diff --git a/CompilerFeatures.md b/CompilerFeatures.md index b7d3ce69..b36a001d 100644 --- a/CompilerFeatures.md +++ b/CompilerFeatures.md @@ -32,6 +32,13 @@ ||EltWise MAX|✔|Not implemented in SW| |**LRN**||✔|Not implemented in SW| +### Frameworks support + +|Framework                              |Status                                      | +|---------|-------| +|Caffe|✔| +|ONNX|Future| + ### Networks verification report |Network                                  |Configuration                          |fp16                   |int8                   | diff --git a/LowPrecision.md b/LowPrecision.md index 70eaa0b5..1665e8b4 100644 --- a/LowPrecision.md +++ b/LowPrecision.md @@ -1,6 +1,6 @@ # Low precision support in NVDLA -Use of low precision such 8-bit, 4-bit, or even lower number of bits for inference is one of the optimization methods used in deep learning. NVDLA architecture includes INT8 (8-bit) precision support. It helps to compress the model reducing memory footprint and to improve performance with a small degradation in accuracy. Using INT8 precision for inference requires quantizing pre-trained models from floating point to INT8 and programming converters in NVDLA for scaling/re-scaling tensors. +Use of low precision such 8-bit, 4-bit, or even lower number of bits for inference is one of the optimization methods used in deep learning. It helps to compress the model reducing memory footprint and to improve performance with a small degradation in accuracy. Using INT8 precision for inference requires quantizing pre-trained models from floating point to INT8 and programming converters in NVDLA for scaling/re-scaling tensors. ### NVDLA architecture for INT8 precision support includes the following: - INT8 input/output data read/write @@ -9,14 +9,24 @@ Use of low precision such 8-bit, 4-bit, or even lower number of bits for inferen - Per-tensor and per-kernel output re-scaling using output converters ### Steps to generate INT8 quantized model: -- Analyze the dynamic range of per-layer tensors and calculate scale factors +- Analyze the dynamic range of per-layer tensors and calculate scale factors using TensorRT +- Import scale factors generated using TensorRT to NVDLA JSON format - Quantize model weights and determine the converter parameters using scale factors -#### Analyze dynamic range of per-layer tensors and calculate scale factors -A calibration tool can collect the dynamic range of the output tensor for each layer over a dataset of images. This dynamic range information can be used to calculate per-tensor scale factors. The NVDLA Compiler uses the following JSON schema to import scale factors. +#### Analyze dynamic range of per-layer tensors and calculate scale factors using TensorRT +A calibration tool collects the dynamic range of the output tensor for each layer over a dataset of images. This dynamic range information can be used to calculate per-tensor scale factors. For NVDLA, calibration interface TensorRT is used to generate scale factors. + +Refer to https://github.com/NVIDIA/TensorRT/tree/release/5.1/samples/opensource/sampleINT8 for sample application which explains how to use TensorRT to generate scales factors. + +Notes: +- Use IInt8EntropyCalibrator2 for calibration. +- Dump calibration scales using writeCalibrationCache() to import it in NVDLA JSON format. +- Do not set --useDLACore for calibration, it is used to generate runtime engine through TensorRT for NVIDIA Xavier platform such NVIDIA Jetson AGX Xavier which has NVDLA integrated. ##### JSON schema for calibration table +The NVDLA Compiler uses the following JSON schema to import scale factors generated from TensorRT. + ``` { "type" : "object", @@ -45,37 +55,18 @@ A calibration tool can collect the dynamic range of the output tensor for each l } ``` -##### Sample calibration table for first few layers of ResNet-50 using symmetric scaling +##### How to covert calibration cache dump to NVDLA JSON format? -``` -{ - "data" : { - "scale": 0.00781453, - "min": 0, - "max": 0, - "offset": 0 - }, - "conv1" : { - "scale": 0.0891214, - "min": 0, - "max": 0, - "offset": 0 - }, - "pool1" : { - "scale": 0.0891214, - "min": 0, - "max": 0, - "offset": 0 - }, - "res2a_branch1" : { - "scale": 0.119546, - "min": 0, - "max": 0, - "offset": 0 - } -} -``` +[calib_txt_to_json.py](https://github.com/nvdla/sw/tree/master/umd/utils/calibdata/calib_txt_to_json.py) can be used to convert calibration scales generated from TensorRT to NVDLA JSON format. #### Quantize model weights and determine the converter parameters -The NVDLA Compiler has the ability to quantize model weights and determine the converter parameters using the scale factors from the calibration table. \ No newline at end of file +The NVDLA Compiler has the ability to quantize model weights and determine the converter parameters using the scale factors from the calibration table. + +Use --calibtable argument to use calibration table generated from TensorRT as input to NVDLA compiler. + +#### Example + +Sample calibration table for [ResNet-50 Caffe model](https://github.com/KaimingHe/deep-residual-networks) is shared at [calib.json](https://github.com/nvdla/sw/tree/master/umd/utils/calibdata/calib.json) + +This calibration table can be used with NVDLA compiler and [ResNet-50 Caffe model](https://github.com/KaimingHe/deep-residual-networks) to run ResNet-50 on NVDLA INT8 configuration diff --git a/Roadmap.md b/Roadmap.md new file mode 100644 index 00000000..108e8371 --- /dev/null +++ b/Roadmap.md @@ -0,0 +1,25 @@ +# NVDLA Roadmap + +### DLA 1.3.0 + +- HW Multibatch for FC layers +- Multi-input network support +- Support different precision and format for input tensors +- Buffer pre-registration +- INT8 deconvolution +- Deconvolution optmization +- Support deconvolution with stride > 32 +- INT8 group convolution +- Depthwise convolution optmization +- ReLU-N +- Machine Translation Layer (MTL) + +Note: APIs are expected to change in DLA1.3.0 + +### Future + +- Memory optimzations +- ONNX +- Sample application for accuracy +- Sample application for object detection + diff --git a/umd/Makefile b/umd/Makefile index f5537ee0..841a7081 100644 --- a/umd/Makefile +++ b/umd/Makefile @@ -1,4 +1,4 @@ -# Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved. +# Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -25,11 +25,19 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -SUBDIRS = core/runtime \ - tests/runtime +COMPILER_SUBDIRS = core/src/compiler \ + apps/compiler -subdirs: - for dir in $(SUBDIRS); do \ +RUNTIME_SUBDIRS = core/src/runtime \ + apps/runtime + +compiler: + for dir in $(COMPILER_SUBDIRS); do \ + $(MAKE) -C $$dir; \ + done + +runtime: + for dir in $(RUNTIME_SUBDIRS); do \ $(MAKE) -C $$dir; \ done diff --git a/umd/apps/compiler/CompileTest.cpp b/umd/apps/compiler/CompileTest.cpp new file mode 100644 index 00000000..6f2ed6f9 --- /dev/null +++ b/umd/apps/compiler/CompileTest.cpp @@ -0,0 +1,121 @@ +/* + * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#include "main.h" + +#include "nvdla/IProfile.h" +#include "nvdla/IProfiler.h" +#include "nvdla/IWisdom.h" +#include "nvdla/INetwork.h" +#include "nvdla/ICompiler.h" +#include "nvdla/ITargetConfig.h" + +#include "ErrorMacros.h" +#include "nvdla_os_inf.h" + +NvDlaError compileProfile(const TestAppArgs* appArgs, TestInfo* i) +{ + NvDlaError e = NvDlaSuccess; + std::string profileName = ""; + std::string targetConfigName = ""; + + NvDlaFileHandle file = 0; + std::string fileName = ""; + NvU8 *buffer = 0; + NvU64 size = 0; + + nvdla::ICompiler* compiler = i->wisdom->getCompiler(); + if (!compiler) + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "wisdom->getCompiler() failed"); + + if (!(appArgs->configtarget != "")) + ORIGINATE_ERROR_FAIL(NvDlaError_NotInitialized, "No target config found to load"); + + targetConfigName = appArgs->configtarget; + + // Determine profile + PROPAGATE_ERROR_FAIL(generateProfile(appArgs, &profileName, i)); + + // Compile + NvDlaDebugPrintf("compiling profile \"%s\"... config \"%s\"...\n", profileName.c_str(), targetConfigName.c_str()); + PROPAGATE_ERROR_FAIL(compiler->compile(profileName.c_str(), targetConfigName.c_str(), &i->compiledLoadable)); + + // Get loadable buffer and dump it into a file + PROPAGATE_ERROR_FAIL(compiler->getLoadableImageSize(profileName.c_str(), + &size)); + if (size == 0) { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, + "Invalid size for a loadable"); + } + + buffer = (NvU8 *) NvDlaAlloc(size); + if (buffer == NULL) { + ORIGINATE_ERROR_FAIL(NvDlaError_InsufficientMemory, + "Failed to allocate buffer for loadable"); + } + PROPAGATE_ERROR_FAIL(compiler->getLoadableImage(profileName.c_str(), + buffer)); + fileName = profileName + ".nvdla"; + PROPAGATE_ERROR_FAIL(NvDlaFopen(fileName.c_str(), NVDLA_OPEN_WRITE, &file)); + PROPAGATE_ERROR_FAIL(NvDlaFwrite(file, buffer, size)); + +fail: + NvDlaFclose(file); + if (buffer != NULL) + NvDlaFree(buffer); + return e; +} + +NvDlaError compile(const TestAppArgs* appArgs, TestInfo* i) +{ + NvDlaError e = NvDlaSuccess; + + i->compiledLoadable = 0; + + NvDlaDebugPrintf("creating new wisdom context...\n"); + i->wisdom = nvdla::createWisdom(); + if (!i->wisdom) + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "createWisdom() failed"); + + NvDlaDebugPrintf("opening wisdom context...\n"); + if (!i->wisdom->open(i->wisdomPath)) + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "wisdom->open() failed to open: \"%s\"", i->wisdomPath.c_str()); + + // Compile + PROPAGATE_ERROR_FAIL(compileProfile(appArgs, i)); + + NvDlaDebugPrintf("closing wisdom context...\n"); + i->wisdom->close(); + +fail: + if (i->wisdom != NULL) { + nvdla::destroyWisdom(i->wisdom); + i->wisdom = NULL; + } + return e; +} diff --git a/umd/apps/compiler/GenerateTest.cpp b/umd/apps/compiler/GenerateTest.cpp new file mode 100644 index 00000000..6e3b109b --- /dev/null +++ b/umd/apps/compiler/GenerateTest.cpp @@ -0,0 +1,358 @@ +/* + * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#include "half.h" +#include "main.h" + +#include "nvdla/ILayer.h" +#include "nvdla/INetwork.h" +#include "nvdla/IProfile.h" +#include "nvdla/IProfiler.h" +#include "rapidjson/document.h" +#include "rapidjson/filereadstream.h" +#include "rapidjson/error/en.h" + +#include "ErrorMacros.h" +#include "nvdla_os_inf.h" + +static NvDlaError beginWithNamedProfile(const TestAppArgs* appArgs, TestInfo* i) +{ + NvDlaError e = NvDlaSuccess; + nvdla::IProfiler* profiler; + nvdla::IProfile* profile; + + profiler = i->wisdom->getProfiler(); + if ( !profiler ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_NotInitialized, "Profiler not initialized"); + } + + profile = profiler->getProfile(appArgs->profileName.c_str()); + if ( !profile ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_NotInitialized, "Profile %s not initialized", appArgs->profileName.c_str()); + } + +fail: + return e; +} + +static NvDlaError beginWithCfgProfile(const TestAppArgs* appArgs, TestInfo* i, nvdla::DataFormat& inDataFormat) +{ + NvDlaError e = NvDlaSuccess; + NvDlaStatType stat; + std::string profileCfgFile; + std::string profileName; + nvdla::IProfiler* profiler; + nvdla::IProfile* profile; + + profiler = i->wisdom->getProfiler(); + if ( !profiler ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_NotInitialized, "Profiler not initialized"); + } + + profileName = appArgs->profileFile; + profileName = profileName.substr(0, profileName.find_last_of(".")); + profile = profiler->getProfile(profileName.c_str()); + if ( !profile ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_NotInitialized, "Profile %s not initialized", profileName.c_str()); + } + + profileCfgFile = i->profilesPath + appArgs->profileFile; + PROPAGATE_ERROR_FAIL(NvDlaStat(profileCfgFile.c_str(), &stat)); + + // first use settings from default profile + profile->initWithDefaultProfile(); + + // then populate the existing profile with params in the cfg file (overriding as necessary) + { + FILE* fp = fopen(profileCfgFile.c_str(), "r"); + char readBuffer[TEST_PARAM_FILE_MAX_SIZE] = {0}; + + rapidjson::Document doc; + rapidjson::FileReadStream inStr(fp, readBuffer, sizeof(readBuffer)); + + doc.ParseStream(inStr); + if (doc.HasParseError()) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "JSON parsing error: %s", GetParseError_En(doc.GetParseError())); + } + + { + nvdla::PixelFormat pf; + + /* Gather compile params of the profile */ + if (doc["profile"].HasMember("compute_precision")) { + rapidjson::Value& compPrecision = doc["profile"]["compute_precision"]; + std::string prec = compPrecision.GetString(); + nvdla::DataType dt = nvdla::DataType::getEnum(prec); + + if (dt.v() == nvdla::DataType::UNKNOWN) { + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Precision %s not supported", prec.c_str()); + } + profile->setComputePrecision(dt); + } + + if (doc["profile"].HasMember("weight_packing")) { + rapidjson::Value& weightPacking = doc["profile"]["weight_packing"]; + std::string wtPacking = weightPacking.GetString(); + + if ( wtPacking == "COMPRESSED" ) + profile->setCanCompressWeights(true); + else + profile->setCanCompressWeights(false); + } + + if (doc["profile"].HasMember("sdp_pdp_on_fly")) { + rapidjson::Value& sdpPdpOnFly = doc["profile"]["sdp_pdp_on_fly"]; + profile->setCanSDPPDPOnFly(sdpPdpOnFly.GetBool()); + } + + if (doc["profile"].HasMember("sdp_merge_math_ops")) { + rapidjson::Value& sdpMergeMathOps = doc["profile"]["sdp_merge_math_ops"]; + profile->setCanSDPMergeMathOps(sdpMergeMathOps.GetBool()); + } + + if (doc["profile"].HasMember("sdp_fuse_subengine_ops")) { + rapidjson::Value& sdpFuseSubEngineOps = doc["profile"]["sdp_fuse_subengine_ops"]; + profile->setCanSDPFuseSubEngineOps(sdpFuseSubEngineOps.GetBool()); + } + + if (doc["profile"].HasMember("can_winograd")) { + rapidjson::Value& canWinograd = doc["profile"]["can_winograd"]; + profile->setCanWinograd(canWinograd.GetBool()); + } + + /* Gather global params of the profile */ + if (doc["profile"]["network_input"].HasMember("format")) { + rapidjson::Value& inFormat = doc["profile"]["network_input"]["format"]; + pf = nvdla::PixelFormat::getEnum(inFormat.GetString()); + if (pf.v() == nvdla::PixelFormat::UNKNOWN) { + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Pixel format %s not supported", inFormat.GetString()); + } + profile->setNetworkInputSurfaceFormat(pf); + if (pf < nvdla::PixelFormat::FEATURE) { + inDataFormat = nvdla::DataFormat::NHWC; + } + else if ((pf == nvdla::PixelFormat::FEATURE) || (pf == nvdla::PixelFormat::FEATURE_X8)) { + inDataFormat = nvdla::DataFormat::NCxHWx; + } + else { + PROPAGATE_ERROR_FAIL(NvDlaError_NotSupported, "Don't support input pixel format: %s", pf.c_str()); + } + } + + if (doc["profile"]["network_input"].HasMember("pixel_offset_x")) { + rapidjson::Value& pxOffX = doc["profile"]["network_input"]["pixel_offset_x"]; + profile->setNetworkInputPixelOffX(pxOffX.GetInt()); + } + if (doc["profile"]["network_input"].HasMember("pixel_offset_y")) { + rapidjson::Value& pxOffY = doc["profile"]["network_input"]["pixel_offset_y"]; + profile->setNetworkInputPixelOffY(pxOffY.GetInt()); + } + + if (doc["profile"]["network_output"].HasMember("format")) { + rapidjson::Value& outFormat = doc["profile"]["network_output"]["format"]; + pf = nvdla::PixelFormat::getEnum(outFormat.GetString()); + if (pf.v() == nvdla::PixelFormat::UNKNOWN) { + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Pixel format %s not supported", outFormat.GetString()); + } + profile->setNetworkOutputSurfaceFormat(pf); + } + } + + fclose(fp); + } + +fail: + return e; +} + +static NvDlaError updateProfileWithCmdLineArgs +( + const TestAppArgs* appArgs, + TestInfo* i, + const char* profileName, + nvdla::DataFormat inDataFormat +) +{ + NvDlaError e = NvDlaSuccess; + nvdla::IProfiler* profiler; + nvdla::IProfile* profile; + + profiler = i->wisdom->getProfiler(); + if (!profiler) + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "wisdom->getProfiler() failed"); + profile = profiler->getProfile(profileName); + if (!profile) + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "profiler->getProfile() failed"); + + PROPAGATE_ERROR_FAIL(profile->setComputePrecision(appArgs->computePrecision)); + PROPAGATE_ERROR_FAIL(profile->setNetworkInputDataFormat(inDataFormat)); + + // determine input surface format + switch(inDataFormat) + { + case nvdla::DataFormat::NHWC: + + if (appArgs->computePrecision == nvdla::DataType::HALF) + { + PROPAGATE_ERROR_FAIL(profile->setNetworkInputSurfaceFormat(nvdla::PixelFormat::A16B16G16R16_F)); + } + else if (appArgs->computePrecision == nvdla::DataType::INT8) + { + PROPAGATE_ERROR_FAIL(profile->setNetworkInputSurfaceFormat(nvdla::PixelFormat::A8B8G8R8)); + } + else + { + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "NHWC and compute precision %u is not yet supported", + appArgs->computePrecision.v()); + } + break; + case nvdla::DataFormat::NCxHWx: + case nvdla::DataFormat::NCHW: + case nvdla::DataFormat::UNKNOWN: // atleast start the test with feature data format + default: + if (std::strcmp(appArgs->configtarget.c_str(), "opendla-small") == 0) + PROPAGATE_ERROR_FAIL(profile->setNetworkInputSurfaceFormat(nvdla::PixelFormat::FEATURE_X8)); + else + PROPAGATE_ERROR_FAIL(profile->setNetworkInputSurfaceFormat(nvdla::PixelFormat::FEATURE)); + } + + // determine int8 cfgs + if (appArgs->computePrecision == nvdla::DataType::INT8) + { + PROPAGATE_ERROR_FAIL(profile->setTensorScalingMode(nvdla::TensorScalingMode::PER_TENSOR)); + switch(appArgs->quantizationMode) + { + case nvdla::QuantizationMode::PER_FILTER: + PROPAGATE_ERROR_FAIL(profile->setQuantizationMode(nvdla::QuantizationMode::PER_FILTER)); + break; + case nvdla::QuantizationMode::PER_KERNEL: + case nvdla::QuantizationMode::NONE: // default to per-kernel; find a way to run int8 tests w/ NONE qtzMode cleanly + default: + PROPAGATE_ERROR_FAIL(profile->setQuantizationMode(nvdla::QuantizationMode::PER_KERNEL)); + } + } + else + { + PROPAGATE_ERROR_FAIL(profile->setTensorScalingMode(nvdla::TensorScalingMode::NONE)); + PROPAGATE_ERROR_FAIL(profile->setQuantizationMode(nvdla::QuantizationMode::NONE)); + } + + PROPAGATE_ERROR_FAIL(profile->setNetworkOutputDataFormat(nvdla::DataFormat::NCxHWx)); + + if (std::strcmp(appArgs->configtarget.c_str(), "opendla-small") == 0) + PROPAGATE_ERROR_FAIL(profile->setNetworkOutputSurfaceFormat(nvdla::PixelFormat::FEATURE_X8)); + else + PROPAGATE_ERROR_FAIL(profile->setNetworkOutputSurfaceFormat(nvdla::PixelFormat::FEATURE)); + + if (appArgs->numBatches > 0) + PROPAGATE_ERROR_FAIL(profile->setMultiBatchSize(appArgs->numBatches)); + +fail: + return e; +} + +NvDlaError generateProfile(const TestAppArgs* appArgs, std::string* profileName, TestInfo* i) +{ + NvDlaError e = NvDlaSuccess; + nvdla::DataFormat inDataFormat = nvdla::DataFormat::UNKNOWN; + + if (appArgs->profileName != "") + { + // init named profile (basic/default/performance) with default params in its constructor and exit + PROPAGATE_ERROR_FAIL(beginWithNamedProfile(appArgs, i)); + *profileName = appArgs->profileName; + } + else if (appArgs->profileFile != "") + { + // if named profile is absent, create a default profile + // and then populate it with params from the cfg file (overriding as necessary) + PROPAGATE_ERROR_FAIL(beginWithCfgProfile(appArgs, i, inDataFormat)); + *profileName = appArgs->profileFile; + *profileName = profileName->substr(0, profileName->find_last_of(".")); + } + else + { + ORIGINATE_ERROR_FAIL(NvDlaError_NotInitialized, "No profile supplied to load"); + } + + // capture profile params from command line (override the existing ones as necessary) + inDataFormat = inDataFormat == nvdla::DataFormat::UNKNOWN ? appArgs->inDataFormat : inDataFormat; + PROPAGATE_ERROR_FAIL(updateProfileWithCmdLineArgs(appArgs, i, profileName->c_str(), inDataFormat)); + +fail: + return e; +} + +NvDlaError generateTensorScales(const TestAppArgs* appArgs, TestInfo* i, nvdla::INetwork* network) +{ + NvDlaError e = NvDlaSuccess; + + std::vector networkLayers = network->getLayers(); + std::vector networkInputs = network->getInputs(); + + std::vector::iterator li = networkLayers.begin(); + std::vector::iterator nii = networkInputs.begin(); + + // set scaling factor for the network input tensors + for (; nii != networkInputs.end(); ++nii) + { + NvF32 scale = 1; + NvF32 min = scale * -127.0f; + NvF32 max = scale * 127.0f; + std::string tName = (*nii)->getName(); + + // set same dynamic range for all channels of the tensor (cIndex = -1) + PROPAGATE_ERROR_FAIL( (*nii)->setChannelDynamicRange(-1, min, max) ); + const_cast(appArgs)->tensorScales.insert(std::pair(tName, scale)); + if (0) + NvDlaDebugPrintf("setting dynamic range of: %s to %f\n", tName.c_str(), scale); + } + + for (; li != networkLayers.end(); ++li) + { + NvF32 scale = 127; + NvF32 min = scale * -127.0f; + NvF32 max = scale * 127.0f; + std::string lName = (*li)->getName(); + nvdla::ITensor* outTensor = (*li)->getOutput(0); + + // set same dynamic range for all channels of the tensor (cIndex = -1) + PROPAGATE_ERROR_FAIL( outTensor->setChannelDynamicRange(-1, min, max) ); + const_cast(appArgs)->tensorScales.insert(std::pair(lName, scale)); + if (0) + NvDlaDebugPrintf("setting dynamic range of: %s to %f\n", lName.c_str(), scale); + } + +fail: + return e; +} diff --git a/umd/apps/compiler/Makefile b/umd/apps/compiler/Makefile new file mode 100644 index 00000000..257380fb --- /dev/null +++ b/umd/apps/compiler/Makefile @@ -0,0 +1,49 @@ +# Copyright (c) 2015-2019, NVIDIA CORPORATION. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * 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. +# * Neither the name of NVIDIA CORPORATION 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 ``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. + +ROOT := $(TOP) + +MODULE := nvdla_compiler + +include $(ROOT)/make/macros.mk + +BUILDOUT ?= $(ROOT)/out/apps/compiler +BUILDDIR := $(BUILDOUT)/$(MODULE) +TEST_BIN := $(BUILDDIR)/$(MODULE) + +INCLUDES := +MODULE_COMPILEFLAGS := -W -Wall -Wno-multichar -Wno-unused-parameter -Wno-unused-function -Werror-implicit-function-declaration +MODULE_CFLAGS := --std=c99 +MODULE_CPPFLAGS := --std=c++11 -fexceptions -fno-rtti + +all:: $(TEST_BIN) + +include rules.mk + +# the logic to compile and link stuff is in here +$(TEST_BIN): $(ALLMODULE_OBJS) $(SHARED_LIBS) + @echo building $(MODULE) $@ + g++ $(ALLMODULE_OBJS) -L$(ROOT)/out/core/src/compiler/libnvdla_compiler libprotobuf.a -lnvdla_compiler -pthread -o $@ libprotobuf.a -Wl,-rpath=. diff --git a/umd/apps/compiler/ParseTest.cpp b/umd/apps/compiler/ParseTest.cpp new file mode 100644 index 00000000..4b5d343c --- /dev/null +++ b/umd/apps/compiler/ParseTest.cpp @@ -0,0 +1,266 @@ +/* + * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#include "main.h" + +#include "nvdla/IWisdom.h" +#include "nvdla/INetwork.h" +#include "nvdla/caffe/ICaffeParser.h" +#include "nvdla/ILayer.h" +#include "nvdla/ICompiler.h" +#include "nvdla/IRuntime.h" +#include "rapidjson/document.h" +#include "rapidjson/filereadstream.h" +#include "rapidjson/error/en.h" + +#include "ErrorMacros.h" +#include "nvdla_os_inf.h" + +#include // system + +NvDlaError parseSetup(const TestAppArgs* appArgs, TestInfo* i) +{ + return NvDlaSuccess; +} + +NvDlaError parseTensorScales(const TestAppArgs* appArgs, TestInfo *i, nvdla::INetwork* network) +{ + NvDlaError e = NvDlaSuccess; + NvDlaStatType stat; + std::string calibTableFile = /*i->calibTablesPath + "/" + */appArgs->calibTable; + + PROPAGATE_ERROR_FAIL(NvDlaStat(calibTableFile.c_str(), &stat)); + + // populate the scaling factor/dynamic range of each of the tensors on the network + { + FILE* fp = fopen(calibTableFile.c_str(), "r"); + char readBuffer[TEST_PARAM_FILE_MAX_SIZE] = {0}; + + rapidjson::Document doc; + rapidjson::FileReadStream inStr(fp, readBuffer, sizeof(readBuffer)); + + doc.ParseStream(inStr); + if (doc.HasParseError()) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "JSON parsing error: %s", GetParseError_En(doc.GetParseError())); + } + + { + std::vector networkLayers = network->getLayers(); + std::vector networkInputs = network->getInputs(); + + std::vector::iterator li = networkLayers.begin(); + std::vector::iterator nii = networkInputs.begin(); + + // set scaling factor for the network input tensors + for (; nii != networkInputs.end(); ++nii) + { + NvF32 scale = 0.0f; + NvF32 min = 0.0f; + NvF32 max = 0.0f; + std::string tName = (*nii)->getName(); + if (doc[tName.c_str()].HasMember("scale")) { + scale = doc[tName.c_str()]["scale"].GetFloat(); + min = scale * -127.0f; + max = scale * 127.0f; + } + else if (doc[tName.c_str()].HasMember("min") && doc[tName.c_str()].HasMember("max")) { + min = doc[tName.c_str()]["min"].GetFloat(); + max = doc[tName.c_str()]["max"].GetFloat(); + } + else { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Atleast 1 of scale or min-max should be specified for %s\n", tName.c_str()); + } + + // set same dynamic range for all channels of the tensor (cIndex = -1) + PROPAGATE_ERROR_FAIL( (*nii)->setChannelDynamicRange(-1, min, max) ); + const_cast(appArgs)->tensorScales.insert(std::pair(tName, scale)); + } + + for (; li != networkLayers.end(); ++li) + { + NvF32 scale = 0.0f; + NvF32 min = 0.0f; + NvF32 max = 0.0f; + std::string lName = (*li)->getName(); + nvdla::ITensor* outTensor = (*li)->getOutput(0); + + if (doc[lName.c_str()].HasMember("scale")) { + scale = doc[lName.c_str()]["scale"].GetFloat(); + min = scale * -127.0f; + max = scale * 127.0f; + } + else if (doc[lName.c_str()].HasMember("min") && doc[lName.c_str()].HasMember("max")) { + min = doc[lName.c_str()]["min"].GetFloat(); + max = doc[lName.c_str()]["max"].GetFloat(); + } + else { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Atleast 1 of scale or min-max should be specified for %s\n", lName.c_str()); + } + + // set same dynamic range for all channels of the tensor (cIndex = -1) + PROPAGATE_ERROR_FAIL( outTensor->setChannelDynamicRange(-1, min, max) ); + const_cast(appArgs)->tensorScales.insert(std::pair(lName, scale)); + } + } + + fclose(fp); + } + +fail: + return e; +} + +static NvDlaError parseCaffeNetwork(const TestAppArgs* appArgs, TestInfo* i) +{ + NVDLA_UNUSED(appArgs); + NvDlaError e = NvDlaSuccess; + + nvdla::INetwork* network = NULL; + + const nvdla::caffe::IBlobNameToTensor* b = NULL; + nvdla::caffe::ICaffeParser* parser = nvdla::caffe::createCaffeParser(); + std::string caffePrototxtFile = appArgs->prototxt.c_str(); + std::string caffeModelFile = appArgs->caffemodel.c_str(); + + network = nvdla::createNetwork(); + if (!network) + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "createNetwork() failed"); + + NvDlaDebugPrintf("parsing caffe network...\n"); + b = parser->parse(caffePrototxtFile.c_str(), caffeModelFile.c_str(), network); + if (!b) + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unable to parse caffemodel: \"%s\"", caffePrototxtFile.c_str()); + + // if the application has so far not marked the network's outputs, allow the parser to do so now + if (network->getNumOutputs() <= 0) + { + int outs = parser->identifyOutputs(network); + NvDlaDebugPrintf("Marking total %d outputs\n", outs); + if (outs <= 0) + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Unable to identify outputs for the network: %d", outs); + } + + if (appArgs->computePrecision == nvdla::DataType::INT8) + { + if (appArgs->calibTable != "") // parse and set tensor scales + { + NvDlaDebugPrintf("parsing calibration table...\n"); + PROPAGATE_ERROR_FAIL(parseTensorScales(appArgs, i, network)); + } + else // use default or const scaling factors + { + NvDlaDebugPrintf("initialize all tensors with const scaling factors of 127...\n"); + PROPAGATE_ERROR_FAIL(generateTensorScales(appArgs, i, network)); + } + } + + NvDlaDebugPrintf("attaching parsed network to the wisdom...\n"); + if (!i->wisdom->setNetworkTransient(network)) + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "wisdom->setNetworkTransient() failed"); + + return NvDlaSuccess; + +fail: + return e; +} + +NvDlaError parse(const TestAppArgs* appArgs, TestInfo* i) +{ + NvDlaError e = NvDlaSuccess; + bool isCaffe = appArgs->caffemodel != ""; + + PROPAGATE_ERROR_FAIL(parseSetup(appArgs, i)); + + NvDlaDebugPrintf("creating new wisdom context...\n"); + i->wisdom = nvdla::createWisdom(); + if (!i->wisdom) + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "createWisdom() failed"); + + NvDlaDebugPrintf("opening wisdom context...\n"); + if (!i->wisdom->open(i->wisdomPath)) + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "wisdom->open() failed to open: \"%s\"", i->wisdomPath.c_str()); + + // Parse + if (isCaffe) + PROPAGATE_ERROR_FAIL(parseCaffeNetwork(appArgs, i)); + else + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unknown network type encountered"); + + /* Destroy network before closing wisdom context */ + nvdla::destroyNetwork(i->wisdom->getNetwork()); + + NvDlaDebugPrintf("closing wisdom context...\n"); + i->wisdom->close(); + +fail: + if (i->wisdom != NULL) { + nvdla::destroyWisdom(i->wisdom); + i->wisdom = NULL; + } + return e; +} + +NvDlaError parseAndCompile(const TestAppArgs* appArgs, TestInfo* i) +{ + NvDlaError e = NvDlaSuccess; + bool isCaffe = appArgs->caffemodel != ""; + + PROPAGATE_ERROR_FAIL(parseSetup(appArgs, i)); + + NvDlaDebugPrintf("creating new wisdom context...\n"); + i->wisdom = nvdla::createWisdom(); + if (!i->wisdom) + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "createWisdom() failed"); + + NvDlaDebugPrintf("opening wisdom context...\n"); + if (!i->wisdom->open(i->wisdomPath)) + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "wisdom->open() failed to open: \"%s\"", i->wisdomPath.c_str()); + + // Parse + if (isCaffe) + PROPAGATE_ERROR_FAIL(parseCaffeNetwork(appArgs, i)); + else + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unknown network type encountered"); + + // Compile + PROPAGATE_ERROR_FAIL(compileProfile(appArgs, i)); + + /* Destroy network before closing wisdom context */ + nvdla::destroyNetwork(i->wisdom->getNetwork()); + + NvDlaDebugPrintf("closing wisdom context...\n"); + i->wisdom->close(); + +fail: + if (i->wisdom != NULL) { + nvdla::destroyWisdom(i->wisdom); + i->wisdom = NULL; + } + return e; +} diff --git a/umd/apps/compiler/libprotobuf.a b/umd/apps/compiler/libprotobuf.a new file mode 100644 index 00000000..493494b5 Binary files /dev/null and b/umd/apps/compiler/libprotobuf.a differ diff --git a/umd/apps/compiler/main.cpp b/umd/apps/compiler/main.cpp new file mode 100644 index 00000000..f011f621 --- /dev/null +++ b/umd/apps/compiler/main.cpp @@ -0,0 +1,394 @@ +/* + * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#include "main.h" +#include "ErrorMacros.h" + +#include "nvdla_os_inf.h" + +#include +#include +#include +#include // system + +#define DEFAULT_BATCH_SIZE 0 +#define DEFAULT_DATA_FMT nvdla::DataFormat::NHWC +#define DEFAULT_QUANT_MODE nvdla::QuantizationMode::NONE +#define TARGET_CONFIG_NAME "nv_full" + +static TestAppArgs defaultTestAppArgs = +{ + /* .project = */ "OpenDLA", + /* .inputPath = */ "./", + /* .inputName = */ "", + /* .outputPath = */ "./", + /* .testname = */ "", + /* .testArgs = */ "", + /* .prototxt = */ "", + /* .caffemodel = */ "", + /* .cachemodel = */ "", + /* .profileName = */ "fast-math", + /* .profileFile = */ "", + /* .configtarget = */ TARGET_CONFIG_NAME, + /* .calibtable = */ "", + /* .quantizationMode = */ DEFAULT_QUANT_MODE, + /* .numBatches = */ DEFAULT_BATCH_SIZE, + /* .inDataFormat = */ DEFAULT_DATA_FMT, + /* .computePrecision = */ nvdla::DataType::INT8 +}; + +NvDlaError testSetup(const TestAppArgs* appArgs, TestInfo* i) +{ + NvDlaError e = NvDlaSuccess; + + std::string wisdomPath = appArgs->outputPath + "wisdom.dir/"; + std::string removeCmd = ""; + std::string imagePath = ""; + NvDlaStatType stat; + int ii = 0; + + // Do input paths exist? + e = NvDlaStat(appArgs->inputPath.c_str(), &stat); + if (e != NvDlaSuccess) + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Input path does not exist: \"%s\"", appArgs->inputPath.c_str()); + + // Do output paths exist? + e = NvDlaStat(appArgs->outputPath.c_str(), &stat); + if (e != NvDlaSuccess) + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Output path does not exist: \"%s\"", appArgs->outputPath.c_str()); + + // Clear wisdomPath if any exist + removeCmd += "rm -rf " + wisdomPath; + ii = std::system(removeCmd.c_str()); // This is pretty awful + if (ii != 0) + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "system command failed: \"%s\"", removeCmd.c_str()); + + PROPAGATE_ERROR_FAIL(NvDlaMkdir(const_cast(wisdomPath.c_str()))); + + // Initialize TestInfo + i->wisdom = NULL; + i->wisdomPath = wisdomPath; + i->pData = NULL; + + return NvDlaSuccess; + +fail: + return e; +} + +NvDlaError launchTest(const TestAppArgs* appArgs) +{ + NvDlaError e = NvDlaSuccess; + TestInfo testInfo; + + PROPAGATE_ERROR_FAIL(testSetup(appArgs, &testInfo)); + + PROPAGATE_ERROR_FAIL(parseAndCompile(appArgs, &testInfo)); + + return NvDlaSuccess; + +fail: + return e; +} + +// This is the entry point to the application +int main(int argc, char* argv[]) +{ + NvDlaError e = NvDlaError_TestApplicationFailed; + TestAppArgs testAppArgs = defaultTestAppArgs; + bool showHelp = false; + bool unknownArg = false; + bool missingArg = false; + bool inputPathSet = false; + bool outputPathSet = false; + bool testnameSet = false; + NVDLA_UNUSED(inputPathSet); + NVDLA_UNUSED(outputPathSet); + NVDLA_UNUSED(testnameSet); + + NvS32 ii = 1; + while(true) + { + if (ii >= argc) + break; + + const char* arg = argv[ii]; + + if (std::strcmp(arg, "-h") == 0) // help + { + // Print usage + showHelp = true; + break; + } + else if (std::strcmp(arg, "-P") == 0) // project + { + if (ii+1 >= argc) + { + // Expecting another parameter + showHelp = true; + break; + } + + testAppArgs.project = std::string(argv[++ii]); + } + else if (std::strcmp(arg, "-i") == 0) // input path + { + if (ii+1 >= argc) + { + // Expecting another parameter + showHelp = true; + break; + } + + testAppArgs.inputPath = std::string(argv[++ii]); + inputPathSet = true; + } + else if (std::strcmp(arg, "-o") == 0) // output path + { + if (ii+1 >= argc) + { + // Expecting another parameter + showHelp = true; + break; + } + + testAppArgs.outputPath = std::string(argv[++ii]); + outputPathSet = true; + } + else if (std::strcmp(arg, "-t") == 0) // testname + { + if (ii+1 >= argc) + { + // Expecting another parameter + showHelp = true; + break; + } + + testAppArgs.testname = std::string(argv[++ii]); + testnameSet = true; + } + else if (std::strcmp(arg, "--prototxt") == 0) // prototxt file + { + if (ii+1 >= argc) + { + // Expecting another parameter + showHelp = true; + break; + } + + testAppArgs.prototxt = std::string(argv[++ii]); + } + else if (std::strcmp(arg, "--caffemodel") == 0) // caffemodel file + { + if (ii+1 >= argc) + { + // Expecting another parameter + showHelp = true; + break; + } + + testAppArgs.caffemodel = std::string(argv[++ii]); + } + else if (strcmp(arg, "--cachemodel") == 0) // cachemodel file + { + if (ii+1 >= argc) + { + // Expecting another parameter + showHelp = true; + break; + } + + testAppArgs.cachemodel = std::string(argv[++ii]); + } + else if (std::strcmp(arg, "--configtarget") == 0) // configtargetname + { + if (ii+1 >= argc) + { + // Expecting another parameter + showHelp = true; + break; + } + + testAppArgs.configtarget = std::string(argv[++ii]); + } + else if (std::strcmp(arg, "--profile") == 0) // named profile + { + if (ii+1 >= argc) + { + // Expecting another parameter + showHelp = true; + break; + } + if (testAppArgs.profileFile != "") { + NvDlaDebugPrintf("Profile already set by --profilecfg argument (%s)\n", testAppArgs.profileFile.c_str()); + showHelp = true; + unknownArg = true; + break; + } + testAppArgs.profileName = std::string(argv[++ii]); + } + else if (std::strcmp(arg, "--profilecfg") == 0) // profile from file + { + if (ii+1 >= argc) + { + // expecting another parameter + showHelp = true; + break; + } + if (testAppArgs.profileName != "") { + NvDlaDebugPrintf("Profile already set by --profile argument (%s)\n", testAppArgs.profileName.c_str()); + showHelp = true; + unknownArg = true; + break; + } + testAppArgs.profileFile = std::string(argv[++ii]); + } + else if (std::strcmp(arg, "--batch") == 0) + { + if (ii+1 >= argc) + { + // Expecting another parameter + showHelp = true; + break; + } + + testAppArgs.numBatches = atoi(argv[++ii]); + } + else if (std::strcmp(arg, "--quantizationMode") == 0) + { + if (ii+1 >= argc) + { + // Expecting another parameter + showHelp = true; + break; + } + + std::string quantMode = std::string(argv[++ii]); + std::transform(quantMode.begin(), quantMode.end(), quantMode.begin(), ::tolower); + + if (quantMode == "per-kernel") + { + testAppArgs.quantizationMode = nvdla::QuantizationMode::PER_KERNEL; + } + else if (quantMode == "per-filter") + { + testAppArgs.quantizationMode = nvdla::QuantizationMode::PER_FILTER; + } + else + { + testAppArgs.quantizationMode = nvdla::QuantizationMode::NONE; + } + } + else if (std::strcmp(arg, "--informat") == 0) + { + if (ii+1 >= argc) + { + // Expecting another parameter + showHelp = true; + break; + } + + std::string inDataFormat = std::string(argv[++ii]); + std::transform(inDataFormat.begin(), inDataFormat.end(), inDataFormat.begin(), ::tolower); + testAppArgs.inDataFormat = inDataFormat == "ncxhwx" ? nvdla::DataFormat::NCxHWx : + inDataFormat == "nchw" ? nvdla::DataFormat::NCHW : + inDataFormat == "nhwc" ? nvdla::DataFormat::NHWC : + nvdla::DataFormat::UNKNOWN; + } + else if (std::strcmp(arg, "--cprecision") == 0) + { + if (ii+1 >= argc) + { + // Expecting another parameter + showHelp = true; + break; + } + + std::string computePrecision = std::string(argv[++ii]); + std::transform(computePrecision.begin(), computePrecision.end(), computePrecision.begin(), ::tolower); + testAppArgs.computePrecision = computePrecision == "fp16" ? nvdla::DataType::HALF : + computePrecision == "int8" ? nvdla::DataType::INT8 : + nvdla::DataType::UNKNOWN; + } + else if (std::strcmp(arg, "--calibtable") == 0) + { + if (ii+1 >= argc) + { + // Expecting another parameter + showHelp = true; + break; + } + + std::string calibTable = std::string(argv[++ii]); + std::transform(calibTable.begin(), calibTable.end(), calibTable.begin(), ::tolower); + testAppArgs.calibTable = calibTable; + } + else // unknown + { + // Unknown argument + NvDlaDebugPrintf("unknown argument: %s\n", arg); + unknownArg = true; + showHelp = true; + break; + } + + ii++; + } + + if (std::strcmp(testAppArgs.prototxt.c_str(), "") == 0 || std::strcmp(testAppArgs.caffemodel.c_str(), "") == 0) { + missingArg = true; + showHelp = true; + } + + if (showHelp) + { + NvDlaDebugPrintf("Usage: %s [-options] --prototxt --caffemodel \n", argv[0]); + NvDlaDebugPrintf("where options include:\n"); + NvDlaDebugPrintf(" -h print this help message\n"); + NvDlaDebugPrintf(" -o outputs wisdom files in 'outputpath' directory\n"); + NvDlaDebugPrintf(" --profile computation profile (default: fast-math)\n"); + NvDlaDebugPrintf(" --cprecision compute precision (default: fp16)\n"); + NvDlaDebugPrintf(" --configtarget target platform (default: nv_full)\n"); + NvDlaDebugPrintf(" --calibtable calibration table for INT8 networks (default: 0.00787)\n"); + NvDlaDebugPrintf(" --quantizationMode quantization mode for INT8 (default: per-kernel)\n"); + NvDlaDebugPrintf(" --batch batch size (default: 1)\n"); + NvDlaDebugPrintf(" --informat input data format (default: nhwc)\n"); + + if (unknownArg) + return EXIT_FAILURE; + else + return EXIT_SUCCESS; + } + + // Launch + e = launchTest(&testAppArgs); + if (e != NvDlaSuccess) + return -1; + else + return 0; +} diff --git a/umd/apps/compiler/main.h b/umd/apps/compiler/main.h new file mode 100644 index 00000000..a6a89a1f --- /dev/null +++ b/umd/apps/compiler/main.h @@ -0,0 +1,165 @@ +/* + * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#include "dlaerror.h" +#include "dlatypes.h" + +#include "nvdla/ILoadable.h" +#include "nvdla/IRuntime.h" +#include "nvdla/ITensor.h" +#include "nvdla/IWisdom.h" +#include "DlaImageUtils.h" + +#include "ErrorMacros.h" + +#include "nvdla_inf.h" + +#include + +#define TEST_PARAM_FILE_MAX_SIZE 65536 + +enum TestImageTypes +{ + IMAGE_TYPE_PGM = 0, + IMAGE_TYPE_JPG = 1, + IMAGE_TYPE_UNKNOWN = 2, +}; + +struct TaskStatus +{ + NvU64 timestamp; + NvU32 status_engine; + NvU16 subframe; + NvU16 status_task; +}; + +struct SubmitContext +{ + NvU32 id; + std::string inputName; + std::map < NvU16, std::vector > inputImages; + std::vector inputBuffers; + std::vector inputTaskStatus; + std::map < NvU16, std::vector > outputImages; + std::vector debugImages; + std::vector debugBuffers; + std::vector outputBuffers; + std::vector outputTaskStatus; +}; + +struct TestAppArgs +{ + std::string project; + std::string inputPath; + std::string inputName; + std::string outputPath; + std::string testname; + std::string testArgs; + std::string prototxt; // This should be folded into testArgs + std::string caffemodel; // This should be folded into testArgs + std::string cachemodel; // This should be folded into testArgs + + std::string profileName; // ok here? + std::string profileFile; + std::string configtarget; + std::string calibTable; + nvdla::QuantizationMode quantizationMode; + + NvU16 numBatches; + nvdla::DataFormat inDataFormat; + nvdla::DataType computePrecision; + + std::map tensorScales; +}; + +struct TestInfo +{ + // common + nvdla::IWisdom* wisdom; + std::string wisdomPath; + + // parse + std::string modelsPath; + std::string profilesPath; + std::string calibTablesPath; + + // runtime + nvdla::IRuntime* runtime; + nvdla::ILoadable* compiledLoadable; + NvU8 *pData; + std::string inputImagesPath; + std::string inputLoadablePath; + std::map inputImages; + std::map inputBuffers; + std::map outputImages; + std::map outputBuffers; + std::vector submits; + NvU32 timeout; + NvU16 numBatches; // runtime's point-of-view + NvU32 numSubmits; +}; + +NvDlaError launchTest(const TestAppArgs* appArgs); +NvDlaError testSetup(const TestAppArgs* appArgs, TestInfo* i); + +// Tests +NvDlaError generate(const TestAppArgs* appArgs, TestInfo* i); +NvDlaError generateAndCompile(const TestAppArgs* appArgs, TestInfo* i); +NvDlaError generateCompileAndRun(const TestAppArgs* appArgs, TestInfo* i); +NvDlaError parse(const TestAppArgs* appArgs, TestInfo* i); +NvDlaError parseAndCompile(const TestAppArgs* appArgs, TestInfo* i); +NvDlaError parseCompileAndRun(const TestAppArgs* appArgs, TestInfo* i); +NvDlaError compile(const TestAppArgs* appArgs, TestInfo* i); +NvDlaError run(const TestAppArgs* appArgs, TestInfo* i); + +// Parse +NvDlaError parseSetup(const TestAppArgs* appArgs, TestInfo* i); +NvDlaError parseTensorScales(const TestAppArgs* appArgs, TestInfo *i, nvdla::INetwork* network); + +// Generate +NvDlaError generateProfile(const TestAppArgs* appArgs, std::string* profileName, TestInfo* i); +NvDlaError generateTensorScales(const TestAppArgs* appArgs, TestInfo* i, nvdla::INetwork* network); + +// Compile +NvDlaError compileProfile(const TestAppArgs* appArgs, TestInfo* i); + +// Runtime +NvDlaError runSetup(const TestAppArgs* appArgs, TestInfo* i); +NvDlaError runTeardown(const TestAppArgs* appArgs, TestInfo* i); +NvDlaError readLoadable(const TestAppArgs* appArgs, TestInfo* i); +NvDlaError loadLoadable(const TestAppArgs* appArgs, TestInfo* i); +NvDlaError setupBuffers(const TestAppArgs* appArgs, TestInfo* i, SubmitContext* sc); +NvDlaError releaseBuffers(const TestAppArgs* appArgs, TestInfo* i, SubmitContext* sc); +NvDlaError runImages(const TestAppArgs* appArgs, TestInfo* i, SubmitContext* sc); + +// TestUtils +NvDlaError allocateDlaBuffer(void ** handle, void **pData, NvU32 size, NvDlaHeap heap); +NvDlaError freeDlaBuffer(void * handle, void *pData); +NvDlaError DIMG2DlaBuffer(const NvDlaImage* image, void ** phBuffer); +NvDlaError DlaBuffer2DIMG(void * hBuffer, NvDlaImage* image); +NvDlaError QINT8DIMG2FP16DIMG(const TestAppArgs* appArgs, const TestInfo* i,NvDlaImage* int8Dimg, NvDlaImage* fp16Dimg, NvF32 outSF); diff --git a/umd/apps/compiler/rules.mk b/umd/apps/compiler/rules.mk new file mode 100644 index 00000000..a7fe1529 --- /dev/null +++ b/umd/apps/compiler/rules.mk @@ -0,0 +1,60 @@ +# Copyright (c) 2015-2019, NVIDIA CORPORATION. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * 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. +# * Neither the name of NVIDIA CORPORATION 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 ``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. + +# +# nvdla_compiler +# + +LOCAL_DIR := $(GET_LOCAL_DIR) + +MODULE_CC := gcc +MODULE_CPP := g++ +MODULE_LD := ld + +NVDLA_SRC_FILES := \ + main.cpp \ + CompileTest.cpp \ + GenerateTest.cpp \ + ParseTest.cpp \ + +INCLUDES += \ + -I$(ROOT)/include \ + -I$(ROOT)/port/linux \ + -I$(ROOT)/external/include \ + -I$(ROOT)/core/include \ + -I$(LOCAL_DIR) + +MODULE_CPPFLAGS += \ + -DNVDLA_UTILS_ERROR_TAG="\"DLA\"" +MODULE_CFLAGS += \ + -DNVDLA_UTILS_ERROR_TAG="\"DLA\"" + +SHARED_LIBS := \ + $(ROOT)/out/core/src/compiler/libnvdla_compiler/libnvdla_compiler.so + +MODULE_SRCS := $(NVDLA_SRC_FILES) + +include $(ROOT)/make/module.mk diff --git a/umd/tests/runtime/DlaImage.cpp b/umd/apps/runtime/DlaImage.cpp similarity index 100% rename from umd/tests/runtime/DlaImage.cpp rename to umd/apps/runtime/DlaImage.cpp diff --git a/umd/tests/runtime/DlaImage.h b/umd/apps/runtime/DlaImage.h similarity index 100% rename from umd/tests/runtime/DlaImage.h rename to umd/apps/runtime/DlaImage.h diff --git a/umd/tests/runtime/DlaImageUtils.cpp b/umd/apps/runtime/DlaImageUtils.cpp similarity index 100% rename from umd/tests/runtime/DlaImageUtils.cpp rename to umd/apps/runtime/DlaImageUtils.cpp diff --git a/umd/tests/runtime/DlaImageUtils.h b/umd/apps/runtime/DlaImageUtils.h similarity index 100% rename from umd/tests/runtime/DlaImageUtils.h rename to umd/apps/runtime/DlaImageUtils.h diff --git a/umd/tests/runtime/Makefile b/umd/apps/runtime/Makefile similarity index 94% rename from umd/tests/runtime/Makefile rename to umd/apps/runtime/Makefile index 6d9ba944..af6e6e0a 100644 --- a/umd/tests/runtime/Makefile +++ b/umd/apps/runtime/Makefile @@ -36,7 +36,7 @@ MODULE := nvdla_runtime include $(ROOT)/make/macros.mk -BUILDOUT ?= $(ROOT)/out/runtime +BUILDOUT ?= $(ROOT)/out/apps/runtime BUILDDIR := $(BUILDOUT)/$(MODULE) TEST_BIN := $(BUILDDIR)/$(MODULE) @@ -52,4 +52,4 @@ include rules.mk # the logic to compile and link stuff is in here $(TEST_BIN): $(ALLMODULE_OBJS) $(SHARED_LIBS) @echo building $(MODULE) $@ - $(TOOLCHAIN_PREFIX)g++ $(ALLMODULE_OBJS) -pthread -L$(ROOT)/external/ -ljpeg -L$(BUILDOUT)/libnvdla_runtime -lnvdla_runtime -o $@ -Wl,-rpath=. + $(TOOLCHAIN_PREFIX)g++ $(ALLMODULE_OBJS) -pthread -L$(ROOT)/external/ -ljpeg -L$(ROOT)/out/core/src/runtime/libnvdla_runtime -lnvdla_runtime -o $@ -Wl,-rpath=. diff --git a/umd/tests/runtime/RuntimeTest.cpp b/umd/apps/runtime/RuntimeTest.cpp similarity index 95% rename from umd/tests/runtime/RuntimeTest.cpp rename to umd/apps/runtime/RuntimeTest.cpp index 22563f22..b17bd4d2 100644 --- a/umd/tests/runtime/RuntimeTest.cpp +++ b/umd/apps/runtime/RuntimeTest.cpp @@ -30,6 +30,10 @@ #include "ErrorMacros.h" #include "RuntimeTest.h" +#include +#include +#include + #include "nvdla/IRuntime.h" #include "half.h" @@ -99,10 +103,7 @@ static NvDlaError copyImageToInputTensor PROPAGATE_ERROR(createImageCopy(appArgs, R8Image, tensorDesc, tensorImage)); - if (0) - { - tensorImage->printBuffer(true); /* Print the input Buffer */ - } + //tensorImage->printBuffer(true); /* Print the input Buffer */ PROPAGATE_ERROR(DIMG2DlaBuffer(tensorImage, pImgBuffer)); @@ -366,11 +367,19 @@ void unloadLoadable(const TestAppArgs* appArgs, TestInfo *i) } } +double get_elapsed_time(struct timespec *before, struct timespec *after) +{ + double deltat_s = (after->tv_sec - before->tv_sec) * 1000000; + double deltat_ns = (after->tv_nsec - before->tv_nsec) / 1000; + return deltat_s + deltat_ns; +} + NvDlaError runTest(const TestAppArgs* appArgs, TestInfo* i) { NvDlaError e = NvDlaSuccess; void* pInputBuffer = NULL; void* pOutputBuffer = NULL; + struct timespec before, after; nvdla::IRuntime* runtime = i->runtime; if (!runtime) @@ -383,15 +392,16 @@ NvDlaError runTest(const TestAppArgs* appArgs, TestInfo* i) PROPAGATE_ERROR_FAIL(setupOutputBuffer(appArgs, i, &pOutputBuffer)); NvDlaDebugPrintf("submitting tasks...\n"); + clock_gettime(CLOCK_MONOTONIC, &before); if (!runtime->submit()) ORIGINATE_ERROR(NvDlaError_BadParameter, "runtime->submit() failed"); + clock_gettime(CLOCK_MONOTONIC, &after); + NvDlaDebugPrintf("execution time = %f s\n", get_elapsed_time(&before,&after)); + PROPAGATE_ERROR_FAIL(DlaBuffer2DIMG(&pOutputBuffer, i->outputImage)); - if (0) - { - i->outputImage->printBuffer(true); - } + //i->outputImage->printBuffer(true); /* Print the output buffer */ /* Dump output dimg to a file */ PROPAGATE_ERROR_FAIL(DIMG2DIMGFile(i->outputImage, diff --git a/umd/tests/runtime/RuntimeTest.h b/umd/apps/runtime/RuntimeTest.h similarity index 100% rename from umd/tests/runtime/RuntimeTest.h rename to umd/apps/runtime/RuntimeTest.h diff --git a/umd/tests/runtime/Server.cpp b/umd/apps/runtime/Server.cpp similarity index 100% rename from umd/tests/runtime/Server.cpp rename to umd/apps/runtime/Server.cpp diff --git a/umd/tests/runtime/Server.h b/umd/apps/runtime/Server.h similarity index 100% rename from umd/tests/runtime/Server.h rename to umd/apps/runtime/Server.h diff --git a/umd/tests/runtime/TestUtils.cpp b/umd/apps/runtime/TestUtils.cpp similarity index 100% rename from umd/tests/runtime/TestUtils.cpp rename to umd/apps/runtime/TestUtils.cpp diff --git a/umd/tests/runtime/main.cpp b/umd/apps/runtime/main.cpp similarity index 100% rename from umd/tests/runtime/main.cpp rename to umd/apps/runtime/main.cpp diff --git a/umd/tests/runtime/main.h b/umd/apps/runtime/main.h similarity index 100% rename from umd/tests/runtime/main.h rename to umd/apps/runtime/main.h diff --git a/umd/tests/runtime/rules.mk b/umd/apps/runtime/rules.mk similarity index 92% rename from umd/tests/runtime/rules.mk rename to umd/apps/runtime/rules.mk index b840dfb1..595be015 100644 --- a/umd/tests/runtime/rules.mk +++ b/umd/apps/runtime/rules.mk @@ -26,6 +26,10 @@ LOCAL_DIR := $(GET_LOCAL_DIR) +MODULE_CC := $(TOOLCHAIN_PREFIX)gcc +MODULE_CPP := $(TOOLCHAIN_PREFIX)g++ +MODULE_LD := $(TOOLCHAIN_PREFIX)ld + NVDLA_SRC_FILES := \ DlaImage.cpp \ DlaImageUtils.cpp \ @@ -46,7 +50,7 @@ MODULE_CPPFLAGS := -DNVDLA_UTILS_ERROR_TAG="\"DLA_TEST\"" MODULE_CFLAGS := -DNVDLA_UTILS_ERROR_TAG="\"DLA_TEST\"" SHARED_LIBS := \ - $(ROOT)/out/runtime/libnvdla_runtime/libnvdla_runtime.so + $(ROOT)/out/core/src/runtime/libnvdla_runtime/libnvdla_runtime.so MODULE_SRCS := $(NVDLA_SRC_FILES) diff --git a/umd/core/include/BitBinaryTree.h b/umd/core/include/BitBinaryTree.h new file mode 100644 index 00000000..2de8181d --- /dev/null +++ b/umd/core/include/BitBinaryTree.h @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#ifndef NVDLA_UTILS_BIT_BINARY_TREE_H +#define NVDLA_UTILS_BIT_BINARY_TREE_H + +#include +#include "dlaerror.h" +#include "dlatypes.h" + +typedef struct NvDlaBitBinaryTreeClass NvDlaBitBinaryTreeClass; +typedef struct NvDlaBitBinaryTreeInst NvDlaBitBinaryTreeInst; + +struct NvDlaBitBinaryTreeClass +{ + // static methods + NvDlaError (*construct)(NvDlaBitBinaryTreeInst* self, NvU8 numLevels); + NvDlaError (*destruct)(NvDlaBitBinaryTreeInst* self); + + bool (*get)(const NvDlaBitBinaryTreeInst* self, NvU8 level, NvU32 index); + void (*set)(NvDlaBitBinaryTreeInst* self, NvU8 level, NvU32 index, bool value); + bool (*flip)(NvDlaBitBinaryTreeInst* self, NvU8 level, NvU32 index); + NvDlaError (*print)(const NvDlaBitBinaryTreeInst* self); +}; + +struct NvDlaBitBinaryTreeInst +{ + // instance members + NvU8 numLevels; + NvU8* treeStorage; +}; + + +extern const NvDlaBitBinaryTreeClass NvDlaBitBinaryTree; + +#endif // NVDLA_UTILS_BIT_BINARY_TREE_H diff --git a/umd/core/include/BuddyAlloc.h b/umd/core/include/BuddyAlloc.h new file mode 100644 index 00000000..b95d09b1 --- /dev/null +++ b/umd/core/include/BuddyAlloc.h @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#ifndef NVDLA_UTILS_BUDDY_ALLOC_H +#define NVDLA_UTILS_BUDDY_ALLOC_H + +#include +#include "BitBinaryTree.h" + +typedef struct NvDlaFreeBlock NvDlaFreeBlock; + +struct NvDlaFreeBlock +{ + NvDlaFreeBlock* prev; + NvDlaFreeBlock* next; +}; + +#define NVDLA_UTILS_BUDDY_ALLOC_MAX_NUM_BLOCKTYPE 32 + +typedef struct NvDlaBuddyAllocClass NvDlaBuddyAllocClass; +typedef struct NvDlaBuddyAllocInst NvDlaBuddyAllocInst; + +struct NvDlaBuddyAllocClass +{ + // static methods + NvDlaError (*construct)(NvDlaBuddyAllocInst* self, + const void* poolData, NvU32 poolSize, + NvU8 minElementSizeLog2); + NvDlaError (*destruct)(NvDlaBuddyAllocInst* self); + + void* (*allocate)(NvDlaBuddyAllocInst* self, NvU32 size); + NvDlaError (*deallocate)(NvDlaBuddyAllocInst* self, void* ptr); +}; + +struct NvDlaBuddyAllocInst +{ + // instance members + const void* poolData; + NvU32 poolSize; + NvU8 maxElementSizeLog2; + NvU8 minElementSizeLog2; + + NvDlaFreeBlock* freeHead[NVDLA_UTILS_BUDDY_ALLOC_MAX_NUM_BLOCKTYPE]; + + NvDlaBitBinaryTreeInst* fxfData; + NvDlaBitBinaryTreeInst* splitData; + + // debug info + //NvDlaBitBinaryTree* allocData; +}; + + +extern const NvDlaBuddyAllocClass NvDlaBuddyAlloc; + +#endif // NVDLA_UTILS_BUDDY_ALLOC_H diff --git a/umd/core/include/DlaImage.h b/umd/core/include/DlaImage.h new file mode 100644 index 00000000..d715fccc --- /dev/null +++ b/umd/core/include/DlaImage.h @@ -0,0 +1,133 @@ +/* + * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#ifndef NVDLA_UTILS_DLAIMAGE_H +#define NVDLA_UTILS_DLAIMAGE_H + +#include +#include "dlaerror.h" +#include "dlatypes.h" + +#include + +class NvDlaImage +{ +public: + typedef enum _PixelFormat + { + T_R8 = 0, + T_R8_I = 1, + T_R10 = 2, + T_R12 = 3, + T_R16 = 4, + T_R16_I = 5, + T_R16_F = 6, + T_A16B16G16R16 = 7, + T_A16B16G16R16_F = 8, + T_X16B16G16R16 = 9, + T_A16Y16U16V16 = 10, + T_A16Y16U16V16_F = 11, + T_V16U16Y16A16 = 12, + T_A8B8G8R8 = 13, + T_A8R8G8B8 = 14, + T_B8G8R8A8 = 15, + T_R8G8B8A8 = 16, + T_X8B8G8R8 = 17, + T_X8R8G8B8 = 18, + T_B8G8R8X8 = 19, + T_R8G8B8X8 = 20, + T_A2B10G10R10 = 21, + T_A2R10G10B10 = 22, + T_B10G10R10A2 = 23, + T_R10G10B10A2 = 24, + T_A2Y10U10V10 = 25, + T_V10U10Y10A2 = 26, + T_A8Y8U8V8 = 27, + T_V8U8Y8A8 = 28, + T_Y8___U8V8_N444 = 29, + T_Y8___V8U8_N444 = 30, + T_Y10___U10V10_N444 = 31, + T_Y10___V10U10_N444 = 32, + T_Y12___U12V12_N444 = 33, + T_Y12___V12U12_N444 = 34, + T_Y16___U16V16_N444 = 35, + T_Y16___V16U16_N444 = 36, + + D_F8_CHW_I = 37, + D_F16_CHW_I = 38, + D_F16_CHW_F = 39, + + D_F8_CxHWx_x32_I = 40, + D_F8_CxHWx_x8_I = 41, + D_F16_CxHWx_x16_I = 42, + D_F16_CxHWx_x16_F = 43, + + D_F32_CHW_F = 44, + D_F32_CxHWx_x8_F = 45, + + T_R8G8B8 = 46, + T_B8G8R8 = 47, + } PixelFormat; + + typedef enum _PixelFormatType + { + UINT = 0, + INT = 1, + IEEEFP = 2, + UNKNOWN = 3 + } PixelFormatType; + + static const NvU32 ms_version; + + struct Metadata + { + PixelFormat surfaceFormat; + NvU32 width; + NvU32 height; + NvU32 channel; + + NvU32 lineStride; + NvU32 surfaceStride; + NvU32 size; + } m_meta; + + void* m_pData; + + NvS8 getBpe() const; + PixelFormatType getPixelFormatType() const; + NvS32 getAddrOffset(NvU32 w, NvU32 h, NvU32 c) const; + NvDlaError printInfo() const; + NvDlaError printBuffer(bool showBorders) const; + + NvDlaError serialize(std::stringstream& sstream, bool stableHash) const; + NvDlaError deserialize(std::stringstream& sstream); + NvDlaError packData(std::stringstream& sstream, bool stableHash) const; + NvDlaError unpackData(std::stringstream& sstream); +}; + +#endif // NVDLA_UTILS_DLAIMAGE_H diff --git a/umd/core/include/DlaImageUtils.h b/umd/core/include/DlaImageUtils.h new file mode 100644 index 00000000..5e34d3fa --- /dev/null +++ b/umd/core/include/DlaImageUtils.h @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#ifndef NVDLA_UTILS_DLAIMAGE_UTILS_H +#define NVDLA_UTILS_DLAIMAGE_UTILS_H + +#include +#include "dlaerror.h" +#include "dlatypes.h" + +#include "DlaImage.h" + +NvDlaError PGM2DIMG(std::string inputfilename, NvDlaImage* output, nvdla::IRuntime::NvDlaTensor *tensorDesc); +NvDlaError DIMG2Tiff(const NvDlaImage* input, std::string outputfilename); +NvDlaError DIMG2DIMGFile(const NvDlaImage* input, std::string outputfilename, bool stableHash); +NvDlaError DIMGFile2DIMG(std::string inputfilename, NvDlaImage* output); +NvDlaError JPEG2DIMG(std::string inputfilename, NvDlaImage* output, nvdla::IRuntime::NvDlaTensor *tensorDesc); + +#if defined(NVDLA_UTILS_CAFFE) || defined(NVDLA_UTILS_NVCAFFE) +#include +#endif + +#if defined(NVDLA_UTILS_CAFFE) +template +NvDlaError CaffeBlob2DIMG(const caffe::Blob* blob, NvDlaImage* output); +#endif + +#if defined(NVDLA_UTILS_NVCAFFE) +NvDlaError NvCaffeBlob2DIMG(const caffe::Blob* blob, NvDlaImage* output); +#endif + +#endif // NVDLA_UTILS_DLAIMAGE_UTILS_H diff --git a/umd/include/ErrorMacros.h b/umd/core/include/ErrorMacros.h similarity index 99% rename from umd/include/ErrorMacros.h rename to umd/core/include/ErrorMacros.h index 7a1aa3a5..14fe9cae 100644 --- a/umd/include/ErrorMacros.h +++ b/umd/core/include/ErrorMacros.h @@ -57,7 +57,7 @@ const char* NvDlaUtilsGetNvErrorString(NvDlaError e); void NvDlaUtilsLogError(const char* tag, const char* path, NvDlaError e, const char* file, const char* func, uint32_t line, bool propagating, const char* format, ...); #if !defined (NVDLA_UTILS_ERROR_PATH) -#define NVDLA_UTILS_ERROR_PATH "nvidia/tegra/cv/dla/" +#define NVDLA_UTILS_ERROR_PATH "dla" #endif #define NVDLA_UTILS_LOG_ERROR(_err, _file, _func, _line, _propagating, _format, ...) \ diff --git a/umd/include/dlaerror.h b/umd/core/include/dlaerror.h similarity index 100% rename from umd/include/dlaerror.h rename to umd/core/include/dlaerror.h diff --git a/umd/include/dlatypes.h b/umd/core/include/dlatypes.h similarity index 100% rename from umd/include/dlatypes.h rename to umd/core/include/dlatypes.h diff --git a/umd/core/include/nvdla/ICompiler.h b/umd/core/include/nvdla/ICompiler.h new file mode 100644 index 00000000..b49df51f --- /dev/null +++ b/umd/core/include/nvdla/ICompiler.h @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#ifndef NVDLA_I_COMPILER_H +#define NVDLA_I_COMPILER_H + +namespace nvdla +{ + +class IWisdom; +class ILoadable; +class ICompiler +{ +public: + virtual IWisdom *wisdom() const = 0; + + virtual NvDlaError getDataType(DataType::UnderlyingType *d) const = 0; + virtual NvDlaError compile(const char *profile_name, const char *target_config_name, ILoadable **l) = 0; // "" := default + virtual NvDlaError getLoadableImage(const char *profile_name, NvU8 *flatbuf) = 0; + virtual NvDlaError getLoadableImageSize(const char *profile_name, NvU64 *size) = 0; + + virtual NvDlaError compileCheck(const char *profile_name, const char *target_config_name) = 0; + +protected: + ICompiler(); + virtual ~ICompiler(); +}; + + +// ICompiler *createCompiler(); + +} // nvdla + + + +#endif // NVDLA_I_COMPILER_H diff --git a/umd/core/include/nvdla/ILayer.h b/umd/core/include/nvdla/ILayer.h new file mode 100644 index 00000000..38b2aa13 --- /dev/null +++ b/umd/core/include/nvdla/ILayer.h @@ -0,0 +1,508 @@ +/* + * Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#ifndef NVDLA_I_LAYER_H +#define NVDLA_I_LAYER_H + +#include "nvdla/IType.h" + + +namespace nvdla +{ + +class INetwork; +class ITensor; + +class ILayer +{ +public: + + virtual Dims4 getOutputDimensions() const = 0; + + virtual void setName(const char* name) = 0; + virtual const char* getName() const = 0; + + virtual LayerType getType() const = 0; + + virtual int getNumInputs() const = 0; + virtual ITensor* getInput(int i) const = 0; + + virtual int getNumOutputs() const = 0; + virtual ITensor* getOutput(int i) const = 0; + + virtual void setKernelSize(Dims2 kernelSize) = 0; + virtual Dims2 getKernelSize() const = 0; + + virtual void setNumOutputMaps(int numOutputMaps) = 0; + virtual int getNumOutputMaps() const = 0; + + virtual void setStride(Dims2 stride) = 0; + virtual Dims2 getStride() const = 0; + + virtual Dims2 getDilation() const = 0; + virtual void setDilation(Dims2) = 0; + + virtual int getPaddingValue() const = 0; + virtual void setPaddingValue(int) = 0; + + virtual Dims2 getBottomRightPadding() const = 0; + virtual void setBottomRightPadding(Dims2) = 0; + + virtual Dims2 getTopLeftPadding() const = 0; + virtual void setTopLeftPadding(Dims2) = 0; + + virtual void setNumGroups(int numGroups) = 0; + virtual int getNumGroups() const = 0; + + virtual void setKernelWeights(Weights weights) = 0; + virtual Weights getKernelWeights() const = 0; + virtual bool hasKernelWeights() = 0; + + virtual void setBiasWeights(Weights weights) = 0; + virtual Weights getBiasWeights() const = 0; + virtual bool hasBiasWeights() = 0; + + virtual NvDlaError supportsPrecision(nvdla::DataType compPrec) = 0; + virtual NvDlaError setComputePrecision(nvdla::DataType compPrec) = 0; + +protected: + ILayer(); + virtual ~ILayer(); +}; + + + +class IConvolutionLayer : public virtual ILayer +{ +public: + + class Parameters + { + public: + Dims2 kernelSize; + Dims2 topLeftPadding; + Dims2 bottomRightPadding; + Dims2 stride; + Dims2 dilation; + int numOutputMaps; + int numGroups; + Weights kernelWeights; + Weights biasWeights; + int paddingValue; + BiasMode biasMode; + }; + + virtual Dims2 getKernelSize() const = 0; + virtual void setKernelSize(Dims2) = 0; + + virtual int getPaddingValue() const = 0; + virtual void setPaddingValue(int) = 0; + + virtual Dims2 getBottomRightPadding() const = 0; + virtual void setBottomRightPadding(Dims2) = 0; + + virtual Dims2 getTopLeftPadding() const = 0; + virtual void setTopLeftPadding(Dims2) = 0; + + virtual Dims2 getStride() const = 0; + virtual void setStride(Dims2) = 0; + + virtual Dims2 getDilation() const = 0; + virtual void setDilation(Dims2) = 0; + + virtual int getNumGroups() const = 0; + virtual void setNumGroups(int) = 0; + + virtual int getNumOutputMaps() const = 0; + virtual void setNumOutputMaps(int) = 0; + + virtual Weights getKernelWeights() const = 0; + virtual void setKernelWeights(Weights) = 0; + virtual bool hasKernelWeights() = 0; + + virtual Weights getBiasWeights() const = 0; + virtual void setBiasWeights(Weights) = 0; + virtual bool hasBiasWeights() = 0; + + virtual BiasMode getBiasMode() const = 0; + virtual void setBiasMode(BiasMode) = 0; + + // virtual Dims4 getOutputDimensions() const = 0; + virtual const Parameters& getParams() const = 0; + +protected: + virtual ~IConvolutionLayer(); +}; + +class IFullyConnectedLayer : public virtual ILayer +{ +public: + + class Parameters + { + public: + int numOutputChannels; + Dims2 kernelSize; + Weights kernelWeights; + Weights biasWeights; + BiasMode biasMode; + }; + + + virtual int getNumOutputChannels() const = 0; + virtual void setNumOutputChannels(int) = 0; + + virtual Weights getKernelWeights() const = 0; + virtual void setKernelWeights(Weights) = 0; + virtual bool hasKernelWeights() = 0; + + virtual Weights getBiasWeights() const = 0; + virtual void setBiasWeights(Weights) = 0; + virtual bool hasBiasWeights() = 0; + + virtual BiasMode getBiasMode() const = 0; + virtual void setBiasMode(BiasMode) = 0; + + // virtual Dims4 getOutputDimensions() const = 0; + virtual const Parameters& getParams() const = 0; +protected: + virtual ~IFullyConnectedLayer(); +}; + +class IActivationLayer : public virtual ILayer +{ +public: + class Parameters + { + public: + ActivationType activationType; + }; + + virtual ActivationType getActivationType() const = 0; + virtual void setActivationType(ActivationType) = 0; + + // virtual Dims4 getOutputDimensions() const = 0; + virtual const Parameters& getParams() const = 0; +protected: + virtual ~IActivationLayer(); +}; + +class IPoolingLayer : public virtual ILayer +{ +public: + + class Parameters + { + public: + PoolingType poolingType; + Dims2 windowSize; + Dims2 topLeftPadding; + Dims2 bottomRightPadding; + Dims2 stride; + }; + + virtual PoolingType getPoolingType() const = 0; + virtual void setPoolingType(PoolingType) = 0; + + virtual Dims2 getWindowSize() const = 0; + virtual void setWindowSize(Dims2) = 0; + + virtual Dims2 getBottomRightPadding() const = 0; + virtual void setBottomRightPadding(Dims2) = 0; + + virtual Dims2 getTopLeftPadding() const = 0; + virtual void setTopLeftPadding(Dims2) = 0; + + virtual Dims2 getStride() const = 0; + virtual void setStride(Dims2) = 0; + + // virtual Dims4 getOutputDimensions() const = 0; + virtual const Parameters& getParams() const = 0; + +protected: + virtual ~IPoolingLayer(); +}; + + +class ILRNLayer : public virtual ILayer +{ +public: + + + class Parameters + { + public: + + int windowSize; + float alpha; + float beta; + float k; + + static inline int minWindowSize() { return 1; } + static inline int maxWindowSize() { return 16; } + static inline float maxAbsAlpha() { return 1e20f; } + static inline float minBeta() { return 0.01f; } + static inline float maxBeta() { return 1e5f; } + static inline float minK() { return 1e-5f; } + static inline float maxK() { return 1e10f; } + }; + + virtual float getAlpha() const = 0; + virtual void setAlpha(float) = 0; + + virtual float getBeta() const = 0; + virtual void setBeta(float) = 0; + + virtual float getK() const = 0; + virtual void setK(float) = 0; + + virtual int getWindowSize() const = 0; + virtual void setWindowSize(int) = 0; + + // virtual Dims4 getOutputDimensions() const = 0; + //virtual bool validateParams(Parameters *) const = 0; + virtual const Parameters& getParams() const = 0; + +protected: + virtual ~ILRNLayer(); +}; + + +class IScaleLayer : public virtual ILayer +{ +public: + + class Parameters + { + public: + ScaleMode mode; + Weights shift; + Weights scale; + Weights power; + }; + + virtual Weights getScale() const = 0; + virtual void setScale(Weights) = 0; + + virtual Weights getShift() const = 0; + virtual void setShift(Weights) = 0; + + virtual Weights getPower() const = 0; + virtual void setPower(Weights) = 0; + + virtual ScaleMode getMode() const = 0; + virtual void setMode(ScaleMode) = 0; + + // virtual Dims4 getOutputDimensions() const = 0; + virtual const Parameters& getParams() const = 0; +protected: + virtual ~IScaleLayer(); +}; + +class IBatchNormLayer : public virtual ILayer +{ +public: + + class Parameters + { + public: + BatchNormMode mode; + Weights mean; + Weights variance; + float epsilon; + }; + + virtual float getEpsilon() const = 0; + virtual void setEpsilon(float) = 0; + + virtual Weights getMean() const = 0; + virtual void setMean(Weights) = 0; + + virtual Weights getVariance() const = 0; + virtual void setVariance(Weights) = 0; + + virtual BatchNormMode getMode() const = 0; + virtual void setMode(BatchNormMode) = 0; + + virtual const Parameters& getParams() const = 0; +protected: + virtual ~IBatchNormLayer(); +}; + + +class ISoftMaxLayer : public virtual ILayer +{ +public: + + class Parameters + { + public: + }; + + // virtual Dims4 getOutputDimensions() const = 0; + virtual const Parameters& getParams() const = 0; +protected: + virtual ~ISoftMaxLayer(); +}; + + +class IConcatenationLayer : public virtual ILayer +{ +public: + class Parameters + { + public: + }; + + // virtual Dims4 getOutputDimensions() const = 0; + virtual const Parameters& getParams() const = 0; +protected: + virtual ~IConcatenationLayer(); +}; + + +class ISliceLayer : public virtual ILayer +{ +public: + class Parameters + { + public: + }; + + // virtual Dims4 getOutputDimensions() const = 0; + virtual const Parameters& getParams() const = 0; +protected: + virtual ~ISliceLayer(); +}; + + +class IDeconvolutionLayer : public virtual ILayer +{ +public: + + class Parameters + { + public: + Dims2 kernelSize; + Dims2 topLeftPadding; + Dims2 bottomRightPadding; + Dims2 stride; + Dims2 dilation; + int numOutputMaps; + int numGroups; + Weights kernelWeights; + Weights biasWeights; + int paddingValue; + BiasMode biasMode; + }; + + + virtual Dims2 getKernelSize() const = 0; + virtual void setKernelSize(Dims2) = 0; + + virtual int getPaddingValue() const = 0; + virtual void setPaddingValue(int) = 0; + + virtual Dims2 getBottomRightPadding() const = 0; + virtual void setBottomRightPadding(Dims2) = 0; + + virtual Dims2 getTopLeftPadding() const = 0; + virtual void setTopLeftPadding(Dims2) = 0; + + virtual Dims2 getStride() const = 0; + virtual void setStride(Dims2) = 0; + + virtual Dims2 getDilation() const = 0; + virtual void setDilation(Dims2) = 0; + + virtual int getNumGroups() const = 0; + virtual void setNumGroups(int) = 0; + + virtual int getNumOutputMaps() const = 0; + virtual void setNumOutputMaps(int) = 0; + + virtual Weights getKernelWeights() const = 0; + virtual void setKernelWeights(Weights) = 0; + virtual bool hasKernelWeights() = 0; + + virtual Weights getBiasWeights() const = 0; + virtual void setBiasWeights(Weights) = 0; + virtual bool hasBiasWeights() = 0; + + virtual BiasMode getBiasMode() const = 0; + virtual void setBiasMode(BiasMode) = 0; + + // virtual Dims4 getOutputDimensions() const = 0; + virtual const Parameters& getParams() const = 0; +protected: + virtual ~IDeconvolutionLayer(); +}; + + +class IElementWiseLayer : public virtual ILayer +{ +public: + class Parameters + { + public: + ElementWiseOperation operation; + }; + + virtual ElementWiseOperation getOperation() const = 0; + virtual void setOperation(ElementWiseOperation) = 0; + + // virtual Dims4 getOutputDimensions() const = 0; + virtual const Parameters& getParams() const = 0; +protected: + virtual ~IElementWiseLayer(); +}; + + +class IInputLayer : public virtual ILayer +{ +public: + class Parameters + { + public: + // InputOperation operation; + }; + + // virtual InputOperation getOperation() const = 0; + // virtual void setOperation(InputOperation) = 0; + + // virtual Dims4 getOutputDimensions() const = 0; + virtual const Parameters& getParams() const = 0; +protected: + virtual ~IInputLayer(); +}; + + + + +} +#endif // NVDLA_I_LAYER_H diff --git a/umd/core/include/nvdla/INetwork.h b/umd/core/include/nvdla/INetwork.h new file mode 100644 index 00000000..cb9c2d70 --- /dev/null +++ b/umd/core/include/nvdla/INetwork.h @@ -0,0 +1,151 @@ +/* + * Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#ifndef NVDLA_I_NETWORK_H +#define NVDLA_I_NETWORK_H + +#include +#include +#include + +#include "nvdla/IType.h" + +namespace nvdla +{ + +class INetwork; +class ILayer; +class IConvolutionLayer; +class IFullyConnectedLayer; +class IActivationLayer; +class IPoolingLayer; +class ILRNLayer; +class IScaleLayer; +class IBatchNormLayer; +class ISoftMaxLayer; +class IConcatenationLayer; +class ISliceLayer; +class IDeconvolutionLayer; +class IElementWiseLayer; + +class IWisdomContainerEntry; +class ITensor; + + +class INetwork +{ +public: + virtual ITensor* addInput(const char * name, Dims4 dimensions) = 0; + + // virtual void markChanged(const ILayer *) = 0; + virtual bool markInput(ITensor * tensor) = 0; + virtual void markOutput(ITensor * tensor) = 0; + + virtual IConvolutionLayer * addConvolution (ITensor * input, int numOutputs, int paddingValue, Dims2 kernelSize, + Dims2 tlPadding, Dims2 brPadding, Dims2 stride, Dims2 dilation, + Weights kernelWeights, Weights biasWeights, BiasMode biasMode, int numGroups) = 0; + virtual IFullyConnectedLayer * addFullyConnected(ITensor * input, int outputSize, Weights kernelWeights, Weights biasWeights, BiasMode biasMode) = 0; + virtual IActivationLayer * addActivation (ITensor * input, ActivationType type) = 0; + virtual IPoolingLayer * addPooling (ITensor * input, PoolingType type, + Dims2 windowSize, Dims2 stride, Dims2 tlPadding, Dims2 brPadding) = 0; + virtual ILRNLayer * addLRN (ITensor * input, int window, float alpha, float beta, float k) = 0; + virtual IScaleLayer * addScale (ITensor * input, ScaleMode mode, Weights shift, Weights scale, Weights power) = 0; + virtual IBatchNormLayer * addBatchNorm (ITensor * input, BatchNormMode mode, Weights mean, Weights variance, float epsilon) = 0; + virtual ISoftMaxLayer * addSoftMax (ITensor*input) = 0; + virtual IConcatenationLayer * addConcatenation (ITensor*const*inputs, int numInputs) = 0; + virtual ISliceLayer * addSlice (ITensor*input, int numOutputs) = 0; + virtual IDeconvolutionLayer * addDeconvolution (ITensor * input, int numOutputs, int paddingValue, + Dims2 kernelSize, Dims2 tlPadding, Dims2 brPadding, Dims2 stride, Dims2 dilation, + Weights kernelWeights, Weights biasWeights, BiasMode biasMode, int numGroups) = 0; + virtual IElementWiseLayer * addElementWise (ITensor *input0, ITensor* input1, ElementWiseOperation op) = 0; + + virtual int getNumInputs() const = 0; + virtual int getNumOutputs() const = 0; + virtual int getNumLayers() const = 0; + + virtual ILayer * getLayer(int index) const = 0; + virtual ITensor * getOutput(int index) const = 0; + virtual ITensor * getInput(int index) const = 0; + + + class OutputDimensionsFormula + { + public: + virtual Dims2 compute(Dims2 inputDims, Dims2 kernelSize, Dims2 stride, Dims2 tlPadding, Dims2 brPadding, const char* layerName) const = 0; + virtual Dims2 compute(Dims2 inputDims, Dims2 kernelSize, Dims2 stride, Dims2 tlPadding, Dims2 brPadding, Dims2 dilation, const char* layerName) const = 0; + virtual ~OutputDimensionsFormula() { } + }; + + class NetworkDefaultConvolutionFormula : public OutputDimensionsFormula + { + public: + virtual Dims2 compute(Dims2 input, Dims2 kernel, Dims2 stride, Dims2 tlPadding, Dims2 brPadding, const char*) const; + virtual Dims2 compute(Dims2 input, Dims2 kernel, Dims2 stride, Dims2 tlPadding, Dims2 brPadding, Dims2 dilation, const char*) const; + }; + + class NetworkDefaultDeconvolutionFormula : public OutputDimensionsFormula + { + public: + virtual Dims2 compute(Dims2 input, Dims2 kernel, Dims2 stride, Dims2 tlPadding, Dims2 brPadding, const char*) const; + virtual Dims2 compute(Dims2 input, Dims2 kernel, Dims2 stride, Dims2 tlPadding, Dims2 brPadding, Dims2 dilation, const char*) const; + }; + + class NetworkDefaultPoolingFormula : public OutputDimensionsFormula + { + public: + virtual Dims2 compute(Dims2 input, Dims2 kernel, Dims2 stride, Dims2 tlPadding, Dims2 brPadding, const char*) const; + virtual Dims2 compute(Dims2 /*input*/, Dims2 /*kernel*/, Dims2 /*stride*/, Dims2 /*tlPadding*/, Dims2 /*brPadding*/, Dims2 /*dilation*/, const char*) const + { + return Dims2(-1, -1); + } + }; + + virtual void setPoolingOutputDimensionsFormula (OutputDimensionsFormula* callback) = 0; + virtual void setConvolutionOutputDimensionsFormula (OutputDimensionsFormula* callback) = 0; + virtual void setDeconvolutionOutputDimensionsFormula(OutputDimensionsFormula* callback) = 0; + + virtual OutputDimensionsFormula& getPoolingOutputDimensionsFormula() const = 0; + virtual OutputDimensionsFormula& getConvolutionOutputDimensionsFormula() const = 0; + virtual OutputDimensionsFormula& getDeconvolutionOutputDimensionsFormula() const = 0; + + virtual const std::vector & getInputs() const = 0; + virtual const std::vector & getLayers() const = 0; + virtual const std::vector & getOutputs() const = 0; + +protected: + INetwork(); + virtual ~INetwork(); + +}; + +INetwork *createNetwork(); +NvDlaError destroyNetwork(INetwork *network); + +} + +#endif // NVDLA_I_NETWORK_H diff --git a/umd/core/include/nvdla/IProfile.h b/umd/core/include/nvdla/IProfile.h new file mode 100644 index 00000000..df6c7790 --- /dev/null +++ b/umd/core/include/nvdla/IProfile.h @@ -0,0 +1,165 @@ +/* + * Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#ifndef NVDLA_I_PROFILE_H +#define NVDLA_I_PROFILE_H + +#include "nvdla/IType.h" + +namespace nvdla +{ + +class IWisdom; +class ILoadable; + +class IProfile +{ +public: + virtual const char* getName() const = 0; + + virtual NvDlaError getNumLoadables(int *) const = 0; + + // if name.length() == 0 or index < 0 then they are ignored for the purpose of lookup + virtual NvDlaError getLoadable(const std::string &name, int index, ILoadable **) = 0; + + virtual NvDlaError setNetworkInputSurfaceFormat(nvdla::PixelFormat) = 0; + virtual NvDlaError setNetworkOutputSurfaceFormat(nvdla::PixelFormat) = 0; + virtual NvDlaError setNetworkInputPixelMapping(nvdla::PixelMapping) = 0; + virtual NvDlaError setNetworkInputDataFormat(const nvdla::DataFormat) = 0; + virtual NvDlaError setNetworkOutputDataFormat(const nvdla::DataFormat) = 0; + virtual NvDlaError setNetworkInputPixelOffX(NvU32) = 0; + virtual NvDlaError setNetworkInputPixelOffY(NvU32) = 0; + + virtual NvDlaError setCanCompressWeights(bool) = 0; + virtual NvDlaError setCanWinograd(bool) = 0; + virtual NvDlaError setCanSDPMergeMathOps(bool) = 0; + virtual NvDlaError setCanSDPFuseSubEngineOps(bool) = 0; + virtual NvDlaError setCanSDPBustNOPs(bool) = 0; + virtual NvDlaError setCanSDPFuseVerticalOps(bool) = 0; + virtual NvDlaError setCanSDPPDPOnFly(bool) = 0; + virtual NvDlaError setUseCVSRAMAllocate(bool) = 0; + virtual NvDlaError setUseMemPool(bool) = 0; + virtual NvDlaError setUseReusePooledMemory(bool) = 0; + virtual NvDlaError setCopyOutDebugSurfaces(bool) = 0; + virtual NvDlaError setUseGreedyEviction(bool) = 0; + virtual NvDlaError setCONVDataBanksAllotted(NvU32) = 0; + virtual NvDlaError setCONVWeightBanksAllotted(NvU32) = 0; + virtual NvDlaError setGlobalDRAMSize(NvU64) = 0; + virtual NvDlaError setLocalDRAMSize(NvU64) = 0; + virtual NvDlaError setLocalCVSRAMSize(NvU64) = 0; + virtual NvDlaError setMultiBatchSize(NvU32) = 0; + virtual NvDlaError setCanIMGPostChnlExtend(bool) = 0; + virtual NvDlaError setComputePrecision(nvdla::DataType) = 0; + virtual NvDlaError setTensorScalingMode(nvdla::TensorScalingMode) = 0; + virtual NvDlaError setQuantizationMode(nvdla::QuantizationMode) = 0; + + + struct IGlobalParams { + NvU32 pixelOffsetX; + NvU32 pixelOffsetY; + nvdla::PixelFormat inputPixelFormat; + nvdla::DataFormat inputDataFormat; // NCHW default + nvdla::PixelMapping inputPixelMapping; + nvdla::PixelFormat outputPixelFormat; + nvdla::DataFormat outputDataFormat; // NCHW default + + IGlobalParams() : + pixelOffsetX(0), + pixelOffsetY(0), + inputPixelFormat(nvdla::PixelFormat::FEATURE), + inputDataFormat(nvdla::DataFormat::NCHW), + inputPixelMapping(nvdla::PixelMapping::PITCH_LINEAR), + outputPixelFormat(nvdla::PixelFormat::FEATURE), + outputDataFormat(nvdla::DataFormat::NCHW) + { } + }; + + struct ICompileParams { + bool canCompressWeights; + bool canWinograd; + NvU32 convWeightBanksAllotted; + NvU32 convDataBanksAllotted; + bool canSdpPdpOnFly; + bool canSdpMergeMathOps; + bool canSdpFuseSubEngineOps; + bool canSdpBustNOPs; + bool canSdpFuseVerticalOps; + bool useCvsramAllocate; + bool useMemPool; + bool useReusePooledMemory; + bool greedyEviction; + bool copyOutDebugSurfaces; + NvU64 globalDramSize; + NvU64 localDramSize; + NvU64 localCvsramSize; + NvU32 multiBatchSize; + bool canImgPostChnlExtend; + nvdla::DataType computePrecision; + nvdla::TensorScalingMode tensorScalingMode; + nvdla::QuantizationMode quantizationMode; + + ICompileParams() : + canCompressWeights(false), + canWinograd(false), + convWeightBanksAllotted(8), + convDataBanksAllotted(8), + canSdpPdpOnFly(false), + canSdpMergeMathOps(false), + canSdpFuseSubEngineOps(false), + canSdpBustNOPs(false), + canSdpFuseVerticalOps(false), + useCvsramAllocate(false), + useMemPool(false), + useReusePooledMemory(false), + greedyEviction(false), + copyOutDebugSurfaces(false), + globalDramSize(1LLU << 28), + localDramSize(1LLU << 30), + localCvsramSize(1LLU << 20), + multiBatchSize(0), + canImgPostChnlExtend(false), + computePrecision(nvdla::DataType::HALF), + tensorScalingMode(nvdla::TensorScalingMode::NONE), + quantizationMode(nvdla::QuantizationMode::NONE) + { } + }; + + virtual NvDlaError initGlobalParams(IGlobalParams*) = 0; + virtual NvDlaError initCompileParams(ICompileParams*) = 0; + virtual void initWithDefaultProfile() = 0; + +protected: + IProfile(); + virtual ~IProfile(); +}; + + +} // nvdla + + +#endif // NVDLA_I_PROFILER_H diff --git a/umd/core/include/nvdla/IProfiler.h b/umd/core/include/nvdla/IProfiler.h new file mode 100644 index 00000000..7b100953 --- /dev/null +++ b/umd/core/include/nvdla/IProfiler.h @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#ifndef NVDLA_I_PROFILER_H +#define NVDLA_I_PROFILER_H + + +namespace nvdla +{ + +class IWisdom; +class IProfile; +class ITargetConfig; + +class IProfiler +{ +public: + + virtual IWisdom *wisdom() = 0; + + virtual IProfile *createProfile(const char *profile_name) = 0; + virtual IProfile *getProfile(const char *profile_name) = 0; + virtual ITargetConfig *getTargetConfig(const char *target_config_name) = 0; + +protected: + IProfiler(); + virtual ~IProfiler(); +}; + + +// IProfiler *createProfiler(); + +} // nvdla + + + +#endif // NVDLA_I_PROFILER_H diff --git a/umd/include/nvdla/IRuntime.h b/umd/core/include/nvdla/IRuntime.h similarity index 100% rename from umd/include/nvdla/IRuntime.h rename to umd/core/include/nvdla/IRuntime.h diff --git a/umd/core/include/nvdla/ISetup.h b/umd/core/include/nvdla/ISetup.h new file mode 100644 index 00000000..4f913780 --- /dev/null +++ b/umd/core/include/nvdla/ISetup.h @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#ifndef NVDLA_I_SETUP_H +#define NVDLA_I_SETUP_H + + +namespace nvdla +{ + +class IWisdom; + +class ISetup +{ +public: + + virtual IWisdom *wisdom() = 0; + +protected: + ISetup(); + virtual ~ISetup(); +}; + + +ISetup *createSetup(); +NvDlaError destroySetup(ISetup *setup); + +} // nvdla + + + +#endif // NVDLA_I_SETUP_H diff --git a/umd/core/include/nvdla/ITargetConfig.h b/umd/core/include/nvdla/ITargetConfig.h new file mode 100644 index 00000000..72c49bd7 --- /dev/null +++ b/umd/core/include/nvdla/ITargetConfig.h @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2018-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#ifndef NVDLA_I_TARGETCONFIG_H +#define NVDLA_I_TARGETCONFIG_H + +#include "nvdla/IType.h" + +namespace nvdla +{ + +class IWisdom; +class ILoadable; + +class ITargetConfig +{ +public: + virtual const char* getName() const = 0; + + struct ITargetConfigParams { + NvU32 atomicCSize; + NvU32 atomicKSize; + NvU32 memoryAtomicSize; + NvU32 numConvBufBankAllotted; + NvU32 numConvBufEntriesPerBank; + NvU32 numConvBufEntryWidth; + NvU32 maxBatchSize; + bool isWinogradCapable; + bool isCompressWeightsCapable; + bool isBatchModeCapable; + bool isPDPCapable; + bool isCDPCapable; + bool isSDPBiasCapable; + bool isSDPBatchNormCapable; + bool isSDPEltWiseCapable; + bool isSDPLutCapable; + bool isBDMACapable; + bool isRubikCapable; + + + ITargetConfigParams() : + atomicCSize(64), + atomicKSize(32), + memoryAtomicSize(32), + numConvBufBankAllotted(16), + numConvBufEntriesPerBank(256), + numConvBufEntryWidth(128), + maxBatchSize(32), + isWinogradCapable(false), + isCompressWeightsCapable(false), + isBatchModeCapable(false), + isPDPCapable(false), + isCDPCapable(false), + isSDPBiasCapable(false), + isSDPBatchNormCapable(false), + isSDPEltWiseCapable(false), + isSDPLutCapable(false), + isBDMACapable(false), + isRubikCapable(false) + { } + }; + + virtual NvDlaError initTargetConfigParams(ITargetConfigParams*) = 0; + +protected: + ITargetConfig(); + virtual ~ITargetConfig(); +}; + + +} // nvdla + + +#endif // NVDLA_I_TARGETCONFIG_H diff --git a/umd/core/include/nvdla/ITensor.h b/umd/core/include/nvdla/ITensor.h new file mode 100644 index 00000000..31a86073 --- /dev/null +++ b/umd/core/include/nvdla/ITensor.h @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#ifndef NVDLA_I_TENSOR_H +#define NVDLA_I_TENSOR_H + +#include "nvdla/IType.h" +#include "nvdla/INetwork.h" + +namespace nvdla +{ + +class ITensor +{ +public: + + virtual const char* getName() const = 0; + virtual void setName(const char *) = 0; + + virtual Dims4 getDimensions() const = 0; + virtual void setDimensions(Dims4 dimensions) = 0; + + virtual bool isNetworkInput() const = 0; + virtual bool isNetworkOutput() const = 0; + + virtual DataFormat getDataFormat() const = 0; + virtual void setDataFormat(DataFormat) = 0; + + virtual DataType getDataType() const = 0; + virtual void setDataType(DataType) = 0; + + virtual TensorType getTensorType() const = 0; + virtual void setTensorType(TensorType) = 0; + + virtual INetwork *getNetwork() const = 0; + + virtual NvDlaError setChannelDynamicRange(NvS32 channelIndex, NvF32 minLimit, NvF32 maxLimit) = 0; + virtual NvDlaError setChannelOffset(NvS32 channelIndex, NvF32 offset) = 0; + +#if 0 + virtual ILayer *getProducerLayer() const = 0; + virtual int getNumConsumerLayers() const = 0; + virtual ILayer *getConsumerLayer(int index) const = 0; +#endif + +protected: + ITensor(); + virtual ~ITensor(); +}; + + + +} // nvdla + +#endif // NVDLA_I_TENSOR_H diff --git a/umd/core/include/nvdla/IType.h b/umd/core/include/nvdla/IType.h index 22ae51ef..b74ab055 100644 --- a/umd/core/include/nvdla/IType.h +++ b/umd/core/include/nvdla/IType.h @@ -222,6 +222,14 @@ class Dims2 Dims2(NvS32 h, NvS32 w) : h(h), w(w) {}; NvS32 h; NvS32 w; + inline bool operator==(const Dims2& other) const + { + return (h == other.h && w == other.w); + } + inline bool operator!=(const Dims2& other) const + { + return !(h == other.h && w == other.w); + } }; class Dims3 @@ -391,9 +399,10 @@ template<> inline int EnumMax() { return 2; } // used by checkers enum ElementWiseOperation { - kSUM = NVDLA_ELEMENTWISE_OPERATION_SUM, //!< sum of the two elements + kSUM = NVDLA_ELEMENTWISE_OPERATION_SUM, //!< sum of the two elements kPROD = NVDLA_ELEMENTWISE_OPERATION_PROD, //!< product of the two elements - ew_kMAX = NVDLA_ELEMENTWISE_OPERATION_MAX //!< maximum of the two elements + kMIN = NVDLA_ELEMENTWISE_OPERATION_MIN, //!< minimum of the two elements + ew_kMAX = NVDLA_ELEMENTWISE_OPERATION_MAX //!< maximum of the two elements }; template<> inline int EnumMax() { return 3; } // used by checkers diff --git a/umd/core/include/nvdla/IWisdom.h b/umd/core/include/nvdla/IWisdom.h new file mode 100644 index 00000000..fc27fa12 --- /dev/null +++ b/umd/core/include/nvdla/IWisdom.h @@ -0,0 +1,102 @@ +/* + * Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#ifndef NVDLA_I_WISDOM_H +#define NVDLA_I_WISDOM_H + +#include + +namespace nvdla +{ +class IRuntime; +class IProfiler; +class IProfile; +class ICompiler; +class INetwork; +class ILayer; +class ILoadable; +class ITensor; +class IWisdomContainerEntry; + +class IWisdom +{ +public: + + virtual bool open(const std::string &uri) = 0; + + // int getNumTestPoints(); + // void save(INetwork *, NVDLANetwork *); + // void save(const OpList &, const WisdomTestPoint &); + // TestPoint &getTestPoint(int); + + virtual void close() = 0 ; + + virtual IWisdomContainerEntry *getRootEntry() = 0; + + // global parameters associated with any result within the wisdom context + virtual NvDlaError setDataType(DataType::UnderlyingType d) = 0; + virtual NvDlaError getDataType(DataType::UnderlyingType *) const = 0; + + virtual bool setNetwork(INetwork *) = 0; + virtual bool setNetworkTransient(INetwork *) = 0; + + virtual INetwork *getNetwork() = 0; + + virtual IProfiler *getProfiler() = 0; + + virtual ICompiler *getCompiler() = 0; + + // + // Dictionary/symbol table interfaces. + // + virtual bool insertNetworkSymbol(INetwork *, const std::string &) = 0; + virtual INetwork *findNetworkSymbol(const std::string &) = 0; + + virtual bool insertLayerSymbol(ILayer *, const std::string &) = 0; + virtual ILayer *findLayerSymbol(const std::string &) = 0; + + virtual bool insertTensorSymbol(ITensor *, const std::string &) = 0; + virtual ITensor *findTensorSymbol(const std::string &) = 0; + + virtual bool insertLoadableSymbol(ILoadable *, const std::string &) = 0; + virtual ILoadable *findLoadableSymbol(const std::string &) = 0; + + +protected: + + IWisdom(); + virtual ~IWisdom(); + // friend static void deleteWisdom(IWisdom *); +}; + +IWisdom *createWisdom(); +NvDlaError destroyWisdom(IWisdom *wisdom); + +} // nvdla + +#endif // NVDLA_I_WISDOM_H diff --git a/umd/core/include/nvdla/IWisdomContainer.h b/umd/core/include/nvdla/IWisdomContainer.h new file mode 100644 index 00000000..8f639560 --- /dev/null +++ b/umd/core/include/nvdla/IWisdomContainer.h @@ -0,0 +1,150 @@ +/* + * Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#ifndef NVDLA_I_WISDOM_CONTAINER_H +#define NVDLA_I_WISDOM_CONTAINER_H + +#include +#include + +namespace nvdla +{ + +class IWisdom; +class IWisdomContainer; + +class IWisdomContainerEntry +{ +public: + + enum EntryType { + ENTRY_TYPE_OBJECT = 0, + ENTRY_TYPE_STRING = 1, + ENTRY_TYPE_UINT32 = 2, + ENTRY_TYPE_INT32 = 3, + ENTRY_TYPE_UINT8_VECTOR = 4, + ENTRY_TYPE_FLOAT32 = 5, + ENTRY_TYPE_UINT64 = 6, + ENTRY_TYPE_UINT8 = 7, + }; + + virtual IWisdomContainer *container() const = 0; + virtual const std::string path() const = 0; + virtual const std::string name() const = 0; + virtual EntryType type() const = 0; + + // write + virtual bool writeUInt8(NvU8 v) = 0; + virtual bool writeString(const std::string &v) = 0; + virtual bool writeUInt8Vector(const std::vector &v) = 0; + virtual bool writeUInt32(NvU32 v) = 0; + virtual bool writeUInt64(NvU64 v) = 0; + virtual bool writeInt32(NvS32 v) = 0; + virtual bool writeFloat32(NvF32 v) = 0; + + + // read + virtual bool readUInt8(NvU8 &) const = 0; + virtual bool readString(std::string &) const = 0; + virtual bool readUInt8Vector(std::vector &) const = 0; + virtual bool readUInt32(NvU32 &) const = 0; + virtual bool readUInt64(NvU64 &) const = 0; + virtual bool readInt32(NvS32 &) const = 0; + virtual bool readFloat32(NvF32 &) const = 0; + + + // access to sub-elements for the 'object' type + virtual bool insertEntry(const std::string &name, EntryType, IWisdomContainerEntry *&) = 0; + virtual bool removeEntry(const std::string &name) = 0; + + virtual bool getEntryNames(std::vector *) = 0; + virtual bool getEntry(const std::string &name, EntryType, IWisdomContainerEntry *&) = 0; + +protected: + IWisdomContainerEntry(); + virtual ~IWisdomContainerEntry(); + +}; + + +class IWisdomContainer +{ +public: + + virtual bool open(const std::string &uri) = 0; + + virtual bool isOpen() = 0; + virtual void close() = 0; + + virtual IWisdom *wisdom() = 0; + virtual IWisdomContainerEntry *root() = 0; + + + // + // To be used by the container entries themselves, not by api clients. + // + // i.e.: + // protected: + // friend class IWisdomContainerEntry; + virtual bool insertEntry(const std::string &path, + const std::string &name, + IWisdomContainerEntry::EntryType, + IWisdomContainerEntry *&) = 0; + virtual bool removeEntry(const std::string &path) = 0; + + virtual bool getEntryNames(const std::string &path, std::vector *) = 0; + virtual bool getEntry(const std::string &path, const std::string &name, + IWisdomContainerEntry::EntryType, + IWisdomContainerEntry *&entry) = 0; + // virtual bool getEntry(const std::string &name, IWisdomContainerEntry *&entry) = 0; + + virtual bool writeUInt8(const std::string &path, NvU8) = 0; + virtual bool writeString(const std::string &path, const std::string &) = 0; + virtual bool writeUInt8Vector(const std::string &path, const std::vector &) = 0; + virtual bool writeUInt32(const std::string &path, NvU32) = 0; + virtual bool writeUInt64(const std::string &path, NvU64) = 0; + virtual bool writeInt32(const std::string &path, NvS32) = 0; + virtual bool writeFloat32(const std::string &path, NvF32) = 0; + + virtual bool readUInt8(const std::string &path, NvU8 &) = 0; + virtual bool readString(const std::string &path, std::string &) = 0; + virtual bool readUInt8Vector(const std::string &path, std::vector &) = 0; + virtual bool readUInt32(const std::string &path, NvU32 &) = 0; + virtual bool readUInt64(const std::string &path, NvU64 &) = 0; + virtual bool readInt32(const std::string &path, NvS32 &) = 0; + virtual bool readFloat32(const std::string &path, NvF32 &) = 0; + +protected: + IWisdomContainer(IWisdom *); + virtual ~IWisdomContainer(); + +}; + +} // nvdla + +#endif // NVDLA_I_WISDOM_CONTAINER_H diff --git a/umd/core/include/nvdla/c/NvDlaType.h b/umd/core/include/nvdla/c/NvDlaType.h index 0f6f46c4..0d07c814 100644 --- a/umd/core/include/nvdla/c/NvDlaType.h +++ b/umd/core/include/nvdla/c/NvDlaType.h @@ -166,7 +166,8 @@ typedef struct NvDlaWeights #define NVDLA_ELEMENTWISE_OPERATION_SUM 0U #define NVDLA_ELEMENTWISE_OPERATION_PROD 1U -#define NVDLA_ELEMENTWISE_OPERATION_MAX 2U +#define NVDLA_ELEMENTWISE_OPERATION_MIN 2U +#define NVDLA_ELEMENTWISE_OPERATION_MAX 3U #ifdef __cplusplus extern "C" { diff --git a/umd/core/include/nvdla/caffe/ICaffeParser.h b/umd/core/include/nvdla/caffe/ICaffeParser.h new file mode 100644 index 00000000..54615147 --- /dev/null +++ b/umd/core/include/nvdla/caffe/ICaffeParser.h @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#ifndef NVDLA_I_CAFFE_PARSER_H +#define NVDLA_I_CAFFE_PARSER_H + +#include + +//#include "nvdla/IType.h" + +namespace nvdla +{ + +class ITensor; +class INetwork; + +namespace caffe +{ + +class IBlobNameToTensor +{ +public: + virtual void add(const std::string& name, ITensor* tensor) = 0; + + virtual ITensor* find(const char* name) const = 0; + virtual ITensor*& operator[](const std::string& name) = 0; + virtual void setTensorNames() = 0; + virtual ~IBlobNameToTensor(); +}; + + +class IBinaryProtoBlob +{ +public: + virtual const void* getData() = 0; + virtual nvdla::Dims4 getDimensions() = 0; + virtual void destroy() = 0; + virtual ~IBinaryProtoBlob(); +}; + +class ICaffeParser +{ +public: + + virtual const IBlobNameToTensor* parse(const char* deploy, + const char* model, + INetwork* network)= 0; + virtual int identifyOutputs(INetwork* network) = 0; + virtual ~ICaffeParser(); + +}; + +ICaffeParser *createCaffeParser(); +NvDlaError destroyCaffeParser(ICaffeParser *parser); + +} +} +#endif // NVDLA_I_CAFFE_PARSER_H diff --git a/umd/core/include/nvdla/caffe/c/NvDlaCaffeParser.h b/umd/core/include/nvdla/caffe/c/NvDlaCaffeParser.h new file mode 100644 index 00000000..6984c0f5 --- /dev/null +++ b/umd/core/include/nvdla/caffe/c/NvDlaCaffeParser.h @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#ifndef NVDLA_CAFFE_PARSER_C_H +#define NVDLA_CAFFE_PARSER_C_H + +#include "nvdla/c/NvDlaType.h" +#include "nvdla/c/NvDla.h" + +struct NvDlaCaffeParserI +{ + NvError (*parse)(NvDlaCaffeParser, const char *, const char *, NvDlaNetwork); + NvError (*identifyOutputs)(NvDlaCaffeParser, NvDlaNetwork); +}; + +#ifdef __cplusplus +extern "C" { +#endif + +NvError NvDlaCreateCaffeParser(NvDlaCaffeParser *cpt); +NvError NvDlaDestroyCaffeParser(NvDlaCaffeParser cpt); + +#ifdef __cplusplus +} +#endif + +#endif /* NVDLA_CAFFE_PARSER_C_H */ diff --git a/umd/include/nvdla_inf.h b/umd/core/include/nvdla_inf.h similarity index 100% rename from umd/include/nvdla_inf.h rename to umd/core/include/nvdla_inf.h diff --git a/umd/include/nvdla_os_inf.h b/umd/core/include/nvdla_os_inf.h similarity index 100% rename from umd/include/nvdla_os_inf.h rename to umd/core/include/nvdla_os_inf.h diff --git a/umd/core/common/Check.cpp b/umd/core/src/common/Check.cpp similarity index 100% rename from umd/core/common/Check.cpp rename to umd/core/src/common/Check.cpp diff --git a/umd/core/common/EMUInterface.cpp b/umd/core/src/common/EMUInterface.cpp similarity index 100% rename from umd/core/common/EMUInterface.cpp rename to umd/core/src/common/EMUInterface.cpp diff --git a/umd/core/common/EMUInterfaceA.cpp b/umd/core/src/common/EMUInterfaceA.cpp similarity index 100% rename from umd/core/common/EMUInterfaceA.cpp rename to umd/core/src/common/EMUInterfaceA.cpp diff --git a/umd/core/common/ErrorLogging.c b/umd/core/src/common/ErrorLogging.c similarity index 100% rename from umd/core/common/ErrorLogging.c rename to umd/core/src/common/ErrorLogging.c diff --git a/umd/core/common/Loadable.cpp b/umd/core/src/common/Loadable.cpp similarity index 100% rename from umd/core/common/Loadable.cpp rename to umd/core/src/common/Loadable.cpp diff --git a/umd/core/common/include/priv/Check.h b/umd/core/src/common/include/priv/Check.h similarity index 100% rename from umd/core/common/include/priv/Check.h rename to umd/core/src/common/include/priv/Check.h diff --git a/umd/core/common/include/priv/EMUInterface.h b/umd/core/src/common/include/priv/EMUInterface.h similarity index 100% rename from umd/core/common/include/priv/EMUInterface.h rename to umd/core/src/common/include/priv/EMUInterface.h diff --git a/umd/core/common/include/priv/EMUInterfaceEnums.h b/umd/core/src/common/include/priv/EMUInterfaceEnums.h similarity index 100% rename from umd/core/common/include/priv/EMUInterfaceEnums.h rename to umd/core/src/common/include/priv/EMUInterfaceEnums.h diff --git a/umd/core/common/include/priv/Loadable.h b/umd/core/src/common/include/priv/Loadable.h similarity index 100% rename from umd/core/common/include/priv/Loadable.h rename to umd/core/src/common/include/priv/Loadable.h diff --git a/umd/core/common/include/priv/Type.h b/umd/core/src/common/include/priv/Type.h similarity index 100% rename from umd/core/common/include/priv/Type.h rename to umd/core/src/common/include/priv/Type.h diff --git a/umd/core/common/include/priv/emu/emu1/A/emu_interface.h b/umd/core/src/common/include/priv/emu/emu1/A/emu_interface.h similarity index 100% rename from umd/core/common/include/priv/emu/emu1/A/emu_interface.h rename to umd/core/src/common/include/priv/emu/emu1/A/emu_interface.h diff --git a/umd/core/common/include/priv/emu/emu1/A/emu_version.h b/umd/core/src/common/include/priv/emu/emu1/A/emu_version.h similarity index 100% rename from umd/core/common/include/priv/emu/emu1/A/emu_version.h rename to umd/core/src/common/include/priv/emu/emu1/A/emu_version.h diff --git a/umd/core/common/include/priv/loadable_generated.h b/umd/core/src/common/include/priv/loadable_generated.h similarity index 99% rename from umd/core/common/include/priv/loadable_generated.h rename to umd/core/src/common/include/priv/loadable_generated.h index ef8b5e0d..d9c68341 100644 --- a/umd/core/common/include/priv/loadable_generated.h +++ b/umd/core/src/common/include/priv/loadable_generated.h @@ -209,9 +209,8 @@ enum DataFormat { DataFormat_UNKNOWN = 0, DataFormat_NCHW = 1, DataFormat_NHWC = 2, - DataFormat_NCxHWx = 3, DataFormat_MIN = DataFormat_UNKNOWN, - DataFormat_MAX = DataFormat_NCxHWx + DataFormat_MAX = DataFormat_NHWC }; inline const char **EnumNamesDataFormat() { @@ -219,7 +218,6 @@ inline const char **EnumNamesDataFormat() { "UNKNOWN", "NCHW", "NHWC", - "NCxHWx", nullptr }; return names; @@ -236,10 +234,8 @@ enum DataType { DataType_HALF = 2, DataType_INT16 = 3, DataType_INT8 = 4, - DataType_UINT8 = 5, - DataType_UINT16 = 6, DataType_MIN = DataType_UNKNOWN, - DataType_MAX = DataType_UINT16 + DataType_MAX = DataType_INT8 }; inline const char **EnumNamesDataType() { @@ -249,8 +245,6 @@ inline const char **EnumNamesDataType() { "HALF", "INT16", "INT8", - "UINT8", - "UINT16", nullptr }; return names; diff --git a/umd/core/common/loadable.fbs b/umd/core/src/common/loadable.fbs similarity index 98% rename from umd/core/common/loadable.fbs rename to umd/core/src/common/loadable.fbs index e8aba70a..d9a23646 100644 --- a/umd/core/common/loadable.fbs +++ b/umd/core/src/common/loadable.fbs @@ -174,12 +174,12 @@ table SubmitListEntry { // // lines up with DataFormat enum in IType.h in UMD // -enum DataFormat : ubyte { UNKNOWN = 0, NCHW = 1, NHWC = 2, NCxHWx = 3 } +enum DataFormat : ubyte { UNKNOWN = 0, NCHW = 1, NHWC = 2 } // // lines up with DataType enum in IType.h in UMD // -enum DataType : ubyte { UNKNOWN = 0, FLOAT = 1, HALF = 2, INT16 = 3, INT8 = 4, UINT8 = 5, UINT16 = 6 } +enum DataType : ubyte { UNKNOWN = 0, FLOAT = 1, HALF = 2, INT16 = 3, INT8 = 4 } // // lines up with DataCategory enum in IType.h in UMD diff --git a/umd/core/src/compiler/AST.cpp b/umd/core/src/compiler/AST.cpp new file mode 100644 index 00000000..13638613 --- /dev/null +++ b/umd/core/src/compiler/AST.cpp @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#include "priv/AST.h" + +namespace nvdla +{ + +namespace priv +{ + +SEQUENCE_ENUM_STATIC_MEMBERS(ast::EdgeDirectionEnum, NvU8, AST_EDGE_DIRECTION_ENUMS, "ASTEdgeDirectionEnum") +SEQUENCE_ENUM_STATIC_MEMBERS(ast::EdgeSideEnum, NvU8, AST_EDGE_SIDE_ENUMS, "ASTEdgeSideEnum") + + +} // nvdla::priv +} // nvdla diff --git a/umd/core/src/compiler/CanonicalAST.cpp b/umd/core/src/compiler/CanonicalAST.cpp new file mode 100644 index 00000000..81374b70 --- /dev/null +++ b/umd/core/src/compiler/CanonicalAST.cpp @@ -0,0 +1,990 @@ +/* + * Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#include +#include +#include + +#include "priv/Check.h" + +#include "priv/CanonicalAST.h" + +#include "priv/Network.h" +#include "priv/Tensor.h" +#include "ErrorMacros.h" + +using std::map; +using std::unordered_map; +using std::unordered_set; +using std::vector; +using std::string; +using std::endl; +using std::ostream; +using std::stringstream; + +namespace nvdla +{ + +class ILayer; + +namespace priv +{ + +ENUM_PARAMETER_STATIC(canonical_ast::CanonicalOpType, CANONICAL_OPERATION_TYPE_ENUMS, "CanonicalOpTypeEnum") + +NvU32 canonical_ast::Node::m_next_id = 0; +NvU32 canonical_ast::Edge::m_next_id = 0; + +canonical_ast::Node *canonical_ast::newCanonicalNode(Layer *orig_nw_layer) +{ + LayerType original_type = orig_nw_layer->getType(); + + switch (original_type) + { + case LayerType::kCONVOLUTION: { + ConvolutionLayer *conv_layer = LayerFactory::derivedPriv< ConvolutionLayerDiamond >( orig_nw_layer ); + return canonical_ast::NodeFactory::newConvNode(conv_layer); + } + case LayerType::kFULLY_CONNECTED: { + FullyConnectedLayer *fc_layer = LayerFactory::derivedPriv< FullyConnectedLayerDiamond >( orig_nw_layer ); + return canonical_ast::NodeFactory::newFCNode(fc_layer); + } + case LayerType::kACTIVATION: { + ActivationLayer *act_layer = LayerFactory::derivedPriv< ActivationLayerDiamond >( orig_nw_layer ); + return canonical_ast::NodeFactory::newActivationNode(act_layer); + } + case LayerType::kPOOLING: { + PoolingLayer *pool_layer = LayerFactory::derivedPriv< PoolingLayerDiamond >( orig_nw_layer ); + return canonical_ast::NodeFactory::newPoolingNode(pool_layer); + } + case LayerType::kLRN: { + LRNLayer *lrn_layer = LayerFactory::derivedPriv< LRNLayerDiamond >( orig_nw_layer ); + return canonical_ast::NodeFactory::newLRNNode(lrn_layer); + } + case LayerType::kSCALE: { + ScaleLayer *scale_layer = LayerFactory::derivedPriv< ScaleLayerDiamond >( orig_nw_layer ); + return canonical_ast::NodeFactory::newScaleNode(scale_layer); + } + case LayerType::kBATCH_NORM: { + BatchNormLayer *bn_layer = LayerFactory::derivedPriv< BatchNormLayerDiamond >( orig_nw_layer ); + return canonical_ast::NodeFactory::newBatchNormNode(bn_layer); + } + case LayerType::kSOFTMAX: { + SoftMaxLayer *sm_layer = LayerFactory::derivedPriv< SoftMaxLayerDiamond >( orig_nw_layer ); + return canonical_ast::NodeFactory::newSoftMaxNode(sm_layer); + } + case LayerType::kCONCATENATION: { + ConcatenationLayer *concat_layer = LayerFactory::derivedPriv< ConcatenationLayerDiamond >( orig_nw_layer ); + return canonical_ast::NodeFactory::newConcatNode(concat_layer); + } + case LayerType::kDECONVOLUTION: { + DeconvolutionLayer *deconv_layer = LayerFactory::derivedPriv< DeconvolutionLayerDiamond >( orig_nw_layer ); + return canonical_ast::NodeFactory::newDeconvNode(deconv_layer); + } + case LayerType::kELEMENTWISE: { + ElementWiseLayer *ew_layer = LayerFactory::derivedPriv< ElementWiseLayerDiamond >( orig_nw_layer ); + return canonical_ast::NodeFactory::newEWNode(ew_layer); + } + case LayerType::kSLICE: { + SliceLayer *slice_layer = LayerFactory::derivedPriv< SliceLayerDiamond >( orig_nw_layer ); + return canonical_ast::NodeFactory::newSplitNode(slice_layer); + } + default: + return NULL; + } + + return NULL; +} + +canonical_ast::Graph* canonical_ast::Graph::clone() +{ + REPORT_ERROR(NvDlaError_NotSupported, "Graph cloning is not supported for Canonical AST"); + + return NULL; +} + +// +// the following generates a 1:1 mapping with the Canonical graph input. +// +canonical_ast::Graph *canonical_ast::generateGraph(Network *network) +{ + vector input_edges; + vector output_edges; + + map node_layer; + map::iterator lni; + + map tensor_edge; + map nw_tensor_to_can_tensor; + map::iterator tei; + + Graph *graph = new Graph(); + + vector network_inputs; + for (int ni = 0; ni < network->getNumInputs(); ++ni) + { + network_inputs.push_back(TensorFactory::priv(network->getInput(ni))); + } + input_edges.resize(network_inputs.size()); + + + vector network_outputs; + for (int ni = 0; ni < network->getNumOutputs(); ++ni) + { + network_outputs.push_back(TensorFactory::priv(network->getOutput(ni))); + } + output_edges.resize(network_outputs.size()); + + // gLogInfo << "canonical_ast::" << __func__ << " network shows " << network_inputs.size() << " inputs and " << + // network_outputs.size() << " outputs" << endl; + + for (int li = 0; li < network->getNumLayers(); li++) + { + ILayer *ilayer = network->getLayer(li); + Layer *layer = LayerFactory::priv(ilayer); + if ( !(ilayer && layer) ) + { + gLogError << __func__ << " encountered null layer at network layer index=" << li << endl; + continue; + } + + canonical_ast::Node *can_node = newCanonicalNode(layer); + if ( !can_node ) + { + delete graph; // blow up + graph = 0; + goto done; + } + can_node->setGraph(graph); + graph->insertNode(can_node); + + can_node->setId(graph->nextNodeId()); + can_node->setName(layer->getName()); + + node_layer[can_node] = layer; + } + + // + // Now all the layer nodes are in the graph. + // For each layer assemble the edges. + // + + for (lni = node_layer.begin(); lni != node_layer.end(); ++lni) + { + canonical_ast::Node *node = lni->first; + Layer *l = lni->second; + + size_t input_tensors = 0, output_tensors = 0, aux_input_tensors = 0; + vector io_tensors, aux_tensors; + NVDLA_UNUSED(aux_input_tensors); + + for(int ii = 0, II = l->getNumInputs(); ii < II; ++ii) + { + Tensor *tensor = TensorFactory::priv(l->getInput(ii)); + if ( !tensor ) + { + gLogError << __func__ << " 3..i." << ii << endl; + continue; + } + io_tensors.push_back(tensor); + input_tensors++; + } + for(int oo = 0, OO = l->getNumOutputs(); oo < OO; ++oo) + { + Tensor *tensor = TensorFactory::priv(l->getOutput(oo)); + if ( ! tensor ) + { + gLogError << __func__ << " 3..o." << oo << endl; + continue; + } + io_tensors.push_back(tensor); + output_tensors++; + } + + for(size_t io = 0, IO = io_tensors.size(); io < IO; ++io) + { + Tensor *nw_tensor = io_tensors[io]; + bool is_input = io < input_tensors; + ast::EdgeSide edge_side( is_input ? ast::EdgeSideEnum::SECOND : ast::EdgeSideEnum::FIRST); + ast::EdgeDirection edge_dir(ast::EdgeDirectionEnum::DIRECTED); + + map::iterator f = tensor_edge.find(nw_tensor); + canonical_ast::Edge *can_edge = 0; + Tensor* can_tensor = 0; + if ( f == tensor_edge.end() ) + { + can_edge = new canonical_ast::Edge(); + can_edge->setGraph(graph); + + can_tensor = nw_tensor->clone(); + can_tensor->setNetwork(NULL); // get rid of any connections back to the network builder + can_tensor->setTensorType(TensorType::kIO); + can_edge->setId(graph->nextEdgeId()); + can_edge->setOriginalTensor(can_tensor); + graph->insertEdge(can_edge); + + tensor_edge[nw_tensor] = can_edge; + nw_tensor_to_can_tensor[nw_tensor] = can_tensor; + } else { + can_edge = f->second; + } + graph->appendNodeToEdge(can_edge, edge_side, node); + + // if this is an input node it could be one of the network inputs. + // if so keep track of it. + if ( is_input ) + { + for ( size_t iti = 0; iti < network_inputs.size(); iti++) + { + if ( nw_tensor == network_inputs[iti] ) + { + // gLogInfo << " identified input edge: " << (int)iti << " tensor id " << tensor->getName() << endl; + input_edges[iti] = can_edge; + can_tensor = nw_tensor_to_can_tensor[nw_tensor]; + can_tensor->setTensorType(TensorType::kNW_INPUT); + break; + } + } + node->markInputEdge(can_edge); + } + else + { + for ( size_t oti = 0; oti < network_outputs.size(); oti++) + { + if ( nw_tensor == network_outputs[oti] ) + { + // gLogInfo << " identified output edge: " << (int)oti << " tensor id " << tensor->getName() << endl; + output_edges[oti] = can_edge; + can_tensor = nw_tensor_to_can_tensor[nw_tensor]; + can_tensor->setTensorType(TensorType::kNW_OUTPUT); + break; + } + } + node->markOutputEdge(can_edge); + } + } + } + + if ( input_edges.size() ) + { + graph->setInputEdges(input_edges); + } + if ( output_edges.size() ) + { + graph->setOutputEdges(output_edges); + } + + graph->scoredOrdering()->generate(); + graph->markClean(); + +done: + return graph; +} + +ostream &canonical_ast::outputJson(canonical_ast::Graph *graph, ostream &os) +{ + string sep; + os << "[ {" << " \"app\" : \"\"} " << endl; // to signal content flavor + + // + // nodes + // + sep = string(","); + for (Graph::NodeSetIterator ni = graph->nodes().begin(); ni != graph->nodes().end(); ++ni) + { + os << sep; + outputJson(graph, *ni, os); + sep = string(", "); + } + + // + // edges + // + for (Graph::EdgeSetIterator ei = graph->edges().begin(); ei != graph->edges().end(); ++ei) + { + os << sep; + outputJson(graph, *ei, os); + sep = string(","); + } + os << "]" << endl; + return os; +} + + + +ostream &canonical_ast::outputJson(canonical_ast::Graph *graph, canonical_ast::Edge *edge, ostream &os) +{ +#if 0 + static int dummy = 0; + string edge_text_id = edge->originalTensor()->getName(); + + if ( edge_text_id == string("") ) + { + edge->originalTensor()->setName( string("e-"+toString(dummy++)).c_str()); + edge_text_id = edge->originalTensor()->getName(); + } +#endif + // edge label to gather the fan-in (almost always 1) and fan-out + os << "{ \"class\":\"edge\", \"id\":\"" << edge->id() << + "\", \"is_input\":" << ( (graph->inputEdges().end()==std::find(graph->inputEdges().begin(), graph->inputEdges().end(), edge))?"false":"true") << + ", \"is_output\":" << ((graph->outputEdges().end()==std::find(graph->outputEdges().begin(), graph->outputEdges().end(), edge))?"false":"true"); + + + // now create "line" elements to represent the fan-in && fan-out of the edge + const vector source_nodes = graph->upstreamNodes(edge); // source + const vector target_nodes = graph->downstreamNodes(edge); // target + + std::string delim0 = "\n\t,"; + os << ", \"sources\":["; + if ( source_nodes.size() ) + { + std::string source_delim = ""; + + for ( size_t s = 0, S = source_nodes.size(); s < S; ++s ) + { + os << source_delim << '"' << source_nodes[s]->id() << '"'; + source_delim = ", "; + } + } + os << "], \"targets\":["; + if ( target_nodes.size() ) + { + std::string target_delim = ""; + for ( size_t t = 0, T = target_nodes.size(); t < T; ++t ) + { + string target_node_id = target_nodes[t]->id(); + os << target_delim << '"' << target_nodes[t]->id() << '"'; + target_delim = ", "; + } + } + os << "]}"; + return os; +} + +ostream &canonical_ast::outputJson(canonical_ast::Graph *, canonical_ast::Node *node, ostream &os) +{ + os << " { \"class\":\"node\", \"id\":\"" << node->id() << "\" }"; + return os; +} + + +bool canonical_ast::serializeTo(WisdomContainerEntry *) +{ + return false; +} + +bool canonical_ast::deserializeFrom(WisdomContainerEntry *) +{ + return false; +} + +// Canonical operation parameters +void canonical_ast::ConvolutionNode::captureNetworkParams(ConvolutionLayer* origNwLayer) +{ + Dims4 weightDims, biasDims; + params().setBiasMode(origNwLayer->getBiasMode()); + params().setHasBiasTerm(origNwLayer->getBiasWeights().count > 0 ? true : false); + params().setTopLeftPadding(origNwLayer->getTopLeftPadding()); + params().setBottomRightPadding(origNwLayer->getBottomRightPadding()); + params().setPaddingValue(origNwLayer->getPaddingValue()); + params().setStride(origNwLayer->getStride()); + params().setDilation(origNwLayer->getDilation()); + params().setWeights(origNwLayer->getKernelWeights()); + params().setBiasData(origNwLayer->getBiasWeights()); + params().setNumGroups(origNwLayer->getNumGroups()); + NvU32 kernChannels = params().weights().count/ + (origNwLayer->getNumOutputMaps() * + origNwLayer->getKernelSize().h * + origNwLayer->getKernelSize().w); + weightDims.n = origNwLayer->getNumOutputMaps(); + weightDims.c = kernChannels; + weightDims.h = origNwLayer->getKernelSize().h; + weightDims.w = origNwLayer->getKernelSize().w; + params().setWeightDims(weightDims); + + if (params().hasBiasTerm()) + { + switch(origNwLayer->getBiasMode()) + { + case BiasMode::bUNIFORM: + biasDims.c = 1; + biasDims.h = 1; + biasDims.w = 1; + break; + case BiasMode::bCHANNEL: + biasDims.c = params().biasData().count; + biasDims.h = 1; + biasDims.w = 1; + break; + case BiasMode::bm_ELEMENTWISE: + biasDims.c = origNwLayer->getInput(0)->getDimensions().c; + biasDims.h = origNwLayer->getInput(0)->getDimensions().h; + biasDims.w = origNwLayer->getInput(0)->getDimensions().w; + break; + default: + REPORT_ERROR(NvDlaError_BadParameter, "Unknown bias mode: %d", (int)origNwLayer->getBiasMode()); + } + params().setBiasDims(biasDims); + } + + return; +} + +void canonical_ast::FullyConnectedNode::captureNetworkParams(FullyConnectedLayer* origNwLayer) +{ + Dims4 weightDims, biasDims; + params().setBiasMode(origNwLayer->getBiasMode()); + params().setHasBiasTerm(origNwLayer->getBiasWeights().count > 0 ? true : false); + params().setWeights(origNwLayer->getKernelWeights()); + params().setBiasData(origNwLayer->getBiasWeights()); + // the kernel weights of an inner product have the same dimensions as the input + weightDims.n = origNwLayer->getNumOutputChannels(); + weightDims.c = origNwLayer->getInput(0)->getDimensions().c; // fixme: probably need fix + weightDims.h = origNwLayer->getInput(0)->getDimensions().h; // fixme: probably need fix + weightDims.w = origNwLayer->getInput(0)->getDimensions().w; // fixme: probably need fix + params().setWeightDims(weightDims); + + if (params().hasBiasTerm()) + { + switch(origNwLayer->getBiasMode()) + { + case BiasMode::bUNIFORM: + biasDims.c = 1; + biasDims.h = 1; + biasDims.w = 1; + break; + case BiasMode::bCHANNEL: + biasDims.c = params().biasData().count; + biasDims.h = 1; + biasDims.w = 1; + break; + case BiasMode::bm_ELEMENTWISE: + biasDims.c = origNwLayer->getInput(0)->getDimensions().c; + biasDims.h = origNwLayer->getInput(0)->getDimensions().h; + biasDims.w = origNwLayer->getInput(0)->getDimensions().w; + break; + default: + REPORT_ERROR(NvDlaError_BadParameter, "Unknown bias mode: %d", (int)origNwLayer->getBiasMode()); + } + params().setBiasDims(biasDims); + } + + return; +} + +void canonical_ast::ActivationNode::captureNetworkParams(ActivationLayer* origNwLayer) +{ + params().setActivationType(origNwLayer->getActivationType()); +} + +void canonical_ast::PoolingNode::captureNetworkParams(PoolingLayer* origNwLayer) +{ + params().setPoolType(origNwLayer->getPoolingType()); + params().setTopLeftPadding(origNwLayer->getTopLeftPadding()); + params().setBottomRightPadding(origNwLayer->getBottomRightPadding()); + params().setKernelDims(origNwLayer->getWindowSize()); + params().setStride(origNwLayer->getStride()); +} + +void canonical_ast::LRNNode::captureNetworkParams(LRNLayer* origNwLayer) +{ + params().setLocalSize(origNwLayer->getWindowSize()); + params().setAlpha(origNwLayer->getAlpha()); + params().setBeta(origNwLayer->getBeta()); + params().setK(origNwLayer->getK()); +} + +void canonical_ast::ScaleNode::captureNetworkParams(ScaleLayer* origNwLayer) +{ + Dims4 scaleDims, shiftDims, powerDims; + params().setMode(origNwLayer->getMode()); + params().setShift(origNwLayer->getShift()); + params().setScale(origNwLayer->getScale()); + params().setPower(origNwLayer->getPower()); + params().setHasBiasTerm(origNwLayer->getShift().count > 0 ? true : false); + switch(origNwLayer->getMode()) + { + case ScaleMode::sUNIFORM: + scaleDims.c = 1; + scaleDims.h = 1; + scaleDims.w = 1; + break; + case ScaleMode::sCHANNEL: + scaleDims.c = params().scale().count; + scaleDims.h = 1; + scaleDims.w = 1; + break; + case ScaleMode::sm_ELEMENTWISE: + scaleDims.c = origNwLayer->getInput(0)->getDimensions().c; + scaleDims.h = origNwLayer->getInput(0)->getDimensions().h; + scaleDims.w = origNwLayer->getInput(0)->getDimensions().w; + break; + default: + REPORT_ERROR(NvDlaError_BadParameter, "Unknown scale mode: %d", (int)origNwLayer->getMode()); + } + params().setScaleDims(scaleDims); + + if (params().hasBiasTerm()) + { + shiftDims = scaleDims; + params().setShiftDims(shiftDims); + } + + if (params().power().count > 0) + { + powerDims.c = 1; + powerDims.h = 1; + powerDims.w = 1; + params().setPowerDims(powerDims); + } +} + +void canonical_ast::BatchNormNode::captureNetworkParams(BatchNormLayer* origNwLayer) +{ + Dims4 meanDims; + Dims4 varianceDims; + params().setMode(origNwLayer->getMode()); + params().setMean(origNwLayer->getMean()); + params().setVariance(origNwLayer->getVariance()); + params().setEpsilon(origNwLayer->getEpsilon()); + switch (origNwLayer->getParams().mode) + { + case BatchNormMode::bnUNIFORM: + meanDims.c = 1; + meanDims.h = 1; + meanDims.w = 1; + break; + case BatchNormMode::bnm_CHANNEL: + meanDims.c = params().mean().count; + meanDims.h = 1; + meanDims.w = 1; + break; + default: + REPORT_ERROR(NvDlaError_BadParameter, "Unknown batch norm mode: %d", (int)origNwLayer->getMode()); + } + varianceDims = meanDims; + params().setMeanDims(meanDims); + params().setVarianceDims(varianceDims); +} + +void canonical_ast::SoftMaxNode::captureNetworkParams(SoftMaxLayer* origNwLayer) +{ +} + +void canonical_ast::ConcatenationNode::captureNetworkParams(ConcatenationLayer* origNwLayer) +{ + params().setNumInputs(origNwLayer->getNumInputs()); +} + +void canonical_ast::SplitNode::captureNetworkParams(SliceLayer* origNwLayer) +{ + this->getParams().setNumOutputs(origNwLayer->getNumOutputs()); +} + +void canonical_ast::DeconvolutionNode::captureNetworkParams(DeconvolutionLayer* origNwLayer) +{ + Dims4 weightDims, biasDims; + params().setBiasMode(origNwLayer->getBiasMode()); + params().setHasBiasTerm(origNwLayer->getBiasWeights().count > 0 ? true : false); + params().setTopLeftPadding(origNwLayer->getTopLeftPadding()); + params().setBottomRightPadding(origNwLayer->getBottomRightPadding()); + params().setPaddingValue(origNwLayer->getPaddingValue()); + params().setStride(origNwLayer->getStride()); + params().setNumGroups(origNwLayer->getNumGroups()); + params().setDilation(origNwLayer->getDilation()); + params().setWeights(origNwLayer->getKernelWeights()); + params().setBiasData(origNwLayer->getBiasWeights()); + NvU32 kernChannels = params().weights().count/ + (origNwLayer->getNumOutputMaps() * + origNwLayer->getKernelSize().h * + origNwLayer->getKernelSize().w); + + weightDims.n = origNwLayer->getNumOutputMaps(); + weightDims.c = kernChannels; + weightDims.h = origNwLayer->getKernelSize().h; + weightDims.w = origNwLayer->getKernelSize().w; + params().setWeightDims(weightDims); + + if (params().hasBiasTerm()) + { + switch(origNwLayer->getBiasMode()) + { + case BiasMode::bUNIFORM: + biasDims.c = 1; + biasDims.h = 1; + biasDims.w = 1; + break; + case BiasMode::bCHANNEL: + biasDims.c = params().biasData().count; + biasDims.h = 1; + biasDims.w = 1; + break; + case BiasMode::bm_ELEMENTWISE: + biasDims.c = origNwLayer->getInput(0)->getDimensions().c; + biasDims.h = origNwLayer->getInput(0)->getDimensions().h; + biasDims.w = origNwLayer->getInput(0)->getDimensions().w; + break; + default: + REPORT_ERROR(NvDlaError_BadParameter, "Unknown bias mode: %d", (int)origNwLayer->getBiasMode()); + } + params().setBiasDims(biasDims); + } + + return; +} + +void canonical_ast::ElementWiseNode::captureNetworkParams(ElementWiseLayer* origNwLayer) +{ + params().setType(origNwLayer->getOperation()); +} + +// explicitly instantiate the priv maps of each node type +map canonical_ast::NodeFactory::s_conv_priv = + map(); + +map canonical_ast::NodeFactory::s_fc_priv = + map(); + +map canonical_ast::NodeFactory::s_act_priv = + map(); + +map canonical_ast::NodeFactory::s_pool_priv = + map(); + +map canonical_ast::NodeFactory::s_lrn_priv = + map(); + +map canonical_ast::NodeFactory::s_scale_priv = + map(); + +map canonical_ast::NodeFactory::s_bn_priv = + map(); + +map canonical_ast::NodeFactory::s_sm_priv = + map(); + +map canonical_ast::NodeFactory::s_concat_priv = + map(); + +map canonical_ast::NodeFactory::s_deconv_priv = + map(); + +map canonical_ast::NodeFactory::s_ew_priv = + map(); + +map canonical_ast::NodeFactory::s_split_priv = + map(); + +canonical_ast::ConvolutionNode* canonical_ast::NodeFactory::newConvNode(ConvolutionLayer* orig_nw_layer) +{ + typedef typename canonical_ast::Node* B; + typedef typename canonical_ast::ConvolutionNode* D; + + B b; + D d; + + b = d = new canonical_ast::ConvolutionNode(); + d->captureNetworkParams(orig_nw_layer); + + s_conv_priv.insert(std::pair(b, d)); + return d; +} + +canonical_ast::FullyConnectedNode* canonical_ast::NodeFactory::newFCNode(FullyConnectedLayer* orig_nw_layer) +{ + typedef typename canonical_ast::Node* B; + typedef typename canonical_ast::FullyConnectedNode* D; + + B b; + D d; + + b = d = new canonical_ast::FullyConnectedNode(); + d->captureNetworkParams(orig_nw_layer); + + s_fc_priv.insert(std::pair(b, d)); + return d; +} + +canonical_ast::ActivationNode* canonical_ast::NodeFactory::newActivationNode(ActivationLayer* orig_nw_layer) +{ + typedef typename canonical_ast::Node* B; + typedef typename canonical_ast::ActivationNode* D; + + B b; + D d; + + b = d = new canonical_ast::ActivationNode(); + d->captureNetworkParams(orig_nw_layer); + + s_act_priv.insert(std::pair(b, d)); + return d; +} + +canonical_ast::PoolingNode* canonical_ast::NodeFactory::newPoolingNode(PoolingLayer* orig_nw_layer) +{ + typedef typename canonical_ast::Node* B; + typedef typename canonical_ast::PoolingNode* D; + + B b; + D d; + + b = d = new canonical_ast::PoolingNode(); + d->captureNetworkParams(orig_nw_layer); + + s_pool_priv.insert(std::pair(b, d)); + return d; +} + +canonical_ast::LRNNode* canonical_ast::NodeFactory::newLRNNode(LRNLayer* orig_nw_layer) +{ + typedef typename canonical_ast::Node* B; + typedef typename canonical_ast::LRNNode* D; + + B b; + D d; + + b = d = new canonical_ast::LRNNode(); + d->captureNetworkParams(orig_nw_layer); + + s_lrn_priv.insert(std::pair(b, d)); + return d; +} + +canonical_ast::ScaleNode* canonical_ast::NodeFactory::newScaleNode(ScaleLayer* orig_nw_layer) +{ + typedef typename canonical_ast::Node* B; + typedef typename canonical_ast::ScaleNode* D; + + B b; + D d; + + b = d = new canonical_ast::ScaleNode(); + d->captureNetworkParams(orig_nw_layer); + + s_scale_priv.insert(std::pair(b, d)); + return d; +} + +canonical_ast::BatchNormNode* canonical_ast::NodeFactory::newBatchNormNode(BatchNormLayer* orig_nw_layer) +{ + typedef typename canonical_ast::Node* B; + typedef typename canonical_ast::BatchNormNode* D; + + B b; + D d; + + b = d = new canonical_ast::BatchNormNode(); + d->captureNetworkParams(orig_nw_layer); + + s_bn_priv.insert(std::pair(b, d)); + return d; +} + +canonical_ast::SoftMaxNode* canonical_ast::NodeFactory::newSoftMaxNode(SoftMaxLayer* orig_nw_layer) +{ + typedef typename canonical_ast::Node* B; + typedef typename canonical_ast::SoftMaxNode* D; + + B b; + D d; + + b = d = new canonical_ast::SoftMaxNode(); + d->captureNetworkParams(orig_nw_layer); + + s_sm_priv.insert(std::pair(b, d)); + return d; +} + +canonical_ast::ConcatenationNode* canonical_ast::NodeFactory::newConcatNode(ConcatenationLayer* orig_nw_layer) +{ + typedef typename canonical_ast::Node* B; + typedef typename canonical_ast::ConcatenationNode* D; + + B b; + D d; + + b = d = new canonical_ast::ConcatenationNode(); + d->captureNetworkParams(orig_nw_layer); + + s_concat_priv.insert(std::pair(b, d)); + return d; +} + +canonical_ast::SplitNode* canonical_ast::NodeFactory::newSplitNode(SliceLayer* orig_nw_layer) +{ + typedef typename canonical_ast::Node* B; + typedef typename canonical_ast::SplitNode* D; + + B b; + D d; + + b = d = new canonical_ast::SplitNode(); + d->captureNetworkParams(orig_nw_layer); + + s_split_priv.insert(std::pair(b, d)); + return d; +} + +canonical_ast::DeconvolutionNode* canonical_ast::NodeFactory::newDeconvNode(DeconvolutionLayer* orig_nw_layer) +{ + typedef typename canonical_ast::Node* B; + typedef typename canonical_ast::DeconvolutionNode* D; + + B b ; + D d; + + b = d = new canonical_ast::DeconvolutionNode(); + d->captureNetworkParams(orig_nw_layer); + + s_deconv_priv.insert(std::pair(b, d)); + return d; +} + +canonical_ast::ElementWiseNode* canonical_ast::NodeFactory::newEWNode(ElementWiseLayer* orig_nw_layer) +{ + typedef typename canonical_ast::Node* B; + typedef typename canonical_ast::ElementWiseNode* D; + + B b; + D d; + + b = d = new canonical_ast::ElementWiseNode(); + d->captureNetworkParams(orig_nw_layer); + + s_ew_priv.insert(std::pair(b, d)); + return d; +} + +namespace canonical_ast +{ + +template <> canonical_ast::ConvolutionNode* NodeFactory::nodeCast(canonical_ast::Node* base) +{ + map::iterator i = s_conv_priv.find(base); + if ( i == s_conv_priv.end() ) + return NULL; + return i->second; +} + +template <> canonical_ast::FullyConnectedNode* NodeFactory::nodeCast(canonical_ast::Node* base) +{ + map::iterator i = s_fc_priv.find(base); + if ( i == s_fc_priv.end() ) + return NULL; + return i->second; +} + +template <> canonical_ast::ActivationNode* NodeFactory::nodeCast(canonical_ast::Node* base) +{ + map::iterator i = s_act_priv.find(base); + if ( i == s_act_priv.end() ) + return NULL; + return i->second; +} + +template <> canonical_ast::PoolingNode* NodeFactory::nodeCast(canonical_ast::Node* base) +{ + map::iterator i = s_pool_priv.find(base); + if ( i == s_pool_priv.end() ) + return NULL; + return i->second; +} + +template <> canonical_ast::LRNNode* NodeFactory::nodeCast(canonical_ast::Node* base) +{ + map::iterator i = s_lrn_priv.find(base); + if ( i == s_lrn_priv.end() ) + return NULL; + return i->second; +} + +template <> canonical_ast::ScaleNode* NodeFactory::nodeCast(canonical_ast::Node* base) +{ + map::iterator i = s_scale_priv.find(base); + if ( i == s_scale_priv.end() ) + return NULL; + return i->second; +} + +template <> canonical_ast::BatchNormNode* NodeFactory::nodeCast(canonical_ast::Node* base) +{ + map::iterator i = s_bn_priv.find(base); + if ( i == s_bn_priv.end() ) + return NULL; + return i->second; +} + +template <> canonical_ast::SoftMaxNode* NodeFactory::nodeCast(canonical_ast::Node* base) +{ + map::iterator i = s_sm_priv.find(base); + if ( i == s_sm_priv.end() ) + return NULL; + return i->second; +} + +template <> canonical_ast::ConcatenationNode* NodeFactory::nodeCast(canonical_ast::Node* base) +{ + map::iterator i = s_concat_priv.find(base); + if ( i == s_concat_priv.end() ) + return NULL; + return i->second; +} + +template <> canonical_ast::SplitNode* NodeFactory::nodeCast(canonical_ast::Node* base) +{ + map::iterator i = s_split_priv.find(base); + if ( i == s_split_priv.end() ) + return NULL; + return i->second; +} + +template <> canonical_ast::DeconvolutionNode* NodeFactory::nodeCast(canonical_ast::Node* base) +{ + map::iterator i = s_deconv_priv.find(base); + if ( i == s_deconv_priv.end() ) + return NULL; + return i->second; +} + +template <> canonical_ast::ElementWiseNode* NodeFactory::nodeCast(canonical_ast::Node* base) +{ + map::iterator i = s_ew_priv.find(base); + if ( i == s_ew_priv.end() ) + return NULL; + return i->second; +} + + +bool CanonicalParams::hasBiasTerm() const { return false; } +void CanonicalParams::setHasBiasTerm(bool /*b*/) { } + +}; // nvdla::priv::canonical_ast_interface + +}; // nvdla::priv + +}; // nvdla:: diff --git a/umd/core/src/compiler/Check.cpp b/umd/core/src/compiler/Check.cpp new file mode 100644 index 00000000..21919f3c --- /dev/null +++ b/umd/core/src/compiler/Check.cpp @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#include "priv/Check.h" + +namespace nvdla +{ + +namespace priv +{ + +Logger::Logger() +{ + +} + +void Logger::log(Severity s, const char *msg) +{ + std::cerr << "libnvdla<" << int(s) << "> " << msg << std::endl; +} + +Logger::~Logger() +{ + +} + +static Logger _glogger; // in case there's no attempt to override... +Logger* gLogger = &_glogger; + + + +LogStream gLogInternalError; +LogStream gLogError; +LogStream gLogWarning; +LogStream gLogInfo; + +} // nvdla::priv + +} // nvdla diff --git a/umd/core/src/compiler/Compiler.cpp b/umd/core/src/compiler/Compiler.cpp new file mode 100644 index 00000000..e8cca3be --- /dev/null +++ b/umd/core/src/compiler/Compiler.cpp @@ -0,0 +1,1878 @@ +/* + * Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#include +#include +#ifdef NVDLA_COMPILER_OUTPUT_FOR_PROTOTEST +#include +#endif +#include +#include +#include +#include + +#include "ErrorMacros.h" + +#include "priv/Check.h" +#include "priv/Network.h" +#include "priv/Profiler.h" +#include "priv/Profile.h" +#include "priv/Compiler.h" +#include "priv/Loadable.h" +#include "priv/Wisdom.h" +#include "priv/TargetConfig.h" + +#ifdef NVDLA_COMPILER_OUTPUT_FOR_PROTOTEST +#include "priv/DlaPrototestInterface.pb.h" +#include +#endif + +#include "priv/DLAInterface.h" + + +#include "priv/loadable_generated.h" + + +using std::string; +using std::endl; +using std::set; +using std::vector; +using std::list; +using std::map; +using std::endl; + +namespace nvdla +{ + +ICompiler::ICompiler() { } +ICompiler::~ICompiler() { } + +#if 0 +ICompiler *createCompiler() +{ + priv::CompilerFactory::CompilerPrivPair p = priv::CompilerFactory::newCompiler(); + return p.i(); +} +#endif + + +namespace priv +{ + + +class DumpCanonicalGraphJson : public DumpGraphBase, public ast::ScoredGraphVisitor +{ +public: + DumpCanonicalGraphJson() : DumpGraphBase("canonical_graph.json", "canonical_graph"), + ast::ScoredGraphVisitor() { } + + virtual ~DumpCanonicalGraphJson() { } + virtual NvDlaError visitBegin(canonical_ast::Graph *, ast::GraphScoreboard &) + { + out().open(_m_filename, std::ios::out | std::ios::trunc); + out() << "{ \"classname\":\"graph\", \"id\":\"" << _m_graph_id << + "\", \"filename\":\"" << _m_filename << + "\", \"elements\": ["; + _m_delim = "\n"; + return NvDlaSuccess; + } + virtual NvDlaError visitElem(canonical_ast::Graph::Elem elem, ast::GraphScoreboard::Score score) + { + canonical_ast::Node *node = elem.first; + canonical_ast::Edge *edge = elem.second; + if ( node ) + { + out() << _m_delim; _m_delim = "\n,"; + out() << "{\"class\":\"node\", \"id\" : \"" << node->id() << + "\",\"className\":\"" << node->className() << + + "\",\"score\":{ \"state\": \"" << int(score.state()) << "\"" << + ", \"dis_time\": " << score.discoveryTime() << " " << + ", \"fab_time\": " << score.discoveryTime() << " " << + ", \"fin_time\": " << score.discoveryTime() << " " << + + " }"; // close score + out () << "}"; + + } + else if ( edge ) + { + canonical_ast::Graph *g = edge->graph(); + out() << _m_delim; _m_delim = "\n,"; + string delim(""); + canonical_ast::NodeSequence srcs = g->upstreamNodes(edge); + canonical_ast::NodeSequence tgts = g->downstreamNodes(edge); + // note: the (void*) cast hack is to be certain the ids given are unique. + // nodes already had a property like that. but edges didn't. + //out() << "{\"class\":\"edge\", \"id\" : \"e-" << std::hex << (void*)edge << std::dec << "\"" << + out() << "{\"class\":\"edge\"" << + ", \"id\":\"" << edge->id()<< "\""<< + // ", \"type\":\"" << edge->edgeType().c_str() << "\"" << + ", "; + out() << "\"sources\":["; + + for ( canonical_ast::NodeSequence::const_iterator si = srcs.begin(); si != srcs.end(); ++si) + { + out() << delim << "\"" << (*si)->id() << "\""; delim = ", "; + } + delim=""; + out() << "], \"targets\":["; + + for ( canonical_ast::NodeSequence::const_iterator ti = tgts.begin(); ti != tgts.end(); ++ti) + { + out() << delim << "\"" << (*ti)->id() << "\""; delim = ", "; + } + out() << "], "; + + out () << "\"score\":{ \"state\": \"" << int(score.state()) << "\"" << + ", \"dis_time\": " << score.discoveryTime() << " " << + ", \"fab_time\": " << score.discoveryTime() << " " << + ", \"fin_time\": " << score.discoveryTime() << " " << + " }"; // close score + + out() << "}"; // close edge + } + + return NvDlaSuccess; + } + virtual NvDlaError visitNode(canonical_ast::Node *, ast::GraphScoreboard::Score) + { + return NvDlaError_InvalidState; + } + virtual NvDlaError visitEdge(canonical_ast::Edge *, ast::GraphScoreboard::Score) + { + return NvDlaError_InvalidState; + } + virtual NvDlaError visitEnd(canonical_ast::Graph *, ast::GraphScoreboard &, NvDlaError ve) + { + out() << "]\n}\n"; + out().close(); + return ve; + } +}; + + +class DumpEngineGraphJson : public DumpGraphBase, public ast::ScoredGraphVisitor +{ +public: + DumpEngineGraphJson() : DumpGraphBase("engine_graph.json", "engine_graph"), + ast::ScoredGraphVisitor() { } + + virtual ~DumpEngineGraphJson() { } + + virtual NvDlaError visitBegin(engine_ast::Graph *, ast::GraphScoreboard &) + { + out().open(_m_filename, std::ios::out | std::ios::trunc); + out() << "{ \"classname\":\"graph\", \"id\":\"" << _m_graph_id << + "\", \"filename\":\"" << _m_filename << + "\", \"elements\": ["; + _m_delim = "\n"; + return NvDlaSuccess; + } + virtual NvDlaError visitElem(engine_ast::Graph::Elem elem, ast::GraphScoreboard::Score score) + { + engine_ast::Node *node = elem.first; + engine_ast::Edge *edge = elem.second; + if ( node ) + { + out() << _m_delim; _m_delim = "\n,"; + out() << "{\"class\":\"node\", \"id\" : \"" << node->name() << + "\",\"name\":\"" << node->id() << + "\",\"className\":\"" << node->className() << + + "\",\"score\":{ \"state\": \"" << int(score.state()) << "\"" << + ", \"dis_time\": " << score.discoveryTime() << " " << + ", \"fab_time\": " << score.discoveryTime() << " " << + ", \"fin_time\": " << score.discoveryTime() << " " << + + " }"; // close score + out () << "}"; + + } + else if ( edge ) + { + engine_ast::Graph *g = edge->graph(); + out() << _m_delim; _m_delim = "\n,"; + string delim(""); + engine_ast::NodeSequence srcs = g->upstreamNodes(edge); + engine_ast::NodeSequence tgts = g->downstreamNodes(edge); + // note: the (void*) cast hack is to be certain the ids given are unique. + // nodes already had a property like that. but edges didn't. + //out() << "{\"class\":\"edge\", \"id\" : \"e-" << std::hex << (void*)edge << std::dec << + out() << "{\"class\":\"edge\"" << + ", \"id\":\"" << edge->id()<< + "\", \"type\":\"" << edge->edgeType().c_str() << "\", "; + out() << "\"sources\":["; + + for ( engine_ast::NodeSequence::const_iterator si = srcs.begin(); si != srcs.end(); ++si) + { + out() << delim << "\"" << (*si)->name() << "\""; delim = ", "; + } + delim=""; + out() << "], \"targets\":["; + + for ( engine_ast::NodeSequence::const_iterator ti = tgts.begin(); ti != tgts.end(); ++ti) + { + out() << delim << "\"" << (*ti)->name() << "\""; delim = ", "; + } + out() << "], "; + + out () << "\"score\":{ \"state\": \"" << int(score.state()) << "\"" << + ", \"dis_time\": " << score.discoveryTime() << " " << + ", \"fab_time\": " << score.discoveryTime() << " " << + ", \"fin_time\": " << score.discoveryTime() << " " << + " }"; // close score + + out() << "}"; // close edge + } + return NvDlaSuccess; + } + virtual NvDlaError visitNode(Node*, ast::GraphScoreboard::Score) + { + return NvDlaError_InvalidState; + } + virtual NvDlaError visitEdge(Edge*, ast::GraphScoreboard::Score) + { + return NvDlaError_InvalidState; + } + virtual NvDlaError visitEnd(engine_ast::Graph *, ast::GraphScoreboard &, NvDlaError ve) + { + out() << "]\n}\n"; + out().close(); + return ve; + } +}; + + + +CompilerFactory::CompilerPrivPair CompilerFactory::newCompiler() +{ + ICompiler *compiler; + Compiler *compiler_priv; + compiler = compiler_priv = new priv::Compiler(); + if (compiler) { + s_priv.insert(compiler, compiler_priv); + s_self.insert(compiler, compiler); + } + return CompilerPrivPair(compiler, compiler_priv); +} + +NvDlaError CompilerFactory::deleteCompiler(ICompiler *compiler) +{ + if (compiler != NULL) { + Compiler *compiler_priv = priv(compiler); + if (compiler_priv != NULL) { + delete compiler_priv; + } + + s_priv.remove(compiler); + s_self.remove(compiler); + } + + return NvDlaSuccess; +} + +Compiler *CompilerFactory::priv(ICompiler *compiler) +{ + BiMap::left_iterator f = s_priv.find_left(compiler); + + if ( f == s_priv.end_left() ) { + return NULL; + } + return f->second; +} + +ICompiler *CompilerFactory::i(Compiler *compiler) +{ + BiMap::right_iterator f = s_priv.find_right(compiler); + if ( f == s_priv.end_right() ) { + return NULL; + } + return f->second; +} + +ICompiler *CompilerFactory::self(void *s) +{ + BiMap::left_iterator f = s_self.find_left(s); + if ( f == s_self.end_left() ) { + return NULL; + } + return f->second; +} + + +BiMap CompilerFactory::s_priv; +BiMap CompilerFactory::s_self; + + +Compiler::Compiler() : ICompiler(), m_wisdom(0) +{ +} + +Compiler::~Compiler() +{ + engine_ast::NodeFactory::clearMaps(); + + // Clear all mallocs made, so far but not freed + engine_ast::MemoryCollector::getInstance()->freeRemainingMemories(); +} + + +IWisdom *Compiler::wisdom() const +{ + return (IWisdom*)m_wisdom; // Wisdom->IWisdom ok, but tbd: hook up WisdomFactory... +} + +NvU16 Compiler::getFactoryType() const +{ + return 0; // only one kind so far +} + +NvDlaError Compiler::compileCheck(const char *tp_name, const char *target_config_name) +{ + NvDlaError e = NvDlaSuccess; + CATCH_PROPAGATE_ERROR_FAIL( + compileInternal(tp_name, target_config_name, nullptr, false /*check compile only*/) + ); + +fail: + return e; +} + +NvDlaError Compiler::compile(const char *tp_name, const char *target_config_name, ILoadable **peli) +{ + NvDlaError e = NvDlaSuccess; + CATCH_PROPAGATE_ERROR_FAIL( + compileInternal(tp_name, target_config_name, peli, true /*full compile*/) + ); + +fail: + return e; +} + +NvDlaError Compiler::compileInternal(const char *tp_name, const char *target_config_name, ILoadable **peli, bool fullCompile) +{ + NvDlaError e = NvDlaSuccess; + DLAInterface *target_dla = 0; + DLAInterface *dla_if = 0; + Profiler *profiler = 0; + ProfileFactory::ProfilePrivPair p_profile; + Profile *profile = 0; + TargetConfig *target_config = 0; + vector g; + NVDLA_UNUSED(target_dla); + NVDLA_UNUSED(dla_if); + + + LoadableFactory::LoadablePrivPair l(0, 0); + + // && == with fullCompile or otherwise ok during compileCheck? + + DumpCanonicalGraphJson dump_can; + DumpEngineGraphJson dump_eng; + + if ( !m_wisdom ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "No wisdom available."); + } + + profiler = ProfilerFactory::priv(m_wisdom->getProfiler()); + if ( !profiler ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "No profiler available."); + } + + profile = ProfileFactory::priv(profiler->getProfile(tp_name)); + if ( !profile ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Couldn't find profile to compile."); + } + + target_config = TargetConfigFactory::priv(profiler->getTargetConfig(target_config_name)); + if ( !target_config ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Couldn't find target config to compile."); + } + + + PROPAGATE_ERROR_FAIL( compileInternal(profile, target_config, peli, fullCompile) ); +fail: + return e; + +} + + +NvDlaError Compiler::compileInternal(Profile *profile, TargetConfig *target_config, ILoadable **peli, bool fullCompile) +{ + NvDlaError e = NvDlaSuccess; + DLAInterface *target_dla = 0; + DLAInterface *dla_if = 0; + ProfileFactory::ProfilePrivPair p_profile; + Network *net = 0; + vector g; + engine_ast::Graph *final_g = 0; + bool ok = true, done = false; + NVDLA_UNUSED(target_dla); + NVDLA_UNUSED(dla_if); + + canonical_ast::Graph *can_g = NULL; + + LoadableFactory::LoadablePrivPair l(0, 0); + + // && == with fullCompile or otherwise ok during compileCheck? + bool dumpCanonicalGraph = debugGraphs(); + bool dumpPreCopyOutGraph = debugGraphs(); + bool dumpEmittedGraph = debugGraphs(); + bool dumpPassGraph = debugGraphs(); + + DumpCanonicalGraphJson dump_can; + DumpEngineGraphJson dump_eng; + + net = NetworkFactory::priv(m_wisdom->getNetwork()); + if ( !net ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_InvalidState, "No network to compile."); + } + + if ( debugProfile() ) + { + gLogInfo << "Compiler profile: " << profile->getName() << endl; + gLogInfo << "\tcompute precision " << profile->computePrecision().c_str() << endl; + gLogInfo << "\tnetwork input data format " << profile->networkInputDataFormat().c_str() << endl; + gLogInfo << "\tnetwork input surface format " << profile->networkInputSurfaceFormat().c_str() << endl; + gLogInfo << "\tnetwork output data format " << profile->networkOutputDataFormat().c_str() << endl; + gLogInfo << "\tnetwork output surface format " << profile->networkOutputSurfaceFormat().c_str() << endl; + gLogInfo << "\tbatch size " << profile->multiBatchSize() << endl; + gLogInfo << "\ttensor scaling mode " << profile->tensorScalingMode().c_str() << endl; + gLogInfo << "\tquantization mode " << profile->quantizationMode().c_str() << endl; + } + + can_g = canonical_ast::generateGraph(net); + if ( !can_g ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_InvalidState, "failed to create canonical graph"); + } + + if ( dumpCanonicalGraph ) + { + dump_can.setGraphId("canonical_graph"); + dump_can.setFilename("can_g.json"); + PROPAGATE_ERROR_FAIL( dump_can.visitElems( can_g->scoredOrdering()) ); + } + + + g.push_back( engine_ast::generateGraph(profile, target_config, can_g) ); + if ( !g.back() ) + { + PROPAGATE_ERROR_FAIL(NvDlaError_InvalidState, "failed compilation phase: generateGraph"); + } + + if ( dumpEmittedGraph ) + { + engine_ast::Graph::printGraph(g.back(), true, "engine_ast::generateGraph"); + dump_eng.setGraphId("engine_graph"); + dump_eng.setFilename("engine_g.json"); + PROPAGATE_ERROR_FAIL( dump_eng.visitElems( g.back()->scoredOrdering()) ); + } + + g.push_back( registerBuffers(g.back()) ); + if ( !g.back() ) + { + PROPAGATE_ERROR_FAIL(NvDlaError_InvalidState, "failed compilation phase: registerBuffers"); + } + + g.push_back( preProcessAuxData(g.back()) ); + if ( !g.back() ) + { + PROPAGATE_ERROR_FAIL(NvDlaError_InvalidState, "failed compulation phase: preProcessAuxData"); + } + + g.push_back( mergeActivationOperations(g.back()) ); + if ( !g.back() ) + { + PROPAGATE_ERROR_FAIL(NvDlaError_InvalidState, "failed compilation phase: mergeActivationOperations"); + } + + g.push_back( updateScalingFactors(g.back()) ); + if ( !g.back() ) + { + PROPAGATE_ERROR_FAIL(NvDlaError_InvalidState, "failed compilation phase: updateScalingFactors"); + } + + g.push_back( quantizeAuxData(g.back()) ); + if ( !g.back() ) + { + PROPAGATE_ERROR_FAIL(NvDlaError_InvalidState, "failed compilation phase: quantizeAuxData"); + } + + g.push_back( fuseOnTheFlyNodes(g.back()) ); + if ( !g.back() ) + { + PROPAGATE_ERROR_FAIL(NvDlaError_InvalidState, "failed compilation phase: fuseOnTheFlyNodes"); + } + + g.push_back( handleLowPrecisionConversions(g.back()) ); + if ( !g.back() ) + { + PROPAGATE_ERROR_FAIL(NvDlaError_InvalidState, "failed compilation phase: handleLowPrecisionConversions"); + } + + g.push_back( translateAuxData(g.back()) ); + if ( !g.back() ) + { + PROPAGATE_ERROR_FAIL(NvDlaError_InvalidState, "failed compilation phase: translateAuxData"); + } + + g.push_back( reserveBuffers(g.back()) ); + if ( !g.back() ) + { + PROPAGATE_ERROR_FAIL(NvDlaError_InvalidState, "failed compilation phase: reserveBuffers"); + } + + /* + g.push_back( groupAtomicOperations(g.back()) ); + if ( !g.back() ) + { + PROPAGATE_ERROR_FAIL(NvDlaError_InvalidState, "failed compilation phase: groupAtomicOperations"); + } + */ + + g.push_back( splitNodes(g.back()) ); + if ( !g.back() ) + { + PROPAGATE_ERROR_FAIL(NvDlaError_InvalidState, "failed compilation phase: splitNodes"); + } + + g.push_back( fuseSubEngineOps(g.back()) ); + if ( !g.back() ) + { + PROPAGATE_ERROR_FAIL(NvDlaError_InvalidState, "failed compilation phase: fuseSubEngineOps"); + } + + g.push_back( boundGraph(g.back()) ); + if ( !g.back() ) + { + PROPAGATE_ERROR_FAIL(NvDlaError_InvalidState, "failed compilation phase: boundGraph"); + } + + g.push_back( handleMultiBatch(g.back()) ); + if ( !g.back() ) + { + PROPAGATE_ERROR_FAIL(NvDlaError_InvalidState, "failed compilation phase: handleMultiBatch"); + } + + /* + g.push_back( flattenGraph(g.back()) ); + if ( !g.back() ) + { + PROPAGATE_ERROR_FAIL(NvDlaError_InvalidState, "failed compilation phase: flattenGraph"); + } + */ + + if ( dumpEmittedGraph ) + { + dump_eng.setGraphId("engine_1"); + dump_eng.setFilename("engine_1.json"); + PROPAGATE_ERROR_FAIL( dump_eng.visitElems(g.back()->scoredOrdering())); + } + + if ( profile->copyOutDebugSurfaces() ) + { + if ( dumpPreCopyOutGraph ) + { + // PROPAGATE_ERROR_FAIL( dumpPre.visitElems( g.back()->scoredOrdering()) ); + // g.back()->dumpGraphJson("eng_pre_debug_copy.json", "eng_pre_debug_copy"); + } + + g.push_back( enableCopyOutDebugSurfaces( g.back() ) ); + + if ( !g.back() ) + { + PROPAGATE_ERROR_FAIL(NvDlaError_InvalidState, "failed compilation phase: enableCopyOutDebugSurfaces"); + } + + if ( dumpPreCopyOutGraph ) + { + dump_eng.setGraphId("engine_2"); + dump_eng.setFilename("engine_2.json"); + PROPAGATE_ERROR_FAIL( dump_eng.visitElems( g.back()->scoredOrdering()) ); + } + } + + // + // this is where operation order and memory placement are finalized. + // make passes until convergence or failure. + // + for ( int pass = 0; !done; ++pass ) + { + if ( dumpPassGraph ) + { + std::stringstream ss; ss << "eng_pre_pass_" << pass; + // g.back()->dumpGraphJson(ss.str() + ".json", ss.str()); + } + + engine_ast::NodeSequence topological_order; + + g.push_back( generateDependencyParams(g.back(), topological_order) ); + if ( !g.back() ) + { + PROPAGATE_ERROR_FAIL(NvDlaError_InvalidState, "failed compilation phase: generateDependencyGraphState pass=%d", pass); + } + + g.push_back( resolveMemory(g.back(), topological_order) ); + if ( !g.back() ) + { + PROPAGATE_ERROR_FAIL(NvDlaError_InvalidState, "failed compilation phase: resolveMemory pass=%d", pass); + } + + + if ( dumpPassGraph ) + { + std::stringstream ss; ss << "eng_post_pass_" << pass; + // g.back()->dumpGraphJson(ss.str() + ".json", ss.str()); + } + + done = !g.back()->dirty(); + ASSERT( done ); // shouldn't have hazards + } + + final_g = g.back(); + + + if ( fullCompile ) + { + + if ( dumpEmittedGraph ) + { + engine_ast::Graph::printGraph(final_g, true, "Final"); + dump_eng.setGraphId("emit"); + dump_eng.setFilename("emit.json"); + PROPAGATE_ERROR_FAIL( dump_eng.visitElems(final_g->scoredOrdering()) ); + } + + PROPAGATE_ERROR_FAIL( emit(final_g, l) ); + ok = l.priv() != 0; + + if ( ok ) + { + // + // this version hands back to the active profile with only the name of the profile + // for look up later. this creates the "same name as the profile" loadable. + // + m_wisdom->insertProfileSymbol( ProfileFactory::i(profile), profile->getName()); + profile->insertLoadable( std::string(profile->getName()), -1, l.i() ); + + // build flatbuffer and save it internally + (void)l.priv()->serialize(); + + if ( peli ) + { + *peli = l.i(); + } + } + } + +fail: + // + // if we start actually cloning graphs then + // there will be many more here than final_g. + // + if ( final_g ) + { + delete final_g; + } + if ( can_g ) + { + delete can_g; + } + return e; +} + + +NvDlaError Compiler::getLoadableFromWisdom(const char *tp_name, + ILoadable **i_loadable) +{ + NvDlaError e = NvDlaSuccess; + Profiler *profiler = NULL; + Profile *profile = NULL; + + if (i_loadable == NULL) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "NULL loadable"); + } + + if ( !m_wisdom ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "No wisdom available."); + } + + profiler = ProfilerFactory::priv(m_wisdom->getProfiler()); + if ( !profiler ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "No profiler available."); + } + + profile = ProfileFactory::priv(profiler->getProfile(tp_name)); + if ( !profile ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, + "Couldn't find profile to compile."); + } + + PROPAGATE_ERROR_FAIL(profile->getLoadable(tp_name, -1, i_loadable)); + if (i_loadable == NULL) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, + "Invalid loadable."); + } + + +fail: + return e; +} + +NvDlaError Compiler::getLoadableImageSize(const char *tp_name, + NvU64 *size) +{ + NvDlaError e = NvDlaSuccess; + CATCH_PROPAGATE_ERROR_FAIL(getLoadableImageSizeInternal(tp_name, size)); + +fail: + return e; +} + +NvDlaError Compiler::getLoadableImageSizeInternal(const char *tp_name, + NvU64 *size) +{ + NvDlaError e = NvDlaSuccess; + ILoadable *i_loadable = NULL; + Loadable *loadable_priv = NULL; + + if (size == NULL) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "NULL size"); + } + + PROPAGATE_ERROR_FAIL(getLoadableFromWisdom(tp_name, &i_loadable)); + loadable_priv = LoadableFactory::priv(i_loadable); + + PROPAGATE_ERROR_FAIL(loadable_priv->getSerializedDataSize(size)); + +fail: + return e; +} + + +NvDlaError Compiler::getLoadableImage(const char *tp_name, + NvU8 *flatbuf) +{ + NvDlaError e = NvDlaSuccess; + CATCH_PROPAGATE_ERROR_FAIL(getLoadableImageInternal(tp_name, flatbuf)); + +fail: + return e; +} + +NvDlaError Compiler::getLoadableImageInternal(const char *tp_name, + NvU8 *flatbuf) +{ + NvDlaError e = NvDlaSuccess; + ILoadable *i_loadable = NULL; + Loadable *loadable_priv = NULL; + + if (flatbuf == NULL) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "No buffer allocated"); + } + + PROPAGATE_ERROR_FAIL(getLoadableFromWisdom(tp_name, &i_loadable)); + loadable_priv = LoadableFactory::priv(i_loadable); + + PROPAGATE_ERROR_FAIL(loadable_priv->getSerializedData(flatbuf)); + +fail: + return e; +} + +/* + + each DLA task's address list contains two sorts of entries: + . those used by emitted instructions + . those which define the task's context (addr0, buffer descriptors, etc). + + task address id 0 is special and must be the network descriptor/addr0. + + we force instructions use address ids 1 -> Ni (whatever we determine 'Ni' is). + + name the task's context entries addr0, addr1, addr2, etc... + then arrange such that tasks' address lists have the following form: + + taskAddrList[0] -> task network desc/addr0 + taskAddrList[1] -> globalAddrList[1] + taskAddrList[Ni] -> globalAddrList[Ni] + taskAddrList[(Ni+1) + 0] -> dep list/addr1 + taskAddrList[(Ni+1) + 1] -> op desc/addr2 + taskAddrList[(Ni+1) + 2] -> surf list/addr3 + taskAddrList[(Ni+1) + 3] -> lut/addr4 + taskAddrList[(Ni+1) + 4] -> dummy/addr5 + + read these like: + . "the task's address list entry 0 refers to the global address list entry for it's addr0." + . "the task's address list entry 1 refers to global address list entry 1." + . "the task's address list entry at (Ni+1)+2 refers to the global address list entry for the task's surface list." + + + rewriting for a general task 'i', parmeterizing naming and simplifying indexing: + + taskAddrList(i)[0] -> globalAddrList[ taskContextAddr(i, 0) ] ; addr0 + taskAddrList(i)[1] -> globalAddrList[ 1 ]; ; 1 + taskAddrList(i)[Ni] -> globalAddrList[ Ni ]; ; In + taskAddrList(i)[Ni + 1 ] -> globalAddrList[ taskContextAddr(i, 1) ] ; addr1 + taskAddrList(i)[Ni + 2 ] -> globalAddrList[ taskContextAddr(i, 2) ] ; addr2 + taskAddrList(i)[Ni + 3 ] -> globalAddrList[ taskContextAddr(i, 3) ] ; addr3 + taskAddrList(i)[Ni + 4 ] -> globalAddrList[ taskContextAddr(i, 4) ] ; addr4 + taskAddrList(i)[Ni + 5 ] -> globalAddrList[ taskContextAddr(i, 5) ] ; addr5 + + the left hand side refers to the entries for any given task 'i' and the right hand side makes use of + 'taskContextAddr' which hasn't been defined yet but returns the relevant index into the global address list. + + + the "global address list" from which the tasks' address lists are derived is of the following form: + + globalAddrList[0] -> dummy page/zero hole + + globalAddrList[1] -> addr id 1 for all emitted instructions + globalAddrList[Ni] -> last instruction addr id + + ; task-0 context items (assume DLA here and below, with EMU similar) + globalAddrList[(Ni+1) +0 ] -> task_0 addr0 + globalAddrList[(Ni+1) +1 ] -> task_0 dep list + globalAddrList[(Ni+1) +2 ] -> task_0 surf desc + globalAddrList[(Ni+1) +3 ] -> task_0 lut desc + globalAddrList[(Ni+1) +4 ] -> task_0 last context item + globaladdrList[(Ni+1) +5 ] -> task_0 dummy + ... + + ; task-i context + global_addr_list[(n+1)+(i*6)+0] ; -> task_i addr0 + ... + global_addr_list[(n+1)+(i*6)+5] ; -> task_+i last item + + + note: the per-task context items get separated (non-contig) into addr0, addrs and then + everything else when stuffed into the individual task address lists. because of that the + offsets to the context items jump around between global and task lists. + + there's potential for many more address list entries than memory list entries. + depending upon how the address list entries are coalesced (or not) during instruction emit + they can also be almost 1:1 (if heavily pooled, say). + + */ + + +class TaskAddressList +{ +public: + // static const int16_t addr0_global_task_offs = 0; + // static const int16_t dep_graph_global_task_offs = 1; + // static const int16_t op_list_global_task_offs = 2; + // static const int16_t surf_list_global_task_offs = 3; + // static const int16_t lut_list_global_task_offs = 4; + // static const int16_t dummy_global_task_offs = 5; + + static int16_t numContextAddrs() { return 6; } // num_global_task_offs = 6; +}; + +class GlobalAddressList +{ +public: + GlobalAddressList() : m_numInstrMemEntries(0), m_numInstrAddrEntries(0), m_numTasks(0) { } + + GlobalAddressList(const GlobalAddressList &o) : + m_numInstrMemEntries(o.m_numInstrMemEntries), m_numInstrAddrEntries(o.m_numInstrAddrEntries), + m_memListEntries(o.m_memListEntries), m_addrListEntries(o.m_addrListEntries), + m_numTasks(o.m_numTasks) { } + + GlobalAddressList(size_t numTasks, + const std::vector &instrMemEntries, + const std::vector &instrAddrEntries) + { + // + // create mem id and address id entries for the dead page at address id == 0. + // + Loadable::MemoryListEntry memZeroEntry(0, 4096, 4096, Loadable::MemoryListEntry::domain_sysmem(), Loadable::MemoryListEntry::flags_alloc()); + Loadable::AddressListEntry addrZeroEntry(0, memZeroEntry.id, memZeroEntry.size); + + m_memListEntries.push_back(memZeroEntry); + m_addrListEntries.push_back(addrZeroEntry); + + m_memListEntries.insert (m_memListEntries.end(), instrMemEntries.begin(), instrMemEntries.end()); + m_addrListEntries.insert(m_addrListEntries.end(), instrAddrEntries.begin(), instrAddrEntries.end()); + + m_numInstrMemEntries = instrMemEntries.size(); + m_numInstrAddrEntries = instrAddrEntries.size(); + + m_numTasks = numTasks; + + m_addrListEntries.resize( 1 /*the zero entry*/ + m_numInstrAddrEntries + (TaskAddressList::numContextAddrs() * m_numTasks), + addrZeroEntry /* fill with references to the zero mem entry */); + + } + + NvS16 taskContextBegin(NvS16 taskId) const + { + // skip 0, then 1..n is 1..numInstrAddrEntries + return (m_numInstrAddrEntries + 1) + (taskId * TaskAddressList::numContextAddrs()); + } + + NvS16 taskContextEnd(NvS16 taskId) const // ala iterator, points to one-beyond + { + return taskContextBegin(taskId) + TaskAddressList::numContextAddrs(); + } + +#if 0 + size_t numAddrEntries() const + { + return m_addrListEntries.size(); + } +#endif + size_t numInstrMemEntries() const { return m_numInstrMemEntries; } + size_t numInstrAddrEntries() const { return m_numInstrAddrEntries; } + + vector &memList() { return m_memListEntries; } + vector &addrList() { return m_addrListEntries; } + +protected: + size_t m_numInstrMemEntries; + size_t m_numInstrAddrEntries; + vector m_memListEntries; + vector m_addrListEntries; + size_t m_numTasks; + +}; + + +NvDlaError Compiler::emit(engine_ast::Graph * g, LoadableFactory::LoadablePrivPair &l) +{ + NvDlaError e = NvDlaSuccess; + DLAInterface *dla_if = 0; + EMUInterface *emu_if = 0; + + Loadable *loadable = 0; + + vector< engine_ast::Node* >::iterator anni; + + bool isEMU; + vector< vector::iterator > task_starting_points; + vector< size_t > task_slot_counts; + vector< NvS16 > task_ids; + NVDLA_UNUSED(isEMU); + + GlobalAddressList gal; + size_t Ni; + + vector task_list_entries; + size_t num_tasks; + + vector submit_list_entries; + + vector event_list_entries; + + ILoadable::EventListEntry event; + NvU16 event_id; + NVDLA_UNUSED(event_id); + + vector reloc_entries; + +#ifdef NVDLA_COMPILER_OUTPUT_FOR_PROTOTEST + GOOGLE_PROTOBUF_VERIFY_VERSION; + + std::fstream protobufFile ("output.protobuf", std::ios::out | std::ios::trunc); + nvdla_prototest_interface::Test protoTest; + nvdla_prototest_interface::TestInfo* protoTestInfo = protoTest.mutable_test(); + protoTestInfo->set_allocated_event_list(0); +#endif + + l = LoadableFactory::LoadablePrivPair(0, 0); + + // if nothing else make sure the right version + // is being targeted, most of the struct references will be + // offsets and the like of where to put things... might be + // inline definitions and such to bit ops, etc. + + dla_if = getTargetDLAInterface(NULL); + emu_if = new EMUInterfaceA(); + + if ( debugVersions() ) + { + gLogInfo << "compiler targeting dla (fw) interface " << + (int)dla_if->firmwareTargetVersionMajor() << "." << + (int)dla_if->firmwareTargetVersionMinor() << endl; + + gLogInfo << "compiler targeting emu (cpu) interface " << + (int)emu_if->emulatorTargetVersionMajor() << "." << + (int)emu_if->emulatorTargetVersionMinor() << endl; + } + + l = LoadableFactory::newLoadable(); + if ( !l ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Error allocating new loadable"); + } + loadable = l.priv(); + + // + // begin building execution context and placing into the loadable + // + g->resetRelocEntries(); + + PROPAGATE_ERROR_FAIL( g->prepareMemoryListEntries(loadable) ); + + task_slot_counts.resize(g->graphlets().size()); + + for (vector::iterator gli = g->graphlets().begin(); gli != g->graphlets().end(); ++gli) + { + engine_ast::Graph::Graphlet *graphlet = *gli; + NvS16 taskId; + engine_ast::Node *first_node; + NVDLA_UNUSED(taskId); + + first_node = *graphlet->nodeList().begin(); + task_starting_points.push_back(graphlet->nodeList().begin()); + task_ids.push_back(first_node->taskId()); + task_slot_counts[task_starting_points.size() - 1] = graphlet->nodeList().size(); + } + num_tasks = task_starting_points.size(); + + gal = GlobalAddressList(num_tasks, loadable->getMemoryListEntries(), loadable->getAddressListEntries()); + Ni = gal.numInstrAddrEntries(); + + if ( debugTasks() || debugMemoryLayout() ) + { + gLogInfo << __func__ << " discovered " << num_tasks << " tasks" << endl; + gLogInfo << "the initial mem list size is " << gal.numInstrMemEntries() << " entries" << endl; + gLogInfo << "the initial addr list size is " << gal.numInstrAddrEntries() << " entries" << endl; + } + + +#ifdef NVDLA_COMPILER_OUTPUT_FOR_PROTOTEST + protoTestInfo->set_num_tasks(num_tasks); + protoTestInfo->set_num_buffers(gal.numInstrMemEntries()); +#endif + + task_list_entries.resize(num_tasks); + + + // + // scan the set of tasks and assign to submit list entries + // + for ( size_t ti = 0; ti < num_tasks; ++ti) + { + ILoadable::SubmitListEntry sle; + sle.id = task_ids.at(ti); + sle.tasks.push_back(sle.id); + submit_list_entries.push_back(sle); + } + + // + // one chain (target 0) exists to provide inter-task synchronization. + // this is the chain that keeps cpu(emu) and hw(dla) tasks synchronized. + // at the end of that chain is an output-bindable event that the caller + // can use to wait for completion. + // + + event_list_entries.clear(); + + event.id = 0; + event.val = 0; + event.target = 0; + + // + // for each task... + // + for ( size_t ti = 0; ti < num_tasks; ++ti) + { + size_t num_op_slots = task_slot_counts.at(ti); + NvU32 num_batches = g->profile()->multiBatchSize(); + NvS16 taskId = task_ids.at(ti); + NvS16 taskContextBegin = gal.taskContextBegin(ti); + + NvU16 preaction = 0; + NvU16 postaction = 0; + + if ( ti != 0 ) + { + preaction = event.id; + event.op = nvdla::ILoadable::EventListEntry::op_wait(); + event_list_entries.push_back(event); + event.id++; + } + + postaction = event.id; + event.val++; + event.op = nvdla::ILoadable::EventListEntry::op_signal(); + event_list_entries.push_back(event); + event.id++; + +#ifdef NVDLA_COMPILER_OUTPUT_FOR_PROTOTEST + nvdla_prototest_interface::TasksData* protoTaskData = protoTestInfo->add_task(); + protoTaskData->set_task_id(taskId); + + /* post action */ + protoTaskData->mutable_schedule()->mutable_post_actions()->add_event_id(postaction); + + /* event list */ + nvdla_prototest_interface::Event* protoTestEvent = protoTestInfo->mutable_event_list()->add_event(); + protoTestEvent->set_event_id(0); + protoTestEvent->set_event_type(nvdla_prototest_interface::Event_EventType::Event_EventType_SYNCPOINT); + protoTestEvent->set_event_flags(0); + + /* task slots */ + nvdla_prototest_interface::SubmitSlot* protoTestInfoSubmitSlot = protoTestInfo->add_slots(); + protoTestInfoSubmitSlot->add_task_id(taskId); + + /* task data */ + nvdla_prototest_interface::Network* protoNw = protoTaskData->mutable_network(); + nvdla_prototest_interface::NetworkDesc* protoNwDesc = protoNw->mutable_param(); + nvdla_prototest_interface::NetworkLayer* protoNwLayers = protoNw->mutable_layers(); + nvdla_prototest_interface::LUTParamList* protoNwLUTList = protoNw->mutable_lut_list(); + nvdla_prototest_interface::ROIDescription* protoNwROIDesc = protoNw->mutable_roi_list(); + NVDLA_UNUSED(protoNwLUTList); +#endif + + if ( debugTasks() ) + { + gLogInfo << "task_id=" << taskId << " has " << num_op_slots << " op slots and " << num_batches << " batches "<< endl; + + gLogInfo << "\taddress list task context at [" << gal.taskContextBegin(ti) << ", " << gal.taskContextEnd(ti) << ")" << endl; + } + + anni = task_starting_points[ti]; + + // g->resetRelocEntries(); // reloc entries really only matter for one task at a time. + + if ( ! (*anni)->isEMUEngineType() ) + { + +#ifdef NVDLA_COMPILER_OUTPUT_FOR_PROTOTEST + protoTaskData->set_engine_id(nvdla_prototest_interface::EngineID::DLA_0); +#endif + + size_t network_desc_size = dla_if->networkDescAccessor(0).struct_size(); + NvU8 *network_desc_mem = new NvU8[ network_desc_size ]; + memset(network_desc_mem, 0, network_desc_size); + DLANetworkDescAccessor network_desc = dla_if->networkDescAccessor( network_desc_mem ); + + size_t dep_container_entry_size = dla_if->commonOpDescAccessor(0).struct_size(); + size_t dep_container_size = dep_container_entry_size * num_op_slots * num_batches; + NvU8 *dep_container_mem = new NvU8[dep_container_size]; + memset(dep_container_mem, 0, dep_container_size); + + size_t op_container_entry_size = dla_if->operationContainerAccessor(0).struct_size(); + size_t op_container_size = op_container_entry_size * num_op_slots * num_batches; + NvU8 *op_container_mem = new NvU8[op_container_size]; + memset(op_container_mem, 0, op_container_size); + + size_t surf_container_entry_size = dla_if->surfaceContainerAccessor(0).struct_size(); + size_t surf_container_size = surf_container_entry_size * num_op_slots * num_batches; + NvU8 *surf_container_mem = new NvU8[surf_container_size]; + memset(surf_container_mem, 0, surf_container_size); + + // Reserve space for at least one LUT, even if unused + NvU16 num_LUTS = g->lutManager()->getNumRegisteredLuts() <= 0 ? 0 : (NvU16)g->lutManager()->getNumRegisteredLuts(); + size_t lut_container_entry_size = dla_if->lutParamAccessor(0).struct_size(); + size_t lut_container_size = lut_container_entry_size * ((g->lutManager()->getNumRegisteredLuts() <= 0) ? 1 : g->lutManager()->getNumRegisteredLuts()); + NvU8 *lut_container_mem = new NvU8[lut_container_size]; + memset(lut_container_mem, 0, lut_container_size); + + DLALUTParamAccessor lut_container = dla_if->lutParamAccessor(lut_container_mem); + NVDLA_UNUSED(lut_container); + + for ( NvU32 op_slot = 0; op_slot < num_op_slots; ++op_slot ) + { + for (NvU32 batch_id = 0; batch_id < num_batches; ++batch_id) + { + NvS16 batch_slot = op_slot*num_batches + batch_id; + if ( batch_slot != (*anni)->dependencyParams(batch_id).annotationId() ) + { + gLogError << "Inconsistencies between slot_id and annotation id " + << batch_slot + << " != " + << (*anni)->dependencyParams(batch_id).annotationId() << std::endl; + goto fail; + } + + DLACommonOpDescAccessor dep_acc = dla_if->commonOpDescAccessor(dep_container_mem + (batch_slot * dep_container_entry_size)); + DLAOperationContainerAccessor op_acc = dla_if->operationContainerAccessor(op_container_mem + (batch_slot * op_container_entry_size)); + DLASurfaceContainerAccessor surf_acc = dla_if->surfaceContainerAccessor(surf_container_mem + (batch_slot * surf_container_entry_size)); + + e = (*anni)->emitOp(g, dla_if, (*anni)->dependencyParams(batch_id).annotationId(), batch_id, dep_acc, op_acc, surf_acc); +#ifdef NVDLA_COMPILER_OUTPUT_FOR_PROTOTEST + nvdla_prototest_interface::Layer* protoNewLayer = protoNwLayers->add_layer(); + e = (*anni)->emitOp((*anni)->dependencyParams(batch_id).annotationId(), batch_id, dla_if, dep_acc, op_acc, surf_acc, protoNewLayer); +#endif + } + ++anni; + } + + std::stringstream task_id_ss; + task_id_ss << "task-" << taskId; + + string network_desc_symbol = task_id_ss.str() + "-addr0"; + string dep_container_symbol = task_id_ss.str() + "-dep_graph"; + string op_container_symbol = task_id_ss.str() + "-op_list"; + string surf_container_symbol = task_id_ss.str() + "-surf_list"; + string lut_container_symbol = task_id_ss.str() + "-lut_list"; + + ILoadable::Version fwVersion(dla_if->firmwareTargetVersionMajor(), + dla_if->firmwareTargetVersionMinor(), + dla_if->firmwareTargetVersionSubminor()); + + ILoadable::Blob network_desc_blob(network_desc_symbol, network_desc_size, ILoadable::Interface_DLA1, NVDLA_LOADABLE_SUB_INTERFACE_DLA1_ADDR0, fwVersion); + ILoadable::Blob dep_container_blob(dep_container_symbol, dep_container_size, ILoadable::Interface_DLA1, NVDLA_LOADABLE_SUB_INTERFACE_DLA1_DEPS, fwVersion); + ILoadable::Blob op_container_blob(op_container_symbol, op_container_size, ILoadable::Interface_DLA1, NVDLA_LOADABLE_SUB_INTERFACE_DLA1_OPS, fwVersion); + ILoadable::Blob surf_container_blob(surf_container_symbol, surf_container_size, ILoadable::Interface_DLA1, NVDLA_LOADABLE_SUB_INTERFACE_DLA1_SURFS, fwVersion); + ILoadable::Blob lut_container_blob(lut_container_symbol, lut_container_size, ILoadable::Interface_DLA1, NVDLA_LOADABLE_SUB_INTERFACE_DLA1_LUTS, fwVersion); + + loadable->setSymbolContent(network_desc_symbol, network_desc_blob, (NvU8*)network_desc_mem); + loadable->setSymbolContent(dep_container_symbol, dep_container_blob, (NvU8*)dep_container_mem); + loadable->setSymbolContent(op_container_symbol, op_container_blob, (NvU8*)op_container_mem); + loadable->setSymbolContent(surf_container_symbol, surf_container_blob, (NvU8*)surf_container_mem); + loadable->setSymbolContent(lut_container_symbol, lut_container_blob, (NvU8*)lut_container_mem); + + NvU8 set_content = ILoadable::MemoryListEntry::flags_alloc() | ILoadable::MemoryListEntry::flags_set(); + NvU8 domain_sysmem = ILoadable::MemoryListEntry::domain_sysmem(); + + ILoadable::MemoryListEntry addr0_mle(gal.memList().size(), network_desc_size, 4096, domain_sysmem, set_content, network_desc_symbol); + ILoadable::MemoryListEntry dep_mle(addr0_mle.id + 1, dep_container_size, 4096, domain_sysmem, set_content, dep_container_symbol); + ILoadable::MemoryListEntry op_mle( dep_mle.id + 1, op_container_size, 4096, domain_sysmem, set_content, op_container_symbol); + ILoadable::MemoryListEntry surf_mle(op_mle.id + 1, surf_container_size, 4096, domain_sysmem, set_content, surf_container_symbol); + ILoadable::MemoryListEntry lut_mle(surf_mle.id + 1, lut_container_size, 4096, domain_sysmem, set_content, lut_container_symbol); + ILoadable::MemoryListEntry dummy_mle(lut_mle.id + 1, 4096, 4096, domain_sysmem, ILoadable::MemoryListEntry::flags_alloc()); + + gal.memList().push_back(addr0_mle); + gal.memList().push_back(dep_mle); + gal.memList().push_back(op_mle); + gal.memList().push_back(surf_mle); + gal.memList().push_back(lut_mle); + gal.memList().push_back(dummy_mle); + + + task_list_entries.at(ti).id = taskId; + task_list_entries.at(ti).interface = ILoadable::TaskListEntry::interface_DLA1(); + task_list_entries.at(ti).instance = ILoadable::TaskListEntry::instance_ANY(); + task_list_entries.at(ti).preactions.clear(); + task_list_entries.at(ti).postactions.clear(); + if ( ti != 0 ) + { + task_list_entries.at(ti).preactions.push_back(preaction); + } + task_list_entries.at(ti).postactions.push_back(postaction); + + vector taskAddrList; + + gal.addrList().at(taskContextBegin + 0) = Loadable::AddressListEntry(taskContextBegin + 0, addr0_mle.id, addr0_mle.size); + gal.addrList().at(taskContextBegin + 1) = Loadable::AddressListEntry(taskContextBegin + 1, dep_mle.id, dep_mle.size); + gal.addrList().at(taskContextBegin + 2) = Loadable::AddressListEntry(taskContextBegin + 2, op_mle.id, op_mle.size); + gal.addrList().at(taskContextBegin + 3) = Loadable::AddressListEntry(taskContextBegin + 3, surf_mle.id, surf_mle.size); + gal.addrList().at(taskContextBegin + 4) = Loadable::AddressListEntry(taskContextBegin + 4, lut_mle.id, lut_mle.size); + gal.addrList().at(taskContextBegin + 5) = Loadable::AddressListEntry(taskContextBegin + 5, dummy_mle.id, dummy_mle.size); + + + taskAddrList.resize( Ni + TaskAddressList::numContextAddrs()); + + // taskAddr[0] := addr0 + taskAddrList.at(0) = taskContextBegin + 0; + + // now instruction entries + for (size_t ii = 1; ii <= Ni; ++ii) + { + taskAddrList.at(ii) = ii; + } + + // then (the rest of) the task context. note that addr0 is separated. start at the next (one) instead. + for (size_t ai = 1, AI = TaskAddressList::numContextAddrs(); ai < AI; ++ai) + { + taskAddrList.at(Ni + ai) = taskContextBegin + ai; + } + + if ( debugTasks() ) + { + gLogInfo << "\ttask address list (indices into global address list): " << endl; + for ( size_t ii = 0; ii < taskAddrList.size(); ++ii) + { + gLogInfo << "\t\t" << taskAddrList.at(ii) << endl; + } + gLogInfo << "\t\t<>" << endl; + } + + // Now that we know where dep_graph, op_list, and surf_list live, we can build the network_desc + *network_desc.dependencyGraphIndex() = Ni + 1; + *network_desc.operationDescIndex() = Ni + 2; + *network_desc.surfaceDescIndex() = Ni + 3; + *network_desc.LUTDataIndex() = Ni + 4; + *network_desc.ROIArrayIndex() = -1; // Bogus + *network_desc.surfaceIndex() = -1; // Bogus + *network_desc.statListIndex() = -1; // Bogus + *network_desc.numROIs() = 1; + *network_desc.numOperations() = num_op_slots * num_batches; + *network_desc.numLUTs() = g->lutManager()->getNumRegisteredLuts(); + *network_desc.numAddresses() = taskAddrList.size(); + *network_desc.dynamicROI() = 0; // Bogus + *network_desc.inputLayer() = 0; // Bogus + + // Map opHeads + vector& graphlet = g->graphlets(); + vector& opHeads = graphlet[ti]->opHeads(); + + *network_desc.opHead(network_desc.op_BDMA()) = opHeads[engine_ast::EngineTypeEnum::BDMA] ? opHeads[engine_ast::EngineTypeEnum::BDMA]->dependencyParams(/*batchId*/0).annotationId() : -1; + *network_desc.opHead(network_desc.op_CONV()) = opHeads[engine_ast::EngineTypeEnum::CONVOLUTION] ? opHeads[engine_ast::EngineTypeEnum::CONVOLUTION]->dependencyParams(/*batchId*/0).annotationId() : -1; + *network_desc.opHead(network_desc.op_SDP()) = opHeads[engine_ast::EngineTypeEnum::SDP] ? opHeads[engine_ast::EngineTypeEnum::SDP]->dependencyParams(/*batchId*/0).annotationId() : -1; + *network_desc.opHead(network_desc.op_PDP()) = opHeads[engine_ast::EngineTypeEnum::PDP] ? opHeads[engine_ast::EngineTypeEnum::PDP]->dependencyParams(/*batchId*/0).annotationId() : -1; + *network_desc.opHead(network_desc.op_CDP()) = opHeads[engine_ast::EngineTypeEnum::CDP] ? opHeads[engine_ast::EngineTypeEnum::CDP]->dependencyParams(/*batchId*/0).annotationId() : -1; + *network_desc.opHead(network_desc.op_RUBIK()) = opHeads[engine_ast::EngineTypeEnum::RUBIK] ? opHeads[engine_ast::EngineTypeEnum::RUBIK]->dependencyParams(/*batchId*/0).annotationId() : -1; + + // Write LUTs + for ( NvU16 lut_slot = 0; lut_slot < num_LUTS; ++lut_slot) + { + DLALUTParamAccessor lut_acc = dla_if->lutParamAccessor(lut_container_mem + (lut_slot * lut_container_entry_size)); + PROPAGATE_ERROR_FAIL(g->lutManager()->writeLutData(lut_slot, lut_acc)); + } + +#ifdef NVDLA_COMPILER_OUTPUT_FOR_PROTOTEST + protoNwDesc->set_operation_desc_index(*network_desc.operationDescIndex()); + protoNwDesc->set_surface_desc_index(*network_desc.surfaceDescIndex()); + protoNwDesc->set_dependency_graph_index(*network_desc.dependencyGraphIndex()); + protoNwDesc->set_lut_data_index(*network_desc.LUTDataIndex()); + protoNwDesc->set_roi_array_index(*network_desc.ROIArrayIndex()); + protoNwDesc->set_surface_index(*network_desc.surfaceIndex()); + protoNwDesc->add_op_head(*network_desc.opHead(network_desc.op_BDMA())); + protoNwDesc->add_op_head(*network_desc.opHead(network_desc.op_CONV())); + protoNwDesc->add_op_head(*network_desc.opHead(network_desc.op_SDP())); + protoNwDesc->add_op_head(*network_desc.opHead(network_desc.op_PDP())); + protoNwDesc->add_op_head(*network_desc.opHead(network_desc.op_CDP())); + protoNwDesc->add_op_head(*network_desc.opHead(network_desc.op_RUBIK())); + protoNwDesc->set_stat_list_index(*network_desc.statListIndex()); + protoNwDesc->set_num_rois(*network_desc.numROIs()); + protoNwDesc->set_num_operations(*network_desc.numOperations()); + protoNwDesc->set_num_luts(*network_desc.numLUTs()); + protoNwDesc->set_num_addresses(*network_desc.numAddresses()); + protoNwDesc->set_dynamic_roi(*network_desc.dynamicROI()); + protoNwDesc->set_input_layer(*network_desc.inputLayer()); + + /* NOP */ + protoNwROIDesc->mutable_roi_arr()->set_array_length(0); + protoNwROIDesc->mutable_roi_arr()->set_array_reserved(0); +#endif + + task_list_entries.at(ti).address_list = taskAddrList; + + g->gatherRelocEntries(op_mle.id, op_container_mem, + surf_mle.id, surf_container_mem, + dep_mle.id, dep_container_mem); + } + else + { + task_list_entries.at(ti).id = taskId; + task_list_entries.at(ti).interface = ILoadable::TaskListEntry::interface_EMU1(); + task_list_entries.at(ti).instance = ILoadable::TaskListEntry::instance_ANY(); + task_list_entries.at(ti).preactions.clear(); + task_list_entries.at(ti).postactions.clear(); + if ( ti != 0 ) + { + task_list_entries.at(ti).preactions.push_back(preaction); + } + task_list_entries.at(ti).postactions.push_back(postaction); + + + // EMU currently only supports 1 op slot + size_t num_ops = 1; + NvU32 num_batches = g->profile()->multiBatchSize(); + + // Allocate the network descriptor + size_t network_desc_size = emu_if->networkDescAccessor(0).struct_size(); + NvU8* network_desc_mem = new NvU8[ network_desc_size ]; + memset(network_desc_mem, 0, network_desc_size); + EMUNetworkDescAccessor network_desc = emu_if->networkDescAccessor( network_desc_mem ); + + // Allocate the operation descriptor list + size_t op_container_entry_size = emu_if->operationContainerAccessor(0).struct_size(); + size_t op_container_size = op_container_entry_size * num_ops * num_batches; + NvU8 *op_container_mem = new NvU8[op_container_size]; + memset(op_container_mem, 0, op_container_size); + + // Allocate the operation buffer descriptor list + size_t op_buffer_container_entry_size = emu_if->operationBufferContainerAccessor(0).struct_size(); + size_t op_buffer_container_size = op_buffer_container_entry_size * num_ops * num_batches; + NvU8 *op_buffer_container_mem = new NvU8[op_buffer_container_size]; + memset(op_buffer_container_mem, 0, op_buffer_container_size); + + for (NvU32 op_slot=0; op_slot < num_ops; ++op_slot) + { + for (NvU32 batch_id = 0; batch_id < num_batches; ++batch_id) + { + NvS16 batch_slot = op_slot*num_batches + batch_id; + if ( batch_slot != (*anni)->dependencyParams(batch_id).annotationId() ) + { + gLogError << "Inconsistencies between slot_id and annotation id " + << batch_slot + << " != " + << (*anni)->dependencyParams(batch_id).annotationId() << std::endl; + goto fail; + } + EMUOperationContainerAccessor op_acc = emu_if->operationContainerAccessor(op_container_mem + (batch_slot * op_container_entry_size)); + EMUOperationBufferContainerAccessor buf_acc = emu_if->operationBufferContainerAccessor(op_buffer_container_mem + (batch_slot * op_buffer_container_entry_size)); + + e = (*anni)->emitOp(g, emu_if, (*anni)->dependencyParams(batch_id).annotationId(), batch_id, op_acc, buf_acc); + } + ++anni; + } + + std::stringstream task_id_ss; + task_id_ss << "task-" << taskId; + + string network_desc_symbol = task_id_ss.str() + "-addr0"; + string op_container_symbol = task_id_ss.str() + "-op_list"; + string op_buffer_container_symbol = task_id_ss.str() + "-op_buf_list"; + + ILoadable::Version emuVersion(emu_if->emulatorTargetVersionMajor(), + emu_if->emulatorTargetVersionMinor(), + emu_if->emulatorTargetVersionSubminor()); + + ILoadable::Blob network_desc_blob(network_desc_symbol, network_desc_size, ILoadable::Interface_EMU1, NVDLA_LOADABLE_SUB_INTERFACE_EMU1_ADDR0, emuVersion); + ILoadable::Blob op_container_blob(op_container_symbol, op_container_size, ILoadable::Interface_EMU1, NVDLA_LOADABLE_SUB_INTERFACE_EMU1_OPS, emuVersion); + ILoadable::Blob op_buffer_container_blob(op_buffer_container_symbol, op_buffer_container_size, ILoadable::Interface_EMU1, NVDLA_LOADABLE_SUB_INTERFACE_EMU1_SURFS, emuVersion); + + loadable->setSymbolContent(network_desc_symbol, network_desc_blob, (NvU8*)network_desc_mem); + loadable->setSymbolContent(op_container_symbol, op_container_blob, (NvU8*)op_container_mem); + loadable->setSymbolContent(op_buffer_container_symbol, op_buffer_container_blob, (NvU8*)op_buffer_container_mem); + + NvU8 alloc = ILoadable::MemoryListEntry::flags_alloc(); + NvU8 set_content = ILoadable::MemoryListEntry::flags_alloc() | ILoadable::MemoryListEntry::flags_set(); + NvU8 domain_sysmem = ILoadable::MemoryListEntry::domain_sysmem(); + + ILoadable::MemoryListEntry addr0_mle (gal.memList().size(), network_desc_size, 4096, domain_sysmem, set_content, network_desc_symbol); + ILoadable::MemoryListEntry op_mle (addr0_mle.id + 1, op_container_size, 4096, domain_sysmem, set_content, op_container_symbol); + ILoadable::MemoryListEntry op_buf_mle(op_mle.id + 1, op_buffer_container_size, 4096, domain_sysmem, set_content, op_buffer_container_symbol); + + gal.memList().push_back(addr0_mle); + gal.memList().push_back(op_mle); + gal.memList().push_back(op_buf_mle); + + ILoadable::MemoryListEntry dummy1_mle(op_buf_mle.id + 1, 4096, 4096, domain_sysmem, alloc); + ILoadable::MemoryListEntry dummy2_mle(dummy1_mle.id + 1, 4096, 4096, domain_sysmem, alloc); + ILoadable::MemoryListEntry dummy3_mle(dummy2_mle.id + 1, 4096, 4096, domain_sysmem, alloc); + + gal.memList().push_back(dummy1_mle); + gal.memList().push_back(dummy2_mle); + gal.memList().push_back(dummy3_mle); + + vector taskAddrList; + + gal.addrList().at(taskContextBegin + 0) = ILoadable::AddressListEntry(taskContextBegin + 0, addr0_mle.id, addr0_mle.size); + gal.addrList().at(taskContextBegin + 1) = ILoadable::AddressListEntry(taskContextBegin + 1, op_mle.id, op_mle.size); + gal.addrList().at(taskContextBegin + 2) = ILoadable::AddressListEntry(taskContextBegin + 2, op_buf_mle.id, op_buf_mle.size); + gal.addrList().at(taskContextBegin + 3) = ILoadable::AddressListEntry(taskContextBegin + 3, dummy1_mle.id, dummy1_mle.size); + gal.addrList().at(taskContextBegin + 4) = ILoadable::AddressListEntry(taskContextBegin + 4, dummy2_mle.id, dummy2_mle.size); + gal.addrList().at(taskContextBegin + 5) = ILoadable::AddressListEntry(taskContextBegin + 5, dummy3_mle.id, dummy3_mle.size); + + taskAddrList.resize(Ni + TaskAddressList::numContextAddrs() ); + + // addr0 + taskAddrList.at(0) = taskContextBegin + 0; + + // now instruction entries + for (size_t ii = 1; ii <= Ni; ++ii) + { + taskAddrList.at(ii) = ii; + } + + // then (the rest of) the task context. + for (size_t ai = 1, AI = TaskAddressList::numContextAddrs(); ai < AI; ++ai) + { + taskAddrList.at(Ni + ai) = taskContextBegin + ai; + } + + if ( debugTasks() ) + { + gLogInfo << "\ttask address list (indices into global address list): " << endl; + for ( size_t ii = 0; ii < taskAddrList.size(); ++ii) + { + gLogInfo << "\t\t" << taskAddrList.at(ii) << endl; + } + gLogInfo << "\t\t<>" << endl; + } + + // Now that we know where dep_graph, op_list, and surf_list live, we can build the network_desc + *network_desc.operationDescIndex() = Ni + 1; // op_mle.id + *network_desc.operationBufferDescIndex() = Ni + 2; // op_buf_mle.id + *network_desc.numOperations() = num_ops * num_batches; + + task_list_entries.at(ti).address_list = taskAddrList; + + g->gatherRelocEntries(op_mle.id, op_container_mem, + op_buf_mle.id, op_buffer_container_mem, + -1, 0); + } + } + + // + // now that all the tasks have set up their context state + // elements the memory and address lists are viable. + // + loadable->setMemoryListEntries(gal.memList()); + + loadable->setAddressListEntries(gal.addrList()); + + loadable->setTaskListEntries(task_list_entries); + + loadable->setSubmitListEntries(submit_list_entries); + + loadable->setEventListEntries(event_list_entries); + + loadable->setRelocEntries(g->getRelocEntries()); + +#ifdef NVDLA_COMPILER_OUTPUT_FOR_PROTOTEST + if (!protoTest.SerializePartialToOstream(&protobufFile)) { + PROPAGATE_ERROR_FAIL(NvDlaError_FileWriteFailed, "Serialize to ostream failed for nvdla_interfacce.Test"); + } + protobufFile.close(); + google::protobuf::ShutdownProtobufLibrary(); +#endif + +fail: + if ( e != NvDlaSuccess) + { + l = LoadableFactory::LoadablePrivPair(0, 0); + } + return e; +} + +engine_ast::Graph *Compiler::registerBuffers(engine_ast::Graph *input_graph) +{ + //engine_ast::Graph *graph = input_graph->clone(); + NvDlaError e = NvDlaSuccess; + engine_ast::Graph *graph = input_graph; + + // + // before registering buffers, we should populate the edges of the eng_ast with + // tensor surface descriptors and then reserve buffers for suitable edges + // + PROPAGATE_ERROR_FAIL(graph->registerAllSurfaces()); + PROPAGATE_ERROR_FAIL(graph->registerAllBuffers()); + + return graph; + +fail: + return NULL; +} + +engine_ast::Graph *Compiler::preProcessAuxData(engine_ast::Graph *input_graph) +{ + //engine_ast::Graph *new_graph = input_graph->clone(); + NvDlaError e = NvDlaSuccess; + engine_ast::Graph *graph = input_graph; + PROPAGATE_ERROR_FAIL(graph->preProcessAuxData()); + + return graph; + +fail: + return NULL; +} + +engine_ast::Graph *Compiler::mergeActivationOperations(engine_ast::Graph *input_graph) +{ + //engine_ast::Graph *new_graph = input_graph->clone(); + NvDlaError e = NvDlaSuccess; + engine_ast::Graph *graph = input_graph; + PROPAGATE_ERROR_FAIL(graph->mergeActivationOperations()); + + return graph; + +fail: + return NULL; +} + +engine_ast::Graph *Compiler::updateScalingFactors(engine_ast::Graph *input_graph) +{ + NvDlaError e = NvDlaSuccess; + engine_ast::Graph *graph = input_graph; + PROPAGATE_ERROR_FAIL(graph->updateScalingFactors()); + + return graph; + +fail: + return NULL; +} + +engine_ast::Graph *Compiler::quantizeAuxData(engine_ast::Graph *input_graph) +{ + //engine_ast::Graph *new_graph = input_graph->clone(); + NvDlaError e = NvDlaSuccess; + engine_ast::Graph *graph = input_graph; + PROPAGATE_ERROR_FAIL(graph->quantizeAuxData()); + + return graph; + +fail: + return NULL; +} + +engine_ast::Graph *Compiler::handleLowPrecisionConversions(engine_ast::Graph *input_graph) +{ + //engine_ast::Graph *new_graph = input_graph->clone(); + NvDlaError e = NvDlaSuccess; + engine_ast::Graph *graph = input_graph; + PROPAGATE_ERROR_FAIL(graph->handleLowPrecisionConversions()); + + return graph; + +fail: + return NULL; +} + +engine_ast::Graph *Compiler::translateAuxData(engine_ast::Graph *input_graph) +{ + //engine_ast::Graph *new_graph = input_graph->clone(); + NvDlaError e = NvDlaSuccess; + engine_ast::Graph *graph = input_graph; + PROPAGATE_ERROR_FAIL(graph->translateAuxData()); + + return graph; + +fail: + return NULL; +} + +engine_ast::Graph *Compiler::reserveBuffers(engine_ast::Graph *input_graph) +{ + //engine_ast::Graph *new_graph = input_graph->clone(); + NvDlaError e = NvDlaSuccess; + engine_ast::Graph *graph = input_graph; + PROPAGATE_ERROR_FAIL(graph->reserveAllBuffers()); + + return graph; + +fail: + return NULL; +} + +engine_ast::Graph *Compiler::fuseOnTheFlyNodes(engine_ast::Graph *input_graph) +{ + //engine_ast::Graph *new_graph = input_graph->clone(); + NvDlaError e = NvDlaSuccess; + engine_ast::Graph *new_graph = input_graph; + PROPAGATE_ERROR_FAIL(new_graph->fuseOnTheFlyNodes()); + + return new_graph; + +fail: + return NULL; +} + +engine_ast::Graph *Compiler::fuseSubEngineOps(engine_ast::Graph *input_graph) +{ + NvDlaError e = NvDlaSuccess; + engine_ast::Graph *graph = input_graph; + PROPAGATE_ERROR_FAIL(graph->fuseSDPSubEngineOps()); + + return graph; + +fail: + return NULL; +} + +engine_ast::Graph *Compiler::groupAtomicOperations(engine_ast::Graph *input_graph) +{ + //engine_ast::Graph *new_graph = input_graph->clone(); + NvDlaError e = NvDlaSuccess; + engine_ast::Graph *new_graph = input_graph; + PROPAGATE_ERROR_FAIL(new_graph->groupAtomicOperations()); + + return new_graph; + +fail: + return NULL; +} + +engine_ast::Graph *Compiler::splitNodes(engine_ast::Graph *input_graph) +{ + //engine_ast::Graph *new_graph = input_graph->clone(); + NvDlaError e = NvDlaSuccess; + engine_ast::Graph *new_graph = input_graph; + PROPAGATE_ERROR_FAIL(new_graph->splitNodes()); + + return new_graph; + +fail: + return NULL; +} + +engine_ast::Graph *Compiler::boundGraph(engine_ast::Graph *input_graph) +{ + //engine_ast::Graph *new_graph = input_graph->clone(); + engine_ast::Graph *new_graph = input_graph; + + return new_graph; +} + +engine_ast::Graph *Compiler::handleMultiBatch(engine_ast::Graph *input_graph) +{ + //engine_ast::Graph *new_graph = input_graph->clone(); + NvDlaError e = NvDlaSuccess; + engine_ast::Graph *new_graph = input_graph; + PROPAGATE_ERROR_FAIL( new_graph->handleMultiBatch() ); + + return new_graph; + +fail: + return NULL; +} + +engine_ast::Graph *Compiler::flattenGraph(engine_ast::Graph *input_graph) +{ + //engine_ast::Graph *new_graph = input_graph->clone(); + NvDlaError e = NvDlaSuccess; + engine_ast::Graph *new_graph = input_graph; + PROPAGATE_ERROR_FAIL( new_graph->flattenGraph() ); + + return new_graph; + +fail: + return NULL; +} + +engine_ast::Graph *Compiler::generateDependencyParams +( + engine_ast::Graph *input_graph, + engine_ast::NodeSequence &topological_order +) +{ + //engine_ast::Graph *new_graph = input_graph->clone(); + NvDlaError e = NvDlaSuccess; + NvS16 lastUsedAnnId = -1; + engine_ast::Graph *new_graph = input_graph; + PROPAGATE_ERROR_FAIL( new_graph->topologicalSort(topological_order) ); + + // dependencies are resolved in a flattened graph + PROPAGATE_ERROR_FAIL( new_graph->resolveDataDependencies(topological_order) ); + PROPAGATE_ERROR_FAIL( new_graph->resolveComputeDependencies(topological_order) ); + PROPAGATE_ERROR_FAIL( new_graph->resolveSoftwareDependencies() ); + + // determine DLA/EMU/DLA/etc task boundaries + PROPAGATE_ERROR_FAIL( new_graph->determineTaskBoundaries(topological_order) ); + + PROPAGATE_ERROR_FAIL( new_graph->annotateNodes(lastUsedAnnId) ); + + PROPAGATE_ERROR_FAIL( new_graph->resolveMultiBatchDependencies() ); + + // validate dependency params of each node in the graph + PROPAGATE_ERROR_FAIL( new_graph->verifyDependencyGraph() ); + + return new_graph; + +fail: + return NULL; +} + +engine_ast::Graph *Compiler::resolveMemory +( + engine_ast::Graph *input_graph, + const engine_ast::NodeSequence &topological_order +) +{ + //engine_ast::Graph *new_graph = input_graph->clone(); + NvDlaError e = NvDlaSuccess; + engine_ast::Graph *new_graph = input_graph; + + //PROPAGATE_ERROR_FAIL( new_graph->flattenGraph() ); + PROPAGATE_ERROR_FAIL( new_graph->resolveMemory(topological_order) ); + + return new_graph; + +fail: + return NULL; +} + + +engine_ast::Graph *Compiler::enableCopyOutDebugSurfaces(engine_ast::Graph *input_graph) +{ + //engine_ast::Graph *new_graph = input_graph->clone(); + NvDlaError e = NvDlaSuccess; + engine_ast::Graph *new_graph = input_graph; + + engine_ast::AddCopyOutDebugBDMA addBDMAs; + + if ( !input_graph->target_config()->isBDMACapable() ) + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "BDMA engine is not supported with this target config"); + + PROPAGATE_ERROR_FAIL( addBDMAs.visitNodes( new_graph->ordering() ) ); + + return new_graph; + +fail: + return NULL; +} + + +DLAInterface *Compiler::getTargetDLAInterface(Profile *) +{ + // dummy, we know exactly which for now. + DLAInterface *dla_if = new DLAInterfaceA(); + return dla_if; +} + +EMUInterface *Compiler::getTargetEMUInterface(Profile *) +{ + // dummy, we know exactly which for now. + EMUInterface *emu_if = new EMUInterfaceA(); + return emu_if; +} + +// +// set/get compilation target attributes. to what do we bind them? +// until compile() is called maybe the active profile? +// +NvDlaError Compiler::getDataType(DataType::UnderlyingType *data_type) const +{ + NvDlaError e = NvDlaSuccess; + if ( !data_type || wisdom() == NULL) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter); + } + PROPAGATE_ERROR_FAIL( wisdom()->getDataType(data_type) ); + fail: + return e; +} + + + +} // nvdla::priv + + +} // nvdla diff --git a/umd/core/src/compiler/DLAInterface.cpp b/umd/core/src/compiler/DLAInterface.cpp new file mode 100644 index 00000000..6eb42da5 --- /dev/null +++ b/umd/core/src/compiler/DLAInterface.cpp @@ -0,0 +1,731 @@ +/* + * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#include "priv/DLAInterface.h" + +namespace nvdla +{ + +namespace priv +{ + +// +// dla_network_desc +// +DLANetworkDescAccessor::DLANetworkDescAccessor(NvU8 *base, const DLANetworkDesc &n) : _base(base), _n(n) { } + +NvU8 * DLANetworkDescAccessor::struct_base() const { return _base; } +size_t DLANetworkDescAccessor::struct_size() const { return _n.struct_size(); } +size_t DLANetworkDescAccessor::struct_align() const { return _n.struct_align(); } + +size_t DLANetworkDescAccessor::op_BDMA() const { return _n.op_BDMA(); } +size_t DLANetworkDescAccessor::op_CONV() const { return _n.op_CONV(); } +size_t DLANetworkDescAccessor::op_SDP() const { return _n.op_SDP(); } +size_t DLANetworkDescAccessor::op_PDP() const { return _n.op_PDP(); } +size_t DLANetworkDescAccessor::op_CDP() const { return _n.op_CDP(); } +size_t DLANetworkDescAccessor::op_RUBIK() const { return _n.op_RUBIK(); } +size_t DLANetworkDescAccessor::numOpHeads() const { return _n.numOpHeads(); } + +int16_t * DLANetworkDescAccessor::operationDescIndex() const { return _n.operationDescIndex(_base); } +int16_t * DLANetworkDescAccessor::surfaceDescIndex() const { return _n.surfaceDescIndex(_base); } +int16_t * DLANetworkDescAccessor::dependencyGraphIndex() const { return _n.dependencyGraphIndex(_base); } +int16_t * DLANetworkDescAccessor::LUTDataIndex() const { return _n.LUTDataIndex(_base); } +int16_t * DLANetworkDescAccessor::ROIArrayIndex() const { return _n.ROIArrayIndex(_base); } +int16_t * DLANetworkDescAccessor::surfaceIndex() const { return _n.surfaceIndex(_base); } +int16_t * DLANetworkDescAccessor::statListIndex() const { return _n.statListIndex(_base); } +int16_t * DLANetworkDescAccessor::opHead(size_t h) const { return _n.opHead(_base, h); } +uint16_t * DLANetworkDescAccessor::numROIs() const { return _n.numROIs(_base); } +uint16_t * DLANetworkDescAccessor::numOperations() const { return _n.numOperations(_base); } +uint16_t * DLANetworkDescAccessor::numLUTs() const { return _n.numLUTs(_base); } +uint16_t * DLANetworkDescAccessor::numAddresses() const { return _n.numAddresses(_base); } +uint8_t * DLANetworkDescAccessor::dynamicROI() const { return _n.dynamicROI(_base); } +int16_t * DLANetworkDescAccessor::inputLayer() const { return _n.inputLayer(_base); } + +// +// dla_consumer +// +DLAConsumerAccessor::DLAConsumerAccessor(NvU8 *base, const DLAConsumer &c) : _base(base), _c(c) { } + +NvU8 * DLAConsumerAccessor::struct_base() const { return _base; } +size_t DLAConsumerAccessor::struct_size() const { return _c.struct_size(); } +size_t DLAConsumerAccessor::struct_align() const { return _c.struct_align(); } + +int16_t * DLAConsumerAccessor::index() const { return _c.index(_base); } +uint8_t * DLAConsumerAccessor::event() const { return _c.event(_base); } +uint8_t DLAConsumerAccessor::event_OpCompleted() const { return _c.event_OpCompleted(); } +uint8_t DLAConsumerAccessor::event_OpProgrammed() const { return _c.event_OpProgrammed(); } +uint8_t DLAConsumerAccessor::event_OpEnabled() const { return _c.event_OpEnabled(); } +uint8_t DLAConsumerAccessor::event_OpCDMAWeightDone() const { return _c.event_OpCDMAWeightDone(); } +uint8_t DLAConsumerAccessor::event_OpCDMADataDone() const { return _c.event_OpCDMADataDone(); } +uint8_t * DLAConsumerAccessor::res() const { return _c.res(_base); } + + +// +// dla_common_op_desc +// +DLACommonOpDescAccessor::DLACommonOpDescAccessor(NvU8 *base, const DLACommonOpDesc &c) : _base(base), _c(c) { } + +NvU8 * DLACommonOpDescAccessor::struct_base() const { return _base; } +size_t DLACommonOpDescAccessor::struct_size() const { return _c.struct_size(); } +size_t DLACommonOpDescAccessor::struct_align() const { return _c.struct_align(); } + +int16_t * DLACommonOpDescAccessor::index() const { return _c.index(_base); } +int8_t * DLACommonOpDescAccessor::roiIndex() const { return _c.roiIndex(_base); } +uint8_t * DLACommonOpDescAccessor::opType() const { return _c.opType(_base); } +uint8_t DLACommonOpDescAccessor::opType_BDMA() const { return _c.opType_BDMA(); } +uint8_t DLACommonOpDescAccessor::opType_CONV() const { return _c.opType_CONV(); } +uint8_t DLACommonOpDescAccessor::opType_SDP() const { return _c.opType_SDP(); } +uint8_t DLACommonOpDescAccessor::opType_PDP() const { return _c.opType_PDP(); } +uint8_t DLACommonOpDescAccessor::opType_CDP() const { return _c.opType_CDP(); } +uint8_t DLACommonOpDescAccessor::opType_RUBIK() const { return _c.opType_RUBIK(); } +uint8_t * DLACommonOpDescAccessor::dependencyCount() const { return _c.dependencyCount(_base); } +uint8_t * DLACommonOpDescAccessor::reserved_xxx() const { return _c.reserved_xxx(_base); } +uint8_t * DLACommonOpDescAccessor::reserved0(size_t i) const { return _c.reserved0(_base, i); } +size_t DLACommonOpDescAccessor::numConsumers() const { return _c.numConsumers(); } + +DLAConsumerAccessor DLACommonOpDescAccessor::consumerAccessor(size_t c) const { return _c.consumerAccessor(_base, c); } +DLAConsumerAccessor DLACommonOpDescAccessor::fusedParentAccessor() const { return _c.fusedParentAccessor(_base); } + + +// +// dla_bdma_transfer_desc +// +DLABDMATransferDescAccessor::DLABDMATransferDescAccessor(NvU8 *base, const DLABDMATransferDesc &t) : _base(base), _t(t) { } + +NvU8 * DLABDMATransferDescAccessor::struct_base() const { return _base; } +size_t DLABDMATransferDescAccessor::struct_size() const { return _t.struct_size(); } +size_t DLABDMATransferDescAccessor::struct_align() const { return _t.struct_align(); } + +int16_t * DLABDMATransferDescAccessor::srcAddress() const { return _t.srcAddress(_base); } +int16_t * DLABDMATransferDescAccessor::dstAddress() const { return _t.dstAddress(_base); } +uint32_t * DLABDMATransferDescAccessor::lineSize() const { return _t.lineSize(_base); } +uint32_t * DLABDMATransferDescAccessor::lineRepeat() const { return _t.lineRepeat(_base); } +uint32_t * DLABDMATransferDescAccessor::srcLine() const { return _t.srcLine(_base); } +uint32_t * DLABDMATransferDescAccessor::dstLine() const { return _t.dstLine(_base); } +uint32_t * DLABDMATransferDescAccessor::surfaceRepeat() const { return _t.surfaceRepeat(_base); } +uint32_t * DLABDMATransferDescAccessor::srcSurface() const { return _t.srcSurface(_base); } +uint32_t * DLABDMATransferDescAccessor::dstSurface() const { return _t.dstSurface(_base); } + + +// +// dla_bdma_surface_desc +// +DLABDMASurfaceDescAccessor::DLABDMASurfaceDescAccessor(NvU8 *base, const DLABDMASurfaceDesc &s) : _base(base), _s(s) { } + +NvU8 * DLABDMASurfaceDescAccessor::struct_base() const { return _base; } +size_t DLABDMASurfaceDescAccessor::struct_size() const { return _s.struct_size(); } +size_t DLABDMASurfaceDescAccessor::struct_align() const { return _s.struct_align(); } + +uint8_t * DLABDMASurfaceDescAccessor::srcType() const { return _s.srcType(_base); } +uint8_t * DLABDMASurfaceDescAccessor::dstType() const { return _s.dstType(_base); } +uint16_t * DLABDMASurfaceDescAccessor::numTransfers() const { return _s.numTransfers(_base); } + +uint8_t DLABDMASurfaceDescAccessor::type_MC() const { return _s.type_MC(); } +uint8_t DLABDMASurfaceDescAccessor::type_CV() const { return _s.type_CV(); } +uint8_t DLABDMASurfaceDescAccessor::type_HW() const { return _s.type_HW(); } +uint16_t DLABDMASurfaceDescAccessor::maxNumTransfers() const { return _s.maxNumTransfers(); } + + +DLABDMATransferDescAccessor DLABDMASurfaceDescAccessor::transferAccessor(size_t c) const { return _s.transferAccessor(_base, c); } + +// +// dla_bdma_op_desc +// +DLABDMAOpDescAccessor::DLABDMAOpDescAccessor(NvU8 *base, const DLABDMAOpDesc &s) : _base(base), _s(s) { } + +NvU8 * DLABDMAOpDescAccessor::struct_base() const { return _base; } +size_t DLABDMAOpDescAccessor::struct_size() const { return _s.struct_size(); } +size_t DLABDMAOpDescAccessor::struct_align() const { return _s.struct_align(); } + +uint16_t * DLABDMAOpDescAccessor::numTransfers() const { return _s.numTransfers(_base); } +uint16_t * DLABDMAOpDescAccessor::reserved0() const { return _s.reserved0(_base); } + + +// +// dla_cvt_param +// +DLACVTParamAccessor::DLACVTParamAccessor(NvU8 *base, const DLACVTParam &l) : _base(base), _l(l) { } + +NvU8 * DLACVTParamAccessor::struct_base() const { return _base; } +size_t DLACVTParamAccessor::struct_size() const { return _l.struct_size(); } +size_t DLACVTParamAccessor::struct_align() const { return _l.struct_align(); } + +int16_t * DLACVTParamAccessor::scale() const { return _l.scale(_base); } +uint8_t * DLACVTParamAccessor::truncate() const { return _l.truncate(_base); } +int32_t * DLACVTParamAccessor::offset() const { return _l.offset(_base); } +uint8_t * DLACVTParamAccessor::enable() const { return _l.enable(_base); } +uint16_t * DLACVTParamAccessor::reserved_xxx() const { return _l.reserved_xxx(_base); } + +// +// dla_data_cube +// +DLADataCubeAccessor::DLADataCubeAccessor(NvU8 *base, const DLADataCube &l) : _base(base), _l(l) { } + +NvU8 * DLADataCubeAccessor::struct_base() const { return _base; } +size_t DLADataCubeAccessor::struct_size() const { return _l.struct_size(); } +size_t DLADataCubeAccessor::struct_align() const { return _l.struct_align(); } + +uint8_t * DLADataCubeAccessor::type_xxx() const { return _l.type_xxx(_base); } +uint8_t DLADataCubeAccessor::type_MC_xxx() const { return _l.type_MC_xxx(); } +uint8_t DLADataCubeAccessor::type_CV_xxx() const { return _l.type_CV_xxx(); } +uint8_t DLADataCubeAccessor::type_HW_xxx() const { return _l.type_HW_xxx(); } +uint16_t * DLADataCubeAccessor::type() const { return _l.type(_base); } +uint16_t DLADataCubeAccessor::type_MC() const { return _l.type_MC(); } +uint16_t DLADataCubeAccessor::type_CV() const { return _l.type_CV(); } +uint16_t DLADataCubeAccessor::type_HW() const { return _l.type_HW(); } +int16_t * DLADataCubeAccessor::address() const { return _l.address(_base); } +uint32_t * DLADataCubeAccessor::offset() const { return _l.offset(_base); } +uint32_t * DLADataCubeAccessor::size() const { return _l.size(_base); } +uint16_t * DLADataCubeAccessor::width() const { return _l.width(_base); } +uint16_t * DLADataCubeAccessor::height() const { return _l.height(_base); } +uint16_t * DLADataCubeAccessor::channel() const { return _l.channel(_base); } +uint16_t * DLADataCubeAccessor::reserved0() const { return _l.reserved0(_base); } +uint32_t * DLADataCubeAccessor::lineStride() const { return _l.lineStride(_base); } +uint32_t * DLADataCubeAccessor::surfStride() const { return _l.surfStride(_base); } +uint32_t * DLADataCubeAccessor::planeStride()const { return _l.planeStride(_base); } + +// +// dla_conv_surface_desc +// +DLAConvSurfaceDescAccessor::DLAConvSurfaceDescAccessor(NvU8 *base, const DLAConvSurfaceDesc &l) : _base(base), _l(l) { } + +NvU8 * DLAConvSurfaceDescAccessor::struct_base() const { return _base; } +size_t DLAConvSurfaceDescAccessor::struct_size() const { return _l.struct_size(); } +size_t DLAConvSurfaceDescAccessor::struct_align() const { return _l.struct_align(); } + +DLADataCubeAccessor DLAConvSurfaceDescAccessor::weightDataAccessor() const { return _l.weightDataAccessor(_base); } +DLADataCubeAccessor DLAConvSurfaceDescAccessor::meanDataAccessor() const { return _l.meanDataAccessor(_base); } +DLADataCubeAccessor DLAConvSurfaceDescAccessor::wmbDataAccessor() const { return _l.wmbDataAccessor(_base); } +DLADataCubeAccessor DLAConvSurfaceDescAccessor::wgsDataAccessor() const { return _l.wgsDataAccessor(_base); } +DLADataCubeAccessor DLAConvSurfaceDescAccessor::srcDataAccessor() const { return _l.srcDataAccessor(_base); } +DLADataCubeAccessor DLAConvSurfaceDescAccessor::dstDataAccessor() const { return _l.dstDataAccessor(_base); } +uint64_t * DLAConvSurfaceDescAccessor::offsetU_xxx() const { return _l.offsetU_xxx(_base); } +int64_t * DLAConvSurfaceDescAccessor::offsetU() const { return _l.offsetU(_base); } +uint32_t * DLAConvSurfaceDescAccessor::offsetV() const { return _l.offsetV(_base); } +uint32_t * DLAConvSurfaceDescAccessor::inLineUVStride() const { return _l.inLineUVStride(_base); } + +// +// dla_conv_op_desc +// +DLAConvOpDescAccessor::DLAConvOpDescAccessor(NvU8 *base, const DLAConvOpDesc &l) : _base(base), _l(l) { } + +NvU8 * DLAConvOpDescAccessor::struct_base() const { return _base; } +size_t DLAConvOpDescAccessor::struct_size() const { return _l.struct_size(); } +size_t DLAConvOpDescAccessor::struct_align() const { return _l.struct_align(); } + +//a_type * DLAConvOpDescAccessor::a() const { return _l.a(_base); } +//b_type * DLAConvOpDescAccessor::b(size_t i) const { return _l.b(_base, i); } +//size_t DLAConvOpDescAccessor::numB() const { return _l.numB(); } +// DLAConsumerAccessor DLACommonOpDescAccessor::fusedParentAccessor() const { return _c.fusedParentAccessor(_base); } + +uint8_t * DLAConvOpDescAccessor::inPrecision() const { return _l.inPrecision(_base); } +uint8_t DLAConvOpDescAccessor::inPrecision_Int8() const { return _l.inPrecision_Int8(); } +uint8_t DLAConvOpDescAccessor::inPrecision_Int16() const { return _l.inPrecision_Int16(); } +uint8_t DLAConvOpDescAccessor::inPrecision_FP16() const { return _l.inPrecision_FP16(); } + +uint8_t * DLAConvOpDescAccessor::outPrecision() const { return _l.outPrecision(_base); } +uint8_t DLAConvOpDescAccessor::outPrecision_Int8() const { return _l.outPrecision_Int8(); } +uint8_t DLAConvOpDescAccessor::outPrecision_Int16() const { return _l.outPrecision_Int16(); } +uint8_t DLAConvOpDescAccessor::outPrecision_FP16() const { return _l.outPrecision_FP16(); } + +DLACVTParamAccessor DLAConvOpDescAccessor::inCVTAccessor() const { return _l.inCVTAccessor(_base); } +DLACVTParamAccessor DLAConvOpDescAccessor::outCVTAccessor() const { return _l.outCVTAccessor(_base); } +int16_t * DLAConvOpDescAccessor::padVal() const { return _l.padVal(_base); } +uint8_t * DLAConvOpDescAccessor::convMode() const { return _l.convMode(_base); } +uint8_t DLAConvOpDescAccessor::convMode_Direct() const { return _l.convMode_Direct(); } +uint8_t DLAConvOpDescAccessor::convMode_Winograd() const { return _l.convMode_Winograd(); } +uint8_t * DLAConvOpDescAccessor::dataReuse() const { return _l.dataReuse(_base); } +uint8_t * DLAConvOpDescAccessor::weightReuse() const { return _l.weightReuse(_base); } +uint8_t * DLAConvOpDescAccessor::skipDataRls() const { return _l.skipDataRls(_base); } +uint8_t * DLAConvOpDescAccessor::skipWeightRls() const { return _l.skipWeightRls(_base); } +uint8_t * DLAConvOpDescAccessor::reserved0() const { return _l.reserved0(_base); } +uint16_t * DLAConvOpDescAccessor::entryPerSlice() const { return _l.entryPerSlice(_base); } +uint16_t * DLAConvOpDescAccessor::fetchGrain() const { return _l.fetchGrain(_base); } +uint8_t * DLAConvOpDescAccessor::dataFormat() const { return _l.dataFormat(_base); } +uint8_t DLAConvOpDescAccessor::dataFormat_T_R8() const { return _l.dataFormat_T_R8(); } +uint8_t DLAConvOpDescAccessor::dataFormat_T_R10() const { return _l.dataFormat_T_R10(); } +uint8_t DLAConvOpDescAccessor::dataFormat_T_R12() const { return _l.dataFormat_T_R12(); } +uint8_t DLAConvOpDescAccessor::dataFormat_T_R16() const { return _l.dataFormat_T_R16(); } +uint8_t DLAConvOpDescAccessor::dataFormat_T_R16_I() const { return _l.dataFormat_T_R16_I(); } +uint8_t DLAConvOpDescAccessor::dataFormat_T_R16_F() const { return _l.dataFormat_T_R16_F(); } +uint8_t DLAConvOpDescAccessor::dataFormat_T_A16B16G16R16() const { return _l.dataFormat_T_A16B16G16R16(); } +uint8_t DLAConvOpDescAccessor::dataFormat_T_X16B16G16R16() const { return _l.dataFormat_T_X16B16G16R16(); } +uint8_t DLAConvOpDescAccessor::dataFormat_T_A16B16G16R16_F() const { return _l.dataFormat_T_A16B16G16R16_F(); } +uint8_t DLAConvOpDescAccessor::dataFormat_T_A16Y16U16V16() const { return _l.dataFormat_T_A16Y16U16V16(); } +uint8_t DLAConvOpDescAccessor::dataFormat_T_V16U16Y16A16() const { return _l.dataFormat_T_V16U16Y16A16(); } +uint8_t DLAConvOpDescAccessor::dataFormat_T_A16Y16U16V16_F() const { return _l.dataFormat_T_A16Y16U16V16_F(); } +uint8_t DLAConvOpDescAccessor::dataFormat_T_A8B8G8R8() const { return _l.dataFormat_T_A8B8G8R8(); } +uint8_t DLAConvOpDescAccessor::dataFormat_T_A8R8G8B8() const { return _l.dataFormat_T_A8R8G8B8(); } +uint8_t DLAConvOpDescAccessor::dataFormat_T_B8G8R8A8() const { return _l.dataFormat_T_B8G8R8A8(); } +uint8_t DLAConvOpDescAccessor::dataFormat_T_R8G8B8A8() const { return _l.dataFormat_T_R8G8B8A8(); } +uint8_t DLAConvOpDescAccessor::dataFormat_T_X8B8G8R8() const { return _l.dataFormat_T_X8B8G8R8(); } +uint8_t DLAConvOpDescAccessor::dataFormat_T_X8R8G8B8() const { return _l.dataFormat_T_X8R8G8B8(); } +uint8_t DLAConvOpDescAccessor::dataFormat_T_B8G8R8X8() const { return _l.dataFormat_T_B8G8R8X8(); } +uint8_t DLAConvOpDescAccessor::dataFormat_T_R8G8B8X8() const { return _l.dataFormat_T_R8G8B8X8(); } +uint8_t DLAConvOpDescAccessor::dataFormat_T_A2B10G10R10() const { return _l.dataFormat_T_A2B10G10R10(); } +uint8_t DLAConvOpDescAccessor::dataFormat_T_A2R10G10B10() const { return _l.dataFormat_T_A2R10G10B10(); } +uint8_t DLAConvOpDescAccessor::dataFormat_T_B10G10R10A2() const { return _l.dataFormat_T_B10G10R10A2(); } +uint8_t DLAConvOpDescAccessor::dataFormat_T_R10G10B10A2() const { return _l.dataFormat_T_R10G10B10A2(); } +uint8_t DLAConvOpDescAccessor::dataFormat_T_A2Y10U10V10() const { return _l.dataFormat_T_A2Y10U10V10(); } +uint8_t DLAConvOpDescAccessor::dataFormat_T_V10U10Y10A2() const { return _l.dataFormat_T_V10U10Y10A2(); } +uint8_t DLAConvOpDescAccessor::dataFormat_T_A8Y8U8V8() const { return _l.dataFormat_T_A8Y8U8V8(); } +uint8_t DLAConvOpDescAccessor::dataFormat_T_V8U8Y8A8() const { return _l.dataFormat_T_V8U8Y8A8(); } +uint8_t DLAConvOpDescAccessor::dataFormat_T_Y8___U8V8_N444() const { return _l.dataFormat_T_Y8___U8V8_N444(); } +uint8_t DLAConvOpDescAccessor::dataFormat_T_Y8___V8U8_N444() const { return _l.dataFormat_T_Y8___V8U8_N444(); } +uint8_t DLAConvOpDescAccessor::dataFormat_T_Y10___U10V10_N444() const { return _l.dataFormat_T_Y10___U10V10_N444(); } +uint8_t DLAConvOpDescAccessor::dataFormat_T_Y10___V10U10_N444() const { return _l.dataFormat_T_Y10___V10U10_N444(); } +uint8_t DLAConvOpDescAccessor::dataFormat_T_Y12___U12V12_N444() const { return _l.dataFormat_T_Y12___U12V12_N444(); } +uint8_t DLAConvOpDescAccessor::dataFormat_T_Y12___V12U12_N444() const { return _l.dataFormat_T_Y12___V12U12_N444(); } +uint8_t DLAConvOpDescAccessor::dataFormat_T_Y16___U16V16_N444() const { return _l.dataFormat_T_Y16___U16V16_N444(); } +uint8_t DLAConvOpDescAccessor::dataFormat_T_Y16___V16U16_N444() const { return _l.dataFormat_T_Y16___V16U16_N444(); } +uint8_t DLAConvOpDescAccessor::dataFormat_T_Y16___U8V8_N444() const { return _l.dataFormat_T_Y16___U8V8_N444(); } +uint8_t DLAConvOpDescAccessor::dataFormat_T_Y16___V8U8_N444() const { return _l.dataFormat_T_Y16___V8U8_N444(); } +uint8_t DLAConvOpDescAccessor::dataFormat_T_Y8___U8___V8_N444() const { return _l.dataFormat_T_Y8___U8___V8_N444(); } +uint8_t DLAConvOpDescAccessor::dataFormat_T_Y10___U10___V10_N444() const { return _l.dataFormat_T_Y10___U10___V10_N444(); } +uint8_t DLAConvOpDescAccessor::dataFormat_T_Y12___U12___V12_N444() const { return _l.dataFormat_T_Y12___U12___V12_N444(); } +uint8_t DLAConvOpDescAccessor::dataFormat_T_Y16___U16___V16_N444() const { return _l.dataFormat_T_Y16___U16___V16_N444(); } +uint8_t DLAConvOpDescAccessor::dataFormat_T_Y16___U8___V8_N444() const { return _l.dataFormat_T_Y16___U8___V8_N444(); } +uint8_t DLAConvOpDescAccessor::dataFormat_FEATURE() const { return _l.dataFormat_FEATURE(); } +uint8_t * DLAConvOpDescAccessor::pixelMapping() const { return _l.pixelMapping(_base); } +uint8_t DLAConvOpDescAccessor::pixelMapping_PitchLinear() const { return _l.pixelMapping_PitchLinear(); } +uint8_t * DLAConvOpDescAccessor::batch() const { return _l.batch(_base); } +uint8_t * DLAConvOpDescAccessor::weightFormat() const { return _l.weightFormat(_base); } +uint8_t DLAConvOpDescAccessor::weightFormat_Uncompressed() const { return _l.weightFormat_Uncompressed(); } +uint8_t DLAConvOpDescAccessor::weightFormat_Compressed() const { return _l.weightFormat_Compressed(); } +uint8_t * DLAConvOpDescAccessor::dataBank() const { return _l.dataBank(_base); } +uint8_t * DLAConvOpDescAccessor::weightBank() const { return _l.weightBank(_base); } +uint32_t * DLAConvOpDescAccessor::batchStride() const { return _l.batchStride(_base); } +uint16_t * DLAConvOpDescAccessor::release() const { return _l.release(_base); } +uint8_t * DLAConvOpDescAccessor::postExtension() const { return _l.postExtension(_base); } +uint8_t * DLAConvOpDescAccessor::reserved1_xxx() const { return _l.reserved1_xxx(_base); } +uint8_t * DLAConvOpDescAccessor::pixelOverride() const { return _l.pixelOverride(_base); } +uint8_t DLAConvOpDescAccessor::pixelOverride_UINT() const { return _l.pixelOverride_UINT(); } +uint8_t DLAConvOpDescAccessor::pixelOverride_INT() const { return _l.pixelOverride_INT(); } +uint8_t * DLAConvOpDescAccessor::meanFormat() const { return _l.meanFormat(_base); } +uint8_t DLAConvOpDescAccessor::meanFormat_None() const { return _l.meanFormat_None(); } +uint8_t DLAConvOpDescAccessor::meanFormat_Global() const { return _l.meanFormat_Global(); } +uint8_t DLAConvOpDescAccessor::meanFormat_PerPixel() const { return _l.meanFormat_PerPixel(); } +uint8_t DLAConvOpDescAccessor::meanFormat_Disable() const { return _l.meanFormat_Disable(); } +uint8_t DLAConvOpDescAccessor::meanFormat_Enable() const { return _l.meanFormat_Enable(); } +int16_t * DLAConvOpDescAccessor::meanRY() const { return _l.meanRY(_base); } +int16_t * DLAConvOpDescAccessor::meanGU() const { return _l.meanGU(_base); } +int16_t * DLAConvOpDescAccessor::meanBV() const { return _l.meanBV(_base); } +int16_t * DLAConvOpDescAccessor::meanAX() const { return _l.meanAX(_base); } +uint8_t * DLAConvOpDescAccessor::convStrideX() const { return _l.convStrideX(_base); } +uint8_t * DLAConvOpDescAccessor::convStrideY() const { return _l.convStrideY(_base); } +uint8_t * DLAConvOpDescAccessor::padXLeft() const { return _l.padXLeft(_base); } +uint8_t * DLAConvOpDescAccessor::padXRight() const { return _l.padXRight(_base); } +uint8_t * DLAConvOpDescAccessor::padYTop() const { return _l.padYTop(_base); } +uint8_t * DLAConvOpDescAccessor::padYBottom() const { return _l.padYBottom(_base); } +uint8_t * DLAConvOpDescAccessor::dilationX() const { return _l.dilationX(_base); } +uint8_t * DLAConvOpDescAccessor::dilationY() const { return _l.dilationY(_base); } +uint8_t * DLAConvOpDescAccessor::reserved2(size_t i) const { return _l.reserved2(_base, i); } +uint8_t * DLAConvOpDescAccessor::praTruncate() const { return _l.praTruncate(_base); } +uint16_t * DLAConvOpDescAccessor::inputWidthCSC() const { return _l.inputWidthCSC(_base); } +uint16_t * DLAConvOpDescAccessor::inputHeightCSC() const { return _l.inputHeightCSC(_base); } +uint16_t * DLAConvOpDescAccessor::inputChannelCSC() const { return _l.inputChannelCSC(_base); } +uint16_t * DLAConvOpDescAccessor::kernelWidthCSC() const { return _l.kernelWidthCSC(_base); } +uint16_t * DLAConvOpDescAccessor::kernelHeightCSC() const { return _l.kernelHeightCSC(_base); } +uint16_t * DLAConvOpDescAccessor::kernelChannelCSC() const { return _l.kernelChannelCSC(_base); } +uint16_t * DLAConvOpDescAccessor::inputWidthCMAC() const { return _l.inputWidthCMAC(_base); } +uint16_t * DLAConvOpDescAccessor::inputHeightCMAC() const { return _l.inputHeightCMAC(_base); } +uint32_t * DLAConvOpDescAccessor::bytesPerKernel() const { return _l.bytesPerKernel(_base); } + + +// +// dla_lut_offset +// +DLALUTOffsetAccessor::DLALUTOffsetAccessor(NvU8 *base, const DLALUTOffset &l) : _base(base), _l(l) { } + +NvU8 * DLALUTOffsetAccessor::struct_base() const { return _base; } +size_t DLALUTOffsetAccessor::struct_size() const { return _l.struct_size(); } +size_t DLALUTOffsetAccessor::struct_align() const { return _l.struct_align(); } + +uint8_t * DLALUTOffsetAccessor::expOffset_xxx() const { return _l.expOffset_xxx(_base); } +int8_t * DLALUTOffsetAccessor::expOffset() const { return _l.expOffset(_base); } +uint8_t * DLALUTOffsetAccessor::fracBits_xxx() const { return _l.fracBits_xxx(_base); } +int8_t * DLALUTOffsetAccessor::fracBits() const { return _l.fracBits(_base); } +uint16_t * DLALUTOffsetAccessor::reserved0() const { return _l.reserved0(_base); } + + +// +// dla_float_data +// +DLAFloatDataAccessor::DLAFloatDataAccessor(NvU8 *base, const DLAFloatData &l) : _base(base), _l(l) { } + +NvU8 * DLAFloatDataAccessor::struct_base() const { return _base; } +size_t DLAFloatDataAccessor::struct_size() const { return _l.struct_size(); } +size_t DLAFloatDataAccessor::struct_align() const { return _l.struct_align(); } + +int16_t * DLAFloatDataAccessor::scale() const { return _l.scale(_base); } +uint8_t * DLAFloatDataAccessor::shifter_xxx() const { return _l.shifter_xxx(_base); } +int8_t * DLAFloatDataAccessor::shifter() const { return _l.shifter(_base); } +uint8_t * DLAFloatDataAccessor::reserved0() const { return _l.reserved0(_base); } + +// +// dla_slope +// +DLASlopeAccessor::DLASlopeAccessor(NvU8 *base, const DLASlope &l) : _base(base), _l(l) { } + +NvU8 * DLASlopeAccessor::struct_base() const { return _base; } +size_t DLASlopeAccessor::struct_size() const { return _l.struct_size(); } +size_t DLASlopeAccessor::struct_align() const { return _l.struct_align(); } + +DLAFloatDataAccessor DLASlopeAccessor::dataIAccessor() const { return _l.dataIAccessor(_base); } +uint16_t * DLASlopeAccessor::dataF() const { return _l.dataF(_base); } + +//a_type * DLASlopeAccessor::a() const { return _l.a(_base); } +//b_type * DLASlopeAccessor::b(size_t i) const { return _l.b(_base, i); } +//size_t DLASlopeAccessor::numB() const { return _l.numB(); } +// DLAConsumerAccessor DLACommonOpDescAccessor::fusedParentAccessor() const { return _c.fusedParentAccessor(_base); } + + +// +// dla_lut_param +// +DLALUTParamAccessor::DLALUTParamAccessor(NvU8 *base, const DLALUTParam &l) : _base(base), _l(l) { } + +NvU8 * DLALUTParamAccessor::struct_base() const { return _base; } +size_t DLALUTParamAccessor::struct_size() const { return _l.struct_size(); } +size_t DLALUTParamAccessor::struct_align() const { return _l.struct_align(); } + +int16_t * DLALUTParamAccessor::linearExpTable(size_t i) const { return _l.linearExpTable(_base, i); } +size_t DLALUTParamAccessor::numLinearExpTable() const { return _l.numLinearExpTable(); } +int16_t * DLALUTParamAccessor::linearOnlyTable(size_t i) const { return _l.linearOnlyTable(_base, i); } +size_t DLALUTParamAccessor::numLinearOnlyTable() const { return _l.numLinearOnlyTable(); } +uint8_t * DLALUTParamAccessor::method() const { return _l.method(_base); } +uint8_t DLALUTParamAccessor::method_Exponential() const { return _l.method_Exponential(); } +uint8_t DLALUTParamAccessor::method_Linear() const { return _l.method_Linear(); } +DLALUTOffsetAccessor DLALUTParamAccessor::linearExpOffsetAccessor() const { return _l.linearExpOffsetAccessor(_base); } +DLALUTOffsetAccessor DLALUTParamAccessor::linearOnlyOffsetAccessor() const { return _l.linearOnlyOffsetAccessor(_base); } +uint64_t * DLALUTParamAccessor::linearExpStart() const { return _l.linearExpStart(_base); } +uint64_t * DLALUTParamAccessor::linearExpEnd() const { return _l.linearExpEnd(_base); } +uint64_t * DLALUTParamAccessor::linearOnlyStart() const { return _l.linearOnlyStart(_base); } +uint64_t * DLALUTParamAccessor::linearOnlyEnd() const { return _l.linearOnlyEnd(_base); } +DLASlopeAccessor DLALUTParamAccessor::linearExpUnderflowSlopeAccessor() const { return _l.linearExpUnderflowSlopeAccessor(_base); } +DLASlopeAccessor DLALUTParamAccessor::linearExpOverflowSlopeAccessor() const { return _l.linearExpOverflowSlopeAccessor(_base); } +DLASlopeAccessor DLALUTParamAccessor::linearOnlyUnderflowSlopeAccessor() const { return _l.linearOnlyUnderflowSlopeAccessor(_base); } +DLASlopeAccessor DLALUTParamAccessor::linearOnlyOverflowSlopeAccessor() const { return _l.linearOnlyOverflowSlopeAccessor(_base); } +uint8_t * DLALUTParamAccessor::hybridPriority() const { return _l.hybridPriority(_base); } +uint8_t * DLALUTParamAccessor::underflowPriority() const { return _l.underflowPriority(_base); } +uint8_t * DLALUTParamAccessor::overflowPriority() const { return _l.overflowPriority(_base); } +uint8_t DLALUTParamAccessor::priority_LinearExp() const { return _l.priority_LinearExp(); } +uint8_t DLALUTParamAccessor::priority_LinearOnly() const { return _l.priority_LinearOnly(); } +int8_t * DLALUTParamAccessor::inputScaleLog2() const { return _l.inputScaleLog2(_base); } + +// +// dla_sdp_surface_desc +// +DLASDPSurfaceDescAccessor::DLASDPSurfaceDescAccessor(NvU8 *base, const DLASDPSurfaceDesc &l) : _base(base), _l(l) { } + +NvU8 * DLASDPSurfaceDescAccessor::struct_base() const { return _base; } +size_t DLASDPSurfaceDescAccessor::struct_size() const { return _l.struct_size(); } +size_t DLASDPSurfaceDescAccessor::struct_align() const { return _l.struct_align(); } + +DLADataCubeAccessor DLASDPSurfaceDescAccessor::srcDataAccessor() const { return _l.srcDataAccessor(_base); } +DLADataCubeAccessor DLASDPSurfaceDescAccessor::x1DataAccessor() const { return _l.x1DataAccessor(_base); } +DLADataCubeAccessor DLASDPSurfaceDescAccessor::x2DataAccessor() const { return _l.x2DataAccessor(_base); } +DLADataCubeAccessor DLASDPSurfaceDescAccessor::yDataAccessor() const { return _l.yDataAccessor(_base); } +DLADataCubeAccessor DLASDPSurfaceDescAccessor::dstDataAccessor() const { return _l.dstDataAccessor(_base); } + + +// +// dla_sdp_op +// +DLASDPOpAccessor::DLASDPOpAccessor(NvU8 *base, const DLASDPOp &l) : _base(base), _l(l) { } + +NvU8 * DLASDPOpAccessor::struct_base() const { return _base; } +size_t DLASDPOpAccessor::struct_size() const { return _l.struct_size(); } +size_t DLASDPOpAccessor::struct_align() const { return _l.struct_align(); } + +uint8_t * DLASDPOpAccessor::enable() const { return _l.enable(_base); } +uint8_t * DLASDPOpAccessor::ALUType() const { return _l.ALUType(_base); } +uint8_t DLASDPOpAccessor::ALUType_Max() const { return _l.ALUType_Max(); } +uint8_t DLASDPOpAccessor::ALUType_Min() const { return _l.ALUType_Min(); } +uint8_t DLASDPOpAccessor::ALUType_Sum() const { return _l.ALUType_Sum(); } +uint8_t DLASDPOpAccessor::ALUType_Eql() const { return _l.ALUType_Eql(); } +uint8_t * DLASDPOpAccessor::type() const { return _l.type(_base); } +uint8_t DLASDPOpAccessor::type_None() const { return _l.type_None(); } +uint8_t DLASDPOpAccessor::type_Mul() const { return _l.type_Mul(); } +uint8_t DLASDPOpAccessor::type_Add() const { return _l.type_Add(); } +uint8_t DLASDPOpAccessor::type_Both() const { return _l.type_Both(); } +uint8_t * DLASDPOpAccessor::mode() const { return _l.mode(_base); } +uint8_t DLASDPOpAccessor::mode_PerLayer() const { return _l.mode_PerLayer(); } +uint8_t DLASDPOpAccessor::mode_PerKernel() const { return _l.mode_PerKernel(); } +uint8_t DLASDPOpAccessor::mode_PerPoint() const { return _l.mode_PerPoint(); } +uint8_t * DLASDPOpAccessor::act() const { return _l.act(_base); } +uint8_t DLASDPOpAccessor::act_None() const { return _l.act_None(); } +uint8_t DLASDPOpAccessor::act_RelU() const { return _l.act_RelU(); } +uint8_t DLASDPOpAccessor::act_LUT() const { return _l.act_LUT(); } +uint8_t * DLASDPOpAccessor::shiftValue() const { return _l.shiftValue(_base); } +int16_t * DLASDPOpAccessor::ALUOperand_xxx() const { return _l.ALUOperand_xxx(_base); } +int16_t * DLASDPOpAccessor::MulOperand_xxx() const { return _l.MulOperand_xxx(_base); } +int32_t * DLASDPOpAccessor::ALUOperand() const { return _l.ALUOperand(_base); } +int32_t * DLASDPOpAccessor::MulOperand() const { return _l.MulOperand(_base); } +uint8_t * DLASDPOpAccessor::truncate() const { return _l.truncate(_base); } +uint8_t * DLASDPOpAccessor::precision() const { return _l.precision(_base); } +DLASDPCVTAccessor DLASDPOpAccessor::cvt() const { return _l.cvt(_base); } + +// +// dla_sdp_op_desc +// +DLASDPOpDescAccessor::DLASDPOpDescAccessor(NvU8 *base, const DLASDPOpDesc &l) : _base(base), _l(l) { } + +NvU8 * DLASDPOpDescAccessor::struct_base() const { return _base; } +size_t DLASDPOpDescAccessor::struct_size() const { return _l.struct_size(); } +size_t DLASDPOpDescAccessor::struct_align() const { return _l.struct_align(); } + +uint8_t * DLASDPOpDescAccessor::srcPrecision() const { return _l.srcPrecision(_base); } +uint8_t DLASDPOpDescAccessor::srcPrecision_Int8() const { return _l.srcPrecision_Int8(); } +uint8_t DLASDPOpDescAccessor::srcPrecision_Int16() const { return _l.srcPrecision_Int16(); } +uint8_t DLASDPOpDescAccessor::srcPrecision_FP16() const { return _l.srcPrecision_FP16(); } +uint8_t * DLASDPOpDescAccessor::dstPrecision() const { return _l.dstPrecision(_base); } +uint8_t DLASDPOpDescAccessor::dstPrecision_Int8() const { return _l.dstPrecision_Int8(); } +uint8_t DLASDPOpDescAccessor::dstPrecision_Int16() const { return _l.dstPrecision_Int16(); } +uint8_t DLASDPOpDescAccessor::dstPrecision_FP16() const { return _l.dstPrecision_FP16(); } +int16_t * DLASDPOpDescAccessor::LUTIndex() const { return _l.LUTIndex(_base); } +DLACVTParamAccessor DLASDPOpDescAccessor::outCVTAccessor() const { return _l.outCVTAccessor(_base); } +uint8_t * DLASDPOpDescAccessor::convMode() const { return _l.convMode(_base); } +uint8_t DLASDPOpDescAccessor::convMode_Direct() const { return _l.convMode_Direct(); } +uint8_t DLASDPOpDescAccessor::convMode_Winograd() const { return _l.convMode_Winograd(); } +uint8_t * DLASDPOpDescAccessor::batchNum() const { return _l.batchNum(_base); } +uint16_t * DLASDPOpDescAccessor::reserved0() const { return _l.reserved0(_base); } +uint32_t * DLASDPOpDescAccessor::batchStride() const { return _l.batchStride(_base); } +DLASDPOpAccessor DLASDPOpDescAccessor::x1OpAccessor() const { return _l.x1OpAccessor(_base); } +DLASDPOpAccessor DLASDPOpDescAccessor::x2OpAccessor() const { return _l.x2OpAccessor(_base); } +DLASDPOpAccessor DLASDPOpDescAccessor::yOpAccessor() const { return _l.yOpAccessor(_base); } + +DLASDPCVTAccessor::DLASDPCVTAccessor(NvU8 *base, const DLASDPCVT &l) : _base(base), _l(l) { } + +NvU8 * DLASDPCVTAccessor::struct_base() const { return _base; } +size_t DLASDPCVTAccessor::struct_size() const { return _l.struct_size(); } +size_t DLASDPCVTAccessor::struct_align() const { return _l.struct_align(); } + +DLACVTParamAccessor DLASDPCVTAccessor::aluCVTAccessor() const { return _l.aluCVTAccessor(_base); } +DLACVTParamAccessor DLASDPCVTAccessor::mulCVTAccessor() const { return _l.mulCVTAccessor(_base); } + +// +// dla_pdp_surface_desc +// +DLAPDPSurfaceDescAccessor::DLAPDPSurfaceDescAccessor(NvU8 *base, const DLAPDPSurfaceDesc &l) : _base(base), _l(l) { } + +NvU8 * DLAPDPSurfaceDescAccessor::struct_base() const { return _base; } +size_t DLAPDPSurfaceDescAccessor::struct_size() const { return _l.struct_size(); } +size_t DLAPDPSurfaceDescAccessor::struct_align() const { return _l.struct_align(); } + +DLADataCubeAccessor DLAPDPSurfaceDescAccessor::srcDataAccessor() const { return _l.srcDataAccessor(_base); } +DLADataCubeAccessor DLAPDPSurfaceDescAccessor::dstDataAccessor() const { return _l.dstDataAccessor(_base); } + +// +// dla_pdp_op_desc +// +DLAPDPOpDescAccessor::DLAPDPOpDescAccessor(NvU8 *base, const DLAPDPOpDesc &l) : _base(base), _l(l) { } + +NvU8 * DLAPDPOpDescAccessor::struct_base() const { return _base; } +size_t DLAPDPOpDescAccessor::struct_size() const { return _l.struct_size(); } +size_t DLAPDPOpDescAccessor::struct_align() const { return _l.struct_align(); } + +uint8_t * DLAPDPOpDescAccessor::precision() const { return _l.precision(_base); } +uint8_t DLAPDPOpDescAccessor::precision_Int8() const { return _l.precision_Int8(); } +uint8_t DLAPDPOpDescAccessor::precision_Int16() const { return _l.precision_Int16(); } +uint8_t DLAPDPOpDescAccessor::precision_FP16() const { return _l.precision_FP16(); } +uint8_t * DLAPDPOpDescAccessor::reserved0_xxx(size_t i) const { return _l.reserved0_xxx(_base, i); } +uint8_t * DLAPDPOpDescAccessor::reserved0() const { return _l.reserved0(_base); } + +int16_t * DLAPDPOpDescAccessor::paddingValue_xxx(size_t i) const { return _l.paddingValue_xxx(_base, i); } +int32_t * DLAPDPOpDescAccessor::paddingValue(size_t i) const { return _l.paddingValue(_base, i); } +uint8_t * DLAPDPOpDescAccessor::splitNum() const { return _l.splitNum(_base); } +uint8_t * DLAPDPOpDescAccessor::reserved1_xxx(size_t i) const { return _l.reserved1_xxx(_base, i); } +uint16_t * DLAPDPOpDescAccessor::partialInWidthFirst() const { return _l.partialInWidthFirst(_base); } +uint16_t * DLAPDPOpDescAccessor::partialInWidthMid() const { return _l.partialInWidthMid(_base); } +uint16_t * DLAPDPOpDescAccessor::partialInWidthLast() const { return _l.partialInWidthLast(_base); } + +uint16_t * DLAPDPOpDescAccessor::partialWidthFirst() const { return _l.partialWidthFirst(_base); } +uint16_t * DLAPDPOpDescAccessor::partialWidthMid() const { return _l.partialWidthMid(_base); } +uint16_t * DLAPDPOpDescAccessor::partialWidthLast() const { return _l.partialWidthLast(_base); } + +uint8_t *DLAPDPOpDescAccessor::poolMode() const { return _l.poolMode(_base); } +uint8_t DLAPDPOpDescAccessor::poolMode_AVG() const { return _l.poolMode_AVG(); } +uint8_t DLAPDPOpDescAccessor::poolMode_MAX() const { return _l.poolMode_MAX(); } +uint8_t DLAPDPOpDescAccessor::poolMode_MIN() const { return _l.poolMode_MIN(); } +uint8_t *DLAPDPOpDescAccessor::poolWidth() const { return _l.poolWidth(_base); } +uint8_t *DLAPDPOpDescAccessor::poolHeight() const { return _l.poolHeight(_base); } +uint8_t *DLAPDPOpDescAccessor::reserved2_xxx() const { return _l.reserved2_xxx(_base); } + +uint8_t *DLAPDPOpDescAccessor::strideX() const { return _l.strideX(_base); } +uint8_t *DLAPDPOpDescAccessor::strideY() const { return _l.strideY(_base); } +uint16_t *DLAPDPOpDescAccessor::strideX_xxx() const { return _l.strideX_xxx(_base); } +uint16_t *DLAPDPOpDescAccessor::strideY_xxx() const { return _l.strideY_xxx(_base); } +uint16_t *DLAPDPOpDescAccessor::reserved3_xxx() const { return _l.reserved3_xxx(_base); } + +uint8_t *DLAPDPOpDescAccessor::padLeft() const { return _l.padLeft(_base); } +uint8_t *DLAPDPOpDescAccessor::padRight() const { return _l.padRight(_base); } +uint8_t *DLAPDPOpDescAccessor::padTop() const { return _l.padTop(_base); } +uint8_t *DLAPDPOpDescAccessor::padBottom() const { return _l.padBottom(_base); } + +// +// dla_cdp_surface_desc +// +DLACDPSurfaceDescAccessor::DLACDPSurfaceDescAccessor(NvU8 *base, const DLACDPSurfaceDesc &l) : _base(base), _l(l) { } + +NvU8 * DLACDPSurfaceDescAccessor::struct_base() const { return _base; } +size_t DLACDPSurfaceDescAccessor::struct_size() const { return _l.struct_size(); } +size_t DLACDPSurfaceDescAccessor::struct_align() const { return _l.struct_align(); } + +DLADataCubeAccessor DLACDPSurfaceDescAccessor::srcDataAccessor() const { return _l.srcDataAccessor(_base); } +DLADataCubeAccessor DLACDPSurfaceDescAccessor::dstDataAccessor() const { return _l.dstDataAccessor(_base); } + + +// +// dla_cdp_op_desc +// +DLACDPOpDescAccessor::DLACDPOpDescAccessor(NvU8 *base, const DLACDPOpDesc &l) : _base(base), _l(l) { } + +NvU8 * DLACDPOpDescAccessor::struct_base() const { return _base; } +size_t DLACDPOpDescAccessor::struct_size() const { return _l.struct_size(); } +size_t DLACDPOpDescAccessor::struct_align() const { return _l.struct_align(); } + +uint8_t * DLACDPOpDescAccessor::inPrecision() const { return _l.inPrecision(_base); } +uint8_t DLACDPOpDescAccessor::inPrecision_Int8() const { return _l.inPrecision_Int8(); } +uint8_t DLACDPOpDescAccessor::inPrecision_Int16() const { return _l.inPrecision_Int16(); } +uint8_t DLACDPOpDescAccessor::inPrecision_FP16() const { return _l.inPrecision_FP16(); } + +uint8_t * DLACDPOpDescAccessor::outPrecision() const { return _l.outPrecision(_base); } +uint8_t DLACDPOpDescAccessor::outPrecision_Int8() const { return _l.outPrecision_Int8(); } +uint8_t DLACDPOpDescAccessor::outPrecision_Int16() const { return _l.outPrecision_Int16(); } +uint8_t DLACDPOpDescAccessor::outPrecision_FP16() const { return _l.outPrecision_FP16(); } + +int16_t * DLACDPOpDescAccessor::LUTIndex() const { return _l.LUTIndex(_base); } +DLACVTParamAccessor DLACDPOpDescAccessor::inCVTAccessor() const { return _l.inCVTAccessor(_base); } +DLACVTParamAccessor DLACDPOpDescAccessor::outCVTAccessor() const { return _l.outCVTAccessor(_base); } + +uint8_t * DLACDPOpDescAccessor::localSize() const { return _l.localSize(_base); } +uint8_t * DLACDPOpDescAccessor::bypassSquareSum() const { return _l.bypassSquareSum(_base); } +uint8_t * DLACDPOpDescAccessor::bypassOutMul() const { return _l.bypassOutMul(_base); } +uint8_t * DLACDPOpDescAccessor::reserved0() const { return _l.reserved0(_base); } + +// +// dla_rubik_surface_desc +// +DLARubikSurfaceDescAccessor::DLARubikSurfaceDescAccessor(NvU8 *base, const DLARubikSurfaceDesc &l) : _base(base), _l(l) { } + +NvU8 * DLARubikSurfaceDescAccessor::struct_base() const { return _base; } +size_t DLARubikSurfaceDescAccessor::struct_size() const { return _l.struct_size(); } +size_t DLARubikSurfaceDescAccessor::struct_align() const { return _l.struct_align(); } + +DLADataCubeAccessor DLARubikSurfaceDescAccessor::srcDataAccessor() const { return _l.srcDataAccessor(_base); } +DLADataCubeAccessor DLARubikSurfaceDescAccessor::dstDataAccessor() const { return _l.dstDataAccessor(_base); } + + +// +// dla_rubik_op_desc +// +DLARubikOpDescAccessor::DLARubikOpDescAccessor(NvU8 *base, const DLARubikOpDesc &l) : _base(base), _l(l) { } + +NvU8 * DLARubikOpDescAccessor::struct_base() const { return _base; } +size_t DLARubikOpDescAccessor::struct_size() const { return _l.struct_size(); } +size_t DLARubikOpDescAccessor::struct_align() const { return _l.struct_align(); } + +uint8_t * DLARubikOpDescAccessor::mode() const { return _l.mode(_base); } +uint8_t DLARubikOpDescAccessor::mode_Contract() const { return _l.mode_Contract(); } +uint8_t DLARubikOpDescAccessor::mode_Split() const { return _l.mode_Split(); } +uint8_t DLARubikOpDescAccessor::mode_Merge() const { return _l.mode_Merge(); } + +uint8_t * DLARubikOpDescAccessor::precision() const { return _l.precision(_base); } +uint8_t DLARubikOpDescAccessor::precision_Int8() const { return _l.precision_Int8(); } +uint8_t DLARubikOpDescAccessor::precision_Int16() const { return _l.precision_Int16(); } +uint8_t DLARubikOpDescAccessor::precision_FP16() const { return _l.precision_FP16(); } + +uint8_t * DLARubikOpDescAccessor::strideX() const { return _l.strideX(_base); } +uint8_t * DLARubikOpDescAccessor::strideY() const { return _l.strideY(_base); } + + +// +// dla_surface_container +// +DLASurfaceContainerAccessor::DLASurfaceContainerAccessor(NvU8 *base, const DLASurfaceContainer &l) : _base(base), _l(l) { } + +NvU8 * DLASurfaceContainerAccessor::struct_base() const { return _base; } +size_t DLASurfaceContainerAccessor::struct_size() const { return _l.struct_size(); } +size_t DLASurfaceContainerAccessor::struct_align() const { return _l.struct_align(); } + +DLABDMASurfaceDescAccessor DLASurfaceContainerAccessor::bdmaSurfaceDescAccessor(size_t c) const { return _l.bdmaSurfaceDescAccessor(_base, c); } +DLAConvSurfaceDescAccessor DLASurfaceContainerAccessor::convSurfaceDescAccessor(size_t c) const { return _l.convSurfaceDescAccessor(_base, c); } +DLASDPSurfaceDescAccessor DLASurfaceContainerAccessor::sdpSurfaceDescAccessor(size_t c) const { return _l.sdpSurfaceDescAccessor(_base, c); } +DLAPDPSurfaceDescAccessor DLASurfaceContainerAccessor::pdpSurfaceDescAccessor(size_t c) const { return _l.pdpSurfaceDescAccessor(_base, c); } +DLACDPSurfaceDescAccessor DLASurfaceContainerAccessor::cdpSurfaceDescAccessor(size_t c) const { return _l.cdpSurfaceDescAccessor(_base, c); } +DLARubikSurfaceDescAccessor DLASurfaceContainerAccessor::rubikSurfaceDescAccessor(size_t c) const { return _l.rubikSurfaceDescAccessor(_base, c); } + + +// +// dla_operation_container +// +DLAOperationContainerAccessor::DLAOperationContainerAccessor(NvU8 *base, const DLAOperationContainer &l) : _base(base), _l(l) { } + +NvU8 * DLAOperationContainerAccessor::struct_base() const { return _base; } +size_t DLAOperationContainerAccessor::struct_size() const { return _l.struct_size(); } +size_t DLAOperationContainerAccessor::struct_align() const { return _l.struct_align(); } +DLABDMAOpDescAccessor DLAOperationContainerAccessor::bdmaOpDescAccessor(size_t c) const { return _l.bdmaOpDescAccessor(_base, c); } +DLAConvOpDescAccessor DLAOperationContainerAccessor::convOpDescAccessor(size_t c) const { return _l.convOpDescAccessor(_base, c); } +DLASDPOpDescAccessor DLAOperationContainerAccessor::sdpOpDescAccessor (size_t c) const { return _l.sdpOpDescAccessor(_base, c); } +DLAPDPOpDescAccessor DLAOperationContainerAccessor::pdpOpDescAccessor (size_t c) const { return _l.pdpOpDescAccessor(_base, c); } +DLACDPOpDescAccessor DLAOperationContainerAccessor::cdpOpDescAccessor (size_t c) const { return _l.cdpOpDescAccessor(_base, c); } +DLARubikOpDescAccessor DLAOperationContainerAccessor::rubikOpDescAccessor (size_t c) const { return _l.rubikOpDescAccessor(_base, c); } + + +// +// DLAInterface:: +// +DLANetworkDescAccessor DLAInterface::networkDescAccessor(NvU8 *b) const { return DLANetworkDescAccessor (b, networkDesc()); } +DLAConsumerAccessor DLAInterface::consumerAccessor(NvU8 *b) const { return DLAConsumerAccessor (b, consumer()); } +DLACommonOpDescAccessor DLAInterface::commonOpDescAccessor(NvU8 *b) const { return DLACommonOpDescAccessor(b, commonOpDesc()); } +DLACVTParamAccessor DLAInterface::cvtParamAccessor(NvU8 *b) const { return DLACVTParamAccessor(b, cvtParam()); } +DLADataCubeAccessor DLAInterface::dataCubeAccessor(NvU8 *b) const { return DLADataCubeAccessor(b, dataCube()); } +DLAConvSurfaceDescAccessor DLAInterface::convSurfaceDescAccessor(NvU8 *b) const { return DLAConvSurfaceDescAccessor(b, convSurfaceDesc()); } +DLAConvOpDescAccessor DLAInterface::convOpDescAccessor(NvU8 *b) const { return DLAConvOpDescAccessor(b, convOpDesc()); } +DLALUTOffsetAccessor DLAInterface::lutOffsetAccessor(NvU8 *b) const { return DLALUTOffsetAccessor(b, lutOffset()); } +DLAFloatDataAccessor DLAInterface::floatDataAccessor(NvU8 *b) const { return DLAFloatDataAccessor(b, floatData()); } +DLASlopeAccessor DLAInterface::slopeAccessor(NvU8 *b) const { return DLASlopeAccessor(b, slope()); } +DLALUTParamAccessor DLAInterface::lutParamAccessor(NvU8 *b) const { return DLALUTParamAccessor(b, lutParam()); } +DLASDPSurfaceDescAccessor DLAInterface::sdpSurfaceDescAccessor(NvU8 *b) const { return DLASDPSurfaceDescAccessor(b, sdpSurfaceDesc()); } +DLASDPOpAccessor DLAInterface::sdpOpAccessor(NvU8 *b) const { return DLASDPOpAccessor(b, sdpOp()); } +DLASDPOpDescAccessor DLAInterface::sdpOpDescAccessor(NvU8 *b) const { return DLASDPOpDescAccessor(b, sdpOpDesc()); } +DLASDPCVTAccessor DLAInterface::sdpCVTAccessor(NvU8 *b) const { return DLASDPCVTAccessor(b, sdpCVT()); } +DLAPDPOpDescAccessor DLAInterface::pdpOpDescAccessor(NvU8* b) const { return DLAPDPOpDescAccessor(b, pdpOpDesc()); } +DLAPDPSurfaceDescAccessor DLAInterface::pdpSurfaceDescAccessor(NvU8* b) const { return DLAPDPSurfaceDescAccessor(b, pdpSurfaceDesc()); } +DLACDPOpDescAccessor DLAInterface::cdpOpDescAccessor(NvU8* b) const { return DLACDPOpDescAccessor(b, cdpOpDesc()); } +DLACDPSurfaceDescAccessor DLAInterface::cdpSurfaceDescAccessor(NvU8* b) const { return DLACDPSurfaceDescAccessor(b, cdpSurfaceDesc()); } +DLARubikOpDescAccessor DLAInterface::rubikOpDescAccessor(NvU8* b) const { return DLARubikOpDescAccessor(b, rubikOpDesc()); } +DLARubikSurfaceDescAccessor DLAInterface::rubikSurfaceDescAccessor(NvU8* b) const { return DLARubikSurfaceDescAccessor(b, rubikSurfaceDesc()); } +DLASurfaceContainerAccessor DLAInterface::surfaceContainerAccessor(NvU8 *b) const { return DLASurfaceContainerAccessor(b, surfaceContainer()); } +DLAOperationContainerAccessor DLAInterface::operationContainerAccessor(NvU8 *b) const { return DLAOperationContainerAccessor(b, operationContainer()); } + + +} // nvdla::priv + +} // nvdla diff --git a/umd/core/src/compiler/DLAInterfaceA.cpp b/umd/core/src/compiler/DLAInterfaceA.cpp new file mode 100644 index 00000000..17904067 --- /dev/null +++ b/umd/core/src/compiler/DLAInterfaceA.cpp @@ -0,0 +1,1027 @@ +/* + * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#include // for offsetof + +#include "priv/DLAInterface.h" + +#include "priv/dla/dla1/A/dla_fw_version.h" +#include "priv/dla/dla1/A/dla_interface.h" + +namespace nvdla +{ + +namespace priv +{ + +// +// struct dla_network_descriptor +// +class DLANetworkDescA : public DLANetworkDesc +{ +public: + virtual ~DLANetworkDescA() { } + + virtual size_t struct_size() const { return sizeof(dla_network_desc); } + virtual size_t struct_align() const { return 4; /* see __attribute__ */ } + + virtual size_t op_BDMA() const { return DLA_OP_BDMA; } + virtual size_t op_CONV() const { return DLA_OP_CONV; } + virtual size_t op_SDP() const { return DLA_OP_SDP; } + virtual size_t op_PDP() const { return DLA_OP_PDP; } + virtual size_t op_CDP() const { return DLA_OP_CDP; } + virtual size_t op_RUBIK() const { return DLA_OP_RUBIK; } + virtual size_t numOpHeads() const { return DLA_OP_NUM; } + + virtual int16_t * operationDescIndex(NvU8 *b) const { return &ric(b)->operation_desc_index; } + virtual int16_t * surfaceDescIndex(NvU8 *b) const { return &ric(b)->surface_desc_index; } + virtual int16_t * dependencyGraphIndex(NvU8 *b) const { return &ric(b)->dependency_graph_index; } + virtual int16_t * LUTDataIndex(NvU8 *b) const { return &ric(b)->lut_data_index; } + virtual int16_t * ROIArrayIndex(NvU8 *b) const { return &ric(b)->roi_array_index; } + virtual int16_t * surfaceIndex(NvU8 *b) const { return &ric(b)->surface_index; } + virtual int16_t * statListIndex(NvU8 *b) const { return &ric(b)->stat_list_index; } + virtual int16_t * reserved1(NvU8 *b) const { return &ric(b)->reserved1; } + virtual int16_t * opHead(NvU8 *b, size_t h) const { return &ric(b)->op_head[h]; } + virtual uint16_t * numROIs(NvU8 *b) const { return &ric(b)->num_rois; } + virtual uint16_t * numOperations(NvU8 *b) const { return &ric(b)->num_operations; } + virtual uint16_t * numLUTs(NvU8 *b) const { return &ric(b)->num_luts; } + virtual uint16_t * numAddresses(NvU8 *b) const { return &ric(b)->num_addresses; } + virtual int16_t * inputLayer(NvU8 *b) const { return &ric(b)->input_layer; } + virtual uint8_t * dynamicROI(NvU8 *b) const { return &ric(b)->dynamic_roi; } + virtual uint8_t * reserved0(NvU8 *b) const { return &ric(b)->reserved0; } +protected: + static inline dla_network_desc *ric(NvU8 *base) { return reinterpret_cast(base); } +}; +static DLANetworkDescA g_dla_network_desc; +const DLANetworkDesc & DLAInterfaceA::networkDesc() const { return g_dla_network_desc; } + + +// +// struct dla_consumer +// +class DLAConsumerA : public DLAConsumer +{ +public: + virtual ~DLAConsumerA() { } + + virtual size_t struct_size() const { return sizeof(dla_consumer); } + virtual size_t struct_align() const { return 4; /* see __attribute__ */ } + + virtual int16_t * index(NvU8 *base) const { return & ric(base)->index; } + virtual uint8_t * event(NvU8 *base) const { return & ric(base)->event; } + virtual uint8_t event_OpCompleted() const { return DLA_EVENT_OP_COMPLETED; } + virtual uint8_t event_OpProgrammed() const { return DLA_EVENT_OP_PROGRAMMED; } + virtual uint8_t event_OpEnabled() const { return DLA_EVENT_OP_ENABLED; } + virtual uint8_t event_OpCDMAWeightDone() const { return DLA_EVENT_CDMA_WT_DONE; } + virtual uint8_t event_OpCDMADataDone() const { return DLA_EVENT_CDMA_DT_DONE; } + + virtual uint8_t * res (NvU8 *base) const { return & ric(base)->res; } +protected: + static inline dla_consumer *ric(NvU8 *base) { return reinterpret_cast(base); } +}; + +static DLAConsumerA g_dla_consumer; +const DLAConsumer & DLAInterfaceA::consumer() const { return g_dla_consumer; } + + +// +// struct dla_common_op_desc +// +class DLACommonOpDescA : public DLACommonOpDesc +{ +public: + virtual ~DLACommonOpDescA() { } + + virtual size_t struct_size() const { return sizeof(dla_common_op_desc); } + virtual size_t struct_align() const { return 4; /* see __attribute__ */ } + + virtual int16_t * index(NvU8 *b) const { return &ric(b)->index; } + virtual int8_t * roiIndex(NvU8 *b) const { return &ric(b)->roi_index; } + virtual uint8_t * opType(NvU8 *b) const { return &ric(b)->op_type; } + virtual uint8_t opType_BDMA() const { return DLA_OP_BDMA; } + virtual uint8_t opType_CONV() const { return DLA_OP_CONV; } + virtual uint8_t opType_SDP() const { return DLA_OP_SDP; } + virtual uint8_t opType_PDP() const { return DLA_OP_PDP; } + virtual uint8_t opType_CDP() const { return DLA_OP_CDP; } + virtual uint8_t opType_RUBIK() const { return DLA_OP_RUBIK; } + virtual uint8_t * dependencyCount(NvU8 *b) const { return &ric(b)->dependency_count; } + virtual uint8_t * reserved_xxx(NvU8 *) const { return 0; } // XXX not supported for this version + virtual uint8_t * reserved0(NvU8 *b, size_t i) const { return &ric(b)->reserved0[i]; } + + virtual size_t numConsumers() const { return DLA_OP_NUM; } + + virtual DLAConsumerAccessor consumerAccessor(NvU8 *b, size_t c) const { return DLAConsumerAccessor(cir(&ric(b)->consumers[c]), g_dla_consumer); } + virtual DLAConsumerAccessor fusedParentAccessor(NvU8 *b) const { return DLAConsumerAccessor(cir(&ric(b)->fused_parent), g_dla_consumer); } + +protected: + + virtual DLAConsumer &consumer() const { return g_dla_consumer; } + virtual DLAConsumer &fusedParent() const { return g_dla_consumer; } + + static inline NvU8 *cir(dla_consumer *c) { return reinterpret_cast(c); } + static inline dla_common_op_desc *ric(NvU8 *base) { return reinterpret_cast(base); } +}; + +static DLACommonOpDescA g_dla_common_op_desc; +const DLACommonOpDesc & DLAInterfaceA::commonOpDesc() const { return g_dla_common_op_desc; } + + +// +// dla_bdma_transfer_desc +// +class DLABDMATransferDescA : public DLABDMATransferDesc +{ +public: + virtual ~DLABDMATransferDescA() { } + + virtual size_t struct_size() const { return sizeof(dla_bdma_transfer_desc); } + virtual size_t struct_align() const { return 4; /* see __attribute__ */ } + + virtual int16_t * srcAddress(NvU8 *b) const { return &ric(b)->source_address; } + virtual int16_t * dstAddress(NvU8 *b) const { return &ric(b)->destination_address; } + virtual uint32_t * lineSize(NvU8 *b) const { return &ric(b)->line_size; } + virtual uint32_t * lineRepeat(NvU8 *b) const { return &ric(b)->line_repeat; } + virtual uint32_t * srcLine(NvU8 *b) const { return &ric(b)->source_line; } + virtual uint32_t * dstLine(NvU8 *b) const { return &ric(b)->destination_line; } + virtual uint32_t * surfaceRepeat(NvU8 *b) const { return &ric(b)->surface_repeat; } + virtual uint32_t * srcSurface(NvU8 *b) const { return &ric(b)->source_surface; } + virtual uint32_t * dstSurface(NvU8 *b) const { return &ric(b)->destination_surface; } + +protected: + static inline dla_bdma_transfer_desc *ric(NvU8 *base) { return reinterpret_cast(base); } +}; +static DLABDMATransferDescA g_dla_bdma_transfer_desc; + + +// +// dla_bdma_surface_desc +// +class DLABDMASurfaceDescA : public DLABDMASurfaceDesc +{ +public: + virtual ~DLABDMASurfaceDescA() { } + + virtual size_t struct_size() const { return sizeof(dla_bdma_surface_desc); } + virtual size_t struct_align() const { return 4; /* see __attribute__ */ } + + virtual uint8_t * srcType(NvU8 *b) const { return &ric(b)->source_type; } + virtual uint8_t * dstType(NvU8 *b) const { return &ric(b)->destination_type; } + virtual uint16_t * numTransfers(NvU8 *b) const { return &ric(b)->num_transfers; } + virtual DLABDMATransferDescAccessor transferAccessor(NvU8 *b, size_t i) const { return DLABDMATransferDescAccessor(dir(&ric(b)->transfers[i]), g_dla_bdma_transfer_desc); } + + virtual uint8_t type_MC() const { return DLA_MEM_MC; } + virtual uint8_t type_CV() const { return DLA_MEM_CV; } + virtual uint8_t type_HW() const { return DLA_MEM_HW; } + virtual uint16_t maxNumTransfers() const { return NUM_MAX_BDMA_OPS; } + +protected: + static inline NvU8 *dir(dla_bdma_transfer_desc *d) { return reinterpret_cast(d); } + static inline dla_bdma_surface_desc *ric(NvU8 *base) { return reinterpret_cast(base); } +}; +static DLABDMASurfaceDescA g_dla_bdma_surface_desc; + + +// +// dla_bdma_op_desc +// +class DLABDMAOpDescA : public DLABDMAOpDesc +{ +public: + virtual ~DLABDMAOpDescA() { } + + virtual size_t struct_size() const { return sizeof(dla_bdma_op_desc); } + virtual size_t struct_align() const { return 4; /* see __attribute__ */ } + + virtual uint16_t * numTransfers(NvU8 *b) const { return &ric(b)->num_transfers; } + virtual uint16_t * reserved0(NvU8 *b) const { return &ric(b)->reserved0; } + +protected: + static inline dla_bdma_op_desc *ric(NvU8 *base) { return reinterpret_cast(base); } +}; +static DLABDMAOpDescA g_dla_bdma_op_desc; + +// +// dla_cvt_param +// +class DLACVTParamA : public DLACVTParam +{ +public: + virtual ~DLACVTParamA() { } + + virtual size_t struct_size() const { return sizeof(dla_cvt_param); } + virtual size_t struct_align() const { return 4; /* see __attribute__ */ } + + + virtual int16_t * scale(NvU8 *b) const { return &ric(b)->scale; } + virtual uint8_t * truncate(NvU8 *b) const { return &ric(b)->truncate; } + virtual int32_t * offset(NvU8 *b) const { return &ric(b)->offset; } + virtual uint8_t * enable(NvU8 *b) const { return &ric(b)->enable; } + virtual uint16_t * reserved_xxx(NvU8 *) const { return 0; } // XXX: Not supported for this version + + + //virtual int16_t * index(NvU8 *b) const { return &ric(b)->index; } + // virtual size_t numOpHeads() const { return DLA_OP_NUM; } + // virtual AnotherAccessor anotherAccessor(NvU8 *b, size_t c) const { return AnotherAccessor(cir(&ric(b)->another[c]), g_another); } + +protected: + // static inline NvU8 *cir(dla_cvt_param *c) { return reinterpret_cast(c); } + static inline dla_cvt_param *ric(NvU8 *base) { return reinterpret_cast(base); } +}; +static DLACVTParamA g_dla_cvt_param; +const DLACVTParam & DLAInterfaceA::cvtParam() const { return g_dla_cvt_param; } + +// +// dla_data_cube +// +class DLADataCubeA : public DLADataCube +{ +public: + virtual ~DLADataCubeA() { } + + virtual size_t struct_size() const { return sizeof(dla_data_cube); } + virtual size_t struct_align() const { return 4; /* see __attribute__ */ } + + virtual uint8_t * type_xxx(NvU8 *) const { return 0; } // XXX: Not supported for this version + virtual uint8_t type_MC_xxx() const { return 0xFFU; } // XXX: Not supported for this version + virtual uint8_t type_CV_xxx() const { return 0xFFU; } // XXX: Not supported for this version + virtual uint8_t type_HW_xxx() const { return 0xFFU; } // XXX: Not supported for this version + virtual uint16_t * type(NvU8 *b) const { return &ric(b)->type; } + virtual uint16_t type_MC() const { return DLA_MEM_MC; } + virtual uint16_t type_CV() const { return DLA_MEM_CV; } + virtual uint16_t type_HW() const { return DLA_MEM_HW; } + virtual int16_t * address(NvU8 *b) const { return &ric(b)->address; } + virtual uint32_t * offset(NvU8 *b) const { return &ric(b)->offset; } + virtual uint32_t * size(NvU8 *b) const { return &ric(b)->size; } + virtual uint16_t * width(NvU8 *b) const { return &ric(b)->width; } + virtual uint16_t * height(NvU8 *b) const { return &ric(b)->height; } + virtual uint16_t * channel(NvU8 *b) const { return &ric(b)->channel; } + virtual uint16_t * reserved0(NvU8 *b) const { return &ric(b)->reserved0; } + virtual uint32_t * lineStride(NvU8 *b) const { return &ric(b)->line_stride; } + virtual uint32_t * surfStride(NvU8 *b) const { return &ric(b)->surf_stride; } + virtual uint32_t * planeStride(NvU8 *b) const { return &ric(b)->plane_stride; } + +protected: + //static inline NvU8 *cir(dla_data_cube *c) { return reinterpret_cast(c); } + static inline dla_data_cube *ric(NvU8 *base) { return reinterpret_cast(base); } +}; +static DLADataCubeA g_dla_data_cube; +const DLADataCube & DLAInterfaceA::dataCube() const { return g_dla_data_cube; } + +// +// struct dla_conv_surface_desc +// + +class DLAConvSurfaceDescA : public DLAConvSurfaceDesc +{ +public: + virtual ~DLAConvSurfaceDescA() { } + + virtual size_t struct_size() const { return sizeof(dla_conv_surface_desc); } + virtual size_t struct_align() const { return 4; /* see __attribute__ */ } + + virtual DLADataCubeAccessor weightDataAccessor(NvU8 *b) const { return DLADataCubeAccessor(dir(&ric(b)->weight_data), g_dla_data_cube); } + virtual DLADataCubeAccessor meanDataAccessor(NvU8*) const { return DLADataCubeAccessor(dir(NULL), g_dla_data_cube); } // not supported in this version + virtual DLADataCubeAccessor wmbDataAccessor(NvU8 *b) const { return DLADataCubeAccessor(dir(&ric(b)->wmb_data), g_dla_data_cube); } + virtual DLADataCubeAccessor wgsDataAccessor(NvU8 *b) const { return DLADataCubeAccessor(dir(&ric(b)->wgs_data), g_dla_data_cube); } + virtual DLADataCubeAccessor srcDataAccessor(NvU8 *b) const { return DLADataCubeAccessor(dir(&ric(b)->src_data), g_dla_data_cube); } + virtual DLADataCubeAccessor dstDataAccessor(NvU8 *b) const { return DLADataCubeAccessor(dir(&ric(b)->dst_data), g_dla_data_cube); } + virtual uint64_t * offsetU_xxx(NvU8 *) const { return 0; } // XXX not supported in this version + virtual int64_t * offsetU(NvU8 *b) const { return &ric(b)->offset_u; } + virtual uint32_t * offsetV(NvU8*) const { return 0; } // XXX not supported in this version + virtual uint32_t * inLineUVStride(NvU8 *b) const { return &ric(b)->in_line_uv_stride; } + +protected: + static inline NvU8 *dir(dla_data_cube *d) { return reinterpret_cast(d); } + static inline NvU8 *cir(dla_conv_surface_desc *c) { return reinterpret_cast(c); } + static inline dla_conv_surface_desc *ric(NvU8 *base) { return reinterpret_cast(base); } +}; +static DLAConvSurfaceDescA g_dla_conv_surface_desc; +const DLAConvSurfaceDesc & DLAInterfaceA::convSurfaceDesc() const { return g_dla_conv_surface_desc; } + +// +// struct dla_conv_op_desc +// +class DLAConvOpDescA : public DLAConvOpDesc +{ +public: + virtual ~DLAConvOpDescA() { } + + virtual size_t struct_size() const { return sizeof(dla_conv_op_desc); } + virtual size_t struct_align() const { return 4; /* see __attribute__ */ } + + virtual uint8_t * inPrecision(NvU8 *b) const { return &ric(b)->in_precision; } + virtual uint8_t inPrecision_Int8() const { return PRECISION_INT8; } + virtual uint8_t inPrecision_Int16() const { return PRECISION_INT16; } + virtual uint8_t inPrecision_FP16() const { return PRECISION_FP16; } + virtual uint8_t * outPrecision(NvU8 *b) const { return &ric(b)->out_precision; } + virtual uint8_t outPrecision_Int8() const { return PRECISION_INT8; } + virtual uint8_t outPrecision_Int16() const { return PRECISION_INT16; } + virtual uint8_t outPrecision_FP16() const { return PRECISION_FP16; } + virtual DLACVTParamAccessor inCVTAccessor(NvU8 *b) const { return DLACVTParamAccessor(cir(&ric(b)->in_cvt), g_dla_cvt_param); } + virtual DLACVTParamAccessor outCVTAccessor(NvU8 *b) const { return DLACVTParamAccessor(cir(&ric(b)->out_cvt), g_dla_cvt_param); } + virtual int16_t * padVal(NvU8 *b) const { return &ric(b)->pad_val; } + virtual uint8_t * convMode(NvU8 *b) const { return &ric(b)->conv_mode; } + virtual uint8_t convMode_Direct() const { return CONV_MODE_DIRECT; } + virtual uint8_t convMode_Winograd() const { return CONV_MODE_WINOGRAD; } + virtual uint8_t * dataReuse(NvU8 *b) const { return &ric(b)->data_reuse; } + virtual uint8_t * weightReuse(NvU8 *b) const { return &ric(b)->weight_reuse; } + virtual uint8_t * skipDataRls(NvU8 *b) const { return &ric(b)->skip_data_rls; } + virtual uint8_t * skipWeightRls(NvU8 *b) const { return &ric(b)->skip_weight_rls; } + virtual uint8_t * reserved0(NvU8 *b) const { return &ric(b)->reserved0; } + virtual uint16_t * entryPerSlice(NvU8 *b) const { return &ric(b)->entry_per_slice; } + virtual uint16_t * fetchGrain(NvU8 *b) const { return &ric(b)->fetch_grain; } + virtual uint8_t * dataFormat(NvU8 *b) const { return &ric(b)->data_format; } + virtual uint8_t dataFormat_T_R8() const { return FORMAT_T_R8; } + virtual uint8_t dataFormat_T_R10() const { return FORMAT_T_R10; } + virtual uint8_t dataFormat_T_R12() const { return FORMAT_T_R12; } + virtual uint8_t dataFormat_T_R16() const { return FORMAT_T_R16; } + virtual uint8_t dataFormat_T_R16_I() const { return FORMAT_T_R16_I; } + virtual uint8_t dataFormat_T_R16_F() const { return FORMAT_T_R16_F; } + virtual uint8_t dataFormat_T_A16B16G16R16() const { return FORMAT_T_A16B16G16R16; } + virtual uint8_t dataFormat_T_X16B16G16R16() const { return FORMAT_T_X16B16G16R16; } + virtual uint8_t dataFormat_T_A16B16G16R16_F() const { return FORMAT_T_A16B16G16R16_F; } + virtual uint8_t dataFormat_T_A16Y16U16V16() const { return FORMAT_T_A16Y16U16V16; } + virtual uint8_t dataFormat_T_V16U16Y16A16() const { return FORMAT_T_V16U16Y16A16; } + virtual uint8_t dataFormat_T_A16Y16U16V16_F() const { return FORMAT_T_A16Y16U16V16_F; } + virtual uint8_t dataFormat_T_A8B8G8R8() const { return FORMAT_T_A8B8G8R8; } + virtual uint8_t dataFormat_T_A8R8G8B8() const { return FORMAT_T_A8R8G8B8; } + virtual uint8_t dataFormat_T_B8G8R8A8() const { return FORMAT_T_B8G8R8A8; } + virtual uint8_t dataFormat_T_R8G8B8A8() const { return FORMAT_T_R8G8B8A8; } + virtual uint8_t dataFormat_T_X8B8G8R8() const { return FORMAT_T_X8B8G8R8; } + virtual uint8_t dataFormat_T_X8R8G8B8() const { return FORMAT_T_X8R8G8B8; } + virtual uint8_t dataFormat_T_B8G8R8X8() const { return FORMAT_T_B8G8R8X8; } + virtual uint8_t dataFormat_T_R8G8B8X8() const { return FORMAT_T_R8G8B8X8; } + virtual uint8_t dataFormat_T_A2B10G10R10() const { return FORMAT_T_A2B10G10R10; } + virtual uint8_t dataFormat_T_A2R10G10B10() const { return FORMAT_T_A2R10G10B10; } + virtual uint8_t dataFormat_T_B10G10R10A2() const { return FORMAT_T_B10G10R10A2; } + virtual uint8_t dataFormat_T_R10G10B10A2() const { return FORMAT_T_R10G10B10A2; } + virtual uint8_t dataFormat_T_A2Y10U10V10() const { return FORMAT_T_A2Y10U10V10; } + virtual uint8_t dataFormat_T_V10U10Y10A2() const { return FORMAT_T_V10U10Y10A2; } + virtual uint8_t dataFormat_T_A8Y8U8V8() const { return FORMAT_T_A8Y8U8V8; } + virtual uint8_t dataFormat_T_V8U8Y8A8() const { return FORMAT_T_V8U8Y8A8; } + virtual uint8_t dataFormat_T_Y8___U8V8_N444() const { return FORMAT_T_Y8___U8V8_N444; } + virtual uint8_t dataFormat_T_Y8___V8U8_N444() const { return FORMAT_T_Y8___V8U8_N444; } + virtual uint8_t dataFormat_T_Y10___U10V10_N444() const { return FORMAT_T_Y10___U10V10_N444; } + virtual uint8_t dataFormat_T_Y10___V10U10_N444() const { return FORMAT_T_Y10___V10U10_N444; } + virtual uint8_t dataFormat_T_Y12___U12V12_N444() const { return FORMAT_T_Y12___U12V12_N444; } + virtual uint8_t dataFormat_T_Y12___V12U12_N444() const { return FORMAT_T_Y12___V12U12_N444; } + virtual uint8_t dataFormat_T_Y16___U16V16_N444() const { return FORMAT_T_Y16___U16V16_N444; } + virtual uint8_t dataFormat_T_Y16___V16U16_N444() const { return FORMAT_T_Y16___V16U16_N444; } + virtual uint8_t dataFormat_T_Y16___U8V8_N444() const { return 0xFF; } + virtual uint8_t dataFormat_T_Y16___V8U8_N444() const { return 0xFF; } + virtual uint8_t dataFormat_T_Y8___U8___V8_N444() const { return 0xFF; } + virtual uint8_t dataFormat_T_Y10___U10___V10_N444() const { return 0xFF; } + virtual uint8_t dataFormat_T_Y12___U12___V12_N444() const { return 0xFF; } + virtual uint8_t dataFormat_T_Y16___U16___V16_N444() const { return 0xFF; } + virtual uint8_t dataFormat_T_Y16___U8___V8_N444() const { return 0xFF; } + virtual uint8_t dataFormat_FEATURE() const { return FORMAT_FEATURE; } + virtual uint8_t * pixelMapping(NvU8 *b) const { return &ric(b)->pixel_mapping; } + virtual uint8_t pixelMapping_PitchLinear() const { return MAP_PITCH_LINEAR; } + virtual uint8_t * batch(NvU8 *b) const { return &ric(b)->batch; } + virtual uint8_t * weightFormat(NvU8 *b) const { return &ric(b)->weight_format; } + virtual uint8_t weightFormat_Uncompressed() const { return WEIGHT_FORMAT_UNCOMPRESSED; } + virtual uint8_t weightFormat_Compressed() const { return WEIGHT_FORMAT_COMPRESSED; } + virtual uint8_t * dataBank(NvU8 *b) const { return &ric(b)->data_bank; } + virtual uint8_t * weightBank(NvU8 *b) const { return &ric(b)->weight_bank; } + virtual uint32_t * batchStride(NvU8 *b) const { return &ric(b)->batch_stride; } + virtual uint16_t * release(NvU8 *b) const { return &ric(b)->release; } + virtual uint8_t * postExtension(NvU8 *b) const { return &ric(b)->post_extension; } + virtual uint8_t * reserved1_xxx(NvU8 *) const { return 0; } // xxx: not supported for this version + virtual uint8_t * pixelOverride(NvU8 *b) const { return &ric(b)->pixel_override; } + virtual uint8_t pixelOverride_UINT() const { return PIXEL_OVERRIDE_UINT; } + virtual uint8_t pixelOverride_INT() const { return PIXEL_OVERRIDE_INT; } + virtual uint8_t * meanFormat(NvU8 *b) const { return &ric(b)->mean_format; } + virtual uint8_t meanFormat_None() const { return 0xFF; } + virtual uint8_t meanFormat_Global() const { return 0xFF; } + virtual uint8_t meanFormat_PerPixel() const { return 0xFF; } + virtual uint8_t meanFormat_Disable() const { return MEAN_FORMAT_DISABLE; } + virtual uint8_t meanFormat_Enable() const { return MEAN_FORMAT_ENABLE; } + virtual int16_t * meanRY(NvU8 *b) const { return &ric(b)->mean_ry; } + virtual int16_t * meanGU(NvU8 *b) const { return &ric(b)->mean_gu; } + virtual int16_t * meanBV(NvU8 *b) const { return &ric(b)->mean_bv; } + virtual int16_t * meanAX(NvU8 *b) const { return &ric(b)->mean_ax; } + virtual uint8_t * convStrideX(NvU8 *b) const { return &ric(b)->conv_stride_x; } + virtual uint8_t * convStrideY(NvU8 *b) const { return &ric(b)->conv_stride_y; } + virtual uint8_t * padXLeft(NvU8 *b) const { return &ric(b)->pad_x_left; } + virtual uint8_t * padXRight(NvU8 *b) const { return &ric(b)->pad_x_right; } + virtual uint8_t * padYTop(NvU8 *b) const { return &ric(b)->pad_y_top; } + virtual uint8_t * padYBottom(NvU8 *b) const { return &ric(b)->pad_y_bottom; } + virtual uint8_t * dilationX(NvU8 *b) const { return &ric(b)->dilation_x; } + virtual uint8_t * dilationY(NvU8 *b) const { return &ric(b)->dilation_y; } + virtual uint8_t * reserved2(NvU8 *b, size_t i) const { return &ric(b)->reserved2[i]; } + virtual uint8_t * praTruncate(NvU8 *b) const { return &ric(b)->pra_truncate; } + virtual uint16_t * inputWidthCSC(NvU8 *b) const { return &ric(b)->input_width_csc; } + virtual uint16_t * inputHeightCSC(NvU8 *b) const { return &ric(b)->input_height_csc; } + virtual uint16_t * inputChannelCSC(NvU8 *b) const { return &ric(b)->input_channel_csc; } + virtual uint16_t * kernelWidthCSC(NvU8 *b) const { return &ric(b)->kernel_width_csc; } + virtual uint16_t * kernelHeightCSC(NvU8 *b) const { return &ric(b)->kernel_height_csc; } + virtual uint16_t * kernelChannelCSC(NvU8 *b) const { return &ric(b)->kernel_channel_csc; } + virtual uint16_t * inputWidthCMAC(NvU8 *b) const { return &ric(b)->input_width_cmac; } + virtual uint16_t * inputHeightCMAC(NvU8 *b) const { return &ric(b)->input_height_cmac; } + virtual uint32_t * bytesPerKernel(NvU8 *b) const { return &ric(b)->bytes_per_kernel; } + + +protected: + static inline NvU8 *cir(dla_cvt_param *c) { return reinterpret_cast(c); } + static inline dla_conv_op_desc *ric(NvU8 *base) { return reinterpret_cast(base); } +}; +static DLAConvOpDescA g_dla_conv_op_desc; +const DLAConvOpDesc & DLAInterfaceA::convOpDesc() const { return g_dla_conv_op_desc; } + +// +// +// +class DLALUTOffsetA : public DLALUTOffset +{ +public: + virtual ~DLALUTOffsetA() { } + + virtual size_t struct_size() const { return sizeof(dla_lut_offset); } + virtual size_t struct_align() const { return 0; /* unspecified */ } + + virtual uint8_t * expOffset_xxx(NvU8 *) const { return 0; } // XXX: Not supported for this version + virtual int8_t * expOffset(NvU8 *b) const { return &ric(b)->exp_offset; } + virtual uint8_t * fracBits_xxx(NvU8 *) const { return 0; } // XXX: Not supported for this version + virtual int8_t * fracBits(NvU8 *b) const { return &ric(b)->frac_bits; } + virtual uint16_t * reserved0(NvU8 *b) const { return &ric(b)->reserved0; } + +protected: + // static inline NvU8 *cir(dla_lut_offset *c) { return reinterpret_cast(c); } + static inline dla_lut_offset *ric(NvU8 *base) { return reinterpret_cast(base); } +}; +static DLALUTOffsetA g_dla_lut_offset; +const DLALUTOffset & DLAInterfaceA::lutOffset() const { return g_dla_lut_offset; } + +// +// dla_float_data +// +class DLAFloatDataA : public DLAFloatData +{ +public: + virtual ~DLAFloatDataA() { } + + virtual size_t struct_size() const { return sizeof(dla_float_data); } + virtual size_t struct_align() const { return 4; /* see __attribute__ */ } + + virtual int16_t * scale(NvU8 *b) const { return &ric(b)->scale; } + /* + * below, the compiler caught that shifter changes from uint to int in A->B. + * because there were no actual usages the original could be moved/renamed _xxx. + */ + virtual uint8_t * shifter_xxx(NvU8*) const { return 0; } + virtual int8_t * shifter(NvU8 *b) const { return &ric(b)->shifter; } + virtual uint8_t * reserved0(NvU8 *b) const { return &ric(b)->reserved0; } + +protected: + //static inline NvU8 *cir(dla_float_data *c) { return reinterpret_cast(c); } + static inline dla_float_data *ric(NvU8 *base) { return reinterpret_cast(base); } +}; +static DLAFloatDataA g_dla_float_data; +const DLAFloatData & DLAInterfaceA::floatData() const { return g_dla_float_data; } + + +// +// dla_slope +// +class DLASlopeA : public DLASlope +{ +public: + virtual ~DLASlopeA() { } + + virtual size_t struct_size() const { return sizeof(dla_slope); } + virtual size_t struct_align() const { return 0; /* unspecified */ } + + virtual DLAFloatDataAccessor dataIAccessor(NvU8 *b) const { return DLAFloatDataAccessor(fir(&ric(b)->data_i), g_dla_float_data); } + virtual uint16_t * dataF(NvU8 *b) const { return &ric(b)->data_f; } + +protected: + static inline NvU8 *fir(dla_float_data *c) { return reinterpret_cast(c); } + static inline dla_slope *ric(NvU8 *base) { return reinterpret_cast(base); } +}; +static DLASlopeA g_dla_slope; +const DLASlope & DLAInterfaceA::slope() const { return g_dla_slope; } + +// +// dla_lut_param +// +class DLALUTParamA : public DLALUTParam +{ +public: + virtual ~DLALUTParamA() { } + + virtual size_t struct_size() const { return sizeof(dla_lut_param); } + virtual size_t struct_align() const { return 4; /* see __attribute__ */ } + + virtual int16_t * linearExpTable(NvU8 *b, size_t i) const { return &ric(b)->linear_exp_table[i]; } + virtual size_t numLinearExpTable() const { return (1<linear_only_table[i]; } + virtual size_t numLinearOnlyTable() const { return (1<method; } + virtual uint8_t method_Exponential() const { return LUT_METHOD_EXPONENTIAL; } + virtual uint8_t method_Linear() const { return LUT_METHOD_LINEAR; } + virtual DLALUTOffsetAccessor linearExpOffsetAccessor(NvU8 *b) const { return DLALUTOffsetAccessor(lir(&ric(b)->linear_exp_offset), g_dla_lut_offset); } + virtual DLALUTOffsetAccessor linearOnlyOffsetAccessor(NvU8 *b) const { return DLALUTOffsetAccessor(lir(&ric(b)->linear_only_offset), g_dla_lut_offset); } + + + virtual uint64_t * linearExpStart(NvU8 *b) const { return &ric(b)->linear_exp_start; } + virtual uint64_t * linearExpEnd(NvU8 *b) const { return &ric(b)->linear_exp_end; } + virtual uint64_t * linearOnlyStart(NvU8 *b) const { return &ric(b)->linear_only_start; } + virtual uint64_t * linearOnlyEnd(NvU8 *b) const { return &ric(b)->linear_only_end; } + + virtual DLASlopeAccessor linearExpUnderflowSlopeAccessor(NvU8 *b) const { return DLASlopeAccessor(sir(&ric(b)->linear_exp_underflow_slope), g_dla_slope); } + virtual DLASlopeAccessor linearExpOverflowSlopeAccessor(NvU8 *b) const { return DLASlopeAccessor(sir(&ric(b)->linear_exp_overflow_slope), g_dla_slope); } + virtual DLASlopeAccessor linearOnlyUnderflowSlopeAccessor(NvU8 *b) const { return DLASlopeAccessor(sir(&ric(b)->linear_only_underflow_slope), g_dla_slope); } + virtual DLASlopeAccessor linearOnlyOverflowSlopeAccessor(NvU8 *b) const { return DLASlopeAccessor(sir(&ric(b)->linear_only_overflow_slope), g_dla_slope); } + virtual uint8_t * hybridPriority(NvU8 *b) const { return &ric(b)->hybrid_priority; } + virtual uint8_t * underflowPriority(NvU8 *b) const { return &ric(b)->underflow_priority; } + virtual uint8_t * overflowPriority(NvU8 *b) const { return &ric(b)->overflow_priority; } + virtual uint8_t priority_LinearExp() const { return LUT_PRI_LINEAR_EXP; } + virtual uint8_t priority_LinearOnly() const { return LUT_PRI_LINEAR_ONLY; } + virtual int8_t * inputScaleLog2(NvU8*) const { return 0; } // XXX not supported for this version + + +protected: + static inline NvU8 *sir(dla_slope *c) { return reinterpret_cast(c); } + // static inline NvU8 *cir(dla_lut_param *c) { return reinterpret_cast(c); } + static inline NvU8 *lir(dla_lut_offset *c) { return reinterpret_cast(c); } + static inline dla_lut_param *ric(NvU8 *base) { return reinterpret_cast(base); } +}; +static DLALUTParamA g_dla_lut_param; +const DLALUTParam & DLAInterfaceA::lutParam() const { return g_dla_lut_param; } + +// +// dla_sdp_surface_desc +// +class DLASDPSurfaceDescA : public DLASDPSurfaceDesc +{ +public: + virtual ~DLASDPSurfaceDescA() { } + + virtual size_t struct_size() const { return sizeof(dla_sdp_surface_desc); } + virtual size_t struct_align() const { return 4; /* see __attribute__ */ } + + virtual DLADataCubeAccessor srcDataAccessor(NvU8 *b) const { return DLADataCubeAccessor(dir(&ric(b)->src_data), g_dla_data_cube); } + virtual DLADataCubeAccessor x1DataAccessor(NvU8 *b) const { return DLADataCubeAccessor(dir(&ric(b)->x1_data), g_dla_data_cube); } + virtual DLADataCubeAccessor x2DataAccessor(NvU8 *b) const { return DLADataCubeAccessor(dir(&ric(b)->x2_data), g_dla_data_cube); } + virtual DLADataCubeAccessor yDataAccessor(NvU8 *b) const { return DLADataCubeAccessor(dir(&ric(b)->y_data), g_dla_data_cube); } + virtual DLADataCubeAccessor dstDataAccessor(NvU8 *b) const { return DLADataCubeAccessor(dir(&ric(b)->dst_data), g_dla_data_cube); } + + +protected: + static inline NvU8 *dir(dla_data_cube *c) { return reinterpret_cast(c); } + static inline dla_sdp_surface_desc *ric(NvU8 *base) { return reinterpret_cast(base); } +}; +static DLASDPSurfaceDescA g_dla_sdp_surface_desc; +const DLASDPSurfaceDesc & DLAInterfaceA::sdpSurfaceDesc() const { return g_dla_sdp_surface_desc; } + +// +// dla_sdp_cvt +// +class DLASDPCVTA : public DLASDPCVT +{ +public: + virtual ~DLASDPCVTA() { } + + virtual size_t struct_size() const { return sizeof(dla_sdp_cvt); } + virtual size_t struct_align() const { return 4; /* see __attribute__ */ } + + virtual DLACVTParamAccessor aluCVTAccessor(NvU8 *b) const { return DLACVTParamAccessor(cir(&ric(b)->alu_cvt), g_dla_cvt_param); } + virtual DLACVTParamAccessor mulCVTAccessor(NvU8 *b) const { return DLACVTParamAccessor(cir(&ric(b)->mul_cvt), g_dla_cvt_param); } + +protected: + static inline NvU8 *cir(dla_cvt_param *c) {return reinterpret_cast(c); } + static inline dla_sdp_cvt *ric(NvU8 *base) { return reinterpret_cast(base); } +}; +static DLASDPCVTA g_dla_sdp_cvt; +const DLASDPCVT & DLAInterfaceA::sdpCVT() const { return g_dla_sdp_cvt; } + +// +// dla_sdp_op +// +class DLASDPOpA : public DLASDPOp +{ +public: + virtual ~DLASDPOpA() { } + + virtual size_t struct_size() const { return sizeof(dla_sdp_op); } + virtual size_t struct_align() const { return 4; /* see __attribute__ */ } + + + //virtual int16_t * index(NvU8 *b) const { return &ric(b)->index; } + // virtual size_t numOpHeads() const { return DLA_OP_NUM; } + // virtual AnotherAccessor anotherAccessor(NvU8 *b, size_t c) const { return AnotherAccessor(cir(&ric(b)->another[c]), g_another); } + + virtual uint8_t * enable(NvU8 *b) const { return &ric(b)->enable; } + virtual uint8_t * ALUType(NvU8 *b) const { return &ric(b)->alu_type; } + virtual uint8_t ALUType_Max() const { return SDP_ALU_OP_MAX; } + virtual uint8_t ALUType_Min() const { return SDP_ALU_OP_MIN; } + virtual uint8_t ALUType_Sum() const { return SDP_ALU_OP_SUM; } + virtual uint8_t ALUType_Eql() const { return SDP_ALU_OP_EQL; } + virtual uint8_t * type(NvU8 *b) const { return &ric(b)->type; } + virtual uint8_t type_None() const { return SDP_OP_NONE; } + virtual uint8_t type_Mul() const { return SDP_OP_MUL; } + virtual uint8_t type_Add() const { return SDP_OP_ADD; } + virtual uint8_t type_Both() const { return SDP_OP_BOTH; } + virtual uint8_t * mode(NvU8 *b) const { return &ric(b)->mode; } + virtual uint8_t mode_PerLayer() const { return SDP_OP_PER_LAYER; } + virtual uint8_t mode_PerKernel() const { return SDP_OP_PER_KERNEL; } + virtual uint8_t mode_PerPoint() const { return SDP_OP_PER_POINT; } + virtual uint8_t * act(NvU8 *b) const { return &ric(b)->act; } + virtual uint8_t act_None() const { return ACTIVATION_NONE; } + virtual uint8_t act_RelU() const { return ACTIVATION_RELU; } + virtual uint8_t act_LUT() const { return ACTIVATION_LUT; } + virtual uint8_t * shiftValue(NvU8 *b) const { return &ric(b)->shift_value; } + virtual int16_t * ALUOperand_xxx(NvU8 *) const { return 0; } // xxx: not supported for this version + virtual int16_t * MulOperand_xxx(NvU8 *) const { return 0; } // xxx: not supported for this version + virtual int32_t * ALUOperand(NvU8 *b) const { return &ric(b)->alu_operand; } + virtual int32_t * MulOperand(NvU8 *b) const { return &ric(b)->mul_operand; } + virtual uint8_t * truncate(NvU8 *b) const { return &ric(b)->truncate; } + virtual uint8_t * precision(NvU8 *b) const { return &ric(b)->precision; } + virtual DLASDPCVTAccessor cvt(NvU8 *b) const { return DLASDPCVTAccessor(vir(&ric(b)->cvt), g_dla_sdp_cvt); } + + +protected: + static inline NvU8 *vir(dla_sdp_cvt *v) { return reinterpret_cast(v); } + static inline NvU8 *cir(dla_sdp_op *c) { return reinterpret_cast(c); } + static inline dla_sdp_op *ric(NvU8 *base) { return reinterpret_cast(base); } +}; +static DLASDPOpA g_dla_sdp_op; +const DLASDPOp & DLAInterfaceA::sdpOp() const { return g_dla_sdp_op; } + + +// +// dla_sdp_op_desc +// +class DLASDPOpDescA : public DLASDPOpDesc +{ +public: + virtual ~DLASDPOpDescA() { } + + virtual size_t struct_size() const { return sizeof(dla_sdp_op_desc); } + virtual size_t struct_align() const { return 4; /* see __attribute__ */ } + + virtual uint8_t * srcPrecision(NvU8 *b) const { return &ric(b)->src_precision; } + virtual uint8_t srcPrecision_Int8() const { return PRECISION_INT8; } + virtual uint8_t srcPrecision_Int16() const { return PRECISION_INT16; } + virtual uint8_t srcPrecision_FP16() const { return PRECISION_FP16; } + virtual uint8_t * dstPrecision(NvU8 *b) const { return &ric(b)->dst_precision; } + virtual uint8_t dstPrecision_Int8() const { return PRECISION_INT8; } + virtual uint8_t dstPrecision_Int16() const { return PRECISION_INT16; } + virtual uint8_t dstPrecision_FP16() const { return PRECISION_FP16; } + virtual int16_t * LUTIndex(NvU8 *b) const { return &ric(b)->lut_index; } + virtual DLACVTParamAccessor outCVTAccessor(NvU8 *b) const { return DLACVTParamAccessor(cir(&ric(b)->out_cvt), g_dla_cvt_param); } + virtual uint8_t * convMode(NvU8 *b) const { return &ric(b)->conv_mode; } + virtual uint8_t convMode_Direct() const { return CONV_MODE_DIRECT; } + virtual uint8_t convMode_Winograd() const { return CONV_MODE_WINOGRAD; } + virtual uint8_t * batchNum(NvU8 *b) const { return &ric(b)->batch_num; } + virtual uint16_t * reserved0(NvU8 *b) const { return &ric(b)->reserved0; } + virtual uint32_t * batchStride(NvU8 *b) const { return &ric(b)->batch_stride; } + virtual DLASDPOpAccessor x1OpAccessor(NvU8 *b) const { return DLASDPOpAccessor(sir(&ric(b)->x1_op), g_dla_sdp_op); } + virtual DLASDPOpAccessor x2OpAccessor(NvU8 *b) const { return DLASDPOpAccessor(sir(&ric(b)->x2_op), g_dla_sdp_op); } + virtual DLASDPOpAccessor yOpAccessor(NvU8 *b) const { return DLASDPOpAccessor(sir(&ric(b)->y_op), g_dla_sdp_op); } + +protected: + static inline NvU8 *cir(dla_cvt_param *c) { return reinterpret_cast(c); } + static inline NvU8 *sir(dla_sdp_op *c) { return reinterpret_cast(c); } + static inline dla_sdp_op_desc *ric(NvU8 *base) { return reinterpret_cast(base); } +}; +static DLASDPOpDescA g_dla_sdp_op_desc; +const DLASDPOpDesc & DLAInterfaceA::sdpOpDesc() const { return g_dla_sdp_op_desc; } + +// +// dla_pdp_surface_desc +// +class DLAPDPSurfaceDescA : public DLAPDPSurfaceDesc +{ +public: + virtual ~DLAPDPSurfaceDescA() { } + + virtual size_t struct_size() const { return sizeof(dla_pdp_surface_desc); } + virtual size_t struct_align() const { return 4; /* see __attribute__ */ } + + virtual DLADataCubeAccessor srcDataAccessor(NvU8 *b) const { return DLADataCubeAccessor(dir(&ric(b)->src_data), g_dla_data_cube); } + virtual DLADataCubeAccessor dstDataAccessor(NvU8 *b) const { return DLADataCubeAccessor(dir(&ric(b)->dst_data), g_dla_data_cube); } + +protected: + static inline NvU8 *dir(dla_data_cube *c) { return reinterpret_cast(c); } + static inline dla_pdp_surface_desc *ric(NvU8 *base) { return reinterpret_cast(base); } +}; +static DLAPDPSurfaceDescA g_dla_pdp_surface_desc; +const DLAPDPSurfaceDesc & DLAInterfaceA::pdpSurfaceDesc() const { return g_dla_pdp_surface_desc; } + +// +// dla_pdp_op_desc +// +class DLAPDPOpDescA : public DLAPDPOpDesc +{ +public: + virtual ~DLAPDPOpDescA() { } + + virtual size_t struct_size() const { return sizeof(dla_pdp_op_desc); } + virtual size_t struct_align() const { return 4; /* see __attribute__ */ } + + virtual uint8_t *precision(NvU8 *b) const { return &ric(b)->precision; } + virtual uint8_t precision_Int8() const { return PRECISION_INT8; } + virtual uint8_t precision_Int16() const { return PRECISION_INT16; } + virtual uint8_t precision_FP16() const { return PRECISION_FP16; } + virtual uint8_t *reserved0_xxx(NvU8 *, size_t) const { return 0; } // XXX: not supported for this version + virtual uint8_t *reserved0(NvU8 *b) const { return &ric(b)->reserved0; } + virtual int16_t *paddingValue_xxx(NvU8*, size_t) const { return 0; } // XXX: not supported for this version + virtual int32_t *paddingValue(NvU8 *b, size_t i) const { return &ric(b)->padding_value[i]; } + virtual uint8_t *splitNum(NvU8 *b) const { return &ric(b)->split_num; } + virtual uint8_t *reserved1_xxx(NvU8 *, size_t) const { return 0; } // XXX: not supported for this version + virtual uint16_t *partialInWidthFirst(NvU8 *b) const { return &ric(b)->partial_in_width_first; } + virtual uint16_t *partialInWidthMid(NvU8 *b) const { return &ric(b)->partial_in_width_mid; } + virtual uint16_t *partialInWidthLast(NvU8 *b) const { return &ric(b)->partial_in_width_last; } + + virtual uint16_t *partialWidthFirst(NvU8 *b) const { return &ric(b)->partial_width_first; } + virtual uint16_t *partialWidthMid(NvU8 *b) const { return &ric(b)->partial_width_mid; } + virtual uint16_t *partialWidthLast(NvU8 *b) const { return &ric(b)->partial_width_last; } + + virtual uint8_t *poolMode(NvU8 *b) const { return &ric(b)->pool_mode; } + virtual uint8_t poolMode_AVG() const { return POOL_MODE_AVG; } + virtual uint8_t poolMode_MAX() const { return POOL_MODE_MAX; } + virtual uint8_t poolMode_MIN() const { return POOL_MODE_MIN; } + virtual uint8_t *poolWidth(NvU8 *b) const { return &ric(b)->pool_width; } + virtual uint8_t *poolHeight(NvU8 *b) const { return &ric(b)->pool_height; } + virtual uint8_t *reserved2_xxx(NvU8 *) const { return 0; } // XXX: not supported for this version + + virtual uint8_t *strideX(NvU8 *b) const { return &ric(b)->stride_x; } + virtual uint8_t *strideY(NvU8 *b) const { return &ric(b)->stride_y; } + virtual uint16_t *strideX_xxx(NvU8*) const { return 0; } // XXX not supported for this version + virtual uint16_t *strideY_xxx(NvU8*) const { return 0; } // XXX not supported for this version + virtual uint16_t *reserved3_xxx(NvU8 *) const { return 0; } // XXX: not supported for this version + + virtual uint8_t *padLeft(NvU8 *b) const { return &ric(b)->pad_left; } + virtual uint8_t *padRight(NvU8 *b) const { return &ric(b)->pad_right; } + virtual uint8_t *padTop(NvU8 *b) const { return &ric(b)->pad_top; } + virtual uint8_t *padBottom(NvU8 *b) const { return &ric(b)->pad_bottom; } + +protected: + static inline NvU8 *cir(dla_pdp_op_desc *c) { return reinterpret_cast(c); } + static inline dla_pdp_op_desc *ric(NvU8 *base) { return reinterpret_cast(base); } +}; +static DLAPDPOpDescA g_dla_pdp_op_desc; +const DLAPDPOpDesc & DLAInterfaceA::pdpOpDesc() const { return g_dla_pdp_op_desc; } + + +// +// dla_cdp_surface_desc +// +class DLACDPSurfaceDescA : public DLACDPSurfaceDesc +{ +public: + virtual ~DLACDPSurfaceDescA() { } + + virtual size_t struct_size() const { return sizeof(dla_cdp_surface_desc); } + virtual size_t struct_align() const { return 4; /* see __attribute__ */ } + + virtual DLADataCubeAccessor srcDataAccessor(NvU8 *b) const { return DLADataCubeAccessor(dir(&ric(b)->src_data), g_dla_data_cube); } + virtual DLADataCubeAccessor dstDataAccessor(NvU8 *b) const { return DLADataCubeAccessor(dir(&ric(b)->dst_data), g_dla_data_cube); } + +protected: + static inline NvU8 *dir(dla_data_cube *c) { return reinterpret_cast(c); } + static inline dla_cdp_surface_desc *ric(NvU8 *base) { return reinterpret_cast(base); } +}; +static DLACDPSurfaceDescA g_dla_cdp_surface_desc; +const DLACDPSurfaceDesc & DLAInterfaceA::cdpSurfaceDesc() const { return g_dla_cdp_surface_desc; } + +// +// dla_cdp_op_desc +// +class DLACDPOpDescA : public DLACDPOpDesc +{ +public: + virtual ~DLACDPOpDescA() { } + + virtual size_t struct_size() const { return sizeof(dla_cdp_op_desc); } + virtual size_t struct_align() const { return 4; /* see __attribute__ */ } + + virtual uint8_t *inPrecision(NvU8 *b) const { return &ric(b)->in_precision; } + virtual uint8_t inPrecision_Int8() const { return PRECISION_INT8; } + virtual uint8_t inPrecision_Int16() const { return PRECISION_INT16; } + virtual uint8_t inPrecision_FP16() const { return PRECISION_FP16; } + virtual uint8_t *outPrecision(NvU8 *b) const { return &ric(b)->out_precision; } + virtual uint8_t outPrecision_Int8() const { return PRECISION_INT8; } + virtual uint8_t outPrecision_Int16() const { return PRECISION_INT16; } + virtual uint8_t outPrecision_FP16() const { return PRECISION_FP16; } + virtual DLACVTParamAccessor inCVTAccessor(NvU8 *b) const { return DLACVTParamAccessor(cir(&ric(b)->in_cvt), g_dla_cvt_param); } + virtual DLACVTParamAccessor outCVTAccessor(NvU8 *b) const { return DLACVTParamAccessor(cir(&ric(b)->out_cvt), g_dla_cvt_param); } + virtual int16_t *LUTIndex(NvU8 *b) const { return &ric(b)->lut_index; } + virtual uint8_t *localSize(NvU8 *b) const { return &ric(b)->local_size; } + virtual uint8_t *bypassSquareSum(NvU8 *b) const { return &ric(b)->bypass_sqsum; } + virtual uint8_t *bypassOutMul(NvU8 *b) const { return &ric(b)->bypass_out_mul; } + virtual uint8_t *reserved0(NvU8 *b) const { return &ric(b)->reserved0; } + + +protected: + static inline NvU8 *cir(dla_cvt_param *c) { return reinterpret_cast(c); } + static inline dla_cdp_op_desc *ric(NvU8 *base) { return reinterpret_cast(base); } +}; +static DLACDPOpDescA g_dla_cdp_op_desc; +const DLACDPOpDesc & DLAInterfaceA::cdpOpDesc() const { return g_dla_cdp_op_desc; } + +// --- CDP --- + + +// Rubik +// +// dla_rubik_surface_desc +// +class DLARubikSurfaceDescA : public DLARubikSurfaceDesc +{ +public: + virtual ~DLARubikSurfaceDescA() { } + + virtual size_t struct_size() const { return sizeof(dla_rubik_surface_desc); } + virtual size_t struct_align() const { return 4; /* see __attribute__ */ } + + virtual DLADataCubeAccessor srcDataAccessor(NvU8 *b) const { return DLADataCubeAccessor(dir(&ric(b)->src_data), g_dla_data_cube); } + virtual DLADataCubeAccessor dstDataAccessor(NvU8 *b) const { return DLADataCubeAccessor(dir(&ric(b)->dst_data), g_dla_data_cube); } + +protected: + static inline NvU8 *dir(dla_data_cube *c) { return reinterpret_cast(c); } + static inline dla_rubik_surface_desc *ric(NvU8 *base) { return reinterpret_cast(base); } +}; +static DLARubikSurfaceDescA g_dla_rubik_surface_desc; +const DLARubikSurfaceDesc & DLAInterfaceA::rubikSurfaceDesc() const { return g_dla_rubik_surface_desc; } + +// +// dla_rubik_op_desc +// +class DLARubikOpDescA : public DLARubikOpDesc +{ +public: + virtual ~DLARubikOpDescA() { } + + virtual size_t struct_size() const { return sizeof(dla_rubik_op_desc); } + virtual size_t struct_align() const { return 4; /* see __attribute__ */ } + + virtual uint8_t *mode(NvU8 *b) const { return &ric(b)->mode; } + virtual uint8_t mode_Contract() const { return RUBIK_MODE_CONTRACT; } + virtual uint8_t mode_Split() const { return RUBIK_MODE_SPLIT; } + virtual uint8_t mode_Merge() const { return RUBIK_MODE_MERGE; } + + + virtual uint8_t *precision(NvU8 *b) const { return &ric(b)->precision; } + virtual uint8_t precision_Int8() const { return PRECISION_INT8; } + virtual uint8_t precision_Int16() const { return PRECISION_INT16; } + virtual uint8_t precision_FP16() const { return PRECISION_FP16; } + + virtual uint8_t *strideX(NvU8 *b) const { return &ric(b)->stride_x; } + virtual uint8_t *strideY(NvU8 *b) const { return &ric(b)->stride_y; } + +protected: + // static inline NvU8 *cir(dla_rubik_op_desc *c) { return reinterpret_cast(c); } + static inline dla_rubik_op_desc *ric(NvU8 *base) { return reinterpret_cast(base); } +}; +static DLARubikOpDescA g_dla_rubik_op_desc; +const DLARubikOpDesc & DLAInterfaceA::rubikOpDesc() const { return g_dla_rubik_op_desc; } + +// ---RUBIK--- + +// +// dla_surface_container +// +class DLASurfaceContainerA : public DLASurfaceContainer +{ +public: + virtual ~DLASurfaceContainerA() { } + + virtual size_t struct_size() const { return sizeof(dla_surface_container); } + virtual size_t struct_align() const { return 0; /* unspecified */ } + + virtual DLABDMASurfaceDescAccessor bdmaSurfaceDescAccessor(NvU8 *b, size_t c) const + { + return DLABDMASurfaceDescAccessor(bir( &(ric(b)[c]).bdma_surface), g_dla_bdma_surface_desc); + } + virtual DLAConvSurfaceDescAccessor convSurfaceDescAccessor(NvU8 *b, size_t c) const + { + return DLAConvSurfaceDescAccessor(cir( &(ric(b)[c]).conv_surface), g_dla_conv_surface_desc); + } + virtual DLASDPSurfaceDescAccessor sdpSurfaceDescAccessor (NvU8 *b, size_t c) const + { + return DLASDPSurfaceDescAccessor(sir( &(ric(b)[c]).sdp_surface), g_dla_sdp_surface_desc); + } + virtual DLAPDPSurfaceDescAccessor pdpSurfaceDescAccessor (NvU8 *b, size_t c) const + { + return DLAPDPSurfaceDescAccessor(pir( &(ric(b)[c]).pdp_surface), g_dla_pdp_surface_desc); + } + virtual DLACDPSurfaceDescAccessor cdpSurfaceDescAccessor (NvU8 *b, size_t c) const + { + return DLACDPSurfaceDescAccessor(cdir( &(ric(b)[c]).cdp_surface), g_dla_cdp_surface_desc); + } + virtual DLARubikSurfaceDescAccessor rubikSurfaceDescAccessor (NvU8 *b, size_t c) const + { + return DLARubikSurfaceDescAccessor(rir( &(ric(b)[c]).rubik_surface), g_dla_rubik_surface_desc); + } + + +protected: + static inline NvU8 *bir(dla_bdma_surface_desc *c) { return reinterpret_cast(c); } + static inline NvU8 *cir(dla_conv_surface_desc *c) { return reinterpret_cast(c); } + static inline NvU8 *sir(dla_sdp_surface_desc *c) { return reinterpret_cast(c); } + static inline NvU8 *pir(dla_pdp_surface_desc *c) { return reinterpret_cast(c); } + static inline NvU8 *cdir(dla_cdp_surface_desc *c) { return reinterpret_cast(c); } + static inline NvU8 *rir(dla_rubik_surface_desc *c) { return reinterpret_cast(c); } + static inline dla_surface_container *ric(NvU8 *base) { return reinterpret_cast(base); } +}; +static DLASurfaceContainerA g_dla_surface_container; +const DLASurfaceContainer & DLAInterfaceA::surfaceContainer() const { return g_dla_surface_container; } + + +// +// dla_operation_container +// +class DLAOperationContainerA : public DLAOperationContainer +{ +public: + virtual ~DLAOperationContainerA() { } + + virtual size_t struct_size() const { return sizeof(dla_operation_container); } + virtual size_t struct_align() const { return 0; /* unspecified */ } + + virtual DLABDMAOpDescAccessor bdmaOpDescAccessor(NvU8 *b, size_t c) const { return DLABDMAOpDescAccessor(bir(&(ric(b)[c].bdma_op)), g_dla_bdma_op_desc); } + virtual DLAConvOpDescAccessor convOpDescAccessor(NvU8 *b, size_t c) const { return DLAConvOpDescAccessor(cir(&(ric(b)[c].conv_op)), g_dla_conv_op_desc); } + virtual DLASDPOpDescAccessor sdpOpDescAccessor(NvU8 *b, size_t c) const { return DLASDPOpDescAccessor(sir(&(ric(b)[c].sdp_op)), g_dla_sdp_op_desc); } + virtual DLAPDPOpDescAccessor pdpOpDescAccessor(NvU8 *b, size_t c) const { return DLAPDPOpDescAccessor(pir(&(ric(b)[c].pdp_op)), g_dla_pdp_op_desc); } + virtual DLACDPOpDescAccessor cdpOpDescAccessor(NvU8 *b, size_t c) const { return DLACDPOpDescAccessor(cdir(&(ric(b)[c].cdp_op)), g_dla_cdp_op_desc); } + virtual DLARubikOpDescAccessor rubikOpDescAccessor(NvU8 *b, size_t c) const { return DLARubikOpDescAccessor(rir(&(ric(b)[c].rubik_op)), g_dla_rubik_op_desc); } + +protected: + static inline NvU8 *bir(dla_bdma_op_desc *c) { return reinterpret_cast(c); } + static inline NvU8 *cir(dla_conv_op_desc *c) { return reinterpret_cast(c); } + static inline NvU8 *sir(dla_sdp_op_desc *c) { return reinterpret_cast(c); } + static inline NvU8 *pir(dla_pdp_op_desc *c) { return reinterpret_cast(c); } + static inline NvU8 *cdir(dla_cdp_op_desc *c) { return reinterpret_cast(c); } + static inline NvU8 *rir(dla_rubik_op_desc *c) { return reinterpret_cast(c); } + static inline dla_operation_container *ric(NvU8 *base) { return reinterpret_cast(base); } +}; +static DLAOperationContainerA g_dla_operation_container; +const DLAOperationContainer & DLAInterfaceA::operationContainer() const { return g_dla_operation_container; } + + +// +// interface +// + +NvU8 DLAInterfaceA::firmwareTargetVersionMajor() const { return FIRMWARE_VERSION_MAJOR; } +NvU8 DLAInterfaceA::firmwareTargetVersionMinor() const { return FIRMWARE_VERSION_MINOR; } +NvU8 DLAInterfaceA::firmwareTargetVersionSubminor() const { return FIRMWARE_VERSION_SUBMINOR; } + +NvU32 DLAInterfaceA::firmwareTargetVersion() const { return dla_version(); } + +NvU8 DLAInterfaceA::firmwareVersionMajor() const +{ + return FIRMWARE_VERSION_MAJOR; // TBD find kmd query? +} + +NvU8 DLAInterfaceA::firmwareVersionMinor() const +{ + return FIRMWARE_VERSION_MINOR; // TBD find kmd query? +} + +NvU8 DLAInterfaceA::firmwareVersionSubminor() const +{ + return FIRMWARE_VERSION_SUBMINOR; // TBD find kmd query? +} + +NvU32 DLAInterfaceA::firmwareVersion() const +{ + return dla_version(); // TBD find kmd query? +} + + + + + + +} // nvdla::priv +} // nvdla diff --git a/umd/core/src/compiler/DLAResourceManager.cpp b/umd/core/src/compiler/DLAResourceManager.cpp new file mode 100644 index 00000000..a19d603e --- /dev/null +++ b/umd/core/src/compiler/DLAResourceManager.cpp @@ -0,0 +1,157 @@ +/* + * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#include "nvdla/IType.h" +#include "priv/DLAResourceManager.h" +#include "priv/Memory.h" + +using std::set; +using std::endl; + +namespace nvdla +{ + +namespace priv +{ + +SEQUENCE_ENUM_STATIC_MEMBERS(memory::PoolTypeEnum, NvU8, POOL_TYPE_ENUMS, "PoolTypeEnum") + +namespace memory +{ + +// +// DLAResourceManager copy constructor for clone +// +DLAResourceManager::DLAResourceManager(const DLAResourceManager &o) : + m_name(o.m_name), + m_next_buffer_id(o.m_next_buffer_id), + m_next_surface_desc_id(o.m_next_surface_desc_id), + m_buffer_desc_directory(o.m_buffer_desc_directory), + m_surface_desc_directory(o.m_surface_desc_directory) +{ + //FIXME: add logic to suitably clone +} + +DLAResourceManager::~DLAResourceManager() +{ + + +} + +surface::TensorSurfaceDesc* DLAResourceManager::regTensorSurfaceDesc +( + TensorType type, + NvU16 numBatches +) +{ + surface::TensorSurfaceDesc* sd = new surface::TensorSurfaceDesc(numBatches); + TensorCategory tc; + switch(type){ + case TensorType::kDEBUG: + case TensorType::kNW_INPUT: + case TensorType::kNW_OUTPUT: tc = TensorCategoryEnum::EXTERNAL_TENSOR; break; + case TensorType::kWEIGHT: + case TensorType::kBIAS: + case TensorType::kBATCH_NORM: + case TensorType::kSCALE: tc = TensorCategoryEnum::GLOBAL_TENSOR; break; + case TensorType::kIO: tc = TensorCategoryEnum::LOCAL_TENSOR; break; + case TensorType::kSTREAM: tc = TensorCategoryEnum::STREAM_TENSOR; break; + default: + { + REPORT_ERROR(NvDlaError_BadParameter, "Unable to categorize tensor type: %d", type); + return NULL; // something wrong + } + } + + std::string sdID = nextSurfaceDescId(); + sd->setId(sdID); + sd->setTensorCategory(tc); + m_surface_desc_directory.insert(sd); + + return sd; +} + +bool DLAResourceManager::unregTensorSurfaceDesc(surface::TensorSurfaceDesc *tsd) +{ + if (tsd) + m_surface_desc_directory.erase(tsd); + return true; +} + +std::vector< TensorBufferDesc *> DLAResourceManager::getBufferDescs() +{ + std::vector< TensorBufferDesc *> allBDs; + + allBDs.reserve(m_buffer_desc_directory.size()); + + for (TensorBufferDirectoryIter it = m_buffer_desc_directory.begin(); + it != m_buffer_desc_directory.end(); ++it) + { + allBDs.push_back(*it); + } + + return allBDs; +} + +std::vector< surface::TensorSurfaceDesc *> DLAResourceManager::getSurfaceDescs() +{ + std::vector< surface::TensorSurfaceDesc *> allSDs; + + allSDs.reserve(m_surface_desc_directory.size()); + + for (TensorSurfaceDirectoryIter it = m_surface_desc_directory.begin(); + it != m_surface_desc_directory.end(); ++it) + { + allSDs.push_back(*it); + } + + return allSDs; +} + + +TensorBufferDesc* DLAResourceManager::regTensorBufferDesc(NvU16 numBatches) +{ + TensorBufferDesc* tbd = new TensorBufferDesc(numBatches); + + std::string bID = nextBufferId(); + tbd->setId(bID); + m_buffer_desc_directory.insert(tbd); + + return tbd; +} + +bool DLAResourceManager::unregTensorBufferDesc(TensorBufferDesc *tbd) +{ + if (tbd) + m_buffer_desc_directory.erase(tbd); + return true; +} + +} // nvdla::priv::memory +} // nvdla::priv +} // nvdla diff --git a/umd/core/src/compiler/DlaPrototestInterface.pb.cpp b/umd/core/src/compiler/DlaPrototestInterface.pb.cpp new file mode 100644 index 00000000..eb340eb8 --- /dev/null +++ b/umd/core/src/compiler/DlaPrototestInterface.pb.cpp @@ -0,0 +1,23073 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: DlaPrototestInterface.proto + +#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION +#include "priv/DlaPrototestInterface.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// @@protoc_insertion_point(includes) + +namespace nvdla_prototest_interface { + +namespace { + +const ::google::protobuf::Descriptor* LUTOffset_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + LUTOffset_reflection_ = NULL; +struct LUTOffsetOneofInstance { + ::google::protobuf::int32 exp_offset_; + ::google::protobuf::int32 frac_bits_; +}* LUTOffset_default_oneof_instance_ = NULL; +const ::google::protobuf::Descriptor* FloatData_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + FloatData_reflection_ = NULL; +const ::google::protobuf::Descriptor* DLASlope_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + DLASlope_reflection_ = NULL; +struct DLASlopeOneofInstance { + const ::nvdla_prototest_interface::FloatData* data_i_; + ::google::protobuf::uint32 data_f_; +}* DLASlope_default_oneof_instance_ = NULL; +const ::google::protobuf::Descriptor* DataFile_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + DataFile_reflection_ = NULL; +const ::google::protobuf::Descriptor* Constant_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + Constant_reflection_ = NULL; +const ::google::protobuf::Descriptor* DataFiller_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + DataFiller_reflection_ = NULL; +struct DataFillerOneofInstance { + const ::nvdla_prototest_interface::DataFile* data_file_; + const ::nvdla_prototest_interface::Constant* const__; +}* DataFiller_default_oneof_instance_ = NULL; +const ::google::protobuf::Descriptor* LUTParam_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + LUTParam_reflection_ = NULL; +const ::google::protobuf::Descriptor* BDMATransferDesc_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + BDMATransferDesc_reflection_ = NULL; +const ::google::protobuf::Descriptor* BDMASurfaceDesc_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + BDMASurfaceDesc_reflection_ = NULL; +const ::google::protobuf::Descriptor* BDMAOpDesc_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + BDMAOpDesc_reflection_ = NULL; +const ::google::protobuf::Descriptor* CVTParam_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + CVTParam_reflection_ = NULL; +const ::google::protobuf::Descriptor* MemInfo_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + MemInfo_reflection_ = NULL; +const ::google::protobuf::Descriptor* DataCube_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + DataCube_reflection_ = NULL; +const ::google::protobuf::Descriptor* CONVSurfaceDesc_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + CONVSurfaceDesc_reflection_ = NULL; +const ::google::protobuf::Descriptor* CONVOpDesc_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + CONVOpDesc_reflection_ = NULL; +const ::google::protobuf::Descriptor* SDPCvt_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + SDPCvt_reflection_ = NULL; +const ::google::protobuf::Descriptor* SDPOp_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + SDPOp_reflection_ = NULL; +const ::google::protobuf::EnumDescriptor* SDPOp_SDPOpMode_descriptor_ = NULL; +const ::google::protobuf::Descriptor* SDPSurfaceDesc_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + SDPSurfaceDesc_reflection_ = NULL; +const ::google::protobuf::Descriptor* SDPOpDesc_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + SDPOpDesc_reflection_ = NULL; +const ::google::protobuf::Descriptor* PDPSurfaceDesc_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + PDPSurfaceDesc_reflection_ = NULL; +const ::google::protobuf::Descriptor* PDPOpDesc_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + PDPOpDesc_reflection_ = NULL; +const ::google::protobuf::EnumDescriptor* PDPOpDesc_PoolingMode_descriptor_ = NULL; +const ::google::protobuf::Descriptor* CDPSurfaceDesc_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + CDPSurfaceDesc_reflection_ = NULL; +const ::google::protobuf::Descriptor* CDPOpDesc_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + CDPOpDesc_reflection_ = NULL; +const ::google::protobuf::Descriptor* RUBIKSurfaceDesc_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + RUBIKSurfaceDesc_reflection_ = NULL; +const ::google::protobuf::Descriptor* RUBIKOpDesc_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + RUBIKOpDesc_reflection_ = NULL; +const ::google::protobuf::Descriptor* SurfaceContainer_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + SurfaceContainer_reflection_ = NULL; +struct SurfaceContainerOneofInstance { + const ::nvdla_prototest_interface::BDMASurfaceDesc* bdma_surface_; + const ::nvdla_prototest_interface::CONVSurfaceDesc* conv_surface_; + const ::nvdla_prototest_interface::SDPSurfaceDesc* sdp_surface_; + const ::nvdla_prototest_interface::PDPSurfaceDesc* pdp_surface_; + const ::nvdla_prototest_interface::CDPSurfaceDesc* cdp_surface_; + const ::nvdla_prototest_interface::RUBIKSurfaceDesc* rubik_surface_; +}* SurfaceContainer_default_oneof_instance_ = NULL; +const ::google::protobuf::Descriptor* OperationContainer_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + OperationContainer_reflection_ = NULL; +struct OperationContainerOneofInstance { + const ::nvdla_prototest_interface::BDMAOpDesc* bdma_op_; + const ::nvdla_prototest_interface::CONVOpDesc* conv_op_; + const ::nvdla_prototest_interface::SDPOpDesc* sdp_op_; + const ::nvdla_prototest_interface::PDPOpDesc* pdp_op_; + const ::nvdla_prototest_interface::CDPOpDesc* cdp_op_; + const ::nvdla_prototest_interface::RUBIKOpDesc* rubik_op_; +}* OperationContainer_default_oneof_instance_ = NULL; +const ::google::protobuf::Descriptor* Consumer_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + Consumer_reflection_ = NULL; +const ::google::protobuf::EnumDescriptor* Consumer_EventType_descriptor_ = NULL; +const ::google::protobuf::Descriptor* Layer_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + Layer_reflection_ = NULL; +const ::google::protobuf::Descriptor* NetworkLayer_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + NetworkLayer_reflection_ = NULL; +const ::google::protobuf::Descriptor* NetworkDesc_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + NetworkDesc_reflection_ = NULL; +const ::google::protobuf::Descriptor* LUTParamList_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + LUTParamList_reflection_ = NULL; +const ::google::protobuf::Descriptor* ROIArrayDesc_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + ROIArrayDesc_reflection_ = NULL; +const ::google::protobuf::Descriptor* ROIDesc_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + ROIDesc_reflection_ = NULL; +const ::google::protobuf::Descriptor* ROIDescription_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + ROIDescription_reflection_ = NULL; +const ::google::protobuf::Descriptor* Network_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + Network_reflection_ = NULL; +const ::google::protobuf::Descriptor* TaskStatus_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + TaskStatus_reflection_ = NULL; +const ::google::protobuf::Descriptor* Action_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + Action_reflection_ = NULL; +const ::google::protobuf::Descriptor* TaskSchedule_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + TaskSchedule_reflection_ = NULL; +const ::google::protobuf::Descriptor* TasksData_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + TasksData_reflection_ = NULL; +const ::google::protobuf::Descriptor* Event_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + Event_reflection_ = NULL; +const ::google::protobuf::EnumDescriptor* Event_EventType_descriptor_ = NULL; +const ::google::protobuf::Descriptor* EventList_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + EventList_reflection_ = NULL; +const ::google::protobuf::Descriptor* SubmitSlot_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + SubmitSlot_reflection_ = NULL; +const ::google::protobuf::Descriptor* TestInfo_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + TestInfo_reflection_ = NULL; +const ::google::protobuf::Descriptor* Test_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + Test_reflection_ = NULL; +const ::google::protobuf::EnumDescriptor* DataPrecision_descriptor_ = NULL; +const ::google::protobuf::EnumDescriptor* MemType_descriptor_ = NULL; +const ::google::protobuf::EnumDescriptor* MemFlag_descriptor_ = NULL; +const ::google::protobuf::EnumDescriptor* EngineID_descriptor_ = NULL; +const ::google::protobuf::EnumDescriptor* LayerType_descriptor_ = NULL; +const ::google::protobuf::EnumDescriptor* ALUType_descriptor_ = NULL; +const ::google::protobuf::EnumDescriptor* SDPOpType_descriptor_ = NULL; +const ::google::protobuf::EnumDescriptor* LUTLOGSize_descriptor_ = NULL; +const ::google::protobuf::EnumDescriptor* LUTTable_descriptor_ = NULL; +const ::google::protobuf::EnumDescriptor* LUTMethod_descriptor_ = NULL; +const ::google::protobuf::EnumDescriptor* LUTPriority_descriptor_ = NULL; +const ::google::protobuf::EnumDescriptor* ConvMode_descriptor_ = NULL; +const ::google::protobuf::EnumDescriptor* ConvPixelMAP_descriptor_ = NULL; +const ::google::protobuf::EnumDescriptor* PixelOverride_descriptor_ = NULL; +const ::google::protobuf::EnumDescriptor* PoolSize_descriptor_ = NULL; +const ::google::protobuf::EnumDescriptor* RUBIKMode_descriptor_ = NULL; +const ::google::protobuf::EnumDescriptor* WeightFormat_descriptor_ = NULL; +const ::google::protobuf::EnumDescriptor* MeanFormat_descriptor_ = NULL; +const ::google::protobuf::EnumDescriptor* SDPActivation_descriptor_ = NULL; +const ::google::protobuf::EnumDescriptor* DataFormat_descriptor_ = NULL; +const ::google::protobuf::EnumDescriptor* FillerType_descriptor_ = NULL; +const ::google::protobuf::EnumDescriptor* FileType_descriptor_ = NULL; +const ::google::protobuf::EnumDescriptor* DataType_descriptor_ = NULL; + +} // namespace + + +void protobuf_AssignDesc_DlaPrototestInterface_2eproto() { + protobuf_AddDesc_DlaPrototestInterface_2eproto(); + const ::google::protobuf::FileDescriptor* file = + ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName( + "DlaPrototestInterface.proto"); + GOOGLE_CHECK(file != NULL); + LUTOffset_descriptor_ = file->message_type(0); + static const int LUTOffset_offsets_[3] = { + PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET(LUTOffset_default_oneof_instance_, exp_offset_), + PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET(LUTOffset_default_oneof_instance_, frac_bits_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LUTOffset, lut_offset_oneof_), + }; + LUTOffset_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + LUTOffset_descriptor_, + LUTOffset::default_instance_, + LUTOffset_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LUTOffset, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LUTOffset, _unknown_fields_), + -1, + LUTOffset_default_oneof_instance_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LUTOffset, _oneof_case_[0]), + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(LUTOffset)); + FloatData_descriptor_ = file->message_type(1); + static const int FloatData_offsets_[3] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FloatData, scale_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FloatData, shifter_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FloatData, reserved0_), + }; + FloatData_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + FloatData_descriptor_, + FloatData::default_instance_, + FloatData_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FloatData, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FloatData, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(FloatData)); + DLASlope_descriptor_ = file->message_type(2); + static const int DLASlope_offsets_[3] = { + PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET(DLASlope_default_oneof_instance_, data_i_), + PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET(DLASlope_default_oneof_instance_, data_f_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DLASlope, dla_slope_oneof_), + }; + DLASlope_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + DLASlope_descriptor_, + DLASlope::default_instance_, + DLASlope_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DLASlope, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DLASlope, _unknown_fields_), + -1, + DLASlope_default_oneof_instance_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DLASlope, _oneof_case_[0]), + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(DLASlope)); + DataFile_descriptor_ = file->message_type(3); + static const int DataFile_offsets_[5] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DataFile, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DataFile, data_type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DataFile, offset_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DataFile, size_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DataFile, file_type_), + }; + DataFile_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + DataFile_descriptor_, + DataFile::default_instance_, + DataFile_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DataFile, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DataFile, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(DataFile)); + Constant_descriptor_ = file->message_type(4); + static const int Constant_offsets_[1] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Constant, value_), + }; + Constant_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + Constant_descriptor_, + Constant::default_instance_, + Constant_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Constant, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Constant, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(Constant)); + DataFiller_descriptor_ = file->message_type(5); + static const int DataFiller_offsets_[3] = { + PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET(DataFiller_default_oneof_instance_, data_file_), + PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET(DataFiller_default_oneof_instance_, const__), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DataFiller, data_filler_oneof_), + }; + DataFiller_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + DataFiller_descriptor_, + DataFiller::default_instance_, + DataFiller_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DataFiller, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DataFiller, _unknown_fields_), + -1, + DataFiller_default_oneof_instance_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DataFiller, _oneof_case_[0]), + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(DataFiller)); + LUTParam_descriptor_ = file->message_type(6); + static const int LUTParam_offsets_[19] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LUTParam, linear_exp_table_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LUTParam, linear_only_table_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LUTParam, linear_exp_offset_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LUTParam, linear_only_offset_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LUTParam, linear_exp_start_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LUTParam, linear_exp_end_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LUTParam, linear_only_start_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LUTParam, linear_only_end_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LUTParam, linear_exp_underflow_slope_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LUTParam, linear_exp_overflow_slope_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LUTParam, linear_only_underflow_slope_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LUTParam, linear_only_overflow_slope_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LUTParam, hybrid_priority_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LUTParam, underflow_priority_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LUTParam, overflow_priority_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LUTParam, method_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LUTParam, fill_type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LUTParam, filler_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LUTParam, precision_), + }; + LUTParam_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + LUTParam_descriptor_, + LUTParam::default_instance_, + LUTParam_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LUTParam, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LUTParam, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(LUTParam)); + BDMATransferDesc_descriptor_ = file->message_type(7); + static const int BDMATransferDesc_offsets_[11] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BDMATransferDesc, source_address_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BDMATransferDesc, destination_address_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BDMATransferDesc, line_size_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BDMATransferDesc, line_repeat_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BDMATransferDesc, source_line_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BDMATransferDesc, destination_line_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BDMATransferDesc, surface_repeat_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BDMATransferDesc, source_surface_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BDMATransferDesc, destination_surface_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BDMATransferDesc, src_mem_info_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BDMATransferDesc, dst_mem_info_), + }; + BDMATransferDesc_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + BDMATransferDesc_descriptor_, + BDMATransferDesc::default_instance_, + BDMATransferDesc_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BDMATransferDesc, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BDMATransferDesc, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(BDMATransferDesc)); + BDMASurfaceDesc_descriptor_ = file->message_type(8); + static const int BDMASurfaceDesc_offsets_[4] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BDMASurfaceDesc, source_type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BDMASurfaceDesc, destination_type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BDMASurfaceDesc, num_transfers_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BDMASurfaceDesc, transfers_), + }; + BDMASurfaceDesc_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + BDMASurfaceDesc_descriptor_, + BDMASurfaceDesc::default_instance_, + BDMASurfaceDesc_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BDMASurfaceDesc, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BDMASurfaceDesc, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(BDMASurfaceDesc)); + BDMAOpDesc_descriptor_ = file->message_type(9); + static const int BDMAOpDesc_offsets_[2] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BDMAOpDesc, num_transfers_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BDMAOpDesc, reserved0_), + }; + BDMAOpDesc_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + BDMAOpDesc_descriptor_, + BDMAOpDesc::default_instance_, + BDMAOpDesc_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BDMAOpDesc, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BDMAOpDesc, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(BDMAOpDesc)); + CVTParam_descriptor_ = file->message_type(10); + static const int CVTParam_offsets_[4] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CVTParam, scale_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CVTParam, truncate_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CVTParam, enable_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CVTParam, offset_), + }; + CVTParam_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + CVTParam_descriptor_, + CVTParam::default_instance_, + CVTParam_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CVTParam, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CVTParam, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(CVTParam)); + MemInfo_descriptor_ = file->message_type(11); + static const int MemInfo_offsets_[9] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MemInfo, mem_id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MemInfo, mem_size_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MemInfo, offset_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MemInfo, fill_type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MemInfo, filler_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MemInfo, flag_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MemInfo, precision_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MemInfo, sw_dilation_x_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MemInfo, sw_dilation_y_), + }; + MemInfo_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + MemInfo_descriptor_, + MemInfo::default_instance_, + MemInfo_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MemInfo, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MemInfo, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(MemInfo)); + DataCube_descriptor_ = file->message_type(12); + static const int DataCube_offsets_[12] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DataCube, reserved0_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DataCube, type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DataCube, address_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DataCube, size_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DataCube, width_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DataCube, height_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DataCube, channel_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DataCube, reserved1_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DataCube, line_stride_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DataCube, surf_stride_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DataCube, plane_stride_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DataCube, mem_info_), + }; + DataCube_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + DataCube_descriptor_, + DataCube::default_instance_, + DataCube_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DataCube, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DataCube, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(DataCube)); + CONVSurfaceDesc_descriptor_ = file->message_type(13); + static const int CONVSurfaceDesc_offsets_[7] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CONVSurfaceDesc, weight_data_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CONVSurfaceDesc, wmb_data_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CONVSurfaceDesc, wgs_data_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CONVSurfaceDesc, src_data_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CONVSurfaceDesc, dst_data_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CONVSurfaceDesc, offset_u_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CONVSurfaceDesc, in_line_uv_stride_), + }; + CONVSurfaceDesc_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + CONVSurfaceDesc_descriptor_, + CONVSurfaceDesc::default_instance_, + CONVSurfaceDesc_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CONVSurfaceDesc, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CONVSurfaceDesc, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(CONVSurfaceDesc)); + CONVOpDesc_descriptor_ = file->message_type(14); + static const int CONVOpDesc_offsets_[53] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CONVOpDesc, conv_mode_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CONVOpDesc, data_reuse_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CONVOpDesc, weight_reuse_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CONVOpDesc, skip_data_rls_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CONVOpDesc, skip_weight_rls_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CONVOpDesc, reserved0_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CONVOpDesc, entry_per_slice_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CONVOpDesc, data_format_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CONVOpDesc, pixel_mapping_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CONVOpDesc, fetch_grain_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CONVOpDesc, pixel_offset_x_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CONVOpDesc, pixel_offset_y_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CONVOpDesc, gob_per_line_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CONVOpDesc, gob_height_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CONVOpDesc, gob_y_index_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CONVOpDesc, gob_per_uv_line_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CONVOpDesc, batch_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CONVOpDesc, weight_format_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CONVOpDesc, data_bank_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CONVOpDesc, weight_bank_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CONVOpDesc, batch_stride_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CONVOpDesc, post_extension_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CONVOpDesc, pixel_override_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CONVOpDesc, release_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CONVOpDesc, input_width_csc_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CONVOpDesc, input_height_csc_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CONVOpDesc, input_channel_csc_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CONVOpDesc, kernel_width_csc_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CONVOpDesc, kernel_height_csc_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CONVOpDesc, kernel_channel_csc_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CONVOpDesc, input_width_cmac_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CONVOpDesc, input_height_cmac_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CONVOpDesc, bytes_per_kernel_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CONVOpDesc, mean_ry_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CONVOpDesc, mean_gu_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CONVOpDesc, mean_bv_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CONVOpDesc, mean_ax_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CONVOpDesc, mean_format_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CONVOpDesc, conv_stride_x_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CONVOpDesc, conv_stride_y_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CONVOpDesc, pad_x_left_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CONVOpDesc, pad_x_right_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CONVOpDesc, pad_y_top_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CONVOpDesc, pad_y_bottom_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CONVOpDesc, dilation_x_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CONVOpDesc, dilation_y_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CONVOpDesc, reserved2_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CONVOpDesc, pra_truncate_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CONVOpDesc, in_precision_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CONVOpDesc, out_precision_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CONVOpDesc, pad_val_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CONVOpDesc, in_cvt_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CONVOpDesc, out_cvt_), + }; + CONVOpDesc_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + CONVOpDesc_descriptor_, + CONVOpDesc::default_instance_, + CONVOpDesc_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CONVOpDesc, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CONVOpDesc, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(CONVOpDesc)); + SDPCvt_descriptor_ = file->message_type(15); + static const int SDPCvt_offsets_[2] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SDPCvt, alu_cvt_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SDPCvt, mul_cvt_), + }; + SDPCvt_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + SDPCvt_descriptor_, + SDPCvt::default_instance_, + SDPCvt_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SDPCvt, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SDPCvt, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(SDPCvt)); + SDPOp_descriptor_ = file->message_type(16); + static const int SDPOp_offsets_[11] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SDPOp, enable_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SDPOp, alu_type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SDPOp, type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SDPOp, mode_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SDPOp, act_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SDPOp, shift_value_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SDPOp, truncate_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SDPOp, precision_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SDPOp, alu_operand_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SDPOp, mul_operand_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SDPOp, cvt_), + }; + SDPOp_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + SDPOp_descriptor_, + SDPOp::default_instance_, + SDPOp_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SDPOp, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SDPOp, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(SDPOp)); + SDPOp_SDPOpMode_descriptor_ = SDPOp_descriptor_->enum_type(0); + SDPSurfaceDesc_descriptor_ = file->message_type(17); + static const int SDPSurfaceDesc_offsets_[5] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SDPSurfaceDesc, src_data_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SDPSurfaceDesc, x1_data_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SDPSurfaceDesc, x2_data_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SDPSurfaceDesc, y_data_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SDPSurfaceDesc, dst_data_), + }; + SDPSurfaceDesc_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + SDPSurfaceDesc_descriptor_, + SDPSurfaceDesc::default_instance_, + SDPSurfaceDesc_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SDPSurfaceDesc, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SDPSurfaceDesc, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(SDPSurfaceDesc)); + SDPOpDesc_descriptor_ = file->message_type(18); + static const int SDPOpDesc_offsets_[11] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SDPOpDesc, src_precision_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SDPOpDesc, dst_precision_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SDPOpDesc, lut_index_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SDPOpDesc, out_cvt_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SDPOpDesc, conv_mode_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SDPOpDesc, batch_num_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SDPOpDesc, reserved0_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SDPOpDesc, batch_stride_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SDPOpDesc, x1_op_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SDPOpDesc, x2_op_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SDPOpDesc, y_op_), + }; + SDPOpDesc_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + SDPOpDesc_descriptor_, + SDPOpDesc::default_instance_, + SDPOpDesc_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SDPOpDesc, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SDPOpDesc, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(SDPOpDesc)); + PDPSurfaceDesc_descriptor_ = file->message_type(19); + static const int PDPSurfaceDesc_offsets_[2] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PDPSurfaceDesc, src_data_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PDPSurfaceDesc, dst_data_), + }; + PDPSurfaceDesc_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + PDPSurfaceDesc_descriptor_, + PDPSurfaceDesc::default_instance_, + PDPSurfaceDesc_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PDPSurfaceDesc, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PDPSurfaceDesc, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(PDPSurfaceDesc)); + PDPOpDesc_descriptor_ = file->message_type(20); + static const int PDPOpDesc_offsets_[19] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PDPOpDesc, partial_in_width_first_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PDPOpDesc, partial_in_width_mid_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PDPOpDesc, partial_in_width_last_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PDPOpDesc, partial_width_first_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PDPOpDesc, partial_width_mid_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PDPOpDesc, partial_width_last_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PDPOpDesc, split_num_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PDPOpDesc, pool_mode_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PDPOpDesc, pool_width_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PDPOpDesc, pool_height_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PDPOpDesc, stride_x_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PDPOpDesc, stride_y_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PDPOpDesc, pad_left_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PDPOpDesc, pad_right_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PDPOpDesc, pad_top_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PDPOpDesc, pad_bottom_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PDPOpDesc, precision_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PDPOpDesc, reserved0_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PDPOpDesc, padding_value_), + }; + PDPOpDesc_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + PDPOpDesc_descriptor_, + PDPOpDesc::default_instance_, + PDPOpDesc_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PDPOpDesc, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PDPOpDesc, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(PDPOpDesc)); + PDPOpDesc_PoolingMode_descriptor_ = PDPOpDesc_descriptor_->enum_type(0); + CDPSurfaceDesc_descriptor_ = file->message_type(21); + static const int CDPSurfaceDesc_offsets_[2] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CDPSurfaceDesc, src_data_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CDPSurfaceDesc, dst_data_), + }; + CDPSurfaceDesc_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + CDPSurfaceDesc_descriptor_, + CDPSurfaceDesc::default_instance_, + CDPSurfaceDesc_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CDPSurfaceDesc, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CDPSurfaceDesc, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(CDPSurfaceDesc)); + CDPOpDesc_descriptor_ = file->message_type(22); + static const int CDPOpDesc_offsets_[9] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CDPOpDesc, in_precision_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CDPOpDesc, out_precision_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CDPOpDesc, lut_index_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CDPOpDesc, in_cvt_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CDPOpDesc, out_cvt_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CDPOpDesc, local_size_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CDPOpDesc, bypass_sqsum_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CDPOpDesc, bypass_out_mul_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CDPOpDesc, reserved0_), + }; + CDPOpDesc_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + CDPOpDesc_descriptor_, + CDPOpDesc::default_instance_, + CDPOpDesc_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CDPOpDesc, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CDPOpDesc, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(CDPOpDesc)); + RUBIKSurfaceDesc_descriptor_ = file->message_type(23); + static const int RUBIKSurfaceDesc_offsets_[2] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RUBIKSurfaceDesc, src_data_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RUBIKSurfaceDesc, dst_data_), + }; + RUBIKSurfaceDesc_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + RUBIKSurfaceDesc_descriptor_, + RUBIKSurfaceDesc::default_instance_, + RUBIKSurfaceDesc_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RUBIKSurfaceDesc, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RUBIKSurfaceDesc, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(RUBIKSurfaceDesc)); + RUBIKOpDesc_descriptor_ = file->message_type(24); + static const int RUBIKOpDesc_offsets_[4] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RUBIKOpDesc, mode_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RUBIKOpDesc, precision_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RUBIKOpDesc, stride_x_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RUBIKOpDesc, stride_y_), + }; + RUBIKOpDesc_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + RUBIKOpDesc_descriptor_, + RUBIKOpDesc::default_instance_, + RUBIKOpDesc_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RUBIKOpDesc, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RUBIKOpDesc, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(RUBIKOpDesc)); + SurfaceContainer_descriptor_ = file->message_type(25); + static const int SurfaceContainer_offsets_[7] = { + PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET(SurfaceContainer_default_oneof_instance_, bdma_surface_), + PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET(SurfaceContainer_default_oneof_instance_, conv_surface_), + PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET(SurfaceContainer_default_oneof_instance_, sdp_surface_), + PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET(SurfaceContainer_default_oneof_instance_, pdp_surface_), + PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET(SurfaceContainer_default_oneof_instance_, cdp_surface_), + PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET(SurfaceContainer_default_oneof_instance_, rubik_surface_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SurfaceContainer, surface_container_oneof_), + }; + SurfaceContainer_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + SurfaceContainer_descriptor_, + SurfaceContainer::default_instance_, + SurfaceContainer_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SurfaceContainer, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SurfaceContainer, _unknown_fields_), + -1, + SurfaceContainer_default_oneof_instance_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SurfaceContainer, _oneof_case_[0]), + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(SurfaceContainer)); + OperationContainer_descriptor_ = file->message_type(26); + static const int OperationContainer_offsets_[7] = { + PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET(OperationContainer_default_oneof_instance_, bdma_op_), + PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET(OperationContainer_default_oneof_instance_, conv_op_), + PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET(OperationContainer_default_oneof_instance_, sdp_op_), + PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET(OperationContainer_default_oneof_instance_, pdp_op_), + PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET(OperationContainer_default_oneof_instance_, cdp_op_), + PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET(OperationContainer_default_oneof_instance_, rubik_op_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OperationContainer, op_container_oneof_), + }; + OperationContainer_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + OperationContainer_descriptor_, + OperationContainer::default_instance_, + OperationContainer_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OperationContainer, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OperationContainer, _unknown_fields_), + -1, + OperationContainer_default_oneof_instance_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OperationContainer, _oneof_case_[0]), + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(OperationContainer)); + Consumer_descriptor_ = file->message_type(27); + static const int Consumer_offsets_[3] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Consumer, index_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Consumer, type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Consumer, event_), + }; + Consumer_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + Consumer_descriptor_, + Consumer::default_instance_, + Consumer_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Consumer, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Consumer, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(Consumer)); + Consumer_EventType_descriptor_ = Consumer_descriptor_->enum_type(0); + Layer_descriptor_ = file->message_type(28); + static const int Layer_offsets_[9] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Layer, index_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Layer, roi_index_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Layer, type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Layer, dependency_count_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Layer, reserved_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Layer, bottom_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Layer, fused_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Layer, op_config_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Layer, surface_), + }; + Layer_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + Layer_descriptor_, + Layer::default_instance_, + Layer_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Layer, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Layer, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(Layer)); + NetworkLayer_descriptor_ = file->message_type(29); + static const int NetworkLayer_offsets_[1] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetworkLayer, layer_), + }; + NetworkLayer_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + NetworkLayer_descriptor_, + NetworkLayer::default_instance_, + NetworkLayer_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetworkLayer, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetworkLayer, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(NetworkLayer)); + NetworkDesc_descriptor_ = file->message_type(30); + static const int NetworkDesc_offsets_[16] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetworkDesc, operation_desc_index_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetworkDesc, surface_desc_index_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetworkDesc, dependency_graph_index_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetworkDesc, lut_data_index_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetworkDesc, roi_array_index_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetworkDesc, surface_index_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetworkDesc, stat_list_index_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetworkDesc, reserved1_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetworkDesc, op_head_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetworkDesc, num_rois_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetworkDesc, num_operations_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetworkDesc, num_luts_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetworkDesc, num_addresses_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetworkDesc, input_layer_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetworkDesc, dynamic_roi_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetworkDesc, reserved0_), + }; + NetworkDesc_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + NetworkDesc_descriptor_, + NetworkDesc::default_instance_, + NetworkDesc_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetworkDesc, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetworkDesc, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(NetworkDesc)); + LUTParamList_descriptor_ = file->message_type(31); + static const int LUTParamList_offsets_[1] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LUTParamList, lut_param_), + }; + LUTParamList_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + LUTParamList_descriptor_, + LUTParamList::default_instance_, + LUTParamList_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LUTParamList, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LUTParamList, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(LUTParamList)); + ROIArrayDesc_descriptor_ = file->message_type(32); + static const int ROIArrayDesc_offsets_[2] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ROIArrayDesc, array_length_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ROIArrayDesc, array_reserved_), + }; + ROIArrayDesc_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + ROIArrayDesc_descriptor_, + ROIArrayDesc::default_instance_, + ROIArrayDesc_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ROIArrayDesc, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ROIArrayDesc, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(ROIArrayDesc)); + ROIDesc_descriptor_ = file->message_type(33); + static const int ROIDesc_offsets_[4] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ROIDesc, left_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ROIDesc, top_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ROIDesc, right_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ROIDesc, bottom_), + }; + ROIDesc_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + ROIDesc_descriptor_, + ROIDesc::default_instance_, + ROIDesc_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ROIDesc, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ROIDesc, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(ROIDesc)); + ROIDescription_descriptor_ = file->message_type(34); + static const int ROIDescription_offsets_[2] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ROIDescription, roi_arr_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ROIDescription, roi_desc_), + }; + ROIDescription_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + ROIDescription_descriptor_, + ROIDescription::default_instance_, + ROIDescription_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ROIDescription, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ROIDescription, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(ROIDescription)); + Network_descriptor_ = file->message_type(35); + static const int Network_offsets_[4] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Network, param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Network, layers_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Network, lut_list_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Network, roi_list_), + }; + Network_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + Network_descriptor_, + Network::default_instance_, + Network_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Network, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Network, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(Network)); + TaskStatus_descriptor_ = file->message_type(36); + static const int TaskStatus_offsets_[4] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TaskStatus, timestamp_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TaskStatus, status_engine_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TaskStatus, subframe_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TaskStatus, status_task_), + }; + TaskStatus_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + TaskStatus_descriptor_, + TaskStatus::default_instance_, + TaskStatus_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TaskStatus, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TaskStatus, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(TaskStatus)); + Action_descriptor_ = file->message_type(37); + static const int Action_offsets_[1] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Action, event_id_), + }; + Action_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + Action_descriptor_, + Action::default_instance_, + Action_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Action, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Action, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(Action)); + TaskSchedule_descriptor_ = file->message_type(38); + static const int TaskSchedule_offsets_[2] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TaskSchedule, pre_actions_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TaskSchedule, post_actions_), + }; + TaskSchedule_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + TaskSchedule_descriptor_, + TaskSchedule::default_instance_, + TaskSchedule_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TaskSchedule, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TaskSchedule, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(TaskSchedule)); + TasksData_descriptor_ = file->message_type(39); + static const int TasksData_offsets_[7] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TasksData, task_id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TasksData, engine_id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TasksData, network_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TasksData, schedule_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TasksData, task_status_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TasksData, task_timeout_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TasksData, task_result_), + }; + TasksData_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + TasksData_descriptor_, + TasksData::default_instance_, + TasksData_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TasksData, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TasksData, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(TasksData)); + Event_descriptor_ = file->message_type(40); + static const int Event_offsets_[4] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Event, event_id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Event, event_type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Event, event_flags_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Event, event_timeout_), + }; + Event_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + Event_descriptor_, + Event::default_instance_, + Event_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Event, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Event, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(Event)); + Event_EventType_descriptor_ = Event_descriptor_->enum_type(0); + EventList_descriptor_ = file->message_type(41); + static const int EventList_offsets_[1] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EventList, event_), + }; + EventList_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + EventList_descriptor_, + EventList::default_instance_, + EventList_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EventList, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EventList, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(EventList)); + SubmitSlot_descriptor_ = file->message_type(42); + static const int SubmitSlot_offsets_[1] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SubmitSlot, task_id_), + }; + SubmitSlot_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + SubmitSlot_descriptor_, + SubmitSlot::default_instance_, + SubmitSlot_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SubmitSlot, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SubmitSlot, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(SubmitSlot)); + TestInfo_descriptor_ = file->message_type(43); + static const int TestInfo_offsets_[5] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TestInfo, num_tasks_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TestInfo, num_buffers_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TestInfo, task_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TestInfo, event_list_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TestInfo, slots_), + }; + TestInfo_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + TestInfo_descriptor_, + TestInfo::default_instance_, + TestInfo_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TestInfo, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TestInfo, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(TestInfo)); + Test_descriptor_ = file->message_type(44); + static const int Test_offsets_[1] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Test, test_), + }; + Test_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + Test_descriptor_, + Test::default_instance_, + Test_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Test, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Test, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(Test)); + DataPrecision_descriptor_ = file->enum_type(0); + MemType_descriptor_ = file->enum_type(1); + MemFlag_descriptor_ = file->enum_type(2); + EngineID_descriptor_ = file->enum_type(3); + LayerType_descriptor_ = file->enum_type(4); + ALUType_descriptor_ = file->enum_type(5); + SDPOpType_descriptor_ = file->enum_type(6); + LUTLOGSize_descriptor_ = file->enum_type(7); + LUTTable_descriptor_ = file->enum_type(8); + LUTMethod_descriptor_ = file->enum_type(9); + LUTPriority_descriptor_ = file->enum_type(10); + ConvMode_descriptor_ = file->enum_type(11); + ConvPixelMAP_descriptor_ = file->enum_type(12); + PixelOverride_descriptor_ = file->enum_type(13); + PoolSize_descriptor_ = file->enum_type(14); + RUBIKMode_descriptor_ = file->enum_type(15); + WeightFormat_descriptor_ = file->enum_type(16); + MeanFormat_descriptor_ = file->enum_type(17); + SDPActivation_descriptor_ = file->enum_type(18); + DataFormat_descriptor_ = file->enum_type(19); + FillerType_descriptor_ = file->enum_type(20); + FileType_descriptor_ = file->enum_type(21); + DataType_descriptor_ = file->enum_type(22); +} + +namespace { + +GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_); +inline void protobuf_AssignDescriptorsOnce() { + ::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_, + &protobuf_AssignDesc_DlaPrototestInterface_2eproto); +} + +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + LUTOffset_descriptor_, &LUTOffset::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + FloatData_descriptor_, &FloatData::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + DLASlope_descriptor_, &DLASlope::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + DataFile_descriptor_, &DataFile::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + Constant_descriptor_, &Constant::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + DataFiller_descriptor_, &DataFiller::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + LUTParam_descriptor_, &LUTParam::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + BDMATransferDesc_descriptor_, &BDMATransferDesc::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + BDMASurfaceDesc_descriptor_, &BDMASurfaceDesc::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + BDMAOpDesc_descriptor_, &BDMAOpDesc::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + CVTParam_descriptor_, &CVTParam::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + MemInfo_descriptor_, &MemInfo::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + DataCube_descriptor_, &DataCube::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + CONVSurfaceDesc_descriptor_, &CONVSurfaceDesc::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + CONVOpDesc_descriptor_, &CONVOpDesc::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + SDPCvt_descriptor_, &SDPCvt::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + SDPOp_descriptor_, &SDPOp::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + SDPSurfaceDesc_descriptor_, &SDPSurfaceDesc::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + SDPOpDesc_descriptor_, &SDPOpDesc::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + PDPSurfaceDesc_descriptor_, &PDPSurfaceDesc::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + PDPOpDesc_descriptor_, &PDPOpDesc::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + CDPSurfaceDesc_descriptor_, &CDPSurfaceDesc::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + CDPOpDesc_descriptor_, &CDPOpDesc::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + RUBIKSurfaceDesc_descriptor_, &RUBIKSurfaceDesc::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + RUBIKOpDesc_descriptor_, &RUBIKOpDesc::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + SurfaceContainer_descriptor_, &SurfaceContainer::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + OperationContainer_descriptor_, &OperationContainer::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + Consumer_descriptor_, &Consumer::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + Layer_descriptor_, &Layer::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + NetworkLayer_descriptor_, &NetworkLayer::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + NetworkDesc_descriptor_, &NetworkDesc::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + LUTParamList_descriptor_, &LUTParamList::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + ROIArrayDesc_descriptor_, &ROIArrayDesc::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + ROIDesc_descriptor_, &ROIDesc::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + ROIDescription_descriptor_, &ROIDescription::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + Network_descriptor_, &Network::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + TaskStatus_descriptor_, &TaskStatus::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + Action_descriptor_, &Action::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + TaskSchedule_descriptor_, &TaskSchedule::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + TasksData_descriptor_, &TasksData::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + Event_descriptor_, &Event::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + EventList_descriptor_, &EventList::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + SubmitSlot_descriptor_, &SubmitSlot::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + TestInfo_descriptor_, &TestInfo::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + Test_descriptor_, &Test::default_instance()); +} + +} // namespace + +void protobuf_ShutdownFile_DlaPrototestInterface_2eproto() { + delete LUTOffset::default_instance_; + delete LUTOffset_default_oneof_instance_; + delete LUTOffset_reflection_; + delete FloatData::default_instance_; + delete FloatData_reflection_; + delete DLASlope::default_instance_; + delete DLASlope_default_oneof_instance_; + delete DLASlope_reflection_; + delete DataFile::default_instance_; + delete DataFile_reflection_; + delete Constant::default_instance_; + delete Constant_reflection_; + delete DataFiller::default_instance_; + delete DataFiller_default_oneof_instance_; + delete DataFiller_reflection_; + delete LUTParam::default_instance_; + delete LUTParam_reflection_; + delete BDMATransferDesc::default_instance_; + delete BDMATransferDesc_reflection_; + delete BDMASurfaceDesc::default_instance_; + delete BDMASurfaceDesc_reflection_; + delete BDMAOpDesc::default_instance_; + delete BDMAOpDesc_reflection_; + delete CVTParam::default_instance_; + delete CVTParam_reflection_; + delete MemInfo::default_instance_; + delete MemInfo_reflection_; + delete DataCube::default_instance_; + delete DataCube_reflection_; + delete CONVSurfaceDesc::default_instance_; + delete CONVSurfaceDesc_reflection_; + delete CONVOpDesc::default_instance_; + delete CONVOpDesc_reflection_; + delete SDPCvt::default_instance_; + delete SDPCvt_reflection_; + delete SDPOp::default_instance_; + delete SDPOp_reflection_; + delete SDPSurfaceDesc::default_instance_; + delete SDPSurfaceDesc_reflection_; + delete SDPOpDesc::default_instance_; + delete SDPOpDesc_reflection_; + delete PDPSurfaceDesc::default_instance_; + delete PDPSurfaceDesc_reflection_; + delete PDPOpDesc::default_instance_; + delete PDPOpDesc_reflection_; + delete CDPSurfaceDesc::default_instance_; + delete CDPSurfaceDesc_reflection_; + delete CDPOpDesc::default_instance_; + delete CDPOpDesc_reflection_; + delete RUBIKSurfaceDesc::default_instance_; + delete RUBIKSurfaceDesc_reflection_; + delete RUBIKOpDesc::default_instance_; + delete RUBIKOpDesc_reflection_; + delete SurfaceContainer::default_instance_; + delete SurfaceContainer_default_oneof_instance_; + delete SurfaceContainer_reflection_; + delete OperationContainer::default_instance_; + delete OperationContainer_default_oneof_instance_; + delete OperationContainer_reflection_; + delete Consumer::default_instance_; + delete Consumer_reflection_; + delete Layer::default_instance_; + delete Layer_reflection_; + delete NetworkLayer::default_instance_; + delete NetworkLayer_reflection_; + delete NetworkDesc::default_instance_; + delete NetworkDesc_reflection_; + delete LUTParamList::default_instance_; + delete LUTParamList_reflection_; + delete ROIArrayDesc::default_instance_; + delete ROIArrayDesc_reflection_; + delete ROIDesc::default_instance_; + delete ROIDesc_reflection_; + delete ROIDescription::default_instance_; + delete ROIDescription_reflection_; + delete Network::default_instance_; + delete Network_reflection_; + delete TaskStatus::default_instance_; + delete TaskStatus_reflection_; + delete Action::default_instance_; + delete Action_reflection_; + delete TaskSchedule::default_instance_; + delete TaskSchedule_reflection_; + delete TasksData::default_instance_; + delete TasksData_reflection_; + delete Event::default_instance_; + delete Event_reflection_; + delete EventList::default_instance_; + delete EventList_reflection_; + delete SubmitSlot::default_instance_; + delete SubmitSlot_reflection_; + delete TestInfo::default_instance_; + delete TestInfo_reflection_; + delete Test::default_instance_; + delete Test_reflection_; +} + +void protobuf_AddDesc_DlaPrototestInterface_2eproto() { + static bool already_here = false; + if (already_here) return; + already_here = true; + GOOGLE_PROTOBUF_VERIFY_VERSION; + + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + "\n\033DlaPrototestInterface.proto\022\031nvdla_pro" + "totest_interface\"J\n\tLUTOffset\022\024\n\nexp_off" + "set\030\001 \001(\005H\000\022\023\n\tfrac_bits\030\002 \001(\005H\000B\022\n\020lut_" + "offset_oneof\"A\n\tFloatData\022\r\n\005scale\030\001 \002(\005" + "\022\017\n\007shifter\030\002 \002(\005\022\024\n\treserved0\030\003 \001(\r:\0010\"" + "g\n\010DLASlope\0226\n\006data_i\030\001 \001(\0132$.nvdla_prot" + "otest_interface.FloatDataH\000\022\020\n\006data_f\030\002 " + "\001(\rH\000B\021\n\017dla_slope_oneof\"\246\001\n\010DataFile\022\014\n" + "\004name\030\001 \002(\t\0226\n\tdata_type\030\002 \002(\0162#.nvdla_p" + "rototest_interface.DataType\022\016\n\006offset\030\003 " + "\002(\r\022\014\n\004size\030\004 \002(\r\0226\n\tfile_type\030\005 \002(\0162#.n" + "vdla_prototest_interface.FileType\"\031\n\010Con" + "stant\022\r\n\005value\030\001 \002(\005\"\221\001\n\nDataFiller\0228\n\td" + "ata_file\030\001 \001(\0132#.nvdla_prototest_interfa" + "ce.DataFileH\000\0224\n\005const\030\002 \001(\0132#.nvdla_pro" + "totest_interface.ConstantH\000B\023\n\021data_fill" + "er_oneof\"\244\007\n\010LUTParam\022\034\n\020linear_exp_tabl" + "e\030\001 \003(\005B\002\020\001\022\035\n\021linear_only_table\030\002 \003(\005B\002" + "\020\001\022\?\n\021linear_exp_offset\030\003 \002(\0132$.nvdla_pr" + "ototest_interface.LUTOffset\022@\n\022linear_on" + "ly_offset\030\004 \002(\0132$.nvdla_prototest_interf" + "ace.LUTOffset\022\030\n\020linear_exp_start\030\005 \002(\004\022" + "\026\n\016linear_exp_end\030\006 \002(\004\022\031\n\021linear_only_s" + "tart\030\007 \002(\004\022\027\n\017linear_only_end\030\010 \002(\004\022G\n\032l" + "inear_exp_underflow_slope\030\t \002(\0132#.nvdla_" + "prototest_interface.DLASlope\022F\n\031linear_e" + "xp_overflow_slope\030\n \002(\0132#.nvdla_prototes" + "t_interface.DLASlope\022H\n\033linear_only_unde" + "rflow_slope\030\013 \002(\0132#.nvdla_prototest_inte" + "rface.DLASlope\022G\n\032linear_only_overflow_s" + "lope\030\014 \002(\0132#.nvdla_prototest_interface.D" + "LASlope\022\027\n\017hybrid_priority\030\r \002(\r\022\032\n\022unde" + "rflow_priority\030\016 \002(\r\022\031\n\021overflow_priorit" + "y\030\017 \002(\r\0224\n\006method\030\020 \002(\0162$.nvdla_prototes" + "t_interface.LUTMethod\022C\n\tfill_type\030\021 \001(\016" + "2%.nvdla_prototest_interface.FillerType:" + "\tFILL_NONE\0225\n\006filler\030\022 \001(\0132%.nvdla_proto" + "test_interface.DataFiller\022L\n\tprecision\030\023" + " \001(\0162(.nvdla_prototest_interface.DataPre" + "cision:\017PRECISION_INT16\"\337\002\n\020BDMATransfer" + "Desc\022\026\n\016source_address\030\001 \002(\005\022\033\n\023destinat" + "ion_address\030\002 \002(\005\022\021\n\tline_size\030\003 \002(\r\022\023\n\013" + "line_repeat\030\004 \002(\r\022\023\n\013source_line\030\005 \002(\r\022\030" + "\n\020destination_line\030\006 \002(\r\022\026\n\016surface_repe" + "at\030\007 \002(\r\022\026\n\016source_surface\030\010 \002(\r\022\033\n\023dest" + "ination_surface\030\t \002(\r\0228\n\014src_mem_info\030\n " + "\002(\0132\".nvdla_prototest_interface.MemInfo\022" + "8\n\014dst_mem_info\030\013 \002(\0132\".nvdla_prototest_" + "interface.MemInfo\"\337\001\n\017BDMASurfaceDesc\0227\n" + "\013source_type\030\001 \002(\0162\".nvdla_prototest_int" + "erface.MemType\022<\n\020destination_type\030\002 \002(\016" + "2\".nvdla_prototest_interface.MemType\022\025\n\r" + "num_transfers\030\003 \002(\r\022>\n\ttransfers\030\004 \003(\0132+" + ".nvdla_prototest_interface.BDMATransferD" + "esc\"9\n\nBDMAOpDesc\022\025\n\rnum_transfers\030\001 \002(\r" + "\022\024\n\treserved0\030\002 \001(\r:\0010\"K\n\010CVTParam\022\r\n\005sc" + "ale\030\001 \002(\005\022\020\n\010truncate\030\002 \002(\r\022\016\n\006enable\030\003 " + "\002(\r\022\016\n\006offset\030\004 \002(\005\"\203\003\n\007MemInfo\022\022\n\006mem_i" + "d\030\001 \002(\005:\002-1\022\023\n\010mem_size\030\002 \002(\r:\0010\022\021\n\006offs" + "et\030\003 \002(\r:\0010\022C\n\tfill_type\030\004 \001(\0162%.nvdla_p" + "rototest_interface.FillerType:\tFILL_NONE" + "\0225\n\006filler\030\005 \001(\0132%.nvdla_prototest_inter" + "face.DataFiller\022\?\n\004flag\030\006 \001(\0162\".nvdla_pr" + "ototest_interface.MemFlag:\rDLA_MEM_ALLOC" + "\022K\n\tprecision\030\007 \001(\0162(.nvdla_prototest_in" + "terface.DataPrecision:\016PRECISION_INT8\022\030\n" + "\rsw_dilation_x\030\010 \001(\r:\0011\022\030\n\rsw_dilation_y" + "\030\t \001(\r:\0011\"\255\002\n\010DataCube\022\024\n\treserved0\030\001 \001(" + "\r:\0010\0220\n\004type\030\002 \002(\0162\".nvdla_prototest_int" + "erface.MemType\022\017\n\007address\030\003 \002(\005\022\014\n\004size\030" + "\004 \002(\r\022\r\n\005width\030\005 \002(\r\022\016\n\006height\030\006 \002(\r\022\017\n\007" + "channel\030\007 \002(\r\022\024\n\treserved1\030\010 \001(\r:\0010\022\023\n\013l" + "ine_stride\030\t \002(\r\022\023\n\013surf_stride\030\n \002(\r\022\024\n" + "\014plane_stride\030\013 \002(\r\0224\n\010mem_info\030\014 \002(\0132\"." + "nvdla_prototest_interface.MemInfo\"\324\002\n\017CO" + "NVSurfaceDesc\0228\n\013weight_data\030\001 \002(\0132#.nvd" + "la_prototest_interface.DataCube\0225\n\010wmb_d" + "ata\030\002 \001(\0132#.nvdla_prototest_interface.Da" + "taCube\0225\n\010wgs_data\030\003 \001(\0132#.nvdla_protote" + "st_interface.DataCube\0225\n\010src_data\030\004 \002(\0132" + "#.nvdla_prototest_interface.DataCube\0225\n\010" + "dst_data\030\005 \002(\0132#.nvdla_prototest_interfa" + "ce.DataCube\022\020\n\010offset_u\030\006 \002(\003\022\031\n\021in_line" + "_uv_stride\030\007 \002(\r\"\365\013\n\nCONVOpDesc\0226\n\tconv_" + "mode\030\001 \002(\0162#.nvdla_prototest_interface.C" + "onvMode\022\022\n\ndata_reuse\030\002 \002(\r\022\024\n\014weight_re" + "use\030\003 \002(\r\022\025\n\rskip_data_rls\030\004 \002(\r\022\027\n\017skip" + "_weight_rls\030\005 \002(\r\022\024\n\treserved0\030\006 \001(\r:\0010\022" + "\027\n\017entry_per_slice\030\007 \002(\r\022:\n\013data_format\030" + "\010 \002(\0162%.nvdla_prototest_interface.DataFo" + "rmat\022\025\n\rpixel_mapping\030\t \002(\r\022\023\n\013fetch_gra" + "in\030\n \002(\r\022\026\n\016pixel_offset_x\030\013 \002(\r\022\026\n\016pixe" + "l_offset_y\030\014 \002(\r\022\024\n\014gob_per_line\030\r \002(\r\022\022" + "\n\ngob_height\030\016 \002(\r\022\023\n\013gob_y_index\030\017 \002(\r\022" + "\027\n\017gob_per_uv_line\030\020 \002(\r\022\r\n\005batch\030\021 \002(\r\022" + ">\n\rweight_format\030\022 \002(\0162\'.nvdla_prototest" + "_interface.WeightFormat\022\021\n\tdata_bank\030\023 \002" + "(\r\022\023\n\013weight_bank\030\024 \002(\r\022\024\n\014batch_stride\030" + "\025 \002(\r\022\026\n\016post_extension\030\026 \002(\r\022@\n\016pixel_o" + "verride\030\027 \001(\0162(.nvdla_prototest_interfac" + "e.PixelOverride\022\017\n\007release\030\030 \002(\r\022\027\n\017inpu" + "t_width_csc\030\031 \002(\r\022\030\n\020input_height_csc\030\032 " + "\002(\r\022\031\n\021input_channel_csc\030\033 \002(\r\022\030\n\020kernel" + "_width_csc\030\034 \002(\r\022\031\n\021kernel_height_csc\030\035 " + "\002(\r\022\032\n\022kernel_channel_csc\030\036 \002(\r\022\030\n\020input" + "_width_cmac\030\037 \002(\r\022\031\n\021input_height_cmac\030 " + " \002(\r\022\030\n\020bytes_per_kernel\030! \002(\r\022\017\n\007mean_r" + "y\030\" \002(\005\022\017\n\007mean_gu\030# \002(\005\022\017\n\007mean_bv\030$ \002(" + "\005\022\017\n\007mean_ax\030% \002(\005\022:\n\013mean_format\030& \002(\0162" + "%.nvdla_prototest_interface.MeanFormat\022\025" + "\n\rconv_stride_x\030\' \002(\r\022\025\n\rconv_stride_y\030(" + " \002(\r\022\022\n\npad_x_left\030) \002(\r\022\023\n\013pad_x_right\030" + "* \002(\r\022\021\n\tpad_y_top\030+ \002(\r\022\024\n\014pad_y_bottom" + "\030, \002(\r\022\022\n\ndilation_x\030- \002(\r\022\022\n\ndilation_y" + "\030. \002(\r\022\025\n\treserved2\030/ \003(\rB\002\020\001\022\024\n\014pra_tru" + "ncate\0300 \002(\r\022>\n\014in_precision\0301 \002(\0162(.nvdl" + "a_prototest_interface.DataPrecision\022\?\n\ro" + "ut_precision\0302 \002(\0162(.nvdla_prototest_int" + "erface.DataPrecision\022\017\n\007pad_val\0303 \002(\005\0223\n" + "\006in_cvt\0304 \002(\0132#.nvdla_prototest_interfac" + "e.CVTParam\0224\n\007out_cvt\0305 \002(\0132#.nvdla_prot" + "otest_interface.CVTParam\"t\n\006SDPCvt\0224\n\007al" + "u_cvt\030\001 \002(\0132#.nvdla_prototest_interface." + "CVTParam\0224\n\007mul_cvt\030\002 \002(\0132#.nvdla_protot" + "est_interface.CVTParam\"\200\004\n\005SDPOp\022\016\n\006enab" + "le\030\001 \002(\r\0224\n\010alu_type\030\002 \002(\0162\".nvdla_proto" + "test_interface.ALUType\0222\n\004type\030\003 \002(\0162$.n" + "vdla_prototest_interface.SDPOpType\0228\n\004mo" + "de\030\004 \002(\0162*.nvdla_prototest_interface.SDP" + "Op.SDPOpMode\0225\n\003act\030\005 \002(\0162(.nvdla_protot" + "est_interface.SDPActivation\022\023\n\013shift_val" + "ue\030\006 \002(\r\022\020\n\010truncate\030\007 \002(\r\022;\n\tprecision\030" + "\010 \002(\0162(.nvdla_prototest_interface.DataPr" + "ecision\022\023\n\013alu_operand\030\t \002(\005\022\023\n\013mul_oper" + "and\030\n \002(\005\022.\n\003cvt\030\013 \002(\0132!.nvdla_prototest" + "_interface.SDPCvt\"N\n\tSDPOpMode\022\024\n\020SDP_OP" + "_PER_LAYER\020\000\022\025\n\021SDP_OP_PER_KERNEL\020\001\022\024\n\020S" + "DP_OP_PER_POINT\020\002\"\237\002\n\016SDPSurfaceDesc\0225\n\010" + "src_data\030\001 \002(\0132#.nvdla_prototest_interfa" + "ce.DataCube\0224\n\007x1_data\030\002 \001(\0132#.nvdla_pro" + "totest_interface.DataCube\0224\n\007x2_data\030\003 \001" + "(\0132#.nvdla_prototest_interface.DataCube\022" + "3\n\006y_data\030\004 \001(\0132#.nvdla_prototest_interf" + "ace.DataCube\0225\n\010dst_data\030\005 \002(\0132#.nvdla_p" + "rototest_interface.DataCube\"\337\003\n\tSDPOpDes" + "c\022\?\n\rsrc_precision\030\001 \002(\0162(.nvdla_protote" + "st_interface.DataPrecision\022\?\n\rdst_precis" + "ion\030\002 \002(\0162(.nvdla_prototest_interface.Da" + "taPrecision\022\021\n\tlut_index\030\003 \002(\005\0224\n\007out_cv" + "t\030\004 \002(\0132#.nvdla_prototest_interface.CVTP" + "aram\0226\n\tconv_mode\030\005 \002(\0162#.nvdla_prototes" + "t_interface.ConvMode\022\021\n\tbatch_num\030\006 \002(\r\022" + "\024\n\treserved0\030\007 \001(\r:\0010\022\024\n\014batch_stride\030\010 " + "\002(\r\022/\n\005x1_op\030\t \002(\0132 .nvdla_prototest_int" + "erface.SDPOp\022/\n\005x2_op\030\n \002(\0132 .nvdla_prot" + "otest_interface.SDPOp\022.\n\004y_op\030\013 \002(\0132 .nv" + "dla_prototest_interface.SDPOp\"~\n\016PDPSurf" + "aceDesc\0225\n\010src_data\030\001 \002(\0132#.nvdla_protot" + "est_interface.DataCube\0225\n\010dst_data\030\002 \002(\013" + "2#.nvdla_prototest_interface.DataCube\"\234\005" + "\n\tPDPOpDesc\022\036\n\026partial_in_width_first\030\001 " + "\002(\r\022\034\n\024partial_in_width_mid\030\002 \002(\r\022\035\n\025par" + "tial_in_width_last\030\003 \002(\r\022\033\n\023partial_widt" + "h_first\030\004 \002(\r\022\031\n\021partial_width_mid\030\005 \002(\r" + "\022\032\n\022partial_width_last\030\006 \002(\r\022\021\n\tsplit_nu" + "m\030\007 \002(\r\022C\n\tpool_mode\030\010 \002(\01620.nvdla_proto" + "test_interface.PDPOpDesc.PoolingMode\0227\n\n" + "pool_width\030\t \002(\0162#.nvdla_prototest_inter" + "face.PoolSize\0228\n\013pool_height\030\n \002(\0162#.nvd" + "la_prototest_interface.PoolSize\022\020\n\010strid" + "e_x\030\013 \002(\r\022\020\n\010stride_y\030\014 \002(\r\022\020\n\010pad_left\030" + "\r \002(\r\022\021\n\tpad_right\030\016 \002(\r\022\017\n\007pad_top\030\017 \002(" + "\r\022\022\n\npad_bottom\030\020 \002(\r\022;\n\tprecision\030\021 \002(\016" + "2(.nvdla_prototest_interface.DataPrecisi" + "on\022\024\n\treserved0\030\022 \001(\r:\0010\022\031\n\rpadding_valu" + "e\030\023 \003(\005B\002\020\001\"7\n\013PoolingMode\022\014\n\010MODE_AVG\020\000" + "\022\014\n\010MODE_MAX\020\001\022\014\n\010MODE_MIN\020\002\"~\n\016CDPSurfa" + "ceDesc\0225\n\010src_data\030\001 \002(\0132#.nvdla_protote" + "st_interface.DataCube\0225\n\010dst_data\030\002 \002(\0132" + "#.nvdla_prototest_interface.DataCube\"\342\002\n" + "\tCDPOpDesc\022>\n\014in_precision\030\001 \002(\0162(.nvdla" + "_prototest_interface.DataPrecision\022\?\n\rou" + "t_precision\030\002 \002(\0162(.nvdla_prototest_inte" + "rface.DataPrecision\022\021\n\tlut_index\030\003 \002(\005\0223" + "\n\006in_cvt\030\004 \002(\0132#.nvdla_prototest_interfa" + "ce.CVTParam\0224\n\007out_cvt\030\005 \002(\0132#.nvdla_pro" + "totest_interface.CVTParam\022\022\n\nlocal_size\030" + "\006 \002(\r\022\024\n\014bypass_sqsum\030\007 \002(\r\022\026\n\016bypass_ou" + "t_mul\030\010 \002(\r\022\024\n\treserved0\030\t \001(\r:\0010\"\200\001\n\020RU" + "BIKSurfaceDesc\0225\n\010src_data\030\001 \002(\0132#.nvdla" + "_prototest_interface.DataCube\0225\n\010dst_dat" + "a\030\002 \002(\0132#.nvdla_prototest_interface.Data" + "Cube\"\242\001\n\013RUBIKOpDesc\0222\n\004mode\030\001 \002(\0162$.nvd" + "la_prototest_interface.RUBIKMode\022;\n\tprec" + "ision\030\002 \002(\0162(.nvdla_prototest_interface." + "DataPrecision\022\020\n\010stride_x\030\003 \002(\r\022\020\n\010strid" + "e_y\030\004 \002(\r\"\301\003\n\020SurfaceContainer\022B\n\014bdma_s" + "urface\030\001 \001(\0132*.nvdla_prototest_interface" + ".BDMASurfaceDescH\000\022B\n\014conv_surface\030\002 \001(\013" + "2*.nvdla_prototest_interface.CONVSurface" + "DescH\000\022@\n\013sdp_surface\030\003 \001(\0132).nvdla_prot" + "otest_interface.SDPSurfaceDescH\000\022@\n\013pdp_" + "surface\030\004 \001(\0132).nvdla_prototest_interfac" + "e.PDPSurfaceDescH\000\022@\n\013cdp_surface\030\005 \001(\0132" + ").nvdla_prototest_interface.CDPSurfaceDe" + "scH\000\022D\n\rrubik_surface\030\006 \001(\0132+.nvdla_prot" + "otest_interface.RUBIKSurfaceDescH\000B\031\n\027su" + "rface_container_oneof\"\202\003\n\022OperationConta" + "iner\0228\n\007bdma_op\030\001 \001(\0132%.nvdla_prototest_" + "interface.BDMAOpDescH\000\0228\n\007conv_op\030\002 \001(\0132" + "%.nvdla_prototest_interface.CONVOpDescH\000" + "\0226\n\006sdp_op\030\003 \001(\0132$.nvdla_prototest_inter" + "face.SDPOpDescH\000\0226\n\006pdp_op\030\004 \001(\0132$.nvdla" + "_prototest_interface.PDPOpDescH\000\0226\n\006cdp_" + "op\030\005 \001(\0132$.nvdla_prototest_interface.CDP" + "OpDescH\000\022:\n\010rubik_op\030\006 \001(\0132&.nvdla_proto" + "test_interface.RUBIKOpDescH\000B\024\n\022op_conta" + "iner_oneof\"\361\001\n\010Consumer\022\r\n\005index\030\001 \002(\005\0222" + "\n\004type\030\002 \002(\0162$.nvdla_prototest_interface" + ".LayerType\022<\n\005event\030\003 \002(\0162-.nvdla_protot" + "est_interface.Consumer.EventType\"d\n\tEven" + "tType\022\020\n\014OP_COMPLETED\020\001\022\021\n\rOP_PROGRAMMED" + "\020\002\022\016\n\nOP_ENABLED\020\003\022\020\n\014CDMA_WT_DONE\020\004\022\020\n\014" + "CDMA_DT_DONE\020\005\"\366\002\n\005Layer\022\r\n\005index\030\001 \002(\005\022" + "\021\n\troi_index\030\002 \002(\005\0222\n\004type\030\003 \002(\0162$.nvdla" + "_prototest_interface.LayerType\022\030\n\020depend" + "ency_count\030\004 \002(\r\022\024\n\010reserved\030\005 \003(\rB\002\020\001\0223" + "\n\006bottom\030\006 \003(\0132#.nvdla_prototest_interfa" + "ce.Consumer\0222\n\005fused\030\007 \001(\0132#.nvdla_proto" + "test_interface.Consumer\022@\n\top_config\030\010 \002" + "(\0132-.nvdla_prototest_interface.Operation" + "Container\022<\n\007surface\030\t \002(\0132+.nvdla_proto" + "test_interface.SurfaceContainer\"\?\n\014Netwo" + "rkLayer\022/\n\005layer\030\001 \003(\0132 .nvdla_prototest" + "_interface.Layer\"\213\003\n\013NetworkDesc\022\034\n\024oper" + "ation_desc_index\030\001 \002(\005\022\032\n\022surface_desc_i" + "ndex\030\002 \002(\005\022\036\n\026dependency_graph_index\030\003 \002" + "(\005\022\026\n\016lut_data_index\030\004 \002(\005\022\027\n\017roi_array_" + "index\030\005 \002(\005\022\025\n\rsurface_index\030\006 \002(\005\022\033\n\017st" + "at_list_index\030\007 \001(\005:\002-1\022\025\n\treserved1\030\010 \001" + "(\005:\002-1\022\023\n\007op_head\030\t \003(\005B\002\020\001\022\020\n\010num_rois\030" + "\n \002(\r\022\026\n\016num_operations\030\013 \002(\r\022\020\n\010num_lut" + "s\030\014 \002(\r\022\025\n\rnum_addresses\030\r \002(\r\022\023\n\013input_" + "layer\030\016 \002(\005\022\023\n\013dynamic_roi\030\017 \002(\r\022\024\n\trese" + "rved0\030\020 \001(\r:\0010\"F\n\014LUTParamList\0226\n\tlut_pa" + "ram\030\001 \003(\0132#.nvdla_prototest_interface.LU" + "TParam\"<\n\014ROIArrayDesc\022\024\n\014array_length\030\001" + " \002(\r\022\026\n\016array_reserved\030\002 \002(\r\"C\n\007ROIDesc\022" + "\014\n\004left\030\001 \002(\r\022\013\n\003top\030\002 \002(\r\022\r\n\005right\030\003 \002(" + "\r\022\016\n\006bottom\030\004 \002(\r\"\200\001\n\016ROIDescription\0228\n\007" + "roi_arr\030\001 \002(\0132\'.nvdla_prototest_interfac" + "e.ROIArrayDesc\0224\n\010roi_desc\030\002 \003(\0132\".nvdla" + "_prototest_interface.ROIDesc\"\361\001\n\007Network" + "\0225\n\005param\030\001 \002(\0132&.nvdla_prototest_interf" + "ace.NetworkDesc\0227\n\006layers\030\002 \002(\0132\'.nvdla_" + "prototest_interface.NetworkLayer\0229\n\010lut_" + "list\030\003 \002(\0132\'.nvdla_prototest_interface.L" + "UTParamList\022;\n\010roi_list\030\004 \002(\0132).nvdla_pr" + "ototest_interface.ROIDescription\"]\n\nTask" + "Status\022\021\n\ttimestamp\030\001 \002(\004\022\025\n\rstatus_engi" + "ne\030\002 \002(\r\022\020\n\010subframe\030\003 \002(\r\022\023\n\013status_tas" + "k\030\004 \002(\r\"\036\n\006Action\022\024\n\010event_id\030\001 \003(\rB\002\020\001\"" + "\177\n\014TaskSchedule\0226\n\013pre_actions\030\001 \001(\0132!.n" + "vdla_prototest_interface.Action\0227\n\014post_" + "actions\030\002 \001(\0132!.nvdla_prototest_interfac" + "e.Action\"\272\002\n\tTasksData\022\017\n\007task_id\030\001 \001(\r\022" + "6\n\tengine_id\030\002 \002(\0162#.nvdla_prototest_int" + "erface.EngineID\0223\n\007network\030\003 \002(\0132\".nvdla" + "_prototest_interface.Network\0229\n\010schedule" + "\030\004 \001(\0132\'.nvdla_prototest_interface.TaskS" + "chedule\022:\n\013task_status\030\005 \001(\0132%.nvdla_pro" + "totest_interface.TaskStatus\022 \n\014task_time" + "out\030\006 \001(\r:\n4294967295\022\026\n\013task_result\030\007 \001" + "(\005:\0010\"\332\001\n\005Event\022\020\n\010event_id\030\001 \002(\r\022>\n\neve" + "nt_type\030\002 \002(\0162*.nvdla_prototest_interfac" + "e.Event.EventType\022\023\n\013event_flags\030\003 \002(\r\022!" + "\n\revent_timeout\030\004 \001(\r:\n4294967295\"G\n\tEve" + "ntType\022\r\n\tSYNCPOINT\020\000\022\n\n\006SYNCFD\020\001\022\r\n\tSEM" + "APHORE\020\002\022\020\n\014TS_SEMAPHORE\020\003\"<\n\tEventList\022" + "/\n\005event\030\001 \003(\0132 .nvdla_prototest_interfa" + "ce.Event\"\035\n\nSubmitSlot\022\017\n\007task_id\030\001 \003(\r\"" + "\326\001\n\010TestInfo\022\021\n\tnum_tasks\030\001 \002(\r\022\023\n\013num_b" + "uffers\030\002 \002(\r\0222\n\004task\030\003 \003(\0132$.nvdla_proto" + "test_interface.TasksData\0228\n\nevent_list\030\004" + " \001(\0132$.nvdla_prototest_interface.EventLi" + "st\0224\n\005slots\030\005 \003(\0132%.nvdla_prototest_inte" + "rface.SubmitSlot\"9\n\004Test\0221\n\004test\030\001 \002(\0132#" + ".nvdla_prototest_interface.TestInfo*L\n\rD" + "ataPrecision\022\022\n\016PRECISION_INT8\020\000\022\023\n\017PREC" + "ISION_INT16\020\001\022\022\n\016PRECISION_FP16\020\002*9\n\007Mem" + "Type\022\016\n\nDLA_MEM_MC\020\000\022\016\n\nDLA_MEM_CV\020\001\022\016\n\n" + "DLA_MEM_HW\020\002*g\n\007MemFlag\022\021\n\rDLA_MEM_ALLOC" + "\020\000\022\017\n\013DLA_MEM_SET\020\001\022\021\n\rDLA_MEM_INPUT\020\002\022\022" + "\n\016DLA_MEM_OUTPUT\020\003\022\021\n\rDLA_MEM_DEBUG\020\004* \n" + "\010EngineID\022\t\n\005DLA_0\020\000\022\t\n\005DLA_1\020\001*o\n\tLayer" + "Type\022\017\n\013DLA_OP_BDMA\020\000\022\017\n\013DLA_OP_CONV\020\001\022\016" + "\n\nDLA_OP_SDP\020\002\022\016\n\nDLA_OP_PDP\020\003\022\016\n\nDLA_OP" + "_CDP\020\004\022\020\n\014DLA_OP_RUBIK\020\005*=\n\007ALUType\022\013\n\007A" + "LU_MAX\020\000\022\013\n\007ALU_MIN\020\001\022\013\n\007ALU_SUM\020\002\022\013\n\007AL" + "U_EQL\020\003*M\n\tSDPOpType\022\017\n\013SDP_OP_NONE\020\000\022\016\n" + "\nSDP_OP_MUL\020\001\022\016\n\nSDP_OP_ADD\020\002\022\017\n\013SDP_OP_" + "BOTH\020\003*C\n\nLUTLOGSize\022\030\n\024EXP_TABLE_ENTRY_" + "LOG2\020\006\022\033\n\027LINEAR_TABLE_ENTRY_LOG2\020\010*+\n\010L" + "UTTable\022\r\n\tEXP_TABLE\020\000\022\020\n\014LINEAR_TABLE\020\001" + "*6\n\tLUTMethod\022\026\n\022METHOD_EXPONENTIAL\020\000\022\021\n" + "\rMETHOD_LINEAR\020\001*2\n\013LUTPriority\022\023\n\017PRI_E" + "XPONENTIAL\020\000\022\016\n\nPRI_LINEAR\020\001*$\n\010ConvMode" + "\022\n\n\006DIRECT\020\000\022\014\n\010WINOGRAD\020\001*2\n\014ConvPixelM" + "AP\022\020\n\014PITCH_LINEAR\020\000\022\020\n\014BLOCK_LINEAR\020\001*4" + "\n\rPixelOverride\022\021\n\rOVERRIDE_UINT\020\000\022\020\n\014OV" + "ERRIDE_INT\020\001*j\n\010PoolSize\022\n\n\006SIZE_1\020\000\022\n\n\006" + "SIZE_2\020\001\022\n\n\006SIZE_3\020\002\022\n\n\006SIZE_4\020\003\022\n\n\006SIZE" + "_5\020\004\022\n\n\006SIZE_6\020\005\022\n\n\006SIZE_7\020\006\022\n\n\006SIZE_8\020\007" + "*>\n\tRUBIKMode\022\021\n\rMODE_CONTRACT\020\000\022\016\n\nMODE" + "_SPLIT\020\001\022\016\n\nMODE_MERGE\020\002*0\n\014WeightFormat" + "\022\020\n\014UNCOMPRESSED\020\000\022\016\n\nCOMPRESSED\020\001*/\n\nMe" + "anFormat\022\020\n\014MEAN_DISABLE\020\000\022\017\n\013MEAN_ENABL" + "E\020\001*G\n\rSDPActivation\022\014\n\010ACT_NONE\020\000\022\014\n\010AC" + "T_RELU\020\001\022\013\n\007ACT_LUT\020\002\022\r\n\tACT_PRELU\020\003*\261\007\n" + "\nDataFormat\022\017\n\013FORMAT_T_R8\020\000\022\020\n\014FORMAT_T" + "_R10\020\001\022\020\n\014FORMAT_T_R12\020\002\022\020\n\014FORMAT_T_R16" + "\020\003\022\022\n\016FORMAT_T_R16_I\020\004\022\022\n\016FORMAT_T_R16_F" + "\020\005\022\031\n\025FORMAT_T_A16B16G16R16\020\006\022\031\n\025FORMAT_" + "T_X16B16G16R16\020\007\022\033\n\027FORMAT_T_A16B16G16R1" + "6_F\020\010\022\031\n\025FORMAT_T_A16Y16U16V16\020\t\022\031\n\025FORM" + "AT_T_V16U16Y16A16\020\n\022\033\n\027FORMAT_T_A16Y16U1" + "6V16_F\020\013\022\025\n\021FORMAT_T_A8B8G8R8\020\014\022\025\n\021FORMA" + "T_T_A8R8G8B8\020\r\022\025\n\021FORMAT_T_B8G8R8A8\020\016\022\025\n" + "\021FORMAT_T_R8G8B8A8\020\017\022\025\n\021FORMAT_T_X8B8G8R" + "8\020\020\022\025\n\021FORMAT_T_X8R8G8B8\020\021\022\025\n\021FORMAT_T_B" + "8G8R8X8\020\022\022\025\n\021FORMAT_T_R8G8B8X8\020\023\022\030\n\024FORM" + "AT_T_A2B10G10R10\020\024\022\030\n\024FORMAT_T_A2R10G10B" + "10\020\025\022\030\n\024FORMAT_T_B10G10R10A2\020\026\022\030\n\024FORMAT" + "_T_R10G10B10A2\020\027\022\030\n\024FORMAT_T_A2Y10U10V10" + "\020\030\022\030\n\024FORMAT_T_V10U10Y10A2\020\031\022\025\n\021FORMAT_T" + "_A8Y8U8V8\020\032\022\025\n\021FORMAT_T_V8U8Y8A8\020\033\022\033\n\027FO" + "RMAT_T_Y8___U8V8_N444\020\034\022\033\n\027FORMAT_T_Y8__" + "_V8U8_N444\020\035\022\036\n\032FORMAT_T_Y10___U10V10_N4" + "44\020\036\022\036\n\032FORMAT_T_Y10___V10U10_N444\020\037\022\036\n\032" + "FORMAT_T_Y12___U12V12_N444\020 \022\036\n\032FORMAT_T" + "_Y12___V12U12_N444\020!\022\036\n\032FORMAT_T_Y16___U" + "16V16_N444\020\"\022\036\n\032FORMAT_T_Y16___V16U16_N4" + "44\020#\022\022\n\016FORMAT_FEATURE\020$*N\n\nFillerType\022\r" + "\n\tFILL_NONE\020\000\022\r\n\tFILL_FILE\020\001\022\021\n\rFILL_CON" + "STANT\020\002\022\017\n\013FILL_RANDOM\020\003*^\n\010FileType\022\021\n\r" + "FILE_PROTOBIN\020\000\022\021\n\rFILE_PROTOTXT\020\001\022\017\n\013FI" + "LE_RAWBIN\020\002\022\014\n\010FILE_PNG\020\003\022\r\n\tFILE_JPEG\020\004" + "*\272\001\n\010DataType\022\026\n\022DLA_DATA_DC_WEIGHT\020\000\022\026\n" + "\022DLA_DATA_WG_WEIGHT\020\001\022\027\n\023DLA_DATA_IMG_WE" + "IGHT\020\002\022\026\n\022DLA_DATA_FC_WEIGHT\020\003\022\021\n\rDLA_DA" + "TA_BIAS\020\004\022\022\n\016DLA_DATA_IMAGE\020\005\022\020\n\014DLA_DAT" + "A_LUT\020\006\022\024\n\020DLA_DATA_FEATURE\020\007", 14069); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "DlaPrototestInterface.proto", &protobuf_RegisterTypes); + LUTOffset::default_instance_ = new LUTOffset(); + LUTOffset_default_oneof_instance_ = new LUTOffsetOneofInstance; + FloatData::default_instance_ = new FloatData(); + DLASlope::default_instance_ = new DLASlope(); + DLASlope_default_oneof_instance_ = new DLASlopeOneofInstance; + DataFile::default_instance_ = new DataFile(); + Constant::default_instance_ = new Constant(); + DataFiller::default_instance_ = new DataFiller(); + DataFiller_default_oneof_instance_ = new DataFillerOneofInstance; + LUTParam::default_instance_ = new LUTParam(); + BDMATransferDesc::default_instance_ = new BDMATransferDesc(); + BDMASurfaceDesc::default_instance_ = new BDMASurfaceDesc(); + BDMAOpDesc::default_instance_ = new BDMAOpDesc(); + CVTParam::default_instance_ = new CVTParam(); + MemInfo::default_instance_ = new MemInfo(); + DataCube::default_instance_ = new DataCube(); + CONVSurfaceDesc::default_instance_ = new CONVSurfaceDesc(); + CONVOpDesc::default_instance_ = new CONVOpDesc(); + SDPCvt::default_instance_ = new SDPCvt(); + SDPOp::default_instance_ = new SDPOp(); + SDPSurfaceDesc::default_instance_ = new SDPSurfaceDesc(); + SDPOpDesc::default_instance_ = new SDPOpDesc(); + PDPSurfaceDesc::default_instance_ = new PDPSurfaceDesc(); + PDPOpDesc::default_instance_ = new PDPOpDesc(); + CDPSurfaceDesc::default_instance_ = new CDPSurfaceDesc(); + CDPOpDesc::default_instance_ = new CDPOpDesc(); + RUBIKSurfaceDesc::default_instance_ = new RUBIKSurfaceDesc(); + RUBIKOpDesc::default_instance_ = new RUBIKOpDesc(); + SurfaceContainer::default_instance_ = new SurfaceContainer(); + SurfaceContainer_default_oneof_instance_ = new SurfaceContainerOneofInstance; + OperationContainer::default_instance_ = new OperationContainer(); + OperationContainer_default_oneof_instance_ = new OperationContainerOneofInstance; + Consumer::default_instance_ = new Consumer(); + Layer::default_instance_ = new Layer(); + NetworkLayer::default_instance_ = new NetworkLayer(); + NetworkDesc::default_instance_ = new NetworkDesc(); + LUTParamList::default_instance_ = new LUTParamList(); + ROIArrayDesc::default_instance_ = new ROIArrayDesc(); + ROIDesc::default_instance_ = new ROIDesc(); + ROIDescription::default_instance_ = new ROIDescription(); + Network::default_instance_ = new Network(); + TaskStatus::default_instance_ = new TaskStatus(); + Action::default_instance_ = new Action(); + TaskSchedule::default_instance_ = new TaskSchedule(); + TasksData::default_instance_ = new TasksData(); + Event::default_instance_ = new Event(); + EventList::default_instance_ = new EventList(); + SubmitSlot::default_instance_ = new SubmitSlot(); + TestInfo::default_instance_ = new TestInfo(); + Test::default_instance_ = new Test(); + LUTOffset::default_instance_->InitAsDefaultInstance(); + FloatData::default_instance_->InitAsDefaultInstance(); + DLASlope::default_instance_->InitAsDefaultInstance(); + DataFile::default_instance_->InitAsDefaultInstance(); + Constant::default_instance_->InitAsDefaultInstance(); + DataFiller::default_instance_->InitAsDefaultInstance(); + LUTParam::default_instance_->InitAsDefaultInstance(); + BDMATransferDesc::default_instance_->InitAsDefaultInstance(); + BDMASurfaceDesc::default_instance_->InitAsDefaultInstance(); + BDMAOpDesc::default_instance_->InitAsDefaultInstance(); + CVTParam::default_instance_->InitAsDefaultInstance(); + MemInfo::default_instance_->InitAsDefaultInstance(); + DataCube::default_instance_->InitAsDefaultInstance(); + CONVSurfaceDesc::default_instance_->InitAsDefaultInstance(); + CONVOpDesc::default_instance_->InitAsDefaultInstance(); + SDPCvt::default_instance_->InitAsDefaultInstance(); + SDPOp::default_instance_->InitAsDefaultInstance(); + SDPSurfaceDesc::default_instance_->InitAsDefaultInstance(); + SDPOpDesc::default_instance_->InitAsDefaultInstance(); + PDPSurfaceDesc::default_instance_->InitAsDefaultInstance(); + PDPOpDesc::default_instance_->InitAsDefaultInstance(); + CDPSurfaceDesc::default_instance_->InitAsDefaultInstance(); + CDPOpDesc::default_instance_->InitAsDefaultInstance(); + RUBIKSurfaceDesc::default_instance_->InitAsDefaultInstance(); + RUBIKOpDesc::default_instance_->InitAsDefaultInstance(); + SurfaceContainer::default_instance_->InitAsDefaultInstance(); + OperationContainer::default_instance_->InitAsDefaultInstance(); + Consumer::default_instance_->InitAsDefaultInstance(); + Layer::default_instance_->InitAsDefaultInstance(); + NetworkLayer::default_instance_->InitAsDefaultInstance(); + NetworkDesc::default_instance_->InitAsDefaultInstance(); + LUTParamList::default_instance_->InitAsDefaultInstance(); + ROIArrayDesc::default_instance_->InitAsDefaultInstance(); + ROIDesc::default_instance_->InitAsDefaultInstance(); + ROIDescription::default_instance_->InitAsDefaultInstance(); + Network::default_instance_->InitAsDefaultInstance(); + TaskStatus::default_instance_->InitAsDefaultInstance(); + Action::default_instance_->InitAsDefaultInstance(); + TaskSchedule::default_instance_->InitAsDefaultInstance(); + TasksData::default_instance_->InitAsDefaultInstance(); + Event::default_instance_->InitAsDefaultInstance(); + EventList::default_instance_->InitAsDefaultInstance(); + SubmitSlot::default_instance_->InitAsDefaultInstance(); + TestInfo::default_instance_->InitAsDefaultInstance(); + Test::default_instance_->InitAsDefaultInstance(); + ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_DlaPrototestInterface_2eproto); +} + +// Force AddDescriptors() to be called at static initialization time. +struct StaticDescriptorInitializer_DlaPrototestInterface_2eproto { + StaticDescriptorInitializer_DlaPrototestInterface_2eproto() { + protobuf_AddDesc_DlaPrototestInterface_2eproto(); + } +} static_descriptor_initializer_DlaPrototestInterface_2eproto_; +const ::google::protobuf::EnumDescriptor* DataPrecision_descriptor() { + protobuf_AssignDescriptorsOnce(); + return DataPrecision_descriptor_; +} +bool DataPrecision_IsValid(int value) { + switch(value) { + case 0: + case 1: + case 2: + return true; + default: + return false; + } +} + +const ::google::protobuf::EnumDescriptor* MemType_descriptor() { + protobuf_AssignDescriptorsOnce(); + return MemType_descriptor_; +} +bool MemType_IsValid(int value) { + switch(value) { + case 0: + case 1: + case 2: + return true; + default: + return false; + } +} + +const ::google::protobuf::EnumDescriptor* MemFlag_descriptor() { + protobuf_AssignDescriptorsOnce(); + return MemFlag_descriptor_; +} +bool MemFlag_IsValid(int value) { + switch(value) { + case 0: + case 1: + case 2: + case 3: + case 4: + return true; + default: + return false; + } +} + +const ::google::protobuf::EnumDescriptor* EngineID_descriptor() { + protobuf_AssignDescriptorsOnce(); + return EngineID_descriptor_; +} +bool EngineID_IsValid(int value) { + switch(value) { + case 0: + case 1: + return true; + default: + return false; + } +} + +const ::google::protobuf::EnumDescriptor* LayerType_descriptor() { + protobuf_AssignDescriptorsOnce(); + return LayerType_descriptor_; +} +bool LayerType_IsValid(int value) { + switch(value) { + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + return true; + default: + return false; + } +} + +const ::google::protobuf::EnumDescriptor* ALUType_descriptor() { + protobuf_AssignDescriptorsOnce(); + return ALUType_descriptor_; +} +bool ALUType_IsValid(int value) { + switch(value) { + case 0: + case 1: + case 2: + case 3: + return true; + default: + return false; + } +} + +const ::google::protobuf::EnumDescriptor* SDPOpType_descriptor() { + protobuf_AssignDescriptorsOnce(); + return SDPOpType_descriptor_; +} +bool SDPOpType_IsValid(int value) { + switch(value) { + case 0: + case 1: + case 2: + case 3: + return true; + default: + return false; + } +} + +const ::google::protobuf::EnumDescriptor* LUTLOGSize_descriptor() { + protobuf_AssignDescriptorsOnce(); + return LUTLOGSize_descriptor_; +} +bool LUTLOGSize_IsValid(int value) { + switch(value) { + case 6: + case 8: + return true; + default: + return false; + } +} + +const ::google::protobuf::EnumDescriptor* LUTTable_descriptor() { + protobuf_AssignDescriptorsOnce(); + return LUTTable_descriptor_; +} +bool LUTTable_IsValid(int value) { + switch(value) { + case 0: + case 1: + return true; + default: + return false; + } +} + +const ::google::protobuf::EnumDescriptor* LUTMethod_descriptor() { + protobuf_AssignDescriptorsOnce(); + return LUTMethod_descriptor_; +} +bool LUTMethod_IsValid(int value) { + switch(value) { + case 0: + case 1: + return true; + default: + return false; + } +} + +const ::google::protobuf::EnumDescriptor* LUTPriority_descriptor() { + protobuf_AssignDescriptorsOnce(); + return LUTPriority_descriptor_; +} +bool LUTPriority_IsValid(int value) { + switch(value) { + case 0: + case 1: + return true; + default: + return false; + } +} + +const ::google::protobuf::EnumDescriptor* ConvMode_descriptor() { + protobuf_AssignDescriptorsOnce(); + return ConvMode_descriptor_; +} +bool ConvMode_IsValid(int value) { + switch(value) { + case 0: + case 1: + return true; + default: + return false; + } +} + +const ::google::protobuf::EnumDescriptor* ConvPixelMAP_descriptor() { + protobuf_AssignDescriptorsOnce(); + return ConvPixelMAP_descriptor_; +} +bool ConvPixelMAP_IsValid(int value) { + switch(value) { + case 0: + case 1: + return true; + default: + return false; + } +} + +const ::google::protobuf::EnumDescriptor* PixelOverride_descriptor() { + protobuf_AssignDescriptorsOnce(); + return PixelOverride_descriptor_; +} +bool PixelOverride_IsValid(int value) { + switch(value) { + case 0: + case 1: + return true; + default: + return false; + } +} + +const ::google::protobuf::EnumDescriptor* PoolSize_descriptor() { + protobuf_AssignDescriptorsOnce(); + return PoolSize_descriptor_; +} +bool PoolSize_IsValid(int value) { + switch(value) { + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + return true; + default: + return false; + } +} + +const ::google::protobuf::EnumDescriptor* RUBIKMode_descriptor() { + protobuf_AssignDescriptorsOnce(); + return RUBIKMode_descriptor_; +} +bool RUBIKMode_IsValid(int value) { + switch(value) { + case 0: + case 1: + case 2: + return true; + default: + return false; + } +} + +const ::google::protobuf::EnumDescriptor* WeightFormat_descriptor() { + protobuf_AssignDescriptorsOnce(); + return WeightFormat_descriptor_; +} +bool WeightFormat_IsValid(int value) { + switch(value) { + case 0: + case 1: + return true; + default: + return false; + } +} + +const ::google::protobuf::EnumDescriptor* MeanFormat_descriptor() { + protobuf_AssignDescriptorsOnce(); + return MeanFormat_descriptor_; +} +bool MeanFormat_IsValid(int value) { + switch(value) { + case 0: + case 1: + return true; + default: + return false; + } +} + +const ::google::protobuf::EnumDescriptor* SDPActivation_descriptor() { + protobuf_AssignDescriptorsOnce(); + return SDPActivation_descriptor_; +} +bool SDPActivation_IsValid(int value) { + switch(value) { + case 0: + case 1: + case 2: + case 3: + return true; + default: + return false; + } +} + +const ::google::protobuf::EnumDescriptor* DataFormat_descriptor() { + protobuf_AssignDescriptorsOnce(); + return DataFormat_descriptor_; +} +bool DataFormat_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: + return true; + default: + return false; + } +} + +const ::google::protobuf::EnumDescriptor* FillerType_descriptor() { + protobuf_AssignDescriptorsOnce(); + return FillerType_descriptor_; +} +bool FillerType_IsValid(int value) { + switch(value) { + case 0: + case 1: + case 2: + case 3: + return true; + default: + return false; + } +} + +const ::google::protobuf::EnumDescriptor* FileType_descriptor() { + protobuf_AssignDescriptorsOnce(); + return FileType_descriptor_; +} +bool FileType_IsValid(int value) { + switch(value) { + case 0: + case 1: + case 2: + case 3: + case 4: + return true; + default: + return false; + } +} + +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: + return true; + default: + return false; + } +} + + +// =================================================================== + +#ifndef _MSC_VER +const int LUTOffset::kExpOffsetFieldNumber; +const int LUTOffset::kFracBitsFieldNumber; +#endif // !_MSC_VER + +LUTOffset::LUTOffset() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:nvdla_prototest_interface.LUTOffset) +} + +void LUTOffset::InitAsDefaultInstance() { + LUTOffset_default_oneof_instance_->exp_offset_ = 0; + LUTOffset_default_oneof_instance_->frac_bits_ = 0; +} + +LUTOffset::LUTOffset(const LUTOffset& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:nvdla_prototest_interface.LUTOffset) +} + +void LUTOffset::SharedCtor() { + _cached_size_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + clear_has_lut_offset_oneof(); +} + +LUTOffset::~LUTOffset() { + // @@protoc_insertion_point(destructor:nvdla_prototest_interface.LUTOffset) + SharedDtor(); +} + +void LUTOffset::SharedDtor() { + if (has_lut_offset_oneof()) { + clear_lut_offset_oneof(); + } + if (this != default_instance_) { + } +} + +void LUTOffset::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* LUTOffset::descriptor() { + protobuf_AssignDescriptorsOnce(); + return LUTOffset_descriptor_; +} + +const LUTOffset& LUTOffset::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_DlaPrototestInterface_2eproto(); + return *default_instance_; +} + +LUTOffset* LUTOffset::default_instance_ = NULL; + +LUTOffset* LUTOffset::New() const { + return new LUTOffset; +} + +void LUTOffset::clear_lut_offset_oneof() { + switch(lut_offset_oneof_case()) { + case kExpOffset: { + // No need to clear + break; + } + case kFracBits: { + // No need to clear + break; + } + case LUT_OFFSET_ONEOF_NOT_SET: { + break; + } + } + _oneof_case_[0] = LUT_OFFSET_ONEOF_NOT_SET; +} + + +void LUTOffset::Clear() { + clear_lut_offset_oneof(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool LUTOffset::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:nvdla_prototest_interface.LUTOffset) + 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 exp_offset = 1; + case 1: { + if (tag == 8) { + clear_lut_offset_oneof(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &lut_offset_oneof_.exp_offset_))); + set_has_exp_offset(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_frac_bits; + break; + } + + // optional int32 frac_bits = 2; + case 2: { + if (tag == 16) { + parse_frac_bits: + clear_lut_offset_oneof(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &lut_offset_oneof_.frac_bits_))); + set_has_frac_bits(); + } 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:nvdla_prototest_interface.LUTOffset) + return true; +failure: + // @@protoc_insertion_point(parse_failure:nvdla_prototest_interface.LUTOffset) + return false; +#undef DO_ +} + +void LUTOffset::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:nvdla_prototest_interface.LUTOffset) + // optional int32 exp_offset = 1; + if (has_exp_offset()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->exp_offset(), output); + } + + // optional int32 frac_bits = 2; + if (has_frac_bits()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->frac_bits(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:nvdla_prototest_interface.LUTOffset) +} + +::google::protobuf::uint8* LUTOffset::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:nvdla_prototest_interface.LUTOffset) + // optional int32 exp_offset = 1; + if (has_exp_offset()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->exp_offset(), target); + } + + // optional int32 frac_bits = 2; + if (has_frac_bits()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->frac_bits(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:nvdla_prototest_interface.LUTOffset) + return target; +} + +int LUTOffset::ByteSize() const { + int total_size = 0; + + switch (lut_offset_oneof_case()) { + // optional int32 exp_offset = 1; + case kExpOffset: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->exp_offset()); + break; + } + // optional int32 frac_bits = 2; + case kFracBits: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->frac_bits()); + break; + } + case LUT_OFFSET_ONEOF_NOT_SET: { + break; + } + } + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void LUTOffset::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const LUTOffset* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void LUTOffset::MergeFrom(const LUTOffset& from) { + GOOGLE_CHECK_NE(&from, this); + switch (from.lut_offset_oneof_case()) { + case kExpOffset: { + set_exp_offset(from.exp_offset()); + break; + } + case kFracBits: { + set_frac_bits(from.frac_bits()); + break; + } + case LUT_OFFSET_ONEOF_NOT_SET: { + break; + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void LUTOffset::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void LUTOffset::CopyFrom(const LUTOffset& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool LUTOffset::IsInitialized() const { + + return true; +} + +void LUTOffset::Swap(LUTOffset* other) { + if (other != this) { + std::swap(lut_offset_oneof_, other->lut_offset_oneof_); + std::swap(_oneof_case_[0], other->_oneof_case_[0]); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::google::protobuf::Metadata LUTOffset::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = LUTOffset_descriptor_; + metadata.reflection = LUTOffset_reflection_; + return metadata; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int FloatData::kScaleFieldNumber; +const int FloatData::kShifterFieldNumber; +const int FloatData::kReserved0FieldNumber; +#endif // !_MSC_VER + +FloatData::FloatData() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:nvdla_prototest_interface.FloatData) +} + +void FloatData::InitAsDefaultInstance() { +} + +FloatData::FloatData(const FloatData& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:nvdla_prototest_interface.FloatData) +} + +void FloatData::SharedCtor() { + _cached_size_ = 0; + scale_ = 0; + shifter_ = 0; + reserved0_ = 0u; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +FloatData::~FloatData() { + // @@protoc_insertion_point(destructor:nvdla_prototest_interface.FloatData) + SharedDtor(); +} + +void FloatData::SharedDtor() { + if (this != default_instance_) { + } +} + +void FloatData::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* FloatData::descriptor() { + protobuf_AssignDescriptorsOnce(); + return FloatData_descriptor_; +} + +const FloatData& FloatData::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_DlaPrototestInterface_2eproto(); + return *default_instance_; +} + +FloatData* FloatData::default_instance_ = NULL; + +FloatData* FloatData::New() const { + return new FloatData; +} + +void FloatData::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + ZR_(scale_, reserved0_); + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool FloatData::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:nvdla_prototest_interface.FloatData) + 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)) { + // required int32 scale = 1; + case 1: { + if (tag == 8) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &scale_))); + set_has_scale(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_shifter; + break; + } + + // required int32 shifter = 2; + case 2: { + if (tag == 16) { + parse_shifter: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &shifter_))); + set_has_shifter(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(24)) goto parse_reserved0; + break; + } + + // optional uint32 reserved0 = 3 [default = 0]; + case 3: { + if (tag == 24) { + parse_reserved0: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &reserved0_))); + set_has_reserved0(); + } 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:nvdla_prototest_interface.FloatData) + return true; +failure: + // @@protoc_insertion_point(parse_failure:nvdla_prototest_interface.FloatData) + return false; +#undef DO_ +} + +void FloatData::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:nvdla_prototest_interface.FloatData) + // required int32 scale = 1; + if (has_scale()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->scale(), output); + } + + // required int32 shifter = 2; + if (has_shifter()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->shifter(), output); + } + + // optional uint32 reserved0 = 3 [default = 0]; + if (has_reserved0()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->reserved0(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:nvdla_prototest_interface.FloatData) +} + +::google::protobuf::uint8* FloatData::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:nvdla_prototest_interface.FloatData) + // required int32 scale = 1; + if (has_scale()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->scale(), target); + } + + // required int32 shifter = 2; + if (has_shifter()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->shifter(), target); + } + + // optional uint32 reserved0 = 3 [default = 0]; + if (has_reserved0()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->reserved0(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:nvdla_prototest_interface.FloatData) + return target; +} + +int FloatData::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // required int32 scale = 1; + if (has_scale()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->scale()); + } + + // required int32 shifter = 2; + if (has_shifter()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->shifter()); + } + + // optional uint32 reserved0 = 3 [default = 0]; + if (has_reserved0()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->reserved0()); + } + + } + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void FloatData::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const FloatData* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void FloatData::MergeFrom(const FloatData& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_scale()) { + set_scale(from.scale()); + } + if (from.has_shifter()) { + set_shifter(from.shifter()); + } + if (from.has_reserved0()) { + set_reserved0(from.reserved0()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void FloatData::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void FloatData::CopyFrom(const FloatData& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool FloatData::IsInitialized() const { + if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false; + + return true; +} + +void FloatData::Swap(FloatData* other) { + if (other != this) { + std::swap(scale_, other->scale_); + std::swap(shifter_, other->shifter_); + std::swap(reserved0_, other->reserved0_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::google::protobuf::Metadata FloatData::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = FloatData_descriptor_; + metadata.reflection = FloatData_reflection_; + return metadata; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int DLASlope::kDataIFieldNumber; +const int DLASlope::kDataFFieldNumber; +#endif // !_MSC_VER + +DLASlope::DLASlope() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:nvdla_prototest_interface.DLASlope) +} + +void DLASlope::InitAsDefaultInstance() { + DLASlope_default_oneof_instance_->data_i_ = const_cast< ::nvdla_prototest_interface::FloatData*>(&::nvdla_prototest_interface::FloatData::default_instance()); + DLASlope_default_oneof_instance_->data_f_ = 0u; +} + +DLASlope::DLASlope(const DLASlope& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:nvdla_prototest_interface.DLASlope) +} + +void DLASlope::SharedCtor() { + _cached_size_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + clear_has_dla_slope_oneof(); +} + +DLASlope::~DLASlope() { + // @@protoc_insertion_point(destructor:nvdla_prototest_interface.DLASlope) + SharedDtor(); +} + +void DLASlope::SharedDtor() { + if (has_dla_slope_oneof()) { + clear_dla_slope_oneof(); + } + if (this != default_instance_) { + } +} + +void DLASlope::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* DLASlope::descriptor() { + protobuf_AssignDescriptorsOnce(); + return DLASlope_descriptor_; +} + +const DLASlope& DLASlope::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_DlaPrototestInterface_2eproto(); + return *default_instance_; +} + +DLASlope* DLASlope::default_instance_ = NULL; + +DLASlope* DLASlope::New() const { + return new DLASlope; +} + +void DLASlope::clear_dla_slope_oneof() { + switch(dla_slope_oneof_case()) { + case kDataI: { + delete dla_slope_oneof_.data_i_; + break; + } + case kDataF: { + // No need to clear + break; + } + case DLA_SLOPE_ONEOF_NOT_SET: { + break; + } + } + _oneof_case_[0] = DLA_SLOPE_ONEOF_NOT_SET; +} + + +void DLASlope::Clear() { + clear_dla_slope_oneof(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool DLASlope::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:nvdla_prototest_interface.DLASlope) + 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 .nvdla_prototest_interface.FloatData data_i = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_data_i())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_data_f; + break; + } + + // optional uint32 data_f = 2; + case 2: { + if (tag == 16) { + parse_data_f: + clear_dla_slope_oneof(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &dla_slope_oneof_.data_f_))); + set_has_data_f(); + } 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:nvdla_prototest_interface.DLASlope) + return true; +failure: + // @@protoc_insertion_point(parse_failure:nvdla_prototest_interface.DLASlope) + return false; +#undef DO_ +} + +void DLASlope::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:nvdla_prototest_interface.DLASlope) + // optional .nvdla_prototest_interface.FloatData data_i = 1; + if (has_data_i()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->data_i(), output); + } + + // optional uint32 data_f = 2; + if (has_data_f()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->data_f(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:nvdla_prototest_interface.DLASlope) +} + +::google::protobuf::uint8* DLASlope::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:nvdla_prototest_interface.DLASlope) + // optional .nvdla_prototest_interface.FloatData data_i = 1; + if (has_data_i()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 1, this->data_i(), target); + } + + // optional uint32 data_f = 2; + if (has_data_f()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->data_f(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:nvdla_prototest_interface.DLASlope) + return target; +} + +int DLASlope::ByteSize() const { + int total_size = 0; + + switch (dla_slope_oneof_case()) { + // optional .nvdla_prototest_interface.FloatData data_i = 1; + case kDataI: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->data_i()); + break; + } + // optional uint32 data_f = 2; + case kDataF: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->data_f()); + break; + } + case DLA_SLOPE_ONEOF_NOT_SET: { + break; + } + } + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void DLASlope::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const DLASlope* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void DLASlope::MergeFrom(const DLASlope& from) { + GOOGLE_CHECK_NE(&from, this); + switch (from.dla_slope_oneof_case()) { + case kDataI: { + mutable_data_i()->::nvdla_prototest_interface::FloatData::MergeFrom(from.data_i()); + break; + } + case kDataF: { + set_data_f(from.data_f()); + break; + } + case DLA_SLOPE_ONEOF_NOT_SET: { + break; + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void DLASlope::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void DLASlope::CopyFrom(const DLASlope& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool DLASlope::IsInitialized() const { + + if (has_data_i()) { + if (!this->data_i().IsInitialized()) return false; + } + return true; +} + +void DLASlope::Swap(DLASlope* other) { + if (other != this) { + std::swap(dla_slope_oneof_, other->dla_slope_oneof_); + std::swap(_oneof_case_[0], other->_oneof_case_[0]); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::google::protobuf::Metadata DLASlope::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = DLASlope_descriptor_; + metadata.reflection = DLASlope_reflection_; + return metadata; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int DataFile::kNameFieldNumber; +const int DataFile::kDataTypeFieldNumber; +const int DataFile::kOffsetFieldNumber; +const int DataFile::kSizeFieldNumber; +const int DataFile::kFileTypeFieldNumber; +#endif // !_MSC_VER + +DataFile::DataFile() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:nvdla_prototest_interface.DataFile) +} + +void DataFile::InitAsDefaultInstance() { +} + +DataFile::DataFile(const DataFile& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:nvdla_prototest_interface.DataFile) +} + +void DataFile::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + data_type_ = 0; + offset_ = 0u; + size_ = 0u; + file_type_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +DataFile::~DataFile() { + // @@protoc_insertion_point(destructor:nvdla_prototest_interface.DataFile) + SharedDtor(); +} + +void DataFile::SharedDtor() { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete name_; + } + if (this != default_instance_) { + } +} + +void DataFile::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* DataFile::descriptor() { + protobuf_AssignDescriptorsOnce(); + return DataFile_descriptor_; +} + +const DataFile& DataFile::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_DlaPrototestInterface_2eproto(); + return *default_instance_; +} + +DataFile* DataFile::default_instance_ = NULL; + +DataFile* DataFile::New() const { + return new DataFile; +} + +void DataFile::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 31) { + ZR_(data_type_, file_type_); + if (has_name()) { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_->clear(); + } + } + } + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool DataFile::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:nvdla_prototest_interface.DataFile) + 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)) { + // required 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, + "name"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_data_type; + break; + } + + // required .nvdla_prototest_interface.DataType data_type = 2; + case 2: { + if (tag == 16) { + parse_data_type: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::nvdla_prototest_interface::DataType_IsValid(value)) { + set_data_type(static_cast< ::nvdla_prototest_interface::DataType >(value)); + } else { + mutable_unknown_fields()->AddVarint(2, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(24)) goto parse_offset; + break; + } + + // required uint32 offset = 3; + case 3: { + if (tag == 24) { + parse_offset: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &offset_))); + set_has_offset(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(32)) goto parse_size; + break; + } + + // required uint32 size = 4; + case 4: { + if (tag == 32) { + parse_size: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &size_))); + set_has_size(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(40)) goto parse_file_type; + break; + } + + // required .nvdla_prototest_interface.FileType file_type = 5; + case 5: { + if (tag == 40) { + parse_file_type: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::nvdla_prototest_interface::FileType_IsValid(value)) { + set_file_type(static_cast< ::nvdla_prototest_interface::FileType >(value)); + } else { + mutable_unknown_fields()->AddVarint(5, 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:nvdla_prototest_interface.DataFile) + return true; +failure: + // @@protoc_insertion_point(parse_failure:nvdla_prototest_interface.DataFile) + return false; +#undef DO_ +} + +void DataFile::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:nvdla_prototest_interface.DataFile) + // required string name = 1; + if (has_name()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // required .nvdla_prototest_interface.DataType data_type = 2; + if (has_data_type()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 2, this->data_type(), output); + } + + // required uint32 offset = 3; + if (has_offset()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->offset(), output); + } + + // required uint32 size = 4; + if (has_size()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(4, this->size(), output); + } + + // required .nvdla_prototest_interface.FileType file_type = 5; + if (has_file_type()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 5, this->file_type(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:nvdla_prototest_interface.DataFile) +} + +::google::protobuf::uint8* DataFile::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:nvdla_prototest_interface.DataFile) + // required string name = 1; + if (has_name()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->name(), target); + } + + // required .nvdla_prototest_interface.DataType data_type = 2; + if (has_data_type()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 2, this->data_type(), target); + } + + // required uint32 offset = 3; + if (has_offset()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->offset(), target); + } + + // required uint32 size = 4; + if (has_size()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(4, this->size(), target); + } + + // required .nvdla_prototest_interface.FileType file_type = 5; + if (has_file_type()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 5, this->file_type(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:nvdla_prototest_interface.DataFile) + return target; +} + +int DataFile::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // required string name = 1; + if (has_name()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } + + // required .nvdla_prototest_interface.DataType data_type = 2; + if (has_data_type()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->data_type()); + } + + // required uint32 offset = 3; + if (has_offset()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->offset()); + } + + // required uint32 size = 4; + if (has_size()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->size()); + } + + // required .nvdla_prototest_interface.FileType file_type = 5; + if (has_file_type()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->file_type()); + } + + } + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void DataFile::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const DataFile* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void DataFile::MergeFrom(const DataFile& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_name()) { + set_name(from.name()); + } + if (from.has_data_type()) { + set_data_type(from.data_type()); + } + if (from.has_offset()) { + set_offset(from.offset()); + } + if (from.has_size()) { + set_size(from.size()); + } + if (from.has_file_type()) { + set_file_type(from.file_type()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void DataFile::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void DataFile::CopyFrom(const DataFile& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool DataFile::IsInitialized() const { + if ((_has_bits_[0] & 0x0000001f) != 0x0000001f) return false; + + return true; +} + +void DataFile::Swap(DataFile* other) { + if (other != this) { + std::swap(name_, other->name_); + std::swap(data_type_, other->data_type_); + std::swap(offset_, other->offset_); + std::swap(size_, other->size_); + std::swap(file_type_, other->file_type_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::google::protobuf::Metadata DataFile::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = DataFile_descriptor_; + metadata.reflection = DataFile_reflection_; + return metadata; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int Constant::kValueFieldNumber; +#endif // !_MSC_VER + +Constant::Constant() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:nvdla_prototest_interface.Constant) +} + +void Constant::InitAsDefaultInstance() { +} + +Constant::Constant(const Constant& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:nvdla_prototest_interface.Constant) +} + +void Constant::SharedCtor() { + _cached_size_ = 0; + value_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +Constant::~Constant() { + // @@protoc_insertion_point(destructor:nvdla_prototest_interface.Constant) + SharedDtor(); +} + +void Constant::SharedDtor() { + if (this != default_instance_) { + } +} + +void Constant::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* Constant::descriptor() { + protobuf_AssignDescriptorsOnce(); + return Constant_descriptor_; +} + +const Constant& Constant::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_DlaPrototestInterface_2eproto(); + return *default_instance_; +} + +Constant* Constant::default_instance_ = NULL; + +Constant* Constant::New() const { + return new Constant; +} + +void Constant::Clear() { + value_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool Constant::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:nvdla_prototest_interface.Constant) + 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)) { + // required int32 value = 1; + case 1: { + if (tag == 8) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &value_))); + set_has_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:nvdla_prototest_interface.Constant) + return true; +failure: + // @@protoc_insertion_point(parse_failure:nvdla_prototest_interface.Constant) + return false; +#undef DO_ +} + +void Constant::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:nvdla_prototest_interface.Constant) + // required int32 value = 1; + if (has_value()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->value(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:nvdla_prototest_interface.Constant) +} + +::google::protobuf::uint8* Constant::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:nvdla_prototest_interface.Constant) + // required int32 value = 1; + if (has_value()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->value(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:nvdla_prototest_interface.Constant) + return target; +} + +int Constant::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // required int32 value = 1; + if (has_value()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->value()); + } + + } + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void Constant::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const Constant* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void Constant::MergeFrom(const Constant& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_value()) { + set_value(from.value()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void Constant::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Constant::CopyFrom(const Constant& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Constant::IsInitialized() const { + if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false; + + return true; +} + +void Constant::Swap(Constant* other) { + if (other != this) { + std::swap(value_, other->value_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::google::protobuf::Metadata Constant::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = Constant_descriptor_; + metadata.reflection = Constant_reflection_; + return metadata; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int DataFiller::kDataFileFieldNumber; +const int DataFiller::kConstFieldNumber; +#endif // !_MSC_VER + +DataFiller::DataFiller() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:nvdla_prototest_interface.DataFiller) +} + +void DataFiller::InitAsDefaultInstance() { + DataFiller_default_oneof_instance_->data_file_ = const_cast< ::nvdla_prototest_interface::DataFile*>(&::nvdla_prototest_interface::DataFile::default_instance()); + DataFiller_default_oneof_instance_->const__ = const_cast< ::nvdla_prototest_interface::Constant*>(&::nvdla_prototest_interface::Constant::default_instance()); +} + +DataFiller::DataFiller(const DataFiller& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:nvdla_prototest_interface.DataFiller) +} + +void DataFiller::SharedCtor() { + _cached_size_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + clear_has_data_filler_oneof(); +} + +DataFiller::~DataFiller() { + // @@protoc_insertion_point(destructor:nvdla_prototest_interface.DataFiller) + SharedDtor(); +} + +void DataFiller::SharedDtor() { + if (has_data_filler_oneof()) { + clear_data_filler_oneof(); + } + if (this != default_instance_) { + } +} + +void DataFiller::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* DataFiller::descriptor() { + protobuf_AssignDescriptorsOnce(); + return DataFiller_descriptor_; +} + +const DataFiller& DataFiller::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_DlaPrototestInterface_2eproto(); + return *default_instance_; +} + +DataFiller* DataFiller::default_instance_ = NULL; + +DataFiller* DataFiller::New() const { + return new DataFiller; +} + +void DataFiller::clear_data_filler_oneof() { + switch(data_filler_oneof_case()) { + case kDataFile: { + delete data_filler_oneof_.data_file_; + break; + } + case kConst: { + delete data_filler_oneof_.const__; + break; + } + case DATA_FILLER_ONEOF_NOT_SET: { + break; + } + } + _oneof_case_[0] = DATA_FILLER_ONEOF_NOT_SET; +} + + +void DataFiller::Clear() { + clear_data_filler_oneof(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool DataFiller::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:nvdla_prototest_interface.DataFiller) + 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 .nvdla_prototest_interface.DataFile data_file = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_data_file())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_const; + break; + } + + // optional .nvdla_prototest_interface.Constant const = 2; + case 2: { + if (tag == 18) { + parse_const: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_const_())); + } 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:nvdla_prototest_interface.DataFiller) + return true; +failure: + // @@protoc_insertion_point(parse_failure:nvdla_prototest_interface.DataFiller) + return false; +#undef DO_ +} + +void DataFiller::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:nvdla_prototest_interface.DataFiller) + // optional .nvdla_prototest_interface.DataFile data_file = 1; + if (has_data_file()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->data_file(), output); + } + + // optional .nvdla_prototest_interface.Constant const = 2; + if (has_const_()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->const_(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:nvdla_prototest_interface.DataFiller) +} + +::google::protobuf::uint8* DataFiller::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:nvdla_prototest_interface.DataFiller) + // optional .nvdla_prototest_interface.DataFile data_file = 1; + if (has_data_file()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 1, this->data_file(), target); + } + + // optional .nvdla_prototest_interface.Constant const = 2; + if (has_const_()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 2, this->const_(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:nvdla_prototest_interface.DataFiller) + return target; +} + +int DataFiller::ByteSize() const { + int total_size = 0; + + switch (data_filler_oneof_case()) { + // optional .nvdla_prototest_interface.DataFile data_file = 1; + case kDataFile: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->data_file()); + break; + } + // optional .nvdla_prototest_interface.Constant const = 2; + case kConst: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->const_()); + break; + } + case DATA_FILLER_ONEOF_NOT_SET: { + break; + } + } + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void DataFiller::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const DataFiller* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void DataFiller::MergeFrom(const DataFiller& from) { + GOOGLE_CHECK_NE(&from, this); + switch (from.data_filler_oneof_case()) { + case kDataFile: { + mutable_data_file()->::nvdla_prototest_interface::DataFile::MergeFrom(from.data_file()); + break; + } + case kConst: { + mutable_const_()->::nvdla_prototest_interface::Constant::MergeFrom(from.const_()); + break; + } + case DATA_FILLER_ONEOF_NOT_SET: { + break; + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void DataFiller::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void DataFiller::CopyFrom(const DataFiller& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool DataFiller::IsInitialized() const { + + if (has_data_file()) { + if (!this->data_file().IsInitialized()) return false; + } + if (has_const_()) { + if (!this->const_().IsInitialized()) return false; + } + return true; +} + +void DataFiller::Swap(DataFiller* other) { + if (other != this) { + std::swap(data_filler_oneof_, other->data_filler_oneof_); + std::swap(_oneof_case_[0], other->_oneof_case_[0]); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::google::protobuf::Metadata DataFiller::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = DataFiller_descriptor_; + metadata.reflection = DataFiller_reflection_; + return metadata; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int LUTParam::kLinearExpTableFieldNumber; +const int LUTParam::kLinearOnlyTableFieldNumber; +const int LUTParam::kLinearExpOffsetFieldNumber; +const int LUTParam::kLinearOnlyOffsetFieldNumber; +const int LUTParam::kLinearExpStartFieldNumber; +const int LUTParam::kLinearExpEndFieldNumber; +const int LUTParam::kLinearOnlyStartFieldNumber; +const int LUTParam::kLinearOnlyEndFieldNumber; +const int LUTParam::kLinearExpUnderflowSlopeFieldNumber; +const int LUTParam::kLinearExpOverflowSlopeFieldNumber; +const int LUTParam::kLinearOnlyUnderflowSlopeFieldNumber; +const int LUTParam::kLinearOnlyOverflowSlopeFieldNumber; +const int LUTParam::kHybridPriorityFieldNumber; +const int LUTParam::kUnderflowPriorityFieldNumber; +const int LUTParam::kOverflowPriorityFieldNumber; +const int LUTParam::kMethodFieldNumber; +const int LUTParam::kFillTypeFieldNumber; +const int LUTParam::kFillerFieldNumber; +const int LUTParam::kPrecisionFieldNumber; +#endif // !_MSC_VER + +LUTParam::LUTParam() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:nvdla_prototest_interface.LUTParam) +} + +void LUTParam::InitAsDefaultInstance() { + linear_exp_offset_ = const_cast< ::nvdla_prototest_interface::LUTOffset*>(&::nvdla_prototest_interface::LUTOffset::default_instance()); + linear_only_offset_ = const_cast< ::nvdla_prototest_interface::LUTOffset*>(&::nvdla_prototest_interface::LUTOffset::default_instance()); + linear_exp_underflow_slope_ = const_cast< ::nvdla_prototest_interface::DLASlope*>(&::nvdla_prototest_interface::DLASlope::default_instance()); + linear_exp_overflow_slope_ = const_cast< ::nvdla_prototest_interface::DLASlope*>(&::nvdla_prototest_interface::DLASlope::default_instance()); + linear_only_underflow_slope_ = const_cast< ::nvdla_prototest_interface::DLASlope*>(&::nvdla_prototest_interface::DLASlope::default_instance()); + linear_only_overflow_slope_ = const_cast< ::nvdla_prototest_interface::DLASlope*>(&::nvdla_prototest_interface::DLASlope::default_instance()); + filler_ = const_cast< ::nvdla_prototest_interface::DataFiller*>(&::nvdla_prototest_interface::DataFiller::default_instance()); +} + +LUTParam::LUTParam(const LUTParam& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:nvdla_prototest_interface.LUTParam) +} + +void LUTParam::SharedCtor() { + _cached_size_ = 0; + linear_exp_offset_ = NULL; + linear_only_offset_ = NULL; + linear_exp_start_ = GOOGLE_ULONGLONG(0); + linear_exp_end_ = GOOGLE_ULONGLONG(0); + linear_only_start_ = GOOGLE_ULONGLONG(0); + linear_only_end_ = GOOGLE_ULONGLONG(0); + linear_exp_underflow_slope_ = NULL; + linear_exp_overflow_slope_ = NULL; + linear_only_underflow_slope_ = NULL; + linear_only_overflow_slope_ = NULL; + hybrid_priority_ = 0u; + underflow_priority_ = 0u; + overflow_priority_ = 0u; + method_ = 0; + fill_type_ = 0; + filler_ = NULL; + precision_ = 1; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +LUTParam::~LUTParam() { + // @@protoc_insertion_point(destructor:nvdla_prototest_interface.LUTParam) + SharedDtor(); +} + +void LUTParam::SharedDtor() { + if (this != default_instance_) { + delete linear_exp_offset_; + delete linear_only_offset_; + delete linear_exp_underflow_slope_; + delete linear_exp_overflow_slope_; + delete linear_only_underflow_slope_; + delete linear_only_overflow_slope_; + delete filler_; + } +} + +void LUTParam::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* LUTParam::descriptor() { + protobuf_AssignDescriptorsOnce(); + return LUTParam_descriptor_; +} + +const LUTParam& LUTParam::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_DlaPrototestInterface_2eproto(); + return *default_instance_; +} + +LUTParam* LUTParam::default_instance_ = NULL; + +LUTParam* LUTParam::New() const { + return new LUTParam; +} + +void LUTParam::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 252) { + ZR_(linear_exp_start_, linear_only_end_); + if (has_linear_exp_offset()) { + if (linear_exp_offset_ != NULL) linear_exp_offset_->::nvdla_prototest_interface::LUTOffset::Clear(); + } + if (has_linear_only_offset()) { + if (linear_only_offset_ != NULL) linear_only_offset_->::nvdla_prototest_interface::LUTOffset::Clear(); + } + } + if (_has_bits_[8 / 32] & 65280) { + ZR_(hybrid_priority_, method_); + if (has_linear_exp_underflow_slope()) { + if (linear_exp_underflow_slope_ != NULL) linear_exp_underflow_slope_->::nvdla_prototest_interface::DLASlope::Clear(); + } + if (has_linear_exp_overflow_slope()) { + if (linear_exp_overflow_slope_ != NULL) linear_exp_overflow_slope_->::nvdla_prototest_interface::DLASlope::Clear(); + } + if (has_linear_only_underflow_slope()) { + if (linear_only_underflow_slope_ != NULL) linear_only_underflow_slope_->::nvdla_prototest_interface::DLASlope::Clear(); + } + if (has_linear_only_overflow_slope()) { + if (linear_only_overflow_slope_ != NULL) linear_only_overflow_slope_->::nvdla_prototest_interface::DLASlope::Clear(); + } + } + if (_has_bits_[16 / 32] & 458752) { + fill_type_ = 0; + if (has_filler()) { + if (filler_ != NULL) filler_->::nvdla_prototest_interface::DataFiller::Clear(); + } + precision_ = 1; + } + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + linear_exp_table_.Clear(); + linear_only_table_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool LUTParam::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:nvdla_prototest_interface.LUTParam) + 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)) { + // repeated int32 linear_exp_table = 1 [packed = true]; + case 1: { + if (tag == 10) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, this->mutable_linear_exp_table()))); + } else if (tag == 8) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + 1, 10, input, this->mutable_linear_exp_table()))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_linear_only_table; + break; + } + + // repeated int32 linear_only_table = 2 [packed = true]; + case 2: { + if (tag == 18) { + parse_linear_only_table: + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, this->mutable_linear_only_table()))); + } else if (tag == 16) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + 1, 18, input, this->mutable_linear_only_table()))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_linear_exp_offset; + break; + } + + // required .nvdla_prototest_interface.LUTOffset linear_exp_offset = 3; + case 3: { + if (tag == 26) { + parse_linear_exp_offset: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_linear_exp_offset())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(34)) goto parse_linear_only_offset; + break; + } + + // required .nvdla_prototest_interface.LUTOffset linear_only_offset = 4; + case 4: { + if (tag == 34) { + parse_linear_only_offset: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_linear_only_offset())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(40)) goto parse_linear_exp_start; + break; + } + + // required uint64 linear_exp_start = 5; + case 5: { + if (tag == 40) { + parse_linear_exp_start: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( + input, &linear_exp_start_))); + set_has_linear_exp_start(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(48)) goto parse_linear_exp_end; + break; + } + + // required uint64 linear_exp_end = 6; + case 6: { + if (tag == 48) { + parse_linear_exp_end: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( + input, &linear_exp_end_))); + set_has_linear_exp_end(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(56)) goto parse_linear_only_start; + break; + } + + // required uint64 linear_only_start = 7; + case 7: { + if (tag == 56) { + parse_linear_only_start: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( + input, &linear_only_start_))); + set_has_linear_only_start(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(64)) goto parse_linear_only_end; + break; + } + + // required uint64 linear_only_end = 8; + case 8: { + if (tag == 64) { + parse_linear_only_end: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( + input, &linear_only_end_))); + set_has_linear_only_end(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(74)) goto parse_linear_exp_underflow_slope; + break; + } + + // required .nvdla_prototest_interface.DLASlope linear_exp_underflow_slope = 9; + case 9: { + if (tag == 74) { + parse_linear_exp_underflow_slope: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_linear_exp_underflow_slope())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(82)) goto parse_linear_exp_overflow_slope; + break; + } + + // required .nvdla_prototest_interface.DLASlope linear_exp_overflow_slope = 10; + case 10: { + if (tag == 82) { + parse_linear_exp_overflow_slope: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_linear_exp_overflow_slope())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(90)) goto parse_linear_only_underflow_slope; + break; + } + + // required .nvdla_prototest_interface.DLASlope linear_only_underflow_slope = 11; + case 11: { + if (tag == 90) { + parse_linear_only_underflow_slope: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_linear_only_underflow_slope())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(98)) goto parse_linear_only_overflow_slope; + break; + } + + // required .nvdla_prototest_interface.DLASlope linear_only_overflow_slope = 12; + case 12: { + if (tag == 98) { + parse_linear_only_overflow_slope: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_linear_only_overflow_slope())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(104)) goto parse_hybrid_priority; + break; + } + + // required uint32 hybrid_priority = 13; + case 13: { + if (tag == 104) { + parse_hybrid_priority: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &hybrid_priority_))); + set_has_hybrid_priority(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(112)) goto parse_underflow_priority; + break; + } + + // required uint32 underflow_priority = 14; + case 14: { + if (tag == 112) { + parse_underflow_priority: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &underflow_priority_))); + set_has_underflow_priority(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(120)) goto parse_overflow_priority; + break; + } + + // required uint32 overflow_priority = 15; + case 15: { + if (tag == 120) { + parse_overflow_priority: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &overflow_priority_))); + set_has_overflow_priority(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(128)) goto parse_method; + break; + } + + // required .nvdla_prototest_interface.LUTMethod method = 16; + case 16: { + if (tag == 128) { + parse_method: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::nvdla_prototest_interface::LUTMethod_IsValid(value)) { + set_method(static_cast< ::nvdla_prototest_interface::LUTMethod >(value)); + } else { + mutable_unknown_fields()->AddVarint(16, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(136)) goto parse_fill_type; + break; + } + + // optional .nvdla_prototest_interface.FillerType fill_type = 17 [default = FILL_NONE]; + case 17: { + if (tag == 136) { + parse_fill_type: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::nvdla_prototest_interface::FillerType_IsValid(value)) { + set_fill_type(static_cast< ::nvdla_prototest_interface::FillerType >(value)); + } else { + mutable_unknown_fields()->AddVarint(17, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(146)) goto parse_filler; + break; + } + + // optional .nvdla_prototest_interface.DataFiller filler = 18; + case 18: { + if (tag == 146) { + parse_filler: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_filler())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(152)) goto parse_precision; + break; + } + + // optional .nvdla_prototest_interface.DataPrecision precision = 19 [default = PRECISION_INT16]; + case 19: { + if (tag == 152) { + parse_precision: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::nvdla_prototest_interface::DataPrecision_IsValid(value)) { + set_precision(static_cast< ::nvdla_prototest_interface::DataPrecision >(value)); + } else { + mutable_unknown_fields()->AddVarint(19, 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:nvdla_prototest_interface.LUTParam) + return true; +failure: + // @@protoc_insertion_point(parse_failure:nvdla_prototest_interface.LUTParam) + return false; +#undef DO_ +} + +void LUTParam::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:nvdla_prototest_interface.LUTParam) + // repeated int32 linear_exp_table = 1 [packed = true]; + if (this->linear_exp_table_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(1, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(_linear_exp_table_cached_byte_size_); + } + for (int i = 0; i < this->linear_exp_table_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt32NoTag( + this->linear_exp_table(i), output); + } + + // repeated int32 linear_only_table = 2 [packed = true]; + if (this->linear_only_table_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(2, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(_linear_only_table_cached_byte_size_); + } + for (int i = 0; i < this->linear_only_table_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt32NoTag( + this->linear_only_table(i), output); + } + + // required .nvdla_prototest_interface.LUTOffset linear_exp_offset = 3; + if (has_linear_exp_offset()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, this->linear_exp_offset(), output); + } + + // required .nvdla_prototest_interface.LUTOffset linear_only_offset = 4; + if (has_linear_only_offset()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, this->linear_only_offset(), output); + } + + // required uint64 linear_exp_start = 5; + if (has_linear_exp_start()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt64(5, this->linear_exp_start(), output); + } + + // required uint64 linear_exp_end = 6; + if (has_linear_exp_end()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt64(6, this->linear_exp_end(), output); + } + + // required uint64 linear_only_start = 7; + if (has_linear_only_start()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt64(7, this->linear_only_start(), output); + } + + // required uint64 linear_only_end = 8; + if (has_linear_only_end()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt64(8, this->linear_only_end(), output); + } + + // required .nvdla_prototest_interface.DLASlope linear_exp_underflow_slope = 9; + if (has_linear_exp_underflow_slope()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 9, this->linear_exp_underflow_slope(), output); + } + + // required .nvdla_prototest_interface.DLASlope linear_exp_overflow_slope = 10; + if (has_linear_exp_overflow_slope()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 10, this->linear_exp_overflow_slope(), output); + } + + // required .nvdla_prototest_interface.DLASlope linear_only_underflow_slope = 11; + if (has_linear_only_underflow_slope()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 11, this->linear_only_underflow_slope(), output); + } + + // required .nvdla_prototest_interface.DLASlope linear_only_overflow_slope = 12; + if (has_linear_only_overflow_slope()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 12, this->linear_only_overflow_slope(), output); + } + + // required uint32 hybrid_priority = 13; + if (has_hybrid_priority()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(13, this->hybrid_priority(), output); + } + + // required uint32 underflow_priority = 14; + if (has_underflow_priority()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(14, this->underflow_priority(), output); + } + + // required uint32 overflow_priority = 15; + if (has_overflow_priority()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(15, this->overflow_priority(), output); + } + + // required .nvdla_prototest_interface.LUTMethod method = 16; + if (has_method()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 16, this->method(), output); + } + + // optional .nvdla_prototest_interface.FillerType fill_type = 17 [default = FILL_NONE]; + if (has_fill_type()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 17, this->fill_type(), output); + } + + // optional .nvdla_prototest_interface.DataFiller filler = 18; + if (has_filler()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 18, this->filler(), output); + } + + // optional .nvdla_prototest_interface.DataPrecision precision = 19 [default = PRECISION_INT16]; + if (has_precision()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 19, this->precision(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:nvdla_prototest_interface.LUTParam) +} + +::google::protobuf::uint8* LUTParam::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:nvdla_prototest_interface.LUTParam) + // repeated int32 linear_exp_table = 1 [packed = true]; + if (this->linear_exp_table_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 1, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + _linear_exp_table_cached_byte_size_, target); + } + for (int i = 0; i < this->linear_exp_table_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt32NoTagToArray(this->linear_exp_table(i), target); + } + + // repeated int32 linear_only_table = 2 [packed = true]; + if (this->linear_only_table_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 2, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + _linear_only_table_cached_byte_size_, target); + } + for (int i = 0; i < this->linear_only_table_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt32NoTagToArray(this->linear_only_table(i), target); + } + + // required .nvdla_prototest_interface.LUTOffset linear_exp_offset = 3; + if (has_linear_exp_offset()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 3, this->linear_exp_offset(), target); + } + + // required .nvdla_prototest_interface.LUTOffset linear_only_offset = 4; + if (has_linear_only_offset()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 4, this->linear_only_offset(), target); + } + + // required uint64 linear_exp_start = 5; + if (has_linear_exp_start()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(5, this->linear_exp_start(), target); + } + + // required uint64 linear_exp_end = 6; + if (has_linear_exp_end()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(6, this->linear_exp_end(), target); + } + + // required uint64 linear_only_start = 7; + if (has_linear_only_start()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(7, this->linear_only_start(), target); + } + + // required uint64 linear_only_end = 8; + if (has_linear_only_end()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(8, this->linear_only_end(), target); + } + + // required .nvdla_prototest_interface.DLASlope linear_exp_underflow_slope = 9; + if (has_linear_exp_underflow_slope()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 9, this->linear_exp_underflow_slope(), target); + } + + // required .nvdla_prototest_interface.DLASlope linear_exp_overflow_slope = 10; + if (has_linear_exp_overflow_slope()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 10, this->linear_exp_overflow_slope(), target); + } + + // required .nvdla_prototest_interface.DLASlope linear_only_underflow_slope = 11; + if (has_linear_only_underflow_slope()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 11, this->linear_only_underflow_slope(), target); + } + + // required .nvdla_prototest_interface.DLASlope linear_only_overflow_slope = 12; + if (has_linear_only_overflow_slope()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 12, this->linear_only_overflow_slope(), target); + } + + // required uint32 hybrid_priority = 13; + if (has_hybrid_priority()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(13, this->hybrid_priority(), target); + } + + // required uint32 underflow_priority = 14; + if (has_underflow_priority()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(14, this->underflow_priority(), target); + } + + // required uint32 overflow_priority = 15; + if (has_overflow_priority()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(15, this->overflow_priority(), target); + } + + // required .nvdla_prototest_interface.LUTMethod method = 16; + if (has_method()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 16, this->method(), target); + } + + // optional .nvdla_prototest_interface.FillerType fill_type = 17 [default = FILL_NONE]; + if (has_fill_type()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 17, this->fill_type(), target); + } + + // optional .nvdla_prototest_interface.DataFiller filler = 18; + if (has_filler()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 18, this->filler(), target); + } + + // optional .nvdla_prototest_interface.DataPrecision precision = 19 [default = PRECISION_INT16]; + if (has_precision()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 19, this->precision(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:nvdla_prototest_interface.LUTParam) + return target; +} + +int LUTParam::ByteSize() const { + int total_size = 0; + + if (_has_bits_[2 / 32] & (0xffu << (2 % 32))) { + // required .nvdla_prototest_interface.LUTOffset linear_exp_offset = 3; + if (has_linear_exp_offset()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->linear_exp_offset()); + } + + // required .nvdla_prototest_interface.LUTOffset linear_only_offset = 4; + if (has_linear_only_offset()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->linear_only_offset()); + } + + // required uint64 linear_exp_start = 5; + if (has_linear_exp_start()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt64Size( + this->linear_exp_start()); + } + + // required uint64 linear_exp_end = 6; + if (has_linear_exp_end()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt64Size( + this->linear_exp_end()); + } + + // required uint64 linear_only_start = 7; + if (has_linear_only_start()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt64Size( + this->linear_only_start()); + } + + // required uint64 linear_only_end = 8; + if (has_linear_only_end()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt64Size( + this->linear_only_end()); + } + + } + if (_has_bits_[8 / 32] & (0xffu << (8 % 32))) { + // required .nvdla_prototest_interface.DLASlope linear_exp_underflow_slope = 9; + if (has_linear_exp_underflow_slope()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->linear_exp_underflow_slope()); + } + + // required .nvdla_prototest_interface.DLASlope linear_exp_overflow_slope = 10; + if (has_linear_exp_overflow_slope()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->linear_exp_overflow_slope()); + } + + // required .nvdla_prototest_interface.DLASlope linear_only_underflow_slope = 11; + if (has_linear_only_underflow_slope()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->linear_only_underflow_slope()); + } + + // required .nvdla_prototest_interface.DLASlope linear_only_overflow_slope = 12; + if (has_linear_only_overflow_slope()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->linear_only_overflow_slope()); + } + + // required uint32 hybrid_priority = 13; + if (has_hybrid_priority()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->hybrid_priority()); + } + + // required uint32 underflow_priority = 14; + if (has_underflow_priority()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->underflow_priority()); + } + + // required uint32 overflow_priority = 15; + if (has_overflow_priority()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->overflow_priority()); + } + + // required .nvdla_prototest_interface.LUTMethod method = 16; + if (has_method()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->method()); + } + + } + if (_has_bits_[16 / 32] & (0xffu << (16 % 32))) { + // optional .nvdla_prototest_interface.FillerType fill_type = 17 [default = FILL_NONE]; + if (has_fill_type()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->fill_type()); + } + + // optional .nvdla_prototest_interface.DataFiller filler = 18; + if (has_filler()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->filler()); + } + + // optional .nvdla_prototest_interface.DataPrecision precision = 19 [default = PRECISION_INT16]; + if (has_precision()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->precision()); + } + + } + // repeated int32 linear_exp_table = 1 [packed = true]; + { + int data_size = 0; + for (int i = 0; i < this->linear_exp_table_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + Int32Size(this->linear_exp_table(i)); + } + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _linear_exp_table_cached_byte_size_ = data_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated int32 linear_only_table = 2 [packed = true]; + { + int data_size = 0; + for (int i = 0; i < this->linear_only_table_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + Int32Size(this->linear_only_table(i)); + } + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _linear_only_table_cached_byte_size_ = data_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void LUTParam::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const LUTParam* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void LUTParam::MergeFrom(const LUTParam& from) { + GOOGLE_CHECK_NE(&from, this); + linear_exp_table_.MergeFrom(from.linear_exp_table_); + linear_only_table_.MergeFrom(from.linear_only_table_); + if (from._has_bits_[2 / 32] & (0xffu << (2 % 32))) { + if (from.has_linear_exp_offset()) { + mutable_linear_exp_offset()->::nvdla_prototest_interface::LUTOffset::MergeFrom(from.linear_exp_offset()); + } + if (from.has_linear_only_offset()) { + mutable_linear_only_offset()->::nvdla_prototest_interface::LUTOffset::MergeFrom(from.linear_only_offset()); + } + if (from.has_linear_exp_start()) { + set_linear_exp_start(from.linear_exp_start()); + } + if (from.has_linear_exp_end()) { + set_linear_exp_end(from.linear_exp_end()); + } + if (from.has_linear_only_start()) { + set_linear_only_start(from.linear_only_start()); + } + if (from.has_linear_only_end()) { + set_linear_only_end(from.linear_only_end()); + } + } + if (from._has_bits_[8 / 32] & (0xffu << (8 % 32))) { + if (from.has_linear_exp_underflow_slope()) { + mutable_linear_exp_underflow_slope()->::nvdla_prototest_interface::DLASlope::MergeFrom(from.linear_exp_underflow_slope()); + } + if (from.has_linear_exp_overflow_slope()) { + mutable_linear_exp_overflow_slope()->::nvdla_prototest_interface::DLASlope::MergeFrom(from.linear_exp_overflow_slope()); + } + if (from.has_linear_only_underflow_slope()) { + mutable_linear_only_underflow_slope()->::nvdla_prototest_interface::DLASlope::MergeFrom(from.linear_only_underflow_slope()); + } + if (from.has_linear_only_overflow_slope()) { + mutable_linear_only_overflow_slope()->::nvdla_prototest_interface::DLASlope::MergeFrom(from.linear_only_overflow_slope()); + } + if (from.has_hybrid_priority()) { + set_hybrid_priority(from.hybrid_priority()); + } + if (from.has_underflow_priority()) { + set_underflow_priority(from.underflow_priority()); + } + if (from.has_overflow_priority()) { + set_overflow_priority(from.overflow_priority()); + } + if (from.has_method()) { + set_method(from.method()); + } + } + if (from._has_bits_[16 / 32] & (0xffu << (16 % 32))) { + if (from.has_fill_type()) { + set_fill_type(from.fill_type()); + } + if (from.has_filler()) { + mutable_filler()->::nvdla_prototest_interface::DataFiller::MergeFrom(from.filler()); + } + if (from.has_precision()) { + set_precision(from.precision()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void LUTParam::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void LUTParam::CopyFrom(const LUTParam& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool LUTParam::IsInitialized() const { + if ((_has_bits_[0] & 0x0000fffc) != 0x0000fffc) return false; + + if (has_linear_exp_underflow_slope()) { + if (!this->linear_exp_underflow_slope().IsInitialized()) return false; + } + if (has_linear_exp_overflow_slope()) { + if (!this->linear_exp_overflow_slope().IsInitialized()) return false; + } + if (has_linear_only_underflow_slope()) { + if (!this->linear_only_underflow_slope().IsInitialized()) return false; + } + if (has_linear_only_overflow_slope()) { + if (!this->linear_only_overflow_slope().IsInitialized()) return false; + } + if (has_filler()) { + if (!this->filler().IsInitialized()) return false; + } + return true; +} + +void LUTParam::Swap(LUTParam* other) { + if (other != this) { + linear_exp_table_.Swap(&other->linear_exp_table_); + linear_only_table_.Swap(&other->linear_only_table_); + std::swap(linear_exp_offset_, other->linear_exp_offset_); + std::swap(linear_only_offset_, other->linear_only_offset_); + std::swap(linear_exp_start_, other->linear_exp_start_); + std::swap(linear_exp_end_, other->linear_exp_end_); + std::swap(linear_only_start_, other->linear_only_start_); + std::swap(linear_only_end_, other->linear_only_end_); + std::swap(linear_exp_underflow_slope_, other->linear_exp_underflow_slope_); + std::swap(linear_exp_overflow_slope_, other->linear_exp_overflow_slope_); + std::swap(linear_only_underflow_slope_, other->linear_only_underflow_slope_); + std::swap(linear_only_overflow_slope_, other->linear_only_overflow_slope_); + std::swap(hybrid_priority_, other->hybrid_priority_); + std::swap(underflow_priority_, other->underflow_priority_); + std::swap(overflow_priority_, other->overflow_priority_); + std::swap(method_, other->method_); + std::swap(fill_type_, other->fill_type_); + std::swap(filler_, other->filler_); + std::swap(precision_, other->precision_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::google::protobuf::Metadata LUTParam::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = LUTParam_descriptor_; + metadata.reflection = LUTParam_reflection_; + return metadata; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int BDMATransferDesc::kSourceAddressFieldNumber; +const int BDMATransferDesc::kDestinationAddressFieldNumber; +const int BDMATransferDesc::kLineSizeFieldNumber; +const int BDMATransferDesc::kLineRepeatFieldNumber; +const int BDMATransferDesc::kSourceLineFieldNumber; +const int BDMATransferDesc::kDestinationLineFieldNumber; +const int BDMATransferDesc::kSurfaceRepeatFieldNumber; +const int BDMATransferDesc::kSourceSurfaceFieldNumber; +const int BDMATransferDesc::kDestinationSurfaceFieldNumber; +const int BDMATransferDesc::kSrcMemInfoFieldNumber; +const int BDMATransferDesc::kDstMemInfoFieldNumber; +#endif // !_MSC_VER + +BDMATransferDesc::BDMATransferDesc() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:nvdla_prototest_interface.BDMATransferDesc) +} + +void BDMATransferDesc::InitAsDefaultInstance() { + src_mem_info_ = const_cast< ::nvdla_prototest_interface::MemInfo*>(&::nvdla_prototest_interface::MemInfo::default_instance()); + dst_mem_info_ = const_cast< ::nvdla_prototest_interface::MemInfo*>(&::nvdla_prototest_interface::MemInfo::default_instance()); +} + +BDMATransferDesc::BDMATransferDesc(const BDMATransferDesc& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:nvdla_prototest_interface.BDMATransferDesc) +} + +void BDMATransferDesc::SharedCtor() { + _cached_size_ = 0; + source_address_ = 0; + destination_address_ = 0; + line_size_ = 0u; + line_repeat_ = 0u; + source_line_ = 0u; + destination_line_ = 0u; + surface_repeat_ = 0u; + source_surface_ = 0u; + destination_surface_ = 0u; + src_mem_info_ = NULL; + dst_mem_info_ = NULL; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +BDMATransferDesc::~BDMATransferDesc() { + // @@protoc_insertion_point(destructor:nvdla_prototest_interface.BDMATransferDesc) + SharedDtor(); +} + +void BDMATransferDesc::SharedDtor() { + if (this != default_instance_) { + delete src_mem_info_; + delete dst_mem_info_; + } +} + +void BDMATransferDesc::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* BDMATransferDesc::descriptor() { + protobuf_AssignDescriptorsOnce(); + return BDMATransferDesc_descriptor_; +} + +const BDMATransferDesc& BDMATransferDesc::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_DlaPrototestInterface_2eproto(); + return *default_instance_; +} + +BDMATransferDesc* BDMATransferDesc::default_instance_ = NULL; + +BDMATransferDesc* BDMATransferDesc::New() const { + return new BDMATransferDesc; +} + +void BDMATransferDesc::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 255) { + ZR_(source_address_, source_surface_); + } + if (_has_bits_[8 / 32] & 1792) { + destination_surface_ = 0u; + if (has_src_mem_info()) { + if (src_mem_info_ != NULL) src_mem_info_->::nvdla_prototest_interface::MemInfo::Clear(); + } + if (has_dst_mem_info()) { + if (dst_mem_info_ != NULL) dst_mem_info_->::nvdla_prototest_interface::MemInfo::Clear(); + } + } + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool BDMATransferDesc::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:nvdla_prototest_interface.BDMATransferDesc) + 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)) { + // required int32 source_address = 1; + case 1: { + if (tag == 8) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &source_address_))); + set_has_source_address(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_destination_address; + break; + } + + // required int32 destination_address = 2; + case 2: { + if (tag == 16) { + parse_destination_address: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &destination_address_))); + set_has_destination_address(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(24)) goto parse_line_size; + break; + } + + // required uint32 line_size = 3; + case 3: { + if (tag == 24) { + parse_line_size: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &line_size_))); + set_has_line_size(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(32)) goto parse_line_repeat; + break; + } + + // required uint32 line_repeat = 4; + case 4: { + if (tag == 32) { + parse_line_repeat: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &line_repeat_))); + set_has_line_repeat(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(40)) goto parse_source_line; + break; + } + + // required uint32 source_line = 5; + case 5: { + if (tag == 40) { + parse_source_line: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &source_line_))); + set_has_source_line(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(48)) goto parse_destination_line; + break; + } + + // required uint32 destination_line = 6; + case 6: { + if (tag == 48) { + parse_destination_line: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &destination_line_))); + set_has_destination_line(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(56)) goto parse_surface_repeat; + break; + } + + // required uint32 surface_repeat = 7; + case 7: { + if (tag == 56) { + parse_surface_repeat: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &surface_repeat_))); + set_has_surface_repeat(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(64)) goto parse_source_surface; + break; + } + + // required uint32 source_surface = 8; + case 8: { + if (tag == 64) { + parse_source_surface: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &source_surface_))); + set_has_source_surface(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(72)) goto parse_destination_surface; + break; + } + + // required uint32 destination_surface = 9; + case 9: { + if (tag == 72) { + parse_destination_surface: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &destination_surface_))); + set_has_destination_surface(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(82)) goto parse_src_mem_info; + break; + } + + // required .nvdla_prototest_interface.MemInfo src_mem_info = 10; + case 10: { + if (tag == 82) { + parse_src_mem_info: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_src_mem_info())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(90)) goto parse_dst_mem_info; + break; + } + + // required .nvdla_prototest_interface.MemInfo dst_mem_info = 11; + case 11: { + if (tag == 90) { + parse_dst_mem_info: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_dst_mem_info())); + } 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:nvdla_prototest_interface.BDMATransferDesc) + return true; +failure: + // @@protoc_insertion_point(parse_failure:nvdla_prototest_interface.BDMATransferDesc) + return false; +#undef DO_ +} + +void BDMATransferDesc::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:nvdla_prototest_interface.BDMATransferDesc) + // required int32 source_address = 1; + if (has_source_address()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->source_address(), output); + } + + // required int32 destination_address = 2; + if (has_destination_address()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->destination_address(), output); + } + + // required uint32 line_size = 3; + if (has_line_size()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->line_size(), output); + } + + // required uint32 line_repeat = 4; + if (has_line_repeat()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(4, this->line_repeat(), output); + } + + // required uint32 source_line = 5; + if (has_source_line()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(5, this->source_line(), output); + } + + // required uint32 destination_line = 6; + if (has_destination_line()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(6, this->destination_line(), output); + } + + // required uint32 surface_repeat = 7; + if (has_surface_repeat()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(7, this->surface_repeat(), output); + } + + // required uint32 source_surface = 8; + if (has_source_surface()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(8, this->source_surface(), output); + } + + // required uint32 destination_surface = 9; + if (has_destination_surface()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(9, this->destination_surface(), output); + } + + // required .nvdla_prototest_interface.MemInfo src_mem_info = 10; + if (has_src_mem_info()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 10, this->src_mem_info(), output); + } + + // required .nvdla_prototest_interface.MemInfo dst_mem_info = 11; + if (has_dst_mem_info()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 11, this->dst_mem_info(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:nvdla_prototest_interface.BDMATransferDesc) +} + +::google::protobuf::uint8* BDMATransferDesc::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:nvdla_prototest_interface.BDMATransferDesc) + // required int32 source_address = 1; + if (has_source_address()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->source_address(), target); + } + + // required int32 destination_address = 2; + if (has_destination_address()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->destination_address(), target); + } + + // required uint32 line_size = 3; + if (has_line_size()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->line_size(), target); + } + + // required uint32 line_repeat = 4; + if (has_line_repeat()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(4, this->line_repeat(), target); + } + + // required uint32 source_line = 5; + if (has_source_line()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(5, this->source_line(), target); + } + + // required uint32 destination_line = 6; + if (has_destination_line()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(6, this->destination_line(), target); + } + + // required uint32 surface_repeat = 7; + if (has_surface_repeat()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(7, this->surface_repeat(), target); + } + + // required uint32 source_surface = 8; + if (has_source_surface()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(8, this->source_surface(), target); + } + + // required uint32 destination_surface = 9; + if (has_destination_surface()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(9, this->destination_surface(), target); + } + + // required .nvdla_prototest_interface.MemInfo src_mem_info = 10; + if (has_src_mem_info()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 10, this->src_mem_info(), target); + } + + // required .nvdla_prototest_interface.MemInfo dst_mem_info = 11; + if (has_dst_mem_info()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 11, this->dst_mem_info(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:nvdla_prototest_interface.BDMATransferDesc) + return target; +} + +int BDMATransferDesc::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // required int32 source_address = 1; + if (has_source_address()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->source_address()); + } + + // required int32 destination_address = 2; + if (has_destination_address()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->destination_address()); + } + + // required uint32 line_size = 3; + if (has_line_size()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->line_size()); + } + + // required uint32 line_repeat = 4; + if (has_line_repeat()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->line_repeat()); + } + + // required uint32 source_line = 5; + if (has_source_line()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->source_line()); + } + + // required uint32 destination_line = 6; + if (has_destination_line()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->destination_line()); + } + + // required uint32 surface_repeat = 7; + if (has_surface_repeat()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->surface_repeat()); + } + + // required uint32 source_surface = 8; + if (has_source_surface()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->source_surface()); + } + + } + if (_has_bits_[8 / 32] & (0xffu << (8 % 32))) { + // required uint32 destination_surface = 9; + if (has_destination_surface()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->destination_surface()); + } + + // required .nvdla_prototest_interface.MemInfo src_mem_info = 10; + if (has_src_mem_info()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->src_mem_info()); + } + + // required .nvdla_prototest_interface.MemInfo dst_mem_info = 11; + if (has_dst_mem_info()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->dst_mem_info()); + } + + } + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void BDMATransferDesc::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const BDMATransferDesc* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void BDMATransferDesc::MergeFrom(const BDMATransferDesc& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_source_address()) { + set_source_address(from.source_address()); + } + if (from.has_destination_address()) { + set_destination_address(from.destination_address()); + } + if (from.has_line_size()) { + set_line_size(from.line_size()); + } + if (from.has_line_repeat()) { + set_line_repeat(from.line_repeat()); + } + if (from.has_source_line()) { + set_source_line(from.source_line()); + } + if (from.has_destination_line()) { + set_destination_line(from.destination_line()); + } + if (from.has_surface_repeat()) { + set_surface_repeat(from.surface_repeat()); + } + if (from.has_source_surface()) { + set_source_surface(from.source_surface()); + } + } + if (from._has_bits_[8 / 32] & (0xffu << (8 % 32))) { + if (from.has_destination_surface()) { + set_destination_surface(from.destination_surface()); + } + if (from.has_src_mem_info()) { + mutable_src_mem_info()->::nvdla_prototest_interface::MemInfo::MergeFrom(from.src_mem_info()); + } + if (from.has_dst_mem_info()) { + mutable_dst_mem_info()->::nvdla_prototest_interface::MemInfo::MergeFrom(from.dst_mem_info()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void BDMATransferDesc::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void BDMATransferDesc::CopyFrom(const BDMATransferDesc& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool BDMATransferDesc::IsInitialized() const { + if ((_has_bits_[0] & 0x000007ff) != 0x000007ff) return false; + + if (has_src_mem_info()) { + if (!this->src_mem_info().IsInitialized()) return false; + } + if (has_dst_mem_info()) { + if (!this->dst_mem_info().IsInitialized()) return false; + } + return true; +} + +void BDMATransferDesc::Swap(BDMATransferDesc* other) { + if (other != this) { + std::swap(source_address_, other->source_address_); + std::swap(destination_address_, other->destination_address_); + std::swap(line_size_, other->line_size_); + std::swap(line_repeat_, other->line_repeat_); + std::swap(source_line_, other->source_line_); + std::swap(destination_line_, other->destination_line_); + std::swap(surface_repeat_, other->surface_repeat_); + std::swap(source_surface_, other->source_surface_); + std::swap(destination_surface_, other->destination_surface_); + std::swap(src_mem_info_, other->src_mem_info_); + std::swap(dst_mem_info_, other->dst_mem_info_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::google::protobuf::Metadata BDMATransferDesc::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = BDMATransferDesc_descriptor_; + metadata.reflection = BDMATransferDesc_reflection_; + return metadata; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int BDMASurfaceDesc::kSourceTypeFieldNumber; +const int BDMASurfaceDesc::kDestinationTypeFieldNumber; +const int BDMASurfaceDesc::kNumTransfersFieldNumber; +const int BDMASurfaceDesc::kTransfersFieldNumber; +#endif // !_MSC_VER + +BDMASurfaceDesc::BDMASurfaceDesc() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:nvdla_prototest_interface.BDMASurfaceDesc) +} + +void BDMASurfaceDesc::InitAsDefaultInstance() { +} + +BDMASurfaceDesc::BDMASurfaceDesc(const BDMASurfaceDesc& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:nvdla_prototest_interface.BDMASurfaceDesc) +} + +void BDMASurfaceDesc::SharedCtor() { + _cached_size_ = 0; + source_type_ = 0; + destination_type_ = 0; + num_transfers_ = 0u; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +BDMASurfaceDesc::~BDMASurfaceDesc() { + // @@protoc_insertion_point(destructor:nvdla_prototest_interface.BDMASurfaceDesc) + SharedDtor(); +} + +void BDMASurfaceDesc::SharedDtor() { + if (this != default_instance_) { + } +} + +void BDMASurfaceDesc::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* BDMASurfaceDesc::descriptor() { + protobuf_AssignDescriptorsOnce(); + return BDMASurfaceDesc_descriptor_; +} + +const BDMASurfaceDesc& BDMASurfaceDesc::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_DlaPrototestInterface_2eproto(); + return *default_instance_; +} + +BDMASurfaceDesc* BDMASurfaceDesc::default_instance_ = NULL; + +BDMASurfaceDesc* BDMASurfaceDesc::New() const { + return new BDMASurfaceDesc; +} + +void BDMASurfaceDesc::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 7) { + ZR_(source_type_, destination_type_); + num_transfers_ = 0u; + } + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + transfers_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool BDMASurfaceDesc::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:nvdla_prototest_interface.BDMASurfaceDesc) + 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)) { + // required .nvdla_prototest_interface.MemType source_type = 1; + case 1: { + if (tag == 8) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::nvdla_prototest_interface::MemType_IsValid(value)) { + set_source_type(static_cast< ::nvdla_prototest_interface::MemType >(value)); + } else { + mutable_unknown_fields()->AddVarint(1, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_destination_type; + break; + } + + // required .nvdla_prototest_interface.MemType destination_type = 2; + case 2: { + if (tag == 16) { + parse_destination_type: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::nvdla_prototest_interface::MemType_IsValid(value)) { + set_destination_type(static_cast< ::nvdla_prototest_interface::MemType >(value)); + } else { + mutable_unknown_fields()->AddVarint(2, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(24)) goto parse_num_transfers; + break; + } + + // required uint32 num_transfers = 3; + case 3: { + if (tag == 24) { + parse_num_transfers: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &num_transfers_))); + set_has_num_transfers(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(34)) goto parse_transfers; + break; + } + + // repeated .nvdla_prototest_interface.BDMATransferDesc transfers = 4; + case 4: { + if (tag == 34) { + parse_transfers: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_transfers())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(34)) goto parse_transfers; + 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:nvdla_prototest_interface.BDMASurfaceDesc) + return true; +failure: + // @@protoc_insertion_point(parse_failure:nvdla_prototest_interface.BDMASurfaceDesc) + return false; +#undef DO_ +} + +void BDMASurfaceDesc::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:nvdla_prototest_interface.BDMASurfaceDesc) + // required .nvdla_prototest_interface.MemType source_type = 1; + if (has_source_type()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 1, this->source_type(), output); + } + + // required .nvdla_prototest_interface.MemType destination_type = 2; + if (has_destination_type()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 2, this->destination_type(), output); + } + + // required uint32 num_transfers = 3; + if (has_num_transfers()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->num_transfers(), output); + } + + // repeated .nvdla_prototest_interface.BDMATransferDesc transfers = 4; + for (int i = 0; i < this->transfers_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, this->transfers(i), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:nvdla_prototest_interface.BDMASurfaceDesc) +} + +::google::protobuf::uint8* BDMASurfaceDesc::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:nvdla_prototest_interface.BDMASurfaceDesc) + // required .nvdla_prototest_interface.MemType source_type = 1; + if (has_source_type()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 1, this->source_type(), target); + } + + // required .nvdla_prototest_interface.MemType destination_type = 2; + if (has_destination_type()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 2, this->destination_type(), target); + } + + // required uint32 num_transfers = 3; + if (has_num_transfers()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->num_transfers(), target); + } + + // repeated .nvdla_prototest_interface.BDMATransferDesc transfers = 4; + for (int i = 0; i < this->transfers_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 4, this->transfers(i), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:nvdla_prototest_interface.BDMASurfaceDesc) + return target; +} + +int BDMASurfaceDesc::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // required .nvdla_prototest_interface.MemType source_type = 1; + if (has_source_type()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->source_type()); + } + + // required .nvdla_prototest_interface.MemType destination_type = 2; + if (has_destination_type()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->destination_type()); + } + + // required uint32 num_transfers = 3; + if (has_num_transfers()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->num_transfers()); + } + + } + // repeated .nvdla_prototest_interface.BDMATransferDesc transfers = 4; + total_size += 1 * this->transfers_size(); + for (int i = 0; i < this->transfers_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->transfers(i)); + } + + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void BDMASurfaceDesc::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const BDMASurfaceDesc* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void BDMASurfaceDesc::MergeFrom(const BDMASurfaceDesc& from) { + GOOGLE_CHECK_NE(&from, this); + transfers_.MergeFrom(from.transfers_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_source_type()) { + set_source_type(from.source_type()); + } + if (from.has_destination_type()) { + set_destination_type(from.destination_type()); + } + if (from.has_num_transfers()) { + set_num_transfers(from.num_transfers()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void BDMASurfaceDesc::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void BDMASurfaceDesc::CopyFrom(const BDMASurfaceDesc& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool BDMASurfaceDesc::IsInitialized() const { + if ((_has_bits_[0] & 0x00000007) != 0x00000007) return false; + + if (!::google::protobuf::internal::AllAreInitialized(this->transfers())) return false; + return true; +} + +void BDMASurfaceDesc::Swap(BDMASurfaceDesc* other) { + if (other != this) { + std::swap(source_type_, other->source_type_); + std::swap(destination_type_, other->destination_type_); + std::swap(num_transfers_, other->num_transfers_); + transfers_.Swap(&other->transfers_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::google::protobuf::Metadata BDMASurfaceDesc::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = BDMASurfaceDesc_descriptor_; + metadata.reflection = BDMASurfaceDesc_reflection_; + return metadata; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int BDMAOpDesc::kNumTransfersFieldNumber; +const int BDMAOpDesc::kReserved0FieldNumber; +#endif // !_MSC_VER + +BDMAOpDesc::BDMAOpDesc() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:nvdla_prototest_interface.BDMAOpDesc) +} + +void BDMAOpDesc::InitAsDefaultInstance() { +} + +BDMAOpDesc::BDMAOpDesc(const BDMAOpDesc& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:nvdla_prototest_interface.BDMAOpDesc) +} + +void BDMAOpDesc::SharedCtor() { + _cached_size_ = 0; + num_transfers_ = 0u; + reserved0_ = 0u; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +BDMAOpDesc::~BDMAOpDesc() { + // @@protoc_insertion_point(destructor:nvdla_prototest_interface.BDMAOpDesc) + SharedDtor(); +} + +void BDMAOpDesc::SharedDtor() { + if (this != default_instance_) { + } +} + +void BDMAOpDesc::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* BDMAOpDesc::descriptor() { + protobuf_AssignDescriptorsOnce(); + return BDMAOpDesc_descriptor_; +} + +const BDMAOpDesc& BDMAOpDesc::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_DlaPrototestInterface_2eproto(); + return *default_instance_; +} + +BDMAOpDesc* BDMAOpDesc::default_instance_ = NULL; + +BDMAOpDesc* BDMAOpDesc::New() const { + return new BDMAOpDesc; +} + +void BDMAOpDesc::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + ZR_(num_transfers_, reserved0_); + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool BDMAOpDesc::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:nvdla_prototest_interface.BDMAOpDesc) + 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)) { + // required uint32 num_transfers = 1; + case 1: { + if (tag == 8) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &num_transfers_))); + set_has_num_transfers(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_reserved0; + break; + } + + // optional uint32 reserved0 = 2 [default = 0]; + case 2: { + if (tag == 16) { + parse_reserved0: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &reserved0_))); + set_has_reserved0(); + } 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:nvdla_prototest_interface.BDMAOpDesc) + return true; +failure: + // @@protoc_insertion_point(parse_failure:nvdla_prototest_interface.BDMAOpDesc) + return false; +#undef DO_ +} + +void BDMAOpDesc::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:nvdla_prototest_interface.BDMAOpDesc) + // required uint32 num_transfers = 1; + if (has_num_transfers()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->num_transfers(), output); + } + + // optional uint32 reserved0 = 2 [default = 0]; + if (has_reserved0()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->reserved0(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:nvdla_prototest_interface.BDMAOpDesc) +} + +::google::protobuf::uint8* BDMAOpDesc::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:nvdla_prototest_interface.BDMAOpDesc) + // required uint32 num_transfers = 1; + if (has_num_transfers()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->num_transfers(), target); + } + + // optional uint32 reserved0 = 2 [default = 0]; + if (has_reserved0()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->reserved0(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:nvdla_prototest_interface.BDMAOpDesc) + return target; +} + +int BDMAOpDesc::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // required uint32 num_transfers = 1; + if (has_num_transfers()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->num_transfers()); + } + + // optional uint32 reserved0 = 2 [default = 0]; + if (has_reserved0()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->reserved0()); + } + + } + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void BDMAOpDesc::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const BDMAOpDesc* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void BDMAOpDesc::MergeFrom(const BDMAOpDesc& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_num_transfers()) { + set_num_transfers(from.num_transfers()); + } + if (from.has_reserved0()) { + set_reserved0(from.reserved0()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void BDMAOpDesc::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void BDMAOpDesc::CopyFrom(const BDMAOpDesc& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool BDMAOpDesc::IsInitialized() const { + if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false; + + return true; +} + +void BDMAOpDesc::Swap(BDMAOpDesc* other) { + if (other != this) { + std::swap(num_transfers_, other->num_transfers_); + std::swap(reserved0_, other->reserved0_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::google::protobuf::Metadata BDMAOpDesc::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = BDMAOpDesc_descriptor_; + metadata.reflection = BDMAOpDesc_reflection_; + return metadata; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int CVTParam::kScaleFieldNumber; +const int CVTParam::kTruncateFieldNumber; +const int CVTParam::kEnableFieldNumber; +const int CVTParam::kOffsetFieldNumber; +#endif // !_MSC_VER + +CVTParam::CVTParam() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:nvdla_prototest_interface.CVTParam) +} + +void CVTParam::InitAsDefaultInstance() { +} + +CVTParam::CVTParam(const CVTParam& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:nvdla_prototest_interface.CVTParam) +} + +void CVTParam::SharedCtor() { + _cached_size_ = 0; + scale_ = 0; + truncate_ = 0u; + enable_ = 0u; + offset_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +CVTParam::~CVTParam() { + // @@protoc_insertion_point(destructor:nvdla_prototest_interface.CVTParam) + SharedDtor(); +} + +void CVTParam::SharedDtor() { + if (this != default_instance_) { + } +} + +void CVTParam::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* CVTParam::descriptor() { + protobuf_AssignDescriptorsOnce(); + return CVTParam_descriptor_; +} + +const CVTParam& CVTParam::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_DlaPrototestInterface_2eproto(); + return *default_instance_; +} + +CVTParam* CVTParam::default_instance_ = NULL; + +CVTParam* CVTParam::New() const { + return new CVTParam; +} + +void CVTParam::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + ZR_(scale_, offset_); + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool CVTParam::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:nvdla_prototest_interface.CVTParam) + 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)) { + // required int32 scale = 1; + case 1: { + if (tag == 8) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &scale_))); + set_has_scale(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_truncate; + break; + } + + // required uint32 truncate = 2; + case 2: { + if (tag == 16) { + parse_truncate: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &truncate_))); + set_has_truncate(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(24)) goto parse_enable; + break; + } + + // required uint32 enable = 3; + case 3: { + if (tag == 24) { + parse_enable: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &enable_))); + set_has_enable(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(32)) goto parse_offset; + break; + } + + // required int32 offset = 4; + case 4: { + if (tag == 32) { + parse_offset: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &offset_))); + set_has_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:nvdla_prototest_interface.CVTParam) + return true; +failure: + // @@protoc_insertion_point(parse_failure:nvdla_prototest_interface.CVTParam) + return false; +#undef DO_ +} + +void CVTParam::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:nvdla_prototest_interface.CVTParam) + // required int32 scale = 1; + if (has_scale()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->scale(), output); + } + + // required uint32 truncate = 2; + if (has_truncate()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->truncate(), output); + } + + // required uint32 enable = 3; + if (has_enable()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->enable(), output); + } + + // required int32 offset = 4; + if (has_offset()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(4, this->offset(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:nvdla_prototest_interface.CVTParam) +} + +::google::protobuf::uint8* CVTParam::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:nvdla_prototest_interface.CVTParam) + // required int32 scale = 1; + if (has_scale()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->scale(), target); + } + + // required uint32 truncate = 2; + if (has_truncate()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->truncate(), target); + } + + // required uint32 enable = 3; + if (has_enable()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->enable(), target); + } + + // required int32 offset = 4; + if (has_offset()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(4, this->offset(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:nvdla_prototest_interface.CVTParam) + return target; +} + +int CVTParam::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // required int32 scale = 1; + if (has_scale()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->scale()); + } + + // required uint32 truncate = 2; + if (has_truncate()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->truncate()); + } + + // required uint32 enable = 3; + if (has_enable()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->enable()); + } + + // required int32 offset = 4; + if (has_offset()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->offset()); + } + + } + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void CVTParam::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const CVTParam* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void CVTParam::MergeFrom(const CVTParam& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_scale()) { + set_scale(from.scale()); + } + if (from.has_truncate()) { + set_truncate(from.truncate()); + } + if (from.has_enable()) { + set_enable(from.enable()); + } + if (from.has_offset()) { + set_offset(from.offset()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void CVTParam::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void CVTParam::CopyFrom(const CVTParam& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool CVTParam::IsInitialized() const { + if ((_has_bits_[0] & 0x0000000f) != 0x0000000f) return false; + + return true; +} + +void CVTParam::Swap(CVTParam* other) { + if (other != this) { + std::swap(scale_, other->scale_); + std::swap(truncate_, other->truncate_); + std::swap(enable_, other->enable_); + std::swap(offset_, other->offset_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::google::protobuf::Metadata CVTParam::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = CVTParam_descriptor_; + metadata.reflection = CVTParam_reflection_; + return metadata; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int MemInfo::kMemIdFieldNumber; +const int MemInfo::kMemSizeFieldNumber; +const int MemInfo::kOffsetFieldNumber; +const int MemInfo::kFillTypeFieldNumber; +const int MemInfo::kFillerFieldNumber; +const int MemInfo::kFlagFieldNumber; +const int MemInfo::kPrecisionFieldNumber; +const int MemInfo::kSwDilationXFieldNumber; +const int MemInfo::kSwDilationYFieldNumber; +#endif // !_MSC_VER + +MemInfo::MemInfo() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:nvdla_prototest_interface.MemInfo) +} + +void MemInfo::InitAsDefaultInstance() { + filler_ = const_cast< ::nvdla_prototest_interface::DataFiller*>(&::nvdla_prototest_interface::DataFiller::default_instance()); +} + +MemInfo::MemInfo(const MemInfo& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:nvdla_prototest_interface.MemInfo) +} + +void MemInfo::SharedCtor() { + _cached_size_ = 0; + mem_id_ = -1; + mem_size_ = 0u; + offset_ = 0u; + fill_type_ = 0; + filler_ = NULL; + flag_ = 0; + precision_ = 0; + sw_dilation_x_ = 1u; + sw_dilation_y_ = 1u; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +MemInfo::~MemInfo() { + // @@protoc_insertion_point(destructor:nvdla_prototest_interface.MemInfo) + SharedDtor(); +} + +void MemInfo::SharedDtor() { + if (this != default_instance_) { + delete filler_; + } +} + +void MemInfo::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* MemInfo::descriptor() { + protobuf_AssignDescriptorsOnce(); + return MemInfo_descriptor_; +} + +const MemInfo& MemInfo::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_DlaPrototestInterface_2eproto(); + return *default_instance_; +} + +MemInfo* MemInfo::default_instance_ = NULL; + +MemInfo* MemInfo::New() const { + return new MemInfo; +} + +void MemInfo::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 255) { + ZR_(mem_size_, fill_type_); + ZR_(flag_, precision_); + mem_id_ = -1; + if (has_filler()) { + if (filler_ != NULL) filler_->::nvdla_prototest_interface::DataFiller::Clear(); + } + sw_dilation_x_ = 1u; + } + sw_dilation_y_ = 1u; + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool MemInfo::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:nvdla_prototest_interface.MemInfo) + 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)) { + // required int32 mem_id = 1 [default = -1]; + case 1: { + if (tag == 8) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &mem_id_))); + set_has_mem_id(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_mem_size; + break; + } + + // required uint32 mem_size = 2 [default = 0]; + case 2: { + if (tag == 16) { + parse_mem_size: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &mem_size_))); + set_has_mem_size(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(24)) goto parse_offset; + break; + } + + // required uint32 offset = 3 [default = 0]; + case 3: { + if (tag == 24) { + parse_offset: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &offset_))); + set_has_offset(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(32)) goto parse_fill_type; + break; + } + + // optional .nvdla_prototest_interface.FillerType fill_type = 4 [default = FILL_NONE]; + case 4: { + if (tag == 32) { + parse_fill_type: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::nvdla_prototest_interface::FillerType_IsValid(value)) { + set_fill_type(static_cast< ::nvdla_prototest_interface::FillerType >(value)); + } else { + mutable_unknown_fields()->AddVarint(4, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(42)) goto parse_filler; + break; + } + + // optional .nvdla_prototest_interface.DataFiller filler = 5; + case 5: { + if (tag == 42) { + parse_filler: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_filler())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(48)) goto parse_flag; + break; + } + + // optional .nvdla_prototest_interface.MemFlag flag = 6 [default = DLA_MEM_ALLOC]; + case 6: { + if (tag == 48) { + parse_flag: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::nvdla_prototest_interface::MemFlag_IsValid(value)) { + set_flag(static_cast< ::nvdla_prototest_interface::MemFlag >(value)); + } else { + mutable_unknown_fields()->AddVarint(6, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(56)) goto parse_precision; + break; + } + + // optional .nvdla_prototest_interface.DataPrecision precision = 7 [default = PRECISION_INT8]; + case 7: { + if (tag == 56) { + parse_precision: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::nvdla_prototest_interface::DataPrecision_IsValid(value)) { + set_precision(static_cast< ::nvdla_prototest_interface::DataPrecision >(value)); + } else { + mutable_unknown_fields()->AddVarint(7, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(64)) goto parse_sw_dilation_x; + break; + } + + // optional uint32 sw_dilation_x = 8 [default = 1]; + case 8: { + if (tag == 64) { + parse_sw_dilation_x: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &sw_dilation_x_))); + set_has_sw_dilation_x(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(72)) goto parse_sw_dilation_y; + break; + } + + // optional uint32 sw_dilation_y = 9 [default = 1]; + case 9: { + if (tag == 72) { + parse_sw_dilation_y: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &sw_dilation_y_))); + set_has_sw_dilation_y(); + } 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:nvdla_prototest_interface.MemInfo) + return true; +failure: + // @@protoc_insertion_point(parse_failure:nvdla_prototest_interface.MemInfo) + return false; +#undef DO_ +} + +void MemInfo::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:nvdla_prototest_interface.MemInfo) + // required int32 mem_id = 1 [default = -1]; + if (has_mem_id()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->mem_id(), output); + } + + // required uint32 mem_size = 2 [default = 0]; + if (has_mem_size()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->mem_size(), output); + } + + // required uint32 offset = 3 [default = 0]; + if (has_offset()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->offset(), output); + } + + // optional .nvdla_prototest_interface.FillerType fill_type = 4 [default = FILL_NONE]; + if (has_fill_type()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 4, this->fill_type(), output); + } + + // optional .nvdla_prototest_interface.DataFiller filler = 5; + if (has_filler()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 5, this->filler(), output); + } + + // optional .nvdla_prototest_interface.MemFlag flag = 6 [default = DLA_MEM_ALLOC]; + if (has_flag()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 6, this->flag(), output); + } + + // optional .nvdla_prototest_interface.DataPrecision precision = 7 [default = PRECISION_INT8]; + if (has_precision()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 7, this->precision(), output); + } + + // optional uint32 sw_dilation_x = 8 [default = 1]; + if (has_sw_dilation_x()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(8, this->sw_dilation_x(), output); + } + + // optional uint32 sw_dilation_y = 9 [default = 1]; + if (has_sw_dilation_y()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(9, this->sw_dilation_y(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:nvdla_prototest_interface.MemInfo) +} + +::google::protobuf::uint8* MemInfo::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:nvdla_prototest_interface.MemInfo) + // required int32 mem_id = 1 [default = -1]; + if (has_mem_id()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->mem_id(), target); + } + + // required uint32 mem_size = 2 [default = 0]; + if (has_mem_size()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->mem_size(), target); + } + + // required uint32 offset = 3 [default = 0]; + if (has_offset()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->offset(), target); + } + + // optional .nvdla_prototest_interface.FillerType fill_type = 4 [default = FILL_NONE]; + if (has_fill_type()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 4, this->fill_type(), target); + } + + // optional .nvdla_prototest_interface.DataFiller filler = 5; + if (has_filler()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 5, this->filler(), target); + } + + // optional .nvdla_prototest_interface.MemFlag flag = 6 [default = DLA_MEM_ALLOC]; + if (has_flag()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 6, this->flag(), target); + } + + // optional .nvdla_prototest_interface.DataPrecision precision = 7 [default = PRECISION_INT8]; + if (has_precision()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 7, this->precision(), target); + } + + // optional uint32 sw_dilation_x = 8 [default = 1]; + if (has_sw_dilation_x()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(8, this->sw_dilation_x(), target); + } + + // optional uint32 sw_dilation_y = 9 [default = 1]; + if (has_sw_dilation_y()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(9, this->sw_dilation_y(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:nvdla_prototest_interface.MemInfo) + return target; +} + +int MemInfo::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // required int32 mem_id = 1 [default = -1]; + if (has_mem_id()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->mem_id()); + } + + // required uint32 mem_size = 2 [default = 0]; + if (has_mem_size()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->mem_size()); + } + + // required uint32 offset = 3 [default = 0]; + if (has_offset()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->offset()); + } + + // optional .nvdla_prototest_interface.FillerType fill_type = 4 [default = FILL_NONE]; + if (has_fill_type()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->fill_type()); + } + + // optional .nvdla_prototest_interface.DataFiller filler = 5; + if (has_filler()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->filler()); + } + + // optional .nvdla_prototest_interface.MemFlag flag = 6 [default = DLA_MEM_ALLOC]; + if (has_flag()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->flag()); + } + + // optional .nvdla_prototest_interface.DataPrecision precision = 7 [default = PRECISION_INT8]; + if (has_precision()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->precision()); + } + + // optional uint32 sw_dilation_x = 8 [default = 1]; + if (has_sw_dilation_x()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->sw_dilation_x()); + } + + } + if (_has_bits_[8 / 32] & (0xffu << (8 % 32))) { + // optional uint32 sw_dilation_y = 9 [default = 1]; + if (has_sw_dilation_y()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->sw_dilation_y()); + } + + } + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void MemInfo::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const MemInfo* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void MemInfo::MergeFrom(const MemInfo& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_mem_id()) { + set_mem_id(from.mem_id()); + } + if (from.has_mem_size()) { + set_mem_size(from.mem_size()); + } + if (from.has_offset()) { + set_offset(from.offset()); + } + if (from.has_fill_type()) { + set_fill_type(from.fill_type()); + } + if (from.has_filler()) { + mutable_filler()->::nvdla_prototest_interface::DataFiller::MergeFrom(from.filler()); + } + if (from.has_flag()) { + set_flag(from.flag()); + } + if (from.has_precision()) { + set_precision(from.precision()); + } + if (from.has_sw_dilation_x()) { + set_sw_dilation_x(from.sw_dilation_x()); + } + } + if (from._has_bits_[8 / 32] & (0xffu << (8 % 32))) { + if (from.has_sw_dilation_y()) { + set_sw_dilation_y(from.sw_dilation_y()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void MemInfo::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void MemInfo::CopyFrom(const MemInfo& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool MemInfo::IsInitialized() const { + if ((_has_bits_[0] & 0x00000007) != 0x00000007) return false; + + if (has_filler()) { + if (!this->filler().IsInitialized()) return false; + } + return true; +} + +void MemInfo::Swap(MemInfo* other) { + if (other != this) { + std::swap(mem_id_, other->mem_id_); + std::swap(mem_size_, other->mem_size_); + std::swap(offset_, other->offset_); + std::swap(fill_type_, other->fill_type_); + std::swap(filler_, other->filler_); + std::swap(flag_, other->flag_); + std::swap(precision_, other->precision_); + std::swap(sw_dilation_x_, other->sw_dilation_x_); + std::swap(sw_dilation_y_, other->sw_dilation_y_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::google::protobuf::Metadata MemInfo::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = MemInfo_descriptor_; + metadata.reflection = MemInfo_reflection_; + return metadata; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int DataCube::kReserved0FieldNumber; +const int DataCube::kTypeFieldNumber; +const int DataCube::kAddressFieldNumber; +const int DataCube::kSizeFieldNumber; +const int DataCube::kWidthFieldNumber; +const int DataCube::kHeightFieldNumber; +const int DataCube::kChannelFieldNumber; +const int DataCube::kReserved1FieldNumber; +const int DataCube::kLineStrideFieldNumber; +const int DataCube::kSurfStrideFieldNumber; +const int DataCube::kPlaneStrideFieldNumber; +const int DataCube::kMemInfoFieldNumber; +#endif // !_MSC_VER + +DataCube::DataCube() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:nvdla_prototest_interface.DataCube) +} + +void DataCube::InitAsDefaultInstance() { + mem_info_ = const_cast< ::nvdla_prototest_interface::MemInfo*>(&::nvdla_prototest_interface::MemInfo::default_instance()); +} + +DataCube::DataCube(const DataCube& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:nvdla_prototest_interface.DataCube) +} + +void DataCube::SharedCtor() { + _cached_size_ = 0; + reserved0_ = 0u; + type_ = 0; + address_ = 0; + size_ = 0u; + width_ = 0u; + height_ = 0u; + channel_ = 0u; + reserved1_ = 0u; + line_stride_ = 0u; + surf_stride_ = 0u; + plane_stride_ = 0u; + mem_info_ = NULL; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +DataCube::~DataCube() { + // @@protoc_insertion_point(destructor:nvdla_prototest_interface.DataCube) + SharedDtor(); +} + +void DataCube::SharedDtor() { + if (this != default_instance_) { + delete mem_info_; + } +} + +void DataCube::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* DataCube::descriptor() { + protobuf_AssignDescriptorsOnce(); + return DataCube_descriptor_; +} + +const DataCube& DataCube::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_DlaPrototestInterface_2eproto(); + return *default_instance_; +} + +DataCube* DataCube::default_instance_ = NULL; + +DataCube* DataCube::New() const { + return new DataCube; +} + +void DataCube::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 255) { + ZR_(reserved0_, reserved1_); + } + if (_has_bits_[8 / 32] & 3840) { + ZR_(line_stride_, surf_stride_); + plane_stride_ = 0u; + if (has_mem_info()) { + if (mem_info_ != NULL) mem_info_->::nvdla_prototest_interface::MemInfo::Clear(); + } + } + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool DataCube::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:nvdla_prototest_interface.DataCube) + 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 reserved0 = 1 [default = 0]; + case 1: { + if (tag == 8) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &reserved0_))); + set_has_reserved0(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_type; + break; + } + + // required .nvdla_prototest_interface.MemType type = 2; + case 2: { + if (tag == 16) { + parse_type: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::nvdla_prototest_interface::MemType_IsValid(value)) { + set_type(static_cast< ::nvdla_prototest_interface::MemType >(value)); + } else { + mutable_unknown_fields()->AddVarint(2, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(24)) goto parse_address; + break; + } + + // required int32 address = 3; + case 3: { + if (tag == 24) { + parse_address: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &address_))); + set_has_address(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(32)) goto parse_size; + break; + } + + // required uint32 size = 4; + case 4: { + if (tag == 32) { + parse_size: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &size_))); + set_has_size(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(40)) goto parse_width; + break; + } + + // required uint32 width = 5; + case 5: { + if (tag == 40) { + parse_width: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &width_))); + set_has_width(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(48)) goto parse_height; + break; + } + + // required uint32 height = 6; + case 6: { + if (tag == 48) { + parse_height: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &height_))); + set_has_height(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(56)) goto parse_channel; + break; + } + + // required uint32 channel = 7; + case 7: { + if (tag == 56) { + parse_channel: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &channel_))); + set_has_channel(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(64)) goto parse_reserved1; + break; + } + + // optional uint32 reserved1 = 8 [default = 0]; + case 8: { + if (tag == 64) { + parse_reserved1: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &reserved1_))); + set_has_reserved1(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(72)) goto parse_line_stride; + break; + } + + // required uint32 line_stride = 9; + case 9: { + if (tag == 72) { + parse_line_stride: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &line_stride_))); + set_has_line_stride(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(80)) goto parse_surf_stride; + break; + } + + // required uint32 surf_stride = 10; + case 10: { + if (tag == 80) { + parse_surf_stride: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &surf_stride_))); + set_has_surf_stride(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(88)) goto parse_plane_stride; + break; + } + + // required uint32 plane_stride = 11; + case 11: { + if (tag == 88) { + parse_plane_stride: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &plane_stride_))); + set_has_plane_stride(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(98)) goto parse_mem_info; + break; + } + + // required .nvdla_prototest_interface.MemInfo mem_info = 12; + case 12: { + if (tag == 98) { + parse_mem_info: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_mem_info())); + } 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:nvdla_prototest_interface.DataCube) + return true; +failure: + // @@protoc_insertion_point(parse_failure:nvdla_prototest_interface.DataCube) + return false; +#undef DO_ +} + +void DataCube::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:nvdla_prototest_interface.DataCube) + // optional uint32 reserved0 = 1 [default = 0]; + if (has_reserved0()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->reserved0(), output); + } + + // required .nvdla_prototest_interface.MemType type = 2; + if (has_type()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 2, this->type(), output); + } + + // required int32 address = 3; + if (has_address()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->address(), output); + } + + // required uint32 size = 4; + if (has_size()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(4, this->size(), output); + } + + // required uint32 width = 5; + if (has_width()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(5, this->width(), output); + } + + // required uint32 height = 6; + if (has_height()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(6, this->height(), output); + } + + // required uint32 channel = 7; + if (has_channel()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(7, this->channel(), output); + } + + // optional uint32 reserved1 = 8 [default = 0]; + if (has_reserved1()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(8, this->reserved1(), output); + } + + // required uint32 line_stride = 9; + if (has_line_stride()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(9, this->line_stride(), output); + } + + // required uint32 surf_stride = 10; + if (has_surf_stride()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(10, this->surf_stride(), output); + } + + // required uint32 plane_stride = 11; + if (has_plane_stride()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(11, this->plane_stride(), output); + } + + // required .nvdla_prototest_interface.MemInfo mem_info = 12; + if (has_mem_info()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 12, this->mem_info(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:nvdla_prototest_interface.DataCube) +} + +::google::protobuf::uint8* DataCube::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:nvdla_prototest_interface.DataCube) + // optional uint32 reserved0 = 1 [default = 0]; + if (has_reserved0()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->reserved0(), target); + } + + // required .nvdla_prototest_interface.MemType type = 2; + if (has_type()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 2, this->type(), target); + } + + // required int32 address = 3; + if (has_address()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->address(), target); + } + + // required uint32 size = 4; + if (has_size()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(4, this->size(), target); + } + + // required uint32 width = 5; + if (has_width()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(5, this->width(), target); + } + + // required uint32 height = 6; + if (has_height()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(6, this->height(), target); + } + + // required uint32 channel = 7; + if (has_channel()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(7, this->channel(), target); + } + + // optional uint32 reserved1 = 8 [default = 0]; + if (has_reserved1()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(8, this->reserved1(), target); + } + + // required uint32 line_stride = 9; + if (has_line_stride()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(9, this->line_stride(), target); + } + + // required uint32 surf_stride = 10; + if (has_surf_stride()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(10, this->surf_stride(), target); + } + + // required uint32 plane_stride = 11; + if (has_plane_stride()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(11, this->plane_stride(), target); + } + + // required .nvdla_prototest_interface.MemInfo mem_info = 12; + if (has_mem_info()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 12, this->mem_info(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:nvdla_prototest_interface.DataCube) + return target; +} + +int DataCube::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional uint32 reserved0 = 1 [default = 0]; + if (has_reserved0()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->reserved0()); + } + + // required .nvdla_prototest_interface.MemType type = 2; + if (has_type()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->type()); + } + + // required int32 address = 3; + if (has_address()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->address()); + } + + // required uint32 size = 4; + if (has_size()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->size()); + } + + // required uint32 width = 5; + if (has_width()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->width()); + } + + // required uint32 height = 6; + if (has_height()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->height()); + } + + // required uint32 channel = 7; + if (has_channel()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->channel()); + } + + // optional uint32 reserved1 = 8 [default = 0]; + if (has_reserved1()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->reserved1()); + } + + } + if (_has_bits_[8 / 32] & (0xffu << (8 % 32))) { + // required uint32 line_stride = 9; + if (has_line_stride()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->line_stride()); + } + + // required uint32 surf_stride = 10; + if (has_surf_stride()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->surf_stride()); + } + + // required uint32 plane_stride = 11; + if (has_plane_stride()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->plane_stride()); + } + + // required .nvdla_prototest_interface.MemInfo mem_info = 12; + if (has_mem_info()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->mem_info()); + } + + } + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void DataCube::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const DataCube* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void DataCube::MergeFrom(const DataCube& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_reserved0()) { + set_reserved0(from.reserved0()); + } + if (from.has_type()) { + set_type(from.type()); + } + if (from.has_address()) { + set_address(from.address()); + } + if (from.has_size()) { + set_size(from.size()); + } + if (from.has_width()) { + set_width(from.width()); + } + if (from.has_height()) { + set_height(from.height()); + } + if (from.has_channel()) { + set_channel(from.channel()); + } + if (from.has_reserved1()) { + set_reserved1(from.reserved1()); + } + } + if (from._has_bits_[8 / 32] & (0xffu << (8 % 32))) { + if (from.has_line_stride()) { + set_line_stride(from.line_stride()); + } + if (from.has_surf_stride()) { + set_surf_stride(from.surf_stride()); + } + if (from.has_plane_stride()) { + set_plane_stride(from.plane_stride()); + } + if (from.has_mem_info()) { + mutable_mem_info()->::nvdla_prototest_interface::MemInfo::MergeFrom(from.mem_info()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void DataCube::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void DataCube::CopyFrom(const DataCube& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool DataCube::IsInitialized() const { + if ((_has_bits_[0] & 0x00000f7e) != 0x00000f7e) return false; + + if (has_mem_info()) { + if (!this->mem_info().IsInitialized()) return false; + } + return true; +} + +void DataCube::Swap(DataCube* other) { + if (other != this) { + std::swap(reserved0_, other->reserved0_); + std::swap(type_, other->type_); + std::swap(address_, other->address_); + std::swap(size_, other->size_); + std::swap(width_, other->width_); + std::swap(height_, other->height_); + std::swap(channel_, other->channel_); + std::swap(reserved1_, other->reserved1_); + std::swap(line_stride_, other->line_stride_); + std::swap(surf_stride_, other->surf_stride_); + std::swap(plane_stride_, other->plane_stride_); + std::swap(mem_info_, other->mem_info_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::google::protobuf::Metadata DataCube::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = DataCube_descriptor_; + metadata.reflection = DataCube_reflection_; + return metadata; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int CONVSurfaceDesc::kWeightDataFieldNumber; +const int CONVSurfaceDesc::kWmbDataFieldNumber; +const int CONVSurfaceDesc::kWgsDataFieldNumber; +const int CONVSurfaceDesc::kSrcDataFieldNumber; +const int CONVSurfaceDesc::kDstDataFieldNumber; +const int CONVSurfaceDesc::kOffsetUFieldNumber; +const int CONVSurfaceDesc::kInLineUvStrideFieldNumber; +#endif // !_MSC_VER + +CONVSurfaceDesc::CONVSurfaceDesc() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:nvdla_prototest_interface.CONVSurfaceDesc) +} + +void CONVSurfaceDesc::InitAsDefaultInstance() { + weight_data_ = const_cast< ::nvdla_prototest_interface::DataCube*>(&::nvdla_prototest_interface::DataCube::default_instance()); + wmb_data_ = const_cast< ::nvdla_prototest_interface::DataCube*>(&::nvdla_prototest_interface::DataCube::default_instance()); + wgs_data_ = const_cast< ::nvdla_prototest_interface::DataCube*>(&::nvdla_prototest_interface::DataCube::default_instance()); + src_data_ = const_cast< ::nvdla_prototest_interface::DataCube*>(&::nvdla_prototest_interface::DataCube::default_instance()); + dst_data_ = const_cast< ::nvdla_prototest_interface::DataCube*>(&::nvdla_prototest_interface::DataCube::default_instance()); +} + +CONVSurfaceDesc::CONVSurfaceDesc(const CONVSurfaceDesc& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:nvdla_prototest_interface.CONVSurfaceDesc) +} + +void CONVSurfaceDesc::SharedCtor() { + _cached_size_ = 0; + weight_data_ = NULL; + wmb_data_ = NULL; + wgs_data_ = NULL; + src_data_ = NULL; + dst_data_ = NULL; + offset_u_ = GOOGLE_LONGLONG(0); + in_line_uv_stride_ = 0u; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +CONVSurfaceDesc::~CONVSurfaceDesc() { + // @@protoc_insertion_point(destructor:nvdla_prototest_interface.CONVSurfaceDesc) + SharedDtor(); +} + +void CONVSurfaceDesc::SharedDtor() { + if (this != default_instance_) { + delete weight_data_; + delete wmb_data_; + delete wgs_data_; + delete src_data_; + delete dst_data_; + } +} + +void CONVSurfaceDesc::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* CONVSurfaceDesc::descriptor() { + protobuf_AssignDescriptorsOnce(); + return CONVSurfaceDesc_descriptor_; +} + +const CONVSurfaceDesc& CONVSurfaceDesc::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_DlaPrototestInterface_2eproto(); + return *default_instance_; +} + +CONVSurfaceDesc* CONVSurfaceDesc::default_instance_ = NULL; + +CONVSurfaceDesc* CONVSurfaceDesc::New() const { + return new CONVSurfaceDesc; +} + +void CONVSurfaceDesc::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 127) { + ZR_(offset_u_, in_line_uv_stride_); + if (has_weight_data()) { + if (weight_data_ != NULL) weight_data_->::nvdla_prototest_interface::DataCube::Clear(); + } + if (has_wmb_data()) { + if (wmb_data_ != NULL) wmb_data_->::nvdla_prototest_interface::DataCube::Clear(); + } + if (has_wgs_data()) { + if (wgs_data_ != NULL) wgs_data_->::nvdla_prototest_interface::DataCube::Clear(); + } + if (has_src_data()) { + if (src_data_ != NULL) src_data_->::nvdla_prototest_interface::DataCube::Clear(); + } + if (has_dst_data()) { + if (dst_data_ != NULL) dst_data_->::nvdla_prototest_interface::DataCube::Clear(); + } + } + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool CONVSurfaceDesc::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:nvdla_prototest_interface.CONVSurfaceDesc) + 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)) { + // required .nvdla_prototest_interface.DataCube weight_data = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_weight_data())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_wmb_data; + break; + } + + // optional .nvdla_prototest_interface.DataCube wmb_data = 2; + case 2: { + if (tag == 18) { + parse_wmb_data: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_wmb_data())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_wgs_data; + break; + } + + // optional .nvdla_prototest_interface.DataCube wgs_data = 3; + case 3: { + if (tag == 26) { + parse_wgs_data: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_wgs_data())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(34)) goto parse_src_data; + break; + } + + // required .nvdla_prototest_interface.DataCube src_data = 4; + case 4: { + if (tag == 34) { + parse_src_data: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_src_data())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(42)) goto parse_dst_data; + break; + } + + // required .nvdla_prototest_interface.DataCube dst_data = 5; + case 5: { + if (tag == 42) { + parse_dst_data: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_dst_data())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(48)) goto parse_offset_u; + break; + } + + // required int64 offset_u = 6; + case 6: { + if (tag == 48) { + parse_offset_u: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &offset_u_))); + set_has_offset_u(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(56)) goto parse_in_line_uv_stride; + break; + } + + // required uint32 in_line_uv_stride = 7; + case 7: { + if (tag == 56) { + parse_in_line_uv_stride: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &in_line_uv_stride_))); + set_has_in_line_uv_stride(); + } 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:nvdla_prototest_interface.CONVSurfaceDesc) + return true; +failure: + // @@protoc_insertion_point(parse_failure:nvdla_prototest_interface.CONVSurfaceDesc) + return false; +#undef DO_ +} + +void CONVSurfaceDesc::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:nvdla_prototest_interface.CONVSurfaceDesc) + // required .nvdla_prototest_interface.DataCube weight_data = 1; + if (has_weight_data()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->weight_data(), output); + } + + // optional .nvdla_prototest_interface.DataCube wmb_data = 2; + if (has_wmb_data()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->wmb_data(), output); + } + + // optional .nvdla_prototest_interface.DataCube wgs_data = 3; + if (has_wgs_data()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, this->wgs_data(), output); + } + + // required .nvdla_prototest_interface.DataCube src_data = 4; + if (has_src_data()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, this->src_data(), output); + } + + // required .nvdla_prototest_interface.DataCube dst_data = 5; + if (has_dst_data()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 5, this->dst_data(), output); + } + + // required int64 offset_u = 6; + if (has_offset_u()) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(6, this->offset_u(), output); + } + + // required uint32 in_line_uv_stride = 7; + if (has_in_line_uv_stride()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(7, this->in_line_uv_stride(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:nvdla_prototest_interface.CONVSurfaceDesc) +} + +::google::protobuf::uint8* CONVSurfaceDesc::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:nvdla_prototest_interface.CONVSurfaceDesc) + // required .nvdla_prototest_interface.DataCube weight_data = 1; + if (has_weight_data()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 1, this->weight_data(), target); + } + + // optional .nvdla_prototest_interface.DataCube wmb_data = 2; + if (has_wmb_data()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 2, this->wmb_data(), target); + } + + // optional .nvdla_prototest_interface.DataCube wgs_data = 3; + if (has_wgs_data()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 3, this->wgs_data(), target); + } + + // required .nvdla_prototest_interface.DataCube src_data = 4; + if (has_src_data()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 4, this->src_data(), target); + } + + // required .nvdla_prototest_interface.DataCube dst_data = 5; + if (has_dst_data()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 5, this->dst_data(), target); + } + + // required int64 offset_u = 6; + if (has_offset_u()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(6, this->offset_u(), target); + } + + // required uint32 in_line_uv_stride = 7; + if (has_in_line_uv_stride()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(7, this->in_line_uv_stride(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:nvdla_prototest_interface.CONVSurfaceDesc) + return target; +} + +int CONVSurfaceDesc::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // required .nvdla_prototest_interface.DataCube weight_data = 1; + if (has_weight_data()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->weight_data()); + } + + // optional .nvdla_prototest_interface.DataCube wmb_data = 2; + if (has_wmb_data()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->wmb_data()); + } + + // optional .nvdla_prototest_interface.DataCube wgs_data = 3; + if (has_wgs_data()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->wgs_data()); + } + + // required .nvdla_prototest_interface.DataCube src_data = 4; + if (has_src_data()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->src_data()); + } + + // required .nvdla_prototest_interface.DataCube dst_data = 5; + if (has_dst_data()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->dst_data()); + } + + // required int64 offset_u = 6; + if (has_offset_u()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->offset_u()); + } + + // required uint32 in_line_uv_stride = 7; + if (has_in_line_uv_stride()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->in_line_uv_stride()); + } + + } + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void CONVSurfaceDesc::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const CONVSurfaceDesc* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void CONVSurfaceDesc::MergeFrom(const CONVSurfaceDesc& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_weight_data()) { + mutable_weight_data()->::nvdla_prototest_interface::DataCube::MergeFrom(from.weight_data()); + } + if (from.has_wmb_data()) { + mutable_wmb_data()->::nvdla_prototest_interface::DataCube::MergeFrom(from.wmb_data()); + } + if (from.has_wgs_data()) { + mutable_wgs_data()->::nvdla_prototest_interface::DataCube::MergeFrom(from.wgs_data()); + } + if (from.has_src_data()) { + mutable_src_data()->::nvdla_prototest_interface::DataCube::MergeFrom(from.src_data()); + } + if (from.has_dst_data()) { + mutable_dst_data()->::nvdla_prototest_interface::DataCube::MergeFrom(from.dst_data()); + } + if (from.has_offset_u()) { + set_offset_u(from.offset_u()); + } + if (from.has_in_line_uv_stride()) { + set_in_line_uv_stride(from.in_line_uv_stride()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void CONVSurfaceDesc::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void CONVSurfaceDesc::CopyFrom(const CONVSurfaceDesc& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool CONVSurfaceDesc::IsInitialized() const { + if ((_has_bits_[0] & 0x00000079) != 0x00000079) return false; + + if (has_weight_data()) { + if (!this->weight_data().IsInitialized()) return false; + } + if (has_wmb_data()) { + if (!this->wmb_data().IsInitialized()) return false; + } + if (has_wgs_data()) { + if (!this->wgs_data().IsInitialized()) return false; + } + if (has_src_data()) { + if (!this->src_data().IsInitialized()) return false; + } + if (has_dst_data()) { + if (!this->dst_data().IsInitialized()) return false; + } + return true; +} + +void CONVSurfaceDesc::Swap(CONVSurfaceDesc* other) { + if (other != this) { + std::swap(weight_data_, other->weight_data_); + std::swap(wmb_data_, other->wmb_data_); + std::swap(wgs_data_, other->wgs_data_); + std::swap(src_data_, other->src_data_); + std::swap(dst_data_, other->dst_data_); + std::swap(offset_u_, other->offset_u_); + std::swap(in_line_uv_stride_, other->in_line_uv_stride_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::google::protobuf::Metadata CONVSurfaceDesc::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = CONVSurfaceDesc_descriptor_; + metadata.reflection = CONVSurfaceDesc_reflection_; + return metadata; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int CONVOpDesc::kConvModeFieldNumber; +const int CONVOpDesc::kDataReuseFieldNumber; +const int CONVOpDesc::kWeightReuseFieldNumber; +const int CONVOpDesc::kSkipDataRlsFieldNumber; +const int CONVOpDesc::kSkipWeightRlsFieldNumber; +const int CONVOpDesc::kReserved0FieldNumber; +const int CONVOpDesc::kEntryPerSliceFieldNumber; +const int CONVOpDesc::kDataFormatFieldNumber; +const int CONVOpDesc::kPixelMappingFieldNumber; +const int CONVOpDesc::kFetchGrainFieldNumber; +const int CONVOpDesc::kPixelOffsetXFieldNumber; +const int CONVOpDesc::kPixelOffsetYFieldNumber; +const int CONVOpDesc::kGobPerLineFieldNumber; +const int CONVOpDesc::kGobHeightFieldNumber; +const int CONVOpDesc::kGobYIndexFieldNumber; +const int CONVOpDesc::kGobPerUvLineFieldNumber; +const int CONVOpDesc::kBatchFieldNumber; +const int CONVOpDesc::kWeightFormatFieldNumber; +const int CONVOpDesc::kDataBankFieldNumber; +const int CONVOpDesc::kWeightBankFieldNumber; +const int CONVOpDesc::kBatchStrideFieldNumber; +const int CONVOpDesc::kPostExtensionFieldNumber; +const int CONVOpDesc::kPixelOverrideFieldNumber; +const int CONVOpDesc::kReleaseFieldNumber; +const int CONVOpDesc::kInputWidthCscFieldNumber; +const int CONVOpDesc::kInputHeightCscFieldNumber; +const int CONVOpDesc::kInputChannelCscFieldNumber; +const int CONVOpDesc::kKernelWidthCscFieldNumber; +const int CONVOpDesc::kKernelHeightCscFieldNumber; +const int CONVOpDesc::kKernelChannelCscFieldNumber; +const int CONVOpDesc::kInputWidthCmacFieldNumber; +const int CONVOpDesc::kInputHeightCmacFieldNumber; +const int CONVOpDesc::kBytesPerKernelFieldNumber; +const int CONVOpDesc::kMeanRyFieldNumber; +const int CONVOpDesc::kMeanGuFieldNumber; +const int CONVOpDesc::kMeanBvFieldNumber; +const int CONVOpDesc::kMeanAxFieldNumber; +const int CONVOpDesc::kMeanFormatFieldNumber; +const int CONVOpDesc::kConvStrideXFieldNumber; +const int CONVOpDesc::kConvStrideYFieldNumber; +const int CONVOpDesc::kPadXLeftFieldNumber; +const int CONVOpDesc::kPadXRightFieldNumber; +const int CONVOpDesc::kPadYTopFieldNumber; +const int CONVOpDesc::kPadYBottomFieldNumber; +const int CONVOpDesc::kDilationXFieldNumber; +const int CONVOpDesc::kDilationYFieldNumber; +const int CONVOpDesc::kReserved2FieldNumber; +const int CONVOpDesc::kPraTruncateFieldNumber; +const int CONVOpDesc::kInPrecisionFieldNumber; +const int CONVOpDesc::kOutPrecisionFieldNumber; +const int CONVOpDesc::kPadValFieldNumber; +const int CONVOpDesc::kInCvtFieldNumber; +const int CONVOpDesc::kOutCvtFieldNumber; +#endif // !_MSC_VER + +CONVOpDesc::CONVOpDesc() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:nvdla_prototest_interface.CONVOpDesc) +} + +void CONVOpDesc::InitAsDefaultInstance() { + in_cvt_ = const_cast< ::nvdla_prototest_interface::CVTParam*>(&::nvdla_prototest_interface::CVTParam::default_instance()); + out_cvt_ = const_cast< ::nvdla_prototest_interface::CVTParam*>(&::nvdla_prototest_interface::CVTParam::default_instance()); +} + +CONVOpDesc::CONVOpDesc(const CONVOpDesc& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:nvdla_prototest_interface.CONVOpDesc) +} + +void CONVOpDesc::SharedCtor() { + _cached_size_ = 0; + conv_mode_ = 0; + data_reuse_ = 0u; + weight_reuse_ = 0u; + skip_data_rls_ = 0u; + skip_weight_rls_ = 0u; + reserved0_ = 0u; + entry_per_slice_ = 0u; + data_format_ = 0; + pixel_mapping_ = 0u; + fetch_grain_ = 0u; + pixel_offset_x_ = 0u; + pixel_offset_y_ = 0u; + gob_per_line_ = 0u; + gob_height_ = 0u; + gob_y_index_ = 0u; + gob_per_uv_line_ = 0u; + batch_ = 0u; + weight_format_ = 0; + data_bank_ = 0u; + weight_bank_ = 0u; + batch_stride_ = 0u; + post_extension_ = 0u; + pixel_override_ = 0; + release_ = 0u; + input_width_csc_ = 0u; + input_height_csc_ = 0u; + input_channel_csc_ = 0u; + kernel_width_csc_ = 0u; + kernel_height_csc_ = 0u; + kernel_channel_csc_ = 0u; + input_width_cmac_ = 0u; + input_height_cmac_ = 0u; + bytes_per_kernel_ = 0u; + mean_ry_ = 0; + mean_gu_ = 0; + mean_bv_ = 0; + mean_ax_ = 0; + mean_format_ = 0; + conv_stride_x_ = 0u; + conv_stride_y_ = 0u; + pad_x_left_ = 0u; + pad_x_right_ = 0u; + pad_y_top_ = 0u; + pad_y_bottom_ = 0u; + dilation_x_ = 0u; + dilation_y_ = 0u; + pra_truncate_ = 0u; + in_precision_ = 0; + out_precision_ = 0; + pad_val_ = 0; + in_cvt_ = NULL; + out_cvt_ = NULL; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +CONVOpDesc::~CONVOpDesc() { + // @@protoc_insertion_point(destructor:nvdla_prototest_interface.CONVOpDesc) + SharedDtor(); +} + +void CONVOpDesc::SharedDtor() { + if (this != default_instance_) { + delete in_cvt_; + delete out_cvt_; + } +} + +void CONVOpDesc::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* CONVOpDesc::descriptor() { + protobuf_AssignDescriptorsOnce(); + return CONVOpDesc_descriptor_; +} + +const CONVOpDesc& CONVOpDesc::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_DlaPrototestInterface_2eproto(); + return *default_instance_; +} + +CONVOpDesc* CONVOpDesc::default_instance_ = NULL; + +CONVOpDesc* CONVOpDesc::New() const { + return new CONVOpDesc; +} + +void CONVOpDesc::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 255) { + ZR_(conv_mode_, data_format_); + } + if (_has_bits_[8 / 32] & 65280) { + ZR_(pixel_mapping_, gob_per_uv_line_); + } + if (_has_bits_[16 / 32] & 16711680) { + ZR_(batch_, release_); + } + if (_has_bits_[24 / 32] & /*4278190080*/ 0xFF000000) { + ZR_(input_width_csc_, input_height_cmac_); + } + if (_has_bits_[32 / 32] & 255) { + ZR_(bytes_per_kernel_, conv_stride_y_); + } + if (_has_bits_[40 / 32] & 48896) { + ZR_(pad_x_left_, dilation_y_); + pra_truncate_ = 0u; + } + if (_has_bits_[48 / 32] & 2031616) { + ZR_(in_precision_, pad_val_); + if (has_in_cvt()) { + if (in_cvt_ != NULL) in_cvt_->::nvdla_prototest_interface::CVTParam::Clear(); + } + if (has_out_cvt()) { + if (out_cvt_ != NULL) out_cvt_->::nvdla_prototest_interface::CVTParam::Clear(); + } + } + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + reserved2_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool CONVOpDesc::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:nvdla_prototest_interface.CONVOpDesc) + 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)) { + // required .nvdla_prototest_interface.ConvMode conv_mode = 1; + case 1: { + if (tag == 8) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::nvdla_prototest_interface::ConvMode_IsValid(value)) { + set_conv_mode(static_cast< ::nvdla_prototest_interface::ConvMode >(value)); + } else { + mutable_unknown_fields()->AddVarint(1, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_data_reuse; + break; + } + + // required uint32 data_reuse = 2; + case 2: { + if (tag == 16) { + parse_data_reuse: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &data_reuse_))); + set_has_data_reuse(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(24)) goto parse_weight_reuse; + break; + } + + // required uint32 weight_reuse = 3; + case 3: { + if (tag == 24) { + parse_weight_reuse: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &weight_reuse_))); + set_has_weight_reuse(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(32)) goto parse_skip_data_rls; + break; + } + + // required uint32 skip_data_rls = 4; + case 4: { + if (tag == 32) { + parse_skip_data_rls: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &skip_data_rls_))); + set_has_skip_data_rls(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(40)) goto parse_skip_weight_rls; + break; + } + + // required uint32 skip_weight_rls = 5; + case 5: { + if (tag == 40) { + parse_skip_weight_rls: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &skip_weight_rls_))); + set_has_skip_weight_rls(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(48)) goto parse_reserved0; + break; + } + + // optional uint32 reserved0 = 6 [default = 0]; + case 6: { + if (tag == 48) { + parse_reserved0: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &reserved0_))); + set_has_reserved0(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(56)) goto parse_entry_per_slice; + break; + } + + // required uint32 entry_per_slice = 7; + case 7: { + if (tag == 56) { + parse_entry_per_slice: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &entry_per_slice_))); + set_has_entry_per_slice(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(64)) goto parse_data_format; + break; + } + + // required .nvdla_prototest_interface.DataFormat data_format = 8; + case 8: { + if (tag == 64) { + parse_data_format: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::nvdla_prototest_interface::DataFormat_IsValid(value)) { + set_data_format(static_cast< ::nvdla_prototest_interface::DataFormat >(value)); + } else { + mutable_unknown_fields()->AddVarint(8, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(72)) goto parse_pixel_mapping; + break; + } + + // required uint32 pixel_mapping = 9; + case 9: { + if (tag == 72) { + parse_pixel_mapping: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &pixel_mapping_))); + set_has_pixel_mapping(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(80)) goto parse_fetch_grain; + break; + } + + // required uint32 fetch_grain = 10; + case 10: { + if (tag == 80) { + parse_fetch_grain: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &fetch_grain_))); + set_has_fetch_grain(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(88)) goto parse_pixel_offset_x; + break; + } + + // required uint32 pixel_offset_x = 11; + case 11: { + if (tag == 88) { + parse_pixel_offset_x: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &pixel_offset_x_))); + set_has_pixel_offset_x(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(96)) goto parse_pixel_offset_y; + break; + } + + // required uint32 pixel_offset_y = 12; + case 12: { + if (tag == 96) { + parse_pixel_offset_y: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &pixel_offset_y_))); + set_has_pixel_offset_y(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(104)) goto parse_gob_per_line; + break; + } + + // required uint32 gob_per_line = 13; + case 13: { + if (tag == 104) { + parse_gob_per_line: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &gob_per_line_))); + set_has_gob_per_line(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(112)) goto parse_gob_height; + break; + } + + // required uint32 gob_height = 14; + case 14: { + if (tag == 112) { + parse_gob_height: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &gob_height_))); + set_has_gob_height(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(120)) goto parse_gob_y_index; + break; + } + + // required uint32 gob_y_index = 15; + case 15: { + if (tag == 120) { + parse_gob_y_index: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &gob_y_index_))); + set_has_gob_y_index(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(128)) goto parse_gob_per_uv_line; + break; + } + + // required uint32 gob_per_uv_line = 16; + case 16: { + if (tag == 128) { + parse_gob_per_uv_line: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &gob_per_uv_line_))); + set_has_gob_per_uv_line(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(136)) goto parse_batch; + break; + } + + // required uint32 batch = 17; + case 17: { + if (tag == 136) { + parse_batch: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &batch_))); + set_has_batch(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(144)) goto parse_weight_format; + break; + } + + // required .nvdla_prototest_interface.WeightFormat weight_format = 18; + case 18: { + if (tag == 144) { + parse_weight_format: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::nvdla_prototest_interface::WeightFormat_IsValid(value)) { + set_weight_format(static_cast< ::nvdla_prototest_interface::WeightFormat >(value)); + } else { + mutable_unknown_fields()->AddVarint(18, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(152)) goto parse_data_bank; + break; + } + + // required uint32 data_bank = 19; + case 19: { + if (tag == 152) { + parse_data_bank: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &data_bank_))); + set_has_data_bank(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(160)) goto parse_weight_bank; + break; + } + + // required uint32 weight_bank = 20; + case 20: { + if (tag == 160) { + parse_weight_bank: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &weight_bank_))); + set_has_weight_bank(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(168)) goto parse_batch_stride; + break; + } + + // required uint32 batch_stride = 21; + case 21: { + if (tag == 168) { + parse_batch_stride: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &batch_stride_))); + set_has_batch_stride(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(176)) goto parse_post_extension; + break; + } + + // required uint32 post_extension = 22; + case 22: { + if (tag == 176) { + parse_post_extension: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &post_extension_))); + set_has_post_extension(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(184)) goto parse_pixel_override; + break; + } + + // optional .nvdla_prototest_interface.PixelOverride pixel_override = 23; + case 23: { + if (tag == 184) { + parse_pixel_override: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::nvdla_prototest_interface::PixelOverride_IsValid(value)) { + set_pixel_override(static_cast< ::nvdla_prototest_interface::PixelOverride >(value)); + } else { + mutable_unknown_fields()->AddVarint(23, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(192)) goto parse_release; + break; + } + + // required uint32 release = 24; + case 24: { + if (tag == 192) { + parse_release: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &release_))); + set_has_release(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(200)) goto parse_input_width_csc; + break; + } + + // required uint32 input_width_csc = 25; + case 25: { + if (tag == 200) { + parse_input_width_csc: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &input_width_csc_))); + set_has_input_width_csc(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(208)) goto parse_input_height_csc; + break; + } + + // required uint32 input_height_csc = 26; + case 26: { + if (tag == 208) { + parse_input_height_csc: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &input_height_csc_))); + set_has_input_height_csc(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(216)) goto parse_input_channel_csc; + break; + } + + // required uint32 input_channel_csc = 27; + case 27: { + if (tag == 216) { + parse_input_channel_csc: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &input_channel_csc_))); + set_has_input_channel_csc(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(224)) goto parse_kernel_width_csc; + break; + } + + // required uint32 kernel_width_csc = 28; + case 28: { + if (tag == 224) { + parse_kernel_width_csc: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &kernel_width_csc_))); + set_has_kernel_width_csc(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(232)) goto parse_kernel_height_csc; + break; + } + + // required uint32 kernel_height_csc = 29; + case 29: { + if (tag == 232) { + parse_kernel_height_csc: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &kernel_height_csc_))); + set_has_kernel_height_csc(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(240)) goto parse_kernel_channel_csc; + break; + } + + // required uint32 kernel_channel_csc = 30; + case 30: { + if (tag == 240) { + parse_kernel_channel_csc: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &kernel_channel_csc_))); + set_has_kernel_channel_csc(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(248)) goto parse_input_width_cmac; + break; + } + + // required uint32 input_width_cmac = 31; + case 31: { + if (tag == 248) { + parse_input_width_cmac: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &input_width_cmac_))); + set_has_input_width_cmac(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(256)) goto parse_input_height_cmac; + break; + } + + // required uint32 input_height_cmac = 32; + case 32: { + if (tag == 256) { + parse_input_height_cmac: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &input_height_cmac_))); + set_has_input_height_cmac(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(264)) goto parse_bytes_per_kernel; + break; + } + + // required uint32 bytes_per_kernel = 33; + case 33: { + if (tag == 264) { + parse_bytes_per_kernel: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &bytes_per_kernel_))); + set_has_bytes_per_kernel(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(272)) goto parse_mean_ry; + break; + } + + // required int32 mean_ry = 34; + case 34: { + if (tag == 272) { + parse_mean_ry: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &mean_ry_))); + set_has_mean_ry(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(280)) goto parse_mean_gu; + break; + } + + // required int32 mean_gu = 35; + case 35: { + if (tag == 280) { + parse_mean_gu: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &mean_gu_))); + set_has_mean_gu(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(288)) goto parse_mean_bv; + break; + } + + // required int32 mean_bv = 36; + case 36: { + if (tag == 288) { + parse_mean_bv: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &mean_bv_))); + set_has_mean_bv(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(296)) goto parse_mean_ax; + break; + } + + // required int32 mean_ax = 37; + case 37: { + if (tag == 296) { + parse_mean_ax: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &mean_ax_))); + set_has_mean_ax(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(304)) goto parse_mean_format; + break; + } + + // required .nvdla_prototest_interface.MeanFormat mean_format = 38; + case 38: { + if (tag == 304) { + parse_mean_format: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::nvdla_prototest_interface::MeanFormat_IsValid(value)) { + set_mean_format(static_cast< ::nvdla_prototest_interface::MeanFormat >(value)); + } else { + mutable_unknown_fields()->AddVarint(38, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(312)) goto parse_conv_stride_x; + break; + } + + // required uint32 conv_stride_x = 39; + case 39: { + if (tag == 312) { + parse_conv_stride_x: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &conv_stride_x_))); + set_has_conv_stride_x(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(320)) goto parse_conv_stride_y; + break; + } + + // required uint32 conv_stride_y = 40; + case 40: { + if (tag == 320) { + parse_conv_stride_y: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &conv_stride_y_))); + set_has_conv_stride_y(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(328)) goto parse_pad_x_left; + break; + } + + // required uint32 pad_x_left = 41; + case 41: { + if (tag == 328) { + parse_pad_x_left: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &pad_x_left_))); + set_has_pad_x_left(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(336)) goto parse_pad_x_right; + break; + } + + // required uint32 pad_x_right = 42; + case 42: { + if (tag == 336) { + parse_pad_x_right: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &pad_x_right_))); + set_has_pad_x_right(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(344)) goto parse_pad_y_top; + break; + } + + // required uint32 pad_y_top = 43; + case 43: { + if (tag == 344) { + parse_pad_y_top: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &pad_y_top_))); + set_has_pad_y_top(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(352)) goto parse_pad_y_bottom; + break; + } + + // required uint32 pad_y_bottom = 44; + case 44: { + if (tag == 352) { + parse_pad_y_bottom: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &pad_y_bottom_))); + set_has_pad_y_bottom(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(360)) goto parse_dilation_x; + break; + } + + // required uint32 dilation_x = 45; + case 45: { + if (tag == 360) { + parse_dilation_x: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &dilation_x_))); + set_has_dilation_x(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(368)) goto parse_dilation_y; + break; + } + + // required uint32 dilation_y = 46; + case 46: { + if (tag == 368) { + parse_dilation_y: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &dilation_y_))); + set_has_dilation_y(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(378)) goto parse_reserved2; + break; + } + + // repeated uint32 reserved2 = 47 [packed = true]; + case 47: { + if (tag == 378) { + parse_reserved2: + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, this->mutable_reserved2()))); + } else if (tag == 376) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + 2, 378, input, this->mutable_reserved2()))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(384)) goto parse_pra_truncate; + break; + } + + // required uint32 pra_truncate = 48; + case 48: { + if (tag == 384) { + parse_pra_truncate: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &pra_truncate_))); + set_has_pra_truncate(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(392)) goto parse_in_precision; + break; + } + + // required .nvdla_prototest_interface.DataPrecision in_precision = 49; + case 49: { + if (tag == 392) { + parse_in_precision: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::nvdla_prototest_interface::DataPrecision_IsValid(value)) { + set_in_precision(static_cast< ::nvdla_prototest_interface::DataPrecision >(value)); + } else { + mutable_unknown_fields()->AddVarint(49, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(400)) goto parse_out_precision; + break; + } + + // required .nvdla_prototest_interface.DataPrecision out_precision = 50; + case 50: { + if (tag == 400) { + parse_out_precision: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::nvdla_prototest_interface::DataPrecision_IsValid(value)) { + set_out_precision(static_cast< ::nvdla_prototest_interface::DataPrecision >(value)); + } else { + mutable_unknown_fields()->AddVarint(50, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(408)) goto parse_pad_val; + break; + } + + // required int32 pad_val = 51; + case 51: { + if (tag == 408) { + parse_pad_val: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &pad_val_))); + set_has_pad_val(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(418)) goto parse_in_cvt; + break; + } + + // required .nvdla_prototest_interface.CVTParam in_cvt = 52; + case 52: { + if (tag == 418) { + parse_in_cvt: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_in_cvt())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(426)) goto parse_out_cvt; + break; + } + + // required .nvdla_prototest_interface.CVTParam out_cvt = 53; + case 53: { + if (tag == 426) { + parse_out_cvt: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_out_cvt())); + } 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:nvdla_prototest_interface.CONVOpDesc) + return true; +failure: + // @@protoc_insertion_point(parse_failure:nvdla_prototest_interface.CONVOpDesc) + return false; +#undef DO_ +} + +void CONVOpDesc::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:nvdla_prototest_interface.CONVOpDesc) + // required .nvdla_prototest_interface.ConvMode conv_mode = 1; + if (has_conv_mode()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 1, this->conv_mode(), output); + } + + // required uint32 data_reuse = 2; + if (has_data_reuse()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->data_reuse(), output); + } + + // required uint32 weight_reuse = 3; + if (has_weight_reuse()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->weight_reuse(), output); + } + + // required uint32 skip_data_rls = 4; + if (has_skip_data_rls()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(4, this->skip_data_rls(), output); + } + + // required uint32 skip_weight_rls = 5; + if (has_skip_weight_rls()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(5, this->skip_weight_rls(), output); + } + + // optional uint32 reserved0 = 6 [default = 0]; + if (has_reserved0()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(6, this->reserved0(), output); + } + + // required uint32 entry_per_slice = 7; + if (has_entry_per_slice()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(7, this->entry_per_slice(), output); + } + + // required .nvdla_prototest_interface.DataFormat data_format = 8; + if (has_data_format()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 8, this->data_format(), output); + } + + // required uint32 pixel_mapping = 9; + if (has_pixel_mapping()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(9, this->pixel_mapping(), output); + } + + // required uint32 fetch_grain = 10; + if (has_fetch_grain()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(10, this->fetch_grain(), output); + } + + // required uint32 pixel_offset_x = 11; + if (has_pixel_offset_x()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(11, this->pixel_offset_x(), output); + } + + // required uint32 pixel_offset_y = 12; + if (has_pixel_offset_y()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(12, this->pixel_offset_y(), output); + } + + // required uint32 gob_per_line = 13; + if (has_gob_per_line()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(13, this->gob_per_line(), output); + } + + // required uint32 gob_height = 14; + if (has_gob_height()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(14, this->gob_height(), output); + } + + // required uint32 gob_y_index = 15; + if (has_gob_y_index()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(15, this->gob_y_index(), output); + } + + // required uint32 gob_per_uv_line = 16; + if (has_gob_per_uv_line()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(16, this->gob_per_uv_line(), output); + } + + // required uint32 batch = 17; + if (has_batch()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(17, this->batch(), output); + } + + // required .nvdla_prototest_interface.WeightFormat weight_format = 18; + if (has_weight_format()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 18, this->weight_format(), output); + } + + // required uint32 data_bank = 19; + if (has_data_bank()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(19, this->data_bank(), output); + } + + // required uint32 weight_bank = 20; + if (has_weight_bank()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(20, this->weight_bank(), output); + } + + // required uint32 batch_stride = 21; + if (has_batch_stride()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(21, this->batch_stride(), output); + } + + // required uint32 post_extension = 22; + if (has_post_extension()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(22, this->post_extension(), output); + } + + // optional .nvdla_prototest_interface.PixelOverride pixel_override = 23; + if (has_pixel_override()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 23, this->pixel_override(), output); + } + + // required uint32 release = 24; + if (has_release()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(24, this->release(), output); + } + + // required uint32 input_width_csc = 25; + if (has_input_width_csc()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(25, this->input_width_csc(), output); + } + + // required uint32 input_height_csc = 26; + if (has_input_height_csc()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(26, this->input_height_csc(), output); + } + + // required uint32 input_channel_csc = 27; + if (has_input_channel_csc()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(27, this->input_channel_csc(), output); + } + + // required uint32 kernel_width_csc = 28; + if (has_kernel_width_csc()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(28, this->kernel_width_csc(), output); + } + + // required uint32 kernel_height_csc = 29; + if (has_kernel_height_csc()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(29, this->kernel_height_csc(), output); + } + + // required uint32 kernel_channel_csc = 30; + if (has_kernel_channel_csc()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(30, this->kernel_channel_csc(), output); + } + + // required uint32 input_width_cmac = 31; + if (has_input_width_cmac()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(31, this->input_width_cmac(), output); + } + + // required uint32 input_height_cmac = 32; + if (has_input_height_cmac()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(32, this->input_height_cmac(), output); + } + + // required uint32 bytes_per_kernel = 33; + if (has_bytes_per_kernel()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(33, this->bytes_per_kernel(), output); + } + + // required int32 mean_ry = 34; + if (has_mean_ry()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(34, this->mean_ry(), output); + } + + // required int32 mean_gu = 35; + if (has_mean_gu()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(35, this->mean_gu(), output); + } + + // required int32 mean_bv = 36; + if (has_mean_bv()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(36, this->mean_bv(), output); + } + + // required int32 mean_ax = 37; + if (has_mean_ax()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(37, this->mean_ax(), output); + } + + // required .nvdla_prototest_interface.MeanFormat mean_format = 38; + if (has_mean_format()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 38, this->mean_format(), output); + } + + // required uint32 conv_stride_x = 39; + if (has_conv_stride_x()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(39, this->conv_stride_x(), output); + } + + // required uint32 conv_stride_y = 40; + if (has_conv_stride_y()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(40, this->conv_stride_y(), output); + } + + // required uint32 pad_x_left = 41; + if (has_pad_x_left()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(41, this->pad_x_left(), output); + } + + // required uint32 pad_x_right = 42; + if (has_pad_x_right()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(42, this->pad_x_right(), output); + } + + // required uint32 pad_y_top = 43; + if (has_pad_y_top()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(43, this->pad_y_top(), output); + } + + // required uint32 pad_y_bottom = 44; + if (has_pad_y_bottom()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(44, this->pad_y_bottom(), output); + } + + // required uint32 dilation_x = 45; + if (has_dilation_x()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(45, this->dilation_x(), output); + } + + // required uint32 dilation_y = 46; + if (has_dilation_y()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(46, this->dilation_y(), output); + } + + // repeated uint32 reserved2 = 47 [packed = true]; + if (this->reserved2_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(47, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(_reserved2_cached_byte_size_); + } + for (int i = 0; i < this->reserved2_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32NoTag( + this->reserved2(i), output); + } + + // required uint32 pra_truncate = 48; + if (has_pra_truncate()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(48, this->pra_truncate(), output); + } + + // required .nvdla_prototest_interface.DataPrecision in_precision = 49; + if (has_in_precision()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 49, this->in_precision(), output); + } + + // required .nvdla_prototest_interface.DataPrecision out_precision = 50; + if (has_out_precision()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 50, this->out_precision(), output); + } + + // required int32 pad_val = 51; + if (has_pad_val()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(51, this->pad_val(), output); + } + + // required .nvdla_prototest_interface.CVTParam in_cvt = 52; + if (has_in_cvt()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 52, this->in_cvt(), output); + } + + // required .nvdla_prototest_interface.CVTParam out_cvt = 53; + if (has_out_cvt()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 53, this->out_cvt(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:nvdla_prototest_interface.CONVOpDesc) +} + +::google::protobuf::uint8* CONVOpDesc::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:nvdla_prototest_interface.CONVOpDesc) + // required .nvdla_prototest_interface.ConvMode conv_mode = 1; + if (has_conv_mode()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 1, this->conv_mode(), target); + } + + // required uint32 data_reuse = 2; + if (has_data_reuse()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->data_reuse(), target); + } + + // required uint32 weight_reuse = 3; + if (has_weight_reuse()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->weight_reuse(), target); + } + + // required uint32 skip_data_rls = 4; + if (has_skip_data_rls()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(4, this->skip_data_rls(), target); + } + + // required uint32 skip_weight_rls = 5; + if (has_skip_weight_rls()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(5, this->skip_weight_rls(), target); + } + + // optional uint32 reserved0 = 6 [default = 0]; + if (has_reserved0()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(6, this->reserved0(), target); + } + + // required uint32 entry_per_slice = 7; + if (has_entry_per_slice()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(7, this->entry_per_slice(), target); + } + + // required .nvdla_prototest_interface.DataFormat data_format = 8; + if (has_data_format()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 8, this->data_format(), target); + } + + // required uint32 pixel_mapping = 9; + if (has_pixel_mapping()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(9, this->pixel_mapping(), target); + } + + // required uint32 fetch_grain = 10; + if (has_fetch_grain()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(10, this->fetch_grain(), target); + } + + // required uint32 pixel_offset_x = 11; + if (has_pixel_offset_x()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(11, this->pixel_offset_x(), target); + } + + // required uint32 pixel_offset_y = 12; + if (has_pixel_offset_y()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(12, this->pixel_offset_y(), target); + } + + // required uint32 gob_per_line = 13; + if (has_gob_per_line()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(13, this->gob_per_line(), target); + } + + // required uint32 gob_height = 14; + if (has_gob_height()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(14, this->gob_height(), target); + } + + // required uint32 gob_y_index = 15; + if (has_gob_y_index()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(15, this->gob_y_index(), target); + } + + // required uint32 gob_per_uv_line = 16; + if (has_gob_per_uv_line()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(16, this->gob_per_uv_line(), target); + } + + // required uint32 batch = 17; + if (has_batch()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(17, this->batch(), target); + } + + // required .nvdla_prototest_interface.WeightFormat weight_format = 18; + if (has_weight_format()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 18, this->weight_format(), target); + } + + // required uint32 data_bank = 19; + if (has_data_bank()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(19, this->data_bank(), target); + } + + // required uint32 weight_bank = 20; + if (has_weight_bank()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(20, this->weight_bank(), target); + } + + // required uint32 batch_stride = 21; + if (has_batch_stride()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(21, this->batch_stride(), target); + } + + // required uint32 post_extension = 22; + if (has_post_extension()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(22, this->post_extension(), target); + } + + // optional .nvdla_prototest_interface.PixelOverride pixel_override = 23; + if (has_pixel_override()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 23, this->pixel_override(), target); + } + + // required uint32 release = 24; + if (has_release()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(24, this->release(), target); + } + + // required uint32 input_width_csc = 25; + if (has_input_width_csc()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(25, this->input_width_csc(), target); + } + + // required uint32 input_height_csc = 26; + if (has_input_height_csc()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(26, this->input_height_csc(), target); + } + + // required uint32 input_channel_csc = 27; + if (has_input_channel_csc()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(27, this->input_channel_csc(), target); + } + + // required uint32 kernel_width_csc = 28; + if (has_kernel_width_csc()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(28, this->kernel_width_csc(), target); + } + + // required uint32 kernel_height_csc = 29; + if (has_kernel_height_csc()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(29, this->kernel_height_csc(), target); + } + + // required uint32 kernel_channel_csc = 30; + if (has_kernel_channel_csc()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(30, this->kernel_channel_csc(), target); + } + + // required uint32 input_width_cmac = 31; + if (has_input_width_cmac()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(31, this->input_width_cmac(), target); + } + + // required uint32 input_height_cmac = 32; + if (has_input_height_cmac()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(32, this->input_height_cmac(), target); + } + + // required uint32 bytes_per_kernel = 33; + if (has_bytes_per_kernel()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(33, this->bytes_per_kernel(), target); + } + + // required int32 mean_ry = 34; + if (has_mean_ry()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(34, this->mean_ry(), target); + } + + // required int32 mean_gu = 35; + if (has_mean_gu()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(35, this->mean_gu(), target); + } + + // required int32 mean_bv = 36; + if (has_mean_bv()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(36, this->mean_bv(), target); + } + + // required int32 mean_ax = 37; + if (has_mean_ax()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(37, this->mean_ax(), target); + } + + // required .nvdla_prototest_interface.MeanFormat mean_format = 38; + if (has_mean_format()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 38, this->mean_format(), target); + } + + // required uint32 conv_stride_x = 39; + if (has_conv_stride_x()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(39, this->conv_stride_x(), target); + } + + // required uint32 conv_stride_y = 40; + if (has_conv_stride_y()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(40, this->conv_stride_y(), target); + } + + // required uint32 pad_x_left = 41; + if (has_pad_x_left()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(41, this->pad_x_left(), target); + } + + // required uint32 pad_x_right = 42; + if (has_pad_x_right()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(42, this->pad_x_right(), target); + } + + // required uint32 pad_y_top = 43; + if (has_pad_y_top()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(43, this->pad_y_top(), target); + } + + // required uint32 pad_y_bottom = 44; + if (has_pad_y_bottom()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(44, this->pad_y_bottom(), target); + } + + // required uint32 dilation_x = 45; + if (has_dilation_x()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(45, this->dilation_x(), target); + } + + // required uint32 dilation_y = 46; + if (has_dilation_y()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(46, this->dilation_y(), target); + } + + // repeated uint32 reserved2 = 47 [packed = true]; + if (this->reserved2_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 47, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + _reserved2_cached_byte_size_, target); + } + for (int i = 0; i < this->reserved2_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteUInt32NoTagToArray(this->reserved2(i), target); + } + + // required uint32 pra_truncate = 48; + if (has_pra_truncate()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(48, this->pra_truncate(), target); + } + + // required .nvdla_prototest_interface.DataPrecision in_precision = 49; + if (has_in_precision()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 49, this->in_precision(), target); + } + + // required .nvdla_prototest_interface.DataPrecision out_precision = 50; + if (has_out_precision()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 50, this->out_precision(), target); + } + + // required int32 pad_val = 51; + if (has_pad_val()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(51, this->pad_val(), target); + } + + // required .nvdla_prototest_interface.CVTParam in_cvt = 52; + if (has_in_cvt()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 52, this->in_cvt(), target); + } + + // required .nvdla_prototest_interface.CVTParam out_cvt = 53; + if (has_out_cvt()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 53, this->out_cvt(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:nvdla_prototest_interface.CONVOpDesc) + return target; +} + +int CONVOpDesc::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // required .nvdla_prototest_interface.ConvMode conv_mode = 1; + if (has_conv_mode()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->conv_mode()); + } + + // required uint32 data_reuse = 2; + if (has_data_reuse()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->data_reuse()); + } + + // required uint32 weight_reuse = 3; + if (has_weight_reuse()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->weight_reuse()); + } + + // required uint32 skip_data_rls = 4; + if (has_skip_data_rls()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->skip_data_rls()); + } + + // required uint32 skip_weight_rls = 5; + if (has_skip_weight_rls()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->skip_weight_rls()); + } + + // optional uint32 reserved0 = 6 [default = 0]; + if (has_reserved0()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->reserved0()); + } + + // required uint32 entry_per_slice = 7; + if (has_entry_per_slice()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->entry_per_slice()); + } + + // required .nvdla_prototest_interface.DataFormat data_format = 8; + if (has_data_format()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->data_format()); + } + + } + if (_has_bits_[8 / 32] & (0xffu << (8 % 32))) { + // required uint32 pixel_mapping = 9; + if (has_pixel_mapping()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->pixel_mapping()); + } + + // required uint32 fetch_grain = 10; + if (has_fetch_grain()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->fetch_grain()); + } + + // required uint32 pixel_offset_x = 11; + if (has_pixel_offset_x()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->pixel_offset_x()); + } + + // required uint32 pixel_offset_y = 12; + if (has_pixel_offset_y()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->pixel_offset_y()); + } + + // required uint32 gob_per_line = 13; + if (has_gob_per_line()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->gob_per_line()); + } + + // required uint32 gob_height = 14; + if (has_gob_height()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->gob_height()); + } + + // required uint32 gob_y_index = 15; + if (has_gob_y_index()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->gob_y_index()); + } + + // required uint32 gob_per_uv_line = 16; + if (has_gob_per_uv_line()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->gob_per_uv_line()); + } + + } + if (_has_bits_[16 / 32] & (0xffu << (16 % 32))) { + // required uint32 batch = 17; + if (has_batch()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->batch()); + } + + // required .nvdla_prototest_interface.WeightFormat weight_format = 18; + if (has_weight_format()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->weight_format()); + } + + // required uint32 data_bank = 19; + if (has_data_bank()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->data_bank()); + } + + // required uint32 weight_bank = 20; + if (has_weight_bank()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->weight_bank()); + } + + // required uint32 batch_stride = 21; + if (has_batch_stride()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->batch_stride()); + } + + // required uint32 post_extension = 22; + if (has_post_extension()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->post_extension()); + } + + // optional .nvdla_prototest_interface.PixelOverride pixel_override = 23; + if (has_pixel_override()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->pixel_override()); + } + + // required uint32 release = 24; + if (has_release()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->release()); + } + + } + if (_has_bits_[24 / 32] & (0xffu << (24 % 32))) { + // required uint32 input_width_csc = 25; + if (has_input_width_csc()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->input_width_csc()); + } + + // required uint32 input_height_csc = 26; + if (has_input_height_csc()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->input_height_csc()); + } + + // required uint32 input_channel_csc = 27; + if (has_input_channel_csc()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->input_channel_csc()); + } + + // required uint32 kernel_width_csc = 28; + if (has_kernel_width_csc()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->kernel_width_csc()); + } + + // required uint32 kernel_height_csc = 29; + if (has_kernel_height_csc()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->kernel_height_csc()); + } + + // required uint32 kernel_channel_csc = 30; + if (has_kernel_channel_csc()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->kernel_channel_csc()); + } + + // required uint32 input_width_cmac = 31; + if (has_input_width_cmac()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->input_width_cmac()); + } + + // required uint32 input_height_cmac = 32; + if (has_input_height_cmac()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->input_height_cmac()); + } + + } + if (_has_bits_[32 / 32] & (0xffu << (32 % 32))) { + // required uint32 bytes_per_kernel = 33; + if (has_bytes_per_kernel()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->bytes_per_kernel()); + } + + // required int32 mean_ry = 34; + if (has_mean_ry()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->mean_ry()); + } + + // required int32 mean_gu = 35; + if (has_mean_gu()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->mean_gu()); + } + + // required int32 mean_bv = 36; + if (has_mean_bv()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->mean_bv()); + } + + // required int32 mean_ax = 37; + if (has_mean_ax()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->mean_ax()); + } + + // required .nvdla_prototest_interface.MeanFormat mean_format = 38; + if (has_mean_format()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->mean_format()); + } + + // required uint32 conv_stride_x = 39; + if (has_conv_stride_x()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->conv_stride_x()); + } + + // required uint32 conv_stride_y = 40; + if (has_conv_stride_y()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->conv_stride_y()); + } + + } + if (_has_bits_[40 / 32] & (0xffu << (40 % 32))) { + // required uint32 pad_x_left = 41; + if (has_pad_x_left()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->pad_x_left()); + } + + // required uint32 pad_x_right = 42; + if (has_pad_x_right()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->pad_x_right()); + } + + // required uint32 pad_y_top = 43; + if (has_pad_y_top()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->pad_y_top()); + } + + // required uint32 pad_y_bottom = 44; + if (has_pad_y_bottom()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->pad_y_bottom()); + } + + // required uint32 dilation_x = 45; + if (has_dilation_x()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->dilation_x()); + } + + // required uint32 dilation_y = 46; + if (has_dilation_y()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->dilation_y()); + } + + // required uint32 pra_truncate = 48; + if (has_pra_truncate()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->pra_truncate()); + } + + } + if (_has_bits_[48 / 32] & (0xffu << (48 % 32))) { + // required .nvdla_prototest_interface.DataPrecision in_precision = 49; + if (has_in_precision()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->in_precision()); + } + + // required .nvdla_prototest_interface.DataPrecision out_precision = 50; + if (has_out_precision()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->out_precision()); + } + + // required int32 pad_val = 51; + if (has_pad_val()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->pad_val()); + } + + // required .nvdla_prototest_interface.CVTParam in_cvt = 52; + if (has_in_cvt()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->in_cvt()); + } + + // required .nvdla_prototest_interface.CVTParam out_cvt = 53; + if (has_out_cvt()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->out_cvt()); + } + + } + // repeated uint32 reserved2 = 47 [packed = true]; + { + int data_size = 0; + for (int i = 0; i < this->reserved2_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->reserved2(i)); + } + if (data_size > 0) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _reserved2_cached_byte_size_ = data_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void CONVOpDesc::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const CONVOpDesc* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void CONVOpDesc::MergeFrom(const CONVOpDesc& from) { + GOOGLE_CHECK_NE(&from, this); + reserved2_.MergeFrom(from.reserved2_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_conv_mode()) { + set_conv_mode(from.conv_mode()); + } + if (from.has_data_reuse()) { + set_data_reuse(from.data_reuse()); + } + if (from.has_weight_reuse()) { + set_weight_reuse(from.weight_reuse()); + } + if (from.has_skip_data_rls()) { + set_skip_data_rls(from.skip_data_rls()); + } + if (from.has_skip_weight_rls()) { + set_skip_weight_rls(from.skip_weight_rls()); + } + if (from.has_reserved0()) { + set_reserved0(from.reserved0()); + } + if (from.has_entry_per_slice()) { + set_entry_per_slice(from.entry_per_slice()); + } + if (from.has_data_format()) { + set_data_format(from.data_format()); + } + } + if (from._has_bits_[8 / 32] & (0xffu << (8 % 32))) { + if (from.has_pixel_mapping()) { + set_pixel_mapping(from.pixel_mapping()); + } + if (from.has_fetch_grain()) { + set_fetch_grain(from.fetch_grain()); + } + if (from.has_pixel_offset_x()) { + set_pixel_offset_x(from.pixel_offset_x()); + } + if (from.has_pixel_offset_y()) { + set_pixel_offset_y(from.pixel_offset_y()); + } + if (from.has_gob_per_line()) { + set_gob_per_line(from.gob_per_line()); + } + if (from.has_gob_height()) { + set_gob_height(from.gob_height()); + } + if (from.has_gob_y_index()) { + set_gob_y_index(from.gob_y_index()); + } + if (from.has_gob_per_uv_line()) { + set_gob_per_uv_line(from.gob_per_uv_line()); + } + } + if (from._has_bits_[16 / 32] & (0xffu << (16 % 32))) { + if (from.has_batch()) { + set_batch(from.batch()); + } + if (from.has_weight_format()) { + set_weight_format(from.weight_format()); + } + if (from.has_data_bank()) { + set_data_bank(from.data_bank()); + } + if (from.has_weight_bank()) { + set_weight_bank(from.weight_bank()); + } + if (from.has_batch_stride()) { + set_batch_stride(from.batch_stride()); + } + if (from.has_post_extension()) { + set_post_extension(from.post_extension()); + } + if (from.has_pixel_override()) { + set_pixel_override(from.pixel_override()); + } + if (from.has_release()) { + set_release(from.release()); + } + } + if (from._has_bits_[24 / 32] & (0xffu << (24 % 32))) { + if (from.has_input_width_csc()) { + set_input_width_csc(from.input_width_csc()); + } + if (from.has_input_height_csc()) { + set_input_height_csc(from.input_height_csc()); + } + if (from.has_input_channel_csc()) { + set_input_channel_csc(from.input_channel_csc()); + } + if (from.has_kernel_width_csc()) { + set_kernel_width_csc(from.kernel_width_csc()); + } + if (from.has_kernel_height_csc()) { + set_kernel_height_csc(from.kernel_height_csc()); + } + if (from.has_kernel_channel_csc()) { + set_kernel_channel_csc(from.kernel_channel_csc()); + } + if (from.has_input_width_cmac()) { + set_input_width_cmac(from.input_width_cmac()); + } + if (from.has_input_height_cmac()) { + set_input_height_cmac(from.input_height_cmac()); + } + } + if (from._has_bits_[32 / 32] & (0xffu << (32 % 32))) { + if (from.has_bytes_per_kernel()) { + set_bytes_per_kernel(from.bytes_per_kernel()); + } + if (from.has_mean_ry()) { + set_mean_ry(from.mean_ry()); + } + if (from.has_mean_gu()) { + set_mean_gu(from.mean_gu()); + } + if (from.has_mean_bv()) { + set_mean_bv(from.mean_bv()); + } + if (from.has_mean_ax()) { + set_mean_ax(from.mean_ax()); + } + if (from.has_mean_format()) { + set_mean_format(from.mean_format()); + } + if (from.has_conv_stride_x()) { + set_conv_stride_x(from.conv_stride_x()); + } + if (from.has_conv_stride_y()) { + set_conv_stride_y(from.conv_stride_y()); + } + } + if (from._has_bits_[40 / 32] & (0xffu << (40 % 32))) { + if (from.has_pad_x_left()) { + set_pad_x_left(from.pad_x_left()); + } + if (from.has_pad_x_right()) { + set_pad_x_right(from.pad_x_right()); + } + if (from.has_pad_y_top()) { + set_pad_y_top(from.pad_y_top()); + } + if (from.has_pad_y_bottom()) { + set_pad_y_bottom(from.pad_y_bottom()); + } + if (from.has_dilation_x()) { + set_dilation_x(from.dilation_x()); + } + if (from.has_dilation_y()) { + set_dilation_y(from.dilation_y()); + } + if (from.has_pra_truncate()) { + set_pra_truncate(from.pra_truncate()); + } + } + if (from._has_bits_[48 / 32] & (0xffu << (48 % 32))) { + if (from.has_in_precision()) { + set_in_precision(from.in_precision()); + } + if (from.has_out_precision()) { + set_out_precision(from.out_precision()); + } + if (from.has_pad_val()) { + set_pad_val(from.pad_val()); + } + if (from.has_in_cvt()) { + mutable_in_cvt()->::nvdla_prototest_interface::CVTParam::MergeFrom(from.in_cvt()); + } + if (from.has_out_cvt()) { + mutable_out_cvt()->::nvdla_prototest_interface::CVTParam::MergeFrom(from.out_cvt()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void CONVOpDesc::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void CONVOpDesc::CopyFrom(const CONVOpDesc& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool CONVOpDesc::IsInitialized() const { + if ((_has_bits_[0] & 0xffbfffdf) != 0xffbfffdf) return false; + if ((_has_bits_[1] & 0x001fbfff) != 0x001fbfff) return false; + + if (has_in_cvt()) { + if (!this->in_cvt().IsInitialized()) return false; + } + if (has_out_cvt()) { + if (!this->out_cvt().IsInitialized()) return false; + } + return true; +} + +void CONVOpDesc::Swap(CONVOpDesc* other) { + if (other != this) { + std::swap(conv_mode_, other->conv_mode_); + std::swap(data_reuse_, other->data_reuse_); + std::swap(weight_reuse_, other->weight_reuse_); + std::swap(skip_data_rls_, other->skip_data_rls_); + std::swap(skip_weight_rls_, other->skip_weight_rls_); + std::swap(reserved0_, other->reserved0_); + std::swap(entry_per_slice_, other->entry_per_slice_); + std::swap(data_format_, other->data_format_); + std::swap(pixel_mapping_, other->pixel_mapping_); + std::swap(fetch_grain_, other->fetch_grain_); + std::swap(pixel_offset_x_, other->pixel_offset_x_); + std::swap(pixel_offset_y_, other->pixel_offset_y_); + std::swap(gob_per_line_, other->gob_per_line_); + std::swap(gob_height_, other->gob_height_); + std::swap(gob_y_index_, other->gob_y_index_); + std::swap(gob_per_uv_line_, other->gob_per_uv_line_); + std::swap(batch_, other->batch_); + std::swap(weight_format_, other->weight_format_); + std::swap(data_bank_, other->data_bank_); + std::swap(weight_bank_, other->weight_bank_); + std::swap(batch_stride_, other->batch_stride_); + std::swap(post_extension_, other->post_extension_); + std::swap(pixel_override_, other->pixel_override_); + std::swap(release_, other->release_); + std::swap(input_width_csc_, other->input_width_csc_); + std::swap(input_height_csc_, other->input_height_csc_); + std::swap(input_channel_csc_, other->input_channel_csc_); + std::swap(kernel_width_csc_, other->kernel_width_csc_); + std::swap(kernel_height_csc_, other->kernel_height_csc_); + std::swap(kernel_channel_csc_, other->kernel_channel_csc_); + std::swap(input_width_cmac_, other->input_width_cmac_); + std::swap(input_height_cmac_, other->input_height_cmac_); + std::swap(bytes_per_kernel_, other->bytes_per_kernel_); + std::swap(mean_ry_, other->mean_ry_); + std::swap(mean_gu_, other->mean_gu_); + std::swap(mean_bv_, other->mean_bv_); + std::swap(mean_ax_, other->mean_ax_); + std::swap(mean_format_, other->mean_format_); + std::swap(conv_stride_x_, other->conv_stride_x_); + std::swap(conv_stride_y_, other->conv_stride_y_); + std::swap(pad_x_left_, other->pad_x_left_); + std::swap(pad_x_right_, other->pad_x_right_); + std::swap(pad_y_top_, other->pad_y_top_); + std::swap(pad_y_bottom_, other->pad_y_bottom_); + std::swap(dilation_x_, other->dilation_x_); + std::swap(dilation_y_, other->dilation_y_); + reserved2_.Swap(&other->reserved2_); + std::swap(pra_truncate_, other->pra_truncate_); + std::swap(in_precision_, other->in_precision_); + std::swap(out_precision_, other->out_precision_); + std::swap(pad_val_, other->pad_val_); + std::swap(in_cvt_, other->in_cvt_); + std::swap(out_cvt_, other->out_cvt_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + std::swap(_has_bits_[1], other->_has_bits_[1]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::google::protobuf::Metadata CONVOpDesc::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = CONVOpDesc_descriptor_; + metadata.reflection = CONVOpDesc_reflection_; + return metadata; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int SDPCvt::kAluCvtFieldNumber; +const int SDPCvt::kMulCvtFieldNumber; +#endif // !_MSC_VER + +SDPCvt::SDPCvt() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:nvdla_prototest_interface.SDPCvt) +} + +void SDPCvt::InitAsDefaultInstance() { + alu_cvt_ = const_cast< ::nvdla_prototest_interface::CVTParam*>(&::nvdla_prototest_interface::CVTParam::default_instance()); + mul_cvt_ = const_cast< ::nvdla_prototest_interface::CVTParam*>(&::nvdla_prototest_interface::CVTParam::default_instance()); +} + +SDPCvt::SDPCvt(const SDPCvt& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:nvdla_prototest_interface.SDPCvt) +} + +void SDPCvt::SharedCtor() { + _cached_size_ = 0; + alu_cvt_ = NULL; + mul_cvt_ = NULL; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +SDPCvt::~SDPCvt() { + // @@protoc_insertion_point(destructor:nvdla_prototest_interface.SDPCvt) + SharedDtor(); +} + +void SDPCvt::SharedDtor() { + if (this != default_instance_) { + delete alu_cvt_; + delete mul_cvt_; + } +} + +void SDPCvt::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* SDPCvt::descriptor() { + protobuf_AssignDescriptorsOnce(); + return SDPCvt_descriptor_; +} + +const SDPCvt& SDPCvt::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_DlaPrototestInterface_2eproto(); + return *default_instance_; +} + +SDPCvt* SDPCvt::default_instance_ = NULL; + +SDPCvt* SDPCvt::New() const { + return new SDPCvt; +} + +void SDPCvt::Clear() { + if (_has_bits_[0 / 32] & 3) { + if (has_alu_cvt()) { + if (alu_cvt_ != NULL) alu_cvt_->::nvdla_prototest_interface::CVTParam::Clear(); + } + if (has_mul_cvt()) { + if (mul_cvt_ != NULL) mul_cvt_->::nvdla_prototest_interface::CVTParam::Clear(); + } + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool SDPCvt::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:nvdla_prototest_interface.SDPCvt) + 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)) { + // required .nvdla_prototest_interface.CVTParam alu_cvt = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_alu_cvt())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_mul_cvt; + break; + } + + // required .nvdla_prototest_interface.CVTParam mul_cvt = 2; + case 2: { + if (tag == 18) { + parse_mul_cvt: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_mul_cvt())); + } 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:nvdla_prototest_interface.SDPCvt) + return true; +failure: + // @@protoc_insertion_point(parse_failure:nvdla_prototest_interface.SDPCvt) + return false; +#undef DO_ +} + +void SDPCvt::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:nvdla_prototest_interface.SDPCvt) + // required .nvdla_prototest_interface.CVTParam alu_cvt = 1; + if (has_alu_cvt()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->alu_cvt(), output); + } + + // required .nvdla_prototest_interface.CVTParam mul_cvt = 2; + if (has_mul_cvt()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->mul_cvt(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:nvdla_prototest_interface.SDPCvt) +} + +::google::protobuf::uint8* SDPCvt::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:nvdla_prototest_interface.SDPCvt) + // required .nvdla_prototest_interface.CVTParam alu_cvt = 1; + if (has_alu_cvt()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 1, this->alu_cvt(), target); + } + + // required .nvdla_prototest_interface.CVTParam mul_cvt = 2; + if (has_mul_cvt()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 2, this->mul_cvt(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:nvdla_prototest_interface.SDPCvt) + return target; +} + +int SDPCvt::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // required .nvdla_prototest_interface.CVTParam alu_cvt = 1; + if (has_alu_cvt()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->alu_cvt()); + } + + // required .nvdla_prototest_interface.CVTParam mul_cvt = 2; + if (has_mul_cvt()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->mul_cvt()); + } + + } + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void SDPCvt::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const SDPCvt* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void SDPCvt::MergeFrom(const SDPCvt& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_alu_cvt()) { + mutable_alu_cvt()->::nvdla_prototest_interface::CVTParam::MergeFrom(from.alu_cvt()); + } + if (from.has_mul_cvt()) { + mutable_mul_cvt()->::nvdla_prototest_interface::CVTParam::MergeFrom(from.mul_cvt()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void SDPCvt::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void SDPCvt::CopyFrom(const SDPCvt& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool SDPCvt::IsInitialized() const { + if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false; + + if (has_alu_cvt()) { + if (!this->alu_cvt().IsInitialized()) return false; + } + if (has_mul_cvt()) { + if (!this->mul_cvt().IsInitialized()) return false; + } + return true; +} + +void SDPCvt::Swap(SDPCvt* other) { + if (other != this) { + std::swap(alu_cvt_, other->alu_cvt_); + std::swap(mul_cvt_, other->mul_cvt_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::google::protobuf::Metadata SDPCvt::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = SDPCvt_descriptor_; + metadata.reflection = SDPCvt_reflection_; + return metadata; +} + + +// =================================================================== + +const ::google::protobuf::EnumDescriptor* SDPOp_SDPOpMode_descriptor() { + protobuf_AssignDescriptorsOnce(); + return SDPOp_SDPOpMode_descriptor_; +} +bool SDPOp_SDPOpMode_IsValid(int value) { + switch(value) { + case 0: + case 1: + case 2: + return true; + default: + return false; + } +} + +#ifndef _MSC_VER +const SDPOp_SDPOpMode SDPOp::SDP_OP_PER_LAYER; +const SDPOp_SDPOpMode SDPOp::SDP_OP_PER_KERNEL; +const SDPOp_SDPOpMode SDPOp::SDP_OP_PER_POINT; +const SDPOp_SDPOpMode SDPOp::SDPOpMode_MIN; +const SDPOp_SDPOpMode SDPOp::SDPOpMode_MAX; +const int SDPOp::SDPOpMode_ARRAYSIZE; +#endif // _MSC_VER +#ifndef _MSC_VER +const int SDPOp::kEnableFieldNumber; +const int SDPOp::kAluTypeFieldNumber; +const int SDPOp::kTypeFieldNumber; +const int SDPOp::kModeFieldNumber; +const int SDPOp::kActFieldNumber; +const int SDPOp::kShiftValueFieldNumber; +const int SDPOp::kTruncateFieldNumber; +const int SDPOp::kPrecisionFieldNumber; +const int SDPOp::kAluOperandFieldNumber; +const int SDPOp::kMulOperandFieldNumber; +const int SDPOp::kCvtFieldNumber; +#endif // !_MSC_VER + +SDPOp::SDPOp() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:nvdla_prototest_interface.SDPOp) +} + +void SDPOp::InitAsDefaultInstance() { + cvt_ = const_cast< ::nvdla_prototest_interface::SDPCvt*>(&::nvdla_prototest_interface::SDPCvt::default_instance()); +} + +SDPOp::SDPOp(const SDPOp& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:nvdla_prototest_interface.SDPOp) +} + +void SDPOp::SharedCtor() { + _cached_size_ = 0; + enable_ = 0u; + alu_type_ = 0; + type_ = 0; + mode_ = 0; + act_ = 0; + shift_value_ = 0u; + truncate_ = 0u; + precision_ = 0; + alu_operand_ = 0; + mul_operand_ = 0; + cvt_ = NULL; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +SDPOp::~SDPOp() { + // @@protoc_insertion_point(destructor:nvdla_prototest_interface.SDPOp) + SharedDtor(); +} + +void SDPOp::SharedDtor() { + if (this != default_instance_) { + delete cvt_; + } +} + +void SDPOp::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* SDPOp::descriptor() { + protobuf_AssignDescriptorsOnce(); + return SDPOp_descriptor_; +} + +const SDPOp& SDPOp::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_DlaPrototestInterface_2eproto(); + return *default_instance_; +} + +SDPOp* SDPOp::default_instance_ = NULL; + +SDPOp* SDPOp::New() const { + return new SDPOp; +} + +void SDPOp::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 255) { + ZR_(enable_, precision_); + } + if (_has_bits_[8 / 32] & 1792) { + ZR_(alu_operand_, mul_operand_); + if (has_cvt()) { + if (cvt_ != NULL) cvt_->::nvdla_prototest_interface::SDPCvt::Clear(); + } + } + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool SDPOp::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:nvdla_prototest_interface.SDPOp) + 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)) { + // required uint32 enable = 1; + case 1: { + if (tag == 8) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &enable_))); + set_has_enable(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_alu_type; + break; + } + + // required .nvdla_prototest_interface.ALUType alu_type = 2; + case 2: { + if (tag == 16) { + parse_alu_type: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::nvdla_prototest_interface::ALUType_IsValid(value)) { + set_alu_type(static_cast< ::nvdla_prototest_interface::ALUType >(value)); + } else { + mutable_unknown_fields()->AddVarint(2, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(24)) goto parse_type; + break; + } + + // required .nvdla_prototest_interface.SDPOpType 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))); + if (::nvdla_prototest_interface::SDPOpType_IsValid(value)) { + set_type(static_cast< ::nvdla_prototest_interface::SDPOpType >(value)); + } else { + mutable_unknown_fields()->AddVarint(3, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(32)) goto parse_mode; + break; + } + + // required .nvdla_prototest_interface.SDPOp.SDPOpMode mode = 4; + case 4: { + if (tag == 32) { + parse_mode: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::nvdla_prototest_interface::SDPOp_SDPOpMode_IsValid(value)) { + set_mode(static_cast< ::nvdla_prototest_interface::SDPOp_SDPOpMode >(value)); + } else { + mutable_unknown_fields()->AddVarint(4, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(40)) goto parse_act; + break; + } + + // required .nvdla_prototest_interface.SDPActivation act = 5; + case 5: { + if (tag == 40) { + parse_act: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::nvdla_prototest_interface::SDPActivation_IsValid(value)) { + set_act(static_cast< ::nvdla_prototest_interface::SDPActivation >(value)); + } else { + mutable_unknown_fields()->AddVarint(5, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(48)) goto parse_shift_value; + break; + } + + // required uint32 shift_value = 6; + case 6: { + if (tag == 48) { + parse_shift_value: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &shift_value_))); + set_has_shift_value(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(56)) goto parse_truncate; + break; + } + + // required uint32 truncate = 7; + case 7: { + if (tag == 56) { + parse_truncate: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &truncate_))); + set_has_truncate(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(64)) goto parse_precision; + break; + } + + // required .nvdla_prototest_interface.DataPrecision precision = 8; + case 8: { + if (tag == 64) { + parse_precision: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::nvdla_prototest_interface::DataPrecision_IsValid(value)) { + set_precision(static_cast< ::nvdla_prototest_interface::DataPrecision >(value)); + } else { + mutable_unknown_fields()->AddVarint(8, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(72)) goto parse_alu_operand; + break; + } + + // required int32 alu_operand = 9; + case 9: { + if (tag == 72) { + parse_alu_operand: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &alu_operand_))); + set_has_alu_operand(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(80)) goto parse_mul_operand; + break; + } + + // required int32 mul_operand = 10; + case 10: { + if (tag == 80) { + parse_mul_operand: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &mul_operand_))); + set_has_mul_operand(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(90)) goto parse_cvt; + break; + } + + // required .nvdla_prototest_interface.SDPCvt cvt = 11; + case 11: { + if (tag == 90) { + parse_cvt: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_cvt())); + } 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:nvdla_prototest_interface.SDPOp) + return true; +failure: + // @@protoc_insertion_point(parse_failure:nvdla_prototest_interface.SDPOp) + return false; +#undef DO_ +} + +void SDPOp::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:nvdla_prototest_interface.SDPOp) + // required uint32 enable = 1; + if (has_enable()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->enable(), output); + } + + // required .nvdla_prototest_interface.ALUType alu_type = 2; + if (has_alu_type()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 2, this->alu_type(), output); + } + + // required .nvdla_prototest_interface.SDPOpType type = 3; + if (has_type()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 3, this->type(), output); + } + + // required .nvdla_prototest_interface.SDPOp.SDPOpMode mode = 4; + if (has_mode()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 4, this->mode(), output); + } + + // required .nvdla_prototest_interface.SDPActivation act = 5; + if (has_act()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 5, this->act(), output); + } + + // required uint32 shift_value = 6; + if (has_shift_value()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(6, this->shift_value(), output); + } + + // required uint32 truncate = 7; + if (has_truncate()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(7, this->truncate(), output); + } + + // required .nvdla_prototest_interface.DataPrecision precision = 8; + if (has_precision()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 8, this->precision(), output); + } + + // required int32 alu_operand = 9; + if (has_alu_operand()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(9, this->alu_operand(), output); + } + + // required int32 mul_operand = 10; + if (has_mul_operand()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(10, this->mul_operand(), output); + } + + // required .nvdla_prototest_interface.SDPCvt cvt = 11; + if (has_cvt()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 11, this->cvt(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:nvdla_prototest_interface.SDPOp) +} + +::google::protobuf::uint8* SDPOp::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:nvdla_prototest_interface.SDPOp) + // required uint32 enable = 1; + if (has_enable()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->enable(), target); + } + + // required .nvdla_prototest_interface.ALUType alu_type = 2; + if (has_alu_type()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 2, this->alu_type(), target); + } + + // required .nvdla_prototest_interface.SDPOpType type = 3; + if (has_type()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 3, this->type(), target); + } + + // required .nvdla_prototest_interface.SDPOp.SDPOpMode mode = 4; + if (has_mode()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 4, this->mode(), target); + } + + // required .nvdla_prototest_interface.SDPActivation act = 5; + if (has_act()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 5, this->act(), target); + } + + // required uint32 shift_value = 6; + if (has_shift_value()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(6, this->shift_value(), target); + } + + // required uint32 truncate = 7; + if (has_truncate()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(7, this->truncate(), target); + } + + // required .nvdla_prototest_interface.DataPrecision precision = 8; + if (has_precision()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 8, this->precision(), target); + } + + // required int32 alu_operand = 9; + if (has_alu_operand()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(9, this->alu_operand(), target); + } + + // required int32 mul_operand = 10; + if (has_mul_operand()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(10, this->mul_operand(), target); + } + + // required .nvdla_prototest_interface.SDPCvt cvt = 11; + if (has_cvt()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 11, this->cvt(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:nvdla_prototest_interface.SDPOp) + return target; +} + +int SDPOp::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // required uint32 enable = 1; + if (has_enable()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->enable()); + } + + // required .nvdla_prototest_interface.ALUType alu_type = 2; + if (has_alu_type()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->alu_type()); + } + + // required .nvdla_prototest_interface.SDPOpType type = 3; + if (has_type()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->type()); + } + + // required .nvdla_prototest_interface.SDPOp.SDPOpMode mode = 4; + if (has_mode()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->mode()); + } + + // required .nvdla_prototest_interface.SDPActivation act = 5; + if (has_act()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->act()); + } + + // required uint32 shift_value = 6; + if (has_shift_value()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->shift_value()); + } + + // required uint32 truncate = 7; + if (has_truncate()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->truncate()); + } + + // required .nvdla_prototest_interface.DataPrecision precision = 8; + if (has_precision()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->precision()); + } + + } + if (_has_bits_[8 / 32] & (0xffu << (8 % 32))) { + // required int32 alu_operand = 9; + if (has_alu_operand()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->alu_operand()); + } + + // required int32 mul_operand = 10; + if (has_mul_operand()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->mul_operand()); + } + + // required .nvdla_prototest_interface.SDPCvt cvt = 11; + if (has_cvt()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->cvt()); + } + + } + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void SDPOp::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const SDPOp* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void SDPOp::MergeFrom(const SDPOp& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_enable()) { + set_enable(from.enable()); + } + if (from.has_alu_type()) { + set_alu_type(from.alu_type()); + } + if (from.has_type()) { + set_type(from.type()); + } + if (from.has_mode()) { + set_mode(from.mode()); + } + if (from.has_act()) { + set_act(from.act()); + } + if (from.has_shift_value()) { + set_shift_value(from.shift_value()); + } + if (from.has_truncate()) { + set_truncate(from.truncate()); + } + if (from.has_precision()) { + set_precision(from.precision()); + } + } + if (from._has_bits_[8 / 32] & (0xffu << (8 % 32))) { + if (from.has_alu_operand()) { + set_alu_operand(from.alu_operand()); + } + if (from.has_mul_operand()) { + set_mul_operand(from.mul_operand()); + } + if (from.has_cvt()) { + mutable_cvt()->::nvdla_prototest_interface::SDPCvt::MergeFrom(from.cvt()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void SDPOp::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void SDPOp::CopyFrom(const SDPOp& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool SDPOp::IsInitialized() const { + if ((_has_bits_[0] & 0x000007ff) != 0x000007ff) return false; + + if (has_cvt()) { + if (!this->cvt().IsInitialized()) return false; + } + return true; +} + +void SDPOp::Swap(SDPOp* other) { + if (other != this) { + std::swap(enable_, other->enable_); + std::swap(alu_type_, other->alu_type_); + std::swap(type_, other->type_); + std::swap(mode_, other->mode_); + std::swap(act_, other->act_); + std::swap(shift_value_, other->shift_value_); + std::swap(truncate_, other->truncate_); + std::swap(precision_, other->precision_); + std::swap(alu_operand_, other->alu_operand_); + std::swap(mul_operand_, other->mul_operand_); + std::swap(cvt_, other->cvt_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::google::protobuf::Metadata SDPOp::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = SDPOp_descriptor_; + metadata.reflection = SDPOp_reflection_; + return metadata; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int SDPSurfaceDesc::kSrcDataFieldNumber; +const int SDPSurfaceDesc::kX1DataFieldNumber; +const int SDPSurfaceDesc::kX2DataFieldNumber; +const int SDPSurfaceDesc::kYDataFieldNumber; +const int SDPSurfaceDesc::kDstDataFieldNumber; +#endif // !_MSC_VER + +SDPSurfaceDesc::SDPSurfaceDesc() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:nvdla_prototest_interface.SDPSurfaceDesc) +} + +void SDPSurfaceDesc::InitAsDefaultInstance() { + src_data_ = const_cast< ::nvdla_prototest_interface::DataCube*>(&::nvdla_prototest_interface::DataCube::default_instance()); + x1_data_ = const_cast< ::nvdla_prototest_interface::DataCube*>(&::nvdla_prototest_interface::DataCube::default_instance()); + x2_data_ = const_cast< ::nvdla_prototest_interface::DataCube*>(&::nvdla_prototest_interface::DataCube::default_instance()); + y_data_ = const_cast< ::nvdla_prototest_interface::DataCube*>(&::nvdla_prototest_interface::DataCube::default_instance()); + dst_data_ = const_cast< ::nvdla_prototest_interface::DataCube*>(&::nvdla_prototest_interface::DataCube::default_instance()); +} + +SDPSurfaceDesc::SDPSurfaceDesc(const SDPSurfaceDesc& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:nvdla_prototest_interface.SDPSurfaceDesc) +} + +void SDPSurfaceDesc::SharedCtor() { + _cached_size_ = 0; + src_data_ = NULL; + x1_data_ = NULL; + x2_data_ = NULL; + y_data_ = NULL; + dst_data_ = NULL; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +SDPSurfaceDesc::~SDPSurfaceDesc() { + // @@protoc_insertion_point(destructor:nvdla_prototest_interface.SDPSurfaceDesc) + SharedDtor(); +} + +void SDPSurfaceDesc::SharedDtor() { + if (this != default_instance_) { + delete src_data_; + delete x1_data_; + delete x2_data_; + delete y_data_; + delete dst_data_; + } +} + +void SDPSurfaceDesc::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* SDPSurfaceDesc::descriptor() { + protobuf_AssignDescriptorsOnce(); + return SDPSurfaceDesc_descriptor_; +} + +const SDPSurfaceDesc& SDPSurfaceDesc::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_DlaPrototestInterface_2eproto(); + return *default_instance_; +} + +SDPSurfaceDesc* SDPSurfaceDesc::default_instance_ = NULL; + +SDPSurfaceDesc* SDPSurfaceDesc::New() const { + return new SDPSurfaceDesc; +} + +void SDPSurfaceDesc::Clear() { + if (_has_bits_[0 / 32] & 31) { + if (has_src_data()) { + if (src_data_ != NULL) src_data_->::nvdla_prototest_interface::DataCube::Clear(); + } + if (has_x1_data()) { + if (x1_data_ != NULL) x1_data_->::nvdla_prototest_interface::DataCube::Clear(); + } + if (has_x2_data()) { + if (x2_data_ != NULL) x2_data_->::nvdla_prototest_interface::DataCube::Clear(); + } + if (has_y_data()) { + if (y_data_ != NULL) y_data_->::nvdla_prototest_interface::DataCube::Clear(); + } + if (has_dst_data()) { + if (dst_data_ != NULL) dst_data_->::nvdla_prototest_interface::DataCube::Clear(); + } + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool SDPSurfaceDesc::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:nvdla_prototest_interface.SDPSurfaceDesc) + 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)) { + // required .nvdla_prototest_interface.DataCube src_data = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_src_data())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_x1_data; + break; + } + + // optional .nvdla_prototest_interface.DataCube x1_data = 2; + case 2: { + if (tag == 18) { + parse_x1_data: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_x1_data())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_x2_data; + break; + } + + // optional .nvdla_prototest_interface.DataCube x2_data = 3; + case 3: { + if (tag == 26) { + parse_x2_data: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_x2_data())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(34)) goto parse_y_data; + break; + } + + // optional .nvdla_prototest_interface.DataCube y_data = 4; + case 4: { + if (tag == 34) { + parse_y_data: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_y_data())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(42)) goto parse_dst_data; + break; + } + + // required .nvdla_prototest_interface.DataCube dst_data = 5; + case 5: { + if (tag == 42) { + parse_dst_data: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_dst_data())); + } 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:nvdla_prototest_interface.SDPSurfaceDesc) + return true; +failure: + // @@protoc_insertion_point(parse_failure:nvdla_prototest_interface.SDPSurfaceDesc) + return false; +#undef DO_ +} + +void SDPSurfaceDesc::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:nvdla_prototest_interface.SDPSurfaceDesc) + // required .nvdla_prototest_interface.DataCube src_data = 1; + if (has_src_data()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->src_data(), output); + } + + // optional .nvdla_prototest_interface.DataCube x1_data = 2; + if (has_x1_data()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->x1_data(), output); + } + + // optional .nvdla_prototest_interface.DataCube x2_data = 3; + if (has_x2_data()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, this->x2_data(), output); + } + + // optional .nvdla_prototest_interface.DataCube y_data = 4; + if (has_y_data()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, this->y_data(), output); + } + + // required .nvdla_prototest_interface.DataCube dst_data = 5; + if (has_dst_data()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 5, this->dst_data(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:nvdla_prototest_interface.SDPSurfaceDesc) +} + +::google::protobuf::uint8* SDPSurfaceDesc::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:nvdla_prototest_interface.SDPSurfaceDesc) + // required .nvdla_prototest_interface.DataCube src_data = 1; + if (has_src_data()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 1, this->src_data(), target); + } + + // optional .nvdla_prototest_interface.DataCube x1_data = 2; + if (has_x1_data()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 2, this->x1_data(), target); + } + + // optional .nvdla_prototest_interface.DataCube x2_data = 3; + if (has_x2_data()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 3, this->x2_data(), target); + } + + // optional .nvdla_prototest_interface.DataCube y_data = 4; + if (has_y_data()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 4, this->y_data(), target); + } + + // required .nvdla_prototest_interface.DataCube dst_data = 5; + if (has_dst_data()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 5, this->dst_data(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:nvdla_prototest_interface.SDPSurfaceDesc) + return target; +} + +int SDPSurfaceDesc::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // required .nvdla_prototest_interface.DataCube src_data = 1; + if (has_src_data()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->src_data()); + } + + // optional .nvdla_prototest_interface.DataCube x1_data = 2; + if (has_x1_data()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->x1_data()); + } + + // optional .nvdla_prototest_interface.DataCube x2_data = 3; + if (has_x2_data()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->x2_data()); + } + + // optional .nvdla_prototest_interface.DataCube y_data = 4; + if (has_y_data()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->y_data()); + } + + // required .nvdla_prototest_interface.DataCube dst_data = 5; + if (has_dst_data()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->dst_data()); + } + + } + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void SDPSurfaceDesc::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const SDPSurfaceDesc* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void SDPSurfaceDesc::MergeFrom(const SDPSurfaceDesc& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_src_data()) { + mutable_src_data()->::nvdla_prototest_interface::DataCube::MergeFrom(from.src_data()); + } + if (from.has_x1_data()) { + mutable_x1_data()->::nvdla_prototest_interface::DataCube::MergeFrom(from.x1_data()); + } + if (from.has_x2_data()) { + mutable_x2_data()->::nvdla_prototest_interface::DataCube::MergeFrom(from.x2_data()); + } + if (from.has_y_data()) { + mutable_y_data()->::nvdla_prototest_interface::DataCube::MergeFrom(from.y_data()); + } + if (from.has_dst_data()) { + mutable_dst_data()->::nvdla_prototest_interface::DataCube::MergeFrom(from.dst_data()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void SDPSurfaceDesc::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void SDPSurfaceDesc::CopyFrom(const SDPSurfaceDesc& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool SDPSurfaceDesc::IsInitialized() const { + if ((_has_bits_[0] & 0x00000011) != 0x00000011) return false; + + if (has_src_data()) { + if (!this->src_data().IsInitialized()) return false; + } + if (has_x1_data()) { + if (!this->x1_data().IsInitialized()) return false; + } + if (has_x2_data()) { + if (!this->x2_data().IsInitialized()) return false; + } + if (has_y_data()) { + if (!this->y_data().IsInitialized()) return false; + } + if (has_dst_data()) { + if (!this->dst_data().IsInitialized()) return false; + } + return true; +} + +void SDPSurfaceDesc::Swap(SDPSurfaceDesc* other) { + if (other != this) { + std::swap(src_data_, other->src_data_); + std::swap(x1_data_, other->x1_data_); + std::swap(x2_data_, other->x2_data_); + std::swap(y_data_, other->y_data_); + std::swap(dst_data_, other->dst_data_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::google::protobuf::Metadata SDPSurfaceDesc::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = SDPSurfaceDesc_descriptor_; + metadata.reflection = SDPSurfaceDesc_reflection_; + return metadata; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int SDPOpDesc::kSrcPrecisionFieldNumber; +const int SDPOpDesc::kDstPrecisionFieldNumber; +const int SDPOpDesc::kLutIndexFieldNumber; +const int SDPOpDesc::kOutCvtFieldNumber; +const int SDPOpDesc::kConvModeFieldNumber; +const int SDPOpDesc::kBatchNumFieldNumber; +const int SDPOpDesc::kReserved0FieldNumber; +const int SDPOpDesc::kBatchStrideFieldNumber; +const int SDPOpDesc::kX1OpFieldNumber; +const int SDPOpDesc::kX2OpFieldNumber; +const int SDPOpDesc::kYOpFieldNumber; +#endif // !_MSC_VER + +SDPOpDesc::SDPOpDesc() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:nvdla_prototest_interface.SDPOpDesc) +} + +void SDPOpDesc::InitAsDefaultInstance() { + out_cvt_ = const_cast< ::nvdla_prototest_interface::CVTParam*>(&::nvdla_prototest_interface::CVTParam::default_instance()); + x1_op_ = const_cast< ::nvdla_prototest_interface::SDPOp*>(&::nvdla_prototest_interface::SDPOp::default_instance()); + x2_op_ = const_cast< ::nvdla_prototest_interface::SDPOp*>(&::nvdla_prototest_interface::SDPOp::default_instance()); + y_op_ = const_cast< ::nvdla_prototest_interface::SDPOp*>(&::nvdla_prototest_interface::SDPOp::default_instance()); +} + +SDPOpDesc::SDPOpDesc(const SDPOpDesc& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:nvdla_prototest_interface.SDPOpDesc) +} + +void SDPOpDesc::SharedCtor() { + _cached_size_ = 0; + src_precision_ = 0; + dst_precision_ = 0; + lut_index_ = 0; + out_cvt_ = NULL; + conv_mode_ = 0; + batch_num_ = 0u; + reserved0_ = 0u; + batch_stride_ = 0u; + x1_op_ = NULL; + x2_op_ = NULL; + y_op_ = NULL; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +SDPOpDesc::~SDPOpDesc() { + // @@protoc_insertion_point(destructor:nvdla_prototest_interface.SDPOpDesc) + SharedDtor(); +} + +void SDPOpDesc::SharedDtor() { + if (this != default_instance_) { + delete out_cvt_; + delete x1_op_; + delete x2_op_; + delete y_op_; + } +} + +void SDPOpDesc::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* SDPOpDesc::descriptor() { + protobuf_AssignDescriptorsOnce(); + return SDPOpDesc_descriptor_; +} + +const SDPOpDesc& SDPOpDesc::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_DlaPrototestInterface_2eproto(); + return *default_instance_; +} + +SDPOpDesc* SDPOpDesc::default_instance_ = NULL; + +SDPOpDesc* SDPOpDesc::New() const { + return new SDPOpDesc; +} + +void SDPOpDesc::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 255) { + ZR_(src_precision_, dst_precision_); + ZR_(lut_index_, reserved0_); + if (has_out_cvt()) { + if (out_cvt_ != NULL) out_cvt_->::nvdla_prototest_interface::CVTParam::Clear(); + } + batch_stride_ = 0u; + } + if (_has_bits_[8 / 32] & 1792) { + if (has_x1_op()) { + if (x1_op_ != NULL) x1_op_->::nvdla_prototest_interface::SDPOp::Clear(); + } + if (has_x2_op()) { + if (x2_op_ != NULL) x2_op_->::nvdla_prototest_interface::SDPOp::Clear(); + } + if (has_y_op()) { + if (y_op_ != NULL) y_op_->::nvdla_prototest_interface::SDPOp::Clear(); + } + } + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool SDPOpDesc::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:nvdla_prototest_interface.SDPOpDesc) + 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)) { + // required .nvdla_prototest_interface.DataPrecision src_precision = 1; + case 1: { + if (tag == 8) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::nvdla_prototest_interface::DataPrecision_IsValid(value)) { + set_src_precision(static_cast< ::nvdla_prototest_interface::DataPrecision >(value)); + } else { + mutable_unknown_fields()->AddVarint(1, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_dst_precision; + break; + } + + // required .nvdla_prototest_interface.DataPrecision dst_precision = 2; + case 2: { + if (tag == 16) { + parse_dst_precision: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::nvdla_prototest_interface::DataPrecision_IsValid(value)) { + set_dst_precision(static_cast< ::nvdla_prototest_interface::DataPrecision >(value)); + } else { + mutable_unknown_fields()->AddVarint(2, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(24)) goto parse_lut_index; + break; + } + + // required int32 lut_index = 3; + case 3: { + if (tag == 24) { + parse_lut_index: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &lut_index_))); + set_has_lut_index(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(34)) goto parse_out_cvt; + break; + } + + // required .nvdla_prototest_interface.CVTParam out_cvt = 4; + case 4: { + if (tag == 34) { + parse_out_cvt: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_out_cvt())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(40)) goto parse_conv_mode; + break; + } + + // required .nvdla_prototest_interface.ConvMode conv_mode = 5; + case 5: { + if (tag == 40) { + parse_conv_mode: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::nvdla_prototest_interface::ConvMode_IsValid(value)) { + set_conv_mode(static_cast< ::nvdla_prototest_interface::ConvMode >(value)); + } else { + mutable_unknown_fields()->AddVarint(5, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(48)) goto parse_batch_num; + break; + } + + // required uint32 batch_num = 6; + case 6: { + if (tag == 48) { + parse_batch_num: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &batch_num_))); + set_has_batch_num(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(56)) goto parse_reserved0; + break; + } + + // optional uint32 reserved0 = 7 [default = 0]; + case 7: { + if (tag == 56) { + parse_reserved0: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &reserved0_))); + set_has_reserved0(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(64)) goto parse_batch_stride; + break; + } + + // required uint32 batch_stride = 8; + case 8: { + if (tag == 64) { + parse_batch_stride: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &batch_stride_))); + set_has_batch_stride(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(74)) goto parse_x1_op; + break; + } + + // required .nvdla_prototest_interface.SDPOp x1_op = 9; + case 9: { + if (tag == 74) { + parse_x1_op: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_x1_op())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(82)) goto parse_x2_op; + break; + } + + // required .nvdla_prototest_interface.SDPOp x2_op = 10; + case 10: { + if (tag == 82) { + parse_x2_op: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_x2_op())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(90)) goto parse_y_op; + break; + } + + // required .nvdla_prototest_interface.SDPOp y_op = 11; + case 11: { + if (tag == 90) { + parse_y_op: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_y_op())); + } 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:nvdla_prototest_interface.SDPOpDesc) + return true; +failure: + // @@protoc_insertion_point(parse_failure:nvdla_prototest_interface.SDPOpDesc) + return false; +#undef DO_ +} + +void SDPOpDesc::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:nvdla_prototest_interface.SDPOpDesc) + // required .nvdla_prototest_interface.DataPrecision src_precision = 1; + if (has_src_precision()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 1, this->src_precision(), output); + } + + // required .nvdla_prototest_interface.DataPrecision dst_precision = 2; + if (has_dst_precision()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 2, this->dst_precision(), output); + } + + // required int32 lut_index = 3; + if (has_lut_index()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->lut_index(), output); + } + + // required .nvdla_prototest_interface.CVTParam out_cvt = 4; + if (has_out_cvt()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, this->out_cvt(), output); + } + + // required .nvdla_prototest_interface.ConvMode conv_mode = 5; + if (has_conv_mode()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 5, this->conv_mode(), output); + } + + // required uint32 batch_num = 6; + if (has_batch_num()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(6, this->batch_num(), output); + } + + // optional uint32 reserved0 = 7 [default = 0]; + if (has_reserved0()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(7, this->reserved0(), output); + } + + // required uint32 batch_stride = 8; + if (has_batch_stride()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(8, this->batch_stride(), output); + } + + // required .nvdla_prototest_interface.SDPOp x1_op = 9; + if (has_x1_op()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 9, this->x1_op(), output); + } + + // required .nvdla_prototest_interface.SDPOp x2_op = 10; + if (has_x2_op()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 10, this->x2_op(), output); + } + + // required .nvdla_prototest_interface.SDPOp y_op = 11; + if (has_y_op()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 11, this->y_op(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:nvdla_prototest_interface.SDPOpDesc) +} + +::google::protobuf::uint8* SDPOpDesc::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:nvdla_prototest_interface.SDPOpDesc) + // required .nvdla_prototest_interface.DataPrecision src_precision = 1; + if (has_src_precision()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 1, this->src_precision(), target); + } + + // required .nvdla_prototest_interface.DataPrecision dst_precision = 2; + if (has_dst_precision()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 2, this->dst_precision(), target); + } + + // required int32 lut_index = 3; + if (has_lut_index()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->lut_index(), target); + } + + // required .nvdla_prototest_interface.CVTParam out_cvt = 4; + if (has_out_cvt()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 4, this->out_cvt(), target); + } + + // required .nvdla_prototest_interface.ConvMode conv_mode = 5; + if (has_conv_mode()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 5, this->conv_mode(), target); + } + + // required uint32 batch_num = 6; + if (has_batch_num()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(6, this->batch_num(), target); + } + + // optional uint32 reserved0 = 7 [default = 0]; + if (has_reserved0()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(7, this->reserved0(), target); + } + + // required uint32 batch_stride = 8; + if (has_batch_stride()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(8, this->batch_stride(), target); + } + + // required .nvdla_prototest_interface.SDPOp x1_op = 9; + if (has_x1_op()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 9, this->x1_op(), target); + } + + // required .nvdla_prototest_interface.SDPOp x2_op = 10; + if (has_x2_op()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 10, this->x2_op(), target); + } + + // required .nvdla_prototest_interface.SDPOp y_op = 11; + if (has_y_op()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 11, this->y_op(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:nvdla_prototest_interface.SDPOpDesc) + return target; +} + +int SDPOpDesc::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // required .nvdla_prototest_interface.DataPrecision src_precision = 1; + if (has_src_precision()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->src_precision()); + } + + // required .nvdla_prototest_interface.DataPrecision dst_precision = 2; + if (has_dst_precision()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->dst_precision()); + } + + // required int32 lut_index = 3; + if (has_lut_index()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->lut_index()); + } + + // required .nvdla_prototest_interface.CVTParam out_cvt = 4; + if (has_out_cvt()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->out_cvt()); + } + + // required .nvdla_prototest_interface.ConvMode conv_mode = 5; + if (has_conv_mode()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->conv_mode()); + } + + // required uint32 batch_num = 6; + if (has_batch_num()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->batch_num()); + } + + // optional uint32 reserved0 = 7 [default = 0]; + if (has_reserved0()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->reserved0()); + } + + // required uint32 batch_stride = 8; + if (has_batch_stride()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->batch_stride()); + } + + } + if (_has_bits_[8 / 32] & (0xffu << (8 % 32))) { + // required .nvdla_prototest_interface.SDPOp x1_op = 9; + if (has_x1_op()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->x1_op()); + } + + // required .nvdla_prototest_interface.SDPOp x2_op = 10; + if (has_x2_op()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->x2_op()); + } + + // required .nvdla_prototest_interface.SDPOp y_op = 11; + if (has_y_op()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->y_op()); + } + + } + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void SDPOpDesc::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const SDPOpDesc* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void SDPOpDesc::MergeFrom(const SDPOpDesc& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_src_precision()) { + set_src_precision(from.src_precision()); + } + if (from.has_dst_precision()) { + set_dst_precision(from.dst_precision()); + } + if (from.has_lut_index()) { + set_lut_index(from.lut_index()); + } + if (from.has_out_cvt()) { + mutable_out_cvt()->::nvdla_prototest_interface::CVTParam::MergeFrom(from.out_cvt()); + } + if (from.has_conv_mode()) { + set_conv_mode(from.conv_mode()); + } + if (from.has_batch_num()) { + set_batch_num(from.batch_num()); + } + if (from.has_reserved0()) { + set_reserved0(from.reserved0()); + } + if (from.has_batch_stride()) { + set_batch_stride(from.batch_stride()); + } + } + if (from._has_bits_[8 / 32] & (0xffu << (8 % 32))) { + if (from.has_x1_op()) { + mutable_x1_op()->::nvdla_prototest_interface::SDPOp::MergeFrom(from.x1_op()); + } + if (from.has_x2_op()) { + mutable_x2_op()->::nvdla_prototest_interface::SDPOp::MergeFrom(from.x2_op()); + } + if (from.has_y_op()) { + mutable_y_op()->::nvdla_prototest_interface::SDPOp::MergeFrom(from.y_op()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void SDPOpDesc::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void SDPOpDesc::CopyFrom(const SDPOpDesc& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool SDPOpDesc::IsInitialized() const { + if ((_has_bits_[0] & 0x000007bf) != 0x000007bf) return false; + + if (has_out_cvt()) { + if (!this->out_cvt().IsInitialized()) return false; + } + if (has_x1_op()) { + if (!this->x1_op().IsInitialized()) return false; + } + if (has_x2_op()) { + if (!this->x2_op().IsInitialized()) return false; + } + if (has_y_op()) { + if (!this->y_op().IsInitialized()) return false; + } + return true; +} + +void SDPOpDesc::Swap(SDPOpDesc* other) { + if (other != this) { + std::swap(src_precision_, other->src_precision_); + std::swap(dst_precision_, other->dst_precision_); + std::swap(lut_index_, other->lut_index_); + std::swap(out_cvt_, other->out_cvt_); + std::swap(conv_mode_, other->conv_mode_); + std::swap(batch_num_, other->batch_num_); + std::swap(reserved0_, other->reserved0_); + std::swap(batch_stride_, other->batch_stride_); + std::swap(x1_op_, other->x1_op_); + std::swap(x2_op_, other->x2_op_); + std::swap(y_op_, other->y_op_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::google::protobuf::Metadata SDPOpDesc::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = SDPOpDesc_descriptor_; + metadata.reflection = SDPOpDesc_reflection_; + return metadata; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int PDPSurfaceDesc::kSrcDataFieldNumber; +const int PDPSurfaceDesc::kDstDataFieldNumber; +#endif // !_MSC_VER + +PDPSurfaceDesc::PDPSurfaceDesc() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:nvdla_prototest_interface.PDPSurfaceDesc) +} + +void PDPSurfaceDesc::InitAsDefaultInstance() { + src_data_ = const_cast< ::nvdla_prototest_interface::DataCube*>(&::nvdla_prototest_interface::DataCube::default_instance()); + dst_data_ = const_cast< ::nvdla_prototest_interface::DataCube*>(&::nvdla_prototest_interface::DataCube::default_instance()); +} + +PDPSurfaceDesc::PDPSurfaceDesc(const PDPSurfaceDesc& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:nvdla_prototest_interface.PDPSurfaceDesc) +} + +void PDPSurfaceDesc::SharedCtor() { + _cached_size_ = 0; + src_data_ = NULL; + dst_data_ = NULL; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +PDPSurfaceDesc::~PDPSurfaceDesc() { + // @@protoc_insertion_point(destructor:nvdla_prototest_interface.PDPSurfaceDesc) + SharedDtor(); +} + +void PDPSurfaceDesc::SharedDtor() { + if (this != default_instance_) { + delete src_data_; + delete dst_data_; + } +} + +void PDPSurfaceDesc::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* PDPSurfaceDesc::descriptor() { + protobuf_AssignDescriptorsOnce(); + return PDPSurfaceDesc_descriptor_; +} + +const PDPSurfaceDesc& PDPSurfaceDesc::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_DlaPrototestInterface_2eproto(); + return *default_instance_; +} + +PDPSurfaceDesc* PDPSurfaceDesc::default_instance_ = NULL; + +PDPSurfaceDesc* PDPSurfaceDesc::New() const { + return new PDPSurfaceDesc; +} + +void PDPSurfaceDesc::Clear() { + if (_has_bits_[0 / 32] & 3) { + if (has_src_data()) { + if (src_data_ != NULL) src_data_->::nvdla_prototest_interface::DataCube::Clear(); + } + if (has_dst_data()) { + if (dst_data_ != NULL) dst_data_->::nvdla_prototest_interface::DataCube::Clear(); + } + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool PDPSurfaceDesc::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:nvdla_prototest_interface.PDPSurfaceDesc) + 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)) { + // required .nvdla_prototest_interface.DataCube src_data = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_src_data())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_dst_data; + break; + } + + // required .nvdla_prototest_interface.DataCube dst_data = 2; + case 2: { + if (tag == 18) { + parse_dst_data: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_dst_data())); + } 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:nvdla_prototest_interface.PDPSurfaceDesc) + return true; +failure: + // @@protoc_insertion_point(parse_failure:nvdla_prototest_interface.PDPSurfaceDesc) + return false; +#undef DO_ +} + +void PDPSurfaceDesc::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:nvdla_prototest_interface.PDPSurfaceDesc) + // required .nvdla_prototest_interface.DataCube src_data = 1; + if (has_src_data()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->src_data(), output); + } + + // required .nvdla_prototest_interface.DataCube dst_data = 2; + if (has_dst_data()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->dst_data(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:nvdla_prototest_interface.PDPSurfaceDesc) +} + +::google::protobuf::uint8* PDPSurfaceDesc::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:nvdla_prototest_interface.PDPSurfaceDesc) + // required .nvdla_prototest_interface.DataCube src_data = 1; + if (has_src_data()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 1, this->src_data(), target); + } + + // required .nvdla_prototest_interface.DataCube dst_data = 2; + if (has_dst_data()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 2, this->dst_data(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:nvdla_prototest_interface.PDPSurfaceDesc) + return target; +} + +int PDPSurfaceDesc::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // required .nvdla_prototest_interface.DataCube src_data = 1; + if (has_src_data()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->src_data()); + } + + // required .nvdla_prototest_interface.DataCube dst_data = 2; + if (has_dst_data()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->dst_data()); + } + + } + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void PDPSurfaceDesc::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const PDPSurfaceDesc* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void PDPSurfaceDesc::MergeFrom(const PDPSurfaceDesc& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_src_data()) { + mutable_src_data()->::nvdla_prototest_interface::DataCube::MergeFrom(from.src_data()); + } + if (from.has_dst_data()) { + mutable_dst_data()->::nvdla_prototest_interface::DataCube::MergeFrom(from.dst_data()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void PDPSurfaceDesc::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void PDPSurfaceDesc::CopyFrom(const PDPSurfaceDesc& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool PDPSurfaceDesc::IsInitialized() const { + if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false; + + if (has_src_data()) { + if (!this->src_data().IsInitialized()) return false; + } + if (has_dst_data()) { + if (!this->dst_data().IsInitialized()) return false; + } + return true; +} + +void PDPSurfaceDesc::Swap(PDPSurfaceDesc* other) { + if (other != this) { + std::swap(src_data_, other->src_data_); + std::swap(dst_data_, other->dst_data_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::google::protobuf::Metadata PDPSurfaceDesc::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = PDPSurfaceDesc_descriptor_; + metadata.reflection = PDPSurfaceDesc_reflection_; + return metadata; +} + + +// =================================================================== + +const ::google::protobuf::EnumDescriptor* PDPOpDesc_PoolingMode_descriptor() { + protobuf_AssignDescriptorsOnce(); + return PDPOpDesc_PoolingMode_descriptor_; +} +bool PDPOpDesc_PoolingMode_IsValid(int value) { + switch(value) { + case 0: + case 1: + case 2: + return true; + default: + return false; + } +} + +#ifndef _MSC_VER +const PDPOpDesc_PoolingMode PDPOpDesc::MODE_AVG; +const PDPOpDesc_PoolingMode PDPOpDesc::MODE_MAX; +const PDPOpDesc_PoolingMode PDPOpDesc::MODE_MIN; +const PDPOpDesc_PoolingMode PDPOpDesc::PoolingMode_MIN; +const PDPOpDesc_PoolingMode PDPOpDesc::PoolingMode_MAX; +const int PDPOpDesc::PoolingMode_ARRAYSIZE; +#endif // _MSC_VER +#ifndef _MSC_VER +const int PDPOpDesc::kPartialInWidthFirstFieldNumber; +const int PDPOpDesc::kPartialInWidthMidFieldNumber; +const int PDPOpDesc::kPartialInWidthLastFieldNumber; +const int PDPOpDesc::kPartialWidthFirstFieldNumber; +const int PDPOpDesc::kPartialWidthMidFieldNumber; +const int PDPOpDesc::kPartialWidthLastFieldNumber; +const int PDPOpDesc::kSplitNumFieldNumber; +const int PDPOpDesc::kPoolModeFieldNumber; +const int PDPOpDesc::kPoolWidthFieldNumber; +const int PDPOpDesc::kPoolHeightFieldNumber; +const int PDPOpDesc::kStrideXFieldNumber; +const int PDPOpDesc::kStrideYFieldNumber; +const int PDPOpDesc::kPadLeftFieldNumber; +const int PDPOpDesc::kPadRightFieldNumber; +const int PDPOpDesc::kPadTopFieldNumber; +const int PDPOpDesc::kPadBottomFieldNumber; +const int PDPOpDesc::kPrecisionFieldNumber; +const int PDPOpDesc::kReserved0FieldNumber; +const int PDPOpDesc::kPaddingValueFieldNumber; +#endif // !_MSC_VER + +PDPOpDesc::PDPOpDesc() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:nvdla_prototest_interface.PDPOpDesc) +} + +void PDPOpDesc::InitAsDefaultInstance() { +} + +PDPOpDesc::PDPOpDesc(const PDPOpDesc& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:nvdla_prototest_interface.PDPOpDesc) +} + +void PDPOpDesc::SharedCtor() { + _cached_size_ = 0; + partial_in_width_first_ = 0u; + partial_in_width_mid_ = 0u; + partial_in_width_last_ = 0u; + partial_width_first_ = 0u; + partial_width_mid_ = 0u; + partial_width_last_ = 0u; + split_num_ = 0u; + pool_mode_ = 0; + pool_width_ = 0; + pool_height_ = 0; + stride_x_ = 0u; + stride_y_ = 0u; + pad_left_ = 0u; + pad_right_ = 0u; + pad_top_ = 0u; + pad_bottom_ = 0u; + precision_ = 0; + reserved0_ = 0u; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +PDPOpDesc::~PDPOpDesc() { + // @@protoc_insertion_point(destructor:nvdla_prototest_interface.PDPOpDesc) + SharedDtor(); +} + +void PDPOpDesc::SharedDtor() { + if (this != default_instance_) { + } +} + +void PDPOpDesc::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* PDPOpDesc::descriptor() { + protobuf_AssignDescriptorsOnce(); + return PDPOpDesc_descriptor_; +} + +const PDPOpDesc& PDPOpDesc::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_DlaPrototestInterface_2eproto(); + return *default_instance_; +} + +PDPOpDesc* PDPOpDesc::default_instance_ = NULL; + +PDPOpDesc* PDPOpDesc::New() const { + return new PDPOpDesc; +} + +void PDPOpDesc::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 255) { + ZR_(partial_in_width_first_, pool_mode_); + } + if (_has_bits_[8 / 32] & 65280) { + ZR_(pool_width_, pad_bottom_); + } + ZR_(precision_, reserved0_); + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + padding_value_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool PDPOpDesc::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:nvdla_prototest_interface.PDPOpDesc) + 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)) { + // required uint32 partial_in_width_first = 1; + case 1: { + if (tag == 8) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &partial_in_width_first_))); + set_has_partial_in_width_first(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_partial_in_width_mid; + break; + } + + // required uint32 partial_in_width_mid = 2; + case 2: { + if (tag == 16) { + parse_partial_in_width_mid: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &partial_in_width_mid_))); + set_has_partial_in_width_mid(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(24)) goto parse_partial_in_width_last; + break; + } + + // required uint32 partial_in_width_last = 3; + case 3: { + if (tag == 24) { + parse_partial_in_width_last: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &partial_in_width_last_))); + set_has_partial_in_width_last(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(32)) goto parse_partial_width_first; + break; + } + + // required uint32 partial_width_first = 4; + case 4: { + if (tag == 32) { + parse_partial_width_first: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &partial_width_first_))); + set_has_partial_width_first(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(40)) goto parse_partial_width_mid; + break; + } + + // required uint32 partial_width_mid = 5; + case 5: { + if (tag == 40) { + parse_partial_width_mid: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &partial_width_mid_))); + set_has_partial_width_mid(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(48)) goto parse_partial_width_last; + break; + } + + // required uint32 partial_width_last = 6; + case 6: { + if (tag == 48) { + parse_partial_width_last: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &partial_width_last_))); + set_has_partial_width_last(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(56)) goto parse_split_num; + break; + } + + // required uint32 split_num = 7; + case 7: { + if (tag == 56) { + parse_split_num: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &split_num_))); + set_has_split_num(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(64)) goto parse_pool_mode; + break; + } + + // required .nvdla_prototest_interface.PDPOpDesc.PoolingMode pool_mode = 8; + case 8: { + if (tag == 64) { + parse_pool_mode: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::nvdla_prototest_interface::PDPOpDesc_PoolingMode_IsValid(value)) { + set_pool_mode(static_cast< ::nvdla_prototest_interface::PDPOpDesc_PoolingMode >(value)); + } else { + mutable_unknown_fields()->AddVarint(8, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(72)) goto parse_pool_width; + break; + } + + // required .nvdla_prototest_interface.PoolSize pool_width = 9; + case 9: { + if (tag == 72) { + parse_pool_width: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::nvdla_prototest_interface::PoolSize_IsValid(value)) { + set_pool_width(static_cast< ::nvdla_prototest_interface::PoolSize >(value)); + } else { + mutable_unknown_fields()->AddVarint(9, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(80)) goto parse_pool_height; + break; + } + + // required .nvdla_prototest_interface.PoolSize pool_height = 10; + case 10: { + if (tag == 80) { + parse_pool_height: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::nvdla_prototest_interface::PoolSize_IsValid(value)) { + set_pool_height(static_cast< ::nvdla_prototest_interface::PoolSize >(value)); + } else { + mutable_unknown_fields()->AddVarint(10, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(88)) goto parse_stride_x; + break; + } + + // required uint32 stride_x = 11; + case 11: { + if (tag == 88) { + parse_stride_x: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &stride_x_))); + set_has_stride_x(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(96)) goto parse_stride_y; + break; + } + + // required uint32 stride_y = 12; + case 12: { + if (tag == 96) { + parse_stride_y: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &stride_y_))); + set_has_stride_y(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(104)) goto parse_pad_left; + break; + } + + // required uint32 pad_left = 13; + case 13: { + if (tag == 104) { + parse_pad_left: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &pad_left_))); + set_has_pad_left(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(112)) goto parse_pad_right; + break; + } + + // required uint32 pad_right = 14; + case 14: { + if (tag == 112) { + parse_pad_right: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &pad_right_))); + set_has_pad_right(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(120)) goto parse_pad_top; + break; + } + + // required uint32 pad_top = 15; + case 15: { + if (tag == 120) { + parse_pad_top: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &pad_top_))); + set_has_pad_top(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(128)) goto parse_pad_bottom; + break; + } + + // required uint32 pad_bottom = 16; + case 16: { + if (tag == 128) { + parse_pad_bottom: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &pad_bottom_))); + set_has_pad_bottom(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(136)) goto parse_precision; + break; + } + + // required .nvdla_prototest_interface.DataPrecision precision = 17; + case 17: { + if (tag == 136) { + parse_precision: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::nvdla_prototest_interface::DataPrecision_IsValid(value)) { + set_precision(static_cast< ::nvdla_prototest_interface::DataPrecision >(value)); + } else { + mutable_unknown_fields()->AddVarint(17, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(144)) goto parse_reserved0; + break; + } + + // optional uint32 reserved0 = 18 [default = 0]; + case 18: { + if (tag == 144) { + parse_reserved0: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &reserved0_))); + set_has_reserved0(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(154)) goto parse_padding_value; + break; + } + + // repeated int32 padding_value = 19 [packed = true]; + case 19: { + if (tag == 154) { + parse_padding_value: + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, this->mutable_padding_value()))); + } else if (tag == 152) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + 2, 154, input, this->mutable_padding_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:nvdla_prototest_interface.PDPOpDesc) + return true; +failure: + // @@protoc_insertion_point(parse_failure:nvdla_prototest_interface.PDPOpDesc) + return false; +#undef DO_ +} + +void PDPOpDesc::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:nvdla_prototest_interface.PDPOpDesc) + // required uint32 partial_in_width_first = 1; + if (has_partial_in_width_first()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->partial_in_width_first(), output); + } + + // required uint32 partial_in_width_mid = 2; + if (has_partial_in_width_mid()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->partial_in_width_mid(), output); + } + + // required uint32 partial_in_width_last = 3; + if (has_partial_in_width_last()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->partial_in_width_last(), output); + } + + // required uint32 partial_width_first = 4; + if (has_partial_width_first()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(4, this->partial_width_first(), output); + } + + // required uint32 partial_width_mid = 5; + if (has_partial_width_mid()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(5, this->partial_width_mid(), output); + } + + // required uint32 partial_width_last = 6; + if (has_partial_width_last()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(6, this->partial_width_last(), output); + } + + // required uint32 split_num = 7; + if (has_split_num()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(7, this->split_num(), output); + } + + // required .nvdla_prototest_interface.PDPOpDesc.PoolingMode pool_mode = 8; + if (has_pool_mode()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 8, this->pool_mode(), output); + } + + // required .nvdla_prototest_interface.PoolSize pool_width = 9; + if (has_pool_width()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 9, this->pool_width(), output); + } + + // required .nvdla_prototest_interface.PoolSize pool_height = 10; + if (has_pool_height()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 10, this->pool_height(), output); + } + + // required uint32 stride_x = 11; + if (has_stride_x()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(11, this->stride_x(), output); + } + + // required uint32 stride_y = 12; + if (has_stride_y()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(12, this->stride_y(), output); + } + + // required uint32 pad_left = 13; + if (has_pad_left()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(13, this->pad_left(), output); + } + + // required uint32 pad_right = 14; + if (has_pad_right()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(14, this->pad_right(), output); + } + + // required uint32 pad_top = 15; + if (has_pad_top()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(15, this->pad_top(), output); + } + + // required uint32 pad_bottom = 16; + if (has_pad_bottom()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(16, this->pad_bottom(), output); + } + + // required .nvdla_prototest_interface.DataPrecision precision = 17; + if (has_precision()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 17, this->precision(), output); + } + + // optional uint32 reserved0 = 18 [default = 0]; + if (has_reserved0()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(18, this->reserved0(), output); + } + + // repeated int32 padding_value = 19 [packed = true]; + if (this->padding_value_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(19, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(_padding_value_cached_byte_size_); + } + for (int i = 0; i < this->padding_value_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt32NoTag( + this->padding_value(i), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:nvdla_prototest_interface.PDPOpDesc) +} + +::google::protobuf::uint8* PDPOpDesc::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:nvdla_prototest_interface.PDPOpDesc) + // required uint32 partial_in_width_first = 1; + if (has_partial_in_width_first()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->partial_in_width_first(), target); + } + + // required uint32 partial_in_width_mid = 2; + if (has_partial_in_width_mid()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->partial_in_width_mid(), target); + } + + // required uint32 partial_in_width_last = 3; + if (has_partial_in_width_last()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->partial_in_width_last(), target); + } + + // required uint32 partial_width_first = 4; + if (has_partial_width_first()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(4, this->partial_width_first(), target); + } + + // required uint32 partial_width_mid = 5; + if (has_partial_width_mid()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(5, this->partial_width_mid(), target); + } + + // required uint32 partial_width_last = 6; + if (has_partial_width_last()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(6, this->partial_width_last(), target); + } + + // required uint32 split_num = 7; + if (has_split_num()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(7, this->split_num(), target); + } + + // required .nvdla_prototest_interface.PDPOpDesc.PoolingMode pool_mode = 8; + if (has_pool_mode()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 8, this->pool_mode(), target); + } + + // required .nvdla_prototest_interface.PoolSize pool_width = 9; + if (has_pool_width()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 9, this->pool_width(), target); + } + + // required .nvdla_prototest_interface.PoolSize pool_height = 10; + if (has_pool_height()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 10, this->pool_height(), target); + } + + // required uint32 stride_x = 11; + if (has_stride_x()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(11, this->stride_x(), target); + } + + // required uint32 stride_y = 12; + if (has_stride_y()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(12, this->stride_y(), target); + } + + // required uint32 pad_left = 13; + if (has_pad_left()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(13, this->pad_left(), target); + } + + // required uint32 pad_right = 14; + if (has_pad_right()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(14, this->pad_right(), target); + } + + // required uint32 pad_top = 15; + if (has_pad_top()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(15, this->pad_top(), target); + } + + // required uint32 pad_bottom = 16; + if (has_pad_bottom()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(16, this->pad_bottom(), target); + } + + // required .nvdla_prototest_interface.DataPrecision precision = 17; + if (has_precision()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 17, this->precision(), target); + } + + // optional uint32 reserved0 = 18 [default = 0]; + if (has_reserved0()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(18, this->reserved0(), target); + } + + // repeated int32 padding_value = 19 [packed = true]; + if (this->padding_value_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 19, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + _padding_value_cached_byte_size_, target); + } + for (int i = 0; i < this->padding_value_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt32NoTagToArray(this->padding_value(i), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:nvdla_prototest_interface.PDPOpDesc) + return target; +} + +int PDPOpDesc::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // required uint32 partial_in_width_first = 1; + if (has_partial_in_width_first()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->partial_in_width_first()); + } + + // required uint32 partial_in_width_mid = 2; + if (has_partial_in_width_mid()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->partial_in_width_mid()); + } + + // required uint32 partial_in_width_last = 3; + if (has_partial_in_width_last()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->partial_in_width_last()); + } + + // required uint32 partial_width_first = 4; + if (has_partial_width_first()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->partial_width_first()); + } + + // required uint32 partial_width_mid = 5; + if (has_partial_width_mid()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->partial_width_mid()); + } + + // required uint32 partial_width_last = 6; + if (has_partial_width_last()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->partial_width_last()); + } + + // required uint32 split_num = 7; + if (has_split_num()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->split_num()); + } + + // required .nvdla_prototest_interface.PDPOpDesc.PoolingMode pool_mode = 8; + if (has_pool_mode()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->pool_mode()); + } + + } + if (_has_bits_[8 / 32] & (0xffu << (8 % 32))) { + // required .nvdla_prototest_interface.PoolSize pool_width = 9; + if (has_pool_width()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->pool_width()); + } + + // required .nvdla_prototest_interface.PoolSize pool_height = 10; + if (has_pool_height()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->pool_height()); + } + + // required uint32 stride_x = 11; + if (has_stride_x()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->stride_x()); + } + + // required uint32 stride_y = 12; + if (has_stride_y()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->stride_y()); + } + + // required uint32 pad_left = 13; + if (has_pad_left()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->pad_left()); + } + + // required uint32 pad_right = 14; + if (has_pad_right()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->pad_right()); + } + + // required uint32 pad_top = 15; + if (has_pad_top()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->pad_top()); + } + + // required uint32 pad_bottom = 16; + if (has_pad_bottom()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->pad_bottom()); + } + + } + if (_has_bits_[16 / 32] & (0xffu << (16 % 32))) { + // required .nvdla_prototest_interface.DataPrecision precision = 17; + if (has_precision()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->precision()); + } + + // optional uint32 reserved0 = 18 [default = 0]; + if (has_reserved0()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->reserved0()); + } + + } + // repeated int32 padding_value = 19 [packed = true]; + { + int data_size = 0; + for (int i = 0; i < this->padding_value_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + Int32Size(this->padding_value(i)); + } + if (data_size > 0) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _padding_value_cached_byte_size_ = data_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void PDPOpDesc::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const PDPOpDesc* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void PDPOpDesc::MergeFrom(const PDPOpDesc& from) { + GOOGLE_CHECK_NE(&from, this); + padding_value_.MergeFrom(from.padding_value_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_partial_in_width_first()) { + set_partial_in_width_first(from.partial_in_width_first()); + } + if (from.has_partial_in_width_mid()) { + set_partial_in_width_mid(from.partial_in_width_mid()); + } + if (from.has_partial_in_width_last()) { + set_partial_in_width_last(from.partial_in_width_last()); + } + if (from.has_partial_width_first()) { + set_partial_width_first(from.partial_width_first()); + } + if (from.has_partial_width_mid()) { + set_partial_width_mid(from.partial_width_mid()); + } + if (from.has_partial_width_last()) { + set_partial_width_last(from.partial_width_last()); + } + if (from.has_split_num()) { + set_split_num(from.split_num()); + } + if (from.has_pool_mode()) { + set_pool_mode(from.pool_mode()); + } + } + if (from._has_bits_[8 / 32] & (0xffu << (8 % 32))) { + if (from.has_pool_width()) { + set_pool_width(from.pool_width()); + } + if (from.has_pool_height()) { + set_pool_height(from.pool_height()); + } + if (from.has_stride_x()) { + set_stride_x(from.stride_x()); + } + if (from.has_stride_y()) { + set_stride_y(from.stride_y()); + } + if (from.has_pad_left()) { + set_pad_left(from.pad_left()); + } + if (from.has_pad_right()) { + set_pad_right(from.pad_right()); + } + if (from.has_pad_top()) { + set_pad_top(from.pad_top()); + } + if (from.has_pad_bottom()) { + set_pad_bottom(from.pad_bottom()); + } + } + if (from._has_bits_[16 / 32] & (0xffu << (16 % 32))) { + if (from.has_precision()) { + set_precision(from.precision()); + } + if (from.has_reserved0()) { + set_reserved0(from.reserved0()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void PDPOpDesc::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void PDPOpDesc::CopyFrom(const PDPOpDesc& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool PDPOpDesc::IsInitialized() const { + if ((_has_bits_[0] & 0x0001ffff) != 0x0001ffff) return false; + + return true; +} + +void PDPOpDesc::Swap(PDPOpDesc* other) { + if (other != this) { + std::swap(partial_in_width_first_, other->partial_in_width_first_); + std::swap(partial_in_width_mid_, other->partial_in_width_mid_); + std::swap(partial_in_width_last_, other->partial_in_width_last_); + std::swap(partial_width_first_, other->partial_width_first_); + std::swap(partial_width_mid_, other->partial_width_mid_); + std::swap(partial_width_last_, other->partial_width_last_); + std::swap(split_num_, other->split_num_); + std::swap(pool_mode_, other->pool_mode_); + std::swap(pool_width_, other->pool_width_); + std::swap(pool_height_, other->pool_height_); + std::swap(stride_x_, other->stride_x_); + std::swap(stride_y_, other->stride_y_); + std::swap(pad_left_, other->pad_left_); + std::swap(pad_right_, other->pad_right_); + std::swap(pad_top_, other->pad_top_); + std::swap(pad_bottom_, other->pad_bottom_); + std::swap(precision_, other->precision_); + std::swap(reserved0_, other->reserved0_); + padding_value_.Swap(&other->padding_value_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::google::protobuf::Metadata PDPOpDesc::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = PDPOpDesc_descriptor_; + metadata.reflection = PDPOpDesc_reflection_; + return metadata; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int CDPSurfaceDesc::kSrcDataFieldNumber; +const int CDPSurfaceDesc::kDstDataFieldNumber; +#endif // !_MSC_VER + +CDPSurfaceDesc::CDPSurfaceDesc() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:nvdla_prototest_interface.CDPSurfaceDesc) +} + +void CDPSurfaceDesc::InitAsDefaultInstance() { + src_data_ = const_cast< ::nvdla_prototest_interface::DataCube*>(&::nvdla_prototest_interface::DataCube::default_instance()); + dst_data_ = const_cast< ::nvdla_prototest_interface::DataCube*>(&::nvdla_prototest_interface::DataCube::default_instance()); +} + +CDPSurfaceDesc::CDPSurfaceDesc(const CDPSurfaceDesc& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:nvdla_prototest_interface.CDPSurfaceDesc) +} + +void CDPSurfaceDesc::SharedCtor() { + _cached_size_ = 0; + src_data_ = NULL; + dst_data_ = NULL; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +CDPSurfaceDesc::~CDPSurfaceDesc() { + // @@protoc_insertion_point(destructor:nvdla_prototest_interface.CDPSurfaceDesc) + SharedDtor(); +} + +void CDPSurfaceDesc::SharedDtor() { + if (this != default_instance_) { + delete src_data_; + delete dst_data_; + } +} + +void CDPSurfaceDesc::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* CDPSurfaceDesc::descriptor() { + protobuf_AssignDescriptorsOnce(); + return CDPSurfaceDesc_descriptor_; +} + +const CDPSurfaceDesc& CDPSurfaceDesc::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_DlaPrototestInterface_2eproto(); + return *default_instance_; +} + +CDPSurfaceDesc* CDPSurfaceDesc::default_instance_ = NULL; + +CDPSurfaceDesc* CDPSurfaceDesc::New() const { + return new CDPSurfaceDesc; +} + +void CDPSurfaceDesc::Clear() { + if (_has_bits_[0 / 32] & 3) { + if (has_src_data()) { + if (src_data_ != NULL) src_data_->::nvdla_prototest_interface::DataCube::Clear(); + } + if (has_dst_data()) { + if (dst_data_ != NULL) dst_data_->::nvdla_prototest_interface::DataCube::Clear(); + } + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool CDPSurfaceDesc::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:nvdla_prototest_interface.CDPSurfaceDesc) + 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)) { + // required .nvdla_prototest_interface.DataCube src_data = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_src_data())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_dst_data; + break; + } + + // required .nvdla_prototest_interface.DataCube dst_data = 2; + case 2: { + if (tag == 18) { + parse_dst_data: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_dst_data())); + } 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:nvdla_prototest_interface.CDPSurfaceDesc) + return true; +failure: + // @@protoc_insertion_point(parse_failure:nvdla_prototest_interface.CDPSurfaceDesc) + return false; +#undef DO_ +} + +void CDPSurfaceDesc::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:nvdla_prototest_interface.CDPSurfaceDesc) + // required .nvdla_prototest_interface.DataCube src_data = 1; + if (has_src_data()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->src_data(), output); + } + + // required .nvdla_prototest_interface.DataCube dst_data = 2; + if (has_dst_data()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->dst_data(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:nvdla_prototest_interface.CDPSurfaceDesc) +} + +::google::protobuf::uint8* CDPSurfaceDesc::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:nvdla_prototest_interface.CDPSurfaceDesc) + // required .nvdla_prototest_interface.DataCube src_data = 1; + if (has_src_data()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 1, this->src_data(), target); + } + + // required .nvdla_prototest_interface.DataCube dst_data = 2; + if (has_dst_data()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 2, this->dst_data(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:nvdla_prototest_interface.CDPSurfaceDesc) + return target; +} + +int CDPSurfaceDesc::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // required .nvdla_prototest_interface.DataCube src_data = 1; + if (has_src_data()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->src_data()); + } + + // required .nvdla_prototest_interface.DataCube dst_data = 2; + if (has_dst_data()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->dst_data()); + } + + } + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void CDPSurfaceDesc::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const CDPSurfaceDesc* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void CDPSurfaceDesc::MergeFrom(const CDPSurfaceDesc& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_src_data()) { + mutable_src_data()->::nvdla_prototest_interface::DataCube::MergeFrom(from.src_data()); + } + if (from.has_dst_data()) { + mutable_dst_data()->::nvdla_prototest_interface::DataCube::MergeFrom(from.dst_data()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void CDPSurfaceDesc::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void CDPSurfaceDesc::CopyFrom(const CDPSurfaceDesc& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool CDPSurfaceDesc::IsInitialized() const { + if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false; + + if (has_src_data()) { + if (!this->src_data().IsInitialized()) return false; + } + if (has_dst_data()) { + if (!this->dst_data().IsInitialized()) return false; + } + return true; +} + +void CDPSurfaceDesc::Swap(CDPSurfaceDesc* other) { + if (other != this) { + std::swap(src_data_, other->src_data_); + std::swap(dst_data_, other->dst_data_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::google::protobuf::Metadata CDPSurfaceDesc::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = CDPSurfaceDesc_descriptor_; + metadata.reflection = CDPSurfaceDesc_reflection_; + return metadata; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int CDPOpDesc::kInPrecisionFieldNumber; +const int CDPOpDesc::kOutPrecisionFieldNumber; +const int CDPOpDesc::kLutIndexFieldNumber; +const int CDPOpDesc::kInCvtFieldNumber; +const int CDPOpDesc::kOutCvtFieldNumber; +const int CDPOpDesc::kLocalSizeFieldNumber; +const int CDPOpDesc::kBypassSqsumFieldNumber; +const int CDPOpDesc::kBypassOutMulFieldNumber; +const int CDPOpDesc::kReserved0FieldNumber; +#endif // !_MSC_VER + +CDPOpDesc::CDPOpDesc() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:nvdla_prototest_interface.CDPOpDesc) +} + +void CDPOpDesc::InitAsDefaultInstance() { + in_cvt_ = const_cast< ::nvdla_prototest_interface::CVTParam*>(&::nvdla_prototest_interface::CVTParam::default_instance()); + out_cvt_ = const_cast< ::nvdla_prototest_interface::CVTParam*>(&::nvdla_prototest_interface::CVTParam::default_instance()); +} + +CDPOpDesc::CDPOpDesc(const CDPOpDesc& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:nvdla_prototest_interface.CDPOpDesc) +} + +void CDPOpDesc::SharedCtor() { + _cached_size_ = 0; + in_precision_ = 0; + out_precision_ = 0; + lut_index_ = 0; + in_cvt_ = NULL; + out_cvt_ = NULL; + local_size_ = 0u; + bypass_sqsum_ = 0u; + bypass_out_mul_ = 0u; + reserved0_ = 0u; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +CDPOpDesc::~CDPOpDesc() { + // @@protoc_insertion_point(destructor:nvdla_prototest_interface.CDPOpDesc) + SharedDtor(); +} + +void CDPOpDesc::SharedDtor() { + if (this != default_instance_) { + delete in_cvt_; + delete out_cvt_; + } +} + +void CDPOpDesc::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* CDPOpDesc::descriptor() { + protobuf_AssignDescriptorsOnce(); + return CDPOpDesc_descriptor_; +} + +const CDPOpDesc& CDPOpDesc::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_DlaPrototestInterface_2eproto(); + return *default_instance_; +} + +CDPOpDesc* CDPOpDesc::default_instance_ = NULL; + +CDPOpDesc* CDPOpDesc::New() const { + return new CDPOpDesc; +} + +void CDPOpDesc::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 255) { + ZR_(in_precision_, out_precision_); + ZR_(lut_index_, local_size_); + ZR_(bypass_sqsum_, bypass_out_mul_); + if (has_in_cvt()) { + if (in_cvt_ != NULL) in_cvt_->::nvdla_prototest_interface::CVTParam::Clear(); + } + if (has_out_cvt()) { + if (out_cvt_ != NULL) out_cvt_->::nvdla_prototest_interface::CVTParam::Clear(); + } + } + reserved0_ = 0u; + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool CDPOpDesc::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:nvdla_prototest_interface.CDPOpDesc) + 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)) { + // required .nvdla_prototest_interface.DataPrecision in_precision = 1; + case 1: { + if (tag == 8) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::nvdla_prototest_interface::DataPrecision_IsValid(value)) { + set_in_precision(static_cast< ::nvdla_prototest_interface::DataPrecision >(value)); + } else { + mutable_unknown_fields()->AddVarint(1, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_out_precision; + break; + } + + // required .nvdla_prototest_interface.DataPrecision out_precision = 2; + case 2: { + if (tag == 16) { + parse_out_precision: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::nvdla_prototest_interface::DataPrecision_IsValid(value)) { + set_out_precision(static_cast< ::nvdla_prototest_interface::DataPrecision >(value)); + } else { + mutable_unknown_fields()->AddVarint(2, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(24)) goto parse_lut_index; + break; + } + + // required int32 lut_index = 3; + case 3: { + if (tag == 24) { + parse_lut_index: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &lut_index_))); + set_has_lut_index(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(34)) goto parse_in_cvt; + break; + } + + // required .nvdla_prototest_interface.CVTParam in_cvt = 4; + case 4: { + if (tag == 34) { + parse_in_cvt: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_in_cvt())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(42)) goto parse_out_cvt; + break; + } + + // required .nvdla_prototest_interface.CVTParam out_cvt = 5; + case 5: { + if (tag == 42) { + parse_out_cvt: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_out_cvt())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(48)) goto parse_local_size; + break; + } + + // required uint32 local_size = 6; + case 6: { + if (tag == 48) { + parse_local_size: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &local_size_))); + set_has_local_size(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(56)) goto parse_bypass_sqsum; + break; + } + + // required uint32 bypass_sqsum = 7; + case 7: { + if (tag == 56) { + parse_bypass_sqsum: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &bypass_sqsum_))); + set_has_bypass_sqsum(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(64)) goto parse_bypass_out_mul; + break; + } + + // required uint32 bypass_out_mul = 8; + case 8: { + if (tag == 64) { + parse_bypass_out_mul: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &bypass_out_mul_))); + set_has_bypass_out_mul(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(72)) goto parse_reserved0; + break; + } + + // optional uint32 reserved0 = 9 [default = 0]; + case 9: { + if (tag == 72) { + parse_reserved0: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &reserved0_))); + set_has_reserved0(); + } 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:nvdla_prototest_interface.CDPOpDesc) + return true; +failure: + // @@protoc_insertion_point(parse_failure:nvdla_prototest_interface.CDPOpDesc) + return false; +#undef DO_ +} + +void CDPOpDesc::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:nvdla_prototest_interface.CDPOpDesc) + // required .nvdla_prototest_interface.DataPrecision in_precision = 1; + if (has_in_precision()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 1, this->in_precision(), output); + } + + // required .nvdla_prototest_interface.DataPrecision out_precision = 2; + if (has_out_precision()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 2, this->out_precision(), output); + } + + // required int32 lut_index = 3; + if (has_lut_index()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->lut_index(), output); + } + + // required .nvdla_prototest_interface.CVTParam in_cvt = 4; + if (has_in_cvt()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, this->in_cvt(), output); + } + + // required .nvdla_prototest_interface.CVTParam out_cvt = 5; + if (has_out_cvt()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 5, this->out_cvt(), output); + } + + // required uint32 local_size = 6; + if (has_local_size()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(6, this->local_size(), output); + } + + // required uint32 bypass_sqsum = 7; + if (has_bypass_sqsum()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(7, this->bypass_sqsum(), output); + } + + // required uint32 bypass_out_mul = 8; + if (has_bypass_out_mul()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(8, this->bypass_out_mul(), output); + } + + // optional uint32 reserved0 = 9 [default = 0]; + if (has_reserved0()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(9, this->reserved0(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:nvdla_prototest_interface.CDPOpDesc) +} + +::google::protobuf::uint8* CDPOpDesc::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:nvdla_prototest_interface.CDPOpDesc) + // required .nvdla_prototest_interface.DataPrecision in_precision = 1; + if (has_in_precision()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 1, this->in_precision(), target); + } + + // required .nvdla_prototest_interface.DataPrecision out_precision = 2; + if (has_out_precision()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 2, this->out_precision(), target); + } + + // required int32 lut_index = 3; + if (has_lut_index()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->lut_index(), target); + } + + // required .nvdla_prototest_interface.CVTParam in_cvt = 4; + if (has_in_cvt()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 4, this->in_cvt(), target); + } + + // required .nvdla_prototest_interface.CVTParam out_cvt = 5; + if (has_out_cvt()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 5, this->out_cvt(), target); + } + + // required uint32 local_size = 6; + if (has_local_size()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(6, this->local_size(), target); + } + + // required uint32 bypass_sqsum = 7; + if (has_bypass_sqsum()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(7, this->bypass_sqsum(), target); + } + + // required uint32 bypass_out_mul = 8; + if (has_bypass_out_mul()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(8, this->bypass_out_mul(), target); + } + + // optional uint32 reserved0 = 9 [default = 0]; + if (has_reserved0()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(9, this->reserved0(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:nvdla_prototest_interface.CDPOpDesc) + return target; +} + +int CDPOpDesc::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // required .nvdla_prototest_interface.DataPrecision in_precision = 1; + if (has_in_precision()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->in_precision()); + } + + // required .nvdla_prototest_interface.DataPrecision out_precision = 2; + if (has_out_precision()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->out_precision()); + } + + // required int32 lut_index = 3; + if (has_lut_index()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->lut_index()); + } + + // required .nvdla_prototest_interface.CVTParam in_cvt = 4; + if (has_in_cvt()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->in_cvt()); + } + + // required .nvdla_prototest_interface.CVTParam out_cvt = 5; + if (has_out_cvt()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->out_cvt()); + } + + // required uint32 local_size = 6; + if (has_local_size()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->local_size()); + } + + // required uint32 bypass_sqsum = 7; + if (has_bypass_sqsum()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->bypass_sqsum()); + } + + // required uint32 bypass_out_mul = 8; + if (has_bypass_out_mul()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->bypass_out_mul()); + } + + } + if (_has_bits_[8 / 32] & (0xffu << (8 % 32))) { + // optional uint32 reserved0 = 9 [default = 0]; + if (has_reserved0()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->reserved0()); + } + + } + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void CDPOpDesc::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const CDPOpDesc* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void CDPOpDesc::MergeFrom(const CDPOpDesc& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_in_precision()) { + set_in_precision(from.in_precision()); + } + if (from.has_out_precision()) { + set_out_precision(from.out_precision()); + } + if (from.has_lut_index()) { + set_lut_index(from.lut_index()); + } + if (from.has_in_cvt()) { + mutable_in_cvt()->::nvdla_prototest_interface::CVTParam::MergeFrom(from.in_cvt()); + } + if (from.has_out_cvt()) { + mutable_out_cvt()->::nvdla_prototest_interface::CVTParam::MergeFrom(from.out_cvt()); + } + if (from.has_local_size()) { + set_local_size(from.local_size()); + } + if (from.has_bypass_sqsum()) { + set_bypass_sqsum(from.bypass_sqsum()); + } + if (from.has_bypass_out_mul()) { + set_bypass_out_mul(from.bypass_out_mul()); + } + } + if (from._has_bits_[8 / 32] & (0xffu << (8 % 32))) { + if (from.has_reserved0()) { + set_reserved0(from.reserved0()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void CDPOpDesc::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void CDPOpDesc::CopyFrom(const CDPOpDesc& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool CDPOpDesc::IsInitialized() const { + if ((_has_bits_[0] & 0x000000ff) != 0x000000ff) return false; + + if (has_in_cvt()) { + if (!this->in_cvt().IsInitialized()) return false; + } + if (has_out_cvt()) { + if (!this->out_cvt().IsInitialized()) return false; + } + return true; +} + +void CDPOpDesc::Swap(CDPOpDesc* other) { + if (other != this) { + std::swap(in_precision_, other->in_precision_); + std::swap(out_precision_, other->out_precision_); + std::swap(lut_index_, other->lut_index_); + std::swap(in_cvt_, other->in_cvt_); + std::swap(out_cvt_, other->out_cvt_); + std::swap(local_size_, other->local_size_); + std::swap(bypass_sqsum_, other->bypass_sqsum_); + std::swap(bypass_out_mul_, other->bypass_out_mul_); + std::swap(reserved0_, other->reserved0_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::google::protobuf::Metadata CDPOpDesc::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = CDPOpDesc_descriptor_; + metadata.reflection = CDPOpDesc_reflection_; + return metadata; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int RUBIKSurfaceDesc::kSrcDataFieldNumber; +const int RUBIKSurfaceDesc::kDstDataFieldNumber; +#endif // !_MSC_VER + +RUBIKSurfaceDesc::RUBIKSurfaceDesc() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:nvdla_prototest_interface.RUBIKSurfaceDesc) +} + +void RUBIKSurfaceDesc::InitAsDefaultInstance() { + src_data_ = const_cast< ::nvdla_prototest_interface::DataCube*>(&::nvdla_prototest_interface::DataCube::default_instance()); + dst_data_ = const_cast< ::nvdla_prototest_interface::DataCube*>(&::nvdla_prototest_interface::DataCube::default_instance()); +} + +RUBIKSurfaceDesc::RUBIKSurfaceDesc(const RUBIKSurfaceDesc& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:nvdla_prototest_interface.RUBIKSurfaceDesc) +} + +void RUBIKSurfaceDesc::SharedCtor() { + _cached_size_ = 0; + src_data_ = NULL; + dst_data_ = NULL; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +RUBIKSurfaceDesc::~RUBIKSurfaceDesc() { + // @@protoc_insertion_point(destructor:nvdla_prototest_interface.RUBIKSurfaceDesc) + SharedDtor(); +} + +void RUBIKSurfaceDesc::SharedDtor() { + if (this != default_instance_) { + delete src_data_; + delete dst_data_; + } +} + +void RUBIKSurfaceDesc::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* RUBIKSurfaceDesc::descriptor() { + protobuf_AssignDescriptorsOnce(); + return RUBIKSurfaceDesc_descriptor_; +} + +const RUBIKSurfaceDesc& RUBIKSurfaceDesc::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_DlaPrototestInterface_2eproto(); + return *default_instance_; +} + +RUBIKSurfaceDesc* RUBIKSurfaceDesc::default_instance_ = NULL; + +RUBIKSurfaceDesc* RUBIKSurfaceDesc::New() const { + return new RUBIKSurfaceDesc; +} + +void RUBIKSurfaceDesc::Clear() { + if (_has_bits_[0 / 32] & 3) { + if (has_src_data()) { + if (src_data_ != NULL) src_data_->::nvdla_prototest_interface::DataCube::Clear(); + } + if (has_dst_data()) { + if (dst_data_ != NULL) dst_data_->::nvdla_prototest_interface::DataCube::Clear(); + } + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool RUBIKSurfaceDesc::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:nvdla_prototest_interface.RUBIKSurfaceDesc) + 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)) { + // required .nvdla_prototest_interface.DataCube src_data = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_src_data())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_dst_data; + break; + } + + // required .nvdla_prototest_interface.DataCube dst_data = 2; + case 2: { + if (tag == 18) { + parse_dst_data: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_dst_data())); + } 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:nvdla_prototest_interface.RUBIKSurfaceDesc) + return true; +failure: + // @@protoc_insertion_point(parse_failure:nvdla_prototest_interface.RUBIKSurfaceDesc) + return false; +#undef DO_ +} + +void RUBIKSurfaceDesc::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:nvdla_prototest_interface.RUBIKSurfaceDesc) + // required .nvdla_prototest_interface.DataCube src_data = 1; + if (has_src_data()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->src_data(), output); + } + + // required .nvdla_prototest_interface.DataCube dst_data = 2; + if (has_dst_data()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->dst_data(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:nvdla_prototest_interface.RUBIKSurfaceDesc) +} + +::google::protobuf::uint8* RUBIKSurfaceDesc::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:nvdla_prototest_interface.RUBIKSurfaceDesc) + // required .nvdla_prototest_interface.DataCube src_data = 1; + if (has_src_data()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 1, this->src_data(), target); + } + + // required .nvdla_prototest_interface.DataCube dst_data = 2; + if (has_dst_data()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 2, this->dst_data(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:nvdla_prototest_interface.RUBIKSurfaceDesc) + return target; +} + +int RUBIKSurfaceDesc::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // required .nvdla_prototest_interface.DataCube src_data = 1; + if (has_src_data()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->src_data()); + } + + // required .nvdla_prototest_interface.DataCube dst_data = 2; + if (has_dst_data()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->dst_data()); + } + + } + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void RUBIKSurfaceDesc::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const RUBIKSurfaceDesc* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void RUBIKSurfaceDesc::MergeFrom(const RUBIKSurfaceDesc& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_src_data()) { + mutable_src_data()->::nvdla_prototest_interface::DataCube::MergeFrom(from.src_data()); + } + if (from.has_dst_data()) { + mutable_dst_data()->::nvdla_prototest_interface::DataCube::MergeFrom(from.dst_data()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void RUBIKSurfaceDesc::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void RUBIKSurfaceDesc::CopyFrom(const RUBIKSurfaceDesc& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool RUBIKSurfaceDesc::IsInitialized() const { + if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false; + + if (has_src_data()) { + if (!this->src_data().IsInitialized()) return false; + } + if (has_dst_data()) { + if (!this->dst_data().IsInitialized()) return false; + } + return true; +} + +void RUBIKSurfaceDesc::Swap(RUBIKSurfaceDesc* other) { + if (other != this) { + std::swap(src_data_, other->src_data_); + std::swap(dst_data_, other->dst_data_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::google::protobuf::Metadata RUBIKSurfaceDesc::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = RUBIKSurfaceDesc_descriptor_; + metadata.reflection = RUBIKSurfaceDesc_reflection_; + return metadata; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int RUBIKOpDesc::kModeFieldNumber; +const int RUBIKOpDesc::kPrecisionFieldNumber; +const int RUBIKOpDesc::kStrideXFieldNumber; +const int RUBIKOpDesc::kStrideYFieldNumber; +#endif // !_MSC_VER + +RUBIKOpDesc::RUBIKOpDesc() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:nvdla_prototest_interface.RUBIKOpDesc) +} + +void RUBIKOpDesc::InitAsDefaultInstance() { +} + +RUBIKOpDesc::RUBIKOpDesc(const RUBIKOpDesc& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:nvdla_prototest_interface.RUBIKOpDesc) +} + +void RUBIKOpDesc::SharedCtor() { + _cached_size_ = 0; + mode_ = 0; + precision_ = 0; + stride_x_ = 0u; + stride_y_ = 0u; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +RUBIKOpDesc::~RUBIKOpDesc() { + // @@protoc_insertion_point(destructor:nvdla_prototest_interface.RUBIKOpDesc) + SharedDtor(); +} + +void RUBIKOpDesc::SharedDtor() { + if (this != default_instance_) { + } +} + +void RUBIKOpDesc::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* RUBIKOpDesc::descriptor() { + protobuf_AssignDescriptorsOnce(); + return RUBIKOpDesc_descriptor_; +} + +const RUBIKOpDesc& RUBIKOpDesc::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_DlaPrototestInterface_2eproto(); + return *default_instance_; +} + +RUBIKOpDesc* RUBIKOpDesc::default_instance_ = NULL; + +RUBIKOpDesc* RUBIKOpDesc::New() const { + return new RUBIKOpDesc; +} + +void RUBIKOpDesc::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + ZR_(mode_, stride_y_); + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool RUBIKOpDesc::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:nvdla_prototest_interface.RUBIKOpDesc) + 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)) { + // required .nvdla_prototest_interface.RUBIKMode mode = 1; + case 1: { + if (tag == 8) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::nvdla_prototest_interface::RUBIKMode_IsValid(value)) { + set_mode(static_cast< ::nvdla_prototest_interface::RUBIKMode >(value)); + } else { + mutable_unknown_fields()->AddVarint(1, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_precision; + break; + } + + // required .nvdla_prototest_interface.DataPrecision precision = 2; + case 2: { + if (tag == 16) { + parse_precision: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::nvdla_prototest_interface::DataPrecision_IsValid(value)) { + set_precision(static_cast< ::nvdla_prototest_interface::DataPrecision >(value)); + } else { + mutable_unknown_fields()->AddVarint(2, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(24)) goto parse_stride_x; + break; + } + + // required uint32 stride_x = 3; + case 3: { + if (tag == 24) { + parse_stride_x: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &stride_x_))); + set_has_stride_x(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(32)) goto parse_stride_y; + break; + } + + // required uint32 stride_y = 4; + case 4: { + if (tag == 32) { + parse_stride_y: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &stride_y_))); + set_has_stride_y(); + } 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:nvdla_prototest_interface.RUBIKOpDesc) + return true; +failure: + // @@protoc_insertion_point(parse_failure:nvdla_prototest_interface.RUBIKOpDesc) + return false; +#undef DO_ +} + +void RUBIKOpDesc::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:nvdla_prototest_interface.RUBIKOpDesc) + // required .nvdla_prototest_interface.RUBIKMode mode = 1; + if (has_mode()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 1, this->mode(), output); + } + + // required .nvdla_prototest_interface.DataPrecision precision = 2; + if (has_precision()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 2, this->precision(), output); + } + + // required uint32 stride_x = 3; + if (has_stride_x()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->stride_x(), output); + } + + // required uint32 stride_y = 4; + if (has_stride_y()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(4, this->stride_y(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:nvdla_prototest_interface.RUBIKOpDesc) +} + +::google::protobuf::uint8* RUBIKOpDesc::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:nvdla_prototest_interface.RUBIKOpDesc) + // required .nvdla_prototest_interface.RUBIKMode mode = 1; + if (has_mode()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 1, this->mode(), target); + } + + // required .nvdla_prototest_interface.DataPrecision precision = 2; + if (has_precision()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 2, this->precision(), target); + } + + // required uint32 stride_x = 3; + if (has_stride_x()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->stride_x(), target); + } + + // required uint32 stride_y = 4; + if (has_stride_y()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(4, this->stride_y(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:nvdla_prototest_interface.RUBIKOpDesc) + return target; +} + +int RUBIKOpDesc::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // required .nvdla_prototest_interface.RUBIKMode mode = 1; + if (has_mode()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->mode()); + } + + // required .nvdla_prototest_interface.DataPrecision precision = 2; + if (has_precision()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->precision()); + } + + // required uint32 stride_x = 3; + if (has_stride_x()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->stride_x()); + } + + // required uint32 stride_y = 4; + if (has_stride_y()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->stride_y()); + } + + } + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void RUBIKOpDesc::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const RUBIKOpDesc* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void RUBIKOpDesc::MergeFrom(const RUBIKOpDesc& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_mode()) { + set_mode(from.mode()); + } + if (from.has_precision()) { + set_precision(from.precision()); + } + if (from.has_stride_x()) { + set_stride_x(from.stride_x()); + } + if (from.has_stride_y()) { + set_stride_y(from.stride_y()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void RUBIKOpDesc::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void RUBIKOpDesc::CopyFrom(const RUBIKOpDesc& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool RUBIKOpDesc::IsInitialized() const { + if ((_has_bits_[0] & 0x0000000f) != 0x0000000f) return false; + + return true; +} + +void RUBIKOpDesc::Swap(RUBIKOpDesc* other) { + if (other != this) { + std::swap(mode_, other->mode_); + std::swap(precision_, other->precision_); + std::swap(stride_x_, other->stride_x_); + std::swap(stride_y_, other->stride_y_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::google::protobuf::Metadata RUBIKOpDesc::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = RUBIKOpDesc_descriptor_; + metadata.reflection = RUBIKOpDesc_reflection_; + return metadata; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int SurfaceContainer::kBdmaSurfaceFieldNumber; +const int SurfaceContainer::kConvSurfaceFieldNumber; +const int SurfaceContainer::kSdpSurfaceFieldNumber; +const int SurfaceContainer::kPdpSurfaceFieldNumber; +const int SurfaceContainer::kCdpSurfaceFieldNumber; +const int SurfaceContainer::kRubikSurfaceFieldNumber; +#endif // !_MSC_VER + +SurfaceContainer::SurfaceContainer() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:nvdla_prototest_interface.SurfaceContainer) +} + +void SurfaceContainer::InitAsDefaultInstance() { + SurfaceContainer_default_oneof_instance_->bdma_surface_ = const_cast< ::nvdla_prototest_interface::BDMASurfaceDesc*>(&::nvdla_prototest_interface::BDMASurfaceDesc::default_instance()); + SurfaceContainer_default_oneof_instance_->conv_surface_ = const_cast< ::nvdla_prototest_interface::CONVSurfaceDesc*>(&::nvdla_prototest_interface::CONVSurfaceDesc::default_instance()); + SurfaceContainer_default_oneof_instance_->sdp_surface_ = const_cast< ::nvdla_prototest_interface::SDPSurfaceDesc*>(&::nvdla_prototest_interface::SDPSurfaceDesc::default_instance()); + SurfaceContainer_default_oneof_instance_->pdp_surface_ = const_cast< ::nvdla_prototest_interface::PDPSurfaceDesc*>(&::nvdla_prototest_interface::PDPSurfaceDesc::default_instance()); + SurfaceContainer_default_oneof_instance_->cdp_surface_ = const_cast< ::nvdla_prototest_interface::CDPSurfaceDesc*>(&::nvdla_prototest_interface::CDPSurfaceDesc::default_instance()); + SurfaceContainer_default_oneof_instance_->rubik_surface_ = const_cast< ::nvdla_prototest_interface::RUBIKSurfaceDesc*>(&::nvdla_prototest_interface::RUBIKSurfaceDesc::default_instance()); +} + +SurfaceContainer::SurfaceContainer(const SurfaceContainer& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:nvdla_prototest_interface.SurfaceContainer) +} + +void SurfaceContainer::SharedCtor() { + _cached_size_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + clear_has_surface_container_oneof(); +} + +SurfaceContainer::~SurfaceContainer() { + // @@protoc_insertion_point(destructor:nvdla_prototest_interface.SurfaceContainer) + SharedDtor(); +} + +void SurfaceContainer::SharedDtor() { + if (has_surface_container_oneof()) { + clear_surface_container_oneof(); + } + if (this != default_instance_) { + } +} + +void SurfaceContainer::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* SurfaceContainer::descriptor() { + protobuf_AssignDescriptorsOnce(); + return SurfaceContainer_descriptor_; +} + +const SurfaceContainer& SurfaceContainer::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_DlaPrototestInterface_2eproto(); + return *default_instance_; +} + +SurfaceContainer* SurfaceContainer::default_instance_ = NULL; + +SurfaceContainer* SurfaceContainer::New() const { + return new SurfaceContainer; +} + +void SurfaceContainer::clear_surface_container_oneof() { + switch(surface_container_oneof_case()) { + case kBdmaSurface: { + delete surface_container_oneof_.bdma_surface_; + break; + } + case kConvSurface: { + delete surface_container_oneof_.conv_surface_; + break; + } + case kSdpSurface: { + delete surface_container_oneof_.sdp_surface_; + break; + } + case kPdpSurface: { + delete surface_container_oneof_.pdp_surface_; + break; + } + case kCdpSurface: { + delete surface_container_oneof_.cdp_surface_; + break; + } + case kRubikSurface: { + delete surface_container_oneof_.rubik_surface_; + break; + } + case SURFACE_CONTAINER_ONEOF_NOT_SET: { + break; + } + } + _oneof_case_[0] = SURFACE_CONTAINER_ONEOF_NOT_SET; +} + + +void SurfaceContainer::Clear() { + clear_surface_container_oneof(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool SurfaceContainer::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:nvdla_prototest_interface.SurfaceContainer) + 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 .nvdla_prototest_interface.BDMASurfaceDesc bdma_surface = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_bdma_surface())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_conv_surface; + break; + } + + // optional .nvdla_prototest_interface.CONVSurfaceDesc conv_surface = 2; + case 2: { + if (tag == 18) { + parse_conv_surface: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_conv_surface())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_sdp_surface; + break; + } + + // optional .nvdla_prototest_interface.SDPSurfaceDesc sdp_surface = 3; + case 3: { + if (tag == 26) { + parse_sdp_surface: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_sdp_surface())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(34)) goto parse_pdp_surface; + break; + } + + // optional .nvdla_prototest_interface.PDPSurfaceDesc pdp_surface = 4; + case 4: { + if (tag == 34) { + parse_pdp_surface: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_pdp_surface())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(42)) goto parse_cdp_surface; + break; + } + + // optional .nvdla_prototest_interface.CDPSurfaceDesc cdp_surface = 5; + case 5: { + if (tag == 42) { + parse_cdp_surface: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_cdp_surface())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(50)) goto parse_rubik_surface; + break; + } + + // optional .nvdla_prototest_interface.RUBIKSurfaceDesc rubik_surface = 6; + case 6: { + if (tag == 50) { + parse_rubik_surface: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_rubik_surface())); + } 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:nvdla_prototest_interface.SurfaceContainer) + return true; +failure: + // @@protoc_insertion_point(parse_failure:nvdla_prototest_interface.SurfaceContainer) + return false; +#undef DO_ +} + +void SurfaceContainer::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:nvdla_prototest_interface.SurfaceContainer) + // optional .nvdla_prototest_interface.BDMASurfaceDesc bdma_surface = 1; + if (has_bdma_surface()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->bdma_surface(), output); + } + + // optional .nvdla_prototest_interface.CONVSurfaceDesc conv_surface = 2; + if (has_conv_surface()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->conv_surface(), output); + } + + // optional .nvdla_prototest_interface.SDPSurfaceDesc sdp_surface = 3; + if (has_sdp_surface()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, this->sdp_surface(), output); + } + + // optional .nvdla_prototest_interface.PDPSurfaceDesc pdp_surface = 4; + if (has_pdp_surface()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, this->pdp_surface(), output); + } + + // optional .nvdla_prototest_interface.CDPSurfaceDesc cdp_surface = 5; + if (has_cdp_surface()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 5, this->cdp_surface(), output); + } + + // optional .nvdla_prototest_interface.RUBIKSurfaceDesc rubik_surface = 6; + if (has_rubik_surface()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 6, this->rubik_surface(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:nvdla_prototest_interface.SurfaceContainer) +} + +::google::protobuf::uint8* SurfaceContainer::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:nvdla_prototest_interface.SurfaceContainer) + // optional .nvdla_prototest_interface.BDMASurfaceDesc bdma_surface = 1; + if (has_bdma_surface()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 1, this->bdma_surface(), target); + } + + // optional .nvdla_prototest_interface.CONVSurfaceDesc conv_surface = 2; + if (has_conv_surface()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 2, this->conv_surface(), target); + } + + // optional .nvdla_prototest_interface.SDPSurfaceDesc sdp_surface = 3; + if (has_sdp_surface()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 3, this->sdp_surface(), target); + } + + // optional .nvdla_prototest_interface.PDPSurfaceDesc pdp_surface = 4; + if (has_pdp_surface()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 4, this->pdp_surface(), target); + } + + // optional .nvdla_prototest_interface.CDPSurfaceDesc cdp_surface = 5; + if (has_cdp_surface()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 5, this->cdp_surface(), target); + } + + // optional .nvdla_prototest_interface.RUBIKSurfaceDesc rubik_surface = 6; + if (has_rubik_surface()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 6, this->rubik_surface(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:nvdla_prototest_interface.SurfaceContainer) + return target; +} + +int SurfaceContainer::ByteSize() const { + int total_size = 0; + + switch (surface_container_oneof_case()) { + // optional .nvdla_prototest_interface.BDMASurfaceDesc bdma_surface = 1; + case kBdmaSurface: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->bdma_surface()); + break; + } + // optional .nvdla_prototest_interface.CONVSurfaceDesc conv_surface = 2; + case kConvSurface: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->conv_surface()); + break; + } + // optional .nvdla_prototest_interface.SDPSurfaceDesc sdp_surface = 3; + case kSdpSurface: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->sdp_surface()); + break; + } + // optional .nvdla_prototest_interface.PDPSurfaceDesc pdp_surface = 4; + case kPdpSurface: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->pdp_surface()); + break; + } + // optional .nvdla_prototest_interface.CDPSurfaceDesc cdp_surface = 5; + case kCdpSurface: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->cdp_surface()); + break; + } + // optional .nvdla_prototest_interface.RUBIKSurfaceDesc rubik_surface = 6; + case kRubikSurface: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->rubik_surface()); + break; + } + case SURFACE_CONTAINER_ONEOF_NOT_SET: { + break; + } + } + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void SurfaceContainer::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const SurfaceContainer* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void SurfaceContainer::MergeFrom(const SurfaceContainer& from) { + GOOGLE_CHECK_NE(&from, this); + switch (from.surface_container_oneof_case()) { + case kBdmaSurface: { + mutable_bdma_surface()->::nvdla_prototest_interface::BDMASurfaceDesc::MergeFrom(from.bdma_surface()); + break; + } + case kConvSurface: { + mutable_conv_surface()->::nvdla_prototest_interface::CONVSurfaceDesc::MergeFrom(from.conv_surface()); + break; + } + case kSdpSurface: { + mutable_sdp_surface()->::nvdla_prototest_interface::SDPSurfaceDesc::MergeFrom(from.sdp_surface()); + break; + } + case kPdpSurface: { + mutable_pdp_surface()->::nvdla_prototest_interface::PDPSurfaceDesc::MergeFrom(from.pdp_surface()); + break; + } + case kCdpSurface: { + mutable_cdp_surface()->::nvdla_prototest_interface::CDPSurfaceDesc::MergeFrom(from.cdp_surface()); + break; + } + case kRubikSurface: { + mutable_rubik_surface()->::nvdla_prototest_interface::RUBIKSurfaceDesc::MergeFrom(from.rubik_surface()); + break; + } + case SURFACE_CONTAINER_ONEOF_NOT_SET: { + break; + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void SurfaceContainer::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void SurfaceContainer::CopyFrom(const SurfaceContainer& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool SurfaceContainer::IsInitialized() const { + + if (has_bdma_surface()) { + if (!this->bdma_surface().IsInitialized()) return false; + } + if (has_conv_surface()) { + if (!this->conv_surface().IsInitialized()) return false; + } + if (has_sdp_surface()) { + if (!this->sdp_surface().IsInitialized()) return false; + } + if (has_pdp_surface()) { + if (!this->pdp_surface().IsInitialized()) return false; + } + if (has_cdp_surface()) { + if (!this->cdp_surface().IsInitialized()) return false; + } + if (has_rubik_surface()) { + if (!this->rubik_surface().IsInitialized()) return false; + } + return true; +} + +void SurfaceContainer::Swap(SurfaceContainer* other) { + if (other != this) { + std::swap(surface_container_oneof_, other->surface_container_oneof_); + std::swap(_oneof_case_[0], other->_oneof_case_[0]); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::google::protobuf::Metadata SurfaceContainer::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = SurfaceContainer_descriptor_; + metadata.reflection = SurfaceContainer_reflection_; + return metadata; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int OperationContainer::kBdmaOpFieldNumber; +const int OperationContainer::kConvOpFieldNumber; +const int OperationContainer::kSdpOpFieldNumber; +const int OperationContainer::kPdpOpFieldNumber; +const int OperationContainer::kCdpOpFieldNumber; +const int OperationContainer::kRubikOpFieldNumber; +#endif // !_MSC_VER + +OperationContainer::OperationContainer() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:nvdla_prototest_interface.OperationContainer) +} + +void OperationContainer::InitAsDefaultInstance() { + OperationContainer_default_oneof_instance_->bdma_op_ = const_cast< ::nvdla_prototest_interface::BDMAOpDesc*>(&::nvdla_prototest_interface::BDMAOpDesc::default_instance()); + OperationContainer_default_oneof_instance_->conv_op_ = const_cast< ::nvdla_prototest_interface::CONVOpDesc*>(&::nvdla_prototest_interface::CONVOpDesc::default_instance()); + OperationContainer_default_oneof_instance_->sdp_op_ = const_cast< ::nvdla_prototest_interface::SDPOpDesc*>(&::nvdla_prototest_interface::SDPOpDesc::default_instance()); + OperationContainer_default_oneof_instance_->pdp_op_ = const_cast< ::nvdla_prototest_interface::PDPOpDesc*>(&::nvdla_prototest_interface::PDPOpDesc::default_instance()); + OperationContainer_default_oneof_instance_->cdp_op_ = const_cast< ::nvdla_prototest_interface::CDPOpDesc*>(&::nvdla_prototest_interface::CDPOpDesc::default_instance()); + OperationContainer_default_oneof_instance_->rubik_op_ = const_cast< ::nvdla_prototest_interface::RUBIKOpDesc*>(&::nvdla_prototest_interface::RUBIKOpDesc::default_instance()); +} + +OperationContainer::OperationContainer(const OperationContainer& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:nvdla_prototest_interface.OperationContainer) +} + +void OperationContainer::SharedCtor() { + _cached_size_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + clear_has_op_container_oneof(); +} + +OperationContainer::~OperationContainer() { + // @@protoc_insertion_point(destructor:nvdla_prototest_interface.OperationContainer) + SharedDtor(); +} + +void OperationContainer::SharedDtor() { + if (has_op_container_oneof()) { + clear_op_container_oneof(); + } + if (this != default_instance_) { + } +} + +void OperationContainer::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* OperationContainer::descriptor() { + protobuf_AssignDescriptorsOnce(); + return OperationContainer_descriptor_; +} + +const OperationContainer& OperationContainer::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_DlaPrototestInterface_2eproto(); + return *default_instance_; +} + +OperationContainer* OperationContainer::default_instance_ = NULL; + +OperationContainer* OperationContainer::New() const { + return new OperationContainer; +} + +void OperationContainer::clear_op_container_oneof() { + switch(op_container_oneof_case()) { + case kBdmaOp: { + delete op_container_oneof_.bdma_op_; + break; + } + case kConvOp: { + delete op_container_oneof_.conv_op_; + break; + } + case kSdpOp: { + delete op_container_oneof_.sdp_op_; + break; + } + case kPdpOp: { + delete op_container_oneof_.pdp_op_; + break; + } + case kCdpOp: { + delete op_container_oneof_.cdp_op_; + break; + } + case kRubikOp: { + delete op_container_oneof_.rubik_op_; + break; + } + case OP_CONTAINER_ONEOF_NOT_SET: { + break; + } + } + _oneof_case_[0] = OP_CONTAINER_ONEOF_NOT_SET; +} + + +void OperationContainer::Clear() { + clear_op_container_oneof(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool OperationContainer::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:nvdla_prototest_interface.OperationContainer) + 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 .nvdla_prototest_interface.BDMAOpDesc bdma_op = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_bdma_op())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_conv_op; + break; + } + + // optional .nvdla_prototest_interface.CONVOpDesc conv_op = 2; + case 2: { + if (tag == 18) { + parse_conv_op: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_conv_op())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_sdp_op; + break; + } + + // optional .nvdla_prototest_interface.SDPOpDesc sdp_op = 3; + case 3: { + if (tag == 26) { + parse_sdp_op: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_sdp_op())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(34)) goto parse_pdp_op; + break; + } + + // optional .nvdla_prototest_interface.PDPOpDesc pdp_op = 4; + case 4: { + if (tag == 34) { + parse_pdp_op: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_pdp_op())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(42)) goto parse_cdp_op; + break; + } + + // optional .nvdla_prototest_interface.CDPOpDesc cdp_op = 5; + case 5: { + if (tag == 42) { + parse_cdp_op: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_cdp_op())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(50)) goto parse_rubik_op; + break; + } + + // optional .nvdla_prototest_interface.RUBIKOpDesc rubik_op = 6; + case 6: { + if (tag == 50) { + parse_rubik_op: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_rubik_op())); + } 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:nvdla_prototest_interface.OperationContainer) + return true; +failure: + // @@protoc_insertion_point(parse_failure:nvdla_prototest_interface.OperationContainer) + return false; +#undef DO_ +} + +void OperationContainer::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:nvdla_prototest_interface.OperationContainer) + // optional .nvdla_prototest_interface.BDMAOpDesc bdma_op = 1; + if (has_bdma_op()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->bdma_op(), output); + } + + // optional .nvdla_prototest_interface.CONVOpDesc conv_op = 2; + if (has_conv_op()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->conv_op(), output); + } + + // optional .nvdla_prototest_interface.SDPOpDesc sdp_op = 3; + if (has_sdp_op()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, this->sdp_op(), output); + } + + // optional .nvdla_prototest_interface.PDPOpDesc pdp_op = 4; + if (has_pdp_op()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, this->pdp_op(), output); + } + + // optional .nvdla_prototest_interface.CDPOpDesc cdp_op = 5; + if (has_cdp_op()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 5, this->cdp_op(), output); + } + + // optional .nvdla_prototest_interface.RUBIKOpDesc rubik_op = 6; + if (has_rubik_op()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 6, this->rubik_op(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:nvdla_prototest_interface.OperationContainer) +} + +::google::protobuf::uint8* OperationContainer::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:nvdla_prototest_interface.OperationContainer) + // optional .nvdla_prototest_interface.BDMAOpDesc bdma_op = 1; + if (has_bdma_op()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 1, this->bdma_op(), target); + } + + // optional .nvdla_prototest_interface.CONVOpDesc conv_op = 2; + if (has_conv_op()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 2, this->conv_op(), target); + } + + // optional .nvdla_prototest_interface.SDPOpDesc sdp_op = 3; + if (has_sdp_op()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 3, this->sdp_op(), target); + } + + // optional .nvdla_prototest_interface.PDPOpDesc pdp_op = 4; + if (has_pdp_op()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 4, this->pdp_op(), target); + } + + // optional .nvdla_prototest_interface.CDPOpDesc cdp_op = 5; + if (has_cdp_op()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 5, this->cdp_op(), target); + } + + // optional .nvdla_prototest_interface.RUBIKOpDesc rubik_op = 6; + if (has_rubik_op()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 6, this->rubik_op(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:nvdla_prototest_interface.OperationContainer) + return target; +} + +int OperationContainer::ByteSize() const { + int total_size = 0; + + switch (op_container_oneof_case()) { + // optional .nvdla_prototest_interface.BDMAOpDesc bdma_op = 1; + case kBdmaOp: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->bdma_op()); + break; + } + // optional .nvdla_prototest_interface.CONVOpDesc conv_op = 2; + case kConvOp: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->conv_op()); + break; + } + // optional .nvdla_prototest_interface.SDPOpDesc sdp_op = 3; + case kSdpOp: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->sdp_op()); + break; + } + // optional .nvdla_prototest_interface.PDPOpDesc pdp_op = 4; + case kPdpOp: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->pdp_op()); + break; + } + // optional .nvdla_prototest_interface.CDPOpDesc cdp_op = 5; + case kCdpOp: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->cdp_op()); + break; + } + // optional .nvdla_prototest_interface.RUBIKOpDesc rubik_op = 6; + case kRubikOp: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->rubik_op()); + break; + } + case OP_CONTAINER_ONEOF_NOT_SET: { + break; + } + } + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void OperationContainer::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const OperationContainer* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void OperationContainer::MergeFrom(const OperationContainer& from) { + GOOGLE_CHECK_NE(&from, this); + switch (from.op_container_oneof_case()) { + case kBdmaOp: { + mutable_bdma_op()->::nvdla_prototest_interface::BDMAOpDesc::MergeFrom(from.bdma_op()); + break; + } + case kConvOp: { + mutable_conv_op()->::nvdla_prototest_interface::CONVOpDesc::MergeFrom(from.conv_op()); + break; + } + case kSdpOp: { + mutable_sdp_op()->::nvdla_prototest_interface::SDPOpDesc::MergeFrom(from.sdp_op()); + break; + } + case kPdpOp: { + mutable_pdp_op()->::nvdla_prototest_interface::PDPOpDesc::MergeFrom(from.pdp_op()); + break; + } + case kCdpOp: { + mutable_cdp_op()->::nvdla_prototest_interface::CDPOpDesc::MergeFrom(from.cdp_op()); + break; + } + case kRubikOp: { + mutable_rubik_op()->::nvdla_prototest_interface::RUBIKOpDesc::MergeFrom(from.rubik_op()); + break; + } + case OP_CONTAINER_ONEOF_NOT_SET: { + break; + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void OperationContainer::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void OperationContainer::CopyFrom(const OperationContainer& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool OperationContainer::IsInitialized() const { + + if (has_bdma_op()) { + if (!this->bdma_op().IsInitialized()) return false; + } + if (has_conv_op()) { + if (!this->conv_op().IsInitialized()) return false; + } + if (has_sdp_op()) { + if (!this->sdp_op().IsInitialized()) return false; + } + if (has_pdp_op()) { + if (!this->pdp_op().IsInitialized()) return false; + } + if (has_cdp_op()) { + if (!this->cdp_op().IsInitialized()) return false; + } + if (has_rubik_op()) { + if (!this->rubik_op().IsInitialized()) return false; + } + return true; +} + +void OperationContainer::Swap(OperationContainer* other) { + if (other != this) { + std::swap(op_container_oneof_, other->op_container_oneof_); + std::swap(_oneof_case_[0], other->_oneof_case_[0]); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::google::protobuf::Metadata OperationContainer::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = OperationContainer_descriptor_; + metadata.reflection = OperationContainer_reflection_; + return metadata; +} + + +// =================================================================== + +const ::google::protobuf::EnumDescriptor* Consumer_EventType_descriptor() { + protobuf_AssignDescriptorsOnce(); + return Consumer_EventType_descriptor_; +} +bool Consumer_EventType_IsValid(int value) { + switch(value) { + case 1: + case 2: + case 3: + case 4: + case 5: + return true; + default: + return false; + } +} + +#ifndef _MSC_VER +const Consumer_EventType Consumer::OP_COMPLETED; +const Consumer_EventType Consumer::OP_PROGRAMMED; +const Consumer_EventType Consumer::OP_ENABLED; +const Consumer_EventType Consumer::CDMA_WT_DONE; +const Consumer_EventType Consumer::CDMA_DT_DONE; +const Consumer_EventType Consumer::EventType_MIN; +const Consumer_EventType Consumer::EventType_MAX; +const int Consumer::EventType_ARRAYSIZE; +#endif // _MSC_VER +#ifndef _MSC_VER +const int Consumer::kIndexFieldNumber; +const int Consumer::kTypeFieldNumber; +const int Consumer::kEventFieldNumber; +#endif // !_MSC_VER + +Consumer::Consumer() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:nvdla_prototest_interface.Consumer) +} + +void Consumer::InitAsDefaultInstance() { +} + +Consumer::Consumer(const Consumer& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:nvdla_prototest_interface.Consumer) +} + +void Consumer::SharedCtor() { + _cached_size_ = 0; + index_ = 0; + type_ = 0; + event_ = 1; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +Consumer::~Consumer() { + // @@protoc_insertion_point(destructor:nvdla_prototest_interface.Consumer) + SharedDtor(); +} + +void Consumer::SharedDtor() { + if (this != default_instance_) { + } +} + +void Consumer::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* Consumer::descriptor() { + protobuf_AssignDescriptorsOnce(); + return Consumer_descriptor_; +} + +const Consumer& Consumer::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_DlaPrototestInterface_2eproto(); + return *default_instance_; +} + +Consumer* Consumer::default_instance_ = NULL; + +Consumer* Consumer::New() const { + return new Consumer; +} + +void Consumer::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 7) { + ZR_(index_, type_); + event_ = 1; + } + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool Consumer::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:nvdla_prototest_interface.Consumer) + 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)) { + // required int32 index = 1; + case 1: { + if (tag == 8) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &index_))); + set_has_index(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_type; + break; + } + + // required .nvdla_prototest_interface.LayerType type = 2; + case 2: { + if (tag == 16) { + parse_type: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::nvdla_prototest_interface::LayerType_IsValid(value)) { + set_type(static_cast< ::nvdla_prototest_interface::LayerType >(value)); + } else { + mutable_unknown_fields()->AddVarint(2, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(24)) goto parse_event; + break; + } + + // required .nvdla_prototest_interface.Consumer.EventType event = 3; + case 3: { + if (tag == 24) { + parse_event: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::nvdla_prototest_interface::Consumer_EventType_IsValid(value)) { + set_event(static_cast< ::nvdla_prototest_interface::Consumer_EventType >(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:nvdla_prototest_interface.Consumer) + return true; +failure: + // @@protoc_insertion_point(parse_failure:nvdla_prototest_interface.Consumer) + return false; +#undef DO_ +} + +void Consumer::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:nvdla_prototest_interface.Consumer) + // required int32 index = 1; + if (has_index()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->index(), output); + } + + // required .nvdla_prototest_interface.LayerType type = 2; + if (has_type()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 2, this->type(), output); + } + + // required .nvdla_prototest_interface.Consumer.EventType event = 3; + if (has_event()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 3, this->event(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:nvdla_prototest_interface.Consumer) +} + +::google::protobuf::uint8* Consumer::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:nvdla_prototest_interface.Consumer) + // required int32 index = 1; + if (has_index()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->index(), target); + } + + // required .nvdla_prototest_interface.LayerType type = 2; + if (has_type()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 2, this->type(), target); + } + + // required .nvdla_prototest_interface.Consumer.EventType event = 3; + if (has_event()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 3, this->event(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:nvdla_prototest_interface.Consumer) + return target; +} + +int Consumer::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // required int32 index = 1; + if (has_index()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->index()); + } + + // required .nvdla_prototest_interface.LayerType type = 2; + if (has_type()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->type()); + } + + // required .nvdla_prototest_interface.Consumer.EventType event = 3; + if (has_event()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->event()); + } + + } + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void Consumer::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const Consumer* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void Consumer::MergeFrom(const Consumer& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_index()) { + set_index(from.index()); + } + if (from.has_type()) { + set_type(from.type()); + } + if (from.has_event()) { + set_event(from.event()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void Consumer::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Consumer::CopyFrom(const Consumer& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Consumer::IsInitialized() const { + if ((_has_bits_[0] & 0x00000007) != 0x00000007) return false; + + return true; +} + +void Consumer::Swap(Consumer* other) { + if (other != this) { + std::swap(index_, other->index_); + std::swap(type_, other->type_); + std::swap(event_, other->event_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::google::protobuf::Metadata Consumer::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = Consumer_descriptor_; + metadata.reflection = Consumer_reflection_; + return metadata; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int Layer::kIndexFieldNumber; +const int Layer::kRoiIndexFieldNumber; +const int Layer::kTypeFieldNumber; +const int Layer::kDependencyCountFieldNumber; +const int Layer::kReservedFieldNumber; +const int Layer::kBottomFieldNumber; +const int Layer::kFusedFieldNumber; +const int Layer::kOpConfigFieldNumber; +const int Layer::kSurfaceFieldNumber; +#endif // !_MSC_VER + +Layer::Layer() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:nvdla_prototest_interface.Layer) +} + +void Layer::InitAsDefaultInstance() { + fused_ = const_cast< ::nvdla_prototest_interface::Consumer*>(&::nvdla_prototest_interface::Consumer::default_instance()); + op_config_ = const_cast< ::nvdla_prototest_interface::OperationContainer*>(&::nvdla_prototest_interface::OperationContainer::default_instance()); + surface_ = const_cast< ::nvdla_prototest_interface::SurfaceContainer*>(&::nvdla_prototest_interface::SurfaceContainer::default_instance()); +} + +Layer::Layer(const Layer& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:nvdla_prototest_interface.Layer) +} + +void Layer::SharedCtor() { + _cached_size_ = 0; + index_ = 0; + roi_index_ = 0; + type_ = 0; + dependency_count_ = 0u; + fused_ = NULL; + op_config_ = NULL; + surface_ = NULL; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +Layer::~Layer() { + // @@protoc_insertion_point(destructor:nvdla_prototest_interface.Layer) + SharedDtor(); +} + +void Layer::SharedDtor() { + if (this != default_instance_) { + delete fused_; + delete op_config_; + delete surface_; + } +} + +void Layer::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* Layer::descriptor() { + protobuf_AssignDescriptorsOnce(); + return Layer_descriptor_; +} + +const Layer& Layer::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_DlaPrototestInterface_2eproto(); + return *default_instance_; +} + +Layer* Layer::default_instance_ = NULL; + +Layer* Layer::New() const { + return new Layer; +} + +void Layer::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 207) { + ZR_(index_, dependency_count_); + if (has_fused()) { + if (fused_ != NULL) fused_->::nvdla_prototest_interface::Consumer::Clear(); + } + if (has_op_config()) { + if (op_config_ != NULL) op_config_->::nvdla_prototest_interface::OperationContainer::Clear(); + } + } + if (has_surface()) { + if (surface_ != NULL) surface_->::nvdla_prototest_interface::SurfaceContainer::Clear(); + } + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + reserved_.Clear(); + bottom_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool Layer::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:nvdla_prototest_interface.Layer) + 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)) { + // required int32 index = 1; + case 1: { + if (tag == 8) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &index_))); + set_has_index(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_roi_index; + break; + } + + // required int32 roi_index = 2; + case 2: { + if (tag == 16) { + parse_roi_index: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &roi_index_))); + set_has_roi_index(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(24)) goto parse_type; + break; + } + + // required .nvdla_prototest_interface.LayerType 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))); + if (::nvdla_prototest_interface::LayerType_IsValid(value)) { + set_type(static_cast< ::nvdla_prototest_interface::LayerType >(value)); + } else { + mutable_unknown_fields()->AddVarint(3, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(32)) goto parse_dependency_count; + break; + } + + // required uint32 dependency_count = 4; + case 4: { + if (tag == 32) { + parse_dependency_count: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &dependency_count_))); + set_has_dependency_count(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(42)) goto parse_reserved; + break; + } + + // repeated uint32 reserved = 5 [packed = true]; + case 5: { + if (tag == 42) { + parse_reserved: + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, this->mutable_reserved()))); + } else if (tag == 40) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + 1, 42, input, this->mutable_reserved()))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(50)) goto parse_bottom; + break; + } + + // repeated .nvdla_prototest_interface.Consumer bottom = 6; + case 6: { + if (tag == 50) { + parse_bottom: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_bottom())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(50)) goto parse_bottom; + if (input->ExpectTag(58)) goto parse_fused; + break; + } + + // optional .nvdla_prototest_interface.Consumer fused = 7; + case 7: { + if (tag == 58) { + parse_fused: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_fused())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(66)) goto parse_op_config; + break; + } + + // required .nvdla_prototest_interface.OperationContainer op_config = 8; + case 8: { + if (tag == 66) { + parse_op_config: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_op_config())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(74)) goto parse_surface; + break; + } + + // required .nvdla_prototest_interface.SurfaceContainer surface = 9; + case 9: { + if (tag == 74) { + parse_surface: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_surface())); + } 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:nvdla_prototest_interface.Layer) + return true; +failure: + // @@protoc_insertion_point(parse_failure:nvdla_prototest_interface.Layer) + return false; +#undef DO_ +} + +void Layer::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:nvdla_prototest_interface.Layer) + // required int32 index = 1; + if (has_index()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->index(), output); + } + + // required int32 roi_index = 2; + if (has_roi_index()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->roi_index(), output); + } + + // required .nvdla_prototest_interface.LayerType type = 3; + if (has_type()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 3, this->type(), output); + } + + // required uint32 dependency_count = 4; + if (has_dependency_count()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(4, this->dependency_count(), output); + } + + // repeated uint32 reserved = 5 [packed = true]; + if (this->reserved_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(5, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(_reserved_cached_byte_size_); + } + for (int i = 0; i < this->reserved_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32NoTag( + this->reserved(i), output); + } + + // repeated .nvdla_prototest_interface.Consumer bottom = 6; + for (int i = 0; i < this->bottom_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 6, this->bottom(i), output); + } + + // optional .nvdla_prototest_interface.Consumer fused = 7; + if (has_fused()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 7, this->fused(), output); + } + + // required .nvdla_prototest_interface.OperationContainer op_config = 8; + if (has_op_config()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 8, this->op_config(), output); + } + + // required .nvdla_prototest_interface.SurfaceContainer surface = 9; + if (has_surface()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 9, this->surface(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:nvdla_prototest_interface.Layer) +} + +::google::protobuf::uint8* Layer::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:nvdla_prototest_interface.Layer) + // required int32 index = 1; + if (has_index()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->index(), target); + } + + // required int32 roi_index = 2; + if (has_roi_index()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->roi_index(), target); + } + + // required .nvdla_prototest_interface.LayerType type = 3; + if (has_type()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 3, this->type(), target); + } + + // required uint32 dependency_count = 4; + if (has_dependency_count()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(4, this->dependency_count(), target); + } + + // repeated uint32 reserved = 5 [packed = true]; + if (this->reserved_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 5, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + _reserved_cached_byte_size_, target); + } + for (int i = 0; i < this->reserved_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteUInt32NoTagToArray(this->reserved(i), target); + } + + // repeated .nvdla_prototest_interface.Consumer bottom = 6; + for (int i = 0; i < this->bottom_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 6, this->bottom(i), target); + } + + // optional .nvdla_prototest_interface.Consumer fused = 7; + if (has_fused()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 7, this->fused(), target); + } + + // required .nvdla_prototest_interface.OperationContainer op_config = 8; + if (has_op_config()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 8, this->op_config(), target); + } + + // required .nvdla_prototest_interface.SurfaceContainer surface = 9; + if (has_surface()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 9, this->surface(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:nvdla_prototest_interface.Layer) + return target; +} + +int Layer::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // required int32 index = 1; + if (has_index()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->index()); + } + + // required int32 roi_index = 2; + if (has_roi_index()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->roi_index()); + } + + // required .nvdla_prototest_interface.LayerType type = 3; + if (has_type()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->type()); + } + + // required uint32 dependency_count = 4; + if (has_dependency_count()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->dependency_count()); + } + + // optional .nvdla_prototest_interface.Consumer fused = 7; + if (has_fused()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->fused()); + } + + // required .nvdla_prototest_interface.OperationContainer op_config = 8; + if (has_op_config()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->op_config()); + } + + } + if (_has_bits_[8 / 32] & (0xffu << (8 % 32))) { + // required .nvdla_prototest_interface.SurfaceContainer surface = 9; + if (has_surface()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->surface()); + } + + } + // repeated uint32 reserved = 5 [packed = true]; + { + int data_size = 0; + for (int i = 0; i < this->reserved_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->reserved(i)); + } + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _reserved_cached_byte_size_ = data_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated .nvdla_prototest_interface.Consumer bottom = 6; + total_size += 1 * this->bottom_size(); + for (int i = 0; i < this->bottom_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->bottom(i)); + } + + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void Layer::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const Layer* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void Layer::MergeFrom(const Layer& from) { + GOOGLE_CHECK_NE(&from, this); + reserved_.MergeFrom(from.reserved_); + bottom_.MergeFrom(from.bottom_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_index()) { + set_index(from.index()); + } + if (from.has_roi_index()) { + set_roi_index(from.roi_index()); + } + if (from.has_type()) { + set_type(from.type()); + } + if (from.has_dependency_count()) { + set_dependency_count(from.dependency_count()); + } + if (from.has_fused()) { + mutable_fused()->::nvdla_prototest_interface::Consumer::MergeFrom(from.fused()); + } + if (from.has_op_config()) { + mutable_op_config()->::nvdla_prototest_interface::OperationContainer::MergeFrom(from.op_config()); + } + } + if (from._has_bits_[8 / 32] & (0xffu << (8 % 32))) { + if (from.has_surface()) { + mutable_surface()->::nvdla_prototest_interface::SurfaceContainer::MergeFrom(from.surface()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void Layer::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Layer::CopyFrom(const Layer& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Layer::IsInitialized() const { + if ((_has_bits_[0] & 0x0000018f) != 0x0000018f) return false; + + if (!::google::protobuf::internal::AllAreInitialized(this->bottom())) return false; + if (has_fused()) { + if (!this->fused().IsInitialized()) return false; + } + if (has_op_config()) { + if (!this->op_config().IsInitialized()) return false; + } + if (has_surface()) { + if (!this->surface().IsInitialized()) return false; + } + return true; +} + +void Layer::Swap(Layer* other) { + if (other != this) { + std::swap(index_, other->index_); + std::swap(roi_index_, other->roi_index_); + std::swap(type_, other->type_); + std::swap(dependency_count_, other->dependency_count_); + reserved_.Swap(&other->reserved_); + bottom_.Swap(&other->bottom_); + std::swap(fused_, other->fused_); + std::swap(op_config_, other->op_config_); + std::swap(surface_, other->surface_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::google::protobuf::Metadata Layer::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = Layer_descriptor_; + metadata.reflection = Layer_reflection_; + return metadata; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int NetworkLayer::kLayerFieldNumber; +#endif // !_MSC_VER + +NetworkLayer::NetworkLayer() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:nvdla_prototest_interface.NetworkLayer) +} + +void NetworkLayer::InitAsDefaultInstance() { +} + +NetworkLayer::NetworkLayer(const NetworkLayer& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:nvdla_prototest_interface.NetworkLayer) +} + +void NetworkLayer::SharedCtor() { + _cached_size_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +NetworkLayer::~NetworkLayer() { + // @@protoc_insertion_point(destructor:nvdla_prototest_interface.NetworkLayer) + SharedDtor(); +} + +void NetworkLayer::SharedDtor() { + if (this != default_instance_) { + } +} + +void NetworkLayer::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* NetworkLayer::descriptor() { + protobuf_AssignDescriptorsOnce(); + return NetworkLayer_descriptor_; +} + +const NetworkLayer& NetworkLayer::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_DlaPrototestInterface_2eproto(); + return *default_instance_; +} + +NetworkLayer* NetworkLayer::default_instance_ = NULL; + +NetworkLayer* NetworkLayer::New() const { + return new NetworkLayer; +} + +void NetworkLayer::Clear() { + layer_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool NetworkLayer::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:nvdla_prototest_interface.NetworkLayer) + 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 .nvdla_prototest_interface.Layer layer = 1; + case 1: { + if (tag == 10) { + parse_layer: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_layer())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(10)) goto parse_layer; + 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:nvdla_prototest_interface.NetworkLayer) + return true; +failure: + // @@protoc_insertion_point(parse_failure:nvdla_prototest_interface.NetworkLayer) + return false; +#undef DO_ +} + +void NetworkLayer::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:nvdla_prototest_interface.NetworkLayer) + // repeated .nvdla_prototest_interface.Layer layer = 1; + for (int i = 0; i < this->layer_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->layer(i), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:nvdla_prototest_interface.NetworkLayer) +} + +::google::protobuf::uint8* NetworkLayer::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:nvdla_prototest_interface.NetworkLayer) + // repeated .nvdla_prototest_interface.Layer layer = 1; + for (int i = 0; i < this->layer_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 1, this->layer(i), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:nvdla_prototest_interface.NetworkLayer) + return target; +} + +int NetworkLayer::ByteSize() const { + int total_size = 0; + + // repeated .nvdla_prototest_interface.Layer layer = 1; + total_size += 1 * this->layer_size(); + for (int i = 0; i < this->layer_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->layer(i)); + } + + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void NetworkLayer::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const NetworkLayer* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void NetworkLayer::MergeFrom(const NetworkLayer& from) { + GOOGLE_CHECK_NE(&from, this); + layer_.MergeFrom(from.layer_); + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void NetworkLayer::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void NetworkLayer::CopyFrom(const NetworkLayer& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool NetworkLayer::IsInitialized() const { + + if (!::google::protobuf::internal::AllAreInitialized(this->layer())) return false; + return true; +} + +void NetworkLayer::Swap(NetworkLayer* other) { + if (other != this) { + layer_.Swap(&other->layer_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::google::protobuf::Metadata NetworkLayer::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = NetworkLayer_descriptor_; + metadata.reflection = NetworkLayer_reflection_; + return metadata; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int NetworkDesc::kOperationDescIndexFieldNumber; +const int NetworkDesc::kSurfaceDescIndexFieldNumber; +const int NetworkDesc::kDependencyGraphIndexFieldNumber; +const int NetworkDesc::kLutDataIndexFieldNumber; +const int NetworkDesc::kRoiArrayIndexFieldNumber; +const int NetworkDesc::kSurfaceIndexFieldNumber; +const int NetworkDesc::kStatListIndexFieldNumber; +const int NetworkDesc::kReserved1FieldNumber; +const int NetworkDesc::kOpHeadFieldNumber; +const int NetworkDesc::kNumRoisFieldNumber; +const int NetworkDesc::kNumOperationsFieldNumber; +const int NetworkDesc::kNumLutsFieldNumber; +const int NetworkDesc::kNumAddressesFieldNumber; +const int NetworkDesc::kInputLayerFieldNumber; +const int NetworkDesc::kDynamicRoiFieldNumber; +const int NetworkDesc::kReserved0FieldNumber; +#endif // !_MSC_VER + +NetworkDesc::NetworkDesc() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:nvdla_prototest_interface.NetworkDesc) +} + +void NetworkDesc::InitAsDefaultInstance() { +} + +NetworkDesc::NetworkDesc(const NetworkDesc& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:nvdla_prototest_interface.NetworkDesc) +} + +void NetworkDesc::SharedCtor() { + _cached_size_ = 0; + operation_desc_index_ = 0; + surface_desc_index_ = 0; + dependency_graph_index_ = 0; + lut_data_index_ = 0; + roi_array_index_ = 0; + surface_index_ = 0; + stat_list_index_ = -1; + reserved1_ = -1; + num_rois_ = 0u; + num_operations_ = 0u; + num_luts_ = 0u; + num_addresses_ = 0u; + input_layer_ = 0; + dynamic_roi_ = 0u; + reserved0_ = 0u; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +NetworkDesc::~NetworkDesc() { + // @@protoc_insertion_point(destructor:nvdla_prototest_interface.NetworkDesc) + SharedDtor(); +} + +void NetworkDesc::SharedDtor() { + if (this != default_instance_) { + } +} + +void NetworkDesc::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* NetworkDesc::descriptor() { + protobuf_AssignDescriptorsOnce(); + return NetworkDesc_descriptor_; +} + +const NetworkDesc& NetworkDesc::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_DlaPrototestInterface_2eproto(); + return *default_instance_; +} + +NetworkDesc* NetworkDesc::default_instance_ = NULL; + +NetworkDesc* NetworkDesc::New() const { + return new NetworkDesc; +} + +void NetworkDesc::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 255) { + ZR_(operation_desc_index_, surface_index_); + stat_list_index_ = -1; + reserved1_ = -1; + } + if (_has_bits_[8 / 32] & 65024) { + ZR_(num_rois_, reserved0_); + } + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + op_head_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool NetworkDesc::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:nvdla_prototest_interface.NetworkDesc) + 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)) { + // required int32 operation_desc_index = 1; + case 1: { + if (tag == 8) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &operation_desc_index_))); + set_has_operation_desc_index(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_surface_desc_index; + break; + } + + // required int32 surface_desc_index = 2; + case 2: { + if (tag == 16) { + parse_surface_desc_index: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &surface_desc_index_))); + set_has_surface_desc_index(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(24)) goto parse_dependency_graph_index; + break; + } + + // required int32 dependency_graph_index = 3; + case 3: { + if (tag == 24) { + parse_dependency_graph_index: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &dependency_graph_index_))); + set_has_dependency_graph_index(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(32)) goto parse_lut_data_index; + break; + } + + // required int32 lut_data_index = 4; + case 4: { + if (tag == 32) { + parse_lut_data_index: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &lut_data_index_))); + set_has_lut_data_index(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(40)) goto parse_roi_array_index; + break; + } + + // required int32 roi_array_index = 5; + case 5: { + if (tag == 40) { + parse_roi_array_index: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &roi_array_index_))); + set_has_roi_array_index(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(48)) goto parse_surface_index; + break; + } + + // required int32 surface_index = 6; + case 6: { + if (tag == 48) { + parse_surface_index: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &surface_index_))); + set_has_surface_index(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(56)) goto parse_stat_list_index; + break; + } + + // optional int32 stat_list_index = 7 [default = -1]; + case 7: { + if (tag == 56) { + parse_stat_list_index: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &stat_list_index_))); + set_has_stat_list_index(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(64)) goto parse_reserved1; + break; + } + + // optional int32 reserved1 = 8 [default = -1]; + case 8: { + if (tag == 64) { + parse_reserved1: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &reserved1_))); + set_has_reserved1(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(74)) goto parse_op_head; + break; + } + + // repeated int32 op_head = 9 [packed = true]; + case 9: { + if (tag == 74) { + parse_op_head: + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, this->mutable_op_head()))); + } else if (tag == 72) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + 1, 74, input, this->mutable_op_head()))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(80)) goto parse_num_rois; + break; + } + + // required uint32 num_rois = 10; + case 10: { + if (tag == 80) { + parse_num_rois: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &num_rois_))); + set_has_num_rois(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(88)) goto parse_num_operations; + break; + } + + // required uint32 num_operations = 11; + case 11: { + if (tag == 88) { + parse_num_operations: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &num_operations_))); + set_has_num_operations(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(96)) goto parse_num_luts; + break; + } + + // required uint32 num_luts = 12; + case 12: { + if (tag == 96) { + parse_num_luts: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &num_luts_))); + set_has_num_luts(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(104)) goto parse_num_addresses; + break; + } + + // required uint32 num_addresses = 13; + case 13: { + if (tag == 104) { + parse_num_addresses: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &num_addresses_))); + set_has_num_addresses(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(112)) goto parse_input_layer; + break; + } + + // required int32 input_layer = 14; + case 14: { + if (tag == 112) { + parse_input_layer: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &input_layer_))); + set_has_input_layer(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(120)) goto parse_dynamic_roi; + break; + } + + // required uint32 dynamic_roi = 15; + case 15: { + if (tag == 120) { + parse_dynamic_roi: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &dynamic_roi_))); + set_has_dynamic_roi(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(128)) goto parse_reserved0; + break; + } + + // optional uint32 reserved0 = 16 [default = 0]; + case 16: { + if (tag == 128) { + parse_reserved0: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &reserved0_))); + set_has_reserved0(); + } 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:nvdla_prototest_interface.NetworkDesc) + return true; +failure: + // @@protoc_insertion_point(parse_failure:nvdla_prototest_interface.NetworkDesc) + return false; +#undef DO_ +} + +void NetworkDesc::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:nvdla_prototest_interface.NetworkDesc) + // required int32 operation_desc_index = 1; + if (has_operation_desc_index()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->operation_desc_index(), output); + } + + // required int32 surface_desc_index = 2; + if (has_surface_desc_index()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->surface_desc_index(), output); + } + + // required int32 dependency_graph_index = 3; + if (has_dependency_graph_index()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->dependency_graph_index(), output); + } + + // required int32 lut_data_index = 4; + if (has_lut_data_index()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(4, this->lut_data_index(), output); + } + + // required int32 roi_array_index = 5; + if (has_roi_array_index()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(5, this->roi_array_index(), output); + } + + // required int32 surface_index = 6; + if (has_surface_index()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(6, this->surface_index(), output); + } + + // optional int32 stat_list_index = 7 [default = -1]; + if (has_stat_list_index()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(7, this->stat_list_index(), output); + } + + // optional int32 reserved1 = 8 [default = -1]; + if (has_reserved1()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(8, this->reserved1(), output); + } + + // repeated int32 op_head = 9 [packed = true]; + if (this->op_head_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(9, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(_op_head_cached_byte_size_); + } + for (int i = 0; i < this->op_head_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt32NoTag( + this->op_head(i), output); + } + + // required uint32 num_rois = 10; + if (has_num_rois()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(10, this->num_rois(), output); + } + + // required uint32 num_operations = 11; + if (has_num_operations()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(11, this->num_operations(), output); + } + + // required uint32 num_luts = 12; + if (has_num_luts()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(12, this->num_luts(), output); + } + + // required uint32 num_addresses = 13; + if (has_num_addresses()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(13, this->num_addresses(), output); + } + + // required int32 input_layer = 14; + if (has_input_layer()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(14, this->input_layer(), output); + } + + // required uint32 dynamic_roi = 15; + if (has_dynamic_roi()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(15, this->dynamic_roi(), output); + } + + // optional uint32 reserved0 = 16 [default = 0]; + if (has_reserved0()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(16, this->reserved0(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:nvdla_prototest_interface.NetworkDesc) +} + +::google::protobuf::uint8* NetworkDesc::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:nvdla_prototest_interface.NetworkDesc) + // required int32 operation_desc_index = 1; + if (has_operation_desc_index()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->operation_desc_index(), target); + } + + // required int32 surface_desc_index = 2; + if (has_surface_desc_index()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->surface_desc_index(), target); + } + + // required int32 dependency_graph_index = 3; + if (has_dependency_graph_index()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->dependency_graph_index(), target); + } + + // required int32 lut_data_index = 4; + if (has_lut_data_index()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(4, this->lut_data_index(), target); + } + + // required int32 roi_array_index = 5; + if (has_roi_array_index()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(5, this->roi_array_index(), target); + } + + // required int32 surface_index = 6; + if (has_surface_index()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(6, this->surface_index(), target); + } + + // optional int32 stat_list_index = 7 [default = -1]; + if (has_stat_list_index()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(7, this->stat_list_index(), target); + } + + // optional int32 reserved1 = 8 [default = -1]; + if (has_reserved1()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(8, this->reserved1(), target); + } + + // repeated int32 op_head = 9 [packed = true]; + if (this->op_head_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 9, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + _op_head_cached_byte_size_, target); + } + for (int i = 0; i < this->op_head_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt32NoTagToArray(this->op_head(i), target); + } + + // required uint32 num_rois = 10; + if (has_num_rois()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(10, this->num_rois(), target); + } + + // required uint32 num_operations = 11; + if (has_num_operations()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(11, this->num_operations(), target); + } + + // required uint32 num_luts = 12; + if (has_num_luts()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(12, this->num_luts(), target); + } + + // required uint32 num_addresses = 13; + if (has_num_addresses()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(13, this->num_addresses(), target); + } + + // required int32 input_layer = 14; + if (has_input_layer()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(14, this->input_layer(), target); + } + + // required uint32 dynamic_roi = 15; + if (has_dynamic_roi()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(15, this->dynamic_roi(), target); + } + + // optional uint32 reserved0 = 16 [default = 0]; + if (has_reserved0()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(16, this->reserved0(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:nvdla_prototest_interface.NetworkDesc) + return target; +} + +int NetworkDesc::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // required int32 operation_desc_index = 1; + if (has_operation_desc_index()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->operation_desc_index()); + } + + // required int32 surface_desc_index = 2; + if (has_surface_desc_index()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->surface_desc_index()); + } + + // required int32 dependency_graph_index = 3; + if (has_dependency_graph_index()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->dependency_graph_index()); + } + + // required int32 lut_data_index = 4; + if (has_lut_data_index()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->lut_data_index()); + } + + // required int32 roi_array_index = 5; + if (has_roi_array_index()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->roi_array_index()); + } + + // required int32 surface_index = 6; + if (has_surface_index()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->surface_index()); + } + + // optional int32 stat_list_index = 7 [default = -1]; + if (has_stat_list_index()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->stat_list_index()); + } + + // optional int32 reserved1 = 8 [default = -1]; + if (has_reserved1()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->reserved1()); + } + + } + if (_has_bits_[9 / 32] & (0xffu << (9 % 32))) { + // required uint32 num_rois = 10; + if (has_num_rois()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->num_rois()); + } + + // required uint32 num_operations = 11; + if (has_num_operations()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->num_operations()); + } + + // required uint32 num_luts = 12; + if (has_num_luts()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->num_luts()); + } + + // required uint32 num_addresses = 13; + if (has_num_addresses()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->num_addresses()); + } + + // required int32 input_layer = 14; + if (has_input_layer()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->input_layer()); + } + + // required uint32 dynamic_roi = 15; + if (has_dynamic_roi()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->dynamic_roi()); + } + + // optional uint32 reserved0 = 16 [default = 0]; + if (has_reserved0()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->reserved0()); + } + + } + // repeated int32 op_head = 9 [packed = true]; + { + int data_size = 0; + for (int i = 0; i < this->op_head_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + Int32Size(this->op_head(i)); + } + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _op_head_cached_byte_size_ = data_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void NetworkDesc::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const NetworkDesc* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void NetworkDesc::MergeFrom(const NetworkDesc& from) { + GOOGLE_CHECK_NE(&from, this); + op_head_.MergeFrom(from.op_head_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_operation_desc_index()) { + set_operation_desc_index(from.operation_desc_index()); + } + if (from.has_surface_desc_index()) { + set_surface_desc_index(from.surface_desc_index()); + } + if (from.has_dependency_graph_index()) { + set_dependency_graph_index(from.dependency_graph_index()); + } + if (from.has_lut_data_index()) { + set_lut_data_index(from.lut_data_index()); + } + if (from.has_roi_array_index()) { + set_roi_array_index(from.roi_array_index()); + } + if (from.has_surface_index()) { + set_surface_index(from.surface_index()); + } + if (from.has_stat_list_index()) { + set_stat_list_index(from.stat_list_index()); + } + if (from.has_reserved1()) { + set_reserved1(from.reserved1()); + } + } + if (from._has_bits_[9 / 32] & (0xffu << (9 % 32))) { + if (from.has_num_rois()) { + set_num_rois(from.num_rois()); + } + if (from.has_num_operations()) { + set_num_operations(from.num_operations()); + } + if (from.has_num_luts()) { + set_num_luts(from.num_luts()); + } + if (from.has_num_addresses()) { + set_num_addresses(from.num_addresses()); + } + if (from.has_input_layer()) { + set_input_layer(from.input_layer()); + } + if (from.has_dynamic_roi()) { + set_dynamic_roi(from.dynamic_roi()); + } + if (from.has_reserved0()) { + set_reserved0(from.reserved0()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void NetworkDesc::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void NetworkDesc::CopyFrom(const NetworkDesc& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool NetworkDesc::IsInitialized() const { + if ((_has_bits_[0] & 0x00007e3f) != 0x00007e3f) return false; + + return true; +} + +void NetworkDesc::Swap(NetworkDesc* other) { + if (other != this) { + std::swap(operation_desc_index_, other->operation_desc_index_); + std::swap(surface_desc_index_, other->surface_desc_index_); + std::swap(dependency_graph_index_, other->dependency_graph_index_); + std::swap(lut_data_index_, other->lut_data_index_); + std::swap(roi_array_index_, other->roi_array_index_); + std::swap(surface_index_, other->surface_index_); + std::swap(stat_list_index_, other->stat_list_index_); + std::swap(reserved1_, other->reserved1_); + op_head_.Swap(&other->op_head_); + std::swap(num_rois_, other->num_rois_); + std::swap(num_operations_, other->num_operations_); + std::swap(num_luts_, other->num_luts_); + std::swap(num_addresses_, other->num_addresses_); + std::swap(input_layer_, other->input_layer_); + std::swap(dynamic_roi_, other->dynamic_roi_); + std::swap(reserved0_, other->reserved0_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::google::protobuf::Metadata NetworkDesc::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = NetworkDesc_descriptor_; + metadata.reflection = NetworkDesc_reflection_; + return metadata; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int LUTParamList::kLutParamFieldNumber; +#endif // !_MSC_VER + +LUTParamList::LUTParamList() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:nvdla_prototest_interface.LUTParamList) +} + +void LUTParamList::InitAsDefaultInstance() { +} + +LUTParamList::LUTParamList(const LUTParamList& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:nvdla_prototest_interface.LUTParamList) +} + +void LUTParamList::SharedCtor() { + _cached_size_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +LUTParamList::~LUTParamList() { + // @@protoc_insertion_point(destructor:nvdla_prototest_interface.LUTParamList) + SharedDtor(); +} + +void LUTParamList::SharedDtor() { + if (this != default_instance_) { + } +} + +void LUTParamList::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* LUTParamList::descriptor() { + protobuf_AssignDescriptorsOnce(); + return LUTParamList_descriptor_; +} + +const LUTParamList& LUTParamList::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_DlaPrototestInterface_2eproto(); + return *default_instance_; +} + +LUTParamList* LUTParamList::default_instance_ = NULL; + +LUTParamList* LUTParamList::New() const { + return new LUTParamList; +} + +void LUTParamList::Clear() { + lut_param_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool LUTParamList::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:nvdla_prototest_interface.LUTParamList) + 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 .nvdla_prototest_interface.LUTParam lut_param = 1; + case 1: { + if (tag == 10) { + parse_lut_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_lut_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(10)) goto parse_lut_param; + 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:nvdla_prototest_interface.LUTParamList) + return true; +failure: + // @@protoc_insertion_point(parse_failure:nvdla_prototest_interface.LUTParamList) + return false; +#undef DO_ +} + +void LUTParamList::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:nvdla_prototest_interface.LUTParamList) + // repeated .nvdla_prototest_interface.LUTParam lut_param = 1; + for (int i = 0; i < this->lut_param_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->lut_param(i), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:nvdla_prototest_interface.LUTParamList) +} + +::google::protobuf::uint8* LUTParamList::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:nvdla_prototest_interface.LUTParamList) + // repeated .nvdla_prototest_interface.LUTParam lut_param = 1; + for (int i = 0; i < this->lut_param_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 1, this->lut_param(i), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:nvdla_prototest_interface.LUTParamList) + return target; +} + +int LUTParamList::ByteSize() const { + int total_size = 0; + + // repeated .nvdla_prototest_interface.LUTParam lut_param = 1; + total_size += 1 * this->lut_param_size(); + for (int i = 0; i < this->lut_param_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->lut_param(i)); + } + + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void LUTParamList::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const LUTParamList* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void LUTParamList::MergeFrom(const LUTParamList& from) { + GOOGLE_CHECK_NE(&from, this); + lut_param_.MergeFrom(from.lut_param_); + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void LUTParamList::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void LUTParamList::CopyFrom(const LUTParamList& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool LUTParamList::IsInitialized() const { + + if (!::google::protobuf::internal::AllAreInitialized(this->lut_param())) return false; + return true; +} + +void LUTParamList::Swap(LUTParamList* other) { + if (other != this) { + lut_param_.Swap(&other->lut_param_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::google::protobuf::Metadata LUTParamList::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = LUTParamList_descriptor_; + metadata.reflection = LUTParamList_reflection_; + return metadata; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int ROIArrayDesc::kArrayLengthFieldNumber; +const int ROIArrayDesc::kArrayReservedFieldNumber; +#endif // !_MSC_VER + +ROIArrayDesc::ROIArrayDesc() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:nvdla_prototest_interface.ROIArrayDesc) +} + +void ROIArrayDesc::InitAsDefaultInstance() { +} + +ROIArrayDesc::ROIArrayDesc(const ROIArrayDesc& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:nvdla_prototest_interface.ROIArrayDesc) +} + +void ROIArrayDesc::SharedCtor() { + _cached_size_ = 0; + array_length_ = 0u; + array_reserved_ = 0u; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ROIArrayDesc::~ROIArrayDesc() { + // @@protoc_insertion_point(destructor:nvdla_prototest_interface.ROIArrayDesc) + SharedDtor(); +} + +void ROIArrayDesc::SharedDtor() { + if (this != default_instance_) { + } +} + +void ROIArrayDesc::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* ROIArrayDesc::descriptor() { + protobuf_AssignDescriptorsOnce(); + return ROIArrayDesc_descriptor_; +} + +const ROIArrayDesc& ROIArrayDesc::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_DlaPrototestInterface_2eproto(); + return *default_instance_; +} + +ROIArrayDesc* ROIArrayDesc::default_instance_ = NULL; + +ROIArrayDesc* ROIArrayDesc::New() const { + return new ROIArrayDesc; +} + +void ROIArrayDesc::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + ZR_(array_length_, array_reserved_); + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool ROIArrayDesc::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:nvdla_prototest_interface.ROIArrayDesc) + 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)) { + // required uint32 array_length = 1; + case 1: { + if (tag == 8) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &array_length_))); + set_has_array_length(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_array_reserved; + break; + } + + // required uint32 array_reserved = 2; + case 2: { + if (tag == 16) { + parse_array_reserved: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &array_reserved_))); + set_has_array_reserved(); + } 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:nvdla_prototest_interface.ROIArrayDesc) + return true; +failure: + // @@protoc_insertion_point(parse_failure:nvdla_prototest_interface.ROIArrayDesc) + return false; +#undef DO_ +} + +void ROIArrayDesc::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:nvdla_prototest_interface.ROIArrayDesc) + // required uint32 array_length = 1; + if (has_array_length()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->array_length(), output); + } + + // required uint32 array_reserved = 2; + if (has_array_reserved()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->array_reserved(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:nvdla_prototest_interface.ROIArrayDesc) +} + +::google::protobuf::uint8* ROIArrayDesc::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:nvdla_prototest_interface.ROIArrayDesc) + // required uint32 array_length = 1; + if (has_array_length()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->array_length(), target); + } + + // required uint32 array_reserved = 2; + if (has_array_reserved()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->array_reserved(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:nvdla_prototest_interface.ROIArrayDesc) + return target; +} + +int ROIArrayDesc::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // required uint32 array_length = 1; + if (has_array_length()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->array_length()); + } + + // required uint32 array_reserved = 2; + if (has_array_reserved()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->array_reserved()); + } + + } + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ROIArrayDesc::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const ROIArrayDesc* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void ROIArrayDesc::MergeFrom(const ROIArrayDesc& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_array_length()) { + set_array_length(from.array_length()); + } + if (from.has_array_reserved()) { + set_array_reserved(from.array_reserved()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void ROIArrayDesc::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ROIArrayDesc::CopyFrom(const ROIArrayDesc& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ROIArrayDesc::IsInitialized() const { + if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false; + + return true; +} + +void ROIArrayDesc::Swap(ROIArrayDesc* other) { + if (other != this) { + std::swap(array_length_, other->array_length_); + std::swap(array_reserved_, other->array_reserved_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::google::protobuf::Metadata ROIArrayDesc::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = ROIArrayDesc_descriptor_; + metadata.reflection = ROIArrayDesc_reflection_; + return metadata; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int ROIDesc::kLeftFieldNumber; +const int ROIDesc::kTopFieldNumber; +const int ROIDesc::kRightFieldNumber; +const int ROIDesc::kBottomFieldNumber; +#endif // !_MSC_VER + +ROIDesc::ROIDesc() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:nvdla_prototest_interface.ROIDesc) +} + +void ROIDesc::InitAsDefaultInstance() { +} + +ROIDesc::ROIDesc(const ROIDesc& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:nvdla_prototest_interface.ROIDesc) +} + +void ROIDesc::SharedCtor() { + _cached_size_ = 0; + left_ = 0u; + top_ = 0u; + right_ = 0u; + bottom_ = 0u; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ROIDesc::~ROIDesc() { + // @@protoc_insertion_point(destructor:nvdla_prototest_interface.ROIDesc) + SharedDtor(); +} + +void ROIDesc::SharedDtor() { + if (this != default_instance_) { + } +} + +void ROIDesc::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* ROIDesc::descriptor() { + protobuf_AssignDescriptorsOnce(); + return ROIDesc_descriptor_; +} + +const ROIDesc& ROIDesc::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_DlaPrototestInterface_2eproto(); + return *default_instance_; +} + +ROIDesc* ROIDesc::default_instance_ = NULL; + +ROIDesc* ROIDesc::New() const { + return new ROIDesc; +} + +void ROIDesc::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + ZR_(left_, bottom_); + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool ROIDesc::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:nvdla_prototest_interface.ROIDesc) + 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)) { + // required uint32 left = 1; + case 1: { + if (tag == 8) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &left_))); + set_has_left(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_top; + break; + } + + // required uint32 top = 2; + case 2: { + if (tag == 16) { + parse_top: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &top_))); + set_has_top(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(24)) goto parse_right; + break; + } + + // required uint32 right = 3; + case 3: { + if (tag == 24) { + parse_right: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &right_))); + set_has_right(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(32)) goto parse_bottom; + break; + } + + // required uint32 bottom = 4; + case 4: { + if (tag == 32) { + parse_bottom: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &bottom_))); + set_has_bottom(); + } 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:nvdla_prototest_interface.ROIDesc) + return true; +failure: + // @@protoc_insertion_point(parse_failure:nvdla_prototest_interface.ROIDesc) + return false; +#undef DO_ +} + +void ROIDesc::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:nvdla_prototest_interface.ROIDesc) + // required uint32 left = 1; + if (has_left()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->left(), output); + } + + // required uint32 top = 2; + if (has_top()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->top(), output); + } + + // required uint32 right = 3; + if (has_right()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->right(), output); + } + + // required uint32 bottom = 4; + if (has_bottom()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(4, this->bottom(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:nvdla_prototest_interface.ROIDesc) +} + +::google::protobuf::uint8* ROIDesc::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:nvdla_prototest_interface.ROIDesc) + // required uint32 left = 1; + if (has_left()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->left(), target); + } + + // required uint32 top = 2; + if (has_top()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->top(), target); + } + + // required uint32 right = 3; + if (has_right()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->right(), target); + } + + // required uint32 bottom = 4; + if (has_bottom()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(4, this->bottom(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:nvdla_prototest_interface.ROIDesc) + return target; +} + +int ROIDesc::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // required uint32 left = 1; + if (has_left()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->left()); + } + + // required uint32 top = 2; + if (has_top()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->top()); + } + + // required uint32 right = 3; + if (has_right()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->right()); + } + + // required uint32 bottom = 4; + if (has_bottom()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->bottom()); + } + + } + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ROIDesc::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const ROIDesc* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void ROIDesc::MergeFrom(const ROIDesc& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_left()) { + set_left(from.left()); + } + if (from.has_top()) { + set_top(from.top()); + } + if (from.has_right()) { + set_right(from.right()); + } + if (from.has_bottom()) { + set_bottom(from.bottom()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void ROIDesc::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ROIDesc::CopyFrom(const ROIDesc& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ROIDesc::IsInitialized() const { + if ((_has_bits_[0] & 0x0000000f) != 0x0000000f) return false; + + return true; +} + +void ROIDesc::Swap(ROIDesc* other) { + if (other != this) { + std::swap(left_, other->left_); + std::swap(top_, other->top_); + std::swap(right_, other->right_); + std::swap(bottom_, other->bottom_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::google::protobuf::Metadata ROIDesc::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = ROIDesc_descriptor_; + metadata.reflection = ROIDesc_reflection_; + return metadata; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int ROIDescription::kRoiArrFieldNumber; +const int ROIDescription::kRoiDescFieldNumber; +#endif // !_MSC_VER + +ROIDescription::ROIDescription() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:nvdla_prototest_interface.ROIDescription) +} + +void ROIDescription::InitAsDefaultInstance() { + roi_arr_ = const_cast< ::nvdla_prototest_interface::ROIArrayDesc*>(&::nvdla_prototest_interface::ROIArrayDesc::default_instance()); +} + +ROIDescription::ROIDescription(const ROIDescription& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:nvdla_prototest_interface.ROIDescription) +} + +void ROIDescription::SharedCtor() { + _cached_size_ = 0; + roi_arr_ = NULL; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ROIDescription::~ROIDescription() { + // @@protoc_insertion_point(destructor:nvdla_prototest_interface.ROIDescription) + SharedDtor(); +} + +void ROIDescription::SharedDtor() { + if (this != default_instance_) { + delete roi_arr_; + } +} + +void ROIDescription::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* ROIDescription::descriptor() { + protobuf_AssignDescriptorsOnce(); + return ROIDescription_descriptor_; +} + +const ROIDescription& ROIDescription::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_DlaPrototestInterface_2eproto(); + return *default_instance_; +} + +ROIDescription* ROIDescription::default_instance_ = NULL; + +ROIDescription* ROIDescription::New() const { + return new ROIDescription; +} + +void ROIDescription::Clear() { + if (has_roi_arr()) { + if (roi_arr_ != NULL) roi_arr_->::nvdla_prototest_interface::ROIArrayDesc::Clear(); + } + roi_desc_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool ROIDescription::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:nvdla_prototest_interface.ROIDescription) + 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)) { + // required .nvdla_prototest_interface.ROIArrayDesc roi_arr = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_roi_arr())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_roi_desc; + break; + } + + // repeated .nvdla_prototest_interface.ROIDesc roi_desc = 2; + case 2: { + if (tag == 18) { + parse_roi_desc: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_roi_desc())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_roi_desc; + 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:nvdla_prototest_interface.ROIDescription) + return true; +failure: + // @@protoc_insertion_point(parse_failure:nvdla_prototest_interface.ROIDescription) + return false; +#undef DO_ +} + +void ROIDescription::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:nvdla_prototest_interface.ROIDescription) + // required .nvdla_prototest_interface.ROIArrayDesc roi_arr = 1; + if (has_roi_arr()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->roi_arr(), output); + } + + // repeated .nvdla_prototest_interface.ROIDesc roi_desc = 2; + for (int i = 0; i < this->roi_desc_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->roi_desc(i), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:nvdla_prototest_interface.ROIDescription) +} + +::google::protobuf::uint8* ROIDescription::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:nvdla_prototest_interface.ROIDescription) + // required .nvdla_prototest_interface.ROIArrayDesc roi_arr = 1; + if (has_roi_arr()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 1, this->roi_arr(), target); + } + + // repeated .nvdla_prototest_interface.ROIDesc roi_desc = 2; + for (int i = 0; i < this->roi_desc_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 2, this->roi_desc(i), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:nvdla_prototest_interface.ROIDescription) + return target; +} + +int ROIDescription::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // required .nvdla_prototest_interface.ROIArrayDesc roi_arr = 1; + if (has_roi_arr()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->roi_arr()); + } + + } + // repeated .nvdla_prototest_interface.ROIDesc roi_desc = 2; + total_size += 1 * this->roi_desc_size(); + for (int i = 0; i < this->roi_desc_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->roi_desc(i)); + } + + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ROIDescription::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const ROIDescription* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void ROIDescription::MergeFrom(const ROIDescription& from) { + GOOGLE_CHECK_NE(&from, this); + roi_desc_.MergeFrom(from.roi_desc_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_roi_arr()) { + mutable_roi_arr()->::nvdla_prototest_interface::ROIArrayDesc::MergeFrom(from.roi_arr()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void ROIDescription::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ROIDescription::CopyFrom(const ROIDescription& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ROIDescription::IsInitialized() const { + if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false; + + if (has_roi_arr()) { + if (!this->roi_arr().IsInitialized()) return false; + } + if (!::google::protobuf::internal::AllAreInitialized(this->roi_desc())) return false; + return true; +} + +void ROIDescription::Swap(ROIDescription* other) { + if (other != this) { + std::swap(roi_arr_, other->roi_arr_); + roi_desc_.Swap(&other->roi_desc_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::google::protobuf::Metadata ROIDescription::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = ROIDescription_descriptor_; + metadata.reflection = ROIDescription_reflection_; + return metadata; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int Network::kParamFieldNumber; +const int Network::kLayersFieldNumber; +const int Network::kLutListFieldNumber; +const int Network::kRoiListFieldNumber; +#endif // !_MSC_VER + +Network::Network() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:nvdla_prototest_interface.Network) +} + +void Network::InitAsDefaultInstance() { + param_ = const_cast< ::nvdla_prototest_interface::NetworkDesc*>(&::nvdla_prototest_interface::NetworkDesc::default_instance()); + layers_ = const_cast< ::nvdla_prototest_interface::NetworkLayer*>(&::nvdla_prototest_interface::NetworkLayer::default_instance()); + lut_list_ = const_cast< ::nvdla_prototest_interface::LUTParamList*>(&::nvdla_prototest_interface::LUTParamList::default_instance()); + roi_list_ = const_cast< ::nvdla_prototest_interface::ROIDescription*>(&::nvdla_prototest_interface::ROIDescription::default_instance()); +} + +Network::Network(const Network& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:nvdla_prototest_interface.Network) +} + +void Network::SharedCtor() { + _cached_size_ = 0; + param_ = NULL; + layers_ = NULL; + lut_list_ = NULL; + roi_list_ = NULL; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +Network::~Network() { + // @@protoc_insertion_point(destructor:nvdla_prototest_interface.Network) + SharedDtor(); +} + +void Network::SharedDtor() { + if (this != default_instance_) { + delete param_; + delete layers_; + delete lut_list_; + delete roi_list_; + } +} + +void Network::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* Network::descriptor() { + protobuf_AssignDescriptorsOnce(); + return Network_descriptor_; +} + +const Network& Network::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_DlaPrototestInterface_2eproto(); + return *default_instance_; +} + +Network* Network::default_instance_ = NULL; + +Network* Network::New() const { + return new Network; +} + +void Network::Clear() { + if (_has_bits_[0 / 32] & 15) { + if (has_param()) { + if (param_ != NULL) param_->::nvdla_prototest_interface::NetworkDesc::Clear(); + } + if (has_layers()) { + if (layers_ != NULL) layers_->::nvdla_prototest_interface::NetworkLayer::Clear(); + } + if (has_lut_list()) { + if (lut_list_ != NULL) lut_list_->::nvdla_prototest_interface::LUTParamList::Clear(); + } + if (has_roi_list()) { + if (roi_list_ != NULL) roi_list_->::nvdla_prototest_interface::ROIDescription::Clear(); + } + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool Network::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:nvdla_prototest_interface.Network) + 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)) { + // required .nvdla_prototest_interface.NetworkDesc param = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_layers; + break; + } + + // required .nvdla_prototest_interface.NetworkLayer layers = 2; + case 2: { + if (tag == 18) { + parse_layers: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_layers())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_lut_list; + break; + } + + // required .nvdla_prototest_interface.LUTParamList lut_list = 3; + case 3: { + if (tag == 26) { + parse_lut_list: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_lut_list())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(34)) goto parse_roi_list; + break; + } + + // required .nvdla_prototest_interface.ROIDescription roi_list = 4; + case 4: { + if (tag == 34) { + parse_roi_list: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_roi_list())); + } 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:nvdla_prototest_interface.Network) + return true; +failure: + // @@protoc_insertion_point(parse_failure:nvdla_prototest_interface.Network) + return false; +#undef DO_ +} + +void Network::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:nvdla_prototest_interface.Network) + // required .nvdla_prototest_interface.NetworkDesc param = 1; + if (has_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->param(), output); + } + + // required .nvdla_prototest_interface.NetworkLayer layers = 2; + if (has_layers()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->layers(), output); + } + + // required .nvdla_prototest_interface.LUTParamList lut_list = 3; + if (has_lut_list()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, this->lut_list(), output); + } + + // required .nvdla_prototest_interface.ROIDescription roi_list = 4; + if (has_roi_list()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, this->roi_list(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:nvdla_prototest_interface.Network) +} + +::google::protobuf::uint8* Network::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:nvdla_prototest_interface.Network) + // required .nvdla_prototest_interface.NetworkDesc param = 1; + if (has_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 1, this->param(), target); + } + + // required .nvdla_prototest_interface.NetworkLayer layers = 2; + if (has_layers()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 2, this->layers(), target); + } + + // required .nvdla_prototest_interface.LUTParamList lut_list = 3; + if (has_lut_list()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 3, this->lut_list(), target); + } + + // required .nvdla_prototest_interface.ROIDescription roi_list = 4; + if (has_roi_list()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 4, this->roi_list(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:nvdla_prototest_interface.Network) + return target; +} + +int Network::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // required .nvdla_prototest_interface.NetworkDesc param = 1; + if (has_param()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->param()); + } + + // required .nvdla_prototest_interface.NetworkLayer layers = 2; + if (has_layers()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->layers()); + } + + // required .nvdla_prototest_interface.LUTParamList lut_list = 3; + if (has_lut_list()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->lut_list()); + } + + // required .nvdla_prototest_interface.ROIDescription roi_list = 4; + if (has_roi_list()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->roi_list()); + } + + } + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void Network::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const Network* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void Network::MergeFrom(const Network& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_param()) { + mutable_param()->::nvdla_prototest_interface::NetworkDesc::MergeFrom(from.param()); + } + if (from.has_layers()) { + mutable_layers()->::nvdla_prototest_interface::NetworkLayer::MergeFrom(from.layers()); + } + if (from.has_lut_list()) { + mutable_lut_list()->::nvdla_prototest_interface::LUTParamList::MergeFrom(from.lut_list()); + } + if (from.has_roi_list()) { + mutable_roi_list()->::nvdla_prototest_interface::ROIDescription::MergeFrom(from.roi_list()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void Network::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Network::CopyFrom(const Network& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Network::IsInitialized() const { + if ((_has_bits_[0] & 0x0000000f) != 0x0000000f) return false; + + if (has_param()) { + if (!this->param().IsInitialized()) return false; + } + if (has_layers()) { + if (!this->layers().IsInitialized()) return false; + } + if (has_lut_list()) { + if (!this->lut_list().IsInitialized()) return false; + } + if (has_roi_list()) { + if (!this->roi_list().IsInitialized()) return false; + } + return true; +} + +void Network::Swap(Network* other) { + if (other != this) { + std::swap(param_, other->param_); + std::swap(layers_, other->layers_); + std::swap(lut_list_, other->lut_list_); + std::swap(roi_list_, other->roi_list_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::google::protobuf::Metadata Network::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = Network_descriptor_; + metadata.reflection = Network_reflection_; + return metadata; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int TaskStatus::kTimestampFieldNumber; +const int TaskStatus::kStatusEngineFieldNumber; +const int TaskStatus::kSubframeFieldNumber; +const int TaskStatus::kStatusTaskFieldNumber; +#endif // !_MSC_VER + +TaskStatus::TaskStatus() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:nvdla_prototest_interface.TaskStatus) +} + +void TaskStatus::InitAsDefaultInstance() { +} + +TaskStatus::TaskStatus(const TaskStatus& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:nvdla_prototest_interface.TaskStatus) +} + +void TaskStatus::SharedCtor() { + _cached_size_ = 0; + timestamp_ = GOOGLE_ULONGLONG(0); + status_engine_ = 0u; + subframe_ = 0u; + status_task_ = 0u; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +TaskStatus::~TaskStatus() { + // @@protoc_insertion_point(destructor:nvdla_prototest_interface.TaskStatus) + SharedDtor(); +} + +void TaskStatus::SharedDtor() { + if (this != default_instance_) { + } +} + +void TaskStatus::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* TaskStatus::descriptor() { + protobuf_AssignDescriptorsOnce(); + return TaskStatus_descriptor_; +} + +const TaskStatus& TaskStatus::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_DlaPrototestInterface_2eproto(); + return *default_instance_; +} + +TaskStatus* TaskStatus::default_instance_ = NULL; + +TaskStatus* TaskStatus::New() const { + return new TaskStatus; +} + +void TaskStatus::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + ZR_(timestamp_, status_task_); + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool TaskStatus::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:nvdla_prototest_interface.TaskStatus) + 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)) { + // required uint64 timestamp = 1; + case 1: { + if (tag == 8) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( + input, ×tamp_))); + set_has_timestamp(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_status_engine; + break; + } + + // required uint32 status_engine = 2; + case 2: { + if (tag == 16) { + parse_status_engine: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &status_engine_))); + set_has_status_engine(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(24)) goto parse_subframe; + break; + } + + // required uint32 subframe = 3; + case 3: { + if (tag == 24) { + parse_subframe: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &subframe_))); + set_has_subframe(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(32)) goto parse_status_task; + break; + } + + // required uint32 status_task = 4; + case 4: { + if (tag == 32) { + parse_status_task: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &status_task_))); + set_has_status_task(); + } 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:nvdla_prototest_interface.TaskStatus) + return true; +failure: + // @@protoc_insertion_point(parse_failure:nvdla_prototest_interface.TaskStatus) + return false; +#undef DO_ +} + +void TaskStatus::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:nvdla_prototest_interface.TaskStatus) + // required uint64 timestamp = 1; + if (has_timestamp()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt64(1, this->timestamp(), output); + } + + // required uint32 status_engine = 2; + if (has_status_engine()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->status_engine(), output); + } + + // required uint32 subframe = 3; + if (has_subframe()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->subframe(), output); + } + + // required uint32 status_task = 4; + if (has_status_task()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(4, this->status_task(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:nvdla_prototest_interface.TaskStatus) +} + +::google::protobuf::uint8* TaskStatus::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:nvdla_prototest_interface.TaskStatus) + // required uint64 timestamp = 1; + if (has_timestamp()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(1, this->timestamp(), target); + } + + // required uint32 status_engine = 2; + if (has_status_engine()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->status_engine(), target); + } + + // required uint32 subframe = 3; + if (has_subframe()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->subframe(), target); + } + + // required uint32 status_task = 4; + if (has_status_task()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(4, this->status_task(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:nvdla_prototest_interface.TaskStatus) + return target; +} + +int TaskStatus::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // required uint64 timestamp = 1; + if (has_timestamp()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt64Size( + this->timestamp()); + } + + // required uint32 status_engine = 2; + if (has_status_engine()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->status_engine()); + } + + // required uint32 subframe = 3; + if (has_subframe()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->subframe()); + } + + // required uint32 status_task = 4; + if (has_status_task()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->status_task()); + } + + } + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void TaskStatus::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const TaskStatus* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void TaskStatus::MergeFrom(const TaskStatus& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_timestamp()) { + set_timestamp(from.timestamp()); + } + if (from.has_status_engine()) { + set_status_engine(from.status_engine()); + } + if (from.has_subframe()) { + set_subframe(from.subframe()); + } + if (from.has_status_task()) { + set_status_task(from.status_task()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void TaskStatus::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void TaskStatus::CopyFrom(const TaskStatus& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool TaskStatus::IsInitialized() const { + if ((_has_bits_[0] & 0x0000000f) != 0x0000000f) return false; + + return true; +} + +void TaskStatus::Swap(TaskStatus* other) { + if (other != this) { + std::swap(timestamp_, other->timestamp_); + std::swap(status_engine_, other->status_engine_); + std::swap(subframe_, other->subframe_); + std::swap(status_task_, other->status_task_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::google::protobuf::Metadata TaskStatus::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = TaskStatus_descriptor_; + metadata.reflection = TaskStatus_reflection_; + return metadata; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int Action::kEventIdFieldNumber; +#endif // !_MSC_VER + +Action::Action() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:nvdla_prototest_interface.Action) +} + +void Action::InitAsDefaultInstance() { +} + +Action::Action(const Action& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:nvdla_prototest_interface.Action) +} + +void Action::SharedCtor() { + _cached_size_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +Action::~Action() { + // @@protoc_insertion_point(destructor:nvdla_prototest_interface.Action) + SharedDtor(); +} + +void Action::SharedDtor() { + if (this != default_instance_) { + } +} + +void Action::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* Action::descriptor() { + protobuf_AssignDescriptorsOnce(); + return Action_descriptor_; +} + +const Action& Action::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_DlaPrototestInterface_2eproto(); + return *default_instance_; +} + +Action* Action::default_instance_ = NULL; + +Action* Action::New() const { + return new Action; +} + +void Action::Clear() { + event_id_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool Action::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:nvdla_prototest_interface.Action) + 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 event_id = 1 [packed = true]; + case 1: { + if (tag == 10) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, this->mutable_event_id()))); + } else if (tag == 8) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + 1, 10, input, this->mutable_event_id()))); + } 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:nvdla_prototest_interface.Action) + return true; +failure: + // @@protoc_insertion_point(parse_failure:nvdla_prototest_interface.Action) + return false; +#undef DO_ +} + +void Action::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:nvdla_prototest_interface.Action) + // repeated uint32 event_id = 1 [packed = true]; + if (this->event_id_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(1, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(_event_id_cached_byte_size_); + } + for (int i = 0; i < this->event_id_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32NoTag( + this->event_id(i), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:nvdla_prototest_interface.Action) +} + +::google::protobuf::uint8* Action::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:nvdla_prototest_interface.Action) + // repeated uint32 event_id = 1 [packed = true]; + if (this->event_id_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 1, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + _event_id_cached_byte_size_, target); + } + for (int i = 0; i < this->event_id_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteUInt32NoTagToArray(this->event_id(i), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:nvdla_prototest_interface.Action) + return target; +} + +int Action::ByteSize() const { + int total_size = 0; + + // repeated uint32 event_id = 1 [packed = true]; + { + int data_size = 0; + for (int i = 0; i < this->event_id_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->event_id(i)); + } + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _event_id_cached_byte_size_ = data_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void Action::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const Action* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void Action::MergeFrom(const Action& from) { + GOOGLE_CHECK_NE(&from, this); + event_id_.MergeFrom(from.event_id_); + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void Action::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Action::CopyFrom(const Action& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Action::IsInitialized() const { + + return true; +} + +void Action::Swap(Action* other) { + if (other != this) { + event_id_.Swap(&other->event_id_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::google::protobuf::Metadata Action::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = Action_descriptor_; + metadata.reflection = Action_reflection_; + return metadata; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int TaskSchedule::kPreActionsFieldNumber; +const int TaskSchedule::kPostActionsFieldNumber; +#endif // !_MSC_VER + +TaskSchedule::TaskSchedule() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:nvdla_prototest_interface.TaskSchedule) +} + +void TaskSchedule::InitAsDefaultInstance() { + pre_actions_ = const_cast< ::nvdla_prototest_interface::Action*>(&::nvdla_prototest_interface::Action::default_instance()); + post_actions_ = const_cast< ::nvdla_prototest_interface::Action*>(&::nvdla_prototest_interface::Action::default_instance()); +} + +TaskSchedule::TaskSchedule(const TaskSchedule& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:nvdla_prototest_interface.TaskSchedule) +} + +void TaskSchedule::SharedCtor() { + _cached_size_ = 0; + pre_actions_ = NULL; + post_actions_ = NULL; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +TaskSchedule::~TaskSchedule() { + // @@protoc_insertion_point(destructor:nvdla_prototest_interface.TaskSchedule) + SharedDtor(); +} + +void TaskSchedule::SharedDtor() { + if (this != default_instance_) { + delete pre_actions_; + delete post_actions_; + } +} + +void TaskSchedule::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* TaskSchedule::descriptor() { + protobuf_AssignDescriptorsOnce(); + return TaskSchedule_descriptor_; +} + +const TaskSchedule& TaskSchedule::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_DlaPrototestInterface_2eproto(); + return *default_instance_; +} + +TaskSchedule* TaskSchedule::default_instance_ = NULL; + +TaskSchedule* TaskSchedule::New() const { + return new TaskSchedule; +} + +void TaskSchedule::Clear() { + if (_has_bits_[0 / 32] & 3) { + if (has_pre_actions()) { + if (pre_actions_ != NULL) pre_actions_->::nvdla_prototest_interface::Action::Clear(); + } + if (has_post_actions()) { + if (post_actions_ != NULL) post_actions_->::nvdla_prototest_interface::Action::Clear(); + } + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool TaskSchedule::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:nvdla_prototest_interface.TaskSchedule) + 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 .nvdla_prototest_interface.Action pre_actions = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_pre_actions())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_post_actions; + break; + } + + // optional .nvdla_prototest_interface.Action post_actions = 2; + case 2: { + if (tag == 18) { + parse_post_actions: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_post_actions())); + } 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:nvdla_prototest_interface.TaskSchedule) + return true; +failure: + // @@protoc_insertion_point(parse_failure:nvdla_prototest_interface.TaskSchedule) + return false; +#undef DO_ +} + +void TaskSchedule::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:nvdla_prototest_interface.TaskSchedule) + // optional .nvdla_prototest_interface.Action pre_actions = 1; + if (has_pre_actions()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->pre_actions(), output); + } + + // optional .nvdla_prototest_interface.Action post_actions = 2; + if (has_post_actions()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->post_actions(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:nvdla_prototest_interface.TaskSchedule) +} + +::google::protobuf::uint8* TaskSchedule::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:nvdla_prototest_interface.TaskSchedule) + // optional .nvdla_prototest_interface.Action pre_actions = 1; + if (has_pre_actions()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 1, this->pre_actions(), target); + } + + // optional .nvdla_prototest_interface.Action post_actions = 2; + if (has_post_actions()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 2, this->post_actions(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:nvdla_prototest_interface.TaskSchedule) + return target; +} + +int TaskSchedule::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional .nvdla_prototest_interface.Action pre_actions = 1; + if (has_pre_actions()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->pre_actions()); + } + + // optional .nvdla_prototest_interface.Action post_actions = 2; + if (has_post_actions()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->post_actions()); + } + + } + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void TaskSchedule::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const TaskSchedule* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void TaskSchedule::MergeFrom(const TaskSchedule& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_pre_actions()) { + mutable_pre_actions()->::nvdla_prototest_interface::Action::MergeFrom(from.pre_actions()); + } + if (from.has_post_actions()) { + mutable_post_actions()->::nvdla_prototest_interface::Action::MergeFrom(from.post_actions()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void TaskSchedule::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void TaskSchedule::CopyFrom(const TaskSchedule& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool TaskSchedule::IsInitialized() const { + + return true; +} + +void TaskSchedule::Swap(TaskSchedule* other) { + if (other != this) { + std::swap(pre_actions_, other->pre_actions_); + std::swap(post_actions_, other->post_actions_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::google::protobuf::Metadata TaskSchedule::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = TaskSchedule_descriptor_; + metadata.reflection = TaskSchedule_reflection_; + return metadata; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int TasksData::kTaskIdFieldNumber; +const int TasksData::kEngineIdFieldNumber; +const int TasksData::kNetworkFieldNumber; +const int TasksData::kScheduleFieldNumber; +const int TasksData::kTaskStatusFieldNumber; +const int TasksData::kTaskTimeoutFieldNumber; +const int TasksData::kTaskResultFieldNumber; +#endif // !_MSC_VER + +TasksData::TasksData() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:nvdla_prototest_interface.TasksData) +} + +void TasksData::InitAsDefaultInstance() { + network_ = const_cast< ::nvdla_prototest_interface::Network*>(&::nvdla_prototest_interface::Network::default_instance()); + schedule_ = const_cast< ::nvdla_prototest_interface::TaskSchedule*>(&::nvdla_prototest_interface::TaskSchedule::default_instance()); + task_status_ = const_cast< ::nvdla_prototest_interface::TaskStatus*>(&::nvdla_prototest_interface::TaskStatus::default_instance()); +} + +TasksData::TasksData(const TasksData& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:nvdla_prototest_interface.TasksData) +} + +void TasksData::SharedCtor() { + _cached_size_ = 0; + task_id_ = 0u; + engine_id_ = 0; + network_ = NULL; + schedule_ = NULL; + task_status_ = NULL; + task_timeout_ = 4294967295u; + task_result_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +TasksData::~TasksData() { + // @@protoc_insertion_point(destructor:nvdla_prototest_interface.TasksData) + SharedDtor(); +} + +void TasksData::SharedDtor() { + if (this != default_instance_) { + delete network_; + delete schedule_; + delete task_status_; + } +} + +void TasksData::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* TasksData::descriptor() { + protobuf_AssignDescriptorsOnce(); + return TasksData_descriptor_; +} + +const TasksData& TasksData::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_DlaPrototestInterface_2eproto(); + return *default_instance_; +} + +TasksData* TasksData::default_instance_ = NULL; + +TasksData* TasksData::New() const { + return new TasksData; +} + +void TasksData::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 127) { + ZR_(task_id_, engine_id_); + if (has_network()) { + if (network_ != NULL) network_->::nvdla_prototest_interface::Network::Clear(); + } + if (has_schedule()) { + if (schedule_ != NULL) schedule_->::nvdla_prototest_interface::TaskSchedule::Clear(); + } + if (has_task_status()) { + if (task_status_ != NULL) task_status_->::nvdla_prototest_interface::TaskStatus::Clear(); + } + task_timeout_ = 4294967295u; + task_result_ = 0; + } + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool TasksData::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:nvdla_prototest_interface.TasksData) + 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 task_id = 1; + case 1: { + if (tag == 8) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &task_id_))); + set_has_task_id(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_engine_id; + break; + } + + // required .nvdla_prototest_interface.EngineID engine_id = 2; + case 2: { + if (tag == 16) { + parse_engine_id: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::nvdla_prototest_interface::EngineID_IsValid(value)) { + set_engine_id(static_cast< ::nvdla_prototest_interface::EngineID >(value)); + } else { + mutable_unknown_fields()->AddVarint(2, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_network; + break; + } + + // required .nvdla_prototest_interface.Network network = 3; + case 3: { + if (tag == 26) { + parse_network: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_network())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(34)) goto parse_schedule; + break; + } + + // optional .nvdla_prototest_interface.TaskSchedule schedule = 4; + case 4: { + if (tag == 34) { + parse_schedule: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_schedule())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(42)) goto parse_task_status; + break; + } + + // optional .nvdla_prototest_interface.TaskStatus task_status = 5; + case 5: { + if (tag == 42) { + parse_task_status: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_task_status())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(48)) goto parse_task_timeout; + break; + } + + // optional uint32 task_timeout = 6 [default = 4294967295]; + case 6: { + if (tag == 48) { + parse_task_timeout: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &task_timeout_))); + set_has_task_timeout(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(56)) goto parse_task_result; + break; + } + + // optional int32 task_result = 7 [default = 0]; + case 7: { + if (tag == 56) { + parse_task_result: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &task_result_))); + set_has_task_result(); + } 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:nvdla_prototest_interface.TasksData) + return true; +failure: + // @@protoc_insertion_point(parse_failure:nvdla_prototest_interface.TasksData) + return false; +#undef DO_ +} + +void TasksData::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:nvdla_prototest_interface.TasksData) + // optional uint32 task_id = 1; + if (has_task_id()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->task_id(), output); + } + + // required .nvdla_prototest_interface.EngineID engine_id = 2; + if (has_engine_id()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 2, this->engine_id(), output); + } + + // required .nvdla_prototest_interface.Network network = 3; + if (has_network()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, this->network(), output); + } + + // optional .nvdla_prototest_interface.TaskSchedule schedule = 4; + if (has_schedule()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, this->schedule(), output); + } + + // optional .nvdla_prototest_interface.TaskStatus task_status = 5; + if (has_task_status()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 5, this->task_status(), output); + } + + // optional uint32 task_timeout = 6 [default = 4294967295]; + if (has_task_timeout()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(6, this->task_timeout(), output); + } + + // optional int32 task_result = 7 [default = 0]; + if (has_task_result()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(7, this->task_result(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:nvdla_prototest_interface.TasksData) +} + +::google::protobuf::uint8* TasksData::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:nvdla_prototest_interface.TasksData) + // optional uint32 task_id = 1; + if (has_task_id()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->task_id(), target); + } + + // required .nvdla_prototest_interface.EngineID engine_id = 2; + if (has_engine_id()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 2, this->engine_id(), target); + } + + // required .nvdla_prototest_interface.Network network = 3; + if (has_network()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 3, this->network(), target); + } + + // optional .nvdla_prototest_interface.TaskSchedule schedule = 4; + if (has_schedule()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 4, this->schedule(), target); + } + + // optional .nvdla_prototest_interface.TaskStatus task_status = 5; + if (has_task_status()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 5, this->task_status(), target); + } + + // optional uint32 task_timeout = 6 [default = 4294967295]; + if (has_task_timeout()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(6, this->task_timeout(), target); + } + + // optional int32 task_result = 7 [default = 0]; + if (has_task_result()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(7, this->task_result(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:nvdla_prototest_interface.TasksData) + return target; +} + +int TasksData::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional uint32 task_id = 1; + if (has_task_id()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->task_id()); + } + + // required .nvdla_prototest_interface.EngineID engine_id = 2; + if (has_engine_id()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->engine_id()); + } + + // required .nvdla_prototest_interface.Network network = 3; + if (has_network()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->network()); + } + + // optional .nvdla_prototest_interface.TaskSchedule schedule = 4; + if (has_schedule()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->schedule()); + } + + // optional .nvdla_prototest_interface.TaskStatus task_status = 5; + if (has_task_status()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->task_status()); + } + + // optional uint32 task_timeout = 6 [default = 4294967295]; + if (has_task_timeout()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->task_timeout()); + } + + // optional int32 task_result = 7 [default = 0]; + if (has_task_result()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->task_result()); + } + + } + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void TasksData::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const TasksData* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void TasksData::MergeFrom(const TasksData& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_task_id()) { + set_task_id(from.task_id()); + } + if (from.has_engine_id()) { + set_engine_id(from.engine_id()); + } + if (from.has_network()) { + mutable_network()->::nvdla_prototest_interface::Network::MergeFrom(from.network()); + } + if (from.has_schedule()) { + mutable_schedule()->::nvdla_prototest_interface::TaskSchedule::MergeFrom(from.schedule()); + } + if (from.has_task_status()) { + mutable_task_status()->::nvdla_prototest_interface::TaskStatus::MergeFrom(from.task_status()); + } + if (from.has_task_timeout()) { + set_task_timeout(from.task_timeout()); + } + if (from.has_task_result()) { + set_task_result(from.task_result()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void TasksData::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void TasksData::CopyFrom(const TasksData& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool TasksData::IsInitialized() const { + if ((_has_bits_[0] & 0x00000006) != 0x00000006) return false; + + if (has_network()) { + if (!this->network().IsInitialized()) return false; + } + if (has_task_status()) { + if (!this->task_status().IsInitialized()) return false; + } + return true; +} + +void TasksData::Swap(TasksData* other) { + if (other != this) { + std::swap(task_id_, other->task_id_); + std::swap(engine_id_, other->engine_id_); + std::swap(network_, other->network_); + std::swap(schedule_, other->schedule_); + std::swap(task_status_, other->task_status_); + std::swap(task_timeout_, other->task_timeout_); + std::swap(task_result_, other->task_result_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::google::protobuf::Metadata TasksData::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = TasksData_descriptor_; + metadata.reflection = TasksData_reflection_; + return metadata; +} + + +// =================================================================== + +const ::google::protobuf::EnumDescriptor* Event_EventType_descriptor() { + protobuf_AssignDescriptorsOnce(); + return Event_EventType_descriptor_; +} +bool Event_EventType_IsValid(int value) { + switch(value) { + case 0: + case 1: + case 2: + case 3: + return true; + default: + return false; + } +} + +#ifndef _MSC_VER +const Event_EventType Event::SYNCPOINT; +const Event_EventType Event::SYNCFD; +const Event_EventType Event::SEMAPHORE; +const Event_EventType Event::TS_SEMAPHORE; +const Event_EventType Event::EventType_MIN; +const Event_EventType Event::EventType_MAX; +const int Event::EventType_ARRAYSIZE; +#endif // _MSC_VER +#ifndef _MSC_VER +const int Event::kEventIdFieldNumber; +const int Event::kEventTypeFieldNumber; +const int Event::kEventFlagsFieldNumber; +const int Event::kEventTimeoutFieldNumber; +#endif // !_MSC_VER + +Event::Event() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:nvdla_prototest_interface.Event) +} + +void Event::InitAsDefaultInstance() { +} + +Event::Event(const Event& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:nvdla_prototest_interface.Event) +} + +void Event::SharedCtor() { + _cached_size_ = 0; + event_id_ = 0u; + event_type_ = 0; + event_flags_ = 0u; + event_timeout_ = 4294967295u; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +Event::~Event() { + // @@protoc_insertion_point(destructor:nvdla_prototest_interface.Event) + SharedDtor(); +} + +void Event::SharedDtor() { + if (this != default_instance_) { + } +} + +void Event::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* Event::descriptor() { + protobuf_AssignDescriptorsOnce(); + return Event_descriptor_; +} + +const Event& Event::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_DlaPrototestInterface_2eproto(); + return *default_instance_; +} + +Event* Event::default_instance_ = NULL; + +Event* Event::New() const { + return new Event; +} + +void Event::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 15) { + ZR_(event_id_, event_flags_); + event_timeout_ = 4294967295u; + } + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool Event::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:nvdla_prototest_interface.Event) + 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)) { + // required uint32 event_id = 1; + case 1: { + if (tag == 8) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &event_id_))); + set_has_event_id(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_event_type; + break; + } + + // required .nvdla_prototest_interface.Event.EventType event_type = 2; + case 2: { + if (tag == 16) { + parse_event_type: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::nvdla_prototest_interface::Event_EventType_IsValid(value)) { + set_event_type(static_cast< ::nvdla_prototest_interface::Event_EventType >(value)); + } else { + mutable_unknown_fields()->AddVarint(2, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(24)) goto parse_event_flags; + break; + } + + // required uint32 event_flags = 3; + case 3: { + if (tag == 24) { + parse_event_flags: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &event_flags_))); + set_has_event_flags(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(32)) goto parse_event_timeout; + break; + } + + // optional uint32 event_timeout = 4 [default = 4294967295]; + case 4: { + if (tag == 32) { + parse_event_timeout: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &event_timeout_))); + set_has_event_timeout(); + } 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:nvdla_prototest_interface.Event) + return true; +failure: + // @@protoc_insertion_point(parse_failure:nvdla_prototest_interface.Event) + return false; +#undef DO_ +} + +void Event::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:nvdla_prototest_interface.Event) + // required uint32 event_id = 1; + if (has_event_id()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->event_id(), output); + } + + // required .nvdla_prototest_interface.Event.EventType event_type = 2; + if (has_event_type()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 2, this->event_type(), output); + } + + // required uint32 event_flags = 3; + if (has_event_flags()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->event_flags(), output); + } + + // optional uint32 event_timeout = 4 [default = 4294967295]; + if (has_event_timeout()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(4, this->event_timeout(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:nvdla_prototest_interface.Event) +} + +::google::protobuf::uint8* Event::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:nvdla_prototest_interface.Event) + // required uint32 event_id = 1; + if (has_event_id()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->event_id(), target); + } + + // required .nvdla_prototest_interface.Event.EventType event_type = 2; + if (has_event_type()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 2, this->event_type(), target); + } + + // required uint32 event_flags = 3; + if (has_event_flags()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->event_flags(), target); + } + + // optional uint32 event_timeout = 4 [default = 4294967295]; + if (has_event_timeout()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(4, this->event_timeout(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:nvdla_prototest_interface.Event) + return target; +} + +int Event::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // required uint32 event_id = 1; + if (has_event_id()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->event_id()); + } + + // required .nvdla_prototest_interface.Event.EventType event_type = 2; + if (has_event_type()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->event_type()); + } + + // required uint32 event_flags = 3; + if (has_event_flags()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->event_flags()); + } + + // optional uint32 event_timeout = 4 [default = 4294967295]; + if (has_event_timeout()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->event_timeout()); + } + + } + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void Event::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const Event* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void Event::MergeFrom(const Event& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_event_id()) { + set_event_id(from.event_id()); + } + if (from.has_event_type()) { + set_event_type(from.event_type()); + } + if (from.has_event_flags()) { + set_event_flags(from.event_flags()); + } + if (from.has_event_timeout()) { + set_event_timeout(from.event_timeout()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void Event::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Event::CopyFrom(const Event& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Event::IsInitialized() const { + if ((_has_bits_[0] & 0x00000007) != 0x00000007) return false; + + return true; +} + +void Event::Swap(Event* other) { + if (other != this) { + std::swap(event_id_, other->event_id_); + std::swap(event_type_, other->event_type_); + std::swap(event_flags_, other->event_flags_); + std::swap(event_timeout_, other->event_timeout_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::google::protobuf::Metadata Event::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = Event_descriptor_; + metadata.reflection = Event_reflection_; + return metadata; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int EventList::kEventFieldNumber; +#endif // !_MSC_VER + +EventList::EventList() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:nvdla_prototest_interface.EventList) +} + +void EventList::InitAsDefaultInstance() { +} + +EventList::EventList(const EventList& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:nvdla_prototest_interface.EventList) +} + +void EventList::SharedCtor() { + _cached_size_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +EventList::~EventList() { + // @@protoc_insertion_point(destructor:nvdla_prototest_interface.EventList) + SharedDtor(); +} + +void EventList::SharedDtor() { + if (this != default_instance_) { + } +} + +void EventList::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* EventList::descriptor() { + protobuf_AssignDescriptorsOnce(); + return EventList_descriptor_; +} + +const EventList& EventList::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_DlaPrototestInterface_2eproto(); + return *default_instance_; +} + +EventList* EventList::default_instance_ = NULL; + +EventList* EventList::New() const { + return new EventList; +} + +void EventList::Clear() { + event_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool EventList::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:nvdla_prototest_interface.EventList) + 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 .nvdla_prototest_interface.Event event = 1; + case 1: { + if (tag == 10) { + parse_event: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_event())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(10)) goto parse_event; + 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:nvdla_prototest_interface.EventList) + return true; +failure: + // @@protoc_insertion_point(parse_failure:nvdla_prototest_interface.EventList) + return false; +#undef DO_ +} + +void EventList::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:nvdla_prototest_interface.EventList) + // repeated .nvdla_prototest_interface.Event event = 1; + for (int i = 0; i < this->event_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->event(i), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:nvdla_prototest_interface.EventList) +} + +::google::protobuf::uint8* EventList::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:nvdla_prototest_interface.EventList) + // repeated .nvdla_prototest_interface.Event event = 1; + for (int i = 0; i < this->event_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 1, this->event(i), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:nvdla_prototest_interface.EventList) + return target; +} + +int EventList::ByteSize() const { + int total_size = 0; + + // repeated .nvdla_prototest_interface.Event event = 1; + total_size += 1 * this->event_size(); + for (int i = 0; i < this->event_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->event(i)); + } + + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void EventList::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const EventList* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void EventList::MergeFrom(const EventList& from) { + GOOGLE_CHECK_NE(&from, this); + event_.MergeFrom(from.event_); + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void EventList::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void EventList::CopyFrom(const EventList& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool EventList::IsInitialized() const { + + if (!::google::protobuf::internal::AllAreInitialized(this->event())) return false; + return true; +} + +void EventList::Swap(EventList* other) { + if (other != this) { + event_.Swap(&other->event_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::google::protobuf::Metadata EventList::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = EventList_descriptor_; + metadata.reflection = EventList_reflection_; + return metadata; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int SubmitSlot::kTaskIdFieldNumber; +#endif // !_MSC_VER + +SubmitSlot::SubmitSlot() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:nvdla_prototest_interface.SubmitSlot) +} + +void SubmitSlot::InitAsDefaultInstance() { +} + +SubmitSlot::SubmitSlot(const SubmitSlot& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:nvdla_prototest_interface.SubmitSlot) +} + +void SubmitSlot::SharedCtor() { + _cached_size_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +SubmitSlot::~SubmitSlot() { + // @@protoc_insertion_point(destructor:nvdla_prototest_interface.SubmitSlot) + SharedDtor(); +} + +void SubmitSlot::SharedDtor() { + if (this != default_instance_) { + } +} + +void SubmitSlot::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* SubmitSlot::descriptor() { + protobuf_AssignDescriptorsOnce(); + return SubmitSlot_descriptor_; +} + +const SubmitSlot& SubmitSlot::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_DlaPrototestInterface_2eproto(); + return *default_instance_; +} + +SubmitSlot* SubmitSlot::default_instance_ = NULL; + +SubmitSlot* SubmitSlot::New() const { + return new SubmitSlot; +} + +void SubmitSlot::Clear() { + task_id_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool SubmitSlot::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:nvdla_prototest_interface.SubmitSlot) + 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 task_id = 1; + case 1: { + if (tag == 8) { + parse_task_id: + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + 1, 8, input, this->mutable_task_id()))); + } else if (tag == 10) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, this->mutable_task_id()))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(8)) goto parse_task_id; + 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:nvdla_prototest_interface.SubmitSlot) + return true; +failure: + // @@protoc_insertion_point(parse_failure:nvdla_prototest_interface.SubmitSlot) + return false; +#undef DO_ +} + +void SubmitSlot::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:nvdla_prototest_interface.SubmitSlot) + // repeated uint32 task_id = 1; + for (int i = 0; i < this->task_id_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32( + 1, this->task_id(i), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:nvdla_prototest_interface.SubmitSlot) +} + +::google::protobuf::uint8* SubmitSlot::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:nvdla_prototest_interface.SubmitSlot) + // repeated uint32 task_id = 1; + for (int i = 0; i < this->task_id_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteUInt32ToArray(1, this->task_id(i), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:nvdla_prototest_interface.SubmitSlot) + return target; +} + +int SubmitSlot::ByteSize() const { + int total_size = 0; + + // repeated uint32 task_id = 1; + { + int data_size = 0; + for (int i = 0; i < this->task_id_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->task_id(i)); + } + total_size += 1 * this->task_id_size() + data_size; + } + + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void SubmitSlot::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const SubmitSlot* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void SubmitSlot::MergeFrom(const SubmitSlot& from) { + GOOGLE_CHECK_NE(&from, this); + task_id_.MergeFrom(from.task_id_); + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void SubmitSlot::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void SubmitSlot::CopyFrom(const SubmitSlot& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool SubmitSlot::IsInitialized() const { + + return true; +} + +void SubmitSlot::Swap(SubmitSlot* other) { + if (other != this) { + task_id_.Swap(&other->task_id_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::google::protobuf::Metadata SubmitSlot::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = SubmitSlot_descriptor_; + metadata.reflection = SubmitSlot_reflection_; + return metadata; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int TestInfo::kNumTasksFieldNumber; +const int TestInfo::kNumBuffersFieldNumber; +const int TestInfo::kTaskFieldNumber; +const int TestInfo::kEventListFieldNumber; +const int TestInfo::kSlotsFieldNumber; +#endif // !_MSC_VER + +TestInfo::TestInfo() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:nvdla_prototest_interface.TestInfo) +} + +void TestInfo::InitAsDefaultInstance() { + event_list_ = const_cast< ::nvdla_prototest_interface::EventList*>(&::nvdla_prototest_interface::EventList::default_instance()); +} + +TestInfo::TestInfo(const TestInfo& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:nvdla_prototest_interface.TestInfo) +} + +void TestInfo::SharedCtor() { + _cached_size_ = 0; + num_tasks_ = 0u; + num_buffers_ = 0u; + event_list_ = NULL; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +TestInfo::~TestInfo() { + // @@protoc_insertion_point(destructor:nvdla_prototest_interface.TestInfo) + SharedDtor(); +} + +void TestInfo::SharedDtor() { + if (this != default_instance_) { + delete event_list_; + } +} + +void TestInfo::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* TestInfo::descriptor() { + protobuf_AssignDescriptorsOnce(); + return TestInfo_descriptor_; +} + +const TestInfo& TestInfo::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_DlaPrototestInterface_2eproto(); + return *default_instance_; +} + +TestInfo* TestInfo::default_instance_ = NULL; + +TestInfo* TestInfo::New() const { + return new TestInfo; +} + +void TestInfo::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 11) { + ZR_(num_tasks_, num_buffers_); + if (has_event_list()) { + if (event_list_ != NULL) event_list_->::nvdla_prototest_interface::EventList::Clear(); + } + } + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + task_.Clear(); + slots_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool TestInfo::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:nvdla_prototest_interface.TestInfo) + 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)) { + // required uint32 num_tasks = 1; + case 1: { + if (tag == 8) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &num_tasks_))); + set_has_num_tasks(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_num_buffers; + break; + } + + // required uint32 num_buffers = 2; + case 2: { + if (tag == 16) { + parse_num_buffers: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &num_buffers_))); + set_has_num_buffers(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_task; + break; + } + + // repeated .nvdla_prototest_interface.TasksData task = 3; + case 3: { + if (tag == 26) { + parse_task: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_task())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_task; + if (input->ExpectTag(34)) goto parse_event_list; + break; + } + + // optional .nvdla_prototest_interface.EventList event_list = 4; + case 4: { + if (tag == 34) { + parse_event_list: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_event_list())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(42)) goto parse_slots; + break; + } + + // repeated .nvdla_prototest_interface.SubmitSlot slots = 5; + case 5: { + if (tag == 42) { + parse_slots: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_slots())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(42)) goto parse_slots; + 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:nvdla_prototest_interface.TestInfo) + return true; +failure: + // @@protoc_insertion_point(parse_failure:nvdla_prototest_interface.TestInfo) + return false; +#undef DO_ +} + +void TestInfo::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:nvdla_prototest_interface.TestInfo) + // required uint32 num_tasks = 1; + if (has_num_tasks()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->num_tasks(), output); + } + + // required uint32 num_buffers = 2; + if (has_num_buffers()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->num_buffers(), output); + } + + // repeated .nvdla_prototest_interface.TasksData task = 3; + for (int i = 0; i < this->task_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, this->task(i), output); + } + + // optional .nvdla_prototest_interface.EventList event_list = 4; + if (has_event_list()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, this->event_list(), output); + } + + // repeated .nvdla_prototest_interface.SubmitSlot slots = 5; + for (int i = 0; i < this->slots_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 5, this->slots(i), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:nvdla_prototest_interface.TestInfo) +} + +::google::protobuf::uint8* TestInfo::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:nvdla_prototest_interface.TestInfo) + // required uint32 num_tasks = 1; + if (has_num_tasks()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->num_tasks(), target); + } + + // required uint32 num_buffers = 2; + if (has_num_buffers()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->num_buffers(), target); + } + + // repeated .nvdla_prototest_interface.TasksData task = 3; + for (int i = 0; i < this->task_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 3, this->task(i), target); + } + + // optional .nvdla_prototest_interface.EventList event_list = 4; + if (has_event_list()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 4, this->event_list(), target); + } + + // repeated .nvdla_prototest_interface.SubmitSlot slots = 5; + for (int i = 0; i < this->slots_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 5, this->slots(i), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:nvdla_prototest_interface.TestInfo) + return target; +} + +int TestInfo::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // required uint32 num_tasks = 1; + if (has_num_tasks()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->num_tasks()); + } + + // required uint32 num_buffers = 2; + if (has_num_buffers()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->num_buffers()); + } + + // optional .nvdla_prototest_interface.EventList event_list = 4; + if (has_event_list()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->event_list()); + } + + } + // repeated .nvdla_prototest_interface.TasksData task = 3; + total_size += 1 * this->task_size(); + for (int i = 0; i < this->task_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->task(i)); + } + + // repeated .nvdla_prototest_interface.SubmitSlot slots = 5; + total_size += 1 * this->slots_size(); + for (int i = 0; i < this->slots_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->slots(i)); + } + + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void TestInfo::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const TestInfo* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void TestInfo::MergeFrom(const TestInfo& from) { + GOOGLE_CHECK_NE(&from, this); + task_.MergeFrom(from.task_); + slots_.MergeFrom(from.slots_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_num_tasks()) { + set_num_tasks(from.num_tasks()); + } + if (from.has_num_buffers()) { + set_num_buffers(from.num_buffers()); + } + if (from.has_event_list()) { + mutable_event_list()->::nvdla_prototest_interface::EventList::MergeFrom(from.event_list()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void TestInfo::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void TestInfo::CopyFrom(const TestInfo& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool TestInfo::IsInitialized() const { + if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false; + + if (!::google::protobuf::internal::AllAreInitialized(this->task())) return false; + if (has_event_list()) { + if (!this->event_list().IsInitialized()) return false; + } + return true; +} + +void TestInfo::Swap(TestInfo* other) { + if (other != this) { + std::swap(num_tasks_, other->num_tasks_); + std::swap(num_buffers_, other->num_buffers_); + task_.Swap(&other->task_); + std::swap(event_list_, other->event_list_); + slots_.Swap(&other->slots_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::google::protobuf::Metadata TestInfo::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = TestInfo_descriptor_; + metadata.reflection = TestInfo_reflection_; + return metadata; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int Test::kTestFieldNumber; +#endif // !_MSC_VER + +Test::Test() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:nvdla_prototest_interface.Test) +} + +void Test::InitAsDefaultInstance() { + test_ = const_cast< ::nvdla_prototest_interface::TestInfo*>(&::nvdla_prototest_interface::TestInfo::default_instance()); +} + +Test::Test(const Test& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:nvdla_prototest_interface.Test) +} + +void Test::SharedCtor() { + _cached_size_ = 0; + test_ = NULL; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +Test::~Test() { + // @@protoc_insertion_point(destructor:nvdla_prototest_interface.Test) + SharedDtor(); +} + +void Test::SharedDtor() { + if (this != default_instance_) { + delete test_; + } +} + +void Test::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* Test::descriptor() { + protobuf_AssignDescriptorsOnce(); + return Test_descriptor_; +} + +const Test& Test::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_DlaPrototestInterface_2eproto(); + return *default_instance_; +} + +Test* Test::default_instance_ = NULL; + +Test* Test::New() const { + return new Test; +} + +void Test::Clear() { + if (has_test()) { + if (test_ != NULL) test_->::nvdla_prototest_interface::TestInfo::Clear(); + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool Test::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:nvdla_prototest_interface.Test) + 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)) { + // required .nvdla_prototest_interface.TestInfo test = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_test())); + } 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:nvdla_prototest_interface.Test) + return true; +failure: + // @@protoc_insertion_point(parse_failure:nvdla_prototest_interface.Test) + return false; +#undef DO_ +} + +void Test::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:nvdla_prototest_interface.Test) + // required .nvdla_prototest_interface.TestInfo test = 1; + if (has_test()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->test(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:nvdla_prototest_interface.Test) +} + +::google::protobuf::uint8* Test::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:nvdla_prototest_interface.Test) + // required .nvdla_prototest_interface.TestInfo test = 1; + if (has_test()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 1, this->test(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:nvdla_prototest_interface.Test) + return target; +} + +int Test::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // required .nvdla_prototest_interface.TestInfo test = 1; + if (has_test()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->test()); + } + + } + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void Test::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const Test* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void Test::MergeFrom(const Test& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_test()) { + mutable_test()->::nvdla_prototest_interface::TestInfo::MergeFrom(from.test()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void Test::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Test::CopyFrom(const Test& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Test::IsInitialized() const { + if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false; + + if (has_test()) { + if (!this->test().IsInitialized()) return false; + } + return true; +} + +void Test::Swap(Test* other) { + if (other != this) { + std::swap(test_, other->test_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::google::protobuf::Metadata Test::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = Test_descriptor_; + metadata.reflection = Test_reflection_; + return metadata; +} + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace nvdla_prototest_interface + +// @@protoc_insertion_point(global_scope) diff --git a/umd/core/src/compiler/Layer.cpp b/umd/core/src/compiler/Layer.cpp new file mode 100644 index 00000000..6000989f --- /dev/null +++ b/umd/core/src/compiler/Layer.cpp @@ -0,0 +1,2047 @@ +/* + * Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#include + +#include "priv/Type.h" + +#include "priv/Network.h" +#include "priv/Layer.h" +#include "priv/Check.h" + +#include "priv/Wisdom.h" +#include "priv/WisdomContainer.h" + +#include + +using std::stringstream; +using std::string; +using std::endl; + +namespace nvdla { + +ILayer::ILayer() { } +ILayer::~ILayer() { } +IConvolutionLayer::~IConvolutionLayer() { } +IFullyConnectedLayer::~IFullyConnectedLayer() { } +IActivationLayer::~IActivationLayer() { } +IPoolingLayer::~IPoolingLayer() { } +ILRNLayer::~ILRNLayer() { } +IScaleLayer::~IScaleLayer() { } +IBatchNormLayer::~IBatchNormLayer() { } +ISoftMaxLayer::~ISoftMaxLayer() { } +IConcatenationLayer::~IConcatenationLayer() { } +ISliceLayer::~ISliceLayer() { } +IDeconvolutionLayer::~IDeconvolutionLayer() { } +IElementWiseLayer::~IElementWiseLayer() { } + +namespace priv { + + +ENUM_PARAMETER_STATIC(LayerTypeEnum, LAYER_FACTORY_TYPE_ENUMS, "LayerTypeEnum") + +//---------------------------------------------------------------------- +// Layer Factory +//---------------------------------------------------------------------- +//! +//! Layers have two sorts of data which need to be deserialized. +//! The first are simple numeric or enumerant parameters. The second, +//! more complicated case are the Tensor references: the inputs and outputs. +//! The inputs and outputs are serialized as symbols which are read +//! back here and looked up in the Wisdom. +//! +ILayer *LayerFactory::deserializeFrom(WisdomContainerEntry *entry) +{ + bool ok = false; + ILayer *layer = NULL; + NvU32 v; + WisdomContainerEntry l_type_entry; + + LayerTypeEnum l_type; + + if ( entry->type() != IWisdomContainerEntry::ENTRY_TYPE_OBJECT ) { + goto done; + } + + ok = entry->getEntry("factory_type", IWisdomContainerEntry::ENTRY_TYPE_UINT32, &l_type_entry); + + ok = ok && l_type_entry.readUInt32(v); + if ( !ok ) { + gLogError << __func__ << " no factory type entry" << endl; + goto done; + } + l_type = LayerTypeEnum::underlying_type(v); + + ok = l_type.valid(); + if ( !ok ) { + gLogError << __func__ << " invalid factory type entry" << endl; + goto done; + } + + switch ( l_type.e() ) + { + case LayerFactoryType::CONVOLUTION: + layer = deserializeLayer(entry); + break; + case LayerFactoryType::FULLY_CONNECTED: + layer = deserializeLayer(entry); + break; + case LayerFactoryType::ACTIVATION: + layer = deserializeLayer(entry); + break; + case LayerFactoryType::POOLING: + layer = deserializeLayer(entry); + break; + case LayerFactoryType::LRN: + layer = deserializeLayer(entry); + break; + case LayerFactoryType::SCALE: + layer = deserializeLayer(entry); + break; + case LayerFactoryType::BATCH_NORM: + layer = deserializeLayer(entry); + break; + case LayerFactoryType::SOFT_MAX: + layer = deserializeLayer(entry); + break; + case LayerFactoryType::CONCATENATION: + layer = deserializeLayer(entry); + break; + case LayerFactoryType::DECONVOLUTION: + layer = deserializeLayer(entry); + break; + case LayerFactoryType::ELEMENT_WISE : + layer = deserializeLayer(entry); + break; + + default: + // but, shouldn't be possible since l_type.valid() is true... + // ok = false; + goto done; + } + + done: + return layer; + +} + +template +class BasePrivDiamondMap +{ +public: + static void insert(D p) + { + s_base_priv_diamond_map[p.base().priv()] = p; + } + static D find(typename D::BasePrivType *base_priv) + { + typename std::map::iterator f = + s_base_priv_diamond_map.find(base_priv); + if ( f == s_base_priv_diamond_map.end() ) { + return D(0, 0, 0, 0); + } + return f->second; + } +protected: + static std::map s_base_priv_diamond_map; +}; + + +template +typename D::DerivedPrivType * LayerFactory::derivedPriv(typename D::BasePrivType *base_priv) +{ + D d = BasePrivDiamondMap::find(base_priv); + return d.derived().priv(); +} + +template D LayerFactory::newLayer() +{ + typename D::BaseInterfaceType *base_i; typename D::BasePrivType *base_priv; + typename D::DerivedInterfaceType *derived_i; typename D::DerivedPrivType *derived_priv; + + base_priv = derived_priv = new typename D::DerivedPrivType(); + base_i = derived_i = derived_priv; + + D d(base_i, base_priv, derived_i, derived_priv); + + BasePrivDiamondMap::insert(d); + + s_priv.insert(base_i, base_priv); + s_self.insert(base_i, base_i); + + return d; +} + +template +typename D::BaseInterfaceType * LayerFactory::deserializeLayer(WisdomContainerEntry *e) +{ + D conv = LayerFactory::newLayer(); + if ( !conv ) { + gLogError << __func__ << " base i NULL!" << endl; + return NULL; + } + conv.derived().priv()->deserializeFrom(e); + return conv.base().i(); +} + +//! +//! Factories implement a poor-man's replacement for dynamic (priv down) casting. +//! MISRA's ok with legit uses of dynamic_cast but we've decided to avoid RTTI, so... +//! +//! note: concurrent access to map is... well, whatever std::map allows. +//! + +BiMap LayerFactory::s_priv; +BiMap LayerFactory::s_self; + +Layer *LayerFactory::priv(ILayer *layer) +{ + // gLogError << __func__ << " looking up priv for base_i=" << layer << endl; + BiMap::left_iterator f = s_priv.find_left(layer); + if ( f == s_priv.end_left() ) { + return NULL; + } + return f->second; +} + +ILayer *LayerFactory::i(Layer *layer) +{ + BiMap::right_iterator f = s_priv.find_right(layer); + if ( f == s_priv.end_right() ) { + return NULL; + } + return f->second; +} + +ILayer *LayerFactory::self(void *s) +{ + BiMap::left_iterator f = s_self.find_left(s); + if ( f == s_self.end_left() ) { + return NULL; + } + return f->second; +} + +ConvolutionLayerDiamond +LayerFactory::newConvolutionLayer(INetwork * network, + const std::string & name, + ITensor * input, + ITensor * output, + int numOutputMaps, + int paddingValue, + Dims2 kernelSize, + Dims2 tlPadding, + Dims2 brPadding, + Dims2 stride, + Dims2 dilation, + Weights kernelWeights, + Weights biasWeights, + BiasMode biasMode, + int numGroups) +{ + ILayer *base_i; Layer *base_priv; + IConvolutionLayer *derived_i; ConvolutionLayer *derived_priv; + + base_priv = derived_priv = new ConvolutionLayer(network, name, + input, output, + numOutputMaps, paddingValue, + kernelSize, tlPadding, brPadding, stride, dilation, + kernelWeights, biasWeights, biasMode, numGroups); + base_i = derived_i = derived_priv; + ConvolutionLayerDiamond d(base_i, base_priv, derived_i, derived_priv); + BasePrivDiamondMap::insert( d ); + s_priv.insert(base_i, base_priv); + s_self.insert(base_i, base_i); + return d; + +} + +FullyConnectedLayerDiamond +LayerFactory::newFullyConnectedLayer(INetwork* network, + const std::string& name, + ITensor* input, + ITensor* output, + int numOutputChannels, + Weights kernelWeights, + Weights biasWeights, + BiasMode biasMode) +{ + ILayer *base_i; Layer *base_priv; + IFullyConnectedLayer *derived_i; FullyConnectedLayer *derived_priv; + + + base_priv = derived_priv = new FullyConnectedLayer(network, name, + input, output, + numOutputChannels, + kernelWeights, biasWeights, biasMode); + base_i = derived_i = derived_priv; + FullyConnectedLayerDiamond d(base_i, base_priv, derived_i, derived_priv); + BasePrivDiamondMap::insert( d ); + s_priv.insert(base_i, base_priv); + s_self.insert(base_i, base_i); + return d; + +} + +ActivationLayerDiamond +LayerFactory::newActivationLayer(INetwork* network, + const std::string& name, + ITensor* input, + ITensor* output, + ActivationType activationType) +{ + ILayer *base_i; Layer *base_priv; + IActivationLayer *derived_i; ActivationLayer *derived_priv; + + base_priv = derived_priv = new ActivationLayer(network, name, input, output, activationType); + base_i = derived_i = derived_priv; + ActivationLayerDiamond d(base_i, base_priv, derived_i, derived_priv); + BasePrivDiamondMap::insert( d ); + s_priv.insert(base_i, base_priv); + s_self.insert(base_i, base_i); + return d; +} + +PoolingLayerDiamond +LayerFactory::newPoolingLayer(INetwork* network, + const std::string& name, + ITensor* input, + ITensor* output, + PoolingType type, + Dims2 windowSize, + Dims2 stride, + Dims2 tlPadding, + Dims2 brPadding) +{ + ILayer *base_i; Layer *base_priv; + IPoolingLayer *derived_i; PoolingLayer *derived_priv; + + base_priv = derived_priv = new PoolingLayer(network, name, input, output, + type, windowSize, stride, tlPadding, brPadding); + base_i = derived_i = derived_priv; + PoolingLayerDiamond d(base_i, base_priv, derived_i, derived_priv); + BasePrivDiamondMap::insert( d ); + s_priv.insert(base_i, base_priv); + s_self.insert(base_i, base_i); + return d; +} + +LRNLayerDiamond +LayerFactory::newLRNLayer(INetwork* network, + const std::string& name, + ITensor* input, + ITensor* output, + int windowSize, + float alpha, + float beta, + float k) +{ + ILayer *base_i; Layer *base_priv; + ILRNLayer *derived_i; LRNLayer *derived_priv; + + base_priv = derived_priv = new LRNLayer(network, name, input, output, + windowSize, alpha, beta, k); + base_i = derived_i = derived_priv; + LRNLayerDiamond d(base_i, base_priv, derived_i, derived_priv); + BasePrivDiamondMap::insert( d ); + s_priv.insert(base_i, base_priv); + s_self.insert(base_i, base_i); + return d; +} + +ScaleLayerDiamond +LayerFactory::newScaleLayer(INetwork* network, + const std::string& name, + ITensor* input, + ITensor* output, + ScaleMode mode, + Weights shift, + Weights scale, + Weights power) +{ + ILayer *base_i; Layer *base_priv; + IScaleLayer *derived_i; ScaleLayer *derived_priv; + + base_priv = derived_priv = new ScaleLayer(network, name, input, output, + mode, shift, scale, power); + base_i = derived_i = derived_priv; + ScaleLayerDiamond d(base_i, base_priv, derived_i, derived_priv); + BasePrivDiamondMap::insert( d ); + s_priv.insert(base_i, base_priv); + s_self.insert(base_i, base_i); + return d; +} + +BatchNormLayerDiamond +LayerFactory::newBatchNormLayer(INetwork* network, + const std::string& name, + ITensor* input, + ITensor* output, + BatchNormMode mode, + Weights mean, + Weights variance, + float eps) +{ + ILayer *base_i; Layer *base_priv; + IBatchNormLayer *derived_i; BatchNormLayer *derived_priv; + + base_priv = derived_priv = new BatchNormLayer(network, name, input, output, + mode, mean, variance, eps); + base_i = derived_i = derived_priv; + BatchNormLayerDiamond d(base_i, base_priv, derived_i, derived_priv); + BasePrivDiamondMap::insert(d); + s_priv.insert(base_i, base_priv); + s_self.insert(base_i, base_i); + return d; +} + +SoftMaxLayerDiamond +LayerFactory::newSoftMaxLayer(INetwork* network, + const std::string& name, + ITensor* input, + ITensor* output) +{ + ILayer *base_i; Layer *base_priv; + ISoftMaxLayer *derived_i; SoftMaxLayer *derived_priv; + + base_priv = derived_priv = new SoftMaxLayer(network, name, input, output); + base_i = derived_i = derived_priv; + SoftMaxLayerDiamond d(base_i, base_priv, derived_i, derived_priv); + BasePrivDiamondMap::insert( d ); + s_priv.insert(base_i, base_priv); + s_self.insert(base_i, base_i); + return d; +} + +ConcatenationLayerDiamond +LayerFactory::newConcatenationLayer(INetwork* network, + const std::string& name, + ITensor*const * inputs, + int numInputs, + ITensor* output) +{ + ILayer *base_i; Layer *base_priv; + IConcatenationLayer *derived_i; ConcatenationLayer *derived_priv; + + base_priv = derived_priv = new ConcatenationLayer(network, name, inputs, numInputs, output); + base_i = derived_i = derived_priv; + ConcatenationLayerDiamond d(base_i, base_priv, derived_i, derived_priv); + BasePrivDiamondMap::insert( d ); + s_priv.insert(base_i, base_priv); + s_self.insert(base_i, base_i); + return d; +} + +SliceLayerDiamond +LayerFactory::newSliceLayer(INetwork* network, + const std::string& name, + ITensor* input, + ITensor* const* outputs, + int numOutputs) +{ + ILayer *base_i; Layer *base_priv; + ISliceLayer *derived_i; SliceLayer *derived_priv; + + base_priv = derived_priv = new SliceLayer(network, name, input, outputs, numOutputs); + base_i = derived_i = derived_priv; + SliceLayerDiamond d(base_i, base_priv, derived_i, derived_priv); + BasePrivDiamondMap::insert( d ); + s_priv.insert(base_i, base_priv); + s_self.insert(base_i, base_i); + return d; +} + +DeconvolutionLayerDiamond +LayerFactory::newDeconvolutionLayer(INetwork* network, + const std::string& name, + ITensor* input, + ITensor* output, + int numOutputMaps, + int paddingValue, + Dims2 kernelSize, + Dims2 tlPadding, + Dims2 brPadding, + Dims2 stride, + Dims2 dilation, + Weights kernelWeights, + Weights biasWeights, + BiasMode biasMode, + int numGroups) +{ + ILayer *base_i; Layer *base_priv; + IDeconvolutionLayer *derived_i; DeconvolutionLayer *derived_priv; + + base_priv = derived_priv = new DeconvolutionLayer(network, name, + input, output, + numOutputMaps, paddingValue, + kernelSize, tlPadding, brPadding, stride, dilation, + kernelWeights, biasWeights, biasMode, numGroups); + base_i = derived_i = derived_priv; + DeconvolutionLayerDiamond d(base_i, base_priv, derived_i, derived_priv); + BasePrivDiamondMap::insert( d ); + s_priv.insert(base_i, base_priv); + s_self.insert(base_i, base_i); + return d; +} + +ElementWiseLayerDiamond +LayerFactory::newElementWiseLayer(INetwork* network, + const std::string& name, + ITensor*const *inputs, + ITensor* output, + ElementWiseOperation op) +{ + ILayer *base_i; Layer *base_priv; + IElementWiseLayer *derived_i; ElementWiseLayer *derived_priv; + + base_priv = derived_priv = new ElementWiseLayer(network, name, inputs, output, op); + base_i = derived_i = derived_priv; + ElementWiseLayerDiamond d(base_i, base_priv, derived_i, derived_priv); + BasePrivDiamondMap::insert( d ); + s_priv.insert(base_i, base_priv); + s_self.insert(base_i, base_i); + return d; +} + + +//---------------------------------------------------------------------- +// Layer +//---------------------------------------------------------------------- + +Layer::Layer(INetwork *n, LayerType type, + const std::string& name, + ITensor* input, + ITensor* output) : + mNetwork(n), mType(type), mName(name) +{ + mInputs.push_back(input); + mOutputs.push_back(output); +} + +Layer::Layer(INetwork* n, LayerType type, + const std::string& name, + ITensor*const * inputs, + int numInputs, + ITensor*const * outputs, + int numOutputs) + : mNetwork(n), mType(type), mName(name) +{ + for (int i = 0; i < numInputs; i++) + mInputs.push_back(inputs[i]); + for (int i = 0; i < numOutputs; i++) + mOutputs.push_back(outputs[i]); +} + +Layer::~Layer() +{ + +} + +bool Layer::deserializeFrom(WisdomContainerEntry *entry) +{ + bool ok = true; + std::string name; + + WisdomContainerEntry name_entry; + WisdomContainerEntry num_inputs_entry, num_outputs_entry; + WisdomContainerEntry inputs_entry, outputs_entry; + NvU32 num_inputs, num_outputs; + std::vector inputs; + std::vector outputs; + + + ok = ok && entry->getEntry("name", IWisdomContainerEntry::ENTRY_TYPE_STRING, &name_entry); + ok = ok && entry->getEntry("num_inputs", IWisdomContainerEntry::ENTRY_TYPE_UINT32, &num_inputs_entry); + ok = ok && entry->getEntry("num_outputs", IWisdomContainerEntry::ENTRY_TYPE_UINT32, &num_outputs_entry); + + if ( !ok ) { + gLogError << __func__ << " missing name, num_inputs and/or num_outputs entries" << endl; + goto done; + } + + ok = ok && name_entry.readString(name); + ok = ok && num_inputs_entry.readUInt32(num_inputs); + ok = ok && num_outputs_entry.readUInt32(num_outputs); + + if ( !ok ) { + gLogError << __func__ << " missing name, num_inputs and/or num_outputs" << endl; + goto done; + } + + // XXX: need upper limit checks on these... + ok = ok && ( 0 < num_inputs && 0 < num_outputs ); + + if ( !ok ) { + gLogError << __func__ << " missing in or outputs" << endl; + goto done; + } + + setName(name.c_str()); + inputs.resize(num_inputs, NULL); + outputs.resize(num_outputs, NULL); + + + ok = ok && entry->getEntry(string("inputs"), IWisdomContainerEntry::ENTRY_TYPE_OBJECT, &inputs_entry); + ok = ok && entry->getEntry(string("outputs"), IWisdomContainerEntry::ENTRY_TYPE_OBJECT, &outputs_entry); + if ( !ok ) { + gLogError << __func__ << " failed to get inputs and outputs entries" << endl; + goto done; + } + + + for (size_t i = 0; ok && (i < num_inputs); i++ ) { + string symbol; + WisdomContainerEntry tensor_index_entry; + string tensor_symbol; + ok = ok && inputs_entry.getEntry(toString(i), + IWisdomContainerEntry::ENTRY_TYPE_STRING, + &tensor_index_entry); + ok = ok && tensor_index_entry.readString(tensor_symbol); + if ( !ok ) { + gLogError << __func__ << " couldn't read (input) tensor index symbol string? " << toString(i) << endl; + break; + } + ITensor *t = entry->container_priv()->wisdom_priv()->getTensorFromSymbol(tensor_symbol); + ok = (NULL != t); + if ( !ok ) { + gLogError << "couldn't get (input) tensor from symbol=[" << tensor_symbol << "]" << endl; + } else { + setInput(i, t); + } + } + + for (size_t o = 0; ok && o < num_outputs; o++ ) { + string symbol; + WisdomContainerEntry tensor_index_entry; + string tensor_symbol; + ok = ok && outputs_entry.getEntry(toString(o), + IWisdomContainerEntry::ENTRY_TYPE_STRING, + &tensor_index_entry); + ok = ok && tensor_index_entry.readString(tensor_symbol); + if ( !ok ) { + gLogError << __func__ << " couldn't read (output) tensor index symbol string? " << toString(o) << endl; + break; + } + ITensor *t = entry->container_priv()->wisdom_priv()->getTensorFromSymbol(tensor_symbol); + ok = NULL != t; + if ( !ok ) { + gLogError << "couldn't get (output) tensor from symbol=[" << tensor_symbol << "]" << endl; + } else { + setOutput(o, t); + } + } + + done: + return ok; +} + + +bool Layer::serializeTo(WisdomContainerEntry *e) const +{ + bool ok = true; + // scribble out which tensors were referred to as inputs and outputs. + WisdomContainerEntry factory_type_entry, inputs_entry, outputs_entry; + + ok = ok && e->writeString("name", getName()); + ok = ok && e->writeUInt32("factory_type", getFactoryType()); + ok = ok && e->writeUInt32("num_inputs", getNumInputs()); + ok = ok && e->writeUInt32("num_outputs", getNumOutputs()); + + ok = ok && e->insertEntryIfNotPresent("inputs", IWisdomContainerEntry::ENTRY_TYPE_OBJECT, &inputs_entry); + ok = ok && e->insertEntryIfNotPresent("outputs", IWisdomContainerEntry::ENTRY_TYPE_OBJECT, &outputs_entry); + + for ( size_t i = 0; ok && (i < mInputs.size()); i++ ) { + string sym; + ok = e->container_priv()->wisdom_priv()->findITensorSymbol(getInput(i), sym); + ok = ok && inputs_entry.writeString(toString(i), sym); + } + + for ( size_t o = 0; ok && (o < mOutputs.size()); o++ ) { + string sym; + ok = e->container_priv()->wisdom_priv()->findITensorSymbol(getOutput(o), sym); + ok = ok && outputs_entry.writeString(toString(o), sym); + } + + return ok; +} + + +// +// internally facing Layer:: interfaces +// +std::string Layer::getInputSymbol(int i) const +{ + return mInputSymbols[i]; +} + +std::string Layer::getOutputSymbol(int i) const +{ + return mOutputSymbols[i]; +} + +void Layer::setInput(int i, ITensor *t) +{ + mInputs[i] = t; +} + +void Layer::setOutput(int i, ITensor *t) +{ + mOutputs[i] = t; +} +// Layer is virtual so it has no typeid +#if 0 +NvU16 Layer::getFactoryType() const +{ + return ~0; // only one so far, not complicated by factory splits +} +#endif + +bool Layer::assignSymbols(Wisdom *wisdom) +{ + bool ok = true; + std::string sym; + Tensor *tensor; + std::vectortensors; + + // gLogError << __func__ << " inputs=" << mInputs.size() << " outputs=" << mOutputs.size() << endl; + + // inputs, then outputs + for (size_t i = 0; i < mInputs.size(); i++ ) { + tensor = TensorFactory::priv(mInputs[i]); + ok = NULL != tensor; + if ( !tensor ) { + gLogError << "missing input tensor " << i << " in layer " << mName << endl; + goto done; + } + tensors.push_back(tensor); + } + for (size_t o = 0; o < mOutputs.size(); o++) { + tensor = TensorFactory::priv(mOutputs[o]); + ok = NULL != tensor; + if ( !ok ) { + gLogError << "missing output tensor " << o << " in layer" << mName << endl; + goto done; + } + tensors.push_back(tensor); + } + for (size_t t = 0; t < tensors.size(); t++ ) { + tensor = tensors[t]; + ok = wisdom->findTensorSymbol(tensor, sym); + if ( !ok ) { + ok = wisdom->assignTensorSymbol(tensor, sym); + if ( !ok ) { + gLogError << "unable to assign tensor symbol " << t << " in layer " << mName << endl; + goto done; + } + } + } + + done: + return ok; +} + +// +// externally facing +// + +void Layer::setName(const char* name) +{ + API_CHECK_NULL(name); + mName = name; +} + +const char* Layer::getName() const +{ + return mName.c_str(); +} + +LayerType Layer::getType() const +{ + return mType; +} + +int Layer::getNumInputs() const +{ + return (int)(mInputs.size()); +} + +ITensor* Layer::getInput(int i) const +{ + return (size_t)i < mInputs.size() ? mInputs[i] : 0; +} + +int Layer::getNumOutputs() const +{ + return (int)(mOutputs.size()); +} + +ITensor* Layer::getOutput(int i) const +{ + return (size_t)i < mOutputs.size() ? mOutputs[i] : 0; +} + +void Layer::setKernelSize(Dims2 kernelSize) +{ + NVDLA_UNUSED(kernelSize); +} + +Dims2 Layer::getKernelSize() const +{ + return Dims2(1, 1); +} + +void Layer::setNumOutputMaps(int /*numOutputMaps*/) +{ + +} + +int Layer::getNumOutputMaps() const +{ + return 0; +} + +void Layer::setStride(Dims2 /*stride*/) +{ + +} + +Dims2 Layer::getStride() const +{ + return Dims2(1, 1); +} + +void Layer::setDilation(Dims2 /*dilation*/) +{ + +} + +Dims2 Layer::getDilation() const +{ + return Dims2(1, 1); +} + +void Layer::setTopLeftPadding(Dims2 /*padding*/) +{ + +} + +Dims2 Layer::getTopLeftPadding() const +{ + return Dims2(0, 0); +} + +void Layer::setBottomRightPadding(Dims2 /*padding*/) +{ + +} + +Dims2 Layer::getBottomRightPadding() const +{ + return Dims2(0, 0); +} + +int Layer::getPaddingValue() const +{ + return 0; +} + +void Layer::setPaddingValue(int /*padding*/) +{ + +} + +void Layer::setNumGroups(int /*numGroups*/) +{ + +} + +int Layer::getNumGroups() const +{ + return 0; +} + +void Layer::setKernelWeights(Weights /*weights*/) +{ + +} + +Weights Layer::getKernelWeights() const +{ + return Weights(DataType::FLOAT, NULL, 0); +} + +void Layer::setBiasWeights(Weights /*weights*/) +{ + +} + +Weights Layer::getBiasWeights() const +{ + return Weights(DataType::FLOAT, NULL, 0); +} + +NvDlaError Layer::supportsPrecision(nvdla::DataType prec) +{ + NvDlaError e = NvDlaSuccess; + + if (prec.v() > EnumMax()) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Precision %d is beyond max allowed(%d)\n", + prec.v(), EnumMax()); + } + + switch(prec.v()) + { + case nvdla::DataType::HALF: + case nvdla::DataType::INT8: + break; + default: + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Precision %d is not supported\n", + prec.v()); + } + +fail: + return e; +} + + +//---------------------------------------------------------------------- +// ConvolutionLayer +//---------------------------------------------------------------------- +ConvolutionLayer::ConvolutionLayer() : Layer(NULL, LayerType::kCONVOLUTION, "", NULL, NULL) { } +ConvolutionLayer::ConvolutionLayer(INetwork* network, const std::string& name, + ITensor* input, + ITensor* output, + int numOutputMaps, + Dims2 kernelSize, + Weights kernelWeights, + Weights biasWeights, + BiasMode biasMode, + int numGroups) + : Layer(network, LayerType::kCONVOLUTION, name, input, output) +{ + API_CHECK_NULL(network); + API_CHECK_NULL(input); + API_CHECK_NULL(output); + API_CHECK(numOutputMaps > 0 && numOutputMaps < MAX_OUTPUT_MAPS); + API_CHECK(kernelSize.h > 0 && kernelSize.w > 0 && kernelSize.h*kernelSize.w < MAX_KERNEL_DIMS_PRODUCT); + API_CHECK_WEIGHTS(kernelWeights); + API_CHECK_WEIGHTS0(biasWeights); + API_CHECK_ENUM_RANGE(BiasMode, biasMode); + mParams.kernelSize = kernelSize; + mParams.numOutputMaps = numOutputMaps; + mParams.topLeftPadding = Dims2(0, 0); + mParams.bottomRightPadding = Dims2(0, 0); + mParams.paddingValue = 0; + mParams.stride = Dims2(1, 1); + mParams.kernelWeights = kernelWeights; + mParams.biasWeights = biasWeights; + mParams.biasMode = biasMode; + mParams.numGroups = numGroups; +} +ConvolutionLayer::ConvolutionLayer(INetwork* network, const std::string& name, + ITensor* input, + ITensor* output, + int numOutputMaps, + int paddingValue, + Dims2 kernelSize, + Dims2 tlPadding, + Dims2 brPadding, + Dims2 stride, + Dims2 dilation, + Weights kernelWeights, + Weights biasWeights, + BiasMode biasMode, + int numGroups) + : Layer(network, LayerType::kCONVOLUTION, name, input, output) +{ + API_CHECK_NULL(network); + API_CHECK_NULL(input); + API_CHECK_NULL(output); + API_CHECK(numOutputMaps > 0 && numOutputMaps < MAX_OUTPUT_MAPS); + API_CHECK(kernelSize.h > 0 && kernelSize.w > 0 && kernelSize.h*kernelSize.w < MAX_KERNEL_DIMS_PRODUCT); + API_CHECK_WEIGHTS(kernelWeights); + API_CHECK_WEIGHTS0(biasWeights); + API_CHECK_ENUM_RANGE(BiasMode, biasMode); + mParams.kernelSize = kernelSize; + mParams.numOutputMaps = numOutputMaps; + mParams.topLeftPadding = tlPadding; + mParams.bottomRightPadding = brPadding; + mParams.paddingValue = paddingValue; + mParams.stride = stride; + mParams.dilation = dilation; + mParams.kernelWeights = kernelWeights; + mParams.biasWeights = biasWeights; + mParams.biasMode = biasMode; + mParams.numGroups = numGroups; +} + +ConvolutionLayer::~ConvolutionLayer() { } + +NvU16 ConvolutionLayer::getFactoryType() const +{ + return LayerFactoryType::CONVOLUTION; +} + +bool ConvolutionLayer::serializeTo(WisdomContainerEntry *e) const +{ + bool ok = Layer::serializeTo(e); + ok = ok && e->writeDims2("kernel_size", mParams.kernelSize); + ok = ok && e->writeDims2("top_left_padding", mParams.topLeftPadding); + ok = ok && e->writeDims2("bottom_right_padding", mParams.bottomRightPadding); + ok = ok && e->writeDims2("stride", mParams.stride); + ok = ok && e->writeDims2("dilation", mParams.dilation); + ok = ok && e->writeInt32("num_output_maps", mParams.numOutputMaps); + ok = ok && e->writeInt32("num_groups", mParams.numGroups); + ok = ok && e->writeInt32("padding_value", mParams.paddingValue); + ok = ok && e->writeWeights("kernel_weights", mParams.kernelWeights); + ok = ok && e->writeWeights("bias_weights", mParams.biasWeights); + ok = ok && e->writeUInt8Enum("bias_mode", mParams.biasMode); + ok = ok && e->writeInt32("groups", mParams.numGroups); + return ok; +} + +bool ConvolutionLayer::deserializeFrom(WisdomContainerEntry *e) +{ + NvU8 v = BiasMode::bUNIFORM; + bool ok = Layer::deserializeFrom(e); + ok = ok && e->readDims2("kernel_size", mParams.kernelSize); + ok = ok && e->readDims2("top_left_padding", mParams.topLeftPadding); + ok = ok && e->readDims2("bottom_right_padding", mParams.bottomRightPadding); + ok = ok && e->readDims2("stride", mParams.stride); + ok = ok && e->readDims2("dilation", mParams.dilation); + ok = ok && e->readInt32("num_output_maps", mParams.numOutputMaps); + ok = ok && e->readInt32("num_groups", mParams.numGroups); + ok = ok && e->readInt32("padding_value", mParams.paddingValue); + ok = ok && e->readWeights("kernel_weights", mParams.kernelWeights); + ok = ok && e->readWeights("bias_weights", mParams.biasWeights); + ok = ok && e->readUInt8Enum("bias_mode", v); + ok = ok && e->readInt32("groups", mParams.numGroups); + mParams.biasMode = BiasMode(v); + + return ok; +} + +#define CurrentScope ConvolutionLayer + +ACCESSOR_MUTATOR_CHECK_EXPR(Dims2, kernelSize, KernelSize, + (kernelSize.h > 0 && kernelSize.w > 0 && + kernelSize.h*kernelSize.w < MAX_KERNEL_DIMS_PRODUCT) ) +ACCESSOR_MUTATOR_CHECK_EXPR(Dims2, topLeftPadding, TopLeftPadding, + (topLeftPadding.h >= 0 && topLeftPadding.w >= 0 && + topLeftPadding.h + topLeftPadding.w < MAX_PADDING_SUM) ) +ACCESSOR_MUTATOR_CHECK_EXPR(Dims2, bottomRightPadding, BottomRightPadding, + (bottomRightPadding.h >= 0 && bottomRightPadding.w >= 0 && + bottomRightPadding.h + bottomRightPadding.w < MAX_PADDING_SUM) ) +ACCESSOR_MUTATOR_CHECK_EXPR(Dims2, stride, Stride, + (stride.h > 0 && stride.w > 0 && + stride.h + stride.w < MAX_STRIDE_SUM) ) +ACCESSOR_MUTATOR_CHECK_EXPR(Dims2, dilation, Dilation, + (dilation.h > 0 && dilation.w > 0 && + dilation.h + dilation.w < MAX_DILATION_SUM) ) +ACCESSOR_MUTATOR_CHECK_EXPR(int, paddingValue, PaddingValue, + (paddingValue >= 0 && paddingValue < MAX_PADDING_VALUE) ) +ACCESSOR_MUTATOR_CHECK_EXPR(int, numGroups, NumGroups, + (numGroups > 0 && numGroups < MAX_GROUPS) ) +ACCESSOR_MUTATOR_CHECK_EXPR(int, numOutputMaps, NumOutputMaps, + (numOutputMaps > 0 && numOutputMaps < MAX_OUTPUT_MAPS) ) +ACCESSOR_MUTATOR_CHECK_ENUM(BiasMode, biasMode, BiasMode) +ACCESSOR_MUTATOR_WEIGHTS(Weights, kernelWeights, KernelWeights) +ACCESSOR_MUTATOR_WEIGHTS(Weights, biasWeights, BiasWeights) +#undef CurrentScope + + +Dims4 ConvolutionLayer::getOutputDimensions() const +{ + Dims4 inputDims = mInputs[0]->getDimensions(); + // assert(inputDims.c > 0 && inputDims.h > 0 && inputDims.w > 0); + Dims2 cd = mNetwork->getConvolutionOutputDimensionsFormula(). + compute(Dims2(inputDims.h, inputDims.w), + mParams.kernelSize, mParams.stride, mParams.topLeftPadding, mParams.bottomRightPadding, mParams.dilation, getName()); + return Dims4(mParams.numOutputMaps, cd.h, cd.w); +} + +const ConvolutionLayer::Parameters& ConvolutionLayer::getParams() const +{ + return mParams; +} + +//---------------------------------------------------------------------- +// FullyConnectedLayer +//---------------------------------------------------------------------- +FullyConnectedLayer::FullyConnectedLayer() : Layer(NULL, LayerType::kFULLY_CONNECTED, "", NULL, NULL) { } +FullyConnectedLayer::FullyConnectedLayer(INetwork* network, + const std::string& name, + ITensor* input, + ITensor* output, + int numOutputChannels, + Weights kernelWeights, + Weights biasWeights, + BiasMode biasMode) : + Layer(network, LayerType::kFULLY_CONNECTED, name, input, output) +{ + API_CHECK_NULL(network); + API_CHECK_NULL(input); + API_CHECK_NULL(output); + API_CHECK(numOutputChannels > 0 && numOutputChannels < MAX_OUTPUT_MAPS); + API_CHECK_WEIGHTS(kernelWeights); + API_CHECK_WEIGHTS0(biasWeights); + API_CHECK_ENUM_RANGE(BiasMode, biasMode); + mParams.numOutputChannels = numOutputChannels; + mParams.kernelWeights = kernelWeights; + mParams.biasWeights = biasWeights; + mParams.biasMode = biasMode; +} + +bool FullyConnectedLayer::serializeTo(WisdomContainerEntry *e) const +{ + bool ok = Layer::serializeTo(e); + ok = ok && e->writeWeights("kernel_weights", mParams.kernelWeights); + ok = ok && e->writeWeights("bias_weights", mParams.biasWeights); + ok = ok && e->writeUInt8Enum("bias_mode", mParams.biasMode); + return ok; +} + +bool FullyConnectedLayer::deserializeFrom(WisdomContainerEntry *e) +{ + NvU8 v = BiasMode::bUNIFORM; + bool ok = Layer::deserializeFrom(e); + ok = ok && e->readWeights("kernel_weights", mParams.kernelWeights); + ok = ok && e->readWeights("bias_weights", mParams.biasWeights); + ok = ok && e->readUInt8Enum("bias_mode", v); + mParams.biasMode = BiasMode(v); + return ok; +} + +NvU16 FullyConnectedLayer::getFactoryType() const +{ + return LayerFactoryType::FULLY_CONNECTED; +} + + +#define CurrentScope FullyConnectedLayer +ACCESSOR_MUTATOR_CHECK_EXPR(Dims2, kernelSize, KernelSize, + (kernelSize.h > 0 && kernelSize.w > 0 && + kernelSize.h*kernelSize.w < MAX_KERNEL_DIMS_PRODUCT) ) +ACCESSOR_MUTATOR_CHECK_EXPR(int, numOutputChannels, NumOutputChannels, + (numOutputChannels > 0 && numOutputChannels < MAX_OUTPUT_MAPS) ); +ACCESSOR_MUTATOR_CHECK_ENUM(BiasMode, biasMode, BiasMode); +ACCESSOR_MUTATOR_WEIGHTS(Weights, kernelWeights, KernelWeights) +ACCESSOR_MUTATOR_WEIGHTS(Weights, biasWeights, BiasWeights) +#undef CurrentScope + +Dims4 FullyConnectedLayer::getOutputDimensions() const +{ + return Dims4(mParams.numOutputChannels, 1, 1); +} + +const FullyConnectedLayer::Parameters& FullyConnectedLayer::getParams() const +{ + return mParams; +} + +int FullyConnectedLayer::getNumOutputMaps() const +{ + return getNumOutputChannels(); +} + +void FullyConnectedLayer::setNumOutputMaps(int maps) +{ + setNumOutputChannels(maps); +} + +FullyConnectedLayer::~FullyConnectedLayer() +{ + +} + + +//---------------------------------------------------------------------- +// ActivationLayer +//---------------------------------------------------------------------- +ActivationLayer::ActivationLayer() : Layer(NULL, LayerType::kACTIVATION, "", NULL, NULL) { } +ActivationLayer::ActivationLayer(INetwork* network, + const std::string& name, + ITensor* input, + ITensor* output, + ActivationType activationType) + : Layer(network, LayerType::kACTIVATION, name, input, output) +{ + API_CHECK_NULL(network); + API_CHECK_NULL(input); + API_CHECK_NULL(output); + API_CHECK_ENUM_RANGE(ActivationType, activationType); + mParams.activationType = activationType; +} + +bool ActivationLayer::serializeTo(WisdomContainerEntry *e) const +{ + bool ok = Layer::serializeTo(e); + ok = ok && e->writeInt32("activation_type", mParams.activationType); + return ok; +} + +bool ActivationLayer::deserializeFrom(WisdomContainerEntry *e) +{ + NvS32 v = kRELU; + bool ok = Layer::deserializeFrom(e); + ok = ok && e->readInt32("activation_type", v); + mParams.activationType = ActivationType(v); + return ok; +} + +ActivationLayer::~ActivationLayer() {} + +NvU16 ActivationLayer::getFactoryType() const +{ + return LayerFactoryType::ACTIVATION; +} + +#define CurrentScope ActivationLayer +ACCESSOR_MUTATOR_CHECK_ENUM(ActivationType, activationType, ActivationType) +//ACCESSOR_MUTATOR_CHECK_ENUM(DataType, arithmeticType, ArithmeticType) +#undef CurrentScope +Dims4 ActivationLayer::getOutputDimensions() const +{ + return mInputs[0]->getDimensions(); +} + +const ActivationLayer::Parameters& ActivationLayer::getParams() const +{ + return mParams; +} + + +//---------------------------------------------------------------------- +// PoolingLayer +//---------------------------------------------------------------------- +PoolingLayer::PoolingLayer() : Layer(NULL, LayerType::kPOOLING, "", NULL, NULL) { } +PoolingLayer::PoolingLayer(INetwork* network, + const std::string& name, + ITensor* input, + ITensor* output, + PoolingType type, + Dims2 windowSize) + : Layer(network, LayerType::kPOOLING, name, input, output) +{ + API_CHECK_NULL(network); + API_CHECK_NULL(input); + API_CHECK_NULL(output); + API_CHECK(type.v() <= EnumMax()); + API_CHECK(windowSize.h > 0 && windowSize.w > 0 && + windowSize.h*windowSize.w < MAX_KERNEL_DIMS_PRODUCT); + API_CHECK(windowSize.h > 0 && windowSize.w > 0 && + windowSize.h + windowSize.w < MAX_STRIDE_SUM); + + mParams.poolingType = type; + mParams.windowSize = windowSize; + mParams.stride = windowSize; + mParams.topLeftPadding = Dims2(0, 0); + mParams.bottomRightPadding = Dims2(0, 0); +} + +PoolingLayer::PoolingLayer(INetwork* network, + const std::string& name, + ITensor* input, + ITensor* output, + PoolingType type, + Dims2 windowSize, + Dims2 stride, + Dims2 tlPadding, + Dims2 brPadding) + : Layer(network, LayerType::kPOOLING, name, input, output) +{ + API_CHECK_NULL(network); + API_CHECK_NULL(input); + API_CHECK_NULL(output); + API_CHECK(type.v() <= EnumMax()); + API_CHECK(windowSize.h > 0 && windowSize.w > 0 && + windowSize.h * windowSize.w < MAX_KERNEL_DIMS_PRODUCT); + API_CHECK(stride.h > 0 && stride.w > 0 && + stride.h + stride.w < MAX_STRIDE_SUM); + + mParams.poolingType = type; + mParams.windowSize = windowSize; + mParams.stride = stride; + mParams.topLeftPadding = tlPadding; + mParams.bottomRightPadding = brPadding; +} +PoolingLayer::~PoolingLayer() { } + +bool PoolingLayer::serializeTo(WisdomContainerEntry *e) const +{ + bool ok = Layer::serializeTo(e); + ok = ok && e->writeDims2("window_size", mParams.windowSize); + ok = ok && e->writeDims2("top_left_padding", mParams.topLeftPadding); + ok = ok && e->writeDims2("bottom_right_padding", mParams.bottomRightPadding); + ok = ok && e->writeDims2("stride", mParams.stride); + ok = ok && e->writeInt32("pooling_type", mParams.poolingType); + return ok; +} + +bool PoolingLayer::deserializeFrom(WisdomContainerEntry *e) +{ + NvS32 v = PoolingType::kMAX; + bool ok = Layer::deserializeFrom(e); + ok = ok && e->readDims2("window_size", mParams.windowSize); + ok = ok && e->readDims2("top_left_padding", mParams.topLeftPadding); + ok = ok && e->readDims2("bottom_right_padding", mParams.bottomRightPadding); + ok = ok && e->readDims2("stride", mParams.stride); + ok = ok && e->readInt32("pooling_type", v); + mParams.poolingType = PoolingType(v); + return ok; +} + +NvU16 PoolingLayer::getFactoryType() const +{ + return LayerFactoryType::POOLING; +} + +#define CurrentScope PoolingLayer + +ACCESSOR_MUTATOR_CHECK_EXPR(Dims2, windowSize, WindowSize, + (windowSize.h > 0 && windowSize.w > 0 && + windowSize.h*windowSize.w < MAX_KERNEL_DIMS_PRODUCT) ); +ACCESSOR_MUTATOR_CHECK_EXPR(Dims2, topLeftPadding, TopLeftPadding, + (topLeftPadding.h >= 0 && topLeftPadding.w >= 0 && + topLeftPadding.h + topLeftPadding.w < MAX_PADDING_SUM) ) +ACCESSOR_MUTATOR_CHECK_EXPR(Dims2, bottomRightPadding, BottomRightPadding, + (bottomRightPadding.h >= 0 && bottomRightPadding.w >= 0 && + bottomRightPadding.h + bottomRightPadding.w < MAX_PADDING_SUM) ) +ACCESSOR_MUTATOR_CHECK_EXPR(Dims2, stride, Stride, + (stride.h > 0 && stride.w > 0 && + stride.h + stride.w < MAX_STRIDE_SUM) ); +#undef CurrentScope + +Dims4 PoolingLayer::getOutputDimensions() const +{ + Dims4 inputDims = mInputs[0]->getDimensions(); + //assert(inputDims.c > 0 && inputDims.h > 0 && inputDims.w > 0); + Dims2 poolDims = mNetwork->getPoolingOutputDimensionsFormula(). + compute(Dims2(inputDims.h, inputDims.w), mParams.windowSize, + mParams.stride, mParams.topLeftPadding, mParams.bottomRightPadding, getName()); + return Dims4(inputDims.c, poolDims.h, poolDims.w); +} + +const PoolingLayer::Parameters& PoolingLayer::getParams() const { return mParams; } + +PoolingType PoolingLayer::getPoolingType() const { return mParams.poolingType; } +void PoolingLayer::setPoolingType(PoolingType pt) { mParams.poolingType = pt; } + +//---------------------------------------------------------------------- +// LRNLayer +//---------------------------------------------------------------------- +LRNLayer::LRNLayer() : Layer(NULL, LayerType::kLRN, "", NULL, NULL) { } +LRNLayer::LRNLayer(INetwork* network, const std::string& name, + ITensor* input, ITensor* output, + int windowSize, float alpha, float beta, float k) + : Layer(network, LayerType::kLRN, name, input, output) +{ + API_CHECK_NULL(network); + API_CHECK_NULL(input); + API_CHECK_NULL(output); + API_CHECK(windowSize >= ILRNLayer::Parameters::minWindowSize() && + windowSize <= ILRNLayer::Parameters::maxWindowSize()); + API_CHECK(fabsf(alpha) < ILRNLayer::Parameters::maxAbsAlpha()); + API_CHECK(beta >= ILRNLayer::Parameters::minBeta() && + beta <= ILRNLayer::Parameters::maxBeta()); + API_CHECK(k >= ILRNLayer::Parameters::minK() && + k <= ILRNLayer::Parameters::maxK()); + mParams.windowSize = windowSize; + mParams.alpha = alpha; + mParams.beta = beta; + mParams.k = k; +} +LRNLayer::~LRNLayer() {} + +bool LRNLayer::serializeTo(WisdomContainerEntry *e) const +{ + bool ok = Layer::serializeTo(e); + ok = ok && e->writeInt32("window_size", mParams.windowSize); + ok = ok && e->writeFloat32("alpha", mParams.alpha); + ok = ok && e->writeFloat32("beta", mParams.beta); + ok = ok && e->writeFloat32("k", mParams.k); + return ok; +} + +bool LRNLayer::deserializeFrom(WisdomContainerEntry *e) +{ + bool ok = Layer::deserializeFrom(e); + ok = ok && e->readInt32("window_size", mParams.windowSize); + ok = ok && e->readFloat32("alpha", mParams.alpha); + ok = ok && e->readFloat32("beta", mParams.beta); + ok = ok && e->readFloat32("k", mParams.k); + return ok; +} + +NvU16 LRNLayer::getFactoryType() const +{ + return LayerFactoryType::LRN; +} + +#define CurrentScope LRNLayer +ACCESSOR_MUTATOR_CHECK_EXPR(float, alpha, Alpha, + (fabsf(alpha) < ILRNLayer::Parameters::maxAbsAlpha()) ); +ACCESSOR_MUTATOR_CHECK_EXPR(float, beta, Beta, + (beta >= ILRNLayer::Parameters::minBeta() && + beta <= ILRNLayer::Parameters::maxBeta()) ); +ACCESSOR_MUTATOR_CHECK_EXPR(float, k, K, + (k >= ILRNLayer::Parameters::minK() && + k <= ILRNLayer::Parameters::maxK()) ); +ACCESSOR_MUTATOR_CHECK_EXPR(int, windowSize, WindowSize, + (windowSize >= ILRNLayer::Parameters::minWindowSize() && + windowSize <= ILRNLayer::Parameters::maxWindowSize()) ); +#undef CurrentScope + +Dims4 LRNLayer::getOutputDimensions() const +{ + return mInputs[0]->getDimensions(); +} + +const LRNLayer::Parameters& LRNLayer::getParams() const { return mParams; } + + +//---------------------------------------------------------------------- +// ScaleLayer +//---------------------------------------------------------------------- +ScaleLayer::ScaleLayer() : Layer(NULL, LayerType::kSCALE, "", NULL, NULL) { } +ScaleLayer::ScaleLayer(INetwork* network, const std::string& name, + ITensor* input, + ITensor* output, + ScaleMode mode, + Weights shift, + Weights scale, + Weights power) + : Layer(network, LayerType::kSCALE, name, input, output) +{ + API_CHECK_NULL(network); + API_CHECK_NULL(input); + API_CHECK_NULL(output); + API_CHECK_ENUM_RANGE(ScaleMode, mode); + API_CHECK_WEIGHTS0(shift); + API_CHECK_WEIGHTS0(scale); + API_CHECK_WEIGHTS0(power); + mParams.mode = mode; + mParams.shift = shift; + mParams.scale = scale; + mParams.power = power; +} +ScaleLayer::~ScaleLayer() {} + + +bool ScaleLayer::serializeTo(WisdomContainerEntry *e) const +{ + bool ok = Layer::serializeTo(e); + ok = ok && e->writeWeights("shift", mParams.shift); + ok = ok && e->writeWeights("scale", mParams.scale); + ok = ok && e->writeWeights("power", mParams.power); + ok = ok && e->writeUInt8Enum("mode", mParams.mode); + return ok; +} + +bool ScaleLayer::deserializeFrom(WisdomContainerEntry *e) +{ + NvU8 v = ScaleMode::sUNIFORM; + bool ok = Layer::deserializeFrom(e); + ok = ok && e->readWeights("shift", mParams.shift); + ok = ok && e->readWeights("scale", mParams.scale); + ok = ok && e->readWeights("power", mParams.power); + ok = ok && e->readUInt8Enum("mode", v); + mParams.mode = ScaleMode(v); + return ok; +} + +NvU16 ScaleLayer::getFactoryType() const +{ + return LayerFactoryType::SCALE; +} + + +#define CurrentScope ScaleLayer +ACCESSOR_MUTATOR_WEIGHTS(Weights, scale, Scale); +ACCESSOR_MUTATOR_WEIGHTS(Weights, shift, Shift); +ACCESSOR_MUTATOR_WEIGHTS(Weights, power, Power); +ACCESSOR_MUTATOR_CHECK_ENUM(ScaleMode, mode, Mode); +//ACCESSOR_MUTATOR_CHECK_ENUM(DataType, arithmeticType, ArithmeticType) +#undef CurrentScope + +Dims4 ScaleLayer::getOutputDimensions() const +{ + return mInputs[0]->getDimensions(); +} + +const ScaleLayer::Parameters& ScaleLayer::getParams() const { return mParams; } + +//---------------------------------------------------------------------- +// BatchNormLayer +//---------------------------------------------------------------------- +BatchNormLayer::BatchNormLayer() : Layer(NULL, LayerType::kBATCH_NORM, "", NULL, NULL) { } +BatchNormLayer::BatchNormLayer(INetwork* network, const std::string& name, + ITensor* input, + ITensor* output, + BatchNormMode mode, + Weights mean, + Weights variance, + float epsilon) + : Layer(network, LayerType::kBATCH_NORM, name, input, output) +{ + API_CHECK_NULL(network); + API_CHECK_NULL(input); + API_CHECK_NULL(output); + API_CHECK_ENUM_RANGE(BatchNormMode, mode); + API_CHECK_WEIGHTS0(mean); + API_CHECK_WEIGHTS0(variance); + mParams.mode = mode; + mParams.mean = mean; + mParams.variance = variance; + mParams.epsilon = epsilon; +} +BatchNormLayer::~BatchNormLayer() {} + + +bool BatchNormLayer::serializeTo(WisdomContainerEntry *e) const +{ + bool ok = Layer::serializeTo(e); + ok = ok && e->writeWeights("mean", mParams.mean); + ok = ok && e->writeWeights("variance", mParams.variance); + ok = ok && e->writeUInt8Enum("mode", mParams.mode); + ok = ok && e->writeFloat32("epsilon", mParams.epsilon); + return ok; +} + +bool BatchNormLayer::deserializeFrom(WisdomContainerEntry *e) +{ + NvU8 v = BatchNormMode::bnUNIFORM; + bool ok = Layer::deserializeFrom(e); + ok = ok && e->readWeights("mean", mParams.mean); + ok = ok && e->readWeights("variance", mParams.variance); + ok = ok && e->readUInt8Enum("mode", v); + mParams.mode = BatchNormMode(v); + ok = ok && e->readFloat32("epsilon", mParams.epsilon); + return ok; +} + +NvU16 BatchNormLayer::getFactoryType() const +{ + return LayerFactoryType::BATCH_NORM; +} + + +#define CurrentScope BatchNormLayer +ACCESSOR_MUTATOR_WEIGHTS(Weights, mean, Mean); +ACCESSOR_MUTATOR_WEIGHTS(Weights, variance, Variance); +ACCESSOR_MUTATOR_CHECK_ENUM(BatchNormMode, mode, Mode); +ACCESSOR_MUTATOR(float, epsilon, Epsilon); +#undef CurrentScope + +Dims4 BatchNormLayer::getOutputDimensions() const +{ + return mInputs[0]->getDimensions(); +} + +const BatchNormLayer::Parameters& BatchNormLayer::getParams() const { return mParams; } + + +//---------------------------------------------------------------------- +// SoftMaxLayer +//---------------------------------------------------------------------- +SoftMaxLayer::SoftMaxLayer() : Layer(NULL, LayerType::kSOFTMAX, "", NULL, NULL) { } +SoftMaxLayer::SoftMaxLayer(INetwork* network, + const std::string& name, + ITensor* input, + ITensor* output) + : Layer(network, LayerType::kSOFTMAX, name, input, output) +{ + API_CHECK_NULL(network); + API_CHECK_NULL(input); + API_CHECK_NULL(output); +} +SoftMaxLayer::~SoftMaxLayer() {} + +bool SoftMaxLayer::serializeTo(WisdomContainerEntry *e) const +{ + bool ok = Layer::serializeTo(e); + return ok; +} +bool SoftMaxLayer::deserializeFrom(WisdomContainerEntry *e) +{ + bool ok = Layer::deserializeFrom(e); + return ok; +} + +Dims4 SoftMaxLayer::getOutputDimensions() const +{ + return mInputs[0]->getDimensions(); +} + +NvU16 SoftMaxLayer::getFactoryType() const +{ + return LayerFactoryType::SOFT_MAX; +} + +#define CurrentScope SoftMaxLayer +//ACCESSOR_MUTATOR_CHECK_ENUM(DataType, arithmeticType, ArithmeticType) +#undef CurrentScope + +const SoftMaxLayer::Parameters& SoftMaxLayer::getParams() const { return mParams; } + + +//---------------------------------------------------------------------- +// ConcatenationLayer +//---------------------------------------------------------------------- +ConcatenationLayer::ConcatenationLayer() : Layer(NULL, LayerType::kCONCATENATION, "", NULL, NULL) { } +ConcatenationLayer::ConcatenationLayer(INetwork* network, + const std::string& name, + ITensor*const * inputs, + int numInputs, + ITensor* output) + : Layer(network, LayerType::kCONCATENATION, name, inputs, numInputs, &output, 1) +{ + API_CHECK_NULL(network); + API_CHECK_NULL(inputs); + API_CHECK(numInputs < MAX_NUM_INPUT_LAYERS); + API_CHECK_NULL(output); + for (int j = 0; j < numInputs; j++) + API_CHECK_NULL(inputs[j]); +} +ConcatenationLayer::~ConcatenationLayer() {} + +bool ConcatenationLayer::serializeTo(WisdomContainerEntry *e) const +{ + bool ok = Layer::serializeTo(e); + return ok; +} + +bool ConcatenationLayer::deserializeFrom(WisdomContainerEntry *e) +{ + bool ok = Layer::deserializeFrom(e); + return ok; +} + +NvU16 ConcatenationLayer::getFactoryType() const +{ + return LayerFactoryType::CONCATENATION; +} + +Dims4 ConcatenationLayer::getOutputDimensions() const +{ + int h = 0, w = 0, c = 0; + for (unsigned i = 0; i < mInputs.size(); i++) + { + Dims4 dims = mInputs[i]->getDimensions(); + if (i == 0) { + h = dims.h; + w = dims.w; + } + //assert(h == dims.h); // TODO: error message + //assert(w == dims.w); + c += dims.c; + } + return Dims4(c, h, w); +} + +const ConcatenationLayer::Parameters& ConcatenationLayer::getParams() const +{ + return mParams; +} + + +//---------------------------------------------------------------------- +// SliceLayer +//---------------------------------------------------------------------- +SliceLayer::SliceLayer() : Layer(NULL, LayerType::kSLICE, "", NULL, NULL) { } +SliceLayer::SliceLayer(INetwork* network, + const std::string& name, + ITensor* input, + ITensor* const* outputs, + int numOutputs) + : Layer(network, LayerType::kSLICE, name, &input, 1, outputs, numOutputs) +{ + API_CHECK_NULL(network); + API_CHECK_NULL(input); + API_CHECK(numOutputs < MAX_NUM_OUTPUT_LAYERS); + API_CHECK_NULL(outputs); + for (int j = 0; j < numOutputs; j++) + API_CHECK_NULL(outputs[j]); +} +SliceLayer::~SliceLayer() {} + +bool SliceLayer::serializeTo(WisdomContainerEntry *e) const +{ + bool ok = Layer::serializeTo(e); + return ok; +} + +bool SliceLayer::deserializeFrom(WisdomContainerEntry *e) +{ + bool ok = Layer::deserializeFrom(e); + return ok; +} + +NvU16 SliceLayer::getFactoryType() const +{ + return LayerFactoryType::SLICE; +} + +Dims4 SliceLayer::getOutputDimensions() const +{ + Dims4 inputDims = mInputs[0]->getDimensions(); + + if (inputDims.c % mOutputs.size() != 0) + std::cerr << "channel dimension [" << inputDims.c << "] not divisible by [" << mOutputs.size() << "]" << std::endl; + + // TODO: Allow slices along H and W dimensions + Dims4 outputDims = inputDims; + outputDims.c = inputDims.c / mOutputs.size(); + + return outputDims; +} + +const SliceLayer::Parameters& SliceLayer::getParams() const +{ + return mParams; +} + + +//---------------------------------------------------------------------- +// DeconvolutionLayer +//---------------------------------------------------------------------- +DeconvolutionLayer::DeconvolutionLayer() : Layer(NULL, LayerType::kDECONVOLUTION, "", NULL, NULL) { } +DeconvolutionLayer::DeconvolutionLayer(INetwork* network, + const std::string& name, + ITensor* input, + ITensor* output, + int numOutputMaps, + Dims2 kernelSize, + Weights kernelWeights, + Weights biasWeights) + : Layer(network, LayerType::kDECONVOLUTION, name, input, output) +{ + API_CHECK_NULL(network); + API_CHECK_NULL(input); + API_CHECK_NULL(output); + API_CHECK(numOutputMaps > 0 && numOutputMaps < MAX_OUTPUT_MAPS); + API_CHECK(kernelSize.h > 0 && kernelSize.w > 0 && + kernelSize.h*kernelSize.w < MAX_KERNEL_DIMS_PRODUCT); + API_CHECK_WEIGHTS(kernelWeights); + API_CHECK_WEIGHTS0(biasWeights); + mParams.kernelSize = kernelSize; + mParams.numOutputMaps = numOutputMaps; + mParams.topLeftPadding = Dims2(0, 0); // set via accessors + mParams.bottomRightPadding = Dims2(0, 0); // set via accessors + mParams.stride = Dims2(1, 1); + mParams.numGroups = 1; + mParams.paddingValue = 0; + mParams.kernelWeights = kernelWeights; + mParams.biasWeights = biasWeights; +} +DeconvolutionLayer::DeconvolutionLayer(INetwork* network, const std::string& name, + ITensor* input, + ITensor* output, + int numOutputMaps, + int paddingValue, + Dims2 kernelSize, + Dims2 tlPadding, + Dims2 brPadding, + Dims2 stride, + Dims2 dilation, + Weights kernelWeights, + Weights biasWeights, + BiasMode biasMode, + int numGroups) + : Layer(network, LayerType::kDECONVOLUTION, name, input, output) +{ + API_CHECK_NULL(network); + API_CHECK_NULL(input); + API_CHECK_NULL(output); + API_CHECK(numOutputMaps > 0 && numOutputMaps < MAX_OUTPUT_MAPS); + API_CHECK(kernelSize.h > 0 && kernelSize.w > 0 && kernelSize.h*kernelSize.w < MAX_KERNEL_DIMS_PRODUCT); + API_CHECK_WEIGHTS(kernelWeights); + API_CHECK_WEIGHTS0(biasWeights); + API_CHECK_ENUM_RANGE(BiasMode, biasMode); + mParams.kernelSize = kernelSize; + mParams.numOutputMaps = numOutputMaps; + mParams.topLeftPadding = tlPadding; + mParams.bottomRightPadding = brPadding; + mParams.paddingValue = paddingValue; + mParams.stride = stride; + mParams.dilation = dilation; + mParams.kernelWeights = kernelWeights; + mParams.biasWeights = biasWeights; + mParams.biasMode = biasMode; + mParams.numGroups = numGroups; +} + +DeconvolutionLayer::~DeconvolutionLayer() {} + +bool DeconvolutionLayer::serializeTo(WisdomContainerEntry *e) const +{ + bool ok = Layer::serializeTo(e); + ok = ok && e->writeDims2("kernel_size", mParams.kernelSize); + ok = ok && e->writeDims2("top_left_padding", mParams.topLeftPadding); + ok = ok && e->writeDims2("bottom_right_padding", mParams.bottomRightPadding); + ok = ok && e->writeDims2("stride", mParams.stride); + ok = ok && e->writeDims2("dilation", mParams.dilation); + ok = ok && e->writeInt32("num_output_maps", mParams.numOutputMaps); + ok = ok && e->writeInt32("num_groups", mParams.numGroups); + ok = ok && e->writeInt32("padding_value", mParams.paddingValue); + ok = ok && e->writeWeights("kernel_weights", mParams.kernelWeights); + ok = ok && e->writeWeights("bias_weights", mParams.biasWeights); + ok = ok && e->writeUInt8Enum("bias_mode", mParams.biasMode); + ok = ok && e->writeInt32("groups", mParams.numGroups); + return ok; +} + +bool DeconvolutionLayer::deserializeFrom(WisdomContainerEntry *e) +{ + NvU8 v = BiasMode::bUNIFORM; + bool ok = Layer::deserializeFrom(e); + ok = ok && e->readDims2("kernel_size", mParams.kernelSize); + ok = ok && e->readDims2("top_left_padding", mParams.topLeftPadding); + ok = ok && e->readDims2("bottom_right_padding", mParams.bottomRightPadding); + ok = ok && e->readDims2("stride", mParams.stride); + ok = ok && e->readDims2("dilation", mParams.dilation); + ok = ok && e->readInt32("num_output_maps", mParams.numOutputMaps); + ok = ok && e->readInt32("num_groups", mParams.numGroups); + ok = ok && e->readInt32("padding_value", mParams.paddingValue); + ok = ok && e->readWeights("kernel_weights", mParams.kernelWeights); + ok = ok && e->readWeights("bias_weights", mParams.biasWeights); + ok = ok && e->readUInt8Enum("bias_mode", v); + ok = ok && e->readInt32("groups", mParams.numGroups); + mParams.biasMode = BiasMode(v); + + return ok; +} + +NvU16 DeconvolutionLayer::getFactoryType() const +{ + return LayerFactoryType::DECONVOLUTION; +} + +#define CurrentScope DeconvolutionLayer +ACCESSOR_MUTATOR_CHECK_EXPR(Dims2, kernelSize, KernelSize, + (kernelSize.h > 0 && kernelSize.w > 0 && + kernelSize.h*kernelSize.w < MAX_KERNEL_DIMS_PRODUCT) ); +ACCESSOR_MUTATOR_CHECK_EXPR(Dims2, topLeftPadding, TopLeftPadding, + (topLeftPadding.h >= 0 && topLeftPadding.w >= 0 && + topLeftPadding.h + topLeftPadding.w < MAX_PADDING_SUM) ) +ACCESSOR_MUTATOR_CHECK_EXPR(Dims2, bottomRightPadding, BottomRightPadding, + (bottomRightPadding.h >= 0 && bottomRightPadding.w >= 0 && + bottomRightPadding.h + bottomRightPadding.w < MAX_PADDING_SUM) ) +ACCESSOR_MUTATOR_CHECK_EXPR(int, paddingValue, PaddingValue, + (paddingValue >= 0 && paddingValue < MAX_PADDING_VALUE) ) +ACCESSOR_MUTATOR_CHECK_EXPR(Dims2, stride, Stride, + (stride.h > 0 && stride.w > 0 && + stride.h + stride.w < MAX_STRIDE_SUM) ); +ACCESSOR_MUTATOR_CHECK_EXPR(Dims2, dilation, Dilation, + (dilation.h > 0 && dilation.w > 0 && + dilation.h + dilation.w < MAX_DILATION_SUM) ) +ACCESSOR_MUTATOR_CHECK_EXPR(int, numGroups, NumGroups, + (numGroups > 0 && numGroups < MAX_GROUPS) ) +ACCESSOR_MUTATOR_CHECK_EXPR(int, numOutputMaps, NumOutputMaps, + (numOutputMaps > 0 && numOutputMaps < MAX_OUTPUT_MAPS ) ) +//ACCESSOR_MUTATOR_CHECK_ENUM(DataType, arithmeticType, ArithmeticType) +ACCESSOR_MUTATOR_CHECK_ENUM(BiasMode, biasMode, BiasMode) +ACCESSOR_MUTATOR_WEIGHTS(Weights, kernelWeights, KernelWeights) +ACCESSOR_MUTATOR_WEIGHTS(Weights, biasWeights, BiasWeights) +#undef CurrentScope + +Dims4 DeconvolutionLayer::getOutputDimensions() const +{ + + Dims4 inputDims = mInputs[0]->getDimensions(); + // assert(inputDims.c > 0 && inputDims.h > 0 && inputDims.w > 0); + Dims2 convDims = mNetwork->getDeconvolutionOutputDimensionsFormula(). + compute(Dims2(inputDims.h, inputDims.w), + mParams.kernelSize, mParams.stride, mParams.topLeftPadding, mParams.bottomRightPadding, mParams.dilation, getName()); + return Dims4(mParams.numOutputMaps, convDims.h, convDims.w); +} + +const DeconvolutionLayer::Parameters& DeconvolutionLayer::getParams() const +{ + return mParams; +} + + +//---------------------------------------------------------------------- +// ElementWiseLayer +//---------------------------------------------------------------------- +ElementWiseLayer::ElementWiseLayer() : Layer(NULL, LayerType::kELEMENTWISE, "", NULL, NULL) { } +ElementWiseLayer::ElementWiseLayer(INetwork* network, const std::string& name, + ITensor*const *inputs, ITensor* output, + ElementWiseOperation op) + : Layer(network, LayerType::kELEMENTWISE, name, inputs, 2, &output, 1) +{ + API_CHECK_NULL(network); + API_CHECK_ENUM_RANGE(ElementWiseOperation, op); + API_CHECK_NULL(inputs); + API_CHECK_NULL(inputs[0]); + API_CHECK_NULL(inputs[1]); + API_CHECK_NULL(output); + mParams.operation = op; +} + +ElementWiseLayer::~ElementWiseLayer() {} + + +bool ElementWiseLayer::serializeTo(WisdomContainerEntry *e) const +{ + bool ok = Layer::serializeTo(e); + ok = ok && e->writeInt32("operation", mParams.operation); + return ok; +} + +bool ElementWiseLayer::deserializeFrom(WisdomContainerEntry *e) +{ + NvS32 v = kSUM; + bool ok = Layer::deserializeFrom(e); + ok = ok && e->readInt32("operation", v); + mParams.operation = ElementWiseOperation(v); + return ok; +} + +NvU16 ElementWiseLayer::getFactoryType() const +{ + return LayerFactoryType::ELEMENT_WISE; +} + +#define CurrentScope ElementWiseLayer +ACCESSOR_MUTATOR_CHECK_ENUM(ElementWiseOperation, operation, Operation) +//ACCESSOR_MUTATOR_CHECK_ENUM(DataType, arithmeticType, ArithmeticType) +#undef CurrentScope + +Dims4 ElementWiseLayer::getOutputDimensions() const +{ + return mInputs[0]->getDimensions(); +} + +const ElementWiseLayer::Parameters& ElementWiseLayer::getParams() const +{ + return mParams; +} + + +//---------------------------------------------------------------------- +// These shenanigans are required to explicitly instantiate the static +// members of the various DiamondMaps +//---------------------------------------------------------------------- +template <> +std::map BasePrivDiamondMap::s_base_priv_diamond_map = + std::map(); + +template <> +std::map BasePrivDiamondMap::s_base_priv_diamond_map = + std::map(); + +template <> +std::map BasePrivDiamondMap::s_base_priv_diamond_map = + std::map(); + +template <> +std::map BasePrivDiamondMap::s_base_priv_diamond_map = + std::map(); + +template <> +std::map BasePrivDiamondMap::s_base_priv_diamond_map = + std::map(); + +template <> +std::map BasePrivDiamondMap::s_base_priv_diamond_map = + std::map(); + +template <> +std::map BasePrivDiamondMap::s_base_priv_diamond_map = + std::map(); + +template <> +std::map BasePrivDiamondMap::s_base_priv_diamond_map = + std::map(); + +template <> +std::map BasePrivDiamondMap::s_base_priv_diamond_map = + std::map(); + +template <> +std::map BasePrivDiamondMap::s_base_priv_diamond_map = + std::map(); + +template <> +std::map BasePrivDiamondMap::s_base_priv_diamond_map = + std::map(); + +template <> +std::map BasePrivDiamondMap::s_base_priv_diamond_map = + std::map(); + + +//---------------------------------------------------------------------- +// must explicitly instance these... +//---------------------------------------------------------------------- + +template ConvolutionLayerDiamond::DerivedPrivType * +LayerFactory::derivedPriv(ConvolutionLayerDiamond::BasePrivType *base_priv); + +template FullyConnectedLayerDiamond::DerivedPrivType * +LayerFactory::derivedPriv(FullyConnectedLayerDiamond::BasePrivType *base_priv); + +template ActivationLayerDiamond::DerivedPrivType * +LayerFactory::derivedPriv(ActivationLayerDiamond::BasePrivType *base_priv); + +template PoolingLayerDiamond::DerivedPrivType * +LayerFactory::derivedPriv(PoolingLayerDiamond::BasePrivType *base_priv); + +template LRNLayerDiamond::DerivedPrivType * +LayerFactory::derivedPriv(LRNLayerDiamond::BasePrivType *base_priv); + +template ScaleLayerDiamond::DerivedPrivType * +LayerFactory::derivedPriv(ScaleLayerDiamond::BasePrivType *base_priv); + +template BatchNormLayerDiamond::DerivedPrivType * +LayerFactory::derivedPriv(BatchNormLayerDiamond::BasePrivType *base_priv); + +template SoftMaxLayerDiamond::DerivedPrivType * +LayerFactory::derivedPriv(SoftMaxLayerDiamond::BasePrivType *base_priv); + +template ConcatenationLayerDiamond::DerivedPrivType * +LayerFactory::derivedPriv(ConcatenationLayerDiamond::BasePrivType *base_priv); + +template SliceLayerDiamond::DerivedPrivType * +LayerFactory::derivedPriv(SliceLayerDiamond::BasePrivType *base_priv); + +template DeconvolutionLayerDiamond::DerivedPrivType * +LayerFactory::derivedPriv(DeconvolutionLayerDiamond::BasePrivType *base_priv); + +template ElementWiseLayerDiamond::DerivedPrivType * +LayerFactory::derivedPriv(ElementWiseLayerDiamond::BasePrivType *base_priv); + + + + + +} // nvdla::priv +} // ::nvdla diff --git a/umd/core/src/compiler/LutManager.cpp b/umd/core/src/compiler/LutManager.cpp new file mode 100644 index 00000000..d2105444 --- /dev/null +++ b/umd/core/src/compiler/LutManager.cpp @@ -0,0 +1,682 @@ +/* + * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#include "half.h" +#include "priv/Compiler.h" +#include "priv/LutManager.h" + +#include + +namespace nvdla +{ +namespace priv +{ + +LutManager::LutManager() : + m_lutHandles(), + m_lutParams(), + m_hNextFree(0) +{ + +} + +LutManager::~LutManager() +{ + +} + +NvDlaError LutManager::registerLRN(surface::SurfacePrecisionEnum precision, NvU32 localSize, NvF32 alpha, NvF32 beta, NvF32 k, LutHandle* hLut) +{ + NvDlaError e = NvDlaSuccess; + LutParams lutParams; + + lutParams.type = LutManager::LUT_TYPE_LRN; + lutParams.precision = precision; + lutParams.lrnParams.localSize = localSize; + lutParams.lrnParams.alpha = alpha; + lutParams.lrnParams.beta = beta; + lutParams.lrnParams.k = k; + + PROPAGATE_ERROR_FAIL(getHandle(&lutParams, hLut)); + +fail: + return e; +} + +NvDlaError LutManager::registerSigmoid(surface::SurfacePrecisionEnum precision, LutHandle* hLut) +{ + NvDlaError e = NvDlaSuccess; + LutParams lutParams; + + lutParams.type = LutManager::LUT_TYPE_SIGMOID; + lutParams.precision = precision; + + PROPAGATE_ERROR_FAIL(getHandle(&lutParams, hLut)); + +fail: + return e; +} + +NvDlaError LutManager::registerTanh(surface::SurfacePrecisionEnum precision, LutHandle* hLut) +{ + NvDlaError e = NvDlaSuccess; + LutParams lutParams; + + lutParams.type = LutManager::LUT_TYPE_TANH; + lutParams.precision = precision; + + PROPAGATE_ERROR_FAIL(getHandle(&lutParams, hLut)); + +fail: + return e; +} + +NvS16 LutManager::getIndex(LutHandle hLut) const +{ + return static_cast(hLut); +} + +NvS16 LutManager::getNumRegisteredLuts() +{ + return static_cast(m_hNextFree); +} + +NvDlaError LutManager::writeLutData(NvU16 lutSlot, DLALUTParamAccessor lutAcc) +{ + NvDlaError e = NvDlaSuccess; + + LutHandle hLut = static_cast(lutSlot); + LutParams lutParams = m_lutParams[hLut]; + + switch(lutParams.type) + { + case LUT_TYPE_LRN: + PROPAGATE_ERROR_FAIL(writeLRNData(&lutParams, lutAcc)); + break; + case LUT_TYPE_SIGMOID: + PROPAGATE_ERROR_FAIL(writeSigmoidData(&lutParams, lutAcc)); + break; + case LUT_TYPE_TANH: + PROPAGATE_ERROR_FAIL(writeTanhData(&lutParams, lutAcc)); + break; + default: + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Unsupported LutParam type %d", lutParams.type); + } + +fail: + return e; +} + +NvDlaError LutManager::writeLRNData(const LutParams* lutParams, DLALUTParamAccessor lutAcc) +{ + NvDlaError e = NvDlaSuccess; + + if (!lutParams) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter); + } + + if (lutParams->precision == surface::NVDLA_PRECISION_FP16) + { + // LRN, FP16, N=any, alpha=any, beta=any, k=any + // mode=EXP, start_index=0 + NvU32 startIndex = 0; + NvS16 lrnFP16Table[lutAcc.numLinearExpTable()]; + + for (NvU32 ii=0; iilrnParams.k + (lutParams->lrnParams.alpha / lutParams->lrnParams.localSize) * input, lutParams->lrnParams.beta); + + half_float::half outputFP16 = static_cast(static_cast(output)); + half_float::half* p = &outputFP16; + lrnFP16Table[ii] = *(reinterpret_cast(p)); // Better to cast via union types instead + } + + // Program LE Lut + for (size_t ii=0; iiprecision == surface::NVDLA_PRECISION_INT8) + { + REPORT_ERROR(NvDlaError_BadValue, "Empty INT8 LRN LUT"); + + // LRN, INT8, N=any, alpha=any, beta=any, k=any + // mode=EXP, start_index=0 + NvU32 startIndex = 0; + + // Program LE Lut + for (size_t ii=0; ii> 0} + DLAFloatDataAccessor leuSlopeAcc = lutAcc.linearExpUnderflowSlopeAccessor().dataIAccessor(); + *leuSlopeAcc.scale() = 0x0000; + *leuSlopeAcc.shifter() = 0x00; + DLAFloatDataAccessor leoSlopeAcc = lutAcc.linearExpOverflowSlopeAccessor().dataIAccessor(); + *leoSlopeAcc.scale() = 0x0000; + *leoSlopeAcc.shifter() = 0x00; + DLAFloatDataAccessor louSlopeAcc = lutAcc.linearOnlyUnderflowSlopeAccessor().dataIAccessor(); + *louSlopeAcc.scale() = 0x0000; + *louSlopeAcc.shifter() = 0x00; + DLAFloatDataAccessor looSlopeAcc = lutAcc.linearOnlyOverflowSlopeAccessor().dataIAccessor(); + *looSlopeAcc.scale() = 0x0000; + *looSlopeAcc.shifter() = 0x00; + + // Program priority bits + *lutAcc.hybridPriority() = lutAcc.priority_LinearExp(); + *lutAcc.underflowPriority() = lutAcc.priority_LinearExp(); + *lutAcc.overflowPriority() = lutAcc.priority_LinearExp(); + } + else + { + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Unsupported LRN Precision: %d", lutParams->precision); + } + +fail: + return e; +} + +NvDlaError LutManager::writeSigmoidData(const LutParams* lutParams, DLALUTParamAccessor lutAcc) +{ + NvDlaError e = NvDlaSuccess; + + if (!lutParams) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter); + } + + if (lutParams->precision == surface::NVDLA_PRECISION_FP16) + { + // SIGMOID, FP16 + // mode=LINEAR, num_elements=257, index_offset=-16, index_sel=-3 + NvF32 indexOffset = -16.0f; + NvS16 indexSel = -3; + NvU16 sigmoidFP16Lut[] = { + 0x0002, 0x0002, 0x0002, 0x0003, 0x0003, 0x0004, 0x0004, 0x0005, + 0x0005, 0x0006, 0x0007, 0x0007, 0x0008, 0x000a, 0x000b, 0x000c, + 0x000e, 0x0010, 0x0012, 0x0014, 0x0017, 0x001a, 0x001e, 0x0021, + 0x0026, 0x002b, 0x0031, 0x0037, 0x003f, 0x0047, 0x0050, 0x005b, + 0x0067, 0x0075, 0x0084, 0x0096, 0x00aa, 0x00c1, 0x00da, 0x00f7, + 0x0118, 0x013e, 0x0168, 0x0198, 0x01ce, 0x020b, 0x0251, 0x02a0, + 0x02fa, 0x035f, 0x03d2, 0x0454, 0x04e8, 0x058f, 0x064c, 0x0723, + 0x080b, 0x0895, 0x0931, 0x09e2, 0x0aaa, 0x0b8e, 0x0c48, 0x0cd9, + 0x0d7f, 0x0e3a, 0x0f0e, 0x0ffe, 0x1087, 0x1122, 0x11d0, 0x1296, + 0x1377, 0x143a, 0x14ca, 0x156d, 0x1626, 0x16f7, 0x17e4, 0x1878, + 0x1910, 0x19bc, 0x1a7f, 0x1b5c, 0x1c2b, 0x1cb8, 0x1d58, 0x1e0e, + 0x1eda, 0x1fc2, 0x2064, 0x20f9, 0x21a0, 0x225d, 0x2333, 0x2412, + 0x249b, 0x2535, 0x25e2, 0x26a5, 0x2781, 0x283c, 0x28c7, 0x2963, + 0x2a12, 0x2ad6, 0x2bb1, 0x2c53, 0x2cdb, 0x2d72, 0x2e1a, 0x2ed4, + 0x2fa1, 0x3041, 0x30bd, 0x3144, 0x31d6, 0x3275, 0x3320, 0x33d8, + 0x344e, 0x34b5, 0x3522, 0x3594, 0x360a, 0x3684, 0x3701, 0x3780, + 0x3800, 0x3840, 0x387f, 0x38be, 0x38fb, 0x3936, 0x396f, 0x39a5, + 0x39d9, 0x3a0a, 0x3a38, 0x3a63, 0x3a8a, 0x3aaf, 0x3ad1, 0x3af0, + 0x3b0c, 0x3b25, 0x3b3d, 0x3b52, 0x3b65, 0x3b76, 0x3b85, 0x3b93, + 0x3b9f, 0x3baa, 0x3bb4, 0x3bbc, 0x3bc4, 0x3bcb, 0x3bd1, 0x3bd6, + 0x3bdb, 0x3bdf, 0x3be3, 0x3be7, 0x3be9, 0x3bec, 0x3bee, 0x3bf0, + 0x3bf2, 0x3bf4, 0x3bf5, 0x3bf7, 0x3bf8, 0x3bf9, 0x3bfa, 0x3bfa, + 0x3bfb, 0x3bfc, 0x3bfc, 0x3bfd, 0x3bfd, 0x3bfd, 0x3bfe, 0x3bfe, + 0x3bfe, 0x3bfe, 0x3bff, 0x3bff, 0x3bff, 0x3bff, 0x3bff, 0x3bff, + 0x3bff, 0x3bff, 0x3bff, 0x3c00, 0x3c00, 0x3c00, 0x3c00, 0x3c00, + 0x3c00, 0x3c00, 0x3c00, 0x3c00, 0x3c00, 0x3c00, 0x3c00, 0x3c00, + 0x3c00, 0x3c00, 0x3c00, 0x3c00, 0x3c00, 0x3c00, 0x3c00, 0x3c00, + 0x3c00, 0x3c00, 0x3c00, 0x3c00, 0x3c00, 0x3c00, 0x3c00, 0x3c00, + 0x3c00, 0x3c00, 0x3c00, 0x3c00, 0x3c00, 0x3c00, 0x3c00, 0x3c00, + 0x3c00, 0x3c00, 0x3c00, 0x3c00, 0x3c00, 0x3c00, 0x3c00, 0x3c00, + 0x3c00, 0x3c00, 0x3c00, 0x3c00, 0x3c00, 0x3c00, 0x3c00, 0x3c00, + 0x3c00, 0x3c00, 0x3c00, 0x3c00, 0x3c00, 0x3c00, 0x3c00, 0x3c00, + 0x3c00, + }; + + // Program LE Lut + for (size_t ii=0; ii(lutAcc.linearOnlyTable(ii)); + *linearTable = sigmoidFP16Lut[ii]; + } + + // Program the LE method + *lutAcc.method() = lutAcc.method_Linear(); + + // Program LE/LO offsets + DLALUTOffsetAccessor lutLEOffsetAcc = lutAcc.linearExpOffsetAccessor(); + *lutLEOffsetAcc.fracBits() = -128; // disables lut + DLALUTOffsetAccessor lutLOOffsetAcc = lutAcc.linearOnlyOffsetAccessor(); + *lutLOOffsetAcc.fracBits() = indexSel; // index_sel + + // Program LE/LO offsets, valid only for LINEAR method + *lutAcc.linearExpStart() = 0; // disabled + *lutAcc.linearExpEnd() = 0; // unused + uint32_t* pIndexOffset = reinterpret_cast(&indexOffset); + *lutAcc.linearOnlyStart() = static_cast(*pIndexOffset); // index_offset + *lutAcc.linearOnlyEnd() = 0; // unused + + // Program LE/LO slopes, 0.0f + DLASlopeAccessor leuSlopeAcc = lutAcc.linearExpUnderflowSlopeAccessor(); + *leuSlopeAcc.dataF() = 0x0000; + DLASlopeAccessor leoSlopeAcc = lutAcc.linearExpOverflowSlopeAccessor(); + *leoSlopeAcc.dataF() = 0x0000; + DLASlopeAccessor louSlopeAcc = lutAcc.linearOnlyUnderflowSlopeAccessor(); + *louSlopeAcc.dataF() = 0x0000; + DLASlopeAccessor looSlopeAcc = lutAcc.linearOnlyOverflowSlopeAccessor(); + *looSlopeAcc.dataF() = 0x0000; + + // Program priority bits + *lutAcc.hybridPriority() = lutAcc.priority_LinearOnly(); + *lutAcc.underflowPriority() = lutAcc.priority_LinearOnly(); + *lutAcc.overflowPriority() = lutAcc.priority_LinearOnly(); + } + else if (lutParams->precision == surface::NVDLA_PRECISION_INT8) + { + REPORT_ERROR(NvDlaError_BadValue, "Empty INT8 Sigmoid LUT"); + + // SIGMOID, INT8, N=any, alpha=any, beta=any, k=any + // mode=EXP, start_index=0 + NvU32 startIndex = 0; + + // Program LE Lut + for (size_t ii=0; ii> 0} + DLAFloatDataAccessor leuSlopeAcc = lutAcc.linearExpUnderflowSlopeAccessor().dataIAccessor(); + *leuSlopeAcc.scale() = 0x0000; + *leuSlopeAcc.shifter() = 0x00; + DLAFloatDataAccessor leoSlopeAcc = lutAcc.linearExpOverflowSlopeAccessor().dataIAccessor(); + *leoSlopeAcc.scale() = 0x0000; + *leoSlopeAcc.shifter() = 0x00; + DLAFloatDataAccessor louSlopeAcc = lutAcc.linearOnlyUnderflowSlopeAccessor().dataIAccessor(); + *louSlopeAcc.scale() = 0x0000; + *louSlopeAcc.shifter() = 0x00; + DLAFloatDataAccessor looSlopeAcc = lutAcc.linearOnlyOverflowSlopeAccessor().dataIAccessor(); + *looSlopeAcc.scale() = 0x0000; + *looSlopeAcc.shifter() = 0x00; + + // Program priority bits + *lutAcc.hybridPriority() = lutAcc.priority_LinearExp(); + *lutAcc.underflowPriority() = lutAcc.priority_LinearExp(); + *lutAcc.overflowPriority() = lutAcc.priority_LinearExp(); + } + else + { + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Unsupported Sigmoid Precision: %d", lutParams->precision); + } + +fail: + return e; +} + +NvDlaError LutManager::writeTanhData(const LutParams* lutParams, DLALUTParamAccessor lutAcc) +{ + NvDlaError e = NvDlaSuccess; + + if (!lutParams) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter); + } + + if (lutParams->precision == surface::NVDLA_PRECISION_FP16) + { + // TANH, FP16 + // mode=LINEAR, num_elements=257, index_offset=-4, index_sel=-5 + NvF32 indexOffset = -4.0f; + NvS16 indexSel = -5; + NvU16 tanhFP16Lut[] = { + 0xbbff, 0xbbff, 0xbbfe, 0xbbfe, 0xbbfe, 0xbbfe, 0xbbfe, 0xbbfe, + 0xbbfe, 0xbbfe, 0xbbfd, 0xbbfd, 0xbbfd, 0xbbfd, 0xbbfd, 0xbbfc, + 0xbbfc, 0xbbfc, 0xbbfc, 0xbbfb, 0xbbfb, 0xbbfb, 0xbbfb, 0xbbfa, + 0xbbfa, 0xbbf9, 0xbbf9, 0xbbf9, 0xbbf8, 0xbbf8, 0xbbf7, 0xbbf6, + 0xbbf6, 0xbbf5, 0xbbf5, 0xbbf4, 0xbbf3, 0xbbf2, 0xbbf1, 0xbbf0, + 0xbbef, 0xbbee, 0xbbed, 0xbbec, 0xbbeb, 0xbbe9, 0xbbe8, 0xbbe6, + 0xbbe5, 0xbbe3, 0xbbe1, 0xbbdf, 0xbbdd, 0xbbdb, 0xbbd8, 0xbbd6, + 0xbbd3, 0xbbd0, 0xbbcd, 0xbbca, 0xbbc6, 0xbbc3, 0xbbbf, 0xbbbb, + 0xbbb6, 0xbbb2, 0xbbad, 0xbba7, 0xbba2, 0xbb9c, 0xbb96, 0xbb8f, + 0xbb88, 0xbb80, 0xbb78, 0xbb70, 0xbb67, 0xbb5e, 0xbb54, 0xbb49, + 0xbb3e, 0xbb32, 0xbb25, 0xbb18, 0xbb0a, 0xbafb, 0xbaeb, 0xbadb, + 0xbac9, 0xbab7, 0xbaa3, 0xba8f, 0xba79, 0xba63, 0xba4b, 0xba32, + 0xba18, 0xb9fc, 0xb9df, 0xb9c1, 0xb9a2, 0xb981, 0xb95e, 0xb93a, + 0xb915, 0xb8ee, 0xb8c5, 0xb89b, 0xb870, 0xb843, 0xb814, 0xb7c8, + 0xb765, 0xb6ff, 0xb696, 0xb62a, 0xb5bc, 0xb54b, 0xb4d8, 0xb463, + 0xb3d6, 0xb2e4, 0xb1ee, 0xb0f6, 0xaff5, 0xadfc, 0xabfd, 0xa7ff, + 0x0000, 0x27ff, 0x2bfd, 0x2dfc, 0x2ff5, 0x30f6, 0x31ee, 0x32e4, + 0x33d6, 0x3463, 0x34d8, 0x354b, 0x35bc, 0x362a, 0x3696, 0x36ff, + 0x3765, 0x37c8, 0x3814, 0x3843, 0x3870, 0x389b, 0x38c5, 0x38ee, + 0x3915, 0x393a, 0x395e, 0x3981, 0x39a2, 0x39c1, 0x39df, 0x39fc, + 0x3a18, 0x3a32, 0x3a4b, 0x3a63, 0x3a79, 0x3a8f, 0x3aa3, 0x3ab7, + 0x3ac9, 0x3adb, 0x3aeb, 0x3afb, 0x3b0a, 0x3b18, 0x3b25, 0x3b32, + 0x3b3e, 0x3b49, 0x3b54, 0x3b5e, 0x3b67, 0x3b70, 0x3b78, 0x3b80, + 0x3b88, 0x3b8f, 0x3b96, 0x3b9c, 0x3ba2, 0x3ba7, 0x3bad, 0x3bb2, + 0x3bb6, 0x3bbb, 0x3bbf, 0x3bc3, 0x3bc6, 0x3bca, 0x3bcd, 0x3bd0, + 0x3bd3, 0x3bd6, 0x3bd8, 0x3bdb, 0x3bdd, 0x3bdf, 0x3be1, 0x3be3, + 0x3be5, 0x3be6, 0x3be8, 0x3be9, 0x3beb, 0x3bec, 0x3bed, 0x3bee, + 0x3bef, 0x3bf0, 0x3bf1, 0x3bf2, 0x3bf3, 0x3bf4, 0x3bf5, 0x3bf5, + 0x3bf6, 0x3bf6, 0x3bf7, 0x3bf8, 0x3bf8, 0x3bf9, 0x3bf9, 0x3bf9, + 0x3bfa, 0x3bfa, 0x3bfb, 0x3bfb, 0x3bfb, 0x3bfb, 0x3bfc, 0x3bfc, + 0x3bfc, 0x3bfc, 0x3bfd, 0x3bfd, 0x3bfd, 0x3bfd, 0x3bfd, 0x3bfe, + 0x3bfe, 0x3bfe, 0x3bfe, 0x3bfe, 0x3bfe, 0x3bfe, 0x3bfe, 0x3bff, + 0x3bff, + }; + + // Program LE Lut + for (size_t ii=0; ii(lutAcc.linearOnlyTable(ii)); + *linearTable = tanhFP16Lut[ii]; + } + + // Program the LE method + *lutAcc.method() = lutAcc.method_Linear(); + + // Program LE/LO offsets + DLALUTOffsetAccessor lutLEOffsetAcc = lutAcc.linearExpOffsetAccessor(); + *lutLEOffsetAcc.fracBits() = -128; // disables lut + DLALUTOffsetAccessor lutLOOffsetAcc = lutAcc.linearOnlyOffsetAccessor(); + *lutLOOffsetAcc.fracBits() = indexSel; // index_sel + + // Program LE/LO offsets, valid only for LINEAR method + *lutAcc.linearExpStart() = 0; // disabled + *lutAcc.linearExpEnd() = 0; // unused + uint32_t* pIndexOffset = reinterpret_cast(&indexOffset); + *lutAcc.linearOnlyStart() = static_cast(*pIndexOffset); // index_offset + *lutAcc.linearOnlyEnd() = 0; // unused + + // Program LE/LO slopes, 0.0f + DLASlopeAccessor leuSlopeAcc = lutAcc.linearExpUnderflowSlopeAccessor(); + *leuSlopeAcc.dataF() = 0x0000; + DLASlopeAccessor leoSlopeAcc = lutAcc.linearExpOverflowSlopeAccessor(); + *leoSlopeAcc.dataF() = 0x0000; + DLASlopeAccessor louSlopeAcc = lutAcc.linearOnlyUnderflowSlopeAccessor(); + *louSlopeAcc.dataF() = 0x0000; + DLASlopeAccessor looSlopeAcc = lutAcc.linearOnlyOverflowSlopeAccessor(); + *looSlopeAcc.dataF() = 0x0000; + + // Program priority bits + *lutAcc.hybridPriority() = lutAcc.priority_LinearOnly(); + *lutAcc.underflowPriority() = lutAcc.priority_LinearOnly(); + *lutAcc.overflowPriority() = lutAcc.priority_LinearOnly(); + } + else if (lutParams->precision == surface::NVDLA_PRECISION_INT8) + { + REPORT_ERROR(NvDlaError_BadValue, "Empty INT8 Tanh LUT"); + + // TANH, INT8, N=any, alpha=any, beta=any, k=any + // mode=EXP, start_index=0 + NvU32 startIndex = 0; + + // Program LE Lut + for (size_t ii=0; ii> 0} + DLAFloatDataAccessor leuSlopeAcc = lutAcc.linearExpUnderflowSlopeAccessor().dataIAccessor(); + *leuSlopeAcc.scale() = 0x0000; + *leuSlopeAcc.shifter() = 0x00; + DLAFloatDataAccessor leoSlopeAcc = lutAcc.linearExpOverflowSlopeAccessor().dataIAccessor(); + *leoSlopeAcc.scale() = 0x0000; + *leoSlopeAcc.shifter() = 0x00; + DLAFloatDataAccessor louSlopeAcc = lutAcc.linearOnlyUnderflowSlopeAccessor().dataIAccessor(); + *louSlopeAcc.scale() = 0x0000; + *louSlopeAcc.shifter() = 0x00; + DLAFloatDataAccessor looSlopeAcc = lutAcc.linearOnlyOverflowSlopeAccessor().dataIAccessor(); + *looSlopeAcc.scale() = 0x0000; + *looSlopeAcc.shifter() = 0x00; + + // Program priority bits + *lutAcc.hybridPriority() = lutAcc.priority_LinearExp(); + *lutAcc.underflowPriority() = lutAcc.priority_LinearExp(); + *lutAcc.overflowPriority() = lutAcc.priority_LinearExp(); + } + else + { + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Unsupported Tanh Precision: %d", lutParams->precision); + } + +fail: + return e; +} + +NvDlaError LutManager::genKey(const LutParams* params, std::string* key) const +{ + NvDlaError e = NvDlaSuccess; + + std::string type; + std::string precision; + std::string extra; + + if (!params || !key) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter); + } + + switch(params->type) + { + case LutManager::LUT_TYPE_LRN: + type += "LRN"; + break; + case LutManager::LUT_TYPE_SIGMOID: + type += "SIGMOID"; + break; + case LutManager::LUT_TYPE_TANH: + type += "TANH"; + break; + default: + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unknown lut param type %d", params->type); + } + + switch(params->precision) + { + case surface::NVDLA_PRECISION_INT8: + precision += "INT8"; + break; + case surface::NVDLA_PRECISION_INT16: + precision += "INT16"; + break; + case surface::NVDLA_PRECISION_FP16: + precision += "FP16"; + break; + default: + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unknown precision type %d", params->precision); + } + + if (params->type == LutManager::LUT_TYPE_LRN) + { + extra += toString(params->lrnParams.localSize) + "-"; + extra += toString(params->lrnParams.alpha) + "-"; + extra += toString(params->lrnParams.beta) + "-"; + extra += toString(params->lrnParams.k); + } + + *key = type; + *key += precision; + *key += extra; + +fail: + return e; +} + +NvDlaError LutManager::getHandle(const LutParams* lutParams, LutHandle* hLut) +{ + NvDlaError e = NvDlaSuccess; + std::string key; + std::map::iterator it; + + PROPAGATE_ERROR_FAIL(genKey(lutParams, &key)); + + // Search for key, create and store if no hits available + it = m_lutHandles.find(key); + if (it != m_lutHandles.end()) + { + *hLut = it->second; + } else { + // Store the next free lut handle + LutHandle newHandle = m_hNextFree; + + m_lutHandles[key] = newHandle; + m_lutParams[newHandle] = *lutParams; + + *hLut = newHandle; + + // Increment next free lut handle + m_hNextFree += 1; + } + +fail: + return e; +} + +}; //nvdla::priv +}; //nvdla:: diff --git a/umd/core/src/compiler/Makefile b/umd/core/src/compiler/Makefile new file mode 100644 index 00000000..d4a24d25 --- /dev/null +++ b/umd/core/src/compiler/Makefile @@ -0,0 +1,49 @@ +# Copyright (c) 2015-2019, NVIDIA CORPORATION. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * 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. +# * Neither the name of NVIDIA CORPORATION 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 ``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. + +ROOT := $(TOP) + +MODULE := libnvdla_compiler + +include $(ROOT)/make/macros.mk + +BUILDOUT ?= $(ROOT)/out/core/src/compiler +BUILDDIR := $(BUILDOUT)/$(MODULE) +LIB := $(BUILDDIR)/$(MODULE).so + +INCLUDES := $(ROOT)/external/protobuf-2.6/src +MODULE_COMPILEFLAGS := -g -fPIC -finline -W -Wall -Wno-multichar -Wno-unused-parameter -Wno-unused-function -Werror-implicit-function-declaration +MODULE_CFLAGS := --std=c99 +MODULE_CPPFLAGS := --std=c++11 -fexceptions -fno-rtti + +all:: $(LIB) + +include rules.mk + +# the logic to compile and link stuff is in here +$(LIB): $(ALLMODULE_OBJS) + @echo building $(MODULE) $@ + g++ -shared libprotobuf.a $(ALLMODULE_OBJS) -o $@ diff --git a/umd/core/src/compiler/Memory.cpp b/umd/core/src/compiler/Memory.cpp new file mode 100644 index 00000000..eb2bfc27 --- /dev/null +++ b/umd/core/src/compiler/Memory.cpp @@ -0,0 +1,1238 @@ +/* + * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#include // floor, log +#include +#include + +#include "priv/EngineAST.h" +#include "priv/Memory.h" +#include "priv/Profile.h" +#include "priv/Surface.h" +#include "BuddyAlloc.h" +#include "ErrorMacros.h" + +using std::endl; +using std::vector; +using std::set; +using std::unordered_set; +using std::list; +static NvU32 timestamp = 0; +const std::string red("\033[0;31m"); +const std::string green("\033[1;32m"); +const std::string yellow("\033[1;33m"); +const std::string cyan("\033[0;36m"); +const std::string magenta("\033[0;35m"); +const std::string reset("\033[0m"); + + +namespace nvdla +{ +namespace priv +{ + +SEQUENCE_ENUM_STATIC_MEMBERS(memory::LocationEnum, NvU8, MEMORY_LOCATION_ENUMS, "MemoryLocationEnum") +SEQUENCE_ENUM_STATIC_MEMBERS(memory::MemoryBufferTypeEnum, NvU8, MEMORY_BUFFER_TYPE_ENUMS, "MemoryBufferTypeEnum") +SEQUENCE_ENUM_STATIC_MEMBERS(memory::TensorCategoryEnum, NvU8, TENSOR_CATEGORY_ENUMS, "TensorCategoryEnum") + + +namespace memory +{ +Pool::~Pool () +{ + if ( m_addr_mgr ) + { + NvDlaBuddyAlloc.destruct(m_addr_mgr); + delete m_addr_mgr; + m_addr_mgr = 0; + } + if ( m_base_addr ) + { + free(m_base_addr); + m_base_addr = 0; + } +} +TensorBufferDesc::~TensorBufferDesc() { } + +NvDlaError Pool::init(PoolType pt, NvU64 poolSize, NvU32 minBufferSize) +{ + NvDlaError e = NvDlaSuccess; + NvU32 minElementSizeLog2 = 0; + + m_name = std::string(pt.c_str()); + m_type = pt; + m_size = poolSize; + m_min_buffer_size = minBufferSize; + // xxx: try to remove this alloc. surfaces can do this. + m_base_addr = malloc(poolSize); + minElementSizeLog2 = floor(log(minBufferSize)/log(2)); + m_addr_mgr = new NvDlaBuddyAllocInst; + PROPAGATE_ERROR_FAIL( NvDlaBuddyAlloc.construct(m_addr_mgr, static_cast(m_base_addr), (NvU32)poolSize, minElementSizeLog2) ); + +fail: + return e; +} + +Location Pool::location() +{ + Location ret; + switch(m_type.v()) + { + case memory::PoolTypeEnum::GLOBAL_DRAM_POOL: + case memory::PoolTypeEnum::LOCAL_DRAM_POOL: + ret = memory::LocationEnum::lDRAM; + break; + + case memory::PoolTypeEnum::LOCAL_CVSRAM_POOL: + ret = memory::LocationEnum::lCVSRAM; + break; + + default: + ret = memory::LocationEnum::lUNKNOWN; + } + return ret; +} + +NvDlaError Pool::allocate(TensorBufferDesc* bufferDesc, NvU16 batchId) +{ + NvDlaError e = NvDlaSuccess; + void* allocAddr = NULL; + NvU64 allocSize = bufferDesc->size(); + NvU64 poolOffset = 0; + + if ( allocSize == 0 ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_InvalidSize, "zero sized buffer desc"); + } + + allocAddr = NvDlaBuddyAlloc.allocate(m_addr_mgr, allocSize); + + if ( allocAddr == NULL ) + { + // this spews a message which might be too scary for the uninitiated. + // we hit this in many/typical situations... + if ( debug() ) + { + gLogInfo << name() << " mem pool exhausted, req. size=" << allocSize << std::endl; + } + e = NvDlaError_InsufficientMemory; + goto fail; + } + + poolOffset = reinterpret_cast(allocAddr) - reinterpret_cast(m_base_addr); + + bufferDesc->setAddress(allocAddr, batchId); + bufferDesc->setPool(this, batchId); + bufferDesc->setMemoryLoc(location(), batchId); + bufferDesc->setPoolOffset(poolOffset, batchId); + bufferDesc->setAllocated(batchId); + + m_size_used = std::max(m_size_used, poolOffset + allocSize); + + if ( debug() ) + { + gLogInfo << "\t\t" << name() << " alloc " << bufferDesc->id() << " @" << poolOffset << " +" << allocSize << " loc=" << (int)location().v() << std::endl; + } +fail: + return e; +} + +// +// we need to keep track of the original allocation for memlist +// entry creation. just tell the allocator to release the address +// range and don't forget about the original... +// +NvDlaError Pool::deallocate(TensorBufferDesc* bufferDesc, NvU16 batchId) +{ + NvDlaError e = NvDlaSuccess; + NvU64 buffAddr = 0; + if ( !bufferDesc->allocated(batchId) ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_InvalidState, "Attempt to deallocate an un-allocated buffer"); + } + buffAddr = reinterpret_cast(m_base_addr) + bufferDesc->poolOffset(batchId); + + if ( debug() ) + { + gLogInfo << "\t\t" << name() << " dealloc " << bufferDesc->id() << " @ " << bufferDesc->poolOffset(batchId) + << " @ " << buffAddr << std::endl; + } + + PROPAGATE_ERROR_FAIL( NvDlaBuddyAlloc.deallocate(m_addr_mgr, reinterpret_cast(buffAddr)) ); + +#if 0 + // NO, can't do this. We need a record of the alloc for + // the memory/address list generator. + bufferDesc->setAddress(NULL); + bufferDesc->setPool(NULL); + bufferDesc->setMemoryLoc(memory::LocationEnum::lUNKNOWN); + bufferDesc->setPoolOffset(0); + bufferDesc->clearAllocated(); +#endif + +fail: + return e; +} + + +NvDlaError TensorBufferDesc::addSurface(surface::TensorSurfaceDesc *tsd) +{ + NvDlaError e = NvDlaSuccess; + + if ( !tsd ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "null surface"); + } + + m_surfaces.insert(tsd); + +fail: + return e; +} + +std::set& TensorBufferDesc::surfaces() +{ + return m_surfaces; +} + + +bool TensorBufferDesc::content() const +{ + for ( std::set::iterator tsdi = m_surfaces.begin(); + tsdi != m_surfaces.end(); + ++tsdi ) + { + if ( (*tsdi)->content() ) + { + return true; + } + } + return false; +} + +bool TensorBufferDesc::bindable() const +{ + int r = false; + for ( std::set::iterator tsdi = m_surfaces.begin(); + tsdi != m_surfaces.end(); + ++tsdi ) + { + if ( debugBinding() ) + { + gLogInfo << "\t\t\t\t::Buffer buffer=" << id() << " surface=" << (*tsdi)->id() << " bindable=" << (*tsdi)->bindable() << endl; + } + if ( (*tsdi)->bindable() ) + { + r = true; + } + } + return r; +} + +NvS16 TensorBufferDesc::bindId(enum IOD &bindDomain) const +{ + NvS16 r = -1; + std::string delim(""); + + if (debugBinding() ) + { + gLogInfo << "\t\t\t\t::Buffer bindId(buffer=" << id() << ") ["; + } + + for ( std::set::iterator tsdi = m_surfaces.begin(); + tsdi != m_surfaces.end(); + ++tsdi ) + { + if ( debugBinding() ) + { + gLogInfo << delim << (*tsdi)->id() << " bind_id=" << (*tsdi)->bindable() << endl; + delim = ", "; + } + if ( (*tsdi)->bindable() ) + { + r = (*tsdi)->bindId(bindDomain); + } + } + + if (debugBinding()) + { + gLogInfo << "]" << endl; + } + + return r; +} + +surface::TensorSurfaceDesc *TensorBufferDesc::boundSurface(size_t i) const +{ + size_t n = 0; + for ( std::set::iterator tsdi = m_surfaces.begin(); + tsdi != m_surfaces.end(); + ++tsdi ) + { + if ( (*tsdi)->bindable() ) + { + if ( i == n ) + { + if ( debugBinding() ) + { + gLogInfo << "\t\t\t\t::Buffer boundSurface(i=" << i << ") -> " << (*tsdi)->id() << endl; + } + return *tsdi; + } + n++; + } + } + return 0; +} + + +/*----------------------------Resolve Memory---------------------------*/ + +// +// regarding memory-reuse: the only place it makes sense to worry +// about re-using memory is within the pools. outside of that we +// must leave the buffers in place; they can't be manipulated +// while the dla engine is working. +// further, it doesn't make much sense to bother with releasing +// global memory pooled items. those are almost always +// content-bearing and so must be initalized at 0-time and +// thereafter no new buffers are created within it (transients +// are created in "local" memory). +// so, we really only need to worry about alloc/dealloc within +// the local sdram and cvsram pools. +// +// + + +memory::MemoryResolver::MemoryResolver() : + ast::GraphVisitor(), + m_useMemPool(false), + m_useReusePooledMemory(false), + m_useGreedyEviction(false), + m_useCVSRAM(false), + m_pools(NULL), + m_localCVSRAM(NULL), + m_localSDRAM(NULL), + m_globalSDRAM(NULL), + m_debug(false), + m_inLocalPool() +{ + +} + +typedef PtrPrintIdList PrintSurfaceIds; + +NvDlaError memory::MemoryResolver::visitBegin(engine_ast::Graph *graph) +{ + m_debug = graph->debugMemoryLayout(); + + m_useMemPool = graph->profile()->useMemPool(); + m_useReusePooledMemory = graph->profile()->useReusePooledMemory(); + m_useGreedyEviction = graph->profile()->useGreedyEviction(); + m_useCVSRAM = graph->profile()->useCVSRAMAllocate(); + + m_pools = graph->resourceMgr()->memoryPools(); + + m_localCVSRAM = &(*m_pools)[memory::PoolTypeEnum::LOCAL_CVSRAM_POOL]; + m_localSDRAM = &(*m_pools)[memory::PoolTypeEnum::LOCAL_DRAM_POOL]; + m_globalSDRAM = &(*m_pools)[memory::PoolTypeEnum::GLOBAL_DRAM_POOL]; + + if ( m_debug ) + { + gLogInfo << "begin memory resolver pooling=" << m_useMemPool << + " reuse=" << m_useReusePooledMemory << " greedy_eviction=" << m_useGreedyEviction << endl; + gLogInfo << "\tlocal cvsram size=" << m_localCVSRAM->size() << " local sdram size=" << m_localSDRAM->size() << + " global sdram size=" << m_globalSDRAM->size() << endl; + } + + return NvDlaSuccess; +} + +NvDlaError memory::MemoryResolver::tryAllocInsidePool(engine_ast::Node* node, + surface::TensorSurfaceDesc* tsd, + memory::TensorBufferDesc* tbd, + vector& tryPools, + bool isAUX, bool& retry) +{ + NvDlaError e = NvDlaSuccess; + memory::Pool *batchCommonPool = 0; + memory::Pool *selectedPool = 0; + NvU32 numBatches = node->graph()->profile()->multiBatchSize(); + + // + // try allocating buffers for all batches, however aux buffers are + // allocated only once and shared among all batches + // + for (NvU32 nn = 0; nn < numBatches; ++nn) + { + selectedPool = 0; + for ( size_t pi = 0; pi < tryPools.size(); ++pi ) + { + // aux buffers are allocated once and shared among all batches + if (isAUX && nn > 0) + { + selectedPool = batchCommonPool; + tbd->setAddress(tbd->address(/*batchId*/0), /*batchId*/nn); + tbd->setPoolOffset(tbd->poolOffset(/*batchId*/0)); + tbd->setAllocated(/*batchId*/nn); + break; + } + + // for non-aux buffers, attempt to allocate + e = tryPools[pi]->allocate(tbd, /*batchId*/nn); + if ( m_debug ) + { + std::string tensorType = isAUX ? "AUX" : + (tsd->producers().find(node) != tsd->producers().end() ? "OUTPUT" : "INPUT"); + gLogInfo << "[MEMTOOL] t = " << timestamp << "\t" + << node->name() << "'s\t" << tensorType << "\t" + << tbd->id() << "-B" << nn << red << "\tALLOC " << reset << endl; + timestamp++; + } + + // if alloc succeeded in a pool, move on to next batch + if ( e == NvDlaSuccess ) + { + selectedPool = tryPools[pi]; + if (nn == 0) + { + batchCommonPool = selectedPool; + } + else if ((selectedPool != batchCommonPool) && m_debug) + { + // FIXME: In future allow buffers for different batches to live in different pools + //ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Pool for batch %d : %s is not " + /*ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Pool for batch %d : %s is not " + "the same as that for batch 0(%s)", + nn, selectedPool->name().c_str(), + batchCommonPool->name().c_str());*/ + gLogInfo << "Pool for batch " << nn << ":" << selectedPool->name() + << " is not the same as that for batch 0:" << batchCommonPool->name() << endl; + } + break; + } + // if this is the last try pool and if that failed too, return error + else if ( pi == (tryPools.size() - 1) ) + { + goto fail; + } + // else try next pool + + } // finish try pools + + if ( selectedPool ) + { + if ( selectedPool == m_localSDRAM || selectedPool == m_localCVSRAM ) + { + m_inLocalPool.insert(tsd); + } + } + else + { + // + // if any of the batches fail to fit, deallocate pool spaces for all of them and error. + // something might free-up and a retry is useful for the buffer for all batches. + // don't spew a scary message yet as it might be ok. + // + retry = true; + for (NvU32 kk = 0; kk <= nn; ++kk) + { + ORIGINATE_ERROR_FAIL(selectedPool->deallocate(tbd, kk)); + tbd->setAddress(NULL, /*batchId*/kk); + tbd->setPoolOffset(0, /*batchId*/kk); + tbd->clearAllocated(/*batchId*/kk); + } // finish dealloc for allocated batches + e = NvDlaError_InsufficientMemory; + goto fail; + } + + if ( m_debug ) + { + gLogInfo << "\t\t\tplaced " << tbd->id() << " batch-" << nn << " inside " << selectedPool->name() + << "@" << tbd->poolOffset(nn) << endl; + } + + } // finish alloc for all batches + +fail: + return e; +} + +NvDlaError memory::MemoryResolver::tryAllocOutsidePool(engine_ast::Node* node, + surface::TensorSurfaceDesc* tsd, + memory::TensorBufferDesc* tbd, + bool isAUX) +{ + NvDlaError e = NvDlaSuccess; + NvU64 allocSize = tbd->size(); + void* allocAddr = 0; + NvU32 numBatches = node->graph()->profile()->multiBatchSize(); + + if ( allocSize == 0 ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_InvalidSize, "zero sized buffer desc"); + } + + if ( isAUX ) + { + allocAddr = new NvU8[allocSize]; + if ( allocAddr == NULL ) + { + // note: cannot be retried. compile-time memory size problem. + ORIGINATE_ERROR_FAIL(NvDlaError_InsufficientMemory, + "mem exhausted, req. size: %lld", allocSize); + } + } + + // + // aux tensors are shared among all batches; whereas + // actual memory allocation for non-pooled non-aux buffers + // happen someplace else (in runtime::loadMemory()) - so no mem alloc for them + // + for (NvU32 nn = 0; nn < numBatches; ++nn) + { + if ( isAUX ) + { + tbd->setAddress(allocAddr, nn); + } + tbd->setPool(0, nn); + tbd->setPoolOffset(0, nn); + tbd->setMemoryLoc(memory::LocationEnum::lDRAM, nn); + tbd->setAllocated(nn); + + if ( m_debug ) + { + gLogInfo << "\t\t\tplaced " << tsd->id() << "/" << tbd->id() << " batch-" << nn << " inside DRAM " + << "@" << tbd->address(nn) << endl; + } + } + +fail: + return e; +} +NvDlaError memory::MemoryResolver::resolveSurfacePlacement(engine_ast::Node *node, + surface::TensorSurfaceDesc *tsd, + memory::TensorBufferDesc *tbd, + bool isAUX, bool &retry, + bool allowFallback) +{ + NvDlaError e = NvDlaSuccess; + retry = false; + + // + // dont allow pooling on buffers that are bindable by the app, + // even if it may have been split by compiler + // + bool pooling = m_useMemPool && !(tbd->bindable() || tsd->copyOutDebugSurface()); + + if ( m_debug ) + { + gLogInfo << "\t\tresolve placement/alloc for tsd=" << tsd->id() << "/" << tbd->id() << + " aux=" << isAUX << " pooling=" << pooling << endl; + } + + if ( pooling ) + { + // + // pooling enabled. determine which pool(s) to try. + // first/best choice is tryPools[0] and any fallbacks + // are after. + // + vector tryPools; + + if ( isAUX ) + { + tryPools.push_back(m_globalSDRAM); + } + else + { + bool emuDetected = tsd->referencedByEMU(); + + if ( m_useCVSRAM && !emuDetected ) + { + // can't allow cvsram if EMU is involved. + tryPools.push_back(m_localCVSRAM); + } + tryPools.push_back(m_localSDRAM); + } + + // + // cull fallbacks if we don't want to allow them + // + if ( (tryPools.size() > 1) && !allowFallback ) + { + tryPools.erase( tryPools.begin()+1, tryPools.end() ); + } + + // + // now try allocating buffers for all batches + // + PROPAGATE_ERROR_FAIL(tryAllocInsidePool(node, tsd, tbd, tryPools, isAUX, retry)); + } + else + { + PROPAGATE_ERROR_FAIL(tryAllocOutsidePool(node, tsd, tbd, isAUX)); + } + + // if ( m_debug ) { gLogInfo << "\t\tend place tsd=" << tsd->id() << " e=" << int(e) << endl; } + + + +fail: + return e; +} + +// records earliest annotationId a deallocation becomes possible for a surface. +//typedef std::pair DeallocableSurface; + +#if 0 +// if deallocables is a vector use this to sort using std::sort +struct DeallocableSorter +{ + bool operator() (memory::MemoryResolver::DeallocableSurface i, memory::MemoryResolver::DeallocableSurface j) + { + bool i_lt_j = i.first < j.first; + return i_lt_j; + } + +}; +#else + +// if deallocables is a list then use this to sort using list::sort +static bool CompareDeallocable(const memory::MemoryResolver::DeallocableSurface &i, + const memory::MemoryResolver::DeallocableSurface &j) +{ + return i.first < j.first; +} +#endif + + +// +// this functor is called over the set of allocations +// which could possibly be released. it runs in the context of a +// specific node's annotationId. it's purpose is to determine +// which, if any of those surfaces could be deallocated at that point. +// + +class CheckSurfaceRelease +{ +public: + CheckSurfaceRelease(engine_ast::Node *atNode, + list &deallocable) : + m_atNode(atNode), + m_deallocable(deallocable) {} + + ~CheckSurfaceRelease() { } + + void operator()(surface::TensorSurfaceDesc * surface) + { + NvDlaError e = NvDlaSuccess; + int atId = m_atNode->dependencyParams().annotationId(); + if ( atId < 0 ) + { + THROW_ERROR(NvDlaError_InvalidState, "check surface release on bogus op?"); + } + + // gLogInfo << "\t\t\tcheck surface release: " << surface->id() << " at node " << m_atNode->id() << endl; + + const engine_ast::Graph::NodeUnorderedSet &consumers = surface->consumers(); + engine_ast::Graph::NodeUnorderedSet::const_iterator + cbegin = consumers.begin(), + cend = consumers.end(), + ci; + + // + // last scheduled reference is max of these. + // + int lastRefId = -1; + for ( ci = cbegin; ci != cend; ++ci ) + { + lastRefId = std::max(lastRefId, (*ci)->dependencyParams().annotationId()); + } + + if ( lastRefId == -1 ) + { + // gLogWarning << "detected a surface without any consumers?" << endl; + // don't free it, it's bogus but worst case it jams things up? + return; // THROW_ERROR(NvDlaError_InvalidState, "detected a surface w/o any consumers?"); + } + + // + // if lastRefId is in the past, and + // if its not that of a fused upstream node, + // then release is possible. + // + int fusedUpstreamNodeId = m_atNode->dependencyParams().fusedNode(engine_ast::IODirectionEnum::INPUT) ? + m_atNode->dependencyParams().fusedNode(engine_ast::IODirectionEnum::INPUT)->dependencyParams().annotationId() : -1; + if ( lastRefId < atId && lastRefId != fusedUpstreamNodeId) + { + memory::TensorBufferDesc *tbd = surface->tensorBufferDesc(); + if ( !tbd ) + { + THROW_ERROR(NvDlaError_InvalidState, "no buffer for surface %s", surface->id().c_str()); + } + memory::Pool *pool = tbd->pool(); + if ( !pool ) + { + THROW_ERROR(NvDlaError_InvalidState, "no pool assigned to surface/buffer %s/%s", + surface->id().c_str(), tbd->id().c_str() ); + } + + m_deallocable.push_back( memory::MemoryResolver::DeallocableSurface(lastRefId, surface) ); + } + + } + +protected: + engine_ast::Node *m_atNode; + list< memory::MemoryResolver::DeallocableSurface > &m_deallocable; +}; + + + + + + +NvDlaError memory::MemoryResolver::placeSurfaceContent(engine_ast::Node *node, + surface::TensorSurfaceDesc *tsd) +{ + NvDlaError e = NvDlaSuccess; + memory::TensorBufferDesc *tbd; + + if ( !tsd ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_InvalidState, "no suface"); + } + tbd = tsd->tensorBufferDesc(); + + if ( !tbd ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_InvalidState, "no buffer for surface"); + } + if ( tsd->bufferOffset() != 0 ) + { + ORIGINATE_ERROR_FAIL( NvDlaError_InvalidState, "not expecting non-zero buffer offset for aux data"); + } + if ( tsd->size() != tbd->size() ) + { + ORIGINATE_ERROR_FAIL( NvDlaError_InvalidState, "not expecting differing sizes on aux data buffer vs. surface"); + } + + if ( ! tsd->content() ) + { + if ( m_debug ) + { + gLogInfo << "\t\t\ttsd=" << tsd->id() << " set content pooled=" << (tbd->pool() ? true : false) << endl; + } + + tsd->setContent( node->getAuxData(tsd->parentEdge()) ); + + if ( tbd->pool() ) + { + tbd->pool()->insertContent( tsd ); + } + } + +fail: + return e; +} + + +// +// resolveHazards can be called before annotation. +// +NvDlaError memory::MemoryResolver::resolveHazards(engine_ast::Node *op, vector< SurfacePair > &collisions) +{ + NvDlaError e = NvDlaSuccess; + engine_ast::Graph *graph = op->graph(); + + for ( size_t ci = 0, CI = collisions.size(); ci != CI; ++ci ) + { + surface::TensorSurfaceDesc *newer = collisions[ci].first; + surface::TensorSurfaceDesc *older = collisions[ci].second; + + // create a hazard dependency between the nodes at which + // the operations occur. such that the op(s?) involved in + // the newer use of the surface wait for the older ones + // to complete. i.e: older +++> newer + + for ( unordered_set::const_iterator readi = older->consumers().begin(); + readi != older->consumers().end(); ++readi ) + { + for ( unordered_set::const_iterator writej = newer->producers().begin(); + writej != newer->producers().end(); ++writej ) + { + if ( readi == writej ) + { + // continue as it makes no sense to wait on yourself. + // shouldn't happen but at least don't freak anything out. + gLogInfo << "warning: hazard waiting on ourselves? " << (*readi)->id() << " vs. " << (*writej)->id() << endl; + continue; + } + + if ( (*writej)->dependsOn(*readi, engine_ast::viaComputeHazard, engine_ast::allowDataCompute ) ) + { + // already there. + if ( graph->debugMemHazards() ) + { + gLogInfo << "info: hazard avoided: " << (*writej)->id() << " already depends on " << (*readi)->id() << endl; + } + continue; + } + else if ( (*readi)->dependsOn(*writej, engine_ast::viaComputeHazard, engine_ast::allowDataCompute) ) + { + // adding a hazard here would cause a cycle. uh? + //ORIGINATE_ERROR_FAIL( NvDlaError_InvalidState, "failed due to memory hazard induced compute dependency cycle"); + if ( graph->debugMemHazards() ) + { + gLogInfo << "warning: hazard cycle?" << (*readi)->id() << " depends on " << (*writej)->id() << " ???" << endl; + } + } + else + { + Edge *hazardEdge = graph->addHazardEdge(*readi, *writej); + if ( graph->debugMemHazards() ) + { + gLogInfo << "\tinserted hazard edge=" << hazardEdge->id() << " between nodes " << + (*readi)->name() << " and " << (*writej)->name() << + " to resolve memory reuse hazard" << endl; + } + } + } + } + } + + // fail: + return e; +} + +typedef list SurfaceList; +typedef vector SurfaceVector; + +struct AllocInfo +{ + AllocInfo(surface::TensorSurfaceDesc * s, memory::TensorBufferDesc *b, bool a) : + m_surface(s), m_buffer(b), m_isAUX(a) { } + + AllocInfo(const AllocInfo &o) : + m_surface(o.m_surface), m_buffer(o.m_buffer), m_isAUX(o.m_isAUX) { } + + AllocInfo() : m_surface(NULL), m_buffer(NULL), m_isAUX(false) { } + + surface::TensorSurfaceDesc * m_surface; + memory::TensorBufferDesc *m_buffer; + bool m_isAUX; +}; + +// +// called during resolveMemory() +// +NvDlaError memory::MemoryResolver::visitNode(Node *node) +{ + NvDlaError e = NvDlaSuccess; + + SurfaceList auxSurfaces, inputSurfaces, outputSurfaces, ioSurfaces; + + SurfaceList allocated; + SurfaceList::iterator allocatedi; + + list deallocable; + CheckSurfaceRelease checkSurfaceRelease(node, deallocable); + + vector collisions; + + vector tryAllocs, retryAllocs; + + vector< SurfaceList *> surfaceLists; + + // set up some references for later. + surfaceLists.push_back(&inputSurfaces); + surfaceLists.push_back(&auxSurfaces); + surfaceLists.push_back(&ioSurfaces); + surfaceLists.push_back(&outputSurfaces); + + // + // unless we're doing greedy eviction we won't try to free + // until after the first attempt to allocate. + // + bool okToFree = false || m_useGreedyEviction; + int numFreed = 0; + bool allowFallback = false; + + if ( !node ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "invalid element"); + } + if ( node->dependencyParams().annotationId() == -1 ) + { + // skip + goto fail; + } + + // + // setup orthogonal lists for input, output, in/out and aux surfaces + // + { + SurfaceVector vin = node->inputSurfaces(), vaux = node->auxSurfaces(), vout = node->outputSurfaces(); + + inputSurfaces.insert (inputSurfaces.end(), vin.begin(), vin.end()); + auxSurfaces.insert (auxSurfaces.end(), vaux.begin(), vaux.end()); + outputSurfaces.insert(outputSurfaces.end(), vout.begin(), vout.end()); + // + // pull any surfaces which are on both sides to the ioSurface set + // this is likely to be stream tensors if at all. + // + for ( SurfaceList::iterator isi = inputSurfaces.begin(); isi != inputSurfaces.end(); ++isi ) + { + if ( std::find(outputSurfaces.begin(), outputSurfaces.end(), *isi) != outputSurfaces.end() ) + { + ioSurfaces.push_back(*isi); + } + } + for ( SurfaceList::iterator iosi = ioSurfaces.begin(); iosi != ioSurfaces.end(); ++iosi) + { + inputSurfaces.remove(*iosi); + outputSurfaces.remove(*iosi); + } + } + + if ( m_debug ) + { + gLogInfo << "\tnode=" << node->name() << " anno=" << node->taskId() << "." << + node->dependencyParams().annotationId(); + gLogInfo << " in=["; std::for_each(inputSurfaces.begin(), inputSurfaces.end(), PrintSurfaceIds()); + gLogInfo << "] aux=["; std::for_each(auxSurfaces.begin(), auxSurfaces.end(), PrintSurfaceIds()); + gLogInfo << "] io=["; std::for_each(ioSurfaces.begin(), ioSurfaces.end(), PrintSurfaceIds()); + gLogInfo << "] out=["; std::for_each(outputSurfaces.begin(), outputSurfaces.end(), PrintSurfaceIds()); + gLogInfo << "]" << endl; + +#if 0 + if ( m_inLocalPool.size() ) + { + gLogInfo << "\t\tsurfaces in local pools=" << m_inLocalPool.size() << " ["; + std::for_each(m_inLocalPool.begin(), m_inLocalPool.end(), PrintSurfaceIds()); + gLogInfo << "]" << endl; + + } +#endif + } + + + // + // run consistency checks and/or culling applicable to all surfaces + // + for ( size_t sli = 0, SLI = surfaceLists.size(); sli != SLI; ++sli ) + { + SurfaceVector toRemove; + + for ( SurfaceList::iterator si = surfaceLists[sli]->begin(); si != surfaceLists[sli]->end(); ++si ) + { + surface::TensorSurfaceDesc *tsd = *si; + memory::TensorBufferDesc *tbd = tsd->tensorBufferDesc(); + + if ( tsd->tensorCategory().e() == memory::TensorCategoryEnum::UNKNOWN_TENSOR ) + { + ORIGINATE_ERROR_FAIL( NvDlaError_InvalidState, "unknown tensor type"); + } + + if ( tsd->tensorCategory().e() == memory::TensorCategoryEnum::STREAM_TENSOR ) + { + if ( m_debug ) { gLogInfo << "\t\ttsd=" << tsd->id() << " (stream tensor)" << endl; } + toRemove.push_back(tsd); + continue; + } + + if ( !tbd ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_InvalidState, "no buffer for tsd=%s", tsd->id().c_str()); + } + + if ( tbd->allocated() ) + { + toRemove.push_back(tsd); + } + } + + for ( size_t ri = 0, RI = toRemove.size(); ri != RI; ++ri ) + { + surfaceLists[sli]->remove(toRemove[ri]); + } + } + + + // + // prime the set of buffers which we (still) need to place. + // + for ( SurfaceList::iterator si = inputSurfaces.begin(); si != inputSurfaces.end(); ++si) + { + tryAllocs.push_back(AllocInfo(*si, (*si)->tensorBufferDesc(), false /*not aux*/)); + } + for ( SurfaceList::iterator si = auxSurfaces.begin(); si != auxSurfaces.end(); ++si) + { + tryAllocs.push_back(AllocInfo(*si, (*si)->tensorBufferDesc(), true /*aux*/)); + } + for ( SurfaceList::iterator si = ioSurfaces.begin(); si != ioSurfaces.end(); ++si) + { + tryAllocs.push_back(AllocInfo(*si, (*si)->tensorBufferDesc(), false /*not aux*/)); + } + for ( SurfaceList::iterator si = outputSurfaces.begin(); si != outputSurfaces.end(); ++si) + { + tryAllocs.push_back(AllocInfo(*si, (*si)->tensorBufferDesc(), false /*not aux*/)); + } + + // + // find surfaces which can be freed. note that the surfaces checked + // are only those which were allocated out of a local pool. + // + CATCH_ERROR_FAIL( std::for_each(m_inLocalPool.begin(), m_inLocalPool.end(), checkSurfaceRelease) ); + + deallocable.sort( CompareDeallocable ); // sorted on annotationId + + do + { + // + // greedy -> free everything which can be (m_useGreedyEviction) + // !greedy-> free one buffer (numFreed) per pass but only after the first pass (okToFree) + // + numFreed = 0; + + while ( (deallocable.begin() != deallocable.end()) && ( m_useGreedyEviction || (okToFree && !numFreed)) ) + { + surface::TensorSurfaceDesc *tsd = deallocable.begin()->second; + memory::TensorBufferDesc *tbd = tsd->tensorBufferDesc(); + memory::Pool *pool; + + if ( !tbd ) + { + THROW_ERROR(NvDlaError_InvalidState, "no buffer for surface %s", tsd->id().c_str()); + } + + pool = tbd->pool(); + if ( !pool ) + { + THROW_ERROR(NvDlaError_InvalidState, "no pool assigned to surface/buffer %s/%s", + tsd->id().c_str(), tbd->id().c_str() ); + } + + // + // the address free happens here. + // + if ( m_debug ) + { + gLogInfo << "\t\t\tdeallocating " << tsd->id() << "/" << tbd->id() + << "@" << tbd->address(0) << endl; + } + + PROPAGATE_ERROR_THROW( pool->deallocate(tbd) ); + if ( m_debug ) + { + gLogInfo << "[MEMTOOL] t = " << timestamp << "\t" + << tbd->id() << "-B0" << green << "\tDEALLOC " << reset << endl; + timestamp++; + } + + m_inLocalPool.erase( tsd ); + + m_deallocated.push_back( DeallocableSurface(node->dependencyParams().annotationId(), deallocable.begin()->second) ); + + deallocable.pop_front(); + + numFreed++; + } + + allowFallback = (deallocable.begin() == deallocable.end()); + + // + // try allocs and record any need to retry + // + for ( size_t ti = 0, TI = tryAllocs.size(); ti != TI; ++ti ) + { + bool retry; + + AllocInfo &ai = tryAllocs[ti]; + e = resolveSurfacePlacement(node, + ai.m_surface, ai.m_buffer, + ai.m_isAUX, retry, allowFallback); + // + // surface placement is successful if it happens for all batches successfully + // + if ( e == NvDlaSuccess ) + { + allocated.push_back(ai.m_surface); + if ( ai.m_isAUX ) + { + PROPAGATE_ERROR_FAIL( placeSurfaceContent(node, ai.m_surface) ); + } + } + else + { + if ( e == NvDlaError_InsufficientMemory && retry ) + { + retryAllocs.push_back(ai); + } + else + { + PROPAGATE_ERROR_FAIL(e); + } + } + } + + // + // setup for next pass + // + okToFree = true; // at least one pass happened, ok to free now if needed + + if ( m_debug ) + { + if ( retryAllocs.size() ) + { + gLogInfo << "\t\tretry surface placement after deallocating: num surface retries:" << retryAllocs.size() << + " any deallocables? " << !(deallocable.begin() == deallocable.end()) << endl; + } + } + + tryAllocs = retryAllocs; + retryAllocs.clear(); + + // + // keep going as long as we need mem and there's something which can be freed + // + + } while ( tryAllocs.size() && (deallocable.begin() != deallocable.end()) ); + + + if ( tryAllocs.size() ) + { + ORIGINATE_ERROR_FAIL( NvDlaError_InsufficientMemory, "couldn't place all buffers for annotationId %d.%d", + node->taskId(), node->dependencyParams().annotationId()); + } + + // + // all necessary allocations succeeded. check for overlaps with surfaces which + // were previously deallocated. anything allocated at a prior node/annotationId + // would have been resolved there... xxx is that accurate? + // + + for ( allocatedi = allocated.begin(); allocatedi != allocated.end(); ++allocatedi ) + { + PROPAGATE_ERROR_FAIL( findReuseHazards(node, *allocatedi, collisions) ); + } + + if ( collisions.size() ) + { + PROPAGATE_ERROR_FAIL( resolveHazards(node, collisions) ); + } + + fail: + + if ( m_debug ) + { + gLogInfo << "\tdone node=" << node->name() << " rc=" << (int)e << endl; + } + return e; +} + +NvDlaError memory::MemoryResolver::findReuseHazards(engine_ast::Node *, surface::TensorSurfaceDesc *tsd, + vector< memory::MemoryResolver::SurfacePair > &collisions) +{ + NvDlaError e = NvDlaSuccess; + + memory::TensorBufferDesc *tbd = tsd->tensorBufferDesc(); + memory::Pool *pool; + + pool = tbd->pool(); + if ( !pool ) + { + // nothing to do... can't possibly be re-using if not in a pool. + goto fail; + } + + for ( list< DeallocableSurface >::iterator i = m_deallocated.begin(); i != m_deallocated.end(); ++i ) + { + surface::TensorSurfaceDesc *vs_tsd = 0; + memory::TensorBufferDesc *vs_tbd = 0; + vs_tsd = i->second; + vs_tbd = vs_tsd->tensorBufferDesc(); + + if ( vs_tbd->pool() != pool ) + { + // not in the same pool... no collision. + continue; + } + + NvU64 vsSurfaceBegin = vs_tbd->poolOffset(); + NvU64 vsSurfaceEnd = vsSurfaceBegin + vs_tbd->size(); + NvU64 surfaceBegin = tbd->poolOffset(); + // NvU64 surfaceEnd = surfaceBegin + tbd->size(); + + if ( (surfaceBegin > vsSurfaceBegin) && (surfaceBegin < vsSurfaceEnd) ) + { + // there's an overlap here. + collisions.push_back(SurfacePair(tsd, vs_tsd)); + } + } + + if ( m_debug ) + { + if ( collisions.size() ) + { + std::string delim(""); + gLogInfo << "detected memory reuse hazard(s) in pool " << pool->name() << ": allocated tsd=" << tsd->id() << + " vs. deallocated tsd(s)=["; + + for ( size_t ci = 0, CI = collisions.size(); ci != CI; ++ci ) + { + // there's an overlap here. + gLogInfo << delim << collisions[ci].second->id(); + delim = ", "; + } + gLogInfo << "]" << endl; + } + + } + + fail: + return e; +} + +// +// note: at the first non-NvDlaSuccess return from any of these... visitGraphEnd will be +// called with that error code as 've'. +// +NvDlaError memory::MemoryResolver::visitEnd(engine_ast::Graph *, NvDlaError ve) +{ + + if ( m_debug ) { gLogInfo << "end memory resolver" << endl; } + return ve; +} + +}; // nvdla::priv::memory + + +}; // nvdla::priv +}; // nvdla diff --git a/umd/core/src/compiler/Network.cpp b/umd/core/src/compiler/Network.cpp new file mode 100644 index 00000000..a308d0a1 --- /dev/null +++ b/umd/core/src/compiler/Network.cpp @@ -0,0 +1,1099 @@ +/* + * Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#include +#include +#include +#include + +#include "priv/CanonicalAST.h" +#include "priv/Check.h" +#include "priv/Layer.h" +#include "priv/Network.h" +#include "priv/Tensor.h" +#include "priv/Wisdom.h" +#include "priv/WisdomContainer.h" + +using std::map; +using std::vector; +using std::string; +using std::endl; +using std::stringstream; + +namespace nvdla { + +INetwork::INetwork() { } +INetwork::~INetwork() { } + +INetwork *createNetwork() +{ + priv::NetworkFactory::NetworkPrivPair n = priv::NetworkFactory::newNetwork(); + return n.i(); +} + +NvDlaError destroyNetwork(INetwork *network) +{ + NvDlaError e = NvDlaSuccess; + PROPAGATE_ERROR_FAIL(priv::NetworkFactory::deleteNetwork(network)); + +fail: + return e; +} + +// TBD: why is this not Network +Dims2 INetwork::NetworkDefaultConvolutionFormula::compute(Dims2 input, Dims2 kernel, + Dims2 stride, Dims2 tlPadding, Dims2 brPadding, const char*) const +{ + return Dims2((input.h + tlPadding.h + brPadding.h - kernel.h) / stride.h + 1, + (input.w + tlPadding.w + brPadding.w - kernel.w) / stride.w + 1); +} + +Dims2 INetwork::NetworkDefaultConvolutionFormula::compute(Dims2 input, Dims2 kernel, + Dims2 stride, Dims2 tlPadding, Dims2 brPadding, Dims2 dilation, const char*) const +{ + NvS32 dilatedH = (kernel.h - 1)*dilation.h + 1; + NvS32 dilatedW = (kernel.w - 1)*dilation.w + 1; + return Dims2((input.h + tlPadding.h + brPadding.h - dilatedH) / stride.h + 1, + (input.w + tlPadding.w + brPadding.w - dilatedW) / stride.w + 1); +} + +Dims2 INetwork::NetworkDefaultDeconvolutionFormula::compute(Dims2 input, Dims2 kernel, + Dims2 stride, Dims2 tlPadding, Dims2 brPadding, const char*) const +{ + // exact inverse of the computation for convolution forward + return Dims2((input.h - 1) * stride.h + kernel.h - (tlPadding.h + brPadding.h), + (input.w - 1) * stride.w + kernel.w - (tlPadding.w + brPadding.w)); +} + +Dims2 INetwork::NetworkDefaultDeconvolutionFormula::compute(Dims2 input, Dims2 kernel, + Dims2 stride, Dims2 tlPadding, Dims2 brPadding, Dims2 dilation, const char*) const +{ + NvS32 dilatedH = (kernel.h - 1)*dilation.h + 1; + NvS32 dilatedW = (kernel.w - 1)*dilation.w + 1; + // exact inverse of the computation for convolution forward + return Dims2((input.h - 1) * stride.h + dilatedH - (tlPadding.h + brPadding.h), + (input.w - 1) * stride.w + dilatedW - (tlPadding.w + brPadding.w)); +} + +Dims2 INetwork::NetworkDefaultPoolingFormula::compute(Dims2 input, Dims2 kernel, + Dims2 stride, Dims2 tlPadding, Dims2 brPadding, const char*) const +{ + int pooledH, pooledW; + pooledH = static_cast + (ceil(static_cast(input.h + tlPadding.h + brPadding.h - kernel.h) / stride.h)) + 1; + pooledW = static_cast + (ceil(static_cast(input.w + tlPadding.w + brPadding.w - kernel.w) / stride.w)) + 1; + + + if (tlPadding.h || tlPadding.w) + { + // DS: caffe comment for this (which doesn't work if padding is very large) is: + // "If we have padding, ensure that the last pooling starts strictly inside the image (instead of at the padding); otherwise clip the last." + if ((pooledH - 1) * stride.h >= input.h + tlPadding.h) + --pooledH; + if ((pooledW - 1) * stride.w >= input.w + tlPadding.w) + --pooledW; + + assert((pooledH - 1) * stride.h < input.h + tlPadding.h); + assert((pooledW - 1) * stride.w < input.w + tlPadding.w); + } + + return Dims2(pooledH, pooledW); +} + +namespace priv { + + + +static INetwork::NetworkDefaultConvolutionFormula sDefaultConvDims; +static INetwork::NetworkDefaultDeconvolutionFormula sDefaultDeconvDims; +static INetwork::NetworkDefaultPoolingFormula sDefaultPoolingDims; + +NetworkFactory::NetworkPrivPair NetworkFactory::newNetwork() +{ + INetwork *network; + Network *network_priv; + network = network_priv = new priv::Network(); + if (network) { + s_priv.insert(network, network_priv); + s_self.insert(network, network); + } + return NetworkPrivPair(network, network_priv); +} + +NvDlaError NetworkFactory::deleteNetwork(INetwork *network) +{ + if (network != NULL) { + Network *network_priv = priv(network); + if (network_priv != NULL) { + delete network_priv; + } + + s_priv.remove(network); + s_self.remove(network); + } + + return NvDlaSuccess; +} + +Network *NetworkFactory::priv(INetwork *network) +{ + BiMap::left_iterator f = s_priv.find_left(network); + + if ( f == s_priv.end_left() ) { + return NULL; + } + return f->second; +} + +INetwork *NetworkFactory::i(Network *network) +{ + BiMap::right_iterator f = s_priv.find_right(network); + if ( f == s_priv.end_right() ) { + return NULL; + } + return f->second; +} + +INetwork *NetworkFactory::self(void *s) +{ + BiMap::left_iterator f = s_self.find_left(s); + if ( f == s_self.end_left() ) { + return NULL; + } + return f->second; +} + + +INetwork *NetworkFactory::deserializeFrom(WisdomContainerEntry *entry) +{ + // gLogError << __func__ << endl; + bool ok = true; + NVDLA_UNUSED(ok); + INetwork *network = NULL; + + if ( entry->type() != IWisdomContainerEntry::ENTRY_TYPE_OBJECT ) { + gLogError << __func__ << " container should be of object type" << endl; + goto done; + } + + // only one type of network right now (INetwork/Network)... + //WisdomContainerEntry factory_type_entry; + // NetworkTypeEnum factory_type; + // NvU32 v; + // ok = entry->getEntry("factory_type", IWisdomContainerEntry::ENTRY_TYPE_UINT32, &factory_type_entry); + // ok = ok && factory_type_entry.readUInt32(v); + // if ( !ok ) { + // goto done; + // } + //factory_type = LayerTypeEnum::underlying_type(v); + //ok = factory_type.valid(); + //if ( !ok ) { + // goto done; + // } + + // switch ( factory_type.e() ) + // { + // case NetworkFactoryType::canonical_ast: + network = deserializeNetwork(entry); + //default: + // but, shouldn't be possible since l_type.valid() is true... + // ok = false; + // goto done; + // } + + + done: + return network; +} + +BiMap NetworkFactory::s_priv; +BiMap NetworkFactory::s_self; + +// there's only one type of "Tensor" for now. so only one of these... so it looks +// silly. see the same paths in "LayerFactory::deserialize*" for why it makes sense +// to organize this way preemptively. +INetwork *NetworkFactory::deserializeNetwork(WisdomContainerEntry *entry) +{ + // gLogError << __func__ << endl; + NetworkFactory::NetworkPrivPair n = NetworkFactory::newNetwork(); + if ( !n ) { + gLogError << __func__ << " error allocating new network" << endl; + return NULL; + } + n.priv()->deserializeFrom(entry); + return n.i(); +} + + +Network::Network() : + mConvDims(&sDefaultConvDims), + mDeconvDims(&sDefaultDeconvDims), + mPoolDims(&sDefaultPoolingDims) +{ + +} + +NvU16 Network::getFactoryType() const +{ + return 0; // only one type of network so far, not complicated by factory splits +} + + +IConvolutionLayer* Network::addConvolution(ITensor* inputTensor, int numOutputChannels, int paddingValue, + Dims2 kernelSize, Dims2 tlPadding, Dims2 brPadding, Dims2 stride, Dims2 dilation, + Weights kernelWeights, + Weights biasWeights, BiasMode biasMode, int numGroups) +{ + API_CHECK_NULL_RET_NULL(inputTensor); + API_CHECK_RETVAL(numOutputChannels >= 1 && numOutputChannels < MAX_OUTPUT_MAPS, 0 ); + API_CHECK_RETVAL(kernelSize.h > 0, 0); + API_CHECK_RETVAL(kernelSize.w > 0, 0); + API_CHECK_RETVAL((kernelSize.h * kernelSize.w) < MAX_KERNEL_DIMS_PRODUCT, 0); + API_CHECK_WEIGHTS_RETVAL(kernelWeights, 0); + API_CHECK_WEIGHTS0_RETVAL(biasWeights, 0); + API_CHECK_ENUM_RANGE_RETVAL(BiasMode, biasMode, 0); + + string name = newLayerName(); + + ITensor* output = addTensor(newTensorName()); + Tensor* output_priv = TensorFactory::priv(output); + NVDLA_UNUSED(output_priv); + + ConvolutionLayerDiamond d = + LayerFactory::newConvolutionLayer(this, name, + inputTensor, + output, numOutputChannels, paddingValue, + kernelSize, tlPadding, brPadding, stride, dilation, + kernelWeights, biasWeights, biasMode, numGroups); + + output->setDimensions( d.derived().priv()->getOutputDimensions() ); + + + mLayers.push_back(d.base().i()); + return d.derived().i(); +} + + +IFullyConnectedLayer* Network::addFullyConnected(ITensor* inputTensor, int outputSize, + Weights kernelWeights, Weights biasWeights, BiasMode biasMode) +{ + API_CHECK_NULL_RET_NULL(inputTensor); + API_CHECK_RETVAL(outputSize >= 1 && outputSize < MAX_OUTPUT_MAPS, 0); + API_CHECK_WEIGHTS_RETVAL(kernelWeights, 0); + API_CHECK_WEIGHTS0_RETVAL(biasWeights, 0); + + string name = newLayerName(); + + ITensor* output = addTensor(newTensorName()); + Tensor* output_priv = TensorFactory::priv(output); + NVDLA_UNUSED(output_priv); + + FullyConnectedLayerDiamond d = + LayerFactory::newFullyConnectedLayer(this, name, + inputTensor, + output, outputSize, + kernelWeights, biasWeights, biasMode); + + output->setDimensions( d.derived().priv()->getOutputDimensions() ); + + + mLayers.push_back(d.base().i()); + return d.derived().i(); +} + + +IActivationLayer* Network::addActivation(ITensor* inputTensor, ActivationType type) +{ + API_CHECK_NULL_RET_NULL(inputTensor); + API_CHECK_ENUM_RANGE_RETVAL(ActivationType, type, 0); + + string name = newLayerName(); + + ITensor* output = addTensor(newTensorName()); + Tensor* output_priv = TensorFactory::priv(output); + NVDLA_UNUSED(output_priv); + + ActivationLayerDiamond d = + LayerFactory::newActivationLayer(this, name, inputTensor, output, type); + + output->setDimensions( d.derived().priv()->getOutputDimensions() ); + + + mLayers.push_back(d.base().i()); + return d.derived().i(); +} + + +IPoolingLayer* Network::addPooling(ITensor* input, PoolingType type, + Dims2 windowSize, Dims2 stride, + Dims2 tlPadding, Dims2 brPadding) +{ + API_CHECK_NULL_RET_NULL(input); + API_CHECK_RETVAL(type.v() <= EnumMax(), 0); + API_CHECK_RETVAL(windowSize.h > 0, 0); + API_CHECK_RETVAL(windowSize.w > 0, 0); + API_CHECK_RETVAL((windowSize.h*windowSize.w) < MAX_KERNEL_DIMS_PRODUCT, 0); + API_CHECK_RETVAL((stride.h + stride.w) < MAX_STRIDE_SUM, 0); + API_CHECK_RETVAL(tlPadding.w < windowSize.w, 0); + API_CHECK_RETVAL(tlPadding.h < windowSize.h, 0); + API_CHECK_RETVAL(brPadding.w < windowSize.w, 0); + API_CHECK_RETVAL(brPadding.h < windowSize.h, 0); + + string name = newLayerName(); + + ITensor* output = addTensor(newTensorName()); + Tensor* output_priv = TensorFactory::priv(output); + NVDLA_UNUSED(output_priv); + + PoolingLayerDiamond d = + LayerFactory::newPoolingLayer(this, name, input, output, + type, + windowSize, stride, + tlPadding, brPadding); + + output->setDimensions( d.derived().priv()->getOutputDimensions() ); + + + mLayers.push_back(d.base().i()); + return d.derived().i(); +} + + +ILRNLayer* Network::addLRN(ITensor* input, int lrnWindow, float alpha, float beta, float k) +{ + API_CHECK_NULL_RET_NULL(input); + API_CHECK_RETVAL(lrnWindow >= ILRNLayer::Parameters::minWindowSize() && + lrnWindow <= ILRNLayer::Parameters::maxWindowSize(), 0); + API_CHECK_RETVAL(fabsf(alpha) <= ILRNLayer::Parameters::maxAbsAlpha(), 0); + API_CHECK_RETVAL(beta >= ILRNLayer::Parameters::minBeta() && + beta <= ILRNLayer::Parameters::maxBeta(), 0); + API_CHECK_RETVAL(k >= ILRNLayer::Parameters::minK() && + k <= ILRNLayer::Parameters::maxK(), 0); + + string name = newLayerName(); + + ITensor* output = addTensor(newTensorName()); + Tensor* output_priv = TensorFactory::priv(output); + NVDLA_UNUSED(output_priv); + + LRNLayerDiamond d = + LayerFactory::newLRNLayer(this, name, input, output, + lrnWindow, alpha, beta, k); + + output->setDimensions( d.derived().priv()->getOutputDimensions() ); + + + mLayers.push_back(d.base().i()); + return d.derived().i(); +} + + +IScaleLayer* Network::addScale(ITensor* inputTensor, ScaleMode mode, + Weights shift, Weights scale, Weights power) +{ + API_CHECK_NULL_RET_NULL(inputTensor); + API_CHECK_ENUM_RANGE_RETVAL(ScaleMode, mode, 0); + API_CHECK_RETVAL(scale.type == shift.type && shift.type == power.type, 0); + API_CHECK_WEIGHTS0_RETVAL(shift, 0); + API_CHECK_WEIGHTS0_RETVAL(scale, 0); + API_CHECK_WEIGHTS0_RETVAL(power, 0); + + string name = newLayerName(); + + ITensor* output = addTensor(newTensorName()); + Tensor* output_priv = TensorFactory::priv(output); + NVDLA_UNUSED(output_priv); + + ScaleLayerDiamond d = + LayerFactory::newScaleLayer(this, name, inputTensor, output, + mode, shift, scale, power); + + output->setDimensions( d.derived().priv()->getOutputDimensions() ); + + + mLayers.push_back(d.base().i()); + return d.derived().i(); +} + +IBatchNormLayer* Network::addBatchNorm(ITensor* inputTensor, BatchNormMode mode, + Weights mean, Weights variance, float epsilon) +{ + API_CHECK_NULL_RET_NULL(inputTensor); + API_CHECK_ENUM_RANGE_RETVAL(BatchNormMode, mode, 0); + API_CHECK_RETVAL(mean.type == variance.type, 0); + API_CHECK_WEIGHTS0_RETVAL(mean, 0); + API_CHECK_WEIGHTS0_RETVAL(variance, 0); + + string name = newLayerName(); + + ITensor* output = addTensor(newTensorName()); + + BatchNormLayerDiamond d = + LayerFactory::newBatchNormLayer(this, name, inputTensor, output, + mode, mean, variance, epsilon); + + output->setDimensions( d.derived().priv()->getOutputDimensions() ); + + mLayers.push_back(d.base().i()); + return d.derived().i(); +} + +ISoftMaxLayer* Network::addSoftMax(ITensor* input) +{ + API_CHECK_NULL_RET_NULL(input); + + string name = newLayerName(); + + ITensor* output = addTensor(newTensorName()); + Tensor* output_priv = TensorFactory::priv(output); + NVDLA_UNUSED(output_priv); + + SoftMaxLayerDiamond d = + LayerFactory::newSoftMaxLayer(this, name, input, output); + + output->setDimensions( d.derived().priv()->getOutputDimensions() ); + + + mLayers.push_back(d.base().i()); + return d.derived().i(); +} + + +IConcatenationLayer *Network::addConcatenation(ITensor * const * inputs, int numInputs ) +{ + API_CHECK_RETVAL(numInputs > 0 && numInputs < MAX_CONCAT_INPUTS, 0); + API_CHECK_NULL_RET_NULL(inputs); + for (int j = 0; j < numInputs; j++) { + API_CHECK_NULL_RET_NULL(inputs[j]); + } + + string name = newLayerName(); + + ITensor* output = addTensor(newTensorName()); + Tensor* output_priv = TensorFactory::priv(output); + NVDLA_UNUSED(output_priv); + + ConcatenationLayerDiamond d = + LayerFactory::newConcatenationLayer(this, name, + inputs, numInputs, output); + + output->setDimensions( d.derived().priv()->getOutputDimensions() ); + + + mLayers.push_back(d.base().i()); + return d.derived().i(); +} + + +ISliceLayer *Network::addSlice(ITensor* input, int numOutputs) +{ + API_CHECK_RETVAL(numOutputs > 0 && numOutputs < MAX_SLICE_OUTPUTS, 0); + API_CHECK_NULL_RET_NULL(input); + + string name = newLayerName(); + + ITensor* outputs[numOutputs]; + for (int ii=0; iisetDimensions(d.derived().priv()->getOutputDimensions()); + } + + mLayers.push_back(d.base().i()); + return d.derived().i(); +} + + +IDeconvolutionLayer* +Network::addDeconvolution +( + ITensor* input, + int numOutputs, int paddingValue, + Dims2 kernelSize, Dims2 tlPadding, Dims2 brPadding, Dims2 stride, Dims2 dilation, + Weights kernelWeights, + Weights biasWeights, BiasMode biasMode, int numGroups + ) +{ + API_CHECK_NULL_RET_NULL(input); + API_CHECK_RETVAL(numOutputs > 0 && numOutputs < MAX_OUTPUT_MAPS, 0); + API_CHECK_RETVAL(kernelSize.h > 0, 0); + API_CHECK_RETVAL(kernelSize.w > 0, 0); + API_CHECK_RETVAL((kernelSize.h * kernelSize.w) < MAX_KERNEL_DIMS_PRODUCT, 0); + API_CHECK_WEIGHTS_RETVAL(kernelWeights, 0); + API_CHECK_WEIGHTS0_RETVAL(biasWeights, 0); + API_CHECK_ENUM_RANGE_RETVAL(BiasMode, biasMode, 0); + + string name = newLayerName(); + + ITensor* output = addTensor(newTensorName()); + Tensor* output_priv = TensorFactory::priv(output); + NVDLA_UNUSED(output_priv); + + DeconvolutionLayerDiamond d = + LayerFactory::newDeconvolutionLayer(this, name, + input, output, numOutputs, paddingValue, + kernelSize, tlPadding, brPadding, stride, dilation, + kernelWeights, biasWeights, biasMode, numGroups); + + output->setDimensions( d.derived().priv()->getOutputDimensions() ); + + mLayers.push_back(d.base().i()); + return d.derived().i(); +} + +IElementWiseLayer* +Network::addElementWise(ITensor* input1, ITensor* input2, ElementWiseOperation op) +{ + API_CHECK_NULL_RET_NULL(input1); + API_CHECK_NULL_RET_NULL(input2); + API_CHECK_ENUM_RANGE_RETVAL(ElementWiseOperation, op, 0); + + string name = newLayerName(); + + ITensor* output = addTensor(newTensorName()); + Tensor* output_priv = TensorFactory::priv(output); + NVDLA_UNUSED(output_priv); + + ITensor* inputs[2] = { input1, input2 }; + + ElementWiseLayerDiamond d = + LayerFactory::newElementWiseLayer(this, name, inputs, output, op); + + output->setDimensions( d.derived().priv()->getOutputDimensions() ); + + + mLayers.push_back(d.base().i()); + return d.derived().i(); +} + +ITensor* Network::addInput(const char* name, Dims4 dims) +{ + API_CHECK_NULL_RET_NULL(name); + API_CHECK_DIMS4_TENSOR_RETVAL(dims, 0); + ITensor* tensor = addTensor(string(name)); + tensor->setDimensions(dims); + mInputs.push_back(tensor); + return tensor; +} + + +bool Network::markInput(ITensor *tensor) +{ + API_CHECK_NULL_RETVAL(tensor, false); + API_CHECK_DIMS3_TENSOR_RETVAL(tensor->getDimensions(), false); + //TBD: check that this isn't already marked. + mInputs.push_back(tensor); + return true; +} + +void Network::markOutput(ITensor* tensor) +{ + API_CHECK_NULL(tensor); + if (std::find(mOutputs.begin(), mOutputs.end(), tensor) == mOutputs.end()) + { + mOutputs.push_back(tensor); + } +} + +int Network::getNumLayers() const +{ + return static_cast(mLayers.size()); +} + +ILayer* Network::getLayer(int i) const +{ + if (i < 0 || i >= int(mLayers.size())) { + return 0; + } + return mLayers[i]; +} + +void Network::destroy() +{ + delete this; +} + +Network::~Network() +{ + +} + +const ILayer* Network::findLayer(const string& name) const +{ + vector< ILayer * >::const_iterator it; + for (it = mLayers.begin(); it != mLayers.end(); it++ ) { + if ( (*it)->getName() == name) + return *it; + } + + return 0; +} + +string Network::newTensorName() const +{ + stringstream s; + s << "tensor-anon-" << mTensors.size(); + return s.str(); +} + +string Network::newLayerName() const +{ + stringstream s; + s << "layer-anon-" << mLayers.size(); + return s.str(); +} + +void Network::setPoolingOutputDimensionsFormula(INetwork::OutputDimensionsFormula* callback) +{ + mPoolDims = callback ? callback : &sDefaultPoolingDims; +} + +void Network::setConvolutionOutputDimensionsFormula(INetwork::OutputDimensionsFormula* callback) +{ + mConvDims = callback ? callback : &sDefaultConvDims; +} + +void Network::setDeconvolutionOutputDimensionsFormula(INetwork::OutputDimensionsFormula* callback) +{ + mDeconvDims = callback ? callback : &sDefaultDeconvDims; +} + + + + +int Network::getNumInputs() const +{ + return (int)mInputs.size(); +} + +int Network::getNumOutputs() const +{ + return (int)mOutputs.size(); +} + +ITensor* Network::getOutput(int index) const +{ + if (index < 0 || index >= int(mOutputs.size())) { + return 0; + } + return mOutputs[index]; +} + +ITensor* Network::getInput(int index) const +{ + if (index < 0 || index >= int(mInputs.size())) { + return 0; + } + return mInputs[index]; +} + +INetwork::OutputDimensionsFormula& Network::getPoolingOutputDimensionsFormula() const +{ + return *mPoolDims; +} + +INetwork::OutputDimensionsFormula& Network::getConvolutionOutputDimensionsFormula() const +{ + return *mConvDims; +} + +INetwork::OutputDimensionsFormula& Network::getDeconvolutionOutputDimensionsFormula() const +{ + return *mDeconvDims; +} + +const vector& Network::getInputs() const +{ + return mInputs; +} +const vector< ILayer * >& Network::getLayers() const +{ + return mLayers; +} +const vector& Network::getOutputs() const +{ + return mOutputs; +} + +ITensor* Network::addTensor(const string &s) +{ + TensorFactory::TensorPrivPair t = TensorFactory::newTensor(); + if ( !t ) { + return NULL; + } + t.priv()->setNetwork(this); + t.priv()->setName(s.c_str()); + mTensors.push_back(t.i()); + return t.i(); +} + +bool Network::assignSymbols(Wisdom *wisdom) +{ + bool ok = true; + + for (size_t l = 0; l < mLayers.size(); l++ ) { + Layer *layer = LayerFactory::priv(mLayers[l]); + if ( !layer ) { + gLogError << "missing layer " << l << " in network?" << endl; + continue; + } + + string sym; + ok = wisdom->findLayerSymbol(layer, sym); + if ( ! ok ) { + ok = wisdom->assignLayerSymbol(layer, sym); + if ( !ok ) { + gLogError << "unable to assign symbol name to layer " << layer->getName() << " ?" << endl; + goto done; + } + } + + // tell the layer to assign symbols for whatever it references... + ok = layer->assignSymbols(wisdom); + if ( !ok ) { + gLogError << "unable to assign symbols for layer " << layer->getName() << endl; + goto done; + } + } + + done: + + return ok; +} + + +bool Network::serializeTo(WisdomContainerEntry *e) const +{ + vector layers; + Wisdom *wisdom; + WisdomContainerEntry inputs_entry, outputs_entry, layers_entry; + map gather_tensors; + + bool ok = e && e->container_priv() && e->container_priv()->wisdom(); + if ( !ok ) { + gLogError << "can't serialize a network without a working wisdom context." << endl; + goto done; + } + + wisdom = e->container_priv()->wisdom_priv(); + + // gLogError << "serializing network with " << getNumLayers() << " layers, " << getNumInputs() << " inputs, and " << getNumOutputs() << " outputs." << endl; + + ok = ok && e->writeUInt32("factory_type", getFactoryType()); + ok = ok && e->writeUInt32("num_inputs", getNumInputs()); + ok = ok && e->writeUInt32("num_outputs", getNumOutputs()); + ok = ok && e->writeUInt32("num_layers", getNumLayers()); + + ok = ok && e->insertEntryIfNotPresent("inputs", IWisdomContainerEntry::ENTRY_TYPE_OBJECT, &inputs_entry); + ok = ok && e->insertEntryIfNotPresent("outputs",IWisdomContainerEntry::ENTRY_TYPE_OBJECT, &outputs_entry); + ok = ok && e->insertEntryIfNotPresent("layers", IWisdomContainerEntry::ENTRY_TYPE_OBJECT, &layers_entry); + + + for (size_t l = 0; l < mLayers.size(); l++ ) { + ILayer *ilayer = mLayers[l]; + Layer *layer = LayerFactory::priv(ilayer); + + if ( !(ilayer && layer) ) { + gLogError << "missing layer " << l << " in network?" << endl; + ok = false; + goto done; + } + layers.push_back(layer); + + // be sure there's a symbol associated with the layer so it can be referred + // to by the network later during deserialization. + string sym; + ok = wisdom->findLayerSymbol(layer, sym); + + // layer symbols should already have been assigned if needed. + if ( ! ok ) { + gLogError << "unassigned layer " << layer->getName() << " ?" << endl; + goto done; + } + + ok = ok && layers_entry.writeString(toString(l), sym); + // gLogError << "writing symbol=[" << sym << "] to layers_entry=[" << ss.str() << "]" << endl; + if ( !ok ) { + gLogError << "failed to write symbol to layers_entry index" << endl; + goto done; + } + } + + // + // gather up all tensors referred to by the layers and set them + // + for (size_t l = 0; l < layers.size(); l++ ) { + int num_inputs = layers[l]->getNumInputs(); + int num_outputs = layers[l]->getNumOutputs(); + for(int i = 0; i < num_inputs; i++) { + gather_tensors[TensorFactory::priv(layers[l]->getInput(i))] = true; + } + for(int o = 0; o < num_outputs; o++) { + gather_tensors[TensorFactory::priv(layers[l]->getOutput(o))] = true; + } + } + + for ( map::iterator ti = gather_tensors.begin(); + ok && (ti != gather_tensors.end()); + ti++ ) { + Tensor *t = ti->first; + ok = ok && wisdom->setTensor(t); + } + + if ( !ok ) { + gLogError << __func__ << " failed to serialize one or more tensors" << endl; + goto done; + } + + + // + // now set the layers + // + for (size_t l = 0; l < layers.size(); l++ ) { + ok = ok && wisdom->setLayer(layers[l]); + } + + if ( !ok ) { + gLogError << __func__ << " failed to serialize one or more layers" << endl; + goto done; + } + + // + // record the input and output tensors + // + for (size_t i = 0; i < mInputs.size(); i++ ) { + string sym; + ok = ok && wisdom->findITensorSymbol(getInput(i), sym); + ok = ok && inputs_entry.writeString(toString(i), sym); + } + if ( !ok ) { + gLogError << __func__ << " failed to serialize one or more inputs" << endl; + goto done; + } + + for (size_t o = 0; o < mOutputs.size(); o++ ) { + string sym; + ok = ok && wisdom->findITensorSymbol(getOutput(o), sym); + ok = ok && outputs_entry.writeString(toString(o), sym); + } + if ( !ok ) { + gLogError << __func__ << " failed to serialize one or more outputs" << endl; + goto done; + } + + done: + + return ok; + +} + +// +// read from the wisdom container entry and deserialize +// all the objects/data necessary to bring the network +// into live memory. +// +bool Network::deserializeFrom(WisdomContainerEntry *e) +{ + canonical_ast::Graph *graph; + NVDLA_UNUSED(graph); + + // gLogError << __func__ << " 1 " << endl; + Wisdom *wisdom; + WisdomContainerEntry inputs_entry, outputs_entry, layers_entry; + NvU32 num_inputs, num_outputs, num_layers; + map tensor_symbols; + vector layers; + + bool ok = true; + + wisdom = e->container_priv()->wisdom_priv(); + ok = NULL != wisdom; + if ( !ok ) { + gLogError << __func__ << "missing Wisdom" << endl; + goto done; + } + + ok = ok && e->getEntry(string("num_inputs"), IWisdomContainerEntry::ENTRY_TYPE_UINT32, &inputs_entry); + ok = ok && e->getEntry(string("num_outputs"), IWisdomContainerEntry::ENTRY_TYPE_UINT32, &outputs_entry); + ok = ok && e->getEntry(string("num_layers"), IWisdomContainerEntry::ENTRY_TYPE_UINT32, &layers_entry); + + ok = ok && inputs_entry. readUInt32(num_inputs); + ok = ok && outputs_entry.readUInt32(num_outputs); + ok = ok && layers_entry. readUInt32(num_layers); + + if ( !ok ) { + gLogError << __func__ << " failed to get all num_* entries" << endl; + goto done; + } + + //XXX upper bounds check? + if ( num_inputs == 0 || num_outputs == 0 || num_layers == 0 ) { + //ok = false; + gLogError << __func__ << " invalid network deserialization data?" << endl; + gLogError << __func__ << " inputs=" << num_inputs << " outputs=" << num_outputs << " layers=" << + num_layers << endl; + // goto done; + } + + // note re-use of the *_entry locals from above... + ok = ok && e->getEntry(string("inputs"), IWisdomContainerEntry::ENTRY_TYPE_OBJECT, &inputs_entry); + ok = ok && e->getEntry(string("outputs"), IWisdomContainerEntry::ENTRY_TYPE_OBJECT, &outputs_entry); + ok = ok && e->getEntry(string("layers"), IWisdomContainerEntry::ENTRY_TYPE_OBJECT, &layers_entry); + if ( !ok ) { + gLogError << __func__ << " failed to get inputs, outputs and layers entries" << endl; + goto done; + } + + // + // Gather up the layers referenced by the network. For each, ascertain + // whether or not it has been deserialized (check with the Wisdom). + // If not, do so. + // + // The set of layers used by the network is stored as an array of layer symbols. + // + + layers.clear(); + + for ( size_t l = 0; ok && (l < num_layers); l++ ) { + WisdomContainerEntry layer_index_entry; + string layer_symbol; + ILayer *layer; + + ok = ok && layers_entry.getEntry(toString(l), + IWisdomContainerEntry::ENTRY_TYPE_STRING, + &layer_index_entry); + if ( !ok ) { + gLogError << "couldn't get layers entry for " << toString(l) << endl; + goto done; + } + ok = ok && layer_index_entry.readString(layer_symbol); + if ( !ok ) { + gLogError << "couldn't read layer index symbol string? " << toString(l) << endl; + goto done; + break; + } + + layer = wisdom->getLayerFromSymbol(layer_symbol); + + ok = (NULL != layer); + if ( ok ) { + layers.push_back(layer); + } else { + gLogError << "couldn't get layer from symbol=[" << layer_symbol << "]" << endl; + goto done; + } + + mLayers.push_back(layer); + } + if ( !ok ) { + gLogError << __func__ << " failed to find or instantiate (some) network layers" << endl; + goto done; + } + + + // go through the input and output tensors and mark them as such. + // they should have all been deserialized by way of layer references. + // so if they aren't found something is really wrong. + + + + for ( size_t i = 0; ok && (i < num_inputs); i++ ) { + + WisdomContainerEntry input_index_entry; + string input_symbol; + ITensor *tensor; + + ok = ok && inputs_entry.getEntry(toString(i), + IWisdomContainerEntry::ENTRY_TYPE_STRING, + &input_index_entry); + if ( !ok ) { + gLogError << "couldn't get input entry for " << toString(i) << endl; + goto done; + } + ok = ok && input_index_entry.readString(input_symbol); + if ( !ok ) { + gLogError << "couldn't read input index symbol string? " << toString(i) << endl; + goto done; + } + tensor = wisdom->findTensorSymbol(input_symbol); + if ( !tensor ) { + ok = false; + gLogError << " couldn't find input tensor sym=[" << input_symbol << "]" << endl; + goto done; + } + + ok = markInput(tensor); + if ( !ok ) { + gLogError << " problem marking tensor sym=[" << input_symbol << "] as a network input." << endl; + goto done; + } + } + + for ( size_t o = 0; ok && (o < num_outputs); o++ ) { + WisdomContainerEntry output_index_entry; + string output_symbol; + ITensor *tensor; + + ok = ok && outputs_entry.getEntry(toString(o), + IWisdomContainerEntry::ENTRY_TYPE_STRING, + &output_index_entry); + if ( !ok ) { + gLogError << "couldn't get output entry for " << toString(o) << endl; + goto done; + } + ok = ok && output_index_entry.readString(output_symbol); + if ( !ok ) { + gLogError << "couldn't read output index symbol string? " << toString(o) << endl; + goto done; + } + tensor = wisdom->findTensorSymbol(output_symbol); + if ( !tensor ) { + ok = false; + gLogError << " couldn't find output tensor sym=[" << output_symbol << "]" << endl; + goto done; + } + markOutput(tensor); + } + + done: + return ok; + +} + + + +} // nvdla::priv +} // nvdla:: diff --git a/umd/core/src/compiler/Profile.cpp b/umd/core/src/compiler/Profile.cpp new file mode 100644 index 00000000..fb80a941 --- /dev/null +++ b/umd/core/src/compiler/Profile.cpp @@ -0,0 +1,633 @@ +/* + * Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#include + +#include "priv/Check.h" + +#include "priv/Wisdom.h" +#include "priv/WisdomContainer.h" +#include "priv/Profile.h" +#include "priv/Profiler.h" + +using std::endl; +using std::string; + +namespace nvdla +{ + + +IProfile::IProfile(){ } +IProfile::~IProfile() { } + +namespace priv +{ + +ProfileFactory::ProfilePrivPair ProfileFactory::newProfile() +{ + IProfile *profile; + Profile *profile_priv; + profile = profile_priv = new priv::Profile(); + if (profile) { + s_priv.insert(profile,profile_priv); + s_self.insert(profile,profile); + } + return ProfilePrivPair(profile, profile_priv); +} + +Profile *ProfileFactory::priv(IProfile *profile) +{ + BiMap::left_iterator f = s_priv.find_left(profile); + if ( f == s_priv.end_left() ) { + return NULL; + } + return f->second; +} + +IProfile *ProfileFactory::i(Profile *profile) +{ + BiMap::right_iterator f = s_priv.find_right(profile); + if ( f == s_priv.end_right() ) { + return NULL; + } + return f->second; +} + +IProfile *ProfileFactory::self(void *s) +{ + BiMap::left_iterator f = s_self.find_left(s); + if ( f == s_self.end_left() ) { + return NULL; + } + return f->second; +} + + + +IProfile *ProfileFactory::deserializeFrom(WisdomContainerEntry *entry) +{ + bool ok = false; + IProfile *profile = NULL; + + // only one type of profile right now (IProfile/Profile)... but go through the motions + WisdomContainerEntry factory_type_entry; + // ProfileType factory_type; + NvU32 v; + + if ( entry->type() != IWisdomContainerEntry::ENTRY_TYPE_OBJECT ) { + goto done; + } + + ok = entry->getEntry("factory_type", IWisdomContainerEntry::ENTRY_TYPE_UINT32, &factory_type_entry); + + ok = ok && factory_type_entry.readUInt32(v); + if ( !ok ) { + goto done; + } + + profile = deserializeProfile(entry); + + done: + return profile; +} + +BiMap ProfileFactory::s_priv; +BiMap ProfileFactory::s_self; + + +// there's only one type of "Profile" for now. so only one of these... so it looks +// silly. see the same paths in "LayerFactory::deserialize*" for why it makes sense +// to organize this way preemptively. +IProfile *ProfileFactory::deserializeProfile(WisdomContainerEntry *entry) +{ + ProfileFactory::ProfilePrivPair t = newProfile(); + if ( !t ) { + return NULL; + } + t.priv()->deserializeFrom(entry); + return t.i(); +} + + +NvU16 Profile::getFactoryType() const +{ + return 0; // only one type of profile so far, not complicated by factory splits +} + + +bool Profile::serializeTo(WisdomContainerEntry *e) const +{ + bool ok = true; + WisdomContainerEntry name_entry; + + // gLogError << __func__ << " name=[" << getName() << "]" << endl; + + ok = ok && e->writeUInt32("factory_type", getFactoryType()); + ok = ok && e->writeString("name", getName()); + + ok = ok && e->writeUInt32("pixel_offset_x", m_globalParams.m_NwInPixelOffX); + ok = ok && e->writeUInt32("pixel_offset_y", m_globalParams.m_NwInPixelOffY); + ok = ok && e->writeUInt8Enum("input_data_format", m_globalParams.m_NwInDataFormat); + ok = ok && e->writeUInt8Enum("output_data_format", m_globalParams.m_NwOutDataFormat); + ok = ok && e->writeUInt8Enum("network_input_format", m_globalParams.m_NwInSurfFormat.v()); + ok = ok && e->writeUInt8Enum("network_output_format", m_globalParams.m_NwOutSurfFormat.v()); + ok = ok && e->writeUInt8Enum("input_pixel_mapping", m_globalParams.m_NwInPixelMapping.v()); + + ok = ok && e->writeUInt32("weight_compression", m_compileParams.m_canCompressWeights); + ok = ok && e->writeUInt32("winograd_enabled", m_compileParams.m_canWinograd); + ok = ok && e->writeUInt32("conv_weight_banks_allotted", m_compileParams.m_CONVWeightBanksAllotted); + ok = ok && e->writeUInt32("conv_data_banks_allotted", m_compileParams.m_CONVDataBanksAllotted); + ok = ok && e->writeUInt32("sdp_pdp_onfly_enabled", m_compileParams.m_canSDPPDPOnFly); + ok = ok && e->writeUInt32("sdp_merge_math_ops_enabled", m_compileParams.m_canSDPMergeMathOps); + ok = ok && e->writeUInt32("sdp_fuse_subengine_ops_enabled", m_compileParams.m_canSDPFuseSubEngineOps); + ok = ok && e->writeUInt32("sdp_bust_nops_enabled", m_compileParams.m_canSDPBustNOPs); + ok = ok && e->writeUInt32("sdp_op_fusion_enabled", m_compileParams.m_canSDPFuseVerticalOps); + ok = ok && e->writeUInt32("memory_pooling_enabled", m_compileParams.m_useMemPool); + ok = ok && e->writeUInt32("reuse_pooled_memory", m_compileParams.m_useReusePooledMemory); + ok = ok && e->writeUInt32("cvsram_alloc_enabled", m_compileParams.m_useCVSRAMAllocate); + ok = ok && e->writeUInt32("copy_out_debug_surfaces", m_compileParams.m_copyOutDebugSurfaces); + ok = ok && e->writeUInt64("global_dram_pool_size", m_compileParams.m_globalDRAMSize); + ok = ok && e->writeUInt64("local_dram_pool_size", m_compileParams.m_localDRAMSize); + ok = ok && e->writeUInt64("local_cvsram_pool_size", m_compileParams.m_localCVSRAMSize); + ok = ok && e->writeUInt32("multi_batch_size", m_compileParams.m_multiBatchSize); + ok = ok && e->writeUInt32("img_post_chnl_extn_enabled", m_compileParams.m_canIMGPostChnlExtend); + ok = ok && e->writeUInt8Enum("compute_precision", m_compileParams.m_computePrecision.v()); + ok = ok && e->writeUInt8Enum("tensor_scaling_mode", m_compileParams.m_tensorScalingMode.v()); + ok = ok && e->writeUInt8Enum("quantization_mode", m_compileParams.m_quantizationMode.v()); + + return ok; +} + +bool Profile::deserializeFrom(WisdomContainerEntry *e) +{ + WisdomContainerEntry name_entry; + string name; + Dims3 dims; + NvS32 data_format, data_type, tensor_type; + NvU32 boolProxy = 0; + NvU8 charProxy = 0; + NVDLA_UNUSED(dims); + NVDLA_UNUSED(data_format); + NVDLA_UNUSED(data_type); + NVDLA_UNUSED(tensor_type); + + bool ok = e->getEntry(string("name"), IWisdomContainerEntry::ENTRY_TYPE_STRING, &name_entry); + ok = e->readString("name", name); + + setName(name.c_str()); // always make this first. if we make any choices based upon name + // they shouldn't override how it was actually saved off. + + ok = ok && e->readUInt32("pixel_offset_x", m_globalParams.m_NwInPixelOffX); + ok = ok && e->readUInt32("pixel_offset_y", m_globalParams.m_NwInPixelOffY); + + ok = ok && e->readUInt8Enum("input_data_format", charProxy); + m_globalParams.m_NwInDataFormat = nvdla::DataFormat(charProxy); + ok = ok && e->readUInt8Enum("output_data_format", charProxy); + m_globalParams.m_NwOutDataFormat = nvdla::DataFormat(charProxy); + ok = ok && e->readUInt8Enum("network_input_format", charProxy); + m_globalParams.m_NwInSurfFormat = surface::SurfaceFormat(charProxy); + ok = ok && e->readUInt8Enum("network_output_format", charProxy); + m_globalParams.m_NwOutSurfFormat = surface::SurfaceFormat(charProxy); + ok = ok && e->readUInt8Enum("input_pixel_mapping", charProxy); + m_globalParams.m_NwInPixelMapping = surface::PixelMapping(charProxy); + + ok = ok && e->readUInt32("memory_pooling_enabled", boolProxy); + m_compileParams.m_useMemPool = bool(boolProxy); + ok = ok && e->readUInt32("reuse_pooled_memory", boolProxy); + m_compileParams.m_useReusePooledMemory = bool(boolProxy); + ok = ok && e->readUInt32("cvsram_alloc_enabled", boolProxy); + m_compileParams.m_useCVSRAMAllocate = bool(boolProxy); + ok = ok && e->readUInt32("copy_out_debug_surfaces", boolProxy); + m_compileParams.m_copyOutDebugSurfaces = bool(boolProxy); + ok = ok && e->readUInt32("weight_compression", boolProxy); + m_compileParams.m_canCompressWeights = bool(boolProxy); + ok = ok && e->readUInt32("winograd_enabled", boolProxy); + m_compileParams.m_canWinograd = bool(boolProxy); + ok = ok && e->readUInt32("sdp_pdp_onfly_enabled", boolProxy); + m_compileParams.m_canSDPPDPOnFly = bool(boolProxy); + ok = ok && e->readUInt32("sdp_merge_math_ops_enabled", boolProxy); + m_compileParams.m_canSDPMergeMathOps = bool(boolProxy); + ok = ok && e->readUInt32("sdp_fuse_subengine_ops_enabled", boolProxy); + m_compileParams.m_canSDPFuseSubEngineOps = bool(boolProxy); + ok = ok && e->readUInt32("sdp_bust_nops_enabled", boolProxy); + m_compileParams.m_canSDPBustNOPs = bool(boolProxy); + ok = ok && e->readUInt32("sdp_op_fusion_enabled", boolProxy); + m_compileParams.m_canSDPFuseVerticalOps = bool(boolProxy); + ok = ok && e->readUInt32("img_post_chnl_extn_enabled", boolProxy); + m_compileParams.m_canIMGPostChnlExtend = bool(boolProxy); + + ok = ok && e->readUInt64("global_dram_pool_size", m_compileParams.m_globalDRAMSize); + ok = ok && e->readUInt64("local_dram_pool_size", m_compileParams.m_localDRAMSize); + ok = ok && e->readUInt64("local_cvsram_pool_size", m_compileParams.m_localCVSRAMSize); + ok = ok && e->readUInt32("conv_weight_banks_allotted", m_compileParams.m_CONVWeightBanksAllotted); + ok = ok && e->readUInt32("conv_data_banks_allotted", m_compileParams.m_CONVDataBanksAllotted); + ok = ok && e->readUInt32("multi_batch_size", m_compileParams.m_multiBatchSize); + + ok = ok && e->readUInt8Enum("compute_precision", charProxy); + m_compileParams.m_computePrecision = surface::SurfacePrecision(charProxy); + ok = ok && e->readUInt8Enum("tensor_scaling_mode", charProxy); + m_compileParams.m_tensorScalingMode = nvdla::TensorScalingMode(charProxy); + ok = ok && e->readUInt8Enum("quantization_mode", charProxy); + m_compileParams.m_quantizationMode = nvdla::QuantizationMode(charProxy); + + return ok; +} + + + +const char* Profile::getName() const +{ + return m_name.c_str(); +} + +void Profile::setBasicProfile() +{ + setUseCVSRAMAllocate(false); + setUseMemPool(false); + setUseReusePooledMemory(false); + setUseGreedyEviction(false); + setCanSDPBustNOPs(false); + setCanSDPMergeMathOps(false); + setCanSDPFuseSubEngineOps(false); +} + +void Profile::setDefaultProfile() +{ + setBasicProfile(); + setUseMemPool(true); + setUseReusePooledMemory(true); + setUseGreedyEviction(true); + setCanSDPBustNOPs(true); +} + +void Profile::setPerformanceProfile() +{ + setDefaultProfile(); +// setUseCVSRAMAllocate(true); +} + +void Profile::setFastMathProfile() +{ + setPerformanceProfile(); + setCanSDPMergeMathOps(true); + setCanSDPFuseSubEngineOps(true); +// setCanWinograd(true); +} + +void Profile::setName(const char* n) +{ + API_CHECK_NULL(n); + m_name = n; + + if ( isBasicProfile() ) + { + setBasicProfile(); + } + + if ( isDefaultProfile() ) + { + setDefaultProfile(); + } + + if ( isPerformanceProfile() ) + { + setPerformanceProfile(); + } + + if ( isFastMathProfile() ) + { + setFastMathProfile(); + } +} + + +NvDlaError Profile::getNumLoadables(int *n) const +{ + NvDlaError e = NvDlaSuccess; + if ( !n ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter); + } + *n = 1; + fail: + return e; +} + +// if name.length() == 0 or index < 0 then they are ignored for the purpose of lookup +NvDlaError Profile::getLoadable(const std::string &name, int index, ILoadable **i_loadable) +{ + bool nameSpecified = name.length() > 0; + bool indexSpecified = index >= 0; + + NvDlaError e = NvDlaSuccess; + if ( !i_loadable ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter); + } + + *i_loadable = 0; + + if ( (nameSpecified && indexSpecified) || !(nameSpecified || indexSpecified) ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "must specify (only) one of index or name for loadable association with profile"); + } + + if ( nameSpecified ) + { + if ( m_loadablesByName.find(name) != m_loadablesByName.end() ) + { + *i_loadable = m_loadablesByName[name]; + } + if ( debug() ) + { + gLogInfo << "profile getLoadable looked for loadable with name " << name << endl; + } + } + else if ( indexSpecified ) + { + size_t u_index(index); // note sign checked above. + if ( u_index < m_loadables.size() ) + { + *i_loadable = m_loadables[u_index]; + } + } + + + fail: + return e; +} + +// if name.length() == 0 or index < 0 then be sure the same one comes back during a lookup. +NvDlaError Profile::insertLoadable(const std::string & name, int index, ILoadable *i_loadable) +{ + NvDlaError e = NvDlaSuccess; + bool nameSpecified = name.length() > 0; + bool indexSpecified = index >= 0; + + if ( !i_loadable ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter); + } + + if ( (nameSpecified && indexSpecified) || !(nameSpecified || indexSpecified) ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "must specify (only) one of index or name for loadable association with profile"); + } + + if ( nameSpecified ) + { + if ( debug() ) + { + gLogInfo << "profile insertLoadable saving loadable with name " << name << endl; + } + m_loadablesByName[name] = i_loadable; + } + else if ( indexSpecified ) + { + size_t u_index(index); // note sign checked above. + if ( u_index >= m_loadables.size() ) + { + m_loadables.resize(u_index + 1, 0); + } + m_loadables[index] = i_loadable; + } + + fail: + return e; +} + +static NvDlaError setSurfaceFormat(nvdla::PixelFormat pf, surface::SurfacePrecision cp, surface::SurfaceFormat& sf) +{ + NvDlaError e = NvDlaSuccess; + + switch(pf) { + case nvdla::PixelFormat::R8: sf = surface::SurfaceFormatEnum::NVDLA_IMG_R8; break; + case nvdla::PixelFormat::R10: sf = surface::SurfaceFormatEnum::NVDLA_IMG_R10; break; + case nvdla::PixelFormat::R12: sf = surface::SurfaceFormatEnum::NVDLA_IMG_R12; break; + case nvdla::PixelFormat::R16: sf = surface::SurfaceFormatEnum::NVDLA_IMG_R16; break; + case nvdla::PixelFormat::R16_I: sf = surface::SurfaceFormatEnum::NVDLA_IMG_R16_I; break; + case nvdla::PixelFormat::R16_F: sf = surface::SurfaceFormatEnum::NVDLA_IMG_R16_F; break; + case nvdla::PixelFormat::A16B16G16R16: sf = surface::SurfaceFormatEnum::NVDLA_IMG_A16B16G16R16; break; + case nvdla::PixelFormat::X16B16G16R16: sf = surface::SurfaceFormatEnum::NVDLA_IMG_X16B16G16R16; break; + case nvdla::PixelFormat::A16B16G16R16_F: sf = surface::SurfaceFormatEnum::NVDLA_IMG_A16B16G16R16_F; break; + case nvdla::PixelFormat::A16Y16U16V16: sf = surface::SurfaceFormatEnum::NVDLA_IMG_A16Y16U16V16; break; + case nvdla::PixelFormat::V16U16Y16A16: sf = surface::SurfaceFormatEnum::NVDLA_IMG_V16U16Y16A16; break; + case nvdla::PixelFormat::A16Y16U16V16_F: sf = surface::SurfaceFormatEnum::NVDLA_IMG_A16Y16U16V16_F; break; + case nvdla::PixelFormat::A8B8G8R8: sf = surface::SurfaceFormatEnum::NVDLA_IMG_A8B8G8R8; break; + case nvdla::PixelFormat::A8R8G8B8: sf = surface::SurfaceFormatEnum::NVDLA_IMG_A8R8G8B8; break; + case nvdla::PixelFormat::B8G8R8A8: sf = surface::SurfaceFormatEnum::NVDLA_IMG_B8G8R8A8; break; + case nvdla::PixelFormat::R8G8B8A8: sf = surface::SurfaceFormatEnum::NVDLA_IMG_R8G8B8A8; break; + case nvdla::PixelFormat::X8B8G8R8: sf = surface::SurfaceFormatEnum::NVDLA_IMG_X8B8G8R8; break; + case nvdla::PixelFormat::X8R8G8B8: sf = surface::SurfaceFormatEnum::NVDLA_IMG_X8R8G8B8; break; + case nvdla::PixelFormat::B8G8R8X8: sf = surface::SurfaceFormatEnum::NVDLA_IMG_B8G8R8X8; break; + case nvdla::PixelFormat::R8G8B8X8: sf = surface::SurfaceFormatEnum::NVDLA_IMG_R8G8B8X8; break; + case nvdla::PixelFormat::A2B10G10R10: sf = surface::SurfaceFormatEnum::NVDLA_IMG_A2B10G10R10; break; + case nvdla::PixelFormat::A2R10G10B10: sf = surface::SurfaceFormatEnum::NVDLA_IMG_A2R10G10B10; break; + case nvdla::PixelFormat::B10G10R10A2: sf = surface::SurfaceFormatEnum::NVDLA_IMG_B10G10R10A2; break; + case nvdla::PixelFormat::R10G10B10A2: sf = surface::SurfaceFormatEnum::NVDLA_IMG_R10G10B10A2; break; + case nvdla::PixelFormat::Y8___U8V8_N444: sf = surface::SurfaceFormatEnum::NVDLA_IMG_Y8___U8V8_N444; break; + case nvdla::PixelFormat::Y8___V8U8_N444: sf = surface::SurfaceFormatEnum::NVDLA_IMG_Y8___V8U8_N444; break; + case nvdla::PixelFormat::Y10___U10V10_N444: sf = surface::SurfaceFormatEnum::NVDLA_IMG_Y10___U10V10_N444; break; + case nvdla::PixelFormat::Y10___V10U10_N444: sf = surface::SurfaceFormatEnum::NVDLA_IMG_Y10___V10U10_N444; break; + case nvdla::PixelFormat::Y12___U12V12_N444: sf = surface::SurfaceFormatEnum::NVDLA_IMG_Y12___U12V12_N444; break; + case nvdla::PixelFormat::Y12___V12U12_N444: sf = surface::SurfaceFormatEnum::NVDLA_IMG_Y12___V12U12_N444; break; + case nvdla::PixelFormat::Y16___U16V16_N444: sf = surface::SurfaceFormatEnum::NVDLA_IMG_Y16___U16V16_N444; break; + case nvdla::PixelFormat::Y16___V16U16_N444: sf = surface::SurfaceFormatEnum::NVDLA_IMG_Y16___V16U16_N444; break; + case nvdla::PixelFormat::A2Y10U10V10: sf = surface::SurfaceFormatEnum::NVDLA_IMG_A2Y10U10V10; break; + case nvdla::PixelFormat::V10U10Y10A2: sf = surface::SurfaceFormatEnum::NVDLA_IMG_V10U10Y10A2; break; + case nvdla::PixelFormat::A8Y8U8V8: sf = surface::SurfaceFormatEnum::NVDLA_IMG_A8Y8U8V8; break; + case nvdla::PixelFormat::V8U8Y8A8: sf = surface::SurfaceFormatEnum::NVDLA_IMG_V8U8Y8A8; break; + case nvdla::PixelFormat::FEATURE : { + switch(cp.v()) { + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_FP16: sf = surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_FP16; break; + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16: sf = surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_INT16; break; + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8: sf = surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_INT8; break; + default: ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Cant determine surface format FEATURE_ with compute precision: %d", (int)cp.v()); + } + }; break; + case nvdla::PixelFormat::FEATURE_X8: { + switch(cp.v()) { + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8: sf = surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_INT8; break; + default: ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Cant determine surface format FEATURE_ with compute precision: %d", (int)cp.v()); + } + }; break; + default: ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unrecognized input format: %d", pf.v()); + } + +fail: + return e; +} + +NvDlaError Profile::setNetworkInputSurfaceFormat(nvdla::PixelFormat nisf) +{ + NvDlaError e = NvDlaSuccess; + PROPAGATE_ERROR_FAIL(setSurfaceFormat(nisf, m_compileParams.m_computePrecision, m_globalParams.m_NwInSurfFormat)); + +fail: + return e; +} + +NvDlaError Profile::setNetworkOutputSurfaceFormat(nvdla::PixelFormat nosf) +{ + NvDlaError e = NvDlaSuccess; + PROPAGATE_ERROR_FAIL(setSurfaceFormat(nosf, m_compileParams.m_computePrecision, m_globalParams.m_NwOutSurfFormat)); + +fail: + return e; +} + +NvDlaError Profile::setNetworkInputPixelMapping(nvdla::PixelMapping pm) +{ + NvDlaError e = NvDlaSuccess; + + switch(pm) { + case nvdla::PixelMapping::PITCH_LINEAR: m_globalParams.m_NwInPixelMapping = surface::PixelMappingEnum::PITCH_LINEAR; break; + default: ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "unrecognized pixel mapping: %d", pm.v()); + } + +fail: + return e; +} + +NvDlaError Profile::initGlobalParams(IProfile::IGlobalParams* globalParams) +{ + NvDlaError e = NvDlaSuccess; + + PROPAGATE_ERROR_FAIL(setNetworkInputPixelOffX(globalParams->pixelOffsetX)); + PROPAGATE_ERROR_FAIL(setNetworkInputPixelOffY(globalParams->pixelOffsetY)); + PROPAGATE_ERROR_FAIL(setNetworkInputDataFormat(globalParams->inputDataFormat)); + PROPAGATE_ERROR_FAIL(setNetworkOutputDataFormat(globalParams->outputDataFormat)); + PROPAGATE_ERROR_FAIL(setNetworkInputPixelMapping(globalParams->inputPixelMapping)); + PROPAGATE_ERROR_FAIL(setNetworkInputSurfaceFormat(globalParams->inputPixelFormat)); + PROPAGATE_ERROR_FAIL(setNetworkOutputSurfaceFormat(globalParams->outputPixelFormat)); + +fail: + return e; +} + +NvDlaError Profile::setComputePrecision(nvdla::DataType cp) +{ + NvDlaError e = NvDlaSuccess; + switch (cp) { + case nvdla::DataType::HALF: m_compileParams.m_computePrecision = surface::SurfacePrecisionEnum::NVDLA_PRECISION_FP16; break; + case nvdla::DataType::INT16: m_compileParams.m_computePrecision = surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16; break; + case nvdla::DataType::INT8: m_compileParams.m_computePrecision = surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8; break; + default: ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unrecognized compute precision: %d", cp.v()); + } + +fail: + return e; +} + +NvDlaError Profile::setTensorScalingMode(nvdla::TensorScalingMode tsm) +{ + NvDlaError e = NvDlaSuccess; + + if (tsm.v() > EnumMax()) + { + e = NvDlaError_BadParameter; + goto fail; + } + + switch (tsm.v()) { + case nvdla::TensorScalingMode::NONE: + case nvdla::TensorScalingMode::PER_TENSOR: + m_compileParams.m_tensorScalingMode = tsm; + break; + default: + e = NvDlaError_NotSupported; + } + +fail: + return e; +} + +NvDlaError Profile::setQuantizationMode(nvdla::QuantizationMode qm) +{ + NvDlaError e = NvDlaSuccess; + + if (qm.v() > EnumMax()) + { + e = NvDlaError_BadParameter; + goto fail; + } + + switch (qm.v()) { + case nvdla::QuantizationMode::NONE: + case nvdla::QuantizationMode::PER_KERNEL: + case nvdla::QuantizationMode::PER_FILTER: + m_compileParams.m_quantizationMode = qm; + break; + default: + e = NvDlaError_NotSupported; + } + +fail: + return e; +} + +NvDlaError Profile::initCompileParams(IProfile::ICompileParams* compileParams) +{ + NvDlaError e = NvDlaSuccess; + + PROPAGATE_ERROR_FAIL(setCanCompressWeights(compileParams->canCompressWeights)); + PROPAGATE_ERROR_FAIL(setCanWinograd(compileParams->canWinograd)); + PROPAGATE_ERROR_FAIL(setCONVWeightBanksAllotted(compileParams->convWeightBanksAllotted)); + PROPAGATE_ERROR_FAIL(setCONVDataBanksAllotted(compileParams->convDataBanksAllotted)); + PROPAGATE_ERROR_FAIL(setCanSDPPDPOnFly(compileParams->canSdpPdpOnFly)); + PROPAGATE_ERROR_FAIL(setCanSDPMergeMathOps(compileParams->canSdpMergeMathOps)); + PROPAGATE_ERROR_FAIL(setCanSDPFuseSubEngineOps(compileParams->canSdpFuseSubEngineOps)); + PROPAGATE_ERROR_FAIL(setCanSDPBustNOPs(compileParams->canSdpBustNOPs)); + PROPAGATE_ERROR_FAIL(setCanSDPFuseVerticalOps(compileParams->canSdpFuseVerticalOps)); + PROPAGATE_ERROR_FAIL(setUseCVSRAMAllocate(compileParams->useCvsramAllocate)); + PROPAGATE_ERROR_FAIL(setUseMemPool(compileParams->useMemPool)); + PROPAGATE_ERROR_FAIL(setUseReusePooledMemory(compileParams->useReusePooledMemory)); + PROPAGATE_ERROR_FAIL(setCopyOutDebugSurfaces(compileParams->copyOutDebugSurfaces)); + PROPAGATE_ERROR_FAIL(setGlobalDRAMSize(compileParams->globalDramSize)); + PROPAGATE_ERROR_FAIL(setLocalDRAMSize(compileParams->localDramSize)); + PROPAGATE_ERROR_FAIL(setLocalCVSRAMSize(compileParams->localCvsramSize)); + PROPAGATE_ERROR_FAIL(setMultiBatchSize(compileParams->multiBatchSize)); + PROPAGATE_ERROR_FAIL(setCanIMGPostChnlExtend(compileParams->canImgPostChnlExtend)); + PROPAGATE_ERROR_FAIL(setComputePrecision(compileParams->computePrecision)); + PROPAGATE_ERROR_FAIL(setTensorScalingMode(compileParams->tensorScalingMode)); + PROPAGATE_ERROR_FAIL(setQuantizationMode(compileParams->quantizationMode)); + + setName(m_name.c_str()); //XXX hack to force use to reevaluate perf/default stuff just clobbered. + +fail: + return e; +} + +void Profile::initWithDefaultProfile() +{ + setDefaultProfile(); +} + +} // nvdla::priv + +} // nvdla:: diff --git a/umd/core/src/compiler/Profiler.cpp b/umd/core/src/compiler/Profiler.cpp new file mode 100644 index 00000000..6ab72802 --- /dev/null +++ b/umd/core/src/compiler/Profiler.cpp @@ -0,0 +1,201 @@ +/* + * Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#include +#include + +#include "priv/Check.h" + +#include "priv/Profile.h" +#include "priv/Profiler.h" +#include "priv/TargetConfig.h" + + +using std::string; +using std::endl; + + +namespace nvdla +{ + +IProfiler::IProfiler() { } +IProfiler::~IProfiler() { } + +namespace priv +{ + + +ProfilerFactory::ProfilerPrivPair ProfilerFactory::newProfiler() +{ + IProfiler *profiler; + Profiler *profiler_priv; + profiler = profiler_priv = new priv::Profiler(); + if (profiler) { + s_priv.insert(profiler, profiler_priv); + s_self.insert(profiler, profiler); + } + return ProfilerPrivPair(profiler, profiler_priv); +} + +NvDlaError ProfilerFactory::deleteProfiler(IProfiler *profiler) +{ + if (profiler != NULL) { + Profiler *profiler_priv = priv(profiler); + if (profiler_priv != NULL) { + delete profiler_priv; + } + + s_priv.remove(profiler); + s_priv.remove(profiler); + } + + return NvDlaSuccess; +} + +Profiler *ProfilerFactory::priv(IProfiler *profiler) +{ + BiMap::left_iterator f = s_priv.find_left(profiler); + + if ( f == s_priv.end_left() ) { + return NULL; + } + return f->second; +} + +IProfiler *ProfilerFactory::i(Profiler *profiler) +{ + BiMap::right_iterator f = s_priv.find_right(profiler); + if ( f == s_priv.end_right() ) { + return NULL; + } + return f->second; +} + +IProfiler *ProfilerFactory::self(void *s) +{ + BiMap::left_iterator f = s_self.find_left(s); + if ( f == s_self.end_left() ) { + return NULL; + } + return f->second; +} + + + +BiMap ProfilerFactory::s_priv; +BiMap ProfilerFactory::s_self; + +Profiler::Profiler() : + IProfiler(), + m_wisdom(0) +{ + +} + +Profiler::~Profiler() +{ + +} + +IWisdom *Profiler::wisdom() +{ + return (IWisdom*)m_wisdom; // Wisdom->IWisdom ok, but tbd: hook up WisdomFactory... +} + +NvU16 Profiler::getFactoryType() const +{ + return 0; // only one kind so far +} + +IProfile *Profiler::createProfile(const char *profile_name) +{ + return getProfile(profile_name); +} + +IProfile *Profiler::getProfile(const char *name) +{ + ProfileFactory::ProfilePrivPair pp; + std::map::iterator f; + IProfile *iprofile = NULL; + + if (name == NULL) + { + goto fail; + } + f = m_profiles.find(std::string(name)); + + if ( f != m_profiles.end() ) + { + pp = f->second; + } + else + { + pp = ProfileFactory::newProfile(); + m_profiles[name] = pp; + pp.priv()->setName(name); + } + + iprofile = pp.i(); + +fail: + return iprofile; + +} + +ITargetConfig *Profiler::getTargetConfig(const char *name) +{ + TargetConfigFactory::TargetConfigPrivPair pp; + std::map::iterator f; + ITargetConfig *itargetconfig = NULL; + + if (name == NULL) + { + goto fail; + } + f = m_targetConfigs.find(std::string(name)); + + if ( m_targetConfigs.find(name) != m_targetConfigs.end() ) + { + pp = f->second; + } + else + { + pp = TargetConfigFactory::newTargetConfig(); + m_targetConfigs[name] = pp; + pp.priv()->setName(name); + } + + itargetconfig = pp.i(); + +fail: + return itargetconfig; +} + +} // nvdla::priv + +} // nvdla diff --git a/umd/core/src/compiler/Setup.cpp b/umd/core/src/compiler/Setup.cpp new file mode 100644 index 00000000..009f109d --- /dev/null +++ b/umd/core/src/compiler/Setup.cpp @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#include "priv/Check.h" + +#include "priv/Setup.h" + +using std::string; +using std::endl; + + +namespace nvdla +{ + +ISetup::ISetup() { } +ISetup::~ISetup() { } + + + +ISetup *createSetup() +{ + priv::SetupFactory::SetupPrivPair p = priv::SetupFactory::newSetup(); + return p.i(); +} + +NvDlaError destroySetup(ISetup *setup) +{ + return priv::SetupFactory::deleteSetup(setup); +} + +namespace priv +{ + + +SetupFactory::SetupPrivPair SetupFactory::newSetup() +{ + ISetup *setup; + Setup *setup_priv; + setup = setup_priv = new priv::Setup(); + if (setup) { + s_priv.insert(setup, setup_priv); + } + return SetupPrivPair(setup, setup_priv); +} + +NvDlaError SetupFactory::deleteSetup(ISetup *setup) +{ + if (setup != NULL) { + Setup *setup_priv = priv(setup); + if (setup_priv != NULL) + delete setup_priv; + + s_priv.remove(setup); + } + + return NvDlaSuccess; +} + +Setup *SetupFactory::priv(ISetup *setup) +{ + BiMap::left_iterator f = s_priv.find_left(setup); + + if ( f == s_priv.end_left() ) { + return NULL; + } + return f->second; +} + +ISetup *SetupFactory::i(Setup *setup) +{ + BiMap::right_iterator f = s_priv.find_right(setup); + if ( f == s_priv.end_right() ) { + return NULL; + } + return f->second; +} + + +BiMap SetupFactory::s_priv; + +Setup::Setup() : + ISetup(), + m_wisdom(0) +{ + +} + +Setup::~Setup() +{ + +} + +IWisdom *Setup::wisdom() +{ + return (IWisdom*)m_wisdom; // Wisdom->IWisdom ok, but tbd: hook up WisdomFactory... +} + +NvU16 Setup::getFactoryType() const +{ + return 0; // only one kind so far +} + + + +} // nvdla::priv + +} // nvdla diff --git a/umd/core/src/compiler/Surface.cpp b/umd/core/src/compiler/Surface.cpp new file mode 100644 index 00000000..d9465637 --- /dev/null +++ b/umd/core/src/compiler/Surface.cpp @@ -0,0 +1,692 @@ +/* + * Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#include +#include + +#include "priv/Check.h" +#include "priv/Surface.h" +#include "priv/Memory.h" +#include "priv/WeightTranslationUnit.h" + +#include "ErrorMacros.h" + +#include "priv/EngineAST.h" + +using std::set; +using std::unordered_set; +using std::string; +using std::endl; + +namespace nvdla +{ +namespace priv +{ + +SEQUENCE_ENUM_STATIC_MEMBERS(surface::SurfaceCategoryEnum, NvU8, SURFACE_CATEGORY_ENUMS, "SurfaceCategoryEnum") +SEQUENCE_ENUM_STATIC_MEMBERS(surface::SurfacePrecisionEnum, NvU8, SURFACE_PRECISION_ENUMS, "SurfacePrecisionEnum") +SEQUENCE_ENUM_STATIC_MEMBERS(surface::BiasDataCategoryEnum, NvU8, BIAS_DATA_CATEGORY_ENUMS, "BiasDataCategoryEnum") +SEQUENCE_ENUM_STATIC_MEMBERS(surface::BatchNormDataCategoryEnum, NvU8, BATCH_NORM_DATA_CATEGORY_ENUMS, "BatchNormDataCategoryEnum") +SEQUENCE_ENUM_STATIC_MEMBERS(surface::ScaleDataCategoryEnum, NvU8, SCALE_DATA_CATEGORY_ENUMS, "ScaleDataCategoryEnum") +SEQUENCE_ENUM_STATIC_MEMBERS(surface::PixelMappingEnum, NvU8, PIXEL_MAPPING_ENUMS, "PixelMappingEnum") + +SURFACE_ENUM_STATIC_MEMBERS(surface::SurfaceFormatEnum, NvU8, SURFACE_FORMAT_ENUMS, "SurfaceFormatEnum") + +namespace surface +{ + +TensorSurfaceDesc::~TensorSurfaceDesc() { } + +/*----------------------------TENSOR SURFACE DESC APIs-----------------------*/ +NvU64 TensorSurfaceDesc::size() +{ + NvU64 size = 0ULL; + if (m_size != 0) + { + size = m_size; + goto done; + } + + switch(m_surface_format.category().v()) + { + case SurfaceCategoryEnum::IMG: size = IMGDesc::size(this); break; + case SurfaceCategoryEnum::FEATURE_DATA: size = FeatureDataDesc::size(this); break; + case SurfaceCategoryEnum::WEIGHT: size = WeightDesc::size(this); break; + case SurfaceCategoryEnum::BIAS_DATA: size = BiasDataDesc::size(this); break; + case SurfaceCategoryEnum::BATCH_NORM_DATA: size = BatchNormDataDesc::size(this); break; + case SurfaceCategoryEnum::SCALE_DATA: size = ScaleDataDesc::size(this); break; + default: + { + size = 0; + REPORT_ERROR(NvDlaError_NotSupported, "Unsupported surface category: %s", m_surface_format.category().c_str()); + } + } + m_size = size; +done: + return size; +} + +NvU32 TensorSurfaceDesc::lineStride() +{ + NvU32 ls = 0; + if (m_line_stride != 0) + { + ls = m_line_stride; + goto done; + } + + switch(m_surface_format.category().v()) + { + case SurfaceCategoryEnum::IMG: ls = IMGDesc::lineStride(this); break; + case SurfaceCategoryEnum::FEATURE_DATA: ls = FeatureDataDesc::lineStride(this); break; + case SurfaceCategoryEnum::BIAS_DATA: ls = BiasDataDesc::lineStride(this); break; + case SurfaceCategoryEnum::BATCH_NORM_DATA: ls = BatchNormDataDesc::lineStride(this); break; + case SurfaceCategoryEnum::SCALE_DATA: ls = ScaleDataDesc::lineStride(this); break; + case SurfaceCategoryEnum::WEIGHT: ls = 0; break; + default: + REPORT_ERROR(NvDlaError_NotSupported, "Unsupported surface category: %s", m_surface_format.category().c_str()); + } + m_line_stride = ls; +done: + return ls; +} + +NvU32 TensorSurfaceDesc::surfaceStride() +{ + NvU32 ss = 0; + if (m_surface_stride != 0) + { + ss = m_surface_stride; + goto done; + } + + switch(m_surface_format.category().v()) + { + case SurfaceCategoryEnum::IMG: ss = 0; break; + case SurfaceCategoryEnum::FEATURE_DATA: ss = FeatureDataDesc::surfaceStride(this); break; + case SurfaceCategoryEnum::BIAS_DATA: ss = BiasDataDesc::surfaceStride(this); break; + case SurfaceCategoryEnum::BATCH_NORM_DATA: ss = BatchNormDataDesc::surfaceStride(this); break; + case SurfaceCategoryEnum::SCALE_DATA: ss = ScaleDataDesc::surfaceStride(this); break; + case SurfaceCategoryEnum::WEIGHT: ss = 0; break; + default: + REPORT_ERROR(NvDlaError_NotSupported, "Unsupported surface category: %s", m_surface_format.category().c_str()); + } + m_surface_stride = ss; +done: + return ss; +} + +NvU32 TensorSurfaceDesc::planeStride() const +{ + NvU32 ps = 0; + switch(m_surface_format.category().v()) + { + case SurfaceCategoryEnum::BIAS_DATA: + case SurfaceCategoryEnum::BATCH_NORM_DATA: + case SurfaceCategoryEnum::SCALE_DATA: + case SurfaceCategoryEnum::WEIGHT: + case SurfaceCategoryEnum::FEATURE_DATA: + case SurfaceCategoryEnum::IMG: + ps = 0; break; + default: + REPORT_ERROR(NvDlaError_NotSupported, "Unsupported surface category: %s", m_surface_format.category().c_str()); + } + + return ps; +} + +bool TensorSurfaceDesc::referencedByEMU() const +{ + bool emuDetected = false; + for( unordered_set::const_iterator pi = producers().begin(); + pi != producers().end(); ++pi ) + { + emuDetected |= (*pi)->isEMUEngineType(); + } + for ( unordered_set::const_iterator ci = consumers().begin(); + ci != consumers().end(); ++ci ) + { + emuDetected |= (*ci)->isEMUEngineType(); + } + return emuDetected; +} + +bool TensorSurfaceDesc::isSurfaceSymmetricTo(TensorSurfaceDesc* other) +{ + bool dims3Diff = (m_dims.c != other->m_dims.c || m_dims.h != other->m_dims.h || m_dims.w != other->m_dims.w); + bool sizeDiff = m_size != other->m_size; + bool lsDiff = m_line_stride != other->m_line_stride; + bool ssDiff = m_surface_stride != other->m_surface_stride; + + return (!dims3Diff && !sizeDiff && !lsDiff && !ssDiff); +} + +/*--------------------------------IMG DESC APIs------------------------------*/ +PixelMapping IMGDesc::pixelMapping(const TensorSurfaceDesc* tsd) +{ + // FIXME: currently treating all images as pitch linear. + // in future, PL or BL would be determined from img dims + PixelMapping pm = PixelMappingEnum::PITCH_LINEAR; + NVDLA_UNUSED(tsd); + return pm; +} + +NvU32 IMGDesc::lineStride(const TensorSurfaceDesc* tsd) +{ + NvU32 ls = 0ULL; + PixelMapping pm = pixelMapping(tsd); + switch(pm.v()) + { + case PixelMappingEnum::PITCH_LINEAR: + ls = PitchLinearSurfaceDesc::lineStride(tsd); break; + default: + REPORT_ERROR(NvDlaError_NotSupported, "Unsupported pixel mapping: %s", pm.c_str()); + } + return ls; +} + +NvU32 IMGDesc::surfaceStride(const TensorSurfaceDesc*) +{ + return 0; +} + +NvU64 IMGDesc::size(const TensorSurfaceDesc* tsd) +{ + NvU64 size = 0ULL; + PixelMapping pm = pixelMapping(tsd); + switch(pm.v()) + { + case PixelMappingEnum::PITCH_LINEAR: + size = PitchLinearSurfaceDesc::size(tsd); break; + default: + size = 0; + } + return size; +} +/*-------------------IMG PITCH LINEAR SURFACE DESC APIs----------------------*/ +NvU32 PitchLinearSurfaceDesc::lineStride(const TensorSurfaceDesc* tsd) +{ + NvDlaError e = NvDlaSuccess; + NVDLA_UNUSED(e); + NvU32 lineStride = 0; + NvU8 bpe = tsd->surfaceFormat().bytesPerElement(); + NvS8 cpa = tsd->surfaceFormat().channelsPerAtom(); + + if (tsd->surfaceFormat().v() > SurfaceFormatEnum::NVDLA_IMG_Y16___V16U16_N444) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Surface Format %s is not Pitch Linear", tsd->surfaceFormat().c_str()); + } + + if (tsd->surfaceFormat().v() < SurfaceFormatEnum::NVDLA_IMG_Y8___U8V8_N444) + { + // interleave format, single plannar + lineStride = ROUNDUP_AND_ALIGN(tsd->dimensions().w * bpe * cpa, 32); + } + else + { + lineStride = ROUNDUP_AND_ALIGN(tsd->dimensions().w * bpe, 32); + } + +fail: + return lineStride; +} + +NvU32 PitchLinearSurfaceDesc::lineUVStride(const TensorSurfaceDesc* tsd) +{ + NvDlaError e = NvDlaSuccess; + NVDLA_UNUSED(e); + NvU32 lineUVStride = 0; + NvU8 bpe = tsd->surfaceFormat().bytesPerElement(); + NvS8 cpa = tsd->surfaceFormat().channelsPerAtom(); + + if (tsd->surfaceFormat().v() > SurfaceFormatEnum::NVDLA_IMG_Y16___V16U16_N444) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Surface Format %s is not Pitch Linear", tsd->surfaceFormat().c_str()); + } + + if (tsd->surfaceFormat().v() < SurfaceFormatEnum::NVDLA_IMG_Y8___U8V8_N444) + { + // interleave format, single plannar + lineUVStride = 0; + } + else + { + lineUVStride = ROUNDUP_AND_ALIGN(tsd->dimensions().w * bpe * (cpa - 1), 32); + } + +fail: + return lineUVStride; +} + +NvU64 PitchLinearSurfaceDesc::size(const TensorSurfaceDesc* tsd) +{ + NvDlaError e = NvDlaSuccess; + NVDLA_UNUSED(e); + NvU64 size = 0; + + if (tsd->surfaceFormat().v() > SurfaceFormatEnum::NVDLA_IMG_Y16___V16U16_N444) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Surface Format %s is not Pitch Linear", tsd->surfaceFormat().c_str()); + } + + ///// FIXME: treat pitch linear image as FD format for now - conservative size (~x32) (remove comment safely?) + //size = tsd->dimensions().c * lineStride(tsd) * tsd->dimensions().h; + size = tsd->dimensions().h * lineStride(tsd); + +fail: + return size; +} + +/*-----------------------FEATURE DATA DESC APIs------------------------------*/ +NvU32 FeatureDataDesc::numBatches(const TensorSurfaceDesc* tsd) +{ + //FIXME: currently single batch mode + NVDLA_UNUSED(tsd); + return 1; +} + +NvU32 FeatureDataDesc::channelsPerGroup(const TensorSurfaceDesc* tsd) +{ + nvdla::priv::engine_ast::Edge *edge_par = tsd->parentEdge(); + NvU32 atom_k_size = edge_par->graph()->target_config()->atomicKSize(); + + return tsd->surfaceFormat().precision().v() == SurfacePrecisionEnum::NVDLA_PRECISION_INT8 ? atom_k_size : (atom_k_size / 2); +} + +NvU32 FeatureDataDesc::channelGroups(const TensorSurfaceDesc* tsd) +{ + return (NvU32)ceilf((NvF32)tsd->dimensions().c / (NvF32)channelsPerGroup(tsd)); +} + +NvU32 FeatureDataDesc::height(const TensorSurfaceDesc* tsd) +{ + return tsd->dimensions().h; +} + +NvU32 FeatureDataDesc::width(const TensorSurfaceDesc* tsd) +{ + return tsd->dimensions().w; +} + +NvU32 FeatureDataDesc::lineStride(const TensorSurfaceDesc* tsd) +{ + return tsd->dimensions().w * channelsPerGroup(tsd) * tsd->surfaceFormat().bytesPerElement(); +} + +NvU32 FeatureDataDesc::surfaceStride(const TensorSurfaceDesc* tsd) +{ + return lineStride(tsd) * tsd->dimensions().h; +} + +NvU64 FeatureDataDesc::size(const TensorSurfaceDesc* tsd) +{ + return surfaceStride(tsd) * channelGroups(tsd); +} + +/*-----------------------ELTWISE DATA DESC APIs------------------------------*/ +NvU32 EltwiseDataDesc::channelsPerGroup(const TensorSurfaceDesc* tsd) +{ + nvdla::priv::engine_ast::Edge *edge_par = tsd->parentEdge(); + NvU32 atom_k_size = edge_par->graph()->target_config()->atomicKSize(); + + return tsd->surfaceFormat().precision().v() == SurfacePrecisionEnum::NVDLA_PRECISION_FP16 ? (atom_k_size / 2) : atom_k_size; +} + +NvU32 EltwiseDataDesc::channelGroups(const TensorSurfaceDesc* tsd) +{ + return (NvU32)ceilf((NvF32)tsd->dimensions().c / (NvF32)channelsPerGroup(tsd)); +} + +NvU32 EltwiseDataDesc::lineStride(const TensorSurfaceDesc* tsd) +{ + return tsd->dimensions().w * channelsPerGroup(tsd) * tsd->surfaceFormat().bytesPerElement(); +} + +NvU32 EltwiseDataDesc::surfaceStride(const TensorSurfaceDesc* tsd) +{ + return lineStride(tsd) * tsd->dimensions().h; +} + +NvU64 EltwiseDataDesc::size(const TensorSurfaceDesc* tsd) +{ + return surfaceStride(tsd) * channelGroups(tsd); +} + +/*--------------------------WEIGHT DESC APIs---------------------------------*/ +bool WeightDesc::iscompressed(const TensorSurfaceDesc* tsd) +{ + return string(tsd->surfaceFormat().c_str()).find("COMPRESSED") != string::npos ? true : false; +} + +NvU32 WeightDesc::fullChnlsPerGrp(const TensorSurfaceDesc* tsd) +{ + NvU32 fullChnlsPerGrp = 0; + + if (string(tsd->surfaceFormat().c_str()).find("DC") != string::npos) + { + nvdla::priv::engine_ast::Edge *edge_par = tsd->parentEdge(); + NvU32 atom_k_size = edge_par->graph()->target_config()->atomicCSize(); + fullChnlsPerGrp = atom_k_size; + } + else if (string(tsd->surfaceFormat().c_str()).find("WG") != string::npos) + { + fullChnlsPerGrp = WG_FULL_CHANNELS_PER_ATOM; + } + + return fullChnlsPerGrp; +} + +NvU32 WeightDesc::fullChnlGroups(const TensorSurfaceDesc* tsd) +{ + NvU32 fullChnlGroups = 0; + if (string(tsd->surfaceFormat().c_str()).find("DC") != string::npos) + { + fullChnlGroups = tsd->dimensions().c / fullChnlsPerGrp(tsd); + } + else if (string(tsd->surfaceFormat().c_str()).find("WG") != string::npos) + { + fullChnlGroups = tsd->dimensions().c / fullChnlsPerGrp(tsd); + } + + return fullChnlGroups; +} + +NvU32 WeightDesc::partialChnlsPerGrp(const TensorSurfaceDesc* tsd) +{ + NvU32 partialChnlsPerGrp = 0; + if (string(tsd->surfaceFormat().c_str()).find("DC") != string::npos) + { + partialChnlsPerGrp = tsd->dimensions().c % fullChnlsPerGrp(tsd); + } + else if (string(tsd->surfaceFormat().c_str()).find("WG") != string::npos) + { + partialChnlsPerGrp = 0; // In WG, #channels are rounded upto nearest multiple of 32 + } + + return partialChnlsPerGrp; +} + +NvU32 WeightDesc::fullKrnlsPerGrp(const TensorSurfaceDesc* tsd) +{ + NvU32 fullKrnlsPerGrp = 0; + + nvdla::priv::engine_ast::Edge *edge_par = tsd->parentEdge(); + NvU32 atom_k_size = edge_par->graph()->target_config()->atomicKSize(); + + if (string(tsd->surfaceFormat().c_str()).find("DC") != string::npos) + { + fullKrnlsPerGrp = tsd->surfaceFormat().precision().v() == SurfacePrecisionEnum::NVDLA_PRECISION_INT8 ? atom_k_size : (atom_k_size / 2); + } + else if (string(tsd->surfaceFormat().c_str()).find("WG") != string::npos) + { + fullKrnlsPerGrp = tsd->surfaceFormat().precision().v() == SurfacePrecisionEnum::NVDLA_PRECISION_INT8 ? atom_k_size : (atom_k_size / 2); + } + + return fullKrnlsPerGrp; +} + +NvU32 WeightDesc::fullKrnlGroups(const TensorSurfaceDesc* tsd) +{ + NvU32 fullKrnlGroups = 0; + if (string(tsd->surfaceFormat().c_str()).find("DC") != string::npos) + { + fullKrnlGroups = tsd->dimensions().n / fullKrnlsPerGrp(tsd); + } + else if (string(tsd->surfaceFormat().c_str()).find("WG") != string::npos) + { + fullKrnlGroups = tsd->dimensions().n / fullKrnlsPerGrp(tsd); + } + + return fullKrnlGroups; +} + +NvU32 WeightDesc::partialKrnlsPerGrp(const TensorSurfaceDesc* tsd) +{ + NvU32 partialKrnlsPerGrp = 0; + if (string(tsd->surfaceFormat().c_str()).find("DC") != string::npos) + { + partialKrnlsPerGrp = tsd->dimensions().n / fullKrnlsPerGrp(tsd); + } + else if (string(tsd->surfaceFormat().c_str()).find("WG") != string::npos) + { + partialKrnlsPerGrp = tsd->dimensions().n / fullKrnlsPerGrp(tsd); + } + + return partialKrnlsPerGrp; +} + +NvU32 WeightDesc::wgs(const TensorSurfaceDesc* tsd) +{ + gLogError << __func__ << "Not Yet Supported" << endl; + NVDLA_UNUSED(tsd); + return 0; +} + +NvU32 WeightDesc::wmb(const TensorSurfaceDesc* tsd) +{ + gLogError << __func__ << "Not Yet Supported" << endl; + NVDLA_UNUSED(tsd); + return 0; +} + +NvU64 WeightDesc::size(const TensorSurfaceDesc* tsd) +{ + nvdla::priv::engine_ast::Edge *edge_par = tsd->parentEdge(); + NvU32 cbuf_bank_width = edge_par->graph()->target_config()->bufEntryWidth(); + + return ROUNDUP_AND_ALIGN(tsd->dimensions().n * + tsd->dimensions().c * + tsd->dimensions().h * + tsd->dimensions().w * + tsd->surfaceFormat().bytesPerElement(), cbuf_bank_width); +} + +NvU32 WeightDesc::bytesPerKernel(const TensorSurfaceDesc* tsd) +{ + return (tsd->dimensions().c * + tsd->dimensions().h * + tsd->dimensions().w * + tsd->surfaceFormat().bytesPerElement()); +} + +NvU64 WeightDesc::rawSize(const TensorSurfaceDesc* tsd) +{ + return (tsd->dimensions().n * + tsd->dimensions().c * + tsd->dimensions().h * + tsd->dimensions().w * + tsd->surfaceFormat().bytesPerElement()); +} + +/*--------------------------BIAS DATA DESC APIs------------------------------*/ +BiasDataCategory BiasDataDesc::biasDataCategory(const TensorSurfaceDesc* tsd) +{ + BiasDataCategory bdc = BiasDataCategoryEnum::BIAS_DATA_CATEGORY_UNKNOWN; + /* Bias Data could be any of the 3 types: + * per-Layer: 1 x 1 x 1 + * per-Channel: 1 x 1 x C + * per-Element: W x H x C + */ + if (tsd->dimensions().c == 1 && tsd->dimensions().h == 1 && tsd->dimensions().w == 1) + { + bdc = BiasDataCategoryEnum::PER_LAYER_BIAS_DATA; + } + else + { + if (tsd->dimensions().h == 1 && tsd->dimensions().w == 1) + { + bdc = BiasDataCategoryEnum::PER_CHANNEL_BIAS_DATA; + } + else + { + bdc = BiasDataCategoryEnum::PER_ELEMENT_BIAS_DATA; + } + } + return bdc; +} + +NvU32 BiasDataDesc::lineStride(const TensorSurfaceDesc* tsd) +{ + NvU32 lineStride = 0; + + lineStride = EltwiseDataDesc::lineStride(tsd); + if (tsd->alignLineStride()) + { + lineStride = lineStride * 2; + } + + return lineStride; +} + +NvU32 BiasDataDesc::surfaceStride(const TensorSurfaceDesc* tsd) +{ + return lineStride(tsd) * tsd->dimensions().h; +} + +NvU64 BiasDataDesc::size(const TensorSurfaceDesc* tsd) +{ + NvU32 size = 0; + + switch(biasDataCategory(tsd).e()) { + case BiasDataCategoryEnum::PER_LAYER_BIAS_DATA: + case BiasDataCategoryEnum::PER_CHANNEL_BIAS_DATA: + size = tsd->dimensions().c * tsd->dimensions().h + * tsd->dimensions().w * tsd->surfaceFormat().bytesPerElement(); + break; + case BiasDataCategoryEnum::PER_ELEMENT_BIAS_DATA: + size = EltwiseDataDesc::size(tsd); + break; + default: + REPORT_ERROR(NvDlaError_BadParameter, + "Unable to compute size: unknown SDP data category %s", + biasDataCategory(tsd).c_str()); + } + + return size; +} + +/*--------------------------BATCH NORM DATA DESC APIs------------------------*/ +BatchNormDataCategory BatchNormDataDesc::batchNormDataCategory(const TensorSurfaceDesc* tsd) +{ + BatchNormDataCategory bndc = BatchNormDataCategoryEnum::BATCH_NORM_DATA_CATEGORY_UNKNOWN; + /* Batch Norm Data can be any of the 2 types: + * per-Layer: 1 x 1 x 1 + * per-Channel: 1 x 1 x C + */ + if (tsd->dimensions().c == 1) + { + bndc = BatchNormDataCategoryEnum::PER_LAYER_BATCH_NORM_DATA; + } + else if (tsd->dimensions().h == 1 && tsd->dimensions().w == 1) + { + bndc = BatchNormDataCategoryEnum::PER_CHANNEL_BATCH_NORM_DATA; + } + return bndc; +} + +NvU32 BatchNormDataDesc::lineStride(const TensorSurfaceDesc* tsd) +{ + return EltwiseDataDesc::lineStride(tsd); +} + +NvU32 BatchNormDataDesc::surfaceStride(const TensorSurfaceDesc* tsd) +{ + return lineStride(tsd) * tsd->dimensions().h; +} + +NvU64 BatchNormDataDesc::size(const TensorSurfaceDesc* tsd) +{ + return (2 * /* 1 for mean and 1 for variance */ + tsd->surfaceFormat().bytesPerElement() * + tsd->dimensions().c); +} + +/*--------------------------SCALE DATA DESC APIs-----------------------------*/ +ScaleDataCategory ScaleDataDesc::scaleDataCategory(const TensorSurfaceDesc* tsd) +{ + ScaleDataCategory sdc = ScaleDataCategoryEnum::SCALE_DATA_CATEGORY_UNKNOWN; + /* Scale Data can be any of the 3 types: + * per-Layer: 1 x 1 x 1 + * per-Channel: 1 x 1 x C + * per-Element: W x H x C + */ + if (tsd->dimensions().c == 1 && tsd->dimensions().h == 1 && tsd->dimensions().w == 1) + { + sdc = ScaleDataCategoryEnum::PER_LAYER_SCALE_DATA; + } + else + { + if (tsd->dimensions().h == 1 && tsd->dimensions().w == 1) + { + sdc = ScaleDataCategoryEnum::PER_CHANNEL_SCALE_DATA; + } + else + { + sdc = ScaleDataCategoryEnum::PER_ELEMENT_SCALE_DATA; + } + } + return sdc; +} + +NvU32 ScaleDataDesc::lineStride(const TensorSurfaceDesc* tsd) +{ + NvU32 lineStride = EltwiseDataDesc::lineStride(tsd); + + return lineStride; +} + +NvU32 ScaleDataDesc::surfaceStride(const TensorSurfaceDesc* tsd) +{ + return lineStride(tsd) * tsd->dimensions().h; +} + +NvU64 ScaleDataDesc::size(const TensorSurfaceDesc* tsd) +{ + NvU32 size = 0; + + switch(scaleDataCategory(tsd).e()) { + case ScaleDataCategoryEnum::PER_LAYER_SCALE_DATA: + case ScaleDataCategoryEnum::PER_CHANNEL_SCALE_DATA: + size = tsd->dimensions().c * tsd->dimensions().h + * tsd->dimensions().w * tsd->surfaceFormat().bytesPerElement(); + break; + case ScaleDataCategoryEnum::PER_ELEMENT_SCALE_DATA: + size = EltwiseDataDesc::size(tsd); + break; + default: + REPORT_ERROR(NvDlaError_BadParameter, + "Unable to compute size: unknown SDP data category %s", + scaleDataCategory(tsd).c_str()); + } + + return size; +} + +}; // nvdla::priv::surface:: +}; // nvdla::priv:: +}; // nvdla:: diff --git a/umd/core/src/compiler/TargetConfig.cpp b/umd/core/src/compiler/TargetConfig.cpp new file mode 100644 index 00000000..73cf4179 --- /dev/null +++ b/umd/core/src/compiler/TargetConfig.cpp @@ -0,0 +1,201 @@ +/* + * Copyright (c) 2018-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#include + +#include "priv/Check.h" + +#include "priv/Wisdom.h" +#include "priv/WisdomContainer.h" +#include "priv/TargetConfig.h" +#include "priv/Profiler.h" + +using std::endl; +using std::string; + +namespace nvdla +{ + + +ITargetConfig::ITargetConfig(){ } +ITargetConfig::~ITargetConfig() { } + +namespace priv +{ + +TargetConfigFactory::TargetConfigPrivPair TargetConfigFactory::newTargetConfig() +{ + ITargetConfig *target_config; + TargetConfig *target_config_priv; + target_config = target_config_priv = new priv::TargetConfig(); + if (target_config) { + s_priv.insert(target_config,target_config_priv); + s_self.insert(target_config,target_config); + } + return TargetConfigPrivPair(target_config, target_config_priv); +} + +TargetConfig *TargetConfigFactory::priv(ITargetConfig *target_config) +{ + BiMap::left_iterator f = s_priv.find_left(target_config); + if ( f == s_priv.end_left() ) { + return NULL; + } + return f->second; +} + +ITargetConfig *TargetConfigFactory::i(TargetConfig *target_config) +{ + BiMap::right_iterator f = s_priv.find_right(target_config); + if ( f == s_priv.end_right() ) { + return NULL; + } + return f->second; +} + +ITargetConfig *TargetConfigFactory::self(void *s) +{ + BiMap::left_iterator f = s_self.find_left(s); + if ( f == s_self.end_left() ) { + return NULL; + } + return f->second; +} + +BiMap TargetConfigFactory::s_priv; +BiMap TargetConfigFactory::s_self; + +const char* TargetConfig::getName() const +{ + return m_instance_name.c_str(); +} + +void TargetConfig::setName(const char* n) +{ + API_CHECK_NULL(n); + m_instance_name = n; + + if ( isFullConfig() ) + { + m_targetConfigParams.m_atomicCSize = 64; + m_targetConfigParams.m_atomicKSize = 32; + m_targetConfigParams.m_memoryAtomicSize = 32; + m_targetConfigParams.m_numConvBufBankAllotted = 16; + m_targetConfigParams.m_numConvBufEntriesPerBank = 256; + m_targetConfigParams.m_numConvBufEntryWidth = 128; + m_targetConfigParams.m_maxBatchSize = 32; + m_targetConfigParams.m_isPDPCapable = true; + m_targetConfigParams.m_isCDPCapable = true; + m_targetConfigParams.m_isSDPBiasCapable = true; + m_targetConfigParams.m_isSDPBatchNormCapable = true; + m_targetConfigParams.m_isSDPEltWiseCapable = true; + m_targetConfigParams.m_isSDPLutCapable = true; + m_targetConfigParams.m_isBDMACapable = true; + m_targetConfigParams.m_isRubikCapable = true; + m_targetConfigParams.m_isWinogradCapable = false; + m_targetConfigParams.m_isCompressWeightsCapable = false; + m_targetConfigParams.m_isBatchModeCapable = true; + } + else if ( isLargeConfig() ) + { + m_targetConfigParams.m_atomicCSize = 64; + m_targetConfigParams.m_atomicKSize = 32; + m_targetConfigParams.m_memoryAtomicSize = 32; + m_targetConfigParams.m_numConvBufBankAllotted = 16; + m_targetConfigParams.m_numConvBufEntriesPerBank = 512; + m_targetConfigParams.m_numConvBufEntryWidth = 64; + m_targetConfigParams.m_maxBatchSize = 32; + m_targetConfigParams.m_isPDPCapable = true; + m_targetConfigParams.m_isCDPCapable = true; + m_targetConfigParams.m_isSDPBiasCapable = true; + m_targetConfigParams.m_isSDPBatchNormCapable = true; + m_targetConfigParams.m_isSDPEltWiseCapable = true; + m_targetConfigParams.m_isSDPLutCapable = true; + m_targetConfigParams.m_isBDMACapable = false; + m_targetConfigParams.m_isRubikCapable = false; + m_targetConfigParams.m_isWinogradCapable = false; + m_targetConfigParams.m_isCompressWeightsCapable = false; + m_targetConfigParams.m_isBatchModeCapable = false; + } + else if ( isSmallConfig() ) + { + m_targetConfigParams.m_atomicCSize = 8; + m_targetConfigParams.m_atomicKSize = 8; + m_targetConfigParams.m_memoryAtomicSize = 8; + m_targetConfigParams.m_numConvBufBankAllotted = 32; + m_targetConfigParams.m_numConvBufEntriesPerBank = 512; + m_targetConfigParams.m_numConvBufEntryWidth = 8; + m_targetConfigParams.m_maxBatchSize = 0; + m_targetConfigParams.m_isPDPCapable = true; + m_targetConfigParams.m_isCDPCapable = true; + m_targetConfigParams.m_isSDPBiasCapable = true; + m_targetConfigParams.m_isSDPBatchNormCapable = true; + m_targetConfigParams.m_isSDPEltWiseCapable = false; + m_targetConfigParams.m_isSDPLutCapable = false; + m_targetConfigParams.m_isBDMACapable = false; + m_targetConfigParams.m_isRubikCapable = false; + m_targetConfigParams.m_isWinogradCapable = false; + m_targetConfigParams.m_isCompressWeightsCapable = false; + m_targetConfigParams.m_isBatchModeCapable = false; + } + else + { + gLogError << "Invalid target config" << std::endl; + } +} + +NvDlaError TargetConfig::initTargetConfigParams(ITargetConfig::ITargetConfigParams* targetConfigParams) +{ + NvDlaError e = NvDlaSuccess; + + m_targetConfigParams.m_atomicCSize = targetConfigParams->atomicCSize; + m_targetConfigParams.m_atomicKSize = targetConfigParams->atomicKSize; + m_targetConfigParams.m_memoryAtomicSize = targetConfigParams->memoryAtomicSize; + m_targetConfigParams.m_numConvBufBankAllotted = targetConfigParams->numConvBufBankAllotted; + m_targetConfigParams.m_numConvBufEntriesPerBank = targetConfigParams->numConvBufEntriesPerBank; + m_targetConfigParams.m_numConvBufEntryWidth = targetConfigParams->numConvBufEntryWidth; + m_targetConfigParams.m_maxBatchSize = targetConfigParams->maxBatchSize; + + m_targetConfigParams.m_isWinogradCapable = targetConfigParams->isWinogradCapable; + m_targetConfigParams.m_isCompressWeightsCapable = targetConfigParams->isCompressWeightsCapable; + m_targetConfigParams.m_isBatchModeCapable = targetConfigParams->isBatchModeCapable; + m_targetConfigParams.m_isPDPCapable = targetConfigParams->isPDPCapable; + m_targetConfigParams.m_isCDPCapable = targetConfigParams->isCDPCapable; + m_targetConfigParams.m_isSDPBiasCapable = targetConfigParams->isSDPBiasCapable; + m_targetConfigParams.m_isSDPBatchNormCapable = targetConfigParams->isSDPBatchNormCapable; + m_targetConfigParams.m_isSDPEltWiseCapable = targetConfigParams->isSDPEltWiseCapable; + m_targetConfigParams.m_isSDPLutCapable = targetConfigParams->isSDPLutCapable; + m_targetConfigParams.m_isBDMACapable = targetConfigParams->isBDMACapable; + m_targetConfigParams.m_isRubikCapable = targetConfigParams->isRubikCapable; + + return e; +} + +} // nvdla::priv + +} // nvdla:: diff --git a/umd/core/src/compiler/Tensor.cpp b/umd/core/src/compiler/Tensor.cpp new file mode 100644 index 00000000..ca0bd43b --- /dev/null +++ b/umd/core/src/compiler/Tensor.cpp @@ -0,0 +1,336 @@ +/* + * Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#include // for fabs + +#include "priv/Check.h" + +#include "priv/Tensor.h" +#include "priv/WisdomContainer.h" + + +using std::string; +using std::endl; + +namespace nvdla { + + +ITensor::ITensor() { } +ITensor::~ITensor() { } + + +namespace priv { + + + +TensorFactory::TensorPrivPair TensorFactory::newTensor() +{ + ITensor *tensor; + Tensor *tensor_priv; + tensor = tensor_priv = new priv::Tensor(); + if (tensor) { + s_priv.insert(tensor,tensor_priv); + s_self.insert(tensor,tensor); + } + return TensorPrivPair(tensor, tensor_priv); +} + +Tensor *TensorFactory::priv(ITensor *tensor) +{ + // gLogError << __func__ << " looking up priv for base_i=" << tensor << endl; + BiMap::left_iterator f = s_priv.find_left(tensor); + if ( f == s_priv.end_left() ) { + return NULL; + } + return f->second; +} + +ITensor *TensorFactory::i(Tensor *tensor) +{ + BiMap::right_iterator f = s_priv.find_right(tensor); + if ( f == s_priv.end_right() ) { + return NULL; + } + return f->second; +} + + +ITensor *TensorFactory::self(void *s) +{ + BiMap::left_iterator f = s_self.find_left(s); + if ( f == s_self.end_left() ) { + return NULL; + } + return f->second; +} + + +ITensor *TensorFactory::deserializeFrom(WisdomContainerEntry *entry) +{ + bool ok = false; + ITensor *tensor = NULL; + + // only one type of tensor right now (ITensor/Tensor)... but go through the motions + WisdomContainerEntry factory_type_entry; + // TensorType factory_type; + NvU32 v; + + if ( entry->type() != IWisdomContainerEntry::ENTRY_TYPE_OBJECT ) { + goto done; + } + + ok = entry->getEntry("factory_type", IWisdomContainerEntry::ENTRY_TYPE_UINT32, &factory_type_entry); + + ok = ok && factory_type_entry.readUInt32(v); + if ( !ok ) { + goto done; + } + + tensor = deserializeTensor(entry); + + done: + return tensor; +} + +BiMap TensorFactory::s_priv; +BiMap TensorFactory::s_self; + +// there's only one type of "Tensor" for now. so only one of these... so it looks +// silly. see the same paths in "LayerFactory::deserialize*" for why it makes sense +// to organize this way preemptively. +ITensor *TensorFactory::deserializeTensor(WisdomContainerEntry *entry) +{ + TensorFactory::TensorPrivPair t = newTensor(); + if ( !t ) { + return NULL; + } + t.priv()->deserializeFrom(entry); + return t.i(); +} + + +NvU16 Tensor::getFactoryType() const +{ + return 0; // only one type of tensor so far, not complicated by factory splits +} + + +Tensor::~Tensor() { } + +bool Tensor::serializeTo(WisdomContainerEntry *e) const +{ + bool ok = true; + WisdomContainerEntry name_entry; + + // gLogError << __func__ << " name=[" << getName() << "]" << endl; + + ok = ok && e->writeUInt32("factory_type", getFactoryType()); + ok = ok && e->writeString("name", getName()); + ok = ok && e->writeDims4("dimensions", getDimensions()); + ok = ok && e->writeInt32("data_format", getDataFormat().v()); + ok = ok && e->writeInt32("data_type", getDataType().v()); + ok = ok && e->writeInt32("tensor_type", (int) getTensorType()); + + return ok; +} + +bool Tensor::deserializeFrom(WisdomContainerEntry *e) +{ + WisdomContainerEntry name_entry; + string name; + Dims4 dims; + NvS32 data_format, data_type, tensor_type; + + bool ok = e->getEntry(string("name"), IWisdomContainerEntry::ENTRY_TYPE_STRING, &name_entry); + ok = ok && name_entry.readString(name); + if ( ok ) { + setName(name.c_str()); + } + ok = ok && e->readDims4("dimensions", dims); + if (ok) { + setDimensions(dims); + } + + ok = ok && e->readInt32("data_format", data_format); + if ( ok ) { + setDataFormat((DataFormat)data_format); + } + + ok = ok && e->readInt32("data_type", data_type); + if ( ok ) { + setDataType((DataType)data_type); + } + + ok = ok && e->readInt32("tensor_type", tensor_type); + if ( ok ) { + setTensorType((TensorType)tensor_type); + } + + + return ok; +} + + +void Tensor::setDimensions(Dims4 dimensions) +{ + //API_CHECK_DIMS3_TENSOR(dimensions); + + mDimensions = dimensions; +} + +Dims4 Tensor::getDimensions() const +{ + return mDimensions; +} + +bool Tensor::isNetworkInput() const +{ + API_CHECK_NULL_RETVAL(mNetwork, false); + + for (int i = 0; i < mNetwork->getNumInputs(); i++) { + if (mNetwork->getInput(i) == this) { + return true; + } + } + return false; +} +bool Tensor::isNetworkOutput() const +{ + API_CHECK_NULL_RETVAL(mNetwork, false); + + for (int i = 0; i < mNetwork->getNumOutputs(); i++) { + if (mNetwork->getOutput(i) == this) { + return true; + } + } + return false; +} + + +Tensor::Tensor(INetwork* network, const string name) : + mDimensions({0,0,0}), + mNetwork(network), + mName(name), + mDataFormat(DataFormat::NCHW), + mDataType(DataType::FLOAT) +{ + API_CHECK_NULL(network); +} + +const char* Tensor::getName() const +{ + return mName.c_str(); +} + +void Tensor::setName(const char* n) +{ + API_CHECK_NULL(n); mName = n; +} + +INetwork *Tensor::getNetwork() const +{ + return mNetwork; +} + +void Tensor::setNetwork(INetwork *network) +{ + mNetwork = network; +} + +DataFormat Tensor::getDataFormat() const +{ + return mDataFormat; +} + +void Tensor::setDataFormat(DataFormat f) +{ + mDataFormat = f; +} + +DataType Tensor::getDataType() const +{ + return mDataType; +} + +void Tensor::setDataType(DataType t) +{ + mDataType = t; +} + +TensorType Tensor::getTensorType() const +{ + return mTensorType; +} + +void Tensor::setTensorType(TensorType t) +{ + mTensorType = t; +} + +NvDlaError Tensor::setChannelDynamicRange(NvS32 chnlIndx, NvF32 min, NvF32 max) +{ + NvDlaError e = NvDlaSuccess; + NvF32 scaleFactor = std::max(std::fabs(min), std::fabs(max))/127.0; + + if (chnlIndx >= mDimensions.c) + { + e = NvDlaError_BadParameter; + goto fail; + } + else if (chnlIndx == -1) + { + // clear existing scales and adjust vector capacity if need be before inserting + mChnlScales.clear(); + mChnlScales.reserve(mDimensions.c); + for (NvU32 cc = 0; cc < static_cast(mDimensions.c); ++cc) + { + mChnlScales.push_back(scaleFactor); + } + } + else + { + // adjust vector capacity before inserting + if (mChnlScales.capacity() < (size_t)mDimensions.c) + { + mChnlScales.reserve(mDimensions.c); + } + mChnlScales.insert(mChnlScales.begin() + chnlIndx, scaleFactor); + } + +fail: + return e; +} + +NvDlaError Tensor::setChannelOffset(NvS32 chnlIndx, NvF32 offset) +{ + return NvDlaError_NotSupported; +} + +} // nvdla::priv + +} // nvdla diff --git a/umd/core/src/compiler/TestPointParameter.cpp b/umd/core/src/compiler/TestPointParameter.cpp new file mode 100644 index 00000000..9e77a6cb --- /dev/null +++ b/umd/core/src/compiler/TestPointParameter.cpp @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#include + +#include "priv/Type.h" + +#include "priv/TestPointParameter.h" + +#include "ErrorMacros.h" + + +namespace nvdla +{ + +namespace priv +{ + +ENUM_PARAMETER_STATIC(BatchModeParameter, BATCH_MODE_ENUMS, "BatchMode") +ENUM_PARAMETER_STATIC(CVSRamSizeParameter, CVSRAM_SIZE_ENUMS, "CVSRamSize") +ENUM_PARAMETER_STATIC(HWLayerTuningParameter, HW_LAYER_TUNING_ENUMS, "HWLayerTuning") +ENUM_PARAMETER_STATIC(MappingWeightsParameter, MAPPING_WEIGHTS_ENUMS, "MappingWeights") +ENUM_PARAMETER_STATIC(PaddingParameter, PADDING_ENUMS, "Padding") +ENUM_PARAMETER_STATIC(OutputSequenceParameter, OUTPUT_SEQUENCE_ENUMS, "OutputSequence") +ENUM_PARAMETER_STATIC(DilationParameter, DILATION_ENUMS, "Dilation") +ENUM_PARAMETER_STATIC(WeightDensityParameter, WEIGHT_DENSITY_ENUMS, "WeightDensity") +ENUM_PARAMETER_STATIC(FeatureDensityParameter, FEATURE_DENSITY_ENUMS, "") +ENUM_PARAMETER_STATIC(ChannelExtensionParameter, CHANNEL_EXTENSION_ENUMS, "ChannelExtension") +ENUM_PARAMETER_STATIC(ConvMACRedundancyParameter, CONV_MAC_REDUNDANCY_ENUMS, "") +ENUM_PARAMETER_STATIC(ConvBufBankMgmtParameter, CONV_BUF_BANK_MGMT_ENUMS, "ConvBufBankMgmt") +ENUM_PARAMETER_STATIC(PDPOpModeParameter, PDP_OP_MODE_ENUMS, "PDPOpMode") +ENUM_PARAMETER_STATIC(OffFlyingOpModeParameter, OFF_FLYING_OP_MODE_ENUMS, "OffFlyingOpMode") +ENUM_PARAMETER_STATIC(AXIFSchedParameter, AXIF_SCHED_ENUMS, "AXIFSched") +ENUM_PARAMETER_STATIC(PixelDataFormatParameter, PIXEL_DATA_FORMAT_ENUMS, "PixelDataFormat") +ENUM_PARAMETER_STATIC(NetworkForksParameter, NETWORK_FORKS_ENUMS, "NetworkForks") + + + + +static void trythis() +{ + NVDLA_UNUSED(&trythis); + CVSRamSizeParameter f( CVSRamSize::ZERO_MB ); + const char * fstr = f.c_str(); + CVSRamSizeParameter::underlying_type v = f.v(); + NVDLA_UNUSED(fstr); + NVDLA_UNUSED(v); + + switch (f.e()) + { + case CVSRamSize::ZERO_MB: + break; + + case CVSRamSize::TWO_MB: + break; + + case CVSRamSize::FOUR_MB: + break; + + default: + break; + }; +} + + +} // nvdla::priv + +} // nvdla diff --git a/umd/core/src/compiler/Wisdom.cpp b/umd/core/src/compiler/Wisdom.cpp new file mode 100644 index 00000000..f3976270 --- /dev/null +++ b/umd/core/src/compiler/Wisdom.cpp @@ -0,0 +1,982 @@ +/* + * Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#include +#include + +#include "priv/Network.h" +#include "priv/Check.h" + +#include "priv/Wisdom.h" +#include "priv/WisdomContainer.h" + +using std::vector; +using std::string; +using std::endl; + +namespace nvdla +{ + +IWisdom::IWisdom() { } +IWisdom::~IWisdom() { } + +IWisdom *createWisdom() +{ + priv::WisdomFactory::WisdomPrivPair wp_pair = priv::WisdomFactory::newWisdom(); + return wp_pair.i(); +} + +NvDlaError destroyWisdom(IWisdom *wisdom) +{ + NvDlaError e = NvDlaSuccess; + PROPAGATE_ERROR_FAIL(priv::WisdomFactory::deleteWisdom(wisdom)); + +fail: + return e; +} + +namespace priv +{ + + +WisdomFactory::WisdomPrivPair WisdomFactory::newWisdom() +{ + IWisdom *wisdom; + Wisdom *wisdom_priv; + wisdom = wisdom_priv = new priv::Wisdom(); + if (wisdom) { + s_priv.insert(wisdom, wisdom_priv); + s_self.insert(wisdom, wisdom); + } + return WisdomPrivPair(wisdom, wisdom_priv); +} + +NvDlaError WisdomFactory::deleteWisdom(IWisdom *wisdom) +{ + if (wisdom != NULL) { + Wisdom *wisdom_priv = priv(wisdom); + if (wisdom_priv != NULL) { + delete wisdom_priv; + } + + s_priv.remove(wisdom); + s_self.remove(wisdom); + } + + return NvDlaSuccess; +} + +Wisdom *WisdomFactory::priv(IWisdom *wisdom) +{ + BiMap::left_iterator f = s_priv.find_left(wisdom); + + if ( f == s_priv.end_left() ) { + return NULL; + } + return f->second; +} + +IWisdom *WisdomFactory::i(Wisdom *wisdom) +{ + BiMap::right_iterator f = s_priv.find_right(wisdom); + if ( f == s_priv.end_right() ) { + return NULL; + } + return f->second; +} + +IWisdom *WisdomFactory::self(void *s) +{ + BiMap::left_iterator f = s_self.find_left(s); + if ( f == s_self.end_left() ) { + return NULL; + } + return f->second; +} + + +BiMap WisdomFactory::s_priv; +BiMap WisdomFactory::s_self; + + +Wisdom::Wisdom() : m_container(0), m_network(0), m_compiler(0), m_profiler(0) +{ + +} + +Wisdom::~Wisdom() +{ + if (m_compiler != NULL) { + CompilerFactory::deleteCompiler(m_compiler); + m_compiler = NULL; + } + if (m_profiler != NULL) { + ProfilerFactory::deleteProfiler(m_profiler); + m_profiler = NULL; + } + if ( m_container ) { + close(); + m_container = NULL; + } +} + +bool Wisdom::open(const std::string &uri) +{ + NvDlaError e = NvDlaSuccess; + NVDLA_UNUSED(e); + + bool status = false; + CATCH_ERROR_FAIL(status = openInternal(uri)); + +fail: + return status; +} + +bool Wisdom::openInternal(const std::string &uri) +{ + m_container = new WisdomContainer(this); + if ( !m_container ) { + return false; + } + + bool ok = m_container->open(uri); + if ( !ok ) { + return false; + } + + IWisdomContainerEntry *root = m_container->root(); + WisdomContainerEntry *root_priv = m_container->root_priv(); + NVDLA_UNUSED(root); + + NvU32 data_type; + if ( root_priv->readUInt32("data_type", data_type) ) { + m_data_type = data_type; + } else { + m_data_type = DataType::INT16; + } + return ok; +} + +void Wisdom::close() +{ + NvDlaError e = NvDlaSuccess; + NVDLA_UNUSED(e); + CATCH_ERROR_FAIL(closeInternal()); + +fail: + return; +} + +void Wisdom::closeInternal() +{ + m_container->close(); + m_container = 0; +} + +IWisdomContainerEntry *Wisdom::getRootEntry() +{ + if ( !m_container ) { + gLogError << "no root?!?!" << endl; + return 0; + } + return m_container->root(); +} + + +bool Wisdom::setNetworkTransient(INetwork *inetwork) +{ + Network *network = NetworkFactory::priv(inetwork); + if ( !network ) { + gLogError << "unrecognized network presented to Wisdom" << endl; + return false; + } + // + // prior to serialization all objects need entries in the symbol table. + // since the network ultimately refers to them all, just triggering + // it's symbols to be resolved is sufficient to be able to deserialize + // it later. + // + bool ok = network->assignSymbols(m_container->wisdom_priv()); + m_network = network; + return ok; +} + +bool Wisdom::setNetwork(INetwork *inetwork) +{ + NvDlaError e = NvDlaSuccess; + NVDLA_UNUSED(e); + bool status = false; + CATCH_ERROR_FAIL(status = setNetworkInternal(inetwork)); + +fail: + return status; +} + +bool Wisdom::setNetworkInternal(INetwork *inetwork) +{ + + bool ok = setNetworkTransient(inetwork); + if ( !ok ) + { + return false; + } + + Network *network = NetworkFactory::priv(inetwork); + if ( !network ) { + gLogError << "unrecognized network presented to Wisdom" << endl; + return false; + } + if ( !m_container ) { + gLogError << "can't Wisdom::setNetwork unless a container is available" << endl; + return false; + } + WisdomContainerEntry network_entry; + + ok = m_container->root_priv()->getEntry("network", + IWisdomContainerEntry::ENTRY_TYPE_OBJECT, + &network_entry); + if ( ok ) { + gLogError << "can't Wisdom::setNetwork if 'network' is already present in the container" << endl; + return false; + } + + ok = m_container->root_priv()->insertEntry("network", + IWisdomContainerEntry::ENTRY_TYPE_OBJECT, + &network_entry); + if ( !ok ) { + gLogError << "Wisdom::setNetwork couldn't insert network into a container entry" << endl; + return false; + } + // + // this will cause all the referenced tensors (inputs, outputs, weights, etc) + // and layers to be serialized as well. + // + ok = network->serializeTo(&network_entry); + if ( !ok ) { + gLogError << "Wisdom::setNetwork couldn't serialize network into a container entry" << endl; + return false; + } + + return ok; + +} + +INetwork *Wisdom::getNetwork() +{ + NvDlaError e = NvDlaSuccess; + NVDLA_UNUSED(e); + INetwork* inetwork = NULL; + CATCH_ERROR_FAIL(inetwork = getNetworkInternal()); + +fail: + return inetwork; +} + +INetwork *Wisdom::getNetworkInternal() +{ + // gLogError << __func__ << " getting network." << endl; + if ( m_network ) { + return m_network; + } + if ( !m_container ) { + gLogError << "no container to get network from" << endl; + return NULL; + } + + // gLogError << __func__ << " getting network entry" << endl; + // deserialize from container + WisdomContainerEntry network_entry; + bool ok = m_container->root_priv()->getEntry("network", + IWisdomContainerEntry::ENTRY_TYPE_OBJECT, + &network_entry); + if ( !ok ) { + gLogError << "no network present" << endl; + return NULL; + } + + m_network = NetworkFactory::deserializeFrom(&network_entry); + + return m_network; +} + + +bool Wisdom::insertNetworkSymbol(INetwork *net, const std::string &sym) +{ + return m_symbol_table.insertNetwork(net, sym); +} + +INetwork *Wisdom::findNetworkSymbol(const std::string &sym) +{ + return m_symbol_table.findNetwork(sym); +} + +bool Wisdom::insertLayerSymbol(ILayer *layer, const std::string &sym) +{ + // gLogError << "this=" << this << " layer=" << layer << " sym=[" << sym << "]" << endl; + return m_symbol_table.insertLayer(layer, sym); +} + +ILayer *Wisdom::findLayerSymbol(const std::string &sym) +{ + return m_symbol_table.findLayer(sym); +} + +bool Wisdom::findLayerSymbol(Layer *find_this, std::string &found_name) +{ + return m_symbol_table.findLayer(find_this, found_name); +} + +bool Wisdom::findILayerSymbol(ILayer *find_this, std::string &found_name) +{ + Layer *layer; + bool ok = NULL != find_this; + if ( ok ) { + layer = LayerFactory::priv(find_this); + } + ok = ok && (NULL != layer); + ok = ok && findLayerSymbol(layer, found_name); + return ok; +} + +bool Wisdom::assignLayerSymbol(Layer *assign_layer, std::string &assigned_sym) +{ + std::stringstream ss; + bool ok = false; + bool assigned = false; + Layer *found_layer; + std::string found_sym; + std::string try_sym; + NVDLA_UNUSED(assigned); + + // check to see if it is already assigned. + if ( findLayerSymbol(assign_layer, found_sym) ) { + assigned_sym = found_sym; + return true; + } + + // + // first choice is to have symbol name == layer name. + // assuming it is a valid symbol name to start with... + // + assigned_sym.clear(); + try_sym = assign_layer->getName(); + if ( try_sym.size() /*tbd: isValidSymbolName(try_sym) */ ) { + found_layer = LayerFactory::priv(findLayerSymbol(try_sym)); + if ( found_layer ) { + // by construction, found_layer cannot be == assign_layer here. + // if it had been, the check above for idempotency would have taken care of it. + // so we found layer a layer already using this layer's name as a symbol name. + // someone dup'd layer names. so assign a new one... + } + else { + assigned_sym = try_sym; + } + } + + // assign something dumb, but almost certain to be ok. + // XXX: after round round of serialization and subsequent + // modification and reserialization this could be WRONG!!! + if ( assigned_sym.empty() ) { + ss << assign_layer; // note this is a pointer! + assigned_sym = "layer-" + ss.str(); + } + + ok = insertLayerSymbol( LayerFactory::i(assign_layer), assigned_sym ); + + return ok; +} + +// root/layers// +bool Wisdom::setLayer(Layer *layer) +{ + bool ok = true; + string sym; + WisdomContainerEntry *root = NULL; + WisdomContainerEntry layers_entry; + WisdomContainerEntry layer_entry; + + ok = NULL != m_container; + if (ok) { + root = m_container->root_priv(); + } + if ( !ok ) { + goto done; + } + ok = root->insertEntryIfNotPresent("layers", + IWisdomContainerEntry::ENTRY_TYPE_OBJECT, + &layers_entry); + ok = ok && findLayerSymbol(layer, sym); + if ( !ok ) { + gLogError << __func__ << " couldn't find create or find root symbol for layer name=" << + layer->getName() << " sym=" << sym << endl; + goto done; + } + ok = layers_entry.insertEntryIfNotPresent(sym, + IWisdomContainerEntry::ENTRY_TYPE_OBJECT, + &layer_entry); + ok = ok && layer->serializeTo(&layer_entry); + if ( !ok ) { + gLogError << __func__ << " couldn't find entry for or serialize layer name=" << + layer->getName() << " sym=" << sym << endl; + goto done; + } + + // gLogError << __func__ << " serialized layer name=" << layer->getName() << " sym=" << sym << endl; + + done: + return ok; +} + +// root/layers// +ILayer *Wisdom::getLayerFromSymbol(const std::string &sym) +{ + bool ok = true; + ILayer *layer = findLayerSymbol(sym); + if ( layer ) { + return layer; + } + // gLogError << __func__ << " sym=[" << sym << "]" << endl; + // request to instantiate is implied. + // find the symbol and deserialize from it. + WisdomContainerEntry layers_entry; + WisdomContainerEntry layer_entry; + + ok = m_container->root_priv()->getEntry("layers", + IWisdomContainerEntry::ENTRY_TYPE_OBJECT, + &layers_entry); + if ( !ok ) { + gLogError << __func__ << " no layers entry for the wisdom" << endl; + return NULL; + } + ok = layers_entry.getEntry(sym, IWisdomContainerEntry::ENTRY_TYPE_OBJECT, &layer_entry); + if ( !ok ) { + gLogError << __func__ << " no entry for sym=[" << sym << "]" << endl; + return NULL; + } + + layer = LayerFactory::deserializeFrom(&layer_entry); + if ( !layer ) { + gLogError << __func__ << " uh, deserialize freaked out" << endl; + return NULL; + } + // gLogError << __func__ << " deserialized layer=" << layer << endl; + + ok = insertLayerSymbol(layer, sym); + + if ( !ok ) { + gLogError << __func__ << "couldn't insert layer symbol sym=[" << sym << "]" << endl; + return NULL; + } + return layer; +} + +bool Wisdom::insertTensorSymbol(ITensor *tensor, const std::string &sym) +{ + return m_symbol_table.insertTensor(tensor, sym); +} + +ITensor *Wisdom::findTensorSymbol(const std::string &sym) +{ + return m_symbol_table.findTensor(sym); +} + +bool Wisdom::findTensorSymbol(Tensor *find_this, std::string &found_name) +{ + return m_symbol_table.findTensor(find_this, found_name); +} + +bool Wisdom::findITensorSymbol(ITensor *find_this, std::string &found_name) +{ + Tensor *tensor; + bool ok = NULL != find_this; + if (ok ) { + tensor = TensorFactory::priv(find_this); + } + ok = ok && (NULL != tensor); + ok = ok && findTensorSymbol(tensor, found_name); + return ok; +} + +bool Wisdom::assignTensorSymbol(Tensor *assign_tensor, std::string &assigned_sym) +{ + std::stringstream ss; + bool ok = false; + bool assigned = false; + Tensor *found_tensor; + std::string found_sym; + std::string try_sym; + NVDLA_UNUSED(assigned); + + // check to see if it is already assigned. + if ( findTensorSymbol(assign_tensor, found_sym) ) { + assigned_sym = found_sym; + return true; + } + + // + // first choice is to have symbol name == tensor name. + // assuming it is a valid symbol name to start with... + // + assigned_sym.clear(); + try_sym = assign_tensor->getName(); + if ( try_sym.size() /*tbd: isValidSymbolName(try_sym) */ ) { + found_tensor = TensorFactory::priv(findTensorSymbol(try_sym)); + if ( found_tensor ) { + // by construction, found_tensor cannot be == assign_tensor here. + // if it had been, the check above for idempotency would have taken care of it. + // so we found tensor a tensor already using this tensor's name as a symbol name. + // someone dup'd tensor names. so assign a new one... + } + else { + assigned_sym = try_sym; + } + } + + // assign something dumb, but almost certain to be ok. + // XXX: after round round of serialization and subsequent + // modification and reserialization this could be WRONG!!! + if ( assigned_sym.empty() ) { + ss << assign_tensor; // note this is a pointer! + assigned_sym = "tensor-" + ss.str(); + } + + ok = insertTensorSymbol( TensorFactory::i(assign_tensor), assigned_sym ); + + + return ok; +} + + +// root/tensors// +bool Wisdom::setTensor(Tensor *tensor) +{ + bool ok = true; + string sym; + WisdomContainerEntry *root = NULL; + WisdomContainerEntry tensors_entry; + WisdomContainerEntry tensor_entry; + + ok = NULL != m_container; + if (ok) { + root = m_container->root_priv(); + } + if ( !ok ) { + goto done; + } + ok = root->insertEntryIfNotPresent("tensors", + IWisdomContainerEntry::ENTRY_TYPE_OBJECT, + &tensors_entry); + ok = ok && findTensorSymbol(tensor, sym); + if ( !ok ) { + gLogError << __func__ << " couldn't find create or find root symbol for tensor name=" << + tensor->getName() << " sym=" << sym << endl; + goto done; + } + ok = tensors_entry.insertEntryIfNotPresent(sym, + IWisdomContainerEntry::ENTRY_TYPE_OBJECT, + &tensor_entry); + ok = ok && tensor->serializeTo(&tensor_entry); + if ( !ok ) { + gLogError << __func__ << " couldn't find entry for or serialize tensor name=" << + tensor->getName() << " sym=" << sym << endl; + goto done; + } + + // gLogError << __func__ << " serialized tensor name=" << tensor->getName() << " sym=" << sym << endl; + + done: + return ok; +} + + +ITensor *Wisdom::getTensorFromSymbol(const std::string &sym) +{ + bool ok = true; + + ITensor *tensor = findTensorSymbol(sym); + if ( tensor ) { + return tensor; + } + // request to instantiate is implied. + // find the symbol and deserialize from it. + WisdomContainerEntry tensors_entry; + WisdomContainerEntry tensor_entry; + + ok = m_container->root_priv()->getEntry("tensors", IWisdomContainerEntry::ENTRY_TYPE_OBJECT, &tensors_entry); + if ( !ok ) { + gLogError << __func__ << " no tensors root entry" << endl; + goto done; + } + ok = tensors_entry.getEntry(sym, IWisdomContainerEntry::ENTRY_TYPE_OBJECT, &tensor_entry); + if ( !ok ) { + gLogError << __func__ << " no tensor entry for sym=[" << sym << "]" << endl; + goto done; + } + tensor = TensorFactory::deserializeFrom(&tensor_entry); + if ( !tensor ) { + gLogError << __func__ << " error attempting to deserialize tensor sym=[" << sym << "]" << endl; + ok = false; + goto done; + } + ok = insertTensorSymbol(tensor, sym); + + done: + if (!ok) + return NULL; + return tensor; +} + + +bool SymbolTable::insertNetwork(INetwork *net, const std::string &sym) +{ + if ( findNetwork(sym) ) { + return false; + } + m_sym_net.insert(sym, net); + return true; +} + +bool SymbolTable::insertLayer(ILayer *layer, const std::string &sym) +{ + if ( findLayer(sym) ) { + return false; + } + m_sym_layer[sym] = layer; + m_layer_sym[layer] = sym; + return true; +} + +bool SymbolTable::insertTensor(ITensor *tensor, const std::string &sym) +{ + if ( findTensor(sym) ) { + return false; + } + m_sym_tensor[sym] = tensor; + m_tensor_sym[tensor] = sym; + return true; +} + + +bool SymbolTable::insertLoadable(ILoadable *loadable, const std::string &sym) +{ + if ( findLoadable(sym) ) { + return false; + } + m_sym_loadable[sym] = loadable; + m_loadable_sym[loadable] = sym; + return true; +} + +bool SymbolTable::insertProfile(IProfile *profile, const std::string &sym) +{ + if ( findProfile(sym) ) { + return false; + } + // gLogInfo << "wisdom insertProfile with symbol name " << sym << endl; + m_sym_profile[sym] = profile; + m_profile_sym[profile] = sym; + return true; +} + + + +INetwork *SymbolTable::findNetwork(const std::string &sym) +{ + SymNetIter f = m_sym_net.find_left(sym); + if ( f == m_sym_net.end_left() ) { + return NULL; + } + return f->second; +} + +bool SymbolTable::findNetwork(Network *find_network, std::string &sym) +{ + INetwork *inetwork = NetworkFactory::i(find_network); + if ( !inetwork ) { + return false; + } + SymNetIter f = m_sym_net.find_left(sym); + if ( f == m_sym_net.end_left() ) { + return false; + } + sym = f->first; + return true; +} + + +ILayer *SymbolTable::findLayer(const std::string &sym) +{ + SymLayerIter f = m_sym_layer.find(sym); + if ( f == m_sym_layer.end() ) { + return NULL; + } + return f->second; +} + +bool SymbolTable::findLayer(Layer *find_this, std::string &found_name) +{ + // get the ILayer which goes with it, then look that up. + ILayer *find_this_ilayer = LayerFactory::i(find_this); + LayerSymIter f; + + if ( !find_this_ilayer ) { + gLogError << __func__ << " unexpected zero interface pointer looking up " << find_this << endl; + return false; + } + + f = m_layer_sym.find(find_this_ilayer); + if ( f == m_layer_sym.end() ) { + // gLogError << __func__ << " no ilayer " << find_this_ilayer << endl; + return false; + } + + found_name = f->second; + return true; +} + +ITensor *SymbolTable::findTensor(const std::string &sym) +{ + SymTensorIter f = m_sym_tensor.find(sym); + if ( f == m_sym_tensor.end() ) { + return NULL; + } + return f->second; +} + +bool SymbolTable::findTensor(Tensor *find_this, std::string &found_name) +{ + // get the ITensor which goes with it, then look that up. + ITensor *find_this_itensor = TensorFactory::i(find_this); + TensorSymIter f; + + if ( !find_this_itensor ) { + return false; + } + + f = m_tensor_sym.find(find_this_itensor); + if ( f == m_tensor_sym.end() ) { + return false; + } + + found_name = f->second; + return true; +} + + + + + +IProfiler *Wisdom::getProfiler() +{ + if (!m_profiler) { + ProfilerFactory::ProfilerPrivPair profiler = ProfilerFactory::newProfiler(); + m_profiler = profiler.priv(); + profiler.priv()->setWisdom(this); + } + return m_profiler; // Profiler->IProfiler ok here for now +} + +ICompiler *Wisdom::getCompiler() +{ + if (!m_compiler) { + CompilerFactory::CompilerPrivPair compiler = CompilerFactory::newCompiler(); + m_compiler = compiler.priv(); + compiler.priv()->setWisdom(this); + } + return m_compiler; +} + +ILoadable *SymbolTable::findLoadable(const std::string &sym) +{ + SymLoadableIter f = m_sym_loadable.find(sym); + if ( f == m_sym_loadable.end() ) { + return NULL; + } + return f->second; +} + +bool Wisdom::insertLoadableSymbol(ILoadable *loadable, const std::string &sym) +{ + // gLogError << "this=" << this << " loadable=" << loadable << " sym=[" << sym << "]" << endl; + return m_symbol_table.insertLoadable(loadable, sym); +} + +ILoadable *Wisdom::findLoadableSymbol(const std::string &sym) +{ + return m_symbol_table.findLoadable(sym); +} + +bool Wisdom::findLoadableSymbol(Loadable *find_this, std::string &found_name) +{ + return m_symbol_table.findLoadable(find_this, found_name); +} + +bool Wisdom::findILoadableSymbol(ILoadable *find_this, std::string &found_name) +{ + Loadable *loadable; + bool ok = NULL != find_this; + if ( ok ) { + loadable = LoadableFactory::priv(find_this); + } + ok = ok && (NULL != loadable); + ok = ok && findLoadableSymbol(loadable, found_name); + return ok; +} + +bool SymbolTable::findLoadable(Loadable *find_this, std::string &found_name) +{ + // get the ILoadable which goes with it, then look that up. + ILoadable *find_this_iloadable = LoadableFactory::i(find_this); + LoadableSymIter f; + + if ( !find_this_iloadable ) { + gLogError << __func__ << " unexpected zero interface pointer looking up " << find_this << endl; + return false; + } + + f = m_loadable_sym.find(find_this_iloadable); + if ( f == m_loadable_sym.end() ) { + // gLogError << __func__ << " no iloadable " << find_this_iloadable << endl; + return false; + } + + found_name = f->second; + return true; +} + + +// +// +// +IProfile *SymbolTable::findProfile(const std::string &sym) +{ + SymProfileIter f = m_sym_profile.find(sym); + if ( f == m_sym_profile.end() ) + { + return NULL; + } + return f->second; +} + +bool Wisdom::insertProfileSymbol(IProfile *profile, const std::string &sym) +{ + // gLogError << "this=" << this << " profile=" << profile << " sym=[" << sym << "]" << endl; + return m_symbol_table.insertProfile(profile, sym); +} + +IProfile *Wisdom::findProfileSymbol(const std::string &sym) +{ + return m_symbol_table.findProfile(sym); +} + +bool Wisdom::findProfileSymbol(Profile *find_this, std::string &found_name) +{ + return m_symbol_table.findProfile(find_this, found_name); +} + +bool Wisdom::findIProfileSymbol(IProfile *find_this, std::string &found_name) +{ + Profile *profile; + bool ok = NULL != find_this; + if ( ok ) + { + profile = ProfileFactory::priv(find_this); + } + ok = ok && (NULL != profile); + ok = ok && findProfileSymbol(profile, found_name); + return ok; +} + +bool SymbolTable::findProfile(Profile *find_this, std::string &found_name) +{ + // get the IProfile which goes with it, then look that up. + IProfile *find_this_iprofile = ProfileFactory::i(find_this); + ProfileSymIter f; + + if ( !find_this_iprofile ) + { + gLogError << __func__ << " unexpected zero interface pointer looking up " << find_this << endl; + return false; + } + + f = m_profile_sym.find(find_this_iprofile); + if ( f == m_profile_sym.end() ) + { + gLogError << __func__ << " no iprofile " << find_this_iprofile << endl; + return false; + } + + found_name = f->second; + return true; +} + +// +// +// +NvDlaError Wisdom::setDataType(DataType::UnderlyingType d) +{ + NvDlaError e = NvDlaSuccess; + CATCH_PROPAGATE_ERROR_FAIL(setDataTypeInternal(d)); + +fail: + return e; +} + +NvDlaError Wisdom::setDataTypeInternal(DataType::UnderlyingType d) +{ + NvDlaError e = NvDlaError_Success; + + if ( m_container ) { + WisdomContainerEntry data_type_entry; + if ( ! m_container->root_priv()->writeUInt32("data_type", d) ) { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Couldn't write data type into a wisdom container."); + } + } + + m_data_type = d; + + fail: + return e; +} + +NvDlaError Wisdom::getDataType(DataType::UnderlyingType *data_type) const +{ + NvDlaError e = NvDlaSuccess; + if ( !data_type ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter); + } + *data_type = m_data_type; + fail: + return e; +} + + + +} // nvdla::priv +} // nvdla diff --git a/umd/core/src/compiler/WisdomContainer.cpp b/umd/core/src/compiler/WisdomContainer.cpp new file mode 100644 index 00000000..38bb5893 --- /dev/null +++ b/umd/core/src/compiler/WisdomContainer.cpp @@ -0,0 +1,1344 @@ +/* + * Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#include +#include +#include + +#include "priv/Check.h" + +#include "priv/Wisdom.h" +#include "priv/WisdomContainer.h" + +#include "nvdla_os_inf.h" + +using std::string; +using std::endl; +using std::vector; +using std::stringstream; + +namespace nvdla +{ + +IWisdomContainer::IWisdomContainer(IWisdom *) { } +IWisdomContainer::~IWisdomContainer() { } + +IWisdomContainerEntry::IWisdomContainerEntry() { } +IWisdomContainerEntry::~IWisdomContainerEntry() { } + +namespace priv +{ + +//---------------------------------------------------------------------- +// WisdomContainerEntry +//---------------------------------------------------------------------- + +WisdomContainerEntry::WisdomContainerEntry() : m_container(0) { } + + +WisdomContainerEntry::WisdomContainerEntry(WisdomContainer *c, + const std::string &path, + const std::string &name, + IWisdomContainerEntry::EntryType type) : + m_container(c), + m_path(path), + m_name(name), + m_type(type) +{ + // gLogError << "this=[" << this << "] new entry c=[" << c << "] path=[" << path << + // "] name=[" << name << "] type=[" << int(type) << "]\n"; +} +WisdomContainerEntry::~WisdomContainerEntry() +{ + +} + + +IWisdomContainer *WisdomContainerEntry::container() const +{ + return m_container; +} + +const std::string WisdomContainerEntry::path() const +{ + return m_path; +} + +const std::string WisdomContainerEntry::name() const +{ + return m_name; +} + +IWisdomContainerEntry::EntryType WisdomContainerEntry::type() const +{ + return m_type; +} + +bool WisdomContainerEntry::writeUInt8(NvU8 v) +{ + if ( ENTRY_TYPE_UINT8 != m_type ) + { + return false; + } + return m_container->writeUInt8(pathName(), v); +} + +bool WisdomContainerEntry::writeString(const std::string &v) +{ + if ( ENTRY_TYPE_STRING != m_type ) + { + return false; + } + return m_container->writeString(pathName(), v); +} + +bool WisdomContainerEntry::writeUInt8Vector(const NvU8 *v, size_t size) +{ + if ( ENTRY_TYPE_UINT8_VECTOR != m_type ) + { + return false; + } + return m_container->writeUInt8Vector(pathName(), v, size); +} + +bool WisdomContainerEntry::writeUInt8Vector(const std::vector &v) +{ + if ( ENTRY_TYPE_UINT8_VECTOR != m_type ) + { + return false; + } + return m_container->writeUInt8Vector(pathName(), v); +} + + +bool WisdomContainerEntry::writeUInt32(NvU32 v) +{ + if ( ENTRY_TYPE_UINT32 != m_type ) + { + return false; + } + return m_container->writeUInt32(pathName(), v); +} + +bool WisdomContainerEntry::writeUInt64(NvU64 v) +{ + if ( ENTRY_TYPE_UINT64 != m_type ) + { + return false; + } + return m_container->writeUInt64(pathName(), v); +} + +bool WisdomContainerEntry::writeInt32(NvS32 v) +{ + if ( ENTRY_TYPE_INT32 != m_type ) + { + return false; + } + return m_container->writeInt32(pathName(), v); +} + +bool WisdomContainerEntry::writeFloat32(NvF32 v) +{ + if ( ENTRY_TYPE_FLOAT32 != m_type ) + { + return false; + } + return m_container->writeFloat32(pathName(), v); +} + +bool WisdomContainerEntry::readUInt8(NvU8 &v) const +{ + if ( ENTRY_TYPE_UINT8 != m_type ) + { + return false; + } + return m_container->readUInt8(pathName(), v); +} + +bool WisdomContainerEntry::readString(std::string &v) const +{ + if ( ENTRY_TYPE_STRING != m_type ) + { + return false; + } + return m_container->readString(pathName(), v); +} + +bool WisdomContainerEntry::readUInt8Vector(NvU8 **v, size_t *size) const +{ + if ( ENTRY_TYPE_UINT8_VECTOR != m_type ) + { + return false; + } + return m_container->readUInt8Vector(pathName(), v, size); +} + +bool WisdomContainerEntry::readUInt8Vector(std::vector &v) const +{ + if ( ENTRY_TYPE_UINT8_VECTOR != m_type ) + { + return false; + } + return m_container->readUInt8Vector(pathName(), v); +} + +bool WisdomContainerEntry::readUInt32(NvU32 &v) const +{ + if ( ENTRY_TYPE_UINT32 != m_type ) + { + return false; + } + return m_container->readUInt32(pathName(), v); +} + +bool WisdomContainerEntry::readUInt64(NvU64 &v) const +{ + if ( ENTRY_TYPE_UINT64 != m_type ) + { + return false; + } + return m_container->readUInt64(pathName(), v); +} + +bool WisdomContainerEntry::readInt32(NvS32 &v) const +{ + if ( ENTRY_TYPE_INT32 != m_type ) + { + return false; + } + return m_container->readInt32(pathName(), v); +} + +bool WisdomContainerEntry::readFloat32(NvF32 &v) const +{ + if ( ENTRY_TYPE_FLOAT32 != m_type ) + { + return false; + } + return m_container->readFloat32(pathName(), v); +} + + +// externally facing +bool WisdomContainerEntry::insertEntry(const std::string &name, + IWisdomContainerEntry::EntryType type, + IWisdomContainerEntry *&entry) +{ + if ( ENTRY_TYPE_OBJECT != m_type ) + { + return false; + } + return m_container->insertEntry(pathName(), name, type, entry); +} + + +// internally facing +bool WisdomContainerEntry::insertEntry(const std::string &name, + IWisdomContainerEntry::EntryType type, + WisdomContainerEntry *entry) +{ + if ( ENTRY_TYPE_OBJECT != m_type ) + { + return false; + } + return m_container->insertEntry(pathName(), name, type, entry); +} + + + +// externally visible version which allocs the entry +bool WisdomContainerEntry::getEntry(const std::string &name, + IWisdomContainerEntry::EntryType type, + IWisdomContainerEntry *&entry) +{ + if ( ENTRY_TYPE_OBJECT != m_type ) + { + return false; + } + return m_container->getEntry(m_path, name, type, entry); +} + +// internal version which uses the stack... +bool WisdomContainerEntry::getEntry(const std::string &name, + IWisdomContainerEntry::EntryType type, + WisdomContainerEntry *entry) const +{ + if ( ENTRY_TYPE_OBJECT != m_type ) + { + return false; + } + return m_container->getEntry(m_path, name, type, entry); +} + + +bool WisdomContainerEntry::getEntryNames(std::vector *names) +{ + if ( ENTRY_TYPE_OBJECT != m_type ) + { + return false; + } + return m_container->getEntryNames(pathName(), names); +} + +bool WisdomContainerEntry::removeEntry(const std::string &name) +{ + if ( ENTRY_TYPE_OBJECT != m_type ) + { + return false; + } + return m_container->removeEntry(pathName() + "/" + name); +} + +bool WisdomContainerEntry::insertEntryIfNotPresent(const std::string &name, + EntryType type, + WisdomContainerEntry *entry) +{ + bool ok; + ok = getEntry(name, type, entry); + if ( !ok ) { + // try inserting it + ok = insertEntry(name, type, entry); + } + return ok; +} + +//---------------------------------------------------------------------- +// serialize and deserialize some useful types by name into a sub-object +// of an exsting OBJECT type wisdom container entry. +//---------------------------------------------------------------------- +bool WisdomContainerEntry::readUInt8Enum(const std::string &name, NvU8 &e) const +{ + bool ok = true; + WisdomContainerEntry b_entry; + ok = ok && getEntry(name, IWisdomContainerEntry::ENTRY_TYPE_UINT8, &b_entry); + ok = ok && b_entry.readUInt8(e); + return ok; +} + +bool WisdomContainerEntry::readString(const std::string &name, std::string &s) const +{ + bool ok = true; + WisdomContainerEntry s_entry; + ok = ok && getEntry(name, IWisdomContainerEntry::ENTRY_TYPE_STRING, &s_entry); + ok = ok && s_entry.readString(s); + return ok; +} + +bool WisdomContainerEntry::readUInt8Vector(const std::string &name, std::vector &v) const +{ + bool ok = true; + WisdomContainerEntry v_entry; + ok = ok && getEntry(name, IWisdomContainerEntry::ENTRY_TYPE_UINT8_VECTOR, &v_entry); + ok = ok && v_entry.readUInt8Vector(v); + return ok; +} + +bool WisdomContainerEntry::readUInt32(const std::string &name, NvU32 &v) const +{ + bool ok = true; + WisdomContainerEntry v_entry; + ok = ok && getEntry(name, IWisdomContainerEntry::ENTRY_TYPE_UINT32, &v_entry); + ok = ok && v_entry.readUInt32(v); + return ok; +} + +bool WisdomContainerEntry::readUInt64(const std::string &name, NvU64 &v) const +{ + bool ok = true; + WisdomContainerEntry v_entry; + ok = ok && getEntry(name, IWisdomContainerEntry::ENTRY_TYPE_UINT64, &v_entry); + ok = ok && v_entry.readUInt64(v); + return ok; +} + +bool WisdomContainerEntry::readInt32(const std::string &name, NvS32 &v) const +{ + bool ok = true; + WisdomContainerEntry v_entry; + ok = ok && getEntry(name, IWisdomContainerEntry::ENTRY_TYPE_INT32, &v_entry); + ok = ok && v_entry.readInt32(v); + return ok; +} + +bool WisdomContainerEntry::readFloat32(const std::string &name, NvF32 &v) const +{ + bool ok = true; + WisdomContainerEntry v_entry; + ok = ok && getEntry(name, IWisdomContainerEntry::ENTRY_TYPE_FLOAT32, &v_entry); + ok = ok && v_entry.readFloat32(v); + return ok; +} + +bool WisdomContainerEntry::readObject(const std::string &name) const +{ + WisdomContainerEntry obj_entry; + bool ok; + ok = getEntry(name, IWisdomContainerEntry::ENTRY_TYPE_OBJECT, &obj_entry); + return ok; +} + +bool WisdomContainerEntry::readDims2(const std::string &name, Dims2 &dims) const +{ + bool ok = true; + WisdomContainerEntry dims_entry, dims_w_entry, dims_h_entry; + NvS32 w, h; + + ok = ok && getEntry(name, IWisdomContainerEntry::ENTRY_TYPE_OBJECT, &dims_entry); + ok = ok && dims_entry.getEntry("w", IWisdomContainerEntry::ENTRY_TYPE_INT32, &dims_w_entry); + ok = ok && dims_entry.getEntry("h", IWisdomContainerEntry::ENTRY_TYPE_INT32, &dims_h_entry); + + ok = ok && dims_w_entry.readInt32(w); + ok = ok && dims_h_entry.readInt32(h); + + if ( ok ) { + dims.w = (int)w; + dims.h = (int)h; + } + return ok; +} + +bool WisdomContainerEntry::readDims3(const std::string &name, Dims3 &dims) const +{ + bool ok = true; + WisdomContainerEntry dims_entry, dims_w_entry, dims_h_entry, dims_c_entry; + NvS32 w, h, c; + + ok = ok && getEntry(name, IWisdomContainerEntry::ENTRY_TYPE_OBJECT, &dims_entry); + ok = ok && dims_entry.getEntry("w", IWisdomContainerEntry::ENTRY_TYPE_INT32, &dims_w_entry); + ok = ok && dims_entry.getEntry("h", IWisdomContainerEntry::ENTRY_TYPE_INT32, &dims_h_entry); + ok = ok && dims_entry.getEntry("c", IWisdomContainerEntry::ENTRY_TYPE_INT32, &dims_c_entry); + + ok = ok && dims_w_entry.readInt32(w); + ok = ok && dims_h_entry.readInt32(h); + ok = ok && dims_c_entry.readInt32(c); + + if ( ok ) { + dims.w = (int)w; + dims.h = (int)h; + dims.c = (int)c; + } + return ok; +} + +bool WisdomContainerEntry::readDims4(const std::string &name, Dims4 &dims) const +{ + bool ok = true; + WisdomContainerEntry dims_entry, dims_w_entry, dims_h_entry, dims_c_entry, dims_n_entry; + NvS32 w, h, c, n; + + ok = ok && getEntry(name, IWisdomContainerEntry::ENTRY_TYPE_OBJECT, &dims_entry); + ok = ok && dims_entry.getEntry("w", IWisdomContainerEntry::ENTRY_TYPE_INT32, &dims_w_entry); + ok = ok && dims_entry.getEntry("h", IWisdomContainerEntry::ENTRY_TYPE_INT32, &dims_h_entry); + ok = ok && dims_entry.getEntry("c", IWisdomContainerEntry::ENTRY_TYPE_INT32, &dims_c_entry); + ok = ok && dims_entry.getEntry("n", IWisdomContainerEntry::ENTRY_TYPE_INT32, &dims_n_entry); + + ok = ok && dims_w_entry.readInt32(w); + ok = ok && dims_h_entry.readInt32(h); + ok = ok && dims_c_entry.readInt32(c); + ok = ok && dims_n_entry.readInt32(n); + + if ( ok ) { + dims.w = (int)w; + dims.h = (int)h; + dims.c = (int)c; + dims.n = (int)n; + } + return ok; +} + +bool WisdomContainerEntry::readWeights(const std::string &name, Weights &w) const +{ + bool ok = true; + WisdomContainerEntry weights_entry, type_entry, count_entry, values_entry; + NvS32 t = 0, c = 0; + NvU8 *v = 0; + size_t s = 0; + + ok = ok && getEntry(name, IWisdomContainerEntry::ENTRY_TYPE_OBJECT, &weights_entry); + ok = ok && weights_entry.getEntry("type", IWisdomContainerEntry::ENTRY_TYPE_INT32, &type_entry); + ok = ok && weights_entry.getEntry("count", IWisdomContainerEntry::ENTRY_TYPE_INT32, &count_entry); + ok = ok && weights_entry.getEntry("values", IWisdomContainerEntry::ENTRY_TYPE_UINT8_VECTOR, &values_entry); + + ok = ok && type_entry.readInt32(t); + w.type = (DataType)t; + ok = ok && count_entry.readInt32(c); + w.count = c; + w.values = NULL; + if ( w.count ) + { + ok = ok && values_entry.readUInt8Vector(&v, &s); + if ( ok ) + { + w.values = v; + w.count = (int)s; // why set this again? + // if it is different it is an error? + // at least warn? + } + } + return ok; +} + +bool WisdomContainerEntry::writeUInt8Enum(const std::string &name, NvU8 v) +{ + WisdomContainerEntry b_entry; + bool ok = insertEntryIfNotPresent(name, IWisdomContainerEntry::ENTRY_TYPE_UINT8, &b_entry); + ok = ok && b_entry.writeUInt8(v); + return ok; +} + +bool WisdomContainerEntry::writeString(const std::string &name, const std::string &s) +{ + WisdomContainerEntry s_entry; + bool ok = insertEntryIfNotPresent(name, IWisdomContainerEntry::ENTRY_TYPE_STRING, &s_entry); + ok = ok && s_entry.writeString(s); + return ok; +} + +bool WisdomContainerEntry::writeUInt8Vector(const std::string &name, const std::vector &v) +{ + WisdomContainerEntry v_entry; + bool ok = insertEntryIfNotPresent(name, IWisdomContainerEntry::ENTRY_TYPE_UINT8_VECTOR, &v_entry); + ok = ok && v_entry.writeUInt8Vector(v); + return ok; +} + +bool WisdomContainerEntry::writeUInt32(const std::string &name, NvU32 v) +{ + WisdomContainerEntry v_entry; + bool ok = insertEntryIfNotPresent(name, IWisdomContainerEntry::ENTRY_TYPE_UINT32, &v_entry); + ok = ok && v_entry.writeUInt32(v); + return ok; +} + +bool WisdomContainerEntry::writeUInt64(const std::string &name, NvU64 v) +{ + WisdomContainerEntry v_entry; + bool ok = insertEntryIfNotPresent(name, IWisdomContainerEntry::ENTRY_TYPE_UINT64, &v_entry); + ok = ok && v_entry.writeUInt64(v); + return ok; +} + +bool WisdomContainerEntry::writeInt32(const std::string &name, NvS32 v) +{ + WisdomContainerEntry v_entry; + bool ok = insertEntryIfNotPresent(name, IWisdomContainerEntry::ENTRY_TYPE_INT32, &v_entry); + ok = ok && v_entry.writeInt32(v); + return ok; +} + +bool WisdomContainerEntry::writeFloat32(const std::string &name, NvF32 v) +{ + WisdomContainerEntry v_entry; + bool ok = insertEntryIfNotPresent(name, IWisdomContainerEntry::ENTRY_TYPE_FLOAT32, &v_entry); + ok = ok && v_entry.writeFloat32(v); + return ok; +} + +bool WisdomContainerEntry::writeObject(const std::string &name) +{ + WisdomContainerEntry obj_entry; + bool ok; + ok = insertEntryIfNotPresent(name, IWisdomContainerEntry::ENTRY_TYPE_OBJECT, &obj_entry); + return ok; +} + +bool WisdomContainerEntry::writeDims2(const std::string &name, const Dims2 &dims) +{ + bool ok = true; + WisdomContainerEntry dims_entry, dims_w_entry, dims_h_entry; + NvS32 w, h; + NVDLA_UNUSED(w); + NVDLA_UNUSED(h); + ok = ok && insertEntryIfNotPresent(name, IWisdomContainerEntry::ENTRY_TYPE_OBJECT, &dims_entry); + ok = ok && dims_entry.insertEntryIfNotPresent("w", IWisdomContainerEntry::ENTRY_TYPE_INT32, &dims_w_entry); + ok = ok && dims_entry.insertEntryIfNotPresent("h", IWisdomContainerEntry::ENTRY_TYPE_INT32, &dims_h_entry); + + ok = ok && dims_w_entry.writeInt32(dims.w); + ok = ok && dims_h_entry.writeInt32(dims.h); + + return ok; +} + +bool WisdomContainerEntry::writeDims3(const std::string &name, const Dims3 &dims) +{ + bool ok = true; + WisdomContainerEntry dims_entry, dims_w_entry, dims_h_entry, dims_c_entry; + NvS32 w, h, c; + NVDLA_UNUSED(w); + NVDLA_UNUSED(h); + NVDLA_UNUSED(c); + ok = ok && insertEntryIfNotPresent(name, IWisdomContainerEntry::ENTRY_TYPE_OBJECT, &dims_entry); + ok = ok && dims_entry.insertEntryIfNotPresent("w", IWisdomContainerEntry::ENTRY_TYPE_INT32, &dims_w_entry); + ok = ok && dims_entry.insertEntryIfNotPresent("h", IWisdomContainerEntry::ENTRY_TYPE_INT32, &dims_h_entry); + ok = ok && dims_entry.insertEntryIfNotPresent("c", IWisdomContainerEntry::ENTRY_TYPE_INT32, &dims_c_entry); + + ok = ok && dims_w_entry.writeInt32(dims.w); + ok = ok && dims_h_entry.writeInt32(dims.h); + ok = ok && dims_c_entry.writeInt32(dims.c); + return ok; +} + +bool WisdomContainerEntry::writeDims4(const std::string &name, const Dims4 &dims) +{ + bool ok = true; + WisdomContainerEntry dims_entry, dims_w_entry, dims_h_entry, dims_c_entry, dims_n_entry; + NvS32 w, h, c; + NVDLA_UNUSED(w); + NVDLA_UNUSED(h); + NVDLA_UNUSED(c); + ok = ok && insertEntryIfNotPresent(name, IWisdomContainerEntry::ENTRY_TYPE_OBJECT, &dims_entry); + ok = ok && dims_entry.insertEntryIfNotPresent("w", IWisdomContainerEntry::ENTRY_TYPE_INT32, &dims_w_entry); + ok = ok && dims_entry.insertEntryIfNotPresent("h", IWisdomContainerEntry::ENTRY_TYPE_INT32, &dims_h_entry); + ok = ok && dims_entry.insertEntryIfNotPresent("c", IWisdomContainerEntry::ENTRY_TYPE_INT32, &dims_c_entry); + ok = ok && dims_entry.insertEntryIfNotPresent("n", IWisdomContainerEntry::ENTRY_TYPE_INT32, &dims_n_entry); + + ok = ok && dims_w_entry.writeInt32(dims.w); + ok = ok && dims_h_entry.writeInt32(dims.h); + ok = ok && dims_c_entry.writeInt32(dims.c); + ok = ok && dims_n_entry.writeInt32(dims.n); + return ok; +} + +bool WisdomContainerEntry::writeWeights(const std::string &name, const Weights &w) +{ + bool ok = true; + WisdomContainerEntry weights_entry, type_entry, values_entry, count_entry; + ok = ok && insertEntryIfNotPresent(name, IWisdomContainerEntry::ENTRY_TYPE_OBJECT, &weights_entry); + ok = ok && weights_entry.insertEntryIfNotPresent("type", IWisdomContainerEntry::ENTRY_TYPE_INT32, &type_entry); + ok = ok && weights_entry.insertEntryIfNotPresent("count", IWisdomContainerEntry::ENTRY_TYPE_INT32, &count_entry); + ok = ok && weights_entry.insertEntryIfNotPresent("values", IWisdomContainerEntry::ENTRY_TYPE_UINT8_VECTOR, &values_entry); + + ok = ok && type_entry.writeInt32(w.type); + ok = ok && count_entry.writeInt32(w.count); + if ( w.count ) + { + ok = ok && values_entry.writeUInt8Vector((const NvU8*)w.values, size_t(w.count)); + } + return ok; +} + + +//---------------------------------------------------------------------- +// WisdomContainer +//---------------------------------------------------------------------- + +//! +//! Note: The default wisdom container uses NvDla to build up an attribute +//! store in the filesystem. This is being used in the early phases of +//! wisdom development for ease of debug and flexibility. We will likely +//! move to something else later (protobuf or some other serialization). +//! + +WisdomContainer::WisdomContainer(Wisdom *wisdom) : + IWisdomContainer(wisdom), + m_wisdom(wisdom), + m_wisdom_priv(wisdom), + m_root(""), + m_root_entry(this, string(""), string(""), IWisdomContainerEntry::ENTRY_TYPE_OBJECT) +{ + +} + +WisdomContainer::~WisdomContainer() +{ + +} + +IWisdom *WisdomContainer::wisdom() +{ + return m_wisdom; +} + +Wisdom *WisdomContainer::wisdom_priv() +{ + return m_wisdom_priv; +} + +IWisdomContainerEntry *WisdomContainer::root() +{ + return &m_root_entry; +} + +WisdomContainerEntry *WisdomContainer::root_priv() +{ + return &m_root_entry; +} + +bool WisdomContainer::open(const std::string &dir_path) +{ + if (m_root != string("")) + { + close(); + } + if ( 0 == dir_path.size() ) + { + gLogError << "a path is needed to open a wisdom container" << endl; + return false; + } + + NvDlaDirHandle dir; + NvDlaError err = NvDlaOpendir(dir_path.c_str(), &dir); + if ( err != NvDlaSuccess ) + { + // gLogError << "couldn't open wisdom directory " << dir << endl; + return false; + } + m_root = std::string(dir_path.c_str()); + + // note "" is not a valid dirpath, so you can't pass "" and get "/" as root + if ( m_root.substr(m_root.size()-1,1) != std::string("/") ) { + m_root += string("/"); + } + + + NvDlaClosedir(dir); + + return true; +} + +bool WisdomContainer::isOpen() +{ + return m_root.size(); +} + +void WisdomContainer::close() +{ + m_root = string(""); + +} + +//! +//! The container never knows the EntryType of the objects... so it must be +//! told how to interpret them. The user of the container is responsible +//! for maintaining that information... the Wisdom fills that role by keeping +//! its own dictionary/symbol table aside... +//! + +// +// this version is publicly visble and allocates the entry. +// +bool WisdomContainer::getEntry(const std::string &path, + const std::string &name, + IWisdomContainerEntry::EntryType type, + IWisdomContainerEntry *&entry) +{ + if ( !isOpen() ) + { + return false; + } + + entry = 0; + + const string fname(entryFilename(path, name)); + // gLogDebug << "getEntry for root=[" << m_root << "] path=[" << path << + // "] name=[" << name << "] type=" << int(type) << " fname=[" << fname << "]" << endl; + + + bool ok; + NvDlaFileHandle file; + NvDlaError rc = NvDlaFopen((m_root + fname).c_str(), NVDLA_OPEN_READ, &file); + ok = rc == NvDlaSuccess; + if (!ok) + { + // gLogError << "couldn't open (read) entry file " << fname << endl; + } + else + { + NvDlaFclose(file); + if ( type == IWisdomContainerEntry::ENTRY_TYPE_OBJECT ) { + // gLogError << "open ok, instance new (dir) entry... " << fname << endl; + std::string dirname = path; + if ( name.size() && (name != string(".")) ) { + dirname += "/" + name; + } + entry = new WisdomContainerEntry(this, dirname, string(""), type); + + } else { + // gLogError << "open ok, instance new entry... " << fname << endl; + entry = new WisdomContainerEntry(this, path, name, type); + } + } + + return ok && entry; +} + +// +// this version of getEntry is internal-only and makes use of an on-the-stack entry +// +bool WisdomContainer::getEntry(const std::string &path, + const std::string &name, + IWisdomContainerEntry::EntryType type, + WisdomContainerEntry *entry) +{ + if ( !isOpen() ) + { + return false; + } + + const string fname(entryFilename(path, name)); + // gLogDebug << "getEntry for root=[" << m_root << "] path=[" << path << + // "] name=[" << name << "] type=" << int(type) << " fname=[" << fname << "]" << endl; + + + bool ok; + NvDlaFileHandle file; + NvDlaError rc = NvDlaFopen((m_root + fname).c_str(), NVDLA_OPEN_READ, &file); + ok = rc == NvDlaSuccess; + if (!ok) + { + // gLogError << "couldn't open (read) entry file " << fname << endl; + } + else + { + NvDlaFclose(file); + if ( type == IWisdomContainerEntry::ENTRY_TYPE_OBJECT ) { + // gLogError << "open ok, instance new (dir) entry... " << fname << endl; + std::string dirname = path; + if ( name.size() && (name != string(".")) ) { + dirname += "/" + name; + } + *entry = WisdomContainerEntry(this, dirname, string(""), type); + } else { + // gLogError << "open ok, instance new entry... " << fname << endl; + *entry = WisdomContainerEntry(this, path, name, type); + } + } + + return ok; +} + + +// +// TBD: double-check/test that readdir here is returning +// dirs as well as file names ("." and ".." should show up). +// +bool WisdomContainer::getEntryNames(const std::string &path, std::vector *names) +{ + if ( !isOpen() ) + { + return false; + } + + NvDlaDirHandle dir; + string dir_path; + if ( path.size() && (path != string(".") && path != string("./"))) { + dir_path = m_root + "/" + path; + } else { + dir_path = m_root; + } + + + NvDlaError err = NvDlaOpendir(dir_path.c_str(), &dir); + if ( err != NvDlaSuccess ) { + gLogError << "couldn't open wisdom attribute directory " << dir_path << endl; + return false; + } + + char name_buf[255+1]; // doc or otherwise parameterize ??? + do { + err = NvDlaReaddir(dir, name_buf, 255); + if ( err == NvDlaSuccess ) { // || == NvDlaError_EndOfDirList dups the last entry... + // skip zero and special/dot files + if ( (name_buf[0] != '\0') && (name_buf[0] != '.') ) { + names->push_back(string(name_buf)); // prefix with current path? + } + } + } while (err == NvDlaSuccess); + + NvDlaClosedir(dir); + + return true; +} + +bool WisdomContainer::removeEntry(const std::string &path) +{ + // TBD, complicated by missing rmdir in NvDla* + gLogError << "removeEntry TBD " << path << endl; + return true; +} + +// internally facing +bool WisdomContainer::insertEntry(const std::string &path, + const std::string &name, + IWisdomContainerEntry::EntryType type, + WisdomContainerEntry *entry) +{ + bool ok = true; + NvDlaError rc = NvDlaSuccess; + + + switch ( type ) + { + case IWisdomContainerEntry::ENTRY_TYPE_OBJECT: + { + int dir_depth = std::count(name.begin(), name.end(), '/'); + int start_pos = 0; + while(dir_depth) + { + std::string parent_dir = name.substr(0, name.find('/', start_pos)); + std::string parent_dir_path(entryDirname(path, parent_dir)); + rc = NvDlaMkdir(const_cast((m_root + parent_dir_path).c_str())); + start_pos = name.find('/', start_pos) + 1; + dir_depth--; + } + const std::string dirname(entryDirname(path, name)); + + // gLogError << "insertEntry root=[" << m_root << "] path=[" << path << + // "] name=[" << name << "] dirname=[" << dirname << "] type=" << int(type) << endl; + + rc = NvDlaMkdir( const_cast((m_root + dirname).c_str()) ); + ok = ((rc == NvDlaSuccess) || (rc == NvDlaError_PathAlreadyExists)); + + if ( ok ) + { + *entry = WisdomContainerEntry(this, dirname, string(""), type); + } + } + break; + + case IWisdomContainerEntry::ENTRY_TYPE_STRING: + case IWisdomContainerEntry::ENTRY_TYPE_UINT8_VECTOR: + case IWisdomContainerEntry::ENTRY_TYPE_UINT32: + case IWisdomContainerEntry::ENTRY_TYPE_UINT64: + case IWisdomContainerEntry::ENTRY_TYPE_INT32: + case IWisdomContainerEntry::ENTRY_TYPE_FLOAT32: + case IWisdomContainerEntry::ENTRY_TYPE_UINT8: + { + const std::string fname(entryFilename(path, name)); + + // gLogError << "insertEntry root=[" << m_root << "] path=[" << path << + // "] name=[" << name << "] filename=[" << fname << "] type=" << int(type) << endl; + + NvDlaFileHandle file; + NvDlaError rc = NvDlaFopen((m_root + fname).c_str(), NVDLA_OPEN_WRITE, &file); + if ( rc != NvDlaSuccess ) + { + gLogError << "couldn't open (write) entry file " << fname << endl; + return false; + } + if ( ok ) + { + NvDlaFclose(file); + // gLogDebug << "instance new entry for " << fname << endl; + *entry = WisdomContainerEntry(this, path, name, type); + } + } + break; + + default: + gLogError << "invalid type (" << (int)type << ") given to create entry path=[" << + path << "] name=[" << name << "]" << endl; + ok = false; + } + + return ok; +} + +// externally facing +bool WisdomContainer::insertEntry(const std::string &path, + const std::string &name, + IWisdomContainerEntry::EntryType type, + IWisdomContainerEntry *&entry) +{ + + bool ok = true; + NvDlaError rc = NvDlaSuccess; + entry = 0; + + switch ( type ) + { + + case IWisdomContainerEntry::ENTRY_TYPE_OBJECT: + { + const std::string dirname(entryDirname(path, name)); + rc = NvDlaMkdir( const_cast((m_root + dirname).c_str()) ); + ok = ((rc == NvDlaSuccess) || (rc == NvDlaError_PathAlreadyExists)); + if ( ok ) + { + entry = new WisdomContainerEntry(this, dirname, string(""), type); + } + } + break; + + case IWisdomContainerEntry::ENTRY_TYPE_STRING: + case IWisdomContainerEntry::ENTRY_TYPE_UINT8_VECTOR: + case IWisdomContainerEntry::ENTRY_TYPE_UINT32: + case IWisdomContainerEntry::ENTRY_TYPE_UINT64: + case IWisdomContainerEntry::ENTRY_TYPE_INT32: + case IWisdomContainerEntry::ENTRY_TYPE_FLOAT32: + { + const std::string fname(entryFilename(path, name)); + NvDlaFileHandle file; + NvDlaError rc = NvDlaFopen((m_root + fname).c_str(), NVDLA_OPEN_WRITE, &file); + if ( rc != NvDlaSuccess ) + { + gLogError << "couldn't open (write) entry file " << fname << endl; + return false; + } + if ( ok ) + { + NvDlaFclose(file); + entry = new WisdomContainerEntry(this, path, name, type); + } + } + break; + + default: + gLogError << "invalid type (" << (int)type << ") given to create entry path=[" << + path << "] name=[" << name << "]" << endl; + ok = false; + } + + return ok; +} + +// +// return a + b w/o introducing superfluous slashes +// +static const std::string catPaths(const std::string a, const std::string b) +{ + if ( !a.size() ) { + return b; + } + if ( a[a.size()-1] != '/' ) { + return a + "/" + b; + } + return a + b; +} + +const std::string WisdomContainer::entryDirname(const std::string &path, const std::string &name) const +{ + if ( name.size() && (name != std::string(".") && name != std::string("./")) ) { + return ( catPaths(path, name) ); + } + return path; +} + +const std::string WisdomContainer::entryFilename(const std::string &path, const std::string &name) const +{ + + return catPaths(path, name); +} + +const std::string WisdomContainer::entryFilename(IWisdomContainerEntry *entry) const +{ + return catPaths(entry->path(),entry->name()); +} + +const std::string WisdomContainer::entryFilename(const std::string &name) const +{ + return name; +} + +bool WisdomContainer::writeUInt8(const std::string &path, NvU8 v) +{ + NvDlaFileHandle file; + NvDlaError rc = NvDlaFopen((m_root + entryFilename(path)).c_str(), NVDLA_OPEN_WRITE, &file); + if (rc != NvDlaSuccess) + { + gLogError << "couldn't open entry " << entryFilename(path) << endl; + return false; + } + + rc = NvDlaFwrite(file, &v, sizeof(NvU8)); + NvDlaFclose(file); + + return rc == NvDlaSuccess; +} + +bool WisdomContainer::writeString(const std::string &path, const std::string &v) +{ + NvDlaFileHandle file; + NvDlaError rc = NvDlaFopen((m_root + entryFilename(path)).c_str(), NVDLA_OPEN_WRITE, &file); + if (rc != NvDlaSuccess) + { + gLogError << "couldn't open entry " << entryFilename(path) << endl; + return false; + } + + rc = NvDlaFwrite(file, v.c_str(), v.size()); + NvDlaFclose(file); + + return rc == NvDlaSuccess; +} + +bool WisdomContainer::writeUInt8Vector(const std::string &path, const NvU8 *v, size_t size) +{ + NvDlaFileHandle file; + NvDlaError rc = NvDlaFopen((m_root + entryFilename(path)).c_str(), NVDLA_OPEN_WRITE, &file); + if (rc != NvDlaSuccess) + { + gLogError << "couldn't open entry " << entryFilename(path) << endl; + return false; + } + rc = NvDlaFwrite(file, v, size); + NvDlaFclose(file); + return rc == NvDlaSuccess; +} + +bool WisdomContainer::writeUInt8Vector(const std::string &path, const std::vector &v) +{ + return writeUInt8Vector(path, (NvU8*)&(*v.begin()), size_t(v.size())); +} + +bool WisdomContainer::writeUInt32(const std::string &path, NvU32 v) +{ + stringstream ss; ss << v; + return writeString(path, ss.str()); +} + +bool WisdomContainer::writeUInt64(const std::string &path, NvU64 v) +{ + stringstream ss; ss << v; + return writeString(path, ss.str()); +} + +bool WisdomContainer::writeInt32(const std::string &path, NvS32 v) +{ + stringstream ss; ss << v; + return writeString(path, ss.str()); +} + +bool WisdomContainer::writeFloat32(const std::string &path, NvF32 v) +{ + stringstream ss; ss << v; + return writeString(path, ss.str()); +} + +bool WisdomContainer::readUInt8(const std::string &path, NvU8 &v) +{ + NvDlaFileHandle file; + NvDlaError rc = NvDlaFopen((m_root + entryFilename(path)).c_str(), NVDLA_OPEN_READ, &file); + if (rc != NvDlaSuccess) + { + gLogError << "couldn't open entry " << entryFilename(path) << endl; + return false; + } + + v = 0; + + rc = NvDlaFgetc(file, &v); + NvDlaFclose(file); + + return true; +} + +bool WisdomContainer::readString(const std::string &path, std::string &v) +{ + NvDlaFileHandle file; + NvDlaError rc = NvDlaFopen((m_root + entryFilename(path)).c_str(), NVDLA_OPEN_READ, &file); + if (rc != NvDlaSuccess) + { + gLogError << "couldn't open entry " << entryFilename(path) << endl; + return false; + } + v.clear(); + + NvU8 c; + for (rc = NvDlaFgetc(file, &c); rc == NvDlaSuccess; rc = NvDlaFgetc(file, &c) ) { + v.push_back(char(c)); + } + NvDlaFclose(file); + + return true; +} + +// +// careful with the args here. the intent is for the user to call in once to get the size +// and perform its own allocation if necessary by calling back in with ret_vals pointing to +// an appropriately sized buffer. and, it's all or nothing... so any garbage value being +// pointed to (the value of the pointer itself) will be assumed to be a valid storage location. +// if not, zero it and a new buffer will be allocated using the default new allocator. +// either way the caller then owns the memory and must manage its eventual clean-up. +// +bool WisdomContainer::readUInt8Vector(const std::string &path, NvU8 **ret_vals, size_t *ret_size) +{ + NvDlaFileHandle file; + NvDlaStatType finfo; + size_t file_size; + + if ( !ret_size ) { + return false; + } + + NvDlaError rc = NvDlaFopen((m_root + entryFilename(path)).c_str(), NVDLA_OPEN_READ, &file); + if (rc != NvDlaSuccess) + { + gLogError << "couldn't open entry " << entryFilename(path) << endl; + return false; + } + + rc = NvDlaFstat(file, &finfo); + if ( rc != NvDlaSuccess) + { + gLogError << "couldn't get file stats for " << entryFilename(path) << endl; + return false; + } + file_size = finfo.size; + + *ret_size = file_size; + + if ( NULL == ret_vals ) { + return true; + } + if ( !file_size ) { + return true; + } + if ( NULL == (*ret_vals) ) { + *ret_vals = new NvU8[file_size]; + if ( NULL == (*ret_vals) ) { + gLogError << " oom" << entryFilename(path) << endl; + return false; + } + } + NvDlaFseek(file, 0, NvDlaSeek_Set); + + size_t actually_read = 0; + NVDLA_UNUSED(actually_read); + + rc = NvDlaFread(file, *ret_vals, file_size, ret_size); + if ( rc != NvDlaSuccess ) + { + return false; + } + if ( *ret_size != file_size ) + { + return false; + } + + NvDlaFclose(file); + + return true; +} + +bool WisdomContainer::readUInt8Vector(const std::string &path, std::vector &v) +{ + NvDlaFileHandle file; + NvDlaStatType finfo; + size_t file_size; + NvDlaError rc = NvDlaFopen((m_root + entryFilename(path)).c_str(), NVDLA_OPEN_READ, &file); + if (rc != NvDlaSuccess) + { + gLogError << "couldn't open entry " << entryFilename(path) << endl; + return false; + } + + rc = NvDlaFstat(file, &finfo); + if ( rc != NvDlaSuccess) + { + gLogError << "couldn't get file stats for " << entryFilename(path) << endl; + return false; + } + file_size = finfo.size; + + // + // NOTE: + // + // there's an underlying (std::vector, or other) allocator here. if it is already holding onto some + // chunk of memory for the vector, it will be making a choice about ditching it or re-using, etc. + // but, do not attempt to be clever about it here! allow those things to happen on their own. + // for scenarios where we're making use of special allocators to track/meter memory requirements + // doing anything else would be counter-productive. + // + // + v.resize(file_size); + + if ( !file_size ) { + return true; + } + + NvDlaFseek(file, 0, NvDlaSeek_Set); + + size_t actually_read = 0; + + rc = NvDlaFread(file, &(*v.begin()), file_size, &actually_read); + if ( rc != NvDlaSuccess ) + { + return false; + } + if ( actually_read != file_size ) + { + return false; + } + + NvDlaFclose(file); + + return true; +} + + +bool WisdomContainer::readUInt32(const std::string &path, NvU32 &v) +{ + string sv; + bool ok = readString(path, sv); + if ( ok ) { + stringstream ss(sv); + ss >> v; + } + return ok; + +} + +bool WisdomContainer::readUInt64(const std::string &path, NvU64 &v) +{ + string sv; + bool ok = readString(path, sv); + if ( ok ) { + stringstream ss(sv); + ss >> v; + } + return ok; + +} + +bool WisdomContainer::readInt32(const std::string &path, NvS32 &v) +{ + string sv; + bool ok = readString(path, sv); + if ( ok ) { + stringstream ss(sv); + ss >> v; + } + return ok; +} + +bool WisdomContainer::readFloat32(const std::string &path, NvF32 &v) +{ + string sv; + bool ok = readString(path, sv); + if ( ok ) { + stringstream ss(sv); + ss >> v; + } + return ok; +} + + +} // nvdla::priv +} // nvdla diff --git a/umd/core/src/compiler/caffe/CaffeParser.cpp b/umd/core/src/compiler/caffe/CaffeParser.cpp new file mode 100644 index 00000000..6ee21354 --- /dev/null +++ b/umd/core/src/compiler/caffe/CaffeParser.cpp @@ -0,0 +1,1094 @@ +/* + * Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#include +#include +#include +#include +#include + +#include "ErrorMacros.h" +#include "priv/Check.h" +#include "priv/caffe/CaffeParser.h" + +#include "ditcaffe/protobuf-2.6.1/ditcaffe.pb.h" + +#include "half.h" + +#include +#include +#include + +#include + +using namespace nvdla; +namespace dc = ditcaffe; +typedef half_float::half float16; + +namespace nvdla +{ + +namespace caffe +{ + + +IBlobNameToTensor::~IBlobNameToTensor() { } +IBinaryProtoBlob::~IBinaryProtoBlob() { } +ICaffeParser::~ICaffeParser() { } + +ICaffeParser *createCaffeParser() +{ + priv::CaffeParserFactory::CaffeParserPrivPair ppair; + ppair = nvdla::caffe::priv::CaffeParserFactory::newCaffeParser(); + return ppair.i(); +} + +NvDlaError destroyCaffeParser(ICaffeParser *parser) +{ + NvDlaError e = NvDlaSuccess; + PROPAGATE_ERROR_FAIL(priv::CaffeParserFactory::deleteCaffeParser(parser)); + +fail: + return e; +} + +namespace priv +{ + +CaffeParserFactory::CaffeParserPrivPair CaffeParserFactory::newCaffeParser() +{ + ICaffeParser *parser; + CaffeParser *parser_priv; + parser = parser_priv = new priv::CaffeParser(); + if (parser) { + s_priv.insert(parser,parser_priv); + s_self.insert(parser, parser); + } + return CaffeParserPrivPair(parser, parser_priv); +} + +NvDlaError CaffeParserFactory::deleteCaffeParser(ICaffeParser *parser) +{ + if (parser != NULL) { + CaffeParser *parser_priv = priv(parser); + if (parser_priv != NULL) { + delete(parser_priv); + } + + s_priv.remove(parser); + s_self.remove(parser); + } + + return NvDlaSuccess; +} + +CaffeParser *CaffeParserFactory::priv(ICaffeParser *parser) +{ + // gLogError << __func__ << " looking up priv for base_i=" << parser << endl; + nvdla::priv::BiMap::left_iterator f = s_priv.find_left(parser); + if ( f == s_priv.end_left() ) { + return NULL; + } + return f->second; +} + +ICaffeParser *CaffeParserFactory::i(CaffeParser *parser) +{ + nvdla::priv::BiMap::right_iterator f = s_priv.find_right(parser); + if ( f == s_priv.end_right() ) { + return NULL; + } + return f->second; +} + + +ICaffeParser *CaffeParserFactory::self(void *s) +{ + nvdla::priv::BiMap::left_iterator f = s_self.find_left(s); + if ( f == s_self.end_left() ) { + return NULL; + } + return f->second; +} + +nvdla::priv::BiMap CaffeParserFactory::s_priv; +nvdla::priv::BiMap CaffeParserFactory::s_self; + + +void BlobNameToTensor::add(const std::string& name, ITensor* tensor) +{ + mMap[name] = tensor; +} + +ITensor* BlobNameToTensor::find(const char* name) const +{ + std::map::const_iterator p = mMap.find(name); + if (p == mMap.end()) { + return 0; + } + return p->second; +} + +ITensor*& BlobNameToTensor::operator[](const std::string& name) +{ + return mMap[name]; +} + +void BlobNameToTensor::setTensorNames() +{ + std::map::iterator p; + for ( p = mMap.begin(); p != mMap.end(); p++) { + p->second->setName(p->first.c_str()); + } +} + + +BlobNameToTensor::~BlobNameToTensor() { } + +struct CaffeParserPoolingDimsCallback : public INetwork::OutputDimensionsFormula +{ + // FB pooling parameters + // Use floor((height + 2 * padding - kernel) / stride) + 1 + // instead of ceil((height + 2 * padding - kernel) / stride) + 1 + std::set mHasTorchPooling; + + // TODO: mostly duplicated with code in engine + virtual Dims2 compute(Dims2 input, Dims2 kernel, Dims2 stride, + Dims2 tlPadding, Dims2 brPadding, const char* layerName) const /* override */ + { + // check for overflow before we delve into any further computations here... + assert( input.h + tlPadding.h + brPadding.h >= kernel.h ); + assert( input.w + tlPadding.w + brPadding.w >= kernel.w ); + int pooledH, pooledW; + if (mHasTorchPooling.find(std::string(layerName)) != mHasTorchPooling.end()) + { + pooledH = static_cast + (floor(static_cast(input.h + tlPadding.h + brPadding.h - kernel.h) / stride.h)) + 1; + pooledW = static_cast + (floor(static_cast(input.w + tlPadding.w + brPadding.w - kernel.w) / stride.w)) + 1; + } else + { + pooledH = static_cast + (ceil(static_cast(input.h + tlPadding.h + brPadding.h - kernel.h) / stride.h)) + 1; + pooledW = static_cast + (ceil(static_cast(input.w + tlPadding.w + brPadding.w - kernel.w) / stride.w)) + 1; + } + + if (tlPadding.h || tlPadding.w) + { + // DS: caffe comment for this (which doesn't work if padding is very large) is: + // "If we have padding, ensure that the last pooling starts strictly inside the image (instead of at the padding); otherwise clip the last." + if ((pooledH - 1) * stride.h >= input.h + tlPadding.h) + --pooledH; + if ((pooledW - 1) * stride.w >= input.w + tlPadding.w) + --pooledW; + + assert((pooledH - 1) * stride.h < input.h + tlPadding.h); + assert((pooledW - 1) * stride.w < input.w + tlPadding.w); + } + + return Dims2(pooledH, pooledW); + } + + Dims2 compute(Dims2 /*input*/, Dims2 /*kernel*/, Dims2 /*stride*/, + Dims2 /*tlPadding*/, Dims2 /*brPadding*/, Dims2 /*dilation*/, const char*) const + { + return Dims2(-1, -1); + } + +}; + +void CaffeParser::shutdownProtobufLibrary() +{ + google::protobuf::ShutdownProtobufLibrary(); +} + +// There are some challenges associated with importing caffe models. One is that +// a .caffemodel file just consists of layers and doesn't have the specs for its +// input and output blobs. +// +// So we need to read the deploy file to get the input + +static bool readBinaryProto(dc::NetParameter* net, const char* file, size_t bufSize) +{ + CHECK_NULL_RET_VAL(net, false); + CHECK_NULL_RET_VAL(file, false); + using namespace google::protobuf::io; + + std::ifstream stream(file, std::ios::in | std::ios::binary); + if (!stream) + { + std::cout << "could not open file " << file << std::endl; + return false; + } + + IstreamInputStream rawInput(&stream); + CodedInputStream codedInput(&rawInput); + codedInput.SetTotalBytesLimit(int(bufSize), -1); + + bool ok = net->ParseFromCodedStream(&codedInput); + stream.close(); + + if (!ok) + { + std::cout << "Caffe Parser: could not parse binary model file" << std::endl; + return false; + } + + return ok; +} + +static bool readTextProto(dc::NetParameter* net, const char* file) +{ + CHECK_NULL_RET_VAL(net, false); + CHECK_NULL_RET_VAL(file, false); + using namespace google::protobuf::io; + + std::ifstream stream(file, std::ios::in ); + if (!stream) + { + std::cout << "could not open file " << file; + return false; + } + + IstreamInputStream input(&stream); + bool ok = google::protobuf::TextFormat::Parse(&input, net); + stream.close(); + + if (!ok) + { + std::cout << "Caffe Parser: could not parse text file" << std::endl; + return false; + } + + return ok; +} + +enum /*class*/ WeightType +{ + // types for convolution, deconv, fully connected + kGENERIC = 0, // typical weights for the layer: e.g. filter (for conv) or matrix weights (for innerproduct) + kBIAS = 1, // bias weights + + kMEAN = 0, + kVARIANCE = 1, + kMOVING_AVERAGE = 2 +}; + + +class CaffeWeightFactory +{ +public: + CaffeWeightFactory(const dc::NetParameter& msg, bool convertTo16bit, std::vector& tmpAllocs) + : mMsg(msg), mTmpAllocs(tmpAllocs), m16bit(convertTo16bit), mOK(true) + { + mRef = new dc::NetParameter; + } + virtual ~CaffeWeightFactory() { } + + bool is16bit() const + { + return m16bit; + } + + std::vector& getTmpAllocs() + { + return mTmpAllocs; + } + + virtual Weights operator()(const std::string& layerName, WeightType weightType) + { + int numLayers = mMsg.layer_size(); + + const dc::BlobProto* blobMsg; + + if (numLayers > 0) + { + int i = 0; + for (; i < mMsg.layer_size(); i++) + { + std::string n = mMsg.layer(i).name(); + if (mMsg.layer(i).name() == layerName) { + break; + } + } + + int index = static_cast(weightType); + blobMsg = &mMsg.layer(i).blobs(index); + } + else + { + int i = 0; + for (; i < mMsg.layers_size(); i++) + { + std::string n = mMsg.layers(i).name(); + if (mMsg.layers(i).name() == layerName) { + break; + } + } + + int index = static_cast(weightType); + blobMsg = &mMsg.layers(i).blobs(index); + } + + + if (!m16bit) + { + if (blobMsg->data_size() >0) + { + mOK &= checkForNans(blobMsg->data().data(), int(blobMsg->data_size()), layerName); + return Weights(DataType::FLOAT, blobMsg->data().data(), NvS64(blobMsg->data_size())); + } + std::cerr << layerName << ": ERROR - 32-bit weights not found for 32-bit model" << std::endl; + mOK = false; + return Weights(DataType::FLOAT, NULL, 0); + } + + + size_t count; + float16* data; + if (blobMsg->half_data_size() > 0) + { + count = blobMsg->half_data().size(); + data = (float16*)blobMsg->half_data().data(); + for (int i = 0; i < blobMsg->half_data().size(); i++) { + // 'cos the fp16 data is stored in uint32, luvverly. + data[i] = data[i * 2]; + } + } + else + { + count = blobMsg->data().size(); + data = reinterpret_cast(malloc(count*sizeof(float16))); + mTmpAllocs.push_back(data); + float* data32 = (float*)blobMsg->data().data(); + for (size_t i = 0; i < count; i++) + { + if (data32[i]>std::numeric_limits::max() || + data32[i] < -std::numeric_limits::max()) + { + std::cerr << "error:" << layerName << ": - weights are out" + " of range for 16-bit conversion" << std::endl; + mOK = false; + } + data[i] = data32[i]; + + } + } + + + mOK &= checkForNans(data, count, layerName); + return Weights(DataType::HALF, data, NvS64(count)); + } + + bool isOK() + { + return mOK; + } + +private: + template bool checkForNans(const void* values, int count, const std::string& layerName) + { + const T* v = reinterpret_cast(values); + for (int i = 0; i < count; i++) + { + if (std::isnan(float(v[i]))) + { + NVDLA_UNUSED(layerName); + // std::cout << layerName << ": Nan detected in weights" << std::endl; + return false; + } + } + return true; + } + + const dc::NetParameter& mMsg; + dc::NetParameter * mRef; + std::vector& mTmpAllocs; + bool m16bit; + + bool mOK; +}; + +static ILayer* parseConvolution(INetwork *network, const dc::LayerParameter& msg, + CaffeWeightFactory& weightFactory, + IBlobNameToTensor* tensors) +{ + const dc::ConvolutionParameter& p = msg.convolution_param(); + int numOutputs = p.num_output(); + int numGroups = p.has_group()? p.group() : 1; + ILayer* layer = NULL; + + int kernelW = p.has_kernel_w() ? p.kernel_w() : p.kernel_size(0); + int kernelH = p.has_kernel_h() ? p.kernel_h() : p.kernel_size_size() > 1 ? p.kernel_size(1) : p.kernel_size(0); + + int strideW = p.has_stride_w() ? p.stride_w() : p.stride_size() > 0 ? p.stride(0) : 1; + int strideH = p.has_stride_h() ? p.stride_h() : p.stride_size() > 1 ? p.stride(1) : p.stride_size() > 0 ? p.stride(0) : 1; + + int padW = p.has_pad_w() ? p.pad_w() : p.pad_size() > 0 ? p.pad(0) : 0; + int padH = p.has_pad_h() ? p.pad_h() : p.pad_size() > 1 ? p.pad(1) : p.pad_size() > 0 ? p.pad(0) : 0; + + int dilationW = p.dilation_size() > 0 ? p.dilation(0) : 1; + int dilationH = p.dilation_size() > 1 ? p.dilation(1) : p.dilation_size() > 0 ? p.dilation(0) : 1; + + BiasMode biasMode = BiasMode::bNONE; + + // TODO: cross-correlation vs convolution + Weights kernelWeights = weightFactory(msg.name(), /*WeightType::*/kGENERIC); + Weights biasWeights = + (!p.has_bias_term() || p.bias_term()) ? + weightFactory(msg.name(), /*WeightType::*/kBIAS) : + Weights(DataType::FLOAT, NULL, 0); + + if ( biasWeights.count == 0 ) + { + biasMode = BiasMode::bNONE; + } + else if ( biasWeights.count == 1 ) + { + biasMode = BiasMode::bUNIFORM; + } + else if ( biasWeights.count == numOutputs ) + { + biasMode = BiasMode::bCHANNEL; + } + else + { + biasMode = BiasMode::bm_ELEMENTWISE; + } + + Dims2 tlPadding = Dims2(padH, padW); + Dims2 brPadding = Dims2(padH, padW); + Dims2 stride = Dims2(strideH, strideW); + Dims2 dilation = Dims2(dilationH, dilationW); + Dims2 kernelSize= Dims2(kernelH, kernelW); + + // TODO: cross-correlation vs convolution + layer = network->addConvolution((*tensors)[msg.bottom(0)], numOutputs, 0, + kernelSize, tlPadding, brPadding, stride, dilation, + kernelWeights, biasWeights, biasMode, numGroups); + + return layer; +} + +static ILayer* parsePooling(INetwork* network, const dc::LayerParameter&msg, + CaffeWeightFactory& /*weightFactory*/, + IBlobNameToTensor * tensors) +{ + const dc::PoolingParameter& p = msg.pooling_param(); + if (p.pool() != dc::PoolingParameter::MAX && p.pool() != dc::PoolingParameter::AVE) + { + gLogError << "only AVE and MAX pool operations are supported" << std::endl; + return 0; + } + + + // mandatory + int kernelH, kernelW; + if (p.has_global_pooling() && p.global_pooling()) + { + Dims4 dims = (*tensors)[msg.bottom(0)]->getDimensions(); + kernelH = dims.h; + kernelW = dims.w; + } + else + { + // mandatory + kernelH = p.has_kernel_h() ? p.kernel_h() : p.kernel_size(); + kernelW = p.has_kernel_w() ? p.kernel_w() : p.kernel_size(); + } + + int strideH = p.has_stride_h() ? p.stride_h() : p.has_stride() ? p.stride() : 1; + int strideW = p.has_stride_w() ? p.stride_w() : p.has_stride() ? p.stride() : 1; + + int padH = p.has_pad_h() ? p.pad_h() : p.has_pad() ? p.pad() : 0; + int padW = p.has_pad_w() ? p.pad_w() : p.has_pad() ? p.pad() : 0; + + Dims2 windowSize = Dims2(kernelH, kernelW); + Dims2 stride = Dims2(strideH, strideW); + Dims2 tlPadding = Dims2(padH, padW); + Dims2 brPadding = Dims2(padH, padW); + + PoolingType type = p.has_pool() && p.pool() == + dc::PoolingParameter::AVE ? PoolingType::kAVERAGE : PoolingType::kMAX; + + ILayer *layer = network->addPooling((*tensors)[msg.bottom(0)], type, + windowSize, stride, tlPadding, brPadding); + + if (layer) + { + layer->setName(msg.name().c_str()); + if (p.has_torch_pooling() ? p.torch_pooling() : false) { + static_cast + (network->getPoolingOutputDimensionsFormula()).mHasTorchPooling.insert(msg.name()); + } + + (*tensors)[msg.top(0)] = layer->getOutput(0); + } + return layer; +} + +static ILayer* parseInnerProduct(INetwork* network, const dc::LayerParameter&msg, + CaffeWeightFactory& weightFactory, + IBlobNameToTensor * tensors) +{ + const dc::InnerProductParameter& p = msg.inner_product_param(); + int numOutputs = p.num_output(); + + Weights kernelWeights = weightFactory(msg.name(), /*WeightType::*/kGENERIC); + Weights biasWeights = !p.has_bias_term() || p.bias_term() ? weightFactory(msg.name(), /*WeightType::*/kBIAS) : Weights(DataType::FLOAT, NULL, 0); + BiasMode biasMode = BiasMode::bNONE; + + if ( biasWeights.count == 0 ) + { + biasMode = BiasMode::bNONE; + } + else if ( biasWeights.count == 1 ) + { + biasMode = BiasMode::bUNIFORM; + } + else if ( biasWeights.count == numOutputs ) + { + biasMode = BiasMode::bCHANNEL; + } + else + { + biasMode = BiasMode::bm_ELEMENTWISE; + } + + return network->addFullyConnected((*tensors)[msg.bottom(0)], numOutputs, + kernelWeights, biasWeights, biasMode); + +} + + +static ILayer* parseReLU(INetwork* network, const dc::LayerParameter&msg, + CaffeWeightFactory& /*weightFactory*/, + IBlobNameToTensor * tensors) +{ + return network->addActivation((*tensors)[msg.bottom(0)], /*ActivationType::*/kRELU); +} + +static ILayer* parseSoftMax(INetwork * network, const dc::LayerParameter&msg, + CaffeWeightFactory& /*weightFactory*/, IBlobNameToTensor * tensors) +{ + return network->addSoftMax((*tensors)[msg.bottom(0)]); +} + +static ILayer* parseLRN(INetwork * network, const dc::LayerParameter&msg, + CaffeWeightFactory& /*weightFactory*/, IBlobNameToTensor* tensors) +{ + const dc::LRNParameter& p = msg.lrn_param(); + int localSize = p.has_local_size() ? p.local_size() : 5; + float alpha = p.has_alpha() ? p.alpha() : 1; + float beta = p.has_beta() ? p.beta() : 5; + float k = p.has_k() ? p.k() : 1; + + return network->addLRN((*tensors)[msg.bottom(0)], localSize, alpha, beta, k); +} + + +static ILayer* parsePower(INetwork * network, const dc::LayerParameter&msg, + CaffeWeightFactory& weightFactory, IBlobNameToTensor *tensors) +{ + const dc::PowerParameter& p = msg.power_param(); + + float shift = p.has_shift() ? p.shift() : 0.0f; + float scale = p.has_scale() ? p.scale() : 1.0f; + float power = p.has_power() ? p.power() : 1.0f; + + if (power != 1.0f || shift != 0.0f) + { + //std::cout << "Caffe Parser: shift and power not supported in scale layers" << std::endl; + return 0; + } + + bool is16bit = weightFactory.is16bit(); + Weights wShift, wScale, wPower; + if (is16bit) + { + float16* t = reinterpret_cast(malloc(3 * sizeof(float16))); + t[0] = float16(shift), t[1] = float16(scale), t[2] = float16(power); + wShift = Weights(DataType::HALF, &t[0], 1); + wScale = Weights(DataType::HALF, &t[1], 1); + wPower = Weights(DataType::HALF, &t[2], 1); + weightFactory.getTmpAllocs().push_back(t); + } + else + { + float* t = reinterpret_cast(malloc(3 * sizeof(float))); + t[0] = shift, t[1] = scale, t[2] = power; + wShift = Weights(DataType::FLOAT, &t[0], 1); + wScale = Weights(DataType::FLOAT, &t[1], 1); + wPower = Weights(DataType::FLOAT, &t[2], 1); + weightFactory.getTmpAllocs().push_back(t); + } + + + return network->addScale((*tensors)[msg.bottom(0)], /*ScaleMode::*/sUNIFORM, wShift, wScale, wPower); +} + + +static ILayer* parseEltwise(INetwork * network, const dc::LayerParameter&msg, + CaffeWeightFactory& /*weightFactory*/, IBlobNameToTensor * tensors) +{ + const dc::EltwiseParameter& p = msg.eltwise_param(); + + ElementWiseOperation op = /*ElementWiseOperation::*/kSUM; + switch (p.operation()) + { + case dc::EltwiseParameter_EltwiseOp_SUM: op = /*ElementWiseOperation::*/kSUM; break; + case dc::EltwiseParameter_EltwiseOp_PROD: op = /*ElementWiseOperation::*/kPROD; break; + case dc::EltwiseParameter_EltwiseOp_MAX: op = /*ElementWiseOperation::*/ew_kMAX; break; + } + + return network->addElementWise((*tensors)[msg.bottom(0)], (*tensors)[msg.bottom(1)], op); +} + + +static ILayer* parseConcat(INetwork * network, const dc::LayerParameter&msg, + CaffeWeightFactory& /*weightFactory*/, IBlobNameToTensor * tensors) +{ + //const dc::ConcatParameter& p = msg.concat_param(); // TODO: unused + + std::vector ptrs; + for (unsigned int i = 0, n = msg.bottom_size(); i < n; i++) { + ptrs.push_back((*tensors)[msg.bottom().Get(i)]); + } + + return network->addConcatenation(&ptrs[0], msg.bottom_size()); +} + + +static ILayer* parseDeconvolution(INetwork * network, const dc::LayerParameter& msg, + CaffeWeightFactory& weightFactory, IBlobNameToTensor * tensors) +{ + const dc::ConvolutionParameter& p = msg.convolution_param(); + int numOutputs = p.num_output(); + + BiasMode biasMode = BiasMode::bNONE; + + int kernelW = p.has_kernel_w() ? p.kernel_w() : p.kernel_size(0); + int kernelH = p.has_kernel_h() ? p.kernel_h() : p.kernel_size_size() > 1 ? p.kernel_size(1) : p.kernel_size(0); + + int strideW = p.has_stride_w() ? p.stride_w() : p.stride_size() > 0 ? p.stride(0) : 1; + int strideH = p.has_stride_h() ? p.stride_h() : p.stride_size() > 1 ? p.stride(1) : p.stride_size() > 0 ? p.stride(0) : 1; + + int padW = p.has_pad_w() ? p.pad_w() : p.pad_size() > 0 ? p.pad(0) : 0; + int padH = p.has_pad_h() ? p.pad_h() : p.pad_size() > 1 ? p.pad(1) : p.pad_size() > 0 ? p.pad(0) : 0; + + int dilationW = p.dilation_size() > 0 ? p.dilation(0) : 1; + int dilationH = p.dilation_size() > 1 ? p.dilation(1) : p.dilation_size() > 0 ? p.dilation(0) : 1; + + int numGroups = p.has_group()? p.group() : 1; + + Weights kernelWeights = weightFactory(msg.name(), /*WeightType::*/kGENERIC); + Weights biasWeights = + !p.has_bias_term() || p.bias_term() ? + weightFactory(msg.name(), /*WeightType::*/kBIAS) : + Weights(DataType::FLOAT, NULL, 0); + + if ( biasWeights.count == 0 ) + { + biasMode = BiasMode::bNONE; + } + else if ( biasWeights.count == 1 ) + { + biasMode = BiasMode::bUNIFORM; + } + else if ( biasWeights.count == numOutputs ) + { + biasMode = BiasMode::bCHANNEL; + } + else + { + biasMode = BiasMode::bm_ELEMENTWISE; + } + + Dims2 stride = Dims2(strideH, strideW); + Dims2 dilation = Dims2(dilationH, dilationW); + Dims2 tlPadding = Dims2(padH, padW); + Dims2 brPadding = Dims2(padH, padW); + Dims2 kernelSize = Dims2(kernelH, kernelW); + + ILayer *layer = network->addDeconvolution((*tensors)[msg.bottom(0)], numOutputs, 0, + kernelSize, tlPadding, brPadding, stride, dilation, + kernelWeights, biasWeights, biasMode, numGroups); + + if (numGroups != 1) + { + // std::cout << "Deconvolution layer: groups not supported" << std::endl; + return 0; + } + + return layer; +} + +static ILayer* parseSigmoid(INetwork * network, const dc::LayerParameter&msg, + CaffeWeightFactory& /*weightFactory*/, IBlobNameToTensor * tensors) +{ + return network->addActivation((*tensors)[msg.bottom(0)], /*ActivationType::*/kSIGMOID); +} + +static ILayer* parseTanH(INetwork * network, const dc::LayerParameter&msg, + CaffeWeightFactory& /*weightFactory*/, IBlobNameToTensor * tensors) +{ + return network->addActivation((*tensors)[msg.bottom(0)], /*ActivationType::*/kTANH); +} + +static ILayer* parseBatchNormalization(INetwork * network, const dc::LayerParameter &msg, + CaffeWeightFactory& weightFactory, IBlobNameToTensor *tensors) +{ + const dc::BatchNormParameter& p = msg.batch_norm_param(); + + Weights mean = weightFactory(msg.name(), /*WeightType::*/kMEAN); + Weights variance = weightFactory(msg.name(), /*WeightType::*/kVARIANCE); + Weights movingAverage = weightFactory(msg.name(), /*WeightType::*/kMOVING_AVERAGE); + float eps = p.eps(); + float scaleFactor = 1.0f; + float average = 0.0f; + int i; + + average = *(static_cast(movingAverage.values)); + if ( average == 0.0f ) + { + gLogError << "Batch Normalization moving average is zero " << std::endl; + return 0; + } + scaleFactor /= average; + + if (mean.count != variance.count) + { + gLogError << "Mean and variance have differing number of elements " << mean.count << " & " << variance.count << std::endl; + return 0; + } + + float *meanBlob = (float *)mean.values; + float *varianceBlob = (float *)variance.values; + + Dims4 inputDims = (*tensors)[msg.bottom(0)]->getDimensions(); + BatchNormMode mode; + + if (mean.count == 1) + { + mode = BatchNormMode::bnUNIFORM; + meanBlob[0] = meanBlob[0] * scaleFactor; + varianceBlob[0] = varianceBlob[0] * scaleFactor; + } + else if (mean.count == inputDims.c) + { + mode = BatchNormMode::bnm_CHANNEL; + for (i = 0; i < mean.count; i++) + { + meanBlob[i] = meanBlob[i] * scaleFactor; + varianceBlob[i] = varianceBlob[i] * scaleFactor; + } + } + else + { + gLogError << "Unknown batch norm mode" << std::endl; + return 0; + } + + /* DLA hardware expects mean and variance and not scale and shift */ + return network->addBatchNorm((*tensors)[msg.bottom(0)], mode, mean, variance, eps); +} + +static ILayer* parseScale(INetwork* network, const dc::LayerParameter& msg, + CaffeWeightFactory& weightFactory, IBlobNameToTensor* tensors) +{ + const dc::ScaleParameter& p = msg.scale_param(); + + Weights scale = weightFactory(msg.name(), WeightType::kGENERIC); + Weights shift = p.has_bias_term() ? weightFactory(msg.name(), WeightType::kBIAS) : Weights(scale.type, NULL, 0); + Weights power = Weights(scale.type, NULL, 0); + Dims4 inputDims = (*tensors)[msg.bottom(0)]->getDimensions(); + ScaleMode mode; + + if (msg.bottom_size() > 1) + { + gLogError << "Parser can't handle more than 1 inputs to scale op" << std::endl; + return 0; + } + + if ( scale.count == 1 ) + { + mode = ScaleMode::sUNIFORM; + } + else if ( scale.count == inputDims.c ) + { + mode = ScaleMode::sCHANNEL; + } + else if ( scale.count == (inputDims.c * inputDims.h * inputDims.w) ) + { + mode = ScaleMode::sm_ELEMENTWISE; + } + else + { + gLogError << "Unknown scale mode" << std::endl; + return 0; + } + + if ( shift.count > 0 ) + { + if ( shift.count != scale.count ) + { + gLogError << "Bias dims not same as scale dims" << std::endl; + return 0; + } + } + + return network->addScale((*tensors)[msg.bottom(0)], mode, shift, scale, power); +} + + +typedef ILayer*(*LayerParseFn)(INetwork *, + const dc::LayerParameter&, + CaffeWeightFactory&, + IBlobNameToTensor *); + + +typedef std::map LayerParseFnMap; + +LayerParseFnMap::value_type gParseTableData[] = + { + LayerParseFnMap::value_type("Convolution", parseConvolution), + LayerParseFnMap::value_type("Pooling", parsePooling), + LayerParseFnMap::value_type("InnerProduct", parseInnerProduct), + LayerParseFnMap::value_type("ReLU", parseReLU), + LayerParseFnMap::value_type("Softmax", parseSoftMax), + LayerParseFnMap::value_type("SoftmaxWithLoss", parseSoftMax), + LayerParseFnMap::value_type("LRN", parseLRN), + LayerParseFnMap::value_type("Power", parsePower), + LayerParseFnMap::value_type("Eltwise", parseEltwise), + LayerParseFnMap::value_type("Concat", parseConcat), + LayerParseFnMap::value_type("Deconvolution", parseDeconvolution), + LayerParseFnMap::value_type("Sigmoid", parseSigmoid), + LayerParseFnMap::value_type("TanH", parseTanH), + LayerParseFnMap::value_type("BatchNorm", parseBatchNormalization), + LayerParseFnMap::value_type("Scale", parseScale) + }; +const int nelems = sizeof gParseTableData / sizeof gParseTableData[0]; +LayerParseFnMap gParseTable( gParseTableData, gParseTableData + nelems); + + + + +CaffeParser::~CaffeParser() +{ + + std::vector::iterator v; + + for (v = mTmpAllocs.begin(); v!= mTmpAllocs.end(); v++) { + free(*v); + } + + delete mBlobNameToTensor; +} + +const IBlobNameToTensor* CaffeParser::parse(const char* deployFile, + const char* modelFile, + INetwork * network) +{ + + CHECK_NULL_RET_NULL(deployFile); + CHECK_NULL_RET_NULL(modelFile); + assert(mDimsCallback == 0); + + if (!mDimsCallback) { + mDimsCallback = new CaffeParserPoolingDimsCallback; + } + network->setPoolingOutputDimensionsFormula(mDimsCallback); + + // this is used to deal with dropout layers which have different input and output + mModel = new dc::NetParameter(); + if (!readBinaryProto(mModel/*.get()*/, modelFile, mProtobufBufferSize)) + { + gLogError << "Could not parse model file" << std::endl; + return 0; + } + + mDeploy = new dc::NetParameter(); + if (!readTextProto(mDeploy/*.get()*/, deployFile)) + { + gLogError << "Could not parse deploy file" << std::endl; + return 0; + } + + bool ok = true; + CaffeWeightFactory weights(*mModel/**mModel.get()*/, + false /*weightType == DataType::kHALF*/, mTmpAllocs); + + mBlobNameToTensor = new BlobNameToTensor(); + + for (int i = 0; i < mDeploy->input_size(); i++) + { + Dims4 dims; + if (mDeploy->input_shape_size()) { + dims.n = (int)mDeploy->input_shape().Get(i).dim().Get(0); + dims.c = (int)mDeploy->input_shape().Get(i).dim().Get(1); + dims.h = (int)mDeploy->input_shape().Get(i).dim().Get(2); + dims.w = (int)mDeploy->input_shape().Get(i).dim().Get(3); + } + else { // deprecated, but still used in a lot of networks + dims.n = (int)mDeploy->input_dim().Get(i * 4 + 0); + dims.c = (int)mDeploy->input_dim().Get(i * 4 + 1); + dims.h = (int)mDeploy->input_dim().Get(i * 4 + 2); + dims.w = (int)mDeploy->input_dim().Get(i * 4 + 3); + } + + ITensor* tensor = network->addInput(mDeploy->input().Get(0).c_str(), dims); + mBlobNameToTensor->add(mDeploy->input().Get(0), tensor); + + } + + for (int i = 0; i < mDeploy->layer_size() && ok; i++) + { + const dc::LayerParameter& layerMsg = mDeploy->layer(i); + if (layerMsg.has_phase() && layerMsg.phase() == dc::TEST) { + continue; + } + + if (layerMsg.type() == "Dropout") + { + mBlobNameToTensor->add(layerMsg.top().Get(0), + mBlobNameToTensor->find(layerMsg.bottom().Get(0).c_str())); + continue; + } + + if (layerMsg.type() == "Input") + { + const dc::InputParameter& p = layerMsg.input_param(); + for (int i = 0; i < layerMsg.top_size(); i++) + { + const dc::BlobShape& shape = p.shape().Get(i); + Dims4 dims(shape.dim().Get(0), shape.dim().Get(1), shape.dim().Get(2), shape.dim().Get(3)); + ITensor* tensor = network->addInput(layerMsg.top(i).c_str(), dims); + mBlobNameToTensor->add(layerMsg.top().Get(i), tensor); + } + continue; + } + if (layerMsg.type() == "Flatten") + { + ITensor* tensor = (*mBlobNameToTensor)[layerMsg.bottom().Get(0)]; + (*mBlobNameToTensor)[layerMsg.top().Get(0)] = tensor; + std::cout << "Warning: Flatten layer ignored." << std::endl; + continue; + } + + LayerParseFnMap::iterator v = gParseTable.find(layerMsg.type()); + + if (v == gParseTable.end()) + { + gLogError << "could not parse layer type " << layerMsg.type() << std::endl; + ok = false; + } + else + { + ILayer* layer = (*v->second)(network, layerMsg, weights, mBlobNameToTensor); + + if (layer == 0) + { + gLogError << "error: parsing layer type " << layerMsg.type() << + " index " << i << std::endl; + ok = false; + } + else + { + layer->setName(layerMsg.name().c_str()); + mBlobNameToTensor->add(layerMsg.top(0), layer->getOutput(0)); + } + } + } + + mBlobNameToTensor->setTensorNames(); + return ok && weights.isOK() ? mBlobNameToTensor : 0; +} + +int CaffeParser::identifyOutputs(INetwork * network) +{ + std::set< ITensor* > outputTensors; + std::set< ITensor* > inputTensors; + + for (int l = 0; l < network->getNumLayers(); ++l) + { + ILayer* layer = network->getLayer(l); + if (!layer) + return -1; + + for (int ii = 0; ii < layer->getNumInputs(); ++ii) { + inputTensors.insert(layer->getInput(ii)); + } + + for (int oo = 0; oo < layer->getNumOutputs(); ++oo) + { + outputTensors.insert(layer->getOutput(oo)); + } + } + + for (std::set::iterator oi = outputTensors.begin(); oi != outputTensors.end(); ++oi) + { + // an output tensor which is not an input to any other layers is a network output tensor + if (inputTensors.find(*oi) == inputTensors.end()) + { + network->markOutput(*oi); + gLogInfo << "mark " << (*oi)->getName() << std::endl; + } + } + + return network->getNumOutputs(); +} + +BinaryProtoBlob::BinaryProtoBlob(void* memory, DataType type, Dims4 dimensions) : + mMemory(memory), mDataType(type), mDimensions(dimensions) +{ +} + +Dims4 BinaryProtoBlob::getDimensions() +{ + return mDimensions; +} + +const void* BinaryProtoBlob::getData() +{ + return mMemory; +} + +void BinaryProtoBlob::destroy() +{ + delete this; +} + +BinaryProtoBlob::~BinaryProtoBlob() +{ + free(mMemory); +} + +} // nvdla::caffe::priv +} // nvdla::caffe +} // nvdla:: diff --git a/umd/core/src/compiler/caffe/c/NvDlaCaffeParser.cpp b/umd/core/src/compiler/caffe/c/NvDlaCaffeParser.cpp new file mode 100644 index 00000000..36714d43 --- /dev/null +++ b/umd/core/src/compiler/caffe/c/NvDlaCaffeParser.cpp @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#include "priv/c/API.h" + +#include "ErrorMacros.h" + +using nvdla::caffe::ICaffeParser; +using nvdla::INetwork; +using nvdla::IWisdom; + +#define CHECK_SELF() \ + NvDlaError e = NvDlaSuccess; \ + ICaffeParser *parser; \ + e = nvdla::priv::checkSelf(cpt, parser); \ + PROPAGATE_ERROR_FAIL( e ) + + + + + +namespace nvdla { + +namespace priv { + + +static NvDlaError caffeParserParse(NvDlaCaffeParser cpt, const char *d, const char *m, NvDlaNetwork nt) +{ + INetwork *network; + CHECK_SELF(); + PROPAGATE_ERROR_FAIL( checkNetworkSelf(nt, network) ); + if ( ! parser->parse(d, m, network) ) { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter); + } + fail: + return e; +} + +static NvDlaError caffeParserIdentifyOutputs(NvDlaCaffeParser cpt, NvDlaNetwork nt) +{ + INetwork *network; + CHECK_SELF(); + PROPAGATE_ERROR_FAIL( checkNetworkSelf(nt, network) ); + if ( parser->identifyOutputs(network) != 0 ) { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter); + } + fail: + return e; +} + +const struct NvDlaCaffeParserI caffeParserI = +{ + /* .parse = */ caffeParserParse, + /* .identifyOutputs = */ caffeParserIdentifyOutputs, +}; + + +} // nvdla::priv + +} // nvdla + + +extern "C" +{ + + NvDlaError NvDlaCreateCaffeParser(NvDlaCaffeParser *rcpt) + { + NvDlaError e = NvDlaSuccess; + if ( !rcpt ) { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter); + } + rcpt->self = nvdla::caffe::createCaffeParser(); + rcpt->i = &nvdla::priv::caffeParserI; + + fail: + return e; + } + + NvDlaError NvDlaDestroyCaffeParser(NvDlaCaffeParser cpt) + { + CHECK_SELF(); + PROPAGATE_ERROR_FAIL(nvdla::caffe::destroyCaffeParser(parser)); + + fail: + return e; + } +} diff --git a/umd/core/src/compiler/caffe/ditcaffe/ditcaffe.opt-for-lite.proto b/umd/core/src/compiler/caffe/ditcaffe/ditcaffe.opt-for-lite.proto new file mode 100644 index 00000000..d617dac7 --- /dev/null +++ b/umd/core/src/compiler/caffe/ditcaffe/ditcaffe.opt-for-lite.proto @@ -0,0 +1,1389 @@ +syntax = "proto2"; + +option optimize_for = LITE_RUNTIME; + +package ditcaffe; + +// 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]; + repeated uint32 half_data = 10 [packed = true]; + repeated uint32 half_diff = 11 [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 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; + + // 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: 146 (last added: parameter_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 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 ParameterParameter parameter_param = 145; + optional PoolingParameter pooling_param = 121; + optional PowerParameter power_param = 122; + optional PReLUParameter prelu_param = 131; + optional PythonParameter python_param = 130; + 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 substract 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 layer. + 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; + } + 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 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]; + + // FB pooling parameters + // Use floor((height + 2 * padding - kernel) / stride) + 1 + // instead of ceil((height + 2 * padding - kernel) / stride) + 1 + optional bool torch_pooling = 40 [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 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 paramters are shared across channels. + optional bool channel_shared = 2 [default = false]; +} diff --git a/umd/core/src/compiler/caffe/ditcaffe/ditcaffe.proto b/umd/core/src/compiler/caffe/ditcaffe/ditcaffe.proto new file mode 100644 index 00000000..5caf2636 --- /dev/null +++ b/umd/core/src/compiler/caffe/ditcaffe/ditcaffe.proto @@ -0,0 +1,1389 @@ +syntax = "proto2"; + +//option optimize_for = LITE_RUNTIME; + +package ditcaffe; + +// 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]; + repeated uint32 half_data = 10 [packed = true]; + repeated uint32 half_diff = 11 [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 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; + + // 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: 146 (last added: parameter_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 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 ParameterParameter parameter_param = 145; + optional PoolingParameter pooling_param = 121; + optional PowerParameter power_param = 122; + optional PReLUParameter prelu_param = 131; + optional PythonParameter python_param = 130; + 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 substract 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 layer. + 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; + } + 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 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]; + + // FB pooling parameters + // Use floor((height + 2 * padding - kernel) / stride) + 1 + // instead of ceil((height + 2 * padding - kernel) / stride) + 1 + optional bool torch_pooling = 40 [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 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 paramters are shared across channels. + optional bool channel_shared = 2 [default = false]; +} diff --git a/umd/core/src/compiler/caffe/ditcaffe/protobuf-2.6.1/ditcaffe.pb.cpp b/umd/core/src/compiler/caffe/ditcaffe/protobuf-2.6.1/ditcaffe.pb.cpp new file mode 100644 index 00000000..e0dd262a --- /dev/null +++ b/umd/core/src/compiler/caffe/ditcaffe/protobuf-2.6.1/ditcaffe.pb.cpp @@ -0,0 +1,31983 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: ditcaffe.proto + +#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION +#include "ditcaffe.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// @@protoc_insertion_point(includes) + +namespace ditcaffe { + +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* 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* 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* 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::EnumDescriptor* Phase_descriptor_ = NULL; + +} // namespace + + +void protobuf_AssignDesc_ditcaffe_2eproto() { + protobuf_AddDesc_ditcaffe_2eproto(); + const ::google::protobuf::FileDescriptor* file = + ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName( + "ditcaffe.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_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + BlobShape_descriptor_, + BlobShape::default_instance_, + BlobShape_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BlobShape, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BlobShape, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(BlobShape)); + BlobProto_descriptor_ = file->message_type(1); + static const int BlobProto_offsets_[11] = { + 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, half_data_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BlobProto, half_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_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + BlobProto_descriptor_, + BlobProto::default_instance_, + BlobProto_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BlobProto, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BlobProto, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(BlobProto)); + BlobProtoVector_descriptor_ = file->message_type(2); + static const int BlobProtoVector_offsets_[1] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BlobProtoVector, blobs_), + }; + BlobProtoVector_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + BlobProtoVector_descriptor_, + BlobProtoVector::default_instance_, + BlobProtoVector_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BlobProtoVector, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BlobProtoVector, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(BlobProtoVector)); + Datum_descriptor_ = file->message_type(3); + 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_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + Datum_descriptor_, + Datum::default_instance_, + Datum_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Datum, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Datum, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(Datum)); + FillerParameter_descriptor_ = file->message_type(4); + 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_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + FillerParameter_descriptor_, + FillerParameter::default_instance_, + FillerParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FillerParameter, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FillerParameter, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(FillerParameter)); + FillerParameter_VarianceNorm_descriptor_ = FillerParameter_descriptor_->enum_type(0); + NetParameter_descriptor_ = file->message_type(5); + 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_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + NetParameter_descriptor_, + NetParameter::default_instance_, + NetParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetParameter, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetParameter, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(NetParameter)); + SolverParameter_descriptor_ = file->message_type(6); + 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_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + SolverParameter_descriptor_, + SolverParameter::default_instance_, + SolverParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SolverParameter, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SolverParameter, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(SolverParameter)); + 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(7); + 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_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + SolverState_descriptor_, + SolverState::default_instance_, + SolverState_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SolverState, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SolverState, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(SolverState)); + NetState_descriptor_ = file->message_type(8); + 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_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + NetState_descriptor_, + NetState::default_instance_, + NetState_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetState, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetState, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(NetState)); + NetStateRule_descriptor_ = file->message_type(9); + 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_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + NetStateRule_descriptor_, + NetStateRule::default_instance_, + NetStateRule_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetStateRule, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetStateRule, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(NetStateRule)); + ParamSpec_descriptor_ = file->message_type(10); + 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_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + ParamSpec_descriptor_, + ParamSpec::default_instance_, + ParamSpec_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ParamSpec, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ParamSpec, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(ParamSpec)); + ParamSpec_DimCheckMode_descriptor_ = ParamSpec_descriptor_->enum_type(0); + LayerParameter_descriptor_ = file->message_type(11); + static const int LayerParameter_offsets_[57] = { + 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, 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, 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, python_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_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + LayerParameter_descriptor_, + LayerParameter::default_instance_, + LayerParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(LayerParameter)); + TransformationParameter_descriptor_ = file->message_type(12); + 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_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + TransformationParameter_descriptor_, + TransformationParameter::default_instance_, + TransformationParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TransformationParameter, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TransformationParameter, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(TransformationParameter)); + LossParameter_descriptor_ = file->message_type(13); + 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_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + LossParameter_descriptor_, + LossParameter::default_instance_, + LossParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LossParameter, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LossParameter, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(LossParameter)); + LossParameter_NormalizationMode_descriptor_ = LossParameter_descriptor_->enum_type(0); + AccuracyParameter_descriptor_ = file->message_type(14); + 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_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + AccuracyParameter_descriptor_, + AccuracyParameter::default_instance_, + AccuracyParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AccuracyParameter, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AccuracyParameter, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(AccuracyParameter)); + ArgMaxParameter_descriptor_ = file->message_type(15); + 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_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + ArgMaxParameter_descriptor_, + ArgMaxParameter::default_instance_, + ArgMaxParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ArgMaxParameter, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ArgMaxParameter, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(ArgMaxParameter)); + ConcatParameter_descriptor_ = file->message_type(16); + 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_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + ConcatParameter_descriptor_, + ConcatParameter::default_instance_, + ConcatParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ConcatParameter, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ConcatParameter, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(ConcatParameter)); + BatchNormParameter_descriptor_ = file->message_type(17); + 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_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + BatchNormParameter_descriptor_, + BatchNormParameter::default_instance_, + BatchNormParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BatchNormParameter, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BatchNormParameter, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(BatchNormParameter)); + BiasParameter_descriptor_ = file->message_type(18); + 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_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + BiasParameter_descriptor_, + BiasParameter::default_instance_, + BiasParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BiasParameter, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BiasParameter, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(BiasParameter)); + ContrastiveLossParameter_descriptor_ = file->message_type(19); + 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_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + ContrastiveLossParameter_descriptor_, + ContrastiveLossParameter::default_instance_, + ContrastiveLossParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ContrastiveLossParameter, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ContrastiveLossParameter, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(ContrastiveLossParameter)); + ConvolutionParameter_descriptor_ = file->message_type(20); + 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_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + ConvolutionParameter_descriptor_, + ConvolutionParameter::default_instance_, + ConvolutionParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ConvolutionParameter, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ConvolutionParameter, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(ConvolutionParameter)); + ConvolutionParameter_Engine_descriptor_ = ConvolutionParameter_descriptor_->enum_type(0); + CropParameter_descriptor_ = file->message_type(21); + static const int CropParameter_offsets_[2] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CropParameter, axis_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CropParameter, offset_), + }; + CropParameter_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + CropParameter_descriptor_, + CropParameter::default_instance_, + CropParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CropParameter, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CropParameter, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(CropParameter)); + DataParameter_descriptor_ = file->message_type(22); + 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_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + DataParameter_descriptor_, + DataParameter::default_instance_, + DataParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DataParameter, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DataParameter, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(DataParameter)); + DataParameter_DB_descriptor_ = DataParameter_descriptor_->enum_type(0); + DropoutParameter_descriptor_ = file->message_type(23); + static const int DropoutParameter_offsets_[1] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DropoutParameter, dropout_ratio_), + }; + DropoutParameter_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + DropoutParameter_descriptor_, + DropoutParameter::default_instance_, + DropoutParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DropoutParameter, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DropoutParameter, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(DropoutParameter)); + DummyDataParameter_descriptor_ = file->message_type(24); + 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_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + DummyDataParameter_descriptor_, + DummyDataParameter::default_instance_, + DummyDataParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DummyDataParameter, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DummyDataParameter, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(DummyDataParameter)); + EltwiseParameter_descriptor_ = file->message_type(25); + 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_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + EltwiseParameter_descriptor_, + EltwiseParameter::default_instance_, + EltwiseParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EltwiseParameter, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EltwiseParameter, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(EltwiseParameter)); + EltwiseParameter_EltwiseOp_descriptor_ = EltwiseParameter_descriptor_->enum_type(0); + ELUParameter_descriptor_ = file->message_type(26); + static const int ELUParameter_offsets_[1] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ELUParameter, alpha_), + }; + ELUParameter_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + ELUParameter_descriptor_, + ELUParameter::default_instance_, + ELUParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ELUParameter, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ELUParameter, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(ELUParameter)); + EmbedParameter_descriptor_ = file->message_type(27); + 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_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + EmbedParameter_descriptor_, + EmbedParameter::default_instance_, + EmbedParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EmbedParameter, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EmbedParameter, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(EmbedParameter)); + ExpParameter_descriptor_ = file->message_type(28); + 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_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + ExpParameter_descriptor_, + ExpParameter::default_instance_, + ExpParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ExpParameter, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ExpParameter, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(ExpParameter)); + FlattenParameter_descriptor_ = file->message_type(29); + 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_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + FlattenParameter_descriptor_, + FlattenParameter::default_instance_, + FlattenParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FlattenParameter, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FlattenParameter, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(FlattenParameter)); + HDF5DataParameter_descriptor_ = file->message_type(30); + 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_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + HDF5DataParameter_descriptor_, + HDF5DataParameter::default_instance_, + HDF5DataParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(HDF5DataParameter, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(HDF5DataParameter, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(HDF5DataParameter)); + HDF5OutputParameter_descriptor_ = file->message_type(31); + static const int HDF5OutputParameter_offsets_[1] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(HDF5OutputParameter, file_name_), + }; + HDF5OutputParameter_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + HDF5OutputParameter_descriptor_, + HDF5OutputParameter::default_instance_, + HDF5OutputParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(HDF5OutputParameter, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(HDF5OutputParameter, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(HDF5OutputParameter)); + HingeLossParameter_descriptor_ = file->message_type(32); + static const int HingeLossParameter_offsets_[1] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(HingeLossParameter, norm_), + }; + HingeLossParameter_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + HingeLossParameter_descriptor_, + HingeLossParameter::default_instance_, + HingeLossParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(HingeLossParameter, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(HingeLossParameter, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(HingeLossParameter)); + HingeLossParameter_Norm_descriptor_ = HingeLossParameter_descriptor_->enum_type(0); + ImageDataParameter_descriptor_ = file->message_type(33); + 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_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + ImageDataParameter_descriptor_, + ImageDataParameter::default_instance_, + ImageDataParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ImageDataParameter, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ImageDataParameter, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(ImageDataParameter)); + InfogainLossParameter_descriptor_ = file->message_type(34); + static const int InfogainLossParameter_offsets_[1] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(InfogainLossParameter, source_), + }; + InfogainLossParameter_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + InfogainLossParameter_descriptor_, + InfogainLossParameter::default_instance_, + InfogainLossParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(InfogainLossParameter, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(InfogainLossParameter, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(InfogainLossParameter)); + InnerProductParameter_descriptor_ = file->message_type(35); + 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_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + InnerProductParameter_descriptor_, + InnerProductParameter::default_instance_, + InnerProductParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(InnerProductParameter, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(InnerProductParameter, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(InnerProductParameter)); + InputParameter_descriptor_ = file->message_type(36); + static const int InputParameter_offsets_[1] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(InputParameter, shape_), + }; + InputParameter_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + InputParameter_descriptor_, + InputParameter::default_instance_, + InputParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(InputParameter, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(InputParameter, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(InputParameter)); + LogParameter_descriptor_ = file->message_type(37); + 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_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + LogParameter_descriptor_, + LogParameter::default_instance_, + LogParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LogParameter, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LogParameter, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(LogParameter)); + LRNParameter_descriptor_ = file->message_type(38); + 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_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + LRNParameter_descriptor_, + LRNParameter::default_instance_, + LRNParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LRNParameter, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LRNParameter, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(LRNParameter)); + LRNParameter_NormRegion_descriptor_ = LRNParameter_descriptor_->enum_type(0); + LRNParameter_Engine_descriptor_ = LRNParameter_descriptor_->enum_type(1); + MemoryDataParameter_descriptor_ = file->message_type(39); + 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_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + MemoryDataParameter_descriptor_, + MemoryDataParameter::default_instance_, + MemoryDataParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MemoryDataParameter, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MemoryDataParameter, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(MemoryDataParameter)); + MVNParameter_descriptor_ = file->message_type(40); + 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_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + MVNParameter_descriptor_, + MVNParameter::default_instance_, + MVNParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MVNParameter, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MVNParameter, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(MVNParameter)); + ParameterParameter_descriptor_ = file->message_type(41); + static const int ParameterParameter_offsets_[1] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ParameterParameter, shape_), + }; + ParameterParameter_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + ParameterParameter_descriptor_, + ParameterParameter::default_instance_, + ParameterParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ParameterParameter, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ParameterParameter, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(ParameterParameter)); + PoolingParameter_descriptor_ = file->message_type(42); + static const int PoolingParameter_offsets_[13] = { + 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_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PoolingParameter, torch_pooling_), + }; + PoolingParameter_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + PoolingParameter_descriptor_, + PoolingParameter::default_instance_, + PoolingParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PoolingParameter, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PoolingParameter, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(PoolingParameter)); + PoolingParameter_PoolMethod_descriptor_ = PoolingParameter_descriptor_->enum_type(0); + PoolingParameter_Engine_descriptor_ = PoolingParameter_descriptor_->enum_type(1); + PowerParameter_descriptor_ = file->message_type(43); + 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_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + PowerParameter_descriptor_, + PowerParameter::default_instance_, + PowerParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PowerParameter, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PowerParameter, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(PowerParameter)); + PythonParameter_descriptor_ = file->message_type(44); + 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_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + PythonParameter_descriptor_, + PythonParameter::default_instance_, + PythonParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PythonParameter, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PythonParameter, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(PythonParameter)); + ReductionParameter_descriptor_ = file->message_type(45); + 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_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + ReductionParameter_descriptor_, + ReductionParameter::default_instance_, + ReductionParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ReductionParameter, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ReductionParameter, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(ReductionParameter)); + ReductionParameter_ReductionOp_descriptor_ = ReductionParameter_descriptor_->enum_type(0); + ReLUParameter_descriptor_ = file->message_type(46); + 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_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + ReLUParameter_descriptor_, + ReLUParameter::default_instance_, + ReLUParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ReLUParameter, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ReLUParameter, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(ReLUParameter)); + ReLUParameter_Engine_descriptor_ = ReLUParameter_descriptor_->enum_type(0); + ReshapeParameter_descriptor_ = file->message_type(47); + 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_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + ReshapeParameter_descriptor_, + ReshapeParameter::default_instance_, + ReshapeParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ReshapeParameter, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ReshapeParameter, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(ReshapeParameter)); + ScaleParameter_descriptor_ = file->message_type(48); + 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_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + ScaleParameter_descriptor_, + ScaleParameter::default_instance_, + ScaleParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ScaleParameter, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ScaleParameter, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(ScaleParameter)); + SigmoidParameter_descriptor_ = file->message_type(49); + static const int SigmoidParameter_offsets_[1] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SigmoidParameter, engine_), + }; + SigmoidParameter_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + SigmoidParameter_descriptor_, + SigmoidParameter::default_instance_, + SigmoidParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SigmoidParameter, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SigmoidParameter, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(SigmoidParameter)); + SigmoidParameter_Engine_descriptor_ = SigmoidParameter_descriptor_->enum_type(0); + SliceParameter_descriptor_ = file->message_type(50); + 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_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + SliceParameter_descriptor_, + SliceParameter::default_instance_, + SliceParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SliceParameter, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SliceParameter, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(SliceParameter)); + SoftmaxParameter_descriptor_ = file->message_type(51); + static const int SoftmaxParameter_offsets_[2] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SoftmaxParameter, engine_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SoftmaxParameter, axis_), + }; + SoftmaxParameter_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + SoftmaxParameter_descriptor_, + SoftmaxParameter::default_instance_, + SoftmaxParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SoftmaxParameter, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SoftmaxParameter, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(SoftmaxParameter)); + SoftmaxParameter_Engine_descriptor_ = SoftmaxParameter_descriptor_->enum_type(0); + TanHParameter_descriptor_ = file->message_type(52); + static const int TanHParameter_offsets_[1] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TanHParameter, engine_), + }; + TanHParameter_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + TanHParameter_descriptor_, + TanHParameter::default_instance_, + TanHParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TanHParameter, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TanHParameter, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(TanHParameter)); + TanHParameter_Engine_descriptor_ = TanHParameter_descriptor_->enum_type(0); + TileParameter_descriptor_ = file->message_type(53); + static const int TileParameter_offsets_[2] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TileParameter, axis_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TileParameter, tiles_), + }; + TileParameter_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + TileParameter_descriptor_, + TileParameter::default_instance_, + TileParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TileParameter, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TileParameter, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(TileParameter)); + ThresholdParameter_descriptor_ = file->message_type(54); + static const int ThresholdParameter_offsets_[1] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ThresholdParameter, threshold_), + }; + ThresholdParameter_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + ThresholdParameter_descriptor_, + ThresholdParameter::default_instance_, + ThresholdParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ThresholdParameter, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ThresholdParameter, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(ThresholdParameter)); + WindowDataParameter_descriptor_ = file->message_type(55); + 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_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + WindowDataParameter_descriptor_, + WindowDataParameter::default_instance_, + WindowDataParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(WindowDataParameter, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(WindowDataParameter, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(WindowDataParameter)); + SPPParameter_descriptor_ = file->message_type(56); + 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_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + SPPParameter_descriptor_, + SPPParameter::default_instance_, + SPPParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SPPParameter, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SPPParameter, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(SPPParameter)); + SPPParameter_PoolMethod_descriptor_ = SPPParameter_descriptor_->enum_type(0); + SPPParameter_Engine_descriptor_ = SPPParameter_descriptor_->enum_type(1); + V1LayerParameter_descriptor_ = file->message_type(57); + 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_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + V1LayerParameter_descriptor_, + V1LayerParameter::default_instance_, + V1LayerParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V1LayerParameter, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V1LayerParameter, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(V1LayerParameter)); + V1LayerParameter_LayerType_descriptor_ = V1LayerParameter_descriptor_->enum_type(0); + V1LayerParameter_DimCheckMode_descriptor_ = V1LayerParameter_descriptor_->enum_type(1); + V0LayerParameter_descriptor_ = file->message_type(58); + 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_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + V0LayerParameter_descriptor_, + V0LayerParameter::default_instance_, + V0LayerParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V0LayerParameter, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V0LayerParameter, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(V0LayerParameter)); + V0LayerParameter_PoolMethod_descriptor_ = V0LayerParameter_descriptor_->enum_type(0); + PReLUParameter_descriptor_ = file->message_type(59); + 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_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + PReLUParameter_descriptor_, + PReLUParameter::default_instance_, + PReLUParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PReLUParameter, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PReLUParameter, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(PReLUParameter)); + Phase_descriptor_ = file->enum_type(0); +} + +namespace { + +GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_); +inline void protobuf_AssignDescriptorsOnce() { + ::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_, + &protobuf_AssignDesc_ditcaffe_2eproto); +} + +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + BlobShape_descriptor_, &BlobShape::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + BlobProto_descriptor_, &BlobProto::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + BlobProtoVector_descriptor_, &BlobProtoVector::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + Datum_descriptor_, &Datum::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + FillerParameter_descriptor_, &FillerParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + NetParameter_descriptor_, &NetParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + SolverParameter_descriptor_, &SolverParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + SolverState_descriptor_, &SolverState::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + NetState_descriptor_, &NetState::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + NetStateRule_descriptor_, &NetStateRule::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + ParamSpec_descriptor_, &ParamSpec::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + LayerParameter_descriptor_, &LayerParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + TransformationParameter_descriptor_, &TransformationParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + LossParameter_descriptor_, &LossParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + AccuracyParameter_descriptor_, &AccuracyParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + ArgMaxParameter_descriptor_, &ArgMaxParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + ConcatParameter_descriptor_, &ConcatParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + BatchNormParameter_descriptor_, &BatchNormParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + BiasParameter_descriptor_, &BiasParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + ContrastiveLossParameter_descriptor_, &ContrastiveLossParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + ConvolutionParameter_descriptor_, &ConvolutionParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + CropParameter_descriptor_, &CropParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + DataParameter_descriptor_, &DataParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + DropoutParameter_descriptor_, &DropoutParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + DummyDataParameter_descriptor_, &DummyDataParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + EltwiseParameter_descriptor_, &EltwiseParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + ELUParameter_descriptor_, &ELUParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + EmbedParameter_descriptor_, &EmbedParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + ExpParameter_descriptor_, &ExpParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + FlattenParameter_descriptor_, &FlattenParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + HDF5DataParameter_descriptor_, &HDF5DataParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + HDF5OutputParameter_descriptor_, &HDF5OutputParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + HingeLossParameter_descriptor_, &HingeLossParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + ImageDataParameter_descriptor_, &ImageDataParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + InfogainLossParameter_descriptor_, &InfogainLossParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + InnerProductParameter_descriptor_, &InnerProductParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + InputParameter_descriptor_, &InputParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + LogParameter_descriptor_, &LogParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + LRNParameter_descriptor_, &LRNParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + MemoryDataParameter_descriptor_, &MemoryDataParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + MVNParameter_descriptor_, &MVNParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + ParameterParameter_descriptor_, &ParameterParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + PoolingParameter_descriptor_, &PoolingParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + PowerParameter_descriptor_, &PowerParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + PythonParameter_descriptor_, &PythonParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + ReductionParameter_descriptor_, &ReductionParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + ReLUParameter_descriptor_, &ReLUParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + ReshapeParameter_descriptor_, &ReshapeParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + ScaleParameter_descriptor_, &ScaleParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + SigmoidParameter_descriptor_, &SigmoidParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + SliceParameter_descriptor_, &SliceParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + SoftmaxParameter_descriptor_, &SoftmaxParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + TanHParameter_descriptor_, &TanHParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + TileParameter_descriptor_, &TileParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + ThresholdParameter_descriptor_, &ThresholdParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + WindowDataParameter_descriptor_, &WindowDataParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + SPPParameter_descriptor_, &SPPParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + V1LayerParameter_descriptor_, &V1LayerParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + V0LayerParameter_descriptor_, &V0LayerParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + PReLUParameter_descriptor_, &PReLUParameter::default_instance()); +} + +} // namespace + +void protobuf_ShutdownFile_ditcaffe_2eproto() { + delete BlobShape::default_instance_; + delete BlobShape_reflection_; + delete BlobProto::default_instance_; + delete BlobProto_reflection_; + delete BlobProtoVector::default_instance_; + delete BlobProtoVector_reflection_; + delete Datum::default_instance_; + delete Datum_reflection_; + delete FillerParameter::default_instance_; + delete FillerParameter_reflection_; + delete FillerParameter::_default_type_; + delete NetParameter::default_instance_; + delete NetParameter_reflection_; + delete SolverParameter::default_instance_; + delete SolverParameter_reflection_; + delete SolverParameter::_default_regularization_type_; + delete SolverParameter::_default_type_; + delete SolverState::default_instance_; + delete SolverState_reflection_; + delete NetState::default_instance_; + delete NetState_reflection_; + delete NetStateRule::default_instance_; + delete NetStateRule_reflection_; + delete ParamSpec::default_instance_; + delete ParamSpec_reflection_; + delete LayerParameter::default_instance_; + delete LayerParameter_reflection_; + delete TransformationParameter::default_instance_; + delete TransformationParameter_reflection_; + delete LossParameter::default_instance_; + delete LossParameter_reflection_; + delete AccuracyParameter::default_instance_; + delete AccuracyParameter_reflection_; + delete ArgMaxParameter::default_instance_; + delete ArgMaxParameter_reflection_; + delete ConcatParameter::default_instance_; + delete ConcatParameter_reflection_; + delete BatchNormParameter::default_instance_; + delete BatchNormParameter_reflection_; + delete BiasParameter::default_instance_; + delete BiasParameter_reflection_; + delete ContrastiveLossParameter::default_instance_; + delete ContrastiveLossParameter_reflection_; + delete ConvolutionParameter::default_instance_; + delete ConvolutionParameter_reflection_; + delete CropParameter::default_instance_; + delete CropParameter_reflection_; + delete DataParameter::default_instance_; + delete DataParameter_reflection_; + delete DropoutParameter::default_instance_; + delete DropoutParameter_reflection_; + delete DummyDataParameter::default_instance_; + delete DummyDataParameter_reflection_; + delete EltwiseParameter::default_instance_; + delete EltwiseParameter_reflection_; + delete ELUParameter::default_instance_; + delete ELUParameter_reflection_; + delete EmbedParameter::default_instance_; + delete EmbedParameter_reflection_; + delete ExpParameter::default_instance_; + delete ExpParameter_reflection_; + delete FlattenParameter::default_instance_; + delete FlattenParameter_reflection_; + delete HDF5DataParameter::default_instance_; + delete HDF5DataParameter_reflection_; + delete HDF5OutputParameter::default_instance_; + delete HDF5OutputParameter_reflection_; + delete HingeLossParameter::default_instance_; + delete HingeLossParameter_reflection_; + delete ImageDataParameter::default_instance_; + delete ImageDataParameter_reflection_; + delete InfogainLossParameter::default_instance_; + delete InfogainLossParameter_reflection_; + delete InnerProductParameter::default_instance_; + delete InnerProductParameter_reflection_; + delete InputParameter::default_instance_; + delete InputParameter_reflection_; + delete LogParameter::default_instance_; + delete LogParameter_reflection_; + delete LRNParameter::default_instance_; + delete LRNParameter_reflection_; + delete MemoryDataParameter::default_instance_; + delete MemoryDataParameter_reflection_; + delete MVNParameter::default_instance_; + delete MVNParameter_reflection_; + delete ParameterParameter::default_instance_; + delete ParameterParameter_reflection_; + delete PoolingParameter::default_instance_; + delete PoolingParameter_reflection_; + delete PowerParameter::default_instance_; + delete PowerParameter_reflection_; + delete PythonParameter::default_instance_; + delete PythonParameter_reflection_; + delete ReductionParameter::default_instance_; + delete ReductionParameter_reflection_; + delete ReLUParameter::default_instance_; + delete ReLUParameter_reflection_; + delete ReshapeParameter::default_instance_; + delete ReshapeParameter_reflection_; + delete ScaleParameter::default_instance_; + delete ScaleParameter_reflection_; + delete SigmoidParameter::default_instance_; + delete SigmoidParameter_reflection_; + delete SliceParameter::default_instance_; + delete SliceParameter_reflection_; + delete SoftmaxParameter::default_instance_; + delete SoftmaxParameter_reflection_; + delete TanHParameter::default_instance_; + delete TanHParameter_reflection_; + delete TileParameter::default_instance_; + delete TileParameter_reflection_; + delete ThresholdParameter::default_instance_; + delete ThresholdParameter_reflection_; + delete WindowDataParameter::default_instance_; + delete WindowDataParameter_reflection_; + delete WindowDataParameter::_default_crop_mode_; + delete SPPParameter::default_instance_; + delete SPPParameter_reflection_; + delete V1LayerParameter::default_instance_; + delete V1LayerParameter_reflection_; + delete V0LayerParameter::default_instance_; + delete V0LayerParameter_reflection_; + delete V0LayerParameter::_default_det_crop_mode_; + delete PReLUParameter::default_instance_; + delete PReLUParameter_reflection_; +} + +void protobuf_AddDesc_ditcaffe_2eproto() { + static bool already_here = false; + if (already_here) return; + already_here = true; + GOOGLE_PROTOBUF_VERIFY_VERSION; + + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + "\n\016ditcaffe.proto\022\010ditcaffe\"\034\n\tBlobShape\022" + "\017\n\003dim\030\001 \003(\003B\002\020\001\"\375\001\n\tBlobProto\022\"\n\005shape\030" + "\007 \001(\0132\023.ditcaffe.BlobShape\022\020\n\004data\030\005 \003(\002" + "B\002\020\001\022\020\n\004diff\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\025\n\thalf" + "_data\030\n \003(\rB\002\020\001\022\025\n\thalf_diff\030\013 \003(\rB\002\020\001\022\016" + "\n\003num\030\001 \001(\005:\0010\022\023\n\010channels\030\002 \001(\005:\0010\022\021\n\006h" + "eight\030\003 \001(\005:\0010\022\020\n\005width\030\004 \001(\005:\0010\"5\n\017Blob" + "ProtoVector\022\"\n\005blobs\030\001 \003(\0132\023.ditcaffe.Bl" + "obProto\"\201\001\n\005Datum\022\020\n\010channels\030\001 \001(\005\022\016\n\006h" + "eight\030\002 \001(\005\022\r\n\005width\030\003 \001(\005\022\014\n\004data\030\004 \001(\014" + "\022\r\n\005label\030\005 \001(\005\022\022\n\nfloat_data\030\006 \003(\002\022\026\n\007e" + "ncoded\030\007 \001(\010:\005false\"\215\002\n\017FillerParameter\022" + "\026\n\004type\030\001 \001(\t:\010constant\022\020\n\005value\030\002 \001(\002:\001" + "0\022\016\n\003min\030\003 \001(\002:\0010\022\016\n\003max\030\004 \001(\002:\0011\022\017\n\004mea" + "n\030\005 \001(\002:\0010\022\016\n\003std\030\006 \001(\002:\0011\022\022\n\006sparse\030\007 \001" + "(\005:\002-1\022E\n\rvariance_norm\030\010 \001(\0162&.ditcaffe" + ".FillerParameter.VarianceNorm:\006FAN_IN\"4\n" + "\014VarianceNorm\022\n\n\006FAN_IN\020\000\022\013\n\007FAN_OUT\020\001\022\013" + "\n\007AVERAGE\020\002\"\232\002\n\014NetParameter\022\014\n\004name\030\001 \001" + "(\t\022\r\n\005input\030\003 \003(\t\022(\n\013input_shape\030\010 \003(\0132\023" + ".ditcaffe.BlobShape\022\021\n\tinput_dim\030\004 \003(\005\022\035" + "\n\016force_backward\030\005 \001(\010:\005false\022!\n\005state\030\006" + " \001(\0132\022.ditcaffe.NetState\022\031\n\ndebug_info\030\007" + " \001(\010:\005false\022\'\n\005layer\030d \003(\0132\030.ditcaffe.La" + "yerParameter\022*\n\006layers\030\002 \003(\0132\032.ditcaffe." + "V1LayerParameter\"\264\n\n\017SolverParameter\022\013\n\003" + "net\030\030 \001(\t\022)\n\tnet_param\030\031 \001(\0132\026.ditcaffe." + "NetParameter\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\026.dit" + "caffe.NetParameter\022.\n\016test_net_param\030\026 \003" + "(\0132\026.ditcaffe.NetParameter\022\'\n\013train_stat" + "e\030\032 \001(\0132\022.ditcaffe.NetState\022&\n\ntest_stat" + "e\030\033 \003(\0132\022.ditcaffe.NetState\022\021\n\ttest_iter" + "\030\003 \003(\005\022\030\n\rtest_interval\030\004 \001(\005:\0010\022 \n\021test" + "_compute_loss\030\023 \001(\010:\005false\022!\n\023test_initi" + "alization\030 \001(\010:\004true\022\017\n\007base_lr\030\005 \001(\002\022\017" + "\n\007display\030\006 \001(\005\022\027\n\014average_loss\030! \001(\005:\0011" + "\022\020\n\010max_iter\030\007 \001(\005\022\024\n\titer_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\005po" + "wer\030\n \001(\002\022\020\n\010momentum\030\013 \001(\002\022\024\n\014weight_de" + "cay\030\014 \001(\002\022\037\n\023regularization_type\030\035 \001(\t:\002" + "L2\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_prefix\030\017 \001(\t\022\034\n\rsna" + "pshot_diff\030\020 \001(\010:\005false\022N\n\017snapshot_form" + "at\030% \001(\0162(.ditcaffe.SolverParameter.Snap" + "shotFormat:\013BINARYPROTO\022>\n\013solver_mode\030\021" + " \001(\0162$.ditcaffe.SolverParameter.SolverMo" + "de:\003GPU\022\024\n\tdevice_id\030\022 \001(\005:\0010\022\027\n\013random_" + "seed\030\024 \001(\003:\002-1\022\021\n\004type\030( \001(\t:\003SGD\022\024\n\005del" + "ta\030\037 \001(\002:\0051e-08\022\030\n\tmomentum2\030\' \001(\002:\0050.99" + "9\022\021\n\trms_decay\030& \001(\002\022\031\n\ndebug_info\030\027 \001(\010" + ":\005false\022\"\n\024snapshot_after_train\030\034 \001(\010:\004t" + "rue\022>\n\013solver_type\030\036 \001(\0162$.ditcaffe.Solv" + "erParameter.SolverType:\003SGD\"+\n\016SnapshotF" + "ormat\022\010\n\004HDF5\020\000\022\017\n\013BINARYPROTO\020\001\"\036\n\nSolv" + "erMode\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\007ADAGRAD\020\002\022\013\n\007RM" + "SPROP\020\003\022\014\n\010ADADELTA\020\004\022\010\n\004ADAM\020\005\"o\n\013Solve" + "rState\022\014\n\004iter\030\001 \001(\005\022\023\n\013learned_net\030\002 \001(" + "\t\022$\n\007history\030\003 \003(\0132\023.ditcaffe.BlobProto\022" + "\027\n\014current_step\030\004 \001(\005:\0010\"Q\n\010NetState\022$\n\005" + "phase\030\001 \001(\0162\017.ditcaffe.Phase:\004TEST\022\020\n\005le" + "vel\030\002 \001(\005:\0010\022\r\n\005stage\030\003 \003(\t\"v\n\014NetStateR" + "ule\022\036\n\005phase\030\001 \001(\0162\017.ditcaffe.Phase\022\021\n\tm" + "in_level\030\002 \001(\005\022\021\n\tmax_level\030\003 \001(\005\022\r\n\005sta" + "ge\030\004 \003(\t\022\021\n\tnot_stage\030\005 \003(\t\"\246\001\n\tParamSpe" + "c\022\014\n\004name\030\001 \001(\t\0224\n\nshare_mode\030\002 \001(\0162 .di" + "tcaffe.ParamSpec.DimCheckMode\022\022\n\007lr_mult" + "\030\003 \001(\002:\0011\022\025\n\ndecay_mult\030\004 \001(\002:\0011\"*\n\014DimC" + "heckMode\022\n\n\006STRICT\020\000\022\016\n\nPERMISSIVE\020\001\"\346\024\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\036\n\005phas" + "e\030\n \001(\0162\017.ditcaffe.Phase\022\023\n\013loss_weight\030" + "\005 \003(\002\022\"\n\005param\030\006 \003(\0132\023.ditcaffe.ParamSpe" + "c\022\"\n\005blobs\030\007 \003(\0132\023.ditcaffe.BlobProto\022\026\n" + "\016propagate_down\030\013 \003(\010\022\'\n\007include\030\010 \003(\0132\026" + ".ditcaffe.NetStateRule\022\'\n\007exclude\030\t \003(\0132" + "\026.ditcaffe.NetStateRule\022:\n\017transform_par" + "am\030d \001(\0132!.ditcaffe.TransformationParame" + "ter\022+\n\nloss_param\030e \001(\0132\027.ditcaffe.LossP" + "arameter\0223\n\016accuracy_param\030f \001(\0132\033.ditca" + "ffe.AccuracyParameter\022/\n\014argmax_param\030g " + "\001(\0132\031.ditcaffe.ArgMaxParameter\0227\n\020batch_" + "norm_param\030\213\001 \001(\0132\034.ditcaffe.BatchNormPa" + "rameter\022,\n\nbias_param\030\215\001 \001(\0132\027.ditcaffe." + "BiasParameter\022/\n\014concat_param\030h \001(\0132\031.di" + "tcaffe.ConcatParameter\022B\n\026contrastive_lo" + "ss_param\030i \001(\0132\".ditcaffe.ContrastiveLos" + "sParameter\0229\n\021convolution_param\030j \001(\0132\036." + "ditcaffe.ConvolutionParameter\022,\n\ncrop_pa" + "ram\030\220\001 \001(\0132\027.ditcaffe.CropParameter\022+\n\nd" + "ata_param\030k \001(\0132\027.ditcaffe.DataParameter" + "\0221\n\rdropout_param\030l \001(\0132\032.ditcaffe.Dropo" + "utParameter\0226\n\020dummy_data_param\030m \001(\0132\034." + "ditcaffe.DummyDataParameter\0221\n\reltwise_p" + "aram\030n \001(\0132\032.ditcaffe.EltwiseParameter\022*" + "\n\telu_param\030\214\001 \001(\0132\026.ditcaffe.ELUParamet" + "er\022.\n\013embed_param\030\211\001 \001(\0132\030.ditcaffe.Embe" + "dParameter\022)\n\texp_param\030o \001(\0132\026.ditcaffe" + ".ExpParameter\0222\n\rflatten_param\030\207\001 \001(\0132\032." + "ditcaffe.FlattenParameter\0224\n\017hdf5_data_p" + "aram\030p \001(\0132\033.ditcaffe.HDF5DataParameter\022" + "8\n\021hdf5_output_param\030q \001(\0132\035.ditcaffe.HD" + "F5OutputParameter\0226\n\020hinge_loss_param\030r " + "\001(\0132\034.ditcaffe.HingeLossParameter\0226\n\020ima" + "ge_data_param\030s \001(\0132\034.ditcaffe.ImageData" + "Parameter\022<\n\023infogain_loss_param\030t \001(\0132\037" + ".ditcaffe.InfogainLossParameter\022<\n\023inner" + "_product_param\030u \001(\0132\037.ditcaffe.InnerPro" + "ductParameter\022.\n\013input_param\030\217\001 \001(\0132\030.di" + "tcaffe.InputParameter\022*\n\tlog_param\030\206\001 \001(" + "\0132\026.ditcaffe.LogParameter\022)\n\tlrn_param\030v" + " \001(\0132\026.ditcaffe.LRNParameter\0228\n\021memory_d" + "ata_param\030w \001(\0132\035.ditcaffe.MemoryDataPar" + "ameter\022)\n\tmvn_param\030x \001(\0132\026.ditcaffe.MVN" + "Parameter\0226\n\017parameter_param\030\221\001 \001(\0132\034.di" + "tcaffe.ParameterParameter\0221\n\rpooling_par" + "am\030y \001(\0132\032.ditcaffe.PoolingParameter\022-\n\013" + "power_param\030z \001(\0132\030.ditcaffe.PowerParame" + "ter\022.\n\013prelu_param\030\203\001 \001(\0132\030.ditcaffe.PRe" + "LUParameter\0220\n\014python_param\030\202\001 \001(\0132\031.dit" + "caffe.PythonParameter\0226\n\017reduction_param" + "\030\210\001 \001(\0132\034.ditcaffe.ReductionParameter\022+\n" + "\nrelu_param\030{ \001(\0132\027.ditcaffe.ReLUParamet" + "er\0222\n\rreshape_param\030\205\001 \001(\0132\032.ditcaffe.Re" + "shapeParameter\022.\n\013scale_param\030\216\001 \001(\0132\030.d" + "itcaffe.ScaleParameter\0221\n\rsigmoid_param\030" + "| \001(\0132\032.ditcaffe.SigmoidParameter\0221\n\rsof" + "tmax_param\030} \001(\0132\032.ditcaffe.SoftmaxParam" + "eter\022*\n\tspp_param\030\204\001 \001(\0132\026.ditcaffe.SPPP" + "arameter\022-\n\013slice_param\030~ \001(\0132\030.ditcaffe" + ".SliceParameter\022+\n\ntanh_param\030\177 \001(\0132\027.di" + "tcaffe.TanHParameter\0226\n\017threshold_param\030" + "\200\001 \001(\0132\034.ditcaffe.ThresholdParameter\022,\n\n" + "tile_param\030\212\001 \001(\0132\027.ditcaffe.TileParamet" + "er\0229\n\021window_data_param\030\201\001 \001(\0132\035.ditcaff" + "e.WindowDataParameter\"\266\001\n\027Transformation" + "Parameter\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\tmean" + "_file\030\004 \001(\t\022\022\n\nmean_value\030\005 \003(\002\022\032\n\013force" + "_color\030\006 \001(\010:\005false\022\031\n\nforce_gray\030\007 \001(\010:" + "\005false\"\305\001\n\rLossParameter\022\024\n\014ignore_label" + "\030\001 \001(\005\022G\n\rnormalization\030\003 \001(\0162).ditcaffe" + ".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\004" + "NONE\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\022BatchNormParam" + "eter\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(" + "\0132\031.ditcaffe.FillerParameter\"L\n\030Contrast" + "iveLossParameter\022\021\n\006margin\030\001 \001(\002:\0011\022\035\n\016l" + "egacy_version\030\002 \001(\010:\005false\"\205\004\n\024Convoluti" + "onParameter\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\010kernel_h\030\013 \001(\r\022\020\n\010kernel_w\030\014 \001(\r\022\020\n\010" + "stride_h\030\r \001(\r\022\020\n\010stride_w\030\016 \001(\r\022\020\n\005grou" + "p\030\005 \001(\r:\0011\0220\n\rweight_filler\030\007 \001(\0132\031.ditc" + "affe.FillerParameter\022.\n\013bias_filler\030\010 \001(" + "\0132\031.ditcaffe.FillerParameter\022>\n\006engine\030\017" + " \001(\0162%.ditcaffe.ConvolutionParameter.Eng" + "ine:\007DEFAULT\022\017\n\004axis\030\020 \001(\005:\0011\022\036\n\017force_n" + "d_im2col\030\021 \001(\010:\005false\"+\n\006Engine\022\013\n\007DEFAU" + "LT\020\000\022\t\n\005CAFFE\020\001\022\t\n\005CUDNN\020\002\"0\n\rCropParame" + "ter\022\017\n\004axis\030\001 \001(\005:\0012\022\016\n\006offset\030\002 \003(\r\"\247\002\n" + "\rDataParameter\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\0224\n\007back" + "end\030\010 \001(\0162\032.ditcaffe.DataParameter.DB:\007L" + "EVELDB\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\023force_encoded_color\030\t \001(\010:\005f" + "alse\022\023\n\010prefetch\030\n \001(\r:\0014\"\033\n\002DB\022\013\n\007LEVEL" + "DB\020\000\022\010\n\004LMDB\020\001\".\n\020DropoutParameter\022\032\n\rdr" + "opout_ratio\030\001 \001(\002:\0030.5\"\246\001\n\022DummyDataPara" + "meter\022.\n\013data_filler\030\001 \003(\0132\031.ditcaffe.Fi" + "llerParameter\022\"\n\005shape\030\006 \003(\0132\023.ditcaffe." + "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\"\250\001\n\020Eltw" + "iseParameter\022<\n\toperation\030\001 \001(\0162$.ditcaf" + "fe.EltwiseParameter.EltwiseOp:\003SUM\022\r\n\005co" + "eff\030\002 \003(\002\022\036\n\020stable_prod_grad\030\003 \001(\010:\004tru" + "e\"\'\n\tEltwiseOp\022\010\n\004PROD\020\000\022\007\n\003SUM\020\001\022\007\n\003MAX" + "\020\002\" \n\014ELUParameter\022\020\n\005alpha\030\001 \001(\002:\0011\"\262\001\n" + "\016EmbedParameter\022\022\n\nnum_output\030\001 \001(\r\022\021\n\ti" + "nput_dim\030\002 \001(\r\022\027\n\tbias_term\030\003 \001(\010:\004true\022" + "0\n\rweight_filler\030\004 \001(\0132\031.ditcaffe.Filler" + "Parameter\022.\n\013bias_filler\030\005 \001(\0132\031.ditcaff" + "e.FillerParameter\"D\n\014ExpParameter\022\020\n\004bas" + "e\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\021HDF5DataPa" + "rameter\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\023HDF5Outpu" + "tParameter\022\021\n\tfile_name\030\001 \001(\t\"a\n\022HingeLo" + "ssParameter\0223\n\004norm\030\001 \001(\0162!.ditcaffe.Hin" + "geLossParameter.Norm:\002L1\"\026\n\004Norm\022\006\n\002L1\020\001" + "\022\006\n\002L2\020\002\"\227\002\n\022ImageDataParameter\022\016\n\006sourc" + "e\030\001 \001(\t\022\025\n\nbatch_size\030\004 \001(\r:\0011\022\024\n\trand_s" + "kip\030\007 \001(\r:\0010\022\026\n\007shuffle\030\010 \001(\010:\005false\022\025\n\n" + "new_height\030\t \001(\r:\0010\022\024\n\tnew_width\030\n \001(\r:\001" + "0\022\026\n\010is_color\030\013 \001(\010:\004true\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\025\n\013root_fold" + "er\030\014 \001(\t:\000\"\'\n\025InfogainLossParameter\022\016\n\006s" + "ource\030\001 \001(\t\"\321\001\n\025InnerProductParameter\022\022\n" + "\nnum_output\030\001 \001(\r\022\027\n\tbias_term\030\002 \001(\010:\004tr" + "ue\0220\n\rweight_filler\030\003 \001(\0132\031.ditcaffe.Fil" + "lerParameter\022.\n\013bias_filler\030\004 \001(\0132\031.ditc" + "affe.FillerParameter\022\017\n\004axis\030\005 \001(\005:\0011\022\030\n" + "\ttranspose\030\006 \001(\010:\005false\"4\n\016InputParamete" + "r\022\"\n\005shape\030\001 \003(\0132\023.ditcaffe.BlobShape\"D\n" + "\014LogParameter\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\"\276\002\n\014LRNParam" + "eter\022\025\n\nlocal_size\030\001 \001(\r:\0015\022\020\n\005alpha\030\002 \001" + "(\002:\0011\022\022\n\004beta\030\003 \001(\002:\0040.75\022G\n\013norm_region" + "\030\004 \001(\0162!.ditcaffe.LRNParameter.NormRegio" + "n:\017ACROSS_CHANNELS\022\014\n\001k\030\005 \001(\002:\0011\0226\n\006engi" + "ne\030\006 \001(\0162\035.ditcaffe.LRNParameter.Engine:" + "\007DEFAULT\"5\n\nNormRegion\022\023\n\017ACROSS_CHANNEL" + "S\020\000\022\022\n\016WITHIN_CHANNEL\020\001\"+\n\006Engine\022\013\n\007DEF" + "AULT\020\000\022\t\n\005CAFFE\020\001\022\t\n\005CUDNN\020\002\"Z\n\023MemoryDa" + "taParameter\022\022\n\nbatch_size\030\001 \001(\r\022\020\n\010chann" + "els\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\022normalize_variance\030\001" + " \001(\010:\004true\022\036\n\017across_channels\030\002 \001(\010:\005fal" + "se\022\022\n\003eps\030\003 \001(\002:\0051e-09\"8\n\022ParameterParam" + "eter\022\"\n\005shape\030\001 \001(\0132\023.ditcaffe.BlobShape" + "\"\306\003\n\020PoolingParameter\0228\n\004pool\030\001 \001(\0162%.di" + "tcaffe.PoolingParameter.PoolMethod:\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\010kern" + "el_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\010stride_w\030\010 " + "\001(\r\022:\n\006engine\030\013 \001(\0162!.ditcaffe.PoolingPa" + "rameter.Engine:\007DEFAULT\022\035\n\016global_poolin" + "g\030\014 \001(\010:\005false\022\034\n\rtorch_pooling\030( \001(\010:\005f" + "alse\".\n\nPoolMethod\022\007\n\003MAX\020\000\022\007\n\003AVE\020\001\022\016\n\n" + "STOCHASTIC\020\002\"+\n\006Engine\022\013\n\007DEFAULT\020\000\022\t\n\005C" + "AFFE\020\001\022\t\n\005CUDNN\020\002\"F\n\016PowerParameter\022\020\n\005p" + "ower\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\017PythonParameter\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\"\260\001\n\022R" + "eductionParameter\022@\n\toperation\030\001 \001(\0162(.d" + "itcaffe.ReductionParameter.ReductionOp:\003" + "SUM\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\005SUMS" + "Q\020\003\022\010\n\004MEAN\020\004\"\220\001\n\rReLUParameter\022\031\n\016negat" + "ive_slope\030\001 \001(\002:\0010\0227\n\006engine\030\002 \001(\0162\036.dit" + "caffe.ReLUParameter.Engine:\007DEFAULT\"+\n\006E" + "ngine\022\013\n\007DEFAULT\020\000\022\t\n\005CAFFE\020\001\022\t\n\005CUDNN\020\002" + "\"]\n\020ReshapeParameter\022\"\n\005shape\030\001 \001(\0132\023.di" + "tcaffe.BlobShape\022\017\n\004axis\030\002 \001(\005:\0010\022\024\n\010num" + "_axes\030\003 \001(\005:\002-1\"\253\001\n\016ScaleParameter\022\017\n\004ax" + "is\030\001 \001(\005:\0011\022\023\n\010num_axes\030\002 \001(\005:\0011\022)\n\006fill" + "er\030\003 \001(\0132\031.ditcaffe.FillerParameter\022\030\n\tb" + "ias_term\030\004 \001(\010:\005false\022.\n\013bias_filler\030\005 \001" + "(\0132\031.ditcaffe.FillerParameter\"{\n\020Sigmoid" + "Parameter\022:\n\006engine\030\001 \001(\0162!.ditcaffe.Sig" + "moidParameter.Engine:\007DEFAULT\"+\n\006Engine\022" + "\013\n\007DEFAULT\020\000\022\t\n\005CAFFE\020\001\022\t\n\005CUDNN\020\002\"L\n\016Sl" + "iceParameter\022\017\n\004axis\030\003 \001(\005:\0011\022\023\n\013slice_p" + "oint\030\002 \003(\r\022\024\n\tslice_dim\030\001 \001(\r:\0011\"\214\001\n\020Sof" + "tmaxParameter\022:\n\006engine\030\001 \001(\0162!.ditcaffe" + ".SoftmaxParameter.Engine:\007DEFAULT\022\017\n\004axi" + "s\030\002 \001(\005:\0011\"+\n\006Engine\022\013\n\007DEFAULT\020\000\022\t\n\005CAF" + "FE\020\001\022\t\n\005CUDNN\020\002\"u\n\rTanHParameter\0227\n\006engi" + "ne\030\001 \001(\0162\036.ditcaffe.TanHParameter.Engine" + ":\007DEFAULT\"+\n\006Engine\022\013\n\007DEFAULT\020\000\022\t\n\005CAFF" + "E\020\001\022\t\n\005CUDNN\020\002\"/\n\rTileParameter\022\017\n\004axis\030" + "\001 \001(\005:\0011\022\r\n\005tiles\030\002 \001(\005\"*\n\022ThresholdPara" + "meter\022\024\n\tthreshold\030\001 \001(\002:\0010\"\301\002\n\023WindowDa" + "taParameter\022\016\n\006source\030\001 \001(\t\022\020\n\005scale\030\002 \001" + "(\002:\0011\022\021\n\tmean_file\030\003 \001(\t\022\022\n\nbatch_size\030\004" + " \001(\r\022\024\n\tcrop_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\014" + "bg_threshold\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\tcr" + "op_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\"\361\001\n\014SPPP" + "arameter\022\026\n\016pyramid_height\030\001 \001(\r\0224\n\004pool" + "\030\002 \001(\0162!.ditcaffe.SPPParameter.PoolMetho" + "d:\003MAX\0226\n\006engine\030\006 \001(\0162\035.ditcaffe.SPPPar" + "ameter.Engine:\007DEFAULT\".\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\"\314\024\n\020" + "V1LayerParameter\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\026.d" + "itcaffe.NetStateRule\022\'\n\007exclude\030! \003(\0132\026." + "ditcaffe.NetStateRule\0222\n\004type\030\005 \001(\0162$.di" + "tcaffe.V1LayerParameter.LayerType\022\"\n\005blo" + "bs\030\006 \003(\0132\023.ditcaffe.BlobProto\022\016\n\005param\030\351" + "\007 \003(\t\022A\n\017blob_share_mode\030\352\007 \003(\0162\'.ditcaf" + "fe.V1LayerParameter.DimCheckMode\022\020\n\010blob" + "s_lr\030\007 \003(\002\022\024\n\014weight_decay\030\010 \003(\002\022\023\n\013loss" + "_weight\030# \003(\002\0223\n\016accuracy_param\030\033 \001(\0132\033." + "ditcaffe.AccuracyParameter\022/\n\014argmax_par" + "am\030\027 \001(\0132\031.ditcaffe.ArgMaxParameter\022/\n\014c" + "oncat_param\030\t \001(\0132\031.ditcaffe.ConcatParam" + "eter\022B\n\026contrastive_loss_param\030( \001(\0132\".d" + "itcaffe.ContrastiveLossParameter\0229\n\021conv" + "olution_param\030\n \001(\0132\036.ditcaffe.Convoluti" + "onParameter\022+\n\ndata_param\030\013 \001(\0132\027.ditcaf" + "fe.DataParameter\0221\n\rdropout_param\030\014 \001(\0132" + "\032.ditcaffe.DropoutParameter\0226\n\020dummy_dat" + "a_param\030\032 \001(\0132\034.ditcaffe.DummyDataParame" + "ter\0221\n\reltwise_param\030\030 \001(\0132\032.ditcaffe.El" + "twiseParameter\022)\n\texp_param\030) \001(\0132\026.ditc" + "affe.ExpParameter\0224\n\017hdf5_data_param\030\r \001" + "(\0132\033.ditcaffe.HDF5DataParameter\0228\n\021hdf5_" + "output_param\030\016 \001(\0132\035.ditcaffe.HDF5Output" + "Parameter\0226\n\020hinge_loss_param\030\035 \001(\0132\034.di" + "tcaffe.HingeLossParameter\0226\n\020image_data_" + "param\030\017 \001(\0132\034.ditcaffe.ImageDataParamete" + "r\022<\n\023infogain_loss_param\030\020 \001(\0132\037.ditcaff" + "e.InfogainLossParameter\022<\n\023inner_product" + "_param\030\021 \001(\0132\037.ditcaffe.InnerProductPara" + "meter\022)\n\tlrn_param\030\022 \001(\0132\026.ditcaffe.LRNP" + "arameter\0228\n\021memory_data_param\030\026 \001(\0132\035.di" + "tcaffe.MemoryDataParameter\022)\n\tmvn_param\030" + "\" \001(\0132\026.ditcaffe.MVNParameter\0221\n\rpooling" + "_param\030\023 \001(\0132\032.ditcaffe.PoolingParameter" + "\022-\n\013power_param\030\025 \001(\0132\030.ditcaffe.PowerPa" + "rameter\022+\n\nrelu_param\030\036 \001(\0132\027.ditcaffe.R" + "eLUParameter\0221\n\rsigmoid_param\030& \001(\0132\032.di" + "tcaffe.SigmoidParameter\0221\n\rsoftmax_param" + "\030\' \001(\0132\032.ditcaffe.SoftmaxParameter\022-\n\013sl" + "ice_param\030\037 \001(\0132\030.ditcaffe.SliceParamete" + "r\022+\n\ntanh_param\030% \001(\0132\027.ditcaffe.TanHPar" + "ameter\0225\n\017threshold_param\030\031 \001(\0132\034.ditcaf" + "fe.ThresholdParameter\0228\n\021window_data_par" + "am\030\024 \001(\0132\035.ditcaffe.WindowDataParameter\022" + ":\n\017transform_param\030$ \001(\0132!.ditcaffe.Tran" + "sformationParameter\022+\n\nloss_param\030* \001(\0132" + "\027.ditcaffe.LossParameter\022)\n\005layer\030\001 \001(\0132" + "\032.ditcaffe.V0LayerParameter\"\330\004\n\tLayerTyp" + "e\022\010\n\004NONE\020\000\022\n\n\006ABSVAL\020#\022\014\n\010ACCURACY\020\001\022\n\n" + "\006ARGMAX\020\036\022\010\n\004BNLL\020\002\022\n\n\006CONCAT\020\003\022\024\n\020CONTR" + "ASTIVE_LOSS\020%\022\017\n\013CONVOLUTION\020\004\022\010\n\004DATA\020\005" + "\022\021\n\rDECONVOLUTION\020\'\022\013\n\007DROPOUT\020\006\022\016\n\nDUMM" + "Y_DATA\020 \022\022\n\016EUCLIDEAN_LOSS\020\007\022\013\n\007ELTWISE\020" + "\031\022\007\n\003EXP\020&\022\013\n\007FLATTEN\020\010\022\r\n\tHDF5_DATA\020\t\022\017" + "\n\013HDF5_OUTPUT\020\n\022\016\n\nHINGE_LOSS\020\034\022\n\n\006IM2CO" + "L\020\013\022\016\n\nIMAGE_DATA\020\014\022\021\n\rINFOGAIN_LOSS\020\r\022\021" + "\n\rINNER_PRODUCT\020\016\022\007\n\003LRN\020\017\022\017\n\013MEMORY_DAT" + "A\020\035\022\035\n\031MULTINOMIAL_LOGISTIC_LOSS\020\020\022\007\n\003MV" + "N\020\"\022\013\n\007POOLING\020\021\022\t\n\005POWER\020\032\022\010\n\004RELU\020\022\022\013\n" + "\007SIGMOID\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\013WINDOW_DATA\020\030\022\r\n\tTHRESHOLD\020\037\"*\n\014DimChe" + "ckMode\022\n\n\006STRICT\020\000\022\016\n\nPERMISSIVE\020\001\"\214\010\n\020V" + "0LayerParameter\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:\004true\0220\n\rweight_filler\030\005 \001(\0132\031.ditcaff" + "e.FillerParameter\022.\n\013bias_filler\030\006 \001(\0132\031" + ".ditcaffe.FillerParameter\022\016\n\003pad\030\007 \001(\r:\001" + "0\022\022\n\nkernelsize\030\010 \001(\r\022\020\n\005group\030\t \001(\r:\0011\022" + "\021\n\006stride\030\n \001(\r:\0011\0228\n\004pool\030\013 \001(\0162%.ditca" + "ffe.V0LayerParameter.PoolMethod:\003MAX\022\032\n\r" + "dropout_ratio\030\014 \001(\002:\0030.5\022\025\n\nlocal_size\030\r" + " \001(\r:\0015\022\020\n\005alpha\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\005s" + "cale\030\021 \001(\002:\0011\022\020\n\010meanfile\030\022 \001(\t\022\021\n\tbatch" + "size\030\023 \001(\r\022\023\n\010cropsize\030\024 \001(\r:\0010\022\025\n\006mirro" + "r\030\025 \001(\010:\005false\022\"\n\005blobs\0302 \003(\0132\023.ditcaffe" + ".BlobProto\022\020\n\010blobs_lr\0303 \003(\002\022\024\n\014weight_d" + "ecay\0304 \003(\002\022\024\n\trand_skip\0305 \001(\r:\0010\022\035\n\020det_" + "fg_threshold\0306 \001(\002:\0030.5\022\035\n\020det_bg_thresh" + "old\0307 \001(\002:\0030.5\022\035\n\017det_fg_fraction\0308 \001(\002:" + "\0040.25\022\032\n\017det_context_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_channels\030= \001(\005:\0010\022\025\n\nnew_heigh" + "t\030> \001(\005:\0010\022\024\n\tnew_width\030\? \001(\005:\0010\022\035\n\016shuf" + "fle_images\030@ \001(\010:\005false\022\025\n\nconcat_dim\030A " + "\001(\r:\0011\0229\n\021hdf5_output_param\030\351\007 \001(\0132\035.dit" + "caffe.HDF5OutputParameter\".\n\nPoolMethod\022" + "\007\n\003MAX\020\000\022\007\n\003AVE\020\001\022\016\n\nSTOCHASTIC\020\002\"Z\n\016PRe" + "LUParameter\022)\n\006filler\030\001 \001(\0132\031.ditcaffe.F" + "illerParameter\022\035\n\016channel_shared\030\002 \001(\010:\005" + "false*\034\n\005Phase\022\t\n\005TRAIN\020\000\022\010\n\004TEST\020\001", 15635); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "ditcaffe.proto", &protobuf_RegisterTypes); + BlobShape::default_instance_ = new BlobShape(); + BlobProto::default_instance_ = new BlobProto(); + BlobProtoVector::default_instance_ = new BlobProtoVector(); + Datum::default_instance_ = new Datum(); + FillerParameter::_default_type_ = + new ::std::string("constant", 8); + FillerParameter::default_instance_ = new FillerParameter(); + NetParameter::default_instance_ = new NetParameter(); + SolverParameter::_default_regularization_type_ = + new ::std::string("L2", 2); + SolverParameter::_default_type_ = + new ::std::string("SGD", 3); + SolverParameter::default_instance_ = new SolverParameter(); + SolverState::default_instance_ = new SolverState(); + NetState::default_instance_ = new NetState(); + NetStateRule::default_instance_ = new NetStateRule(); + ParamSpec::default_instance_ = new ParamSpec(); + LayerParameter::default_instance_ = new LayerParameter(); + TransformationParameter::default_instance_ = new TransformationParameter(); + LossParameter::default_instance_ = new LossParameter(); + AccuracyParameter::default_instance_ = new AccuracyParameter(); + ArgMaxParameter::default_instance_ = new ArgMaxParameter(); + ConcatParameter::default_instance_ = new ConcatParameter(); + BatchNormParameter::default_instance_ = new BatchNormParameter(); + BiasParameter::default_instance_ = new BiasParameter(); + ContrastiveLossParameter::default_instance_ = new ContrastiveLossParameter(); + ConvolutionParameter::default_instance_ = new ConvolutionParameter(); + CropParameter::default_instance_ = new CropParameter(); + DataParameter::default_instance_ = new DataParameter(); + DropoutParameter::default_instance_ = new DropoutParameter(); + DummyDataParameter::default_instance_ = new DummyDataParameter(); + EltwiseParameter::default_instance_ = new EltwiseParameter(); + ELUParameter::default_instance_ = new ELUParameter(); + EmbedParameter::default_instance_ = new EmbedParameter(); + ExpParameter::default_instance_ = new ExpParameter(); + FlattenParameter::default_instance_ = new FlattenParameter(); + HDF5DataParameter::default_instance_ = new HDF5DataParameter(); + HDF5OutputParameter::default_instance_ = new HDF5OutputParameter(); + HingeLossParameter::default_instance_ = new HingeLossParameter(); + ImageDataParameter::default_instance_ = new ImageDataParameter(); + InfogainLossParameter::default_instance_ = new InfogainLossParameter(); + InnerProductParameter::default_instance_ = new InnerProductParameter(); + InputParameter::default_instance_ = new InputParameter(); + LogParameter::default_instance_ = new LogParameter(); + LRNParameter::default_instance_ = new LRNParameter(); + MemoryDataParameter::default_instance_ = new MemoryDataParameter(); + MVNParameter::default_instance_ = new MVNParameter(); + ParameterParameter::default_instance_ = new ParameterParameter(); + PoolingParameter::default_instance_ = new PoolingParameter(); + PowerParameter::default_instance_ = new PowerParameter(); + PythonParameter::default_instance_ = new PythonParameter(); + ReductionParameter::default_instance_ = new ReductionParameter(); + ReLUParameter::default_instance_ = new ReLUParameter(); + ReshapeParameter::default_instance_ = new ReshapeParameter(); + ScaleParameter::default_instance_ = new ScaleParameter(); + SigmoidParameter::default_instance_ = new SigmoidParameter(); + SliceParameter::default_instance_ = new SliceParameter(); + SoftmaxParameter::default_instance_ = new SoftmaxParameter(); + TanHParameter::default_instance_ = new TanHParameter(); + TileParameter::default_instance_ = new TileParameter(); + ThresholdParameter::default_instance_ = new ThresholdParameter(); + WindowDataParameter::_default_crop_mode_ = + new ::std::string("warp", 4); + WindowDataParameter::default_instance_ = new WindowDataParameter(); + SPPParameter::default_instance_ = new SPPParameter(); + V1LayerParameter::default_instance_ = new V1LayerParameter(); + V0LayerParameter::_default_det_crop_mode_ = + new ::std::string("warp", 4); + V0LayerParameter::default_instance_ = new V0LayerParameter(); + PReLUParameter::default_instance_ = new PReLUParameter(); + BlobShape::default_instance_->InitAsDefaultInstance(); + BlobProto::default_instance_->InitAsDefaultInstance(); + BlobProtoVector::default_instance_->InitAsDefaultInstance(); + Datum::default_instance_->InitAsDefaultInstance(); + FillerParameter::default_instance_->InitAsDefaultInstance(); + NetParameter::default_instance_->InitAsDefaultInstance(); + SolverParameter::default_instance_->InitAsDefaultInstance(); + SolverState::default_instance_->InitAsDefaultInstance(); + NetState::default_instance_->InitAsDefaultInstance(); + NetStateRule::default_instance_->InitAsDefaultInstance(); + ParamSpec::default_instance_->InitAsDefaultInstance(); + LayerParameter::default_instance_->InitAsDefaultInstance(); + TransformationParameter::default_instance_->InitAsDefaultInstance(); + LossParameter::default_instance_->InitAsDefaultInstance(); + AccuracyParameter::default_instance_->InitAsDefaultInstance(); + ArgMaxParameter::default_instance_->InitAsDefaultInstance(); + ConcatParameter::default_instance_->InitAsDefaultInstance(); + BatchNormParameter::default_instance_->InitAsDefaultInstance(); + BiasParameter::default_instance_->InitAsDefaultInstance(); + ContrastiveLossParameter::default_instance_->InitAsDefaultInstance(); + ConvolutionParameter::default_instance_->InitAsDefaultInstance(); + CropParameter::default_instance_->InitAsDefaultInstance(); + DataParameter::default_instance_->InitAsDefaultInstance(); + DropoutParameter::default_instance_->InitAsDefaultInstance(); + DummyDataParameter::default_instance_->InitAsDefaultInstance(); + EltwiseParameter::default_instance_->InitAsDefaultInstance(); + ELUParameter::default_instance_->InitAsDefaultInstance(); + EmbedParameter::default_instance_->InitAsDefaultInstance(); + ExpParameter::default_instance_->InitAsDefaultInstance(); + FlattenParameter::default_instance_->InitAsDefaultInstance(); + HDF5DataParameter::default_instance_->InitAsDefaultInstance(); + HDF5OutputParameter::default_instance_->InitAsDefaultInstance(); + HingeLossParameter::default_instance_->InitAsDefaultInstance(); + ImageDataParameter::default_instance_->InitAsDefaultInstance(); + InfogainLossParameter::default_instance_->InitAsDefaultInstance(); + InnerProductParameter::default_instance_->InitAsDefaultInstance(); + InputParameter::default_instance_->InitAsDefaultInstance(); + LogParameter::default_instance_->InitAsDefaultInstance(); + LRNParameter::default_instance_->InitAsDefaultInstance(); + MemoryDataParameter::default_instance_->InitAsDefaultInstance(); + MVNParameter::default_instance_->InitAsDefaultInstance(); + ParameterParameter::default_instance_->InitAsDefaultInstance(); + PoolingParameter::default_instance_->InitAsDefaultInstance(); + PowerParameter::default_instance_->InitAsDefaultInstance(); + PythonParameter::default_instance_->InitAsDefaultInstance(); + ReductionParameter::default_instance_->InitAsDefaultInstance(); + ReLUParameter::default_instance_->InitAsDefaultInstance(); + ReshapeParameter::default_instance_->InitAsDefaultInstance(); + ScaleParameter::default_instance_->InitAsDefaultInstance(); + SigmoidParameter::default_instance_->InitAsDefaultInstance(); + SliceParameter::default_instance_->InitAsDefaultInstance(); + SoftmaxParameter::default_instance_->InitAsDefaultInstance(); + TanHParameter::default_instance_->InitAsDefaultInstance(); + TileParameter::default_instance_->InitAsDefaultInstance(); + ThresholdParameter::default_instance_->InitAsDefaultInstance(); + WindowDataParameter::default_instance_->InitAsDefaultInstance(); + SPPParameter::default_instance_->InitAsDefaultInstance(); + V1LayerParameter::default_instance_->InitAsDefaultInstance(); + V0LayerParameter::default_instance_->InitAsDefaultInstance(); + PReLUParameter::default_instance_->InitAsDefaultInstance(); + ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_ditcaffe_2eproto); +} + +// Force AddDescriptors() to be called at static initialization time. +struct StaticDescriptorInitializer_ditcaffe_2eproto { + StaticDescriptorInitializer_ditcaffe_2eproto() { + protobuf_AddDesc_ditcaffe_2eproto(); + } +} static_descriptor_initializer_ditcaffe_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; + } +} + + +// =================================================================== + +#ifndef _MSC_VER +const int BlobShape::kDimFieldNumber; +#endif // !_MSC_VER + +BlobShape::BlobShape() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.BlobShape) +} + +void BlobShape::InitAsDefaultInstance() { +} + +BlobShape::BlobShape(const BlobShape& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.BlobShape) +} + +void BlobShape::SharedCtor() { + _cached_size_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +BlobShape::~BlobShape() { + // @@protoc_insertion_point(destructor:ditcaffe.BlobShape) + SharedDtor(); +} + +void BlobShape::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +BlobShape* BlobShape::default_instance_ = NULL; + +BlobShape* BlobShape::New() const { + return new BlobShape; +} + +void BlobShape::Clear() { + dim_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool BlobShape::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:ditcaffe.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:ditcaffe.BlobShape) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.BlobShape) + return false; +#undef DO_ +} + +void BlobShape::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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 (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:ditcaffe.BlobShape) +} + +::google::protobuf::uint8* BlobShape::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.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 (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.BlobShape) + return target; +} + +int BlobShape::ByteSize() const { + int total_size = 0; + + // repeated int64 dim = 1 [packed = true]; + { + int data_size = 0; + for (int i = 0; i < this->dim_size(); 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); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _dim_cached_byte_size_ = data_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void BlobShape::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const BlobShape* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void BlobShape::MergeFrom(const BlobShape& from) { + GOOGLE_CHECK_NE(&from, this); + dim_.MergeFrom(from.dim_); + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void BlobShape::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void BlobShape::CopyFrom(const BlobShape& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool BlobShape::IsInitialized() const { + + return true; +} + +void BlobShape::Swap(BlobShape* other) { + if (other != this) { + dim_.Swap(&other->dim_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + 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; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int BlobProto::kShapeFieldNumber; +const int BlobProto::kDataFieldNumber; +const int BlobProto::kDiffFieldNumber; +const int BlobProto::kDoubleDataFieldNumber; +const int BlobProto::kDoubleDiffFieldNumber; +const int BlobProto::kHalfDataFieldNumber; +const int BlobProto::kHalfDiffFieldNumber; +const int BlobProto::kNumFieldNumber; +const int BlobProto::kChannelsFieldNumber; +const int BlobProto::kHeightFieldNumber; +const int BlobProto::kWidthFieldNumber; +#endif // !_MSC_VER + +BlobProto::BlobProto() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.BlobProto) +} + +void BlobProto::InitAsDefaultInstance() { + shape_ = const_cast< ::ditcaffe::BlobShape*>(&::ditcaffe::BlobShape::default_instance()); +} + +BlobProto::BlobProto(const BlobProto& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.BlobProto) +} + +void BlobProto::SharedCtor() { + _cached_size_ = 0; + shape_ = NULL; + num_ = 0; + channels_ = 0; + height_ = 0; + width_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +BlobProto::~BlobProto() { + // @@protoc_insertion_point(destructor:ditcaffe.BlobProto) + SharedDtor(); +} + +void BlobProto::SharedDtor() { + if (this != default_instance_) { + 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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +BlobProto* BlobProto::default_instance_ = NULL; + +BlobProto* BlobProto::New() const { + return new BlobProto; +} + +void BlobProto::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 129) { + if (has_shape()) { + if (shape_ != NULL) shape_->::ditcaffe::BlobShape::Clear(); + } + num_ = 0; + } + ZR_(channels_, width_); + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + data_.Clear(); + diff_.Clear(); + double_data_.Clear(); + double_diff_.Clear(); + half_data_.Clear(); + half_diff_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool BlobProto::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &num_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &channels_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &height_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &width_))); + set_has_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 .ditcaffe.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->ExpectTag(82)) goto parse_half_data; + break; + } + + // repeated uint32 half_data = 10 [packed = true]; + case 10: { + if (tag == 82) { + parse_half_data: + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, this->mutable_half_data()))); + } else if (tag == 80) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + 1, 82, input, this->mutable_half_data()))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(90)) goto parse_half_diff; + break; + } + + // repeated uint32 half_diff = 11 [packed = true]; + case 11: { + if (tag == 90) { + parse_half_diff: + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, this->mutable_half_diff()))); + } else if (tag == 88) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + 1, 90, input, this->mutable_half_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:ditcaffe.BlobProto) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.BlobProto) + return false; +#undef DO_ +} + +void BlobProto::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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 .ditcaffe.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); + } + + // repeated uint32 half_data = 10 [packed = true]; + if (this->half_data_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(10, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(_half_data_cached_byte_size_); + } + for (int i = 0; i < this->half_data_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32NoTag( + this->half_data(i), output); + } + + // repeated uint32 half_diff = 11 [packed = true]; + if (this->half_diff_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(11, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(_half_diff_cached_byte_size_); + } + for (int i = 0; i < this->half_diff_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32NoTag( + this->half_diff(i), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:ditcaffe.BlobProto) +} + +::google::protobuf::uint8* BlobProto::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.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 .ditcaffe.BlobShape shape = 7; + if (has_shape()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 7, this->shape(), 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); + } + + // repeated uint32 half_data = 10 [packed = true]; + if (this->half_data_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 10, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + _half_data_cached_byte_size_, target); + } + for (int i = 0; i < this->half_data_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteUInt32NoTagToArray(this->half_data(i), target); + } + + // repeated uint32 half_diff = 11 [packed = true]; + if (this->half_diff_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 11, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + _half_diff_cached_byte_size_, target); + } + for (int i = 0; i < this->half_diff_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteUInt32NoTagToArray(this->half_diff(i), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.BlobProto) + return target; +} + +int BlobProto::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional .ditcaffe.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()); + } + + } + if (_has_bits_[8 / 32] & (0xffu << (8 % 32))) { + // 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]; + { + int data_size = 0; + data_size = 4 * this->data_size(); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _data_cached_byte_size_ = data_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated float diff = 6 [packed = true]; + { + int data_size = 0; + data_size = 4 * this->diff_size(); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _diff_cached_byte_size_ = data_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated double double_data = 8 [packed = true]; + { + int data_size = 0; + data_size = 8 * this->double_data_size(); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _double_data_cached_byte_size_ = data_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated double double_diff = 9 [packed = true]; + { + int data_size = 0; + data_size = 8 * this->double_diff_size(); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _double_diff_cached_byte_size_ = data_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated uint32 half_data = 10 [packed = true]; + { + int data_size = 0; + for (int i = 0; i < this->half_data_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->half_data(i)); + } + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _half_data_cached_byte_size_ = data_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated uint32 half_diff = 11 [packed = true]; + { + int data_size = 0; + for (int i = 0; i < this->half_diff_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->half_diff(i)); + } + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _half_diff_cached_byte_size_ = data_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void BlobProto::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const BlobProto* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void BlobProto::MergeFrom(const BlobProto& from) { + GOOGLE_CHECK_NE(&from, this); + data_.MergeFrom(from.data_); + diff_.MergeFrom(from.diff_); + double_data_.MergeFrom(from.double_data_); + double_diff_.MergeFrom(from.double_diff_); + half_data_.MergeFrom(from.half_data_); + half_diff_.MergeFrom(from.half_diff_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_shape()) { + mutable_shape()->::ditcaffe::BlobShape::MergeFrom(from.shape()); + } + if (from.has_num()) { + set_num(from.num()); + } + } + if (from._has_bits_[8 / 32] & (0xffu << (8 % 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()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void BlobProto::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void BlobProto::CopyFrom(const BlobProto& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool BlobProto::IsInitialized() const { + + return true; +} + +void BlobProto::Swap(BlobProto* other) { + if (other != this) { + std::swap(shape_, other->shape_); + data_.Swap(&other->data_); + diff_.Swap(&other->diff_); + double_data_.Swap(&other->double_data_); + double_diff_.Swap(&other->double_diff_); + half_data_.Swap(&other->half_data_); + half_diff_.Swap(&other->half_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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + 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; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int BlobProtoVector::kBlobsFieldNumber; +#endif // !_MSC_VER + +BlobProtoVector::BlobProtoVector() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.BlobProtoVector) +} + +void BlobProtoVector::InitAsDefaultInstance() { +} + +BlobProtoVector::BlobProtoVector(const BlobProtoVector& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.BlobProtoVector) +} + +void BlobProtoVector::SharedCtor() { + _cached_size_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +BlobProtoVector::~BlobProtoVector() { + // @@protoc_insertion_point(destructor:ditcaffe.BlobProtoVector) + SharedDtor(); +} + +void BlobProtoVector::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +BlobProtoVector* BlobProtoVector::default_instance_ = NULL; + +BlobProtoVector* BlobProtoVector::New() const { + return new BlobProtoVector; +} + +void BlobProtoVector::Clear() { + blobs_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool BlobProtoVector::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:ditcaffe.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 .ditcaffe.BlobProto blobs = 1; + case 1: { + if (tag == 10) { + parse_blobs: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_blobs())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(10)) goto parse_blobs; + 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:ditcaffe.BlobProtoVector) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.BlobProtoVector) + return false; +#undef DO_ +} + +void BlobProtoVector::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.BlobProtoVector) + // repeated .ditcaffe.BlobProto blobs = 1; + for (int i = 0; i < this->blobs_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->blobs(i), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:ditcaffe.BlobProtoVector) +} + +::google::protobuf::uint8* BlobProtoVector::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.BlobProtoVector) + // repeated .ditcaffe.BlobProto blobs = 1; + for (int i = 0; i < this->blobs_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 1, this->blobs(i), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.BlobProtoVector) + return target; +} + +int BlobProtoVector::ByteSize() const { + int total_size = 0; + + // repeated .ditcaffe.BlobProto blobs = 1; + total_size += 1 * this->blobs_size(); + for (int i = 0; i < this->blobs_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->blobs(i)); + } + + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void BlobProtoVector::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const BlobProtoVector* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void BlobProtoVector::MergeFrom(const BlobProtoVector& from) { + GOOGLE_CHECK_NE(&from, this); + blobs_.MergeFrom(from.blobs_); + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void BlobProtoVector::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void BlobProtoVector::CopyFrom(const BlobProtoVector& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool BlobProtoVector::IsInitialized() const { + + return true; +} + +void BlobProtoVector::Swap(BlobProtoVector* other) { + if (other != this) { + blobs_.Swap(&other->blobs_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + 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; +} + + +// =================================================================== + +#ifndef _MSC_VER +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 // !_MSC_VER + +Datum::Datum() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.Datum) +} + +void Datum::InitAsDefaultInstance() { +} + +Datum::Datum(const Datum& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.Datum) +} + +void Datum::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + channels_ = 0; + height_ = 0; + width_ = 0; + data_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + label_ = 0; + encoded_ = false; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +Datum::~Datum() { + // @@protoc_insertion_point(destructor:ditcaffe.Datum) + SharedDtor(); +} + +void Datum::SharedDtor() { + if (data_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete data_; + } + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +Datum* Datum::default_instance_ = NULL; + +Datum* Datum::New() const { + return new Datum; +} + +void Datum::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 95) { + ZR_(channels_, height_); + ZR_(width_, label_); + if (has_data()) { + if (data_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + data_->clear(); + } + } + encoded_ = false; + } + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + float_data_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool Datum::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &channels_))); + set_has_channels(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_height; + break; + } + + // optional int32 height = 2; + case 2: { + if (tag == 16) { + parse_height: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &height_))); + set_has_height(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(24)) goto parse_width; + break; + } + + // optional int32 width = 3; + case 3: { + if (tag == 24) { + parse_width: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &width_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &label_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &encoded_))); + set_has_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:ditcaffe.Datum) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.Datum) + return false; +#undef DO_ +} + +void Datum::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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 (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:ditcaffe.Datum) +} + +::google::protobuf::uint8* Datum::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.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 (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.Datum) + return target; +} + +int Datum::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // 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; + { + int data_size = 0; + data_size = 4 * this->float_data_size(); + total_size += 1 * this->float_data_size() + data_size; + } + + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void Datum::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const Datum* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void Datum::MergeFrom(const Datum& from) { + GOOGLE_CHECK_NE(&from, this); + float_data_.MergeFrom(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_data(from.data()); + } + if (from.has_label()) { + set_label(from.label()); + } + if (from.has_encoded()) { + set_encoded(from.encoded()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void Datum::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Datum::CopyFrom(const Datum& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Datum::IsInitialized() const { + + return true; +} + +void Datum::Swap(Datum* other) { + if (other != this) { + std::swap(channels_, other->channels_); + std::swap(height_, other->height_); + std::swap(width_, other->width_); + std::swap(data_, other->data_); + std::swap(label_, other->label_); + float_data_.Swap(&other->float_data_); + std::swap(encoded_, other->encoded_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + 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; +} + + +// =================================================================== + +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; + } +} + +#ifndef _MSC_VER +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 // _MSC_VER +::std::string* FillerParameter::_default_type_ = NULL; +#ifndef _MSC_VER +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 // !_MSC_VER + +FillerParameter::FillerParameter() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.FillerParameter) +} + +void FillerParameter::InitAsDefaultInstance() { +} + +FillerParameter::FillerParameter(const FillerParameter& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.FillerParameter) +} + +void FillerParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + type_ = const_cast< ::std::string*>(_default_type_); + value_ = 0; + min_ = 0; + max_ = 1; + mean_ = 0; + std_ = 1; + sparse_ = -1; + variance_norm_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +FillerParameter::~FillerParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.FillerParameter) + SharedDtor(); +} + +void FillerParameter::SharedDtor() { + if (type_ != _default_type_) { + delete type_; + } + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +FillerParameter* FillerParameter::default_instance_ = NULL; + +FillerParameter* FillerParameter::New() const { + return new FillerParameter; +} + +void FillerParameter::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 255) { + ZR_(value_, min_); + if (has_type()) { + if (type_ != _default_type_) { + type_->assign(*_default_type_); + } + } + max_ = 1; + mean_ = 0; + std_ = 1; + sparse_ = -1; + variance_norm_ = 0; + } + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool FillerParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:ditcaffe.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, + "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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &value_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &min_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &max_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &mean_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &std_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &sparse_))); + set_has_sparse(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(64)) goto parse_variance_norm; + break; + } + + // optional .ditcaffe.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 (::ditcaffe::FillerParameter_VarianceNorm_IsValid(value)) { + set_variance_norm(static_cast< ::ditcaffe::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:ditcaffe.FillerParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.FillerParameter) + return false; +#undef DO_ +} + +void FillerParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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, + "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 .ditcaffe.FillerParameter.VarianceNorm variance_norm = 8 [default = FAN_IN]; + if (has_variance_norm()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 8, this->variance_norm(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:ditcaffe.FillerParameter) +} + +::google::protobuf::uint8* FillerParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.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, + "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 .ditcaffe.FillerParameter.VarianceNorm variance_norm = 8 [default = FAN_IN]; + if (has_variance_norm()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 8, this->variance_norm(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.FillerParameter) + return target; +} + +int FillerParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // 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 .ditcaffe.FillerParameter.VarianceNorm variance_norm = 8 [default = FAN_IN]; + if (has_variance_norm()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->variance_norm()); + } + + } + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void FillerParameter::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const FillerParameter* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void FillerParameter::MergeFrom(const FillerParameter& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_type()) { + set_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()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void FillerParameter::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void FillerParameter::CopyFrom(const FillerParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool FillerParameter::IsInitialized() const { + + return true; +} + +void FillerParameter::Swap(FillerParameter* other) { + if (other != this) { + std::swap(type_, 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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + 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; +} + + +// =================================================================== + +#ifndef _MSC_VER +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 // !_MSC_VER + +NetParameter::NetParameter() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.NetParameter) +} + +void NetParameter::InitAsDefaultInstance() { + state_ = const_cast< ::ditcaffe::NetState*>(&::ditcaffe::NetState::default_instance()); +} + +NetParameter::NetParameter(const NetParameter& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.NetParameter) +} + +void NetParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + force_backward_ = false; + state_ = NULL; + debug_info_ = false; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +NetParameter::~NetParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.NetParameter) + SharedDtor(); +} + +void NetParameter::SharedDtor() { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete name_; + } + if (this != default_instance_) { + 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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +NetParameter* NetParameter::default_instance_ = NULL; + +NetParameter* NetParameter::New() const { + return new NetParameter; +} + +void NetParameter::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 113) { + ZR_(force_backward_, debug_info_); + if (has_name()) { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_->clear(); + } + } + if (has_state()) { + if (state_ != NULL) state_->::ditcaffe::NetState::Clear(); + } + } + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + input_.Clear(); + input_shape_.Clear(); + input_dim_.Clear(); + layer_.Clear(); + layers_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool NetParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:ditcaffe.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, + "name"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_layers; + break; + } + + // repeated .ditcaffe.V1LayerParameter layers = 2; + case 2: { + if (tag == 18) { + parse_layers: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_layers())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_layers; + 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, + "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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &force_backward_))); + set_has_force_backward(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(50)) goto parse_state; + break; + } + + // optional .ditcaffe.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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &debug_info_))); + set_has_debug_info(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(66)) goto parse_input_shape; + break; + } + + // repeated .ditcaffe.BlobShape input_shape = 8; + case 8: { + if (tag == 66) { + parse_input_shape: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_input_shape())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(66)) goto parse_input_shape; + if (input->ExpectTag(802)) goto parse_layer; + break; + } + + // repeated .ditcaffe.LayerParameter layer = 100; + case 100: { + if (tag == 802) { + parse_layer: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_layer())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(802)) goto parse_layer; + 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:ditcaffe.NetParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.NetParameter) + return false; +#undef DO_ +} + +void NetParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.NetParameter) + // optional string name = 1; + if (has_name()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // repeated .ditcaffe.V1LayerParameter layers = 2; + for (int i = 0; i < this->layers_size(); 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, + "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 .ditcaffe.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 .ditcaffe.BlobShape input_shape = 8; + for (int i = 0; i < this->input_shape_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 8, this->input_shape(i), output); + } + + // repeated .ditcaffe.LayerParameter layer = 100; + for (int i = 0; i < this->layer_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 100, this->layer(i), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:ditcaffe.NetParameter) +} + +::google::protobuf::uint8* NetParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.NetParameter) + // optional string name = 1; + if (has_name()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->name(), target); + } + + // repeated .ditcaffe.V1LayerParameter layers = 2; + for (int i = 0; i < this->layers_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 2, this->layers(i), 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, + "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 .ditcaffe.NetState state = 6; + if (has_state()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 6, this->state(), target); + } + + // optional bool debug_info = 7 [default = false]; + if (has_debug_info()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(7, this->debug_info(), target); + } + + // repeated .ditcaffe.BlobShape input_shape = 8; + for (int i = 0; i < this->input_shape_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 8, this->input_shape(i), target); + } + + // repeated .ditcaffe.LayerParameter layer = 100; + for (int i = 0; i < this->layer_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 100, this->layer(i), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.NetParameter) + return target; +} + +int NetParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // 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 .ditcaffe.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 * this->input_size(); + for (int i = 0; i < this->input_size(); i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->input(i)); + } + + // repeated .ditcaffe.BlobShape input_shape = 8; + total_size += 1 * this->input_shape_size(); + for (int i = 0; i < this->input_shape_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->input_shape(i)); + } + + // repeated int32 input_dim = 4; + { + int data_size = 0; + for (int i = 0; i < this->input_dim_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + Int32Size(this->input_dim(i)); + } + total_size += 1 * this->input_dim_size() + data_size; + } + + // repeated .ditcaffe.LayerParameter layer = 100; + total_size += 2 * this->layer_size(); + for (int i = 0; i < this->layer_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->layer(i)); + } + + // repeated .ditcaffe.V1LayerParameter layers = 2; + total_size += 1 * this->layers_size(); + for (int i = 0; i < this->layers_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->layers(i)); + } + + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void NetParameter::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const NetParameter* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void NetParameter::MergeFrom(const NetParameter& from) { + GOOGLE_CHECK_NE(&from, this); + input_.MergeFrom(from.input_); + input_shape_.MergeFrom(from.input_shape_); + input_dim_.MergeFrom(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_name(from.name()); + } + if (from.has_force_backward()) { + set_force_backward(from.force_backward()); + } + if (from.has_state()) { + mutable_state()->::ditcaffe::NetState::MergeFrom(from.state()); + } + if (from.has_debug_info()) { + set_debug_info(from.debug_info()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void NetParameter::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void NetParameter::CopyFrom(const NetParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool NetParameter::IsInitialized() const { + + return true; +} + +void NetParameter::Swap(NetParameter* other) { + if (other != this) { + std::swap(name_, other->name_); + input_.Swap(&other->input_); + input_shape_.Swap(&other->input_shape_); + input_dim_.Swap(&other->input_dim_); + std::swap(force_backward_, other->force_backward_); + std::swap(state_, other->state_); + std::swap(debug_info_, other->debug_info_); + layer_.Swap(&other->layer_); + layers_.Swap(&other->layers_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + 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; +} + + +// =================================================================== + +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; + } +} + +#ifndef _MSC_VER +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 // _MSC_VER +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; + } +} + +#ifndef _MSC_VER +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 // _MSC_VER +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; + } +} + +#ifndef _MSC_VER +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 // _MSC_VER +::std::string* SolverParameter::_default_regularization_type_ = NULL; +::std::string* SolverParameter::_default_type_ = NULL; +#ifndef _MSC_VER +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 // !_MSC_VER + +SolverParameter::SolverParameter() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.SolverParameter) +} + +void SolverParameter::InitAsDefaultInstance() { + net_param_ = const_cast< ::ditcaffe::NetParameter*>(&::ditcaffe::NetParameter::default_instance()); + train_net_param_ = const_cast< ::ditcaffe::NetParameter*>(&::ditcaffe::NetParameter::default_instance()); + train_state_ = const_cast< ::ditcaffe::NetState*>(&::ditcaffe::NetState::default_instance()); +} + +SolverParameter::SolverParameter(const SolverParameter& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.SolverParameter) +} + +void SolverParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + net_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + net_param_ = NULL; + train_net_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + train_net_param_ = NULL; + train_state_ = NULL; + test_interval_ = 0; + test_compute_loss_ = false; + test_initialization_ = true; + base_lr_ = 0; + display_ = 0; + average_loss_ = 1; + max_iter_ = 0; + iter_size_ = 1; + lr_policy_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + gamma_ = 0; + power_ = 0; + momentum_ = 0; + weight_decay_ = 0; + regularization_type_ = const_cast< ::std::string*>(_default_regularization_type_); + stepsize_ = 0; + clip_gradients_ = -1; + snapshot_ = 0; + snapshot_prefix_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + snapshot_diff_ = false; + snapshot_format_ = 1; + solver_mode_ = 1; + device_id_ = 0; + random_seed_ = GOOGLE_LONGLONG(-1); + type_ = const_cast< ::std::string*>(_default_type_); + delta_ = 1e-08f; + momentum2_ = 0.999f; + rms_decay_ = 0; + debug_info_ = false; + snapshot_after_train_ = true; + solver_type_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +SolverParameter::~SolverParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.SolverParameter) + SharedDtor(); +} + +void SolverParameter::SharedDtor() { + if (net_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete net_; + } + if (train_net_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete train_net_; + } + if (lr_policy_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete lr_policy_; + } + if (regularization_type_ != _default_regularization_type_) { + delete regularization_type_; + } + if (snapshot_prefix_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete snapshot_prefix_; + } + if (type_ != _default_type_) { + delete type_; + } + if (this != default_instance_) { + 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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +SolverParameter* SolverParameter::default_instance_ = NULL; + +SolverParameter* SolverParameter::New() const { + return new SolverParameter; +} + +void SolverParameter::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 87) { + if (has_net()) { + if (net_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + net_->clear(); + } + } + if (has_net_param()) { + if (net_param_ != NULL) net_param_->::ditcaffe::NetParameter::Clear(); + } + if (has_train_net()) { + if (train_net_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + train_net_->clear(); + } + } + if (has_train_net_param()) { + if (train_net_param_ != NULL) train_net_param_->::ditcaffe::NetParameter::Clear(); + } + if (has_train_state()) { + if (train_state_ != NULL) train_state_->::ditcaffe::NetState::Clear(); + } + } + if (_has_bits_[8 / 32] & 65024) { + ZR_(test_interval_, display_); + test_compute_loss_ = false; + test_initialization_ = true; + average_loss_ = 1; + max_iter_ = 0; + } + if (_has_bits_[16 / 32] & 16711680) { + ZR_(gamma_, weight_decay_); + iter_size_ = 1; + if (has_lr_policy()) { + if (lr_policy_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + lr_policy_->clear(); + } + } + if (has_regularization_type()) { + if (regularization_type_ != _default_regularization_type_) { + regularization_type_->assign(*_default_regularization_type_); + } + } + stepsize_ = 0; + } + // In-place patch to suppress error: this decimal constant is unsigned only in ISO C90 + if (_has_bits_[24 / 32] & /*4261412864*/ 0xFE000000) { + clip_gradients_ = -1; + snapshot_ = 0; + if (has_snapshot_prefix()) { + if (snapshot_prefix_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + snapshot_prefix_->clear(); + } + } + snapshot_diff_ = false; + snapshot_format_ = 1; + solver_mode_ = 1; + device_id_ = 0; + } + if (_has_bits_[32 / 32] & 255) { + random_seed_ = GOOGLE_LONGLONG(-1); + if (has_type()) { + if (type_ != _default_type_) { + type_->assign(*_default_type_); + } + } + delta_ = 1e-08f; + momentum2_ = 0.999f; + rms_decay_ = 0; + debug_info_ = false; + snapshot_after_train_ = true; + solver_type_ = 0; + } + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + test_net_.Clear(); + test_net_param_.Clear(); + test_state_.Clear(); + test_iter_.Clear(); + stepvalue_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool SolverParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:ditcaffe.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, + "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, + "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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &test_interval_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &base_lr_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &display_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &max_iter_))); + set_has_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, + "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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &gamma_))); + set_has_gamma(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(85)) goto parse_power; + break; + } + + // optional float power = 10; + case 10: { + if (tag == 85) { + parse_power: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &power_))); + set_has_power(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(93)) goto parse_momentum; + break; + } + + // optional float momentum = 11; + case 11: { + if (tag == 93) { + parse_momentum: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &momentum_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &weight_decay_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &stepsize_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &snapshot_))); + set_has_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, + "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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &snapshot_diff_))); + set_has_snapshot_diff(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(136)) goto parse_solver_mode; + break; + } + + // optional .ditcaffe.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 (::ditcaffe::SolverParameter_SolverMode_IsValid(value)) { + set_solver_mode(static_cast< ::ditcaffe::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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &device_id_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &test_compute_loss_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &random_seed_))); + set_has_random_seed(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(170)) goto parse_train_net_param; + break; + } + + // optional .ditcaffe.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 .ditcaffe.NetParameter test_net_param = 22; + case 22: { + if (tag == 178) { + parse_test_net_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_test_net_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(178)) goto parse_test_net_param; + if (input->ExpectTag(184)) goto parse_debug_info; + break; + } + + // optional bool debug_info = 23 [default = false]; + case 23: { + if (tag == 184) { + parse_debug_info: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &debug_info_))); + set_has_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, + "net"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(202)) goto parse_net_param; + break; + } + + // optional .ditcaffe.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 .ditcaffe.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 .ditcaffe.NetState test_state = 27; + case 27: { + if (tag == 218) { + parse_test_state: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_test_state())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(218)) goto parse_test_state; + 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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &snapshot_after_train_))); + set_has_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, + "regularization_type"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(240)) goto parse_solver_type; + break; + } + + // optional .ditcaffe.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 (::ditcaffe::SolverParameter_SolverType_IsValid(value)) { + set_solver_type(static_cast< ::ditcaffe::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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &delta_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &test_initialization_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &average_loss_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &clip_gradients_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &iter_size_))); + set_has_iter_size(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(296)) goto parse_snapshot_format; + break; + } + + // optional .ditcaffe.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 (::ditcaffe::SolverParameter_SnapshotFormat_IsValid(value)) { + set_snapshot_format(static_cast< ::ditcaffe::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; + case 38: { + if (tag == 309) { + parse_rms_decay: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &rms_decay_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &momentum2_))); + set_has_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, + "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:ditcaffe.SolverParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.SolverParameter) + return false; +#undef DO_ +} + +void SolverParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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, + "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, + "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, + "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, + "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 .ditcaffe.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 .ditcaffe.NetParameter train_net_param = 21; + if (has_train_net_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 21, this->train_net_param(), output); + } + + // repeated .ditcaffe.NetParameter test_net_param = 22; + for (int i = 0; i < this->test_net_param_size(); 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, + "net"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 24, this->net(), output); + } + + // optional .ditcaffe.NetParameter net_param = 25; + if (has_net_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 25, this->net_param(), output); + } + + // optional .ditcaffe.NetState train_state = 26; + if (has_train_state()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 26, this->train_state(), output); + } + + // repeated .ditcaffe.NetState test_state = 27; + for (int i = 0; i < this->test_state_size(); 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, + "regularization_type"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 29, this->regularization_type(), output); + } + + // optional .ditcaffe.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 .ditcaffe.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; + 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, + "type"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 40, this->type(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:ditcaffe.SolverParameter) +} + +::google::protobuf::uint8* SolverParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.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, + "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, + "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, + "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, + "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 .ditcaffe.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 .ditcaffe.NetParameter train_net_param = 21; + if (has_train_net_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 21, this->train_net_param(), target); + } + + // repeated .ditcaffe.NetParameter test_net_param = 22; + for (int i = 0; i < this->test_net_param_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 22, this->test_net_param(i), 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, + "net"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 24, this->net(), target); + } + + // optional .ditcaffe.NetParameter net_param = 25; + if (has_net_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 25, this->net_param(), target); + } + + // optional .ditcaffe.NetState train_state = 26; + if (has_train_state()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 26, this->train_state(), target); + } + + // repeated .ditcaffe.NetState test_state = 27; + for (int i = 0; i < this->test_state_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 27, this->test_state(i), 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, + "regularization_type"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 29, this->regularization_type(), target); + } + + // optional .ditcaffe.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 .ditcaffe.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; + 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, + "type"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 40, this->type(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.SolverParameter) + return target; +} + +int SolverParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional string net = 24; + if (has_net()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->net()); + } + + // optional .ditcaffe.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 .ditcaffe.NetParameter train_net_param = 21; + if (has_train_net_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->train_net_param()); + } + + // optional .ditcaffe.NetState train_state = 26; + if (has_train_state()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->train_state()); + } + + } + if (_has_bits_[9 / 32] & (0xffu << (9 % 32))) { + // 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] & (0xffu << (16 % 32))) { + // 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] & (0xffu << (25 % 32))) { + // 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 .ditcaffe.SolverParameter.SnapshotFormat snapshot_format = 37 [default = BINARYPROTO]; + if (has_snapshot_format()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->snapshot_format()); + } + + // optional .ditcaffe.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] & (0xffu << (32 % 32))) { + // 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; + 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 .ditcaffe.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 * 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 .ditcaffe.NetParameter test_net_param = 22; + total_size += 2 * this->test_net_param_size(); + for (int i = 0; i < this->test_net_param_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->test_net_param(i)); + } + + // repeated .ditcaffe.NetState test_state = 27; + total_size += 2 * this->test_state_size(); + for (int i = 0; i < this->test_state_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->test_state(i)); + } + + // repeated int32 test_iter = 3; + { + int data_size = 0; + for (int i = 0; i < this->test_iter_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + Int32Size(this->test_iter(i)); + } + total_size += 1 * this->test_iter_size() + data_size; + } + + // repeated int32 stepvalue = 34; + { + int data_size = 0; + for (int i = 0; i < this->stepvalue_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + Int32Size(this->stepvalue(i)); + } + total_size += 2 * this->stepvalue_size() + data_size; + } + + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void SolverParameter::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const SolverParameter* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void SolverParameter::MergeFrom(const SolverParameter& from) { + GOOGLE_CHECK_NE(&from, this); + test_net_.MergeFrom(from.test_net_); + test_net_param_.MergeFrom(from.test_net_param_); + test_state_.MergeFrom(from.test_state_); + test_iter_.MergeFrom(from.test_iter_); + stepvalue_.MergeFrom(from.stepvalue_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_net()) { + set_net(from.net()); + } + if (from.has_net_param()) { + mutable_net_param()->::ditcaffe::NetParameter::MergeFrom(from.net_param()); + } + if (from.has_train_net()) { + set_train_net(from.train_net()); + } + if (from.has_train_net_param()) { + mutable_train_net_param()->::ditcaffe::NetParameter::MergeFrom(from.train_net_param()); + } + if (from.has_train_state()) { + mutable_train_state()->::ditcaffe::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_lr_policy(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_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_snapshot_prefix(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_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()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void SolverParameter::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void SolverParameter::CopyFrom(const SolverParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool SolverParameter::IsInitialized() const { + + return true; +} + +void SolverParameter::Swap(SolverParameter* other) { + if (other != this) { + std::swap(net_, other->net_); + std::swap(net_param_, other->net_param_); + std::swap(train_net_, other->train_net_); + test_net_.Swap(&other->test_net_); + std::swap(train_net_param_, other->train_net_param_); + test_net_param_.Swap(&other->test_net_param_); + std::swap(train_state_, other->train_state_); + test_state_.Swap(&other->test_state_); + test_iter_.Swap(&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_); + std::swap(lr_policy_, 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_); + std::swap(regularization_type_, other->regularization_type_); + std::swap(stepsize_, other->stepsize_); + stepvalue_.Swap(&other->stepvalue_); + std::swap(clip_gradients_, other->clip_gradients_); + std::swap(snapshot_, other->snapshot_); + std::swap(snapshot_prefix_, 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_); + std::swap(type_, 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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + 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; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int SolverState::kIterFieldNumber; +const int SolverState::kLearnedNetFieldNumber; +const int SolverState::kHistoryFieldNumber; +const int SolverState::kCurrentStepFieldNumber; +#endif // !_MSC_VER + +SolverState::SolverState() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.SolverState) +} + +void SolverState::InitAsDefaultInstance() { +} + +SolverState::SolverState(const SolverState& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.SolverState) +} + +void SolverState::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + iter_ = 0; + learned_net_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + current_step_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +SolverState::~SolverState() { + // @@protoc_insertion_point(destructor:ditcaffe.SolverState) + SharedDtor(); +} + +void SolverState::SharedDtor() { + if (learned_net_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete learned_net_; + } + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +SolverState* SolverState::default_instance_ = NULL; + +SolverState* SolverState::New() const { + return new SolverState; +} + +void SolverState::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 11) { + ZR_(iter_, current_step_); + if (has_learned_net()) { + if (learned_net_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + learned_net_->clear(); + } + } + } + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + history_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool SolverState::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &iter_))); + set_has_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, + "learned_net"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_history; + break; + } + + // repeated .ditcaffe.BlobProto history = 3; + case 3: { + if (tag == 26) { + parse_history: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_history())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_history; + if (input->ExpectTag(32)) goto parse_current_step; + break; + } + + // optional int32 current_step = 4 [default = 0]; + case 4: { + if (tag == 32) { + parse_current_step: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, ¤t_step_))); + set_has_current_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:ditcaffe.SolverState) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.SolverState) + return false; +#undef DO_ +} + +void SolverState::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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, + "learned_net"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->learned_net(), output); + } + + // repeated .ditcaffe.BlobProto history = 3; + for (int i = 0; i < this->history_size(); 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 (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:ditcaffe.SolverState) +} + +::google::protobuf::uint8* SolverState::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.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, + "learned_net"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->learned_net(), target); + } + + // repeated .ditcaffe.BlobProto history = 3; + for (int i = 0; i < this->history_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 3, this->history(i), target); + } + + // optional int32 current_step = 4 [default = 0]; + if (has_current_step()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(4, this->current_step(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.SolverState) + return target; +} + +int SolverState::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // 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 .ditcaffe.BlobProto history = 3; + total_size += 1 * this->history_size(); + for (int i = 0; i < this->history_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->history(i)); + } + + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void SolverState::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const SolverState* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void SolverState::MergeFrom(const SolverState& from) { + GOOGLE_CHECK_NE(&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_learned_net(from.learned_net()); + } + if (from.has_current_step()) { + set_current_step(from.current_step()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void SolverState::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void SolverState::CopyFrom(const SolverState& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool SolverState::IsInitialized() const { + + return true; +} + +void SolverState::Swap(SolverState* other) { + if (other != this) { + std::swap(iter_, other->iter_); + std::swap(learned_net_, other->learned_net_); + history_.Swap(&other->history_); + std::swap(current_step_, other->current_step_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + 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; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int NetState::kPhaseFieldNumber; +const int NetState::kLevelFieldNumber; +const int NetState::kStageFieldNumber; +#endif // !_MSC_VER + +NetState::NetState() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.NetState) +} + +void NetState::InitAsDefaultInstance() { +} + +NetState::NetState(const NetState& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.NetState) +} + +void NetState::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + phase_ = 1; + level_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +NetState::~NetState() { + // @@protoc_insertion_point(destructor:ditcaffe.NetState) + SharedDtor(); +} + +void NetState::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +NetState* NetState::default_instance_ = NULL; + +NetState* NetState::New() const { + return new NetState; +} + +void NetState::Clear() { + if (_has_bits_[0 / 32] & 3) { + phase_ = 1; + level_ = 0; + } + stage_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool NetState::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:ditcaffe.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 .ditcaffe.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 (::ditcaffe::Phase_IsValid(value)) { + set_phase(static_cast< ::ditcaffe::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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &level_))); + set_has_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, + "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:ditcaffe.NetState) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.NetState) + return false; +#undef DO_ +} + +void NetState::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.NetState) + // optional .ditcaffe.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, + "stage"); + ::google::protobuf::internal::WireFormatLite::WriteString( + 3, this->stage(i), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:ditcaffe.NetState) +} + +::google::protobuf::uint8* NetState::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.NetState) + // optional .ditcaffe.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, + "stage"); + target = ::google::protobuf::internal::WireFormatLite:: + WriteStringToArray(3, this->stage(i), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.NetState) + return target; +} + +int NetState::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional .ditcaffe.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 * this->stage_size(); + for (int i = 0; i < this->stage_size(); i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->stage(i)); + } + + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void NetState::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const NetState* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void NetState::MergeFrom(const NetState& from) { + GOOGLE_CHECK_NE(&from, this); + stage_.MergeFrom(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()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void NetState::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void NetState::CopyFrom(const NetState& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool NetState::IsInitialized() const { + + return true; +} + +void NetState::Swap(NetState* other) { + if (other != this) { + std::swap(phase_, other->phase_); + std::swap(level_, other->level_); + stage_.Swap(&other->stage_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + 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; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int NetStateRule::kPhaseFieldNumber; +const int NetStateRule::kMinLevelFieldNumber; +const int NetStateRule::kMaxLevelFieldNumber; +const int NetStateRule::kStageFieldNumber; +const int NetStateRule::kNotStageFieldNumber; +#endif // !_MSC_VER + +NetStateRule::NetStateRule() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.NetStateRule) +} + +void NetStateRule::InitAsDefaultInstance() { +} + +NetStateRule::NetStateRule(const NetStateRule& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.NetStateRule) +} + +void NetStateRule::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + phase_ = 0; + min_level_ = 0; + max_level_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +NetStateRule::~NetStateRule() { + // @@protoc_insertion_point(destructor:ditcaffe.NetStateRule) + SharedDtor(); +} + +void NetStateRule::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +NetStateRule* NetStateRule::default_instance_ = NULL; + +NetStateRule* NetStateRule::New() const { + return new NetStateRule; +} + +void NetStateRule::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 7) { + ZR_(phase_, min_level_); + max_level_ = 0; + } + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + stage_.Clear(); + not_stage_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool NetStateRule::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:ditcaffe.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 .ditcaffe.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 (::ditcaffe::Phase_IsValid(value)) { + set_phase(static_cast< ::ditcaffe::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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &min_level_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &max_level_))); + set_has_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, + "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, + "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:ditcaffe.NetStateRule) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.NetStateRule) + return false; +#undef DO_ +} + +void NetStateRule::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.NetStateRule) + // optional .ditcaffe.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, + "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, + "not_stage"); + ::google::protobuf::internal::WireFormatLite::WriteString( + 5, this->not_stage(i), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:ditcaffe.NetStateRule) +} + +::google::protobuf::uint8* NetStateRule::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.NetStateRule) + // optional .ditcaffe.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, + "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, + "not_stage"); + target = ::google::protobuf::internal::WireFormatLite:: + WriteStringToArray(5, this->not_stage(i), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.NetStateRule) + return target; +} + +int NetStateRule::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional .ditcaffe.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 * 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 * 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 (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void NetStateRule::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const NetStateRule* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void NetStateRule::MergeFrom(const NetStateRule& from) { + GOOGLE_CHECK_NE(&from, this); + stage_.MergeFrom(from.stage_); + not_stage_.MergeFrom(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()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void NetStateRule::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void NetStateRule::CopyFrom(const NetStateRule& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool NetStateRule::IsInitialized() const { + + return true; +} + +void NetStateRule::Swap(NetStateRule* other) { + if (other != this) { + std::swap(phase_, other->phase_); + std::swap(min_level_, other->min_level_); + std::swap(max_level_, other->max_level_); + stage_.Swap(&other->stage_); + not_stage_.Swap(&other->not_stage_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + 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; +} + + +// =================================================================== + +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; + } +} + +#ifndef _MSC_VER +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 // _MSC_VER +#ifndef _MSC_VER +const int ParamSpec::kNameFieldNumber; +const int ParamSpec::kShareModeFieldNumber; +const int ParamSpec::kLrMultFieldNumber; +const int ParamSpec::kDecayMultFieldNumber; +#endif // !_MSC_VER + +ParamSpec::ParamSpec() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.ParamSpec) +} + +void ParamSpec::InitAsDefaultInstance() { +} + +ParamSpec::ParamSpec(const ParamSpec& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.ParamSpec) +} + +void ParamSpec::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + share_mode_ = 0; + lr_mult_ = 1; + decay_mult_ = 1; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ParamSpec::~ParamSpec() { + // @@protoc_insertion_point(destructor:ditcaffe.ParamSpec) + SharedDtor(); +} + +void ParamSpec::SharedDtor() { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete name_; + } + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +ParamSpec* ParamSpec::default_instance_ = NULL; + +ParamSpec* ParamSpec::New() const { + return new ParamSpec; +} + +void ParamSpec::Clear() { + if (_has_bits_[0 / 32] & 15) { + if (has_name()) { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_->clear(); + } + } + share_mode_ = 0; + lr_mult_ = 1; + decay_mult_ = 1; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool ParamSpec::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:ditcaffe.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, + "name"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_share_mode; + break; + } + + // optional .ditcaffe.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 (::ditcaffe::ParamSpec_DimCheckMode_IsValid(value)) { + set_share_mode(static_cast< ::ditcaffe::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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &lr_mult_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &decay_mult_))); + set_has_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:ditcaffe.ParamSpec) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.ParamSpec) + return false; +#undef DO_ +} + +void ParamSpec::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.ParamSpec) + // optional string name = 1; + if (has_name()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // optional .ditcaffe.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 (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:ditcaffe.ParamSpec) +} + +::google::protobuf::uint8* ParamSpec::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.ParamSpec) + // optional string name = 1; + if (has_name()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->name(), target); + } + + // optional .ditcaffe.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 (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.ParamSpec) + return target; +} + +int ParamSpec::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional string name = 1; + if (has_name()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } + + // optional .ditcaffe.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 (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ParamSpec::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const ParamSpec* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void ParamSpec::MergeFrom(const ParamSpec& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_name()) { + set_name(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()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void ParamSpec::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ParamSpec::CopyFrom(const ParamSpec& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ParamSpec::IsInitialized() const { + + return true; +} + +void ParamSpec::Swap(ParamSpec* other) { + if (other != this) { + std::swap(name_, 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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + 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; +} + + +// =================================================================== + +#ifndef _MSC_VER +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::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::kParameterParamFieldNumber; +const int LayerParameter::kPoolingParamFieldNumber; +const int LayerParameter::kPowerParamFieldNumber; +const int LayerParameter::kPreluParamFieldNumber; +const int LayerParameter::kPythonParamFieldNumber; +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 // !_MSC_VER + +LayerParameter::LayerParameter() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.LayerParameter) +} + +void LayerParameter::InitAsDefaultInstance() { + transform_param_ = const_cast< ::ditcaffe::TransformationParameter*>(&::ditcaffe::TransformationParameter::default_instance()); + loss_param_ = const_cast< ::ditcaffe::LossParameter*>(&::ditcaffe::LossParameter::default_instance()); + accuracy_param_ = const_cast< ::ditcaffe::AccuracyParameter*>(&::ditcaffe::AccuracyParameter::default_instance()); + argmax_param_ = const_cast< ::ditcaffe::ArgMaxParameter*>(&::ditcaffe::ArgMaxParameter::default_instance()); + batch_norm_param_ = const_cast< ::ditcaffe::BatchNormParameter*>(&::ditcaffe::BatchNormParameter::default_instance()); + bias_param_ = const_cast< ::ditcaffe::BiasParameter*>(&::ditcaffe::BiasParameter::default_instance()); + concat_param_ = const_cast< ::ditcaffe::ConcatParameter*>(&::ditcaffe::ConcatParameter::default_instance()); + contrastive_loss_param_ = const_cast< ::ditcaffe::ContrastiveLossParameter*>(&::ditcaffe::ContrastiveLossParameter::default_instance()); + convolution_param_ = const_cast< ::ditcaffe::ConvolutionParameter*>(&::ditcaffe::ConvolutionParameter::default_instance()); + crop_param_ = const_cast< ::ditcaffe::CropParameter*>(&::ditcaffe::CropParameter::default_instance()); + data_param_ = const_cast< ::ditcaffe::DataParameter*>(&::ditcaffe::DataParameter::default_instance()); + dropout_param_ = const_cast< ::ditcaffe::DropoutParameter*>(&::ditcaffe::DropoutParameter::default_instance()); + dummy_data_param_ = const_cast< ::ditcaffe::DummyDataParameter*>(&::ditcaffe::DummyDataParameter::default_instance()); + eltwise_param_ = const_cast< ::ditcaffe::EltwiseParameter*>(&::ditcaffe::EltwiseParameter::default_instance()); + elu_param_ = const_cast< ::ditcaffe::ELUParameter*>(&::ditcaffe::ELUParameter::default_instance()); + embed_param_ = const_cast< ::ditcaffe::EmbedParameter*>(&::ditcaffe::EmbedParameter::default_instance()); + exp_param_ = const_cast< ::ditcaffe::ExpParameter*>(&::ditcaffe::ExpParameter::default_instance()); + flatten_param_ = const_cast< ::ditcaffe::FlattenParameter*>(&::ditcaffe::FlattenParameter::default_instance()); + hdf5_data_param_ = const_cast< ::ditcaffe::HDF5DataParameter*>(&::ditcaffe::HDF5DataParameter::default_instance()); + hdf5_output_param_ = const_cast< ::ditcaffe::HDF5OutputParameter*>(&::ditcaffe::HDF5OutputParameter::default_instance()); + hinge_loss_param_ = const_cast< ::ditcaffe::HingeLossParameter*>(&::ditcaffe::HingeLossParameter::default_instance()); + image_data_param_ = const_cast< ::ditcaffe::ImageDataParameter*>(&::ditcaffe::ImageDataParameter::default_instance()); + infogain_loss_param_ = const_cast< ::ditcaffe::InfogainLossParameter*>(&::ditcaffe::InfogainLossParameter::default_instance()); + inner_product_param_ = const_cast< ::ditcaffe::InnerProductParameter*>(&::ditcaffe::InnerProductParameter::default_instance()); + input_param_ = const_cast< ::ditcaffe::InputParameter*>(&::ditcaffe::InputParameter::default_instance()); + log_param_ = const_cast< ::ditcaffe::LogParameter*>(&::ditcaffe::LogParameter::default_instance()); + lrn_param_ = const_cast< ::ditcaffe::LRNParameter*>(&::ditcaffe::LRNParameter::default_instance()); + memory_data_param_ = const_cast< ::ditcaffe::MemoryDataParameter*>(&::ditcaffe::MemoryDataParameter::default_instance()); + mvn_param_ = const_cast< ::ditcaffe::MVNParameter*>(&::ditcaffe::MVNParameter::default_instance()); + parameter_param_ = const_cast< ::ditcaffe::ParameterParameter*>(&::ditcaffe::ParameterParameter::default_instance()); + pooling_param_ = const_cast< ::ditcaffe::PoolingParameter*>(&::ditcaffe::PoolingParameter::default_instance()); + power_param_ = const_cast< ::ditcaffe::PowerParameter*>(&::ditcaffe::PowerParameter::default_instance()); + prelu_param_ = const_cast< ::ditcaffe::PReLUParameter*>(&::ditcaffe::PReLUParameter::default_instance()); + python_param_ = const_cast< ::ditcaffe::PythonParameter*>(&::ditcaffe::PythonParameter::default_instance()); + reduction_param_ = const_cast< ::ditcaffe::ReductionParameter*>(&::ditcaffe::ReductionParameter::default_instance()); + relu_param_ = const_cast< ::ditcaffe::ReLUParameter*>(&::ditcaffe::ReLUParameter::default_instance()); + reshape_param_ = const_cast< ::ditcaffe::ReshapeParameter*>(&::ditcaffe::ReshapeParameter::default_instance()); + scale_param_ = const_cast< ::ditcaffe::ScaleParameter*>(&::ditcaffe::ScaleParameter::default_instance()); + sigmoid_param_ = const_cast< ::ditcaffe::SigmoidParameter*>(&::ditcaffe::SigmoidParameter::default_instance()); + softmax_param_ = const_cast< ::ditcaffe::SoftmaxParameter*>(&::ditcaffe::SoftmaxParameter::default_instance()); + spp_param_ = const_cast< ::ditcaffe::SPPParameter*>(&::ditcaffe::SPPParameter::default_instance()); + slice_param_ = const_cast< ::ditcaffe::SliceParameter*>(&::ditcaffe::SliceParameter::default_instance()); + tanh_param_ = const_cast< ::ditcaffe::TanHParameter*>(&::ditcaffe::TanHParameter::default_instance()); + threshold_param_ = const_cast< ::ditcaffe::ThresholdParameter*>(&::ditcaffe::ThresholdParameter::default_instance()); + tile_param_ = const_cast< ::ditcaffe::TileParameter*>(&::ditcaffe::TileParameter::default_instance()); + window_data_param_ = const_cast< ::ditcaffe::WindowDataParameter*>(&::ditcaffe::WindowDataParameter::default_instance()); +} + +LayerParameter::LayerParameter(const LayerParameter& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.LayerParameter) +} + +void LayerParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + type_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + phase_ = 0; + 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; + 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; + parameter_param_ = NULL; + pooling_param_ = NULL; + power_param_ = NULL; + prelu_param_ = NULL; + python_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; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +LayerParameter::~LayerParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.LayerParameter) + SharedDtor(); +} + +void LayerParameter::SharedDtor() { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete name_; + } + if (type_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete type_; + } + if (this != default_instance_) { + 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 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 parameter_param_; + delete pooling_param_; + delete power_param_; + delete prelu_param_; + delete python_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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +LayerParameter* LayerParameter::default_instance_ = NULL; + +LayerParameter* LayerParameter::New() const { + return new LayerParameter; +} + +void LayerParameter::Clear() { + if (_has_bits_[0 / 32] & 19) { + if (has_name()) { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_->clear(); + } + } + if (has_type()) { + if (type_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + type_->clear(); + } + } + phase_ = 0; + } + if (_has_bits_[8 / 32] & 63488) { + if (has_transform_param()) { + if (transform_param_ != NULL) transform_param_->::ditcaffe::TransformationParameter::Clear(); + } + if (has_loss_param()) { + if (loss_param_ != NULL) loss_param_->::ditcaffe::LossParameter::Clear(); + } + if (has_accuracy_param()) { + if (accuracy_param_ != NULL) accuracy_param_->::ditcaffe::AccuracyParameter::Clear(); + } + if (has_argmax_param()) { + if (argmax_param_ != NULL) argmax_param_->::ditcaffe::ArgMaxParameter::Clear(); + } + if (has_batch_norm_param()) { + if (batch_norm_param_ != NULL) batch_norm_param_->::ditcaffe::BatchNormParameter::Clear(); + } + } + if (_has_bits_[16 / 32] & 16711680) { + if (has_bias_param()) { + if (bias_param_ != NULL) bias_param_->::ditcaffe::BiasParameter::Clear(); + } + if (has_concat_param()) { + if (concat_param_ != NULL) concat_param_->::ditcaffe::ConcatParameter::Clear(); + } + if (has_contrastive_loss_param()) { + if (contrastive_loss_param_ != NULL) contrastive_loss_param_->::ditcaffe::ContrastiveLossParameter::Clear(); + } + if (has_convolution_param()) { + if (convolution_param_ != NULL) convolution_param_->::ditcaffe::ConvolutionParameter::Clear(); + } + if (has_crop_param()) { + if (crop_param_ != NULL) crop_param_->::ditcaffe::CropParameter::Clear(); + } + if (has_data_param()) { + if (data_param_ != NULL) data_param_->::ditcaffe::DataParameter::Clear(); + } + if (has_dropout_param()) { + if (dropout_param_ != NULL) dropout_param_->::ditcaffe::DropoutParameter::Clear(); + } + if (has_dummy_data_param()) { + if (dummy_data_param_ != NULL) dummy_data_param_->::ditcaffe::DummyDataParameter::Clear(); + } + } + // In-place patch to suppress error: this decimal constant is unsigned only in ISO C90 + if (_has_bits_[24 / 32] & /*4278190080*/ 0xFF000000) { + if (has_eltwise_param()) { + if (eltwise_param_ != NULL) eltwise_param_->::ditcaffe::EltwiseParameter::Clear(); + } + if (has_elu_param()) { + if (elu_param_ != NULL) elu_param_->::ditcaffe::ELUParameter::Clear(); + } + if (has_embed_param()) { + if (embed_param_ != NULL) embed_param_->::ditcaffe::EmbedParameter::Clear(); + } + if (has_exp_param()) { + if (exp_param_ != NULL) exp_param_->::ditcaffe::ExpParameter::Clear(); + } + if (has_flatten_param()) { + if (flatten_param_ != NULL) flatten_param_->::ditcaffe::FlattenParameter::Clear(); + } + if (has_hdf5_data_param()) { + if (hdf5_data_param_ != NULL) hdf5_data_param_->::ditcaffe::HDF5DataParameter::Clear(); + } + if (has_hdf5_output_param()) { + if (hdf5_output_param_ != NULL) hdf5_output_param_->::ditcaffe::HDF5OutputParameter::Clear(); + } + if (has_hinge_loss_param()) { + if (hinge_loss_param_ != NULL) hinge_loss_param_->::ditcaffe::HingeLossParameter::Clear(); + } + } + if (_has_bits_[32 / 32] & 255) { + if (has_image_data_param()) { + if (image_data_param_ != NULL) image_data_param_->::ditcaffe::ImageDataParameter::Clear(); + } + if (has_infogain_loss_param()) { + if (infogain_loss_param_ != NULL) infogain_loss_param_->::ditcaffe::InfogainLossParameter::Clear(); + } + if (has_inner_product_param()) { + if (inner_product_param_ != NULL) inner_product_param_->::ditcaffe::InnerProductParameter::Clear(); + } + if (has_input_param()) { + if (input_param_ != NULL) input_param_->::ditcaffe::InputParameter::Clear(); + } + if (has_log_param()) { + if (log_param_ != NULL) log_param_->::ditcaffe::LogParameter::Clear(); + } + if (has_lrn_param()) { + if (lrn_param_ != NULL) lrn_param_->::ditcaffe::LRNParameter::Clear(); + } + if (has_memory_data_param()) { + if (memory_data_param_ != NULL) memory_data_param_->::ditcaffe::MemoryDataParameter::Clear(); + } + if (has_mvn_param()) { + if (mvn_param_ != NULL) mvn_param_->::ditcaffe::MVNParameter::Clear(); + } + } + if (_has_bits_[40 / 32] & 65280) { + if (has_parameter_param()) { + if (parameter_param_ != NULL) parameter_param_->::ditcaffe::ParameterParameter::Clear(); + } + if (has_pooling_param()) { + if (pooling_param_ != NULL) pooling_param_->::ditcaffe::PoolingParameter::Clear(); + } + if (has_power_param()) { + if (power_param_ != NULL) power_param_->::ditcaffe::PowerParameter::Clear(); + } + if (has_prelu_param()) { + if (prelu_param_ != NULL) prelu_param_->::ditcaffe::PReLUParameter::Clear(); + } + if (has_python_param()) { + if (python_param_ != NULL) python_param_->::ditcaffe::PythonParameter::Clear(); + } + if (has_reduction_param()) { + if (reduction_param_ != NULL) reduction_param_->::ditcaffe::ReductionParameter::Clear(); + } + if (has_relu_param()) { + if (relu_param_ != NULL) relu_param_->::ditcaffe::ReLUParameter::Clear(); + } + if (has_reshape_param()) { + if (reshape_param_ != NULL) reshape_param_->::ditcaffe::ReshapeParameter::Clear(); + } + } + if (_has_bits_[48 / 32] & 16711680) { + if (has_scale_param()) { + if (scale_param_ != NULL) scale_param_->::ditcaffe::ScaleParameter::Clear(); + } + if (has_sigmoid_param()) { + if (sigmoid_param_ != NULL) sigmoid_param_->::ditcaffe::SigmoidParameter::Clear(); + } + if (has_softmax_param()) { + if (softmax_param_ != NULL) softmax_param_->::ditcaffe::SoftmaxParameter::Clear(); + } + if (has_spp_param()) { + if (spp_param_ != NULL) spp_param_->::ditcaffe::SPPParameter::Clear(); + } + if (has_slice_param()) { + if (slice_param_ != NULL) slice_param_->::ditcaffe::SliceParameter::Clear(); + } + if (has_tanh_param()) { + if (tanh_param_ != NULL) tanh_param_->::ditcaffe::TanHParameter::Clear(); + } + if (has_threshold_param()) { + if (threshold_param_ != NULL) threshold_param_->::ditcaffe::ThresholdParameter::Clear(); + } + if (has_tile_param()) { + if (tile_param_ != NULL) tile_param_->::ditcaffe::TileParameter::Clear(); + } + } + if (has_window_data_param()) { + if (window_data_param_ != NULL) window_data_param_->::ditcaffe::WindowDataParameter::Clear(); + } + bottom_.Clear(); + top_.Clear(); + loss_weight_.Clear(); + param_.Clear(); + blobs_.Clear(); + propagate_down_.Clear(); + include_.Clear(); + exclude_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool LayerParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:ditcaffe.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, + "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, + "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, + "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, + "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 .ditcaffe.ParamSpec param = 6; + case 6: { + if (tag == 50) { + parse_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(50)) goto parse_param; + if (input->ExpectTag(58)) goto parse_blobs; + break; + } + + // repeated .ditcaffe.BlobProto blobs = 7; + case 7: { + if (tag == 58) { + parse_blobs: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_blobs())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(58)) goto parse_blobs; + if (input->ExpectTag(66)) goto parse_include; + break; + } + + // repeated .ditcaffe.NetStateRule include = 8; + case 8: { + if (tag == 66) { + parse_include: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_include())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(66)) goto parse_include; + if (input->ExpectTag(74)) goto parse_exclude; + break; + } + + // repeated .ditcaffe.NetStateRule exclude = 9; + case 9: { + if (tag == 74) { + parse_exclude: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_exclude())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(74)) goto parse_exclude; + if (input->ExpectTag(80)) goto parse_phase; + break; + } + + // optional .ditcaffe.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 (::ditcaffe::Phase_IsValid(value)) { + set_phase(static_cast< ::ditcaffe::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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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->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:ditcaffe.LayerParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.LayerParameter) + return false; +#undef DO_ +} + +void LayerParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.LayerParameter) + // optional string name = 1; + if (has_name()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "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, + "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, + "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, + "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 .ditcaffe.ParamSpec param = 6; + for (int i = 0; i < this->param_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 6, this->param(i), output); + } + + // repeated .ditcaffe.BlobProto blobs = 7; + for (int i = 0; i < this->blobs_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 7, this->blobs(i), output); + } + + // repeated .ditcaffe.NetStateRule include = 8; + for (int i = 0; i < this->include_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 8, this->include(i), output); + } + + // repeated .ditcaffe.NetStateRule exclude = 9; + for (int i = 0; i < this->exclude_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 9, this->exclude(i), output); + } + + // optional .ditcaffe.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 .ditcaffe.TransformationParameter transform_param = 100; + if (has_transform_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 100, this->transform_param(), output); + } + + // optional .ditcaffe.LossParameter loss_param = 101; + if (has_loss_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 101, this->loss_param(), output); + } + + // optional .ditcaffe.AccuracyParameter accuracy_param = 102; + if (has_accuracy_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 102, this->accuracy_param(), output); + } + + // optional .ditcaffe.ArgMaxParameter argmax_param = 103; + if (has_argmax_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 103, this->argmax_param(), output); + } + + // optional .ditcaffe.ConcatParameter concat_param = 104; + if (has_concat_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 104, this->concat_param(), output); + } + + // optional .ditcaffe.ContrastiveLossParameter contrastive_loss_param = 105; + if (has_contrastive_loss_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 105, this->contrastive_loss_param(), output); + } + + // optional .ditcaffe.ConvolutionParameter convolution_param = 106; + if (has_convolution_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 106, this->convolution_param(), output); + } + + // optional .ditcaffe.DataParameter data_param = 107; + if (has_data_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 107, this->data_param(), output); + } + + // optional .ditcaffe.DropoutParameter dropout_param = 108; + if (has_dropout_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 108, this->dropout_param(), output); + } + + // optional .ditcaffe.DummyDataParameter dummy_data_param = 109; + if (has_dummy_data_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 109, this->dummy_data_param(), output); + } + + // optional .ditcaffe.EltwiseParameter eltwise_param = 110; + if (has_eltwise_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 110, this->eltwise_param(), output); + } + + // optional .ditcaffe.ExpParameter exp_param = 111; + if (has_exp_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 111, this->exp_param(), output); + } + + // optional .ditcaffe.HDF5DataParameter hdf5_data_param = 112; + if (has_hdf5_data_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 112, this->hdf5_data_param(), output); + } + + // optional .ditcaffe.HDF5OutputParameter hdf5_output_param = 113; + if (has_hdf5_output_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 113, this->hdf5_output_param(), output); + } + + // optional .ditcaffe.HingeLossParameter hinge_loss_param = 114; + if (has_hinge_loss_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 114, this->hinge_loss_param(), output); + } + + // optional .ditcaffe.ImageDataParameter image_data_param = 115; + if (has_image_data_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 115, this->image_data_param(), output); + } + + // optional .ditcaffe.InfogainLossParameter infogain_loss_param = 116; + if (has_infogain_loss_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 116, this->infogain_loss_param(), output); + } + + // optional .ditcaffe.InnerProductParameter inner_product_param = 117; + if (has_inner_product_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 117, this->inner_product_param(), output); + } + + // optional .ditcaffe.LRNParameter lrn_param = 118; + if (has_lrn_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 118, this->lrn_param(), output); + } + + // optional .ditcaffe.MemoryDataParameter memory_data_param = 119; + if (has_memory_data_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 119, this->memory_data_param(), output); + } + + // optional .ditcaffe.MVNParameter mvn_param = 120; + if (has_mvn_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 120, this->mvn_param(), output); + } + + // optional .ditcaffe.PoolingParameter pooling_param = 121; + if (has_pooling_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 121, this->pooling_param(), output); + } + + // optional .ditcaffe.PowerParameter power_param = 122; + if (has_power_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 122, this->power_param(), output); + } + + // optional .ditcaffe.ReLUParameter relu_param = 123; + if (has_relu_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 123, this->relu_param(), output); + } + + // optional .ditcaffe.SigmoidParameter sigmoid_param = 124; + if (has_sigmoid_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 124, this->sigmoid_param(), output); + } + + // optional .ditcaffe.SoftmaxParameter softmax_param = 125; + if (has_softmax_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 125, this->softmax_param(), output); + } + + // optional .ditcaffe.SliceParameter slice_param = 126; + if (has_slice_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 126, this->slice_param(), output); + } + + // optional .ditcaffe.TanHParameter tanh_param = 127; + if (has_tanh_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 127, this->tanh_param(), output); + } + + // optional .ditcaffe.ThresholdParameter threshold_param = 128; + if (has_threshold_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 128, this->threshold_param(), output); + } + + // optional .ditcaffe.WindowDataParameter window_data_param = 129; + if (has_window_data_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 129, this->window_data_param(), output); + } + + // optional .ditcaffe.PythonParameter python_param = 130; + if (has_python_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 130, this->python_param(), output); + } + + // optional .ditcaffe.PReLUParameter prelu_param = 131; + if (has_prelu_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 131, this->prelu_param(), output); + } + + // optional .ditcaffe.SPPParameter spp_param = 132; + if (has_spp_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 132, this->spp_param(), output); + } + + // optional .ditcaffe.ReshapeParameter reshape_param = 133; + if (has_reshape_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 133, this->reshape_param(), output); + } + + // optional .ditcaffe.LogParameter log_param = 134; + if (has_log_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 134, this->log_param(), output); + } + + // optional .ditcaffe.FlattenParameter flatten_param = 135; + if (has_flatten_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 135, this->flatten_param(), output); + } + + // optional .ditcaffe.ReductionParameter reduction_param = 136; + if (has_reduction_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 136, this->reduction_param(), output); + } + + // optional .ditcaffe.EmbedParameter embed_param = 137; + if (has_embed_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 137, this->embed_param(), output); + } + + // optional .ditcaffe.TileParameter tile_param = 138; + if (has_tile_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 138, this->tile_param(), output); + } + + // optional .ditcaffe.BatchNormParameter batch_norm_param = 139; + if (has_batch_norm_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 139, this->batch_norm_param(), output); + } + + // optional .ditcaffe.ELUParameter elu_param = 140; + if (has_elu_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 140, this->elu_param(), output); + } + + // optional .ditcaffe.BiasParameter bias_param = 141; + if (has_bias_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 141, this->bias_param(), output); + } + + // optional .ditcaffe.ScaleParameter scale_param = 142; + if (has_scale_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 142, this->scale_param(), output); + } + + // optional .ditcaffe.InputParameter input_param = 143; + if (has_input_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 143, this->input_param(), output); + } + + // optional .ditcaffe.CropParameter crop_param = 144; + if (has_crop_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 144, this->crop_param(), output); + } + + // optional .ditcaffe.ParameterParameter parameter_param = 145; + if (has_parameter_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 145, this->parameter_param(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:ditcaffe.LayerParameter) +} + +::google::protobuf::uint8* LayerParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.LayerParameter) + // optional string name = 1; + if (has_name()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "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, + "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, + "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, + "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 .ditcaffe.ParamSpec param = 6; + for (int i = 0; i < this->param_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 6, this->param(i), target); + } + + // repeated .ditcaffe.BlobProto blobs = 7; + for (int i = 0; i < this->blobs_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 7, this->blobs(i), target); + } + + // repeated .ditcaffe.NetStateRule include = 8; + for (int i = 0; i < this->include_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 8, this->include(i), target); + } + + // repeated .ditcaffe.NetStateRule exclude = 9; + for (int i = 0; i < this->exclude_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 9, this->exclude(i), target); + } + + // optional .ditcaffe.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 .ditcaffe.TransformationParameter transform_param = 100; + if (has_transform_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 100, this->transform_param(), target); + } + + // optional .ditcaffe.LossParameter loss_param = 101; + if (has_loss_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 101, this->loss_param(), target); + } + + // optional .ditcaffe.AccuracyParameter accuracy_param = 102; + if (has_accuracy_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 102, this->accuracy_param(), target); + } + + // optional .ditcaffe.ArgMaxParameter argmax_param = 103; + if (has_argmax_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 103, this->argmax_param(), target); + } + + // optional .ditcaffe.ConcatParameter concat_param = 104; + if (has_concat_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 104, this->concat_param(), target); + } + + // optional .ditcaffe.ContrastiveLossParameter contrastive_loss_param = 105; + if (has_contrastive_loss_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 105, this->contrastive_loss_param(), target); + } + + // optional .ditcaffe.ConvolutionParameter convolution_param = 106; + if (has_convolution_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 106, this->convolution_param(), target); + } + + // optional .ditcaffe.DataParameter data_param = 107; + if (has_data_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 107, this->data_param(), target); + } + + // optional .ditcaffe.DropoutParameter dropout_param = 108; + if (has_dropout_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 108, this->dropout_param(), target); + } + + // optional .ditcaffe.DummyDataParameter dummy_data_param = 109; + if (has_dummy_data_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 109, this->dummy_data_param(), target); + } + + // optional .ditcaffe.EltwiseParameter eltwise_param = 110; + if (has_eltwise_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 110, this->eltwise_param(), target); + } + + // optional .ditcaffe.ExpParameter exp_param = 111; + if (has_exp_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 111, this->exp_param(), target); + } + + // optional .ditcaffe.HDF5DataParameter hdf5_data_param = 112; + if (has_hdf5_data_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 112, this->hdf5_data_param(), target); + } + + // optional .ditcaffe.HDF5OutputParameter hdf5_output_param = 113; + if (has_hdf5_output_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 113, this->hdf5_output_param(), target); + } + + // optional .ditcaffe.HingeLossParameter hinge_loss_param = 114; + if (has_hinge_loss_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 114, this->hinge_loss_param(), target); + } + + // optional .ditcaffe.ImageDataParameter image_data_param = 115; + if (has_image_data_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 115, this->image_data_param(), target); + } + + // optional .ditcaffe.InfogainLossParameter infogain_loss_param = 116; + if (has_infogain_loss_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 116, this->infogain_loss_param(), target); + } + + // optional .ditcaffe.InnerProductParameter inner_product_param = 117; + if (has_inner_product_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 117, this->inner_product_param(), target); + } + + // optional .ditcaffe.LRNParameter lrn_param = 118; + if (has_lrn_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 118, this->lrn_param(), target); + } + + // optional .ditcaffe.MemoryDataParameter memory_data_param = 119; + if (has_memory_data_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 119, this->memory_data_param(), target); + } + + // optional .ditcaffe.MVNParameter mvn_param = 120; + if (has_mvn_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 120, this->mvn_param(), target); + } + + // optional .ditcaffe.PoolingParameter pooling_param = 121; + if (has_pooling_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 121, this->pooling_param(), target); + } + + // optional .ditcaffe.PowerParameter power_param = 122; + if (has_power_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 122, this->power_param(), target); + } + + // optional .ditcaffe.ReLUParameter relu_param = 123; + if (has_relu_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 123, this->relu_param(), target); + } + + // optional .ditcaffe.SigmoidParameter sigmoid_param = 124; + if (has_sigmoid_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 124, this->sigmoid_param(), target); + } + + // optional .ditcaffe.SoftmaxParameter softmax_param = 125; + if (has_softmax_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 125, this->softmax_param(), target); + } + + // optional .ditcaffe.SliceParameter slice_param = 126; + if (has_slice_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 126, this->slice_param(), target); + } + + // optional .ditcaffe.TanHParameter tanh_param = 127; + if (has_tanh_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 127, this->tanh_param(), target); + } + + // optional .ditcaffe.ThresholdParameter threshold_param = 128; + if (has_threshold_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 128, this->threshold_param(), target); + } + + // optional .ditcaffe.WindowDataParameter window_data_param = 129; + if (has_window_data_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 129, this->window_data_param(), target); + } + + // optional .ditcaffe.PythonParameter python_param = 130; + if (has_python_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 130, this->python_param(), target); + } + + // optional .ditcaffe.PReLUParameter prelu_param = 131; + if (has_prelu_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 131, this->prelu_param(), target); + } + + // optional .ditcaffe.SPPParameter spp_param = 132; + if (has_spp_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 132, this->spp_param(), target); + } + + // optional .ditcaffe.ReshapeParameter reshape_param = 133; + if (has_reshape_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 133, this->reshape_param(), target); + } + + // optional .ditcaffe.LogParameter log_param = 134; + if (has_log_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 134, this->log_param(), target); + } + + // optional .ditcaffe.FlattenParameter flatten_param = 135; + if (has_flatten_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 135, this->flatten_param(), target); + } + + // optional .ditcaffe.ReductionParameter reduction_param = 136; + if (has_reduction_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 136, this->reduction_param(), target); + } + + // optional .ditcaffe.EmbedParameter embed_param = 137; + if (has_embed_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 137, this->embed_param(), target); + } + + // optional .ditcaffe.TileParameter tile_param = 138; + if (has_tile_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 138, this->tile_param(), target); + } + + // optional .ditcaffe.BatchNormParameter batch_norm_param = 139; + if (has_batch_norm_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 139, this->batch_norm_param(), target); + } + + // optional .ditcaffe.ELUParameter elu_param = 140; + if (has_elu_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 140, this->elu_param(), target); + } + + // optional .ditcaffe.BiasParameter bias_param = 141; + if (has_bias_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 141, this->bias_param(), target); + } + + // optional .ditcaffe.ScaleParameter scale_param = 142; + if (has_scale_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 142, this->scale_param(), target); + } + + // optional .ditcaffe.InputParameter input_param = 143; + if (has_input_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 143, this->input_param(), target); + } + + // optional .ditcaffe.CropParameter crop_param = 144; + if (has_crop_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 144, this->crop_param(), target); + } + + // optional .ditcaffe.ParameterParameter parameter_param = 145; + if (has_parameter_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 145, this->parameter_param(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.LayerParameter) + return target; +} + +int LayerParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // 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 .ditcaffe.Phase phase = 10; + if (has_phase()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->phase()); + } + + } + if (_has_bits_[11 / 32] & (0xffu << (11 % 32))) { + // optional .ditcaffe.TransformationParameter transform_param = 100; + if (has_transform_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->transform_param()); + } + + // optional .ditcaffe.LossParameter loss_param = 101; + if (has_loss_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->loss_param()); + } + + // optional .ditcaffe.AccuracyParameter accuracy_param = 102; + if (has_accuracy_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->accuracy_param()); + } + + // optional .ditcaffe.ArgMaxParameter argmax_param = 103; + if (has_argmax_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->argmax_param()); + } + + // optional .ditcaffe.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] & (0xffu << (16 % 32))) { + // optional .ditcaffe.BiasParameter bias_param = 141; + if (has_bias_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->bias_param()); + } + + // optional .ditcaffe.ConcatParameter concat_param = 104; + if (has_concat_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->concat_param()); + } + + // optional .ditcaffe.ContrastiveLossParameter contrastive_loss_param = 105; + if (has_contrastive_loss_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->contrastive_loss_param()); + } + + // optional .ditcaffe.ConvolutionParameter convolution_param = 106; + if (has_convolution_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->convolution_param()); + } + + // optional .ditcaffe.CropParameter crop_param = 144; + if (has_crop_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->crop_param()); + } + + // optional .ditcaffe.DataParameter data_param = 107; + if (has_data_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->data_param()); + } + + // optional .ditcaffe.DropoutParameter dropout_param = 108; + if (has_dropout_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->dropout_param()); + } + + // optional .ditcaffe.DummyDataParameter dummy_data_param = 109; + if (has_dummy_data_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->dummy_data_param()); + } + + } + if (_has_bits_[24 / 32] & (0xffu << (24 % 32))) { + // optional .ditcaffe.EltwiseParameter eltwise_param = 110; + if (has_eltwise_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->eltwise_param()); + } + + // optional .ditcaffe.ELUParameter elu_param = 140; + if (has_elu_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->elu_param()); + } + + // optional .ditcaffe.EmbedParameter embed_param = 137; + if (has_embed_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->embed_param()); + } + + // optional .ditcaffe.ExpParameter exp_param = 111; + if (has_exp_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->exp_param()); + } + + // optional .ditcaffe.FlattenParameter flatten_param = 135; + if (has_flatten_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->flatten_param()); + } + + // optional .ditcaffe.HDF5DataParameter hdf5_data_param = 112; + if (has_hdf5_data_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->hdf5_data_param()); + } + + // optional .ditcaffe.HDF5OutputParameter hdf5_output_param = 113; + if (has_hdf5_output_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->hdf5_output_param()); + } + + // optional .ditcaffe.HingeLossParameter hinge_loss_param = 114; + if (has_hinge_loss_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->hinge_loss_param()); + } + + } + if (_has_bits_[32 / 32] & (0xffu << (32 % 32))) { + // optional .ditcaffe.ImageDataParameter image_data_param = 115; + if (has_image_data_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->image_data_param()); + } + + // optional .ditcaffe.InfogainLossParameter infogain_loss_param = 116; + if (has_infogain_loss_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->infogain_loss_param()); + } + + // optional .ditcaffe.InnerProductParameter inner_product_param = 117; + if (has_inner_product_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->inner_product_param()); + } + + // optional .ditcaffe.InputParameter input_param = 143; + if (has_input_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->input_param()); + } + + // optional .ditcaffe.LogParameter log_param = 134; + if (has_log_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->log_param()); + } + + // optional .ditcaffe.LRNParameter lrn_param = 118; + if (has_lrn_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->lrn_param()); + } + + // optional .ditcaffe.MemoryDataParameter memory_data_param = 119; + if (has_memory_data_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->memory_data_param()); + } + + // optional .ditcaffe.MVNParameter mvn_param = 120; + if (has_mvn_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->mvn_param()); + } + + } + if (_has_bits_[40 / 32] & (0xffu << (40 % 32))) { + // optional .ditcaffe.ParameterParameter parameter_param = 145; + if (has_parameter_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->parameter_param()); + } + + // optional .ditcaffe.PoolingParameter pooling_param = 121; + if (has_pooling_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->pooling_param()); + } + + // optional .ditcaffe.PowerParameter power_param = 122; + if (has_power_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->power_param()); + } + + // optional .ditcaffe.PReLUParameter prelu_param = 131; + if (has_prelu_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->prelu_param()); + } + + // optional .ditcaffe.PythonParameter python_param = 130; + if (has_python_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->python_param()); + } + + // optional .ditcaffe.ReductionParameter reduction_param = 136; + if (has_reduction_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->reduction_param()); + } + + // optional .ditcaffe.ReLUParameter relu_param = 123; + if (has_relu_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->relu_param()); + } + + // optional .ditcaffe.ReshapeParameter reshape_param = 133; + if (has_reshape_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->reshape_param()); + } + + } + if (_has_bits_[48 / 32] & (0xffu << (48 % 32))) { + // optional .ditcaffe.ScaleParameter scale_param = 142; + if (has_scale_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->scale_param()); + } + + // optional .ditcaffe.SigmoidParameter sigmoid_param = 124; + if (has_sigmoid_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->sigmoid_param()); + } + + // optional .ditcaffe.SoftmaxParameter softmax_param = 125; + if (has_softmax_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->softmax_param()); + } + + // optional .ditcaffe.SPPParameter spp_param = 132; + if (has_spp_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->spp_param()); + } + + // optional .ditcaffe.SliceParameter slice_param = 126; + if (has_slice_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->slice_param()); + } + + // optional .ditcaffe.TanHParameter tanh_param = 127; + if (has_tanh_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->tanh_param()); + } + + // optional .ditcaffe.ThresholdParameter threshold_param = 128; + if (has_threshold_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->threshold_param()); + } + + // optional .ditcaffe.TileParameter tile_param = 138; + if (has_tile_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->tile_param()); + } + + } + if (_has_bits_[56 / 32] & (0xffu << (56 % 32))) { + // optional .ditcaffe.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 * 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 * 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; + { + int data_size = 0; + data_size = 4 * this->loss_weight_size(); + total_size += 1 * this->loss_weight_size() + data_size; + } + + // repeated .ditcaffe.ParamSpec param = 6; + total_size += 1 * this->param_size(); + for (int i = 0; i < this->param_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->param(i)); + } + + // repeated .ditcaffe.BlobProto blobs = 7; + total_size += 1 * this->blobs_size(); + for (int i = 0; i < this->blobs_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->blobs(i)); + } + + // repeated bool propagate_down = 11; + { + int data_size = 0; + data_size = 1 * this->propagate_down_size(); + total_size += 1 * this->propagate_down_size() + data_size; + } + + // repeated .ditcaffe.NetStateRule include = 8; + total_size += 1 * this->include_size(); + for (int i = 0; i < this->include_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->include(i)); + } + + // repeated .ditcaffe.NetStateRule exclude = 9; + total_size += 1 * this->exclude_size(); + for (int i = 0; i < this->exclude_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->exclude(i)); + } + + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void LayerParameter::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const LayerParameter* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void LayerParameter::MergeFrom(const LayerParameter& from) { + GOOGLE_CHECK_NE(&from, this); + bottom_.MergeFrom(from.bottom_); + top_.MergeFrom(from.top_); + loss_weight_.MergeFrom(from.loss_weight_); + param_.MergeFrom(from.param_); + blobs_.MergeFrom(from.blobs_); + propagate_down_.MergeFrom(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_name(from.name()); + } + if (from.has_type()) { + set_type(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()->::ditcaffe::TransformationParameter::MergeFrom(from.transform_param()); + } + if (from.has_loss_param()) { + mutable_loss_param()->::ditcaffe::LossParameter::MergeFrom(from.loss_param()); + } + if (from.has_accuracy_param()) { + mutable_accuracy_param()->::ditcaffe::AccuracyParameter::MergeFrom(from.accuracy_param()); + } + if (from.has_argmax_param()) { + mutable_argmax_param()->::ditcaffe::ArgMaxParameter::MergeFrom(from.argmax_param()); + } + if (from.has_batch_norm_param()) { + mutable_batch_norm_param()->::ditcaffe::BatchNormParameter::MergeFrom(from.batch_norm_param()); + } + } + if (from._has_bits_[16 / 32] & (0xffu << (16 % 32))) { + if (from.has_bias_param()) { + mutable_bias_param()->::ditcaffe::BiasParameter::MergeFrom(from.bias_param()); + } + if (from.has_concat_param()) { + mutable_concat_param()->::ditcaffe::ConcatParameter::MergeFrom(from.concat_param()); + } + if (from.has_contrastive_loss_param()) { + mutable_contrastive_loss_param()->::ditcaffe::ContrastiveLossParameter::MergeFrom(from.contrastive_loss_param()); + } + if (from.has_convolution_param()) { + mutable_convolution_param()->::ditcaffe::ConvolutionParameter::MergeFrom(from.convolution_param()); + } + if (from.has_crop_param()) { + mutable_crop_param()->::ditcaffe::CropParameter::MergeFrom(from.crop_param()); + } + if (from.has_data_param()) { + mutable_data_param()->::ditcaffe::DataParameter::MergeFrom(from.data_param()); + } + if (from.has_dropout_param()) { + mutable_dropout_param()->::ditcaffe::DropoutParameter::MergeFrom(from.dropout_param()); + } + if (from.has_dummy_data_param()) { + mutable_dummy_data_param()->::ditcaffe::DummyDataParameter::MergeFrom(from.dummy_data_param()); + } + } + if (from._has_bits_[24 / 32] & (0xffu << (24 % 32))) { + if (from.has_eltwise_param()) { + mutable_eltwise_param()->::ditcaffe::EltwiseParameter::MergeFrom(from.eltwise_param()); + } + if (from.has_elu_param()) { + mutable_elu_param()->::ditcaffe::ELUParameter::MergeFrom(from.elu_param()); + } + if (from.has_embed_param()) { + mutable_embed_param()->::ditcaffe::EmbedParameter::MergeFrom(from.embed_param()); + } + if (from.has_exp_param()) { + mutable_exp_param()->::ditcaffe::ExpParameter::MergeFrom(from.exp_param()); + } + if (from.has_flatten_param()) { + mutable_flatten_param()->::ditcaffe::FlattenParameter::MergeFrom(from.flatten_param()); + } + if (from.has_hdf5_data_param()) { + mutable_hdf5_data_param()->::ditcaffe::HDF5DataParameter::MergeFrom(from.hdf5_data_param()); + } + if (from.has_hdf5_output_param()) { + mutable_hdf5_output_param()->::ditcaffe::HDF5OutputParameter::MergeFrom(from.hdf5_output_param()); + } + if (from.has_hinge_loss_param()) { + mutable_hinge_loss_param()->::ditcaffe::HingeLossParameter::MergeFrom(from.hinge_loss_param()); + } + } + if (from._has_bits_[32 / 32] & (0xffu << (32 % 32))) { + if (from.has_image_data_param()) { + mutable_image_data_param()->::ditcaffe::ImageDataParameter::MergeFrom(from.image_data_param()); + } + if (from.has_infogain_loss_param()) { + mutable_infogain_loss_param()->::ditcaffe::InfogainLossParameter::MergeFrom(from.infogain_loss_param()); + } + if (from.has_inner_product_param()) { + mutable_inner_product_param()->::ditcaffe::InnerProductParameter::MergeFrom(from.inner_product_param()); + } + if (from.has_input_param()) { + mutable_input_param()->::ditcaffe::InputParameter::MergeFrom(from.input_param()); + } + if (from.has_log_param()) { + mutable_log_param()->::ditcaffe::LogParameter::MergeFrom(from.log_param()); + } + if (from.has_lrn_param()) { + mutable_lrn_param()->::ditcaffe::LRNParameter::MergeFrom(from.lrn_param()); + } + if (from.has_memory_data_param()) { + mutable_memory_data_param()->::ditcaffe::MemoryDataParameter::MergeFrom(from.memory_data_param()); + } + if (from.has_mvn_param()) { + mutable_mvn_param()->::ditcaffe::MVNParameter::MergeFrom(from.mvn_param()); + } + } + if (from._has_bits_[40 / 32] & (0xffu << (40 % 32))) { + if (from.has_parameter_param()) { + mutable_parameter_param()->::ditcaffe::ParameterParameter::MergeFrom(from.parameter_param()); + } + if (from.has_pooling_param()) { + mutable_pooling_param()->::ditcaffe::PoolingParameter::MergeFrom(from.pooling_param()); + } + if (from.has_power_param()) { + mutable_power_param()->::ditcaffe::PowerParameter::MergeFrom(from.power_param()); + } + if (from.has_prelu_param()) { + mutable_prelu_param()->::ditcaffe::PReLUParameter::MergeFrom(from.prelu_param()); + } + if (from.has_python_param()) { + mutable_python_param()->::ditcaffe::PythonParameter::MergeFrom(from.python_param()); + } + if (from.has_reduction_param()) { + mutable_reduction_param()->::ditcaffe::ReductionParameter::MergeFrom(from.reduction_param()); + } + if (from.has_relu_param()) { + mutable_relu_param()->::ditcaffe::ReLUParameter::MergeFrom(from.relu_param()); + } + if (from.has_reshape_param()) { + mutable_reshape_param()->::ditcaffe::ReshapeParameter::MergeFrom(from.reshape_param()); + } + } + if (from._has_bits_[48 / 32] & (0xffu << (48 % 32))) { + if (from.has_scale_param()) { + mutable_scale_param()->::ditcaffe::ScaleParameter::MergeFrom(from.scale_param()); + } + if (from.has_sigmoid_param()) { + mutable_sigmoid_param()->::ditcaffe::SigmoidParameter::MergeFrom(from.sigmoid_param()); + } + if (from.has_softmax_param()) { + mutable_softmax_param()->::ditcaffe::SoftmaxParameter::MergeFrom(from.softmax_param()); + } + if (from.has_spp_param()) { + mutable_spp_param()->::ditcaffe::SPPParameter::MergeFrom(from.spp_param()); + } + if (from.has_slice_param()) { + mutable_slice_param()->::ditcaffe::SliceParameter::MergeFrom(from.slice_param()); + } + if (from.has_tanh_param()) { + mutable_tanh_param()->::ditcaffe::TanHParameter::MergeFrom(from.tanh_param()); + } + if (from.has_threshold_param()) { + mutable_threshold_param()->::ditcaffe::ThresholdParameter::MergeFrom(from.threshold_param()); + } + if (from.has_tile_param()) { + mutable_tile_param()->::ditcaffe::TileParameter::MergeFrom(from.tile_param()); + } + } + if (from._has_bits_[56 / 32] & (0xffu << (56 % 32))) { + if (from.has_window_data_param()) { + mutable_window_data_param()->::ditcaffe::WindowDataParameter::MergeFrom(from.window_data_param()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void LayerParameter::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void LayerParameter::CopyFrom(const LayerParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool LayerParameter::IsInitialized() const { + + return true; +} + +void LayerParameter::Swap(LayerParameter* other) { + if (other != this) { + std::swap(name_, other->name_); + std::swap(type_, other->type_); + bottom_.Swap(&other->bottom_); + top_.Swap(&other->top_); + std::swap(phase_, other->phase_); + loss_weight_.Swap(&other->loss_weight_); + param_.Swap(&other->param_); + blobs_.Swap(&other->blobs_); + propagate_down_.Swap(&other->propagate_down_); + include_.Swap(&other->include_); + exclude_.Swap(&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(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(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(python_param_, other->python_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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + 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; +} + + +// =================================================================== + +#ifndef _MSC_VER +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 // !_MSC_VER + +TransformationParameter::TransformationParameter() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.TransformationParameter) +} + +void TransformationParameter::InitAsDefaultInstance() { +} + +TransformationParameter::TransformationParameter(const TransformationParameter& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.TransformationParameter) +} + +void TransformationParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + scale_ = 1; + mirror_ = false; + crop_size_ = 0u; + mean_file_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + force_color_ = false; + force_gray_ = false; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +TransformationParameter::~TransformationParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.TransformationParameter) + SharedDtor(); +} + +void TransformationParameter::SharedDtor() { + if (mean_file_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete mean_file_; + } + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +TransformationParameter* TransformationParameter::default_instance_ = NULL; + +TransformationParameter* TransformationParameter::New() const { + return new TransformationParameter; +} + +void TransformationParameter::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 111) { + ZR_(mirror_, force_gray_); + scale_ = 1; + crop_size_ = 0u; + if (has_mean_file()) { + if (mean_file_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + mean_file_->clear(); + } + } + } + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + mean_value_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool TransformationParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &scale_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &mirror_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &crop_size_))); + set_has_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, + "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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &force_color_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &force_gray_))); + set_has_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:ditcaffe.TransformationParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.TransformationParameter) + return false; +#undef DO_ +} + +void TransformationParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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, + "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 (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:ditcaffe.TransformationParameter) +} + +::google::protobuf::uint8* TransformationParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.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, + "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 (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.TransformationParameter) + return target; +} + +int TransformationParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // 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; + { + int data_size = 0; + data_size = 4 * this->mean_value_size(); + total_size += 1 * this->mean_value_size() + data_size; + } + + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void TransformationParameter::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const TransformationParameter* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void TransformationParameter::MergeFrom(const TransformationParameter& from) { + GOOGLE_CHECK_NE(&from, this); + mean_value_.MergeFrom(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_mean_file(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()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void TransformationParameter::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void TransformationParameter::CopyFrom(const TransformationParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool TransformationParameter::IsInitialized() const { + + return true; +} + +void TransformationParameter::Swap(TransformationParameter* other) { + if (other != this) { + std::swap(scale_, other->scale_); + std::swap(mirror_, other->mirror_); + std::swap(crop_size_, other->crop_size_); + std::swap(mean_file_, other->mean_file_); + mean_value_.Swap(&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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + 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; +} + + +// =================================================================== + +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; + } +} + +#ifndef _MSC_VER +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 // _MSC_VER +#ifndef _MSC_VER +const int LossParameter::kIgnoreLabelFieldNumber; +const int LossParameter::kNormalizationFieldNumber; +const int LossParameter::kNormalizeFieldNumber; +#endif // !_MSC_VER + +LossParameter::LossParameter() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.LossParameter) +} + +void LossParameter::InitAsDefaultInstance() { +} + +LossParameter::LossParameter(const LossParameter& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.LossParameter) +} + +void LossParameter::SharedCtor() { + _cached_size_ = 0; + ignore_label_ = 0; + normalization_ = 1; + normalize_ = false; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +LossParameter::~LossParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.LossParameter) + SharedDtor(); +} + +void LossParameter::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +LossParameter* LossParameter::default_instance_ = NULL; + +LossParameter* LossParameter::New() const { + return new LossParameter; +} + +void LossParameter::Clear() { + if (_has_bits_[0 / 32] & 7) { + ignore_label_ = 0; + normalization_ = 1; + normalize_ = false; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool LossParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &ignore_label_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &normalize_))); + set_has_normalize(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(24)) goto parse_normalization; + break; + } + + // optional .ditcaffe.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 (::ditcaffe::LossParameter_NormalizationMode_IsValid(value)) { + set_normalization(static_cast< ::ditcaffe::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:ditcaffe.LossParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.LossParameter) + return false; +#undef DO_ +} + +void LossParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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 .ditcaffe.LossParameter.NormalizationMode normalization = 3 [default = VALID]; + if (has_normalization()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 3, this->normalization(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:ditcaffe.LossParameter) +} + +::google::protobuf::uint8* LossParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.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 .ditcaffe.LossParameter.NormalizationMode normalization = 3 [default = VALID]; + if (has_normalization()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 3, this->normalization(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.LossParameter) + return target; +} + +int LossParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional int32 ignore_label = 1; + if (has_ignore_label()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->ignore_label()); + } + + // optional .ditcaffe.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 (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void LossParameter::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const LossParameter* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void LossParameter::MergeFrom(const LossParameter& from) { + GOOGLE_CHECK_NE(&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()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void LossParameter::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void LossParameter::CopyFrom(const LossParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool LossParameter::IsInitialized() const { + + return true; +} + +void LossParameter::Swap(LossParameter* other) { + if (other != this) { + 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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + 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; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int AccuracyParameter::kTopKFieldNumber; +const int AccuracyParameter::kAxisFieldNumber; +const int AccuracyParameter::kIgnoreLabelFieldNumber; +#endif // !_MSC_VER + +AccuracyParameter::AccuracyParameter() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.AccuracyParameter) +} + +void AccuracyParameter::InitAsDefaultInstance() { +} + +AccuracyParameter::AccuracyParameter(const AccuracyParameter& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.AccuracyParameter) +} + +void AccuracyParameter::SharedCtor() { + _cached_size_ = 0; + top_k_ = 1u; + axis_ = 1; + ignore_label_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +AccuracyParameter::~AccuracyParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.AccuracyParameter) + SharedDtor(); +} + +void AccuracyParameter::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +AccuracyParameter* AccuracyParameter::default_instance_ = NULL; + +AccuracyParameter* AccuracyParameter::New() const { + return new AccuracyParameter; +} + +void AccuracyParameter::Clear() { + if (_has_bits_[0 / 32] & 7) { + top_k_ = 1u; + axis_ = 1; + ignore_label_ = 0; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool AccuracyParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &top_k_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &ignore_label_))); + set_has_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:ditcaffe.AccuracyParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.AccuracyParameter) + return false; +#undef DO_ +} + +void AccuracyParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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 (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:ditcaffe.AccuracyParameter) +} + +::google::protobuf::uint8* AccuracyParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.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 (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.AccuracyParameter) + return target; +} + +int AccuracyParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // 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 (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void AccuracyParameter::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const AccuracyParameter* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void AccuracyParameter::MergeFrom(const AccuracyParameter& from) { + GOOGLE_CHECK_NE(&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()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void AccuracyParameter::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void AccuracyParameter::CopyFrom(const AccuracyParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool AccuracyParameter::IsInitialized() const { + + return true; +} + +void AccuracyParameter::Swap(AccuracyParameter* other) { + if (other != this) { + 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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + 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; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int ArgMaxParameter::kOutMaxValFieldNumber; +const int ArgMaxParameter::kTopKFieldNumber; +const int ArgMaxParameter::kAxisFieldNumber; +#endif // !_MSC_VER + +ArgMaxParameter::ArgMaxParameter() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.ArgMaxParameter) +} + +void ArgMaxParameter::InitAsDefaultInstance() { +} + +ArgMaxParameter::ArgMaxParameter(const ArgMaxParameter& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.ArgMaxParameter) +} + +void ArgMaxParameter::SharedCtor() { + _cached_size_ = 0; + out_max_val_ = false; + top_k_ = 1u; + axis_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ArgMaxParameter::~ArgMaxParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.ArgMaxParameter) + SharedDtor(); +} + +void ArgMaxParameter::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +ArgMaxParameter* ArgMaxParameter::default_instance_ = NULL; + +ArgMaxParameter* ArgMaxParameter::New() const { + return new ArgMaxParameter; +} + +void ArgMaxParameter::Clear() { + if (_has_bits_[0 / 32] & 7) { + out_max_val_ = false; + top_k_ = 1u; + axis_ = 0; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool ArgMaxParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &out_max_val_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &top_k_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + set_has_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:ditcaffe.ArgMaxParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.ArgMaxParameter) + return false; +#undef DO_ +} + +void ArgMaxParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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 (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:ditcaffe.ArgMaxParameter) +} + +::google::protobuf::uint8* ArgMaxParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.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 (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.ArgMaxParameter) + return target; +} + +int ArgMaxParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // 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 (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ArgMaxParameter::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const ArgMaxParameter* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void ArgMaxParameter::MergeFrom(const ArgMaxParameter& from) { + GOOGLE_CHECK_NE(&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()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void ArgMaxParameter::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ArgMaxParameter::CopyFrom(const ArgMaxParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ArgMaxParameter::IsInitialized() const { + + return true; +} + +void ArgMaxParameter::Swap(ArgMaxParameter* other) { + if (other != this) { + 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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + 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; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int ConcatParameter::kAxisFieldNumber; +const int ConcatParameter::kConcatDimFieldNumber; +#endif // !_MSC_VER + +ConcatParameter::ConcatParameter() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.ConcatParameter) +} + +void ConcatParameter::InitAsDefaultInstance() { +} + +ConcatParameter::ConcatParameter(const ConcatParameter& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.ConcatParameter) +} + +void ConcatParameter::SharedCtor() { + _cached_size_ = 0; + axis_ = 1; + concat_dim_ = 1u; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ConcatParameter::~ConcatParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.ConcatParameter) + SharedDtor(); +} + +void ConcatParameter::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +ConcatParameter* ConcatParameter::default_instance_ = NULL; + +ConcatParameter* ConcatParameter::New() const { + return new ConcatParameter; +} + +void ConcatParameter::Clear() { + if (_has_bits_[0 / 32] & 3) { + axis_ = 1; + concat_dim_ = 1u; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool ConcatParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &concat_dim_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + set_has_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:ditcaffe.ConcatParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.ConcatParameter) + return false; +#undef DO_ +} + +void ConcatParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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 (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:ditcaffe.ConcatParameter) +} + +::google::protobuf::uint8* ConcatParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.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 (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.ConcatParameter) + return target; +} + +int ConcatParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // 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 (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ConcatParameter::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const ConcatParameter* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void ConcatParameter::MergeFrom(const ConcatParameter& from) { + GOOGLE_CHECK_NE(&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()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void ConcatParameter::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ConcatParameter::CopyFrom(const ConcatParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ConcatParameter::IsInitialized() const { + + return true; +} + +void ConcatParameter::Swap(ConcatParameter* other) { + if (other != this) { + std::swap(axis_, other->axis_); + std::swap(concat_dim_, other->concat_dim_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + 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; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int BatchNormParameter::kUseGlobalStatsFieldNumber; +const int BatchNormParameter::kMovingAverageFractionFieldNumber; +const int BatchNormParameter::kEpsFieldNumber; +#endif // !_MSC_VER + +BatchNormParameter::BatchNormParameter() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.BatchNormParameter) +} + +void BatchNormParameter::InitAsDefaultInstance() { +} + +BatchNormParameter::BatchNormParameter(const BatchNormParameter& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.BatchNormParameter) +} + +void BatchNormParameter::SharedCtor() { + _cached_size_ = 0; + use_global_stats_ = false; + moving_average_fraction_ = 0.999f; + eps_ = 1e-05f; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +BatchNormParameter::~BatchNormParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.BatchNormParameter) + SharedDtor(); +} + +void BatchNormParameter::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +BatchNormParameter* BatchNormParameter::default_instance_ = NULL; + +BatchNormParameter* BatchNormParameter::New() const { + return new BatchNormParameter; +} + +void BatchNormParameter::Clear() { + if (_has_bits_[0 / 32] & 7) { + use_global_stats_ = false; + moving_average_fraction_ = 0.999f; + eps_ = 1e-05f; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool BatchNormParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &use_global_stats_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &moving_average_fraction_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &eps_))); + set_has_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:ditcaffe.BatchNormParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.BatchNormParameter) + return false; +#undef DO_ +} + +void BatchNormParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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 (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:ditcaffe.BatchNormParameter) +} + +::google::protobuf::uint8* BatchNormParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.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 (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.BatchNormParameter) + return target; +} + +int BatchNormParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // 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 (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void BatchNormParameter::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const BatchNormParameter* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void BatchNormParameter::MergeFrom(const BatchNormParameter& from) { + GOOGLE_CHECK_NE(&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()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void BatchNormParameter::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void BatchNormParameter::CopyFrom(const BatchNormParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool BatchNormParameter::IsInitialized() const { + + return true; +} + +void BatchNormParameter::Swap(BatchNormParameter* other) { + if (other != this) { + 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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + 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; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int BiasParameter::kAxisFieldNumber; +const int BiasParameter::kNumAxesFieldNumber; +const int BiasParameter::kFillerFieldNumber; +#endif // !_MSC_VER + +BiasParameter::BiasParameter() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.BiasParameter) +} + +void BiasParameter::InitAsDefaultInstance() { + filler_ = const_cast< ::ditcaffe::FillerParameter*>(&::ditcaffe::FillerParameter::default_instance()); +} + +BiasParameter::BiasParameter(const BiasParameter& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.BiasParameter) +} + +void BiasParameter::SharedCtor() { + _cached_size_ = 0; + axis_ = 1; + num_axes_ = 1; + filler_ = NULL; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +BiasParameter::~BiasParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.BiasParameter) + SharedDtor(); +} + +void BiasParameter::SharedDtor() { + if (this != default_instance_) { + 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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +BiasParameter* BiasParameter::default_instance_ = NULL; + +BiasParameter* BiasParameter::New() const { + return new BiasParameter; +} + +void BiasParameter::Clear() { + if (_has_bits_[0 / 32] & 7) { + axis_ = 1; + num_axes_ = 1; + if (has_filler()) { + if (filler_ != NULL) filler_->::ditcaffe::FillerParameter::Clear(); + } + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool BiasParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &num_axes_))); + set_has_num_axes(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_filler; + break; + } + + // optional .ditcaffe.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:ditcaffe.BiasParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.BiasParameter) + return false; +#undef DO_ +} + +void BiasParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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 .ditcaffe.FillerParameter filler = 3; + if (has_filler()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, this->filler(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:ditcaffe.BiasParameter) +} + +::google::protobuf::uint8* BiasParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.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 .ditcaffe.FillerParameter filler = 3; + if (has_filler()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 3, this->filler(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.BiasParameter) + return target; +} + +int BiasParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // 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 .ditcaffe.FillerParameter filler = 3; + if (has_filler()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->filler()); + } + + } + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void BiasParameter::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const BiasParameter* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void BiasParameter::MergeFrom(const BiasParameter& from) { + GOOGLE_CHECK_NE(&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()->::ditcaffe::FillerParameter::MergeFrom(from.filler()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void BiasParameter::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void BiasParameter::CopyFrom(const BiasParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool BiasParameter::IsInitialized() const { + + return true; +} + +void BiasParameter::Swap(BiasParameter* other) { + if (other != this) { + 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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + 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; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int ContrastiveLossParameter::kMarginFieldNumber; +const int ContrastiveLossParameter::kLegacyVersionFieldNumber; +#endif // !_MSC_VER + +ContrastiveLossParameter::ContrastiveLossParameter() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.ContrastiveLossParameter) +} + +void ContrastiveLossParameter::InitAsDefaultInstance() { +} + +ContrastiveLossParameter::ContrastiveLossParameter(const ContrastiveLossParameter& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.ContrastiveLossParameter) +} + +void ContrastiveLossParameter::SharedCtor() { + _cached_size_ = 0; + margin_ = 1; + legacy_version_ = false; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ContrastiveLossParameter::~ContrastiveLossParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.ContrastiveLossParameter) + SharedDtor(); +} + +void ContrastiveLossParameter::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +ContrastiveLossParameter* ContrastiveLossParameter::default_instance_ = NULL; + +ContrastiveLossParameter* ContrastiveLossParameter::New() const { + return new ContrastiveLossParameter; +} + +void ContrastiveLossParameter::Clear() { + if (_has_bits_[0 / 32] & 3) { + margin_ = 1; + legacy_version_ = false; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool ContrastiveLossParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &margin_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &legacy_version_))); + set_has_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:ditcaffe.ContrastiveLossParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.ContrastiveLossParameter) + return false; +#undef DO_ +} + +void ContrastiveLossParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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 (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:ditcaffe.ContrastiveLossParameter) +} + +::google::protobuf::uint8* ContrastiveLossParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.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 (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.ContrastiveLossParameter) + return target; +} + +int ContrastiveLossParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // 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 (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ContrastiveLossParameter::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const ContrastiveLossParameter* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void ContrastiveLossParameter::MergeFrom(const ContrastiveLossParameter& from) { + GOOGLE_CHECK_NE(&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()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void ContrastiveLossParameter::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ContrastiveLossParameter::CopyFrom(const ContrastiveLossParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ContrastiveLossParameter::IsInitialized() const { + + return true; +} + +void ContrastiveLossParameter::Swap(ContrastiveLossParameter* other) { + if (other != this) { + std::swap(margin_, other->margin_); + std::swap(legacy_version_, other->legacy_version_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + 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; +} + + +// =================================================================== + +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; + } +} + +#ifndef _MSC_VER +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 // _MSC_VER +#ifndef _MSC_VER +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 // !_MSC_VER + +ConvolutionParameter::ConvolutionParameter() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.ConvolutionParameter) +} + +void ConvolutionParameter::InitAsDefaultInstance() { + weight_filler_ = const_cast< ::ditcaffe::FillerParameter*>(&::ditcaffe::FillerParameter::default_instance()); + bias_filler_ = const_cast< ::ditcaffe::FillerParameter*>(&::ditcaffe::FillerParameter::default_instance()); +} + +ConvolutionParameter::ConvolutionParameter(const ConvolutionParameter& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.ConvolutionParameter) +} + +void ConvolutionParameter::SharedCtor() { + _cached_size_ = 0; + num_output_ = 0u; + bias_term_ = true; + pad_h_ = 0u; + pad_w_ = 0u; + kernel_h_ = 0u; + kernel_w_ = 0u; + stride_h_ = 0u; + stride_w_ = 0u; + group_ = 1u; + weight_filler_ = NULL; + bias_filler_ = NULL; + engine_ = 0; + axis_ = 1; + force_nd_im2col_ = false; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ConvolutionParameter::~ConvolutionParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.ConvolutionParameter) + SharedDtor(); +} + +void ConvolutionParameter::SharedDtor() { + if (this != default_instance_) { + 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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +ConvolutionParameter* ConvolutionParameter::default_instance_ = NULL; + +ConvolutionParameter* ConvolutionParameter::New() const { + return new ConvolutionParameter; +} + +void ConvolutionParameter::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 195) { + ZR_(num_output_, pad_h_); + bias_term_ = true; + pad_w_ = 0u; + } + if (_has_bits_[8 / 32] & 65280) { + ZR_(kernel_h_, kernel_w_); + ZR_(stride_h_, stride_w_); + group_ = 1u; + if (has_weight_filler()) { + if (weight_filler_ != NULL) weight_filler_->::ditcaffe::FillerParameter::Clear(); + } + if (has_bias_filler()) { + if (bias_filler_ != NULL) bias_filler_->::ditcaffe::FillerParameter::Clear(); + } + engine_ = 0; + } + if (_has_bits_[16 / 32] & 196608) { + axis_ = 1; + force_nd_im2col_ = false; + } + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + pad_.Clear(); + kernel_size_.Clear(); + stride_.Clear(); + dilation_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool ConvolutionParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &num_output_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &bias_term_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &group_))); + set_has_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 .ditcaffe.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 .ditcaffe.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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &pad_h_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &pad_w_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &kernel_h_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &kernel_w_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &stride_h_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &stride_w_))); + set_has_stride_w(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(120)) goto parse_engine; + break; + } + + // optional .ditcaffe.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 (::ditcaffe::ConvolutionParameter_Engine_IsValid(value)) { + set_engine(static_cast< ::ditcaffe::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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &force_nd_im2col_))); + set_has_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:ditcaffe.ConvolutionParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.ConvolutionParameter) + return false; +#undef DO_ +} + +void ConvolutionParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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 .ditcaffe.FillerParameter weight_filler = 7; + if (has_weight_filler()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 7, this->weight_filler(), output); + } + + // optional .ditcaffe.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 .ditcaffe.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 (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:ditcaffe.ConvolutionParameter) +} + +::google::protobuf::uint8* ConvolutionParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.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 .ditcaffe.FillerParameter weight_filler = 7; + if (has_weight_filler()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 7, this->weight_filler(), target); + } + + // optional .ditcaffe.FillerParameter bias_filler = 8; + if (has_bias_filler()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 8, this->bias_filler(), 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 .ditcaffe.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 (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.ConvolutionParameter) + return target; +} + +int ConvolutionParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // 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] & (0xffu << (8 % 32))) { + // 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 .ditcaffe.FillerParameter weight_filler = 7; + if (has_weight_filler()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->weight_filler()); + } + + // optional .ditcaffe.FillerParameter bias_filler = 8; + if (has_bias_filler()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->bias_filler()); + } + + // optional .ditcaffe.ConvolutionParameter.Engine engine = 15 [default = DEFAULT]; + if (has_engine()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->engine()); + } + + } + if (_has_bits_[16 / 32] & (0xffu << (16 % 32))) { + // 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; + { + int data_size = 0; + for (int i = 0; i < this->pad_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->pad(i)); + } + total_size += 1 * this->pad_size() + data_size; + } + + // repeated uint32 kernel_size = 4; + { + int data_size = 0; + for (int i = 0; i < this->kernel_size_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->kernel_size(i)); + } + total_size += 1 * this->kernel_size_size() + data_size; + } + + // repeated uint32 stride = 6; + { + int data_size = 0; + for (int i = 0; i < this->stride_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->stride(i)); + } + total_size += 1 * this->stride_size() + data_size; + } + + // repeated uint32 dilation = 18; + { + int data_size = 0; + for (int i = 0; i < this->dilation_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->dilation(i)); + } + total_size += 2 * this->dilation_size() + data_size; + } + + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ConvolutionParameter::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const ConvolutionParameter* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void ConvolutionParameter::MergeFrom(const ConvolutionParameter& from) { + GOOGLE_CHECK_NE(&from, this); + pad_.MergeFrom(from.pad_); + kernel_size_.MergeFrom(from.kernel_size_); + stride_.MergeFrom(from.stride_); + dilation_.MergeFrom(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()->::ditcaffe::FillerParameter::MergeFrom(from.weight_filler()); + } + if (from.has_bias_filler()) { + mutable_bias_filler()->::ditcaffe::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()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void ConvolutionParameter::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ConvolutionParameter::CopyFrom(const ConvolutionParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ConvolutionParameter::IsInitialized() const { + + return true; +} + +void ConvolutionParameter::Swap(ConvolutionParameter* other) { + if (other != this) { + std::swap(num_output_, other->num_output_); + std::swap(bias_term_, other->bias_term_); + pad_.Swap(&other->pad_); + kernel_size_.Swap(&other->kernel_size_); + stride_.Swap(&other->stride_); + dilation_.Swap(&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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + 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; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int CropParameter::kAxisFieldNumber; +const int CropParameter::kOffsetFieldNumber; +#endif // !_MSC_VER + +CropParameter::CropParameter() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.CropParameter) +} + +void CropParameter::InitAsDefaultInstance() { +} + +CropParameter::CropParameter(const CropParameter& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.CropParameter) +} + +void CropParameter::SharedCtor() { + _cached_size_ = 0; + axis_ = 2; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +CropParameter::~CropParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.CropParameter) + SharedDtor(); +} + +void CropParameter::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +CropParameter* CropParameter::default_instance_ = NULL; + +CropParameter* CropParameter::New() const { + return new CropParameter; +} + +void CropParameter::Clear() { + axis_ = 2; + offset_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool CropParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + set_has_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:ditcaffe.CropParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.CropParameter) + return false; +#undef DO_ +} + +void CropParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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 (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:ditcaffe.CropParameter) +} + +::google::protobuf::uint8* CropParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.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 (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.CropParameter) + return target; +} + +int CropParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional int32 axis = 1 [default = 2]; + if (has_axis()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->axis()); + } + + } + // repeated uint32 offset = 2; + { + int data_size = 0; + for (int i = 0; i < this->offset_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->offset(i)); + } + total_size += 1 * this->offset_size() + data_size; + } + + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void CropParameter::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const CropParameter* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void CropParameter::MergeFrom(const CropParameter& from) { + GOOGLE_CHECK_NE(&from, this); + offset_.MergeFrom(from.offset_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_axis()) { + set_axis(from.axis()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void CropParameter::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void CropParameter::CopyFrom(const CropParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool CropParameter::IsInitialized() const { + + return true; +} + +void CropParameter::Swap(CropParameter* other) { + if (other != this) { + std::swap(axis_, other->axis_); + offset_.Swap(&other->offset_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + 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; +} + + +// =================================================================== + +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; + } +} + +#ifndef _MSC_VER +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 // _MSC_VER +#ifndef _MSC_VER +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 // !_MSC_VER + +DataParameter::DataParameter() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.DataParameter) +} + +void DataParameter::InitAsDefaultInstance() { +} + +DataParameter::DataParameter(const DataParameter& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.DataParameter) +} + +void DataParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + source_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + batch_size_ = 0u; + rand_skip_ = 0u; + backend_ = 0; + scale_ = 1; + mean_file_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + crop_size_ = 0u; + mirror_ = false; + force_encoded_color_ = false; + prefetch_ = 4u; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +DataParameter::~DataParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.DataParameter) + SharedDtor(); +} + +void DataParameter::SharedDtor() { + if (source_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete source_; + } + if (mean_file_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete mean_file_; + } + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +DataParameter* DataParameter::default_instance_ = NULL; + +DataParameter* DataParameter::New() const { + return new DataParameter; +} + +void DataParameter::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 255) { + ZR_(batch_size_, backend_); + ZR_(crop_size_, mirror_); + if (has_source()) { + if (source_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_->clear(); + } + } + scale_ = 1; + if (has_mean_file()) { + if (mean_file_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + mean_file_->clear(); + } + } + } + if (_has_bits_[8 / 32] & 768) { + force_encoded_color_ = false; + prefetch_ = 4u; + } + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool DataParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:ditcaffe.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, + "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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &scale_))); + set_has_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, + "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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &batch_size_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &crop_size_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &mirror_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &rand_skip_))); + set_has_rand_skip(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(64)) goto parse_backend; + break; + } + + // optional .ditcaffe.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 (::ditcaffe::DataParameter_DB_IsValid(value)) { + set_backend(static_cast< ::ditcaffe::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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &force_encoded_color_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &prefetch_))); + set_has_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:ditcaffe.DataParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.DataParameter) + return false; +#undef DO_ +} + +void DataParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.DataParameter) + // optional string source = 1; + if (has_source()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->source().data(), this->source().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "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, + "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 .ditcaffe.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 (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:ditcaffe.DataParameter) +} + +::google::protobuf::uint8* DataParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.DataParameter) + // optional string source = 1; + if (has_source()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->source().data(), this->source().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "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, + "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 .ditcaffe.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 (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.DataParameter) + return target; +} + +int DataParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // 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 .ditcaffe.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] & (0xffu << (8 % 32))) { + // 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 (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void DataParameter::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const DataParameter* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void DataParameter::MergeFrom(const DataParameter& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_source()) { + set_source(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_mean_file(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()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void DataParameter::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void DataParameter::CopyFrom(const DataParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool DataParameter::IsInitialized() const { + + return true; +} + +void DataParameter::Swap(DataParameter* other) { + if (other != this) { + std::swap(source_, 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_); + std::swap(mean_file_, 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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + 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; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int DropoutParameter::kDropoutRatioFieldNumber; +#endif // !_MSC_VER + +DropoutParameter::DropoutParameter() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.DropoutParameter) +} + +void DropoutParameter::InitAsDefaultInstance() { +} + +DropoutParameter::DropoutParameter(const DropoutParameter& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.DropoutParameter) +} + +void DropoutParameter::SharedCtor() { + _cached_size_ = 0; + dropout_ratio_ = 0.5f; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +DropoutParameter::~DropoutParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.DropoutParameter) + SharedDtor(); +} + +void DropoutParameter::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +DropoutParameter* DropoutParameter::default_instance_ = NULL; + +DropoutParameter* DropoutParameter::New() const { + return new DropoutParameter; +} + +void DropoutParameter::Clear() { + dropout_ratio_ = 0.5f; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool DropoutParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &dropout_ratio_))); + set_has_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:ditcaffe.DropoutParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.DropoutParameter) + return false; +#undef DO_ +} + +void DropoutParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.DropoutParameter) + // optional float dropout_ratio = 1 [default = 0.5]; + if (has_dropout_ratio()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->dropout_ratio(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:ditcaffe.DropoutParameter) +} + +::google::protobuf::uint8* DropoutParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.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 (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.DropoutParameter) + return target; +} + +int DropoutParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional float dropout_ratio = 1 [default = 0.5]; + if (has_dropout_ratio()) { + total_size += 1 + 4; + } + + } + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void DropoutParameter::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const DropoutParameter* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void DropoutParameter::MergeFrom(const DropoutParameter& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_dropout_ratio()) { + set_dropout_ratio(from.dropout_ratio()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void DropoutParameter::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void DropoutParameter::CopyFrom(const DropoutParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool DropoutParameter::IsInitialized() const { + + return true; +} + +void DropoutParameter::Swap(DropoutParameter* other) { + if (other != this) { + std::swap(dropout_ratio_, other->dropout_ratio_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + 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; +} + + +// =================================================================== + +#ifndef _MSC_VER +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 // !_MSC_VER + +DummyDataParameter::DummyDataParameter() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.DummyDataParameter) +} + +void DummyDataParameter::InitAsDefaultInstance() { +} + +DummyDataParameter::DummyDataParameter(const DummyDataParameter& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.DummyDataParameter) +} + +void DummyDataParameter::SharedCtor() { + _cached_size_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +DummyDataParameter::~DummyDataParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.DummyDataParameter) + SharedDtor(); +} + +void DummyDataParameter::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +DummyDataParameter* DummyDataParameter::default_instance_ = NULL; + +DummyDataParameter* DummyDataParameter::New() const { + return new DummyDataParameter; +} + +void DummyDataParameter::Clear() { + data_filler_.Clear(); + shape_.Clear(); + num_.Clear(); + channels_.Clear(); + height_.Clear(); + width_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool DummyDataParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:ditcaffe.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 .ditcaffe.FillerParameter data_filler = 1; + case 1: { + if (tag == 10) { + parse_data_filler: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_data_filler())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(10)) goto parse_data_filler; + 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 .ditcaffe.BlobShape shape = 6; + case 6: { + if (tag == 50) { + parse_shape: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_shape())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(50)) goto parse_shape; + 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:ditcaffe.DummyDataParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.DummyDataParameter) + return false; +#undef DO_ +} + +void DummyDataParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.DummyDataParameter) + // repeated .ditcaffe.FillerParameter data_filler = 1; + for (int i = 0; i < this->data_filler_size(); 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 .ditcaffe.BlobShape shape = 6; + for (int i = 0; i < this->shape_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 6, this->shape(i), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:ditcaffe.DummyDataParameter) +} + +::google::protobuf::uint8* DummyDataParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.DummyDataParameter) + // repeated .ditcaffe.FillerParameter data_filler = 1; + for (int i = 0; i < this->data_filler_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 1, this->data_filler(i), 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 .ditcaffe.BlobShape shape = 6; + for (int i = 0; i < this->shape_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 6, this->shape(i), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.DummyDataParameter) + return target; +} + +int DummyDataParameter::ByteSize() const { + int total_size = 0; + + // repeated .ditcaffe.FillerParameter data_filler = 1; + total_size += 1 * this->data_filler_size(); + for (int i = 0; i < this->data_filler_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->data_filler(i)); + } + + // repeated .ditcaffe.BlobShape shape = 6; + total_size += 1 * this->shape_size(); + for (int i = 0; i < this->shape_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->shape(i)); + } + + // repeated uint32 num = 2; + { + int data_size = 0; + for (int i = 0; i < this->num_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->num(i)); + } + total_size += 1 * this->num_size() + data_size; + } + + // repeated uint32 channels = 3; + { + int data_size = 0; + for (int i = 0; i < this->channels_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->channels(i)); + } + total_size += 1 * this->channels_size() + data_size; + } + + // repeated uint32 height = 4; + { + int data_size = 0; + for (int i = 0; i < this->height_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->height(i)); + } + total_size += 1 * this->height_size() + data_size; + } + + // repeated uint32 width = 5; + { + int data_size = 0; + for (int i = 0; i < this->width_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->width(i)); + } + total_size += 1 * this->width_size() + data_size; + } + + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void DummyDataParameter::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const DummyDataParameter* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void DummyDataParameter::MergeFrom(const DummyDataParameter& from) { + GOOGLE_CHECK_NE(&from, this); + data_filler_.MergeFrom(from.data_filler_); + shape_.MergeFrom(from.shape_); + num_.MergeFrom(from.num_); + channels_.MergeFrom(from.channels_); + height_.MergeFrom(from.height_); + width_.MergeFrom(from.width_); + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void DummyDataParameter::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void DummyDataParameter::CopyFrom(const DummyDataParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool DummyDataParameter::IsInitialized() const { + + return true; +} + +void DummyDataParameter::Swap(DummyDataParameter* other) { + if (other != this) { + data_filler_.Swap(&other->data_filler_); + shape_.Swap(&other->shape_); + num_.Swap(&other->num_); + channels_.Swap(&other->channels_); + height_.Swap(&other->height_); + width_.Swap(&other->width_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + 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; +} + + +// =================================================================== + +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; + } +} + +#ifndef _MSC_VER +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 // _MSC_VER +#ifndef _MSC_VER +const int EltwiseParameter::kOperationFieldNumber; +const int EltwiseParameter::kCoeffFieldNumber; +const int EltwiseParameter::kStableProdGradFieldNumber; +#endif // !_MSC_VER + +EltwiseParameter::EltwiseParameter() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.EltwiseParameter) +} + +void EltwiseParameter::InitAsDefaultInstance() { +} + +EltwiseParameter::EltwiseParameter(const EltwiseParameter& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.EltwiseParameter) +} + +void EltwiseParameter::SharedCtor() { + _cached_size_ = 0; + operation_ = 1; + stable_prod_grad_ = true; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +EltwiseParameter::~EltwiseParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.EltwiseParameter) + SharedDtor(); +} + +void EltwiseParameter::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +EltwiseParameter* EltwiseParameter::default_instance_ = NULL; + +EltwiseParameter* EltwiseParameter::New() const { + return new EltwiseParameter; +} + +void EltwiseParameter::Clear() { + if (_has_bits_[0 / 32] & 5) { + operation_ = 1; + stable_prod_grad_ = true; + } + coeff_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool EltwiseParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:ditcaffe.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 .ditcaffe.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 (::ditcaffe::EltwiseParameter_EltwiseOp_IsValid(value)) { + set_operation(static_cast< ::ditcaffe::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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &stable_prod_grad_))); + set_has_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:ditcaffe.EltwiseParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.EltwiseParameter) + return false; +#undef DO_ +} + +void EltwiseParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.EltwiseParameter) + // optional .ditcaffe.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 (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:ditcaffe.EltwiseParameter) +} + +::google::protobuf::uint8* EltwiseParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.EltwiseParameter) + // optional .ditcaffe.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 (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.EltwiseParameter) + return target; +} + +int EltwiseParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional .ditcaffe.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; + { + int data_size = 0; + data_size = 4 * this->coeff_size(); + total_size += 1 * this->coeff_size() + data_size; + } + + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void EltwiseParameter::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const EltwiseParameter* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void EltwiseParameter::MergeFrom(const EltwiseParameter& from) { + GOOGLE_CHECK_NE(&from, this); + coeff_.MergeFrom(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()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void EltwiseParameter::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void EltwiseParameter::CopyFrom(const EltwiseParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool EltwiseParameter::IsInitialized() const { + + return true; +} + +void EltwiseParameter::Swap(EltwiseParameter* other) { + if (other != this) { + std::swap(operation_, other->operation_); + coeff_.Swap(&other->coeff_); + std::swap(stable_prod_grad_, other->stable_prod_grad_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + 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; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int ELUParameter::kAlphaFieldNumber; +#endif // !_MSC_VER + +ELUParameter::ELUParameter() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.ELUParameter) +} + +void ELUParameter::InitAsDefaultInstance() { +} + +ELUParameter::ELUParameter(const ELUParameter& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.ELUParameter) +} + +void ELUParameter::SharedCtor() { + _cached_size_ = 0; + alpha_ = 1; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ELUParameter::~ELUParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.ELUParameter) + SharedDtor(); +} + +void ELUParameter::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +ELUParameter* ELUParameter::default_instance_ = NULL; + +ELUParameter* ELUParameter::New() const { + return new ELUParameter; +} + +void ELUParameter::Clear() { + alpha_ = 1; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool ELUParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &alpha_))); + set_has_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:ditcaffe.ELUParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.ELUParameter) + return false; +#undef DO_ +} + +void ELUParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.ELUParameter) + // optional float alpha = 1 [default = 1]; + if (has_alpha()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->alpha(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:ditcaffe.ELUParameter) +} + +::google::protobuf::uint8* ELUParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.ELUParameter) + // optional float alpha = 1 [default = 1]; + if (has_alpha()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(1, this->alpha(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.ELUParameter) + return target; +} + +int ELUParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional float alpha = 1 [default = 1]; + if (has_alpha()) { + total_size += 1 + 4; + } + + } + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ELUParameter::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const ELUParameter* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void ELUParameter::MergeFrom(const ELUParameter& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_alpha()) { + set_alpha(from.alpha()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void ELUParameter::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ELUParameter::CopyFrom(const ELUParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ELUParameter::IsInitialized() const { + + return true; +} + +void ELUParameter::Swap(ELUParameter* other) { + if (other != this) { + std::swap(alpha_, other->alpha_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + 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; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int EmbedParameter::kNumOutputFieldNumber; +const int EmbedParameter::kInputDimFieldNumber; +const int EmbedParameter::kBiasTermFieldNumber; +const int EmbedParameter::kWeightFillerFieldNumber; +const int EmbedParameter::kBiasFillerFieldNumber; +#endif // !_MSC_VER + +EmbedParameter::EmbedParameter() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.EmbedParameter) +} + +void EmbedParameter::InitAsDefaultInstance() { + weight_filler_ = const_cast< ::ditcaffe::FillerParameter*>(&::ditcaffe::FillerParameter::default_instance()); + bias_filler_ = const_cast< ::ditcaffe::FillerParameter*>(&::ditcaffe::FillerParameter::default_instance()); +} + +EmbedParameter::EmbedParameter(const EmbedParameter& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.EmbedParameter) +} + +void EmbedParameter::SharedCtor() { + _cached_size_ = 0; + num_output_ = 0u; + input_dim_ = 0u; + bias_term_ = true; + weight_filler_ = NULL; + bias_filler_ = NULL; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +EmbedParameter::~EmbedParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.EmbedParameter) + SharedDtor(); +} + +void EmbedParameter::SharedDtor() { + if (this != default_instance_) { + 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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +EmbedParameter* EmbedParameter::default_instance_ = NULL; + +EmbedParameter* EmbedParameter::New() const { + return new EmbedParameter; +} + +void EmbedParameter::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 31) { + ZR_(num_output_, input_dim_); + bias_term_ = true; + if (has_weight_filler()) { + if (weight_filler_ != NULL) weight_filler_->::ditcaffe::FillerParameter::Clear(); + } + if (has_bias_filler()) { + if (bias_filler_ != NULL) bias_filler_->::ditcaffe::FillerParameter::Clear(); + } + } + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool EmbedParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &num_output_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &input_dim_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &bias_term_))); + set_has_bias_term(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(34)) goto parse_weight_filler; + break; + } + + // optional .ditcaffe.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 .ditcaffe.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:ditcaffe.EmbedParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.EmbedParameter) + return false; +#undef DO_ +} + +void EmbedParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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 .ditcaffe.FillerParameter weight_filler = 4; + if (has_weight_filler()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, this->weight_filler(), output); + } + + // optional .ditcaffe.FillerParameter bias_filler = 5; + if (has_bias_filler()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 5, this->bias_filler(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:ditcaffe.EmbedParameter) +} + +::google::protobuf::uint8* EmbedParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.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 .ditcaffe.FillerParameter weight_filler = 4; + if (has_weight_filler()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 4, this->weight_filler(), target); + } + + // optional .ditcaffe.FillerParameter bias_filler = 5; + if (has_bias_filler()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 5, this->bias_filler(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.EmbedParameter) + return target; +} + +int EmbedParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // 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 .ditcaffe.FillerParameter weight_filler = 4; + if (has_weight_filler()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->weight_filler()); + } + + // optional .ditcaffe.FillerParameter bias_filler = 5; + if (has_bias_filler()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->bias_filler()); + } + + } + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void EmbedParameter::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const EmbedParameter* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void EmbedParameter::MergeFrom(const EmbedParameter& from) { + GOOGLE_CHECK_NE(&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()->::ditcaffe::FillerParameter::MergeFrom(from.weight_filler()); + } + if (from.has_bias_filler()) { + mutable_bias_filler()->::ditcaffe::FillerParameter::MergeFrom(from.bias_filler()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void EmbedParameter::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void EmbedParameter::CopyFrom(const EmbedParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool EmbedParameter::IsInitialized() const { + + return true; +} + +void EmbedParameter::Swap(EmbedParameter* other) { + if (other != this) { + 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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + 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; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int ExpParameter::kBaseFieldNumber; +const int ExpParameter::kScaleFieldNumber; +const int ExpParameter::kShiftFieldNumber; +#endif // !_MSC_VER + +ExpParameter::ExpParameter() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.ExpParameter) +} + +void ExpParameter::InitAsDefaultInstance() { +} + +ExpParameter::ExpParameter(const ExpParameter& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.ExpParameter) +} + +void ExpParameter::SharedCtor() { + _cached_size_ = 0; + base_ = -1; + scale_ = 1; + shift_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ExpParameter::~ExpParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.ExpParameter) + SharedDtor(); +} + +void ExpParameter::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +ExpParameter* ExpParameter::default_instance_ = NULL; + +ExpParameter* ExpParameter::New() const { + return new ExpParameter; +} + +void ExpParameter::Clear() { + if (_has_bits_[0 / 32] & 7) { + base_ = -1; + scale_ = 1; + shift_ = 0; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool ExpParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &base_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &scale_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &shift_))); + set_has_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:ditcaffe.ExpParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.ExpParameter) + return false; +#undef DO_ +} + +void ExpParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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 (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:ditcaffe.ExpParameter) +} + +::google::protobuf::uint8* ExpParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.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 (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.ExpParameter) + return target; +} + +int ExpParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // 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 (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ExpParameter::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const ExpParameter* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void ExpParameter::MergeFrom(const ExpParameter& from) { + GOOGLE_CHECK_NE(&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()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void ExpParameter::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ExpParameter::CopyFrom(const ExpParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ExpParameter::IsInitialized() const { + + return true; +} + +void ExpParameter::Swap(ExpParameter* other) { + if (other != this) { + std::swap(base_, other->base_); + std::swap(scale_, other->scale_); + std::swap(shift_, other->shift_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + 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; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int FlattenParameter::kAxisFieldNumber; +const int FlattenParameter::kEndAxisFieldNumber; +#endif // !_MSC_VER + +FlattenParameter::FlattenParameter() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.FlattenParameter) +} + +void FlattenParameter::InitAsDefaultInstance() { +} + +FlattenParameter::FlattenParameter(const FlattenParameter& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.FlattenParameter) +} + +void FlattenParameter::SharedCtor() { + _cached_size_ = 0; + axis_ = 1; + end_axis_ = -1; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +FlattenParameter::~FlattenParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.FlattenParameter) + SharedDtor(); +} + +void FlattenParameter::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +FlattenParameter* FlattenParameter::default_instance_ = NULL; + +FlattenParameter* FlattenParameter::New() const { + return new FlattenParameter; +} + +void FlattenParameter::Clear() { + if (_has_bits_[0 / 32] & 3) { + axis_ = 1; + end_axis_ = -1; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool FlattenParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &end_axis_))); + set_has_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:ditcaffe.FlattenParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.FlattenParameter) + return false; +#undef DO_ +} + +void FlattenParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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 (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:ditcaffe.FlattenParameter) +} + +::google::protobuf::uint8* FlattenParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.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 (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.FlattenParameter) + return target; +} + +int FlattenParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // 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 (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void FlattenParameter::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const FlattenParameter* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void FlattenParameter::MergeFrom(const FlattenParameter& from) { + GOOGLE_CHECK_NE(&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()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void FlattenParameter::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void FlattenParameter::CopyFrom(const FlattenParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool FlattenParameter::IsInitialized() const { + + return true; +} + +void FlattenParameter::Swap(FlattenParameter* other) { + if (other != this) { + std::swap(axis_, other->axis_); + std::swap(end_axis_, other->end_axis_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + 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; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int HDF5DataParameter::kSourceFieldNumber; +const int HDF5DataParameter::kBatchSizeFieldNumber; +const int HDF5DataParameter::kShuffleFieldNumber; +#endif // !_MSC_VER + +HDF5DataParameter::HDF5DataParameter() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.HDF5DataParameter) +} + +void HDF5DataParameter::InitAsDefaultInstance() { +} + +HDF5DataParameter::HDF5DataParameter(const HDF5DataParameter& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.HDF5DataParameter) +} + +void HDF5DataParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + source_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + batch_size_ = 0u; + shuffle_ = false; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +HDF5DataParameter::~HDF5DataParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.HDF5DataParameter) + SharedDtor(); +} + +void HDF5DataParameter::SharedDtor() { + if (source_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete source_; + } + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +HDF5DataParameter* HDF5DataParameter::default_instance_ = NULL; + +HDF5DataParameter* HDF5DataParameter::New() const { + return new HDF5DataParameter; +} + +void HDF5DataParameter::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 7) { + ZR_(batch_size_, shuffle_); + if (has_source()) { + if (source_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_->clear(); + } + } + } + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool HDF5DataParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:ditcaffe.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, + "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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &batch_size_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &shuffle_))); + set_has_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:ditcaffe.HDF5DataParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.HDF5DataParameter) + return false; +#undef DO_ +} + +void HDF5DataParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.HDF5DataParameter) + // optional string source = 1; + if (has_source()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->source().data(), this->source().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "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 (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:ditcaffe.HDF5DataParameter) +} + +::google::protobuf::uint8* HDF5DataParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.HDF5DataParameter) + // optional string source = 1; + if (has_source()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->source().data(), this->source().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "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 (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.HDF5DataParameter) + return target; +} + +int HDF5DataParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // 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 (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void HDF5DataParameter::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const HDF5DataParameter* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void HDF5DataParameter::MergeFrom(const HDF5DataParameter& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_source()) { + set_source(from.source()); + } + if (from.has_batch_size()) { + set_batch_size(from.batch_size()); + } + if (from.has_shuffle()) { + set_shuffle(from.shuffle()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void HDF5DataParameter::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void HDF5DataParameter::CopyFrom(const HDF5DataParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool HDF5DataParameter::IsInitialized() const { + + return true; +} + +void HDF5DataParameter::Swap(HDF5DataParameter* other) { + if (other != this) { + std::swap(source_, other->source_); + std::swap(batch_size_, other->batch_size_); + std::swap(shuffle_, other->shuffle_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + 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; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int HDF5OutputParameter::kFileNameFieldNumber; +#endif // !_MSC_VER + +HDF5OutputParameter::HDF5OutputParameter() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.HDF5OutputParameter) +} + +void HDF5OutputParameter::InitAsDefaultInstance() { +} + +HDF5OutputParameter::HDF5OutputParameter(const HDF5OutputParameter& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.HDF5OutputParameter) +} + +void HDF5OutputParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + file_name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +HDF5OutputParameter::~HDF5OutputParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.HDF5OutputParameter) + SharedDtor(); +} + +void HDF5OutputParameter::SharedDtor() { + if (file_name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete file_name_; + } + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +HDF5OutputParameter* HDF5OutputParameter::default_instance_ = NULL; + +HDF5OutputParameter* HDF5OutputParameter::New() const { + return new HDF5OutputParameter; +} + +void HDF5OutputParameter::Clear() { + if (has_file_name()) { + if (file_name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + file_name_->clear(); + } + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool HDF5OutputParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:ditcaffe.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, + "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:ditcaffe.HDF5OutputParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.HDF5OutputParameter) + return false; +#undef DO_ +} + +void HDF5OutputParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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, + "file_name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->file_name(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:ditcaffe.HDF5OutputParameter) +} + +::google::protobuf::uint8* HDF5OutputParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.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, + "file_name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->file_name(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.HDF5OutputParameter) + return target; +} + +int HDF5OutputParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional string file_name = 1; + if (has_file_name()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->file_name()); + } + + } + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void HDF5OutputParameter::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const HDF5OutputParameter* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void HDF5OutputParameter::MergeFrom(const HDF5OutputParameter& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_file_name()) { + set_file_name(from.file_name()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void HDF5OutputParameter::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void HDF5OutputParameter::CopyFrom(const HDF5OutputParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool HDF5OutputParameter::IsInitialized() const { + + return true; +} + +void HDF5OutputParameter::Swap(HDF5OutputParameter* other) { + if (other != this) { + std::swap(file_name_, other->file_name_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + 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; +} + + +// =================================================================== + +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; + } +} + +#ifndef _MSC_VER +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 // _MSC_VER +#ifndef _MSC_VER +const int HingeLossParameter::kNormFieldNumber; +#endif // !_MSC_VER + +HingeLossParameter::HingeLossParameter() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.HingeLossParameter) +} + +void HingeLossParameter::InitAsDefaultInstance() { +} + +HingeLossParameter::HingeLossParameter(const HingeLossParameter& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.HingeLossParameter) +} + +void HingeLossParameter::SharedCtor() { + _cached_size_ = 0; + norm_ = 1; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +HingeLossParameter::~HingeLossParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.HingeLossParameter) + SharedDtor(); +} + +void HingeLossParameter::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +HingeLossParameter* HingeLossParameter::default_instance_ = NULL; + +HingeLossParameter* HingeLossParameter::New() const { + return new HingeLossParameter; +} + +void HingeLossParameter::Clear() { + norm_ = 1; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool HingeLossParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:ditcaffe.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 .ditcaffe.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 (::ditcaffe::HingeLossParameter_Norm_IsValid(value)) { + set_norm(static_cast< ::ditcaffe::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:ditcaffe.HingeLossParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.HingeLossParameter) + return false; +#undef DO_ +} + +void HingeLossParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.HingeLossParameter) + // optional .ditcaffe.HingeLossParameter.Norm norm = 1 [default = L1]; + if (has_norm()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 1, this->norm(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:ditcaffe.HingeLossParameter) +} + +::google::protobuf::uint8* HingeLossParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.HingeLossParameter) + // optional .ditcaffe.HingeLossParameter.Norm norm = 1 [default = L1]; + if (has_norm()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 1, this->norm(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.HingeLossParameter) + return target; +} + +int HingeLossParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional .ditcaffe.HingeLossParameter.Norm norm = 1 [default = L1]; + if (has_norm()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->norm()); + } + + } + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void HingeLossParameter::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const HingeLossParameter* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void HingeLossParameter::MergeFrom(const HingeLossParameter& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_norm()) { + set_norm(from.norm()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void HingeLossParameter::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void HingeLossParameter::CopyFrom(const HingeLossParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool HingeLossParameter::IsInitialized() const { + + return true; +} + +void HingeLossParameter::Swap(HingeLossParameter* other) { + if (other != this) { + std::swap(norm_, other->norm_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + 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; +} + + +// =================================================================== + +#ifndef _MSC_VER +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 // !_MSC_VER + +ImageDataParameter::ImageDataParameter() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.ImageDataParameter) +} + +void ImageDataParameter::InitAsDefaultInstance() { +} + +ImageDataParameter::ImageDataParameter(const ImageDataParameter& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.ImageDataParameter) +} + +void ImageDataParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + source_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + batch_size_ = 1u; + rand_skip_ = 0u; + shuffle_ = false; + new_height_ = 0u; + new_width_ = 0u; + is_color_ = true; + scale_ = 1; + mean_file_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + crop_size_ = 0u; + mirror_ = false; + root_folder_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ImageDataParameter::~ImageDataParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.ImageDataParameter) + SharedDtor(); +} + +void ImageDataParameter::SharedDtor() { + if (source_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete source_; + } + if (mean_file_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete mean_file_; + } + if (root_folder_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete root_folder_; + } + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +ImageDataParameter* ImageDataParameter::default_instance_ = NULL; + +ImageDataParameter* ImageDataParameter::New() const { + return new ImageDataParameter; +} + +void ImageDataParameter::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 255) { + ZR_(rand_skip_, shuffle_); + if (has_source()) { + if (source_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_->clear(); + } + } + batch_size_ = 1u; + is_color_ = true; + scale_ = 1; + } + if (_has_bits_[8 / 32] & 3840) { + if (has_mean_file()) { + if (mean_file_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + mean_file_->clear(); + } + } + crop_size_ = 0u; + mirror_ = false; + if (has_root_folder()) { + if (root_folder_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + root_folder_->clear(); + } + } + } + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool ImageDataParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:ditcaffe.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, + "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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &scale_))); + set_has_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, + "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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &batch_size_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &crop_size_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &mirror_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &rand_skip_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &shuffle_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &new_height_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &new_width_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &is_color_))); + set_has_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, + "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:ditcaffe.ImageDataParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.ImageDataParameter) + return false; +#undef DO_ +} + +void ImageDataParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.ImageDataParameter) + // optional string source = 1; + if (has_source()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->source().data(), this->source().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "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, + "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, + "root_folder"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 12, this->root_folder(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:ditcaffe.ImageDataParameter) +} + +::google::protobuf::uint8* ImageDataParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.ImageDataParameter) + // optional string source = 1; + if (has_source()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->source().data(), this->source().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "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, + "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, + "root_folder"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 12, this->root_folder(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.ImageDataParameter) + return target; +} + +int ImageDataParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // 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] & (0xffu << (8 % 32))) { + // 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 (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ImageDataParameter::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const ImageDataParameter* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void ImageDataParameter::MergeFrom(const ImageDataParameter& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_source()) { + set_source(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_mean_file(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_root_folder(from.root_folder()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void ImageDataParameter::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ImageDataParameter::CopyFrom(const ImageDataParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ImageDataParameter::IsInitialized() const { + + return true; +} + +void ImageDataParameter::Swap(ImageDataParameter* other) { + if (other != this) { + std::swap(source_, 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_); + std::swap(mean_file_, other->mean_file_); + std::swap(crop_size_, other->crop_size_); + std::swap(mirror_, other->mirror_); + std::swap(root_folder_, other->root_folder_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + 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; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int InfogainLossParameter::kSourceFieldNumber; +#endif // !_MSC_VER + +InfogainLossParameter::InfogainLossParameter() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.InfogainLossParameter) +} + +void InfogainLossParameter::InitAsDefaultInstance() { +} + +InfogainLossParameter::InfogainLossParameter(const InfogainLossParameter& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.InfogainLossParameter) +} + +void InfogainLossParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + source_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +InfogainLossParameter::~InfogainLossParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.InfogainLossParameter) + SharedDtor(); +} + +void InfogainLossParameter::SharedDtor() { + if (source_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete source_; + } + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +InfogainLossParameter* InfogainLossParameter::default_instance_ = NULL; + +InfogainLossParameter* InfogainLossParameter::New() const { + return new InfogainLossParameter; +} + +void InfogainLossParameter::Clear() { + if (has_source()) { + if (source_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_->clear(); + } + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool InfogainLossParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:ditcaffe.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, + "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:ditcaffe.InfogainLossParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.InfogainLossParameter) + return false; +#undef DO_ +} + +void InfogainLossParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.InfogainLossParameter) + // optional string source = 1; + if (has_source()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->source().data(), this->source().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "source"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->source(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:ditcaffe.InfogainLossParameter) +} + +::google::protobuf::uint8* InfogainLossParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.InfogainLossParameter) + // optional string source = 1; + if (has_source()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->source().data(), this->source().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "source"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->source(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.InfogainLossParameter) + return target; +} + +int InfogainLossParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional string source = 1; + if (has_source()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->source()); + } + + } + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void InfogainLossParameter::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const InfogainLossParameter* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void InfogainLossParameter::MergeFrom(const InfogainLossParameter& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_source()) { + set_source(from.source()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void InfogainLossParameter::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void InfogainLossParameter::CopyFrom(const InfogainLossParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool InfogainLossParameter::IsInitialized() const { + + return true; +} + +void InfogainLossParameter::Swap(InfogainLossParameter* other) { + if (other != this) { + std::swap(source_, other->source_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + 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; +} + + +// =================================================================== + +#ifndef _MSC_VER +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 // !_MSC_VER + +InnerProductParameter::InnerProductParameter() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.InnerProductParameter) +} + +void InnerProductParameter::InitAsDefaultInstance() { + weight_filler_ = const_cast< ::ditcaffe::FillerParameter*>(&::ditcaffe::FillerParameter::default_instance()); + bias_filler_ = const_cast< ::ditcaffe::FillerParameter*>(&::ditcaffe::FillerParameter::default_instance()); +} + +InnerProductParameter::InnerProductParameter(const InnerProductParameter& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.InnerProductParameter) +} + +void InnerProductParameter::SharedCtor() { + _cached_size_ = 0; + num_output_ = 0u; + bias_term_ = true; + weight_filler_ = NULL; + bias_filler_ = NULL; + axis_ = 1; + transpose_ = false; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +InnerProductParameter::~InnerProductParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.InnerProductParameter) + SharedDtor(); +} + +void InnerProductParameter::SharedDtor() { + if (this != default_instance_) { + 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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +InnerProductParameter* InnerProductParameter::default_instance_ = NULL; + +InnerProductParameter* InnerProductParameter::New() const { + return new InnerProductParameter; +} + +void InnerProductParameter::Clear() { + if (_has_bits_[0 / 32] & 63) { + num_output_ = 0u; + bias_term_ = true; + if (has_weight_filler()) { + if (weight_filler_ != NULL) weight_filler_->::ditcaffe::FillerParameter::Clear(); + } + if (has_bias_filler()) { + if (bias_filler_ != NULL) bias_filler_->::ditcaffe::FillerParameter::Clear(); + } + axis_ = 1; + transpose_ = false; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool InnerProductParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &num_output_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &bias_term_))); + set_has_bias_term(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_weight_filler; + break; + } + + // optional .ditcaffe.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 .ditcaffe.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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &transpose_))); + set_has_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:ditcaffe.InnerProductParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.InnerProductParameter) + return false; +#undef DO_ +} + +void InnerProductParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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 .ditcaffe.FillerParameter weight_filler = 3; + if (has_weight_filler()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, this->weight_filler(), output); + } + + // optional .ditcaffe.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 (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:ditcaffe.InnerProductParameter) +} + +::google::protobuf::uint8* InnerProductParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.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 .ditcaffe.FillerParameter weight_filler = 3; + if (has_weight_filler()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 3, this->weight_filler(), target); + } + + // optional .ditcaffe.FillerParameter bias_filler = 4; + if (has_bias_filler()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 4, this->bias_filler(), 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 (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.InnerProductParameter) + return target; +} + +int InnerProductParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // 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 .ditcaffe.FillerParameter weight_filler = 3; + if (has_weight_filler()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->weight_filler()); + } + + // optional .ditcaffe.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 (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void InnerProductParameter::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const InnerProductParameter* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void InnerProductParameter::MergeFrom(const InnerProductParameter& from) { + GOOGLE_CHECK_NE(&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()->::ditcaffe::FillerParameter::MergeFrom(from.weight_filler()); + } + if (from.has_bias_filler()) { + mutable_bias_filler()->::ditcaffe::FillerParameter::MergeFrom(from.bias_filler()); + } + if (from.has_axis()) { + set_axis(from.axis()); + } + if (from.has_transpose()) { + set_transpose(from.transpose()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void InnerProductParameter::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void InnerProductParameter::CopyFrom(const InnerProductParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool InnerProductParameter::IsInitialized() const { + + return true; +} + +void InnerProductParameter::Swap(InnerProductParameter* other) { + if (other != this) { + 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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + 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; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int InputParameter::kShapeFieldNumber; +#endif // !_MSC_VER + +InputParameter::InputParameter() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.InputParameter) +} + +void InputParameter::InitAsDefaultInstance() { +} + +InputParameter::InputParameter(const InputParameter& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.InputParameter) +} + +void InputParameter::SharedCtor() { + _cached_size_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +InputParameter::~InputParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.InputParameter) + SharedDtor(); +} + +void InputParameter::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +InputParameter* InputParameter::default_instance_ = NULL; + +InputParameter* InputParameter::New() const { + return new InputParameter; +} + +void InputParameter::Clear() { + shape_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool InputParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:ditcaffe.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 .ditcaffe.BlobShape shape = 1; + case 1: { + if (tag == 10) { + parse_shape: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_shape())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(10)) goto parse_shape; + 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:ditcaffe.InputParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.InputParameter) + return false; +#undef DO_ +} + +void InputParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.InputParameter) + // repeated .ditcaffe.BlobShape shape = 1; + for (int i = 0; i < this->shape_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->shape(i), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:ditcaffe.InputParameter) +} + +::google::protobuf::uint8* InputParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.InputParameter) + // repeated .ditcaffe.BlobShape shape = 1; + for (int i = 0; i < this->shape_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 1, this->shape(i), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.InputParameter) + return target; +} + +int InputParameter::ByteSize() const { + int total_size = 0; + + // repeated .ditcaffe.BlobShape shape = 1; + total_size += 1 * this->shape_size(); + for (int i = 0; i < this->shape_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->shape(i)); + } + + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void InputParameter::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const InputParameter* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void InputParameter::MergeFrom(const InputParameter& from) { + GOOGLE_CHECK_NE(&from, this); + shape_.MergeFrom(from.shape_); + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void InputParameter::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void InputParameter::CopyFrom(const InputParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool InputParameter::IsInitialized() const { + + return true; +} + +void InputParameter::Swap(InputParameter* other) { + if (other != this) { + shape_.Swap(&other->shape_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + 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; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int LogParameter::kBaseFieldNumber; +const int LogParameter::kScaleFieldNumber; +const int LogParameter::kShiftFieldNumber; +#endif // !_MSC_VER + +LogParameter::LogParameter() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.LogParameter) +} + +void LogParameter::InitAsDefaultInstance() { +} + +LogParameter::LogParameter(const LogParameter& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.LogParameter) +} + +void LogParameter::SharedCtor() { + _cached_size_ = 0; + base_ = -1; + scale_ = 1; + shift_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +LogParameter::~LogParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.LogParameter) + SharedDtor(); +} + +void LogParameter::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +LogParameter* LogParameter::default_instance_ = NULL; + +LogParameter* LogParameter::New() const { + return new LogParameter; +} + +void LogParameter::Clear() { + if (_has_bits_[0 / 32] & 7) { + base_ = -1; + scale_ = 1; + shift_ = 0; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool LogParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &base_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &scale_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &shift_))); + set_has_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:ditcaffe.LogParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.LogParameter) + return false; +#undef DO_ +} + +void LogParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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 (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:ditcaffe.LogParameter) +} + +::google::protobuf::uint8* LogParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.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 (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.LogParameter) + return target; +} + +int LogParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // 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 (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void LogParameter::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const LogParameter* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void LogParameter::MergeFrom(const LogParameter& from) { + GOOGLE_CHECK_NE(&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()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void LogParameter::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void LogParameter::CopyFrom(const LogParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool LogParameter::IsInitialized() const { + + return true; +} + +void LogParameter::Swap(LogParameter* other) { + if (other != this) { + std::swap(base_, other->base_); + std::swap(scale_, other->scale_); + std::swap(shift_, other->shift_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + 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; +} + + +// =================================================================== + +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; + } +} + +#ifndef _MSC_VER +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 // _MSC_VER +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; + } +} + +#ifndef _MSC_VER +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 // _MSC_VER +#ifndef _MSC_VER +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 // !_MSC_VER + +LRNParameter::LRNParameter() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.LRNParameter) +} + +void LRNParameter::InitAsDefaultInstance() { +} + +LRNParameter::LRNParameter(const LRNParameter& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.LRNParameter) +} + +void LRNParameter::SharedCtor() { + _cached_size_ = 0; + local_size_ = 5u; + alpha_ = 1; + beta_ = 0.75f; + norm_region_ = 0; + k_ = 1; + engine_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +LRNParameter::~LRNParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.LRNParameter) + SharedDtor(); +} + +void LRNParameter::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +LRNParameter* LRNParameter::default_instance_ = NULL; + +LRNParameter* LRNParameter::New() const { + return new LRNParameter; +} + +void LRNParameter::Clear() { + if (_has_bits_[0 / 32] & 63) { + local_size_ = 5u; + alpha_ = 1; + beta_ = 0.75f; + norm_region_ = 0; + k_ = 1; + engine_ = 0; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool LRNParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &local_size_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &alpha_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &beta_))); + set_has_beta(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(32)) goto parse_norm_region; + break; + } + + // optional .ditcaffe.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 (::ditcaffe::LRNParameter_NormRegion_IsValid(value)) { + set_norm_region(static_cast< ::ditcaffe::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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &k_))); + set_has_k(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(48)) goto parse_engine; + break; + } + + // optional .ditcaffe.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 (::ditcaffe::LRNParameter_Engine_IsValid(value)) { + set_engine(static_cast< ::ditcaffe::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:ditcaffe.LRNParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.LRNParameter) + return false; +#undef DO_ +} + +void LRNParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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 .ditcaffe.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 .ditcaffe.LRNParameter.Engine engine = 6 [default = DEFAULT]; + if (has_engine()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 6, this->engine(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:ditcaffe.LRNParameter) +} + +::google::protobuf::uint8* LRNParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.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 .ditcaffe.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 .ditcaffe.LRNParameter.Engine engine = 6 [default = DEFAULT]; + if (has_engine()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 6, this->engine(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.LRNParameter) + return target; +} + +int LRNParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // 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 .ditcaffe.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 .ditcaffe.LRNParameter.Engine engine = 6 [default = DEFAULT]; + if (has_engine()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->engine()); + } + + } + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void LRNParameter::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const LRNParameter* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void LRNParameter::MergeFrom(const LRNParameter& from) { + GOOGLE_CHECK_NE(&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()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void LRNParameter::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void LRNParameter::CopyFrom(const LRNParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool LRNParameter::IsInitialized() const { + + return true; +} + +void LRNParameter::Swap(LRNParameter* other) { + if (other != this) { + 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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + 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; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int MemoryDataParameter::kBatchSizeFieldNumber; +const int MemoryDataParameter::kChannelsFieldNumber; +const int MemoryDataParameter::kHeightFieldNumber; +const int MemoryDataParameter::kWidthFieldNumber; +#endif // !_MSC_VER + +MemoryDataParameter::MemoryDataParameter() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.MemoryDataParameter) +} + +void MemoryDataParameter::InitAsDefaultInstance() { +} + +MemoryDataParameter::MemoryDataParameter(const MemoryDataParameter& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.MemoryDataParameter) +} + +void MemoryDataParameter::SharedCtor() { + _cached_size_ = 0; + batch_size_ = 0u; + channels_ = 0u; + height_ = 0u; + width_ = 0u; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +MemoryDataParameter::~MemoryDataParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.MemoryDataParameter) + SharedDtor(); +} + +void MemoryDataParameter::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +MemoryDataParameter* MemoryDataParameter::default_instance_ = NULL; + +MemoryDataParameter* MemoryDataParameter::New() const { + return new MemoryDataParameter; +} + +void MemoryDataParameter::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + ZR_(batch_size_, width_); + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool MemoryDataParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &batch_size_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &channels_))); + set_has_channels(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(24)) goto parse_height; + break; + } + + // optional uint32 height = 3; + case 3: { + if (tag == 24) { + parse_height: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &height_))); + set_has_height(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(32)) goto parse_width; + break; + } + + // optional uint32 width = 4; + case 4: { + if (tag == 32) { + parse_width: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &width_))); + set_has_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:ditcaffe.MemoryDataParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.MemoryDataParameter) + return false; +#undef DO_ +} + +void MemoryDataParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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 (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:ditcaffe.MemoryDataParameter) +} + +::google::protobuf::uint8* MemoryDataParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.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 (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.MemoryDataParameter) + return target; +} + +int MemoryDataParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // 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 (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void MemoryDataParameter::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const MemoryDataParameter* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void MemoryDataParameter::MergeFrom(const MemoryDataParameter& from) { + GOOGLE_CHECK_NE(&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()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void MemoryDataParameter::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void MemoryDataParameter::CopyFrom(const MemoryDataParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool MemoryDataParameter::IsInitialized() const { + + return true; +} + +void MemoryDataParameter::Swap(MemoryDataParameter* other) { + if (other != this) { + 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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + 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; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int MVNParameter::kNormalizeVarianceFieldNumber; +const int MVNParameter::kAcrossChannelsFieldNumber; +const int MVNParameter::kEpsFieldNumber; +#endif // !_MSC_VER + +MVNParameter::MVNParameter() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.MVNParameter) +} + +void MVNParameter::InitAsDefaultInstance() { +} + +MVNParameter::MVNParameter(const MVNParameter& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.MVNParameter) +} + +void MVNParameter::SharedCtor() { + _cached_size_ = 0; + normalize_variance_ = true; + across_channels_ = false; + eps_ = 1e-09f; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +MVNParameter::~MVNParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.MVNParameter) + SharedDtor(); +} + +void MVNParameter::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +MVNParameter* MVNParameter::default_instance_ = NULL; + +MVNParameter* MVNParameter::New() const { + return new MVNParameter; +} + +void MVNParameter::Clear() { + if (_has_bits_[0 / 32] & 7) { + normalize_variance_ = true; + across_channels_ = false; + eps_ = 1e-09f; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool MVNParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &normalize_variance_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &across_channels_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &eps_))); + set_has_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:ditcaffe.MVNParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.MVNParameter) + return false; +#undef DO_ +} + +void MVNParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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 (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:ditcaffe.MVNParameter) +} + +::google::protobuf::uint8* MVNParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.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 (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.MVNParameter) + return target; +} + +int MVNParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // 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 (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void MVNParameter::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const MVNParameter* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void MVNParameter::MergeFrom(const MVNParameter& from) { + GOOGLE_CHECK_NE(&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()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void MVNParameter::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void MVNParameter::CopyFrom(const MVNParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool MVNParameter::IsInitialized() const { + + return true; +} + +void MVNParameter::Swap(MVNParameter* other) { + if (other != this) { + 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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + 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; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int ParameterParameter::kShapeFieldNumber; +#endif // !_MSC_VER + +ParameterParameter::ParameterParameter() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.ParameterParameter) +} + +void ParameterParameter::InitAsDefaultInstance() { + shape_ = const_cast< ::ditcaffe::BlobShape*>(&::ditcaffe::BlobShape::default_instance()); +} + +ParameterParameter::ParameterParameter(const ParameterParameter& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.ParameterParameter) +} + +void ParameterParameter::SharedCtor() { + _cached_size_ = 0; + shape_ = NULL; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ParameterParameter::~ParameterParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.ParameterParameter) + SharedDtor(); +} + +void ParameterParameter::SharedDtor() { + if (this != default_instance_) { + 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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +ParameterParameter* ParameterParameter::default_instance_ = NULL; + +ParameterParameter* ParameterParameter::New() const { + return new ParameterParameter; +} + +void ParameterParameter::Clear() { + if (has_shape()) { + if (shape_ != NULL) shape_->::ditcaffe::BlobShape::Clear(); + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool ParameterParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:ditcaffe.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 .ditcaffe.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:ditcaffe.ParameterParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.ParameterParameter) + return false; +#undef DO_ +} + +void ParameterParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.ParameterParameter) + // optional .ditcaffe.BlobShape shape = 1; + if (has_shape()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->shape(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:ditcaffe.ParameterParameter) +} + +::google::protobuf::uint8* ParameterParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.ParameterParameter) + // optional .ditcaffe.BlobShape shape = 1; + if (has_shape()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 1, this->shape(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.ParameterParameter) + return target; +} + +int ParameterParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional .ditcaffe.BlobShape shape = 1; + if (has_shape()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->shape()); + } + + } + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ParameterParameter::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const ParameterParameter* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void ParameterParameter::MergeFrom(const ParameterParameter& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_shape()) { + mutable_shape()->::ditcaffe::BlobShape::MergeFrom(from.shape()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void ParameterParameter::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ParameterParameter::CopyFrom(const ParameterParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ParameterParameter::IsInitialized() const { + + return true; +} + +void ParameterParameter::Swap(ParameterParameter* other) { + if (other != this) { + std::swap(shape_, other->shape_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + 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; +} + + +// =================================================================== + +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; + } +} + +#ifndef _MSC_VER +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 // _MSC_VER +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; + } +} + +#ifndef _MSC_VER +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 // _MSC_VER +#ifndef _MSC_VER +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; +const int PoolingParameter::kTorchPoolingFieldNumber; +#endif // !_MSC_VER + +PoolingParameter::PoolingParameter() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.PoolingParameter) +} + +void PoolingParameter::InitAsDefaultInstance() { +} + +PoolingParameter::PoolingParameter(const PoolingParameter& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.PoolingParameter) +} + +void PoolingParameter::SharedCtor() { + _cached_size_ = 0; + pool_ = 0; + pad_ = 0u; + pad_h_ = 0u; + pad_w_ = 0u; + kernel_size_ = 0u; + kernel_h_ = 0u; + kernel_w_ = 0u; + stride_ = 1u; + stride_h_ = 0u; + stride_w_ = 0u; + engine_ = 0; + global_pooling_ = false; + torch_pooling_ = false; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +PoolingParameter::~PoolingParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.PoolingParameter) + SharedDtor(); +} + +void PoolingParameter::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +PoolingParameter* PoolingParameter::default_instance_ = NULL; + +PoolingParameter* PoolingParameter::New() const { + return new PoolingParameter; +} + +void PoolingParameter::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 255) { + ZR_(pool_, kernel_w_); + stride_ = 1u; + } + if (_has_bits_[8 / 32] & 7936) { + ZR_(stride_h_, torch_pooling_); + } + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool PoolingParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:ditcaffe.PoolingParameter) + 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 .ditcaffe.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 (::ditcaffe::PoolingParameter_PoolMethod_IsValid(value)) { + set_pool(static_cast< ::ditcaffe::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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &kernel_size_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &stride_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &pad_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &kernel_h_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &kernel_w_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &stride_h_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &stride_w_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &pad_h_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &pad_w_))); + set_has_pad_w(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(88)) goto parse_engine; + break; + } + + // optional .ditcaffe.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 (::ditcaffe::PoolingParameter_Engine_IsValid(value)) { + set_engine(static_cast< ::ditcaffe::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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &global_pooling_))); + set_has_global_pooling(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(320)) goto parse_torch_pooling; + break; + } + + // optional bool torch_pooling = 40 [default = false]; + case 40: { + if (tag == 320) { + parse_torch_pooling: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &torch_pooling_))); + set_has_torch_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:ditcaffe.PoolingParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.PoolingParameter) + return false; +#undef DO_ +} + +void PoolingParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.PoolingParameter) + // optional .ditcaffe.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 .ditcaffe.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); + } + + // optional bool torch_pooling = 40 [default = false]; + if (has_torch_pooling()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(40, this->torch_pooling(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:ditcaffe.PoolingParameter) +} + +::google::protobuf::uint8* PoolingParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.PoolingParameter) + // optional .ditcaffe.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 .ditcaffe.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); + } + + // optional bool torch_pooling = 40 [default = false]; + if (has_torch_pooling()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(40, this->torch_pooling(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.PoolingParameter) + return target; +} + +int PoolingParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional .ditcaffe.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] & (0xffu << (8 % 32))) { + // 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 .ditcaffe.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; + } + + // optional bool torch_pooling = 40 [default = false]; + if (has_torch_pooling()) { + total_size += 2 + 1; + } + + } + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void PoolingParameter::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const PoolingParameter* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void PoolingParameter::MergeFrom(const PoolingParameter& from) { + GOOGLE_CHECK_NE(&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.has_torch_pooling()) { + set_torch_pooling(from.torch_pooling()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void PoolingParameter::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void PoolingParameter::CopyFrom(const PoolingParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool PoolingParameter::IsInitialized() const { + + return true; +} + +void PoolingParameter::Swap(PoolingParameter* other) { + if (other != this) { + 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(torch_pooling_, other->torch_pooling_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + 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; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int PowerParameter::kPowerFieldNumber; +const int PowerParameter::kScaleFieldNumber; +const int PowerParameter::kShiftFieldNumber; +#endif // !_MSC_VER + +PowerParameter::PowerParameter() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.PowerParameter) +} + +void PowerParameter::InitAsDefaultInstance() { +} + +PowerParameter::PowerParameter(const PowerParameter& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.PowerParameter) +} + +void PowerParameter::SharedCtor() { + _cached_size_ = 0; + power_ = 1; + scale_ = 1; + shift_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +PowerParameter::~PowerParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.PowerParameter) + SharedDtor(); +} + +void PowerParameter::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +PowerParameter* PowerParameter::default_instance_ = NULL; + +PowerParameter* PowerParameter::New() const { + return new PowerParameter; +} + +void PowerParameter::Clear() { + if (_has_bits_[0 / 32] & 7) { + power_ = 1; + scale_ = 1; + shift_ = 0; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool PowerParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &power_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &scale_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &shift_))); + set_has_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:ditcaffe.PowerParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.PowerParameter) + return false; +#undef DO_ +} + +void PowerParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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 (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:ditcaffe.PowerParameter) +} + +::google::protobuf::uint8* PowerParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.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 (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.PowerParameter) + return target; +} + +int PowerParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // 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 (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void PowerParameter::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const PowerParameter* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void PowerParameter::MergeFrom(const PowerParameter& from) { + GOOGLE_CHECK_NE(&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()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void PowerParameter::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void PowerParameter::CopyFrom(const PowerParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool PowerParameter::IsInitialized() const { + + return true; +} + +void PowerParameter::Swap(PowerParameter* other) { + if (other != this) { + std::swap(power_, other->power_); + std::swap(scale_, other->scale_); + std::swap(shift_, other->shift_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + 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; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int PythonParameter::kModuleFieldNumber; +const int PythonParameter::kLayerFieldNumber; +const int PythonParameter::kParamStrFieldNumber; +const int PythonParameter::kShareInParallelFieldNumber; +#endif // !_MSC_VER + +PythonParameter::PythonParameter() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.PythonParameter) +} + +void PythonParameter::InitAsDefaultInstance() { +} + +PythonParameter::PythonParameter(const PythonParameter& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.PythonParameter) +} + +void PythonParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + module_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + layer_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + param_str_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + share_in_parallel_ = false; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +PythonParameter::~PythonParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.PythonParameter) + SharedDtor(); +} + +void PythonParameter::SharedDtor() { + if (module_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete module_; + } + if (layer_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete layer_; + } + if (param_str_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete param_str_; + } + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +PythonParameter* PythonParameter::default_instance_ = NULL; + +PythonParameter* PythonParameter::New() const { + return new PythonParameter; +} + +void PythonParameter::Clear() { + if (_has_bits_[0 / 32] & 15) { + if (has_module()) { + if (module_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + module_->clear(); + } + } + if (has_layer()) { + if (layer_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + layer_->clear(); + } + } + if (has_param_str()) { + if (param_str_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + param_str_->clear(); + } + } + share_in_parallel_ = false; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool PythonParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:ditcaffe.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, + "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, + "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, + "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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &share_in_parallel_))); + set_has_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:ditcaffe.PythonParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.PythonParameter) + return false; +#undef DO_ +} + +void PythonParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.PythonParameter) + // optional string module = 1; + if (has_module()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->module().data(), this->module().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "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, + "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, + "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 (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:ditcaffe.PythonParameter) +} + +::google::protobuf::uint8* PythonParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.PythonParameter) + // optional string module = 1; + if (has_module()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->module().data(), this->module().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "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, + "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, + "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 (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.PythonParameter) + return target; +} + +int PythonParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // 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 (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void PythonParameter::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const PythonParameter* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void PythonParameter::MergeFrom(const PythonParameter& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_module()) { + set_module(from.module()); + } + if (from.has_layer()) { + set_layer(from.layer()); + } + if (from.has_param_str()) { + set_param_str(from.param_str()); + } + if (from.has_share_in_parallel()) { + set_share_in_parallel(from.share_in_parallel()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void PythonParameter::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void PythonParameter::CopyFrom(const PythonParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool PythonParameter::IsInitialized() const { + + return true; +} + +void PythonParameter::Swap(PythonParameter* other) { + if (other != this) { + std::swap(module_, other->module_); + std::swap(layer_, other->layer_); + std::swap(param_str_, other->param_str_); + std::swap(share_in_parallel_, other->share_in_parallel_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + 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; +} + + +// =================================================================== + +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; + } +} + +#ifndef _MSC_VER +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 // _MSC_VER +#ifndef _MSC_VER +const int ReductionParameter::kOperationFieldNumber; +const int ReductionParameter::kAxisFieldNumber; +const int ReductionParameter::kCoeffFieldNumber; +#endif // !_MSC_VER + +ReductionParameter::ReductionParameter() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.ReductionParameter) +} + +void ReductionParameter::InitAsDefaultInstance() { +} + +ReductionParameter::ReductionParameter(const ReductionParameter& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.ReductionParameter) +} + +void ReductionParameter::SharedCtor() { + _cached_size_ = 0; + operation_ = 1; + axis_ = 0; + coeff_ = 1; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ReductionParameter::~ReductionParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.ReductionParameter) + SharedDtor(); +} + +void ReductionParameter::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +ReductionParameter* ReductionParameter::default_instance_ = NULL; + +ReductionParameter* ReductionParameter::New() const { + return new ReductionParameter; +} + +void ReductionParameter::Clear() { + if (_has_bits_[0 / 32] & 7) { + operation_ = 1; + axis_ = 0; + coeff_ = 1; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool ReductionParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:ditcaffe.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 .ditcaffe.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 (::ditcaffe::ReductionParameter_ReductionOp_IsValid(value)) { + set_operation(static_cast< ::ditcaffe::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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &coeff_))); + set_has_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:ditcaffe.ReductionParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.ReductionParameter) + return false; +#undef DO_ +} + +void ReductionParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.ReductionParameter) + // optional .ditcaffe.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 (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:ditcaffe.ReductionParameter) +} + +::google::protobuf::uint8* ReductionParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.ReductionParameter) + // optional .ditcaffe.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 (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.ReductionParameter) + return target; +} + +int ReductionParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional .ditcaffe.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 (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ReductionParameter::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const ReductionParameter* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void ReductionParameter::MergeFrom(const ReductionParameter& from) { + GOOGLE_CHECK_NE(&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()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void ReductionParameter::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ReductionParameter::CopyFrom(const ReductionParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ReductionParameter::IsInitialized() const { + + return true; +} + +void ReductionParameter::Swap(ReductionParameter* other) { + if (other != this) { + std::swap(operation_, other->operation_); + std::swap(axis_, other->axis_); + std::swap(coeff_, other->coeff_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + 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; +} + + +// =================================================================== + +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; + } +} + +#ifndef _MSC_VER +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 // _MSC_VER +#ifndef _MSC_VER +const int ReLUParameter::kNegativeSlopeFieldNumber; +const int ReLUParameter::kEngineFieldNumber; +#endif // !_MSC_VER + +ReLUParameter::ReLUParameter() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.ReLUParameter) +} + +void ReLUParameter::InitAsDefaultInstance() { +} + +ReLUParameter::ReLUParameter(const ReLUParameter& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.ReLUParameter) +} + +void ReLUParameter::SharedCtor() { + _cached_size_ = 0; + negative_slope_ = 0; + engine_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ReLUParameter::~ReLUParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.ReLUParameter) + SharedDtor(); +} + +void ReLUParameter::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +ReLUParameter* ReLUParameter::default_instance_ = NULL; + +ReLUParameter* ReLUParameter::New() const { + return new ReLUParameter; +} + +void ReLUParameter::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + ZR_(negative_slope_, engine_); + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool ReLUParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &negative_slope_))); + set_has_negative_slope(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_engine; + break; + } + + // optional .ditcaffe.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 (::ditcaffe::ReLUParameter_Engine_IsValid(value)) { + set_engine(static_cast< ::ditcaffe::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:ditcaffe.ReLUParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.ReLUParameter) + return false; +#undef DO_ +} + +void ReLUParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.ReLUParameter) + // optional float negative_slope = 1 [default = 0]; + if (has_negative_slope()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->negative_slope(), output); + } + + // optional .ditcaffe.ReLUParameter.Engine engine = 2 [default = DEFAULT]; + if (has_engine()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 2, this->engine(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:ditcaffe.ReLUParameter) +} + +::google::protobuf::uint8* ReLUParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.ReLUParameter) + // optional float negative_slope = 1 [default = 0]; + if (has_negative_slope()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(1, this->negative_slope(), target); + } + + // optional .ditcaffe.ReLUParameter.Engine engine = 2 [default = DEFAULT]; + if (has_engine()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 2, this->engine(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.ReLUParameter) + return target; +} + +int ReLUParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional float negative_slope = 1 [default = 0]; + if (has_negative_slope()) { + total_size += 1 + 4; + } + + // optional .ditcaffe.ReLUParameter.Engine engine = 2 [default = DEFAULT]; + if (has_engine()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->engine()); + } + + } + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ReLUParameter::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const ReLUParameter* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void ReLUParameter::MergeFrom(const ReLUParameter& from) { + GOOGLE_CHECK_NE(&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()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void ReLUParameter::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ReLUParameter::CopyFrom(const ReLUParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ReLUParameter::IsInitialized() const { + + return true; +} + +void ReLUParameter::Swap(ReLUParameter* other) { + if (other != this) { + std::swap(negative_slope_, other->negative_slope_); + std::swap(engine_, other->engine_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + 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; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int ReshapeParameter::kShapeFieldNumber; +const int ReshapeParameter::kAxisFieldNumber; +const int ReshapeParameter::kNumAxesFieldNumber; +#endif // !_MSC_VER + +ReshapeParameter::ReshapeParameter() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.ReshapeParameter) +} + +void ReshapeParameter::InitAsDefaultInstance() { + shape_ = const_cast< ::ditcaffe::BlobShape*>(&::ditcaffe::BlobShape::default_instance()); +} + +ReshapeParameter::ReshapeParameter(const ReshapeParameter& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.ReshapeParameter) +} + +void ReshapeParameter::SharedCtor() { + _cached_size_ = 0; + shape_ = NULL; + axis_ = 0; + num_axes_ = -1; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ReshapeParameter::~ReshapeParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.ReshapeParameter) + SharedDtor(); +} + +void ReshapeParameter::SharedDtor() { + if (this != default_instance_) { + 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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +ReshapeParameter* ReshapeParameter::default_instance_ = NULL; + +ReshapeParameter* ReshapeParameter::New() const { + return new ReshapeParameter; +} + +void ReshapeParameter::Clear() { + if (_has_bits_[0 / 32] & 7) { + if (has_shape()) { + if (shape_ != NULL) shape_->::ditcaffe::BlobShape::Clear(); + } + axis_ = 0; + num_axes_ = -1; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool ReshapeParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:ditcaffe.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 .ditcaffe.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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &num_axes_))); + set_has_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:ditcaffe.ReshapeParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.ReshapeParameter) + return false; +#undef DO_ +} + +void ReshapeParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.ReshapeParameter) + // optional .ditcaffe.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 (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:ditcaffe.ReshapeParameter) +} + +::google::protobuf::uint8* ReshapeParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.ReshapeParameter) + // optional .ditcaffe.BlobShape shape = 1; + if (has_shape()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 1, this->shape(), 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 (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.ReshapeParameter) + return target; +} + +int ReshapeParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional .ditcaffe.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 (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ReshapeParameter::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const ReshapeParameter* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void ReshapeParameter::MergeFrom(const ReshapeParameter& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_shape()) { + mutable_shape()->::ditcaffe::BlobShape::MergeFrom(from.shape()); + } + if (from.has_axis()) { + set_axis(from.axis()); + } + if (from.has_num_axes()) { + set_num_axes(from.num_axes()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void ReshapeParameter::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ReshapeParameter::CopyFrom(const ReshapeParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ReshapeParameter::IsInitialized() const { + + return true; +} + +void ReshapeParameter::Swap(ReshapeParameter* other) { + if (other != this) { + 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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + 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; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int ScaleParameter::kAxisFieldNumber; +const int ScaleParameter::kNumAxesFieldNumber; +const int ScaleParameter::kFillerFieldNumber; +const int ScaleParameter::kBiasTermFieldNumber; +const int ScaleParameter::kBiasFillerFieldNumber; +#endif // !_MSC_VER + +ScaleParameter::ScaleParameter() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.ScaleParameter) +} + +void ScaleParameter::InitAsDefaultInstance() { + filler_ = const_cast< ::ditcaffe::FillerParameter*>(&::ditcaffe::FillerParameter::default_instance()); + bias_filler_ = const_cast< ::ditcaffe::FillerParameter*>(&::ditcaffe::FillerParameter::default_instance()); +} + +ScaleParameter::ScaleParameter(const ScaleParameter& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.ScaleParameter) +} + +void ScaleParameter::SharedCtor() { + _cached_size_ = 0; + axis_ = 1; + num_axes_ = 1; + filler_ = NULL; + bias_term_ = false; + bias_filler_ = NULL; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ScaleParameter::~ScaleParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.ScaleParameter) + SharedDtor(); +} + +void ScaleParameter::SharedDtor() { + if (this != default_instance_) { + 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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +ScaleParameter* ScaleParameter::default_instance_ = NULL; + +ScaleParameter* ScaleParameter::New() const { + return new ScaleParameter; +} + +void ScaleParameter::Clear() { + if (_has_bits_[0 / 32] & 31) { + axis_ = 1; + num_axes_ = 1; + if (has_filler()) { + if (filler_ != NULL) filler_->::ditcaffe::FillerParameter::Clear(); + } + bias_term_ = false; + if (has_bias_filler()) { + if (bias_filler_ != NULL) bias_filler_->::ditcaffe::FillerParameter::Clear(); + } + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool ScaleParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &num_axes_))); + set_has_num_axes(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_filler; + break; + } + + // optional .ditcaffe.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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &bias_term_))); + set_has_bias_term(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(42)) goto parse_bias_filler; + break; + } + + // optional .ditcaffe.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:ditcaffe.ScaleParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.ScaleParameter) + return false; +#undef DO_ +} + +void ScaleParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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 .ditcaffe.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 .ditcaffe.FillerParameter bias_filler = 5; + if (has_bias_filler()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 5, this->bias_filler(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:ditcaffe.ScaleParameter) +} + +::google::protobuf::uint8* ScaleParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.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 .ditcaffe.FillerParameter filler = 3; + if (has_filler()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 3, this->filler(), target); + } + + // optional bool bias_term = 4 [default = false]; + if (has_bias_term()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(4, this->bias_term(), target); + } + + // optional .ditcaffe.FillerParameter bias_filler = 5; + if (has_bias_filler()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 5, this->bias_filler(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.ScaleParameter) + return target; +} + +int ScaleParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // 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 .ditcaffe.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 .ditcaffe.FillerParameter bias_filler = 5; + if (has_bias_filler()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->bias_filler()); + } + + } + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ScaleParameter::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const ScaleParameter* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void ScaleParameter::MergeFrom(const ScaleParameter& from) { + GOOGLE_CHECK_NE(&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()->::ditcaffe::FillerParameter::MergeFrom(from.filler()); + } + if (from.has_bias_term()) { + set_bias_term(from.bias_term()); + } + if (from.has_bias_filler()) { + mutable_bias_filler()->::ditcaffe::FillerParameter::MergeFrom(from.bias_filler()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void ScaleParameter::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ScaleParameter::CopyFrom(const ScaleParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ScaleParameter::IsInitialized() const { + + return true; +} + +void ScaleParameter::Swap(ScaleParameter* other) { + if (other != this) { + 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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + 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; +} + + +// =================================================================== + +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; + } +} + +#ifndef _MSC_VER +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 // _MSC_VER +#ifndef _MSC_VER +const int SigmoidParameter::kEngineFieldNumber; +#endif // !_MSC_VER + +SigmoidParameter::SigmoidParameter() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.SigmoidParameter) +} + +void SigmoidParameter::InitAsDefaultInstance() { +} + +SigmoidParameter::SigmoidParameter(const SigmoidParameter& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.SigmoidParameter) +} + +void SigmoidParameter::SharedCtor() { + _cached_size_ = 0; + engine_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +SigmoidParameter::~SigmoidParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.SigmoidParameter) + SharedDtor(); +} + +void SigmoidParameter::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +SigmoidParameter* SigmoidParameter::default_instance_ = NULL; + +SigmoidParameter* SigmoidParameter::New() const { + return new SigmoidParameter; +} + +void SigmoidParameter::Clear() { + engine_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool SigmoidParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:ditcaffe.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 .ditcaffe.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 (::ditcaffe::SigmoidParameter_Engine_IsValid(value)) { + set_engine(static_cast< ::ditcaffe::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:ditcaffe.SigmoidParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.SigmoidParameter) + return false; +#undef DO_ +} + +void SigmoidParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.SigmoidParameter) + // optional .ditcaffe.SigmoidParameter.Engine engine = 1 [default = DEFAULT]; + if (has_engine()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 1, this->engine(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:ditcaffe.SigmoidParameter) +} + +::google::protobuf::uint8* SigmoidParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.SigmoidParameter) + // optional .ditcaffe.SigmoidParameter.Engine engine = 1 [default = DEFAULT]; + if (has_engine()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 1, this->engine(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.SigmoidParameter) + return target; +} + +int SigmoidParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional .ditcaffe.SigmoidParameter.Engine engine = 1 [default = DEFAULT]; + if (has_engine()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->engine()); + } + + } + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void SigmoidParameter::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const SigmoidParameter* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void SigmoidParameter::MergeFrom(const SigmoidParameter& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_engine()) { + set_engine(from.engine()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void SigmoidParameter::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void SigmoidParameter::CopyFrom(const SigmoidParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool SigmoidParameter::IsInitialized() const { + + return true; +} + +void SigmoidParameter::Swap(SigmoidParameter* other) { + if (other != this) { + std::swap(engine_, other->engine_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + 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; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int SliceParameter::kAxisFieldNumber; +const int SliceParameter::kSlicePointFieldNumber; +const int SliceParameter::kSliceDimFieldNumber; +#endif // !_MSC_VER + +SliceParameter::SliceParameter() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.SliceParameter) +} + +void SliceParameter::InitAsDefaultInstance() { +} + +SliceParameter::SliceParameter(const SliceParameter& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.SliceParameter) +} + +void SliceParameter::SharedCtor() { + _cached_size_ = 0; + axis_ = 1; + slice_dim_ = 1u; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +SliceParameter::~SliceParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.SliceParameter) + SharedDtor(); +} + +void SliceParameter::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +SliceParameter* SliceParameter::default_instance_ = NULL; + +SliceParameter* SliceParameter::New() const { + return new SliceParameter; +} + +void SliceParameter::Clear() { + if (_has_bits_[0 / 32] & 5) { + axis_ = 1; + slice_dim_ = 1u; + } + slice_point_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool SliceParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &slice_dim_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + set_has_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:ditcaffe.SliceParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.SliceParameter) + return false; +#undef DO_ +} + +void SliceParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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 (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:ditcaffe.SliceParameter) +} + +::google::protobuf::uint8* SliceParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.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 (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.SliceParameter) + return target; +} + +int SliceParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // 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; + { + int data_size = 0; + for (int i = 0; i < this->slice_point_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->slice_point(i)); + } + total_size += 1 * this->slice_point_size() + data_size; + } + + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void SliceParameter::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const SliceParameter* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void SliceParameter::MergeFrom(const SliceParameter& from) { + GOOGLE_CHECK_NE(&from, this); + slice_point_.MergeFrom(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()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void SliceParameter::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void SliceParameter::CopyFrom(const SliceParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool SliceParameter::IsInitialized() const { + + return true; +} + +void SliceParameter::Swap(SliceParameter* other) { + if (other != this) { + std::swap(axis_, other->axis_); + slice_point_.Swap(&other->slice_point_); + std::swap(slice_dim_, other->slice_dim_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + 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; +} + + +// =================================================================== + +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; + } +} + +#ifndef _MSC_VER +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 // _MSC_VER +#ifndef _MSC_VER +const int SoftmaxParameter::kEngineFieldNumber; +const int SoftmaxParameter::kAxisFieldNumber; +#endif // !_MSC_VER + +SoftmaxParameter::SoftmaxParameter() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.SoftmaxParameter) +} + +void SoftmaxParameter::InitAsDefaultInstance() { +} + +SoftmaxParameter::SoftmaxParameter(const SoftmaxParameter& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.SoftmaxParameter) +} + +void SoftmaxParameter::SharedCtor() { + _cached_size_ = 0; + engine_ = 0; + axis_ = 1; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +SoftmaxParameter::~SoftmaxParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.SoftmaxParameter) + SharedDtor(); +} + +void SoftmaxParameter::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +SoftmaxParameter* SoftmaxParameter::default_instance_ = NULL; + +SoftmaxParameter* SoftmaxParameter::New() const { + return new SoftmaxParameter; +} + +void SoftmaxParameter::Clear() { + if (_has_bits_[0 / 32] & 3) { + engine_ = 0; + axis_ = 1; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool SoftmaxParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:ditcaffe.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 .ditcaffe.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 (::ditcaffe::SoftmaxParameter_Engine_IsValid(value)) { + set_engine(static_cast< ::ditcaffe::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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + set_has_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:ditcaffe.SoftmaxParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.SoftmaxParameter) + return false; +#undef DO_ +} + +void SoftmaxParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.SoftmaxParameter) + // optional .ditcaffe.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 (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:ditcaffe.SoftmaxParameter) +} + +::google::protobuf::uint8* SoftmaxParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.SoftmaxParameter) + // optional .ditcaffe.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 (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.SoftmaxParameter) + return target; +} + +int SoftmaxParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional .ditcaffe.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 (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void SoftmaxParameter::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const SoftmaxParameter* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void SoftmaxParameter::MergeFrom(const SoftmaxParameter& from) { + GOOGLE_CHECK_NE(&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()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void SoftmaxParameter::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void SoftmaxParameter::CopyFrom(const SoftmaxParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool SoftmaxParameter::IsInitialized() const { + + return true; +} + +void SoftmaxParameter::Swap(SoftmaxParameter* other) { + if (other != this) { + std::swap(engine_, other->engine_); + std::swap(axis_, other->axis_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + 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; +} + + +// =================================================================== + +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; + } +} + +#ifndef _MSC_VER +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 // _MSC_VER +#ifndef _MSC_VER +const int TanHParameter::kEngineFieldNumber; +#endif // !_MSC_VER + +TanHParameter::TanHParameter() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.TanHParameter) +} + +void TanHParameter::InitAsDefaultInstance() { +} + +TanHParameter::TanHParameter(const TanHParameter& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.TanHParameter) +} + +void TanHParameter::SharedCtor() { + _cached_size_ = 0; + engine_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +TanHParameter::~TanHParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.TanHParameter) + SharedDtor(); +} + +void TanHParameter::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +TanHParameter* TanHParameter::default_instance_ = NULL; + +TanHParameter* TanHParameter::New() const { + return new TanHParameter; +} + +void TanHParameter::Clear() { + engine_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool TanHParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:ditcaffe.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 .ditcaffe.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 (::ditcaffe::TanHParameter_Engine_IsValid(value)) { + set_engine(static_cast< ::ditcaffe::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:ditcaffe.TanHParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.TanHParameter) + return false; +#undef DO_ +} + +void TanHParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.TanHParameter) + // optional .ditcaffe.TanHParameter.Engine engine = 1 [default = DEFAULT]; + if (has_engine()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 1, this->engine(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:ditcaffe.TanHParameter) +} + +::google::protobuf::uint8* TanHParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.TanHParameter) + // optional .ditcaffe.TanHParameter.Engine engine = 1 [default = DEFAULT]; + if (has_engine()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 1, this->engine(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.TanHParameter) + return target; +} + +int TanHParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional .ditcaffe.TanHParameter.Engine engine = 1 [default = DEFAULT]; + if (has_engine()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->engine()); + } + + } + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void TanHParameter::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const TanHParameter* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void TanHParameter::MergeFrom(const TanHParameter& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_engine()) { + set_engine(from.engine()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void TanHParameter::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void TanHParameter::CopyFrom(const TanHParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool TanHParameter::IsInitialized() const { + + return true; +} + +void TanHParameter::Swap(TanHParameter* other) { + if (other != this) { + std::swap(engine_, other->engine_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + 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; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int TileParameter::kAxisFieldNumber; +const int TileParameter::kTilesFieldNumber; +#endif // !_MSC_VER + +TileParameter::TileParameter() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.TileParameter) +} + +void TileParameter::InitAsDefaultInstance() { +} + +TileParameter::TileParameter(const TileParameter& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.TileParameter) +} + +void TileParameter::SharedCtor() { + _cached_size_ = 0; + axis_ = 1; + tiles_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +TileParameter::~TileParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.TileParameter) + SharedDtor(); +} + +void TileParameter::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +TileParameter* TileParameter::default_instance_ = NULL; + +TileParameter* TileParameter::New() const { + return new TileParameter; +} + +void TileParameter::Clear() { + if (_has_bits_[0 / 32] & 3) { + axis_ = 1; + tiles_ = 0; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool TileParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + set_has_axis(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_tiles; + break; + } + + // optional int32 tiles = 2; + case 2: { + if (tag == 16) { + parse_tiles: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &tiles_))); + set_has_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:ditcaffe.TileParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.TileParameter) + return false; +#undef DO_ +} + +void TileParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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 (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:ditcaffe.TileParameter) +} + +::google::protobuf::uint8* TileParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.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 (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.TileParameter) + return target; +} + +int TileParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // 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 (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void TileParameter::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const TileParameter* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void TileParameter::MergeFrom(const TileParameter& from) { + GOOGLE_CHECK_NE(&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()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void TileParameter::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void TileParameter::CopyFrom(const TileParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool TileParameter::IsInitialized() const { + + return true; +} + +void TileParameter::Swap(TileParameter* other) { + if (other != this) { + std::swap(axis_, other->axis_); + std::swap(tiles_, other->tiles_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + 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; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int ThresholdParameter::kThresholdFieldNumber; +#endif // !_MSC_VER + +ThresholdParameter::ThresholdParameter() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.ThresholdParameter) +} + +void ThresholdParameter::InitAsDefaultInstance() { +} + +ThresholdParameter::ThresholdParameter(const ThresholdParameter& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.ThresholdParameter) +} + +void ThresholdParameter::SharedCtor() { + _cached_size_ = 0; + threshold_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ThresholdParameter::~ThresholdParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.ThresholdParameter) + SharedDtor(); +} + +void ThresholdParameter::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +ThresholdParameter* ThresholdParameter::default_instance_ = NULL; + +ThresholdParameter* ThresholdParameter::New() const { + return new ThresholdParameter; +} + +void ThresholdParameter::Clear() { + threshold_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool ThresholdParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &threshold_))); + set_has_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:ditcaffe.ThresholdParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.ThresholdParameter) + return false; +#undef DO_ +} + +void ThresholdParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.ThresholdParameter) + // optional float threshold = 1 [default = 0]; + if (has_threshold()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->threshold(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:ditcaffe.ThresholdParameter) +} + +::google::protobuf::uint8* ThresholdParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.ThresholdParameter) + // optional float threshold = 1 [default = 0]; + if (has_threshold()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(1, this->threshold(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.ThresholdParameter) + return target; +} + +int ThresholdParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional float threshold = 1 [default = 0]; + if (has_threshold()) { + total_size += 1 + 4; + } + + } + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ThresholdParameter::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const ThresholdParameter* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void ThresholdParameter::MergeFrom(const ThresholdParameter& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_threshold()) { + set_threshold(from.threshold()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void ThresholdParameter::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ThresholdParameter::CopyFrom(const ThresholdParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ThresholdParameter::IsInitialized() const { + + return true; +} + +void ThresholdParameter::Swap(ThresholdParameter* other) { + if (other != this) { + std::swap(threshold_, other->threshold_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + 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; +} + + +// =================================================================== + +::std::string* WindowDataParameter::_default_crop_mode_ = NULL; +#ifndef _MSC_VER +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 // !_MSC_VER + +WindowDataParameter::WindowDataParameter() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.WindowDataParameter) +} + +void WindowDataParameter::InitAsDefaultInstance() { +} + +WindowDataParameter::WindowDataParameter(const WindowDataParameter& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.WindowDataParameter) +} + +void WindowDataParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + source_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + scale_ = 1; + mean_file_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + batch_size_ = 0u; + crop_size_ = 0u; + mirror_ = false; + fg_threshold_ = 0.5f; + bg_threshold_ = 0.5f; + fg_fraction_ = 0.25f; + context_pad_ = 0u; + crop_mode_ = const_cast< ::std::string*>(_default_crop_mode_); + cache_images_ = false; + root_folder_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +WindowDataParameter::~WindowDataParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.WindowDataParameter) + SharedDtor(); +} + +void WindowDataParameter::SharedDtor() { + if (source_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete source_; + } + if (mean_file_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete mean_file_; + } + if (crop_mode_ != _default_crop_mode_) { + delete crop_mode_; + } + if (root_folder_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete root_folder_; + } + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +WindowDataParameter* WindowDataParameter::default_instance_ = NULL; + +WindowDataParameter* WindowDataParameter::New() const { + return new WindowDataParameter; +} + +void WindowDataParameter::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 255) { + ZR_(batch_size_, crop_size_); + if (has_source()) { + if (source_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_->clear(); + } + } + scale_ = 1; + if (has_mean_file()) { + if (mean_file_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + mean_file_->clear(); + } + } + mirror_ = false; + fg_threshold_ = 0.5f; + bg_threshold_ = 0.5f; + } + if (_has_bits_[8 / 32] & 7936) { + ZR_(cache_images_, context_pad_); + fg_fraction_ = 0.25f; + if (has_crop_mode()) { + if (crop_mode_ != _default_crop_mode_) { + crop_mode_->assign(*_default_crop_mode_); + } + } + if (has_root_folder()) { + if (root_folder_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + root_folder_->clear(); + } + } + } + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool WindowDataParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:ditcaffe.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, + "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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &scale_))); + set_has_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, + "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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &batch_size_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &crop_size_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &mirror_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &fg_threshold_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &bg_threshold_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &fg_fraction_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &context_pad_))); + set_has_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, + "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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &cache_images_))); + set_has_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, + "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:ditcaffe.WindowDataParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.WindowDataParameter) + return false; +#undef DO_ +} + +void WindowDataParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.WindowDataParameter) + // optional string source = 1; + if (has_source()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->source().data(), this->source().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "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, + "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, + "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, + "root_folder"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 13, this->root_folder(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:ditcaffe.WindowDataParameter) +} + +::google::protobuf::uint8* WindowDataParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.WindowDataParameter) + // optional string source = 1; + if (has_source()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->source().data(), this->source().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "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, + "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, + "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, + "root_folder"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 13, this->root_folder(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.WindowDataParameter) + return target; +} + +int WindowDataParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // 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] & (0xffu << (8 % 32))) { + // 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 (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void WindowDataParameter::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const WindowDataParameter* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void WindowDataParameter::MergeFrom(const WindowDataParameter& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_source()) { + set_source(from.source()); + } + if (from.has_scale()) { + set_scale(from.scale()); + } + if (from.has_mean_file()) { + set_mean_file(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_crop_mode(from.crop_mode()); + } + if (from.has_cache_images()) { + set_cache_images(from.cache_images()); + } + if (from.has_root_folder()) { + set_root_folder(from.root_folder()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void WindowDataParameter::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void WindowDataParameter::CopyFrom(const WindowDataParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool WindowDataParameter::IsInitialized() const { + + return true; +} + +void WindowDataParameter::Swap(WindowDataParameter* other) { + if (other != this) { + std::swap(source_, other->source_); + std::swap(scale_, other->scale_); + std::swap(mean_file_, 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_); + std::swap(crop_mode_, other->crop_mode_); + std::swap(cache_images_, other->cache_images_); + std::swap(root_folder_, other->root_folder_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + 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; +} + + +// =================================================================== + +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; + } +} + +#ifndef _MSC_VER +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 // _MSC_VER +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; + } +} + +#ifndef _MSC_VER +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 // _MSC_VER +#ifndef _MSC_VER +const int SPPParameter::kPyramidHeightFieldNumber; +const int SPPParameter::kPoolFieldNumber; +const int SPPParameter::kEngineFieldNumber; +#endif // !_MSC_VER + +SPPParameter::SPPParameter() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.SPPParameter) +} + +void SPPParameter::InitAsDefaultInstance() { +} + +SPPParameter::SPPParameter(const SPPParameter& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.SPPParameter) +} + +void SPPParameter::SharedCtor() { + _cached_size_ = 0; + pyramid_height_ = 0u; + pool_ = 0; + engine_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +SPPParameter::~SPPParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.SPPParameter) + SharedDtor(); +} + +void SPPParameter::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +SPPParameter* SPPParameter::default_instance_ = NULL; + +SPPParameter* SPPParameter::New() const { + return new SPPParameter; +} + +void SPPParameter::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + ZR_(pyramid_height_, engine_); + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool SPPParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &pyramid_height_))); + set_has_pyramid_height(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_pool; + break; + } + + // optional .ditcaffe.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 (::ditcaffe::SPPParameter_PoolMethod_IsValid(value)) { + set_pool(static_cast< ::ditcaffe::SPPParameter_PoolMethod >(value)); + } else { + mutable_unknown_fields()->AddVarint(2, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(48)) goto parse_engine; + break; + } + + // optional .ditcaffe.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 (::ditcaffe::SPPParameter_Engine_IsValid(value)) { + set_engine(static_cast< ::ditcaffe::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:ditcaffe.SPPParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.SPPParameter) + return false; +#undef DO_ +} + +void SPPParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.SPPParameter) + // optional uint32 pyramid_height = 1; + if (has_pyramid_height()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->pyramid_height(), output); + } + + // optional .ditcaffe.SPPParameter.PoolMethod pool = 2 [default = MAX]; + if (has_pool()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 2, this->pool(), output); + } + + // optional .ditcaffe.SPPParameter.Engine engine = 6 [default = DEFAULT]; + if (has_engine()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 6, this->engine(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:ditcaffe.SPPParameter) +} + +::google::protobuf::uint8* SPPParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.SPPParameter) + // optional uint32 pyramid_height = 1; + if (has_pyramid_height()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->pyramid_height(), target); + } + + // optional .ditcaffe.SPPParameter.PoolMethod pool = 2 [default = MAX]; + if (has_pool()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 2, this->pool(), target); + } + + // optional .ditcaffe.SPPParameter.Engine engine = 6 [default = DEFAULT]; + if (has_engine()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 6, this->engine(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.SPPParameter) + return target; +} + +int SPPParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional uint32 pyramid_height = 1; + if (has_pyramid_height()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->pyramid_height()); + } + + // optional .ditcaffe.SPPParameter.PoolMethod pool = 2 [default = MAX]; + if (has_pool()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->pool()); + } + + // optional .ditcaffe.SPPParameter.Engine engine = 6 [default = DEFAULT]; + if (has_engine()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->engine()); + } + + } + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void SPPParameter::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const SPPParameter* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void SPPParameter::MergeFrom(const SPPParameter& from) { + GOOGLE_CHECK_NE(&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()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void SPPParameter::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void SPPParameter::CopyFrom(const SPPParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool SPPParameter::IsInitialized() const { + + return true; +} + +void SPPParameter::Swap(SPPParameter* other) { + if (other != this) { + 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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + 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; +} + + +// =================================================================== + +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; + } +} + +#ifndef _MSC_VER +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 // _MSC_VER +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; + } +} + +#ifndef _MSC_VER +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 // _MSC_VER +#ifndef _MSC_VER +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 // !_MSC_VER + +V1LayerParameter::V1LayerParameter() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.V1LayerParameter) +} + +void V1LayerParameter::InitAsDefaultInstance() { + accuracy_param_ = const_cast< ::ditcaffe::AccuracyParameter*>(&::ditcaffe::AccuracyParameter::default_instance()); + argmax_param_ = const_cast< ::ditcaffe::ArgMaxParameter*>(&::ditcaffe::ArgMaxParameter::default_instance()); + concat_param_ = const_cast< ::ditcaffe::ConcatParameter*>(&::ditcaffe::ConcatParameter::default_instance()); + contrastive_loss_param_ = const_cast< ::ditcaffe::ContrastiveLossParameter*>(&::ditcaffe::ContrastiveLossParameter::default_instance()); + convolution_param_ = const_cast< ::ditcaffe::ConvolutionParameter*>(&::ditcaffe::ConvolutionParameter::default_instance()); + data_param_ = const_cast< ::ditcaffe::DataParameter*>(&::ditcaffe::DataParameter::default_instance()); + dropout_param_ = const_cast< ::ditcaffe::DropoutParameter*>(&::ditcaffe::DropoutParameter::default_instance()); + dummy_data_param_ = const_cast< ::ditcaffe::DummyDataParameter*>(&::ditcaffe::DummyDataParameter::default_instance()); + eltwise_param_ = const_cast< ::ditcaffe::EltwiseParameter*>(&::ditcaffe::EltwiseParameter::default_instance()); + exp_param_ = const_cast< ::ditcaffe::ExpParameter*>(&::ditcaffe::ExpParameter::default_instance()); + hdf5_data_param_ = const_cast< ::ditcaffe::HDF5DataParameter*>(&::ditcaffe::HDF5DataParameter::default_instance()); + hdf5_output_param_ = const_cast< ::ditcaffe::HDF5OutputParameter*>(&::ditcaffe::HDF5OutputParameter::default_instance()); + hinge_loss_param_ = const_cast< ::ditcaffe::HingeLossParameter*>(&::ditcaffe::HingeLossParameter::default_instance()); + image_data_param_ = const_cast< ::ditcaffe::ImageDataParameter*>(&::ditcaffe::ImageDataParameter::default_instance()); + infogain_loss_param_ = const_cast< ::ditcaffe::InfogainLossParameter*>(&::ditcaffe::InfogainLossParameter::default_instance()); + inner_product_param_ = const_cast< ::ditcaffe::InnerProductParameter*>(&::ditcaffe::InnerProductParameter::default_instance()); + lrn_param_ = const_cast< ::ditcaffe::LRNParameter*>(&::ditcaffe::LRNParameter::default_instance()); + memory_data_param_ = const_cast< ::ditcaffe::MemoryDataParameter*>(&::ditcaffe::MemoryDataParameter::default_instance()); + mvn_param_ = const_cast< ::ditcaffe::MVNParameter*>(&::ditcaffe::MVNParameter::default_instance()); + pooling_param_ = const_cast< ::ditcaffe::PoolingParameter*>(&::ditcaffe::PoolingParameter::default_instance()); + power_param_ = const_cast< ::ditcaffe::PowerParameter*>(&::ditcaffe::PowerParameter::default_instance()); + relu_param_ = const_cast< ::ditcaffe::ReLUParameter*>(&::ditcaffe::ReLUParameter::default_instance()); + sigmoid_param_ = const_cast< ::ditcaffe::SigmoidParameter*>(&::ditcaffe::SigmoidParameter::default_instance()); + softmax_param_ = const_cast< ::ditcaffe::SoftmaxParameter*>(&::ditcaffe::SoftmaxParameter::default_instance()); + slice_param_ = const_cast< ::ditcaffe::SliceParameter*>(&::ditcaffe::SliceParameter::default_instance()); + tanh_param_ = const_cast< ::ditcaffe::TanHParameter*>(&::ditcaffe::TanHParameter::default_instance()); + threshold_param_ = const_cast< ::ditcaffe::ThresholdParameter*>(&::ditcaffe::ThresholdParameter::default_instance()); + window_data_param_ = const_cast< ::ditcaffe::WindowDataParameter*>(&::ditcaffe::WindowDataParameter::default_instance()); + transform_param_ = const_cast< ::ditcaffe::TransformationParameter*>(&::ditcaffe::TransformationParameter::default_instance()); + loss_param_ = const_cast< ::ditcaffe::LossParameter*>(&::ditcaffe::LossParameter::default_instance()); + layer_ = const_cast< ::ditcaffe::V0LayerParameter*>(&::ditcaffe::V0LayerParameter::default_instance()); +} + +V1LayerParameter::V1LayerParameter(const V1LayerParameter& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.V1LayerParameter) +} + +void V1LayerParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + type_ = 0; + 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; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +V1LayerParameter::~V1LayerParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.V1LayerParameter) + SharedDtor(); +} + +void V1LayerParameter::SharedDtor() { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete name_; + } + if (this != default_instance_) { + 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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +V1LayerParameter* V1LayerParameter::default_instance_ = NULL; + +V1LayerParameter* V1LayerParameter::New() const { + return new V1LayerParameter; +} + +void V1LayerParameter::Clear() { + if (_has_bits_[0 / 32] & 36) { + if (has_name()) { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_->clear(); + } + } + type_ = 0; + } + if (_has_bits_[8 / 32] & 61440) { + if (has_accuracy_param()) { + if (accuracy_param_ != NULL) accuracy_param_->::ditcaffe::AccuracyParameter::Clear(); + } + if (has_argmax_param()) { + if (argmax_param_ != NULL) argmax_param_->::ditcaffe::ArgMaxParameter::Clear(); + } + if (has_concat_param()) { + if (concat_param_ != NULL) concat_param_->::ditcaffe::ConcatParameter::Clear(); + } + if (has_contrastive_loss_param()) { + if (contrastive_loss_param_ != NULL) contrastive_loss_param_->::ditcaffe::ContrastiveLossParameter::Clear(); + } + } + if (_has_bits_[16 / 32] & 16711680) { + if (has_convolution_param()) { + if (convolution_param_ != NULL) convolution_param_->::ditcaffe::ConvolutionParameter::Clear(); + } + if (has_data_param()) { + if (data_param_ != NULL) data_param_->::ditcaffe::DataParameter::Clear(); + } + if (has_dropout_param()) { + if (dropout_param_ != NULL) dropout_param_->::ditcaffe::DropoutParameter::Clear(); + } + if (has_dummy_data_param()) { + if (dummy_data_param_ != NULL) dummy_data_param_->::ditcaffe::DummyDataParameter::Clear(); + } + if (has_eltwise_param()) { + if (eltwise_param_ != NULL) eltwise_param_->::ditcaffe::EltwiseParameter::Clear(); + } + if (has_exp_param()) { + if (exp_param_ != NULL) exp_param_->::ditcaffe::ExpParameter::Clear(); + } + if (has_hdf5_data_param()) { + if (hdf5_data_param_ != NULL) hdf5_data_param_->::ditcaffe::HDF5DataParameter::Clear(); + } + if (has_hdf5_output_param()) { + if (hdf5_output_param_ != NULL) hdf5_output_param_->::ditcaffe::HDF5OutputParameter::Clear(); + } + } + // In-place patch to suppress error: this decimal constant is unsigned only in ISO C90 + if (_has_bits_[24 / 32] & /*4278190080*/ 0xFF000000) { + if (has_hinge_loss_param()) { + if (hinge_loss_param_ != NULL) hinge_loss_param_->::ditcaffe::HingeLossParameter::Clear(); + } + if (has_image_data_param()) { + if (image_data_param_ != NULL) image_data_param_->::ditcaffe::ImageDataParameter::Clear(); + } + if (has_infogain_loss_param()) { + if (infogain_loss_param_ != NULL) infogain_loss_param_->::ditcaffe::InfogainLossParameter::Clear(); + } + if (has_inner_product_param()) { + if (inner_product_param_ != NULL) inner_product_param_->::ditcaffe::InnerProductParameter::Clear(); + } + if (has_lrn_param()) { + if (lrn_param_ != NULL) lrn_param_->::ditcaffe::LRNParameter::Clear(); + } + if (has_memory_data_param()) { + if (memory_data_param_ != NULL) memory_data_param_->::ditcaffe::MemoryDataParameter::Clear(); + } + if (has_mvn_param()) { + if (mvn_param_ != NULL) mvn_param_->::ditcaffe::MVNParameter::Clear(); + } + if (has_pooling_param()) { + if (pooling_param_ != NULL) pooling_param_->::ditcaffe::PoolingParameter::Clear(); + } + } + if (_has_bits_[32 / 32] & 255) { + if (has_power_param()) { + if (power_param_ != NULL) power_param_->::ditcaffe::PowerParameter::Clear(); + } + if (has_relu_param()) { + if (relu_param_ != NULL) relu_param_->::ditcaffe::ReLUParameter::Clear(); + } + if (has_sigmoid_param()) { + if (sigmoid_param_ != NULL) sigmoid_param_->::ditcaffe::SigmoidParameter::Clear(); + } + if (has_softmax_param()) { + if (softmax_param_ != NULL) softmax_param_->::ditcaffe::SoftmaxParameter::Clear(); + } + if (has_slice_param()) { + if (slice_param_ != NULL) slice_param_->::ditcaffe::SliceParameter::Clear(); + } + if (has_tanh_param()) { + if (tanh_param_ != NULL) tanh_param_->::ditcaffe::TanHParameter::Clear(); + } + if (has_threshold_param()) { + if (threshold_param_ != NULL) threshold_param_->::ditcaffe::ThresholdParameter::Clear(); + } + if (has_window_data_param()) { + if (window_data_param_ != NULL) window_data_param_->::ditcaffe::WindowDataParameter::Clear(); + } + } + if (_has_bits_[40 / 32] & 1792) { + if (has_transform_param()) { + if (transform_param_ != NULL) transform_param_->::ditcaffe::TransformationParameter::Clear(); + } + if (has_loss_param()) { + if (loss_param_ != NULL) loss_param_->::ditcaffe::LossParameter::Clear(); + } + if (has_layer()) { + if (layer_ != NULL) layer_->::ditcaffe::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(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool V1LayerParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:ditcaffe.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 .ditcaffe.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, + "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, + "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, + "name"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(40)) goto parse_type; + break; + } + + // optional .ditcaffe.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 (::ditcaffe::V1LayerParameter_LayerType_IsValid(value)) { + set_type(static_cast< ::ditcaffe::V1LayerParameter_LayerType >(value)); + } else { + mutable_unknown_fields()->AddVarint(5, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(50)) goto parse_blobs; + break; + } + + // repeated .ditcaffe.BlobProto blobs = 6; + case 6: { + if (tag == 50) { + parse_blobs: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_blobs())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(50)) goto parse_blobs; + 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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.NetStateRule include = 32; + case 32: { + if (tag == 258) { + parse_include: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_include())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(258)) goto parse_include; + if (input->ExpectTag(266)) goto parse_exclude; + break; + } + + // repeated .ditcaffe.NetStateRule exclude = 33; + case 33: { + if (tag == 266) { + parse_exclude: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_exclude())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(266)) goto parse_exclude; + if (input->ExpectTag(274)) goto parse_mvn_param; + break; + } + + // optional .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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, + "param"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(8010)) goto parse_param; + if (input->ExpectTag(8016)) goto parse_blob_share_mode; + break; + } + + // repeated .ditcaffe.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 (::ditcaffe::V1LayerParameter_DimCheckMode_IsValid(value)) { + add_blob_share_mode(static_cast< ::ditcaffe::V1LayerParameter_DimCheckMode >(value)); + } else { + mutable_unknown_fields()->AddVarint(1002, value); + } + } else if (tag == 8018) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedEnumNoInline( + input, + &::ditcaffe::V1LayerParameter_DimCheckMode_IsValid, + 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:ditcaffe.V1LayerParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.V1LayerParameter) + return false; +#undef DO_ +} + +void V1LayerParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.V1LayerParameter) + // optional .ditcaffe.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, + "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, + "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, + "name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 4, this->name(), output); + } + + // optional .ditcaffe.V1LayerParameter.LayerType type = 5; + if (has_type()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 5, this->type(), output); + } + + // repeated .ditcaffe.BlobProto blobs = 6; + for (int i = 0; i < this->blobs_size(); 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 .ditcaffe.ConcatParameter concat_param = 9; + if (has_concat_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 9, this->concat_param(), output); + } + + // optional .ditcaffe.ConvolutionParameter convolution_param = 10; + if (has_convolution_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 10, this->convolution_param(), output); + } + + // optional .ditcaffe.DataParameter data_param = 11; + if (has_data_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 11, this->data_param(), output); + } + + // optional .ditcaffe.DropoutParameter dropout_param = 12; + if (has_dropout_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 12, this->dropout_param(), output); + } + + // optional .ditcaffe.HDF5DataParameter hdf5_data_param = 13; + if (has_hdf5_data_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 13, this->hdf5_data_param(), output); + } + + // optional .ditcaffe.HDF5OutputParameter hdf5_output_param = 14; + if (has_hdf5_output_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 14, this->hdf5_output_param(), output); + } + + // optional .ditcaffe.ImageDataParameter image_data_param = 15; + if (has_image_data_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 15, this->image_data_param(), output); + } + + // optional .ditcaffe.InfogainLossParameter infogain_loss_param = 16; + if (has_infogain_loss_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 16, this->infogain_loss_param(), output); + } + + // optional .ditcaffe.InnerProductParameter inner_product_param = 17; + if (has_inner_product_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 17, this->inner_product_param(), output); + } + + // optional .ditcaffe.LRNParameter lrn_param = 18; + if (has_lrn_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 18, this->lrn_param(), output); + } + + // optional .ditcaffe.PoolingParameter pooling_param = 19; + if (has_pooling_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 19, this->pooling_param(), output); + } + + // optional .ditcaffe.WindowDataParameter window_data_param = 20; + if (has_window_data_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 20, this->window_data_param(), output); + } + + // optional .ditcaffe.PowerParameter power_param = 21; + if (has_power_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 21, this->power_param(), output); + } + + // optional .ditcaffe.MemoryDataParameter memory_data_param = 22; + if (has_memory_data_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 22, this->memory_data_param(), output); + } + + // optional .ditcaffe.ArgMaxParameter argmax_param = 23; + if (has_argmax_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 23, this->argmax_param(), output); + } + + // optional .ditcaffe.EltwiseParameter eltwise_param = 24; + if (has_eltwise_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 24, this->eltwise_param(), output); + } + + // optional .ditcaffe.ThresholdParameter threshold_param = 25; + if (has_threshold_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 25, this->threshold_param(), output); + } + + // optional .ditcaffe.DummyDataParameter dummy_data_param = 26; + if (has_dummy_data_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 26, this->dummy_data_param(), output); + } + + // optional .ditcaffe.AccuracyParameter accuracy_param = 27; + if (has_accuracy_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 27, this->accuracy_param(), output); + } + + // optional .ditcaffe.HingeLossParameter hinge_loss_param = 29; + if (has_hinge_loss_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 29, this->hinge_loss_param(), output); + } + + // optional .ditcaffe.ReLUParameter relu_param = 30; + if (has_relu_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 30, this->relu_param(), output); + } + + // optional .ditcaffe.SliceParameter slice_param = 31; + if (has_slice_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 31, this->slice_param(), output); + } + + // repeated .ditcaffe.NetStateRule include = 32; + for (int i = 0; i < this->include_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 32, this->include(i), output); + } + + // repeated .ditcaffe.NetStateRule exclude = 33; + for (int i = 0; i < this->exclude_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 33, this->exclude(i), output); + } + + // optional .ditcaffe.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 .ditcaffe.TransformationParameter transform_param = 36; + if (has_transform_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 36, this->transform_param(), output); + } + + // optional .ditcaffe.TanHParameter tanh_param = 37; + if (has_tanh_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 37, this->tanh_param(), output); + } + + // optional .ditcaffe.SigmoidParameter sigmoid_param = 38; + if (has_sigmoid_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 38, this->sigmoid_param(), output); + } + + // optional .ditcaffe.SoftmaxParameter softmax_param = 39; + if (has_softmax_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 39, this->softmax_param(), output); + } + + // optional .ditcaffe.ContrastiveLossParameter contrastive_loss_param = 40; + if (has_contrastive_loss_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 40, this->contrastive_loss_param(), output); + } + + // optional .ditcaffe.ExpParameter exp_param = 41; + if (has_exp_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 41, this->exp_param(), output); + } + + // optional .ditcaffe.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, + "param"); + ::google::protobuf::internal::WireFormatLite::WriteString( + 1001, this->param(i), output); + } + + // repeated .ditcaffe.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 (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:ditcaffe.V1LayerParameter) +} + +::google::protobuf::uint8* V1LayerParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.V1LayerParameter) + // optional .ditcaffe.V0LayerParameter layer = 1; + if (has_layer()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 1, this->layer(), 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, + "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, + "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, + "name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 4, this->name(), target); + } + + // optional .ditcaffe.V1LayerParameter.LayerType type = 5; + if (has_type()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 5, this->type(), target); + } + + // repeated .ditcaffe.BlobProto blobs = 6; + for (int i = 0; i < this->blobs_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 6, this->blobs(i), 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 .ditcaffe.ConcatParameter concat_param = 9; + if (has_concat_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 9, this->concat_param(), target); + } + + // optional .ditcaffe.ConvolutionParameter convolution_param = 10; + if (has_convolution_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 10, this->convolution_param(), target); + } + + // optional .ditcaffe.DataParameter data_param = 11; + if (has_data_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 11, this->data_param(), target); + } + + // optional .ditcaffe.DropoutParameter dropout_param = 12; + if (has_dropout_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 12, this->dropout_param(), target); + } + + // optional .ditcaffe.HDF5DataParameter hdf5_data_param = 13; + if (has_hdf5_data_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 13, this->hdf5_data_param(), target); + } + + // optional .ditcaffe.HDF5OutputParameter hdf5_output_param = 14; + if (has_hdf5_output_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 14, this->hdf5_output_param(), target); + } + + // optional .ditcaffe.ImageDataParameter image_data_param = 15; + if (has_image_data_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 15, this->image_data_param(), target); + } + + // optional .ditcaffe.InfogainLossParameter infogain_loss_param = 16; + if (has_infogain_loss_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 16, this->infogain_loss_param(), target); + } + + // optional .ditcaffe.InnerProductParameter inner_product_param = 17; + if (has_inner_product_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 17, this->inner_product_param(), target); + } + + // optional .ditcaffe.LRNParameter lrn_param = 18; + if (has_lrn_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 18, this->lrn_param(), target); + } + + // optional .ditcaffe.PoolingParameter pooling_param = 19; + if (has_pooling_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 19, this->pooling_param(), target); + } + + // optional .ditcaffe.WindowDataParameter window_data_param = 20; + if (has_window_data_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 20, this->window_data_param(), target); + } + + // optional .ditcaffe.PowerParameter power_param = 21; + if (has_power_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 21, this->power_param(), target); + } + + // optional .ditcaffe.MemoryDataParameter memory_data_param = 22; + if (has_memory_data_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 22, this->memory_data_param(), target); + } + + // optional .ditcaffe.ArgMaxParameter argmax_param = 23; + if (has_argmax_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 23, this->argmax_param(), target); + } + + // optional .ditcaffe.EltwiseParameter eltwise_param = 24; + if (has_eltwise_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 24, this->eltwise_param(), target); + } + + // optional .ditcaffe.ThresholdParameter threshold_param = 25; + if (has_threshold_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 25, this->threshold_param(), target); + } + + // optional .ditcaffe.DummyDataParameter dummy_data_param = 26; + if (has_dummy_data_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 26, this->dummy_data_param(), target); + } + + // optional .ditcaffe.AccuracyParameter accuracy_param = 27; + if (has_accuracy_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 27, this->accuracy_param(), target); + } + + // optional .ditcaffe.HingeLossParameter hinge_loss_param = 29; + if (has_hinge_loss_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 29, this->hinge_loss_param(), target); + } + + // optional .ditcaffe.ReLUParameter relu_param = 30; + if (has_relu_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 30, this->relu_param(), target); + } + + // optional .ditcaffe.SliceParameter slice_param = 31; + if (has_slice_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 31, this->slice_param(), target); + } + + // repeated .ditcaffe.NetStateRule include = 32; + for (int i = 0; i < this->include_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 32, this->include(i), target); + } + + // repeated .ditcaffe.NetStateRule exclude = 33; + for (int i = 0; i < this->exclude_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 33, this->exclude(i), target); + } + + // optional .ditcaffe.MVNParameter mvn_param = 34; + if (has_mvn_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 34, this->mvn_param(), 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 .ditcaffe.TransformationParameter transform_param = 36; + if (has_transform_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 36, this->transform_param(), target); + } + + // optional .ditcaffe.TanHParameter tanh_param = 37; + if (has_tanh_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 37, this->tanh_param(), target); + } + + // optional .ditcaffe.SigmoidParameter sigmoid_param = 38; + if (has_sigmoid_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 38, this->sigmoid_param(), target); + } + + // optional .ditcaffe.SoftmaxParameter softmax_param = 39; + if (has_softmax_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 39, this->softmax_param(), target); + } + + // optional .ditcaffe.ContrastiveLossParameter contrastive_loss_param = 40; + if (has_contrastive_loss_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 40, this->contrastive_loss_param(), target); + } + + // optional .ditcaffe.ExpParameter exp_param = 41; + if (has_exp_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 41, this->exp_param(), target); + } + + // optional .ditcaffe.LossParameter loss_param = 42; + if (has_loss_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 42, this->loss_param(), 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, + "param"); + target = ::google::protobuf::internal::WireFormatLite:: + WriteStringToArray(1001, this->param(i), target); + } + + // repeated .ditcaffe.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 (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.V1LayerParameter) + return target; +} + +int V1LayerParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[2 / 32] & (0xffu << (2 % 32))) { + // optional string name = 4; + if (has_name()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } + + // optional .ditcaffe.V1LayerParameter.LayerType type = 5; + if (has_type()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->type()); + } + + } + if (_has_bits_[12 / 32] & (0xffu << (12 % 32))) { + // optional .ditcaffe.AccuracyParameter accuracy_param = 27; + if (has_accuracy_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->accuracy_param()); + } + + // optional .ditcaffe.ArgMaxParameter argmax_param = 23; + if (has_argmax_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->argmax_param()); + } + + // optional .ditcaffe.ConcatParameter concat_param = 9; + if (has_concat_param()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->concat_param()); + } + + // optional .ditcaffe.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] & (0xffu << (16 % 32))) { + // optional .ditcaffe.ConvolutionParameter convolution_param = 10; + if (has_convolution_param()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->convolution_param()); + } + + // optional .ditcaffe.DataParameter data_param = 11; + if (has_data_param()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->data_param()); + } + + // optional .ditcaffe.DropoutParameter dropout_param = 12; + if (has_dropout_param()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->dropout_param()); + } + + // optional .ditcaffe.DummyDataParameter dummy_data_param = 26; + if (has_dummy_data_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->dummy_data_param()); + } + + // optional .ditcaffe.EltwiseParameter eltwise_param = 24; + if (has_eltwise_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->eltwise_param()); + } + + // optional .ditcaffe.ExpParameter exp_param = 41; + if (has_exp_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->exp_param()); + } + + // optional .ditcaffe.HDF5DataParameter hdf5_data_param = 13; + if (has_hdf5_data_param()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->hdf5_data_param()); + } + + // optional .ditcaffe.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] & (0xffu << (24 % 32))) { + // optional .ditcaffe.HingeLossParameter hinge_loss_param = 29; + if (has_hinge_loss_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->hinge_loss_param()); + } + + // optional .ditcaffe.ImageDataParameter image_data_param = 15; + if (has_image_data_param()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->image_data_param()); + } + + // optional .ditcaffe.InfogainLossParameter infogain_loss_param = 16; + if (has_infogain_loss_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->infogain_loss_param()); + } + + // optional .ditcaffe.InnerProductParameter inner_product_param = 17; + if (has_inner_product_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->inner_product_param()); + } + + // optional .ditcaffe.LRNParameter lrn_param = 18; + if (has_lrn_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->lrn_param()); + } + + // optional .ditcaffe.MemoryDataParameter memory_data_param = 22; + if (has_memory_data_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->memory_data_param()); + } + + // optional .ditcaffe.MVNParameter mvn_param = 34; + if (has_mvn_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->mvn_param()); + } + + // optional .ditcaffe.PoolingParameter pooling_param = 19; + if (has_pooling_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->pooling_param()); + } + + } + if (_has_bits_[32 / 32] & (0xffu << (32 % 32))) { + // optional .ditcaffe.PowerParameter power_param = 21; + if (has_power_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->power_param()); + } + + // optional .ditcaffe.ReLUParameter relu_param = 30; + if (has_relu_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->relu_param()); + } + + // optional .ditcaffe.SigmoidParameter sigmoid_param = 38; + if (has_sigmoid_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->sigmoid_param()); + } + + // optional .ditcaffe.SoftmaxParameter softmax_param = 39; + if (has_softmax_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->softmax_param()); + } + + // optional .ditcaffe.SliceParameter slice_param = 31; + if (has_slice_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->slice_param()); + } + + // optional .ditcaffe.TanHParameter tanh_param = 37; + if (has_tanh_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->tanh_param()); + } + + // optional .ditcaffe.ThresholdParameter threshold_param = 25; + if (has_threshold_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->threshold_param()); + } + + // optional .ditcaffe.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] & (0xffu << (40 % 32))) { + // optional .ditcaffe.TransformationParameter transform_param = 36; + if (has_transform_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->transform_param()); + } + + // optional .ditcaffe.LossParameter loss_param = 42; + if (has_loss_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->loss_param()); + } + + // optional .ditcaffe.V0LayerParameter layer = 1; + if (has_layer()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->layer()); + } + + } + // repeated string bottom = 2; + total_size += 1 * 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 * this->top_size(); + for (int i = 0; i < this->top_size(); i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->top(i)); + } + + // repeated .ditcaffe.NetStateRule include = 32; + total_size += 2 * this->include_size(); + for (int i = 0; i < this->include_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->include(i)); + } + + // repeated .ditcaffe.NetStateRule exclude = 33; + total_size += 2 * this->exclude_size(); + for (int i = 0; i < this->exclude_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->exclude(i)); + } + + // repeated .ditcaffe.BlobProto blobs = 6; + total_size += 1 * this->blobs_size(); + for (int i = 0; i < this->blobs_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->blobs(i)); + } + + // repeated string param = 1001; + total_size += 2 * this->param_size(); + for (int i = 0; i < this->param_size(); i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->param(i)); + } + + // repeated .ditcaffe.V1LayerParameter.DimCheckMode blob_share_mode = 1002; + { + int data_size = 0; + for (int i = 0; i < this->blob_share_mode_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite::EnumSize( + this->blob_share_mode(i)); + } + total_size += 2 * this->blob_share_mode_size() + data_size; + } + + // repeated float blobs_lr = 7; + { + int data_size = 0; + data_size = 4 * this->blobs_lr_size(); + total_size += 1 * this->blobs_lr_size() + data_size; + } + + // repeated float weight_decay = 8; + { + int data_size = 0; + data_size = 4 * this->weight_decay_size(); + total_size += 1 * this->weight_decay_size() + data_size; + } + + // repeated float loss_weight = 35; + { + int data_size = 0; + data_size = 4 * this->loss_weight_size(); + total_size += 2 * this->loss_weight_size() + data_size; + } + + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void V1LayerParameter::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const V1LayerParameter* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void V1LayerParameter::MergeFrom(const V1LayerParameter& from) { + GOOGLE_CHECK_NE(&from, this); + bottom_.MergeFrom(from.bottom_); + top_.MergeFrom(from.top_); + include_.MergeFrom(from.include_); + exclude_.MergeFrom(from.exclude_); + blobs_.MergeFrom(from.blobs_); + param_.MergeFrom(from.param_); + blob_share_mode_.MergeFrom(from.blob_share_mode_); + blobs_lr_.MergeFrom(from.blobs_lr_); + weight_decay_.MergeFrom(from.weight_decay_); + loss_weight_.MergeFrom(from.loss_weight_); + if (from._has_bits_[2 / 32] & (0xffu << (2 % 32))) { + if (from.has_name()) { + set_name(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()->::ditcaffe::AccuracyParameter::MergeFrom(from.accuracy_param()); + } + if (from.has_argmax_param()) { + mutable_argmax_param()->::ditcaffe::ArgMaxParameter::MergeFrom(from.argmax_param()); + } + if (from.has_concat_param()) { + mutable_concat_param()->::ditcaffe::ConcatParameter::MergeFrom(from.concat_param()); + } + if (from.has_contrastive_loss_param()) { + mutable_contrastive_loss_param()->::ditcaffe::ContrastiveLossParameter::MergeFrom(from.contrastive_loss_param()); + } + } + if (from._has_bits_[16 / 32] & (0xffu << (16 % 32))) { + if (from.has_convolution_param()) { + mutable_convolution_param()->::ditcaffe::ConvolutionParameter::MergeFrom(from.convolution_param()); + } + if (from.has_data_param()) { + mutable_data_param()->::ditcaffe::DataParameter::MergeFrom(from.data_param()); + } + if (from.has_dropout_param()) { + mutable_dropout_param()->::ditcaffe::DropoutParameter::MergeFrom(from.dropout_param()); + } + if (from.has_dummy_data_param()) { + mutable_dummy_data_param()->::ditcaffe::DummyDataParameter::MergeFrom(from.dummy_data_param()); + } + if (from.has_eltwise_param()) { + mutable_eltwise_param()->::ditcaffe::EltwiseParameter::MergeFrom(from.eltwise_param()); + } + if (from.has_exp_param()) { + mutable_exp_param()->::ditcaffe::ExpParameter::MergeFrom(from.exp_param()); + } + if (from.has_hdf5_data_param()) { + mutable_hdf5_data_param()->::ditcaffe::HDF5DataParameter::MergeFrom(from.hdf5_data_param()); + } + if (from.has_hdf5_output_param()) { + mutable_hdf5_output_param()->::ditcaffe::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()->::ditcaffe::HingeLossParameter::MergeFrom(from.hinge_loss_param()); + } + if (from.has_image_data_param()) { + mutable_image_data_param()->::ditcaffe::ImageDataParameter::MergeFrom(from.image_data_param()); + } + if (from.has_infogain_loss_param()) { + mutable_infogain_loss_param()->::ditcaffe::InfogainLossParameter::MergeFrom(from.infogain_loss_param()); + } + if (from.has_inner_product_param()) { + mutable_inner_product_param()->::ditcaffe::InnerProductParameter::MergeFrom(from.inner_product_param()); + } + if (from.has_lrn_param()) { + mutable_lrn_param()->::ditcaffe::LRNParameter::MergeFrom(from.lrn_param()); + } + if (from.has_memory_data_param()) { + mutable_memory_data_param()->::ditcaffe::MemoryDataParameter::MergeFrom(from.memory_data_param()); + } + if (from.has_mvn_param()) { + mutable_mvn_param()->::ditcaffe::MVNParameter::MergeFrom(from.mvn_param()); + } + if (from.has_pooling_param()) { + mutable_pooling_param()->::ditcaffe::PoolingParameter::MergeFrom(from.pooling_param()); + } + } + if (from._has_bits_[32 / 32] & (0xffu << (32 % 32))) { + if (from.has_power_param()) { + mutable_power_param()->::ditcaffe::PowerParameter::MergeFrom(from.power_param()); + } + if (from.has_relu_param()) { + mutable_relu_param()->::ditcaffe::ReLUParameter::MergeFrom(from.relu_param()); + } + if (from.has_sigmoid_param()) { + mutable_sigmoid_param()->::ditcaffe::SigmoidParameter::MergeFrom(from.sigmoid_param()); + } + if (from.has_softmax_param()) { + mutable_softmax_param()->::ditcaffe::SoftmaxParameter::MergeFrom(from.softmax_param()); + } + if (from.has_slice_param()) { + mutable_slice_param()->::ditcaffe::SliceParameter::MergeFrom(from.slice_param()); + } + if (from.has_tanh_param()) { + mutable_tanh_param()->::ditcaffe::TanHParameter::MergeFrom(from.tanh_param()); + } + if (from.has_threshold_param()) { + mutable_threshold_param()->::ditcaffe::ThresholdParameter::MergeFrom(from.threshold_param()); + } + if (from.has_window_data_param()) { + mutable_window_data_param()->::ditcaffe::WindowDataParameter::MergeFrom(from.window_data_param()); + } + } + if (from._has_bits_[40 / 32] & (0xffu << (40 % 32))) { + if (from.has_transform_param()) { + mutable_transform_param()->::ditcaffe::TransformationParameter::MergeFrom(from.transform_param()); + } + if (from.has_loss_param()) { + mutable_loss_param()->::ditcaffe::LossParameter::MergeFrom(from.loss_param()); + } + if (from.has_layer()) { + mutable_layer()->::ditcaffe::V0LayerParameter::MergeFrom(from.layer()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void V1LayerParameter::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void V1LayerParameter::CopyFrom(const V1LayerParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool V1LayerParameter::IsInitialized() const { + + return true; +} + +void V1LayerParameter::Swap(V1LayerParameter* other) { + if (other != this) { + bottom_.Swap(&other->bottom_); + top_.Swap(&other->top_); + std::swap(name_, other->name_); + include_.Swap(&other->include_); + exclude_.Swap(&other->exclude_); + std::swap(type_, other->type_); + blobs_.Swap(&other->blobs_); + param_.Swap(&other->param_); + blob_share_mode_.Swap(&other->blob_share_mode_); + blobs_lr_.Swap(&other->blobs_lr_); + weight_decay_.Swap(&other->weight_decay_); + loss_weight_.Swap(&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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + 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; +} + + +// =================================================================== + +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; + } +} + +#ifndef _MSC_VER +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 // _MSC_VER +::std::string* V0LayerParameter::_default_det_crop_mode_ = NULL; +#ifndef _MSC_VER +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 // !_MSC_VER + +V0LayerParameter::V0LayerParameter() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.V0LayerParameter) +} + +void V0LayerParameter::InitAsDefaultInstance() { + weight_filler_ = const_cast< ::ditcaffe::FillerParameter*>(&::ditcaffe::FillerParameter::default_instance()); + bias_filler_ = const_cast< ::ditcaffe::FillerParameter*>(&::ditcaffe::FillerParameter::default_instance()); + hdf5_output_param_ = const_cast< ::ditcaffe::HDF5OutputParameter*>(&::ditcaffe::HDF5OutputParameter::default_instance()); +} + +V0LayerParameter::V0LayerParameter(const V0LayerParameter& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.V0LayerParameter) +} + +void V0LayerParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + type_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + num_output_ = 0u; + biasterm_ = true; + weight_filler_ = NULL; + bias_filler_ = NULL; + pad_ = 0u; + kernelsize_ = 0u; + group_ = 1u; + stride_ = 1u; + pool_ = 0; + dropout_ratio_ = 0.5f; + local_size_ = 5u; + alpha_ = 1; + beta_ = 0.75f; + k_ = 1; + source_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + scale_ = 1; + meanfile_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + batchsize_ = 0u; + cropsize_ = 0u; + mirror_ = false; + rand_skip_ = 0u; + det_fg_threshold_ = 0.5f; + det_bg_threshold_ = 0.5f; + det_fg_fraction_ = 0.25f; + det_context_pad_ = 0u; + det_crop_mode_ = const_cast< ::std::string*>(_default_det_crop_mode_); + new_num_ = 0; + new_channels_ = 0; + new_height_ = 0; + new_width_ = 0; + shuffle_images_ = false; + concat_dim_ = 1u; + hdf5_output_param_ = NULL; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +V0LayerParameter::~V0LayerParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.V0LayerParameter) + SharedDtor(); +} + +void V0LayerParameter::SharedDtor() { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete name_; + } + if (type_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete type_; + } + if (source_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete source_; + } + if (meanfile_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete meanfile_; + } + if (det_crop_mode_ != _default_det_crop_mode_) { + delete det_crop_mode_; + } + if (this != default_instance_) { + 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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +V0LayerParameter* V0LayerParameter::default_instance_ = NULL; + +V0LayerParameter* V0LayerParameter::New() const { + return new V0LayerParameter; +} + +void V0LayerParameter::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 255) { + ZR_(num_output_, pad_); + if (has_name()) { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_->clear(); + } + } + if (has_type()) { + if (type_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + type_->clear(); + } + } + biasterm_ = true; + if (has_weight_filler()) { + if (weight_filler_ != NULL) weight_filler_->::ditcaffe::FillerParameter::Clear(); + } + if (has_bias_filler()) { + if (bias_filler_ != NULL) bias_filler_->::ditcaffe::FillerParameter::Clear(); + } + kernelsize_ = 0u; + } + if (_has_bits_[8 / 32] & 65280) { + 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] & 4128768) { + if (has_source()) { + if (source_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_->clear(); + } + } + scale_ = 1; + if (has_meanfile()) { + if (meanfile_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + meanfile_->clear(); + } + } + batchsize_ = 0u; + cropsize_ = 0u; + mirror_ = false; + } + // In-place patch to suppress error: this decimal constant is unsigned only in ISO C90 + if (_has_bits_[24 / 32] & /*4261412864*/ 0xFE000000) { + rand_skip_ = 0u; + det_fg_threshold_ = 0.5f; + det_bg_threshold_ = 0.5f; + det_fg_fraction_ = 0.25f; + det_context_pad_ = 0u; + if (has_det_crop_mode()) { + if (det_crop_mode_ != _default_det_crop_mode_) { + det_crop_mode_->assign(*_default_det_crop_mode_); + } + } + new_num_ = 0; + } + if (_has_bits_[32 / 32] & 63) { + ZR_(new_channels_, new_width_); + shuffle_images_ = false; + concat_dim_ = 1u; + if (has_hdf5_output_param()) { + if (hdf5_output_param_ != NULL) hdf5_output_param_->::ditcaffe::HDF5OutputParameter::Clear(); + } + } + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + blobs_.Clear(); + blobs_lr_.Clear(); + weight_decay_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool V0LayerParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:ditcaffe.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, + "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, + "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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &num_output_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &biasterm_))); + set_has_biasterm(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(42)) goto parse_weight_filler; + break; + } + + // optional .ditcaffe.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 .ditcaffe.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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &pad_))); + set_has_pad(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(64)) goto parse_kernelsize; + break; + } + + // optional uint32 kernelsize = 8; + case 8: { + if (tag == 64) { + parse_kernelsize: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &kernelsize_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &group_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &stride_))); + set_has_stride(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(88)) goto parse_pool; + break; + } + + // optional .ditcaffe.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 (::ditcaffe::V0LayerParameter_PoolMethod_IsValid(value)) { + set_pool(static_cast< ::ditcaffe::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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &dropout_ratio_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &local_size_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &alpha_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &beta_))); + set_has_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, + "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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &scale_))); + set_has_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, + "meanfile"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(152)) goto parse_batchsize; + break; + } + + // optional uint32 batchsize = 19; + case 19: { + if (tag == 152) { + parse_batchsize: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &batchsize_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &cropsize_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &mirror_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &k_))); + set_has_k(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(402)) goto parse_blobs; + break; + } + + // repeated .ditcaffe.BlobProto blobs = 50; + case 50: { + if (tag == 402) { + parse_blobs: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_blobs())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(402)) goto parse_blobs; + 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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &rand_skip_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &det_fg_threshold_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &det_bg_threshold_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &det_fg_fraction_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &det_context_pad_))); + set_has_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, + "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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &new_num_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &new_channels_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &new_height_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &new_width_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &shuffle_images_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &concat_dim_))); + set_has_concat_dim(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(8010)) goto parse_hdf5_output_param; + break; + } + + // optional .ditcaffe.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:ditcaffe.V0LayerParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.V0LayerParameter) + return false; +#undef DO_ +} + +void V0LayerParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.V0LayerParameter) + // optional string name = 1; + if (has_name()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "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, + "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 .ditcaffe.FillerParameter weight_filler = 5; + if (has_weight_filler()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 5, this->weight_filler(), output); + } + + // optional .ditcaffe.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 .ditcaffe.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, + "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, + "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 .ditcaffe.BlobProto blobs = 50; + for (int i = 0; i < this->blobs_size(); 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, + "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 .ditcaffe.HDF5OutputParameter hdf5_output_param = 1001; + if (has_hdf5_output_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1001, this->hdf5_output_param(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:ditcaffe.V0LayerParameter) +} + +::google::protobuf::uint8* V0LayerParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.V0LayerParameter) + // optional string name = 1; + if (has_name()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "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, + "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 .ditcaffe.FillerParameter weight_filler = 5; + if (has_weight_filler()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 5, this->weight_filler(), target); + } + + // optional .ditcaffe.FillerParameter bias_filler = 6; + if (has_bias_filler()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 6, this->bias_filler(), 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 .ditcaffe.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, + "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, + "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 .ditcaffe.BlobProto blobs = 50; + for (int i = 0; i < this->blobs_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 50, this->blobs(i), 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, + "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 .ditcaffe.HDF5OutputParameter hdf5_output_param = 1001; + if (has_hdf5_output_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 1001, this->hdf5_output_param(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.V0LayerParameter) + return target; +} + +int V0LayerParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // 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 .ditcaffe.FillerParameter weight_filler = 5; + if (has_weight_filler()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->weight_filler()); + } + + // optional .ditcaffe.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] & (0xffu << (8 % 32))) { + // 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 .ditcaffe.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] & (0xffu << (16 % 32))) { + // 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] & (0xffu << (25 % 32))) { + // 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] & (0xffu << (32 % 32))) { + // 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 .ditcaffe.HDF5OutputParameter hdf5_output_param = 1001; + if (has_hdf5_output_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->hdf5_output_param()); + } + + } + // repeated .ditcaffe.BlobProto blobs = 50; + total_size += 2 * this->blobs_size(); + for (int i = 0; i < this->blobs_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->blobs(i)); + } + + // repeated float blobs_lr = 51; + { + int data_size = 0; + data_size = 4 * this->blobs_lr_size(); + total_size += 2 * this->blobs_lr_size() + data_size; + } + + // repeated float weight_decay = 52; + { + int data_size = 0; + data_size = 4 * this->weight_decay_size(); + total_size += 2 * this->weight_decay_size() + data_size; + } + + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void V0LayerParameter::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const V0LayerParameter* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void V0LayerParameter::MergeFrom(const V0LayerParameter& from) { + GOOGLE_CHECK_NE(&from, this); + blobs_.MergeFrom(from.blobs_); + blobs_lr_.MergeFrom(from.blobs_lr_); + weight_decay_.MergeFrom(from.weight_decay_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_name()) { + set_name(from.name()); + } + if (from.has_type()) { + set_type(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()->::ditcaffe::FillerParameter::MergeFrom(from.weight_filler()); + } + if (from.has_bias_filler()) { + mutable_bias_filler()->::ditcaffe::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_source(from.source()); + } + if (from.has_scale()) { + set_scale(from.scale()); + } + if (from.has_meanfile()) { + set_meanfile(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_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()->::ditcaffe::HDF5OutputParameter::MergeFrom(from.hdf5_output_param()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void V0LayerParameter::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void V0LayerParameter::CopyFrom(const V0LayerParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool V0LayerParameter::IsInitialized() const { + + return true; +} + +void V0LayerParameter::Swap(V0LayerParameter* other) { + if (other != this) { + std::swap(name_, other->name_); + std::swap(type_, 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_); + std::swap(source_, other->source_); + std::swap(scale_, other->scale_); + std::swap(meanfile_, other->meanfile_); + std::swap(batchsize_, other->batchsize_); + std::swap(cropsize_, other->cropsize_); + std::swap(mirror_, other->mirror_); + blobs_.Swap(&other->blobs_); + blobs_lr_.Swap(&other->blobs_lr_); + weight_decay_.Swap(&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_); + std::swap(det_crop_mode_, 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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + 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; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int PReLUParameter::kFillerFieldNumber; +const int PReLUParameter::kChannelSharedFieldNumber; +#endif // !_MSC_VER + +PReLUParameter::PReLUParameter() + : ::google::protobuf::Message() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.PReLUParameter) +} + +void PReLUParameter::InitAsDefaultInstance() { + filler_ = const_cast< ::ditcaffe::FillerParameter*>(&::ditcaffe::FillerParameter::default_instance()); +} + +PReLUParameter::PReLUParameter(const PReLUParameter& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.PReLUParameter) +} + +void PReLUParameter::SharedCtor() { + _cached_size_ = 0; + filler_ = NULL; + channel_shared_ = false; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +PReLUParameter::~PReLUParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.PReLUParameter) + SharedDtor(); +} + +void PReLUParameter::SharedDtor() { + if (this != default_instance_) { + 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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +PReLUParameter* PReLUParameter::default_instance_ = NULL; + +PReLUParameter* PReLUParameter::New() const { + return new PReLUParameter; +} + +void PReLUParameter::Clear() { + if (_has_bits_[0 / 32] & 3) { + if (has_filler()) { + if (filler_ != NULL) filler_->::ditcaffe::FillerParameter::Clear(); + } + channel_shared_ = false; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool PReLUParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:ditcaffe.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 .ditcaffe.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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &channel_shared_))); + set_has_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:ditcaffe.PReLUParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.PReLUParameter) + return false; +#undef DO_ +} + +void PReLUParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.PReLUParameter) + // optional .ditcaffe.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 (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:ditcaffe.PReLUParameter) +} + +::google::protobuf::uint8* PReLUParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.PReLUParameter) + // optional .ditcaffe.FillerParameter filler = 1; + if (has_filler()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 1, this->filler(), target); + } + + // optional bool channel_shared = 2 [default = false]; + if (has_channel_shared()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(2, this->channel_shared(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.PReLUParameter) + return target; +} + +int PReLUParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional .ditcaffe.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 (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void PReLUParameter::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const PReLUParameter* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void PReLUParameter::MergeFrom(const PReLUParameter& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_filler()) { + mutable_filler()->::ditcaffe::FillerParameter::MergeFrom(from.filler()); + } + if (from.has_channel_shared()) { + set_channel_shared(from.channel_shared()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void PReLUParameter::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void PReLUParameter::CopyFrom(const PReLUParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool PReLUParameter::IsInitialized() const { + + return true; +} + +void PReLUParameter::Swap(PReLUParameter* other) { + if (other != this) { + std::swap(filler_, other->filler_); + std::swap(channel_shared_, other->channel_shared_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + 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; +} + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace ditcaffe + +// @@protoc_insertion_point(global_scope) diff --git a/umd/core/src/compiler/caffe/ditcaffe/protobuf-2.6.1/ditcaffe.pb.h b/umd/core/src/compiler/caffe/ditcaffe/protobuf-2.6.1/ditcaffe.pb.h new file mode 100644 index 00000000..4d208a7b --- /dev/null +++ b/umd/core/src/compiler/caffe/ditcaffe/protobuf-2.6.1/ditcaffe.pb.h @@ -0,0 +1,24452 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: ditcaffe.proto + +#ifndef PROTOBUF_ditcaffe_2eproto__INCLUDED +#define PROTOBUF_ditcaffe_2eproto__INCLUDED + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 2006000 +#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 2006001 < 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 +// @@protoc_insertion_point(includes) + +namespace ditcaffe { + +// Internal implementation detail -- do not call these. +void protobuf_AddDesc_ditcaffe_2eproto(); +void protobuf_AssignDesc_ditcaffe_2eproto(); +void protobuf_ShutdownFile_ditcaffe_2eproto(); + +class BlobShape; +class BlobProto; +class BlobProtoVector; +class Datum; +class FillerParameter; +class NetParameter; +class SolverParameter; +class SolverState; +class NetState; +class NetStateRule; +class ParamSpec; +class LayerParameter; +class TransformationParameter; +class LossParameter; +class AccuracyParameter; +class ArgMaxParameter; +class ConcatParameter; +class BatchNormParameter; +class BiasParameter; +class ContrastiveLossParameter; +class ConvolutionParameter; +class CropParameter; +class DataParameter; +class DropoutParameter; +class DummyDataParameter; +class EltwiseParameter; +class ELUParameter; +class EmbedParameter; +class ExpParameter; +class FlattenParameter; +class HDF5DataParameter; +class HDF5OutputParameter; +class HingeLossParameter; +class ImageDataParameter; +class InfogainLossParameter; +class InnerProductParameter; +class InputParameter; +class LogParameter; +class LRNParameter; +class MemoryDataParameter; +class MVNParameter; +class ParameterParameter; +class PoolingParameter; +class PowerParameter; +class PythonParameter; +class ReductionParameter; +class ReLUParameter; +class ReshapeParameter; +class ScaleParameter; +class SigmoidParameter; +class SliceParameter; +class SoftmaxParameter; +class TanHParameter; +class TileParameter; +class ThresholdParameter; +class WindowDataParameter; +class SPPParameter; +class V1LayerParameter; +class V0LayerParameter; +class PReLUParameter; + +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 { + 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 _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const BlobShape& default_instance(); + + void Swap(BlobShape* other); + + // implements Message ---------------------------------------------- + + BlobShape* New() 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated int64 dim = 1 [packed = true]; + inline int dim_size() const; + inline void clear_dim(); + static const int kDimFieldNumber = 1; + inline ::google::protobuf::int64 dim(int index) const; + inline void set_dim(int index, ::google::protobuf::int64 value); + inline void add_dim(::google::protobuf::int64 value); + inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& + dim() const; + inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* + mutable_dim(); + + // @@protoc_insertion_point(class_scope:ditcaffe.BlobShape) + private: + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 > dim_; + mutable int _dim_cached_byte_size_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static BlobShape* default_instance_; +}; +// ------------------------------------------------------------------- + +class BlobProto : public ::google::protobuf::Message { + 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 _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const BlobProto& default_instance(); + + void Swap(BlobProto* other); + + // implements Message ---------------------------------------------- + + BlobProto* New() 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional .ditcaffe.BlobShape shape = 7; + inline bool has_shape() const; + inline void clear_shape(); + static const int kShapeFieldNumber = 7; + inline const ::ditcaffe::BlobShape& shape() const; + inline ::ditcaffe::BlobShape* mutable_shape(); + inline ::ditcaffe::BlobShape* release_shape(); + inline void set_allocated_shape(::ditcaffe::BlobShape* shape); + + // repeated float data = 5 [packed = true]; + inline int data_size() const; + inline void clear_data(); + static const int kDataFieldNumber = 5; + inline float data(int index) const; + inline void set_data(int index, float value); + inline void add_data(float value); + inline const ::google::protobuf::RepeatedField< float >& + data() const; + inline ::google::protobuf::RepeatedField< float >* + mutable_data(); + + // repeated float diff = 6 [packed = true]; + inline int diff_size() const; + inline void clear_diff(); + static const int kDiffFieldNumber = 6; + inline float diff(int index) const; + inline void set_diff(int index, float value); + inline void add_diff(float value); + inline const ::google::protobuf::RepeatedField< float >& + diff() const; + inline ::google::protobuf::RepeatedField< float >* + mutable_diff(); + + // repeated double double_data = 8 [packed = true]; + inline int double_data_size() const; + inline void clear_double_data(); + static const int kDoubleDataFieldNumber = 8; + inline double double_data(int index) const; + inline void set_double_data(int index, double value); + inline void add_double_data(double value); + inline const ::google::protobuf::RepeatedField< double >& + double_data() const; + inline ::google::protobuf::RepeatedField< double >* + mutable_double_data(); + + // repeated double double_diff = 9 [packed = true]; + inline int double_diff_size() const; + inline void clear_double_diff(); + static const int kDoubleDiffFieldNumber = 9; + inline double double_diff(int index) const; + inline void set_double_diff(int index, double value); + inline void add_double_diff(double value); + inline const ::google::protobuf::RepeatedField< double >& + double_diff() const; + inline ::google::protobuf::RepeatedField< double >* + mutable_double_diff(); + + // repeated uint32 half_data = 10 [packed = true]; + inline int half_data_size() const; + inline void clear_half_data(); + static const int kHalfDataFieldNumber = 10; + inline ::google::protobuf::uint32 half_data(int index) const; + inline void set_half_data(int index, ::google::protobuf::uint32 value); + inline void add_half_data(::google::protobuf::uint32 value); + inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& + half_data() const; + inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* + mutable_half_data(); + + // repeated uint32 half_diff = 11 [packed = true]; + inline int half_diff_size() const; + inline void clear_half_diff(); + static const int kHalfDiffFieldNumber = 11; + inline ::google::protobuf::uint32 half_diff(int index) const; + inline void set_half_diff(int index, ::google::protobuf::uint32 value); + inline void add_half_diff(::google::protobuf::uint32 value); + inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& + half_diff() const; + inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* + mutable_half_diff(); + + // optional int32 num = 1 [default = 0]; + inline bool has_num() const; + inline void clear_num(); + static const int kNumFieldNumber = 1; + inline ::google::protobuf::int32 num() const; + inline void set_num(::google::protobuf::int32 value); + + // optional int32 channels = 2 [default = 0]; + inline bool has_channels() const; + inline void clear_channels(); + static const int kChannelsFieldNumber = 2; + inline ::google::protobuf::int32 channels() const; + inline void set_channels(::google::protobuf::int32 value); + + // optional int32 height = 3 [default = 0]; + inline bool has_height() const; + inline void clear_height(); + static const int kHeightFieldNumber = 3; + inline ::google::protobuf::int32 height() const; + inline void set_height(::google::protobuf::int32 value); + + // optional int32 width = 4 [default = 0]; + inline bool has_width() const; + inline void clear_width(); + static const int kWidthFieldNumber = 4; + inline ::google::protobuf::int32 width() const; + inline void set_width(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::ditcaffe::BlobShape* shape_; + ::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_; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > half_data_; + mutable int _half_data_cached_byte_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > half_diff_; + mutable int _half_diff_cached_byte_size_; + ::google::protobuf::int32 num_; + ::google::protobuf::int32 channels_; + ::google::protobuf::int32 height_; + ::google::protobuf::int32 width_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static BlobProto* default_instance_; +}; +// ------------------------------------------------------------------- + +class BlobProtoVector : public ::google::protobuf::Message { + 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 _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const BlobProtoVector& default_instance(); + + void Swap(BlobProtoVector* other); + + // implements Message ---------------------------------------------- + + BlobProtoVector* New() 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .ditcaffe.BlobProto blobs = 1; + inline int blobs_size() const; + inline void clear_blobs(); + static const int kBlobsFieldNumber = 1; + inline const ::ditcaffe::BlobProto& blobs(int index) const; + inline ::ditcaffe::BlobProto* mutable_blobs(int index); + inline ::ditcaffe::BlobProto* add_blobs(); + inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >& + blobs() const; + inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >* + mutable_blobs(); + + // @@protoc_insertion_point(class_scope:ditcaffe.BlobProtoVector) + private: + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto > blobs_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static BlobProtoVector* default_instance_; +}; +// ------------------------------------------------------------------- + +class Datum : public ::google::protobuf::Message { + 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 _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const Datum& default_instance(); + + void Swap(Datum* other); + + // implements Message ---------------------------------------------- + + Datum* New() 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional int32 channels = 1; + inline bool has_channels() const; + inline void clear_channels(); + static const int kChannelsFieldNumber = 1; + inline ::google::protobuf::int32 channels() const; + inline void set_channels(::google::protobuf::int32 value); + + // optional int32 height = 2; + inline bool has_height() const; + inline void clear_height(); + static const int kHeightFieldNumber = 2; + inline ::google::protobuf::int32 height() const; + inline void set_height(::google::protobuf::int32 value); + + // optional int32 width = 3; + inline bool has_width() const; + inline void clear_width(); + static const int kWidthFieldNumber = 3; + inline ::google::protobuf::int32 width() const; + inline void set_width(::google::protobuf::int32 value); + + // optional bytes data = 4; + inline bool has_data() const; + inline void clear_data(); + static const int kDataFieldNumber = 4; + inline const ::std::string& data() const; + inline void set_data(const ::std::string& value); + inline void set_data(const char* value); + inline void set_data(const void* value, size_t size); + inline ::std::string* mutable_data(); + inline ::std::string* release_data(); + inline void set_allocated_data(::std::string* data); + + // optional int32 label = 5; + inline bool has_label() const; + inline void clear_label(); + static const int kLabelFieldNumber = 5; + inline ::google::protobuf::int32 label() const; + inline void set_label(::google::protobuf::int32 value); + + // repeated float float_data = 6; + inline int float_data_size() const; + inline void clear_float_data(); + static const int kFloatDataFieldNumber = 6; + inline float float_data(int index) const; + inline void set_float_data(int index, float value); + inline void add_float_data(float value); + inline const ::google::protobuf::RepeatedField< float >& + float_data() const; + inline ::google::protobuf::RepeatedField< float >* + mutable_float_data(); + + // optional bool encoded = 7 [default = false]; + inline bool has_encoded() const; + inline void clear_encoded(); + static const int kEncodedFieldNumber = 7; + inline bool encoded() const; + inline void set_encoded(bool value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::int32 channels_; + ::google::protobuf::int32 height_; + ::std::string* data_; + ::google::protobuf::int32 width_; + ::google::protobuf::int32 label_; + ::google::protobuf::RepeatedField< float > float_data_; + bool encoded_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static Datum* default_instance_; +}; +// ------------------------------------------------------------------- + +class FillerParameter : public ::google::protobuf::Message { + 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 _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const FillerParameter& default_instance(); + + void Swap(FillerParameter* other); + + // implements Message ---------------------------------------------- + + FillerParameter* New() 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + 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"]; + inline bool has_type() const; + inline void clear_type(); + static const int kTypeFieldNumber = 1; + inline const ::std::string& type() const; + inline void set_type(const ::std::string& value); + inline void set_type(const char* value); + inline void set_type(const char* value, size_t size); + inline ::std::string* mutable_type(); + inline ::std::string* release_type(); + inline void set_allocated_type(::std::string* type); + + // optional float value = 2 [default = 0]; + inline bool has_value() const; + inline void clear_value(); + static const int kValueFieldNumber = 2; + inline float value() const; + inline void set_value(float value); + + // optional float min = 3 [default = 0]; + inline bool has_min() const; + inline void clear_min(); + static const int kMinFieldNumber = 3; + inline float min() const; + inline void set_min(float value); + + // optional float max = 4 [default = 1]; + inline bool has_max() const; + inline void clear_max(); + static const int kMaxFieldNumber = 4; + inline float max() const; + inline void set_max(float value); + + // optional float mean = 5 [default = 0]; + inline bool has_mean() const; + inline void clear_mean(); + static const int kMeanFieldNumber = 5; + inline float mean() const; + inline void set_mean(float value); + + // optional float std = 6 [default = 1]; + inline bool has_std() const; + inline void clear_std(); + static const int kStdFieldNumber = 6; + inline float std() const; + inline void set_std(float value); + + // optional int32 sparse = 7 [default = -1]; + inline bool has_sparse() const; + inline void clear_sparse(); + static const int kSparseFieldNumber = 7; + inline ::google::protobuf::int32 sparse() const; + inline void set_sparse(::google::protobuf::int32 value); + + // optional .ditcaffe.FillerParameter.VarianceNorm variance_norm = 8 [default = FAN_IN]; + inline bool has_variance_norm() const; + inline void clear_variance_norm(); + static const int kVarianceNormFieldNumber = 8; + inline ::ditcaffe::FillerParameter_VarianceNorm variance_norm() const; + inline void set_variance_norm(::ditcaffe::FillerParameter_VarianceNorm value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + static ::std::string* _default_type_; + ::std::string* type_; + float value_; + float min_; + float max_; + float mean_; + float std_; + ::google::protobuf::int32 sparse_; + int variance_norm_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static FillerParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class NetParameter : public ::google::protobuf::Message { + 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 _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const NetParameter& default_instance(); + + void Swap(NetParameter* other); + + // implements Message ---------------------------------------------- + + NetParameter* New() 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional string name = 1; + inline bool has_name() const; + inline void clear_name(); + static const int kNameFieldNumber = 1; + inline const ::std::string& name() const; + inline void set_name(const ::std::string& value); + inline void set_name(const char* value); + inline void set_name(const char* value, size_t size); + inline ::std::string* mutable_name(); + inline ::std::string* release_name(); + inline void set_allocated_name(::std::string* name); + + // repeated string input = 3; + inline int input_size() const; + inline void clear_input(); + static const int kInputFieldNumber = 3; + inline const ::std::string& input(int index) const; + inline ::std::string* mutable_input(int index); + inline void set_input(int index, const ::std::string& value); + inline void set_input(int index, const char* value); + inline void set_input(int index, const char* value, size_t size); + inline ::std::string* add_input(); + inline void add_input(const ::std::string& value); + inline void add_input(const char* value); + inline void add_input(const char* value, size_t size); + inline const ::google::protobuf::RepeatedPtrField< ::std::string>& input() const; + inline ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_input(); + + // repeated .ditcaffe.BlobShape input_shape = 8; + inline int input_shape_size() const; + inline void clear_input_shape(); + static const int kInputShapeFieldNumber = 8; + inline const ::ditcaffe::BlobShape& input_shape(int index) const; + inline ::ditcaffe::BlobShape* mutable_input_shape(int index); + inline ::ditcaffe::BlobShape* add_input_shape(); + inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobShape >& + input_shape() const; + inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobShape >* + mutable_input_shape(); + + // repeated int32 input_dim = 4; + inline int input_dim_size() const; + inline void clear_input_dim(); + static const int kInputDimFieldNumber = 4; + inline ::google::protobuf::int32 input_dim(int index) const; + inline void set_input_dim(int index, ::google::protobuf::int32 value); + inline void add_input_dim(::google::protobuf::int32 value); + inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& + input_dim() const; + inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* + mutable_input_dim(); + + // optional bool force_backward = 5 [default = false]; + inline bool has_force_backward() const; + inline void clear_force_backward(); + static const int kForceBackwardFieldNumber = 5; + inline bool force_backward() const; + inline void set_force_backward(bool value); + + // optional .ditcaffe.NetState state = 6; + inline bool has_state() const; + inline void clear_state(); + static const int kStateFieldNumber = 6; + inline const ::ditcaffe::NetState& state() const; + inline ::ditcaffe::NetState* mutable_state(); + inline ::ditcaffe::NetState* release_state(); + inline void set_allocated_state(::ditcaffe::NetState* state); + + // optional bool debug_info = 7 [default = false]; + inline bool has_debug_info() const; + inline void clear_debug_info(); + static const int kDebugInfoFieldNumber = 7; + inline bool debug_info() const; + inline void set_debug_info(bool value); + + // repeated .ditcaffe.LayerParameter layer = 100; + inline int layer_size() const; + inline void clear_layer(); + static const int kLayerFieldNumber = 100; + inline const ::ditcaffe::LayerParameter& layer(int index) const; + inline ::ditcaffe::LayerParameter* mutable_layer(int index); + inline ::ditcaffe::LayerParameter* add_layer(); + inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::LayerParameter >& + layer() const; + inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::LayerParameter >* + mutable_layer(); + + // repeated .ditcaffe.V1LayerParameter layers = 2; + inline int layers_size() const; + inline void clear_layers(); + static const int kLayersFieldNumber = 2; + inline const ::ditcaffe::V1LayerParameter& layers(int index) const; + inline ::ditcaffe::V1LayerParameter* mutable_layers(int index); + inline ::ditcaffe::V1LayerParameter* add_layers(); + inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::V1LayerParameter >& + layers() const; + inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::V1LayerParameter >* + mutable_layers(); + + // @@protoc_insertion_point(class_scope:ditcaffe.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::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::std::string* name_; + ::google::protobuf::RepeatedPtrField< ::std::string> input_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobShape > input_shape_; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 > input_dim_; + ::ditcaffe::NetState* state_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::LayerParameter > layer_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::V1LayerParameter > layers_; + bool force_backward_; + bool debug_info_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static NetParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class SolverParameter : public ::google::protobuf::Message { + 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 _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const SolverParameter& default_instance(); + + void Swap(SolverParameter* other); + + // implements Message ---------------------------------------------- + + SolverParameter* New() 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + 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; + inline bool has_net() const; + inline void clear_net(); + static const int kNetFieldNumber = 24; + inline const ::std::string& net() const; + inline void set_net(const ::std::string& value); + inline void set_net(const char* value); + inline void set_net(const char* value, size_t size); + inline ::std::string* mutable_net(); + inline ::std::string* release_net(); + inline void set_allocated_net(::std::string* net); + + // optional .ditcaffe.NetParameter net_param = 25; + inline bool has_net_param() const; + inline void clear_net_param(); + static const int kNetParamFieldNumber = 25; + inline const ::ditcaffe::NetParameter& net_param() const; + inline ::ditcaffe::NetParameter* mutable_net_param(); + inline ::ditcaffe::NetParameter* release_net_param(); + inline void set_allocated_net_param(::ditcaffe::NetParameter* net_param); + + // optional string train_net = 1; + inline bool has_train_net() const; + inline void clear_train_net(); + static const int kTrainNetFieldNumber = 1; + inline const ::std::string& train_net() const; + inline void set_train_net(const ::std::string& value); + inline void set_train_net(const char* value); + inline void set_train_net(const char* value, size_t size); + inline ::std::string* mutable_train_net(); + inline ::std::string* release_train_net(); + inline void set_allocated_train_net(::std::string* train_net); + + // repeated string test_net = 2; + inline int test_net_size() const; + inline void clear_test_net(); + static const int kTestNetFieldNumber = 2; + inline const ::std::string& test_net(int index) const; + inline ::std::string* mutable_test_net(int index); + inline void set_test_net(int index, const ::std::string& value); + inline void set_test_net(int index, const char* value); + inline void set_test_net(int index, const char* value, size_t size); + inline ::std::string* add_test_net(); + inline void add_test_net(const ::std::string& value); + inline void add_test_net(const char* value); + inline void add_test_net(const char* value, size_t size); + inline const ::google::protobuf::RepeatedPtrField< ::std::string>& test_net() const; + inline ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_test_net(); + + // optional .ditcaffe.NetParameter train_net_param = 21; + inline bool has_train_net_param() const; + inline void clear_train_net_param(); + static const int kTrainNetParamFieldNumber = 21; + inline const ::ditcaffe::NetParameter& train_net_param() const; + inline ::ditcaffe::NetParameter* mutable_train_net_param(); + inline ::ditcaffe::NetParameter* release_train_net_param(); + inline void set_allocated_train_net_param(::ditcaffe::NetParameter* train_net_param); + + // repeated .ditcaffe.NetParameter test_net_param = 22; + inline int test_net_param_size() const; + inline void clear_test_net_param(); + static const int kTestNetParamFieldNumber = 22; + inline const ::ditcaffe::NetParameter& test_net_param(int index) const; + inline ::ditcaffe::NetParameter* mutable_test_net_param(int index); + inline ::ditcaffe::NetParameter* add_test_net_param(); + inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetParameter >& + test_net_param() const; + inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetParameter >* + mutable_test_net_param(); + + // optional .ditcaffe.NetState train_state = 26; + inline bool has_train_state() const; + inline void clear_train_state(); + static const int kTrainStateFieldNumber = 26; + inline const ::ditcaffe::NetState& train_state() const; + inline ::ditcaffe::NetState* mutable_train_state(); + inline ::ditcaffe::NetState* release_train_state(); + inline void set_allocated_train_state(::ditcaffe::NetState* train_state); + + // repeated .ditcaffe.NetState test_state = 27; + inline int test_state_size() const; + inline void clear_test_state(); + static const int kTestStateFieldNumber = 27; + inline const ::ditcaffe::NetState& test_state(int index) const; + inline ::ditcaffe::NetState* mutable_test_state(int index); + inline ::ditcaffe::NetState* add_test_state(); + inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetState >& + test_state() const; + inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetState >* + mutable_test_state(); + + // repeated int32 test_iter = 3; + inline int test_iter_size() const; + inline void clear_test_iter(); + static const int kTestIterFieldNumber = 3; + inline ::google::protobuf::int32 test_iter(int index) const; + inline void set_test_iter(int index, ::google::protobuf::int32 value); + inline void add_test_iter(::google::protobuf::int32 value); + inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& + test_iter() const; + inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* + mutable_test_iter(); + + // optional int32 test_interval = 4 [default = 0]; + inline bool has_test_interval() const; + inline void clear_test_interval(); + static const int kTestIntervalFieldNumber = 4; + inline ::google::protobuf::int32 test_interval() const; + inline void set_test_interval(::google::protobuf::int32 value); + + // optional bool test_compute_loss = 19 [default = false]; + inline bool has_test_compute_loss() const; + inline void clear_test_compute_loss(); + static const int kTestComputeLossFieldNumber = 19; + inline bool test_compute_loss() const; + inline void set_test_compute_loss(bool value); + + // optional bool test_initialization = 32 [default = true]; + inline bool has_test_initialization() const; + inline void clear_test_initialization(); + static const int kTestInitializationFieldNumber = 32; + inline bool test_initialization() const; + inline void set_test_initialization(bool value); + + // optional float base_lr = 5; + inline bool has_base_lr() const; + inline void clear_base_lr(); + static const int kBaseLrFieldNumber = 5; + inline float base_lr() const; + inline void set_base_lr(float value); + + // optional int32 display = 6; + inline bool has_display() const; + inline void clear_display(); + static const int kDisplayFieldNumber = 6; + inline ::google::protobuf::int32 display() const; + inline void set_display(::google::protobuf::int32 value); + + // optional int32 average_loss = 33 [default = 1]; + inline bool has_average_loss() const; + inline void clear_average_loss(); + static const int kAverageLossFieldNumber = 33; + inline ::google::protobuf::int32 average_loss() const; + inline void set_average_loss(::google::protobuf::int32 value); + + // optional int32 max_iter = 7; + inline bool has_max_iter() const; + inline void clear_max_iter(); + static const int kMaxIterFieldNumber = 7; + inline ::google::protobuf::int32 max_iter() const; + inline void set_max_iter(::google::protobuf::int32 value); + + // optional int32 iter_size = 36 [default = 1]; + inline bool has_iter_size() const; + inline void clear_iter_size(); + static const int kIterSizeFieldNumber = 36; + inline ::google::protobuf::int32 iter_size() const; + inline void set_iter_size(::google::protobuf::int32 value); + + // optional string lr_policy = 8; + inline bool has_lr_policy() const; + inline void clear_lr_policy(); + static const int kLrPolicyFieldNumber = 8; + inline const ::std::string& lr_policy() const; + inline void set_lr_policy(const ::std::string& value); + inline void set_lr_policy(const char* value); + inline void set_lr_policy(const char* value, size_t size); + inline ::std::string* mutable_lr_policy(); + inline ::std::string* release_lr_policy(); + inline void set_allocated_lr_policy(::std::string* lr_policy); + + // optional float gamma = 9; + inline bool has_gamma() const; + inline void clear_gamma(); + static const int kGammaFieldNumber = 9; + inline float gamma() const; + inline void set_gamma(float value); + + // optional float power = 10; + inline bool has_power() const; + inline void clear_power(); + static const int kPowerFieldNumber = 10; + inline float power() const; + inline void set_power(float value); + + // optional float momentum = 11; + inline bool has_momentum() const; + inline void clear_momentum(); + static const int kMomentumFieldNumber = 11; + inline float momentum() const; + inline void set_momentum(float value); + + // optional float weight_decay = 12; + inline bool has_weight_decay() const; + inline void clear_weight_decay(); + static const int kWeightDecayFieldNumber = 12; + inline float weight_decay() const; + inline void set_weight_decay(float value); + + // optional string regularization_type = 29 [default = "L2"]; + inline bool has_regularization_type() const; + inline void clear_regularization_type(); + static const int kRegularizationTypeFieldNumber = 29; + inline const ::std::string& regularization_type() const; + inline void set_regularization_type(const ::std::string& value); + inline void set_regularization_type(const char* value); + inline void set_regularization_type(const char* value, size_t size); + inline ::std::string* mutable_regularization_type(); + inline ::std::string* release_regularization_type(); + inline void set_allocated_regularization_type(::std::string* regularization_type); + + // optional int32 stepsize = 13; + inline bool has_stepsize() const; + inline void clear_stepsize(); + static const int kStepsizeFieldNumber = 13; + inline ::google::protobuf::int32 stepsize() const; + inline void set_stepsize(::google::protobuf::int32 value); + + // repeated int32 stepvalue = 34; + inline int stepvalue_size() const; + inline void clear_stepvalue(); + static const int kStepvalueFieldNumber = 34; + inline ::google::protobuf::int32 stepvalue(int index) const; + inline void set_stepvalue(int index, ::google::protobuf::int32 value); + inline void add_stepvalue(::google::protobuf::int32 value); + inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& + stepvalue() const; + inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* + mutable_stepvalue(); + + // optional float clip_gradients = 35 [default = -1]; + inline bool has_clip_gradients() const; + inline void clear_clip_gradients(); + static const int kClipGradientsFieldNumber = 35; + inline float clip_gradients() const; + inline void set_clip_gradients(float value); + + // optional int32 snapshot = 14 [default = 0]; + inline bool has_snapshot() const; + inline void clear_snapshot(); + static const int kSnapshotFieldNumber = 14; + inline ::google::protobuf::int32 snapshot() const; + inline void set_snapshot(::google::protobuf::int32 value); + + // optional string snapshot_prefix = 15; + inline bool has_snapshot_prefix() const; + inline void clear_snapshot_prefix(); + static const int kSnapshotPrefixFieldNumber = 15; + inline const ::std::string& snapshot_prefix() const; + inline void set_snapshot_prefix(const ::std::string& value); + inline void set_snapshot_prefix(const char* value); + inline void set_snapshot_prefix(const char* value, size_t size); + inline ::std::string* mutable_snapshot_prefix(); + inline ::std::string* release_snapshot_prefix(); + inline void set_allocated_snapshot_prefix(::std::string* snapshot_prefix); + + // optional bool snapshot_diff = 16 [default = false]; + inline bool has_snapshot_diff() const; + inline void clear_snapshot_diff(); + static const int kSnapshotDiffFieldNumber = 16; + inline bool snapshot_diff() const; + inline void set_snapshot_diff(bool value); + + // optional .ditcaffe.SolverParameter.SnapshotFormat snapshot_format = 37 [default = BINARYPROTO]; + inline bool has_snapshot_format() const; + inline void clear_snapshot_format(); + static const int kSnapshotFormatFieldNumber = 37; + inline ::ditcaffe::SolverParameter_SnapshotFormat snapshot_format() const; + inline void set_snapshot_format(::ditcaffe::SolverParameter_SnapshotFormat value); + + // optional .ditcaffe.SolverParameter.SolverMode solver_mode = 17 [default = GPU]; + inline bool has_solver_mode() const; + inline void clear_solver_mode(); + static const int kSolverModeFieldNumber = 17; + inline ::ditcaffe::SolverParameter_SolverMode solver_mode() const; + inline void set_solver_mode(::ditcaffe::SolverParameter_SolverMode value); + + // optional int32 device_id = 18 [default = 0]; + inline bool has_device_id() const; + inline void clear_device_id(); + static const int kDeviceIdFieldNumber = 18; + inline ::google::protobuf::int32 device_id() const; + inline void set_device_id(::google::protobuf::int32 value); + + // optional int64 random_seed = 20 [default = -1]; + inline bool has_random_seed() const; + inline void clear_random_seed(); + static const int kRandomSeedFieldNumber = 20; + inline ::google::protobuf::int64 random_seed() const; + inline void set_random_seed(::google::protobuf::int64 value); + + // optional string type = 40 [default = "SGD"]; + inline bool has_type() const; + inline void clear_type(); + static const int kTypeFieldNumber = 40; + inline const ::std::string& type() const; + inline void set_type(const ::std::string& value); + inline void set_type(const char* value); + inline void set_type(const char* value, size_t size); + inline ::std::string* mutable_type(); + inline ::std::string* release_type(); + inline void set_allocated_type(::std::string* type); + + // optional float delta = 31 [default = 1e-08]; + inline bool has_delta() const; + inline void clear_delta(); + static const int kDeltaFieldNumber = 31; + inline float delta() const; + inline void set_delta(float value); + + // optional float momentum2 = 39 [default = 0.999]; + inline bool has_momentum2() const; + inline void clear_momentum2(); + static const int kMomentum2FieldNumber = 39; + inline float momentum2() const; + inline void set_momentum2(float value); + + // optional float rms_decay = 38; + inline bool has_rms_decay() const; + inline void clear_rms_decay(); + static const int kRmsDecayFieldNumber = 38; + inline float rms_decay() const; + inline void set_rms_decay(float value); + + // optional bool debug_info = 23 [default = false]; + inline bool has_debug_info() const; + inline void clear_debug_info(); + static const int kDebugInfoFieldNumber = 23; + inline bool debug_info() const; + inline void set_debug_info(bool value); + + // optional bool snapshot_after_train = 28 [default = true]; + inline bool has_snapshot_after_train() const; + inline void clear_snapshot_after_train(); + static const int kSnapshotAfterTrainFieldNumber = 28; + inline bool snapshot_after_train() const; + inline void set_snapshot_after_train(bool value); + + // optional .ditcaffe.SolverParameter.SolverType solver_type = 30 [default = SGD]; + inline bool has_solver_type() const; + inline void clear_solver_type(); + static const int kSolverTypeFieldNumber = 30; + inline ::ditcaffe::SolverParameter_SolverType solver_type() const; + inline void set_solver_type(::ditcaffe::SolverParameter_SolverType value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[2]; + ::std::string* net_; + ::ditcaffe::NetParameter* net_param_; + ::std::string* train_net_; + ::google::protobuf::RepeatedPtrField< ::std::string> test_net_; + ::ditcaffe::NetParameter* train_net_param_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetParameter > test_net_param_; + ::ditcaffe::NetState* train_state_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetState > test_state_; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 > test_iter_; + ::google::protobuf::int32 test_interval_; + float base_lr_; + ::google::protobuf::int32 display_; + ::google::protobuf::int32 average_loss_; + ::google::protobuf::int32 max_iter_; + ::google::protobuf::int32 iter_size_; + ::std::string* lr_policy_; + float gamma_; + float power_; + float momentum_; + float weight_decay_; + bool test_compute_loss_; + bool test_initialization_; + bool snapshot_diff_; + bool debug_info_; + ::google::protobuf::int32 stepsize_; + static ::std::string* _default_regularization_type_; + ::std::string* regularization_type_; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 > stepvalue_; + float clip_gradients_; + ::google::protobuf::int32 snapshot_; + ::std::string* snapshot_prefix_; + int snapshot_format_; + int solver_mode_; + ::google::protobuf::int64 random_seed_; + ::google::protobuf::int32 device_id_; + float delta_; + static ::std::string* _default_type_; + ::std::string* type_; + float momentum2_; + float rms_decay_; + bool snapshot_after_train_; + int solver_type_; + mutable int _cached_size_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static SolverParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class SolverState : public ::google::protobuf::Message { + 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 _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const SolverState& default_instance(); + + void Swap(SolverState* other); + + // implements Message ---------------------------------------------- + + SolverState* New() 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional int32 iter = 1; + inline bool has_iter() const; + inline void clear_iter(); + static const int kIterFieldNumber = 1; + inline ::google::protobuf::int32 iter() const; + inline void set_iter(::google::protobuf::int32 value); + + // optional string learned_net = 2; + inline bool has_learned_net() const; + inline void clear_learned_net(); + static const int kLearnedNetFieldNumber = 2; + inline const ::std::string& learned_net() const; + inline void set_learned_net(const ::std::string& value); + inline void set_learned_net(const char* value); + inline void set_learned_net(const char* value, size_t size); + inline ::std::string* mutable_learned_net(); + inline ::std::string* release_learned_net(); + inline void set_allocated_learned_net(::std::string* learned_net); + + // repeated .ditcaffe.BlobProto history = 3; + inline int history_size() const; + inline void clear_history(); + static const int kHistoryFieldNumber = 3; + inline const ::ditcaffe::BlobProto& history(int index) const; + inline ::ditcaffe::BlobProto* mutable_history(int index); + inline ::ditcaffe::BlobProto* add_history(); + inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >& + history() const; + inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >* + mutable_history(); + + // optional int32 current_step = 4 [default = 0]; + inline bool has_current_step() const; + inline void clear_current_step(); + static const int kCurrentStepFieldNumber = 4; + inline ::google::protobuf::int32 current_step() const; + inline void set_current_step(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::std::string* learned_net_; + ::google::protobuf::int32 iter_; + ::google::protobuf::int32 current_step_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto > history_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static SolverState* default_instance_; +}; +// ------------------------------------------------------------------- + +class NetState : public ::google::protobuf::Message { + 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 _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const NetState& default_instance(); + + void Swap(NetState* other); + + // implements Message ---------------------------------------------- + + NetState* New() 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional .ditcaffe.Phase phase = 1 [default = TEST]; + inline bool has_phase() const; + inline void clear_phase(); + static const int kPhaseFieldNumber = 1; + inline ::ditcaffe::Phase phase() const; + inline void set_phase(::ditcaffe::Phase value); + + // optional int32 level = 2 [default = 0]; + inline bool has_level() const; + inline void clear_level(); + static const int kLevelFieldNumber = 2; + inline ::google::protobuf::int32 level() const; + inline void set_level(::google::protobuf::int32 value); + + // repeated string stage = 3; + inline int stage_size() const; + inline void clear_stage(); + static const int kStageFieldNumber = 3; + inline const ::std::string& stage(int index) const; + inline ::std::string* mutable_stage(int index); + inline void set_stage(int index, const ::std::string& value); + inline void set_stage(int index, const char* value); + inline void set_stage(int index, const char* value, size_t size); + inline ::std::string* add_stage(); + inline void add_stage(const ::std::string& value); + inline void add_stage(const char* value); + inline void add_stage(const char* value, size_t size); + inline const ::google::protobuf::RepeatedPtrField< ::std::string>& stage() const; + inline ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_stage(); + + // @@protoc_insertion_point(class_scope:ditcaffe.NetState) + private: + inline void set_has_phase(); + inline void clear_has_phase(); + inline void set_has_level(); + inline void clear_has_level(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + int phase_; + ::google::protobuf::int32 level_; + ::google::protobuf::RepeatedPtrField< ::std::string> stage_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static NetState* default_instance_; +}; +// ------------------------------------------------------------------- + +class NetStateRule : public ::google::protobuf::Message { + 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 _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const NetStateRule& default_instance(); + + void Swap(NetStateRule* other); + + // implements Message ---------------------------------------------- + + NetStateRule* New() 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional .ditcaffe.Phase phase = 1; + inline bool has_phase() const; + inline void clear_phase(); + static const int kPhaseFieldNumber = 1; + inline ::ditcaffe::Phase phase() const; + inline void set_phase(::ditcaffe::Phase value); + + // optional int32 min_level = 2; + inline bool has_min_level() const; + inline void clear_min_level(); + static const int kMinLevelFieldNumber = 2; + inline ::google::protobuf::int32 min_level() const; + inline void set_min_level(::google::protobuf::int32 value); + + // optional int32 max_level = 3; + inline bool has_max_level() const; + inline void clear_max_level(); + static const int kMaxLevelFieldNumber = 3; + inline ::google::protobuf::int32 max_level() const; + inline void set_max_level(::google::protobuf::int32 value); + + // repeated string stage = 4; + inline int stage_size() const; + inline void clear_stage(); + static const int kStageFieldNumber = 4; + inline const ::std::string& stage(int index) const; + inline ::std::string* mutable_stage(int index); + inline void set_stage(int index, const ::std::string& value); + inline void set_stage(int index, const char* value); + inline void set_stage(int index, const char* value, size_t size); + inline ::std::string* add_stage(); + inline void add_stage(const ::std::string& value); + inline void add_stage(const char* value); + inline void add_stage(const char* value, size_t size); + inline const ::google::protobuf::RepeatedPtrField< ::std::string>& stage() const; + inline ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_stage(); + + // repeated string not_stage = 5; + inline int not_stage_size() const; + inline void clear_not_stage(); + static const int kNotStageFieldNumber = 5; + inline const ::std::string& not_stage(int index) const; + inline ::std::string* mutable_not_stage(int index); + inline void set_not_stage(int index, const ::std::string& value); + inline void set_not_stage(int index, const char* value); + inline void set_not_stage(int index, const char* value, size_t size); + inline ::std::string* add_not_stage(); + inline void add_not_stage(const ::std::string& value); + inline void add_not_stage(const char* value); + inline void add_not_stage(const char* value, size_t size); + inline const ::google::protobuf::RepeatedPtrField< ::std::string>& not_stage() const; + inline ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_not_stage(); + + // @@protoc_insertion_point(class_scope:ditcaffe.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::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + int phase_; + ::google::protobuf::int32 min_level_; + ::google::protobuf::RepeatedPtrField< ::std::string> stage_; + ::google::protobuf::RepeatedPtrField< ::std::string> not_stage_; + ::google::protobuf::int32 max_level_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static NetStateRule* default_instance_; +}; +// ------------------------------------------------------------------- + +class ParamSpec : public ::google::protobuf::Message { + 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 _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const ParamSpec& default_instance(); + + void Swap(ParamSpec* other); + + // implements Message ---------------------------------------------- + + ParamSpec* New() 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + 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; + inline bool has_name() const; + inline void clear_name(); + static const int kNameFieldNumber = 1; + inline const ::std::string& name() const; + inline void set_name(const ::std::string& value); + inline void set_name(const char* value); + inline void set_name(const char* value, size_t size); + inline ::std::string* mutable_name(); + inline ::std::string* release_name(); + inline void set_allocated_name(::std::string* name); + + // optional .ditcaffe.ParamSpec.DimCheckMode share_mode = 2; + inline bool has_share_mode() const; + inline void clear_share_mode(); + static const int kShareModeFieldNumber = 2; + inline ::ditcaffe::ParamSpec_DimCheckMode share_mode() const; + inline void set_share_mode(::ditcaffe::ParamSpec_DimCheckMode value); + + // optional float lr_mult = 3 [default = 1]; + inline bool has_lr_mult() const; + inline void clear_lr_mult(); + static const int kLrMultFieldNumber = 3; + inline float lr_mult() const; + inline void set_lr_mult(float value); + + // optional float decay_mult = 4 [default = 1]; + inline bool has_decay_mult() const; + inline void clear_decay_mult(); + static const int kDecayMultFieldNumber = 4; + inline float decay_mult() const; + inline void set_decay_mult(float value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::std::string* name_; + int share_mode_; + float lr_mult_; + float decay_mult_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static ParamSpec* default_instance_; +}; +// ------------------------------------------------------------------- + +class LayerParameter : public ::google::protobuf::Message { + 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 _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const LayerParameter& default_instance(); + + void Swap(LayerParameter* other); + + // implements Message ---------------------------------------------- + + LayerParameter* New() 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional string name = 1; + inline bool has_name() const; + inline void clear_name(); + static const int kNameFieldNumber = 1; + inline const ::std::string& name() const; + inline void set_name(const ::std::string& value); + inline void set_name(const char* value); + inline void set_name(const char* value, size_t size); + inline ::std::string* mutable_name(); + inline ::std::string* release_name(); + inline void set_allocated_name(::std::string* name); + + // optional string type = 2; + inline bool has_type() const; + inline void clear_type(); + static const int kTypeFieldNumber = 2; + inline const ::std::string& type() const; + inline void set_type(const ::std::string& value); + inline void set_type(const char* value); + inline void set_type(const char* value, size_t size); + inline ::std::string* mutable_type(); + inline ::std::string* release_type(); + inline void set_allocated_type(::std::string* type); + + // repeated string bottom = 3; + inline int bottom_size() const; + inline void clear_bottom(); + static const int kBottomFieldNumber = 3; + inline const ::std::string& bottom(int index) const; + inline ::std::string* mutable_bottom(int index); + inline void set_bottom(int index, const ::std::string& value); + inline void set_bottom(int index, const char* value); + inline void set_bottom(int index, const char* value, size_t size); + inline ::std::string* add_bottom(); + inline void add_bottom(const ::std::string& value); + inline void add_bottom(const char* value); + inline void add_bottom(const char* value, size_t size); + inline const ::google::protobuf::RepeatedPtrField< ::std::string>& bottom() const; + inline ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_bottom(); + + // repeated string top = 4; + inline int top_size() const; + inline void clear_top(); + static const int kTopFieldNumber = 4; + inline const ::std::string& top(int index) const; + inline ::std::string* mutable_top(int index); + inline void set_top(int index, const ::std::string& value); + inline void set_top(int index, const char* value); + inline void set_top(int index, const char* value, size_t size); + inline ::std::string* add_top(); + inline void add_top(const ::std::string& value); + inline void add_top(const char* value); + inline void add_top(const char* value, size_t size); + inline const ::google::protobuf::RepeatedPtrField< ::std::string>& top() const; + inline ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_top(); + + // optional .ditcaffe.Phase phase = 10; + inline bool has_phase() const; + inline void clear_phase(); + static const int kPhaseFieldNumber = 10; + inline ::ditcaffe::Phase phase() const; + inline void set_phase(::ditcaffe::Phase value); + + // repeated float loss_weight = 5; + inline int loss_weight_size() const; + inline void clear_loss_weight(); + static const int kLossWeightFieldNumber = 5; + inline float loss_weight(int index) const; + inline void set_loss_weight(int index, float value); + inline void add_loss_weight(float value); + inline const ::google::protobuf::RepeatedField< float >& + loss_weight() const; + inline ::google::protobuf::RepeatedField< float >* + mutable_loss_weight(); + + // repeated .ditcaffe.ParamSpec param = 6; + inline int param_size() const; + inline void clear_param(); + static const int kParamFieldNumber = 6; + inline const ::ditcaffe::ParamSpec& param(int index) const; + inline ::ditcaffe::ParamSpec* mutable_param(int index); + inline ::ditcaffe::ParamSpec* add_param(); + inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::ParamSpec >& + param() const; + inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::ParamSpec >* + mutable_param(); + + // repeated .ditcaffe.BlobProto blobs = 7; + inline int blobs_size() const; + inline void clear_blobs(); + static const int kBlobsFieldNumber = 7; + inline const ::ditcaffe::BlobProto& blobs(int index) const; + inline ::ditcaffe::BlobProto* mutable_blobs(int index); + inline ::ditcaffe::BlobProto* add_blobs(); + inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >& + blobs() const; + inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >* + mutable_blobs(); + + // repeated bool propagate_down = 11; + inline int propagate_down_size() const; + inline void clear_propagate_down(); + static const int kPropagateDownFieldNumber = 11; + inline bool propagate_down(int index) const; + inline void set_propagate_down(int index, bool value); + inline void add_propagate_down(bool value); + inline const ::google::protobuf::RepeatedField< bool >& + propagate_down() const; + inline ::google::protobuf::RepeatedField< bool >* + mutable_propagate_down(); + + // repeated .ditcaffe.NetStateRule include = 8; + inline int include_size() const; + inline void clear_include(); + static const int kIncludeFieldNumber = 8; + inline const ::ditcaffe::NetStateRule& include(int index) const; + inline ::ditcaffe::NetStateRule* mutable_include(int index); + inline ::ditcaffe::NetStateRule* add_include(); + inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >& + include() const; + inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >* + mutable_include(); + + // repeated .ditcaffe.NetStateRule exclude = 9; + inline int exclude_size() const; + inline void clear_exclude(); + static const int kExcludeFieldNumber = 9; + inline const ::ditcaffe::NetStateRule& exclude(int index) const; + inline ::ditcaffe::NetStateRule* mutable_exclude(int index); + inline ::ditcaffe::NetStateRule* add_exclude(); + inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >& + exclude() const; + inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >* + mutable_exclude(); + + // optional .ditcaffe.TransformationParameter transform_param = 100; + inline bool has_transform_param() const; + inline void clear_transform_param(); + static const int kTransformParamFieldNumber = 100; + inline const ::ditcaffe::TransformationParameter& transform_param() const; + inline ::ditcaffe::TransformationParameter* mutable_transform_param(); + inline ::ditcaffe::TransformationParameter* release_transform_param(); + inline void set_allocated_transform_param(::ditcaffe::TransformationParameter* transform_param); + + // optional .ditcaffe.LossParameter loss_param = 101; + inline bool has_loss_param() const; + inline void clear_loss_param(); + static const int kLossParamFieldNumber = 101; + inline const ::ditcaffe::LossParameter& loss_param() const; + inline ::ditcaffe::LossParameter* mutable_loss_param(); + inline ::ditcaffe::LossParameter* release_loss_param(); + inline void set_allocated_loss_param(::ditcaffe::LossParameter* loss_param); + + // optional .ditcaffe.AccuracyParameter accuracy_param = 102; + inline bool has_accuracy_param() const; + inline void clear_accuracy_param(); + static const int kAccuracyParamFieldNumber = 102; + inline const ::ditcaffe::AccuracyParameter& accuracy_param() const; + inline ::ditcaffe::AccuracyParameter* mutable_accuracy_param(); + inline ::ditcaffe::AccuracyParameter* release_accuracy_param(); + inline void set_allocated_accuracy_param(::ditcaffe::AccuracyParameter* accuracy_param); + + // optional .ditcaffe.ArgMaxParameter argmax_param = 103; + inline bool has_argmax_param() const; + inline void clear_argmax_param(); + static const int kArgmaxParamFieldNumber = 103; + inline const ::ditcaffe::ArgMaxParameter& argmax_param() const; + inline ::ditcaffe::ArgMaxParameter* mutable_argmax_param(); + inline ::ditcaffe::ArgMaxParameter* release_argmax_param(); + inline void set_allocated_argmax_param(::ditcaffe::ArgMaxParameter* argmax_param); + + // optional .ditcaffe.BatchNormParameter batch_norm_param = 139; + inline bool has_batch_norm_param() const; + inline void clear_batch_norm_param(); + static const int kBatchNormParamFieldNumber = 139; + inline const ::ditcaffe::BatchNormParameter& batch_norm_param() const; + inline ::ditcaffe::BatchNormParameter* mutable_batch_norm_param(); + inline ::ditcaffe::BatchNormParameter* release_batch_norm_param(); + inline void set_allocated_batch_norm_param(::ditcaffe::BatchNormParameter* batch_norm_param); + + // optional .ditcaffe.BiasParameter bias_param = 141; + inline bool has_bias_param() const; + inline void clear_bias_param(); + static const int kBiasParamFieldNumber = 141; + inline const ::ditcaffe::BiasParameter& bias_param() const; + inline ::ditcaffe::BiasParameter* mutable_bias_param(); + inline ::ditcaffe::BiasParameter* release_bias_param(); + inline void set_allocated_bias_param(::ditcaffe::BiasParameter* bias_param); + + // optional .ditcaffe.ConcatParameter concat_param = 104; + inline bool has_concat_param() const; + inline void clear_concat_param(); + static const int kConcatParamFieldNumber = 104; + inline const ::ditcaffe::ConcatParameter& concat_param() const; + inline ::ditcaffe::ConcatParameter* mutable_concat_param(); + inline ::ditcaffe::ConcatParameter* release_concat_param(); + inline void set_allocated_concat_param(::ditcaffe::ConcatParameter* concat_param); + + // optional .ditcaffe.ContrastiveLossParameter contrastive_loss_param = 105; + inline bool has_contrastive_loss_param() const; + inline void clear_contrastive_loss_param(); + static const int kContrastiveLossParamFieldNumber = 105; + inline const ::ditcaffe::ContrastiveLossParameter& contrastive_loss_param() const; + inline ::ditcaffe::ContrastiveLossParameter* mutable_contrastive_loss_param(); + inline ::ditcaffe::ContrastiveLossParameter* release_contrastive_loss_param(); + inline void set_allocated_contrastive_loss_param(::ditcaffe::ContrastiveLossParameter* contrastive_loss_param); + + // optional .ditcaffe.ConvolutionParameter convolution_param = 106; + inline bool has_convolution_param() const; + inline void clear_convolution_param(); + static const int kConvolutionParamFieldNumber = 106; + inline const ::ditcaffe::ConvolutionParameter& convolution_param() const; + inline ::ditcaffe::ConvolutionParameter* mutable_convolution_param(); + inline ::ditcaffe::ConvolutionParameter* release_convolution_param(); + inline void set_allocated_convolution_param(::ditcaffe::ConvolutionParameter* convolution_param); + + // optional .ditcaffe.CropParameter crop_param = 144; + inline bool has_crop_param() const; + inline void clear_crop_param(); + static const int kCropParamFieldNumber = 144; + inline const ::ditcaffe::CropParameter& crop_param() const; + inline ::ditcaffe::CropParameter* mutable_crop_param(); + inline ::ditcaffe::CropParameter* release_crop_param(); + inline void set_allocated_crop_param(::ditcaffe::CropParameter* crop_param); + + // optional .ditcaffe.DataParameter data_param = 107; + inline bool has_data_param() const; + inline void clear_data_param(); + static const int kDataParamFieldNumber = 107; + inline const ::ditcaffe::DataParameter& data_param() const; + inline ::ditcaffe::DataParameter* mutable_data_param(); + inline ::ditcaffe::DataParameter* release_data_param(); + inline void set_allocated_data_param(::ditcaffe::DataParameter* data_param); + + // optional .ditcaffe.DropoutParameter dropout_param = 108; + inline bool has_dropout_param() const; + inline void clear_dropout_param(); + static const int kDropoutParamFieldNumber = 108; + inline const ::ditcaffe::DropoutParameter& dropout_param() const; + inline ::ditcaffe::DropoutParameter* mutable_dropout_param(); + inline ::ditcaffe::DropoutParameter* release_dropout_param(); + inline void set_allocated_dropout_param(::ditcaffe::DropoutParameter* dropout_param); + + // optional .ditcaffe.DummyDataParameter dummy_data_param = 109; + inline bool has_dummy_data_param() const; + inline void clear_dummy_data_param(); + static const int kDummyDataParamFieldNumber = 109; + inline const ::ditcaffe::DummyDataParameter& dummy_data_param() const; + inline ::ditcaffe::DummyDataParameter* mutable_dummy_data_param(); + inline ::ditcaffe::DummyDataParameter* release_dummy_data_param(); + inline void set_allocated_dummy_data_param(::ditcaffe::DummyDataParameter* dummy_data_param); + + // optional .ditcaffe.EltwiseParameter eltwise_param = 110; + inline bool has_eltwise_param() const; + inline void clear_eltwise_param(); + static const int kEltwiseParamFieldNumber = 110; + inline const ::ditcaffe::EltwiseParameter& eltwise_param() const; + inline ::ditcaffe::EltwiseParameter* mutable_eltwise_param(); + inline ::ditcaffe::EltwiseParameter* release_eltwise_param(); + inline void set_allocated_eltwise_param(::ditcaffe::EltwiseParameter* eltwise_param); + + // optional .ditcaffe.ELUParameter elu_param = 140; + inline bool has_elu_param() const; + inline void clear_elu_param(); + static const int kEluParamFieldNumber = 140; + inline const ::ditcaffe::ELUParameter& elu_param() const; + inline ::ditcaffe::ELUParameter* mutable_elu_param(); + inline ::ditcaffe::ELUParameter* release_elu_param(); + inline void set_allocated_elu_param(::ditcaffe::ELUParameter* elu_param); + + // optional .ditcaffe.EmbedParameter embed_param = 137; + inline bool has_embed_param() const; + inline void clear_embed_param(); + static const int kEmbedParamFieldNumber = 137; + inline const ::ditcaffe::EmbedParameter& embed_param() const; + inline ::ditcaffe::EmbedParameter* mutable_embed_param(); + inline ::ditcaffe::EmbedParameter* release_embed_param(); + inline void set_allocated_embed_param(::ditcaffe::EmbedParameter* embed_param); + + // optional .ditcaffe.ExpParameter exp_param = 111; + inline bool has_exp_param() const; + inline void clear_exp_param(); + static const int kExpParamFieldNumber = 111; + inline const ::ditcaffe::ExpParameter& exp_param() const; + inline ::ditcaffe::ExpParameter* mutable_exp_param(); + inline ::ditcaffe::ExpParameter* release_exp_param(); + inline void set_allocated_exp_param(::ditcaffe::ExpParameter* exp_param); + + // optional .ditcaffe.FlattenParameter flatten_param = 135; + inline bool has_flatten_param() const; + inline void clear_flatten_param(); + static const int kFlattenParamFieldNumber = 135; + inline const ::ditcaffe::FlattenParameter& flatten_param() const; + inline ::ditcaffe::FlattenParameter* mutable_flatten_param(); + inline ::ditcaffe::FlattenParameter* release_flatten_param(); + inline void set_allocated_flatten_param(::ditcaffe::FlattenParameter* flatten_param); + + // optional .ditcaffe.HDF5DataParameter hdf5_data_param = 112; + inline bool has_hdf5_data_param() const; + inline void clear_hdf5_data_param(); + static const int kHdf5DataParamFieldNumber = 112; + inline const ::ditcaffe::HDF5DataParameter& hdf5_data_param() const; + inline ::ditcaffe::HDF5DataParameter* mutable_hdf5_data_param(); + inline ::ditcaffe::HDF5DataParameter* release_hdf5_data_param(); + inline void set_allocated_hdf5_data_param(::ditcaffe::HDF5DataParameter* hdf5_data_param); + + // optional .ditcaffe.HDF5OutputParameter hdf5_output_param = 113; + inline bool has_hdf5_output_param() const; + inline void clear_hdf5_output_param(); + static const int kHdf5OutputParamFieldNumber = 113; + inline const ::ditcaffe::HDF5OutputParameter& hdf5_output_param() const; + inline ::ditcaffe::HDF5OutputParameter* mutable_hdf5_output_param(); + inline ::ditcaffe::HDF5OutputParameter* release_hdf5_output_param(); + inline void set_allocated_hdf5_output_param(::ditcaffe::HDF5OutputParameter* hdf5_output_param); + + // optional .ditcaffe.HingeLossParameter hinge_loss_param = 114; + inline bool has_hinge_loss_param() const; + inline void clear_hinge_loss_param(); + static const int kHingeLossParamFieldNumber = 114; + inline const ::ditcaffe::HingeLossParameter& hinge_loss_param() const; + inline ::ditcaffe::HingeLossParameter* mutable_hinge_loss_param(); + inline ::ditcaffe::HingeLossParameter* release_hinge_loss_param(); + inline void set_allocated_hinge_loss_param(::ditcaffe::HingeLossParameter* hinge_loss_param); + + // optional .ditcaffe.ImageDataParameter image_data_param = 115; + inline bool has_image_data_param() const; + inline void clear_image_data_param(); + static const int kImageDataParamFieldNumber = 115; + inline const ::ditcaffe::ImageDataParameter& image_data_param() const; + inline ::ditcaffe::ImageDataParameter* mutable_image_data_param(); + inline ::ditcaffe::ImageDataParameter* release_image_data_param(); + inline void set_allocated_image_data_param(::ditcaffe::ImageDataParameter* image_data_param); + + // optional .ditcaffe.InfogainLossParameter infogain_loss_param = 116; + inline bool has_infogain_loss_param() const; + inline void clear_infogain_loss_param(); + static const int kInfogainLossParamFieldNumber = 116; + inline const ::ditcaffe::InfogainLossParameter& infogain_loss_param() const; + inline ::ditcaffe::InfogainLossParameter* mutable_infogain_loss_param(); + inline ::ditcaffe::InfogainLossParameter* release_infogain_loss_param(); + inline void set_allocated_infogain_loss_param(::ditcaffe::InfogainLossParameter* infogain_loss_param); + + // optional .ditcaffe.InnerProductParameter inner_product_param = 117; + inline bool has_inner_product_param() const; + inline void clear_inner_product_param(); + static const int kInnerProductParamFieldNumber = 117; + inline const ::ditcaffe::InnerProductParameter& inner_product_param() const; + inline ::ditcaffe::InnerProductParameter* mutable_inner_product_param(); + inline ::ditcaffe::InnerProductParameter* release_inner_product_param(); + inline void set_allocated_inner_product_param(::ditcaffe::InnerProductParameter* inner_product_param); + + // optional .ditcaffe.InputParameter input_param = 143; + inline bool has_input_param() const; + inline void clear_input_param(); + static const int kInputParamFieldNumber = 143; + inline const ::ditcaffe::InputParameter& input_param() const; + inline ::ditcaffe::InputParameter* mutable_input_param(); + inline ::ditcaffe::InputParameter* release_input_param(); + inline void set_allocated_input_param(::ditcaffe::InputParameter* input_param); + + // optional .ditcaffe.LogParameter log_param = 134; + inline bool has_log_param() const; + inline void clear_log_param(); + static const int kLogParamFieldNumber = 134; + inline const ::ditcaffe::LogParameter& log_param() const; + inline ::ditcaffe::LogParameter* mutable_log_param(); + inline ::ditcaffe::LogParameter* release_log_param(); + inline void set_allocated_log_param(::ditcaffe::LogParameter* log_param); + + // optional .ditcaffe.LRNParameter lrn_param = 118; + inline bool has_lrn_param() const; + inline void clear_lrn_param(); + static const int kLrnParamFieldNumber = 118; + inline const ::ditcaffe::LRNParameter& lrn_param() const; + inline ::ditcaffe::LRNParameter* mutable_lrn_param(); + inline ::ditcaffe::LRNParameter* release_lrn_param(); + inline void set_allocated_lrn_param(::ditcaffe::LRNParameter* lrn_param); + + // optional .ditcaffe.MemoryDataParameter memory_data_param = 119; + inline bool has_memory_data_param() const; + inline void clear_memory_data_param(); + static const int kMemoryDataParamFieldNumber = 119; + inline const ::ditcaffe::MemoryDataParameter& memory_data_param() const; + inline ::ditcaffe::MemoryDataParameter* mutable_memory_data_param(); + inline ::ditcaffe::MemoryDataParameter* release_memory_data_param(); + inline void set_allocated_memory_data_param(::ditcaffe::MemoryDataParameter* memory_data_param); + + // optional .ditcaffe.MVNParameter mvn_param = 120; + inline bool has_mvn_param() const; + inline void clear_mvn_param(); + static const int kMvnParamFieldNumber = 120; + inline const ::ditcaffe::MVNParameter& mvn_param() const; + inline ::ditcaffe::MVNParameter* mutable_mvn_param(); + inline ::ditcaffe::MVNParameter* release_mvn_param(); + inline void set_allocated_mvn_param(::ditcaffe::MVNParameter* mvn_param); + + // optional .ditcaffe.ParameterParameter parameter_param = 145; + inline bool has_parameter_param() const; + inline void clear_parameter_param(); + static const int kParameterParamFieldNumber = 145; + inline const ::ditcaffe::ParameterParameter& parameter_param() const; + inline ::ditcaffe::ParameterParameter* mutable_parameter_param(); + inline ::ditcaffe::ParameterParameter* release_parameter_param(); + inline void set_allocated_parameter_param(::ditcaffe::ParameterParameter* parameter_param); + + // optional .ditcaffe.PoolingParameter pooling_param = 121; + inline bool has_pooling_param() const; + inline void clear_pooling_param(); + static const int kPoolingParamFieldNumber = 121; + inline const ::ditcaffe::PoolingParameter& pooling_param() const; + inline ::ditcaffe::PoolingParameter* mutable_pooling_param(); + inline ::ditcaffe::PoolingParameter* release_pooling_param(); + inline void set_allocated_pooling_param(::ditcaffe::PoolingParameter* pooling_param); + + // optional .ditcaffe.PowerParameter power_param = 122; + inline bool has_power_param() const; + inline void clear_power_param(); + static const int kPowerParamFieldNumber = 122; + inline const ::ditcaffe::PowerParameter& power_param() const; + inline ::ditcaffe::PowerParameter* mutable_power_param(); + inline ::ditcaffe::PowerParameter* release_power_param(); + inline void set_allocated_power_param(::ditcaffe::PowerParameter* power_param); + + // optional .ditcaffe.PReLUParameter prelu_param = 131; + inline bool has_prelu_param() const; + inline void clear_prelu_param(); + static const int kPreluParamFieldNumber = 131; + inline const ::ditcaffe::PReLUParameter& prelu_param() const; + inline ::ditcaffe::PReLUParameter* mutable_prelu_param(); + inline ::ditcaffe::PReLUParameter* release_prelu_param(); + inline void set_allocated_prelu_param(::ditcaffe::PReLUParameter* prelu_param); + + // optional .ditcaffe.PythonParameter python_param = 130; + inline bool has_python_param() const; + inline void clear_python_param(); + static const int kPythonParamFieldNumber = 130; + inline const ::ditcaffe::PythonParameter& python_param() const; + inline ::ditcaffe::PythonParameter* mutable_python_param(); + inline ::ditcaffe::PythonParameter* release_python_param(); + inline void set_allocated_python_param(::ditcaffe::PythonParameter* python_param); + + // optional .ditcaffe.ReductionParameter reduction_param = 136; + inline bool has_reduction_param() const; + inline void clear_reduction_param(); + static const int kReductionParamFieldNumber = 136; + inline const ::ditcaffe::ReductionParameter& reduction_param() const; + inline ::ditcaffe::ReductionParameter* mutable_reduction_param(); + inline ::ditcaffe::ReductionParameter* release_reduction_param(); + inline void set_allocated_reduction_param(::ditcaffe::ReductionParameter* reduction_param); + + // optional .ditcaffe.ReLUParameter relu_param = 123; + inline bool has_relu_param() const; + inline void clear_relu_param(); + static const int kReluParamFieldNumber = 123; + inline const ::ditcaffe::ReLUParameter& relu_param() const; + inline ::ditcaffe::ReLUParameter* mutable_relu_param(); + inline ::ditcaffe::ReLUParameter* release_relu_param(); + inline void set_allocated_relu_param(::ditcaffe::ReLUParameter* relu_param); + + // optional .ditcaffe.ReshapeParameter reshape_param = 133; + inline bool has_reshape_param() const; + inline void clear_reshape_param(); + static const int kReshapeParamFieldNumber = 133; + inline const ::ditcaffe::ReshapeParameter& reshape_param() const; + inline ::ditcaffe::ReshapeParameter* mutable_reshape_param(); + inline ::ditcaffe::ReshapeParameter* release_reshape_param(); + inline void set_allocated_reshape_param(::ditcaffe::ReshapeParameter* reshape_param); + + // optional .ditcaffe.ScaleParameter scale_param = 142; + inline bool has_scale_param() const; + inline void clear_scale_param(); + static const int kScaleParamFieldNumber = 142; + inline const ::ditcaffe::ScaleParameter& scale_param() const; + inline ::ditcaffe::ScaleParameter* mutable_scale_param(); + inline ::ditcaffe::ScaleParameter* release_scale_param(); + inline void set_allocated_scale_param(::ditcaffe::ScaleParameter* scale_param); + + // optional .ditcaffe.SigmoidParameter sigmoid_param = 124; + inline bool has_sigmoid_param() const; + inline void clear_sigmoid_param(); + static const int kSigmoidParamFieldNumber = 124; + inline const ::ditcaffe::SigmoidParameter& sigmoid_param() const; + inline ::ditcaffe::SigmoidParameter* mutable_sigmoid_param(); + inline ::ditcaffe::SigmoidParameter* release_sigmoid_param(); + inline void set_allocated_sigmoid_param(::ditcaffe::SigmoidParameter* sigmoid_param); + + // optional .ditcaffe.SoftmaxParameter softmax_param = 125; + inline bool has_softmax_param() const; + inline void clear_softmax_param(); + static const int kSoftmaxParamFieldNumber = 125; + inline const ::ditcaffe::SoftmaxParameter& softmax_param() const; + inline ::ditcaffe::SoftmaxParameter* mutable_softmax_param(); + inline ::ditcaffe::SoftmaxParameter* release_softmax_param(); + inline void set_allocated_softmax_param(::ditcaffe::SoftmaxParameter* softmax_param); + + // optional .ditcaffe.SPPParameter spp_param = 132; + inline bool has_spp_param() const; + inline void clear_spp_param(); + static const int kSppParamFieldNumber = 132; + inline const ::ditcaffe::SPPParameter& spp_param() const; + inline ::ditcaffe::SPPParameter* mutable_spp_param(); + inline ::ditcaffe::SPPParameter* release_spp_param(); + inline void set_allocated_spp_param(::ditcaffe::SPPParameter* spp_param); + + // optional .ditcaffe.SliceParameter slice_param = 126; + inline bool has_slice_param() const; + inline void clear_slice_param(); + static const int kSliceParamFieldNumber = 126; + inline const ::ditcaffe::SliceParameter& slice_param() const; + inline ::ditcaffe::SliceParameter* mutable_slice_param(); + inline ::ditcaffe::SliceParameter* release_slice_param(); + inline void set_allocated_slice_param(::ditcaffe::SliceParameter* slice_param); + + // optional .ditcaffe.TanHParameter tanh_param = 127; + inline bool has_tanh_param() const; + inline void clear_tanh_param(); + static const int kTanhParamFieldNumber = 127; + inline const ::ditcaffe::TanHParameter& tanh_param() const; + inline ::ditcaffe::TanHParameter* mutable_tanh_param(); + inline ::ditcaffe::TanHParameter* release_tanh_param(); + inline void set_allocated_tanh_param(::ditcaffe::TanHParameter* tanh_param); + + // optional .ditcaffe.ThresholdParameter threshold_param = 128; + inline bool has_threshold_param() const; + inline void clear_threshold_param(); + static const int kThresholdParamFieldNumber = 128; + inline const ::ditcaffe::ThresholdParameter& threshold_param() const; + inline ::ditcaffe::ThresholdParameter* mutable_threshold_param(); + inline ::ditcaffe::ThresholdParameter* release_threshold_param(); + inline void set_allocated_threshold_param(::ditcaffe::ThresholdParameter* threshold_param); + + // optional .ditcaffe.TileParameter tile_param = 138; + inline bool has_tile_param() const; + inline void clear_tile_param(); + static const int kTileParamFieldNumber = 138; + inline const ::ditcaffe::TileParameter& tile_param() const; + inline ::ditcaffe::TileParameter* mutable_tile_param(); + inline ::ditcaffe::TileParameter* release_tile_param(); + inline void set_allocated_tile_param(::ditcaffe::TileParameter* tile_param); + + // optional .ditcaffe.WindowDataParameter window_data_param = 129; + inline bool has_window_data_param() const; + inline void clear_window_data_param(); + static const int kWindowDataParamFieldNumber = 129; + inline const ::ditcaffe::WindowDataParameter& window_data_param() const; + inline ::ditcaffe::WindowDataParameter* mutable_window_data_param(); + inline ::ditcaffe::WindowDataParameter* release_window_data_param(); + inline void set_allocated_window_data_param(::ditcaffe::WindowDataParameter* window_data_param); + + // @@protoc_insertion_point(class_scope:ditcaffe.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_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_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_python_param(); + inline void clear_has_python_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::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[2]; + ::std::string* name_; + ::std::string* type_; + ::google::protobuf::RepeatedPtrField< ::std::string> bottom_; + ::google::protobuf::RepeatedPtrField< ::std::string> top_; + ::google::protobuf::RepeatedField< float > loss_weight_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::ParamSpec > param_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto > blobs_; + ::google::protobuf::RepeatedField< bool > propagate_down_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule > include_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule > exclude_; + ::ditcaffe::TransformationParameter* transform_param_; + ::ditcaffe::LossParameter* loss_param_; + ::ditcaffe::AccuracyParameter* accuracy_param_; + ::ditcaffe::ArgMaxParameter* argmax_param_; + ::ditcaffe::BatchNormParameter* batch_norm_param_; + ::ditcaffe::BiasParameter* bias_param_; + ::ditcaffe::ConcatParameter* concat_param_; + ::ditcaffe::ContrastiveLossParameter* contrastive_loss_param_; + ::ditcaffe::ConvolutionParameter* convolution_param_; + ::ditcaffe::CropParameter* crop_param_; + ::ditcaffe::DataParameter* data_param_; + ::ditcaffe::DropoutParameter* dropout_param_; + ::ditcaffe::DummyDataParameter* dummy_data_param_; + ::ditcaffe::EltwiseParameter* eltwise_param_; + ::ditcaffe::ELUParameter* elu_param_; + ::ditcaffe::EmbedParameter* embed_param_; + ::ditcaffe::ExpParameter* exp_param_; + ::ditcaffe::FlattenParameter* flatten_param_; + ::ditcaffe::HDF5DataParameter* hdf5_data_param_; + ::ditcaffe::HDF5OutputParameter* hdf5_output_param_; + ::ditcaffe::HingeLossParameter* hinge_loss_param_; + ::ditcaffe::ImageDataParameter* image_data_param_; + ::ditcaffe::InfogainLossParameter* infogain_loss_param_; + ::ditcaffe::InnerProductParameter* inner_product_param_; + ::ditcaffe::InputParameter* input_param_; + ::ditcaffe::LogParameter* log_param_; + ::ditcaffe::LRNParameter* lrn_param_; + ::ditcaffe::MemoryDataParameter* memory_data_param_; + ::ditcaffe::MVNParameter* mvn_param_; + ::ditcaffe::ParameterParameter* parameter_param_; + ::ditcaffe::PoolingParameter* pooling_param_; + ::ditcaffe::PowerParameter* power_param_; + ::ditcaffe::PReLUParameter* prelu_param_; + ::ditcaffe::PythonParameter* python_param_; + ::ditcaffe::ReductionParameter* reduction_param_; + ::ditcaffe::ReLUParameter* relu_param_; + ::ditcaffe::ReshapeParameter* reshape_param_; + ::ditcaffe::ScaleParameter* scale_param_; + ::ditcaffe::SigmoidParameter* sigmoid_param_; + ::ditcaffe::SoftmaxParameter* softmax_param_; + ::ditcaffe::SPPParameter* spp_param_; + ::ditcaffe::SliceParameter* slice_param_; + ::ditcaffe::TanHParameter* tanh_param_; + ::ditcaffe::ThresholdParameter* threshold_param_; + ::ditcaffe::TileParameter* tile_param_; + ::ditcaffe::WindowDataParameter* window_data_param_; + int phase_; + mutable int _cached_size_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static LayerParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class TransformationParameter : public ::google::protobuf::Message { + 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 _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const TransformationParameter& default_instance(); + + void Swap(TransformationParameter* other); + + // implements Message ---------------------------------------------- + + TransformationParameter* New() 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional float scale = 1 [default = 1]; + inline bool has_scale() const; + inline void clear_scale(); + static const int kScaleFieldNumber = 1; + inline float scale() const; + inline void set_scale(float value); + + // optional bool mirror = 2 [default = false]; + inline bool has_mirror() const; + inline void clear_mirror(); + static const int kMirrorFieldNumber = 2; + inline bool mirror() const; + inline void set_mirror(bool value); + + // optional uint32 crop_size = 3 [default = 0]; + inline bool has_crop_size() const; + inline void clear_crop_size(); + static const int kCropSizeFieldNumber = 3; + inline ::google::protobuf::uint32 crop_size() const; + inline void set_crop_size(::google::protobuf::uint32 value); + + // optional string mean_file = 4; + inline bool has_mean_file() const; + inline void clear_mean_file(); + static const int kMeanFileFieldNumber = 4; + inline const ::std::string& mean_file() const; + inline void set_mean_file(const ::std::string& value); + inline void set_mean_file(const char* value); + inline void set_mean_file(const char* value, size_t size); + inline ::std::string* mutable_mean_file(); + inline ::std::string* release_mean_file(); + inline void set_allocated_mean_file(::std::string* mean_file); + + // repeated float mean_value = 5; + inline int mean_value_size() const; + inline void clear_mean_value(); + static const int kMeanValueFieldNumber = 5; + inline float mean_value(int index) const; + inline void set_mean_value(int index, float value); + inline void add_mean_value(float value); + inline const ::google::protobuf::RepeatedField< float >& + mean_value() const; + inline ::google::protobuf::RepeatedField< float >* + mutable_mean_value(); + + // optional bool force_color = 6 [default = false]; + inline bool has_force_color() const; + inline void clear_force_color(); + static const int kForceColorFieldNumber = 6; + inline bool force_color() const; + inline void set_force_color(bool value); + + // optional bool force_gray = 7 [default = false]; + inline bool has_force_gray() const; + inline void clear_force_gray(); + static const int kForceGrayFieldNumber = 7; + inline bool force_gray() const; + inline void set_force_gray(bool value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + float scale_; + ::google::protobuf::uint32 crop_size_; + ::std::string* mean_file_; + ::google::protobuf::RepeatedField< float > mean_value_; + bool mirror_; + bool force_color_; + bool force_gray_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static TransformationParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class LossParameter : public ::google::protobuf::Message { + 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 _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const LossParameter& default_instance(); + + void Swap(LossParameter* other); + + // implements Message ---------------------------------------------- + + LossParameter* New() 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + 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; + inline bool has_ignore_label() const; + inline void clear_ignore_label(); + static const int kIgnoreLabelFieldNumber = 1; + inline ::google::protobuf::int32 ignore_label() const; + inline void set_ignore_label(::google::protobuf::int32 value); + + // optional .ditcaffe.LossParameter.NormalizationMode normalization = 3 [default = VALID]; + inline bool has_normalization() const; + inline void clear_normalization(); + static const int kNormalizationFieldNumber = 3; + inline ::ditcaffe::LossParameter_NormalizationMode normalization() const; + inline void set_normalization(::ditcaffe::LossParameter_NormalizationMode value); + + // optional bool normalize = 2; + inline bool has_normalize() const; + inline void clear_normalize(); + static const int kNormalizeFieldNumber = 2; + inline bool normalize() const; + inline void set_normalize(bool value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::int32 ignore_label_; + int normalization_; + bool normalize_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static LossParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class AccuracyParameter : public ::google::protobuf::Message { + 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 _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const AccuracyParameter& default_instance(); + + void Swap(AccuracyParameter* other); + + // implements Message ---------------------------------------------- + + AccuracyParameter* New() 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional uint32 top_k = 1 [default = 1]; + inline bool has_top_k() const; + inline void clear_top_k(); + static const int kTopKFieldNumber = 1; + inline ::google::protobuf::uint32 top_k() const; + inline void set_top_k(::google::protobuf::uint32 value); + + // optional int32 axis = 2 [default = 1]; + inline bool has_axis() const; + inline void clear_axis(); + static const int kAxisFieldNumber = 2; + inline ::google::protobuf::int32 axis() const; + inline void set_axis(::google::protobuf::int32 value); + + // optional int32 ignore_label = 3; + inline bool has_ignore_label() const; + inline void clear_ignore_label(); + static const int kIgnoreLabelFieldNumber = 3; + inline ::google::protobuf::int32 ignore_label() const; + inline void set_ignore_label(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::uint32 top_k_; + ::google::protobuf::int32 axis_; + ::google::protobuf::int32 ignore_label_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static AccuracyParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class ArgMaxParameter : public ::google::protobuf::Message { + 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 _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const ArgMaxParameter& default_instance(); + + void Swap(ArgMaxParameter* other); + + // implements Message ---------------------------------------------- + + ArgMaxParameter* New() 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional bool out_max_val = 1 [default = false]; + inline bool has_out_max_val() const; + inline void clear_out_max_val(); + static const int kOutMaxValFieldNumber = 1; + inline bool out_max_val() const; + inline void set_out_max_val(bool value); + + // optional uint32 top_k = 2 [default = 1]; + inline bool has_top_k() const; + inline void clear_top_k(); + static const int kTopKFieldNumber = 2; + inline ::google::protobuf::uint32 top_k() const; + inline void set_top_k(::google::protobuf::uint32 value); + + // optional int32 axis = 3; + inline bool has_axis() const; + inline void clear_axis(); + static const int kAxisFieldNumber = 3; + inline ::google::protobuf::int32 axis() const; + inline void set_axis(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + bool out_max_val_; + ::google::protobuf::uint32 top_k_; + ::google::protobuf::int32 axis_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static ArgMaxParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class ConcatParameter : public ::google::protobuf::Message { + 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 _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const ConcatParameter& default_instance(); + + void Swap(ConcatParameter* other); + + // implements Message ---------------------------------------------- + + ConcatParameter* New() 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional int32 axis = 2 [default = 1]; + inline bool has_axis() const; + inline void clear_axis(); + static const int kAxisFieldNumber = 2; + inline ::google::protobuf::int32 axis() const; + inline void set_axis(::google::protobuf::int32 value); + + // optional uint32 concat_dim = 1 [default = 1]; + inline bool has_concat_dim() const; + inline void clear_concat_dim(); + static const int kConcatDimFieldNumber = 1; + inline ::google::protobuf::uint32 concat_dim() const; + inline void set_concat_dim(::google::protobuf::uint32 value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::int32 axis_; + ::google::protobuf::uint32 concat_dim_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static ConcatParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class BatchNormParameter : public ::google::protobuf::Message { + 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 _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const BatchNormParameter& default_instance(); + + void Swap(BatchNormParameter* other); + + // implements Message ---------------------------------------------- + + BatchNormParameter* New() 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional bool use_global_stats = 1; + inline bool has_use_global_stats() const; + inline void clear_use_global_stats(); + static const int kUseGlobalStatsFieldNumber = 1; + inline bool use_global_stats() const; + inline void set_use_global_stats(bool value); + + // optional float moving_average_fraction = 2 [default = 0.999]; + inline bool has_moving_average_fraction() const; + inline void clear_moving_average_fraction(); + static const int kMovingAverageFractionFieldNumber = 2; + inline float moving_average_fraction() const; + inline void set_moving_average_fraction(float value); + + // optional float eps = 3 [default = 1e-05]; + inline bool has_eps() const; + inline void clear_eps(); + static const int kEpsFieldNumber = 3; + inline float eps() const; + inline void set_eps(float value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + bool use_global_stats_; + float moving_average_fraction_; + float eps_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static BatchNormParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class BiasParameter : public ::google::protobuf::Message { + 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 _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const BiasParameter& default_instance(); + + void Swap(BiasParameter* other); + + // implements Message ---------------------------------------------- + + BiasParameter* New() 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional int32 axis = 1 [default = 1]; + inline bool has_axis() const; + inline void clear_axis(); + static const int kAxisFieldNumber = 1; + inline ::google::protobuf::int32 axis() const; + inline void set_axis(::google::protobuf::int32 value); + + // optional int32 num_axes = 2 [default = 1]; + inline bool has_num_axes() const; + inline void clear_num_axes(); + static const int kNumAxesFieldNumber = 2; + inline ::google::protobuf::int32 num_axes() const; + inline void set_num_axes(::google::protobuf::int32 value); + + // optional .ditcaffe.FillerParameter filler = 3; + inline bool has_filler() const; + inline void clear_filler(); + static const int kFillerFieldNumber = 3; + inline const ::ditcaffe::FillerParameter& filler() const; + inline ::ditcaffe::FillerParameter* mutable_filler(); + inline ::ditcaffe::FillerParameter* release_filler(); + inline void set_allocated_filler(::ditcaffe::FillerParameter* filler); + + // @@protoc_insertion_point(class_scope:ditcaffe.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::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::int32 axis_; + ::google::protobuf::int32 num_axes_; + ::ditcaffe::FillerParameter* filler_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static BiasParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class ContrastiveLossParameter : public ::google::protobuf::Message { + 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 _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const ContrastiveLossParameter& default_instance(); + + void Swap(ContrastiveLossParameter* other); + + // implements Message ---------------------------------------------- + + ContrastiveLossParameter* New() 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional float margin = 1 [default = 1]; + inline bool has_margin() const; + inline void clear_margin(); + static const int kMarginFieldNumber = 1; + inline float margin() const; + inline void set_margin(float value); + + // optional bool legacy_version = 2 [default = false]; + inline bool has_legacy_version() const; + inline void clear_legacy_version(); + static const int kLegacyVersionFieldNumber = 2; + inline bool legacy_version() const; + inline void set_legacy_version(bool value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + float margin_; + bool legacy_version_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static ContrastiveLossParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class ConvolutionParameter : public ::google::protobuf::Message { + 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 _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const ConvolutionParameter& default_instance(); + + void Swap(ConvolutionParameter* other); + + // implements Message ---------------------------------------------- + + ConvolutionParameter* New() 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + 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; + inline bool has_num_output() const; + inline void clear_num_output(); + static const int kNumOutputFieldNumber = 1; + inline ::google::protobuf::uint32 num_output() const; + inline void set_num_output(::google::protobuf::uint32 value); + + // optional bool bias_term = 2 [default = true]; + inline bool has_bias_term() const; + inline void clear_bias_term(); + static const int kBiasTermFieldNumber = 2; + inline bool bias_term() const; + inline void set_bias_term(bool value); + + // repeated uint32 pad = 3; + inline int pad_size() const; + inline void clear_pad(); + static const int kPadFieldNumber = 3; + inline ::google::protobuf::uint32 pad(int index) const; + inline void set_pad(int index, ::google::protobuf::uint32 value); + inline void add_pad(::google::protobuf::uint32 value); + inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& + pad() const; + inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* + mutable_pad(); + + // repeated uint32 kernel_size = 4; + inline int kernel_size_size() const; + inline void clear_kernel_size(); + static const int kKernelSizeFieldNumber = 4; + inline ::google::protobuf::uint32 kernel_size(int index) const; + inline void set_kernel_size(int index, ::google::protobuf::uint32 value); + inline void add_kernel_size(::google::protobuf::uint32 value); + inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& + kernel_size() const; + inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* + mutable_kernel_size(); + + // repeated uint32 stride = 6; + inline int stride_size() const; + inline void clear_stride(); + static const int kStrideFieldNumber = 6; + inline ::google::protobuf::uint32 stride(int index) const; + inline void set_stride(int index, ::google::protobuf::uint32 value); + inline void add_stride(::google::protobuf::uint32 value); + inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& + stride() const; + inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* + mutable_stride(); + + // repeated uint32 dilation = 18; + inline int dilation_size() const; + inline void clear_dilation(); + static const int kDilationFieldNumber = 18; + inline ::google::protobuf::uint32 dilation(int index) const; + inline void set_dilation(int index, ::google::protobuf::uint32 value); + inline void add_dilation(::google::protobuf::uint32 value); + inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& + dilation() const; + inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* + mutable_dilation(); + + // optional uint32 pad_h = 9 [default = 0]; + inline bool has_pad_h() const; + inline void clear_pad_h(); + static const int kPadHFieldNumber = 9; + inline ::google::protobuf::uint32 pad_h() const; + inline void set_pad_h(::google::protobuf::uint32 value); + + // optional uint32 pad_w = 10 [default = 0]; + inline bool has_pad_w() const; + inline void clear_pad_w(); + static const int kPadWFieldNumber = 10; + inline ::google::protobuf::uint32 pad_w() const; + inline void set_pad_w(::google::protobuf::uint32 value); + + // optional uint32 kernel_h = 11; + inline bool has_kernel_h() const; + inline void clear_kernel_h(); + static const int kKernelHFieldNumber = 11; + inline ::google::protobuf::uint32 kernel_h() const; + inline void set_kernel_h(::google::protobuf::uint32 value); + + // optional uint32 kernel_w = 12; + inline bool has_kernel_w() const; + inline void clear_kernel_w(); + static const int kKernelWFieldNumber = 12; + inline ::google::protobuf::uint32 kernel_w() const; + inline void set_kernel_w(::google::protobuf::uint32 value); + + // optional uint32 stride_h = 13; + inline bool has_stride_h() const; + inline void clear_stride_h(); + static const int kStrideHFieldNumber = 13; + inline ::google::protobuf::uint32 stride_h() const; + inline void set_stride_h(::google::protobuf::uint32 value); + + // optional uint32 stride_w = 14; + inline bool has_stride_w() const; + inline void clear_stride_w(); + static const int kStrideWFieldNumber = 14; + inline ::google::protobuf::uint32 stride_w() const; + inline void set_stride_w(::google::protobuf::uint32 value); + + // optional uint32 group = 5 [default = 1]; + inline bool has_group() const; + inline void clear_group(); + static const int kGroupFieldNumber = 5; + inline ::google::protobuf::uint32 group() const; + inline void set_group(::google::protobuf::uint32 value); + + // optional .ditcaffe.FillerParameter weight_filler = 7; + inline bool has_weight_filler() const; + inline void clear_weight_filler(); + static const int kWeightFillerFieldNumber = 7; + inline const ::ditcaffe::FillerParameter& weight_filler() const; + inline ::ditcaffe::FillerParameter* mutable_weight_filler(); + inline ::ditcaffe::FillerParameter* release_weight_filler(); + inline void set_allocated_weight_filler(::ditcaffe::FillerParameter* weight_filler); + + // optional .ditcaffe.FillerParameter bias_filler = 8; + inline bool has_bias_filler() const; + inline void clear_bias_filler(); + static const int kBiasFillerFieldNumber = 8; + inline const ::ditcaffe::FillerParameter& bias_filler() const; + inline ::ditcaffe::FillerParameter* mutable_bias_filler(); + inline ::ditcaffe::FillerParameter* release_bias_filler(); + inline void set_allocated_bias_filler(::ditcaffe::FillerParameter* bias_filler); + + // optional .ditcaffe.ConvolutionParameter.Engine engine = 15 [default = DEFAULT]; + inline bool has_engine() const; + inline void clear_engine(); + static const int kEngineFieldNumber = 15; + inline ::ditcaffe::ConvolutionParameter_Engine engine() const; + inline void set_engine(::ditcaffe::ConvolutionParameter_Engine value); + + // optional int32 axis = 16 [default = 1]; + inline bool has_axis() const; + inline void clear_axis(); + static const int kAxisFieldNumber = 16; + inline ::google::protobuf::int32 axis() const; + inline void set_axis(::google::protobuf::int32 value); + + // optional bool force_nd_im2col = 17 [default = false]; + inline bool has_force_nd_im2col() const; + inline void clear_force_nd_im2col(); + static const int kForceNdIm2ColFieldNumber = 17; + inline bool force_nd_im2col() const; + inline void set_force_nd_im2col(bool value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > pad_; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > kernel_size_; + ::google::protobuf::uint32 num_output_; + ::google::protobuf::uint32 pad_h_; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > stride_; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > dilation_; + ::google::protobuf::uint32 pad_w_; + ::google::protobuf::uint32 kernel_h_; + ::google::protobuf::uint32 kernel_w_; + bool bias_term_; + bool force_nd_im2col_; + ::google::protobuf::uint32 stride_h_; + ::google::protobuf::uint32 stride_w_; + ::ditcaffe::FillerParameter* weight_filler_; + ::google::protobuf::uint32 group_; + int engine_; + ::ditcaffe::FillerParameter* bias_filler_; + ::google::protobuf::int32 axis_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static ConvolutionParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class CropParameter : public ::google::protobuf::Message { + 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 _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const CropParameter& default_instance(); + + void Swap(CropParameter* other); + + // implements Message ---------------------------------------------- + + CropParameter* New() 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional int32 axis = 1 [default = 2]; + inline bool has_axis() const; + inline void clear_axis(); + static const int kAxisFieldNumber = 1; + inline ::google::protobuf::int32 axis() const; + inline void set_axis(::google::protobuf::int32 value); + + // repeated uint32 offset = 2; + inline int offset_size() const; + inline void clear_offset(); + static const int kOffsetFieldNumber = 2; + inline ::google::protobuf::uint32 offset(int index) const; + inline void set_offset(int index, ::google::protobuf::uint32 value); + inline void add_offset(::google::protobuf::uint32 value); + inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& + offset() const; + inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* + mutable_offset(); + + // @@protoc_insertion_point(class_scope:ditcaffe.CropParameter) + private: + inline void set_has_axis(); + inline void clear_has_axis(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > offset_; + ::google::protobuf::int32 axis_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static CropParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class DataParameter : public ::google::protobuf::Message { + 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 _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const DataParameter& default_instance(); + + void Swap(DataParameter* other); + + // implements Message ---------------------------------------------- + + DataParameter* New() 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + 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; + inline bool has_source() const; + inline void clear_source(); + static const int kSourceFieldNumber = 1; + inline const ::std::string& source() const; + inline void set_source(const ::std::string& value); + inline void set_source(const char* value); + inline void set_source(const char* value, size_t size); + inline ::std::string* mutable_source(); + inline ::std::string* release_source(); + inline void set_allocated_source(::std::string* source); + + // optional uint32 batch_size = 4; + inline bool has_batch_size() const; + inline void clear_batch_size(); + static const int kBatchSizeFieldNumber = 4; + inline ::google::protobuf::uint32 batch_size() const; + inline void set_batch_size(::google::protobuf::uint32 value); + + // optional uint32 rand_skip = 7 [default = 0]; + inline bool has_rand_skip() const; + inline void clear_rand_skip(); + static const int kRandSkipFieldNumber = 7; + inline ::google::protobuf::uint32 rand_skip() const; + inline void set_rand_skip(::google::protobuf::uint32 value); + + // optional .ditcaffe.DataParameter.DB backend = 8 [default = LEVELDB]; + inline bool has_backend() const; + inline void clear_backend(); + static const int kBackendFieldNumber = 8; + inline ::ditcaffe::DataParameter_DB backend() const; + inline void set_backend(::ditcaffe::DataParameter_DB value); + + // optional float scale = 2 [default = 1]; + inline bool has_scale() const; + inline void clear_scale(); + static const int kScaleFieldNumber = 2; + inline float scale() const; + inline void set_scale(float value); + + // optional string mean_file = 3; + inline bool has_mean_file() const; + inline void clear_mean_file(); + static const int kMeanFileFieldNumber = 3; + inline const ::std::string& mean_file() const; + inline void set_mean_file(const ::std::string& value); + inline void set_mean_file(const char* value); + inline void set_mean_file(const char* value, size_t size); + inline ::std::string* mutable_mean_file(); + inline ::std::string* release_mean_file(); + inline void set_allocated_mean_file(::std::string* mean_file); + + // optional uint32 crop_size = 5 [default = 0]; + inline bool has_crop_size() const; + inline void clear_crop_size(); + static const int kCropSizeFieldNumber = 5; + inline ::google::protobuf::uint32 crop_size() const; + inline void set_crop_size(::google::protobuf::uint32 value); + + // optional bool mirror = 6 [default = false]; + inline bool has_mirror() const; + inline void clear_mirror(); + static const int kMirrorFieldNumber = 6; + inline bool mirror() const; + inline void set_mirror(bool value); + + // optional bool force_encoded_color = 9 [default = false]; + inline bool has_force_encoded_color() const; + inline void clear_force_encoded_color(); + static const int kForceEncodedColorFieldNumber = 9; + inline bool force_encoded_color() const; + inline void set_force_encoded_color(bool value); + + // optional uint32 prefetch = 10 [default = 4]; + inline bool has_prefetch() const; + inline void clear_prefetch(); + static const int kPrefetchFieldNumber = 10; + inline ::google::protobuf::uint32 prefetch() const; + inline void set_prefetch(::google::protobuf::uint32 value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::std::string* source_; + ::google::protobuf::uint32 batch_size_; + ::google::protobuf::uint32 rand_skip_; + int backend_; + float scale_; + ::std::string* mean_file_; + ::google::protobuf::uint32 crop_size_; + bool mirror_; + bool force_encoded_color_; + ::google::protobuf::uint32 prefetch_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static DataParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class DropoutParameter : public ::google::protobuf::Message { + 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 _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const DropoutParameter& default_instance(); + + void Swap(DropoutParameter* other); + + // implements Message ---------------------------------------------- + + DropoutParameter* New() 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional float dropout_ratio = 1 [default = 0.5]; + inline bool has_dropout_ratio() const; + inline void clear_dropout_ratio(); + static const int kDropoutRatioFieldNumber = 1; + inline float dropout_ratio() const; + inline void set_dropout_ratio(float value); + + // @@protoc_insertion_point(class_scope:ditcaffe.DropoutParameter) + private: + inline void set_has_dropout_ratio(); + inline void clear_has_dropout_ratio(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + float dropout_ratio_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static DropoutParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class DummyDataParameter : public ::google::protobuf::Message { + 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 _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const DummyDataParameter& default_instance(); + + void Swap(DummyDataParameter* other); + + // implements Message ---------------------------------------------- + + DummyDataParameter* New() 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .ditcaffe.FillerParameter data_filler = 1; + inline int data_filler_size() const; + inline void clear_data_filler(); + static const int kDataFillerFieldNumber = 1; + inline const ::ditcaffe::FillerParameter& data_filler(int index) const; + inline ::ditcaffe::FillerParameter* mutable_data_filler(int index); + inline ::ditcaffe::FillerParameter* add_data_filler(); + inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::FillerParameter >& + data_filler() const; + inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::FillerParameter >* + mutable_data_filler(); + + // repeated .ditcaffe.BlobShape shape = 6; + inline int shape_size() const; + inline void clear_shape(); + static const int kShapeFieldNumber = 6; + inline const ::ditcaffe::BlobShape& shape(int index) const; + inline ::ditcaffe::BlobShape* mutable_shape(int index); + inline ::ditcaffe::BlobShape* add_shape(); + inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobShape >& + shape() const; + inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobShape >* + mutable_shape(); + + // repeated uint32 num = 2; + inline int num_size() const; + inline void clear_num(); + static const int kNumFieldNumber = 2; + inline ::google::protobuf::uint32 num(int index) const; + inline void set_num(int index, ::google::protobuf::uint32 value); + inline void add_num(::google::protobuf::uint32 value); + inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& + num() const; + inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* + mutable_num(); + + // repeated uint32 channels = 3; + inline int channels_size() const; + inline void clear_channels(); + static const int kChannelsFieldNumber = 3; + inline ::google::protobuf::uint32 channels(int index) const; + inline void set_channels(int index, ::google::protobuf::uint32 value); + inline void add_channels(::google::protobuf::uint32 value); + inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& + channels() const; + inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* + mutable_channels(); + + // repeated uint32 height = 4; + inline int height_size() const; + inline void clear_height(); + static const int kHeightFieldNumber = 4; + inline ::google::protobuf::uint32 height(int index) const; + inline void set_height(int index, ::google::protobuf::uint32 value); + inline void add_height(::google::protobuf::uint32 value); + inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& + height() const; + inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* + mutable_height(); + + // repeated uint32 width = 5; + inline int width_size() const; + inline void clear_width(); + static const int kWidthFieldNumber = 5; + inline ::google::protobuf::uint32 width(int index) const; + inline void set_width(int index, ::google::protobuf::uint32 value); + inline void add_width(::google::protobuf::uint32 value); + inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& + width() const; + inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* + mutable_width(); + + // @@protoc_insertion_point(class_scope:ditcaffe.DummyDataParameter) + private: + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::FillerParameter > data_filler_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::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_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static DummyDataParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class EltwiseParameter : public ::google::protobuf::Message { + 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 _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const EltwiseParameter& default_instance(); + + void Swap(EltwiseParameter* other); + + // implements Message ---------------------------------------------- + + EltwiseParameter* New() 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + 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 .ditcaffe.EltwiseParameter.EltwiseOp operation = 1 [default = SUM]; + inline bool has_operation() const; + inline void clear_operation(); + static const int kOperationFieldNumber = 1; + inline ::ditcaffe::EltwiseParameter_EltwiseOp operation() const; + inline void set_operation(::ditcaffe::EltwiseParameter_EltwiseOp value); + + // repeated float coeff = 2; + inline int coeff_size() const; + inline void clear_coeff(); + static const int kCoeffFieldNumber = 2; + inline float coeff(int index) const; + inline void set_coeff(int index, float value); + inline void add_coeff(float value); + inline const ::google::protobuf::RepeatedField< float >& + coeff() const; + inline ::google::protobuf::RepeatedField< float >* + mutable_coeff(); + + // optional bool stable_prod_grad = 3 [default = true]; + inline bool has_stable_prod_grad() const; + inline void clear_stable_prod_grad(); + static const int kStableProdGradFieldNumber = 3; + inline bool stable_prod_grad() const; + inline void set_stable_prod_grad(bool value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::RepeatedField< float > coeff_; + int operation_; + bool stable_prod_grad_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static EltwiseParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class ELUParameter : public ::google::protobuf::Message { + 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 _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const ELUParameter& default_instance(); + + void Swap(ELUParameter* other); + + // implements Message ---------------------------------------------- + + ELUParameter* New() 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional float alpha = 1 [default = 1]; + inline bool has_alpha() const; + inline void clear_alpha(); + static const int kAlphaFieldNumber = 1; + inline float alpha() const; + inline void set_alpha(float value); + + // @@protoc_insertion_point(class_scope:ditcaffe.ELUParameter) + private: + inline void set_has_alpha(); + inline void clear_has_alpha(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + float alpha_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static ELUParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class EmbedParameter : public ::google::protobuf::Message { + 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 _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const EmbedParameter& default_instance(); + + void Swap(EmbedParameter* other); + + // implements Message ---------------------------------------------- + + EmbedParameter* New() 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional uint32 num_output = 1; + inline bool has_num_output() const; + inline void clear_num_output(); + static const int kNumOutputFieldNumber = 1; + inline ::google::protobuf::uint32 num_output() const; + inline void set_num_output(::google::protobuf::uint32 value); + + // optional uint32 input_dim = 2; + inline bool has_input_dim() const; + inline void clear_input_dim(); + static const int kInputDimFieldNumber = 2; + inline ::google::protobuf::uint32 input_dim() const; + inline void set_input_dim(::google::protobuf::uint32 value); + + // optional bool bias_term = 3 [default = true]; + inline bool has_bias_term() const; + inline void clear_bias_term(); + static const int kBiasTermFieldNumber = 3; + inline bool bias_term() const; + inline void set_bias_term(bool value); + + // optional .ditcaffe.FillerParameter weight_filler = 4; + inline bool has_weight_filler() const; + inline void clear_weight_filler(); + static const int kWeightFillerFieldNumber = 4; + inline const ::ditcaffe::FillerParameter& weight_filler() const; + inline ::ditcaffe::FillerParameter* mutable_weight_filler(); + inline ::ditcaffe::FillerParameter* release_weight_filler(); + inline void set_allocated_weight_filler(::ditcaffe::FillerParameter* weight_filler); + + // optional .ditcaffe.FillerParameter bias_filler = 5; + inline bool has_bias_filler() const; + inline void clear_bias_filler(); + static const int kBiasFillerFieldNumber = 5; + inline const ::ditcaffe::FillerParameter& bias_filler() const; + inline ::ditcaffe::FillerParameter* mutable_bias_filler(); + inline ::ditcaffe::FillerParameter* release_bias_filler(); + inline void set_allocated_bias_filler(::ditcaffe::FillerParameter* bias_filler); + + // @@protoc_insertion_point(class_scope:ditcaffe.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::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::uint32 num_output_; + ::google::protobuf::uint32 input_dim_; + ::ditcaffe::FillerParameter* weight_filler_; + ::ditcaffe::FillerParameter* bias_filler_; + bool bias_term_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static EmbedParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class ExpParameter : public ::google::protobuf::Message { + 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 _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const ExpParameter& default_instance(); + + void Swap(ExpParameter* other); + + // implements Message ---------------------------------------------- + + ExpParameter* New() 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional float base = 1 [default = -1]; + inline bool has_base() const; + inline void clear_base(); + static const int kBaseFieldNumber = 1; + inline float base() const; + inline void set_base(float value); + + // optional float scale = 2 [default = 1]; + inline bool has_scale() const; + inline void clear_scale(); + static const int kScaleFieldNumber = 2; + inline float scale() const; + inline void set_scale(float value); + + // optional float shift = 3 [default = 0]; + inline bool has_shift() const; + inline void clear_shift(); + static const int kShiftFieldNumber = 3; + inline float shift() const; + inline void set_shift(float value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + float base_; + float scale_; + float shift_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static ExpParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class FlattenParameter : public ::google::protobuf::Message { + 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 _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const FlattenParameter& default_instance(); + + void Swap(FlattenParameter* other); + + // implements Message ---------------------------------------------- + + FlattenParameter* New() 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional int32 axis = 1 [default = 1]; + inline bool has_axis() const; + inline void clear_axis(); + static const int kAxisFieldNumber = 1; + inline ::google::protobuf::int32 axis() const; + inline void set_axis(::google::protobuf::int32 value); + + // optional int32 end_axis = 2 [default = -1]; + inline bool has_end_axis() const; + inline void clear_end_axis(); + static const int kEndAxisFieldNumber = 2; + inline ::google::protobuf::int32 end_axis() const; + inline void set_end_axis(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::int32 axis_; + ::google::protobuf::int32 end_axis_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static FlattenParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class HDF5DataParameter : public ::google::protobuf::Message { + 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 _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const HDF5DataParameter& default_instance(); + + void Swap(HDF5DataParameter* other); + + // implements Message ---------------------------------------------- + + HDF5DataParameter* New() 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional string source = 1; + inline bool has_source() const; + inline void clear_source(); + static const int kSourceFieldNumber = 1; + inline const ::std::string& source() const; + inline void set_source(const ::std::string& value); + inline void set_source(const char* value); + inline void set_source(const char* value, size_t size); + inline ::std::string* mutable_source(); + inline ::std::string* release_source(); + inline void set_allocated_source(::std::string* source); + + // optional uint32 batch_size = 2; + inline bool has_batch_size() const; + inline void clear_batch_size(); + static const int kBatchSizeFieldNumber = 2; + inline ::google::protobuf::uint32 batch_size() const; + inline void set_batch_size(::google::protobuf::uint32 value); + + // optional bool shuffle = 3 [default = false]; + inline bool has_shuffle() const; + inline void clear_shuffle(); + static const int kShuffleFieldNumber = 3; + inline bool shuffle() const; + inline void set_shuffle(bool value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::std::string* source_; + ::google::protobuf::uint32 batch_size_; + bool shuffle_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static HDF5DataParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class HDF5OutputParameter : public ::google::protobuf::Message { + 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 _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const HDF5OutputParameter& default_instance(); + + void Swap(HDF5OutputParameter* other); + + // implements Message ---------------------------------------------- + + HDF5OutputParameter* New() 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional string file_name = 1; + inline bool has_file_name() const; + inline void clear_file_name(); + static const int kFileNameFieldNumber = 1; + inline const ::std::string& file_name() const; + inline void set_file_name(const ::std::string& value); + inline void set_file_name(const char* value); + inline void set_file_name(const char* value, size_t size); + inline ::std::string* mutable_file_name(); + inline ::std::string* release_file_name(); + inline void set_allocated_file_name(::std::string* file_name); + + // @@protoc_insertion_point(class_scope:ditcaffe.HDF5OutputParameter) + private: + inline void set_has_file_name(); + inline void clear_has_file_name(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::std::string* file_name_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static HDF5OutputParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class HingeLossParameter : public ::google::protobuf::Message { + 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 _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const HingeLossParameter& default_instance(); + + void Swap(HingeLossParameter* other); + + // implements Message ---------------------------------------------- + + HingeLossParameter* New() 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + 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 .ditcaffe.HingeLossParameter.Norm norm = 1 [default = L1]; + inline bool has_norm() const; + inline void clear_norm(); + static const int kNormFieldNumber = 1; + inline ::ditcaffe::HingeLossParameter_Norm norm() const; + inline void set_norm(::ditcaffe::HingeLossParameter_Norm value); + + // @@protoc_insertion_point(class_scope:ditcaffe.HingeLossParameter) + private: + inline void set_has_norm(); + inline void clear_has_norm(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + int norm_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static HingeLossParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class ImageDataParameter : public ::google::protobuf::Message { + 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 _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const ImageDataParameter& default_instance(); + + void Swap(ImageDataParameter* other); + + // implements Message ---------------------------------------------- + + ImageDataParameter* New() 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional string source = 1; + inline bool has_source() const; + inline void clear_source(); + static const int kSourceFieldNumber = 1; + inline const ::std::string& source() const; + inline void set_source(const ::std::string& value); + inline void set_source(const char* value); + inline void set_source(const char* value, size_t size); + inline ::std::string* mutable_source(); + inline ::std::string* release_source(); + inline void set_allocated_source(::std::string* source); + + // optional uint32 batch_size = 4 [default = 1]; + inline bool has_batch_size() const; + inline void clear_batch_size(); + static const int kBatchSizeFieldNumber = 4; + inline ::google::protobuf::uint32 batch_size() const; + inline void set_batch_size(::google::protobuf::uint32 value); + + // optional uint32 rand_skip = 7 [default = 0]; + inline bool has_rand_skip() const; + inline void clear_rand_skip(); + static const int kRandSkipFieldNumber = 7; + inline ::google::protobuf::uint32 rand_skip() const; + inline void set_rand_skip(::google::protobuf::uint32 value); + + // optional bool shuffle = 8 [default = false]; + inline bool has_shuffle() const; + inline void clear_shuffle(); + static const int kShuffleFieldNumber = 8; + inline bool shuffle() const; + inline void set_shuffle(bool value); + + // optional uint32 new_height = 9 [default = 0]; + inline bool has_new_height() const; + inline void clear_new_height(); + static const int kNewHeightFieldNumber = 9; + inline ::google::protobuf::uint32 new_height() const; + inline void set_new_height(::google::protobuf::uint32 value); + + // optional uint32 new_width = 10 [default = 0]; + inline bool has_new_width() const; + inline void clear_new_width(); + static const int kNewWidthFieldNumber = 10; + inline ::google::protobuf::uint32 new_width() const; + inline void set_new_width(::google::protobuf::uint32 value); + + // optional bool is_color = 11 [default = true]; + inline bool has_is_color() const; + inline void clear_is_color(); + static const int kIsColorFieldNumber = 11; + inline bool is_color() const; + inline void set_is_color(bool value); + + // optional float scale = 2 [default = 1]; + inline bool has_scale() const; + inline void clear_scale(); + static const int kScaleFieldNumber = 2; + inline float scale() const; + inline void set_scale(float value); + + // optional string mean_file = 3; + inline bool has_mean_file() const; + inline void clear_mean_file(); + static const int kMeanFileFieldNumber = 3; + inline const ::std::string& mean_file() const; + inline void set_mean_file(const ::std::string& value); + inline void set_mean_file(const char* value); + inline void set_mean_file(const char* value, size_t size); + inline ::std::string* mutable_mean_file(); + inline ::std::string* release_mean_file(); + inline void set_allocated_mean_file(::std::string* mean_file); + + // optional uint32 crop_size = 5 [default = 0]; + inline bool has_crop_size() const; + inline void clear_crop_size(); + static const int kCropSizeFieldNumber = 5; + inline ::google::protobuf::uint32 crop_size() const; + inline void set_crop_size(::google::protobuf::uint32 value); + + // optional bool mirror = 6 [default = false]; + inline bool has_mirror() const; + inline void clear_mirror(); + static const int kMirrorFieldNumber = 6; + inline bool mirror() const; + inline void set_mirror(bool value); + + // optional string root_folder = 12 [default = ""]; + inline bool has_root_folder() const; + inline void clear_root_folder(); + static const int kRootFolderFieldNumber = 12; + inline const ::std::string& root_folder() const; + inline void set_root_folder(const ::std::string& value); + inline void set_root_folder(const char* value); + inline void set_root_folder(const char* value, size_t size); + inline ::std::string* mutable_root_folder(); + inline ::std::string* release_root_folder(); + inline void set_allocated_root_folder(::std::string* root_folder); + + // @@protoc_insertion_point(class_scope:ditcaffe.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::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::std::string* source_; + ::google::protobuf::uint32 batch_size_; + ::google::protobuf::uint32 rand_skip_; + ::google::protobuf::uint32 new_height_; + ::google::protobuf::uint32 new_width_; + bool shuffle_; + bool is_color_; + bool mirror_; + float scale_; + ::std::string* mean_file_; + ::std::string* root_folder_; + ::google::protobuf::uint32 crop_size_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static ImageDataParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class InfogainLossParameter : public ::google::protobuf::Message { + 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 _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const InfogainLossParameter& default_instance(); + + void Swap(InfogainLossParameter* other); + + // implements Message ---------------------------------------------- + + InfogainLossParameter* New() 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional string source = 1; + inline bool has_source() const; + inline void clear_source(); + static const int kSourceFieldNumber = 1; + inline const ::std::string& source() const; + inline void set_source(const ::std::string& value); + inline void set_source(const char* value); + inline void set_source(const char* value, size_t size); + inline ::std::string* mutable_source(); + inline ::std::string* release_source(); + inline void set_allocated_source(::std::string* source); + + // @@protoc_insertion_point(class_scope:ditcaffe.InfogainLossParameter) + private: + inline void set_has_source(); + inline void clear_has_source(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::std::string* source_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static InfogainLossParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class InnerProductParameter : public ::google::protobuf::Message { + 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 _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const InnerProductParameter& default_instance(); + + void Swap(InnerProductParameter* other); + + // implements Message ---------------------------------------------- + + InnerProductParameter* New() 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional uint32 num_output = 1; + inline bool has_num_output() const; + inline void clear_num_output(); + static const int kNumOutputFieldNumber = 1; + inline ::google::protobuf::uint32 num_output() const; + inline void set_num_output(::google::protobuf::uint32 value); + + // optional bool bias_term = 2 [default = true]; + inline bool has_bias_term() const; + inline void clear_bias_term(); + static const int kBiasTermFieldNumber = 2; + inline bool bias_term() const; + inline void set_bias_term(bool value); + + // optional .ditcaffe.FillerParameter weight_filler = 3; + inline bool has_weight_filler() const; + inline void clear_weight_filler(); + static const int kWeightFillerFieldNumber = 3; + inline const ::ditcaffe::FillerParameter& weight_filler() const; + inline ::ditcaffe::FillerParameter* mutable_weight_filler(); + inline ::ditcaffe::FillerParameter* release_weight_filler(); + inline void set_allocated_weight_filler(::ditcaffe::FillerParameter* weight_filler); + + // optional .ditcaffe.FillerParameter bias_filler = 4; + inline bool has_bias_filler() const; + inline void clear_bias_filler(); + static const int kBiasFillerFieldNumber = 4; + inline const ::ditcaffe::FillerParameter& bias_filler() const; + inline ::ditcaffe::FillerParameter* mutable_bias_filler(); + inline ::ditcaffe::FillerParameter* release_bias_filler(); + inline void set_allocated_bias_filler(::ditcaffe::FillerParameter* bias_filler); + + // optional int32 axis = 5 [default = 1]; + inline bool has_axis() const; + inline void clear_axis(); + static const int kAxisFieldNumber = 5; + inline ::google::protobuf::int32 axis() const; + inline void set_axis(::google::protobuf::int32 value); + + // optional bool transpose = 6 [default = false]; + inline bool has_transpose() const; + inline void clear_transpose(); + static const int kTransposeFieldNumber = 6; + inline bool transpose() const; + inline void set_transpose(bool value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::ditcaffe::FillerParameter* weight_filler_; + ::google::protobuf::uint32 num_output_; + bool bias_term_; + bool transpose_; + ::ditcaffe::FillerParameter* bias_filler_; + ::google::protobuf::int32 axis_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static InnerProductParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class InputParameter : public ::google::protobuf::Message { + 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 _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const InputParameter& default_instance(); + + void Swap(InputParameter* other); + + // implements Message ---------------------------------------------- + + InputParameter* New() 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .ditcaffe.BlobShape shape = 1; + inline int shape_size() const; + inline void clear_shape(); + static const int kShapeFieldNumber = 1; + inline const ::ditcaffe::BlobShape& shape(int index) const; + inline ::ditcaffe::BlobShape* mutable_shape(int index); + inline ::ditcaffe::BlobShape* add_shape(); + inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobShape >& + shape() const; + inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobShape >* + mutable_shape(); + + // @@protoc_insertion_point(class_scope:ditcaffe.InputParameter) + private: + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobShape > shape_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static InputParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class LogParameter : public ::google::protobuf::Message { + 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 _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const LogParameter& default_instance(); + + void Swap(LogParameter* other); + + // implements Message ---------------------------------------------- + + LogParameter* New() 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional float base = 1 [default = -1]; + inline bool has_base() const; + inline void clear_base(); + static const int kBaseFieldNumber = 1; + inline float base() const; + inline void set_base(float value); + + // optional float scale = 2 [default = 1]; + inline bool has_scale() const; + inline void clear_scale(); + static const int kScaleFieldNumber = 2; + inline float scale() const; + inline void set_scale(float value); + + // optional float shift = 3 [default = 0]; + inline bool has_shift() const; + inline void clear_shift(); + static const int kShiftFieldNumber = 3; + inline float shift() const; + inline void set_shift(float value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + float base_; + float scale_; + float shift_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static LogParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class LRNParameter : public ::google::protobuf::Message { + 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 _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const LRNParameter& default_instance(); + + void Swap(LRNParameter* other); + + // implements Message ---------------------------------------------- + + LRNParameter* New() 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + 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]; + inline bool has_local_size() const; + inline void clear_local_size(); + static const int kLocalSizeFieldNumber = 1; + inline ::google::protobuf::uint32 local_size() const; + inline void set_local_size(::google::protobuf::uint32 value); + + // optional float alpha = 2 [default = 1]; + inline bool has_alpha() const; + inline void clear_alpha(); + static const int kAlphaFieldNumber = 2; + inline float alpha() const; + inline void set_alpha(float value); + + // optional float beta = 3 [default = 0.75]; + inline bool has_beta() const; + inline void clear_beta(); + static const int kBetaFieldNumber = 3; + inline float beta() const; + inline void set_beta(float value); + + // optional .ditcaffe.LRNParameter.NormRegion norm_region = 4 [default = ACROSS_CHANNELS]; + inline bool has_norm_region() const; + inline void clear_norm_region(); + static const int kNormRegionFieldNumber = 4; + inline ::ditcaffe::LRNParameter_NormRegion norm_region() const; + inline void set_norm_region(::ditcaffe::LRNParameter_NormRegion value); + + // optional float k = 5 [default = 1]; + inline bool has_k() const; + inline void clear_k(); + static const int kKFieldNumber = 5; + inline float k() const; + inline void set_k(float value); + + // optional .ditcaffe.LRNParameter.Engine engine = 6 [default = DEFAULT]; + inline bool has_engine() const; + inline void clear_engine(); + static const int kEngineFieldNumber = 6; + inline ::ditcaffe::LRNParameter_Engine engine() const; + inline void set_engine(::ditcaffe::LRNParameter_Engine value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::uint32 local_size_; + float alpha_; + float beta_; + int norm_region_; + float k_; + int engine_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static LRNParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class MemoryDataParameter : public ::google::protobuf::Message { + 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 _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const MemoryDataParameter& default_instance(); + + void Swap(MemoryDataParameter* other); + + // implements Message ---------------------------------------------- + + MemoryDataParameter* New() 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional uint32 batch_size = 1; + inline bool has_batch_size() const; + inline void clear_batch_size(); + static const int kBatchSizeFieldNumber = 1; + inline ::google::protobuf::uint32 batch_size() const; + inline void set_batch_size(::google::protobuf::uint32 value); + + // optional uint32 channels = 2; + inline bool has_channels() const; + inline void clear_channels(); + static const int kChannelsFieldNumber = 2; + inline ::google::protobuf::uint32 channels() const; + inline void set_channels(::google::protobuf::uint32 value); + + // optional uint32 height = 3; + inline bool has_height() const; + inline void clear_height(); + static const int kHeightFieldNumber = 3; + inline ::google::protobuf::uint32 height() const; + inline void set_height(::google::protobuf::uint32 value); + + // optional uint32 width = 4; + inline bool has_width() const; + inline void clear_width(); + static const int kWidthFieldNumber = 4; + inline ::google::protobuf::uint32 width() const; + inline void set_width(::google::protobuf::uint32 value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::uint32 batch_size_; + ::google::protobuf::uint32 channels_; + ::google::protobuf::uint32 height_; + ::google::protobuf::uint32 width_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static MemoryDataParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class MVNParameter : public ::google::protobuf::Message { + 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 _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const MVNParameter& default_instance(); + + void Swap(MVNParameter* other); + + // implements Message ---------------------------------------------- + + MVNParameter* New() 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional bool normalize_variance = 1 [default = true]; + inline bool has_normalize_variance() const; + inline void clear_normalize_variance(); + static const int kNormalizeVarianceFieldNumber = 1; + inline bool normalize_variance() const; + inline void set_normalize_variance(bool value); + + // optional bool across_channels = 2 [default = false]; + inline bool has_across_channels() const; + inline void clear_across_channels(); + static const int kAcrossChannelsFieldNumber = 2; + inline bool across_channels() const; + inline void set_across_channels(bool value); + + // optional float eps = 3 [default = 1e-09]; + inline bool has_eps() const; + inline void clear_eps(); + static const int kEpsFieldNumber = 3; + inline float eps() const; + inline void set_eps(float value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + bool normalize_variance_; + bool across_channels_; + float eps_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static MVNParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class ParameterParameter : public ::google::protobuf::Message { + 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 _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const ParameterParameter& default_instance(); + + void Swap(ParameterParameter* other); + + // implements Message ---------------------------------------------- + + ParameterParameter* New() 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional .ditcaffe.BlobShape shape = 1; + inline bool has_shape() const; + inline void clear_shape(); + static const int kShapeFieldNumber = 1; + inline const ::ditcaffe::BlobShape& shape() const; + inline ::ditcaffe::BlobShape* mutable_shape(); + inline ::ditcaffe::BlobShape* release_shape(); + inline void set_allocated_shape(::ditcaffe::BlobShape* shape); + + // @@protoc_insertion_point(class_scope:ditcaffe.ParameterParameter) + private: + inline void set_has_shape(); + inline void clear_has_shape(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::ditcaffe::BlobShape* shape_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static ParameterParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class PoolingParameter : public ::google::protobuf::Message { + 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 _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const PoolingParameter& default_instance(); + + void Swap(PoolingParameter* other); + + // implements Message ---------------------------------------------- + + PoolingParameter* New() 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + 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 .ditcaffe.PoolingParameter.PoolMethod pool = 1 [default = MAX]; + inline bool has_pool() const; + inline void clear_pool(); + static const int kPoolFieldNumber = 1; + inline ::ditcaffe::PoolingParameter_PoolMethod pool() const; + inline void set_pool(::ditcaffe::PoolingParameter_PoolMethod value); + + // optional uint32 pad = 4 [default = 0]; + inline bool has_pad() const; + inline void clear_pad(); + static const int kPadFieldNumber = 4; + inline ::google::protobuf::uint32 pad() const; + inline void set_pad(::google::protobuf::uint32 value); + + // optional uint32 pad_h = 9 [default = 0]; + inline bool has_pad_h() const; + inline void clear_pad_h(); + static const int kPadHFieldNumber = 9; + inline ::google::protobuf::uint32 pad_h() const; + inline void set_pad_h(::google::protobuf::uint32 value); + + // optional uint32 pad_w = 10 [default = 0]; + inline bool has_pad_w() const; + inline void clear_pad_w(); + static const int kPadWFieldNumber = 10; + inline ::google::protobuf::uint32 pad_w() const; + inline void set_pad_w(::google::protobuf::uint32 value); + + // optional uint32 kernel_size = 2; + inline bool has_kernel_size() const; + inline void clear_kernel_size(); + static const int kKernelSizeFieldNumber = 2; + inline ::google::protobuf::uint32 kernel_size() const; + inline void set_kernel_size(::google::protobuf::uint32 value); + + // optional uint32 kernel_h = 5; + inline bool has_kernel_h() const; + inline void clear_kernel_h(); + static const int kKernelHFieldNumber = 5; + inline ::google::protobuf::uint32 kernel_h() const; + inline void set_kernel_h(::google::protobuf::uint32 value); + + // optional uint32 kernel_w = 6; + inline bool has_kernel_w() const; + inline void clear_kernel_w(); + static const int kKernelWFieldNumber = 6; + inline ::google::protobuf::uint32 kernel_w() const; + inline void set_kernel_w(::google::protobuf::uint32 value); + + // optional uint32 stride = 3 [default = 1]; + inline bool has_stride() const; + inline void clear_stride(); + static const int kStrideFieldNumber = 3; + inline ::google::protobuf::uint32 stride() const; + inline void set_stride(::google::protobuf::uint32 value); + + // optional uint32 stride_h = 7; + inline bool has_stride_h() const; + inline void clear_stride_h(); + static const int kStrideHFieldNumber = 7; + inline ::google::protobuf::uint32 stride_h() const; + inline void set_stride_h(::google::protobuf::uint32 value); + + // optional uint32 stride_w = 8; + inline bool has_stride_w() const; + inline void clear_stride_w(); + static const int kStrideWFieldNumber = 8; + inline ::google::protobuf::uint32 stride_w() const; + inline void set_stride_w(::google::protobuf::uint32 value); + + // optional .ditcaffe.PoolingParameter.Engine engine = 11 [default = DEFAULT]; + inline bool has_engine() const; + inline void clear_engine(); + static const int kEngineFieldNumber = 11; + inline ::ditcaffe::PoolingParameter_Engine engine() const; + inline void set_engine(::ditcaffe::PoolingParameter_Engine value); + + // optional bool global_pooling = 12 [default = false]; + inline bool has_global_pooling() const; + inline void clear_global_pooling(); + static const int kGlobalPoolingFieldNumber = 12; + inline bool global_pooling() const; + inline void set_global_pooling(bool value); + + // optional bool torch_pooling = 40 [default = false]; + inline bool has_torch_pooling() const; + inline void clear_torch_pooling(); + static const int kTorchPoolingFieldNumber = 40; + inline bool torch_pooling() const; + inline void set_torch_pooling(bool value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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(); + inline void set_has_torch_pooling(); + inline void clear_has_torch_pooling(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + 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_; + ::google::protobuf::uint32 stride_h_; + ::google::protobuf::uint32 stride_w_; + int engine_; + bool global_pooling_; + bool torch_pooling_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static PoolingParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class PowerParameter : public ::google::protobuf::Message { + 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 _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const PowerParameter& default_instance(); + + void Swap(PowerParameter* other); + + // implements Message ---------------------------------------------- + + PowerParameter* New() 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional float power = 1 [default = 1]; + inline bool has_power() const; + inline void clear_power(); + static const int kPowerFieldNumber = 1; + inline float power() const; + inline void set_power(float value); + + // optional float scale = 2 [default = 1]; + inline bool has_scale() const; + inline void clear_scale(); + static const int kScaleFieldNumber = 2; + inline float scale() const; + inline void set_scale(float value); + + // optional float shift = 3 [default = 0]; + inline bool has_shift() const; + inline void clear_shift(); + static const int kShiftFieldNumber = 3; + inline float shift() const; + inline void set_shift(float value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + float power_; + float scale_; + float shift_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static PowerParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class PythonParameter : public ::google::protobuf::Message { + 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 _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const PythonParameter& default_instance(); + + void Swap(PythonParameter* other); + + // implements Message ---------------------------------------------- + + PythonParameter* New() 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional string module = 1; + inline bool has_module() const; + inline void clear_module(); + static const int kModuleFieldNumber = 1; + inline const ::std::string& module() const; + inline void set_module(const ::std::string& value); + inline void set_module(const char* value); + inline void set_module(const char* value, size_t size); + inline ::std::string* mutable_module(); + inline ::std::string* release_module(); + inline void set_allocated_module(::std::string* module); + + // optional string layer = 2; + inline bool has_layer() const; + inline void clear_layer(); + static const int kLayerFieldNumber = 2; + inline const ::std::string& layer() const; + inline void set_layer(const ::std::string& value); + inline void set_layer(const char* value); + inline void set_layer(const char* value, size_t size); + inline ::std::string* mutable_layer(); + inline ::std::string* release_layer(); + inline void set_allocated_layer(::std::string* layer); + + // optional string param_str = 3 [default = ""]; + inline bool has_param_str() const; + inline void clear_param_str(); + static const int kParamStrFieldNumber = 3; + inline const ::std::string& param_str() const; + inline void set_param_str(const ::std::string& value); + inline void set_param_str(const char* value); + inline void set_param_str(const char* value, size_t size); + inline ::std::string* mutable_param_str(); + inline ::std::string* release_param_str(); + inline void set_allocated_param_str(::std::string* param_str); + + // optional bool share_in_parallel = 4 [default = false]; + inline bool has_share_in_parallel() const; + inline void clear_share_in_parallel(); + static const int kShareInParallelFieldNumber = 4; + inline bool share_in_parallel() const; + inline void set_share_in_parallel(bool value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::std::string* module_; + ::std::string* layer_; + ::std::string* param_str_; + bool share_in_parallel_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static PythonParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class ReductionParameter : public ::google::protobuf::Message { + 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 _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const ReductionParameter& default_instance(); + + void Swap(ReductionParameter* other); + + // implements Message ---------------------------------------------- + + ReductionParameter* New() 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + 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 .ditcaffe.ReductionParameter.ReductionOp operation = 1 [default = SUM]; + inline bool has_operation() const; + inline void clear_operation(); + static const int kOperationFieldNumber = 1; + inline ::ditcaffe::ReductionParameter_ReductionOp operation() const; + inline void set_operation(::ditcaffe::ReductionParameter_ReductionOp value); + + // optional int32 axis = 2 [default = 0]; + inline bool has_axis() const; + inline void clear_axis(); + static const int kAxisFieldNumber = 2; + inline ::google::protobuf::int32 axis() const; + inline void set_axis(::google::protobuf::int32 value); + + // optional float coeff = 3 [default = 1]; + inline bool has_coeff() const; + inline void clear_coeff(); + static const int kCoeffFieldNumber = 3; + inline float coeff() const; + inline void set_coeff(float value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + int operation_; + ::google::protobuf::int32 axis_; + float coeff_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static ReductionParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class ReLUParameter : public ::google::protobuf::Message { + 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 _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const ReLUParameter& default_instance(); + + void Swap(ReLUParameter* other); + + // implements Message ---------------------------------------------- + + ReLUParameter* New() 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + 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]; + inline bool has_negative_slope() const; + inline void clear_negative_slope(); + static const int kNegativeSlopeFieldNumber = 1; + inline float negative_slope() const; + inline void set_negative_slope(float value); + + // optional .ditcaffe.ReLUParameter.Engine engine = 2 [default = DEFAULT]; + inline bool has_engine() const; + inline void clear_engine(); + static const int kEngineFieldNumber = 2; + inline ::ditcaffe::ReLUParameter_Engine engine() const; + inline void set_engine(::ditcaffe::ReLUParameter_Engine value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + float negative_slope_; + int engine_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static ReLUParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class ReshapeParameter : public ::google::protobuf::Message { + 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 _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const ReshapeParameter& default_instance(); + + void Swap(ReshapeParameter* other); + + // implements Message ---------------------------------------------- + + ReshapeParameter* New() 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional .ditcaffe.BlobShape shape = 1; + inline bool has_shape() const; + inline void clear_shape(); + static const int kShapeFieldNumber = 1; + inline const ::ditcaffe::BlobShape& shape() const; + inline ::ditcaffe::BlobShape* mutable_shape(); + inline ::ditcaffe::BlobShape* release_shape(); + inline void set_allocated_shape(::ditcaffe::BlobShape* shape); + + // optional int32 axis = 2 [default = 0]; + inline bool has_axis() const; + inline void clear_axis(); + static const int kAxisFieldNumber = 2; + inline ::google::protobuf::int32 axis() const; + inline void set_axis(::google::protobuf::int32 value); + + // optional int32 num_axes = 3 [default = -1]; + inline bool has_num_axes() const; + inline void clear_num_axes(); + static const int kNumAxesFieldNumber = 3; + inline ::google::protobuf::int32 num_axes() const; + inline void set_num_axes(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::ditcaffe::BlobShape* shape_; + ::google::protobuf::int32 axis_; + ::google::protobuf::int32 num_axes_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static ReshapeParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class ScaleParameter : public ::google::protobuf::Message { + 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 _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const ScaleParameter& default_instance(); + + void Swap(ScaleParameter* other); + + // implements Message ---------------------------------------------- + + ScaleParameter* New() 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional int32 axis = 1 [default = 1]; + inline bool has_axis() const; + inline void clear_axis(); + static const int kAxisFieldNumber = 1; + inline ::google::protobuf::int32 axis() const; + inline void set_axis(::google::protobuf::int32 value); + + // optional int32 num_axes = 2 [default = 1]; + inline bool has_num_axes() const; + inline void clear_num_axes(); + static const int kNumAxesFieldNumber = 2; + inline ::google::protobuf::int32 num_axes() const; + inline void set_num_axes(::google::protobuf::int32 value); + + // optional .ditcaffe.FillerParameter filler = 3; + inline bool has_filler() const; + inline void clear_filler(); + static const int kFillerFieldNumber = 3; + inline const ::ditcaffe::FillerParameter& filler() const; + inline ::ditcaffe::FillerParameter* mutable_filler(); + inline ::ditcaffe::FillerParameter* release_filler(); + inline void set_allocated_filler(::ditcaffe::FillerParameter* filler); + + // optional bool bias_term = 4 [default = false]; + inline bool has_bias_term() const; + inline void clear_bias_term(); + static const int kBiasTermFieldNumber = 4; + inline bool bias_term() const; + inline void set_bias_term(bool value); + + // optional .ditcaffe.FillerParameter bias_filler = 5; + inline bool has_bias_filler() const; + inline void clear_bias_filler(); + static const int kBiasFillerFieldNumber = 5; + inline const ::ditcaffe::FillerParameter& bias_filler() const; + inline ::ditcaffe::FillerParameter* mutable_bias_filler(); + inline ::ditcaffe::FillerParameter* release_bias_filler(); + inline void set_allocated_bias_filler(::ditcaffe::FillerParameter* bias_filler); + + // @@protoc_insertion_point(class_scope:ditcaffe.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::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::int32 axis_; + ::google::protobuf::int32 num_axes_; + ::ditcaffe::FillerParameter* filler_; + ::ditcaffe::FillerParameter* bias_filler_; + bool bias_term_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static ScaleParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class SigmoidParameter : public ::google::protobuf::Message { + 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 _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const SigmoidParameter& default_instance(); + + void Swap(SigmoidParameter* other); + + // implements Message ---------------------------------------------- + + SigmoidParameter* New() 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + 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 .ditcaffe.SigmoidParameter.Engine engine = 1 [default = DEFAULT]; + inline bool has_engine() const; + inline void clear_engine(); + static const int kEngineFieldNumber = 1; + inline ::ditcaffe::SigmoidParameter_Engine engine() const; + inline void set_engine(::ditcaffe::SigmoidParameter_Engine value); + + // @@protoc_insertion_point(class_scope:ditcaffe.SigmoidParameter) + private: + inline void set_has_engine(); + inline void clear_has_engine(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + int engine_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static SigmoidParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class SliceParameter : public ::google::protobuf::Message { + 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 _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const SliceParameter& default_instance(); + + void Swap(SliceParameter* other); + + // implements Message ---------------------------------------------- + + SliceParameter* New() 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional int32 axis = 3 [default = 1]; + inline bool has_axis() const; + inline void clear_axis(); + static const int kAxisFieldNumber = 3; + inline ::google::protobuf::int32 axis() const; + inline void set_axis(::google::protobuf::int32 value); + + // repeated uint32 slice_point = 2; + inline int slice_point_size() const; + inline void clear_slice_point(); + static const int kSlicePointFieldNumber = 2; + inline ::google::protobuf::uint32 slice_point(int index) const; + inline void set_slice_point(int index, ::google::protobuf::uint32 value); + inline void add_slice_point(::google::protobuf::uint32 value); + inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& + slice_point() const; + inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* + mutable_slice_point(); + + // optional uint32 slice_dim = 1 [default = 1]; + inline bool has_slice_dim() const; + inline void clear_slice_dim(); + static const int kSliceDimFieldNumber = 1; + inline ::google::protobuf::uint32 slice_dim() const; + inline void set_slice_dim(::google::protobuf::uint32 value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > slice_point_; + ::google::protobuf::int32 axis_; + ::google::protobuf::uint32 slice_dim_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static SliceParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class SoftmaxParameter : public ::google::protobuf::Message { + 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 _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const SoftmaxParameter& default_instance(); + + void Swap(SoftmaxParameter* other); + + // implements Message ---------------------------------------------- + + SoftmaxParameter* New() 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + 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 .ditcaffe.SoftmaxParameter.Engine engine = 1 [default = DEFAULT]; + inline bool has_engine() const; + inline void clear_engine(); + static const int kEngineFieldNumber = 1; + inline ::ditcaffe::SoftmaxParameter_Engine engine() const; + inline void set_engine(::ditcaffe::SoftmaxParameter_Engine value); + + // optional int32 axis = 2 [default = 1]; + inline bool has_axis() const; + inline void clear_axis(); + static const int kAxisFieldNumber = 2; + inline ::google::protobuf::int32 axis() const; + inline void set_axis(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:ditcaffe.SoftmaxParameter) + private: + inline void set_has_engine(); + inline void clear_has_engine(); + inline void set_has_axis(); + inline void clear_has_axis(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + int engine_; + ::google::protobuf::int32 axis_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static SoftmaxParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class TanHParameter : public ::google::protobuf::Message { + 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 _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const TanHParameter& default_instance(); + + void Swap(TanHParameter* other); + + // implements Message ---------------------------------------------- + + TanHParameter* New() 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + 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 .ditcaffe.TanHParameter.Engine engine = 1 [default = DEFAULT]; + inline bool has_engine() const; + inline void clear_engine(); + static const int kEngineFieldNumber = 1; + inline ::ditcaffe::TanHParameter_Engine engine() const; + inline void set_engine(::ditcaffe::TanHParameter_Engine value); + + // @@protoc_insertion_point(class_scope:ditcaffe.TanHParameter) + private: + inline void set_has_engine(); + inline void clear_has_engine(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + int engine_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static TanHParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class TileParameter : public ::google::protobuf::Message { + 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 _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const TileParameter& default_instance(); + + void Swap(TileParameter* other); + + // implements Message ---------------------------------------------- + + TileParameter* New() 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional int32 axis = 1 [default = 1]; + inline bool has_axis() const; + inline void clear_axis(); + static const int kAxisFieldNumber = 1; + inline ::google::protobuf::int32 axis() const; + inline void set_axis(::google::protobuf::int32 value); + + // optional int32 tiles = 2; + inline bool has_tiles() const; + inline void clear_tiles(); + static const int kTilesFieldNumber = 2; + inline ::google::protobuf::int32 tiles() const; + inline void set_tiles(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:ditcaffe.TileParameter) + private: + inline void set_has_axis(); + inline void clear_has_axis(); + inline void set_has_tiles(); + inline void clear_has_tiles(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::int32 axis_; + ::google::protobuf::int32 tiles_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static TileParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class ThresholdParameter : public ::google::protobuf::Message { + 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 _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const ThresholdParameter& default_instance(); + + void Swap(ThresholdParameter* other); + + // implements Message ---------------------------------------------- + + ThresholdParameter* New() 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional float threshold = 1 [default = 0]; + inline bool has_threshold() const; + inline void clear_threshold(); + static const int kThresholdFieldNumber = 1; + inline float threshold() const; + inline void set_threshold(float value); + + // @@protoc_insertion_point(class_scope:ditcaffe.ThresholdParameter) + private: + inline void set_has_threshold(); + inline void clear_has_threshold(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + float threshold_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static ThresholdParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class WindowDataParameter : public ::google::protobuf::Message { + 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 _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const WindowDataParameter& default_instance(); + + void Swap(WindowDataParameter* other); + + // implements Message ---------------------------------------------- + + WindowDataParameter* New() 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional string source = 1; + inline bool has_source() const; + inline void clear_source(); + static const int kSourceFieldNumber = 1; + inline const ::std::string& source() const; + inline void set_source(const ::std::string& value); + inline void set_source(const char* value); + inline void set_source(const char* value, size_t size); + inline ::std::string* mutable_source(); + inline ::std::string* release_source(); + inline void set_allocated_source(::std::string* source); + + // optional float scale = 2 [default = 1]; + inline bool has_scale() const; + inline void clear_scale(); + static const int kScaleFieldNumber = 2; + inline float scale() const; + inline void set_scale(float value); + + // optional string mean_file = 3; + inline bool has_mean_file() const; + inline void clear_mean_file(); + static const int kMeanFileFieldNumber = 3; + inline const ::std::string& mean_file() const; + inline void set_mean_file(const ::std::string& value); + inline void set_mean_file(const char* value); + inline void set_mean_file(const char* value, size_t size); + inline ::std::string* mutable_mean_file(); + inline ::std::string* release_mean_file(); + inline void set_allocated_mean_file(::std::string* mean_file); + + // optional uint32 batch_size = 4; + inline bool has_batch_size() const; + inline void clear_batch_size(); + static const int kBatchSizeFieldNumber = 4; + inline ::google::protobuf::uint32 batch_size() const; + inline void set_batch_size(::google::protobuf::uint32 value); + + // optional uint32 crop_size = 5 [default = 0]; + inline bool has_crop_size() const; + inline void clear_crop_size(); + static const int kCropSizeFieldNumber = 5; + inline ::google::protobuf::uint32 crop_size() const; + inline void set_crop_size(::google::protobuf::uint32 value); + + // optional bool mirror = 6 [default = false]; + inline bool has_mirror() const; + inline void clear_mirror(); + static const int kMirrorFieldNumber = 6; + inline bool mirror() const; + inline void set_mirror(bool value); + + // optional float fg_threshold = 7 [default = 0.5]; + inline bool has_fg_threshold() const; + inline void clear_fg_threshold(); + static const int kFgThresholdFieldNumber = 7; + inline float fg_threshold() const; + inline void set_fg_threshold(float value); + + // optional float bg_threshold = 8 [default = 0.5]; + inline bool has_bg_threshold() const; + inline void clear_bg_threshold(); + static const int kBgThresholdFieldNumber = 8; + inline float bg_threshold() const; + inline void set_bg_threshold(float value); + + // optional float fg_fraction = 9 [default = 0.25]; + inline bool has_fg_fraction() const; + inline void clear_fg_fraction(); + static const int kFgFractionFieldNumber = 9; + inline float fg_fraction() const; + inline void set_fg_fraction(float value); + + // optional uint32 context_pad = 10 [default = 0]; + inline bool has_context_pad() const; + inline void clear_context_pad(); + static const int kContextPadFieldNumber = 10; + inline ::google::protobuf::uint32 context_pad() const; + inline void set_context_pad(::google::protobuf::uint32 value); + + // optional string crop_mode = 11 [default = "warp"]; + inline bool has_crop_mode() const; + inline void clear_crop_mode(); + static const int kCropModeFieldNumber = 11; + inline const ::std::string& crop_mode() const; + inline void set_crop_mode(const ::std::string& value); + inline void set_crop_mode(const char* value); + inline void set_crop_mode(const char* value, size_t size); + inline ::std::string* mutable_crop_mode(); + inline ::std::string* release_crop_mode(); + inline void set_allocated_crop_mode(::std::string* crop_mode); + + // optional bool cache_images = 12 [default = false]; + inline bool has_cache_images() const; + inline void clear_cache_images(); + static const int kCacheImagesFieldNumber = 12; + inline bool cache_images() const; + inline void set_cache_images(bool value); + + // optional string root_folder = 13 [default = ""]; + inline bool has_root_folder() const; + inline void clear_root_folder(); + static const int kRootFolderFieldNumber = 13; + inline const ::std::string& root_folder() const; + inline void set_root_folder(const ::std::string& value); + inline void set_root_folder(const char* value); + inline void set_root_folder(const char* value, size_t size); + inline ::std::string* mutable_root_folder(); + inline ::std::string* release_root_folder(); + inline void set_allocated_root_folder(::std::string* root_folder); + + // @@protoc_insertion_point(class_scope:ditcaffe.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::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::std::string* source_; + ::std::string* mean_file_; + float scale_; + ::google::protobuf::uint32 batch_size_; + ::google::protobuf::uint32 crop_size_; + float fg_threshold_; + float bg_threshold_; + float fg_fraction_; + bool mirror_; + bool cache_images_; + ::google::protobuf::uint32 context_pad_; + static ::std::string* _default_crop_mode_; + ::std::string* crop_mode_; + ::std::string* root_folder_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static WindowDataParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class SPPParameter : public ::google::protobuf::Message { + 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 _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const SPPParameter& default_instance(); + + void Swap(SPPParameter* other); + + // implements Message ---------------------------------------------- + + SPPParameter* New() 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + 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; + inline bool has_pyramid_height() const; + inline void clear_pyramid_height(); + static const int kPyramidHeightFieldNumber = 1; + inline ::google::protobuf::uint32 pyramid_height() const; + inline void set_pyramid_height(::google::protobuf::uint32 value); + + // optional .ditcaffe.SPPParameter.PoolMethod pool = 2 [default = MAX]; + inline bool has_pool() const; + inline void clear_pool(); + static const int kPoolFieldNumber = 2; + inline ::ditcaffe::SPPParameter_PoolMethod pool() const; + inline void set_pool(::ditcaffe::SPPParameter_PoolMethod value); + + // optional .ditcaffe.SPPParameter.Engine engine = 6 [default = DEFAULT]; + inline bool has_engine() const; + inline void clear_engine(); + static const int kEngineFieldNumber = 6; + inline ::ditcaffe::SPPParameter_Engine engine() const; + inline void set_engine(::ditcaffe::SPPParameter_Engine value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::uint32 pyramid_height_; + int pool_; + int engine_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static SPPParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class V1LayerParameter : public ::google::protobuf::Message { + 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 _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const V1LayerParameter& default_instance(); + + void Swap(V1LayerParameter* other); + + // implements Message ---------------------------------------------- + + V1LayerParameter* New() 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + 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; + inline int bottom_size() const; + inline void clear_bottom(); + static const int kBottomFieldNumber = 2; + inline const ::std::string& bottom(int index) const; + inline ::std::string* mutable_bottom(int index); + inline void set_bottom(int index, const ::std::string& value); + inline void set_bottom(int index, const char* value); + inline void set_bottom(int index, const char* value, size_t size); + inline ::std::string* add_bottom(); + inline void add_bottom(const ::std::string& value); + inline void add_bottom(const char* value); + inline void add_bottom(const char* value, size_t size); + inline const ::google::protobuf::RepeatedPtrField< ::std::string>& bottom() const; + inline ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_bottom(); + + // repeated string top = 3; + inline int top_size() const; + inline void clear_top(); + static const int kTopFieldNumber = 3; + inline const ::std::string& top(int index) const; + inline ::std::string* mutable_top(int index); + inline void set_top(int index, const ::std::string& value); + inline void set_top(int index, const char* value); + inline void set_top(int index, const char* value, size_t size); + inline ::std::string* add_top(); + inline void add_top(const ::std::string& value); + inline void add_top(const char* value); + inline void add_top(const char* value, size_t size); + inline const ::google::protobuf::RepeatedPtrField< ::std::string>& top() const; + inline ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_top(); + + // optional string name = 4; + inline bool has_name() const; + inline void clear_name(); + static const int kNameFieldNumber = 4; + inline const ::std::string& name() const; + inline void set_name(const ::std::string& value); + inline void set_name(const char* value); + inline void set_name(const char* value, size_t size); + inline ::std::string* mutable_name(); + inline ::std::string* release_name(); + inline void set_allocated_name(::std::string* name); + + // repeated .ditcaffe.NetStateRule include = 32; + inline int include_size() const; + inline void clear_include(); + static const int kIncludeFieldNumber = 32; + inline const ::ditcaffe::NetStateRule& include(int index) const; + inline ::ditcaffe::NetStateRule* mutable_include(int index); + inline ::ditcaffe::NetStateRule* add_include(); + inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >& + include() const; + inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >* + mutable_include(); + + // repeated .ditcaffe.NetStateRule exclude = 33; + inline int exclude_size() const; + inline void clear_exclude(); + static const int kExcludeFieldNumber = 33; + inline const ::ditcaffe::NetStateRule& exclude(int index) const; + inline ::ditcaffe::NetStateRule* mutable_exclude(int index); + inline ::ditcaffe::NetStateRule* add_exclude(); + inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >& + exclude() const; + inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >* + mutable_exclude(); + + // optional .ditcaffe.V1LayerParameter.LayerType type = 5; + inline bool has_type() const; + inline void clear_type(); + static const int kTypeFieldNumber = 5; + inline ::ditcaffe::V1LayerParameter_LayerType type() const; + inline void set_type(::ditcaffe::V1LayerParameter_LayerType value); + + // repeated .ditcaffe.BlobProto blobs = 6; + inline int blobs_size() const; + inline void clear_blobs(); + static const int kBlobsFieldNumber = 6; + inline const ::ditcaffe::BlobProto& blobs(int index) const; + inline ::ditcaffe::BlobProto* mutable_blobs(int index); + inline ::ditcaffe::BlobProto* add_blobs(); + inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >& + blobs() const; + inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >* + mutable_blobs(); + + // repeated string param = 1001; + inline int param_size() const; + inline void clear_param(); + static const int kParamFieldNumber = 1001; + inline const ::std::string& param(int index) const; + inline ::std::string* mutable_param(int index); + inline void set_param(int index, const ::std::string& value); + inline void set_param(int index, const char* value); + inline void set_param(int index, const char* value, size_t size); + inline ::std::string* add_param(); + inline void add_param(const ::std::string& value); + inline void add_param(const char* value); + inline void add_param(const char* value, size_t size); + inline const ::google::protobuf::RepeatedPtrField< ::std::string>& param() const; + inline ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_param(); + + // repeated .ditcaffe.V1LayerParameter.DimCheckMode blob_share_mode = 1002; + inline int blob_share_mode_size() const; + inline void clear_blob_share_mode(); + static const int kBlobShareModeFieldNumber = 1002; + inline ::ditcaffe::V1LayerParameter_DimCheckMode blob_share_mode(int index) const; + inline void set_blob_share_mode(int index, ::ditcaffe::V1LayerParameter_DimCheckMode value); + inline void add_blob_share_mode(::ditcaffe::V1LayerParameter_DimCheckMode value); + inline const ::google::protobuf::RepeatedField& blob_share_mode() const; + inline ::google::protobuf::RepeatedField* mutable_blob_share_mode(); + + // repeated float blobs_lr = 7; + inline int blobs_lr_size() const; + inline void clear_blobs_lr(); + static const int kBlobsLrFieldNumber = 7; + inline float blobs_lr(int index) const; + inline void set_blobs_lr(int index, float value); + inline void add_blobs_lr(float value); + inline const ::google::protobuf::RepeatedField< float >& + blobs_lr() const; + inline ::google::protobuf::RepeatedField< float >* + mutable_blobs_lr(); + + // repeated float weight_decay = 8; + inline int weight_decay_size() const; + inline void clear_weight_decay(); + static const int kWeightDecayFieldNumber = 8; + inline float weight_decay(int index) const; + inline void set_weight_decay(int index, float value); + inline void add_weight_decay(float value); + inline const ::google::protobuf::RepeatedField< float >& + weight_decay() const; + inline ::google::protobuf::RepeatedField< float >* + mutable_weight_decay(); + + // repeated float loss_weight = 35; + inline int loss_weight_size() const; + inline void clear_loss_weight(); + static const int kLossWeightFieldNumber = 35; + inline float loss_weight(int index) const; + inline void set_loss_weight(int index, float value); + inline void add_loss_weight(float value); + inline const ::google::protobuf::RepeatedField< float >& + loss_weight() const; + inline ::google::protobuf::RepeatedField< float >* + mutable_loss_weight(); + + // optional .ditcaffe.AccuracyParameter accuracy_param = 27; + inline bool has_accuracy_param() const; + inline void clear_accuracy_param(); + static const int kAccuracyParamFieldNumber = 27; + inline const ::ditcaffe::AccuracyParameter& accuracy_param() const; + inline ::ditcaffe::AccuracyParameter* mutable_accuracy_param(); + inline ::ditcaffe::AccuracyParameter* release_accuracy_param(); + inline void set_allocated_accuracy_param(::ditcaffe::AccuracyParameter* accuracy_param); + + // optional .ditcaffe.ArgMaxParameter argmax_param = 23; + inline bool has_argmax_param() const; + inline void clear_argmax_param(); + static const int kArgmaxParamFieldNumber = 23; + inline const ::ditcaffe::ArgMaxParameter& argmax_param() const; + inline ::ditcaffe::ArgMaxParameter* mutable_argmax_param(); + inline ::ditcaffe::ArgMaxParameter* release_argmax_param(); + inline void set_allocated_argmax_param(::ditcaffe::ArgMaxParameter* argmax_param); + + // optional .ditcaffe.ConcatParameter concat_param = 9; + inline bool has_concat_param() const; + inline void clear_concat_param(); + static const int kConcatParamFieldNumber = 9; + inline const ::ditcaffe::ConcatParameter& concat_param() const; + inline ::ditcaffe::ConcatParameter* mutable_concat_param(); + inline ::ditcaffe::ConcatParameter* release_concat_param(); + inline void set_allocated_concat_param(::ditcaffe::ConcatParameter* concat_param); + + // optional .ditcaffe.ContrastiveLossParameter contrastive_loss_param = 40; + inline bool has_contrastive_loss_param() const; + inline void clear_contrastive_loss_param(); + static const int kContrastiveLossParamFieldNumber = 40; + inline const ::ditcaffe::ContrastiveLossParameter& contrastive_loss_param() const; + inline ::ditcaffe::ContrastiveLossParameter* mutable_contrastive_loss_param(); + inline ::ditcaffe::ContrastiveLossParameter* release_contrastive_loss_param(); + inline void set_allocated_contrastive_loss_param(::ditcaffe::ContrastiveLossParameter* contrastive_loss_param); + + // optional .ditcaffe.ConvolutionParameter convolution_param = 10; + inline bool has_convolution_param() const; + inline void clear_convolution_param(); + static const int kConvolutionParamFieldNumber = 10; + inline const ::ditcaffe::ConvolutionParameter& convolution_param() const; + inline ::ditcaffe::ConvolutionParameter* mutable_convolution_param(); + inline ::ditcaffe::ConvolutionParameter* release_convolution_param(); + inline void set_allocated_convolution_param(::ditcaffe::ConvolutionParameter* convolution_param); + + // optional .ditcaffe.DataParameter data_param = 11; + inline bool has_data_param() const; + inline void clear_data_param(); + static const int kDataParamFieldNumber = 11; + inline const ::ditcaffe::DataParameter& data_param() const; + inline ::ditcaffe::DataParameter* mutable_data_param(); + inline ::ditcaffe::DataParameter* release_data_param(); + inline void set_allocated_data_param(::ditcaffe::DataParameter* data_param); + + // optional .ditcaffe.DropoutParameter dropout_param = 12; + inline bool has_dropout_param() const; + inline void clear_dropout_param(); + static const int kDropoutParamFieldNumber = 12; + inline const ::ditcaffe::DropoutParameter& dropout_param() const; + inline ::ditcaffe::DropoutParameter* mutable_dropout_param(); + inline ::ditcaffe::DropoutParameter* release_dropout_param(); + inline void set_allocated_dropout_param(::ditcaffe::DropoutParameter* dropout_param); + + // optional .ditcaffe.DummyDataParameter dummy_data_param = 26; + inline bool has_dummy_data_param() const; + inline void clear_dummy_data_param(); + static const int kDummyDataParamFieldNumber = 26; + inline const ::ditcaffe::DummyDataParameter& dummy_data_param() const; + inline ::ditcaffe::DummyDataParameter* mutable_dummy_data_param(); + inline ::ditcaffe::DummyDataParameter* release_dummy_data_param(); + inline void set_allocated_dummy_data_param(::ditcaffe::DummyDataParameter* dummy_data_param); + + // optional .ditcaffe.EltwiseParameter eltwise_param = 24; + inline bool has_eltwise_param() const; + inline void clear_eltwise_param(); + static const int kEltwiseParamFieldNumber = 24; + inline const ::ditcaffe::EltwiseParameter& eltwise_param() const; + inline ::ditcaffe::EltwiseParameter* mutable_eltwise_param(); + inline ::ditcaffe::EltwiseParameter* release_eltwise_param(); + inline void set_allocated_eltwise_param(::ditcaffe::EltwiseParameter* eltwise_param); + + // optional .ditcaffe.ExpParameter exp_param = 41; + inline bool has_exp_param() const; + inline void clear_exp_param(); + static const int kExpParamFieldNumber = 41; + inline const ::ditcaffe::ExpParameter& exp_param() const; + inline ::ditcaffe::ExpParameter* mutable_exp_param(); + inline ::ditcaffe::ExpParameter* release_exp_param(); + inline void set_allocated_exp_param(::ditcaffe::ExpParameter* exp_param); + + // optional .ditcaffe.HDF5DataParameter hdf5_data_param = 13; + inline bool has_hdf5_data_param() const; + inline void clear_hdf5_data_param(); + static const int kHdf5DataParamFieldNumber = 13; + inline const ::ditcaffe::HDF5DataParameter& hdf5_data_param() const; + inline ::ditcaffe::HDF5DataParameter* mutable_hdf5_data_param(); + inline ::ditcaffe::HDF5DataParameter* release_hdf5_data_param(); + inline void set_allocated_hdf5_data_param(::ditcaffe::HDF5DataParameter* hdf5_data_param); + + // optional .ditcaffe.HDF5OutputParameter hdf5_output_param = 14; + inline bool has_hdf5_output_param() const; + inline void clear_hdf5_output_param(); + static const int kHdf5OutputParamFieldNumber = 14; + inline const ::ditcaffe::HDF5OutputParameter& hdf5_output_param() const; + inline ::ditcaffe::HDF5OutputParameter* mutable_hdf5_output_param(); + inline ::ditcaffe::HDF5OutputParameter* release_hdf5_output_param(); + inline void set_allocated_hdf5_output_param(::ditcaffe::HDF5OutputParameter* hdf5_output_param); + + // optional .ditcaffe.HingeLossParameter hinge_loss_param = 29; + inline bool has_hinge_loss_param() const; + inline void clear_hinge_loss_param(); + static const int kHingeLossParamFieldNumber = 29; + inline const ::ditcaffe::HingeLossParameter& hinge_loss_param() const; + inline ::ditcaffe::HingeLossParameter* mutable_hinge_loss_param(); + inline ::ditcaffe::HingeLossParameter* release_hinge_loss_param(); + inline void set_allocated_hinge_loss_param(::ditcaffe::HingeLossParameter* hinge_loss_param); + + // optional .ditcaffe.ImageDataParameter image_data_param = 15; + inline bool has_image_data_param() const; + inline void clear_image_data_param(); + static const int kImageDataParamFieldNumber = 15; + inline const ::ditcaffe::ImageDataParameter& image_data_param() const; + inline ::ditcaffe::ImageDataParameter* mutable_image_data_param(); + inline ::ditcaffe::ImageDataParameter* release_image_data_param(); + inline void set_allocated_image_data_param(::ditcaffe::ImageDataParameter* image_data_param); + + // optional .ditcaffe.InfogainLossParameter infogain_loss_param = 16; + inline bool has_infogain_loss_param() const; + inline void clear_infogain_loss_param(); + static const int kInfogainLossParamFieldNumber = 16; + inline const ::ditcaffe::InfogainLossParameter& infogain_loss_param() const; + inline ::ditcaffe::InfogainLossParameter* mutable_infogain_loss_param(); + inline ::ditcaffe::InfogainLossParameter* release_infogain_loss_param(); + inline void set_allocated_infogain_loss_param(::ditcaffe::InfogainLossParameter* infogain_loss_param); + + // optional .ditcaffe.InnerProductParameter inner_product_param = 17; + inline bool has_inner_product_param() const; + inline void clear_inner_product_param(); + static const int kInnerProductParamFieldNumber = 17; + inline const ::ditcaffe::InnerProductParameter& inner_product_param() const; + inline ::ditcaffe::InnerProductParameter* mutable_inner_product_param(); + inline ::ditcaffe::InnerProductParameter* release_inner_product_param(); + inline void set_allocated_inner_product_param(::ditcaffe::InnerProductParameter* inner_product_param); + + // optional .ditcaffe.LRNParameter lrn_param = 18; + inline bool has_lrn_param() const; + inline void clear_lrn_param(); + static const int kLrnParamFieldNumber = 18; + inline const ::ditcaffe::LRNParameter& lrn_param() const; + inline ::ditcaffe::LRNParameter* mutable_lrn_param(); + inline ::ditcaffe::LRNParameter* release_lrn_param(); + inline void set_allocated_lrn_param(::ditcaffe::LRNParameter* lrn_param); + + // optional .ditcaffe.MemoryDataParameter memory_data_param = 22; + inline bool has_memory_data_param() const; + inline void clear_memory_data_param(); + static const int kMemoryDataParamFieldNumber = 22; + inline const ::ditcaffe::MemoryDataParameter& memory_data_param() const; + inline ::ditcaffe::MemoryDataParameter* mutable_memory_data_param(); + inline ::ditcaffe::MemoryDataParameter* release_memory_data_param(); + inline void set_allocated_memory_data_param(::ditcaffe::MemoryDataParameter* memory_data_param); + + // optional .ditcaffe.MVNParameter mvn_param = 34; + inline bool has_mvn_param() const; + inline void clear_mvn_param(); + static const int kMvnParamFieldNumber = 34; + inline const ::ditcaffe::MVNParameter& mvn_param() const; + inline ::ditcaffe::MVNParameter* mutable_mvn_param(); + inline ::ditcaffe::MVNParameter* release_mvn_param(); + inline void set_allocated_mvn_param(::ditcaffe::MVNParameter* mvn_param); + + // optional .ditcaffe.PoolingParameter pooling_param = 19; + inline bool has_pooling_param() const; + inline void clear_pooling_param(); + static const int kPoolingParamFieldNumber = 19; + inline const ::ditcaffe::PoolingParameter& pooling_param() const; + inline ::ditcaffe::PoolingParameter* mutable_pooling_param(); + inline ::ditcaffe::PoolingParameter* release_pooling_param(); + inline void set_allocated_pooling_param(::ditcaffe::PoolingParameter* pooling_param); + + // optional .ditcaffe.PowerParameter power_param = 21; + inline bool has_power_param() const; + inline void clear_power_param(); + static const int kPowerParamFieldNumber = 21; + inline const ::ditcaffe::PowerParameter& power_param() const; + inline ::ditcaffe::PowerParameter* mutable_power_param(); + inline ::ditcaffe::PowerParameter* release_power_param(); + inline void set_allocated_power_param(::ditcaffe::PowerParameter* power_param); + + // optional .ditcaffe.ReLUParameter relu_param = 30; + inline bool has_relu_param() const; + inline void clear_relu_param(); + static const int kReluParamFieldNumber = 30; + inline const ::ditcaffe::ReLUParameter& relu_param() const; + inline ::ditcaffe::ReLUParameter* mutable_relu_param(); + inline ::ditcaffe::ReLUParameter* release_relu_param(); + inline void set_allocated_relu_param(::ditcaffe::ReLUParameter* relu_param); + + // optional .ditcaffe.SigmoidParameter sigmoid_param = 38; + inline bool has_sigmoid_param() const; + inline void clear_sigmoid_param(); + static const int kSigmoidParamFieldNumber = 38; + inline const ::ditcaffe::SigmoidParameter& sigmoid_param() const; + inline ::ditcaffe::SigmoidParameter* mutable_sigmoid_param(); + inline ::ditcaffe::SigmoidParameter* release_sigmoid_param(); + inline void set_allocated_sigmoid_param(::ditcaffe::SigmoidParameter* sigmoid_param); + + // optional .ditcaffe.SoftmaxParameter softmax_param = 39; + inline bool has_softmax_param() const; + inline void clear_softmax_param(); + static const int kSoftmaxParamFieldNumber = 39; + inline const ::ditcaffe::SoftmaxParameter& softmax_param() const; + inline ::ditcaffe::SoftmaxParameter* mutable_softmax_param(); + inline ::ditcaffe::SoftmaxParameter* release_softmax_param(); + inline void set_allocated_softmax_param(::ditcaffe::SoftmaxParameter* softmax_param); + + // optional .ditcaffe.SliceParameter slice_param = 31; + inline bool has_slice_param() const; + inline void clear_slice_param(); + static const int kSliceParamFieldNumber = 31; + inline const ::ditcaffe::SliceParameter& slice_param() const; + inline ::ditcaffe::SliceParameter* mutable_slice_param(); + inline ::ditcaffe::SliceParameter* release_slice_param(); + inline void set_allocated_slice_param(::ditcaffe::SliceParameter* slice_param); + + // optional .ditcaffe.TanHParameter tanh_param = 37; + inline bool has_tanh_param() const; + inline void clear_tanh_param(); + static const int kTanhParamFieldNumber = 37; + inline const ::ditcaffe::TanHParameter& tanh_param() const; + inline ::ditcaffe::TanHParameter* mutable_tanh_param(); + inline ::ditcaffe::TanHParameter* release_tanh_param(); + inline void set_allocated_tanh_param(::ditcaffe::TanHParameter* tanh_param); + + // optional .ditcaffe.ThresholdParameter threshold_param = 25; + inline bool has_threshold_param() const; + inline void clear_threshold_param(); + static const int kThresholdParamFieldNumber = 25; + inline const ::ditcaffe::ThresholdParameter& threshold_param() const; + inline ::ditcaffe::ThresholdParameter* mutable_threshold_param(); + inline ::ditcaffe::ThresholdParameter* release_threshold_param(); + inline void set_allocated_threshold_param(::ditcaffe::ThresholdParameter* threshold_param); + + // optional .ditcaffe.WindowDataParameter window_data_param = 20; + inline bool has_window_data_param() const; + inline void clear_window_data_param(); + static const int kWindowDataParamFieldNumber = 20; + inline const ::ditcaffe::WindowDataParameter& window_data_param() const; + inline ::ditcaffe::WindowDataParameter* mutable_window_data_param(); + inline ::ditcaffe::WindowDataParameter* release_window_data_param(); + inline void set_allocated_window_data_param(::ditcaffe::WindowDataParameter* window_data_param); + + // optional .ditcaffe.TransformationParameter transform_param = 36; + inline bool has_transform_param() const; + inline void clear_transform_param(); + static const int kTransformParamFieldNumber = 36; + inline const ::ditcaffe::TransformationParameter& transform_param() const; + inline ::ditcaffe::TransformationParameter* mutable_transform_param(); + inline ::ditcaffe::TransformationParameter* release_transform_param(); + inline void set_allocated_transform_param(::ditcaffe::TransformationParameter* transform_param); + + // optional .ditcaffe.LossParameter loss_param = 42; + inline bool has_loss_param() const; + inline void clear_loss_param(); + static const int kLossParamFieldNumber = 42; + inline const ::ditcaffe::LossParameter& loss_param() const; + inline ::ditcaffe::LossParameter* mutable_loss_param(); + inline ::ditcaffe::LossParameter* release_loss_param(); + inline void set_allocated_loss_param(::ditcaffe::LossParameter* loss_param); + + // optional .ditcaffe.V0LayerParameter layer = 1; + inline bool has_layer() const; + inline void clear_layer(); + static const int kLayerFieldNumber = 1; + inline const ::ditcaffe::V0LayerParameter& layer() const; + inline ::ditcaffe::V0LayerParameter* mutable_layer(); + inline ::ditcaffe::V0LayerParameter* release_layer(); + inline void set_allocated_layer(::ditcaffe::V0LayerParameter* layer); + + // @@protoc_insertion_point(class_scope:ditcaffe.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::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[2]; + ::google::protobuf::RepeatedPtrField< ::std::string> bottom_; + ::google::protobuf::RepeatedPtrField< ::std::string> top_; + ::std::string* name_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule > include_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule > exclude_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::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_; + ::ditcaffe::AccuracyParameter* accuracy_param_; + ::ditcaffe::ArgMaxParameter* argmax_param_; + ::ditcaffe::ConcatParameter* concat_param_; + ::ditcaffe::ContrastiveLossParameter* contrastive_loss_param_; + ::ditcaffe::ConvolutionParameter* convolution_param_; + ::ditcaffe::DataParameter* data_param_; + ::ditcaffe::DropoutParameter* dropout_param_; + ::ditcaffe::DummyDataParameter* dummy_data_param_; + ::ditcaffe::EltwiseParameter* eltwise_param_; + ::ditcaffe::ExpParameter* exp_param_; + ::ditcaffe::HDF5DataParameter* hdf5_data_param_; + ::ditcaffe::HDF5OutputParameter* hdf5_output_param_; + ::ditcaffe::HingeLossParameter* hinge_loss_param_; + ::ditcaffe::ImageDataParameter* image_data_param_; + ::ditcaffe::InfogainLossParameter* infogain_loss_param_; + ::ditcaffe::InnerProductParameter* inner_product_param_; + ::ditcaffe::LRNParameter* lrn_param_; + ::ditcaffe::MemoryDataParameter* memory_data_param_; + ::ditcaffe::MVNParameter* mvn_param_; + ::ditcaffe::PoolingParameter* pooling_param_; + ::ditcaffe::PowerParameter* power_param_; + ::ditcaffe::ReLUParameter* relu_param_; + ::ditcaffe::SigmoidParameter* sigmoid_param_; + ::ditcaffe::SoftmaxParameter* softmax_param_; + ::ditcaffe::SliceParameter* slice_param_; + ::ditcaffe::TanHParameter* tanh_param_; + ::ditcaffe::ThresholdParameter* threshold_param_; + ::ditcaffe::WindowDataParameter* window_data_param_; + ::ditcaffe::TransformationParameter* transform_param_; + ::ditcaffe::LossParameter* loss_param_; + ::ditcaffe::V0LayerParameter* layer_; + int type_; + mutable int _cached_size_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static V1LayerParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class V0LayerParameter : public ::google::protobuf::Message { + 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 _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const V0LayerParameter& default_instance(); + + void Swap(V0LayerParameter* other); + + // implements Message ---------------------------------------------- + + V0LayerParameter* New() 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + 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; + inline bool has_name() const; + inline void clear_name(); + static const int kNameFieldNumber = 1; + inline const ::std::string& name() const; + inline void set_name(const ::std::string& value); + inline void set_name(const char* value); + inline void set_name(const char* value, size_t size); + inline ::std::string* mutable_name(); + inline ::std::string* release_name(); + inline void set_allocated_name(::std::string* name); + + // optional string type = 2; + inline bool has_type() const; + inline void clear_type(); + static const int kTypeFieldNumber = 2; + inline const ::std::string& type() const; + inline void set_type(const ::std::string& value); + inline void set_type(const char* value); + inline void set_type(const char* value, size_t size); + inline ::std::string* mutable_type(); + inline ::std::string* release_type(); + inline void set_allocated_type(::std::string* type); + + // optional uint32 num_output = 3; + inline bool has_num_output() const; + inline void clear_num_output(); + static const int kNumOutputFieldNumber = 3; + inline ::google::protobuf::uint32 num_output() const; + inline void set_num_output(::google::protobuf::uint32 value); + + // optional bool biasterm = 4 [default = true]; + inline bool has_biasterm() const; + inline void clear_biasterm(); + static const int kBiastermFieldNumber = 4; + inline bool biasterm() const; + inline void set_biasterm(bool value); + + // optional .ditcaffe.FillerParameter weight_filler = 5; + inline bool has_weight_filler() const; + inline void clear_weight_filler(); + static const int kWeightFillerFieldNumber = 5; + inline const ::ditcaffe::FillerParameter& weight_filler() const; + inline ::ditcaffe::FillerParameter* mutable_weight_filler(); + inline ::ditcaffe::FillerParameter* release_weight_filler(); + inline void set_allocated_weight_filler(::ditcaffe::FillerParameter* weight_filler); + + // optional .ditcaffe.FillerParameter bias_filler = 6; + inline bool has_bias_filler() const; + inline void clear_bias_filler(); + static const int kBiasFillerFieldNumber = 6; + inline const ::ditcaffe::FillerParameter& bias_filler() const; + inline ::ditcaffe::FillerParameter* mutable_bias_filler(); + inline ::ditcaffe::FillerParameter* release_bias_filler(); + inline void set_allocated_bias_filler(::ditcaffe::FillerParameter* bias_filler); + + // optional uint32 pad = 7 [default = 0]; + inline bool has_pad() const; + inline void clear_pad(); + static const int kPadFieldNumber = 7; + inline ::google::protobuf::uint32 pad() const; + inline void set_pad(::google::protobuf::uint32 value); + + // optional uint32 kernelsize = 8; + inline bool has_kernelsize() const; + inline void clear_kernelsize(); + static const int kKernelsizeFieldNumber = 8; + inline ::google::protobuf::uint32 kernelsize() const; + inline void set_kernelsize(::google::protobuf::uint32 value); + + // optional uint32 group = 9 [default = 1]; + inline bool has_group() const; + inline void clear_group(); + static const int kGroupFieldNumber = 9; + inline ::google::protobuf::uint32 group() const; + inline void set_group(::google::protobuf::uint32 value); + + // optional uint32 stride = 10 [default = 1]; + inline bool has_stride() const; + inline void clear_stride(); + static const int kStrideFieldNumber = 10; + inline ::google::protobuf::uint32 stride() const; + inline void set_stride(::google::protobuf::uint32 value); + + // optional .ditcaffe.V0LayerParameter.PoolMethod pool = 11 [default = MAX]; + inline bool has_pool() const; + inline void clear_pool(); + static const int kPoolFieldNumber = 11; + inline ::ditcaffe::V0LayerParameter_PoolMethod pool() const; + inline void set_pool(::ditcaffe::V0LayerParameter_PoolMethod value); + + // optional float dropout_ratio = 12 [default = 0.5]; + inline bool has_dropout_ratio() const; + inline void clear_dropout_ratio(); + static const int kDropoutRatioFieldNumber = 12; + inline float dropout_ratio() const; + inline void set_dropout_ratio(float value); + + // optional uint32 local_size = 13 [default = 5]; + inline bool has_local_size() const; + inline void clear_local_size(); + static const int kLocalSizeFieldNumber = 13; + inline ::google::protobuf::uint32 local_size() const; + inline void set_local_size(::google::protobuf::uint32 value); + + // optional float alpha = 14 [default = 1]; + inline bool has_alpha() const; + inline void clear_alpha(); + static const int kAlphaFieldNumber = 14; + inline float alpha() const; + inline void set_alpha(float value); + + // optional float beta = 15 [default = 0.75]; + inline bool has_beta() const; + inline void clear_beta(); + static const int kBetaFieldNumber = 15; + inline float beta() const; + inline void set_beta(float value); + + // optional float k = 22 [default = 1]; + inline bool has_k() const; + inline void clear_k(); + static const int kKFieldNumber = 22; + inline float k() const; + inline void set_k(float value); + + // optional string source = 16; + inline bool has_source() const; + inline void clear_source(); + static const int kSourceFieldNumber = 16; + inline const ::std::string& source() const; + inline void set_source(const ::std::string& value); + inline void set_source(const char* value); + inline void set_source(const char* value, size_t size); + inline ::std::string* mutable_source(); + inline ::std::string* release_source(); + inline void set_allocated_source(::std::string* source); + + // optional float scale = 17 [default = 1]; + inline bool has_scale() const; + inline void clear_scale(); + static const int kScaleFieldNumber = 17; + inline float scale() const; + inline void set_scale(float value); + + // optional string meanfile = 18; + inline bool has_meanfile() const; + inline void clear_meanfile(); + static const int kMeanfileFieldNumber = 18; + inline const ::std::string& meanfile() const; + inline void set_meanfile(const ::std::string& value); + inline void set_meanfile(const char* value); + inline void set_meanfile(const char* value, size_t size); + inline ::std::string* mutable_meanfile(); + inline ::std::string* release_meanfile(); + inline void set_allocated_meanfile(::std::string* meanfile); + + // optional uint32 batchsize = 19; + inline bool has_batchsize() const; + inline void clear_batchsize(); + static const int kBatchsizeFieldNumber = 19; + inline ::google::protobuf::uint32 batchsize() const; + inline void set_batchsize(::google::protobuf::uint32 value); + + // optional uint32 cropsize = 20 [default = 0]; + inline bool has_cropsize() const; + inline void clear_cropsize(); + static const int kCropsizeFieldNumber = 20; + inline ::google::protobuf::uint32 cropsize() const; + inline void set_cropsize(::google::protobuf::uint32 value); + + // optional bool mirror = 21 [default = false]; + inline bool has_mirror() const; + inline void clear_mirror(); + static const int kMirrorFieldNumber = 21; + inline bool mirror() const; + inline void set_mirror(bool value); + + // repeated .ditcaffe.BlobProto blobs = 50; + inline int blobs_size() const; + inline void clear_blobs(); + static const int kBlobsFieldNumber = 50; + inline const ::ditcaffe::BlobProto& blobs(int index) const; + inline ::ditcaffe::BlobProto* mutable_blobs(int index); + inline ::ditcaffe::BlobProto* add_blobs(); + inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >& + blobs() const; + inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >* + mutable_blobs(); + + // repeated float blobs_lr = 51; + inline int blobs_lr_size() const; + inline void clear_blobs_lr(); + static const int kBlobsLrFieldNumber = 51; + inline float blobs_lr(int index) const; + inline void set_blobs_lr(int index, float value); + inline void add_blobs_lr(float value); + inline const ::google::protobuf::RepeatedField< float >& + blobs_lr() const; + inline ::google::protobuf::RepeatedField< float >* + mutable_blobs_lr(); + + // repeated float weight_decay = 52; + inline int weight_decay_size() const; + inline void clear_weight_decay(); + static const int kWeightDecayFieldNumber = 52; + inline float weight_decay(int index) const; + inline void set_weight_decay(int index, float value); + inline void add_weight_decay(float value); + inline const ::google::protobuf::RepeatedField< float >& + weight_decay() const; + inline ::google::protobuf::RepeatedField< float >* + mutable_weight_decay(); + + // optional uint32 rand_skip = 53 [default = 0]; + inline bool has_rand_skip() const; + inline void clear_rand_skip(); + static const int kRandSkipFieldNumber = 53; + inline ::google::protobuf::uint32 rand_skip() const; + inline void set_rand_skip(::google::protobuf::uint32 value); + + // optional float det_fg_threshold = 54 [default = 0.5]; + inline bool has_det_fg_threshold() const; + inline void clear_det_fg_threshold(); + static const int kDetFgThresholdFieldNumber = 54; + inline float det_fg_threshold() const; + inline void set_det_fg_threshold(float value); + + // optional float det_bg_threshold = 55 [default = 0.5]; + inline bool has_det_bg_threshold() const; + inline void clear_det_bg_threshold(); + static const int kDetBgThresholdFieldNumber = 55; + inline float det_bg_threshold() const; + inline void set_det_bg_threshold(float value); + + // optional float det_fg_fraction = 56 [default = 0.25]; + inline bool has_det_fg_fraction() const; + inline void clear_det_fg_fraction(); + static const int kDetFgFractionFieldNumber = 56; + inline float det_fg_fraction() const; + inline void set_det_fg_fraction(float value); + + // optional uint32 det_context_pad = 58 [default = 0]; + inline bool has_det_context_pad() const; + inline void clear_det_context_pad(); + static const int kDetContextPadFieldNumber = 58; + inline ::google::protobuf::uint32 det_context_pad() const; + inline void set_det_context_pad(::google::protobuf::uint32 value); + + // optional string det_crop_mode = 59 [default = "warp"]; + inline bool has_det_crop_mode() const; + inline void clear_det_crop_mode(); + static const int kDetCropModeFieldNumber = 59; + inline const ::std::string& det_crop_mode() const; + inline void set_det_crop_mode(const ::std::string& value); + inline void set_det_crop_mode(const char* value); + inline void set_det_crop_mode(const char* value, size_t size); + inline ::std::string* mutable_det_crop_mode(); + inline ::std::string* release_det_crop_mode(); + inline void set_allocated_det_crop_mode(::std::string* det_crop_mode); + + // optional int32 new_num = 60 [default = 0]; + inline bool has_new_num() const; + inline void clear_new_num(); + static const int kNewNumFieldNumber = 60; + inline ::google::protobuf::int32 new_num() const; + inline void set_new_num(::google::protobuf::int32 value); + + // optional int32 new_channels = 61 [default = 0]; + inline bool has_new_channels() const; + inline void clear_new_channels(); + static const int kNewChannelsFieldNumber = 61; + inline ::google::protobuf::int32 new_channels() const; + inline void set_new_channels(::google::protobuf::int32 value); + + // optional int32 new_height = 62 [default = 0]; + inline bool has_new_height() const; + inline void clear_new_height(); + static const int kNewHeightFieldNumber = 62; + inline ::google::protobuf::int32 new_height() const; + inline void set_new_height(::google::protobuf::int32 value); + + // optional int32 new_width = 63 [default = 0]; + inline bool has_new_width() const; + inline void clear_new_width(); + static const int kNewWidthFieldNumber = 63; + inline ::google::protobuf::int32 new_width() const; + inline void set_new_width(::google::protobuf::int32 value); + + // optional bool shuffle_images = 64 [default = false]; + inline bool has_shuffle_images() const; + inline void clear_shuffle_images(); + static const int kShuffleImagesFieldNumber = 64; + inline bool shuffle_images() const; + inline void set_shuffle_images(bool value); + + // optional uint32 concat_dim = 65 [default = 1]; + inline bool has_concat_dim() const; + inline void clear_concat_dim(); + static const int kConcatDimFieldNumber = 65; + inline ::google::protobuf::uint32 concat_dim() const; + inline void set_concat_dim(::google::protobuf::uint32 value); + + // optional .ditcaffe.HDF5OutputParameter hdf5_output_param = 1001; + inline bool has_hdf5_output_param() const; + inline void clear_hdf5_output_param(); + static const int kHdf5OutputParamFieldNumber = 1001; + inline const ::ditcaffe::HDF5OutputParameter& hdf5_output_param() const; + inline ::ditcaffe::HDF5OutputParameter* mutable_hdf5_output_param(); + inline ::ditcaffe::HDF5OutputParameter* release_hdf5_output_param(); + inline void set_allocated_hdf5_output_param(::ditcaffe::HDF5OutputParameter* hdf5_output_param); + + // @@protoc_insertion_point(class_scope:ditcaffe.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::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[2]; + ::std::string* name_; + ::std::string* type_; + ::ditcaffe::FillerParameter* weight_filler_; + ::google::protobuf::uint32 num_output_; + ::google::protobuf::uint32 pad_; + ::ditcaffe::FillerParameter* bias_filler_; + ::google::protobuf::uint32 kernelsize_; + ::google::protobuf::uint32 group_; + ::google::protobuf::uint32 stride_; + int pool_; + float dropout_ratio_; + ::google::protobuf::uint32 local_size_; + float alpha_; + float beta_; + ::std::string* source_; + float k_; + float scale_; + ::std::string* meanfile_; + ::google::protobuf::uint32 batchsize_; + bool biasterm_; + bool mirror_; + bool shuffle_images_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto > blobs_; + ::google::protobuf::uint32 cropsize_; + ::google::protobuf::uint32 rand_skip_; + ::google::protobuf::RepeatedField< float > blobs_lr_; + ::google::protobuf::RepeatedField< float > weight_decay_; + float det_fg_threshold_; + float det_bg_threshold_; + float det_fg_fraction_; + ::google::protobuf::uint32 det_context_pad_; + static ::std::string* _default_det_crop_mode_; + ::std::string* det_crop_mode_; + ::google::protobuf::int32 new_num_; + ::google::protobuf::int32 new_channels_; + ::google::protobuf::int32 new_height_; + ::google::protobuf::int32 new_width_; + ::ditcaffe::HDF5OutputParameter* hdf5_output_param_; + ::google::protobuf::uint32 concat_dim_; + mutable int _cached_size_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static V0LayerParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class PReLUParameter : public ::google::protobuf::Message { + 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 _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const PReLUParameter& default_instance(); + + void Swap(PReLUParameter* other); + + // implements Message ---------------------------------------------- + + PReLUParameter* New() 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional .ditcaffe.FillerParameter filler = 1; + inline bool has_filler() const; + inline void clear_filler(); + static const int kFillerFieldNumber = 1; + inline const ::ditcaffe::FillerParameter& filler() const; + inline ::ditcaffe::FillerParameter* mutable_filler(); + inline ::ditcaffe::FillerParameter* release_filler(); + inline void set_allocated_filler(::ditcaffe::FillerParameter* filler); + + // optional bool channel_shared = 2 [default = false]; + inline bool has_channel_shared() const; + inline void clear_channel_shared(); + static const int kChannelSharedFieldNumber = 2; + inline bool channel_shared() const; + inline void set_channel_shared(bool value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::ditcaffe::FillerParameter* filler_; + bool channel_shared_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static PReLUParameter* default_instance_; +}; +// =================================================================== + + +// =================================================================== + +// 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:ditcaffe.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:ditcaffe.BlobShape.dim) +} +inline void BlobShape::add_dim(::google::protobuf::int64 value) { + dim_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.BlobShape.dim) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +BlobShape::dim() const { + // @@protoc_insertion_point(field_list:ditcaffe.BlobShape.dim) + return dim_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +BlobShape::mutable_dim() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.BlobShape.dim) + return &dim_; +} + +// ------------------------------------------------------------------- + +// BlobProto + +// optional .ditcaffe.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_->::ditcaffe::BlobShape::Clear(); + clear_has_shape(); +} +inline const ::ditcaffe::BlobShape& BlobProto::shape() const { + // @@protoc_insertion_point(field_get:ditcaffe.BlobProto.shape) + return shape_ != NULL ? *shape_ : *default_instance_->shape_; +} +inline ::ditcaffe::BlobShape* BlobProto::mutable_shape() { + set_has_shape(); + if (shape_ == NULL) shape_ = new ::ditcaffe::BlobShape; + // @@protoc_insertion_point(field_mutable:ditcaffe.BlobProto.shape) + return shape_; +} +inline ::ditcaffe::BlobShape* BlobProto::release_shape() { + clear_has_shape(); + ::ditcaffe::BlobShape* temp = shape_; + shape_ = NULL; + return temp; +} +inline void BlobProto::set_allocated_shape(::ditcaffe::BlobShape* shape) { + delete shape_; + shape_ = shape; + if (shape) { + set_has_shape(); + } else { + clear_has_shape(); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.BlobProto.data) + return data_.Get(index); +} +inline void BlobProto::set_data(int index, float value) { + data_.Set(index, value); + // @@protoc_insertion_point(field_set:ditcaffe.BlobProto.data) +} +inline void BlobProto::add_data(float value) { + data_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.BlobProto.data) +} +inline const ::google::protobuf::RepeatedField< float >& +BlobProto::data() const { + // @@protoc_insertion_point(field_list:ditcaffe.BlobProto.data) + return data_; +} +inline ::google::protobuf::RepeatedField< float >* +BlobProto::mutable_data() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.BlobProto.diff) + return diff_.Get(index); +} +inline void BlobProto::set_diff(int index, float value) { + diff_.Set(index, value); + // @@protoc_insertion_point(field_set:ditcaffe.BlobProto.diff) +} +inline void BlobProto::add_diff(float value) { + diff_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.BlobProto.diff) +} +inline const ::google::protobuf::RepeatedField< float >& +BlobProto::diff() const { + // @@protoc_insertion_point(field_list:ditcaffe.BlobProto.diff) + return diff_; +} +inline ::google::protobuf::RepeatedField< float >* +BlobProto::mutable_diff() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.BlobProto.double_data) +} +inline void BlobProto::add_double_data(double value) { + double_data_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.BlobProto.double_data) +} +inline const ::google::protobuf::RepeatedField< double >& +BlobProto::double_data() const { + // @@protoc_insertion_point(field_list:ditcaffe.BlobProto.double_data) + return double_data_; +} +inline ::google::protobuf::RepeatedField< double >* +BlobProto::mutable_double_data() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.BlobProto.double_diff) +} +inline void BlobProto::add_double_diff(double value) { + double_diff_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.BlobProto.double_diff) +} +inline const ::google::protobuf::RepeatedField< double >& +BlobProto::double_diff() const { + // @@protoc_insertion_point(field_list:ditcaffe.BlobProto.double_diff) + return double_diff_; +} +inline ::google::protobuf::RepeatedField< double >* +BlobProto::mutable_double_diff() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.BlobProto.double_diff) + return &double_diff_; +} + +// repeated uint32 half_data = 10 [packed = true]; +inline int BlobProto::half_data_size() const { + return half_data_.size(); +} +inline void BlobProto::clear_half_data() { + half_data_.Clear(); +} +inline ::google::protobuf::uint32 BlobProto::half_data(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.BlobProto.half_data) + return half_data_.Get(index); +} +inline void BlobProto::set_half_data(int index, ::google::protobuf::uint32 value) { + half_data_.Set(index, value); + // @@protoc_insertion_point(field_set:ditcaffe.BlobProto.half_data) +} +inline void BlobProto::add_half_data(::google::protobuf::uint32 value) { + half_data_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.BlobProto.half_data) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +BlobProto::half_data() const { + // @@protoc_insertion_point(field_list:ditcaffe.BlobProto.half_data) + return half_data_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +BlobProto::mutable_half_data() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.BlobProto.half_data) + return &half_data_; +} + +// repeated uint32 half_diff = 11 [packed = true]; +inline int BlobProto::half_diff_size() const { + return half_diff_.size(); +} +inline void BlobProto::clear_half_diff() { + half_diff_.Clear(); +} +inline ::google::protobuf::uint32 BlobProto::half_diff(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.BlobProto.half_diff) + return half_diff_.Get(index); +} +inline void BlobProto::set_half_diff(int index, ::google::protobuf::uint32 value) { + half_diff_.Set(index, value); + // @@protoc_insertion_point(field_set:ditcaffe.BlobProto.half_diff) +} +inline void BlobProto::add_half_diff(::google::protobuf::uint32 value) { + half_diff_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.BlobProto.half_diff) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +BlobProto::half_diff() const { + // @@protoc_insertion_point(field_list:ditcaffe.BlobProto.half_diff) + return half_diff_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +BlobProto::mutable_half_diff() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.BlobProto.half_diff) + return &half_diff_; +} + +// optional int32 num = 1 [default = 0]; +inline bool BlobProto::has_num() const { + return (_has_bits_[0] & 0x00000080u) != 0; +} +inline void BlobProto::set_has_num() { + _has_bits_[0] |= 0x00000080u; +} +inline void BlobProto::clear_has_num() { + _has_bits_[0] &= ~0x00000080u; +} +inline void BlobProto::clear_num() { + num_ = 0; + clear_has_num(); +} +inline ::google::protobuf::int32 BlobProto::num() const { + // @@protoc_insertion_point(field_get:ditcaffe.BlobProto.num) + return num_; +} +inline void BlobProto::set_num(::google::protobuf::int32 value) { + set_has_num(); + num_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.BlobProto.num) +} + +// optional int32 channels = 2 [default = 0]; +inline bool BlobProto::has_channels() const { + return (_has_bits_[0] & 0x00000100u) != 0; +} +inline void BlobProto::set_has_channels() { + _has_bits_[0] |= 0x00000100u; +} +inline void BlobProto::clear_has_channels() { + _has_bits_[0] &= ~0x00000100u; +} +inline void BlobProto::clear_channels() { + channels_ = 0; + clear_has_channels(); +} +inline ::google::protobuf::int32 BlobProto::channels() const { + // @@protoc_insertion_point(field_get:ditcaffe.BlobProto.channels) + return channels_; +} +inline void BlobProto::set_channels(::google::protobuf::int32 value) { + set_has_channels(); + channels_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.BlobProto.channels) +} + +// optional int32 height = 3 [default = 0]; +inline bool BlobProto::has_height() const { + return (_has_bits_[0] & 0x00000200u) != 0; +} +inline void BlobProto::set_has_height() { + _has_bits_[0] |= 0x00000200u; +} +inline void BlobProto::clear_has_height() { + _has_bits_[0] &= ~0x00000200u; +} +inline void BlobProto::clear_height() { + height_ = 0; + clear_has_height(); +} +inline ::google::protobuf::int32 BlobProto::height() const { + // @@protoc_insertion_point(field_get:ditcaffe.BlobProto.height) + return height_; +} +inline void BlobProto::set_height(::google::protobuf::int32 value) { + set_has_height(); + height_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.BlobProto.height) +} + +// optional int32 width = 4 [default = 0]; +inline bool BlobProto::has_width() const { + return (_has_bits_[0] & 0x00000400u) != 0; +} +inline void BlobProto::set_has_width() { + _has_bits_[0] |= 0x00000400u; +} +inline void BlobProto::clear_has_width() { + _has_bits_[0] &= ~0x00000400u; +} +inline void BlobProto::clear_width() { + width_ = 0; + clear_has_width(); +} +inline ::google::protobuf::int32 BlobProto::width() const { + // @@protoc_insertion_point(field_get:ditcaffe.BlobProto.width) + return width_; +} +inline void BlobProto::set_width(::google::protobuf::int32 value) { + set_has_width(); + width_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.BlobProto.width) +} + +// ------------------------------------------------------------------- + +// BlobProtoVector + +// repeated .ditcaffe.BlobProto blobs = 1; +inline int BlobProtoVector::blobs_size() const { + return blobs_.size(); +} +inline void BlobProtoVector::clear_blobs() { + blobs_.Clear(); +} +inline const ::ditcaffe::BlobProto& BlobProtoVector::blobs(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.BlobProtoVector.blobs) + return blobs_.Get(index); +} +inline ::ditcaffe::BlobProto* BlobProtoVector::mutable_blobs(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.BlobProtoVector.blobs) + return blobs_.Mutable(index); +} +inline ::ditcaffe::BlobProto* BlobProtoVector::add_blobs() { + // @@protoc_insertion_point(field_add:ditcaffe.BlobProtoVector.blobs) + return blobs_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >& +BlobProtoVector::blobs() const { + // @@protoc_insertion_point(field_list:ditcaffe.BlobProtoVector.blobs) + return blobs_; +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >* +BlobProtoVector::mutable_blobs() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.BlobProtoVector.blobs) + return &blobs_; +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.Datum.channels) + return channels_; +} +inline void Datum::set_channels(::google::protobuf::int32 value) { + set_has_channels(); + channels_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.Datum.height) + return height_; +} +inline void Datum::set_height(::google::protobuf::int32 value) { + set_has_height(); + height_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.Datum.width) + return width_; +} +inline void Datum::set_width(::google::protobuf::int32 value) { + set_has_width(); + width_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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() { + if (data_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + data_->clear(); + } + clear_has_data(); +} +inline const ::std::string& Datum::data() const { + // @@protoc_insertion_point(field_get:ditcaffe.Datum.data) + return *data_; +} +inline void Datum::set_data(const ::std::string& value) { + set_has_data(); + if (data_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + data_ = new ::std::string; + } + data_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.Datum.data) +} +inline void Datum::set_data(const char* value) { + set_has_data(); + if (data_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + data_ = new ::std::string; + } + data_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.Datum.data) +} +inline void Datum::set_data(const void* value, size_t size) { + set_has_data(); + if (data_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + data_ = new ::std::string; + } + data_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.Datum.data) +} +inline ::std::string* Datum::mutable_data() { + set_has_data(); + if (data_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + data_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.Datum.data) + return data_; +} +inline ::std::string* Datum::release_data() { + clear_has_data(); + if (data_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = data_; + data_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void Datum::set_allocated_data(::std::string* data) { + if (data_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete data_; + } + if (data) { + set_has_data(); + data_ = data; + } else { + clear_has_data(); + data_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.Datum.label) + return label_; +} +inline void Datum::set_label(::google::protobuf::int32 value) { + set_has_label(); + label_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.Datum.float_data) +} +inline void Datum::add_float_data(float value) { + float_data_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.Datum.float_data) +} +inline const ::google::protobuf::RepeatedField< float >& +Datum::float_data() const { + // @@protoc_insertion_point(field_list:ditcaffe.Datum.float_data) + return float_data_; +} +inline ::google::protobuf::RepeatedField< float >* +Datum::mutable_float_data() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.Datum.encoded) + return encoded_; +} +inline void Datum::set_encoded(bool value) { + set_has_encoded(); + encoded_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.Datum.encoded) +} + +// ------------------------------------------------------------------- + +// 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() { + if (type_ != _default_type_) { + type_->assign(*_default_type_); + } + clear_has_type(); +} +inline const ::std::string& FillerParameter::type() const { + // @@protoc_insertion_point(field_get:ditcaffe.FillerParameter.type) + return *type_; +} +inline void FillerParameter::set_type(const ::std::string& value) { + set_has_type(); + if (type_ == _default_type_) { + type_ = new ::std::string; + } + type_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.FillerParameter.type) +} +inline void FillerParameter::set_type(const char* value) { + set_has_type(); + if (type_ == _default_type_) { + type_ = new ::std::string; + } + type_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.FillerParameter.type) +} +inline void FillerParameter::set_type(const char* value, size_t size) { + set_has_type(); + if (type_ == _default_type_) { + type_ = new ::std::string; + } + type_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.FillerParameter.type) +} +inline ::std::string* FillerParameter::mutable_type() { + set_has_type(); + if (type_ == _default_type_) { + type_ = new ::std::string(*_default_type_); + } + // @@protoc_insertion_point(field_mutable:ditcaffe.FillerParameter.type) + return type_; +} +inline ::std::string* FillerParameter::release_type() { + clear_has_type(); + if (type_ == _default_type_) { + return NULL; + } else { + ::std::string* temp = type_; + type_ = const_cast< ::std::string*>(_default_type_); + return temp; + } +} +inline void FillerParameter::set_allocated_type(::std::string* type) { + if (type_ != _default_type_) { + delete type_; + } + if (type) { + set_has_type(); + type_ = type; + } else { + clear_has_type(); + type_ = const_cast< ::std::string*>(_default_type_); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.FillerParameter.value) + return value_; +} +inline void FillerParameter::set_value(float value) { + set_has_value(); + value_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.FillerParameter.min) + return min_; +} +inline void FillerParameter::set_min(float value) { + set_has_min(); + min_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.FillerParameter.max) + return max_; +} +inline void FillerParameter::set_max(float value) { + set_has_max(); + max_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.FillerParameter.mean) + return mean_; +} +inline void FillerParameter::set_mean(float value) { + set_has_mean(); + mean_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.FillerParameter.std) + return std_; +} +inline void FillerParameter::set_std(float value) { + set_has_std(); + std_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.FillerParameter.sparse) + return sparse_; +} +inline void FillerParameter::set_sparse(::google::protobuf::int32 value) { + set_has_sparse(); + sparse_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.FillerParameter.sparse) +} + +// optional .ditcaffe.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 ::ditcaffe::FillerParameter_VarianceNorm FillerParameter::variance_norm() const { + // @@protoc_insertion_point(field_get:ditcaffe.FillerParameter.variance_norm) + return static_cast< ::ditcaffe::FillerParameter_VarianceNorm >(variance_norm_); +} +inline void FillerParameter::set_variance_norm(::ditcaffe::FillerParameter_VarianceNorm value) { + assert(::ditcaffe::FillerParameter_VarianceNorm_IsValid(value)); + set_has_variance_norm(); + variance_norm_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.FillerParameter.variance_norm) +} + +// ------------------------------------------------------------------- + +// 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() { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_->clear(); + } + clear_has_name(); +} +inline const ::std::string& NetParameter::name() const { + // @@protoc_insertion_point(field_get:ditcaffe.NetParameter.name) + return *name_; +} +inline void NetParameter::set_name(const ::std::string& value) { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + name_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.NetParameter.name) +} +inline void NetParameter::set_name(const char* value) { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + name_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.NetParameter.name) +} +inline void NetParameter::set_name(const char* value, size_t size) { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + name_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.NetParameter.name) +} +inline ::std::string* NetParameter::mutable_name() { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.NetParameter.name) + return name_; +} +inline ::std::string* NetParameter::release_name() { + clear_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = name_; + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void NetParameter::set_allocated_name(::std::string* name) { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete name_; + } + if (name) { + set_has_name(); + name_ = name; + } else { + clear_has_name(); + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.NetParameter.input) + return input_.Get(index); +} +inline ::std::string* NetParameter::mutable_input(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.NetParameter.input) + return input_.Mutable(index); +} +inline void NetParameter::set_input(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.NetParameter.input) +} +inline ::std::string* NetParameter::add_input() { + return input_.Add(); +} +inline void NetParameter::add_input(const ::std::string& value) { + input_.Add()->assign(value); + // @@protoc_insertion_point(field_add:ditcaffe.NetParameter.input) +} +inline void NetParameter::add_input(const char* value) { + input_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:ditcaffe.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:ditcaffe.NetParameter.input) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +NetParameter::input() const { + // @@protoc_insertion_point(field_list:ditcaffe.NetParameter.input) + return input_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +NetParameter::mutable_input() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.NetParameter.input) + return &input_; +} + +// repeated .ditcaffe.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 ::ditcaffe::BlobShape& NetParameter::input_shape(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.NetParameter.input_shape) + return input_shape_.Get(index); +} +inline ::ditcaffe::BlobShape* NetParameter::mutable_input_shape(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.NetParameter.input_shape) + return input_shape_.Mutable(index); +} +inline ::ditcaffe::BlobShape* NetParameter::add_input_shape() { + // @@protoc_insertion_point(field_add:ditcaffe.NetParameter.input_shape) + return input_shape_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobShape >& +NetParameter::input_shape() const { + // @@protoc_insertion_point(field_list:ditcaffe.NetParameter.input_shape) + return input_shape_; +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobShape >* +NetParameter::mutable_input_shape() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.NetParameter.input_dim) +} +inline void NetParameter::add_input_dim(::google::protobuf::int32 value) { + input_dim_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.NetParameter.input_dim) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +NetParameter::input_dim() const { + // @@protoc_insertion_point(field_list:ditcaffe.NetParameter.input_dim) + return input_dim_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +NetParameter::mutable_input_dim() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.NetParameter.force_backward) +} + +// optional .ditcaffe.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_->::ditcaffe::NetState::Clear(); + clear_has_state(); +} +inline const ::ditcaffe::NetState& NetParameter::state() const { + // @@protoc_insertion_point(field_get:ditcaffe.NetParameter.state) + return state_ != NULL ? *state_ : *default_instance_->state_; +} +inline ::ditcaffe::NetState* NetParameter::mutable_state() { + set_has_state(); + if (state_ == NULL) state_ = new ::ditcaffe::NetState; + // @@protoc_insertion_point(field_mutable:ditcaffe.NetParameter.state) + return state_; +} +inline ::ditcaffe::NetState* NetParameter::release_state() { + clear_has_state(); + ::ditcaffe::NetState* temp = state_; + state_ = NULL; + return temp; +} +inline void NetParameter::set_allocated_state(::ditcaffe::NetState* state) { + delete state_; + state_ = state; + if (state) { + set_has_state(); + } else { + clear_has_state(); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.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:ditcaffe.NetParameter.debug_info) +} + +// repeated .ditcaffe.LayerParameter layer = 100; +inline int NetParameter::layer_size() const { + return layer_.size(); +} +inline void NetParameter::clear_layer() { + layer_.Clear(); +} +inline const ::ditcaffe::LayerParameter& NetParameter::layer(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.NetParameter.layer) + return layer_.Get(index); +} +inline ::ditcaffe::LayerParameter* NetParameter::mutable_layer(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.NetParameter.layer) + return layer_.Mutable(index); +} +inline ::ditcaffe::LayerParameter* NetParameter::add_layer() { + // @@protoc_insertion_point(field_add:ditcaffe.NetParameter.layer) + return layer_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::LayerParameter >& +NetParameter::layer() const { + // @@protoc_insertion_point(field_list:ditcaffe.NetParameter.layer) + return layer_; +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::LayerParameter >* +NetParameter::mutable_layer() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.NetParameter.layer) + return &layer_; +} + +// repeated .ditcaffe.V1LayerParameter layers = 2; +inline int NetParameter::layers_size() const { + return layers_.size(); +} +inline void NetParameter::clear_layers() { + layers_.Clear(); +} +inline const ::ditcaffe::V1LayerParameter& NetParameter::layers(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.NetParameter.layers) + return layers_.Get(index); +} +inline ::ditcaffe::V1LayerParameter* NetParameter::mutable_layers(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.NetParameter.layers) + return layers_.Mutable(index); +} +inline ::ditcaffe::V1LayerParameter* NetParameter::add_layers() { + // @@protoc_insertion_point(field_add:ditcaffe.NetParameter.layers) + return layers_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::V1LayerParameter >& +NetParameter::layers() const { + // @@protoc_insertion_point(field_list:ditcaffe.NetParameter.layers) + return layers_; +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::V1LayerParameter >* +NetParameter::mutable_layers() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.NetParameter.layers) + return &layers_; +} + +// ------------------------------------------------------------------- + +// 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() { + if (net_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + net_->clear(); + } + clear_has_net(); +} +inline const ::std::string& SolverParameter::net() const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverParameter.net) + return *net_; +} +inline void SolverParameter::set_net(const ::std::string& value) { + set_has_net(); + if (net_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + net_ = new ::std::string; + } + net_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.SolverParameter.net) +} +inline void SolverParameter::set_net(const char* value) { + set_has_net(); + if (net_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + net_ = new ::std::string; + } + net_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.SolverParameter.net) +} +inline void SolverParameter::set_net(const char* value, size_t size) { + set_has_net(); + if (net_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + net_ = new ::std::string; + } + net_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.SolverParameter.net) +} +inline ::std::string* SolverParameter::mutable_net() { + set_has_net(); + if (net_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + net_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.net) + return net_; +} +inline ::std::string* SolverParameter::release_net() { + clear_has_net(); + if (net_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = net_; + net_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void SolverParameter::set_allocated_net(::std::string* net) { + if (net_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete net_; + } + if (net) { + set_has_net(); + net_ = net; + } else { + clear_has_net(); + net_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.SolverParameter.net) +} + +// optional .ditcaffe.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_->::ditcaffe::NetParameter::Clear(); + clear_has_net_param(); +} +inline const ::ditcaffe::NetParameter& SolverParameter::net_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverParameter.net_param) + return net_param_ != NULL ? *net_param_ : *default_instance_->net_param_; +} +inline ::ditcaffe::NetParameter* SolverParameter::mutable_net_param() { + set_has_net_param(); + if (net_param_ == NULL) net_param_ = new ::ditcaffe::NetParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.net_param) + return net_param_; +} +inline ::ditcaffe::NetParameter* SolverParameter::release_net_param() { + clear_has_net_param(); + ::ditcaffe::NetParameter* temp = net_param_; + net_param_ = NULL; + return temp; +} +inline void SolverParameter::set_allocated_net_param(::ditcaffe::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:ditcaffe.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() { + if (train_net_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + train_net_->clear(); + } + clear_has_train_net(); +} +inline const ::std::string& SolverParameter::train_net() const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverParameter.train_net) + return *train_net_; +} +inline void SolverParameter::set_train_net(const ::std::string& value) { + set_has_train_net(); + if (train_net_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + train_net_ = new ::std::string; + } + train_net_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.SolverParameter.train_net) +} +inline void SolverParameter::set_train_net(const char* value) { + set_has_train_net(); + if (train_net_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + train_net_ = new ::std::string; + } + train_net_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.SolverParameter.train_net) +} +inline void SolverParameter::set_train_net(const char* value, size_t size) { + set_has_train_net(); + if (train_net_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + train_net_ = new ::std::string; + } + train_net_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.SolverParameter.train_net) +} +inline ::std::string* SolverParameter::mutable_train_net() { + set_has_train_net(); + if (train_net_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + train_net_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.train_net) + return train_net_; +} +inline ::std::string* SolverParameter::release_train_net() { + clear_has_train_net(); + if (train_net_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = train_net_; + train_net_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void SolverParameter::set_allocated_train_net(::std::string* train_net) { + if (train_net_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete train_net_; + } + if (train_net) { + set_has_train_net(); + train_net_ = train_net; + } else { + clear_has_train_net(); + train_net_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.SolverParameter.test_net) + return test_net_.Get(index); +} +inline ::std::string* SolverParameter::mutable_test_net(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.test_net) +} +inline ::std::string* SolverParameter::add_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:ditcaffe.SolverParameter.test_net) +} +inline void SolverParameter::add_test_net(const char* value) { + test_net_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:ditcaffe.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:ditcaffe.SolverParameter.test_net) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +SolverParameter::test_net() const { + // @@protoc_insertion_point(field_list:ditcaffe.SolverParameter.test_net) + return test_net_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +SolverParameter::mutable_test_net() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.SolverParameter.test_net) + return &test_net_; +} + +// optional .ditcaffe.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_->::ditcaffe::NetParameter::Clear(); + clear_has_train_net_param(); +} +inline const ::ditcaffe::NetParameter& SolverParameter::train_net_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverParameter.train_net_param) + return train_net_param_ != NULL ? *train_net_param_ : *default_instance_->train_net_param_; +} +inline ::ditcaffe::NetParameter* SolverParameter::mutable_train_net_param() { + set_has_train_net_param(); + if (train_net_param_ == NULL) train_net_param_ = new ::ditcaffe::NetParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.train_net_param) + return train_net_param_; +} +inline ::ditcaffe::NetParameter* SolverParameter::release_train_net_param() { + clear_has_train_net_param(); + ::ditcaffe::NetParameter* temp = train_net_param_; + train_net_param_ = NULL; + return temp; +} +inline void SolverParameter::set_allocated_train_net_param(::ditcaffe::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:ditcaffe.SolverParameter.train_net_param) +} + +// repeated .ditcaffe.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 ::ditcaffe::NetParameter& SolverParameter::test_net_param(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverParameter.test_net_param) + return test_net_param_.Get(index); +} +inline ::ditcaffe::NetParameter* SolverParameter::mutable_test_net_param(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.test_net_param) + return test_net_param_.Mutable(index); +} +inline ::ditcaffe::NetParameter* SolverParameter::add_test_net_param() { + // @@protoc_insertion_point(field_add:ditcaffe.SolverParameter.test_net_param) + return test_net_param_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetParameter >& +SolverParameter::test_net_param() const { + // @@protoc_insertion_point(field_list:ditcaffe.SolverParameter.test_net_param) + return test_net_param_; +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetParameter >* +SolverParameter::mutable_test_net_param() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.SolverParameter.test_net_param) + return &test_net_param_; +} + +// optional .ditcaffe.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_->::ditcaffe::NetState::Clear(); + clear_has_train_state(); +} +inline const ::ditcaffe::NetState& SolverParameter::train_state() const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverParameter.train_state) + return train_state_ != NULL ? *train_state_ : *default_instance_->train_state_; +} +inline ::ditcaffe::NetState* SolverParameter::mutable_train_state() { + set_has_train_state(); + if (train_state_ == NULL) train_state_ = new ::ditcaffe::NetState; + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.train_state) + return train_state_; +} +inline ::ditcaffe::NetState* SolverParameter::release_train_state() { + clear_has_train_state(); + ::ditcaffe::NetState* temp = train_state_; + train_state_ = NULL; + return temp; +} +inline void SolverParameter::set_allocated_train_state(::ditcaffe::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:ditcaffe.SolverParameter.train_state) +} + +// repeated .ditcaffe.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 ::ditcaffe::NetState& SolverParameter::test_state(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverParameter.test_state) + return test_state_.Get(index); +} +inline ::ditcaffe::NetState* SolverParameter::mutable_test_state(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.test_state) + return test_state_.Mutable(index); +} +inline ::ditcaffe::NetState* SolverParameter::add_test_state() { + // @@protoc_insertion_point(field_add:ditcaffe.SolverParameter.test_state) + return test_state_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetState >& +SolverParameter::test_state() const { + // @@protoc_insertion_point(field_list:ditcaffe.SolverParameter.test_state) + return test_state_; +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetState >* +SolverParameter::mutable_test_state() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.test_iter) +} +inline void SolverParameter::add_test_iter(::google::protobuf::int32 value) { + test_iter_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.SolverParameter.test_iter) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +SolverParameter::test_iter() const { + // @@protoc_insertion_point(field_list:ditcaffe.SolverParameter.test_iter) + return test_iter_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +SolverParameter::mutable_test_iter() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.display) + return display_; +} +inline void SolverParameter::set_display(::google::protobuf::int32 value) { + set_has_display(); + display_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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() { + if (lr_policy_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + lr_policy_->clear(); + } + clear_has_lr_policy(); +} +inline const ::std::string& SolverParameter::lr_policy() const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverParameter.lr_policy) + return *lr_policy_; +} +inline void SolverParameter::set_lr_policy(const ::std::string& value) { + set_has_lr_policy(); + if (lr_policy_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + lr_policy_ = new ::std::string; + } + lr_policy_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.SolverParameter.lr_policy) +} +inline void SolverParameter::set_lr_policy(const char* value) { + set_has_lr_policy(); + if (lr_policy_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + lr_policy_ = new ::std::string; + } + lr_policy_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.SolverParameter.lr_policy) +} +inline void SolverParameter::set_lr_policy(const char* value, size_t size) { + set_has_lr_policy(); + if (lr_policy_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + lr_policy_ = new ::std::string; + } + lr_policy_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.SolverParameter.lr_policy) +} +inline ::std::string* SolverParameter::mutable_lr_policy() { + set_has_lr_policy(); + if (lr_policy_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + lr_policy_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.lr_policy) + return lr_policy_; +} +inline ::std::string* SolverParameter::release_lr_policy() { + clear_has_lr_policy(); + if (lr_policy_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = lr_policy_; + lr_policy_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void SolverParameter::set_allocated_lr_policy(::std::string* lr_policy) { + if (lr_policy_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete lr_policy_; + } + if (lr_policy) { + set_has_lr_policy(); + lr_policy_ = lr_policy; + } else { + clear_has_lr_policy(); + lr_policy_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.SolverParameter.gamma) + return gamma_; +} +inline void SolverParameter::set_gamma(float value) { + set_has_gamma(); + gamma_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.SolverParameter.power) + return power_; +} +inline void SolverParameter::set_power(float value) { + set_has_power(); + power_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.SolverParameter.momentum) + return momentum_; +} +inline void SolverParameter::set_momentum(float value) { + set_has_momentum(); + momentum_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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() { + if (regularization_type_ != _default_regularization_type_) { + regularization_type_->assign(*_default_regularization_type_); + } + clear_has_regularization_type(); +} +inline const ::std::string& SolverParameter::regularization_type() const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverParameter.regularization_type) + return *regularization_type_; +} +inline void SolverParameter::set_regularization_type(const ::std::string& value) { + set_has_regularization_type(); + if (regularization_type_ == _default_regularization_type_) { + regularization_type_ = new ::std::string; + } + regularization_type_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.SolverParameter.regularization_type) +} +inline void SolverParameter::set_regularization_type(const char* value) { + set_has_regularization_type(); + if (regularization_type_ == _default_regularization_type_) { + regularization_type_ = new ::std::string; + } + regularization_type_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.SolverParameter.regularization_type) +} +inline void SolverParameter::set_regularization_type(const char* value, size_t size) { + set_has_regularization_type(); + if (regularization_type_ == _default_regularization_type_) { + regularization_type_ = new ::std::string; + } + regularization_type_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.SolverParameter.regularization_type) +} +inline ::std::string* SolverParameter::mutable_regularization_type() { + set_has_regularization_type(); + if (regularization_type_ == _default_regularization_type_) { + regularization_type_ = new ::std::string(*_default_regularization_type_); + } + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.regularization_type) + return regularization_type_; +} +inline ::std::string* SolverParameter::release_regularization_type() { + clear_has_regularization_type(); + if (regularization_type_ == _default_regularization_type_) { + return NULL; + } else { + ::std::string* temp = regularization_type_; + regularization_type_ = const_cast< ::std::string*>(_default_regularization_type_); + return temp; + } +} +inline void SolverParameter::set_allocated_regularization_type(::std::string* regularization_type) { + if (regularization_type_ != _default_regularization_type_) { + delete regularization_type_; + } + if (regularization_type) { + set_has_regularization_type(); + regularization_type_ = regularization_type; + } else { + clear_has_regularization_type(); + regularization_type_ = const_cast< ::std::string*>(_default_regularization_type_); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.SolverParameter.stepsize) + return stepsize_; +} +inline void SolverParameter::set_stepsize(::google::protobuf::int32 value) { + set_has_stepsize(); + stepsize_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.stepvalue) +} +inline void SolverParameter::add_stepvalue(::google::protobuf::int32 value) { + stepvalue_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.SolverParameter.stepvalue) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +SolverParameter::stepvalue() const { + // @@protoc_insertion_point(field_list:ditcaffe.SolverParameter.stepvalue) + return stepvalue_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +SolverParameter::mutable_stepvalue() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.snapshot) + return snapshot_; +} +inline void SolverParameter::set_snapshot(::google::protobuf::int32 value) { + set_has_snapshot(); + snapshot_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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() { + if (snapshot_prefix_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + snapshot_prefix_->clear(); + } + clear_has_snapshot_prefix(); +} +inline const ::std::string& SolverParameter::snapshot_prefix() const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverParameter.snapshot_prefix) + return *snapshot_prefix_; +} +inline void SolverParameter::set_snapshot_prefix(const ::std::string& value) { + set_has_snapshot_prefix(); + if (snapshot_prefix_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + snapshot_prefix_ = new ::std::string; + } + snapshot_prefix_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.SolverParameter.snapshot_prefix) +} +inline void SolverParameter::set_snapshot_prefix(const char* value) { + set_has_snapshot_prefix(); + if (snapshot_prefix_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + snapshot_prefix_ = new ::std::string; + } + snapshot_prefix_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.SolverParameter.snapshot_prefix) +} +inline void SolverParameter::set_snapshot_prefix(const char* value, size_t size) { + set_has_snapshot_prefix(); + if (snapshot_prefix_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + snapshot_prefix_ = new ::std::string; + } + snapshot_prefix_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.SolverParameter.snapshot_prefix) +} +inline ::std::string* SolverParameter::mutable_snapshot_prefix() { + set_has_snapshot_prefix(); + if (snapshot_prefix_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + snapshot_prefix_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.snapshot_prefix) + return snapshot_prefix_; +} +inline ::std::string* SolverParameter::release_snapshot_prefix() { + clear_has_snapshot_prefix(); + if (snapshot_prefix_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = snapshot_prefix_; + snapshot_prefix_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void SolverParameter::set_allocated_snapshot_prefix(::std::string* snapshot_prefix) { + if (snapshot_prefix_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete snapshot_prefix_; + } + if (snapshot_prefix) { + set_has_snapshot_prefix(); + snapshot_prefix_ = snapshot_prefix; + } else { + clear_has_snapshot_prefix(); + snapshot_prefix_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.snapshot_diff) +} + +// optional .ditcaffe.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 ::ditcaffe::SolverParameter_SnapshotFormat SolverParameter::snapshot_format() const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverParameter.snapshot_format) + return static_cast< ::ditcaffe::SolverParameter_SnapshotFormat >(snapshot_format_); +} +inline void SolverParameter::set_snapshot_format(::ditcaffe::SolverParameter_SnapshotFormat value) { + assert(::ditcaffe::SolverParameter_SnapshotFormat_IsValid(value)); + set_has_snapshot_format(); + snapshot_format_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.SolverParameter.snapshot_format) +} + +// optional .ditcaffe.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 ::ditcaffe::SolverParameter_SolverMode SolverParameter::solver_mode() const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverParameter.solver_mode) + return static_cast< ::ditcaffe::SolverParameter_SolverMode >(solver_mode_); +} +inline void SolverParameter::set_solver_mode(::ditcaffe::SolverParameter_SolverMode value) { + assert(::ditcaffe::SolverParameter_SolverMode_IsValid(value)); + set_has_solver_mode(); + solver_mode_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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() { + if (type_ != _default_type_) { + type_->assign(*_default_type_); + } + clear_has_type(); +} +inline const ::std::string& SolverParameter::type() const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverParameter.type) + return *type_; +} +inline void SolverParameter::set_type(const ::std::string& value) { + set_has_type(); + if (type_ == _default_type_) { + type_ = new ::std::string; + } + type_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.SolverParameter.type) +} +inline void SolverParameter::set_type(const char* value) { + set_has_type(); + if (type_ == _default_type_) { + type_ = new ::std::string; + } + type_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.SolverParameter.type) +} +inline void SolverParameter::set_type(const char* value, size_t size) { + set_has_type(); + if (type_ == _default_type_) { + type_ = new ::std::string; + } + type_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.SolverParameter.type) +} +inline ::std::string* SolverParameter::mutable_type() { + set_has_type(); + if (type_ == _default_type_) { + type_ = new ::std::string(*_default_type_); + } + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.type) + return type_; +} +inline ::std::string* SolverParameter::release_type() { + clear_has_type(); + if (type_ == _default_type_) { + return NULL; + } else { + ::std::string* temp = type_; + type_ = const_cast< ::std::string*>(_default_type_); + return temp; + } +} +inline void SolverParameter::set_allocated_type(::std::string* type) { + if (type_ != _default_type_) { + delete type_; + } + if (type) { + set_has_type(); + type_ = type; + } else { + clear_has_type(); + type_ = const_cast< ::std::string*>(_default_type_); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.SolverParameter.delta) + return delta_; +} +inline void SolverParameter::set_delta(float value) { + set_has_delta(); + delta_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.SolverParameter.momentum2) + return momentum2_; +} +inline void SolverParameter::set_momentum2(float value) { + set_has_momentum2(); + momentum2_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.SolverParameter.momentum2) +} + +// optional float rms_decay = 38; +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; + clear_has_rms_decay(); +} +inline float SolverParameter::rms_decay() const { + // @@protoc_insertion_point(field_get:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.snapshot_after_train) +} + +// optional .ditcaffe.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 ::ditcaffe::SolverParameter_SolverType SolverParameter::solver_type() const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverParameter.solver_type) + return static_cast< ::ditcaffe::SolverParameter_SolverType >(solver_type_); +} +inline void SolverParameter::set_solver_type(::ditcaffe::SolverParameter_SolverType value) { + assert(::ditcaffe::SolverParameter_SolverType_IsValid(value)); + set_has_solver_type(); + solver_type_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.SolverParameter.solver_type) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.SolverState.iter) + return iter_; +} +inline void SolverState::set_iter(::google::protobuf::int32 value) { + set_has_iter(); + iter_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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() { + if (learned_net_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + learned_net_->clear(); + } + clear_has_learned_net(); +} +inline const ::std::string& SolverState::learned_net() const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverState.learned_net) + return *learned_net_; +} +inline void SolverState::set_learned_net(const ::std::string& value) { + set_has_learned_net(); + if (learned_net_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + learned_net_ = new ::std::string; + } + learned_net_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.SolverState.learned_net) +} +inline void SolverState::set_learned_net(const char* value) { + set_has_learned_net(); + if (learned_net_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + learned_net_ = new ::std::string; + } + learned_net_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.SolverState.learned_net) +} +inline void SolverState::set_learned_net(const char* value, size_t size) { + set_has_learned_net(); + if (learned_net_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + learned_net_ = new ::std::string; + } + learned_net_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.SolverState.learned_net) +} +inline ::std::string* SolverState::mutable_learned_net() { + set_has_learned_net(); + if (learned_net_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + learned_net_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverState.learned_net) + return learned_net_; +} +inline ::std::string* SolverState::release_learned_net() { + clear_has_learned_net(); + if (learned_net_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = learned_net_; + learned_net_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void SolverState::set_allocated_learned_net(::std::string* learned_net) { + if (learned_net_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete learned_net_; + } + if (learned_net) { + set_has_learned_net(); + learned_net_ = learned_net; + } else { + clear_has_learned_net(); + learned_net_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.SolverState.learned_net) +} + +// repeated .ditcaffe.BlobProto history = 3; +inline int SolverState::history_size() const { + return history_.size(); +} +inline void SolverState::clear_history() { + history_.Clear(); +} +inline const ::ditcaffe::BlobProto& SolverState::history(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverState.history) + return history_.Get(index); +} +inline ::ditcaffe::BlobProto* SolverState::mutable_history(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverState.history) + return history_.Mutable(index); +} +inline ::ditcaffe::BlobProto* SolverState::add_history() { + // @@protoc_insertion_point(field_add:ditcaffe.SolverState.history) + return history_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >& +SolverState::history() const { + // @@protoc_insertion_point(field_list:ditcaffe.SolverState.history) + return history_; +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >* +SolverState::mutable_history() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.SolverState.current_step) +} + +// ------------------------------------------------------------------- + +// NetState + +// optional .ditcaffe.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 ::ditcaffe::Phase NetState::phase() const { + // @@protoc_insertion_point(field_get:ditcaffe.NetState.phase) + return static_cast< ::ditcaffe::Phase >(phase_); +} +inline void NetState::set_phase(::ditcaffe::Phase value) { + assert(::ditcaffe::Phase_IsValid(value)); + set_has_phase(); + phase_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.NetState.level) + return level_; +} +inline void NetState::set_level(::google::protobuf::int32 value) { + set_has_level(); + level_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.NetState.stage) + return stage_.Get(index); +} +inline ::std::string* NetState::mutable_stage(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.NetState.stage) + return stage_.Mutable(index); +} +inline void NetState::set_stage(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.NetState.stage) +} +inline ::std::string* NetState::add_stage() { + return stage_.Add(); +} +inline void NetState::add_stage(const ::std::string& value) { + stage_.Add()->assign(value); + // @@protoc_insertion_point(field_add:ditcaffe.NetState.stage) +} +inline void NetState::add_stage(const char* value) { + stage_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:ditcaffe.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:ditcaffe.NetState.stage) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +NetState::stage() const { + // @@protoc_insertion_point(field_list:ditcaffe.NetState.stage) + return stage_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +NetState::mutable_stage() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.NetState.stage) + return &stage_; +} + +// ------------------------------------------------------------------- + +// NetStateRule + +// optional .ditcaffe.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 ::ditcaffe::Phase NetStateRule::phase() const { + // @@protoc_insertion_point(field_get:ditcaffe.NetStateRule.phase) + return static_cast< ::ditcaffe::Phase >(phase_); +} +inline void NetStateRule::set_phase(::ditcaffe::Phase value) { + assert(::ditcaffe::Phase_IsValid(value)); + set_has_phase(); + phase_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.NetStateRule.stage) + return stage_.Get(index); +} +inline ::std::string* NetStateRule::mutable_stage(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.NetStateRule.stage) + return stage_.Mutable(index); +} +inline void NetStateRule::set_stage(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.NetStateRule.stage) +} +inline ::std::string* NetStateRule::add_stage() { + return stage_.Add(); +} +inline void NetStateRule::add_stage(const ::std::string& value) { + stage_.Add()->assign(value); + // @@protoc_insertion_point(field_add:ditcaffe.NetStateRule.stage) +} +inline void NetStateRule::add_stage(const char* value) { + stage_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:ditcaffe.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:ditcaffe.NetStateRule.stage) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +NetStateRule::stage() const { + // @@protoc_insertion_point(field_list:ditcaffe.NetStateRule.stage) + return stage_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +NetStateRule::mutable_stage() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.NetStateRule.not_stage) + return not_stage_.Get(index); +} +inline ::std::string* NetStateRule::mutable_not_stage(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.NetStateRule.not_stage) +} +inline ::std::string* NetStateRule::add_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:ditcaffe.NetStateRule.not_stage) +} +inline void NetStateRule::add_not_stage(const char* value) { + not_stage_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:ditcaffe.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:ditcaffe.NetStateRule.not_stage) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +NetStateRule::not_stage() const { + // @@protoc_insertion_point(field_list:ditcaffe.NetStateRule.not_stage) + return not_stage_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +NetStateRule::mutable_not_stage() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.NetStateRule.not_stage) + return ¬_stage_; +} + +// ------------------------------------------------------------------- + +// 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() { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_->clear(); + } + clear_has_name(); +} +inline const ::std::string& ParamSpec::name() const { + // @@protoc_insertion_point(field_get:ditcaffe.ParamSpec.name) + return *name_; +} +inline void ParamSpec::set_name(const ::std::string& value) { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + name_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.ParamSpec.name) +} +inline void ParamSpec::set_name(const char* value) { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + name_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.ParamSpec.name) +} +inline void ParamSpec::set_name(const char* value, size_t size) { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + name_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.ParamSpec.name) +} +inline ::std::string* ParamSpec::mutable_name() { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.ParamSpec.name) + return name_; +} +inline ::std::string* ParamSpec::release_name() { + clear_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = name_; + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ParamSpec::set_allocated_name(::std::string* name) { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete name_; + } + if (name) { + set_has_name(); + name_ = name; + } else { + clear_has_name(); + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.ParamSpec.name) +} + +// optional .ditcaffe.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 ::ditcaffe::ParamSpec_DimCheckMode ParamSpec::share_mode() const { + // @@protoc_insertion_point(field_get:ditcaffe.ParamSpec.share_mode) + return static_cast< ::ditcaffe::ParamSpec_DimCheckMode >(share_mode_); +} +inline void ParamSpec::set_share_mode(::ditcaffe::ParamSpec_DimCheckMode value) { + assert(::ditcaffe::ParamSpec_DimCheckMode_IsValid(value)); + set_has_share_mode(); + share_mode_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.ParamSpec.decay_mult) +} + +// ------------------------------------------------------------------- + +// 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() { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_->clear(); + } + clear_has_name(); +} +inline const ::std::string& LayerParameter::name() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.name) + return *name_; +} +inline void LayerParameter::set_name(const ::std::string& value) { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + name_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.LayerParameter.name) +} +inline void LayerParameter::set_name(const char* value) { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + name_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.LayerParameter.name) +} +inline void LayerParameter::set_name(const char* value, size_t size) { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + name_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.LayerParameter.name) +} +inline ::std::string* LayerParameter::mutable_name() { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.name) + return name_; +} +inline ::std::string* LayerParameter::release_name() { + clear_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = name_; + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void LayerParameter::set_allocated_name(::std::string* name) { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete name_; + } + if (name) { + set_has_name(); + name_ = name; + } else { + clear_has_name(); + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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() { + if (type_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + type_->clear(); + } + clear_has_type(); +} +inline const ::std::string& LayerParameter::type() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.type) + return *type_; +} +inline void LayerParameter::set_type(const ::std::string& value) { + set_has_type(); + if (type_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + type_ = new ::std::string; + } + type_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.LayerParameter.type) +} +inline void LayerParameter::set_type(const char* value) { + set_has_type(); + if (type_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + type_ = new ::std::string; + } + type_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.LayerParameter.type) +} +inline void LayerParameter::set_type(const char* value, size_t size) { + set_has_type(); + if (type_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + type_ = new ::std::string; + } + type_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.LayerParameter.type) +} +inline ::std::string* LayerParameter::mutable_type() { + set_has_type(); + if (type_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + type_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.type) + return type_; +} +inline ::std::string* LayerParameter::release_type() { + clear_has_type(); + if (type_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = type_; + type_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void LayerParameter::set_allocated_type(::std::string* type) { + if (type_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete type_; + } + if (type) { + set_has_type(); + type_ = type; + } else { + clear_has_type(); + type_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.LayerParameter.bottom) + return bottom_.Get(index); +} +inline ::std::string* LayerParameter::mutable_bottom(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.bottom) + return bottom_.Mutable(index); +} +inline void LayerParameter::set_bottom(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.LayerParameter.bottom) +} +inline ::std::string* LayerParameter::add_bottom() { + return bottom_.Add(); +} +inline void LayerParameter::add_bottom(const ::std::string& value) { + bottom_.Add()->assign(value); + // @@protoc_insertion_point(field_add:ditcaffe.LayerParameter.bottom) +} +inline void LayerParameter::add_bottom(const char* value) { + bottom_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:ditcaffe.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:ditcaffe.LayerParameter.bottom) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +LayerParameter::bottom() const { + // @@protoc_insertion_point(field_list:ditcaffe.LayerParameter.bottom) + return bottom_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +LayerParameter::mutable_bottom() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.LayerParameter.top) + return top_.Get(index); +} +inline ::std::string* LayerParameter::mutable_top(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.top) + return top_.Mutable(index); +} +inline void LayerParameter::set_top(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.LayerParameter.top) +} +inline ::std::string* LayerParameter::add_top() { + return top_.Add(); +} +inline void LayerParameter::add_top(const ::std::string& value) { + top_.Add()->assign(value); + // @@protoc_insertion_point(field_add:ditcaffe.LayerParameter.top) +} +inline void LayerParameter::add_top(const char* value) { + top_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:ditcaffe.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:ditcaffe.LayerParameter.top) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +LayerParameter::top() const { + // @@protoc_insertion_point(field_list:ditcaffe.LayerParameter.top) + return top_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +LayerParameter::mutable_top() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.LayerParameter.top) + return &top_; +} + +// optional .ditcaffe.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 ::ditcaffe::Phase LayerParameter::phase() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.phase) + return static_cast< ::ditcaffe::Phase >(phase_); +} +inline void LayerParameter::set_phase(::ditcaffe::Phase value) { + assert(::ditcaffe::Phase_IsValid(value)); + set_has_phase(); + phase_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.LayerParameter.loss_weight) +} +inline void LayerParameter::add_loss_weight(float value) { + loss_weight_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.LayerParameter.loss_weight) +} +inline const ::google::protobuf::RepeatedField< float >& +LayerParameter::loss_weight() const { + // @@protoc_insertion_point(field_list:ditcaffe.LayerParameter.loss_weight) + return loss_weight_; +} +inline ::google::protobuf::RepeatedField< float >* +LayerParameter::mutable_loss_weight() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.LayerParameter.loss_weight) + return &loss_weight_; +} + +// repeated .ditcaffe.ParamSpec param = 6; +inline int LayerParameter::param_size() const { + return param_.size(); +} +inline void LayerParameter::clear_param() { + param_.Clear(); +} +inline const ::ditcaffe::ParamSpec& LayerParameter::param(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.param) + return param_.Get(index); +} +inline ::ditcaffe::ParamSpec* LayerParameter::mutable_param(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.param) + return param_.Mutable(index); +} +inline ::ditcaffe::ParamSpec* LayerParameter::add_param() { + // @@protoc_insertion_point(field_add:ditcaffe.LayerParameter.param) + return param_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::ParamSpec >& +LayerParameter::param() const { + // @@protoc_insertion_point(field_list:ditcaffe.LayerParameter.param) + return param_; +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::ParamSpec >* +LayerParameter::mutable_param() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.LayerParameter.param) + return ¶m_; +} + +// repeated .ditcaffe.BlobProto blobs = 7; +inline int LayerParameter::blobs_size() const { + return blobs_.size(); +} +inline void LayerParameter::clear_blobs() { + blobs_.Clear(); +} +inline const ::ditcaffe::BlobProto& LayerParameter::blobs(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.blobs) + return blobs_.Get(index); +} +inline ::ditcaffe::BlobProto* LayerParameter::mutable_blobs(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.blobs) + return blobs_.Mutable(index); +} +inline ::ditcaffe::BlobProto* LayerParameter::add_blobs() { + // @@protoc_insertion_point(field_add:ditcaffe.LayerParameter.blobs) + return blobs_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >& +LayerParameter::blobs() const { + // @@protoc_insertion_point(field_list:ditcaffe.LayerParameter.blobs) + return blobs_; +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >* +LayerParameter::mutable_blobs() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.LayerParameter.propagate_down) +} +inline void LayerParameter::add_propagate_down(bool value) { + propagate_down_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.LayerParameter.propagate_down) +} +inline const ::google::protobuf::RepeatedField< bool >& +LayerParameter::propagate_down() const { + // @@protoc_insertion_point(field_list:ditcaffe.LayerParameter.propagate_down) + return propagate_down_; +} +inline ::google::protobuf::RepeatedField< bool >* +LayerParameter::mutable_propagate_down() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.LayerParameter.propagate_down) + return &propagate_down_; +} + +// repeated .ditcaffe.NetStateRule include = 8; +inline int LayerParameter::include_size() const { + return include_.size(); +} +inline void LayerParameter::clear_include() { + include_.Clear(); +} +inline const ::ditcaffe::NetStateRule& LayerParameter::include(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.include) + return include_.Get(index); +} +inline ::ditcaffe::NetStateRule* LayerParameter::mutable_include(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.include) + return include_.Mutable(index); +} +inline ::ditcaffe::NetStateRule* LayerParameter::add_include() { + // @@protoc_insertion_point(field_add:ditcaffe.LayerParameter.include) + return include_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >& +LayerParameter::include() const { + // @@protoc_insertion_point(field_list:ditcaffe.LayerParameter.include) + return include_; +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >* +LayerParameter::mutable_include() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.LayerParameter.include) + return &include_; +} + +// repeated .ditcaffe.NetStateRule exclude = 9; +inline int LayerParameter::exclude_size() const { + return exclude_.size(); +} +inline void LayerParameter::clear_exclude() { + exclude_.Clear(); +} +inline const ::ditcaffe::NetStateRule& LayerParameter::exclude(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.exclude) + return exclude_.Get(index); +} +inline ::ditcaffe::NetStateRule* LayerParameter::mutable_exclude(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.exclude) + return exclude_.Mutable(index); +} +inline ::ditcaffe::NetStateRule* LayerParameter::add_exclude() { + // @@protoc_insertion_point(field_add:ditcaffe.LayerParameter.exclude) + return exclude_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >& +LayerParameter::exclude() const { + // @@protoc_insertion_point(field_list:ditcaffe.LayerParameter.exclude) + return exclude_; +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >* +LayerParameter::mutable_exclude() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.LayerParameter.exclude) + return &exclude_; +} + +// optional .ditcaffe.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_->::ditcaffe::TransformationParameter::Clear(); + clear_has_transform_param(); +} +inline const ::ditcaffe::TransformationParameter& LayerParameter::transform_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.transform_param) + return transform_param_ != NULL ? *transform_param_ : *default_instance_->transform_param_; +} +inline ::ditcaffe::TransformationParameter* LayerParameter::mutable_transform_param() { + set_has_transform_param(); + if (transform_param_ == NULL) transform_param_ = new ::ditcaffe::TransformationParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.transform_param) + return transform_param_; +} +inline ::ditcaffe::TransformationParameter* LayerParameter::release_transform_param() { + clear_has_transform_param(); + ::ditcaffe::TransformationParameter* temp = transform_param_; + transform_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_transform_param(::ditcaffe::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:ditcaffe.LayerParameter.transform_param) +} + +// optional .ditcaffe.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_->::ditcaffe::LossParameter::Clear(); + clear_has_loss_param(); +} +inline const ::ditcaffe::LossParameter& LayerParameter::loss_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.loss_param) + return loss_param_ != NULL ? *loss_param_ : *default_instance_->loss_param_; +} +inline ::ditcaffe::LossParameter* LayerParameter::mutable_loss_param() { + set_has_loss_param(); + if (loss_param_ == NULL) loss_param_ = new ::ditcaffe::LossParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.loss_param) + return loss_param_; +} +inline ::ditcaffe::LossParameter* LayerParameter::release_loss_param() { + clear_has_loss_param(); + ::ditcaffe::LossParameter* temp = loss_param_; + loss_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_loss_param(::ditcaffe::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:ditcaffe.LayerParameter.loss_param) +} + +// optional .ditcaffe.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_->::ditcaffe::AccuracyParameter::Clear(); + clear_has_accuracy_param(); +} +inline const ::ditcaffe::AccuracyParameter& LayerParameter::accuracy_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.accuracy_param) + return accuracy_param_ != NULL ? *accuracy_param_ : *default_instance_->accuracy_param_; +} +inline ::ditcaffe::AccuracyParameter* LayerParameter::mutable_accuracy_param() { + set_has_accuracy_param(); + if (accuracy_param_ == NULL) accuracy_param_ = new ::ditcaffe::AccuracyParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.accuracy_param) + return accuracy_param_; +} +inline ::ditcaffe::AccuracyParameter* LayerParameter::release_accuracy_param() { + clear_has_accuracy_param(); + ::ditcaffe::AccuracyParameter* temp = accuracy_param_; + accuracy_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_accuracy_param(::ditcaffe::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:ditcaffe.LayerParameter.accuracy_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ArgMaxParameter::Clear(); + clear_has_argmax_param(); +} +inline const ::ditcaffe::ArgMaxParameter& LayerParameter::argmax_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.argmax_param) + return argmax_param_ != NULL ? *argmax_param_ : *default_instance_->argmax_param_; +} +inline ::ditcaffe::ArgMaxParameter* LayerParameter::mutable_argmax_param() { + set_has_argmax_param(); + if (argmax_param_ == NULL) argmax_param_ = new ::ditcaffe::ArgMaxParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.argmax_param) + return argmax_param_; +} +inline ::ditcaffe::ArgMaxParameter* LayerParameter::release_argmax_param() { + clear_has_argmax_param(); + ::ditcaffe::ArgMaxParameter* temp = argmax_param_; + argmax_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_argmax_param(::ditcaffe::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:ditcaffe.LayerParameter.argmax_param) +} + +// optional .ditcaffe.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_->::ditcaffe::BatchNormParameter::Clear(); + clear_has_batch_norm_param(); +} +inline const ::ditcaffe::BatchNormParameter& LayerParameter::batch_norm_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.batch_norm_param) + return batch_norm_param_ != NULL ? *batch_norm_param_ : *default_instance_->batch_norm_param_; +} +inline ::ditcaffe::BatchNormParameter* LayerParameter::mutable_batch_norm_param() { + set_has_batch_norm_param(); + if (batch_norm_param_ == NULL) batch_norm_param_ = new ::ditcaffe::BatchNormParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.batch_norm_param) + return batch_norm_param_; +} +inline ::ditcaffe::BatchNormParameter* LayerParameter::release_batch_norm_param() { + clear_has_batch_norm_param(); + ::ditcaffe::BatchNormParameter* temp = batch_norm_param_; + batch_norm_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_batch_norm_param(::ditcaffe::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:ditcaffe.LayerParameter.batch_norm_param) +} + +// optional .ditcaffe.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_->::ditcaffe::BiasParameter::Clear(); + clear_has_bias_param(); +} +inline const ::ditcaffe::BiasParameter& LayerParameter::bias_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.bias_param) + return bias_param_ != NULL ? *bias_param_ : *default_instance_->bias_param_; +} +inline ::ditcaffe::BiasParameter* LayerParameter::mutable_bias_param() { + set_has_bias_param(); + if (bias_param_ == NULL) bias_param_ = new ::ditcaffe::BiasParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.bias_param) + return bias_param_; +} +inline ::ditcaffe::BiasParameter* LayerParameter::release_bias_param() { + clear_has_bias_param(); + ::ditcaffe::BiasParameter* temp = bias_param_; + bias_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_bias_param(::ditcaffe::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:ditcaffe.LayerParameter.bias_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ConcatParameter::Clear(); + clear_has_concat_param(); +} +inline const ::ditcaffe::ConcatParameter& LayerParameter::concat_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.concat_param) + return concat_param_ != NULL ? *concat_param_ : *default_instance_->concat_param_; +} +inline ::ditcaffe::ConcatParameter* LayerParameter::mutable_concat_param() { + set_has_concat_param(); + if (concat_param_ == NULL) concat_param_ = new ::ditcaffe::ConcatParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.concat_param) + return concat_param_; +} +inline ::ditcaffe::ConcatParameter* LayerParameter::release_concat_param() { + clear_has_concat_param(); + ::ditcaffe::ConcatParameter* temp = concat_param_; + concat_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_concat_param(::ditcaffe::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:ditcaffe.LayerParameter.concat_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ContrastiveLossParameter::Clear(); + clear_has_contrastive_loss_param(); +} +inline const ::ditcaffe::ContrastiveLossParameter& LayerParameter::contrastive_loss_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.contrastive_loss_param) + return contrastive_loss_param_ != NULL ? *contrastive_loss_param_ : *default_instance_->contrastive_loss_param_; +} +inline ::ditcaffe::ContrastiveLossParameter* LayerParameter::mutable_contrastive_loss_param() { + set_has_contrastive_loss_param(); + if (contrastive_loss_param_ == NULL) contrastive_loss_param_ = new ::ditcaffe::ContrastiveLossParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.contrastive_loss_param) + return contrastive_loss_param_; +} +inline ::ditcaffe::ContrastiveLossParameter* LayerParameter::release_contrastive_loss_param() { + clear_has_contrastive_loss_param(); + ::ditcaffe::ContrastiveLossParameter* temp = contrastive_loss_param_; + contrastive_loss_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_contrastive_loss_param(::ditcaffe::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:ditcaffe.LayerParameter.contrastive_loss_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ConvolutionParameter::Clear(); + clear_has_convolution_param(); +} +inline const ::ditcaffe::ConvolutionParameter& LayerParameter::convolution_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.convolution_param) + return convolution_param_ != NULL ? *convolution_param_ : *default_instance_->convolution_param_; +} +inline ::ditcaffe::ConvolutionParameter* LayerParameter::mutable_convolution_param() { + set_has_convolution_param(); + if (convolution_param_ == NULL) convolution_param_ = new ::ditcaffe::ConvolutionParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.convolution_param) + return convolution_param_; +} +inline ::ditcaffe::ConvolutionParameter* LayerParameter::release_convolution_param() { + clear_has_convolution_param(); + ::ditcaffe::ConvolutionParameter* temp = convolution_param_; + convolution_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_convolution_param(::ditcaffe::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:ditcaffe.LayerParameter.convolution_param) +} + +// optional .ditcaffe.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_->::ditcaffe::CropParameter::Clear(); + clear_has_crop_param(); +} +inline const ::ditcaffe::CropParameter& LayerParameter::crop_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.crop_param) + return crop_param_ != NULL ? *crop_param_ : *default_instance_->crop_param_; +} +inline ::ditcaffe::CropParameter* LayerParameter::mutable_crop_param() { + set_has_crop_param(); + if (crop_param_ == NULL) crop_param_ = new ::ditcaffe::CropParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.crop_param) + return crop_param_; +} +inline ::ditcaffe::CropParameter* LayerParameter::release_crop_param() { + clear_has_crop_param(); + ::ditcaffe::CropParameter* temp = crop_param_; + crop_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_crop_param(::ditcaffe::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:ditcaffe.LayerParameter.crop_param) +} + +// optional .ditcaffe.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_->::ditcaffe::DataParameter::Clear(); + clear_has_data_param(); +} +inline const ::ditcaffe::DataParameter& LayerParameter::data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.data_param) + return data_param_ != NULL ? *data_param_ : *default_instance_->data_param_; +} +inline ::ditcaffe::DataParameter* LayerParameter::mutable_data_param() { + set_has_data_param(); + if (data_param_ == NULL) data_param_ = new ::ditcaffe::DataParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.data_param) + return data_param_; +} +inline ::ditcaffe::DataParameter* LayerParameter::release_data_param() { + clear_has_data_param(); + ::ditcaffe::DataParameter* temp = data_param_; + data_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_data_param(::ditcaffe::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:ditcaffe.LayerParameter.data_param) +} + +// optional .ditcaffe.DropoutParameter dropout_param = 108; +inline bool LayerParameter::has_dropout_param() const { + return (_has_bits_[0] & 0x00400000u) != 0; +} +inline void LayerParameter::set_has_dropout_param() { + _has_bits_[0] |= 0x00400000u; +} +inline void LayerParameter::clear_has_dropout_param() { + _has_bits_[0] &= ~0x00400000u; +} +inline void LayerParameter::clear_dropout_param() { + if (dropout_param_ != NULL) dropout_param_->::ditcaffe::DropoutParameter::Clear(); + clear_has_dropout_param(); +} +inline const ::ditcaffe::DropoutParameter& LayerParameter::dropout_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.dropout_param) + return dropout_param_ != NULL ? *dropout_param_ : *default_instance_->dropout_param_; +} +inline ::ditcaffe::DropoutParameter* LayerParameter::mutable_dropout_param() { + set_has_dropout_param(); + if (dropout_param_ == NULL) dropout_param_ = new ::ditcaffe::DropoutParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.dropout_param) + return dropout_param_; +} +inline ::ditcaffe::DropoutParameter* LayerParameter::release_dropout_param() { + clear_has_dropout_param(); + ::ditcaffe::DropoutParameter* temp = dropout_param_; + dropout_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_dropout_param(::ditcaffe::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:ditcaffe.LayerParameter.dropout_param) +} + +// optional .ditcaffe.DummyDataParameter dummy_data_param = 109; +inline bool LayerParameter::has_dummy_data_param() const { + return (_has_bits_[0] & 0x00800000u) != 0; +} +inline void LayerParameter::set_has_dummy_data_param() { + _has_bits_[0] |= 0x00800000u; +} +inline void LayerParameter::clear_has_dummy_data_param() { + _has_bits_[0] &= ~0x00800000u; +} +inline void LayerParameter::clear_dummy_data_param() { + if (dummy_data_param_ != NULL) dummy_data_param_->::ditcaffe::DummyDataParameter::Clear(); + clear_has_dummy_data_param(); +} +inline const ::ditcaffe::DummyDataParameter& LayerParameter::dummy_data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.dummy_data_param) + return dummy_data_param_ != NULL ? *dummy_data_param_ : *default_instance_->dummy_data_param_; +} +inline ::ditcaffe::DummyDataParameter* LayerParameter::mutable_dummy_data_param() { + set_has_dummy_data_param(); + if (dummy_data_param_ == NULL) dummy_data_param_ = new ::ditcaffe::DummyDataParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.dummy_data_param) + return dummy_data_param_; +} +inline ::ditcaffe::DummyDataParameter* LayerParameter::release_dummy_data_param() { + clear_has_dummy_data_param(); + ::ditcaffe::DummyDataParameter* temp = dummy_data_param_; + dummy_data_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_dummy_data_param(::ditcaffe::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:ditcaffe.LayerParameter.dummy_data_param) +} + +// optional .ditcaffe.EltwiseParameter eltwise_param = 110; +inline bool LayerParameter::has_eltwise_param() const { + return (_has_bits_[0] & 0x01000000u) != 0; +} +inline void LayerParameter::set_has_eltwise_param() { + _has_bits_[0] |= 0x01000000u; +} +inline void LayerParameter::clear_has_eltwise_param() { + _has_bits_[0] &= ~0x01000000u; +} +inline void LayerParameter::clear_eltwise_param() { + if (eltwise_param_ != NULL) eltwise_param_->::ditcaffe::EltwiseParameter::Clear(); + clear_has_eltwise_param(); +} +inline const ::ditcaffe::EltwiseParameter& LayerParameter::eltwise_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.eltwise_param) + return eltwise_param_ != NULL ? *eltwise_param_ : *default_instance_->eltwise_param_; +} +inline ::ditcaffe::EltwiseParameter* LayerParameter::mutable_eltwise_param() { + set_has_eltwise_param(); + if (eltwise_param_ == NULL) eltwise_param_ = new ::ditcaffe::EltwiseParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.eltwise_param) + return eltwise_param_; +} +inline ::ditcaffe::EltwiseParameter* LayerParameter::release_eltwise_param() { + clear_has_eltwise_param(); + ::ditcaffe::EltwiseParameter* temp = eltwise_param_; + eltwise_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_eltwise_param(::ditcaffe::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:ditcaffe.LayerParameter.eltwise_param) +} + +// optional .ditcaffe.ELUParameter elu_param = 140; +inline bool LayerParameter::has_elu_param() const { + return (_has_bits_[0] & 0x02000000u) != 0; +} +inline void LayerParameter::set_has_elu_param() { + _has_bits_[0] |= 0x02000000u; +} +inline void LayerParameter::clear_has_elu_param() { + _has_bits_[0] &= ~0x02000000u; +} +inline void LayerParameter::clear_elu_param() { + if (elu_param_ != NULL) elu_param_->::ditcaffe::ELUParameter::Clear(); + clear_has_elu_param(); +} +inline const ::ditcaffe::ELUParameter& LayerParameter::elu_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.elu_param) + return elu_param_ != NULL ? *elu_param_ : *default_instance_->elu_param_; +} +inline ::ditcaffe::ELUParameter* LayerParameter::mutable_elu_param() { + set_has_elu_param(); + if (elu_param_ == NULL) elu_param_ = new ::ditcaffe::ELUParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.elu_param) + return elu_param_; +} +inline ::ditcaffe::ELUParameter* LayerParameter::release_elu_param() { + clear_has_elu_param(); + ::ditcaffe::ELUParameter* temp = elu_param_; + elu_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_elu_param(::ditcaffe::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:ditcaffe.LayerParameter.elu_param) +} + +// optional .ditcaffe.EmbedParameter embed_param = 137; +inline bool LayerParameter::has_embed_param() const { + return (_has_bits_[0] & 0x04000000u) != 0; +} +inline void LayerParameter::set_has_embed_param() { + _has_bits_[0] |= 0x04000000u; +} +inline void LayerParameter::clear_has_embed_param() { + _has_bits_[0] &= ~0x04000000u; +} +inline void LayerParameter::clear_embed_param() { + if (embed_param_ != NULL) embed_param_->::ditcaffe::EmbedParameter::Clear(); + clear_has_embed_param(); +} +inline const ::ditcaffe::EmbedParameter& LayerParameter::embed_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.embed_param) + return embed_param_ != NULL ? *embed_param_ : *default_instance_->embed_param_; +} +inline ::ditcaffe::EmbedParameter* LayerParameter::mutable_embed_param() { + set_has_embed_param(); + if (embed_param_ == NULL) embed_param_ = new ::ditcaffe::EmbedParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.embed_param) + return embed_param_; +} +inline ::ditcaffe::EmbedParameter* LayerParameter::release_embed_param() { + clear_has_embed_param(); + ::ditcaffe::EmbedParameter* temp = embed_param_; + embed_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_embed_param(::ditcaffe::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:ditcaffe.LayerParameter.embed_param) +} + +// optional .ditcaffe.ExpParameter exp_param = 111; +inline bool LayerParameter::has_exp_param() const { + return (_has_bits_[0] & 0x08000000u) != 0; +} +inline void LayerParameter::set_has_exp_param() { + _has_bits_[0] |= 0x08000000u; +} +inline void LayerParameter::clear_has_exp_param() { + _has_bits_[0] &= ~0x08000000u; +} +inline void LayerParameter::clear_exp_param() { + if (exp_param_ != NULL) exp_param_->::ditcaffe::ExpParameter::Clear(); + clear_has_exp_param(); +} +inline const ::ditcaffe::ExpParameter& LayerParameter::exp_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.exp_param) + return exp_param_ != NULL ? *exp_param_ : *default_instance_->exp_param_; +} +inline ::ditcaffe::ExpParameter* LayerParameter::mutable_exp_param() { + set_has_exp_param(); + if (exp_param_ == NULL) exp_param_ = new ::ditcaffe::ExpParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.exp_param) + return exp_param_; +} +inline ::ditcaffe::ExpParameter* LayerParameter::release_exp_param() { + clear_has_exp_param(); + ::ditcaffe::ExpParameter* temp = exp_param_; + exp_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_exp_param(::ditcaffe::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:ditcaffe.LayerParameter.exp_param) +} + +// optional .ditcaffe.FlattenParameter flatten_param = 135; +inline bool LayerParameter::has_flatten_param() const { + return (_has_bits_[0] & 0x10000000u) != 0; +} +inline void LayerParameter::set_has_flatten_param() { + _has_bits_[0] |= 0x10000000u; +} +inline void LayerParameter::clear_has_flatten_param() { + _has_bits_[0] &= ~0x10000000u; +} +inline void LayerParameter::clear_flatten_param() { + if (flatten_param_ != NULL) flatten_param_->::ditcaffe::FlattenParameter::Clear(); + clear_has_flatten_param(); +} +inline const ::ditcaffe::FlattenParameter& LayerParameter::flatten_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.flatten_param) + return flatten_param_ != NULL ? *flatten_param_ : *default_instance_->flatten_param_; +} +inline ::ditcaffe::FlattenParameter* LayerParameter::mutable_flatten_param() { + set_has_flatten_param(); + if (flatten_param_ == NULL) flatten_param_ = new ::ditcaffe::FlattenParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.flatten_param) + return flatten_param_; +} +inline ::ditcaffe::FlattenParameter* LayerParameter::release_flatten_param() { + clear_has_flatten_param(); + ::ditcaffe::FlattenParameter* temp = flatten_param_; + flatten_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_flatten_param(::ditcaffe::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:ditcaffe.LayerParameter.flatten_param) +} + +// optional .ditcaffe.HDF5DataParameter hdf5_data_param = 112; +inline bool LayerParameter::has_hdf5_data_param() const { + return (_has_bits_[0] & 0x20000000u) != 0; +} +inline void LayerParameter::set_has_hdf5_data_param() { + _has_bits_[0] |= 0x20000000u; +} +inline void LayerParameter::clear_has_hdf5_data_param() { + _has_bits_[0] &= ~0x20000000u; +} +inline void LayerParameter::clear_hdf5_data_param() { + if (hdf5_data_param_ != NULL) hdf5_data_param_->::ditcaffe::HDF5DataParameter::Clear(); + clear_has_hdf5_data_param(); +} +inline const ::ditcaffe::HDF5DataParameter& LayerParameter::hdf5_data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.hdf5_data_param) + return hdf5_data_param_ != NULL ? *hdf5_data_param_ : *default_instance_->hdf5_data_param_; +} +inline ::ditcaffe::HDF5DataParameter* LayerParameter::mutable_hdf5_data_param() { + set_has_hdf5_data_param(); + if (hdf5_data_param_ == NULL) hdf5_data_param_ = new ::ditcaffe::HDF5DataParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.hdf5_data_param) + return hdf5_data_param_; +} +inline ::ditcaffe::HDF5DataParameter* LayerParameter::release_hdf5_data_param() { + clear_has_hdf5_data_param(); + ::ditcaffe::HDF5DataParameter* temp = hdf5_data_param_; + hdf5_data_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_hdf5_data_param(::ditcaffe::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:ditcaffe.LayerParameter.hdf5_data_param) +} + +// optional .ditcaffe.HDF5OutputParameter hdf5_output_param = 113; +inline bool LayerParameter::has_hdf5_output_param() const { + return (_has_bits_[0] & 0x40000000u) != 0; +} +inline void LayerParameter::set_has_hdf5_output_param() { + _has_bits_[0] |= 0x40000000u; +} +inline void LayerParameter::clear_has_hdf5_output_param() { + _has_bits_[0] &= ~0x40000000u; +} +inline void LayerParameter::clear_hdf5_output_param() { + if (hdf5_output_param_ != NULL) hdf5_output_param_->::ditcaffe::HDF5OutputParameter::Clear(); + clear_has_hdf5_output_param(); +} +inline const ::ditcaffe::HDF5OutputParameter& LayerParameter::hdf5_output_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.hdf5_output_param) + return hdf5_output_param_ != NULL ? *hdf5_output_param_ : *default_instance_->hdf5_output_param_; +} +inline ::ditcaffe::HDF5OutputParameter* LayerParameter::mutable_hdf5_output_param() { + set_has_hdf5_output_param(); + if (hdf5_output_param_ == NULL) hdf5_output_param_ = new ::ditcaffe::HDF5OutputParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.hdf5_output_param) + return hdf5_output_param_; +} +inline ::ditcaffe::HDF5OutputParameter* LayerParameter::release_hdf5_output_param() { + clear_has_hdf5_output_param(); + ::ditcaffe::HDF5OutputParameter* temp = hdf5_output_param_; + hdf5_output_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_hdf5_output_param(::ditcaffe::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:ditcaffe.LayerParameter.hdf5_output_param) +} + +// optional .ditcaffe.HingeLossParameter hinge_loss_param = 114; +inline bool LayerParameter::has_hinge_loss_param() const { + return (_has_bits_[0] & 0x80000000u) != 0; +} +inline void LayerParameter::set_has_hinge_loss_param() { + _has_bits_[0] |= 0x80000000u; +} +inline void LayerParameter::clear_has_hinge_loss_param() { + _has_bits_[0] &= ~0x80000000u; +} +inline void LayerParameter::clear_hinge_loss_param() { + if (hinge_loss_param_ != NULL) hinge_loss_param_->::ditcaffe::HingeLossParameter::Clear(); + clear_has_hinge_loss_param(); +} +inline const ::ditcaffe::HingeLossParameter& LayerParameter::hinge_loss_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.hinge_loss_param) + return hinge_loss_param_ != NULL ? *hinge_loss_param_ : *default_instance_->hinge_loss_param_; +} +inline ::ditcaffe::HingeLossParameter* LayerParameter::mutable_hinge_loss_param() { + set_has_hinge_loss_param(); + if (hinge_loss_param_ == NULL) hinge_loss_param_ = new ::ditcaffe::HingeLossParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.hinge_loss_param) + return hinge_loss_param_; +} +inline ::ditcaffe::HingeLossParameter* LayerParameter::release_hinge_loss_param() { + clear_has_hinge_loss_param(); + ::ditcaffe::HingeLossParameter* temp = hinge_loss_param_; + hinge_loss_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_hinge_loss_param(::ditcaffe::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:ditcaffe.LayerParameter.hinge_loss_param) +} + +// optional .ditcaffe.ImageDataParameter image_data_param = 115; +inline bool LayerParameter::has_image_data_param() const { + return (_has_bits_[1] & 0x00000001u) != 0; +} +inline void LayerParameter::set_has_image_data_param() { + _has_bits_[1] |= 0x00000001u; +} +inline void LayerParameter::clear_has_image_data_param() { + _has_bits_[1] &= ~0x00000001u; +} +inline void LayerParameter::clear_image_data_param() { + if (image_data_param_ != NULL) image_data_param_->::ditcaffe::ImageDataParameter::Clear(); + clear_has_image_data_param(); +} +inline const ::ditcaffe::ImageDataParameter& LayerParameter::image_data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.image_data_param) + return image_data_param_ != NULL ? *image_data_param_ : *default_instance_->image_data_param_; +} +inline ::ditcaffe::ImageDataParameter* LayerParameter::mutable_image_data_param() { + set_has_image_data_param(); + if (image_data_param_ == NULL) image_data_param_ = new ::ditcaffe::ImageDataParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.image_data_param) + return image_data_param_; +} +inline ::ditcaffe::ImageDataParameter* LayerParameter::release_image_data_param() { + clear_has_image_data_param(); + ::ditcaffe::ImageDataParameter* temp = image_data_param_; + image_data_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_image_data_param(::ditcaffe::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:ditcaffe.LayerParameter.image_data_param) +} + +// optional .ditcaffe.InfogainLossParameter infogain_loss_param = 116; +inline bool LayerParameter::has_infogain_loss_param() const { + return (_has_bits_[1] & 0x00000002u) != 0; +} +inline void LayerParameter::set_has_infogain_loss_param() { + _has_bits_[1] |= 0x00000002u; +} +inline void LayerParameter::clear_has_infogain_loss_param() { + _has_bits_[1] &= ~0x00000002u; +} +inline void LayerParameter::clear_infogain_loss_param() { + if (infogain_loss_param_ != NULL) infogain_loss_param_->::ditcaffe::InfogainLossParameter::Clear(); + clear_has_infogain_loss_param(); +} +inline const ::ditcaffe::InfogainLossParameter& LayerParameter::infogain_loss_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.infogain_loss_param) + return infogain_loss_param_ != NULL ? *infogain_loss_param_ : *default_instance_->infogain_loss_param_; +} +inline ::ditcaffe::InfogainLossParameter* LayerParameter::mutable_infogain_loss_param() { + set_has_infogain_loss_param(); + if (infogain_loss_param_ == NULL) infogain_loss_param_ = new ::ditcaffe::InfogainLossParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.infogain_loss_param) + return infogain_loss_param_; +} +inline ::ditcaffe::InfogainLossParameter* LayerParameter::release_infogain_loss_param() { + clear_has_infogain_loss_param(); + ::ditcaffe::InfogainLossParameter* temp = infogain_loss_param_; + infogain_loss_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_infogain_loss_param(::ditcaffe::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:ditcaffe.LayerParameter.infogain_loss_param) +} + +// optional .ditcaffe.InnerProductParameter inner_product_param = 117; +inline bool LayerParameter::has_inner_product_param() const { + return (_has_bits_[1] & 0x00000004u) != 0; +} +inline void LayerParameter::set_has_inner_product_param() { + _has_bits_[1] |= 0x00000004u; +} +inline void LayerParameter::clear_has_inner_product_param() { + _has_bits_[1] &= ~0x00000004u; +} +inline void LayerParameter::clear_inner_product_param() { + if (inner_product_param_ != NULL) inner_product_param_->::ditcaffe::InnerProductParameter::Clear(); + clear_has_inner_product_param(); +} +inline const ::ditcaffe::InnerProductParameter& LayerParameter::inner_product_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.inner_product_param) + return inner_product_param_ != NULL ? *inner_product_param_ : *default_instance_->inner_product_param_; +} +inline ::ditcaffe::InnerProductParameter* LayerParameter::mutable_inner_product_param() { + set_has_inner_product_param(); + if (inner_product_param_ == NULL) inner_product_param_ = new ::ditcaffe::InnerProductParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.inner_product_param) + return inner_product_param_; +} +inline ::ditcaffe::InnerProductParameter* LayerParameter::release_inner_product_param() { + clear_has_inner_product_param(); + ::ditcaffe::InnerProductParameter* temp = inner_product_param_; + inner_product_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_inner_product_param(::ditcaffe::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:ditcaffe.LayerParameter.inner_product_param) +} + +// optional .ditcaffe.InputParameter input_param = 143; +inline bool LayerParameter::has_input_param() const { + return (_has_bits_[1] & 0x00000008u) != 0; +} +inline void LayerParameter::set_has_input_param() { + _has_bits_[1] |= 0x00000008u; +} +inline void LayerParameter::clear_has_input_param() { + _has_bits_[1] &= ~0x00000008u; +} +inline void LayerParameter::clear_input_param() { + if (input_param_ != NULL) input_param_->::ditcaffe::InputParameter::Clear(); + clear_has_input_param(); +} +inline const ::ditcaffe::InputParameter& LayerParameter::input_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.input_param) + return input_param_ != NULL ? *input_param_ : *default_instance_->input_param_; +} +inline ::ditcaffe::InputParameter* LayerParameter::mutable_input_param() { + set_has_input_param(); + if (input_param_ == NULL) input_param_ = new ::ditcaffe::InputParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.input_param) + return input_param_; +} +inline ::ditcaffe::InputParameter* LayerParameter::release_input_param() { + clear_has_input_param(); + ::ditcaffe::InputParameter* temp = input_param_; + input_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_input_param(::ditcaffe::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:ditcaffe.LayerParameter.input_param) +} + +// optional .ditcaffe.LogParameter log_param = 134; +inline bool LayerParameter::has_log_param() const { + return (_has_bits_[1] & 0x00000010u) != 0; +} +inline void LayerParameter::set_has_log_param() { + _has_bits_[1] |= 0x00000010u; +} +inline void LayerParameter::clear_has_log_param() { + _has_bits_[1] &= ~0x00000010u; +} +inline void LayerParameter::clear_log_param() { + if (log_param_ != NULL) log_param_->::ditcaffe::LogParameter::Clear(); + clear_has_log_param(); +} +inline const ::ditcaffe::LogParameter& LayerParameter::log_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.log_param) + return log_param_ != NULL ? *log_param_ : *default_instance_->log_param_; +} +inline ::ditcaffe::LogParameter* LayerParameter::mutable_log_param() { + set_has_log_param(); + if (log_param_ == NULL) log_param_ = new ::ditcaffe::LogParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.log_param) + return log_param_; +} +inline ::ditcaffe::LogParameter* LayerParameter::release_log_param() { + clear_has_log_param(); + ::ditcaffe::LogParameter* temp = log_param_; + log_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_log_param(::ditcaffe::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:ditcaffe.LayerParameter.log_param) +} + +// optional .ditcaffe.LRNParameter lrn_param = 118; +inline bool LayerParameter::has_lrn_param() const { + return (_has_bits_[1] & 0x00000020u) != 0; +} +inline void LayerParameter::set_has_lrn_param() { + _has_bits_[1] |= 0x00000020u; +} +inline void LayerParameter::clear_has_lrn_param() { + _has_bits_[1] &= ~0x00000020u; +} +inline void LayerParameter::clear_lrn_param() { + if (lrn_param_ != NULL) lrn_param_->::ditcaffe::LRNParameter::Clear(); + clear_has_lrn_param(); +} +inline const ::ditcaffe::LRNParameter& LayerParameter::lrn_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.lrn_param) + return lrn_param_ != NULL ? *lrn_param_ : *default_instance_->lrn_param_; +} +inline ::ditcaffe::LRNParameter* LayerParameter::mutable_lrn_param() { + set_has_lrn_param(); + if (lrn_param_ == NULL) lrn_param_ = new ::ditcaffe::LRNParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.lrn_param) + return lrn_param_; +} +inline ::ditcaffe::LRNParameter* LayerParameter::release_lrn_param() { + clear_has_lrn_param(); + ::ditcaffe::LRNParameter* temp = lrn_param_; + lrn_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_lrn_param(::ditcaffe::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:ditcaffe.LayerParameter.lrn_param) +} + +// optional .ditcaffe.MemoryDataParameter memory_data_param = 119; +inline bool LayerParameter::has_memory_data_param() const { + return (_has_bits_[1] & 0x00000040u) != 0; +} +inline void LayerParameter::set_has_memory_data_param() { + _has_bits_[1] |= 0x00000040u; +} +inline void LayerParameter::clear_has_memory_data_param() { + _has_bits_[1] &= ~0x00000040u; +} +inline void LayerParameter::clear_memory_data_param() { + if (memory_data_param_ != NULL) memory_data_param_->::ditcaffe::MemoryDataParameter::Clear(); + clear_has_memory_data_param(); +} +inline const ::ditcaffe::MemoryDataParameter& LayerParameter::memory_data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.memory_data_param) + return memory_data_param_ != NULL ? *memory_data_param_ : *default_instance_->memory_data_param_; +} +inline ::ditcaffe::MemoryDataParameter* LayerParameter::mutable_memory_data_param() { + set_has_memory_data_param(); + if (memory_data_param_ == NULL) memory_data_param_ = new ::ditcaffe::MemoryDataParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.memory_data_param) + return memory_data_param_; +} +inline ::ditcaffe::MemoryDataParameter* LayerParameter::release_memory_data_param() { + clear_has_memory_data_param(); + ::ditcaffe::MemoryDataParameter* temp = memory_data_param_; + memory_data_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_memory_data_param(::ditcaffe::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:ditcaffe.LayerParameter.memory_data_param) +} + +// optional .ditcaffe.MVNParameter mvn_param = 120; +inline bool LayerParameter::has_mvn_param() const { + return (_has_bits_[1] & 0x00000080u) != 0; +} +inline void LayerParameter::set_has_mvn_param() { + _has_bits_[1] |= 0x00000080u; +} +inline void LayerParameter::clear_has_mvn_param() { + _has_bits_[1] &= ~0x00000080u; +} +inline void LayerParameter::clear_mvn_param() { + if (mvn_param_ != NULL) mvn_param_->::ditcaffe::MVNParameter::Clear(); + clear_has_mvn_param(); +} +inline const ::ditcaffe::MVNParameter& LayerParameter::mvn_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.mvn_param) + return mvn_param_ != NULL ? *mvn_param_ : *default_instance_->mvn_param_; +} +inline ::ditcaffe::MVNParameter* LayerParameter::mutable_mvn_param() { + set_has_mvn_param(); + if (mvn_param_ == NULL) mvn_param_ = new ::ditcaffe::MVNParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.mvn_param) + return mvn_param_; +} +inline ::ditcaffe::MVNParameter* LayerParameter::release_mvn_param() { + clear_has_mvn_param(); + ::ditcaffe::MVNParameter* temp = mvn_param_; + mvn_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_mvn_param(::ditcaffe::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:ditcaffe.LayerParameter.mvn_param) +} + +// optional .ditcaffe.ParameterParameter parameter_param = 145; +inline bool LayerParameter::has_parameter_param() const { + return (_has_bits_[1] & 0x00000100u) != 0; +} +inline void LayerParameter::set_has_parameter_param() { + _has_bits_[1] |= 0x00000100u; +} +inline void LayerParameter::clear_has_parameter_param() { + _has_bits_[1] &= ~0x00000100u; +} +inline void LayerParameter::clear_parameter_param() { + if (parameter_param_ != NULL) parameter_param_->::ditcaffe::ParameterParameter::Clear(); + clear_has_parameter_param(); +} +inline const ::ditcaffe::ParameterParameter& LayerParameter::parameter_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.parameter_param) + return parameter_param_ != NULL ? *parameter_param_ : *default_instance_->parameter_param_; +} +inline ::ditcaffe::ParameterParameter* LayerParameter::mutable_parameter_param() { + set_has_parameter_param(); + if (parameter_param_ == NULL) parameter_param_ = new ::ditcaffe::ParameterParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.parameter_param) + return parameter_param_; +} +inline ::ditcaffe::ParameterParameter* LayerParameter::release_parameter_param() { + clear_has_parameter_param(); + ::ditcaffe::ParameterParameter* temp = parameter_param_; + parameter_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_parameter_param(::ditcaffe::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:ditcaffe.LayerParameter.parameter_param) +} + +// optional .ditcaffe.PoolingParameter pooling_param = 121; +inline bool LayerParameter::has_pooling_param() const { + return (_has_bits_[1] & 0x00000200u) != 0; +} +inline void LayerParameter::set_has_pooling_param() { + _has_bits_[1] |= 0x00000200u; +} +inline void LayerParameter::clear_has_pooling_param() { + _has_bits_[1] &= ~0x00000200u; +} +inline void LayerParameter::clear_pooling_param() { + if (pooling_param_ != NULL) pooling_param_->::ditcaffe::PoolingParameter::Clear(); + clear_has_pooling_param(); +} +inline const ::ditcaffe::PoolingParameter& LayerParameter::pooling_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.pooling_param) + return pooling_param_ != NULL ? *pooling_param_ : *default_instance_->pooling_param_; +} +inline ::ditcaffe::PoolingParameter* LayerParameter::mutable_pooling_param() { + set_has_pooling_param(); + if (pooling_param_ == NULL) pooling_param_ = new ::ditcaffe::PoolingParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.pooling_param) + return pooling_param_; +} +inline ::ditcaffe::PoolingParameter* LayerParameter::release_pooling_param() { + clear_has_pooling_param(); + ::ditcaffe::PoolingParameter* temp = pooling_param_; + pooling_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_pooling_param(::ditcaffe::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:ditcaffe.LayerParameter.pooling_param) +} + +// optional .ditcaffe.PowerParameter power_param = 122; +inline bool LayerParameter::has_power_param() const { + return (_has_bits_[1] & 0x00000400u) != 0; +} +inline void LayerParameter::set_has_power_param() { + _has_bits_[1] |= 0x00000400u; +} +inline void LayerParameter::clear_has_power_param() { + _has_bits_[1] &= ~0x00000400u; +} +inline void LayerParameter::clear_power_param() { + if (power_param_ != NULL) power_param_->::ditcaffe::PowerParameter::Clear(); + clear_has_power_param(); +} +inline const ::ditcaffe::PowerParameter& LayerParameter::power_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.power_param) + return power_param_ != NULL ? *power_param_ : *default_instance_->power_param_; +} +inline ::ditcaffe::PowerParameter* LayerParameter::mutable_power_param() { + set_has_power_param(); + if (power_param_ == NULL) power_param_ = new ::ditcaffe::PowerParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.power_param) + return power_param_; +} +inline ::ditcaffe::PowerParameter* LayerParameter::release_power_param() { + clear_has_power_param(); + ::ditcaffe::PowerParameter* temp = power_param_; + power_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_power_param(::ditcaffe::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:ditcaffe.LayerParameter.power_param) +} + +// optional .ditcaffe.PReLUParameter prelu_param = 131; +inline bool LayerParameter::has_prelu_param() const { + return (_has_bits_[1] & 0x00000800u) != 0; +} +inline void LayerParameter::set_has_prelu_param() { + _has_bits_[1] |= 0x00000800u; +} +inline void LayerParameter::clear_has_prelu_param() { + _has_bits_[1] &= ~0x00000800u; +} +inline void LayerParameter::clear_prelu_param() { + if (prelu_param_ != NULL) prelu_param_->::ditcaffe::PReLUParameter::Clear(); + clear_has_prelu_param(); +} +inline const ::ditcaffe::PReLUParameter& LayerParameter::prelu_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.prelu_param) + return prelu_param_ != NULL ? *prelu_param_ : *default_instance_->prelu_param_; +} +inline ::ditcaffe::PReLUParameter* LayerParameter::mutable_prelu_param() { + set_has_prelu_param(); + if (prelu_param_ == NULL) prelu_param_ = new ::ditcaffe::PReLUParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.prelu_param) + return prelu_param_; +} +inline ::ditcaffe::PReLUParameter* LayerParameter::release_prelu_param() { + clear_has_prelu_param(); + ::ditcaffe::PReLUParameter* temp = prelu_param_; + prelu_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_prelu_param(::ditcaffe::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:ditcaffe.LayerParameter.prelu_param) +} + +// optional .ditcaffe.PythonParameter python_param = 130; +inline bool LayerParameter::has_python_param() const { + return (_has_bits_[1] & 0x00001000u) != 0; +} +inline void LayerParameter::set_has_python_param() { + _has_bits_[1] |= 0x00001000u; +} +inline void LayerParameter::clear_has_python_param() { + _has_bits_[1] &= ~0x00001000u; +} +inline void LayerParameter::clear_python_param() { + if (python_param_ != NULL) python_param_->::ditcaffe::PythonParameter::Clear(); + clear_has_python_param(); +} +inline const ::ditcaffe::PythonParameter& LayerParameter::python_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.python_param) + return python_param_ != NULL ? *python_param_ : *default_instance_->python_param_; +} +inline ::ditcaffe::PythonParameter* LayerParameter::mutable_python_param() { + set_has_python_param(); + if (python_param_ == NULL) python_param_ = new ::ditcaffe::PythonParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.python_param) + return python_param_; +} +inline ::ditcaffe::PythonParameter* LayerParameter::release_python_param() { + clear_has_python_param(); + ::ditcaffe::PythonParameter* temp = python_param_; + python_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_python_param(::ditcaffe::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:ditcaffe.LayerParameter.python_param) +} + +// optional .ditcaffe.ReductionParameter reduction_param = 136; +inline bool LayerParameter::has_reduction_param() const { + return (_has_bits_[1] & 0x00002000u) != 0; +} +inline void LayerParameter::set_has_reduction_param() { + _has_bits_[1] |= 0x00002000u; +} +inline void LayerParameter::clear_has_reduction_param() { + _has_bits_[1] &= ~0x00002000u; +} +inline void LayerParameter::clear_reduction_param() { + if (reduction_param_ != NULL) reduction_param_->::ditcaffe::ReductionParameter::Clear(); + clear_has_reduction_param(); +} +inline const ::ditcaffe::ReductionParameter& LayerParameter::reduction_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.reduction_param) + return reduction_param_ != NULL ? *reduction_param_ : *default_instance_->reduction_param_; +} +inline ::ditcaffe::ReductionParameter* LayerParameter::mutable_reduction_param() { + set_has_reduction_param(); + if (reduction_param_ == NULL) reduction_param_ = new ::ditcaffe::ReductionParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.reduction_param) + return reduction_param_; +} +inline ::ditcaffe::ReductionParameter* LayerParameter::release_reduction_param() { + clear_has_reduction_param(); + ::ditcaffe::ReductionParameter* temp = reduction_param_; + reduction_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_reduction_param(::ditcaffe::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:ditcaffe.LayerParameter.reduction_param) +} + +// optional .ditcaffe.ReLUParameter relu_param = 123; +inline bool LayerParameter::has_relu_param() const { + return (_has_bits_[1] & 0x00004000u) != 0; +} +inline void LayerParameter::set_has_relu_param() { + _has_bits_[1] |= 0x00004000u; +} +inline void LayerParameter::clear_has_relu_param() { + _has_bits_[1] &= ~0x00004000u; +} +inline void LayerParameter::clear_relu_param() { + if (relu_param_ != NULL) relu_param_->::ditcaffe::ReLUParameter::Clear(); + clear_has_relu_param(); +} +inline const ::ditcaffe::ReLUParameter& LayerParameter::relu_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.relu_param) + return relu_param_ != NULL ? *relu_param_ : *default_instance_->relu_param_; +} +inline ::ditcaffe::ReLUParameter* LayerParameter::mutable_relu_param() { + set_has_relu_param(); + if (relu_param_ == NULL) relu_param_ = new ::ditcaffe::ReLUParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.relu_param) + return relu_param_; +} +inline ::ditcaffe::ReLUParameter* LayerParameter::release_relu_param() { + clear_has_relu_param(); + ::ditcaffe::ReLUParameter* temp = relu_param_; + relu_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_relu_param(::ditcaffe::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:ditcaffe.LayerParameter.relu_param) +} + +// optional .ditcaffe.ReshapeParameter reshape_param = 133; +inline bool LayerParameter::has_reshape_param() const { + return (_has_bits_[1] & 0x00008000u) != 0; +} +inline void LayerParameter::set_has_reshape_param() { + _has_bits_[1] |= 0x00008000u; +} +inline void LayerParameter::clear_has_reshape_param() { + _has_bits_[1] &= ~0x00008000u; +} +inline void LayerParameter::clear_reshape_param() { + if (reshape_param_ != NULL) reshape_param_->::ditcaffe::ReshapeParameter::Clear(); + clear_has_reshape_param(); +} +inline const ::ditcaffe::ReshapeParameter& LayerParameter::reshape_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.reshape_param) + return reshape_param_ != NULL ? *reshape_param_ : *default_instance_->reshape_param_; +} +inline ::ditcaffe::ReshapeParameter* LayerParameter::mutable_reshape_param() { + set_has_reshape_param(); + if (reshape_param_ == NULL) reshape_param_ = new ::ditcaffe::ReshapeParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.reshape_param) + return reshape_param_; +} +inline ::ditcaffe::ReshapeParameter* LayerParameter::release_reshape_param() { + clear_has_reshape_param(); + ::ditcaffe::ReshapeParameter* temp = reshape_param_; + reshape_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_reshape_param(::ditcaffe::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:ditcaffe.LayerParameter.reshape_param) +} + +// optional .ditcaffe.ScaleParameter scale_param = 142; +inline bool LayerParameter::has_scale_param() const { + return (_has_bits_[1] & 0x00010000u) != 0; +} +inline void LayerParameter::set_has_scale_param() { + _has_bits_[1] |= 0x00010000u; +} +inline void LayerParameter::clear_has_scale_param() { + _has_bits_[1] &= ~0x00010000u; +} +inline void LayerParameter::clear_scale_param() { + if (scale_param_ != NULL) scale_param_->::ditcaffe::ScaleParameter::Clear(); + clear_has_scale_param(); +} +inline const ::ditcaffe::ScaleParameter& LayerParameter::scale_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.scale_param) + return scale_param_ != NULL ? *scale_param_ : *default_instance_->scale_param_; +} +inline ::ditcaffe::ScaleParameter* LayerParameter::mutable_scale_param() { + set_has_scale_param(); + if (scale_param_ == NULL) scale_param_ = new ::ditcaffe::ScaleParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.scale_param) + return scale_param_; +} +inline ::ditcaffe::ScaleParameter* LayerParameter::release_scale_param() { + clear_has_scale_param(); + ::ditcaffe::ScaleParameter* temp = scale_param_; + scale_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_scale_param(::ditcaffe::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:ditcaffe.LayerParameter.scale_param) +} + +// optional .ditcaffe.SigmoidParameter sigmoid_param = 124; +inline bool LayerParameter::has_sigmoid_param() const { + return (_has_bits_[1] & 0x00020000u) != 0; +} +inline void LayerParameter::set_has_sigmoid_param() { + _has_bits_[1] |= 0x00020000u; +} +inline void LayerParameter::clear_has_sigmoid_param() { + _has_bits_[1] &= ~0x00020000u; +} +inline void LayerParameter::clear_sigmoid_param() { + if (sigmoid_param_ != NULL) sigmoid_param_->::ditcaffe::SigmoidParameter::Clear(); + clear_has_sigmoid_param(); +} +inline const ::ditcaffe::SigmoidParameter& LayerParameter::sigmoid_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.sigmoid_param) + return sigmoid_param_ != NULL ? *sigmoid_param_ : *default_instance_->sigmoid_param_; +} +inline ::ditcaffe::SigmoidParameter* LayerParameter::mutable_sigmoid_param() { + set_has_sigmoid_param(); + if (sigmoid_param_ == NULL) sigmoid_param_ = new ::ditcaffe::SigmoidParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.sigmoid_param) + return sigmoid_param_; +} +inline ::ditcaffe::SigmoidParameter* LayerParameter::release_sigmoid_param() { + clear_has_sigmoid_param(); + ::ditcaffe::SigmoidParameter* temp = sigmoid_param_; + sigmoid_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_sigmoid_param(::ditcaffe::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:ditcaffe.LayerParameter.sigmoid_param) +} + +// optional .ditcaffe.SoftmaxParameter softmax_param = 125; +inline bool LayerParameter::has_softmax_param() const { + return (_has_bits_[1] & 0x00040000u) != 0; +} +inline void LayerParameter::set_has_softmax_param() { + _has_bits_[1] |= 0x00040000u; +} +inline void LayerParameter::clear_has_softmax_param() { + _has_bits_[1] &= ~0x00040000u; +} +inline void LayerParameter::clear_softmax_param() { + if (softmax_param_ != NULL) softmax_param_->::ditcaffe::SoftmaxParameter::Clear(); + clear_has_softmax_param(); +} +inline const ::ditcaffe::SoftmaxParameter& LayerParameter::softmax_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.softmax_param) + return softmax_param_ != NULL ? *softmax_param_ : *default_instance_->softmax_param_; +} +inline ::ditcaffe::SoftmaxParameter* LayerParameter::mutable_softmax_param() { + set_has_softmax_param(); + if (softmax_param_ == NULL) softmax_param_ = new ::ditcaffe::SoftmaxParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.softmax_param) + return softmax_param_; +} +inline ::ditcaffe::SoftmaxParameter* LayerParameter::release_softmax_param() { + clear_has_softmax_param(); + ::ditcaffe::SoftmaxParameter* temp = softmax_param_; + softmax_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_softmax_param(::ditcaffe::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:ditcaffe.LayerParameter.softmax_param) +} + +// optional .ditcaffe.SPPParameter spp_param = 132; +inline bool LayerParameter::has_spp_param() const { + return (_has_bits_[1] & 0x00080000u) != 0; +} +inline void LayerParameter::set_has_spp_param() { + _has_bits_[1] |= 0x00080000u; +} +inline void LayerParameter::clear_has_spp_param() { + _has_bits_[1] &= ~0x00080000u; +} +inline void LayerParameter::clear_spp_param() { + if (spp_param_ != NULL) spp_param_->::ditcaffe::SPPParameter::Clear(); + clear_has_spp_param(); +} +inline const ::ditcaffe::SPPParameter& LayerParameter::spp_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.spp_param) + return spp_param_ != NULL ? *spp_param_ : *default_instance_->spp_param_; +} +inline ::ditcaffe::SPPParameter* LayerParameter::mutable_spp_param() { + set_has_spp_param(); + if (spp_param_ == NULL) spp_param_ = new ::ditcaffe::SPPParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.spp_param) + return spp_param_; +} +inline ::ditcaffe::SPPParameter* LayerParameter::release_spp_param() { + clear_has_spp_param(); + ::ditcaffe::SPPParameter* temp = spp_param_; + spp_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_spp_param(::ditcaffe::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:ditcaffe.LayerParameter.spp_param) +} + +// optional .ditcaffe.SliceParameter slice_param = 126; +inline bool LayerParameter::has_slice_param() const { + return (_has_bits_[1] & 0x00100000u) != 0; +} +inline void LayerParameter::set_has_slice_param() { + _has_bits_[1] |= 0x00100000u; +} +inline void LayerParameter::clear_has_slice_param() { + _has_bits_[1] &= ~0x00100000u; +} +inline void LayerParameter::clear_slice_param() { + if (slice_param_ != NULL) slice_param_->::ditcaffe::SliceParameter::Clear(); + clear_has_slice_param(); +} +inline const ::ditcaffe::SliceParameter& LayerParameter::slice_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.slice_param) + return slice_param_ != NULL ? *slice_param_ : *default_instance_->slice_param_; +} +inline ::ditcaffe::SliceParameter* LayerParameter::mutable_slice_param() { + set_has_slice_param(); + if (slice_param_ == NULL) slice_param_ = new ::ditcaffe::SliceParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.slice_param) + return slice_param_; +} +inline ::ditcaffe::SliceParameter* LayerParameter::release_slice_param() { + clear_has_slice_param(); + ::ditcaffe::SliceParameter* temp = slice_param_; + slice_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_slice_param(::ditcaffe::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:ditcaffe.LayerParameter.slice_param) +} + +// optional .ditcaffe.TanHParameter tanh_param = 127; +inline bool LayerParameter::has_tanh_param() const { + return (_has_bits_[1] & 0x00200000u) != 0; +} +inline void LayerParameter::set_has_tanh_param() { + _has_bits_[1] |= 0x00200000u; +} +inline void LayerParameter::clear_has_tanh_param() { + _has_bits_[1] &= ~0x00200000u; +} +inline void LayerParameter::clear_tanh_param() { + if (tanh_param_ != NULL) tanh_param_->::ditcaffe::TanHParameter::Clear(); + clear_has_tanh_param(); +} +inline const ::ditcaffe::TanHParameter& LayerParameter::tanh_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.tanh_param) + return tanh_param_ != NULL ? *tanh_param_ : *default_instance_->tanh_param_; +} +inline ::ditcaffe::TanHParameter* LayerParameter::mutable_tanh_param() { + set_has_tanh_param(); + if (tanh_param_ == NULL) tanh_param_ = new ::ditcaffe::TanHParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.tanh_param) + return tanh_param_; +} +inline ::ditcaffe::TanHParameter* LayerParameter::release_tanh_param() { + clear_has_tanh_param(); + ::ditcaffe::TanHParameter* temp = tanh_param_; + tanh_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_tanh_param(::ditcaffe::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:ditcaffe.LayerParameter.tanh_param) +} + +// optional .ditcaffe.ThresholdParameter threshold_param = 128; +inline bool LayerParameter::has_threshold_param() const { + return (_has_bits_[1] & 0x00400000u) != 0; +} +inline void LayerParameter::set_has_threshold_param() { + _has_bits_[1] |= 0x00400000u; +} +inline void LayerParameter::clear_has_threshold_param() { + _has_bits_[1] &= ~0x00400000u; +} +inline void LayerParameter::clear_threshold_param() { + if (threshold_param_ != NULL) threshold_param_->::ditcaffe::ThresholdParameter::Clear(); + clear_has_threshold_param(); +} +inline const ::ditcaffe::ThresholdParameter& LayerParameter::threshold_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.threshold_param) + return threshold_param_ != NULL ? *threshold_param_ : *default_instance_->threshold_param_; +} +inline ::ditcaffe::ThresholdParameter* LayerParameter::mutable_threshold_param() { + set_has_threshold_param(); + if (threshold_param_ == NULL) threshold_param_ = new ::ditcaffe::ThresholdParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.threshold_param) + return threshold_param_; +} +inline ::ditcaffe::ThresholdParameter* LayerParameter::release_threshold_param() { + clear_has_threshold_param(); + ::ditcaffe::ThresholdParameter* temp = threshold_param_; + threshold_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_threshold_param(::ditcaffe::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:ditcaffe.LayerParameter.threshold_param) +} + +// optional .ditcaffe.TileParameter tile_param = 138; +inline bool LayerParameter::has_tile_param() const { + return (_has_bits_[1] & 0x00800000u) != 0; +} +inline void LayerParameter::set_has_tile_param() { + _has_bits_[1] |= 0x00800000u; +} +inline void LayerParameter::clear_has_tile_param() { + _has_bits_[1] &= ~0x00800000u; +} +inline void LayerParameter::clear_tile_param() { + if (tile_param_ != NULL) tile_param_->::ditcaffe::TileParameter::Clear(); + clear_has_tile_param(); +} +inline const ::ditcaffe::TileParameter& LayerParameter::tile_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.tile_param) + return tile_param_ != NULL ? *tile_param_ : *default_instance_->tile_param_; +} +inline ::ditcaffe::TileParameter* LayerParameter::mutable_tile_param() { + set_has_tile_param(); + if (tile_param_ == NULL) tile_param_ = new ::ditcaffe::TileParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.tile_param) + return tile_param_; +} +inline ::ditcaffe::TileParameter* LayerParameter::release_tile_param() { + clear_has_tile_param(); + ::ditcaffe::TileParameter* temp = tile_param_; + tile_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_tile_param(::ditcaffe::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:ditcaffe.LayerParameter.tile_param) +} + +// optional .ditcaffe.WindowDataParameter window_data_param = 129; +inline bool LayerParameter::has_window_data_param() const { + return (_has_bits_[1] & 0x01000000u) != 0; +} +inline void LayerParameter::set_has_window_data_param() { + _has_bits_[1] |= 0x01000000u; +} +inline void LayerParameter::clear_has_window_data_param() { + _has_bits_[1] &= ~0x01000000u; +} +inline void LayerParameter::clear_window_data_param() { + if (window_data_param_ != NULL) window_data_param_->::ditcaffe::WindowDataParameter::Clear(); + clear_has_window_data_param(); +} +inline const ::ditcaffe::WindowDataParameter& LayerParameter::window_data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.window_data_param) + return window_data_param_ != NULL ? *window_data_param_ : *default_instance_->window_data_param_; +} +inline ::ditcaffe::WindowDataParameter* LayerParameter::mutable_window_data_param() { + set_has_window_data_param(); + if (window_data_param_ == NULL) window_data_param_ = new ::ditcaffe::WindowDataParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.window_data_param) + return window_data_param_; +} +inline ::ditcaffe::WindowDataParameter* LayerParameter::release_window_data_param() { + clear_has_window_data_param(); + ::ditcaffe::WindowDataParameter* temp = window_data_param_; + window_data_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_window_data_param(::ditcaffe::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:ditcaffe.LayerParameter.window_data_param) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.TransformationParameter.scale) + return scale_; +} +inline void TransformationParameter::set_scale(float value) { + set_has_scale(); + scale_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.TransformationParameter.mirror) + return mirror_; +} +inline void TransformationParameter::set_mirror(bool value) { + set_has_mirror(); + mirror_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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() { + if (mean_file_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + mean_file_->clear(); + } + clear_has_mean_file(); +} +inline const ::std::string& TransformationParameter::mean_file() const { + // @@protoc_insertion_point(field_get:ditcaffe.TransformationParameter.mean_file) + return *mean_file_; +} +inline void TransformationParameter::set_mean_file(const ::std::string& value) { + set_has_mean_file(); + if (mean_file_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + mean_file_ = new ::std::string; + } + mean_file_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.TransformationParameter.mean_file) +} +inline void TransformationParameter::set_mean_file(const char* value) { + set_has_mean_file(); + if (mean_file_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + mean_file_ = new ::std::string; + } + mean_file_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.TransformationParameter.mean_file) +} +inline void TransformationParameter::set_mean_file(const char* value, size_t size) { + set_has_mean_file(); + if (mean_file_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + mean_file_ = new ::std::string; + } + mean_file_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.TransformationParameter.mean_file) +} +inline ::std::string* TransformationParameter::mutable_mean_file() { + set_has_mean_file(); + if (mean_file_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + mean_file_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.TransformationParameter.mean_file) + return mean_file_; +} +inline ::std::string* TransformationParameter::release_mean_file() { + clear_has_mean_file(); + if (mean_file_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = mean_file_; + mean_file_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void TransformationParameter::set_allocated_mean_file(::std::string* mean_file) { + if (mean_file_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete mean_file_; + } + if (mean_file) { + set_has_mean_file(); + mean_file_ = mean_file; + } else { + clear_has_mean_file(); + mean_file_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.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:ditcaffe.TransformationParameter.mean_value) +} +inline void TransformationParameter::add_mean_value(float value) { + mean_value_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.TransformationParameter.mean_value) +} +inline const ::google::protobuf::RepeatedField< float >& +TransformationParameter::mean_value() const { + // @@protoc_insertion_point(field_list:ditcaffe.TransformationParameter.mean_value) + return mean_value_; +} +inline ::google::protobuf::RepeatedField< float >* +TransformationParameter::mutable_mean_value() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.TransformationParameter.force_gray) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.LossParameter.ignore_label) +} + +// optional .ditcaffe.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 ::ditcaffe::LossParameter_NormalizationMode LossParameter::normalization() const { + // @@protoc_insertion_point(field_get:ditcaffe.LossParameter.normalization) + return static_cast< ::ditcaffe::LossParameter_NormalizationMode >(normalization_); +} +inline void LossParameter::set_normalization(::ditcaffe::LossParameter_NormalizationMode value) { + assert(::ditcaffe::LossParameter_NormalizationMode_IsValid(value)); + set_has_normalization(); + normalization_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.LossParameter.normalize) + return normalize_; +} +inline void LossParameter::set_normalize(bool value) { + set_has_normalize(); + normalize_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.LossParameter.normalize) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.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:ditcaffe.AccuracyParameter.axis) + return axis_; +} +inline void AccuracyParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.AccuracyParameter.ignore_label) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.ArgMaxParameter.axis) + return axis_; +} +inline void ArgMaxParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.ArgMaxParameter.axis) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.ConcatParameter.axis) + return axis_; +} +inline void ConcatParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.ConcatParameter.concat_dim) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.BatchNormParameter.eps) + return eps_; +} +inline void BatchNormParameter::set_eps(float value) { + set_has_eps(); + eps_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.BatchNormParameter.eps) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.BiasParameter.axis) + return axis_; +} +inline void BiasParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.BiasParameter.num_axes) +} + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_filler(); +} +inline const ::ditcaffe::FillerParameter& BiasParameter::filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.BiasParameter.filler) + return filler_ != NULL ? *filler_ : *default_instance_->filler_; +} +inline ::ditcaffe::FillerParameter* BiasParameter::mutable_filler() { + set_has_filler(); + if (filler_ == NULL) filler_ = new ::ditcaffe::FillerParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.BiasParameter.filler) + return filler_; +} +inline ::ditcaffe::FillerParameter* BiasParameter::release_filler() { + clear_has_filler(); + ::ditcaffe::FillerParameter* temp = filler_; + filler_ = NULL; + return temp; +} +inline void BiasParameter::set_allocated_filler(::ditcaffe::FillerParameter* filler) { + delete filler_; + filler_ = filler; + if (filler) { + set_has_filler(); + } else { + clear_has_filler(); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.BiasParameter.filler) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.ContrastiveLossParameter.margin) + return margin_; +} +inline void ContrastiveLossParameter::set_margin(float value) { + set_has_margin(); + margin_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.ContrastiveLossParameter.legacy_version) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.ConvolutionParameter.pad) +} +inline void ConvolutionParameter::add_pad(::google::protobuf::uint32 value) { + pad_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.ConvolutionParameter.pad) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +ConvolutionParameter::pad() const { + // @@protoc_insertion_point(field_list:ditcaffe.ConvolutionParameter.pad) + return pad_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +ConvolutionParameter::mutable_pad() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.ConvolutionParameter.kernel_size) +} +inline void ConvolutionParameter::add_kernel_size(::google::protobuf::uint32 value) { + kernel_size_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.ConvolutionParameter.kernel_size) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +ConvolutionParameter::kernel_size() const { + // @@protoc_insertion_point(field_list:ditcaffe.ConvolutionParameter.kernel_size) + return kernel_size_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +ConvolutionParameter::mutable_kernel_size() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.ConvolutionParameter.stride) +} +inline void ConvolutionParameter::add_stride(::google::protobuf::uint32 value) { + stride_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.ConvolutionParameter.stride) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +ConvolutionParameter::stride() const { + // @@protoc_insertion_point(field_list:ditcaffe.ConvolutionParameter.stride) + return stride_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +ConvolutionParameter::mutable_stride() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.ConvolutionParameter.dilation) +} +inline void ConvolutionParameter::add_dilation(::google::protobuf::uint32 value) { + dilation_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.ConvolutionParameter.dilation) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +ConvolutionParameter::dilation() const { + // @@protoc_insertion_point(field_list:ditcaffe.ConvolutionParameter.dilation) + return dilation_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +ConvolutionParameter::mutable_dilation() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.ConvolutionParameter.group) + return group_; +} +inline void ConvolutionParameter::set_group(::google::protobuf::uint32 value) { + set_has_group(); + group_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.ConvolutionParameter.group) +} + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_weight_filler(); +} +inline const ::ditcaffe::FillerParameter& ConvolutionParameter::weight_filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.ConvolutionParameter.weight_filler) + return weight_filler_ != NULL ? *weight_filler_ : *default_instance_->weight_filler_; +} +inline ::ditcaffe::FillerParameter* ConvolutionParameter::mutable_weight_filler() { + set_has_weight_filler(); + if (weight_filler_ == NULL) weight_filler_ = new ::ditcaffe::FillerParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.ConvolutionParameter.weight_filler) + return weight_filler_; +} +inline ::ditcaffe::FillerParameter* ConvolutionParameter::release_weight_filler() { + clear_has_weight_filler(); + ::ditcaffe::FillerParameter* temp = weight_filler_; + weight_filler_ = NULL; + return temp; +} +inline void ConvolutionParameter::set_allocated_weight_filler(::ditcaffe::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:ditcaffe.ConvolutionParameter.weight_filler) +} + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_bias_filler(); +} +inline const ::ditcaffe::FillerParameter& ConvolutionParameter::bias_filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.ConvolutionParameter.bias_filler) + return bias_filler_ != NULL ? *bias_filler_ : *default_instance_->bias_filler_; +} +inline ::ditcaffe::FillerParameter* ConvolutionParameter::mutable_bias_filler() { + set_has_bias_filler(); + if (bias_filler_ == NULL) bias_filler_ = new ::ditcaffe::FillerParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.ConvolutionParameter.bias_filler) + return bias_filler_; +} +inline ::ditcaffe::FillerParameter* ConvolutionParameter::release_bias_filler() { + clear_has_bias_filler(); + ::ditcaffe::FillerParameter* temp = bias_filler_; + bias_filler_ = NULL; + return temp; +} +inline void ConvolutionParameter::set_allocated_bias_filler(::ditcaffe::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:ditcaffe.ConvolutionParameter.bias_filler) +} + +// optional .ditcaffe.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 ::ditcaffe::ConvolutionParameter_Engine ConvolutionParameter::engine() const { + // @@protoc_insertion_point(field_get:ditcaffe.ConvolutionParameter.engine) + return static_cast< ::ditcaffe::ConvolutionParameter_Engine >(engine_); +} +inline void ConvolutionParameter::set_engine(::ditcaffe::ConvolutionParameter_Engine value) { + assert(::ditcaffe::ConvolutionParameter_Engine_IsValid(value)); + set_has_engine(); + engine_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.ConvolutionParameter.axis) + return axis_; +} +inline void ConvolutionParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.ConvolutionParameter.force_nd_im2col) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.CropParameter.axis) + return axis_; +} +inline void CropParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.CropParameter.offset) +} +inline void CropParameter::add_offset(::google::protobuf::uint32 value) { + offset_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.CropParameter.offset) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +CropParameter::offset() const { + // @@protoc_insertion_point(field_list:ditcaffe.CropParameter.offset) + return offset_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +CropParameter::mutable_offset() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.CropParameter.offset) + return &offset_; +} + +// ------------------------------------------------------------------- + +// 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() { + if (source_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_->clear(); + } + clear_has_source(); +} +inline const ::std::string& DataParameter::source() const { + // @@protoc_insertion_point(field_get:ditcaffe.DataParameter.source) + return *source_; +} +inline void DataParameter::set_source(const ::std::string& value) { + set_has_source(); + if (source_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_ = new ::std::string; + } + source_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.DataParameter.source) +} +inline void DataParameter::set_source(const char* value) { + set_has_source(); + if (source_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_ = new ::std::string; + } + source_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.DataParameter.source) +} +inline void DataParameter::set_source(const char* value, size_t size) { + set_has_source(); + if (source_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_ = new ::std::string; + } + source_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.DataParameter.source) +} +inline ::std::string* DataParameter::mutable_source() { + set_has_source(); + if (source_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.DataParameter.source) + return source_; +} +inline ::std::string* DataParameter::release_source() { + clear_has_source(); + if (source_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = source_; + source_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void DataParameter::set_allocated_source(::std::string* source) { + if (source_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete source_; + } + if (source) { + set_has_source(); + source_ = source; + } else { + clear_has_source(); + source_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.DataParameter.rand_skip) +} + +// optional .ditcaffe.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 ::ditcaffe::DataParameter_DB DataParameter::backend() const { + // @@protoc_insertion_point(field_get:ditcaffe.DataParameter.backend) + return static_cast< ::ditcaffe::DataParameter_DB >(backend_); +} +inline void DataParameter::set_backend(::ditcaffe::DataParameter_DB value) { + assert(::ditcaffe::DataParameter_DB_IsValid(value)); + set_has_backend(); + backend_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.DataParameter.scale) + return scale_; +} +inline void DataParameter::set_scale(float value) { + set_has_scale(); + scale_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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() { + if (mean_file_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + mean_file_->clear(); + } + clear_has_mean_file(); +} +inline const ::std::string& DataParameter::mean_file() const { + // @@protoc_insertion_point(field_get:ditcaffe.DataParameter.mean_file) + return *mean_file_; +} +inline void DataParameter::set_mean_file(const ::std::string& value) { + set_has_mean_file(); + if (mean_file_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + mean_file_ = new ::std::string; + } + mean_file_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.DataParameter.mean_file) +} +inline void DataParameter::set_mean_file(const char* value) { + set_has_mean_file(); + if (mean_file_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + mean_file_ = new ::std::string; + } + mean_file_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.DataParameter.mean_file) +} +inline void DataParameter::set_mean_file(const char* value, size_t size) { + set_has_mean_file(); + if (mean_file_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + mean_file_ = new ::std::string; + } + mean_file_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.DataParameter.mean_file) +} +inline ::std::string* DataParameter::mutable_mean_file() { + set_has_mean_file(); + if (mean_file_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + mean_file_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.DataParameter.mean_file) + return mean_file_; +} +inline ::std::string* DataParameter::release_mean_file() { + clear_has_mean_file(); + if (mean_file_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = mean_file_; + mean_file_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void DataParameter::set_allocated_mean_file(::std::string* mean_file) { + if (mean_file_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete mean_file_; + } + if (mean_file) { + set_has_mean_file(); + mean_file_ = mean_file; + } else { + clear_has_mean_file(); + mean_file_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.DataParameter.mirror) + return mirror_; +} +inline void DataParameter::set_mirror(bool value) { + set_has_mirror(); + mirror_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.DataParameter.prefetch) + return prefetch_; +} +inline void DataParameter::set_prefetch(::google::protobuf::uint32 value) { + set_has_prefetch(); + prefetch_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.DataParameter.prefetch) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.DropoutParameter.dropout_ratio) +} + +// ------------------------------------------------------------------- + +// DummyDataParameter + +// repeated .ditcaffe.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 ::ditcaffe::FillerParameter& DummyDataParameter::data_filler(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.DummyDataParameter.data_filler) + return data_filler_.Get(index); +} +inline ::ditcaffe::FillerParameter* DummyDataParameter::mutable_data_filler(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.DummyDataParameter.data_filler) + return data_filler_.Mutable(index); +} +inline ::ditcaffe::FillerParameter* DummyDataParameter::add_data_filler() { + // @@protoc_insertion_point(field_add:ditcaffe.DummyDataParameter.data_filler) + return data_filler_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::FillerParameter >& +DummyDataParameter::data_filler() const { + // @@protoc_insertion_point(field_list:ditcaffe.DummyDataParameter.data_filler) + return data_filler_; +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::FillerParameter >* +DummyDataParameter::mutable_data_filler() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.DummyDataParameter.data_filler) + return &data_filler_; +} + +// repeated .ditcaffe.BlobShape shape = 6; +inline int DummyDataParameter::shape_size() const { + return shape_.size(); +} +inline void DummyDataParameter::clear_shape() { + shape_.Clear(); +} +inline const ::ditcaffe::BlobShape& DummyDataParameter::shape(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.DummyDataParameter.shape) + return shape_.Get(index); +} +inline ::ditcaffe::BlobShape* DummyDataParameter::mutable_shape(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.DummyDataParameter.shape) + return shape_.Mutable(index); +} +inline ::ditcaffe::BlobShape* DummyDataParameter::add_shape() { + // @@protoc_insertion_point(field_add:ditcaffe.DummyDataParameter.shape) + return shape_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobShape >& +DummyDataParameter::shape() const { + // @@protoc_insertion_point(field_list:ditcaffe.DummyDataParameter.shape) + return shape_; +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobShape >* +DummyDataParameter::mutable_shape() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.DummyDataParameter.num) +} +inline void DummyDataParameter::add_num(::google::protobuf::uint32 value) { + num_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.DummyDataParameter.num) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +DummyDataParameter::num() const { + // @@protoc_insertion_point(field_list:ditcaffe.DummyDataParameter.num) + return num_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +DummyDataParameter::mutable_num() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.DummyDataParameter.channels) +} +inline void DummyDataParameter::add_channels(::google::protobuf::uint32 value) { + channels_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.DummyDataParameter.channels) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +DummyDataParameter::channels() const { + // @@protoc_insertion_point(field_list:ditcaffe.DummyDataParameter.channels) + return channels_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +DummyDataParameter::mutable_channels() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.DummyDataParameter.height) +} +inline void DummyDataParameter::add_height(::google::protobuf::uint32 value) { + height_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.DummyDataParameter.height) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +DummyDataParameter::height() const { + // @@protoc_insertion_point(field_list:ditcaffe.DummyDataParameter.height) + return height_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +DummyDataParameter::mutable_height() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.DummyDataParameter.width) +} +inline void DummyDataParameter::add_width(::google::protobuf::uint32 value) { + width_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.DummyDataParameter.width) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +DummyDataParameter::width() const { + // @@protoc_insertion_point(field_list:ditcaffe.DummyDataParameter.width) + return width_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +DummyDataParameter::mutable_width() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.DummyDataParameter.width) + return &width_; +} + +// ------------------------------------------------------------------- + +// EltwiseParameter + +// optional .ditcaffe.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 ::ditcaffe::EltwiseParameter_EltwiseOp EltwiseParameter::operation() const { + // @@protoc_insertion_point(field_get:ditcaffe.EltwiseParameter.operation) + return static_cast< ::ditcaffe::EltwiseParameter_EltwiseOp >(operation_); +} +inline void EltwiseParameter::set_operation(::ditcaffe::EltwiseParameter_EltwiseOp value) { + assert(::ditcaffe::EltwiseParameter_EltwiseOp_IsValid(value)); + set_has_operation(); + operation_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.EltwiseParameter.coeff) + return coeff_.Get(index); +} +inline void EltwiseParameter::set_coeff(int index, float value) { + coeff_.Set(index, value); + // @@protoc_insertion_point(field_set:ditcaffe.EltwiseParameter.coeff) +} +inline void EltwiseParameter::add_coeff(float value) { + coeff_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.EltwiseParameter.coeff) +} +inline const ::google::protobuf::RepeatedField< float >& +EltwiseParameter::coeff() const { + // @@protoc_insertion_point(field_list:ditcaffe.EltwiseParameter.coeff) + return coeff_; +} +inline ::google::protobuf::RepeatedField< float >* +EltwiseParameter::mutable_coeff() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.EltwiseParameter.stable_prod_grad) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.ELUParameter.alpha) + return alpha_; +} +inline void ELUParameter::set_alpha(float value) { + set_has_alpha(); + alpha_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.ELUParameter.alpha) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.EmbedParameter.bias_term) +} + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_weight_filler(); +} +inline const ::ditcaffe::FillerParameter& EmbedParameter::weight_filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.EmbedParameter.weight_filler) + return weight_filler_ != NULL ? *weight_filler_ : *default_instance_->weight_filler_; +} +inline ::ditcaffe::FillerParameter* EmbedParameter::mutable_weight_filler() { + set_has_weight_filler(); + if (weight_filler_ == NULL) weight_filler_ = new ::ditcaffe::FillerParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.EmbedParameter.weight_filler) + return weight_filler_; +} +inline ::ditcaffe::FillerParameter* EmbedParameter::release_weight_filler() { + clear_has_weight_filler(); + ::ditcaffe::FillerParameter* temp = weight_filler_; + weight_filler_ = NULL; + return temp; +} +inline void EmbedParameter::set_allocated_weight_filler(::ditcaffe::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:ditcaffe.EmbedParameter.weight_filler) +} + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_bias_filler(); +} +inline const ::ditcaffe::FillerParameter& EmbedParameter::bias_filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.EmbedParameter.bias_filler) + return bias_filler_ != NULL ? *bias_filler_ : *default_instance_->bias_filler_; +} +inline ::ditcaffe::FillerParameter* EmbedParameter::mutable_bias_filler() { + set_has_bias_filler(); + if (bias_filler_ == NULL) bias_filler_ = new ::ditcaffe::FillerParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.EmbedParameter.bias_filler) + return bias_filler_; +} +inline ::ditcaffe::FillerParameter* EmbedParameter::release_bias_filler() { + clear_has_bias_filler(); + ::ditcaffe::FillerParameter* temp = bias_filler_; + bias_filler_ = NULL; + return temp; +} +inline void EmbedParameter::set_allocated_bias_filler(::ditcaffe::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:ditcaffe.EmbedParameter.bias_filler) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.ExpParameter.base) + return base_; +} +inline void ExpParameter::set_base(float value) { + set_has_base(); + base_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.ExpParameter.scale) + return scale_; +} +inline void ExpParameter::set_scale(float value) { + set_has_scale(); + scale_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.ExpParameter.shift) + return shift_; +} +inline void ExpParameter::set_shift(float value) { + set_has_shift(); + shift_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.ExpParameter.shift) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.FlattenParameter.axis) + return axis_; +} +inline void FlattenParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.FlattenParameter.end_axis) +} + +// ------------------------------------------------------------------- + +// 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() { + if (source_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_->clear(); + } + clear_has_source(); +} +inline const ::std::string& HDF5DataParameter::source() const { + // @@protoc_insertion_point(field_get:ditcaffe.HDF5DataParameter.source) + return *source_; +} +inline void HDF5DataParameter::set_source(const ::std::string& value) { + set_has_source(); + if (source_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_ = new ::std::string; + } + source_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.HDF5DataParameter.source) +} +inline void HDF5DataParameter::set_source(const char* value) { + set_has_source(); + if (source_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_ = new ::std::string; + } + source_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.HDF5DataParameter.source) +} +inline void HDF5DataParameter::set_source(const char* value, size_t size) { + set_has_source(); + if (source_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_ = new ::std::string; + } + source_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.HDF5DataParameter.source) +} +inline ::std::string* HDF5DataParameter::mutable_source() { + set_has_source(); + if (source_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.HDF5DataParameter.source) + return source_; +} +inline ::std::string* HDF5DataParameter::release_source() { + clear_has_source(); + if (source_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = source_; + source_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void HDF5DataParameter::set_allocated_source(::std::string* source) { + if (source_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete source_; + } + if (source) { + set_has_source(); + source_ = source; + } else { + clear_has_source(); + source_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.HDF5DataParameter.shuffle) + return shuffle_; +} +inline void HDF5DataParameter::set_shuffle(bool value) { + set_has_shuffle(); + shuffle_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.HDF5DataParameter.shuffle) +} + +// ------------------------------------------------------------------- + +// 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() { + if (file_name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + file_name_->clear(); + } + clear_has_file_name(); +} +inline const ::std::string& HDF5OutputParameter::file_name() const { + // @@protoc_insertion_point(field_get:ditcaffe.HDF5OutputParameter.file_name) + return *file_name_; +} +inline void HDF5OutputParameter::set_file_name(const ::std::string& value) { + set_has_file_name(); + if (file_name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + file_name_ = new ::std::string; + } + file_name_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.HDF5OutputParameter.file_name) +} +inline void HDF5OutputParameter::set_file_name(const char* value) { + set_has_file_name(); + if (file_name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + file_name_ = new ::std::string; + } + file_name_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.HDF5OutputParameter.file_name) +} +inline void HDF5OutputParameter::set_file_name(const char* value, size_t size) { + set_has_file_name(); + if (file_name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + file_name_ = new ::std::string; + } + file_name_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.HDF5OutputParameter.file_name) +} +inline ::std::string* HDF5OutputParameter::mutable_file_name() { + set_has_file_name(); + if (file_name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + file_name_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.HDF5OutputParameter.file_name) + return file_name_; +} +inline ::std::string* HDF5OutputParameter::release_file_name() { + clear_has_file_name(); + if (file_name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = file_name_; + file_name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void HDF5OutputParameter::set_allocated_file_name(::std::string* file_name) { + if (file_name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete file_name_; + } + if (file_name) { + set_has_file_name(); + file_name_ = file_name; + } else { + clear_has_file_name(); + file_name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.HDF5OutputParameter.file_name) +} + +// ------------------------------------------------------------------- + +// HingeLossParameter + +// optional .ditcaffe.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 ::ditcaffe::HingeLossParameter_Norm HingeLossParameter::norm() const { + // @@protoc_insertion_point(field_get:ditcaffe.HingeLossParameter.norm) + return static_cast< ::ditcaffe::HingeLossParameter_Norm >(norm_); +} +inline void HingeLossParameter::set_norm(::ditcaffe::HingeLossParameter_Norm value) { + assert(::ditcaffe::HingeLossParameter_Norm_IsValid(value)); + set_has_norm(); + norm_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.HingeLossParameter.norm) +} + +// ------------------------------------------------------------------- + +// 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() { + if (source_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_->clear(); + } + clear_has_source(); +} +inline const ::std::string& ImageDataParameter::source() const { + // @@protoc_insertion_point(field_get:ditcaffe.ImageDataParameter.source) + return *source_; +} +inline void ImageDataParameter::set_source(const ::std::string& value) { + set_has_source(); + if (source_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_ = new ::std::string; + } + source_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.ImageDataParameter.source) +} +inline void ImageDataParameter::set_source(const char* value) { + set_has_source(); + if (source_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_ = new ::std::string; + } + source_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.ImageDataParameter.source) +} +inline void ImageDataParameter::set_source(const char* value, size_t size) { + set_has_source(); + if (source_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_ = new ::std::string; + } + source_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.ImageDataParameter.source) +} +inline ::std::string* ImageDataParameter::mutable_source() { + set_has_source(); + if (source_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.ImageDataParameter.source) + return source_; +} +inline ::std::string* ImageDataParameter::release_source() { + clear_has_source(); + if (source_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = source_; + source_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ImageDataParameter::set_allocated_source(::std::string* source) { + if (source_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete source_; + } + if (source) { + set_has_source(); + source_ = source; + } else { + clear_has_source(); + source_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.ImageDataParameter.shuffle) + return shuffle_; +} +inline void ImageDataParameter::set_shuffle(bool value) { + set_has_shuffle(); + shuffle_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.ImageDataParameter.scale) + return scale_; +} +inline void ImageDataParameter::set_scale(float value) { + set_has_scale(); + scale_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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() { + if (mean_file_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + mean_file_->clear(); + } + clear_has_mean_file(); +} +inline const ::std::string& ImageDataParameter::mean_file() const { + // @@protoc_insertion_point(field_get:ditcaffe.ImageDataParameter.mean_file) + return *mean_file_; +} +inline void ImageDataParameter::set_mean_file(const ::std::string& value) { + set_has_mean_file(); + if (mean_file_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + mean_file_ = new ::std::string; + } + mean_file_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.ImageDataParameter.mean_file) +} +inline void ImageDataParameter::set_mean_file(const char* value) { + set_has_mean_file(); + if (mean_file_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + mean_file_ = new ::std::string; + } + mean_file_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.ImageDataParameter.mean_file) +} +inline void ImageDataParameter::set_mean_file(const char* value, size_t size) { + set_has_mean_file(); + if (mean_file_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + mean_file_ = new ::std::string; + } + mean_file_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.ImageDataParameter.mean_file) +} +inline ::std::string* ImageDataParameter::mutable_mean_file() { + set_has_mean_file(); + if (mean_file_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + mean_file_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.ImageDataParameter.mean_file) + return mean_file_; +} +inline ::std::string* ImageDataParameter::release_mean_file() { + clear_has_mean_file(); + if (mean_file_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = mean_file_; + mean_file_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ImageDataParameter::set_allocated_mean_file(::std::string* mean_file) { + if (mean_file_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete mean_file_; + } + if (mean_file) { + set_has_mean_file(); + mean_file_ = mean_file; + } else { + clear_has_mean_file(); + mean_file_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.ImageDataParameter.mirror) + return mirror_; +} +inline void ImageDataParameter::set_mirror(bool value) { + set_has_mirror(); + mirror_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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() { + if (root_folder_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + root_folder_->clear(); + } + clear_has_root_folder(); +} +inline const ::std::string& ImageDataParameter::root_folder() const { + // @@protoc_insertion_point(field_get:ditcaffe.ImageDataParameter.root_folder) + return *root_folder_; +} +inline void ImageDataParameter::set_root_folder(const ::std::string& value) { + set_has_root_folder(); + if (root_folder_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + root_folder_ = new ::std::string; + } + root_folder_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.ImageDataParameter.root_folder) +} +inline void ImageDataParameter::set_root_folder(const char* value) { + set_has_root_folder(); + if (root_folder_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + root_folder_ = new ::std::string; + } + root_folder_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.ImageDataParameter.root_folder) +} +inline void ImageDataParameter::set_root_folder(const char* value, size_t size) { + set_has_root_folder(); + if (root_folder_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + root_folder_ = new ::std::string; + } + root_folder_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.ImageDataParameter.root_folder) +} +inline ::std::string* ImageDataParameter::mutable_root_folder() { + set_has_root_folder(); + if (root_folder_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + root_folder_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.ImageDataParameter.root_folder) + return root_folder_; +} +inline ::std::string* ImageDataParameter::release_root_folder() { + clear_has_root_folder(); + if (root_folder_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = root_folder_; + root_folder_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ImageDataParameter::set_allocated_root_folder(::std::string* root_folder) { + if (root_folder_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete root_folder_; + } + if (root_folder) { + set_has_root_folder(); + root_folder_ = root_folder; + } else { + clear_has_root_folder(); + root_folder_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.ImageDataParameter.root_folder) +} + +// ------------------------------------------------------------------- + +// 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() { + if (source_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_->clear(); + } + clear_has_source(); +} +inline const ::std::string& InfogainLossParameter::source() const { + // @@protoc_insertion_point(field_get:ditcaffe.InfogainLossParameter.source) + return *source_; +} +inline void InfogainLossParameter::set_source(const ::std::string& value) { + set_has_source(); + if (source_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_ = new ::std::string; + } + source_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.InfogainLossParameter.source) +} +inline void InfogainLossParameter::set_source(const char* value) { + set_has_source(); + if (source_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_ = new ::std::string; + } + source_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.InfogainLossParameter.source) +} +inline void InfogainLossParameter::set_source(const char* value, size_t size) { + set_has_source(); + if (source_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_ = new ::std::string; + } + source_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.InfogainLossParameter.source) +} +inline ::std::string* InfogainLossParameter::mutable_source() { + set_has_source(); + if (source_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.InfogainLossParameter.source) + return source_; +} +inline ::std::string* InfogainLossParameter::release_source() { + clear_has_source(); + if (source_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = source_; + source_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void InfogainLossParameter::set_allocated_source(::std::string* source) { + if (source_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete source_; + } + if (source) { + set_has_source(); + source_ = source; + } else { + clear_has_source(); + source_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.InfogainLossParameter.source) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.InnerProductParameter.bias_term) +} + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_weight_filler(); +} +inline const ::ditcaffe::FillerParameter& InnerProductParameter::weight_filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.InnerProductParameter.weight_filler) + return weight_filler_ != NULL ? *weight_filler_ : *default_instance_->weight_filler_; +} +inline ::ditcaffe::FillerParameter* InnerProductParameter::mutable_weight_filler() { + set_has_weight_filler(); + if (weight_filler_ == NULL) weight_filler_ = new ::ditcaffe::FillerParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.InnerProductParameter.weight_filler) + return weight_filler_; +} +inline ::ditcaffe::FillerParameter* InnerProductParameter::release_weight_filler() { + clear_has_weight_filler(); + ::ditcaffe::FillerParameter* temp = weight_filler_; + weight_filler_ = NULL; + return temp; +} +inline void InnerProductParameter::set_allocated_weight_filler(::ditcaffe::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:ditcaffe.InnerProductParameter.weight_filler) +} + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_bias_filler(); +} +inline const ::ditcaffe::FillerParameter& InnerProductParameter::bias_filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.InnerProductParameter.bias_filler) + return bias_filler_ != NULL ? *bias_filler_ : *default_instance_->bias_filler_; +} +inline ::ditcaffe::FillerParameter* InnerProductParameter::mutable_bias_filler() { + set_has_bias_filler(); + if (bias_filler_ == NULL) bias_filler_ = new ::ditcaffe::FillerParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.InnerProductParameter.bias_filler) + return bias_filler_; +} +inline ::ditcaffe::FillerParameter* InnerProductParameter::release_bias_filler() { + clear_has_bias_filler(); + ::ditcaffe::FillerParameter* temp = bias_filler_; + bias_filler_ = NULL; + return temp; +} +inline void InnerProductParameter::set_allocated_bias_filler(::ditcaffe::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:ditcaffe.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:ditcaffe.InnerProductParameter.axis) + return axis_; +} +inline void InnerProductParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.InnerProductParameter.transpose) + return transpose_; +} +inline void InnerProductParameter::set_transpose(bool value) { + set_has_transpose(); + transpose_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.InnerProductParameter.transpose) +} + +// ------------------------------------------------------------------- + +// InputParameter + +// repeated .ditcaffe.BlobShape shape = 1; +inline int InputParameter::shape_size() const { + return shape_.size(); +} +inline void InputParameter::clear_shape() { + shape_.Clear(); +} +inline const ::ditcaffe::BlobShape& InputParameter::shape(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.InputParameter.shape) + return shape_.Get(index); +} +inline ::ditcaffe::BlobShape* InputParameter::mutable_shape(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.InputParameter.shape) + return shape_.Mutable(index); +} +inline ::ditcaffe::BlobShape* InputParameter::add_shape() { + // @@protoc_insertion_point(field_add:ditcaffe.InputParameter.shape) + return shape_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobShape >& +InputParameter::shape() const { + // @@protoc_insertion_point(field_list:ditcaffe.InputParameter.shape) + return shape_; +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobShape >* +InputParameter::mutable_shape() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.InputParameter.shape) + return &shape_; +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.LogParameter.base) + return base_; +} +inline void LogParameter::set_base(float value) { + set_has_base(); + base_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.LogParameter.scale) + return scale_; +} +inline void LogParameter::set_scale(float value) { + set_has_scale(); + scale_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.LogParameter.shift) + return shift_; +} +inline void LogParameter::set_shift(float value) { + set_has_shift(); + shift_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.LogParameter.shift) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.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:ditcaffe.LRNParameter.alpha) + return alpha_; +} +inline void LRNParameter::set_alpha(float value) { + set_has_alpha(); + alpha_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.LRNParameter.beta) + return beta_; +} +inline void LRNParameter::set_beta(float value) { + set_has_beta(); + beta_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.LRNParameter.beta) +} + +// optional .ditcaffe.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 ::ditcaffe::LRNParameter_NormRegion LRNParameter::norm_region() const { + // @@protoc_insertion_point(field_get:ditcaffe.LRNParameter.norm_region) + return static_cast< ::ditcaffe::LRNParameter_NormRegion >(norm_region_); +} +inline void LRNParameter::set_norm_region(::ditcaffe::LRNParameter_NormRegion value) { + assert(::ditcaffe::LRNParameter_NormRegion_IsValid(value)); + set_has_norm_region(); + norm_region_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.LRNParameter.k) + return k_; +} +inline void LRNParameter::set_k(float value) { + set_has_k(); + k_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.LRNParameter.k) +} + +// optional .ditcaffe.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 ::ditcaffe::LRNParameter_Engine LRNParameter::engine() const { + // @@protoc_insertion_point(field_get:ditcaffe.LRNParameter.engine) + return static_cast< ::ditcaffe::LRNParameter_Engine >(engine_); +} +inline void LRNParameter::set_engine(::ditcaffe::LRNParameter_Engine value) { + assert(::ditcaffe::LRNParameter_Engine_IsValid(value)); + set_has_engine(); + engine_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.LRNParameter.engine) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.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:ditcaffe.MemoryDataParameter.channels) + return channels_; +} +inline void MemoryDataParameter::set_channels(::google::protobuf::uint32 value) { + set_has_channels(); + channels_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.MemoryDataParameter.height) + return height_; +} +inline void MemoryDataParameter::set_height(::google::protobuf::uint32 value) { + set_has_height(); + height_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.MemoryDataParameter.width) + return width_; +} +inline void MemoryDataParameter::set_width(::google::protobuf::uint32 value) { + set_has_width(); + width_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.MemoryDataParameter.width) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.MVNParameter.eps) + return eps_; +} +inline void MVNParameter::set_eps(float value) { + set_has_eps(); + eps_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.MVNParameter.eps) +} + +// ------------------------------------------------------------------- + +// ParameterParameter + +// optional .ditcaffe.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_->::ditcaffe::BlobShape::Clear(); + clear_has_shape(); +} +inline const ::ditcaffe::BlobShape& ParameterParameter::shape() const { + // @@protoc_insertion_point(field_get:ditcaffe.ParameterParameter.shape) + return shape_ != NULL ? *shape_ : *default_instance_->shape_; +} +inline ::ditcaffe::BlobShape* ParameterParameter::mutable_shape() { + set_has_shape(); + if (shape_ == NULL) shape_ = new ::ditcaffe::BlobShape; + // @@protoc_insertion_point(field_mutable:ditcaffe.ParameterParameter.shape) + return shape_; +} +inline ::ditcaffe::BlobShape* ParameterParameter::release_shape() { + clear_has_shape(); + ::ditcaffe::BlobShape* temp = shape_; + shape_ = NULL; + return temp; +} +inline void ParameterParameter::set_allocated_shape(::ditcaffe::BlobShape* shape) { + delete shape_; + shape_ = shape; + if (shape) { + set_has_shape(); + } else { + clear_has_shape(); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.ParameterParameter.shape) +} + +// ------------------------------------------------------------------- + +// PoolingParameter + +// optional .ditcaffe.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 ::ditcaffe::PoolingParameter_PoolMethod PoolingParameter::pool() const { + // @@protoc_insertion_point(field_get:ditcaffe.PoolingParameter.pool) + return static_cast< ::ditcaffe::PoolingParameter_PoolMethod >(pool_); +} +inline void PoolingParameter::set_pool(::ditcaffe::PoolingParameter_PoolMethod value) { + assert(::ditcaffe::PoolingParameter_PoolMethod_IsValid(value)); + set_has_pool(); + pool_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.PoolingParameter.pad) + return pad_; +} +inline void PoolingParameter::set_pad(::google::protobuf::uint32 value) { + set_has_pad(); + pad_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.PoolingParameter.stride) + return stride_; +} +inline void PoolingParameter::set_stride(::google::protobuf::uint32 value) { + set_has_stride(); + stride_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.PoolingParameter.stride_w) +} + +// optional .ditcaffe.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 ::ditcaffe::PoolingParameter_Engine PoolingParameter::engine() const { + // @@protoc_insertion_point(field_get:ditcaffe.PoolingParameter.engine) + return static_cast< ::ditcaffe::PoolingParameter_Engine >(engine_); +} +inline void PoolingParameter::set_engine(::ditcaffe::PoolingParameter_Engine value) { + assert(::ditcaffe::PoolingParameter_Engine_IsValid(value)); + set_has_engine(); + engine_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.PoolingParameter.global_pooling) +} + +// optional bool torch_pooling = 40 [default = false]; +inline bool PoolingParameter::has_torch_pooling() const { + return (_has_bits_[0] & 0x00001000u) != 0; +} +inline void PoolingParameter::set_has_torch_pooling() { + _has_bits_[0] |= 0x00001000u; +} +inline void PoolingParameter::clear_has_torch_pooling() { + _has_bits_[0] &= ~0x00001000u; +} +inline void PoolingParameter::clear_torch_pooling() { + torch_pooling_ = false; + clear_has_torch_pooling(); +} +inline bool PoolingParameter::torch_pooling() const { + // @@protoc_insertion_point(field_get:ditcaffe.PoolingParameter.torch_pooling) + return torch_pooling_; +} +inline void PoolingParameter::set_torch_pooling(bool value) { + set_has_torch_pooling(); + torch_pooling_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.PoolingParameter.torch_pooling) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.PowerParameter.power) + return power_; +} +inline void PowerParameter::set_power(float value) { + set_has_power(); + power_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.PowerParameter.scale) + return scale_; +} +inline void PowerParameter::set_scale(float value) { + set_has_scale(); + scale_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.PowerParameter.shift) + return shift_; +} +inline void PowerParameter::set_shift(float value) { + set_has_shift(); + shift_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.PowerParameter.shift) +} + +// ------------------------------------------------------------------- + +// 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() { + if (module_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + module_->clear(); + } + clear_has_module(); +} +inline const ::std::string& PythonParameter::module() const { + // @@protoc_insertion_point(field_get:ditcaffe.PythonParameter.module) + return *module_; +} +inline void PythonParameter::set_module(const ::std::string& value) { + set_has_module(); + if (module_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + module_ = new ::std::string; + } + module_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.PythonParameter.module) +} +inline void PythonParameter::set_module(const char* value) { + set_has_module(); + if (module_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + module_ = new ::std::string; + } + module_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.PythonParameter.module) +} +inline void PythonParameter::set_module(const char* value, size_t size) { + set_has_module(); + if (module_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + module_ = new ::std::string; + } + module_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.PythonParameter.module) +} +inline ::std::string* PythonParameter::mutable_module() { + set_has_module(); + if (module_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + module_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.PythonParameter.module) + return module_; +} +inline ::std::string* PythonParameter::release_module() { + clear_has_module(); + if (module_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = module_; + module_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void PythonParameter::set_allocated_module(::std::string* module) { + if (module_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete module_; + } + if (module) { + set_has_module(); + module_ = module; + } else { + clear_has_module(); + module_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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() { + if (layer_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + layer_->clear(); + } + clear_has_layer(); +} +inline const ::std::string& PythonParameter::layer() const { + // @@protoc_insertion_point(field_get:ditcaffe.PythonParameter.layer) + return *layer_; +} +inline void PythonParameter::set_layer(const ::std::string& value) { + set_has_layer(); + if (layer_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + layer_ = new ::std::string; + } + layer_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.PythonParameter.layer) +} +inline void PythonParameter::set_layer(const char* value) { + set_has_layer(); + if (layer_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + layer_ = new ::std::string; + } + layer_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.PythonParameter.layer) +} +inline void PythonParameter::set_layer(const char* value, size_t size) { + set_has_layer(); + if (layer_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + layer_ = new ::std::string; + } + layer_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.PythonParameter.layer) +} +inline ::std::string* PythonParameter::mutable_layer() { + set_has_layer(); + if (layer_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + layer_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.PythonParameter.layer) + return layer_; +} +inline ::std::string* PythonParameter::release_layer() { + clear_has_layer(); + if (layer_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = layer_; + layer_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void PythonParameter::set_allocated_layer(::std::string* layer) { + if (layer_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete layer_; + } + if (layer) { + set_has_layer(); + layer_ = layer; + } else { + clear_has_layer(); + layer_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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() { + if (param_str_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + param_str_->clear(); + } + clear_has_param_str(); +} +inline const ::std::string& PythonParameter::param_str() const { + // @@protoc_insertion_point(field_get:ditcaffe.PythonParameter.param_str) + return *param_str_; +} +inline void PythonParameter::set_param_str(const ::std::string& value) { + set_has_param_str(); + if (param_str_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + param_str_ = new ::std::string; + } + param_str_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.PythonParameter.param_str) +} +inline void PythonParameter::set_param_str(const char* value) { + set_has_param_str(); + if (param_str_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + param_str_ = new ::std::string; + } + param_str_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.PythonParameter.param_str) +} +inline void PythonParameter::set_param_str(const char* value, size_t size) { + set_has_param_str(); + if (param_str_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + param_str_ = new ::std::string; + } + param_str_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.PythonParameter.param_str) +} +inline ::std::string* PythonParameter::mutable_param_str() { + set_has_param_str(); + if (param_str_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + param_str_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.PythonParameter.param_str) + return param_str_; +} +inline ::std::string* PythonParameter::release_param_str() { + clear_has_param_str(); + if (param_str_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = param_str_; + param_str_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void PythonParameter::set_allocated_param_str(::std::string* param_str) { + if (param_str_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete param_str_; + } + if (param_str) { + set_has_param_str(); + param_str_ = param_str; + } else { + clear_has_param_str(); + param_str_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.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:ditcaffe.PythonParameter.share_in_parallel) +} + +// ------------------------------------------------------------------- + +// ReductionParameter + +// optional .ditcaffe.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 ::ditcaffe::ReductionParameter_ReductionOp ReductionParameter::operation() const { + // @@protoc_insertion_point(field_get:ditcaffe.ReductionParameter.operation) + return static_cast< ::ditcaffe::ReductionParameter_ReductionOp >(operation_); +} +inline void ReductionParameter::set_operation(::ditcaffe::ReductionParameter_ReductionOp value) { + assert(::ditcaffe::ReductionParameter_ReductionOp_IsValid(value)); + set_has_operation(); + operation_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.ReductionParameter.axis) + return axis_; +} +inline void ReductionParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.ReductionParameter.coeff) + return coeff_; +} +inline void ReductionParameter::set_coeff(float value) { + set_has_coeff(); + coeff_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.ReductionParameter.coeff) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.ReLUParameter.negative_slope) +} + +// optional .ditcaffe.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 ::ditcaffe::ReLUParameter_Engine ReLUParameter::engine() const { + // @@protoc_insertion_point(field_get:ditcaffe.ReLUParameter.engine) + return static_cast< ::ditcaffe::ReLUParameter_Engine >(engine_); +} +inline void ReLUParameter::set_engine(::ditcaffe::ReLUParameter_Engine value) { + assert(::ditcaffe::ReLUParameter_Engine_IsValid(value)); + set_has_engine(); + engine_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.ReLUParameter.engine) +} + +// ------------------------------------------------------------------- + +// ReshapeParameter + +// optional .ditcaffe.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_->::ditcaffe::BlobShape::Clear(); + clear_has_shape(); +} +inline const ::ditcaffe::BlobShape& ReshapeParameter::shape() const { + // @@protoc_insertion_point(field_get:ditcaffe.ReshapeParameter.shape) + return shape_ != NULL ? *shape_ : *default_instance_->shape_; +} +inline ::ditcaffe::BlobShape* ReshapeParameter::mutable_shape() { + set_has_shape(); + if (shape_ == NULL) shape_ = new ::ditcaffe::BlobShape; + // @@protoc_insertion_point(field_mutable:ditcaffe.ReshapeParameter.shape) + return shape_; +} +inline ::ditcaffe::BlobShape* ReshapeParameter::release_shape() { + clear_has_shape(); + ::ditcaffe::BlobShape* temp = shape_; + shape_ = NULL; + return temp; +} +inline void ReshapeParameter::set_allocated_shape(::ditcaffe::BlobShape* shape) { + delete shape_; + shape_ = shape; + if (shape) { + set_has_shape(); + } else { + clear_has_shape(); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.ReshapeParameter.axis) + return axis_; +} +inline void ReshapeParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.ReshapeParameter.num_axes) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.ScaleParameter.axis) + return axis_; +} +inline void ScaleParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.ScaleParameter.num_axes) +} + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_filler(); +} +inline const ::ditcaffe::FillerParameter& ScaleParameter::filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.ScaleParameter.filler) + return filler_ != NULL ? *filler_ : *default_instance_->filler_; +} +inline ::ditcaffe::FillerParameter* ScaleParameter::mutable_filler() { + set_has_filler(); + if (filler_ == NULL) filler_ = new ::ditcaffe::FillerParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.ScaleParameter.filler) + return filler_; +} +inline ::ditcaffe::FillerParameter* ScaleParameter::release_filler() { + clear_has_filler(); + ::ditcaffe::FillerParameter* temp = filler_; + filler_ = NULL; + return temp; +} +inline void ScaleParameter::set_allocated_filler(::ditcaffe::FillerParameter* filler) { + delete filler_; + filler_ = filler; + if (filler) { + set_has_filler(); + } else { + clear_has_filler(); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.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:ditcaffe.ScaleParameter.bias_term) +} + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_bias_filler(); +} +inline const ::ditcaffe::FillerParameter& ScaleParameter::bias_filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.ScaleParameter.bias_filler) + return bias_filler_ != NULL ? *bias_filler_ : *default_instance_->bias_filler_; +} +inline ::ditcaffe::FillerParameter* ScaleParameter::mutable_bias_filler() { + set_has_bias_filler(); + if (bias_filler_ == NULL) bias_filler_ = new ::ditcaffe::FillerParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.ScaleParameter.bias_filler) + return bias_filler_; +} +inline ::ditcaffe::FillerParameter* ScaleParameter::release_bias_filler() { + clear_has_bias_filler(); + ::ditcaffe::FillerParameter* temp = bias_filler_; + bias_filler_ = NULL; + return temp; +} +inline void ScaleParameter::set_allocated_bias_filler(::ditcaffe::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:ditcaffe.ScaleParameter.bias_filler) +} + +// ------------------------------------------------------------------- + +// SigmoidParameter + +// optional .ditcaffe.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 ::ditcaffe::SigmoidParameter_Engine SigmoidParameter::engine() const { + // @@protoc_insertion_point(field_get:ditcaffe.SigmoidParameter.engine) + return static_cast< ::ditcaffe::SigmoidParameter_Engine >(engine_); +} +inline void SigmoidParameter::set_engine(::ditcaffe::SigmoidParameter_Engine value) { + assert(::ditcaffe::SigmoidParameter_Engine_IsValid(value)); + set_has_engine(); + engine_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.SigmoidParameter.engine) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.SliceParameter.axis) + return axis_; +} +inline void SliceParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.SliceParameter.slice_point) +} +inline void SliceParameter::add_slice_point(::google::protobuf::uint32 value) { + slice_point_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.SliceParameter.slice_point) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +SliceParameter::slice_point() const { + // @@protoc_insertion_point(field_list:ditcaffe.SliceParameter.slice_point) + return slice_point_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +SliceParameter::mutable_slice_point() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.SliceParameter.slice_dim) +} + +// ------------------------------------------------------------------- + +// SoftmaxParameter + +// optional .ditcaffe.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 ::ditcaffe::SoftmaxParameter_Engine SoftmaxParameter::engine() const { + // @@protoc_insertion_point(field_get:ditcaffe.SoftmaxParameter.engine) + return static_cast< ::ditcaffe::SoftmaxParameter_Engine >(engine_); +} +inline void SoftmaxParameter::set_engine(::ditcaffe::SoftmaxParameter_Engine value) { + assert(::ditcaffe::SoftmaxParameter_Engine_IsValid(value)); + set_has_engine(); + engine_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.SoftmaxParameter.axis) + return axis_; +} +inline void SoftmaxParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.SoftmaxParameter.axis) +} + +// ------------------------------------------------------------------- + +// TanHParameter + +// optional .ditcaffe.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 ::ditcaffe::TanHParameter_Engine TanHParameter::engine() const { + // @@protoc_insertion_point(field_get:ditcaffe.TanHParameter.engine) + return static_cast< ::ditcaffe::TanHParameter_Engine >(engine_); +} +inline void TanHParameter::set_engine(::ditcaffe::TanHParameter_Engine value) { + assert(::ditcaffe::TanHParameter_Engine_IsValid(value)); + set_has_engine(); + engine_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.TanHParameter.engine) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.TileParameter.axis) + return axis_; +} +inline void TileParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.TileParameter.tiles) + return tiles_; +} +inline void TileParameter::set_tiles(::google::protobuf::int32 value) { + set_has_tiles(); + tiles_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.TileParameter.tiles) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.ThresholdParameter.threshold) + return threshold_; +} +inline void ThresholdParameter::set_threshold(float value) { + set_has_threshold(); + threshold_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.ThresholdParameter.threshold) +} + +// ------------------------------------------------------------------- + +// 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() { + if (source_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_->clear(); + } + clear_has_source(); +} +inline const ::std::string& WindowDataParameter::source() const { + // @@protoc_insertion_point(field_get:ditcaffe.WindowDataParameter.source) + return *source_; +} +inline void WindowDataParameter::set_source(const ::std::string& value) { + set_has_source(); + if (source_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_ = new ::std::string; + } + source_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.WindowDataParameter.source) +} +inline void WindowDataParameter::set_source(const char* value) { + set_has_source(); + if (source_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_ = new ::std::string; + } + source_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.WindowDataParameter.source) +} +inline void WindowDataParameter::set_source(const char* value, size_t size) { + set_has_source(); + if (source_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_ = new ::std::string; + } + source_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.WindowDataParameter.source) +} +inline ::std::string* WindowDataParameter::mutable_source() { + set_has_source(); + if (source_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.WindowDataParameter.source) + return source_; +} +inline ::std::string* WindowDataParameter::release_source() { + clear_has_source(); + if (source_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = source_; + source_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void WindowDataParameter::set_allocated_source(::std::string* source) { + if (source_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete source_; + } + if (source) { + set_has_source(); + source_ = source; + } else { + clear_has_source(); + source_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.WindowDataParameter.scale) + return scale_; +} +inline void WindowDataParameter::set_scale(float value) { + set_has_scale(); + scale_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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() { + if (mean_file_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + mean_file_->clear(); + } + clear_has_mean_file(); +} +inline const ::std::string& WindowDataParameter::mean_file() const { + // @@protoc_insertion_point(field_get:ditcaffe.WindowDataParameter.mean_file) + return *mean_file_; +} +inline void WindowDataParameter::set_mean_file(const ::std::string& value) { + set_has_mean_file(); + if (mean_file_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + mean_file_ = new ::std::string; + } + mean_file_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.WindowDataParameter.mean_file) +} +inline void WindowDataParameter::set_mean_file(const char* value) { + set_has_mean_file(); + if (mean_file_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + mean_file_ = new ::std::string; + } + mean_file_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.WindowDataParameter.mean_file) +} +inline void WindowDataParameter::set_mean_file(const char* value, size_t size) { + set_has_mean_file(); + if (mean_file_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + mean_file_ = new ::std::string; + } + mean_file_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.WindowDataParameter.mean_file) +} +inline ::std::string* WindowDataParameter::mutable_mean_file() { + set_has_mean_file(); + if (mean_file_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + mean_file_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.WindowDataParameter.mean_file) + return mean_file_; +} +inline ::std::string* WindowDataParameter::release_mean_file() { + clear_has_mean_file(); + if (mean_file_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = mean_file_; + mean_file_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void WindowDataParameter::set_allocated_mean_file(::std::string* mean_file) { + if (mean_file_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete mean_file_; + } + if (mean_file) { + set_has_mean_file(); + mean_file_ = mean_file; + } else { + clear_has_mean_file(); + mean_file_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.WindowDataParameter.mirror) + return mirror_; +} +inline void WindowDataParameter::set_mirror(bool value) { + set_has_mirror(); + mirror_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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() { + if (crop_mode_ != _default_crop_mode_) { + crop_mode_->assign(*_default_crop_mode_); + } + clear_has_crop_mode(); +} +inline const ::std::string& WindowDataParameter::crop_mode() const { + // @@protoc_insertion_point(field_get:ditcaffe.WindowDataParameter.crop_mode) + return *crop_mode_; +} +inline void WindowDataParameter::set_crop_mode(const ::std::string& value) { + set_has_crop_mode(); + if (crop_mode_ == _default_crop_mode_) { + crop_mode_ = new ::std::string; + } + crop_mode_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.WindowDataParameter.crop_mode) +} +inline void WindowDataParameter::set_crop_mode(const char* value) { + set_has_crop_mode(); + if (crop_mode_ == _default_crop_mode_) { + crop_mode_ = new ::std::string; + } + crop_mode_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.WindowDataParameter.crop_mode) +} +inline void WindowDataParameter::set_crop_mode(const char* value, size_t size) { + set_has_crop_mode(); + if (crop_mode_ == _default_crop_mode_) { + crop_mode_ = new ::std::string; + } + crop_mode_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.WindowDataParameter.crop_mode) +} +inline ::std::string* WindowDataParameter::mutable_crop_mode() { + set_has_crop_mode(); + if (crop_mode_ == _default_crop_mode_) { + crop_mode_ = new ::std::string(*_default_crop_mode_); + } + // @@protoc_insertion_point(field_mutable:ditcaffe.WindowDataParameter.crop_mode) + return crop_mode_; +} +inline ::std::string* WindowDataParameter::release_crop_mode() { + clear_has_crop_mode(); + if (crop_mode_ == _default_crop_mode_) { + return NULL; + } else { + ::std::string* temp = crop_mode_; + crop_mode_ = const_cast< ::std::string*>(_default_crop_mode_); + return temp; + } +} +inline void WindowDataParameter::set_allocated_crop_mode(::std::string* crop_mode) { + if (crop_mode_ != _default_crop_mode_) { + delete crop_mode_; + } + if (crop_mode) { + set_has_crop_mode(); + crop_mode_ = crop_mode; + } else { + clear_has_crop_mode(); + crop_mode_ = const_cast< ::std::string*>(_default_crop_mode_); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.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:ditcaffe.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() { + if (root_folder_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + root_folder_->clear(); + } + clear_has_root_folder(); +} +inline const ::std::string& WindowDataParameter::root_folder() const { + // @@protoc_insertion_point(field_get:ditcaffe.WindowDataParameter.root_folder) + return *root_folder_; +} +inline void WindowDataParameter::set_root_folder(const ::std::string& value) { + set_has_root_folder(); + if (root_folder_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + root_folder_ = new ::std::string; + } + root_folder_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.WindowDataParameter.root_folder) +} +inline void WindowDataParameter::set_root_folder(const char* value) { + set_has_root_folder(); + if (root_folder_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + root_folder_ = new ::std::string; + } + root_folder_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.WindowDataParameter.root_folder) +} +inline void WindowDataParameter::set_root_folder(const char* value, size_t size) { + set_has_root_folder(); + if (root_folder_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + root_folder_ = new ::std::string; + } + root_folder_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.WindowDataParameter.root_folder) +} +inline ::std::string* WindowDataParameter::mutable_root_folder() { + set_has_root_folder(); + if (root_folder_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + root_folder_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.WindowDataParameter.root_folder) + return root_folder_; +} +inline ::std::string* WindowDataParameter::release_root_folder() { + clear_has_root_folder(); + if (root_folder_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = root_folder_; + root_folder_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void WindowDataParameter::set_allocated_root_folder(::std::string* root_folder) { + if (root_folder_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete root_folder_; + } + if (root_folder) { + set_has_root_folder(); + root_folder_ = root_folder; + } else { + clear_has_root_folder(); + root_folder_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.WindowDataParameter.root_folder) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.SPPParameter.pyramid_height) +} + +// optional .ditcaffe.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 ::ditcaffe::SPPParameter_PoolMethod SPPParameter::pool() const { + // @@protoc_insertion_point(field_get:ditcaffe.SPPParameter.pool) + return static_cast< ::ditcaffe::SPPParameter_PoolMethod >(pool_); +} +inline void SPPParameter::set_pool(::ditcaffe::SPPParameter_PoolMethod value) { + assert(::ditcaffe::SPPParameter_PoolMethod_IsValid(value)); + set_has_pool(); + pool_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.SPPParameter.pool) +} + +// optional .ditcaffe.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 ::ditcaffe::SPPParameter_Engine SPPParameter::engine() const { + // @@protoc_insertion_point(field_get:ditcaffe.SPPParameter.engine) + return static_cast< ::ditcaffe::SPPParameter_Engine >(engine_); +} +inline void SPPParameter::set_engine(::ditcaffe::SPPParameter_Engine value) { + assert(::ditcaffe::SPPParameter_Engine_IsValid(value)); + set_has_engine(); + engine_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.SPPParameter.engine) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.V1LayerParameter.bottom) + return bottom_.Get(index); +} +inline ::std::string* V1LayerParameter::mutable_bottom(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.bottom) + return bottom_.Mutable(index); +} +inline void V1LayerParameter::set_bottom(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.V1LayerParameter.bottom) +} +inline ::std::string* V1LayerParameter::add_bottom() { + return bottom_.Add(); +} +inline void V1LayerParameter::add_bottom(const ::std::string& value) { + bottom_.Add()->assign(value); + // @@protoc_insertion_point(field_add:ditcaffe.V1LayerParameter.bottom) +} +inline void V1LayerParameter::add_bottom(const char* value) { + bottom_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:ditcaffe.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:ditcaffe.V1LayerParameter.bottom) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +V1LayerParameter::bottom() const { + // @@protoc_insertion_point(field_list:ditcaffe.V1LayerParameter.bottom) + return bottom_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +V1LayerParameter::mutable_bottom() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.V1LayerParameter.top) + return top_.Get(index); +} +inline ::std::string* V1LayerParameter::mutable_top(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.top) + return top_.Mutable(index); +} +inline void V1LayerParameter::set_top(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.V1LayerParameter.top) +} +inline ::std::string* V1LayerParameter::add_top() { + return top_.Add(); +} +inline void V1LayerParameter::add_top(const ::std::string& value) { + top_.Add()->assign(value); + // @@protoc_insertion_point(field_add:ditcaffe.V1LayerParameter.top) +} +inline void V1LayerParameter::add_top(const char* value) { + top_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:ditcaffe.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:ditcaffe.V1LayerParameter.top) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +V1LayerParameter::top() const { + // @@protoc_insertion_point(field_list:ditcaffe.V1LayerParameter.top) + return top_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +V1LayerParameter::mutable_top() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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() { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_->clear(); + } + clear_has_name(); +} +inline const ::std::string& V1LayerParameter::name() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.name) + return *name_; +} +inline void V1LayerParameter::set_name(const ::std::string& value) { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + name_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.V1LayerParameter.name) +} +inline void V1LayerParameter::set_name(const char* value) { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + name_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.V1LayerParameter.name) +} +inline void V1LayerParameter::set_name(const char* value, size_t size) { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + name_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.V1LayerParameter.name) +} +inline ::std::string* V1LayerParameter::mutable_name() { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.name) + return name_; +} +inline ::std::string* V1LayerParameter::release_name() { + clear_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = name_; + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void V1LayerParameter::set_allocated_name(::std::string* name) { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete name_; + } + if (name) { + set_has_name(); + name_ = name; + } else { + clear_has_name(); + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.V1LayerParameter.name) +} + +// repeated .ditcaffe.NetStateRule include = 32; +inline int V1LayerParameter::include_size() const { + return include_.size(); +} +inline void V1LayerParameter::clear_include() { + include_.Clear(); +} +inline const ::ditcaffe::NetStateRule& V1LayerParameter::include(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.include) + return include_.Get(index); +} +inline ::ditcaffe::NetStateRule* V1LayerParameter::mutable_include(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.include) + return include_.Mutable(index); +} +inline ::ditcaffe::NetStateRule* V1LayerParameter::add_include() { + // @@protoc_insertion_point(field_add:ditcaffe.V1LayerParameter.include) + return include_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >& +V1LayerParameter::include() const { + // @@protoc_insertion_point(field_list:ditcaffe.V1LayerParameter.include) + return include_; +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >* +V1LayerParameter::mutable_include() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.V1LayerParameter.include) + return &include_; +} + +// repeated .ditcaffe.NetStateRule exclude = 33; +inline int V1LayerParameter::exclude_size() const { + return exclude_.size(); +} +inline void V1LayerParameter::clear_exclude() { + exclude_.Clear(); +} +inline const ::ditcaffe::NetStateRule& V1LayerParameter::exclude(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.exclude) + return exclude_.Get(index); +} +inline ::ditcaffe::NetStateRule* V1LayerParameter::mutable_exclude(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.exclude) + return exclude_.Mutable(index); +} +inline ::ditcaffe::NetStateRule* V1LayerParameter::add_exclude() { + // @@protoc_insertion_point(field_add:ditcaffe.V1LayerParameter.exclude) + return exclude_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >& +V1LayerParameter::exclude() const { + // @@protoc_insertion_point(field_list:ditcaffe.V1LayerParameter.exclude) + return exclude_; +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >* +V1LayerParameter::mutable_exclude() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.V1LayerParameter.exclude) + return &exclude_; +} + +// optional .ditcaffe.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 ::ditcaffe::V1LayerParameter_LayerType V1LayerParameter::type() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.type) + return static_cast< ::ditcaffe::V1LayerParameter_LayerType >(type_); +} +inline void V1LayerParameter::set_type(::ditcaffe::V1LayerParameter_LayerType value) { + assert(::ditcaffe::V1LayerParameter_LayerType_IsValid(value)); + set_has_type(); + type_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.V1LayerParameter.type) +} + +// repeated .ditcaffe.BlobProto blobs = 6; +inline int V1LayerParameter::blobs_size() const { + return blobs_.size(); +} +inline void V1LayerParameter::clear_blobs() { + blobs_.Clear(); +} +inline const ::ditcaffe::BlobProto& V1LayerParameter::blobs(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.blobs) + return blobs_.Get(index); +} +inline ::ditcaffe::BlobProto* V1LayerParameter::mutable_blobs(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.blobs) + return blobs_.Mutable(index); +} +inline ::ditcaffe::BlobProto* V1LayerParameter::add_blobs() { + // @@protoc_insertion_point(field_add:ditcaffe.V1LayerParameter.blobs) + return blobs_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >& +V1LayerParameter::blobs() const { + // @@protoc_insertion_point(field_list:ditcaffe.V1LayerParameter.blobs) + return blobs_; +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >* +V1LayerParameter::mutable_blobs() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.V1LayerParameter.param) + return param_.Get(index); +} +inline ::std::string* V1LayerParameter::mutable_param(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.param) + return param_.Mutable(index); +} +inline void V1LayerParameter::set_param(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.V1LayerParameter.param) +} +inline ::std::string* V1LayerParameter::add_param() { + return param_.Add(); +} +inline void V1LayerParameter::add_param(const ::std::string& value) { + param_.Add()->assign(value); + // @@protoc_insertion_point(field_add:ditcaffe.V1LayerParameter.param) +} +inline void V1LayerParameter::add_param(const char* value) { + param_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:ditcaffe.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:ditcaffe.V1LayerParameter.param) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +V1LayerParameter::param() const { + // @@protoc_insertion_point(field_list:ditcaffe.V1LayerParameter.param) + return param_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +V1LayerParameter::mutable_param() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.V1LayerParameter.param) + return ¶m_; +} + +// repeated .ditcaffe.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 ::ditcaffe::V1LayerParameter_DimCheckMode V1LayerParameter::blob_share_mode(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.blob_share_mode) + return static_cast< ::ditcaffe::V1LayerParameter_DimCheckMode >(blob_share_mode_.Get(index)); +} +inline void V1LayerParameter::set_blob_share_mode(int index, ::ditcaffe::V1LayerParameter_DimCheckMode value) { + assert(::ditcaffe::V1LayerParameter_DimCheckMode_IsValid(value)); + blob_share_mode_.Set(index, value); + // @@protoc_insertion_point(field_set:ditcaffe.V1LayerParameter.blob_share_mode) +} +inline void V1LayerParameter::add_blob_share_mode(::ditcaffe::V1LayerParameter_DimCheckMode value) { + assert(::ditcaffe::V1LayerParameter_DimCheckMode_IsValid(value)); + blob_share_mode_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.V1LayerParameter.blob_share_mode) +} +inline const ::google::protobuf::RepeatedField& +V1LayerParameter::blob_share_mode() const { + // @@protoc_insertion_point(field_list:ditcaffe.V1LayerParameter.blob_share_mode) + return blob_share_mode_; +} +inline ::google::protobuf::RepeatedField* +V1LayerParameter::mutable_blob_share_mode() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.V1LayerParameter.blobs_lr) +} +inline void V1LayerParameter::add_blobs_lr(float value) { + blobs_lr_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.V1LayerParameter.blobs_lr) +} +inline const ::google::protobuf::RepeatedField< float >& +V1LayerParameter::blobs_lr() const { + // @@protoc_insertion_point(field_list:ditcaffe.V1LayerParameter.blobs_lr) + return blobs_lr_; +} +inline ::google::protobuf::RepeatedField< float >* +V1LayerParameter::mutable_blobs_lr() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.V1LayerParameter.weight_decay) +} +inline void V1LayerParameter::add_weight_decay(float value) { + weight_decay_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.V1LayerParameter.weight_decay) +} +inline const ::google::protobuf::RepeatedField< float >& +V1LayerParameter::weight_decay() const { + // @@protoc_insertion_point(field_list:ditcaffe.V1LayerParameter.weight_decay) + return weight_decay_; +} +inline ::google::protobuf::RepeatedField< float >* +V1LayerParameter::mutable_weight_decay() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.V1LayerParameter.loss_weight) +} +inline void V1LayerParameter::add_loss_weight(float value) { + loss_weight_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.V1LayerParameter.loss_weight) +} +inline const ::google::protobuf::RepeatedField< float >& +V1LayerParameter::loss_weight() const { + // @@protoc_insertion_point(field_list:ditcaffe.V1LayerParameter.loss_weight) + return loss_weight_; +} +inline ::google::protobuf::RepeatedField< float >* +V1LayerParameter::mutable_loss_weight() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.V1LayerParameter.loss_weight) + return &loss_weight_; +} + +// optional .ditcaffe.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_->::ditcaffe::AccuracyParameter::Clear(); + clear_has_accuracy_param(); +} +inline const ::ditcaffe::AccuracyParameter& V1LayerParameter::accuracy_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.accuracy_param) + return accuracy_param_ != NULL ? *accuracy_param_ : *default_instance_->accuracy_param_; +} +inline ::ditcaffe::AccuracyParameter* V1LayerParameter::mutable_accuracy_param() { + set_has_accuracy_param(); + if (accuracy_param_ == NULL) accuracy_param_ = new ::ditcaffe::AccuracyParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.accuracy_param) + return accuracy_param_; +} +inline ::ditcaffe::AccuracyParameter* V1LayerParameter::release_accuracy_param() { + clear_has_accuracy_param(); + ::ditcaffe::AccuracyParameter* temp = accuracy_param_; + accuracy_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_accuracy_param(::ditcaffe::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:ditcaffe.V1LayerParameter.accuracy_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ArgMaxParameter::Clear(); + clear_has_argmax_param(); +} +inline const ::ditcaffe::ArgMaxParameter& V1LayerParameter::argmax_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.argmax_param) + return argmax_param_ != NULL ? *argmax_param_ : *default_instance_->argmax_param_; +} +inline ::ditcaffe::ArgMaxParameter* V1LayerParameter::mutable_argmax_param() { + set_has_argmax_param(); + if (argmax_param_ == NULL) argmax_param_ = new ::ditcaffe::ArgMaxParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.argmax_param) + return argmax_param_; +} +inline ::ditcaffe::ArgMaxParameter* V1LayerParameter::release_argmax_param() { + clear_has_argmax_param(); + ::ditcaffe::ArgMaxParameter* temp = argmax_param_; + argmax_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_argmax_param(::ditcaffe::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:ditcaffe.V1LayerParameter.argmax_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ConcatParameter::Clear(); + clear_has_concat_param(); +} +inline const ::ditcaffe::ConcatParameter& V1LayerParameter::concat_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.concat_param) + return concat_param_ != NULL ? *concat_param_ : *default_instance_->concat_param_; +} +inline ::ditcaffe::ConcatParameter* V1LayerParameter::mutable_concat_param() { + set_has_concat_param(); + if (concat_param_ == NULL) concat_param_ = new ::ditcaffe::ConcatParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.concat_param) + return concat_param_; +} +inline ::ditcaffe::ConcatParameter* V1LayerParameter::release_concat_param() { + clear_has_concat_param(); + ::ditcaffe::ConcatParameter* temp = concat_param_; + concat_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_concat_param(::ditcaffe::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:ditcaffe.V1LayerParameter.concat_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ContrastiveLossParameter::Clear(); + clear_has_contrastive_loss_param(); +} +inline const ::ditcaffe::ContrastiveLossParameter& V1LayerParameter::contrastive_loss_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.contrastive_loss_param) + return contrastive_loss_param_ != NULL ? *contrastive_loss_param_ : *default_instance_->contrastive_loss_param_; +} +inline ::ditcaffe::ContrastiveLossParameter* V1LayerParameter::mutable_contrastive_loss_param() { + set_has_contrastive_loss_param(); + if (contrastive_loss_param_ == NULL) contrastive_loss_param_ = new ::ditcaffe::ContrastiveLossParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.contrastive_loss_param) + return contrastive_loss_param_; +} +inline ::ditcaffe::ContrastiveLossParameter* V1LayerParameter::release_contrastive_loss_param() { + clear_has_contrastive_loss_param(); + ::ditcaffe::ContrastiveLossParameter* temp = contrastive_loss_param_; + contrastive_loss_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_contrastive_loss_param(::ditcaffe::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:ditcaffe.V1LayerParameter.contrastive_loss_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ConvolutionParameter::Clear(); + clear_has_convolution_param(); +} +inline const ::ditcaffe::ConvolutionParameter& V1LayerParameter::convolution_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.convolution_param) + return convolution_param_ != NULL ? *convolution_param_ : *default_instance_->convolution_param_; +} +inline ::ditcaffe::ConvolutionParameter* V1LayerParameter::mutable_convolution_param() { + set_has_convolution_param(); + if (convolution_param_ == NULL) convolution_param_ = new ::ditcaffe::ConvolutionParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.convolution_param) + return convolution_param_; +} +inline ::ditcaffe::ConvolutionParameter* V1LayerParameter::release_convolution_param() { + clear_has_convolution_param(); + ::ditcaffe::ConvolutionParameter* temp = convolution_param_; + convolution_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_convolution_param(::ditcaffe::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:ditcaffe.V1LayerParameter.convolution_param) +} + +// optional .ditcaffe.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_->::ditcaffe::DataParameter::Clear(); + clear_has_data_param(); +} +inline const ::ditcaffe::DataParameter& V1LayerParameter::data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.data_param) + return data_param_ != NULL ? *data_param_ : *default_instance_->data_param_; +} +inline ::ditcaffe::DataParameter* V1LayerParameter::mutable_data_param() { + set_has_data_param(); + if (data_param_ == NULL) data_param_ = new ::ditcaffe::DataParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.data_param) + return data_param_; +} +inline ::ditcaffe::DataParameter* V1LayerParameter::release_data_param() { + clear_has_data_param(); + ::ditcaffe::DataParameter* temp = data_param_; + data_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_data_param(::ditcaffe::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:ditcaffe.V1LayerParameter.data_param) +} + +// optional .ditcaffe.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_->::ditcaffe::DropoutParameter::Clear(); + clear_has_dropout_param(); +} +inline const ::ditcaffe::DropoutParameter& V1LayerParameter::dropout_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.dropout_param) + return dropout_param_ != NULL ? *dropout_param_ : *default_instance_->dropout_param_; +} +inline ::ditcaffe::DropoutParameter* V1LayerParameter::mutable_dropout_param() { + set_has_dropout_param(); + if (dropout_param_ == NULL) dropout_param_ = new ::ditcaffe::DropoutParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.dropout_param) + return dropout_param_; +} +inline ::ditcaffe::DropoutParameter* V1LayerParameter::release_dropout_param() { + clear_has_dropout_param(); + ::ditcaffe::DropoutParameter* temp = dropout_param_; + dropout_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_dropout_param(::ditcaffe::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:ditcaffe.V1LayerParameter.dropout_param) +} + +// optional .ditcaffe.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_->::ditcaffe::DummyDataParameter::Clear(); + clear_has_dummy_data_param(); +} +inline const ::ditcaffe::DummyDataParameter& V1LayerParameter::dummy_data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.dummy_data_param) + return dummy_data_param_ != NULL ? *dummy_data_param_ : *default_instance_->dummy_data_param_; +} +inline ::ditcaffe::DummyDataParameter* V1LayerParameter::mutable_dummy_data_param() { + set_has_dummy_data_param(); + if (dummy_data_param_ == NULL) dummy_data_param_ = new ::ditcaffe::DummyDataParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.dummy_data_param) + return dummy_data_param_; +} +inline ::ditcaffe::DummyDataParameter* V1LayerParameter::release_dummy_data_param() { + clear_has_dummy_data_param(); + ::ditcaffe::DummyDataParameter* temp = dummy_data_param_; + dummy_data_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_dummy_data_param(::ditcaffe::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:ditcaffe.V1LayerParameter.dummy_data_param) +} + +// optional .ditcaffe.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_->::ditcaffe::EltwiseParameter::Clear(); + clear_has_eltwise_param(); +} +inline const ::ditcaffe::EltwiseParameter& V1LayerParameter::eltwise_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.eltwise_param) + return eltwise_param_ != NULL ? *eltwise_param_ : *default_instance_->eltwise_param_; +} +inline ::ditcaffe::EltwiseParameter* V1LayerParameter::mutable_eltwise_param() { + set_has_eltwise_param(); + if (eltwise_param_ == NULL) eltwise_param_ = new ::ditcaffe::EltwiseParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.eltwise_param) + return eltwise_param_; +} +inline ::ditcaffe::EltwiseParameter* V1LayerParameter::release_eltwise_param() { + clear_has_eltwise_param(); + ::ditcaffe::EltwiseParameter* temp = eltwise_param_; + eltwise_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_eltwise_param(::ditcaffe::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:ditcaffe.V1LayerParameter.eltwise_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ExpParameter::Clear(); + clear_has_exp_param(); +} +inline const ::ditcaffe::ExpParameter& V1LayerParameter::exp_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.exp_param) + return exp_param_ != NULL ? *exp_param_ : *default_instance_->exp_param_; +} +inline ::ditcaffe::ExpParameter* V1LayerParameter::mutable_exp_param() { + set_has_exp_param(); + if (exp_param_ == NULL) exp_param_ = new ::ditcaffe::ExpParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.exp_param) + return exp_param_; +} +inline ::ditcaffe::ExpParameter* V1LayerParameter::release_exp_param() { + clear_has_exp_param(); + ::ditcaffe::ExpParameter* temp = exp_param_; + exp_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_exp_param(::ditcaffe::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:ditcaffe.V1LayerParameter.exp_param) +} + +// optional .ditcaffe.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_->::ditcaffe::HDF5DataParameter::Clear(); + clear_has_hdf5_data_param(); +} +inline const ::ditcaffe::HDF5DataParameter& V1LayerParameter::hdf5_data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.hdf5_data_param) + return hdf5_data_param_ != NULL ? *hdf5_data_param_ : *default_instance_->hdf5_data_param_; +} +inline ::ditcaffe::HDF5DataParameter* V1LayerParameter::mutable_hdf5_data_param() { + set_has_hdf5_data_param(); + if (hdf5_data_param_ == NULL) hdf5_data_param_ = new ::ditcaffe::HDF5DataParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.hdf5_data_param) + return hdf5_data_param_; +} +inline ::ditcaffe::HDF5DataParameter* V1LayerParameter::release_hdf5_data_param() { + clear_has_hdf5_data_param(); + ::ditcaffe::HDF5DataParameter* temp = hdf5_data_param_; + hdf5_data_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_hdf5_data_param(::ditcaffe::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:ditcaffe.V1LayerParameter.hdf5_data_param) +} + +// optional .ditcaffe.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_->::ditcaffe::HDF5OutputParameter::Clear(); + clear_has_hdf5_output_param(); +} +inline const ::ditcaffe::HDF5OutputParameter& V1LayerParameter::hdf5_output_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.hdf5_output_param) + return hdf5_output_param_ != NULL ? *hdf5_output_param_ : *default_instance_->hdf5_output_param_; +} +inline ::ditcaffe::HDF5OutputParameter* V1LayerParameter::mutable_hdf5_output_param() { + set_has_hdf5_output_param(); + if (hdf5_output_param_ == NULL) hdf5_output_param_ = new ::ditcaffe::HDF5OutputParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.hdf5_output_param) + return hdf5_output_param_; +} +inline ::ditcaffe::HDF5OutputParameter* V1LayerParameter::release_hdf5_output_param() { + clear_has_hdf5_output_param(); + ::ditcaffe::HDF5OutputParameter* temp = hdf5_output_param_; + hdf5_output_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_hdf5_output_param(::ditcaffe::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:ditcaffe.V1LayerParameter.hdf5_output_param) +} + +// optional .ditcaffe.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_->::ditcaffe::HingeLossParameter::Clear(); + clear_has_hinge_loss_param(); +} +inline const ::ditcaffe::HingeLossParameter& V1LayerParameter::hinge_loss_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.hinge_loss_param) + return hinge_loss_param_ != NULL ? *hinge_loss_param_ : *default_instance_->hinge_loss_param_; +} +inline ::ditcaffe::HingeLossParameter* V1LayerParameter::mutable_hinge_loss_param() { + set_has_hinge_loss_param(); + if (hinge_loss_param_ == NULL) hinge_loss_param_ = new ::ditcaffe::HingeLossParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.hinge_loss_param) + return hinge_loss_param_; +} +inline ::ditcaffe::HingeLossParameter* V1LayerParameter::release_hinge_loss_param() { + clear_has_hinge_loss_param(); + ::ditcaffe::HingeLossParameter* temp = hinge_loss_param_; + hinge_loss_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_hinge_loss_param(::ditcaffe::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:ditcaffe.V1LayerParameter.hinge_loss_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ImageDataParameter::Clear(); + clear_has_image_data_param(); +} +inline const ::ditcaffe::ImageDataParameter& V1LayerParameter::image_data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.image_data_param) + return image_data_param_ != NULL ? *image_data_param_ : *default_instance_->image_data_param_; +} +inline ::ditcaffe::ImageDataParameter* V1LayerParameter::mutable_image_data_param() { + set_has_image_data_param(); + if (image_data_param_ == NULL) image_data_param_ = new ::ditcaffe::ImageDataParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.image_data_param) + return image_data_param_; +} +inline ::ditcaffe::ImageDataParameter* V1LayerParameter::release_image_data_param() { + clear_has_image_data_param(); + ::ditcaffe::ImageDataParameter* temp = image_data_param_; + image_data_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_image_data_param(::ditcaffe::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:ditcaffe.V1LayerParameter.image_data_param) +} + +// optional .ditcaffe.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_->::ditcaffe::InfogainLossParameter::Clear(); + clear_has_infogain_loss_param(); +} +inline const ::ditcaffe::InfogainLossParameter& V1LayerParameter::infogain_loss_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.infogain_loss_param) + return infogain_loss_param_ != NULL ? *infogain_loss_param_ : *default_instance_->infogain_loss_param_; +} +inline ::ditcaffe::InfogainLossParameter* V1LayerParameter::mutable_infogain_loss_param() { + set_has_infogain_loss_param(); + if (infogain_loss_param_ == NULL) infogain_loss_param_ = new ::ditcaffe::InfogainLossParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.infogain_loss_param) + return infogain_loss_param_; +} +inline ::ditcaffe::InfogainLossParameter* V1LayerParameter::release_infogain_loss_param() { + clear_has_infogain_loss_param(); + ::ditcaffe::InfogainLossParameter* temp = infogain_loss_param_; + infogain_loss_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_infogain_loss_param(::ditcaffe::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:ditcaffe.V1LayerParameter.infogain_loss_param) +} + +// optional .ditcaffe.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_->::ditcaffe::InnerProductParameter::Clear(); + clear_has_inner_product_param(); +} +inline const ::ditcaffe::InnerProductParameter& V1LayerParameter::inner_product_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.inner_product_param) + return inner_product_param_ != NULL ? *inner_product_param_ : *default_instance_->inner_product_param_; +} +inline ::ditcaffe::InnerProductParameter* V1LayerParameter::mutable_inner_product_param() { + set_has_inner_product_param(); + if (inner_product_param_ == NULL) inner_product_param_ = new ::ditcaffe::InnerProductParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.inner_product_param) + return inner_product_param_; +} +inline ::ditcaffe::InnerProductParameter* V1LayerParameter::release_inner_product_param() { + clear_has_inner_product_param(); + ::ditcaffe::InnerProductParameter* temp = inner_product_param_; + inner_product_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_inner_product_param(::ditcaffe::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:ditcaffe.V1LayerParameter.inner_product_param) +} + +// optional .ditcaffe.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_->::ditcaffe::LRNParameter::Clear(); + clear_has_lrn_param(); +} +inline const ::ditcaffe::LRNParameter& V1LayerParameter::lrn_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.lrn_param) + return lrn_param_ != NULL ? *lrn_param_ : *default_instance_->lrn_param_; +} +inline ::ditcaffe::LRNParameter* V1LayerParameter::mutable_lrn_param() { + set_has_lrn_param(); + if (lrn_param_ == NULL) lrn_param_ = new ::ditcaffe::LRNParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.lrn_param) + return lrn_param_; +} +inline ::ditcaffe::LRNParameter* V1LayerParameter::release_lrn_param() { + clear_has_lrn_param(); + ::ditcaffe::LRNParameter* temp = lrn_param_; + lrn_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_lrn_param(::ditcaffe::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:ditcaffe.V1LayerParameter.lrn_param) +} + +// optional .ditcaffe.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_->::ditcaffe::MemoryDataParameter::Clear(); + clear_has_memory_data_param(); +} +inline const ::ditcaffe::MemoryDataParameter& V1LayerParameter::memory_data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.memory_data_param) + return memory_data_param_ != NULL ? *memory_data_param_ : *default_instance_->memory_data_param_; +} +inline ::ditcaffe::MemoryDataParameter* V1LayerParameter::mutable_memory_data_param() { + set_has_memory_data_param(); + if (memory_data_param_ == NULL) memory_data_param_ = new ::ditcaffe::MemoryDataParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.memory_data_param) + return memory_data_param_; +} +inline ::ditcaffe::MemoryDataParameter* V1LayerParameter::release_memory_data_param() { + clear_has_memory_data_param(); + ::ditcaffe::MemoryDataParameter* temp = memory_data_param_; + memory_data_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_memory_data_param(::ditcaffe::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:ditcaffe.V1LayerParameter.memory_data_param) +} + +// optional .ditcaffe.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_->::ditcaffe::MVNParameter::Clear(); + clear_has_mvn_param(); +} +inline const ::ditcaffe::MVNParameter& V1LayerParameter::mvn_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.mvn_param) + return mvn_param_ != NULL ? *mvn_param_ : *default_instance_->mvn_param_; +} +inline ::ditcaffe::MVNParameter* V1LayerParameter::mutable_mvn_param() { + set_has_mvn_param(); + if (mvn_param_ == NULL) mvn_param_ = new ::ditcaffe::MVNParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.mvn_param) + return mvn_param_; +} +inline ::ditcaffe::MVNParameter* V1LayerParameter::release_mvn_param() { + clear_has_mvn_param(); + ::ditcaffe::MVNParameter* temp = mvn_param_; + mvn_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_mvn_param(::ditcaffe::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:ditcaffe.V1LayerParameter.mvn_param) +} + +// optional .ditcaffe.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_->::ditcaffe::PoolingParameter::Clear(); + clear_has_pooling_param(); +} +inline const ::ditcaffe::PoolingParameter& V1LayerParameter::pooling_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.pooling_param) + return pooling_param_ != NULL ? *pooling_param_ : *default_instance_->pooling_param_; +} +inline ::ditcaffe::PoolingParameter* V1LayerParameter::mutable_pooling_param() { + set_has_pooling_param(); + if (pooling_param_ == NULL) pooling_param_ = new ::ditcaffe::PoolingParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.pooling_param) + return pooling_param_; +} +inline ::ditcaffe::PoolingParameter* V1LayerParameter::release_pooling_param() { + clear_has_pooling_param(); + ::ditcaffe::PoolingParameter* temp = pooling_param_; + pooling_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_pooling_param(::ditcaffe::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:ditcaffe.V1LayerParameter.pooling_param) +} + +// optional .ditcaffe.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_->::ditcaffe::PowerParameter::Clear(); + clear_has_power_param(); +} +inline const ::ditcaffe::PowerParameter& V1LayerParameter::power_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.power_param) + return power_param_ != NULL ? *power_param_ : *default_instance_->power_param_; +} +inline ::ditcaffe::PowerParameter* V1LayerParameter::mutable_power_param() { + set_has_power_param(); + if (power_param_ == NULL) power_param_ = new ::ditcaffe::PowerParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.power_param) + return power_param_; +} +inline ::ditcaffe::PowerParameter* V1LayerParameter::release_power_param() { + clear_has_power_param(); + ::ditcaffe::PowerParameter* temp = power_param_; + power_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_power_param(::ditcaffe::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:ditcaffe.V1LayerParameter.power_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ReLUParameter::Clear(); + clear_has_relu_param(); +} +inline const ::ditcaffe::ReLUParameter& V1LayerParameter::relu_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.relu_param) + return relu_param_ != NULL ? *relu_param_ : *default_instance_->relu_param_; +} +inline ::ditcaffe::ReLUParameter* V1LayerParameter::mutable_relu_param() { + set_has_relu_param(); + if (relu_param_ == NULL) relu_param_ = new ::ditcaffe::ReLUParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.relu_param) + return relu_param_; +} +inline ::ditcaffe::ReLUParameter* V1LayerParameter::release_relu_param() { + clear_has_relu_param(); + ::ditcaffe::ReLUParameter* temp = relu_param_; + relu_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_relu_param(::ditcaffe::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:ditcaffe.V1LayerParameter.relu_param) +} + +// optional .ditcaffe.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_->::ditcaffe::SigmoidParameter::Clear(); + clear_has_sigmoid_param(); +} +inline const ::ditcaffe::SigmoidParameter& V1LayerParameter::sigmoid_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.sigmoid_param) + return sigmoid_param_ != NULL ? *sigmoid_param_ : *default_instance_->sigmoid_param_; +} +inline ::ditcaffe::SigmoidParameter* V1LayerParameter::mutable_sigmoid_param() { + set_has_sigmoid_param(); + if (sigmoid_param_ == NULL) sigmoid_param_ = new ::ditcaffe::SigmoidParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.sigmoid_param) + return sigmoid_param_; +} +inline ::ditcaffe::SigmoidParameter* V1LayerParameter::release_sigmoid_param() { + clear_has_sigmoid_param(); + ::ditcaffe::SigmoidParameter* temp = sigmoid_param_; + sigmoid_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_sigmoid_param(::ditcaffe::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:ditcaffe.V1LayerParameter.sigmoid_param) +} + +// optional .ditcaffe.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_->::ditcaffe::SoftmaxParameter::Clear(); + clear_has_softmax_param(); +} +inline const ::ditcaffe::SoftmaxParameter& V1LayerParameter::softmax_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.softmax_param) + return softmax_param_ != NULL ? *softmax_param_ : *default_instance_->softmax_param_; +} +inline ::ditcaffe::SoftmaxParameter* V1LayerParameter::mutable_softmax_param() { + set_has_softmax_param(); + if (softmax_param_ == NULL) softmax_param_ = new ::ditcaffe::SoftmaxParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.softmax_param) + return softmax_param_; +} +inline ::ditcaffe::SoftmaxParameter* V1LayerParameter::release_softmax_param() { + clear_has_softmax_param(); + ::ditcaffe::SoftmaxParameter* temp = softmax_param_; + softmax_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_softmax_param(::ditcaffe::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:ditcaffe.V1LayerParameter.softmax_param) +} + +// optional .ditcaffe.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_->::ditcaffe::SliceParameter::Clear(); + clear_has_slice_param(); +} +inline const ::ditcaffe::SliceParameter& V1LayerParameter::slice_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.slice_param) + return slice_param_ != NULL ? *slice_param_ : *default_instance_->slice_param_; +} +inline ::ditcaffe::SliceParameter* V1LayerParameter::mutable_slice_param() { + set_has_slice_param(); + if (slice_param_ == NULL) slice_param_ = new ::ditcaffe::SliceParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.slice_param) + return slice_param_; +} +inline ::ditcaffe::SliceParameter* V1LayerParameter::release_slice_param() { + clear_has_slice_param(); + ::ditcaffe::SliceParameter* temp = slice_param_; + slice_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_slice_param(::ditcaffe::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:ditcaffe.V1LayerParameter.slice_param) +} + +// optional .ditcaffe.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_->::ditcaffe::TanHParameter::Clear(); + clear_has_tanh_param(); +} +inline const ::ditcaffe::TanHParameter& V1LayerParameter::tanh_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.tanh_param) + return tanh_param_ != NULL ? *tanh_param_ : *default_instance_->tanh_param_; +} +inline ::ditcaffe::TanHParameter* V1LayerParameter::mutable_tanh_param() { + set_has_tanh_param(); + if (tanh_param_ == NULL) tanh_param_ = new ::ditcaffe::TanHParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.tanh_param) + return tanh_param_; +} +inline ::ditcaffe::TanHParameter* V1LayerParameter::release_tanh_param() { + clear_has_tanh_param(); + ::ditcaffe::TanHParameter* temp = tanh_param_; + tanh_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_tanh_param(::ditcaffe::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:ditcaffe.V1LayerParameter.tanh_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ThresholdParameter::Clear(); + clear_has_threshold_param(); +} +inline const ::ditcaffe::ThresholdParameter& V1LayerParameter::threshold_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.threshold_param) + return threshold_param_ != NULL ? *threshold_param_ : *default_instance_->threshold_param_; +} +inline ::ditcaffe::ThresholdParameter* V1LayerParameter::mutable_threshold_param() { + set_has_threshold_param(); + if (threshold_param_ == NULL) threshold_param_ = new ::ditcaffe::ThresholdParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.threshold_param) + return threshold_param_; +} +inline ::ditcaffe::ThresholdParameter* V1LayerParameter::release_threshold_param() { + clear_has_threshold_param(); + ::ditcaffe::ThresholdParameter* temp = threshold_param_; + threshold_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_threshold_param(::ditcaffe::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:ditcaffe.V1LayerParameter.threshold_param) +} + +// optional .ditcaffe.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_->::ditcaffe::WindowDataParameter::Clear(); + clear_has_window_data_param(); +} +inline const ::ditcaffe::WindowDataParameter& V1LayerParameter::window_data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.window_data_param) + return window_data_param_ != NULL ? *window_data_param_ : *default_instance_->window_data_param_; +} +inline ::ditcaffe::WindowDataParameter* V1LayerParameter::mutable_window_data_param() { + set_has_window_data_param(); + if (window_data_param_ == NULL) window_data_param_ = new ::ditcaffe::WindowDataParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.window_data_param) + return window_data_param_; +} +inline ::ditcaffe::WindowDataParameter* V1LayerParameter::release_window_data_param() { + clear_has_window_data_param(); + ::ditcaffe::WindowDataParameter* temp = window_data_param_; + window_data_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_window_data_param(::ditcaffe::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:ditcaffe.V1LayerParameter.window_data_param) +} + +// optional .ditcaffe.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_->::ditcaffe::TransformationParameter::Clear(); + clear_has_transform_param(); +} +inline const ::ditcaffe::TransformationParameter& V1LayerParameter::transform_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.transform_param) + return transform_param_ != NULL ? *transform_param_ : *default_instance_->transform_param_; +} +inline ::ditcaffe::TransformationParameter* V1LayerParameter::mutable_transform_param() { + set_has_transform_param(); + if (transform_param_ == NULL) transform_param_ = new ::ditcaffe::TransformationParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.transform_param) + return transform_param_; +} +inline ::ditcaffe::TransformationParameter* V1LayerParameter::release_transform_param() { + clear_has_transform_param(); + ::ditcaffe::TransformationParameter* temp = transform_param_; + transform_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_transform_param(::ditcaffe::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:ditcaffe.V1LayerParameter.transform_param) +} + +// optional .ditcaffe.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_->::ditcaffe::LossParameter::Clear(); + clear_has_loss_param(); +} +inline const ::ditcaffe::LossParameter& V1LayerParameter::loss_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.loss_param) + return loss_param_ != NULL ? *loss_param_ : *default_instance_->loss_param_; +} +inline ::ditcaffe::LossParameter* V1LayerParameter::mutable_loss_param() { + set_has_loss_param(); + if (loss_param_ == NULL) loss_param_ = new ::ditcaffe::LossParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.loss_param) + return loss_param_; +} +inline ::ditcaffe::LossParameter* V1LayerParameter::release_loss_param() { + clear_has_loss_param(); + ::ditcaffe::LossParameter* temp = loss_param_; + loss_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_loss_param(::ditcaffe::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:ditcaffe.V1LayerParameter.loss_param) +} + +// optional .ditcaffe.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_->::ditcaffe::V0LayerParameter::Clear(); + clear_has_layer(); +} +inline const ::ditcaffe::V0LayerParameter& V1LayerParameter::layer() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.layer) + return layer_ != NULL ? *layer_ : *default_instance_->layer_; +} +inline ::ditcaffe::V0LayerParameter* V1LayerParameter::mutable_layer() { + set_has_layer(); + if (layer_ == NULL) layer_ = new ::ditcaffe::V0LayerParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.layer) + return layer_; +} +inline ::ditcaffe::V0LayerParameter* V1LayerParameter::release_layer() { + clear_has_layer(); + ::ditcaffe::V0LayerParameter* temp = layer_; + layer_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_layer(::ditcaffe::V0LayerParameter* layer) { + delete layer_; + layer_ = layer; + if (layer) { + set_has_layer(); + } else { + clear_has_layer(); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.V1LayerParameter.layer) +} + +// ------------------------------------------------------------------- + +// 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() { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_->clear(); + } + clear_has_name(); +} +inline const ::std::string& V0LayerParameter::name() const { + // @@protoc_insertion_point(field_get:ditcaffe.V0LayerParameter.name) + return *name_; +} +inline void V0LayerParameter::set_name(const ::std::string& value) { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + name_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.V0LayerParameter.name) +} +inline void V0LayerParameter::set_name(const char* value) { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + name_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.V0LayerParameter.name) +} +inline void V0LayerParameter::set_name(const char* value, size_t size) { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + name_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.V0LayerParameter.name) +} +inline ::std::string* V0LayerParameter::mutable_name() { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V0LayerParameter.name) + return name_; +} +inline ::std::string* V0LayerParameter::release_name() { + clear_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = name_; + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void V0LayerParameter::set_allocated_name(::std::string* name) { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete name_; + } + if (name) { + set_has_name(); + name_ = name; + } else { + clear_has_name(); + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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() { + if (type_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + type_->clear(); + } + clear_has_type(); +} +inline const ::std::string& V0LayerParameter::type() const { + // @@protoc_insertion_point(field_get:ditcaffe.V0LayerParameter.type) + return *type_; +} +inline void V0LayerParameter::set_type(const ::std::string& value) { + set_has_type(); + if (type_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + type_ = new ::std::string; + } + type_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.V0LayerParameter.type) +} +inline void V0LayerParameter::set_type(const char* value) { + set_has_type(); + if (type_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + type_ = new ::std::string; + } + type_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.V0LayerParameter.type) +} +inline void V0LayerParameter::set_type(const char* value, size_t size) { + set_has_type(); + if (type_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + type_ = new ::std::string; + } + type_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.V0LayerParameter.type) +} +inline ::std::string* V0LayerParameter::mutable_type() { + set_has_type(); + if (type_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + type_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V0LayerParameter.type) + return type_; +} +inline ::std::string* V0LayerParameter::release_type() { + clear_has_type(); + if (type_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = type_; + type_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void V0LayerParameter::set_allocated_type(::std::string* type) { + if (type_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete type_; + } + if (type) { + set_has_type(); + type_ = type; + } else { + clear_has_type(); + type_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.V0LayerParameter.biasterm) + return biasterm_; +} +inline void V0LayerParameter::set_biasterm(bool value) { + set_has_biasterm(); + biasterm_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.V0LayerParameter.biasterm) +} + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_weight_filler(); +} +inline const ::ditcaffe::FillerParameter& V0LayerParameter::weight_filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.V0LayerParameter.weight_filler) + return weight_filler_ != NULL ? *weight_filler_ : *default_instance_->weight_filler_; +} +inline ::ditcaffe::FillerParameter* V0LayerParameter::mutable_weight_filler() { + set_has_weight_filler(); + if (weight_filler_ == NULL) weight_filler_ = new ::ditcaffe::FillerParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V0LayerParameter.weight_filler) + return weight_filler_; +} +inline ::ditcaffe::FillerParameter* V0LayerParameter::release_weight_filler() { + clear_has_weight_filler(); + ::ditcaffe::FillerParameter* temp = weight_filler_; + weight_filler_ = NULL; + return temp; +} +inline void V0LayerParameter::set_allocated_weight_filler(::ditcaffe::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:ditcaffe.V0LayerParameter.weight_filler) +} + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_bias_filler(); +} +inline const ::ditcaffe::FillerParameter& V0LayerParameter::bias_filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.V0LayerParameter.bias_filler) + return bias_filler_ != NULL ? *bias_filler_ : *default_instance_->bias_filler_; +} +inline ::ditcaffe::FillerParameter* V0LayerParameter::mutable_bias_filler() { + set_has_bias_filler(); + if (bias_filler_ == NULL) bias_filler_ = new ::ditcaffe::FillerParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V0LayerParameter.bias_filler) + return bias_filler_; +} +inline ::ditcaffe::FillerParameter* V0LayerParameter::release_bias_filler() { + clear_has_bias_filler(); + ::ditcaffe::FillerParameter* temp = bias_filler_; + bias_filler_ = NULL; + return temp; +} +inline void V0LayerParameter::set_allocated_bias_filler(::ditcaffe::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:ditcaffe.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:ditcaffe.V0LayerParameter.pad) + return pad_; +} +inline void V0LayerParameter::set_pad(::google::protobuf::uint32 value) { + set_has_pad(); + pad_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.V0LayerParameter.kernelsize) + return kernelsize_; +} +inline void V0LayerParameter::set_kernelsize(::google::protobuf::uint32 value) { + set_has_kernelsize(); + kernelsize_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.V0LayerParameter.group) + return group_; +} +inline void V0LayerParameter::set_group(::google::protobuf::uint32 value) { + set_has_group(); + group_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.V0LayerParameter.stride) + return stride_; +} +inline void V0LayerParameter::set_stride(::google::protobuf::uint32 value) { + set_has_stride(); + stride_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.V0LayerParameter.stride) +} + +// optional .ditcaffe.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 ::ditcaffe::V0LayerParameter_PoolMethod V0LayerParameter::pool() const { + // @@protoc_insertion_point(field_get:ditcaffe.V0LayerParameter.pool) + return static_cast< ::ditcaffe::V0LayerParameter_PoolMethod >(pool_); +} +inline void V0LayerParameter::set_pool(::ditcaffe::V0LayerParameter_PoolMethod value) { + assert(::ditcaffe::V0LayerParameter_PoolMethod_IsValid(value)); + set_has_pool(); + pool_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.V0LayerParameter.alpha) + return alpha_; +} +inline void V0LayerParameter::set_alpha(float value) { + set_has_alpha(); + alpha_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.V0LayerParameter.beta) + return beta_; +} +inline void V0LayerParameter::set_beta(float value) { + set_has_beta(); + beta_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.V0LayerParameter.k) + return k_; +} +inline void V0LayerParameter::set_k(float value) { + set_has_k(); + k_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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() { + if (source_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_->clear(); + } + clear_has_source(); +} +inline const ::std::string& V0LayerParameter::source() const { + // @@protoc_insertion_point(field_get:ditcaffe.V0LayerParameter.source) + return *source_; +} +inline void V0LayerParameter::set_source(const ::std::string& value) { + set_has_source(); + if (source_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_ = new ::std::string; + } + source_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.V0LayerParameter.source) +} +inline void V0LayerParameter::set_source(const char* value) { + set_has_source(); + if (source_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_ = new ::std::string; + } + source_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.V0LayerParameter.source) +} +inline void V0LayerParameter::set_source(const char* value, size_t size) { + set_has_source(); + if (source_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_ = new ::std::string; + } + source_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.V0LayerParameter.source) +} +inline ::std::string* V0LayerParameter::mutable_source() { + set_has_source(); + if (source_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V0LayerParameter.source) + return source_; +} +inline ::std::string* V0LayerParameter::release_source() { + clear_has_source(); + if (source_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = source_; + source_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void V0LayerParameter::set_allocated_source(::std::string* source) { + if (source_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete source_; + } + if (source) { + set_has_source(); + source_ = source; + } else { + clear_has_source(); + source_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.V0LayerParameter.scale) + return scale_; +} +inline void V0LayerParameter::set_scale(float value) { + set_has_scale(); + scale_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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() { + if (meanfile_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + meanfile_->clear(); + } + clear_has_meanfile(); +} +inline const ::std::string& V0LayerParameter::meanfile() const { + // @@protoc_insertion_point(field_get:ditcaffe.V0LayerParameter.meanfile) + return *meanfile_; +} +inline void V0LayerParameter::set_meanfile(const ::std::string& value) { + set_has_meanfile(); + if (meanfile_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + meanfile_ = new ::std::string; + } + meanfile_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.V0LayerParameter.meanfile) +} +inline void V0LayerParameter::set_meanfile(const char* value) { + set_has_meanfile(); + if (meanfile_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + meanfile_ = new ::std::string; + } + meanfile_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.V0LayerParameter.meanfile) +} +inline void V0LayerParameter::set_meanfile(const char* value, size_t size) { + set_has_meanfile(); + if (meanfile_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + meanfile_ = new ::std::string; + } + meanfile_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.V0LayerParameter.meanfile) +} +inline ::std::string* V0LayerParameter::mutable_meanfile() { + set_has_meanfile(); + if (meanfile_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + meanfile_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V0LayerParameter.meanfile) + return meanfile_; +} +inline ::std::string* V0LayerParameter::release_meanfile() { + clear_has_meanfile(); + if (meanfile_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = meanfile_; + meanfile_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void V0LayerParameter::set_allocated_meanfile(::std::string* meanfile) { + if (meanfile_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete meanfile_; + } + if (meanfile) { + set_has_meanfile(); + meanfile_ = meanfile; + } else { + clear_has_meanfile(); + meanfile_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.V0LayerParameter.batchsize) + return batchsize_; +} +inline void V0LayerParameter::set_batchsize(::google::protobuf::uint32 value) { + set_has_batchsize(); + batchsize_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.V0LayerParameter.cropsize) + return cropsize_; +} +inline void V0LayerParameter::set_cropsize(::google::protobuf::uint32 value) { + set_has_cropsize(); + cropsize_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.V0LayerParameter.mirror) + return mirror_; +} +inline void V0LayerParameter::set_mirror(bool value) { + set_has_mirror(); + mirror_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.V0LayerParameter.mirror) +} + +// repeated .ditcaffe.BlobProto blobs = 50; +inline int V0LayerParameter::blobs_size() const { + return blobs_.size(); +} +inline void V0LayerParameter::clear_blobs() { + blobs_.Clear(); +} +inline const ::ditcaffe::BlobProto& V0LayerParameter::blobs(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.V0LayerParameter.blobs) + return blobs_.Get(index); +} +inline ::ditcaffe::BlobProto* V0LayerParameter::mutable_blobs(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.V0LayerParameter.blobs) + return blobs_.Mutable(index); +} +inline ::ditcaffe::BlobProto* V0LayerParameter::add_blobs() { + // @@protoc_insertion_point(field_add:ditcaffe.V0LayerParameter.blobs) + return blobs_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >& +V0LayerParameter::blobs() const { + // @@protoc_insertion_point(field_list:ditcaffe.V0LayerParameter.blobs) + return blobs_; +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >* +V0LayerParameter::mutable_blobs() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.V0LayerParameter.blobs_lr) +} +inline void V0LayerParameter::add_blobs_lr(float value) { + blobs_lr_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.V0LayerParameter.blobs_lr) +} +inline const ::google::protobuf::RepeatedField< float >& +V0LayerParameter::blobs_lr() const { + // @@protoc_insertion_point(field_list:ditcaffe.V0LayerParameter.blobs_lr) + return blobs_lr_; +} +inline ::google::protobuf::RepeatedField< float >* +V0LayerParameter::mutable_blobs_lr() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.V0LayerParameter.weight_decay) +} +inline void V0LayerParameter::add_weight_decay(float value) { + weight_decay_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.V0LayerParameter.weight_decay) +} +inline const ::google::protobuf::RepeatedField< float >& +V0LayerParameter::weight_decay() const { + // @@protoc_insertion_point(field_list:ditcaffe.V0LayerParameter.weight_decay) + return weight_decay_; +} +inline ::google::protobuf::RepeatedField< float >* +V0LayerParameter::mutable_weight_decay() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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() { + if (det_crop_mode_ != _default_det_crop_mode_) { + det_crop_mode_->assign(*_default_det_crop_mode_); + } + clear_has_det_crop_mode(); +} +inline const ::std::string& V0LayerParameter::det_crop_mode() const { + // @@protoc_insertion_point(field_get:ditcaffe.V0LayerParameter.det_crop_mode) + return *det_crop_mode_; +} +inline void V0LayerParameter::set_det_crop_mode(const ::std::string& value) { + set_has_det_crop_mode(); + if (det_crop_mode_ == _default_det_crop_mode_) { + det_crop_mode_ = new ::std::string; + } + det_crop_mode_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.V0LayerParameter.det_crop_mode) +} +inline void V0LayerParameter::set_det_crop_mode(const char* value) { + set_has_det_crop_mode(); + if (det_crop_mode_ == _default_det_crop_mode_) { + det_crop_mode_ = new ::std::string; + } + det_crop_mode_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.V0LayerParameter.det_crop_mode) +} +inline void V0LayerParameter::set_det_crop_mode(const char* value, size_t size) { + set_has_det_crop_mode(); + if (det_crop_mode_ == _default_det_crop_mode_) { + det_crop_mode_ = new ::std::string; + } + det_crop_mode_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.V0LayerParameter.det_crop_mode) +} +inline ::std::string* V0LayerParameter::mutable_det_crop_mode() { + set_has_det_crop_mode(); + if (det_crop_mode_ == _default_det_crop_mode_) { + det_crop_mode_ = new ::std::string(*_default_det_crop_mode_); + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V0LayerParameter.det_crop_mode) + return det_crop_mode_; +} +inline ::std::string* V0LayerParameter::release_det_crop_mode() { + clear_has_det_crop_mode(); + if (det_crop_mode_ == _default_det_crop_mode_) { + return NULL; + } else { + ::std::string* temp = det_crop_mode_; + det_crop_mode_ = const_cast< ::std::string*>(_default_det_crop_mode_); + return temp; + } +} +inline void V0LayerParameter::set_allocated_det_crop_mode(::std::string* det_crop_mode) { + if (det_crop_mode_ != _default_det_crop_mode_) { + delete det_crop_mode_; + } + if (det_crop_mode) { + set_has_det_crop_mode(); + det_crop_mode_ = det_crop_mode; + } else { + clear_has_det_crop_mode(); + det_crop_mode_ = const_cast< ::std::string*>(_default_det_crop_mode_); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.V0LayerParameter.concat_dim) +} + +// optional .ditcaffe.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_->::ditcaffe::HDF5OutputParameter::Clear(); + clear_has_hdf5_output_param(); +} +inline const ::ditcaffe::HDF5OutputParameter& V0LayerParameter::hdf5_output_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V0LayerParameter.hdf5_output_param) + return hdf5_output_param_ != NULL ? *hdf5_output_param_ : *default_instance_->hdf5_output_param_; +} +inline ::ditcaffe::HDF5OutputParameter* V0LayerParameter::mutable_hdf5_output_param() { + set_has_hdf5_output_param(); + if (hdf5_output_param_ == NULL) hdf5_output_param_ = new ::ditcaffe::HDF5OutputParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V0LayerParameter.hdf5_output_param) + return hdf5_output_param_; +} +inline ::ditcaffe::HDF5OutputParameter* V0LayerParameter::release_hdf5_output_param() { + clear_has_hdf5_output_param(); + ::ditcaffe::HDF5OutputParameter* temp = hdf5_output_param_; + hdf5_output_param_ = NULL; + return temp; +} +inline void V0LayerParameter::set_allocated_hdf5_output_param(::ditcaffe::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:ditcaffe.V0LayerParameter.hdf5_output_param) +} + +// ------------------------------------------------------------------- + +// PReLUParameter + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_filler(); +} +inline const ::ditcaffe::FillerParameter& PReLUParameter::filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.PReLUParameter.filler) + return filler_ != NULL ? *filler_ : *default_instance_->filler_; +} +inline ::ditcaffe::FillerParameter* PReLUParameter::mutable_filler() { + set_has_filler(); + if (filler_ == NULL) filler_ = new ::ditcaffe::FillerParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.PReLUParameter.filler) + return filler_; +} +inline ::ditcaffe::FillerParameter* PReLUParameter::release_filler() { + clear_has_filler(); + ::ditcaffe::FillerParameter* temp = filler_; + filler_ = NULL; + return temp; +} +inline void PReLUParameter::set_allocated_filler(::ditcaffe::FillerParameter* filler) { + delete filler_; + filler_ = filler; + if (filler) { + set_has_filler(); + } else { + clear_has_filler(); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.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:ditcaffe.PReLUParameter.channel_shared) +} + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace ditcaffe + +#ifndef SWIG +namespace google { +namespace protobuf { + +template <> struct is_proto_enum< ::ditcaffe::FillerParameter_VarianceNorm> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::ditcaffe::FillerParameter_VarianceNorm>() { + return ::ditcaffe::FillerParameter_VarianceNorm_descriptor(); +} +template <> struct is_proto_enum< ::ditcaffe::SolverParameter_SnapshotFormat> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::ditcaffe::SolverParameter_SnapshotFormat>() { + return ::ditcaffe::SolverParameter_SnapshotFormat_descriptor(); +} +template <> struct is_proto_enum< ::ditcaffe::SolverParameter_SolverMode> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::ditcaffe::SolverParameter_SolverMode>() { + return ::ditcaffe::SolverParameter_SolverMode_descriptor(); +} +template <> struct is_proto_enum< ::ditcaffe::SolverParameter_SolverType> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::ditcaffe::SolverParameter_SolverType>() { + return ::ditcaffe::SolverParameter_SolverType_descriptor(); +} +template <> struct is_proto_enum< ::ditcaffe::ParamSpec_DimCheckMode> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::ditcaffe::ParamSpec_DimCheckMode>() { + return ::ditcaffe::ParamSpec_DimCheckMode_descriptor(); +} +template <> struct is_proto_enum< ::ditcaffe::LossParameter_NormalizationMode> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::ditcaffe::LossParameter_NormalizationMode>() { + return ::ditcaffe::LossParameter_NormalizationMode_descriptor(); +} +template <> struct is_proto_enum< ::ditcaffe::ConvolutionParameter_Engine> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::ditcaffe::ConvolutionParameter_Engine>() { + return ::ditcaffe::ConvolutionParameter_Engine_descriptor(); +} +template <> struct is_proto_enum< ::ditcaffe::DataParameter_DB> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::ditcaffe::DataParameter_DB>() { + return ::ditcaffe::DataParameter_DB_descriptor(); +} +template <> struct is_proto_enum< ::ditcaffe::EltwiseParameter_EltwiseOp> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::ditcaffe::EltwiseParameter_EltwiseOp>() { + return ::ditcaffe::EltwiseParameter_EltwiseOp_descriptor(); +} +template <> struct is_proto_enum< ::ditcaffe::HingeLossParameter_Norm> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::ditcaffe::HingeLossParameter_Norm>() { + return ::ditcaffe::HingeLossParameter_Norm_descriptor(); +} +template <> struct is_proto_enum< ::ditcaffe::LRNParameter_NormRegion> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::ditcaffe::LRNParameter_NormRegion>() { + return ::ditcaffe::LRNParameter_NormRegion_descriptor(); +} +template <> struct is_proto_enum< ::ditcaffe::LRNParameter_Engine> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::ditcaffe::LRNParameter_Engine>() { + return ::ditcaffe::LRNParameter_Engine_descriptor(); +} +template <> struct is_proto_enum< ::ditcaffe::PoolingParameter_PoolMethod> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::ditcaffe::PoolingParameter_PoolMethod>() { + return ::ditcaffe::PoolingParameter_PoolMethod_descriptor(); +} +template <> struct is_proto_enum< ::ditcaffe::PoolingParameter_Engine> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::ditcaffe::PoolingParameter_Engine>() { + return ::ditcaffe::PoolingParameter_Engine_descriptor(); +} +template <> struct is_proto_enum< ::ditcaffe::ReductionParameter_ReductionOp> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::ditcaffe::ReductionParameter_ReductionOp>() { + return ::ditcaffe::ReductionParameter_ReductionOp_descriptor(); +} +template <> struct is_proto_enum< ::ditcaffe::ReLUParameter_Engine> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::ditcaffe::ReLUParameter_Engine>() { + return ::ditcaffe::ReLUParameter_Engine_descriptor(); +} +template <> struct is_proto_enum< ::ditcaffe::SigmoidParameter_Engine> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::ditcaffe::SigmoidParameter_Engine>() { + return ::ditcaffe::SigmoidParameter_Engine_descriptor(); +} +template <> struct is_proto_enum< ::ditcaffe::SoftmaxParameter_Engine> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::ditcaffe::SoftmaxParameter_Engine>() { + return ::ditcaffe::SoftmaxParameter_Engine_descriptor(); +} +template <> struct is_proto_enum< ::ditcaffe::TanHParameter_Engine> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::ditcaffe::TanHParameter_Engine>() { + return ::ditcaffe::TanHParameter_Engine_descriptor(); +} +template <> struct is_proto_enum< ::ditcaffe::SPPParameter_PoolMethod> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::ditcaffe::SPPParameter_PoolMethod>() { + return ::ditcaffe::SPPParameter_PoolMethod_descriptor(); +} +template <> struct is_proto_enum< ::ditcaffe::SPPParameter_Engine> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::ditcaffe::SPPParameter_Engine>() { + return ::ditcaffe::SPPParameter_Engine_descriptor(); +} +template <> struct is_proto_enum< ::ditcaffe::V1LayerParameter_LayerType> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::ditcaffe::V1LayerParameter_LayerType>() { + return ::ditcaffe::V1LayerParameter_LayerType_descriptor(); +} +template <> struct is_proto_enum< ::ditcaffe::V1LayerParameter_DimCheckMode> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::ditcaffe::V1LayerParameter_DimCheckMode>() { + return ::ditcaffe::V1LayerParameter_DimCheckMode_descriptor(); +} +template <> struct is_proto_enum< ::ditcaffe::V0LayerParameter_PoolMethod> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::ditcaffe::V0LayerParameter_PoolMethod>() { + return ::ditcaffe::V0LayerParameter_PoolMethod_descriptor(); +} +template <> struct is_proto_enum< ::ditcaffe::Phase> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::ditcaffe::Phase>() { + return ::ditcaffe::Phase_descriptor(); +} + +} // namespace google +} // namespace protobuf +#endif // SWIG + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_ditcaffe_2eproto__INCLUDED diff --git a/umd/core/src/compiler/caffe/ditcaffe/protobuf-3.0.0/ditcaffe.pb.cpp b/umd/core/src/compiler/caffe/ditcaffe/protobuf-3.0.0/ditcaffe.pb.cpp new file mode 100644 index 00000000..6009ffc4 --- /dev/null +++ b/umd/core/src/compiler/caffe/ditcaffe/protobuf-3.0.0/ditcaffe.pb.cpp @@ -0,0 +1,46891 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: ditcaffe.proto + +#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION +#include "ditcaffe.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +// @@protoc_insertion_point(includes) + +namespace ditcaffe { + +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* 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* 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* 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::EnumDescriptor* Phase_descriptor_ = NULL; + +} // namespace + + +void protobuf_AssignDesc_ditcaffe_2eproto() { + protobuf_AddDesc_ditcaffe_2eproto(); + const ::google::protobuf::FileDescriptor* file = + ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName( + "ditcaffe.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::default_instance_, + BlobShape_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BlobShape, _has_bits_[0]), + -1, + -1, + sizeof(BlobShape), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BlobShape, _internal_metadata_), + -1); + BlobProto_descriptor_ = file->message_type(1); + static const int BlobProto_offsets_[11] = { + 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, half_data_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BlobProto, half_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::default_instance_, + BlobProto_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BlobProto, _has_bits_[0]), + -1, + -1, + sizeof(BlobProto), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BlobProto, _internal_metadata_), + -1); + 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::default_instance_, + BlobProtoVector_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BlobProtoVector, _has_bits_[0]), + -1, + -1, + sizeof(BlobProtoVector), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BlobProtoVector, _internal_metadata_), + -1); + Datum_descriptor_ = file->message_type(3); + 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::default_instance_, + Datum_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Datum, _has_bits_[0]), + -1, + -1, + sizeof(Datum), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Datum, _internal_metadata_), + -1); + FillerParameter_descriptor_ = file->message_type(4); + 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::default_instance_, + FillerParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FillerParameter, _has_bits_[0]), + -1, + -1, + sizeof(FillerParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FillerParameter, _internal_metadata_), + -1); + FillerParameter_VarianceNorm_descriptor_ = FillerParameter_descriptor_->enum_type(0); + NetParameter_descriptor_ = file->message_type(5); + 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::default_instance_, + NetParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetParameter, _has_bits_[0]), + -1, + -1, + sizeof(NetParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetParameter, _internal_metadata_), + -1); + SolverParameter_descriptor_ = file->message_type(6); + 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::default_instance_, + SolverParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SolverParameter, _has_bits_[0]), + -1, + -1, + sizeof(SolverParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SolverParameter, _internal_metadata_), + -1); + 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(7); + 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::default_instance_, + SolverState_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SolverState, _has_bits_[0]), + -1, + -1, + sizeof(SolverState), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SolverState, _internal_metadata_), + -1); + NetState_descriptor_ = file->message_type(8); + 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::default_instance_, + NetState_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetState, _has_bits_[0]), + -1, + -1, + sizeof(NetState), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetState, _internal_metadata_), + -1); + NetStateRule_descriptor_ = file->message_type(9); + 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::default_instance_, + NetStateRule_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetStateRule, _has_bits_[0]), + -1, + -1, + sizeof(NetStateRule), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NetStateRule, _internal_metadata_), + -1); + ParamSpec_descriptor_ = file->message_type(10); + 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::default_instance_, + ParamSpec_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ParamSpec, _has_bits_[0]), + -1, + -1, + sizeof(ParamSpec), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ParamSpec, _internal_metadata_), + -1); + ParamSpec_DimCheckMode_descriptor_ = ParamSpec_descriptor_->enum_type(0); + LayerParameter_descriptor_ = file->message_type(11); + static const int LayerParameter_offsets_[57] = { + 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, 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, 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, python_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::default_instance_, + LayerParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, _has_bits_[0]), + -1, + -1, + sizeof(LayerParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, _internal_metadata_), + -1); + TransformationParameter_descriptor_ = file->message_type(12); + 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::default_instance_, + TransformationParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TransformationParameter, _has_bits_[0]), + -1, + -1, + sizeof(TransformationParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TransformationParameter, _internal_metadata_), + -1); + LossParameter_descriptor_ = file->message_type(13); + 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::default_instance_, + LossParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LossParameter, _has_bits_[0]), + -1, + -1, + sizeof(LossParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LossParameter, _internal_metadata_), + -1); + LossParameter_NormalizationMode_descriptor_ = LossParameter_descriptor_->enum_type(0); + AccuracyParameter_descriptor_ = file->message_type(14); + 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::default_instance_, + AccuracyParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AccuracyParameter, _has_bits_[0]), + -1, + -1, + sizeof(AccuracyParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AccuracyParameter, _internal_metadata_), + -1); + ArgMaxParameter_descriptor_ = file->message_type(15); + 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::default_instance_, + ArgMaxParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ArgMaxParameter, _has_bits_[0]), + -1, + -1, + sizeof(ArgMaxParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ArgMaxParameter, _internal_metadata_), + -1); + ConcatParameter_descriptor_ = file->message_type(16); + 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::default_instance_, + ConcatParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ConcatParameter, _has_bits_[0]), + -1, + -1, + sizeof(ConcatParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ConcatParameter, _internal_metadata_), + -1); + BatchNormParameter_descriptor_ = file->message_type(17); + 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::default_instance_, + BatchNormParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BatchNormParameter, _has_bits_[0]), + -1, + -1, + sizeof(BatchNormParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BatchNormParameter, _internal_metadata_), + -1); + BiasParameter_descriptor_ = file->message_type(18); + 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::default_instance_, + BiasParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BiasParameter, _has_bits_[0]), + -1, + -1, + sizeof(BiasParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BiasParameter, _internal_metadata_), + -1); + ContrastiveLossParameter_descriptor_ = file->message_type(19); + 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::default_instance_, + ContrastiveLossParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ContrastiveLossParameter, _has_bits_[0]), + -1, + -1, + sizeof(ContrastiveLossParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ContrastiveLossParameter, _internal_metadata_), + -1); + ConvolutionParameter_descriptor_ = file->message_type(20); + 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::default_instance_, + ConvolutionParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ConvolutionParameter, _has_bits_[0]), + -1, + -1, + sizeof(ConvolutionParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ConvolutionParameter, _internal_metadata_), + -1); + ConvolutionParameter_Engine_descriptor_ = ConvolutionParameter_descriptor_->enum_type(0); + CropParameter_descriptor_ = file->message_type(21); + 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::default_instance_, + CropParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CropParameter, _has_bits_[0]), + -1, + -1, + sizeof(CropParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CropParameter, _internal_metadata_), + -1); + DataParameter_descriptor_ = file->message_type(22); + 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::default_instance_, + DataParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DataParameter, _has_bits_[0]), + -1, + -1, + sizeof(DataParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DataParameter, _internal_metadata_), + -1); + DataParameter_DB_descriptor_ = DataParameter_descriptor_->enum_type(0); + DropoutParameter_descriptor_ = file->message_type(23); + 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::default_instance_, + DropoutParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DropoutParameter, _has_bits_[0]), + -1, + -1, + sizeof(DropoutParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DropoutParameter, _internal_metadata_), + -1); + DummyDataParameter_descriptor_ = file->message_type(24); + 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::default_instance_, + DummyDataParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DummyDataParameter, _has_bits_[0]), + -1, + -1, + sizeof(DummyDataParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DummyDataParameter, _internal_metadata_), + -1); + EltwiseParameter_descriptor_ = file->message_type(25); + 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::default_instance_, + EltwiseParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EltwiseParameter, _has_bits_[0]), + -1, + -1, + sizeof(EltwiseParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EltwiseParameter, _internal_metadata_), + -1); + EltwiseParameter_EltwiseOp_descriptor_ = EltwiseParameter_descriptor_->enum_type(0); + ELUParameter_descriptor_ = file->message_type(26); + static const int ELUParameter_offsets_[1] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ELUParameter, alpha_), + }; + ELUParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + ELUParameter_descriptor_, + ELUParameter::default_instance_, + ELUParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ELUParameter, _has_bits_[0]), + -1, + -1, + sizeof(ELUParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ELUParameter, _internal_metadata_), + -1); + EmbedParameter_descriptor_ = file->message_type(27); + 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::default_instance_, + EmbedParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EmbedParameter, _has_bits_[0]), + -1, + -1, + sizeof(EmbedParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EmbedParameter, _internal_metadata_), + -1); + ExpParameter_descriptor_ = file->message_type(28); + 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::default_instance_, + ExpParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ExpParameter, _has_bits_[0]), + -1, + -1, + sizeof(ExpParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ExpParameter, _internal_metadata_), + -1); + FlattenParameter_descriptor_ = file->message_type(29); + 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::default_instance_, + FlattenParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FlattenParameter, _has_bits_[0]), + -1, + -1, + sizeof(FlattenParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FlattenParameter, _internal_metadata_), + -1); + HDF5DataParameter_descriptor_ = file->message_type(30); + 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::default_instance_, + HDF5DataParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(HDF5DataParameter, _has_bits_[0]), + -1, + -1, + sizeof(HDF5DataParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(HDF5DataParameter, _internal_metadata_), + -1); + HDF5OutputParameter_descriptor_ = file->message_type(31); + 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::default_instance_, + HDF5OutputParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(HDF5OutputParameter, _has_bits_[0]), + -1, + -1, + sizeof(HDF5OutputParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(HDF5OutputParameter, _internal_metadata_), + -1); + HingeLossParameter_descriptor_ = file->message_type(32); + static const int HingeLossParameter_offsets_[1] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(HingeLossParameter, norm_), + }; + HingeLossParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + HingeLossParameter_descriptor_, + HingeLossParameter::default_instance_, + HingeLossParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(HingeLossParameter, _has_bits_[0]), + -1, + -1, + sizeof(HingeLossParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(HingeLossParameter, _internal_metadata_), + -1); + HingeLossParameter_Norm_descriptor_ = HingeLossParameter_descriptor_->enum_type(0); + ImageDataParameter_descriptor_ = file->message_type(33); + 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::default_instance_, + ImageDataParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ImageDataParameter, _has_bits_[0]), + -1, + -1, + sizeof(ImageDataParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ImageDataParameter, _internal_metadata_), + -1); + InfogainLossParameter_descriptor_ = file->message_type(34); + static const int InfogainLossParameter_offsets_[1] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(InfogainLossParameter, source_), + }; + InfogainLossParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + InfogainLossParameter_descriptor_, + InfogainLossParameter::default_instance_, + InfogainLossParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(InfogainLossParameter, _has_bits_[0]), + -1, + -1, + sizeof(InfogainLossParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(InfogainLossParameter, _internal_metadata_), + -1); + InnerProductParameter_descriptor_ = file->message_type(35); + 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::default_instance_, + InnerProductParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(InnerProductParameter, _has_bits_[0]), + -1, + -1, + sizeof(InnerProductParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(InnerProductParameter, _internal_metadata_), + -1); + InputParameter_descriptor_ = file->message_type(36); + static const int InputParameter_offsets_[1] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(InputParameter, shape_), + }; + InputParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + InputParameter_descriptor_, + InputParameter::default_instance_, + InputParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(InputParameter, _has_bits_[0]), + -1, + -1, + sizeof(InputParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(InputParameter, _internal_metadata_), + -1); + LogParameter_descriptor_ = file->message_type(37); + 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::default_instance_, + LogParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LogParameter, _has_bits_[0]), + -1, + -1, + sizeof(LogParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LogParameter, _internal_metadata_), + -1); + LRNParameter_descriptor_ = file->message_type(38); + 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::default_instance_, + LRNParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LRNParameter, _has_bits_[0]), + -1, + -1, + sizeof(LRNParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LRNParameter, _internal_metadata_), + -1); + LRNParameter_NormRegion_descriptor_ = LRNParameter_descriptor_->enum_type(0); + LRNParameter_Engine_descriptor_ = LRNParameter_descriptor_->enum_type(1); + MemoryDataParameter_descriptor_ = file->message_type(39); + 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::default_instance_, + MemoryDataParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MemoryDataParameter, _has_bits_[0]), + -1, + -1, + sizeof(MemoryDataParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MemoryDataParameter, _internal_metadata_), + -1); + MVNParameter_descriptor_ = file->message_type(40); + 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::default_instance_, + MVNParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MVNParameter, _has_bits_[0]), + -1, + -1, + sizeof(MVNParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MVNParameter, _internal_metadata_), + -1); + ParameterParameter_descriptor_ = file->message_type(41); + static const int ParameterParameter_offsets_[1] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ParameterParameter, shape_), + }; + ParameterParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + ParameterParameter_descriptor_, + ParameterParameter::default_instance_, + ParameterParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ParameterParameter, _has_bits_[0]), + -1, + -1, + sizeof(ParameterParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ParameterParameter, _internal_metadata_), + -1); + PoolingParameter_descriptor_ = file->message_type(42); + static const int PoolingParameter_offsets_[13] = { + 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_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PoolingParameter, torch_pooling_), + }; + PoolingParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + PoolingParameter_descriptor_, + PoolingParameter::default_instance_, + PoolingParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PoolingParameter, _has_bits_[0]), + -1, + -1, + sizeof(PoolingParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PoolingParameter, _internal_metadata_), + -1); + PoolingParameter_PoolMethod_descriptor_ = PoolingParameter_descriptor_->enum_type(0); + PoolingParameter_Engine_descriptor_ = PoolingParameter_descriptor_->enum_type(1); + PowerParameter_descriptor_ = file->message_type(43); + 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::default_instance_, + PowerParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PowerParameter, _has_bits_[0]), + -1, + -1, + sizeof(PowerParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PowerParameter, _internal_metadata_), + -1); + PythonParameter_descriptor_ = file->message_type(44); + 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::default_instance_, + PythonParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PythonParameter, _has_bits_[0]), + -1, + -1, + sizeof(PythonParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PythonParameter, _internal_metadata_), + -1); + ReductionParameter_descriptor_ = file->message_type(45); + 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::default_instance_, + ReductionParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ReductionParameter, _has_bits_[0]), + -1, + -1, + sizeof(ReductionParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ReductionParameter, _internal_metadata_), + -1); + ReductionParameter_ReductionOp_descriptor_ = ReductionParameter_descriptor_->enum_type(0); + ReLUParameter_descriptor_ = file->message_type(46); + 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::default_instance_, + ReLUParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ReLUParameter, _has_bits_[0]), + -1, + -1, + sizeof(ReLUParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ReLUParameter, _internal_metadata_), + -1); + ReLUParameter_Engine_descriptor_ = ReLUParameter_descriptor_->enum_type(0); + ReshapeParameter_descriptor_ = file->message_type(47); + 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::default_instance_, + ReshapeParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ReshapeParameter, _has_bits_[0]), + -1, + -1, + sizeof(ReshapeParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ReshapeParameter, _internal_metadata_), + -1); + ScaleParameter_descriptor_ = file->message_type(48); + 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::default_instance_, + ScaleParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ScaleParameter, _has_bits_[0]), + -1, + -1, + sizeof(ScaleParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ScaleParameter, _internal_metadata_), + -1); + SigmoidParameter_descriptor_ = file->message_type(49); + static const int SigmoidParameter_offsets_[1] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SigmoidParameter, engine_), + }; + SigmoidParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + SigmoidParameter_descriptor_, + SigmoidParameter::default_instance_, + SigmoidParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SigmoidParameter, _has_bits_[0]), + -1, + -1, + sizeof(SigmoidParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SigmoidParameter, _internal_metadata_), + -1); + SigmoidParameter_Engine_descriptor_ = SigmoidParameter_descriptor_->enum_type(0); + SliceParameter_descriptor_ = file->message_type(50); + 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::default_instance_, + SliceParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SliceParameter, _has_bits_[0]), + -1, + -1, + sizeof(SliceParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SliceParameter, _internal_metadata_), + -1); + SoftmaxParameter_descriptor_ = file->message_type(51); + 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::default_instance_, + SoftmaxParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SoftmaxParameter, _has_bits_[0]), + -1, + -1, + sizeof(SoftmaxParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SoftmaxParameter, _internal_metadata_), + -1); + SoftmaxParameter_Engine_descriptor_ = SoftmaxParameter_descriptor_->enum_type(0); + TanHParameter_descriptor_ = file->message_type(52); + static const int TanHParameter_offsets_[1] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TanHParameter, engine_), + }; + TanHParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + TanHParameter_descriptor_, + TanHParameter::default_instance_, + TanHParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TanHParameter, _has_bits_[0]), + -1, + -1, + sizeof(TanHParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TanHParameter, _internal_metadata_), + -1); + TanHParameter_Engine_descriptor_ = TanHParameter_descriptor_->enum_type(0); + TileParameter_descriptor_ = file->message_type(53); + 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::default_instance_, + TileParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TileParameter, _has_bits_[0]), + -1, + -1, + sizeof(TileParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TileParameter, _internal_metadata_), + -1); + ThresholdParameter_descriptor_ = file->message_type(54); + static const int ThresholdParameter_offsets_[1] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ThresholdParameter, threshold_), + }; + ThresholdParameter_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + ThresholdParameter_descriptor_, + ThresholdParameter::default_instance_, + ThresholdParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ThresholdParameter, _has_bits_[0]), + -1, + -1, + sizeof(ThresholdParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ThresholdParameter, _internal_metadata_), + -1); + WindowDataParameter_descriptor_ = file->message_type(55); + 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::default_instance_, + WindowDataParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(WindowDataParameter, _has_bits_[0]), + -1, + -1, + sizeof(WindowDataParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(WindowDataParameter, _internal_metadata_), + -1); + SPPParameter_descriptor_ = file->message_type(56); + 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::default_instance_, + SPPParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SPPParameter, _has_bits_[0]), + -1, + -1, + sizeof(SPPParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SPPParameter, _internal_metadata_), + -1); + SPPParameter_PoolMethod_descriptor_ = SPPParameter_descriptor_->enum_type(0); + SPPParameter_Engine_descriptor_ = SPPParameter_descriptor_->enum_type(1); + V1LayerParameter_descriptor_ = file->message_type(57); + 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::default_instance_, + V1LayerParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V1LayerParameter, _has_bits_[0]), + -1, + -1, + sizeof(V1LayerParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V1LayerParameter, _internal_metadata_), + -1); + V1LayerParameter_LayerType_descriptor_ = V1LayerParameter_descriptor_->enum_type(0); + V1LayerParameter_DimCheckMode_descriptor_ = V1LayerParameter_descriptor_->enum_type(1); + V0LayerParameter_descriptor_ = file->message_type(58); + 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::default_instance_, + V0LayerParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V0LayerParameter, _has_bits_[0]), + -1, + -1, + sizeof(V0LayerParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(V0LayerParameter, _internal_metadata_), + -1); + V0LayerParameter_PoolMethod_descriptor_ = V0LayerParameter_descriptor_->enum_type(0); + PReLUParameter_descriptor_ = file->message_type(59); + 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::default_instance_, + PReLUParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PReLUParameter, _has_bits_[0]), + -1, + -1, + sizeof(PReLUParameter), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PReLUParameter, _internal_metadata_), + -1); + Phase_descriptor_ = file->enum_type(0); +} + +namespace { + +GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_); +inline void protobuf_AssignDescriptorsOnce() { + ::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_, + &protobuf_AssignDesc_ditcaffe_2eproto); +} + +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + BlobShape_descriptor_, &BlobShape::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + BlobProto_descriptor_, &BlobProto::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + BlobProtoVector_descriptor_, &BlobProtoVector::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + Datum_descriptor_, &Datum::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + FillerParameter_descriptor_, &FillerParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + NetParameter_descriptor_, &NetParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + SolverParameter_descriptor_, &SolverParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + SolverState_descriptor_, &SolverState::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + NetState_descriptor_, &NetState::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + NetStateRule_descriptor_, &NetStateRule::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + ParamSpec_descriptor_, &ParamSpec::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + LayerParameter_descriptor_, &LayerParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + TransformationParameter_descriptor_, &TransformationParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + LossParameter_descriptor_, &LossParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + AccuracyParameter_descriptor_, &AccuracyParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + ArgMaxParameter_descriptor_, &ArgMaxParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + ConcatParameter_descriptor_, &ConcatParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + BatchNormParameter_descriptor_, &BatchNormParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + BiasParameter_descriptor_, &BiasParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + ContrastiveLossParameter_descriptor_, &ContrastiveLossParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + ConvolutionParameter_descriptor_, &ConvolutionParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + CropParameter_descriptor_, &CropParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + DataParameter_descriptor_, &DataParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + DropoutParameter_descriptor_, &DropoutParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + DummyDataParameter_descriptor_, &DummyDataParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + EltwiseParameter_descriptor_, &EltwiseParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + ELUParameter_descriptor_, &ELUParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + EmbedParameter_descriptor_, &EmbedParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + ExpParameter_descriptor_, &ExpParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + FlattenParameter_descriptor_, &FlattenParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + HDF5DataParameter_descriptor_, &HDF5DataParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + HDF5OutputParameter_descriptor_, &HDF5OutputParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + HingeLossParameter_descriptor_, &HingeLossParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + ImageDataParameter_descriptor_, &ImageDataParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + InfogainLossParameter_descriptor_, &InfogainLossParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + InnerProductParameter_descriptor_, &InnerProductParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + InputParameter_descriptor_, &InputParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + LogParameter_descriptor_, &LogParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + LRNParameter_descriptor_, &LRNParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + MemoryDataParameter_descriptor_, &MemoryDataParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + MVNParameter_descriptor_, &MVNParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + ParameterParameter_descriptor_, &ParameterParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + PoolingParameter_descriptor_, &PoolingParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + PowerParameter_descriptor_, &PowerParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + PythonParameter_descriptor_, &PythonParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + ReductionParameter_descriptor_, &ReductionParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + ReLUParameter_descriptor_, &ReLUParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + ReshapeParameter_descriptor_, &ReshapeParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + ScaleParameter_descriptor_, &ScaleParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + SigmoidParameter_descriptor_, &SigmoidParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + SliceParameter_descriptor_, &SliceParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + SoftmaxParameter_descriptor_, &SoftmaxParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + TanHParameter_descriptor_, &TanHParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + TileParameter_descriptor_, &TileParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + ThresholdParameter_descriptor_, &ThresholdParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + WindowDataParameter_descriptor_, &WindowDataParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + SPPParameter_descriptor_, &SPPParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + V1LayerParameter_descriptor_, &V1LayerParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + V0LayerParameter_descriptor_, &V0LayerParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + PReLUParameter_descriptor_, &PReLUParameter::default_instance()); +} + +} // namespace + +void protobuf_ShutdownFile_ditcaffe_2eproto() { + delete BlobShape::default_instance_; + delete BlobShape_reflection_; + delete BlobProto::default_instance_; + delete BlobProto_reflection_; + delete BlobProtoVector::default_instance_; + delete BlobProtoVector_reflection_; + delete Datum::default_instance_; + delete Datum_reflection_; + delete FillerParameter::default_instance_; + delete FillerParameter_reflection_; + delete FillerParameter::_default_type_; + delete NetParameter::default_instance_; + delete NetParameter_reflection_; + delete SolverParameter::default_instance_; + delete SolverParameter_reflection_; + delete SolverParameter::_default_regularization_type_; + delete SolverParameter::_default_type_; + delete SolverState::default_instance_; + delete SolverState_reflection_; + delete NetState::default_instance_; + delete NetState_reflection_; + delete NetStateRule::default_instance_; + delete NetStateRule_reflection_; + delete ParamSpec::default_instance_; + delete ParamSpec_reflection_; + delete LayerParameter::default_instance_; + delete LayerParameter_reflection_; + delete TransformationParameter::default_instance_; + delete TransformationParameter_reflection_; + delete LossParameter::default_instance_; + delete LossParameter_reflection_; + delete AccuracyParameter::default_instance_; + delete AccuracyParameter_reflection_; + delete ArgMaxParameter::default_instance_; + delete ArgMaxParameter_reflection_; + delete ConcatParameter::default_instance_; + delete ConcatParameter_reflection_; + delete BatchNormParameter::default_instance_; + delete BatchNormParameter_reflection_; + delete BiasParameter::default_instance_; + delete BiasParameter_reflection_; + delete ContrastiveLossParameter::default_instance_; + delete ContrastiveLossParameter_reflection_; + delete ConvolutionParameter::default_instance_; + delete ConvolutionParameter_reflection_; + delete CropParameter::default_instance_; + delete CropParameter_reflection_; + delete DataParameter::default_instance_; + delete DataParameter_reflection_; + delete DropoutParameter::default_instance_; + delete DropoutParameter_reflection_; + delete DummyDataParameter::default_instance_; + delete DummyDataParameter_reflection_; + delete EltwiseParameter::default_instance_; + delete EltwiseParameter_reflection_; + delete ELUParameter::default_instance_; + delete ELUParameter_reflection_; + delete EmbedParameter::default_instance_; + delete EmbedParameter_reflection_; + delete ExpParameter::default_instance_; + delete ExpParameter_reflection_; + delete FlattenParameter::default_instance_; + delete FlattenParameter_reflection_; + delete HDF5DataParameter::default_instance_; + delete HDF5DataParameter_reflection_; + delete HDF5OutputParameter::default_instance_; + delete HDF5OutputParameter_reflection_; + delete HingeLossParameter::default_instance_; + delete HingeLossParameter_reflection_; + delete ImageDataParameter::default_instance_; + delete ImageDataParameter_reflection_; + delete InfogainLossParameter::default_instance_; + delete InfogainLossParameter_reflection_; + delete InnerProductParameter::default_instance_; + delete InnerProductParameter_reflection_; + delete InputParameter::default_instance_; + delete InputParameter_reflection_; + delete LogParameter::default_instance_; + delete LogParameter_reflection_; + delete LRNParameter::default_instance_; + delete LRNParameter_reflection_; + delete MemoryDataParameter::default_instance_; + delete MemoryDataParameter_reflection_; + delete MVNParameter::default_instance_; + delete MVNParameter_reflection_; + delete ParameterParameter::default_instance_; + delete ParameterParameter_reflection_; + delete PoolingParameter::default_instance_; + delete PoolingParameter_reflection_; + delete PowerParameter::default_instance_; + delete PowerParameter_reflection_; + delete PythonParameter::default_instance_; + delete PythonParameter_reflection_; + delete ReductionParameter::default_instance_; + delete ReductionParameter_reflection_; + delete ReLUParameter::default_instance_; + delete ReLUParameter_reflection_; + delete ReshapeParameter::default_instance_; + delete ReshapeParameter_reflection_; + delete ScaleParameter::default_instance_; + delete ScaleParameter_reflection_; + delete SigmoidParameter::default_instance_; + delete SigmoidParameter_reflection_; + delete SliceParameter::default_instance_; + delete SliceParameter_reflection_; + delete SoftmaxParameter::default_instance_; + delete SoftmaxParameter_reflection_; + delete TanHParameter::default_instance_; + delete TanHParameter_reflection_; + delete TileParameter::default_instance_; + delete TileParameter_reflection_; + delete ThresholdParameter::default_instance_; + delete ThresholdParameter_reflection_; + delete WindowDataParameter::default_instance_; + delete WindowDataParameter_reflection_; + delete WindowDataParameter::_default_crop_mode_; + delete SPPParameter::default_instance_; + delete SPPParameter_reflection_; + delete V1LayerParameter::default_instance_; + delete V1LayerParameter_reflection_; + delete V0LayerParameter::default_instance_; + delete V0LayerParameter_reflection_; + delete V0LayerParameter::_default_det_crop_mode_; + delete PReLUParameter::default_instance_; + delete PReLUParameter_reflection_; +} + +void protobuf_AddDesc_ditcaffe_2eproto() { + static bool already_here = false; + if (already_here) return; + already_here = true; + GOOGLE_PROTOBUF_VERIFY_VERSION; + + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + "\n\016ditcaffe.proto\022\010ditcaffe\"\034\n\tBlobShape\022" + "\017\n\003dim\030\001 \003(\003B\002\020\001\"\375\001\n\tBlobProto\022\"\n\005shape\030" + "\007 \001(\0132\023.ditcaffe.BlobShape\022\020\n\004data\030\005 \003(\002" + "B\002\020\001\022\020\n\004diff\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\025\n\thalf" + "_data\030\n \003(\rB\002\020\001\022\025\n\thalf_diff\030\013 \003(\rB\002\020\001\022\016" + "\n\003num\030\001 \001(\005:\0010\022\023\n\010channels\030\002 \001(\005:\0010\022\021\n\006h" + "eight\030\003 \001(\005:\0010\022\020\n\005width\030\004 \001(\005:\0010\"5\n\017Blob" + "ProtoVector\022\"\n\005blobs\030\001 \003(\0132\023.ditcaffe.Bl" + "obProto\"\201\001\n\005Datum\022\020\n\010channels\030\001 \001(\005\022\016\n\006h" + "eight\030\002 \001(\005\022\r\n\005width\030\003 \001(\005\022\014\n\004data\030\004 \001(\014" + "\022\r\n\005label\030\005 \001(\005\022\022\n\nfloat_data\030\006 \003(\002\022\026\n\007e" + "ncoded\030\007 \001(\010:\005false\"\215\002\n\017FillerParameter\022" + "\026\n\004type\030\001 \001(\t:\010constant\022\020\n\005value\030\002 \001(\002:\001" + "0\022\016\n\003min\030\003 \001(\002:\0010\022\016\n\003max\030\004 \001(\002:\0011\022\017\n\004mea" + "n\030\005 \001(\002:\0010\022\016\n\003std\030\006 \001(\002:\0011\022\022\n\006sparse\030\007 \001" + "(\005:\002-1\022E\n\rvariance_norm\030\010 \001(\0162&.ditcaffe" + ".FillerParameter.VarianceNorm:\006FAN_IN\"4\n" + "\014VarianceNorm\022\n\n\006FAN_IN\020\000\022\013\n\007FAN_OUT\020\001\022\013" + "\n\007AVERAGE\020\002\"\232\002\n\014NetParameter\022\014\n\004name\030\001 \001" + "(\t\022\r\n\005input\030\003 \003(\t\022(\n\013input_shape\030\010 \003(\0132\023" + ".ditcaffe.BlobShape\022\021\n\tinput_dim\030\004 \003(\005\022\035" + "\n\016force_backward\030\005 \001(\010:\005false\022!\n\005state\030\006" + " \001(\0132\022.ditcaffe.NetState\022\031\n\ndebug_info\030\007" + " \001(\010:\005false\022\'\n\005layer\030d \003(\0132\030.ditcaffe.La" + "yerParameter\022*\n\006layers\030\002 \003(\0132\032.ditcaffe." + "V1LayerParameter\"\264\n\n\017SolverParameter\022\013\n\003" + "net\030\030 \001(\t\022)\n\tnet_param\030\031 \001(\0132\026.ditcaffe." + "NetParameter\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\026.dit" + "caffe.NetParameter\022.\n\016test_net_param\030\026 \003" + "(\0132\026.ditcaffe.NetParameter\022\'\n\013train_stat" + "e\030\032 \001(\0132\022.ditcaffe.NetState\022&\n\ntest_stat" + "e\030\033 \003(\0132\022.ditcaffe.NetState\022\021\n\ttest_iter" + "\030\003 \003(\005\022\030\n\rtest_interval\030\004 \001(\005:\0010\022 \n\021test" + "_compute_loss\030\023 \001(\010:\005false\022!\n\023test_initi" + "alization\030 \001(\010:\004true\022\017\n\007base_lr\030\005 \001(\002\022\017" + "\n\007display\030\006 \001(\005\022\027\n\014average_loss\030! \001(\005:\0011" + "\022\020\n\010max_iter\030\007 \001(\005\022\024\n\titer_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\005po" + "wer\030\n \001(\002\022\020\n\010momentum\030\013 \001(\002\022\024\n\014weight_de" + "cay\030\014 \001(\002\022\037\n\023regularization_type\030\035 \001(\t:\002" + "L2\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_prefix\030\017 \001(\t\022\034\n\rsna" + "pshot_diff\030\020 \001(\010:\005false\022N\n\017snapshot_form" + "at\030% \001(\0162(.ditcaffe.SolverParameter.Snap" + "shotFormat:\013BINARYPROTO\022>\n\013solver_mode\030\021" + " \001(\0162$.ditcaffe.SolverParameter.SolverMo" + "de:\003GPU\022\024\n\tdevice_id\030\022 \001(\005:\0010\022\027\n\013random_" + "seed\030\024 \001(\003:\002-1\022\021\n\004type\030( \001(\t:\003SGD\022\024\n\005del" + "ta\030\037 \001(\002:\0051e-08\022\030\n\tmomentum2\030\' \001(\002:\0050.99" + "9\022\021\n\trms_decay\030& \001(\002\022\031\n\ndebug_info\030\027 \001(\010" + ":\005false\022\"\n\024snapshot_after_train\030\034 \001(\010:\004t" + "rue\022>\n\013solver_type\030\036 \001(\0162$.ditcaffe.Solv" + "erParameter.SolverType:\003SGD\"+\n\016SnapshotF" + "ormat\022\010\n\004HDF5\020\000\022\017\n\013BINARYPROTO\020\001\"\036\n\nSolv" + "erMode\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\007ADAGRAD\020\002\022\013\n\007RM" + "SPROP\020\003\022\014\n\010ADADELTA\020\004\022\010\n\004ADAM\020\005\"o\n\013Solve" + "rState\022\014\n\004iter\030\001 \001(\005\022\023\n\013learned_net\030\002 \001(" + "\t\022$\n\007history\030\003 \003(\0132\023.ditcaffe.BlobProto\022" + "\027\n\014current_step\030\004 \001(\005:\0010\"Q\n\010NetState\022$\n\005" + "phase\030\001 \001(\0162\017.ditcaffe.Phase:\004TEST\022\020\n\005le" + "vel\030\002 \001(\005:\0010\022\r\n\005stage\030\003 \003(\t\"v\n\014NetStateR" + "ule\022\036\n\005phase\030\001 \001(\0162\017.ditcaffe.Phase\022\021\n\tm" + "in_level\030\002 \001(\005\022\021\n\tmax_level\030\003 \001(\005\022\r\n\005sta" + "ge\030\004 \003(\t\022\021\n\tnot_stage\030\005 \003(\t\"\246\001\n\tParamSpe" + "c\022\014\n\004name\030\001 \001(\t\0224\n\nshare_mode\030\002 \001(\0162 .di" + "tcaffe.ParamSpec.DimCheckMode\022\022\n\007lr_mult" + "\030\003 \001(\002:\0011\022\025\n\ndecay_mult\030\004 \001(\002:\0011\"*\n\014DimC" + "heckMode\022\n\n\006STRICT\020\000\022\016\n\nPERMISSIVE\020\001\"\346\024\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\036\n\005phas" + "e\030\n \001(\0162\017.ditcaffe.Phase\022\023\n\013loss_weight\030" + "\005 \003(\002\022\"\n\005param\030\006 \003(\0132\023.ditcaffe.ParamSpe" + "c\022\"\n\005blobs\030\007 \003(\0132\023.ditcaffe.BlobProto\022\026\n" + "\016propagate_down\030\013 \003(\010\022\'\n\007include\030\010 \003(\0132\026" + ".ditcaffe.NetStateRule\022\'\n\007exclude\030\t \003(\0132" + "\026.ditcaffe.NetStateRule\022:\n\017transform_par" + "am\030d \001(\0132!.ditcaffe.TransformationParame" + "ter\022+\n\nloss_param\030e \001(\0132\027.ditcaffe.LossP" + "arameter\0223\n\016accuracy_param\030f \001(\0132\033.ditca" + "ffe.AccuracyParameter\022/\n\014argmax_param\030g " + "\001(\0132\031.ditcaffe.ArgMaxParameter\0227\n\020batch_" + "norm_param\030\213\001 \001(\0132\034.ditcaffe.BatchNormPa" + "rameter\022,\n\nbias_param\030\215\001 \001(\0132\027.ditcaffe." + "BiasParameter\022/\n\014concat_param\030h \001(\0132\031.di" + "tcaffe.ConcatParameter\022B\n\026contrastive_lo" + "ss_param\030i \001(\0132\".ditcaffe.ContrastiveLos" + "sParameter\0229\n\021convolution_param\030j \001(\0132\036." + "ditcaffe.ConvolutionParameter\022,\n\ncrop_pa" + "ram\030\220\001 \001(\0132\027.ditcaffe.CropParameter\022+\n\nd" + "ata_param\030k \001(\0132\027.ditcaffe.DataParameter" + "\0221\n\rdropout_param\030l \001(\0132\032.ditcaffe.Dropo" + "utParameter\0226\n\020dummy_data_param\030m \001(\0132\034." + "ditcaffe.DummyDataParameter\0221\n\reltwise_p" + "aram\030n \001(\0132\032.ditcaffe.EltwiseParameter\022*" + "\n\telu_param\030\214\001 \001(\0132\026.ditcaffe.ELUParamet" + "er\022.\n\013embed_param\030\211\001 \001(\0132\030.ditcaffe.Embe" + "dParameter\022)\n\texp_param\030o \001(\0132\026.ditcaffe" + ".ExpParameter\0222\n\rflatten_param\030\207\001 \001(\0132\032." + "ditcaffe.FlattenParameter\0224\n\017hdf5_data_p" + "aram\030p \001(\0132\033.ditcaffe.HDF5DataParameter\022" + "8\n\021hdf5_output_param\030q \001(\0132\035.ditcaffe.HD" + "F5OutputParameter\0226\n\020hinge_loss_param\030r " + "\001(\0132\034.ditcaffe.HingeLossParameter\0226\n\020ima" + "ge_data_param\030s \001(\0132\034.ditcaffe.ImageData" + "Parameter\022<\n\023infogain_loss_param\030t \001(\0132\037" + ".ditcaffe.InfogainLossParameter\022<\n\023inner" + "_product_param\030u \001(\0132\037.ditcaffe.InnerPro" + "ductParameter\022.\n\013input_param\030\217\001 \001(\0132\030.di" + "tcaffe.InputParameter\022*\n\tlog_param\030\206\001 \001(" + "\0132\026.ditcaffe.LogParameter\022)\n\tlrn_param\030v" + " \001(\0132\026.ditcaffe.LRNParameter\0228\n\021memory_d" + "ata_param\030w \001(\0132\035.ditcaffe.MemoryDataPar" + "ameter\022)\n\tmvn_param\030x \001(\0132\026.ditcaffe.MVN" + "Parameter\0226\n\017parameter_param\030\221\001 \001(\0132\034.di" + "tcaffe.ParameterParameter\0221\n\rpooling_par" + "am\030y \001(\0132\032.ditcaffe.PoolingParameter\022-\n\013" + "power_param\030z \001(\0132\030.ditcaffe.PowerParame" + "ter\022.\n\013prelu_param\030\203\001 \001(\0132\030.ditcaffe.PRe" + "LUParameter\0220\n\014python_param\030\202\001 \001(\0132\031.dit" + "caffe.PythonParameter\0226\n\017reduction_param" + "\030\210\001 \001(\0132\034.ditcaffe.ReductionParameter\022+\n" + "\nrelu_param\030{ \001(\0132\027.ditcaffe.ReLUParamet" + "er\0222\n\rreshape_param\030\205\001 \001(\0132\032.ditcaffe.Re" + "shapeParameter\022.\n\013scale_param\030\216\001 \001(\0132\030.d" + "itcaffe.ScaleParameter\0221\n\rsigmoid_param\030" + "| \001(\0132\032.ditcaffe.SigmoidParameter\0221\n\rsof" + "tmax_param\030} \001(\0132\032.ditcaffe.SoftmaxParam" + "eter\022*\n\tspp_param\030\204\001 \001(\0132\026.ditcaffe.SPPP" + "arameter\022-\n\013slice_param\030~ \001(\0132\030.ditcaffe" + ".SliceParameter\022+\n\ntanh_param\030\177 \001(\0132\027.di" + "tcaffe.TanHParameter\0226\n\017threshold_param\030" + "\200\001 \001(\0132\034.ditcaffe.ThresholdParameter\022,\n\n" + "tile_param\030\212\001 \001(\0132\027.ditcaffe.TileParamet" + "er\0229\n\021window_data_param\030\201\001 \001(\0132\035.ditcaff" + "e.WindowDataParameter\"\266\001\n\027Transformation" + "Parameter\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\tmean" + "_file\030\004 \001(\t\022\022\n\nmean_value\030\005 \003(\002\022\032\n\013force" + "_color\030\006 \001(\010:\005false\022\031\n\nforce_gray\030\007 \001(\010:" + "\005false\"\305\001\n\rLossParameter\022\024\n\014ignore_label" + "\030\001 \001(\005\022G\n\rnormalization\030\003 \001(\0162).ditcaffe" + ".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\004" + "NONE\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\022BatchNormParam" + "eter\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(" + "\0132\031.ditcaffe.FillerParameter\"L\n\030Contrast" + "iveLossParameter\022\021\n\006margin\030\001 \001(\002:\0011\022\035\n\016l" + "egacy_version\030\002 \001(\010:\005false\"\205\004\n\024Convoluti" + "onParameter\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\010kernel_h\030\013 \001(\r\022\020\n\010kernel_w\030\014 \001(\r\022\020\n\010" + "stride_h\030\r \001(\r\022\020\n\010stride_w\030\016 \001(\r\022\020\n\005grou" + "p\030\005 \001(\r:\0011\0220\n\rweight_filler\030\007 \001(\0132\031.ditc" + "affe.FillerParameter\022.\n\013bias_filler\030\010 \001(" + "\0132\031.ditcaffe.FillerParameter\022>\n\006engine\030\017" + " \001(\0162%.ditcaffe.ConvolutionParameter.Eng" + "ine:\007DEFAULT\022\017\n\004axis\030\020 \001(\005:\0011\022\036\n\017force_n" + "d_im2col\030\021 \001(\010:\005false\"+\n\006Engine\022\013\n\007DEFAU" + "LT\020\000\022\t\n\005CAFFE\020\001\022\t\n\005CUDNN\020\002\"0\n\rCropParame" + "ter\022\017\n\004axis\030\001 \001(\005:\0012\022\016\n\006offset\030\002 \003(\r\"\247\002\n" + "\rDataParameter\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\0224\n\007back" + "end\030\010 \001(\0162\032.ditcaffe.DataParameter.DB:\007L" + "EVELDB\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\023force_encoded_color\030\t \001(\010:\005f" + "alse\022\023\n\010prefetch\030\n \001(\r:\0014\"\033\n\002DB\022\013\n\007LEVEL" + "DB\020\000\022\010\n\004LMDB\020\001\".\n\020DropoutParameter\022\032\n\rdr" + "opout_ratio\030\001 \001(\002:\0030.5\"\246\001\n\022DummyDataPara" + "meter\022.\n\013data_filler\030\001 \003(\0132\031.ditcaffe.Fi" + "llerParameter\022\"\n\005shape\030\006 \003(\0132\023.ditcaffe." + "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\"\250\001\n\020Eltw" + "iseParameter\022<\n\toperation\030\001 \001(\0162$.ditcaf" + "fe.EltwiseParameter.EltwiseOp:\003SUM\022\r\n\005co" + "eff\030\002 \003(\002\022\036\n\020stable_prod_grad\030\003 \001(\010:\004tru" + "e\"\'\n\tEltwiseOp\022\010\n\004PROD\020\000\022\007\n\003SUM\020\001\022\007\n\003MAX" + "\020\002\" \n\014ELUParameter\022\020\n\005alpha\030\001 \001(\002:\0011\"\262\001\n" + "\016EmbedParameter\022\022\n\nnum_output\030\001 \001(\r\022\021\n\ti" + "nput_dim\030\002 \001(\r\022\027\n\tbias_term\030\003 \001(\010:\004true\022" + "0\n\rweight_filler\030\004 \001(\0132\031.ditcaffe.Filler" + "Parameter\022.\n\013bias_filler\030\005 \001(\0132\031.ditcaff" + "e.FillerParameter\"D\n\014ExpParameter\022\020\n\004bas" + "e\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\021HDF5DataPa" + "rameter\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\023HDF5Outpu" + "tParameter\022\021\n\tfile_name\030\001 \001(\t\"a\n\022HingeLo" + "ssParameter\0223\n\004norm\030\001 \001(\0162!.ditcaffe.Hin" + "geLossParameter.Norm:\002L1\"\026\n\004Norm\022\006\n\002L1\020\001" + "\022\006\n\002L2\020\002\"\227\002\n\022ImageDataParameter\022\016\n\006sourc" + "e\030\001 \001(\t\022\025\n\nbatch_size\030\004 \001(\r:\0011\022\024\n\trand_s" + "kip\030\007 \001(\r:\0010\022\026\n\007shuffle\030\010 \001(\010:\005false\022\025\n\n" + "new_height\030\t \001(\r:\0010\022\024\n\tnew_width\030\n \001(\r:\001" + "0\022\026\n\010is_color\030\013 \001(\010:\004true\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\025\n\013root_fold" + "er\030\014 \001(\t:\000\"\'\n\025InfogainLossParameter\022\016\n\006s" + "ource\030\001 \001(\t\"\321\001\n\025InnerProductParameter\022\022\n" + "\nnum_output\030\001 \001(\r\022\027\n\tbias_term\030\002 \001(\010:\004tr" + "ue\0220\n\rweight_filler\030\003 \001(\0132\031.ditcaffe.Fil" + "lerParameter\022.\n\013bias_filler\030\004 \001(\0132\031.ditc" + "affe.FillerParameter\022\017\n\004axis\030\005 \001(\005:\0011\022\030\n" + "\ttranspose\030\006 \001(\010:\005false\"4\n\016InputParamete" + "r\022\"\n\005shape\030\001 \003(\0132\023.ditcaffe.BlobShape\"D\n" + "\014LogParameter\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\"\276\002\n\014LRNParam" + "eter\022\025\n\nlocal_size\030\001 \001(\r:\0015\022\020\n\005alpha\030\002 \001" + "(\002:\0011\022\022\n\004beta\030\003 \001(\002:\0040.75\022G\n\013norm_region" + "\030\004 \001(\0162!.ditcaffe.LRNParameter.NormRegio" + "n:\017ACROSS_CHANNELS\022\014\n\001k\030\005 \001(\002:\0011\0226\n\006engi" + "ne\030\006 \001(\0162\035.ditcaffe.LRNParameter.Engine:" + "\007DEFAULT\"5\n\nNormRegion\022\023\n\017ACROSS_CHANNEL" + "S\020\000\022\022\n\016WITHIN_CHANNEL\020\001\"+\n\006Engine\022\013\n\007DEF" + "AULT\020\000\022\t\n\005CAFFE\020\001\022\t\n\005CUDNN\020\002\"Z\n\023MemoryDa" + "taParameter\022\022\n\nbatch_size\030\001 \001(\r\022\020\n\010chann" + "els\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\022normalize_variance\030\001" + " \001(\010:\004true\022\036\n\017across_channels\030\002 \001(\010:\005fal" + "se\022\022\n\003eps\030\003 \001(\002:\0051e-09\"8\n\022ParameterParam" + "eter\022\"\n\005shape\030\001 \001(\0132\023.ditcaffe.BlobShape" + "\"\306\003\n\020PoolingParameter\0228\n\004pool\030\001 \001(\0162%.di" + "tcaffe.PoolingParameter.PoolMethod:\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\010kern" + "el_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\010stride_w\030\010 " + "\001(\r\022:\n\006engine\030\013 \001(\0162!.ditcaffe.PoolingPa" + "rameter.Engine:\007DEFAULT\022\035\n\016global_poolin" + "g\030\014 \001(\010:\005false\022\034\n\rtorch_pooling\030( \001(\010:\005f" + "alse\".\n\nPoolMethod\022\007\n\003MAX\020\000\022\007\n\003AVE\020\001\022\016\n\n" + "STOCHASTIC\020\002\"+\n\006Engine\022\013\n\007DEFAULT\020\000\022\t\n\005C" + "AFFE\020\001\022\t\n\005CUDNN\020\002\"F\n\016PowerParameter\022\020\n\005p" + "ower\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\017PythonParameter\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\"\260\001\n\022R" + "eductionParameter\022@\n\toperation\030\001 \001(\0162(.d" + "itcaffe.ReductionParameter.ReductionOp:\003" + "SUM\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\005SUMS" + "Q\020\003\022\010\n\004MEAN\020\004\"\220\001\n\rReLUParameter\022\031\n\016negat" + "ive_slope\030\001 \001(\002:\0010\0227\n\006engine\030\002 \001(\0162\036.dit" + "caffe.ReLUParameter.Engine:\007DEFAULT\"+\n\006E" + "ngine\022\013\n\007DEFAULT\020\000\022\t\n\005CAFFE\020\001\022\t\n\005CUDNN\020\002" + "\"]\n\020ReshapeParameter\022\"\n\005shape\030\001 \001(\0132\023.di" + "tcaffe.BlobShape\022\017\n\004axis\030\002 \001(\005:\0010\022\024\n\010num" + "_axes\030\003 \001(\005:\002-1\"\253\001\n\016ScaleParameter\022\017\n\004ax" + "is\030\001 \001(\005:\0011\022\023\n\010num_axes\030\002 \001(\005:\0011\022)\n\006fill" + "er\030\003 \001(\0132\031.ditcaffe.FillerParameter\022\030\n\tb" + "ias_term\030\004 \001(\010:\005false\022.\n\013bias_filler\030\005 \001" + "(\0132\031.ditcaffe.FillerParameter\"{\n\020Sigmoid" + "Parameter\022:\n\006engine\030\001 \001(\0162!.ditcaffe.Sig" + "moidParameter.Engine:\007DEFAULT\"+\n\006Engine\022" + "\013\n\007DEFAULT\020\000\022\t\n\005CAFFE\020\001\022\t\n\005CUDNN\020\002\"L\n\016Sl" + "iceParameter\022\017\n\004axis\030\003 \001(\005:\0011\022\023\n\013slice_p" + "oint\030\002 \003(\r\022\024\n\tslice_dim\030\001 \001(\r:\0011\"\214\001\n\020Sof" + "tmaxParameter\022:\n\006engine\030\001 \001(\0162!.ditcaffe" + ".SoftmaxParameter.Engine:\007DEFAULT\022\017\n\004axi" + "s\030\002 \001(\005:\0011\"+\n\006Engine\022\013\n\007DEFAULT\020\000\022\t\n\005CAF" + "FE\020\001\022\t\n\005CUDNN\020\002\"u\n\rTanHParameter\0227\n\006engi" + "ne\030\001 \001(\0162\036.ditcaffe.TanHParameter.Engine" + ":\007DEFAULT\"+\n\006Engine\022\013\n\007DEFAULT\020\000\022\t\n\005CAFF" + "E\020\001\022\t\n\005CUDNN\020\002\"/\n\rTileParameter\022\017\n\004axis\030" + "\001 \001(\005:\0011\022\r\n\005tiles\030\002 \001(\005\"*\n\022ThresholdPara" + "meter\022\024\n\tthreshold\030\001 \001(\002:\0010\"\301\002\n\023WindowDa" + "taParameter\022\016\n\006source\030\001 \001(\t\022\020\n\005scale\030\002 \001" + "(\002:\0011\022\021\n\tmean_file\030\003 \001(\t\022\022\n\nbatch_size\030\004" + " \001(\r\022\024\n\tcrop_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\014" + "bg_threshold\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\tcr" + "op_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\"\361\001\n\014SPPP" + "arameter\022\026\n\016pyramid_height\030\001 \001(\r\0224\n\004pool" + "\030\002 \001(\0162!.ditcaffe.SPPParameter.PoolMetho" + "d:\003MAX\0226\n\006engine\030\006 \001(\0162\035.ditcaffe.SPPPar" + "ameter.Engine:\007DEFAULT\".\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\"\314\024\n\020" + "V1LayerParameter\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\026.d" + "itcaffe.NetStateRule\022\'\n\007exclude\030! \003(\0132\026." + "ditcaffe.NetStateRule\0222\n\004type\030\005 \001(\0162$.di" + "tcaffe.V1LayerParameter.LayerType\022\"\n\005blo" + "bs\030\006 \003(\0132\023.ditcaffe.BlobProto\022\016\n\005param\030\351" + "\007 \003(\t\022A\n\017blob_share_mode\030\352\007 \003(\0162\'.ditcaf" + "fe.V1LayerParameter.DimCheckMode\022\020\n\010blob" + "s_lr\030\007 \003(\002\022\024\n\014weight_decay\030\010 \003(\002\022\023\n\013loss" + "_weight\030# \003(\002\0223\n\016accuracy_param\030\033 \001(\0132\033." + "ditcaffe.AccuracyParameter\022/\n\014argmax_par" + "am\030\027 \001(\0132\031.ditcaffe.ArgMaxParameter\022/\n\014c" + "oncat_param\030\t \001(\0132\031.ditcaffe.ConcatParam" + "eter\022B\n\026contrastive_loss_param\030( \001(\0132\".d" + "itcaffe.ContrastiveLossParameter\0229\n\021conv" + "olution_param\030\n \001(\0132\036.ditcaffe.Convoluti" + "onParameter\022+\n\ndata_param\030\013 \001(\0132\027.ditcaf" + "fe.DataParameter\0221\n\rdropout_param\030\014 \001(\0132" + "\032.ditcaffe.DropoutParameter\0226\n\020dummy_dat" + "a_param\030\032 \001(\0132\034.ditcaffe.DummyDataParame" + "ter\0221\n\reltwise_param\030\030 \001(\0132\032.ditcaffe.El" + "twiseParameter\022)\n\texp_param\030) \001(\0132\026.ditc" + "affe.ExpParameter\0224\n\017hdf5_data_param\030\r \001" + "(\0132\033.ditcaffe.HDF5DataParameter\0228\n\021hdf5_" + "output_param\030\016 \001(\0132\035.ditcaffe.HDF5Output" + "Parameter\0226\n\020hinge_loss_param\030\035 \001(\0132\034.di" + "tcaffe.HingeLossParameter\0226\n\020image_data_" + "param\030\017 \001(\0132\034.ditcaffe.ImageDataParamete" + "r\022<\n\023infogain_loss_param\030\020 \001(\0132\037.ditcaff" + "e.InfogainLossParameter\022<\n\023inner_product" + "_param\030\021 \001(\0132\037.ditcaffe.InnerProductPara" + "meter\022)\n\tlrn_param\030\022 \001(\0132\026.ditcaffe.LRNP" + "arameter\0228\n\021memory_data_param\030\026 \001(\0132\035.di" + "tcaffe.MemoryDataParameter\022)\n\tmvn_param\030" + "\" \001(\0132\026.ditcaffe.MVNParameter\0221\n\rpooling" + "_param\030\023 \001(\0132\032.ditcaffe.PoolingParameter" + "\022-\n\013power_param\030\025 \001(\0132\030.ditcaffe.PowerPa" + "rameter\022+\n\nrelu_param\030\036 \001(\0132\027.ditcaffe.R" + "eLUParameter\0221\n\rsigmoid_param\030& \001(\0132\032.di" + "tcaffe.SigmoidParameter\0221\n\rsoftmax_param" + "\030\' \001(\0132\032.ditcaffe.SoftmaxParameter\022-\n\013sl" + "ice_param\030\037 \001(\0132\030.ditcaffe.SliceParamete" + "r\022+\n\ntanh_param\030% \001(\0132\027.ditcaffe.TanHPar" + "ameter\0225\n\017threshold_param\030\031 \001(\0132\034.ditcaf" + "fe.ThresholdParameter\0228\n\021window_data_par" + "am\030\024 \001(\0132\035.ditcaffe.WindowDataParameter\022" + ":\n\017transform_param\030$ \001(\0132!.ditcaffe.Tran" + "sformationParameter\022+\n\nloss_param\030* \001(\0132" + "\027.ditcaffe.LossParameter\022)\n\005layer\030\001 \001(\0132" + "\032.ditcaffe.V0LayerParameter\"\330\004\n\tLayerTyp" + "e\022\010\n\004NONE\020\000\022\n\n\006ABSVAL\020#\022\014\n\010ACCURACY\020\001\022\n\n" + "\006ARGMAX\020\036\022\010\n\004BNLL\020\002\022\n\n\006CONCAT\020\003\022\024\n\020CONTR" + "ASTIVE_LOSS\020%\022\017\n\013CONVOLUTION\020\004\022\010\n\004DATA\020\005" + "\022\021\n\rDECONVOLUTION\020\'\022\013\n\007DROPOUT\020\006\022\016\n\nDUMM" + "Y_DATA\020 \022\022\n\016EUCLIDEAN_LOSS\020\007\022\013\n\007ELTWISE\020" + "\031\022\007\n\003EXP\020&\022\013\n\007FLATTEN\020\010\022\r\n\tHDF5_DATA\020\t\022\017" + "\n\013HDF5_OUTPUT\020\n\022\016\n\nHINGE_LOSS\020\034\022\n\n\006IM2CO" + "L\020\013\022\016\n\nIMAGE_DATA\020\014\022\021\n\rINFOGAIN_LOSS\020\r\022\021" + "\n\rINNER_PRODUCT\020\016\022\007\n\003LRN\020\017\022\017\n\013MEMORY_DAT" + "A\020\035\022\035\n\031MULTINOMIAL_LOGISTIC_LOSS\020\020\022\007\n\003MV" + "N\020\"\022\013\n\007POOLING\020\021\022\t\n\005POWER\020\032\022\010\n\004RELU\020\022\022\013\n" + "\007SIGMOID\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\013WINDOW_DATA\020\030\022\r\n\tTHRESHOLD\020\037\"*\n\014DimChe" + "ckMode\022\n\n\006STRICT\020\000\022\016\n\nPERMISSIVE\020\001\"\214\010\n\020V" + "0LayerParameter\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:\004true\0220\n\rweight_filler\030\005 \001(\0132\031.ditcaff" + "e.FillerParameter\022.\n\013bias_filler\030\006 \001(\0132\031" + ".ditcaffe.FillerParameter\022\016\n\003pad\030\007 \001(\r:\001" + "0\022\022\n\nkernelsize\030\010 \001(\r\022\020\n\005group\030\t \001(\r:\0011\022" + "\021\n\006stride\030\n \001(\r:\0011\0228\n\004pool\030\013 \001(\0162%.ditca" + "ffe.V0LayerParameter.PoolMethod:\003MAX\022\032\n\r" + "dropout_ratio\030\014 \001(\002:\0030.5\022\025\n\nlocal_size\030\r" + " \001(\r:\0015\022\020\n\005alpha\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\005s" + "cale\030\021 \001(\002:\0011\022\020\n\010meanfile\030\022 \001(\t\022\021\n\tbatch" + "size\030\023 \001(\r\022\023\n\010cropsize\030\024 \001(\r:\0010\022\025\n\006mirro" + "r\030\025 \001(\010:\005false\022\"\n\005blobs\0302 \003(\0132\023.ditcaffe" + ".BlobProto\022\020\n\010blobs_lr\0303 \003(\002\022\024\n\014weight_d" + "ecay\0304 \003(\002\022\024\n\trand_skip\0305 \001(\r:\0010\022\035\n\020det_" + "fg_threshold\0306 \001(\002:\0030.5\022\035\n\020det_bg_thresh" + "old\0307 \001(\002:\0030.5\022\035\n\017det_fg_fraction\0308 \001(\002:" + "\0040.25\022\032\n\017det_context_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_channels\030= \001(\005:\0010\022\025\n\nnew_heigh" + "t\030> \001(\005:\0010\022\024\n\tnew_width\030\? \001(\005:\0010\022\035\n\016shuf" + "fle_images\030@ \001(\010:\005false\022\025\n\nconcat_dim\030A " + "\001(\r:\0011\0229\n\021hdf5_output_param\030\351\007 \001(\0132\035.dit" + "caffe.HDF5OutputParameter\".\n\nPoolMethod\022" + "\007\n\003MAX\020\000\022\007\n\003AVE\020\001\022\016\n\nSTOCHASTIC\020\002\"Z\n\016PRe" + "LUParameter\022)\n\006filler\030\001 \001(\0132\031.ditcaffe.F" + "illerParameter\022\035\n\016channel_shared\030\002 \001(\010:\005" + "false*\034\n\005Phase\022\t\n\005TRAIN\020\000\022\010\n\004TEST\020\001", 15635); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "ditcaffe.proto", &protobuf_RegisterTypes); + BlobShape::default_instance_ = new BlobShape(); + BlobProto::default_instance_ = new BlobProto(); + BlobProtoVector::default_instance_ = new BlobProtoVector(); + Datum::default_instance_ = new Datum(); + FillerParameter::_default_type_ = + new ::std::string("constant", 8); + FillerParameter::default_instance_ = new FillerParameter(); + NetParameter::default_instance_ = new NetParameter(); + SolverParameter::_default_regularization_type_ = + new ::std::string("L2", 2); + SolverParameter::_default_type_ = + new ::std::string("SGD", 3); + SolverParameter::default_instance_ = new SolverParameter(); + SolverState::default_instance_ = new SolverState(); + NetState::default_instance_ = new NetState(); + NetStateRule::default_instance_ = new NetStateRule(); + ParamSpec::default_instance_ = new ParamSpec(); + LayerParameter::default_instance_ = new LayerParameter(); + TransformationParameter::default_instance_ = new TransformationParameter(); + LossParameter::default_instance_ = new LossParameter(); + AccuracyParameter::default_instance_ = new AccuracyParameter(); + ArgMaxParameter::default_instance_ = new ArgMaxParameter(); + ConcatParameter::default_instance_ = new ConcatParameter(); + BatchNormParameter::default_instance_ = new BatchNormParameter(); + BiasParameter::default_instance_ = new BiasParameter(); + ContrastiveLossParameter::default_instance_ = new ContrastiveLossParameter(); + ConvolutionParameter::default_instance_ = new ConvolutionParameter(); + CropParameter::default_instance_ = new CropParameter(); + DataParameter::default_instance_ = new DataParameter(); + DropoutParameter::default_instance_ = new DropoutParameter(); + DummyDataParameter::default_instance_ = new DummyDataParameter(); + EltwiseParameter::default_instance_ = new EltwiseParameter(); + ELUParameter::default_instance_ = new ELUParameter(); + EmbedParameter::default_instance_ = new EmbedParameter(); + ExpParameter::default_instance_ = new ExpParameter(); + FlattenParameter::default_instance_ = new FlattenParameter(); + HDF5DataParameter::default_instance_ = new HDF5DataParameter(); + HDF5OutputParameter::default_instance_ = new HDF5OutputParameter(); + HingeLossParameter::default_instance_ = new HingeLossParameter(); + ImageDataParameter::default_instance_ = new ImageDataParameter(); + InfogainLossParameter::default_instance_ = new InfogainLossParameter(); + InnerProductParameter::default_instance_ = new InnerProductParameter(); + InputParameter::default_instance_ = new InputParameter(); + LogParameter::default_instance_ = new LogParameter(); + LRNParameter::default_instance_ = new LRNParameter(); + MemoryDataParameter::default_instance_ = new MemoryDataParameter(); + MVNParameter::default_instance_ = new MVNParameter(); + ParameterParameter::default_instance_ = new ParameterParameter(); + PoolingParameter::default_instance_ = new PoolingParameter(); + PowerParameter::default_instance_ = new PowerParameter(); + PythonParameter::default_instance_ = new PythonParameter(); + ReductionParameter::default_instance_ = new ReductionParameter(); + ReLUParameter::default_instance_ = new ReLUParameter(); + ReshapeParameter::default_instance_ = new ReshapeParameter(); + ScaleParameter::default_instance_ = new ScaleParameter(); + SigmoidParameter::default_instance_ = new SigmoidParameter(); + SliceParameter::default_instance_ = new SliceParameter(); + SoftmaxParameter::default_instance_ = new SoftmaxParameter(); + TanHParameter::default_instance_ = new TanHParameter(); + TileParameter::default_instance_ = new TileParameter(); + ThresholdParameter::default_instance_ = new ThresholdParameter(); + WindowDataParameter::_default_crop_mode_ = + new ::std::string("warp", 4); + WindowDataParameter::default_instance_ = new WindowDataParameter(); + SPPParameter::default_instance_ = new SPPParameter(); + V1LayerParameter::default_instance_ = new V1LayerParameter(); + V0LayerParameter::_default_det_crop_mode_ = + new ::std::string("warp", 4); + V0LayerParameter::default_instance_ = new V0LayerParameter(); + PReLUParameter::default_instance_ = new PReLUParameter(); + BlobShape::default_instance_->InitAsDefaultInstance(); + BlobProto::default_instance_->InitAsDefaultInstance(); + BlobProtoVector::default_instance_->InitAsDefaultInstance(); + Datum::default_instance_->InitAsDefaultInstance(); + FillerParameter::default_instance_->InitAsDefaultInstance(); + NetParameter::default_instance_->InitAsDefaultInstance(); + SolverParameter::default_instance_->InitAsDefaultInstance(); + SolverState::default_instance_->InitAsDefaultInstance(); + NetState::default_instance_->InitAsDefaultInstance(); + NetStateRule::default_instance_->InitAsDefaultInstance(); + ParamSpec::default_instance_->InitAsDefaultInstance(); + LayerParameter::default_instance_->InitAsDefaultInstance(); + TransformationParameter::default_instance_->InitAsDefaultInstance(); + LossParameter::default_instance_->InitAsDefaultInstance(); + AccuracyParameter::default_instance_->InitAsDefaultInstance(); + ArgMaxParameter::default_instance_->InitAsDefaultInstance(); + ConcatParameter::default_instance_->InitAsDefaultInstance(); + BatchNormParameter::default_instance_->InitAsDefaultInstance(); + BiasParameter::default_instance_->InitAsDefaultInstance(); + ContrastiveLossParameter::default_instance_->InitAsDefaultInstance(); + ConvolutionParameter::default_instance_->InitAsDefaultInstance(); + CropParameter::default_instance_->InitAsDefaultInstance(); + DataParameter::default_instance_->InitAsDefaultInstance(); + DropoutParameter::default_instance_->InitAsDefaultInstance(); + DummyDataParameter::default_instance_->InitAsDefaultInstance(); + EltwiseParameter::default_instance_->InitAsDefaultInstance(); + ELUParameter::default_instance_->InitAsDefaultInstance(); + EmbedParameter::default_instance_->InitAsDefaultInstance(); + ExpParameter::default_instance_->InitAsDefaultInstance(); + FlattenParameter::default_instance_->InitAsDefaultInstance(); + HDF5DataParameter::default_instance_->InitAsDefaultInstance(); + HDF5OutputParameter::default_instance_->InitAsDefaultInstance(); + HingeLossParameter::default_instance_->InitAsDefaultInstance(); + ImageDataParameter::default_instance_->InitAsDefaultInstance(); + InfogainLossParameter::default_instance_->InitAsDefaultInstance(); + InnerProductParameter::default_instance_->InitAsDefaultInstance(); + InputParameter::default_instance_->InitAsDefaultInstance(); + LogParameter::default_instance_->InitAsDefaultInstance(); + LRNParameter::default_instance_->InitAsDefaultInstance(); + MemoryDataParameter::default_instance_->InitAsDefaultInstance(); + MVNParameter::default_instance_->InitAsDefaultInstance(); + ParameterParameter::default_instance_->InitAsDefaultInstance(); + PoolingParameter::default_instance_->InitAsDefaultInstance(); + PowerParameter::default_instance_->InitAsDefaultInstance(); + PythonParameter::default_instance_->InitAsDefaultInstance(); + ReductionParameter::default_instance_->InitAsDefaultInstance(); + ReLUParameter::default_instance_->InitAsDefaultInstance(); + ReshapeParameter::default_instance_->InitAsDefaultInstance(); + ScaleParameter::default_instance_->InitAsDefaultInstance(); + SigmoidParameter::default_instance_->InitAsDefaultInstance(); + SliceParameter::default_instance_->InitAsDefaultInstance(); + SoftmaxParameter::default_instance_->InitAsDefaultInstance(); + TanHParameter::default_instance_->InitAsDefaultInstance(); + TileParameter::default_instance_->InitAsDefaultInstance(); + ThresholdParameter::default_instance_->InitAsDefaultInstance(); + WindowDataParameter::default_instance_->InitAsDefaultInstance(); + SPPParameter::default_instance_->InitAsDefaultInstance(); + V1LayerParameter::default_instance_->InitAsDefaultInstance(); + V0LayerParameter::default_instance_->InitAsDefaultInstance(); + PReLUParameter::default_instance_->InitAsDefaultInstance(); + ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_ditcaffe_2eproto); +} + +// Force AddDescriptors() to be called at static initialization time. +struct StaticDescriptorInitializer_ditcaffe_2eproto { + StaticDescriptorInitializer_ditcaffe_2eproto() { + protobuf_AddDesc_ditcaffe_2eproto(); + } +} static_descriptor_initializer_ditcaffe_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; +static void MergeFromFail(int line) { + GOOGLE_CHECK(false) << __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) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.BlobShape) +} + +void BlobShape::InitAsDefaultInstance() { +} + +BlobShape::BlobShape(const BlobShape& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.BlobShape) +} + +void BlobShape::SharedCtor() { + _cached_size_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +BlobShape::~BlobShape() { + // @@protoc_insertion_point(destructor:ditcaffe.BlobShape) + SharedDtor(); +} + +void BlobShape::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +BlobShape* BlobShape::default_instance_ = NULL; + +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:ditcaffe.BlobShape) + dim_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + 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:ditcaffe.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:ditcaffe.BlobShape) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.BlobShape) + return false; +#undef DO_ +} + +void BlobShape::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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:ditcaffe.BlobShape) +} + +::google::protobuf::uint8* BlobShape::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.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:ditcaffe.BlobShape) + return target; +} + +int BlobShape::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.BlobShape) + int total_size = 0; + + // repeated int64 dim = 1 [packed = true]; + { + int data_size = 0; + for (int i = 0; i < this->dim_size(); 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); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _dim_cached_byte_size_ = data_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()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void BlobShape::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:ditcaffe.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:ditcaffe.BlobShape) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:ditcaffe.BlobShape) + MergeFrom(*source); + } +} + +void BlobShape::MergeFrom(const BlobShape& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.BlobShape) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + dim_.MergeFrom(from.dim_); + if (from._internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void BlobShape::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:ditcaffe.BlobShape) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void BlobShape::CopyFrom(const BlobShape& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.BlobShape) + if (&from == this) return; + Clear(); + MergeFrom(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:ditcaffe.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:ditcaffe.BlobShape.dim) +} + void BlobShape::add_dim(::google::protobuf::int64 value) { + dim_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.BlobShape.dim) +} + const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +BlobShape::dim() const { + // @@protoc_insertion_point(field_list:ditcaffe.BlobShape.dim) + return dim_; +} + ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +BlobShape::mutable_dim() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.BlobShape.dim) + return &dim_; +} + +#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::kHalfDataFieldNumber; +const int BlobProto::kHalfDiffFieldNumber; +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) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.BlobProto) +} + +void BlobProto::InitAsDefaultInstance() { + shape_ = const_cast< ::ditcaffe::BlobShape*>(&::ditcaffe::BlobShape::default_instance()); +} + +BlobProto::BlobProto(const BlobProto& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.BlobProto) +} + +void BlobProto::SharedCtor() { + _cached_size_ = 0; + shape_ = NULL; + num_ = 0; + channels_ = 0; + height_ = 0; + width_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +BlobProto::~BlobProto() { + // @@protoc_insertion_point(destructor:ditcaffe.BlobProto) + SharedDtor(); +} + +void BlobProto::SharedDtor() { + if (this != default_instance_) { + 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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +BlobProto* BlobProto::default_instance_ = NULL; + +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:ditcaffe.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] & 129u) { + if (has_shape()) { + if (shape_ != NULL) shape_->::ditcaffe::BlobShape::Clear(); + } + num_ = 0; + } + ZR_(channels_, width_); + +#undef ZR_HELPER_ +#undef ZR_ + + data_.Clear(); + diff_.Clear(); + double_data_.Clear(); + double_diff_.Clear(); + half_data_.Clear(); + half_diff_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + 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:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &num_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &channels_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &height_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &width_))); + set_has_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 .ditcaffe.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->ExpectTag(82)) goto parse_half_data; + break; + } + + // repeated uint32 half_data = 10 [packed = true]; + case 10: { + if (tag == 82) { + parse_half_data: + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, this->mutable_half_data()))); + } else if (tag == 80) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + 1, 82, input, this->mutable_half_data()))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(90)) goto parse_half_diff; + break; + } + + // repeated uint32 half_diff = 11 [packed = true]; + case 11: { + if (tag == 90) { + parse_half_diff: + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, this->mutable_half_diff()))); + } else if (tag == 88) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + 1, 90, input, this->mutable_half_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:ditcaffe.BlobProto) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.BlobProto) + return false; +#undef DO_ +} + +void BlobProto::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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 .ditcaffe.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); + } + + // repeated uint32 half_data = 10 [packed = true]; + if (this->half_data_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(10, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(_half_data_cached_byte_size_); + } + for (int i = 0; i < this->half_data_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32NoTag( + this->half_data(i), output); + } + + // repeated uint32 half_diff = 11 [packed = true]; + if (this->half_diff_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(11, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(_half_diff_cached_byte_size_); + } + for (int i = 0; i < this->half_diff_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32NoTag( + this->half_diff(i), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:ditcaffe.BlobProto) +} + +::google::protobuf::uint8* BlobProto::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.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 .ditcaffe.BlobShape shape = 7; + if (has_shape()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 7, *this->shape_, 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); + } + + // repeated uint32 half_data = 10 [packed = true]; + if (this->half_data_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 10, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + _half_data_cached_byte_size_, target); + } + for (int i = 0; i < this->half_data_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteUInt32NoTagToArray(this->half_data(i), target); + } + + // repeated uint32 half_diff = 11 [packed = true]; + if (this->half_diff_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 11, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + _half_diff_cached_byte_size_, target); + } + for (int i = 0; i < this->half_diff_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteUInt32NoTagToArray(this->half_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:ditcaffe.BlobProto) + return target; +} + +int BlobProto::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.BlobProto) + int total_size = 0; + + if (_has_bits_[0 / 32] & 129u) { + // optional .ditcaffe.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()); + } + + } + if (_has_bits_[8 / 32] & 1792u) { + // 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]; + { + int data_size = 0; + data_size = 4 * this->data_size(); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _data_cached_byte_size_ = data_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated float diff = 6 [packed = true]; + { + int data_size = 0; + data_size = 4 * this->diff_size(); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _diff_cached_byte_size_ = data_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated double double_data = 8 [packed = true]; + { + int data_size = 0; + data_size = 8 * this->double_data_size(); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _double_data_cached_byte_size_ = data_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated double double_diff = 9 [packed = true]; + { + int data_size = 0; + data_size = 8 * this->double_diff_size(); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _double_diff_cached_byte_size_ = data_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated uint32 half_data = 10 [packed = true]; + { + int data_size = 0; + for (int i = 0; i < this->half_data_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->half_data(i)); + } + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _half_data_cached_byte_size_ = data_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated uint32 half_diff = 11 [packed = true]; + { + int data_size = 0; + for (int i = 0; i < this->half_diff_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->half_diff(i)); + } + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _half_diff_cached_byte_size_ = data_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()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void BlobProto::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:ditcaffe.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:ditcaffe.BlobProto) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:ditcaffe.BlobProto) + MergeFrom(*source); + } +} + +void BlobProto::MergeFrom(const BlobProto& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.BlobProto) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + data_.MergeFrom(from.data_); + diff_.MergeFrom(from.diff_); + double_data_.MergeFrom(from.double_data_); + double_diff_.MergeFrom(from.double_diff_); + half_data_.MergeFrom(from.half_data_); + half_diff_.MergeFrom(from.half_diff_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_shape()) { + mutable_shape()->::ditcaffe::BlobShape::MergeFrom(from.shape()); + } + if (from.has_num()) { + set_num(from.num()); + } + } + if (from._has_bits_[8 / 32] & (0xffu << (8 % 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._internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void BlobProto::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:ditcaffe.BlobProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void BlobProto::CopyFrom(const BlobProto& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.BlobProto) + if (&from == this) return; + Clear(); + MergeFrom(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_); + half_data_.UnsafeArenaSwap(&other->half_data_); + half_diff_.UnsafeArenaSwap(&other->half_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 .ditcaffe.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_->::ditcaffe::BlobShape::Clear(); + clear_has_shape(); +} +const ::ditcaffe::BlobShape& BlobProto::shape() const { + // @@protoc_insertion_point(field_get:ditcaffe.BlobProto.shape) + return shape_ != NULL ? *shape_ : *default_instance_->shape_; +} +::ditcaffe::BlobShape* BlobProto::mutable_shape() { + set_has_shape(); + if (shape_ == NULL) { + shape_ = new ::ditcaffe::BlobShape; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.BlobProto.shape) + return shape_; +} +::ditcaffe::BlobShape* BlobProto::release_shape() { + // @@protoc_insertion_point(field_release:ditcaffe.BlobProto.shape) + clear_has_shape(); + ::ditcaffe::BlobShape* temp = shape_; + shape_ = NULL; + return temp; +} +void BlobProto::set_allocated_shape(::ditcaffe::BlobShape* shape) { + delete shape_; + shape_ = shape; + if (shape) { + set_has_shape(); + } else { + clear_has_shape(); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.BlobProto.data) + return data_.Get(index); +} + void BlobProto::set_data(int index, float value) { + data_.Set(index, value); + // @@protoc_insertion_point(field_set:ditcaffe.BlobProto.data) +} + void BlobProto::add_data(float value) { + data_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.BlobProto.data) +} + const ::google::protobuf::RepeatedField< float >& +BlobProto::data() const { + // @@protoc_insertion_point(field_list:ditcaffe.BlobProto.data) + return data_; +} + ::google::protobuf::RepeatedField< float >* +BlobProto::mutable_data() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.BlobProto.diff) + return diff_.Get(index); +} + void BlobProto::set_diff(int index, float value) { + diff_.Set(index, value); + // @@protoc_insertion_point(field_set:ditcaffe.BlobProto.diff) +} + void BlobProto::add_diff(float value) { + diff_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.BlobProto.diff) +} + const ::google::protobuf::RepeatedField< float >& +BlobProto::diff() const { + // @@protoc_insertion_point(field_list:ditcaffe.BlobProto.diff) + return diff_; +} + ::google::protobuf::RepeatedField< float >* +BlobProto::mutable_diff() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.BlobProto.double_data) +} + void BlobProto::add_double_data(double value) { + double_data_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.BlobProto.double_data) +} + const ::google::protobuf::RepeatedField< double >& +BlobProto::double_data() const { + // @@protoc_insertion_point(field_list:ditcaffe.BlobProto.double_data) + return double_data_; +} + ::google::protobuf::RepeatedField< double >* +BlobProto::mutable_double_data() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.BlobProto.double_diff) +} + void BlobProto::add_double_diff(double value) { + double_diff_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.BlobProto.double_diff) +} + const ::google::protobuf::RepeatedField< double >& +BlobProto::double_diff() const { + // @@protoc_insertion_point(field_list:ditcaffe.BlobProto.double_diff) + return double_diff_; +} + ::google::protobuf::RepeatedField< double >* +BlobProto::mutable_double_diff() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.BlobProto.double_diff) + return &double_diff_; +} + +// repeated uint32 half_data = 10 [packed = true]; +int BlobProto::half_data_size() const { + return half_data_.size(); +} +void BlobProto::clear_half_data() { + half_data_.Clear(); +} + ::google::protobuf::uint32 BlobProto::half_data(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.BlobProto.half_data) + return half_data_.Get(index); +} + void BlobProto::set_half_data(int index, ::google::protobuf::uint32 value) { + half_data_.Set(index, value); + // @@protoc_insertion_point(field_set:ditcaffe.BlobProto.half_data) +} + void BlobProto::add_half_data(::google::protobuf::uint32 value) { + half_data_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.BlobProto.half_data) +} + const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +BlobProto::half_data() const { + // @@protoc_insertion_point(field_list:ditcaffe.BlobProto.half_data) + return half_data_; +} + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +BlobProto::mutable_half_data() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.BlobProto.half_data) + return &half_data_; +} + +// repeated uint32 half_diff = 11 [packed = true]; +int BlobProto::half_diff_size() const { + return half_diff_.size(); +} +void BlobProto::clear_half_diff() { + half_diff_.Clear(); +} + ::google::protobuf::uint32 BlobProto::half_diff(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.BlobProto.half_diff) + return half_diff_.Get(index); +} + void BlobProto::set_half_diff(int index, ::google::protobuf::uint32 value) { + half_diff_.Set(index, value); + // @@protoc_insertion_point(field_set:ditcaffe.BlobProto.half_diff) +} + void BlobProto::add_half_diff(::google::protobuf::uint32 value) { + half_diff_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.BlobProto.half_diff) +} + const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +BlobProto::half_diff() const { + // @@protoc_insertion_point(field_list:ditcaffe.BlobProto.half_diff) + return half_diff_; +} + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +BlobProto::mutable_half_diff() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.BlobProto.half_diff) + return &half_diff_; +} + +// optional int32 num = 1 [default = 0]; +bool BlobProto::has_num() const { + return (_has_bits_[0] & 0x00000080u) != 0; +} +void BlobProto::set_has_num() { + _has_bits_[0] |= 0x00000080u; +} +void BlobProto::clear_has_num() { + _has_bits_[0] &= ~0x00000080u; +} +void BlobProto::clear_num() { + num_ = 0; + clear_has_num(); +} + ::google::protobuf::int32 BlobProto::num() const { + // @@protoc_insertion_point(field_get:ditcaffe.BlobProto.num) + return num_; +} + void BlobProto::set_num(::google::protobuf::int32 value) { + set_has_num(); + num_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.BlobProto.num) +} + +// optional int32 channels = 2 [default = 0]; +bool BlobProto::has_channels() const { + return (_has_bits_[0] & 0x00000100u) != 0; +} +void BlobProto::set_has_channels() { + _has_bits_[0] |= 0x00000100u; +} +void BlobProto::clear_has_channels() { + _has_bits_[0] &= ~0x00000100u; +} +void BlobProto::clear_channels() { + channels_ = 0; + clear_has_channels(); +} + ::google::protobuf::int32 BlobProto::channels() const { + // @@protoc_insertion_point(field_get:ditcaffe.BlobProto.channels) + return channels_; +} + void BlobProto::set_channels(::google::protobuf::int32 value) { + set_has_channels(); + channels_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.BlobProto.channels) +} + +// optional int32 height = 3 [default = 0]; +bool BlobProto::has_height() const { + return (_has_bits_[0] & 0x00000200u) != 0; +} +void BlobProto::set_has_height() { + _has_bits_[0] |= 0x00000200u; +} +void BlobProto::clear_has_height() { + _has_bits_[0] &= ~0x00000200u; +} +void BlobProto::clear_height() { + height_ = 0; + clear_has_height(); +} + ::google::protobuf::int32 BlobProto::height() const { + // @@protoc_insertion_point(field_get:ditcaffe.BlobProto.height) + return height_; +} + void BlobProto::set_height(::google::protobuf::int32 value) { + set_has_height(); + height_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.BlobProto.height) +} + +// optional int32 width = 4 [default = 0]; +bool BlobProto::has_width() const { + return (_has_bits_[0] & 0x00000400u) != 0; +} +void BlobProto::set_has_width() { + _has_bits_[0] |= 0x00000400u; +} +void BlobProto::clear_has_width() { + _has_bits_[0] &= ~0x00000400u; +} +void BlobProto::clear_width() { + width_ = 0; + clear_has_width(); +} + ::google::protobuf::int32 BlobProto::width() const { + // @@protoc_insertion_point(field_get:ditcaffe.BlobProto.width) + return width_; +} + void BlobProto::set_width(::google::protobuf::int32 value) { + set_has_width(); + width_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.BlobProto.width) +} + +#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) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.BlobProtoVector) +} + +void BlobProtoVector::InitAsDefaultInstance() { +} + +BlobProtoVector::BlobProtoVector(const BlobProtoVector& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.BlobProtoVector) +} + +void BlobProtoVector::SharedCtor() { + _cached_size_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +BlobProtoVector::~BlobProtoVector() { + // @@protoc_insertion_point(destructor:ditcaffe.BlobProtoVector) + SharedDtor(); +} + +void BlobProtoVector::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +BlobProtoVector* BlobProtoVector::default_instance_ = NULL; + +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:ditcaffe.BlobProtoVector) + blobs_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + 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:ditcaffe.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 .ditcaffe.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:ditcaffe.BlobProtoVector) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.BlobProtoVector) + return false; +#undef DO_ +} + +void BlobProtoVector::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.BlobProtoVector) + // repeated .ditcaffe.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:ditcaffe.BlobProtoVector) +} + +::google::protobuf::uint8* BlobProtoVector::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.BlobProtoVector) + // repeated .ditcaffe.BlobProto blobs = 1; + for (unsigned int i = 0, n = this->blobs_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 1, this->blobs(i), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.BlobProtoVector) + return target; +} + +int BlobProtoVector::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.BlobProtoVector) + int total_size = 0; + + // repeated .ditcaffe.BlobProto blobs = 1; + total_size += 1 * this->blobs_size(); + for (int i = 0; i < this->blobs_size(); 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()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void BlobProtoVector::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:ditcaffe.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:ditcaffe.BlobProtoVector) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:ditcaffe.BlobProtoVector) + MergeFrom(*source); + } +} + +void BlobProtoVector::MergeFrom(const BlobProtoVector& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.BlobProtoVector) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + blobs_.MergeFrom(from.blobs_); + if (from._internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void BlobProtoVector::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:ditcaffe.BlobProtoVector) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void BlobProtoVector::CopyFrom(const BlobProtoVector& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.BlobProtoVector) + if (&from == this) return; + Clear(); + MergeFrom(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 .ditcaffe.BlobProto blobs = 1; +int BlobProtoVector::blobs_size() const { + return blobs_.size(); +} +void BlobProtoVector::clear_blobs() { + blobs_.Clear(); +} +const ::ditcaffe::BlobProto& BlobProtoVector::blobs(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.BlobProtoVector.blobs) + return blobs_.Get(index); +} +::ditcaffe::BlobProto* BlobProtoVector::mutable_blobs(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.BlobProtoVector.blobs) + return blobs_.Mutable(index); +} +::ditcaffe::BlobProto* BlobProtoVector::add_blobs() { + // @@protoc_insertion_point(field_add:ditcaffe.BlobProtoVector.blobs) + return blobs_.Add(); +} +::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >* +BlobProtoVector::mutable_blobs() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.BlobProtoVector.blobs) + return &blobs_; +} +const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >& +BlobProtoVector::blobs() const { + // @@protoc_insertion_point(field_list:ditcaffe.BlobProtoVector.blobs) + return blobs_; +} + +#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) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.Datum) +} + +void Datum::InitAsDefaultInstance() { +} + +Datum::Datum(const Datum& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.Datum) +} + +void Datum::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + channels_ = 0; + height_ = 0; + width_ = 0; + data_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + label_ = 0; + encoded_ = false; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +Datum::~Datum() { + // @@protoc_insertion_point(destructor:ditcaffe.Datum) + SharedDtor(); +} + +void Datum::SharedDtor() { + data_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +Datum* Datum::default_instance_ = NULL; + +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:ditcaffe.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_, height_); + ZR_(width_, label_); + if (has_data()) { + data_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + encoded_ = false; + } + +#undef ZR_HELPER_ +#undef ZR_ + + float_data_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + 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:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &channels_))); + set_has_channels(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_height; + break; + } + + // optional int32 height = 2; + case 2: { + if (tag == 16) { + parse_height: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &height_))); + set_has_height(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(24)) goto parse_width; + break; + } + + // optional int32 width = 3; + case 3: { + if (tag == 24) { + parse_width: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &width_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &label_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &encoded_))); + set_has_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:ditcaffe.Datum) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.Datum) + return false; +#undef DO_ +} + +void Datum::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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:ditcaffe.Datum) +} + +::google::protobuf::uint8* Datum::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.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:ditcaffe.Datum) + return target; +} + +int Datum::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.Datum) + int 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; + { + int data_size = 0; + data_size = 4 * this->float_data_size(); + total_size += 1 * this->float_data_size() + data_size; + } + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void Datum::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:ditcaffe.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:ditcaffe.Datum) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:ditcaffe.Datum) + MergeFrom(*source); + } +} + +void Datum::MergeFrom(const Datum& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.Datum) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + float_data_.MergeFrom(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()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void Datum::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:ditcaffe.Datum) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Datum::CopyFrom(const Datum& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.Datum) + if (&from == this) return; + Clear(); + MergeFrom(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:ditcaffe.Datum.channels) + return channels_; +} + void Datum::set_channels(::google::protobuf::int32 value) { + set_has_channels(); + channels_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.Datum.height) + return height_; +} + void Datum::set_height(::google::protobuf::int32 value) { + set_has_height(); + height_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.Datum.width) + return width_; +} + void Datum::set_width(::google::protobuf::int32 value) { + set_has_width(); + width_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.Datum.data) +} + ::std::string* Datum::mutable_data() { + set_has_data(); + // @@protoc_insertion_point(field_mutable:ditcaffe.Datum.data) + return data_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* Datum::release_data() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.Datum.label) + return label_; +} + void Datum::set_label(::google::protobuf::int32 value) { + set_has_label(); + label_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.Datum.float_data) +} + void Datum::add_float_data(float value) { + float_data_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.Datum.float_data) +} + const ::google::protobuf::RepeatedField< float >& +Datum::float_data() const { + // @@protoc_insertion_point(field_list:ditcaffe.Datum.float_data) + return float_data_; +} + ::google::protobuf::RepeatedField< float >* +Datum::mutable_float_data() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.Datum.encoded) + return encoded_; +} + void Datum::set_encoded(bool value) { + set_has_encoded(); + encoded_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.Datum.encoded) +} + +#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) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.FillerParameter) +} + +void FillerParameter::InitAsDefaultInstance() { +} + +FillerParameter::FillerParameter(const FillerParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.FillerParameter) +} + +void FillerParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + type_.UnsafeSetDefault(_default_type_); + value_ = 0; + min_ = 0; + max_ = 1; + mean_ = 0; + std_ = 1; + sparse_ = -1; + variance_norm_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +FillerParameter::~FillerParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.FillerParameter) + SharedDtor(); +} + +void FillerParameter::SharedDtor() { + type_.DestroyNoArena(_default_type_); + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +FillerParameter* FillerParameter::default_instance_ = NULL; + +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:ditcaffe.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_, min_); + if (has_type()) { + type_.ClearToDefaultNoArena(_default_type_); + } + max_ = 1; + mean_ = 0; + std_ = 1; + sparse_ = -1; + variance_norm_ = 0; + } + +#undef ZR_HELPER_ +#undef ZR_ + + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + 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:ditcaffe.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, + "ditcaffe.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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &value_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &min_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &max_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &mean_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &std_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &sparse_))); + set_has_sparse(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(64)) goto parse_variance_norm; + break; + } + + // optional .ditcaffe.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 (::ditcaffe::FillerParameter_VarianceNorm_IsValid(value)) { + set_variance_norm(static_cast< ::ditcaffe::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:ditcaffe.FillerParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.FillerParameter) + return false; +#undef DO_ +} + +void FillerParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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, + "ditcaffe.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 .ditcaffe.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:ditcaffe.FillerParameter) +} + +::google::protobuf::uint8* FillerParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.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, + "ditcaffe.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 .ditcaffe.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:ditcaffe.FillerParameter) + return target; +} + +int FillerParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.FillerParameter) + int 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 .ditcaffe.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()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void FillerParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:ditcaffe.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:ditcaffe.FillerParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:ditcaffe.FillerParameter) + MergeFrom(*source); + } +} + +void FillerParameter::MergeFrom(const FillerParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.FillerParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void FillerParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:ditcaffe.FillerParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void FillerParameter::CopyFrom(const FillerParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.FillerParameter) + if (&from == this) return; + Clear(); + MergeFrom(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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.FillerParameter.type) +} + ::std::string* FillerParameter::mutable_type() { + set_has_type(); + // @@protoc_insertion_point(field_mutable:ditcaffe.FillerParameter.type) + return type_.MutableNoArena(_default_type_); +} + ::std::string* FillerParameter::release_type() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.FillerParameter.value) + return value_; +} + void FillerParameter::set_value(float value) { + set_has_value(); + value_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.FillerParameter.min) + return min_; +} + void FillerParameter::set_min(float value) { + set_has_min(); + min_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.FillerParameter.max) + return max_; +} + void FillerParameter::set_max(float value) { + set_has_max(); + max_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.FillerParameter.mean) + return mean_; +} + void FillerParameter::set_mean(float value) { + set_has_mean(); + mean_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.FillerParameter.std) + return std_; +} + void FillerParameter::set_std(float value) { + set_has_std(); + std_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.FillerParameter.sparse) + return sparse_; +} + void FillerParameter::set_sparse(::google::protobuf::int32 value) { + set_has_sparse(); + sparse_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.FillerParameter.sparse) +} + +// optional .ditcaffe.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(); +} + ::ditcaffe::FillerParameter_VarianceNorm FillerParameter::variance_norm() const { + // @@protoc_insertion_point(field_get:ditcaffe.FillerParameter.variance_norm) + return static_cast< ::ditcaffe::FillerParameter_VarianceNorm >(variance_norm_); +} + void FillerParameter::set_variance_norm(::ditcaffe::FillerParameter_VarianceNorm value) { + assert(::ditcaffe::FillerParameter_VarianceNorm_IsValid(value)); + set_has_variance_norm(); + variance_norm_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.FillerParameter.variance_norm) +} + +#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) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.NetParameter) +} + +void NetParameter::InitAsDefaultInstance() { + state_ = const_cast< ::ditcaffe::NetState*>(&::ditcaffe::NetState::default_instance()); +} + +NetParameter::NetParameter(const NetParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.NetParameter) +} + +void NetParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + force_backward_ = false; + state_ = NULL; + debug_info_ = false; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +NetParameter::~NetParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.NetParameter) + SharedDtor(); +} + +void NetParameter::SharedDtor() { + name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != default_instance_) { + 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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +NetParameter* NetParameter::default_instance_ = NULL; + +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:ditcaffe.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_->::ditcaffe::NetState::Clear(); + } + } + +#undef ZR_HELPER_ +#undef ZR_ + + input_.Clear(); + input_shape_.Clear(); + input_dim_.Clear(); + layer_.Clear(); + layers_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + 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:ditcaffe.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, + "ditcaffe.NetParameter.name"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_layers; + break; + } + + // repeated .ditcaffe.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, + "ditcaffe.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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &force_backward_))); + set_has_force_backward(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(50)) goto parse_state; + break; + } + + // optional .ditcaffe.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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &debug_info_))); + set_has_debug_info(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(66)) goto parse_input_shape; + break; + } + + // repeated .ditcaffe.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 .ditcaffe.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:ditcaffe.NetParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.NetParameter) + return false; +#undef DO_ +} + +void NetParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.NetParameter) + // optional string name = 1; + if (has_name()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "ditcaffe.NetParameter.name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // repeated .ditcaffe.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, + "ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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:ditcaffe.NetParameter) +} + +::google::protobuf::uint8* NetParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.NetParameter) + // optional string name = 1; + if (has_name()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "ditcaffe.NetParameter.name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->name(), target); + } + + // repeated .ditcaffe.V1LayerParameter layers = 2; + for (unsigned int i = 0, n = this->layers_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 2, this->layers(i), 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, + "ditcaffe.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 .ditcaffe.NetState state = 6; + if (has_state()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 6, *this->state_, target); + } + + // optional bool debug_info = 7 [default = false]; + if (has_debug_info()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(7, this->debug_info(), target); + } + + // repeated .ditcaffe.BlobShape input_shape = 8; + for (unsigned int i = 0, n = this->input_shape_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 8, this->input_shape(i), target); + } + + // repeated .ditcaffe.LayerParameter layer = 100; + for (unsigned int i = 0, n = this->layer_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 100, this->layer(i), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.NetParameter) + return target; +} + +int NetParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.NetParameter) + int 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 .ditcaffe.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 * this->input_size(); + for (int i = 0; i < this->input_size(); i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->input(i)); + } + + // repeated .ditcaffe.BlobShape input_shape = 8; + total_size += 1 * this->input_shape_size(); + for (int i = 0; i < this->input_shape_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->input_shape(i)); + } + + // repeated int32 input_dim = 4; + { + int data_size = 0; + for (int i = 0; i < this->input_dim_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + Int32Size(this->input_dim(i)); + } + total_size += 1 * this->input_dim_size() + data_size; + } + + // repeated .ditcaffe.LayerParameter layer = 100; + total_size += 2 * this->layer_size(); + for (int i = 0; i < this->layer_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->layer(i)); + } + + // repeated .ditcaffe.V1LayerParameter layers = 2; + total_size += 1 * this->layers_size(); + for (int i = 0; i < this->layers_size(); 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()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void NetParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:ditcaffe.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:ditcaffe.NetParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:ditcaffe.NetParameter) + MergeFrom(*source); + } +} + +void NetParameter::MergeFrom(const NetParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.NetParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + input_.MergeFrom(from.input_); + input_shape_.MergeFrom(from.input_shape_); + input_dim_.MergeFrom(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()->::ditcaffe::NetState::MergeFrom(from.state()); + } + if (from.has_debug_info()) { + set_debug_info(from.debug_info()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void NetParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:ditcaffe.NetParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void NetParameter::CopyFrom(const NetParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.NetParameter) + if (&from == this) return; + Clear(); + MergeFrom(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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.NetParameter.name) +} + ::std::string* NetParameter::mutable_name() { + set_has_name(); + // @@protoc_insertion_point(field_mutable:ditcaffe.NetParameter.name) + return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* NetParameter::release_name() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.NetParameter.input) + return input_.Get(index); +} + ::std::string* NetParameter::mutable_input(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.NetParameter.input) + return input_.Mutable(index); +} + void NetParameter::set_input(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.NetParameter.input) +} + ::std::string* NetParameter::add_input() { + // @@protoc_insertion_point(field_add_mutable:ditcaffe.NetParameter.input) + return input_.Add(); +} + void NetParameter::add_input(const ::std::string& value) { + input_.Add()->assign(value); + // @@protoc_insertion_point(field_add:ditcaffe.NetParameter.input) +} + void NetParameter::add_input(const char* value) { + input_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:ditcaffe.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:ditcaffe.NetParameter.input) +} + const ::google::protobuf::RepeatedPtrField< ::std::string>& +NetParameter::input() const { + // @@protoc_insertion_point(field_list:ditcaffe.NetParameter.input) + return input_; +} + ::google::protobuf::RepeatedPtrField< ::std::string>* +NetParameter::mutable_input() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.NetParameter.input) + return &input_; +} + +// repeated .ditcaffe.BlobShape input_shape = 8; +int NetParameter::input_shape_size() const { + return input_shape_.size(); +} +void NetParameter::clear_input_shape() { + input_shape_.Clear(); +} +const ::ditcaffe::BlobShape& NetParameter::input_shape(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.NetParameter.input_shape) + return input_shape_.Get(index); +} +::ditcaffe::BlobShape* NetParameter::mutable_input_shape(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.NetParameter.input_shape) + return input_shape_.Mutable(index); +} +::ditcaffe::BlobShape* NetParameter::add_input_shape() { + // @@protoc_insertion_point(field_add:ditcaffe.NetParameter.input_shape) + return input_shape_.Add(); +} +::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobShape >* +NetParameter::mutable_input_shape() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.NetParameter.input_shape) + return &input_shape_; +} +const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobShape >& +NetParameter::input_shape() const { + // @@protoc_insertion_point(field_list:ditcaffe.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:ditcaffe.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:ditcaffe.NetParameter.input_dim) +} + void NetParameter::add_input_dim(::google::protobuf::int32 value) { + input_dim_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.NetParameter.input_dim) +} + const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +NetParameter::input_dim() const { + // @@protoc_insertion_point(field_list:ditcaffe.NetParameter.input_dim) + return input_dim_; +} + ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +NetParameter::mutable_input_dim() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.NetParameter.force_backward) +} + +// optional .ditcaffe.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_->::ditcaffe::NetState::Clear(); + clear_has_state(); +} +const ::ditcaffe::NetState& NetParameter::state() const { + // @@protoc_insertion_point(field_get:ditcaffe.NetParameter.state) + return state_ != NULL ? *state_ : *default_instance_->state_; +} +::ditcaffe::NetState* NetParameter::mutable_state() { + set_has_state(); + if (state_ == NULL) { + state_ = new ::ditcaffe::NetState; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.NetParameter.state) + return state_; +} +::ditcaffe::NetState* NetParameter::release_state() { + // @@protoc_insertion_point(field_release:ditcaffe.NetParameter.state) + clear_has_state(); + ::ditcaffe::NetState* temp = state_; + state_ = NULL; + return temp; +} +void NetParameter::set_allocated_state(::ditcaffe::NetState* state) { + delete state_; + state_ = state; + if (state) { + set_has_state(); + } else { + clear_has_state(); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.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:ditcaffe.NetParameter.debug_info) +} + +// repeated .ditcaffe.LayerParameter layer = 100; +int NetParameter::layer_size() const { + return layer_.size(); +} +void NetParameter::clear_layer() { + layer_.Clear(); +} +const ::ditcaffe::LayerParameter& NetParameter::layer(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.NetParameter.layer) + return layer_.Get(index); +} +::ditcaffe::LayerParameter* NetParameter::mutable_layer(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.NetParameter.layer) + return layer_.Mutable(index); +} +::ditcaffe::LayerParameter* NetParameter::add_layer() { + // @@protoc_insertion_point(field_add:ditcaffe.NetParameter.layer) + return layer_.Add(); +} +::google::protobuf::RepeatedPtrField< ::ditcaffe::LayerParameter >* +NetParameter::mutable_layer() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.NetParameter.layer) + return &layer_; +} +const ::google::protobuf::RepeatedPtrField< ::ditcaffe::LayerParameter >& +NetParameter::layer() const { + // @@protoc_insertion_point(field_list:ditcaffe.NetParameter.layer) + return layer_; +} + +// repeated .ditcaffe.V1LayerParameter layers = 2; +int NetParameter::layers_size() const { + return layers_.size(); +} +void NetParameter::clear_layers() { + layers_.Clear(); +} +const ::ditcaffe::V1LayerParameter& NetParameter::layers(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.NetParameter.layers) + return layers_.Get(index); +} +::ditcaffe::V1LayerParameter* NetParameter::mutable_layers(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.NetParameter.layers) + return layers_.Mutable(index); +} +::ditcaffe::V1LayerParameter* NetParameter::add_layers() { + // @@protoc_insertion_point(field_add:ditcaffe.NetParameter.layers) + return layers_.Add(); +} +::google::protobuf::RepeatedPtrField< ::ditcaffe::V1LayerParameter >* +NetParameter::mutable_layers() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.NetParameter.layers) + return &layers_; +} +const ::google::protobuf::RepeatedPtrField< ::ditcaffe::V1LayerParameter >& +NetParameter::layers() const { + // @@protoc_insertion_point(field_list:ditcaffe.NetParameter.layers) + return layers_; +} + +#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) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.SolverParameter) +} + +void SolverParameter::InitAsDefaultInstance() { + net_param_ = const_cast< ::ditcaffe::NetParameter*>(&::ditcaffe::NetParameter::default_instance()); + train_net_param_ = const_cast< ::ditcaffe::NetParameter*>(&::ditcaffe::NetParameter::default_instance()); + train_state_ = const_cast< ::ditcaffe::NetState*>(&::ditcaffe::NetState::default_instance()); +} + +SolverParameter::SolverParameter(const SolverParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.SolverParameter) +} + +void SolverParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + net_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + net_param_ = NULL; + train_net_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + train_net_param_ = NULL; + train_state_ = NULL; + test_interval_ = 0; + test_compute_loss_ = false; + test_initialization_ = true; + base_lr_ = 0; + display_ = 0; + average_loss_ = 1; + max_iter_ = 0; + iter_size_ = 1; + lr_policy_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + gamma_ = 0; + power_ = 0; + momentum_ = 0; + weight_decay_ = 0; + regularization_type_.UnsafeSetDefault(_default_regularization_type_); + stepsize_ = 0; + clip_gradients_ = -1; + snapshot_ = 0; + snapshot_prefix_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + snapshot_diff_ = false; + snapshot_format_ = 1; + solver_mode_ = 1; + device_id_ = 0; + random_seed_ = GOOGLE_LONGLONG(-1); + type_.UnsafeSetDefault(_default_type_); + delta_ = 1e-08f; + momentum2_ = 0.999f; + rms_decay_ = 0; + debug_info_ = false; + snapshot_after_train_ = true; + solver_type_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +SolverParameter::~SolverParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.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 != default_instance_) { + 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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +SolverParameter* SolverParameter::default_instance_ = NULL; + +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:ditcaffe.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_->::ditcaffe::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_->::ditcaffe::NetParameter::Clear(); + } + if (has_train_state()) { + if (train_state_ != NULL) train_state_->::ditcaffe::NetState::Clear(); + } + } + if (_has_bits_[8 / 32] & 65024u) { + ZR_(test_interval_, display_); + test_compute_loss_ = false; + test_initialization_ = true; + average_loss_ = 1; + max_iter_ = 0; + } + if (_has_bits_[16 / 32] & 16711680u) { + ZR_(gamma_, weight_decay_); + iter_size_ = 1; + if (has_lr_policy()) { + lr_policy_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + if (has_regularization_type()) { + regularization_type_.ClearToDefaultNoArena(_default_regularization_type_); + } + stepsize_ = 0; + } + if (_has_bits_[24 / 32] & 4261412864u) { + clip_gradients_ = -1; + snapshot_ = 0; + if (has_snapshot_prefix()) { + snapshot_prefix_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + snapshot_diff_ = false; + snapshot_format_ = 1; + solver_mode_ = 1; + device_id_ = 0; + } + 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; + 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(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + 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:ditcaffe.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, + "ditcaffe.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, + "ditcaffe.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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &test_interval_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &base_lr_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &display_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &max_iter_))); + set_has_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, + "ditcaffe.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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &gamma_))); + set_has_gamma(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(85)) goto parse_power; + break; + } + + // optional float power = 10; + case 10: { + if (tag == 85) { + parse_power: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &power_))); + set_has_power(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(93)) goto parse_momentum; + break; + } + + // optional float momentum = 11; + case 11: { + if (tag == 93) { + parse_momentum: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &momentum_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &weight_decay_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &stepsize_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &snapshot_))); + set_has_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, + "ditcaffe.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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &snapshot_diff_))); + set_has_snapshot_diff(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(136)) goto parse_solver_mode; + break; + } + + // optional .ditcaffe.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 (::ditcaffe::SolverParameter_SolverMode_IsValid(value)) { + set_solver_mode(static_cast< ::ditcaffe::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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &device_id_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &test_compute_loss_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &random_seed_))); + set_has_random_seed(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(170)) goto parse_train_net_param; + break; + } + + // optional .ditcaffe.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 .ditcaffe.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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &debug_info_))); + set_has_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, + "ditcaffe.SolverParameter.net"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(202)) goto parse_net_param; + break; + } + + // optional .ditcaffe.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 .ditcaffe.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 .ditcaffe.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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &snapshot_after_train_))); + set_has_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, + "ditcaffe.SolverParameter.regularization_type"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(240)) goto parse_solver_type; + break; + } + + // optional .ditcaffe.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 (::ditcaffe::SolverParameter_SolverType_IsValid(value)) { + set_solver_type(static_cast< ::ditcaffe::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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &delta_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &test_initialization_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &average_loss_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &clip_gradients_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &iter_size_))); + set_has_iter_size(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(296)) goto parse_snapshot_format; + break; + } + + // optional .ditcaffe.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 (::ditcaffe::SolverParameter_SnapshotFormat_IsValid(value)) { + set_snapshot_format(static_cast< ::ditcaffe::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; + case 38: { + if (tag == 309) { + parse_rms_decay: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &rms_decay_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &momentum2_))); + set_has_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, + "ditcaffe.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:ditcaffe.SolverParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.SolverParameter) + return false; +#undef DO_ +} + +void SolverParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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, + "ditcaffe.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, + "ditcaffe.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, + "ditcaffe.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, + "ditcaffe.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 .ditcaffe.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 .ditcaffe.NetParameter train_net_param = 21; + if (has_train_net_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 21, *this->train_net_param_, output); + } + + // repeated .ditcaffe.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, + "ditcaffe.SolverParameter.net"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 24, this->net(), output); + } + + // optional .ditcaffe.NetParameter net_param = 25; + if (has_net_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 25, *this->net_param_, output); + } + + // optional .ditcaffe.NetState train_state = 26; + if (has_train_state()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 26, *this->train_state_, output); + } + + // repeated .ditcaffe.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, + "ditcaffe.SolverParameter.regularization_type"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 29, this->regularization_type(), output); + } + + // optional .ditcaffe.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 .ditcaffe.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; + 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, + "ditcaffe.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:ditcaffe.SolverParameter) +} + +::google::protobuf::uint8* SolverParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.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, + "ditcaffe.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, + "ditcaffe.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, + "ditcaffe.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, + "ditcaffe.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 .ditcaffe.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 .ditcaffe.NetParameter train_net_param = 21; + if (has_train_net_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 21, *this->train_net_param_, target); + } + + // repeated .ditcaffe.NetParameter test_net_param = 22; + for (unsigned int i = 0, n = this->test_net_param_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 22, this->test_net_param(i), 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, + "ditcaffe.SolverParameter.net"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 24, this->net(), target); + } + + // optional .ditcaffe.NetParameter net_param = 25; + if (has_net_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 25, *this->net_param_, target); + } + + // optional .ditcaffe.NetState train_state = 26; + if (has_train_state()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 26, *this->train_state_, target); + } + + // repeated .ditcaffe.NetState test_state = 27; + for (unsigned int i = 0, n = this->test_state_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 27, this->test_state(i), 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, + "ditcaffe.SolverParameter.regularization_type"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 29, this->regularization_type(), target); + } + + // optional .ditcaffe.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 .ditcaffe.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; + 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, + "ditcaffe.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:ditcaffe.SolverParameter) + return target; +} + +int SolverParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.SolverParameter) + int 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 .ditcaffe.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 .ditcaffe.NetParameter train_net_param = 21; + if (has_train_net_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->train_net_param_); + } + + // optional .ditcaffe.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 .ditcaffe.SolverParameter.SnapshotFormat snapshot_format = 37 [default = BINARYPROTO]; + if (has_snapshot_format()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->snapshot_format()); + } + + // optional .ditcaffe.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; + 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 .ditcaffe.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 * 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 .ditcaffe.NetParameter test_net_param = 22; + total_size += 2 * this->test_net_param_size(); + for (int i = 0; i < this->test_net_param_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->test_net_param(i)); + } + + // repeated .ditcaffe.NetState test_state = 27; + total_size += 2 * this->test_state_size(); + for (int i = 0; i < this->test_state_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->test_state(i)); + } + + // repeated int32 test_iter = 3; + { + int data_size = 0; + for (int i = 0; i < this->test_iter_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + Int32Size(this->test_iter(i)); + } + total_size += 1 * this->test_iter_size() + data_size; + } + + // repeated int32 stepvalue = 34; + { + int data_size = 0; + for (int i = 0; i < this->stepvalue_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + Int32Size(this->stepvalue(i)); + } + total_size += 2 * this->stepvalue_size() + data_size; + } + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void SolverParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:ditcaffe.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:ditcaffe.SolverParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:ditcaffe.SolverParameter) + MergeFrom(*source); + } +} + +void SolverParameter::MergeFrom(const SolverParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.SolverParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + test_net_.MergeFrom(from.test_net_); + test_net_param_.MergeFrom(from.test_net_param_); + test_state_.MergeFrom(from.test_state_); + test_iter_.MergeFrom(from.test_iter_); + stepvalue_.MergeFrom(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()->::ditcaffe::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()->::ditcaffe::NetParameter::MergeFrom(from.train_net_param()); + } + if (from.has_train_state()) { + mutable_train_state()->::ditcaffe::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()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void SolverParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:ditcaffe.SolverParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void SolverParameter::CopyFrom(const SolverParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.SolverParameter) + if (&from == this) return; + Clear(); + MergeFrom(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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.net) +} + ::std::string* SolverParameter::mutable_net() { + set_has_net(); + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.net) + return net_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* SolverParameter::release_net() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.SolverParameter.net) +} + +// optional .ditcaffe.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_->::ditcaffe::NetParameter::Clear(); + clear_has_net_param(); +} +const ::ditcaffe::NetParameter& SolverParameter::net_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverParameter.net_param) + return net_param_ != NULL ? *net_param_ : *default_instance_->net_param_; +} +::ditcaffe::NetParameter* SolverParameter::mutable_net_param() { + set_has_net_param(); + if (net_param_ == NULL) { + net_param_ = new ::ditcaffe::NetParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.net_param) + return net_param_; +} +::ditcaffe::NetParameter* SolverParameter::release_net_param() { + // @@protoc_insertion_point(field_release:ditcaffe.SolverParameter.net_param) + clear_has_net_param(); + ::ditcaffe::NetParameter* temp = net_param_; + net_param_ = NULL; + return temp; +} +void SolverParameter::set_allocated_net_param(::ditcaffe::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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.train_net) +} + ::std::string* SolverParameter::mutable_train_net() { + set_has_train_net(); + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.train_net) + return train_net_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* SolverParameter::release_train_net() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.test_net) + return test_net_.Get(index); +} + ::std::string* SolverParameter::mutable_test_net(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.test_net) + return test_net_.Mutable(index); +} + void SolverParameter::set_test_net(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.test_net) +} + ::std::string* SolverParameter::add_test_net() { + // @@protoc_insertion_point(field_add_mutable:ditcaffe.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:ditcaffe.SolverParameter.test_net) +} + void SolverParameter::add_test_net(const char* value) { + test_net_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:ditcaffe.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:ditcaffe.SolverParameter.test_net) +} + const ::google::protobuf::RepeatedPtrField< ::std::string>& +SolverParameter::test_net() const { + // @@protoc_insertion_point(field_list:ditcaffe.SolverParameter.test_net) + return test_net_; +} + ::google::protobuf::RepeatedPtrField< ::std::string>* +SolverParameter::mutable_test_net() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.SolverParameter.test_net) + return &test_net_; +} + +// optional .ditcaffe.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_->::ditcaffe::NetParameter::Clear(); + clear_has_train_net_param(); +} +const ::ditcaffe::NetParameter& SolverParameter::train_net_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverParameter.train_net_param) + return train_net_param_ != NULL ? *train_net_param_ : *default_instance_->train_net_param_; +} +::ditcaffe::NetParameter* SolverParameter::mutable_train_net_param() { + set_has_train_net_param(); + if (train_net_param_ == NULL) { + train_net_param_ = new ::ditcaffe::NetParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.train_net_param) + return train_net_param_; +} +::ditcaffe::NetParameter* SolverParameter::release_train_net_param() { + // @@protoc_insertion_point(field_release:ditcaffe.SolverParameter.train_net_param) + clear_has_train_net_param(); + ::ditcaffe::NetParameter* temp = train_net_param_; + train_net_param_ = NULL; + return temp; +} +void SolverParameter::set_allocated_train_net_param(::ditcaffe::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:ditcaffe.SolverParameter.train_net_param) +} + +// repeated .ditcaffe.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 ::ditcaffe::NetParameter& SolverParameter::test_net_param(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverParameter.test_net_param) + return test_net_param_.Get(index); +} +::ditcaffe::NetParameter* SolverParameter::mutable_test_net_param(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.test_net_param) + return test_net_param_.Mutable(index); +} +::ditcaffe::NetParameter* SolverParameter::add_test_net_param() { + // @@protoc_insertion_point(field_add:ditcaffe.SolverParameter.test_net_param) + return test_net_param_.Add(); +} +::google::protobuf::RepeatedPtrField< ::ditcaffe::NetParameter >* +SolverParameter::mutable_test_net_param() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.SolverParameter.test_net_param) + return &test_net_param_; +} +const ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetParameter >& +SolverParameter::test_net_param() const { + // @@protoc_insertion_point(field_list:ditcaffe.SolverParameter.test_net_param) + return test_net_param_; +} + +// optional .ditcaffe.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_->::ditcaffe::NetState::Clear(); + clear_has_train_state(); +} +const ::ditcaffe::NetState& SolverParameter::train_state() const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverParameter.train_state) + return train_state_ != NULL ? *train_state_ : *default_instance_->train_state_; +} +::ditcaffe::NetState* SolverParameter::mutable_train_state() { + set_has_train_state(); + if (train_state_ == NULL) { + train_state_ = new ::ditcaffe::NetState; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.train_state) + return train_state_; +} +::ditcaffe::NetState* SolverParameter::release_train_state() { + // @@protoc_insertion_point(field_release:ditcaffe.SolverParameter.train_state) + clear_has_train_state(); + ::ditcaffe::NetState* temp = train_state_; + train_state_ = NULL; + return temp; +} +void SolverParameter::set_allocated_train_state(::ditcaffe::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:ditcaffe.SolverParameter.train_state) +} + +// repeated .ditcaffe.NetState test_state = 27; +int SolverParameter::test_state_size() const { + return test_state_.size(); +} +void SolverParameter::clear_test_state() { + test_state_.Clear(); +} +const ::ditcaffe::NetState& SolverParameter::test_state(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverParameter.test_state) + return test_state_.Get(index); +} +::ditcaffe::NetState* SolverParameter::mutable_test_state(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.test_state) + return test_state_.Mutable(index); +} +::ditcaffe::NetState* SolverParameter::add_test_state() { + // @@protoc_insertion_point(field_add:ditcaffe.SolverParameter.test_state) + return test_state_.Add(); +} +::google::protobuf::RepeatedPtrField< ::ditcaffe::NetState >* +SolverParameter::mutable_test_state() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.SolverParameter.test_state) + return &test_state_; +} +const ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetState >& +SolverParameter::test_state() const { + // @@protoc_insertion_point(field_list:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.test_iter) +} + void SolverParameter::add_test_iter(::google::protobuf::int32 value) { + test_iter_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.SolverParameter.test_iter) +} + const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +SolverParameter::test_iter() const { + // @@protoc_insertion_point(field_list:ditcaffe.SolverParameter.test_iter) + return test_iter_; +} + ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +SolverParameter::mutable_test_iter() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.display) + return display_; +} + void SolverParameter::set_display(::google::protobuf::int32 value) { + set_has_display(); + display_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.lr_policy) +} + ::std::string* SolverParameter::mutable_lr_policy() { + set_has_lr_policy(); + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.lr_policy) + return lr_policy_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* SolverParameter::release_lr_policy() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.gamma) + return gamma_; +} + void SolverParameter::set_gamma(float value) { + set_has_gamma(); + gamma_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.SolverParameter.power) + return power_; +} + void SolverParameter::set_power(float value) { + set_has_power(); + power_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.SolverParameter.momentum) + return momentum_; +} + void SolverParameter::set_momentum(float value) { + set_has_momentum(); + momentum_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.regularization_type) +} + ::std::string* SolverParameter::mutable_regularization_type() { + set_has_regularization_type(); + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.regularization_type) + return regularization_type_.MutableNoArena(_default_regularization_type_); +} + ::std::string* SolverParameter::release_regularization_type() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.stepsize) + return stepsize_; +} + void SolverParameter::set_stepsize(::google::protobuf::int32 value) { + set_has_stepsize(); + stepsize_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.stepvalue) +} + void SolverParameter::add_stepvalue(::google::protobuf::int32 value) { + stepvalue_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.SolverParameter.stepvalue) +} + const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +SolverParameter::stepvalue() const { + // @@protoc_insertion_point(field_list:ditcaffe.SolverParameter.stepvalue) + return stepvalue_; +} + ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +SolverParameter::mutable_stepvalue() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.snapshot) + return snapshot_; +} + void SolverParameter::set_snapshot(::google::protobuf::int32 value) { + set_has_snapshot(); + snapshot_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.snapshot_prefix) +} + ::std::string* SolverParameter::mutable_snapshot_prefix() { + set_has_snapshot_prefix(); + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.snapshot_prefix) + return snapshot_prefix_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* SolverParameter::release_snapshot_prefix() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.snapshot_diff) +} + +// optional .ditcaffe.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(); +} + ::ditcaffe::SolverParameter_SnapshotFormat SolverParameter::snapshot_format() const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverParameter.snapshot_format) + return static_cast< ::ditcaffe::SolverParameter_SnapshotFormat >(snapshot_format_); +} + void SolverParameter::set_snapshot_format(::ditcaffe::SolverParameter_SnapshotFormat value) { + assert(::ditcaffe::SolverParameter_SnapshotFormat_IsValid(value)); + set_has_snapshot_format(); + snapshot_format_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.SolverParameter.snapshot_format) +} + +// optional .ditcaffe.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(); +} + ::ditcaffe::SolverParameter_SolverMode SolverParameter::solver_mode() const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverParameter.solver_mode) + return static_cast< ::ditcaffe::SolverParameter_SolverMode >(solver_mode_); +} + void SolverParameter::set_solver_mode(::ditcaffe::SolverParameter_SolverMode value) { + assert(::ditcaffe::SolverParameter_SolverMode_IsValid(value)); + set_has_solver_mode(); + solver_mode_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.type) +} + ::std::string* SolverParameter::mutable_type() { + set_has_type(); + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.type) + return type_.MutableNoArena(_default_type_); +} + ::std::string* SolverParameter::release_type() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.delta) + return delta_; +} + void SolverParameter::set_delta(float value) { + set_has_delta(); + delta_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.SolverParameter.momentum2) + return momentum2_; +} + void SolverParameter::set_momentum2(float value) { + set_has_momentum2(); + momentum2_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.SolverParameter.momentum2) +} + +// optional float rms_decay = 38; +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; + clear_has_rms_decay(); +} + float SolverParameter::rms_decay() const { + // @@protoc_insertion_point(field_get:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.snapshot_after_train) +} + +// optional .ditcaffe.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(); +} + ::ditcaffe::SolverParameter_SolverType SolverParameter::solver_type() const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverParameter.solver_type) + return static_cast< ::ditcaffe::SolverParameter_SolverType >(solver_type_); +} + void SolverParameter::set_solver_type(::ditcaffe::SolverParameter_SolverType value) { + assert(::ditcaffe::SolverParameter_SolverType_IsValid(value)); + set_has_solver_type(); + solver_type_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.SolverParameter.solver_type) +} + +#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) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.SolverState) +} + +void SolverState::InitAsDefaultInstance() { +} + +SolverState::SolverState(const SolverState& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.SolverState) +} + +void SolverState::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + iter_ = 0; + learned_net_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + current_step_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +SolverState::~SolverState() { + // @@protoc_insertion_point(destructor:ditcaffe.SolverState) + SharedDtor(); +} + +void SolverState::SharedDtor() { + learned_net_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +SolverState* SolverState::default_instance_ = NULL; + +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:ditcaffe.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(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + 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:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &iter_))); + set_has_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, + "ditcaffe.SolverState.learned_net"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_history; + break; + } + + // repeated .ditcaffe.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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, ¤t_step_))); + set_has_current_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:ditcaffe.SolverState) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.SolverState) + return false; +#undef DO_ +} + +void SolverState::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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, + "ditcaffe.SolverState.learned_net"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->learned_net(), output); + } + + // repeated .ditcaffe.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:ditcaffe.SolverState) +} + +::google::protobuf::uint8* SolverState::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.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, + "ditcaffe.SolverState.learned_net"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->learned_net(), target); + } + + // repeated .ditcaffe.BlobProto history = 3; + for (unsigned int i = 0, n = this->history_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 3, this->history(i), 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:ditcaffe.SolverState) + return target; +} + +int SolverState::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.SolverState) + int 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 .ditcaffe.BlobProto history = 3; + total_size += 1 * this->history_size(); + for (int i = 0; i < this->history_size(); 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()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void SolverState::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:ditcaffe.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:ditcaffe.SolverState) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:ditcaffe.SolverState) + MergeFrom(*source); + } +} + +void SolverState::MergeFrom(const SolverState& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.SolverState) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void SolverState::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:ditcaffe.SolverState) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void SolverState::CopyFrom(const SolverState& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.SolverState) + if (&from == this) return; + Clear(); + MergeFrom(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:ditcaffe.SolverState.iter) + return iter_; +} + void SolverState::set_iter(::google::protobuf::int32 value) { + set_has_iter(); + iter_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.SolverState.learned_net) +} + ::std::string* SolverState::mutable_learned_net() { + set_has_learned_net(); + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverState.learned_net) + return learned_net_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* SolverState::release_learned_net() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.SolverState.learned_net) +} + +// repeated .ditcaffe.BlobProto history = 3; +int SolverState::history_size() const { + return history_.size(); +} +void SolverState::clear_history() { + history_.Clear(); +} +const ::ditcaffe::BlobProto& SolverState::history(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverState.history) + return history_.Get(index); +} +::ditcaffe::BlobProto* SolverState::mutable_history(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverState.history) + return history_.Mutable(index); +} +::ditcaffe::BlobProto* SolverState::add_history() { + // @@protoc_insertion_point(field_add:ditcaffe.SolverState.history) + return history_.Add(); +} +::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >* +SolverState::mutable_history() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.SolverState.history) + return &history_; +} +const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >& +SolverState::history() const { + // @@protoc_insertion_point(field_list:ditcaffe.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:ditcaffe.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:ditcaffe.SolverState.current_step) +} + +#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) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.NetState) +} + +void NetState::InitAsDefaultInstance() { +} + +NetState::NetState(const NetState& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.NetState) +} + +void NetState::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + phase_ = 1; + level_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +NetState::~NetState() { + // @@protoc_insertion_point(destructor:ditcaffe.NetState) + SharedDtor(); +} + +void NetState::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +NetState* NetState::default_instance_ = NULL; + +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:ditcaffe.NetState) + if (_has_bits_[0 / 32] & 3u) { + phase_ = 1; + level_ = 0; + } + stage_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + 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:ditcaffe.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 .ditcaffe.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 (::ditcaffe::Phase_IsValid(value)) { + set_phase(static_cast< ::ditcaffe::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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &level_))); + set_has_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, + "ditcaffe.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:ditcaffe.NetState) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.NetState) + return false; +#undef DO_ +} + +void NetState::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.NetState) + // optional .ditcaffe.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, + "ditcaffe.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:ditcaffe.NetState) +} + +::google::protobuf::uint8* NetState::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.NetState) + // optional .ditcaffe.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, + "ditcaffe.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:ditcaffe.NetState) + return target; +} + +int NetState::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.NetState) + int total_size = 0; + + if (_has_bits_[0 / 32] & 3u) { + // optional .ditcaffe.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 * 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()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void NetState::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:ditcaffe.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:ditcaffe.NetState) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:ditcaffe.NetState) + MergeFrom(*source); + } +} + +void NetState::MergeFrom(const NetState& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.NetState) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + stage_.MergeFrom(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()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void NetState::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:ditcaffe.NetState) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void NetState::CopyFrom(const NetState& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.NetState) + if (&from == this) return; + Clear(); + MergeFrom(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 .ditcaffe.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(); +} + ::ditcaffe::Phase NetState::phase() const { + // @@protoc_insertion_point(field_get:ditcaffe.NetState.phase) + return static_cast< ::ditcaffe::Phase >(phase_); +} + void NetState::set_phase(::ditcaffe::Phase value) { + assert(::ditcaffe::Phase_IsValid(value)); + set_has_phase(); + phase_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.NetState.level) + return level_; +} + void NetState::set_level(::google::protobuf::int32 value) { + set_has_level(); + level_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.NetState.stage) + return stage_.Get(index); +} + ::std::string* NetState::mutable_stage(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.NetState.stage) + return stage_.Mutable(index); +} + void NetState::set_stage(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.NetState.stage) +} + ::std::string* NetState::add_stage() { + // @@protoc_insertion_point(field_add_mutable:ditcaffe.NetState.stage) + return stage_.Add(); +} + void NetState::add_stage(const ::std::string& value) { + stage_.Add()->assign(value); + // @@protoc_insertion_point(field_add:ditcaffe.NetState.stage) +} + void NetState::add_stage(const char* value) { + stage_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:ditcaffe.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:ditcaffe.NetState.stage) +} + const ::google::protobuf::RepeatedPtrField< ::std::string>& +NetState::stage() const { + // @@protoc_insertion_point(field_list:ditcaffe.NetState.stage) + return stage_; +} + ::google::protobuf::RepeatedPtrField< ::std::string>* +NetState::mutable_stage() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.NetState.stage) + return &stage_; +} + +#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) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.NetStateRule) +} + +void NetStateRule::InitAsDefaultInstance() { +} + +NetStateRule::NetStateRule(const NetStateRule& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.NetStateRule) +} + +void NetStateRule::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + phase_ = 0; + min_level_ = 0; + max_level_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +NetStateRule::~NetStateRule() { + // @@protoc_insertion_point(destructor:ditcaffe.NetStateRule) + SharedDtor(); +} + +void NetStateRule::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +NetStateRule* NetStateRule::default_instance_ = NULL; + +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:ditcaffe.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) + + if (_has_bits_[0 / 32] & 7u) { + ZR_(phase_, min_level_); + max_level_ = 0; + } + +#undef ZR_HELPER_ +#undef ZR_ + + stage_.Clear(); + not_stage_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + 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:ditcaffe.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 .ditcaffe.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 (::ditcaffe::Phase_IsValid(value)) { + set_phase(static_cast< ::ditcaffe::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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &min_level_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &max_level_))); + set_has_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, + "ditcaffe.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, + "ditcaffe.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:ditcaffe.NetStateRule) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.NetStateRule) + return false; +#undef DO_ +} + +void NetStateRule::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.NetStateRule) + // optional .ditcaffe.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, + "ditcaffe.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, + "ditcaffe.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:ditcaffe.NetStateRule) +} + +::google::protobuf::uint8* NetStateRule::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.NetStateRule) + // optional .ditcaffe.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, + "ditcaffe.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, + "ditcaffe.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:ditcaffe.NetStateRule) + return target; +} + +int NetStateRule::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.NetStateRule) + int total_size = 0; + + if (_has_bits_[0 / 32] & 7u) { + // optional .ditcaffe.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 * 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 * 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()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void NetStateRule::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:ditcaffe.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:ditcaffe.NetStateRule) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:ditcaffe.NetStateRule) + MergeFrom(*source); + } +} + +void NetStateRule::MergeFrom(const NetStateRule& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.NetStateRule) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + stage_.MergeFrom(from.stage_); + not_stage_.MergeFrom(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()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void NetStateRule::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:ditcaffe.NetStateRule) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void NetStateRule::CopyFrom(const NetStateRule& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.NetStateRule) + if (&from == this) return; + Clear(); + MergeFrom(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 .ditcaffe.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(); +} + ::ditcaffe::Phase NetStateRule::phase() const { + // @@protoc_insertion_point(field_get:ditcaffe.NetStateRule.phase) + return static_cast< ::ditcaffe::Phase >(phase_); +} + void NetStateRule::set_phase(::ditcaffe::Phase value) { + assert(::ditcaffe::Phase_IsValid(value)); + set_has_phase(); + phase_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.NetStateRule.stage) + return stage_.Get(index); +} + ::std::string* NetStateRule::mutable_stage(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.NetStateRule.stage) + return stage_.Mutable(index); +} + void NetStateRule::set_stage(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.NetStateRule.stage) +} + ::std::string* NetStateRule::add_stage() { + // @@protoc_insertion_point(field_add_mutable:ditcaffe.NetStateRule.stage) + return stage_.Add(); +} + void NetStateRule::add_stage(const ::std::string& value) { + stage_.Add()->assign(value); + // @@protoc_insertion_point(field_add:ditcaffe.NetStateRule.stage) +} + void NetStateRule::add_stage(const char* value) { + stage_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:ditcaffe.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:ditcaffe.NetStateRule.stage) +} + const ::google::protobuf::RepeatedPtrField< ::std::string>& +NetStateRule::stage() const { + // @@protoc_insertion_point(field_list:ditcaffe.NetStateRule.stage) + return stage_; +} + ::google::protobuf::RepeatedPtrField< ::std::string>* +NetStateRule::mutable_stage() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.NetStateRule.not_stage) + return not_stage_.Get(index); +} + ::std::string* NetStateRule::mutable_not_stage(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.NetStateRule.not_stage) + return not_stage_.Mutable(index); +} + void NetStateRule::set_not_stage(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.NetStateRule.not_stage) +} + ::std::string* NetStateRule::add_not_stage() { + // @@protoc_insertion_point(field_add_mutable:ditcaffe.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:ditcaffe.NetStateRule.not_stage) +} + void NetStateRule::add_not_stage(const char* value) { + not_stage_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:ditcaffe.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:ditcaffe.NetStateRule.not_stage) +} + const ::google::protobuf::RepeatedPtrField< ::std::string>& +NetStateRule::not_stage() const { + // @@protoc_insertion_point(field_list:ditcaffe.NetStateRule.not_stage) + return not_stage_; +} + ::google::protobuf::RepeatedPtrField< ::std::string>* +NetStateRule::mutable_not_stage() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.NetStateRule.not_stage) + return ¬_stage_; +} + +#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) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.ParamSpec) +} + +void ParamSpec::InitAsDefaultInstance() { +} + +ParamSpec::ParamSpec(const ParamSpec& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.ParamSpec) +} + +void ParamSpec::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + share_mode_ = 0; + lr_mult_ = 1; + decay_mult_ = 1; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ParamSpec::~ParamSpec() { + // @@protoc_insertion_point(destructor:ditcaffe.ParamSpec) + SharedDtor(); +} + +void ParamSpec::SharedDtor() { + name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +ParamSpec* ParamSpec::default_instance_ = NULL; + +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:ditcaffe.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; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + 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:ditcaffe.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, + "ditcaffe.ParamSpec.name"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_share_mode; + break; + } + + // optional .ditcaffe.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 (::ditcaffe::ParamSpec_DimCheckMode_IsValid(value)) { + set_share_mode(static_cast< ::ditcaffe::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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &lr_mult_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &decay_mult_))); + set_has_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:ditcaffe.ParamSpec) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.ParamSpec) + return false; +#undef DO_ +} + +void ParamSpec::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.ParamSpec) + // optional string name = 1; + if (has_name()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "ditcaffe.ParamSpec.name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // optional .ditcaffe.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:ditcaffe.ParamSpec) +} + +::google::protobuf::uint8* ParamSpec::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.ParamSpec) + // optional string name = 1; + if (has_name()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "ditcaffe.ParamSpec.name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->name(), target); + } + + // optional .ditcaffe.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:ditcaffe.ParamSpec) + return target; +} + +int ParamSpec::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.ParamSpec) + int 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 .ditcaffe.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()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ParamSpec::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:ditcaffe.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:ditcaffe.ParamSpec) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:ditcaffe.ParamSpec) + MergeFrom(*source); + } +} + +void ParamSpec::MergeFrom(const ParamSpec& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.ParamSpec) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void ParamSpec::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:ditcaffe.ParamSpec) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ParamSpec::CopyFrom(const ParamSpec& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.ParamSpec) + if (&from == this) return; + Clear(); + MergeFrom(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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.ParamSpec.name) +} + ::std::string* ParamSpec::mutable_name() { + set_has_name(); + // @@protoc_insertion_point(field_mutable:ditcaffe.ParamSpec.name) + return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* ParamSpec::release_name() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.ParamSpec.name) +} + +// optional .ditcaffe.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(); +} + ::ditcaffe::ParamSpec_DimCheckMode ParamSpec::share_mode() const { + // @@protoc_insertion_point(field_get:ditcaffe.ParamSpec.share_mode) + return static_cast< ::ditcaffe::ParamSpec_DimCheckMode >(share_mode_); +} + void ParamSpec::set_share_mode(::ditcaffe::ParamSpec_DimCheckMode value) { + assert(::ditcaffe::ParamSpec_DimCheckMode_IsValid(value)); + set_has_share_mode(); + share_mode_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.ParamSpec.decay_mult) +} + +#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::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::kParameterParamFieldNumber; +const int LayerParameter::kPoolingParamFieldNumber; +const int LayerParameter::kPowerParamFieldNumber; +const int LayerParameter::kPreluParamFieldNumber; +const int LayerParameter::kPythonParamFieldNumber; +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) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.LayerParameter) +} + +void LayerParameter::InitAsDefaultInstance() { + transform_param_ = const_cast< ::ditcaffe::TransformationParameter*>(&::ditcaffe::TransformationParameter::default_instance()); + loss_param_ = const_cast< ::ditcaffe::LossParameter*>(&::ditcaffe::LossParameter::default_instance()); + accuracy_param_ = const_cast< ::ditcaffe::AccuracyParameter*>(&::ditcaffe::AccuracyParameter::default_instance()); + argmax_param_ = const_cast< ::ditcaffe::ArgMaxParameter*>(&::ditcaffe::ArgMaxParameter::default_instance()); + batch_norm_param_ = const_cast< ::ditcaffe::BatchNormParameter*>(&::ditcaffe::BatchNormParameter::default_instance()); + bias_param_ = const_cast< ::ditcaffe::BiasParameter*>(&::ditcaffe::BiasParameter::default_instance()); + concat_param_ = const_cast< ::ditcaffe::ConcatParameter*>(&::ditcaffe::ConcatParameter::default_instance()); + contrastive_loss_param_ = const_cast< ::ditcaffe::ContrastiveLossParameter*>(&::ditcaffe::ContrastiveLossParameter::default_instance()); + convolution_param_ = const_cast< ::ditcaffe::ConvolutionParameter*>(&::ditcaffe::ConvolutionParameter::default_instance()); + crop_param_ = const_cast< ::ditcaffe::CropParameter*>(&::ditcaffe::CropParameter::default_instance()); + data_param_ = const_cast< ::ditcaffe::DataParameter*>(&::ditcaffe::DataParameter::default_instance()); + dropout_param_ = const_cast< ::ditcaffe::DropoutParameter*>(&::ditcaffe::DropoutParameter::default_instance()); + dummy_data_param_ = const_cast< ::ditcaffe::DummyDataParameter*>(&::ditcaffe::DummyDataParameter::default_instance()); + eltwise_param_ = const_cast< ::ditcaffe::EltwiseParameter*>(&::ditcaffe::EltwiseParameter::default_instance()); + elu_param_ = const_cast< ::ditcaffe::ELUParameter*>(&::ditcaffe::ELUParameter::default_instance()); + embed_param_ = const_cast< ::ditcaffe::EmbedParameter*>(&::ditcaffe::EmbedParameter::default_instance()); + exp_param_ = const_cast< ::ditcaffe::ExpParameter*>(&::ditcaffe::ExpParameter::default_instance()); + flatten_param_ = const_cast< ::ditcaffe::FlattenParameter*>(&::ditcaffe::FlattenParameter::default_instance()); + hdf5_data_param_ = const_cast< ::ditcaffe::HDF5DataParameter*>(&::ditcaffe::HDF5DataParameter::default_instance()); + hdf5_output_param_ = const_cast< ::ditcaffe::HDF5OutputParameter*>(&::ditcaffe::HDF5OutputParameter::default_instance()); + hinge_loss_param_ = const_cast< ::ditcaffe::HingeLossParameter*>(&::ditcaffe::HingeLossParameter::default_instance()); + image_data_param_ = const_cast< ::ditcaffe::ImageDataParameter*>(&::ditcaffe::ImageDataParameter::default_instance()); + infogain_loss_param_ = const_cast< ::ditcaffe::InfogainLossParameter*>(&::ditcaffe::InfogainLossParameter::default_instance()); + inner_product_param_ = const_cast< ::ditcaffe::InnerProductParameter*>(&::ditcaffe::InnerProductParameter::default_instance()); + input_param_ = const_cast< ::ditcaffe::InputParameter*>(&::ditcaffe::InputParameter::default_instance()); + log_param_ = const_cast< ::ditcaffe::LogParameter*>(&::ditcaffe::LogParameter::default_instance()); + lrn_param_ = const_cast< ::ditcaffe::LRNParameter*>(&::ditcaffe::LRNParameter::default_instance()); + memory_data_param_ = const_cast< ::ditcaffe::MemoryDataParameter*>(&::ditcaffe::MemoryDataParameter::default_instance()); + mvn_param_ = const_cast< ::ditcaffe::MVNParameter*>(&::ditcaffe::MVNParameter::default_instance()); + parameter_param_ = const_cast< ::ditcaffe::ParameterParameter*>(&::ditcaffe::ParameterParameter::default_instance()); + pooling_param_ = const_cast< ::ditcaffe::PoolingParameter*>(&::ditcaffe::PoolingParameter::default_instance()); + power_param_ = const_cast< ::ditcaffe::PowerParameter*>(&::ditcaffe::PowerParameter::default_instance()); + prelu_param_ = const_cast< ::ditcaffe::PReLUParameter*>(&::ditcaffe::PReLUParameter::default_instance()); + python_param_ = const_cast< ::ditcaffe::PythonParameter*>(&::ditcaffe::PythonParameter::default_instance()); + reduction_param_ = const_cast< ::ditcaffe::ReductionParameter*>(&::ditcaffe::ReductionParameter::default_instance()); + relu_param_ = const_cast< ::ditcaffe::ReLUParameter*>(&::ditcaffe::ReLUParameter::default_instance()); + reshape_param_ = const_cast< ::ditcaffe::ReshapeParameter*>(&::ditcaffe::ReshapeParameter::default_instance()); + scale_param_ = const_cast< ::ditcaffe::ScaleParameter*>(&::ditcaffe::ScaleParameter::default_instance()); + sigmoid_param_ = const_cast< ::ditcaffe::SigmoidParameter*>(&::ditcaffe::SigmoidParameter::default_instance()); + softmax_param_ = const_cast< ::ditcaffe::SoftmaxParameter*>(&::ditcaffe::SoftmaxParameter::default_instance()); + spp_param_ = const_cast< ::ditcaffe::SPPParameter*>(&::ditcaffe::SPPParameter::default_instance()); + slice_param_ = const_cast< ::ditcaffe::SliceParameter*>(&::ditcaffe::SliceParameter::default_instance()); + tanh_param_ = const_cast< ::ditcaffe::TanHParameter*>(&::ditcaffe::TanHParameter::default_instance()); + threshold_param_ = const_cast< ::ditcaffe::ThresholdParameter*>(&::ditcaffe::ThresholdParameter::default_instance()); + tile_param_ = const_cast< ::ditcaffe::TileParameter*>(&::ditcaffe::TileParameter::default_instance()); + window_data_param_ = const_cast< ::ditcaffe::WindowDataParameter*>(&::ditcaffe::WindowDataParameter::default_instance()); +} + +LayerParameter::LayerParameter(const LayerParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.LayerParameter) +} + +void LayerParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + type_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + phase_ = 0; + 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; + 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; + parameter_param_ = NULL; + pooling_param_ = NULL; + power_param_ = NULL; + prelu_param_ = NULL; + python_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; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +LayerParameter::~LayerParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.LayerParameter) + SharedDtor(); +} + +void LayerParameter::SharedDtor() { + name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + type_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != default_instance_) { + 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 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 parameter_param_; + delete pooling_param_; + delete power_param_; + delete prelu_param_; + delete python_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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +LayerParameter* LayerParameter::default_instance_ = NULL; + +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:ditcaffe.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_->::ditcaffe::TransformationParameter::Clear(); + } + if (has_loss_param()) { + if (loss_param_ != NULL) loss_param_->::ditcaffe::LossParameter::Clear(); + } + if (has_accuracy_param()) { + if (accuracy_param_ != NULL) accuracy_param_->::ditcaffe::AccuracyParameter::Clear(); + } + if (has_argmax_param()) { + if (argmax_param_ != NULL) argmax_param_->::ditcaffe::ArgMaxParameter::Clear(); + } + if (has_batch_norm_param()) { + if (batch_norm_param_ != NULL) batch_norm_param_->::ditcaffe::BatchNormParameter::Clear(); + } + } + if (_has_bits_[16 / 32] & 16711680u) { + if (has_bias_param()) { + if (bias_param_ != NULL) bias_param_->::ditcaffe::BiasParameter::Clear(); + } + if (has_concat_param()) { + if (concat_param_ != NULL) concat_param_->::ditcaffe::ConcatParameter::Clear(); + } + if (has_contrastive_loss_param()) { + if (contrastive_loss_param_ != NULL) contrastive_loss_param_->::ditcaffe::ContrastiveLossParameter::Clear(); + } + if (has_convolution_param()) { + if (convolution_param_ != NULL) convolution_param_->::ditcaffe::ConvolutionParameter::Clear(); + } + if (has_crop_param()) { + if (crop_param_ != NULL) crop_param_->::ditcaffe::CropParameter::Clear(); + } + if (has_data_param()) { + if (data_param_ != NULL) data_param_->::ditcaffe::DataParameter::Clear(); + } + if (has_dropout_param()) { + if (dropout_param_ != NULL) dropout_param_->::ditcaffe::DropoutParameter::Clear(); + } + if (has_dummy_data_param()) { + if (dummy_data_param_ != NULL) dummy_data_param_->::ditcaffe::DummyDataParameter::Clear(); + } + } + if (_has_bits_[24 / 32] & 4278190080u) { + if (has_eltwise_param()) { + if (eltwise_param_ != NULL) eltwise_param_->::ditcaffe::EltwiseParameter::Clear(); + } + if (has_elu_param()) { + if (elu_param_ != NULL) elu_param_->::ditcaffe::ELUParameter::Clear(); + } + if (has_embed_param()) { + if (embed_param_ != NULL) embed_param_->::ditcaffe::EmbedParameter::Clear(); + } + if (has_exp_param()) { + if (exp_param_ != NULL) exp_param_->::ditcaffe::ExpParameter::Clear(); + } + if (has_flatten_param()) { + if (flatten_param_ != NULL) flatten_param_->::ditcaffe::FlattenParameter::Clear(); + } + if (has_hdf5_data_param()) { + if (hdf5_data_param_ != NULL) hdf5_data_param_->::ditcaffe::HDF5DataParameter::Clear(); + } + if (has_hdf5_output_param()) { + if (hdf5_output_param_ != NULL) hdf5_output_param_->::ditcaffe::HDF5OutputParameter::Clear(); + } + if (has_hinge_loss_param()) { + if (hinge_loss_param_ != NULL) hinge_loss_param_->::ditcaffe::HingeLossParameter::Clear(); + } + } + if (_has_bits_[32 / 32] & 255u) { + if (has_image_data_param()) { + if (image_data_param_ != NULL) image_data_param_->::ditcaffe::ImageDataParameter::Clear(); + } + if (has_infogain_loss_param()) { + if (infogain_loss_param_ != NULL) infogain_loss_param_->::ditcaffe::InfogainLossParameter::Clear(); + } + if (has_inner_product_param()) { + if (inner_product_param_ != NULL) inner_product_param_->::ditcaffe::InnerProductParameter::Clear(); + } + if (has_input_param()) { + if (input_param_ != NULL) input_param_->::ditcaffe::InputParameter::Clear(); + } + if (has_log_param()) { + if (log_param_ != NULL) log_param_->::ditcaffe::LogParameter::Clear(); + } + if (has_lrn_param()) { + if (lrn_param_ != NULL) lrn_param_->::ditcaffe::LRNParameter::Clear(); + } + if (has_memory_data_param()) { + if (memory_data_param_ != NULL) memory_data_param_->::ditcaffe::MemoryDataParameter::Clear(); + } + if (has_mvn_param()) { + if (mvn_param_ != NULL) mvn_param_->::ditcaffe::MVNParameter::Clear(); + } + } + if (_has_bits_[40 / 32] & 65280u) { + if (has_parameter_param()) { + if (parameter_param_ != NULL) parameter_param_->::ditcaffe::ParameterParameter::Clear(); + } + if (has_pooling_param()) { + if (pooling_param_ != NULL) pooling_param_->::ditcaffe::PoolingParameter::Clear(); + } + if (has_power_param()) { + if (power_param_ != NULL) power_param_->::ditcaffe::PowerParameter::Clear(); + } + if (has_prelu_param()) { + if (prelu_param_ != NULL) prelu_param_->::ditcaffe::PReLUParameter::Clear(); + } + if (has_python_param()) { + if (python_param_ != NULL) python_param_->::ditcaffe::PythonParameter::Clear(); + } + if (has_reduction_param()) { + if (reduction_param_ != NULL) reduction_param_->::ditcaffe::ReductionParameter::Clear(); + } + if (has_relu_param()) { + if (relu_param_ != NULL) relu_param_->::ditcaffe::ReLUParameter::Clear(); + } + if (has_reshape_param()) { + if (reshape_param_ != NULL) reshape_param_->::ditcaffe::ReshapeParameter::Clear(); + } + } + if (_has_bits_[48 / 32] & 16711680u) { + if (has_scale_param()) { + if (scale_param_ != NULL) scale_param_->::ditcaffe::ScaleParameter::Clear(); + } + if (has_sigmoid_param()) { + if (sigmoid_param_ != NULL) sigmoid_param_->::ditcaffe::SigmoidParameter::Clear(); + } + if (has_softmax_param()) { + if (softmax_param_ != NULL) softmax_param_->::ditcaffe::SoftmaxParameter::Clear(); + } + if (has_spp_param()) { + if (spp_param_ != NULL) spp_param_->::ditcaffe::SPPParameter::Clear(); + } + if (has_slice_param()) { + if (slice_param_ != NULL) slice_param_->::ditcaffe::SliceParameter::Clear(); + } + if (has_tanh_param()) { + if (tanh_param_ != NULL) tanh_param_->::ditcaffe::TanHParameter::Clear(); + } + if (has_threshold_param()) { + if (threshold_param_ != NULL) threshold_param_->::ditcaffe::ThresholdParameter::Clear(); + } + if (has_tile_param()) { + if (tile_param_ != NULL) tile_param_->::ditcaffe::TileParameter::Clear(); + } + } + if (has_window_data_param()) { + if (window_data_param_ != NULL) window_data_param_->::ditcaffe::WindowDataParameter::Clear(); + } + bottom_.Clear(); + top_.Clear(); + loss_weight_.Clear(); + param_.Clear(); + blobs_.Clear(); + propagate_down_.Clear(); + include_.Clear(); + exclude_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + 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:ditcaffe.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, + "ditcaffe.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, + "ditcaffe.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, + "ditcaffe.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, + "ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 (::ditcaffe::Phase_IsValid(value)) { + set_phase(static_cast< ::ditcaffe::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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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->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:ditcaffe.LayerParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.LayerParameter) + return false; +#undef DO_ +} + +void LayerParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.LayerParameter) + // optional string name = 1; + if (has_name()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "ditcaffe.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, + "ditcaffe.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, + "ditcaffe.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, + "ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.TransformationParameter transform_param = 100; + if (has_transform_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 100, *this->transform_param_, output); + } + + // optional .ditcaffe.LossParameter loss_param = 101; + if (has_loss_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 101, *this->loss_param_, output); + } + + // optional .ditcaffe.AccuracyParameter accuracy_param = 102; + if (has_accuracy_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 102, *this->accuracy_param_, output); + } + + // optional .ditcaffe.ArgMaxParameter argmax_param = 103; + if (has_argmax_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 103, *this->argmax_param_, output); + } + + // optional .ditcaffe.ConcatParameter concat_param = 104; + if (has_concat_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 104, *this->concat_param_, output); + } + + // optional .ditcaffe.ContrastiveLossParameter contrastive_loss_param = 105; + if (has_contrastive_loss_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 105, *this->contrastive_loss_param_, output); + } + + // optional .ditcaffe.ConvolutionParameter convolution_param = 106; + if (has_convolution_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 106, *this->convolution_param_, output); + } + + // optional .ditcaffe.DataParameter data_param = 107; + if (has_data_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 107, *this->data_param_, output); + } + + // optional .ditcaffe.DropoutParameter dropout_param = 108; + if (has_dropout_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 108, *this->dropout_param_, output); + } + + // optional .ditcaffe.DummyDataParameter dummy_data_param = 109; + if (has_dummy_data_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 109, *this->dummy_data_param_, output); + } + + // optional .ditcaffe.EltwiseParameter eltwise_param = 110; + if (has_eltwise_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 110, *this->eltwise_param_, output); + } + + // optional .ditcaffe.ExpParameter exp_param = 111; + if (has_exp_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 111, *this->exp_param_, output); + } + + // optional .ditcaffe.HDF5DataParameter hdf5_data_param = 112; + if (has_hdf5_data_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 112, *this->hdf5_data_param_, output); + } + + // optional .ditcaffe.HDF5OutputParameter hdf5_output_param = 113; + if (has_hdf5_output_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 113, *this->hdf5_output_param_, output); + } + + // optional .ditcaffe.HingeLossParameter hinge_loss_param = 114; + if (has_hinge_loss_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 114, *this->hinge_loss_param_, output); + } + + // optional .ditcaffe.ImageDataParameter image_data_param = 115; + if (has_image_data_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 115, *this->image_data_param_, output); + } + + // optional .ditcaffe.InfogainLossParameter infogain_loss_param = 116; + if (has_infogain_loss_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 116, *this->infogain_loss_param_, output); + } + + // optional .ditcaffe.InnerProductParameter inner_product_param = 117; + if (has_inner_product_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 117, *this->inner_product_param_, output); + } + + // optional .ditcaffe.LRNParameter lrn_param = 118; + if (has_lrn_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 118, *this->lrn_param_, output); + } + + // optional .ditcaffe.MemoryDataParameter memory_data_param = 119; + if (has_memory_data_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 119, *this->memory_data_param_, output); + } + + // optional .ditcaffe.MVNParameter mvn_param = 120; + if (has_mvn_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 120, *this->mvn_param_, output); + } + + // optional .ditcaffe.PoolingParameter pooling_param = 121; + if (has_pooling_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 121, *this->pooling_param_, output); + } + + // optional .ditcaffe.PowerParameter power_param = 122; + if (has_power_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 122, *this->power_param_, output); + } + + // optional .ditcaffe.ReLUParameter relu_param = 123; + if (has_relu_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 123, *this->relu_param_, output); + } + + // optional .ditcaffe.SigmoidParameter sigmoid_param = 124; + if (has_sigmoid_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 124, *this->sigmoid_param_, output); + } + + // optional .ditcaffe.SoftmaxParameter softmax_param = 125; + if (has_softmax_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 125, *this->softmax_param_, output); + } + + // optional .ditcaffe.SliceParameter slice_param = 126; + if (has_slice_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 126, *this->slice_param_, output); + } + + // optional .ditcaffe.TanHParameter tanh_param = 127; + if (has_tanh_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 127, *this->tanh_param_, output); + } + + // optional .ditcaffe.ThresholdParameter threshold_param = 128; + if (has_threshold_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 128, *this->threshold_param_, output); + } + + // optional .ditcaffe.WindowDataParameter window_data_param = 129; + if (has_window_data_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 129, *this->window_data_param_, output); + } + + // optional .ditcaffe.PythonParameter python_param = 130; + if (has_python_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 130, *this->python_param_, output); + } + + // optional .ditcaffe.PReLUParameter prelu_param = 131; + if (has_prelu_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 131, *this->prelu_param_, output); + } + + // optional .ditcaffe.SPPParameter spp_param = 132; + if (has_spp_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 132, *this->spp_param_, output); + } + + // optional .ditcaffe.ReshapeParameter reshape_param = 133; + if (has_reshape_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 133, *this->reshape_param_, output); + } + + // optional .ditcaffe.LogParameter log_param = 134; + if (has_log_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 134, *this->log_param_, output); + } + + // optional .ditcaffe.FlattenParameter flatten_param = 135; + if (has_flatten_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 135, *this->flatten_param_, output); + } + + // optional .ditcaffe.ReductionParameter reduction_param = 136; + if (has_reduction_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 136, *this->reduction_param_, output); + } + + // optional .ditcaffe.EmbedParameter embed_param = 137; + if (has_embed_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 137, *this->embed_param_, output); + } + + // optional .ditcaffe.TileParameter tile_param = 138; + if (has_tile_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 138, *this->tile_param_, output); + } + + // optional .ditcaffe.BatchNormParameter batch_norm_param = 139; + if (has_batch_norm_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 139, *this->batch_norm_param_, output); + } + + // optional .ditcaffe.ELUParameter elu_param = 140; + if (has_elu_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 140, *this->elu_param_, output); + } + + // optional .ditcaffe.BiasParameter bias_param = 141; + if (has_bias_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 141, *this->bias_param_, output); + } + + // optional .ditcaffe.ScaleParameter scale_param = 142; + if (has_scale_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 142, *this->scale_param_, output); + } + + // optional .ditcaffe.InputParameter input_param = 143; + if (has_input_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 143, *this->input_param_, output); + } + + // optional .ditcaffe.CropParameter crop_param = 144; + if (has_crop_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 144, *this->crop_param_, output); + } + + // optional .ditcaffe.ParameterParameter parameter_param = 145; + if (has_parameter_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 145, *this->parameter_param_, output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:ditcaffe.LayerParameter) +} + +::google::protobuf::uint8* LayerParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.LayerParameter) + // optional string name = 1; + if (has_name()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "ditcaffe.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, + "ditcaffe.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, + "ditcaffe.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, + "ditcaffe.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 .ditcaffe.ParamSpec param = 6; + for (unsigned int i = 0, n = this->param_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 6, this->param(i), target); + } + + // repeated .ditcaffe.BlobProto blobs = 7; + for (unsigned int i = 0, n = this->blobs_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 7, this->blobs(i), target); + } + + // repeated .ditcaffe.NetStateRule include = 8; + for (unsigned int i = 0, n = this->include_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 8, this->include(i), target); + } + + // repeated .ditcaffe.NetStateRule exclude = 9; + for (unsigned int i = 0, n = this->exclude_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 9, this->exclude(i), target); + } + + // optional .ditcaffe.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 .ditcaffe.TransformationParameter transform_param = 100; + if (has_transform_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 100, *this->transform_param_, target); + } + + // optional .ditcaffe.LossParameter loss_param = 101; + if (has_loss_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 101, *this->loss_param_, target); + } + + // optional .ditcaffe.AccuracyParameter accuracy_param = 102; + if (has_accuracy_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 102, *this->accuracy_param_, target); + } + + // optional .ditcaffe.ArgMaxParameter argmax_param = 103; + if (has_argmax_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 103, *this->argmax_param_, target); + } + + // optional .ditcaffe.ConcatParameter concat_param = 104; + if (has_concat_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 104, *this->concat_param_, target); + } + + // optional .ditcaffe.ContrastiveLossParameter contrastive_loss_param = 105; + if (has_contrastive_loss_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 105, *this->contrastive_loss_param_, target); + } + + // optional .ditcaffe.ConvolutionParameter convolution_param = 106; + if (has_convolution_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 106, *this->convolution_param_, target); + } + + // optional .ditcaffe.DataParameter data_param = 107; + if (has_data_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 107, *this->data_param_, target); + } + + // optional .ditcaffe.DropoutParameter dropout_param = 108; + if (has_dropout_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 108, *this->dropout_param_, target); + } + + // optional .ditcaffe.DummyDataParameter dummy_data_param = 109; + if (has_dummy_data_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 109, *this->dummy_data_param_, target); + } + + // optional .ditcaffe.EltwiseParameter eltwise_param = 110; + if (has_eltwise_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 110, *this->eltwise_param_, target); + } + + // optional .ditcaffe.ExpParameter exp_param = 111; + if (has_exp_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 111, *this->exp_param_, target); + } + + // optional .ditcaffe.HDF5DataParameter hdf5_data_param = 112; + if (has_hdf5_data_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 112, *this->hdf5_data_param_, target); + } + + // optional .ditcaffe.HDF5OutputParameter hdf5_output_param = 113; + if (has_hdf5_output_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 113, *this->hdf5_output_param_, target); + } + + // optional .ditcaffe.HingeLossParameter hinge_loss_param = 114; + if (has_hinge_loss_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 114, *this->hinge_loss_param_, target); + } + + // optional .ditcaffe.ImageDataParameter image_data_param = 115; + if (has_image_data_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 115, *this->image_data_param_, target); + } + + // optional .ditcaffe.InfogainLossParameter infogain_loss_param = 116; + if (has_infogain_loss_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 116, *this->infogain_loss_param_, target); + } + + // optional .ditcaffe.InnerProductParameter inner_product_param = 117; + if (has_inner_product_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 117, *this->inner_product_param_, target); + } + + // optional .ditcaffe.LRNParameter lrn_param = 118; + if (has_lrn_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 118, *this->lrn_param_, target); + } + + // optional .ditcaffe.MemoryDataParameter memory_data_param = 119; + if (has_memory_data_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 119, *this->memory_data_param_, target); + } + + // optional .ditcaffe.MVNParameter mvn_param = 120; + if (has_mvn_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 120, *this->mvn_param_, target); + } + + // optional .ditcaffe.PoolingParameter pooling_param = 121; + if (has_pooling_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 121, *this->pooling_param_, target); + } + + // optional .ditcaffe.PowerParameter power_param = 122; + if (has_power_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 122, *this->power_param_, target); + } + + // optional .ditcaffe.ReLUParameter relu_param = 123; + if (has_relu_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 123, *this->relu_param_, target); + } + + // optional .ditcaffe.SigmoidParameter sigmoid_param = 124; + if (has_sigmoid_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 124, *this->sigmoid_param_, target); + } + + // optional .ditcaffe.SoftmaxParameter softmax_param = 125; + if (has_softmax_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 125, *this->softmax_param_, target); + } + + // optional .ditcaffe.SliceParameter slice_param = 126; + if (has_slice_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 126, *this->slice_param_, target); + } + + // optional .ditcaffe.TanHParameter tanh_param = 127; + if (has_tanh_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 127, *this->tanh_param_, target); + } + + // optional .ditcaffe.ThresholdParameter threshold_param = 128; + if (has_threshold_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 128, *this->threshold_param_, target); + } + + // optional .ditcaffe.WindowDataParameter window_data_param = 129; + if (has_window_data_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 129, *this->window_data_param_, target); + } + + // optional .ditcaffe.PythonParameter python_param = 130; + if (has_python_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 130, *this->python_param_, target); + } + + // optional .ditcaffe.PReLUParameter prelu_param = 131; + if (has_prelu_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 131, *this->prelu_param_, target); + } + + // optional .ditcaffe.SPPParameter spp_param = 132; + if (has_spp_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 132, *this->spp_param_, target); + } + + // optional .ditcaffe.ReshapeParameter reshape_param = 133; + if (has_reshape_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 133, *this->reshape_param_, target); + } + + // optional .ditcaffe.LogParameter log_param = 134; + if (has_log_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 134, *this->log_param_, target); + } + + // optional .ditcaffe.FlattenParameter flatten_param = 135; + if (has_flatten_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 135, *this->flatten_param_, target); + } + + // optional .ditcaffe.ReductionParameter reduction_param = 136; + if (has_reduction_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 136, *this->reduction_param_, target); + } + + // optional .ditcaffe.EmbedParameter embed_param = 137; + if (has_embed_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 137, *this->embed_param_, target); + } + + // optional .ditcaffe.TileParameter tile_param = 138; + if (has_tile_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 138, *this->tile_param_, target); + } + + // optional .ditcaffe.BatchNormParameter batch_norm_param = 139; + if (has_batch_norm_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 139, *this->batch_norm_param_, target); + } + + // optional .ditcaffe.ELUParameter elu_param = 140; + if (has_elu_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 140, *this->elu_param_, target); + } + + // optional .ditcaffe.BiasParameter bias_param = 141; + if (has_bias_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 141, *this->bias_param_, target); + } + + // optional .ditcaffe.ScaleParameter scale_param = 142; + if (has_scale_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 142, *this->scale_param_, target); + } + + // optional .ditcaffe.InputParameter input_param = 143; + if (has_input_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 143, *this->input_param_, target); + } + + // optional .ditcaffe.CropParameter crop_param = 144; + if (has_crop_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 144, *this->crop_param_, target); + } + + // optional .ditcaffe.ParameterParameter parameter_param = 145; + if (has_parameter_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 145, *this->parameter_param_, target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.LayerParameter) + return target; +} + +int LayerParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.LayerParameter) + int 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 .ditcaffe.Phase phase = 10; + if (has_phase()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->phase()); + } + + } + if (_has_bits_[11 / 32] & 63488u) { + // optional .ditcaffe.TransformationParameter transform_param = 100; + if (has_transform_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->transform_param_); + } + + // optional .ditcaffe.LossParameter loss_param = 101; + if (has_loss_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->loss_param_); + } + + // optional .ditcaffe.AccuracyParameter accuracy_param = 102; + if (has_accuracy_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->accuracy_param_); + } + + // optional .ditcaffe.ArgMaxParameter argmax_param = 103; + if (has_argmax_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->argmax_param_); + } + + // optional .ditcaffe.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 .ditcaffe.BiasParameter bias_param = 141; + if (has_bias_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->bias_param_); + } + + // optional .ditcaffe.ConcatParameter concat_param = 104; + if (has_concat_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->concat_param_); + } + + // optional .ditcaffe.ContrastiveLossParameter contrastive_loss_param = 105; + if (has_contrastive_loss_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->contrastive_loss_param_); + } + + // optional .ditcaffe.ConvolutionParameter convolution_param = 106; + if (has_convolution_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->convolution_param_); + } + + // optional .ditcaffe.CropParameter crop_param = 144; + if (has_crop_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->crop_param_); + } + + // optional .ditcaffe.DataParameter data_param = 107; + if (has_data_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->data_param_); + } + + // optional .ditcaffe.DropoutParameter dropout_param = 108; + if (has_dropout_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->dropout_param_); + } + + // optional .ditcaffe.DummyDataParameter dummy_data_param = 109; + if (has_dummy_data_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->dummy_data_param_); + } + + } + if (_has_bits_[24 / 32] & 4278190080u) { + // optional .ditcaffe.EltwiseParameter eltwise_param = 110; + if (has_eltwise_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->eltwise_param_); + } + + // optional .ditcaffe.ELUParameter elu_param = 140; + if (has_elu_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->elu_param_); + } + + // optional .ditcaffe.EmbedParameter embed_param = 137; + if (has_embed_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->embed_param_); + } + + // optional .ditcaffe.ExpParameter exp_param = 111; + if (has_exp_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->exp_param_); + } + + // optional .ditcaffe.FlattenParameter flatten_param = 135; + if (has_flatten_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->flatten_param_); + } + + // optional .ditcaffe.HDF5DataParameter hdf5_data_param = 112; + if (has_hdf5_data_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->hdf5_data_param_); + } + + // optional .ditcaffe.HDF5OutputParameter hdf5_output_param = 113; + if (has_hdf5_output_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->hdf5_output_param_); + } + + // optional .ditcaffe.HingeLossParameter hinge_loss_param = 114; + if (has_hinge_loss_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->hinge_loss_param_); + } + + } + if (_has_bits_[32 / 32] & 255u) { + // optional .ditcaffe.ImageDataParameter image_data_param = 115; + if (has_image_data_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->image_data_param_); + } + + // optional .ditcaffe.InfogainLossParameter infogain_loss_param = 116; + if (has_infogain_loss_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->infogain_loss_param_); + } + + // optional .ditcaffe.InnerProductParameter inner_product_param = 117; + if (has_inner_product_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->inner_product_param_); + } + + // optional .ditcaffe.InputParameter input_param = 143; + if (has_input_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->input_param_); + } + + // optional .ditcaffe.LogParameter log_param = 134; + if (has_log_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->log_param_); + } + + // optional .ditcaffe.LRNParameter lrn_param = 118; + if (has_lrn_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->lrn_param_); + } + + // optional .ditcaffe.MemoryDataParameter memory_data_param = 119; + if (has_memory_data_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->memory_data_param_); + } + + // optional .ditcaffe.MVNParameter mvn_param = 120; + if (has_mvn_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->mvn_param_); + } + + } + if (_has_bits_[40 / 32] & 65280u) { + // optional .ditcaffe.ParameterParameter parameter_param = 145; + if (has_parameter_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->parameter_param_); + } + + // optional .ditcaffe.PoolingParameter pooling_param = 121; + if (has_pooling_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->pooling_param_); + } + + // optional .ditcaffe.PowerParameter power_param = 122; + if (has_power_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->power_param_); + } + + // optional .ditcaffe.PReLUParameter prelu_param = 131; + if (has_prelu_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->prelu_param_); + } + + // optional .ditcaffe.PythonParameter python_param = 130; + if (has_python_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->python_param_); + } + + // optional .ditcaffe.ReductionParameter reduction_param = 136; + if (has_reduction_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->reduction_param_); + } + + // optional .ditcaffe.ReLUParameter relu_param = 123; + if (has_relu_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->relu_param_); + } + + // optional .ditcaffe.ReshapeParameter reshape_param = 133; + if (has_reshape_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->reshape_param_); + } + + } + if (_has_bits_[48 / 32] & 16711680u) { + // optional .ditcaffe.ScaleParameter scale_param = 142; + if (has_scale_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->scale_param_); + } + + // optional .ditcaffe.SigmoidParameter sigmoid_param = 124; + if (has_sigmoid_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->sigmoid_param_); + } + + // optional .ditcaffe.SoftmaxParameter softmax_param = 125; + if (has_softmax_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->softmax_param_); + } + + // optional .ditcaffe.SPPParameter spp_param = 132; + if (has_spp_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->spp_param_); + } + + // optional .ditcaffe.SliceParameter slice_param = 126; + if (has_slice_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->slice_param_); + } + + // optional .ditcaffe.TanHParameter tanh_param = 127; + if (has_tanh_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->tanh_param_); + } + + // optional .ditcaffe.ThresholdParameter threshold_param = 128; + if (has_threshold_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->threshold_param_); + } + + // optional .ditcaffe.TileParameter tile_param = 138; + if (has_tile_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->tile_param_); + } + + } + // optional .ditcaffe.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 * 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 * 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; + { + int data_size = 0; + data_size = 4 * this->loss_weight_size(); + total_size += 1 * this->loss_weight_size() + data_size; + } + + // repeated .ditcaffe.ParamSpec param = 6; + total_size += 1 * this->param_size(); + for (int i = 0; i < this->param_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->param(i)); + } + + // repeated .ditcaffe.BlobProto blobs = 7; + total_size += 1 * this->blobs_size(); + for (int i = 0; i < this->blobs_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->blobs(i)); + } + + // repeated bool propagate_down = 11; + { + int data_size = 0; + data_size = 1 * this->propagate_down_size(); + total_size += 1 * this->propagate_down_size() + data_size; + } + + // repeated .ditcaffe.NetStateRule include = 8; + total_size += 1 * this->include_size(); + for (int i = 0; i < this->include_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->include(i)); + } + + // repeated .ditcaffe.NetStateRule exclude = 9; + total_size += 1 * this->exclude_size(); + for (int i = 0; i < this->exclude_size(); 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()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void LayerParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:ditcaffe.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:ditcaffe.LayerParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:ditcaffe.LayerParameter) + MergeFrom(*source); + } +} + +void LayerParameter::MergeFrom(const LayerParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.LayerParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + bottom_.MergeFrom(from.bottom_); + top_.MergeFrom(from.top_); + loss_weight_.MergeFrom(from.loss_weight_); + param_.MergeFrom(from.param_); + blobs_.MergeFrom(from.blobs_); + propagate_down_.MergeFrom(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()->::ditcaffe::TransformationParameter::MergeFrom(from.transform_param()); + } + if (from.has_loss_param()) { + mutable_loss_param()->::ditcaffe::LossParameter::MergeFrom(from.loss_param()); + } + if (from.has_accuracy_param()) { + mutable_accuracy_param()->::ditcaffe::AccuracyParameter::MergeFrom(from.accuracy_param()); + } + if (from.has_argmax_param()) { + mutable_argmax_param()->::ditcaffe::ArgMaxParameter::MergeFrom(from.argmax_param()); + } + if (from.has_batch_norm_param()) { + mutable_batch_norm_param()->::ditcaffe::BatchNormParameter::MergeFrom(from.batch_norm_param()); + } + } + if (from._has_bits_[16 / 32] & (0xffu << (16 % 32))) { + if (from.has_bias_param()) { + mutable_bias_param()->::ditcaffe::BiasParameter::MergeFrom(from.bias_param()); + } + if (from.has_concat_param()) { + mutable_concat_param()->::ditcaffe::ConcatParameter::MergeFrom(from.concat_param()); + } + if (from.has_contrastive_loss_param()) { + mutable_contrastive_loss_param()->::ditcaffe::ContrastiveLossParameter::MergeFrom(from.contrastive_loss_param()); + } + if (from.has_convolution_param()) { + mutable_convolution_param()->::ditcaffe::ConvolutionParameter::MergeFrom(from.convolution_param()); + } + if (from.has_crop_param()) { + mutable_crop_param()->::ditcaffe::CropParameter::MergeFrom(from.crop_param()); + } + if (from.has_data_param()) { + mutable_data_param()->::ditcaffe::DataParameter::MergeFrom(from.data_param()); + } + if (from.has_dropout_param()) { + mutable_dropout_param()->::ditcaffe::DropoutParameter::MergeFrom(from.dropout_param()); + } + if (from.has_dummy_data_param()) { + mutable_dummy_data_param()->::ditcaffe::DummyDataParameter::MergeFrom(from.dummy_data_param()); + } + } + if (from._has_bits_[24 / 32] & (0xffu << (24 % 32))) { + if (from.has_eltwise_param()) { + mutable_eltwise_param()->::ditcaffe::EltwiseParameter::MergeFrom(from.eltwise_param()); + } + if (from.has_elu_param()) { + mutable_elu_param()->::ditcaffe::ELUParameter::MergeFrom(from.elu_param()); + } + if (from.has_embed_param()) { + mutable_embed_param()->::ditcaffe::EmbedParameter::MergeFrom(from.embed_param()); + } + if (from.has_exp_param()) { + mutable_exp_param()->::ditcaffe::ExpParameter::MergeFrom(from.exp_param()); + } + if (from.has_flatten_param()) { + mutable_flatten_param()->::ditcaffe::FlattenParameter::MergeFrom(from.flatten_param()); + } + if (from.has_hdf5_data_param()) { + mutable_hdf5_data_param()->::ditcaffe::HDF5DataParameter::MergeFrom(from.hdf5_data_param()); + } + if (from.has_hdf5_output_param()) { + mutable_hdf5_output_param()->::ditcaffe::HDF5OutputParameter::MergeFrom(from.hdf5_output_param()); + } + if (from.has_hinge_loss_param()) { + mutable_hinge_loss_param()->::ditcaffe::HingeLossParameter::MergeFrom(from.hinge_loss_param()); + } + } + if (from._has_bits_[32 / 32] & (0xffu << (32 % 32))) { + if (from.has_image_data_param()) { + mutable_image_data_param()->::ditcaffe::ImageDataParameter::MergeFrom(from.image_data_param()); + } + if (from.has_infogain_loss_param()) { + mutable_infogain_loss_param()->::ditcaffe::InfogainLossParameter::MergeFrom(from.infogain_loss_param()); + } + if (from.has_inner_product_param()) { + mutable_inner_product_param()->::ditcaffe::InnerProductParameter::MergeFrom(from.inner_product_param()); + } + if (from.has_input_param()) { + mutable_input_param()->::ditcaffe::InputParameter::MergeFrom(from.input_param()); + } + if (from.has_log_param()) { + mutable_log_param()->::ditcaffe::LogParameter::MergeFrom(from.log_param()); + } + if (from.has_lrn_param()) { + mutable_lrn_param()->::ditcaffe::LRNParameter::MergeFrom(from.lrn_param()); + } + if (from.has_memory_data_param()) { + mutable_memory_data_param()->::ditcaffe::MemoryDataParameter::MergeFrom(from.memory_data_param()); + } + if (from.has_mvn_param()) { + mutable_mvn_param()->::ditcaffe::MVNParameter::MergeFrom(from.mvn_param()); + } + } + if (from._has_bits_[40 / 32] & (0xffu << (40 % 32))) { + if (from.has_parameter_param()) { + mutable_parameter_param()->::ditcaffe::ParameterParameter::MergeFrom(from.parameter_param()); + } + if (from.has_pooling_param()) { + mutable_pooling_param()->::ditcaffe::PoolingParameter::MergeFrom(from.pooling_param()); + } + if (from.has_power_param()) { + mutable_power_param()->::ditcaffe::PowerParameter::MergeFrom(from.power_param()); + } + if (from.has_prelu_param()) { + mutable_prelu_param()->::ditcaffe::PReLUParameter::MergeFrom(from.prelu_param()); + } + if (from.has_python_param()) { + mutable_python_param()->::ditcaffe::PythonParameter::MergeFrom(from.python_param()); + } + if (from.has_reduction_param()) { + mutable_reduction_param()->::ditcaffe::ReductionParameter::MergeFrom(from.reduction_param()); + } + if (from.has_relu_param()) { + mutable_relu_param()->::ditcaffe::ReLUParameter::MergeFrom(from.relu_param()); + } + if (from.has_reshape_param()) { + mutable_reshape_param()->::ditcaffe::ReshapeParameter::MergeFrom(from.reshape_param()); + } + } + if (from._has_bits_[48 / 32] & (0xffu << (48 % 32))) { + if (from.has_scale_param()) { + mutable_scale_param()->::ditcaffe::ScaleParameter::MergeFrom(from.scale_param()); + } + if (from.has_sigmoid_param()) { + mutable_sigmoid_param()->::ditcaffe::SigmoidParameter::MergeFrom(from.sigmoid_param()); + } + if (from.has_softmax_param()) { + mutable_softmax_param()->::ditcaffe::SoftmaxParameter::MergeFrom(from.softmax_param()); + } + if (from.has_spp_param()) { + mutable_spp_param()->::ditcaffe::SPPParameter::MergeFrom(from.spp_param()); + } + if (from.has_slice_param()) { + mutable_slice_param()->::ditcaffe::SliceParameter::MergeFrom(from.slice_param()); + } + if (from.has_tanh_param()) { + mutable_tanh_param()->::ditcaffe::TanHParameter::MergeFrom(from.tanh_param()); + } + if (from.has_threshold_param()) { + mutable_threshold_param()->::ditcaffe::ThresholdParameter::MergeFrom(from.threshold_param()); + } + if (from.has_tile_param()) { + mutable_tile_param()->::ditcaffe::TileParameter::MergeFrom(from.tile_param()); + } + } + if (from._has_bits_[56 / 32] & (0xffu << (56 % 32))) { + if (from.has_window_data_param()) { + mutable_window_data_param()->::ditcaffe::WindowDataParameter::MergeFrom(from.window_data_param()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void LayerParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:ditcaffe.LayerParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void LayerParameter::CopyFrom(const LayerParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.LayerParameter) + if (&from == this) return; + Clear(); + MergeFrom(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(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(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(python_param_, other->python_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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.LayerParameter.name) +} + ::std::string* LayerParameter::mutable_name() { + set_has_name(); + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.name) + return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* LayerParameter::release_name() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.LayerParameter.type) +} + ::std::string* LayerParameter::mutable_type() { + set_has_type(); + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.type) + return type_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* LayerParameter::release_type() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.LayerParameter.bottom) + return bottom_.Get(index); +} + ::std::string* LayerParameter::mutable_bottom(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.bottom) + return bottom_.Mutable(index); +} + void LayerParameter::set_bottom(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.LayerParameter.bottom) +} + ::std::string* LayerParameter::add_bottom() { + // @@protoc_insertion_point(field_add_mutable:ditcaffe.LayerParameter.bottom) + return bottom_.Add(); +} + void LayerParameter::add_bottom(const ::std::string& value) { + bottom_.Add()->assign(value); + // @@protoc_insertion_point(field_add:ditcaffe.LayerParameter.bottom) +} + void LayerParameter::add_bottom(const char* value) { + bottom_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:ditcaffe.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:ditcaffe.LayerParameter.bottom) +} + const ::google::protobuf::RepeatedPtrField< ::std::string>& +LayerParameter::bottom() const { + // @@protoc_insertion_point(field_list:ditcaffe.LayerParameter.bottom) + return bottom_; +} + ::google::protobuf::RepeatedPtrField< ::std::string>* +LayerParameter::mutable_bottom() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.LayerParameter.top) + return top_.Get(index); +} + ::std::string* LayerParameter::mutable_top(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.top) + return top_.Mutable(index); +} + void LayerParameter::set_top(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.LayerParameter.top) +} + ::std::string* LayerParameter::add_top() { + // @@protoc_insertion_point(field_add_mutable:ditcaffe.LayerParameter.top) + return top_.Add(); +} + void LayerParameter::add_top(const ::std::string& value) { + top_.Add()->assign(value); + // @@protoc_insertion_point(field_add:ditcaffe.LayerParameter.top) +} + void LayerParameter::add_top(const char* value) { + top_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:ditcaffe.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:ditcaffe.LayerParameter.top) +} + const ::google::protobuf::RepeatedPtrField< ::std::string>& +LayerParameter::top() const { + // @@protoc_insertion_point(field_list:ditcaffe.LayerParameter.top) + return top_; +} + ::google::protobuf::RepeatedPtrField< ::std::string>* +LayerParameter::mutable_top() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.LayerParameter.top) + return &top_; +} + +// optional .ditcaffe.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(); +} + ::ditcaffe::Phase LayerParameter::phase() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.phase) + return static_cast< ::ditcaffe::Phase >(phase_); +} + void LayerParameter::set_phase(::ditcaffe::Phase value) { + assert(::ditcaffe::Phase_IsValid(value)); + set_has_phase(); + phase_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.LayerParameter.loss_weight) +} + void LayerParameter::add_loss_weight(float value) { + loss_weight_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.LayerParameter.loss_weight) +} + const ::google::protobuf::RepeatedField< float >& +LayerParameter::loss_weight() const { + // @@protoc_insertion_point(field_list:ditcaffe.LayerParameter.loss_weight) + return loss_weight_; +} + ::google::protobuf::RepeatedField< float >* +LayerParameter::mutable_loss_weight() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.LayerParameter.loss_weight) + return &loss_weight_; +} + +// repeated .ditcaffe.ParamSpec param = 6; +int LayerParameter::param_size() const { + return param_.size(); +} +void LayerParameter::clear_param() { + param_.Clear(); +} +const ::ditcaffe::ParamSpec& LayerParameter::param(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.param) + return param_.Get(index); +} +::ditcaffe::ParamSpec* LayerParameter::mutable_param(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.param) + return param_.Mutable(index); +} +::ditcaffe::ParamSpec* LayerParameter::add_param() { + // @@protoc_insertion_point(field_add:ditcaffe.LayerParameter.param) + return param_.Add(); +} +::google::protobuf::RepeatedPtrField< ::ditcaffe::ParamSpec >* +LayerParameter::mutable_param() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.LayerParameter.param) + return ¶m_; +} +const ::google::protobuf::RepeatedPtrField< ::ditcaffe::ParamSpec >& +LayerParameter::param() const { + // @@protoc_insertion_point(field_list:ditcaffe.LayerParameter.param) + return param_; +} + +// repeated .ditcaffe.BlobProto blobs = 7; +int LayerParameter::blobs_size() const { + return blobs_.size(); +} +void LayerParameter::clear_blobs() { + blobs_.Clear(); +} +const ::ditcaffe::BlobProto& LayerParameter::blobs(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.blobs) + return blobs_.Get(index); +} +::ditcaffe::BlobProto* LayerParameter::mutable_blobs(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.blobs) + return blobs_.Mutable(index); +} +::ditcaffe::BlobProto* LayerParameter::add_blobs() { + // @@protoc_insertion_point(field_add:ditcaffe.LayerParameter.blobs) + return blobs_.Add(); +} +::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >* +LayerParameter::mutable_blobs() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.LayerParameter.blobs) + return &blobs_; +} +const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >& +LayerParameter::blobs() const { + // @@protoc_insertion_point(field_list:ditcaffe.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:ditcaffe.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:ditcaffe.LayerParameter.propagate_down) +} + void LayerParameter::add_propagate_down(bool value) { + propagate_down_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.LayerParameter.propagate_down) +} + const ::google::protobuf::RepeatedField< bool >& +LayerParameter::propagate_down() const { + // @@protoc_insertion_point(field_list:ditcaffe.LayerParameter.propagate_down) + return propagate_down_; +} + ::google::protobuf::RepeatedField< bool >* +LayerParameter::mutable_propagate_down() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.LayerParameter.propagate_down) + return &propagate_down_; +} + +// repeated .ditcaffe.NetStateRule include = 8; +int LayerParameter::include_size() const { + return include_.size(); +} +void LayerParameter::clear_include() { + include_.Clear(); +} +const ::ditcaffe::NetStateRule& LayerParameter::include(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.include) + return include_.Get(index); +} +::ditcaffe::NetStateRule* LayerParameter::mutable_include(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.include) + return include_.Mutable(index); +} +::ditcaffe::NetStateRule* LayerParameter::add_include() { + // @@protoc_insertion_point(field_add:ditcaffe.LayerParameter.include) + return include_.Add(); +} +::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >* +LayerParameter::mutable_include() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.LayerParameter.include) + return &include_; +} +const ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >& +LayerParameter::include() const { + // @@protoc_insertion_point(field_list:ditcaffe.LayerParameter.include) + return include_; +} + +// repeated .ditcaffe.NetStateRule exclude = 9; +int LayerParameter::exclude_size() const { + return exclude_.size(); +} +void LayerParameter::clear_exclude() { + exclude_.Clear(); +} +const ::ditcaffe::NetStateRule& LayerParameter::exclude(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.exclude) + return exclude_.Get(index); +} +::ditcaffe::NetStateRule* LayerParameter::mutable_exclude(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.exclude) + return exclude_.Mutable(index); +} +::ditcaffe::NetStateRule* LayerParameter::add_exclude() { + // @@protoc_insertion_point(field_add:ditcaffe.LayerParameter.exclude) + return exclude_.Add(); +} +::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >* +LayerParameter::mutable_exclude() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.LayerParameter.exclude) + return &exclude_; +} +const ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >& +LayerParameter::exclude() const { + // @@protoc_insertion_point(field_list:ditcaffe.LayerParameter.exclude) + return exclude_; +} + +// optional .ditcaffe.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_->::ditcaffe::TransformationParameter::Clear(); + clear_has_transform_param(); +} +const ::ditcaffe::TransformationParameter& LayerParameter::transform_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.transform_param) + return transform_param_ != NULL ? *transform_param_ : *default_instance_->transform_param_; +} +::ditcaffe::TransformationParameter* LayerParameter::mutable_transform_param() { + set_has_transform_param(); + if (transform_param_ == NULL) { + transform_param_ = new ::ditcaffe::TransformationParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.transform_param) + return transform_param_; +} +::ditcaffe::TransformationParameter* LayerParameter::release_transform_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.transform_param) + clear_has_transform_param(); + ::ditcaffe::TransformationParameter* temp = transform_param_; + transform_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_transform_param(::ditcaffe::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:ditcaffe.LayerParameter.transform_param) +} + +// optional .ditcaffe.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_->::ditcaffe::LossParameter::Clear(); + clear_has_loss_param(); +} +const ::ditcaffe::LossParameter& LayerParameter::loss_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.loss_param) + return loss_param_ != NULL ? *loss_param_ : *default_instance_->loss_param_; +} +::ditcaffe::LossParameter* LayerParameter::mutable_loss_param() { + set_has_loss_param(); + if (loss_param_ == NULL) { + loss_param_ = new ::ditcaffe::LossParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.loss_param) + return loss_param_; +} +::ditcaffe::LossParameter* LayerParameter::release_loss_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.loss_param) + clear_has_loss_param(); + ::ditcaffe::LossParameter* temp = loss_param_; + loss_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_loss_param(::ditcaffe::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:ditcaffe.LayerParameter.loss_param) +} + +// optional .ditcaffe.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_->::ditcaffe::AccuracyParameter::Clear(); + clear_has_accuracy_param(); +} +const ::ditcaffe::AccuracyParameter& LayerParameter::accuracy_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.accuracy_param) + return accuracy_param_ != NULL ? *accuracy_param_ : *default_instance_->accuracy_param_; +} +::ditcaffe::AccuracyParameter* LayerParameter::mutable_accuracy_param() { + set_has_accuracy_param(); + if (accuracy_param_ == NULL) { + accuracy_param_ = new ::ditcaffe::AccuracyParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.accuracy_param) + return accuracy_param_; +} +::ditcaffe::AccuracyParameter* LayerParameter::release_accuracy_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.accuracy_param) + clear_has_accuracy_param(); + ::ditcaffe::AccuracyParameter* temp = accuracy_param_; + accuracy_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_accuracy_param(::ditcaffe::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:ditcaffe.LayerParameter.accuracy_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ArgMaxParameter::Clear(); + clear_has_argmax_param(); +} +const ::ditcaffe::ArgMaxParameter& LayerParameter::argmax_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.argmax_param) + return argmax_param_ != NULL ? *argmax_param_ : *default_instance_->argmax_param_; +} +::ditcaffe::ArgMaxParameter* LayerParameter::mutable_argmax_param() { + set_has_argmax_param(); + if (argmax_param_ == NULL) { + argmax_param_ = new ::ditcaffe::ArgMaxParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.argmax_param) + return argmax_param_; +} +::ditcaffe::ArgMaxParameter* LayerParameter::release_argmax_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.argmax_param) + clear_has_argmax_param(); + ::ditcaffe::ArgMaxParameter* temp = argmax_param_; + argmax_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_argmax_param(::ditcaffe::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:ditcaffe.LayerParameter.argmax_param) +} + +// optional .ditcaffe.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_->::ditcaffe::BatchNormParameter::Clear(); + clear_has_batch_norm_param(); +} +const ::ditcaffe::BatchNormParameter& LayerParameter::batch_norm_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.batch_norm_param) + return batch_norm_param_ != NULL ? *batch_norm_param_ : *default_instance_->batch_norm_param_; +} +::ditcaffe::BatchNormParameter* LayerParameter::mutable_batch_norm_param() { + set_has_batch_norm_param(); + if (batch_norm_param_ == NULL) { + batch_norm_param_ = new ::ditcaffe::BatchNormParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.batch_norm_param) + return batch_norm_param_; +} +::ditcaffe::BatchNormParameter* LayerParameter::release_batch_norm_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.batch_norm_param) + clear_has_batch_norm_param(); + ::ditcaffe::BatchNormParameter* temp = batch_norm_param_; + batch_norm_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_batch_norm_param(::ditcaffe::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:ditcaffe.LayerParameter.batch_norm_param) +} + +// optional .ditcaffe.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_->::ditcaffe::BiasParameter::Clear(); + clear_has_bias_param(); +} +const ::ditcaffe::BiasParameter& LayerParameter::bias_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.bias_param) + return bias_param_ != NULL ? *bias_param_ : *default_instance_->bias_param_; +} +::ditcaffe::BiasParameter* LayerParameter::mutable_bias_param() { + set_has_bias_param(); + if (bias_param_ == NULL) { + bias_param_ = new ::ditcaffe::BiasParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.bias_param) + return bias_param_; +} +::ditcaffe::BiasParameter* LayerParameter::release_bias_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.bias_param) + clear_has_bias_param(); + ::ditcaffe::BiasParameter* temp = bias_param_; + bias_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_bias_param(::ditcaffe::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:ditcaffe.LayerParameter.bias_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ConcatParameter::Clear(); + clear_has_concat_param(); +} +const ::ditcaffe::ConcatParameter& LayerParameter::concat_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.concat_param) + return concat_param_ != NULL ? *concat_param_ : *default_instance_->concat_param_; +} +::ditcaffe::ConcatParameter* LayerParameter::mutable_concat_param() { + set_has_concat_param(); + if (concat_param_ == NULL) { + concat_param_ = new ::ditcaffe::ConcatParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.concat_param) + return concat_param_; +} +::ditcaffe::ConcatParameter* LayerParameter::release_concat_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.concat_param) + clear_has_concat_param(); + ::ditcaffe::ConcatParameter* temp = concat_param_; + concat_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_concat_param(::ditcaffe::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:ditcaffe.LayerParameter.concat_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ContrastiveLossParameter::Clear(); + clear_has_contrastive_loss_param(); +} +const ::ditcaffe::ContrastiveLossParameter& LayerParameter::contrastive_loss_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.contrastive_loss_param) + return contrastive_loss_param_ != NULL ? *contrastive_loss_param_ : *default_instance_->contrastive_loss_param_; +} +::ditcaffe::ContrastiveLossParameter* LayerParameter::mutable_contrastive_loss_param() { + set_has_contrastive_loss_param(); + if (contrastive_loss_param_ == NULL) { + contrastive_loss_param_ = new ::ditcaffe::ContrastiveLossParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.contrastive_loss_param) + return contrastive_loss_param_; +} +::ditcaffe::ContrastiveLossParameter* LayerParameter::release_contrastive_loss_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.contrastive_loss_param) + clear_has_contrastive_loss_param(); + ::ditcaffe::ContrastiveLossParameter* temp = contrastive_loss_param_; + contrastive_loss_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_contrastive_loss_param(::ditcaffe::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:ditcaffe.LayerParameter.contrastive_loss_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ConvolutionParameter::Clear(); + clear_has_convolution_param(); +} +const ::ditcaffe::ConvolutionParameter& LayerParameter::convolution_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.convolution_param) + return convolution_param_ != NULL ? *convolution_param_ : *default_instance_->convolution_param_; +} +::ditcaffe::ConvolutionParameter* LayerParameter::mutable_convolution_param() { + set_has_convolution_param(); + if (convolution_param_ == NULL) { + convolution_param_ = new ::ditcaffe::ConvolutionParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.convolution_param) + return convolution_param_; +} +::ditcaffe::ConvolutionParameter* LayerParameter::release_convolution_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.convolution_param) + clear_has_convolution_param(); + ::ditcaffe::ConvolutionParameter* temp = convolution_param_; + convolution_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_convolution_param(::ditcaffe::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:ditcaffe.LayerParameter.convolution_param) +} + +// optional .ditcaffe.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_->::ditcaffe::CropParameter::Clear(); + clear_has_crop_param(); +} +const ::ditcaffe::CropParameter& LayerParameter::crop_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.crop_param) + return crop_param_ != NULL ? *crop_param_ : *default_instance_->crop_param_; +} +::ditcaffe::CropParameter* LayerParameter::mutable_crop_param() { + set_has_crop_param(); + if (crop_param_ == NULL) { + crop_param_ = new ::ditcaffe::CropParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.crop_param) + return crop_param_; +} +::ditcaffe::CropParameter* LayerParameter::release_crop_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.crop_param) + clear_has_crop_param(); + ::ditcaffe::CropParameter* temp = crop_param_; + crop_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_crop_param(::ditcaffe::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:ditcaffe.LayerParameter.crop_param) +} + +// optional .ditcaffe.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_->::ditcaffe::DataParameter::Clear(); + clear_has_data_param(); +} +const ::ditcaffe::DataParameter& LayerParameter::data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.data_param) + return data_param_ != NULL ? *data_param_ : *default_instance_->data_param_; +} +::ditcaffe::DataParameter* LayerParameter::mutable_data_param() { + set_has_data_param(); + if (data_param_ == NULL) { + data_param_ = new ::ditcaffe::DataParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.data_param) + return data_param_; +} +::ditcaffe::DataParameter* LayerParameter::release_data_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.data_param) + clear_has_data_param(); + ::ditcaffe::DataParameter* temp = data_param_; + data_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_data_param(::ditcaffe::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:ditcaffe.LayerParameter.data_param) +} + +// optional .ditcaffe.DropoutParameter dropout_param = 108; +bool LayerParameter::has_dropout_param() const { + return (_has_bits_[0] & 0x00400000u) != 0; +} +void LayerParameter::set_has_dropout_param() { + _has_bits_[0] |= 0x00400000u; +} +void LayerParameter::clear_has_dropout_param() { + _has_bits_[0] &= ~0x00400000u; +} +void LayerParameter::clear_dropout_param() { + if (dropout_param_ != NULL) dropout_param_->::ditcaffe::DropoutParameter::Clear(); + clear_has_dropout_param(); +} +const ::ditcaffe::DropoutParameter& LayerParameter::dropout_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.dropout_param) + return dropout_param_ != NULL ? *dropout_param_ : *default_instance_->dropout_param_; +} +::ditcaffe::DropoutParameter* LayerParameter::mutable_dropout_param() { + set_has_dropout_param(); + if (dropout_param_ == NULL) { + dropout_param_ = new ::ditcaffe::DropoutParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.dropout_param) + return dropout_param_; +} +::ditcaffe::DropoutParameter* LayerParameter::release_dropout_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.dropout_param) + clear_has_dropout_param(); + ::ditcaffe::DropoutParameter* temp = dropout_param_; + dropout_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_dropout_param(::ditcaffe::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:ditcaffe.LayerParameter.dropout_param) +} + +// optional .ditcaffe.DummyDataParameter dummy_data_param = 109; +bool LayerParameter::has_dummy_data_param() const { + return (_has_bits_[0] & 0x00800000u) != 0; +} +void LayerParameter::set_has_dummy_data_param() { + _has_bits_[0] |= 0x00800000u; +} +void LayerParameter::clear_has_dummy_data_param() { + _has_bits_[0] &= ~0x00800000u; +} +void LayerParameter::clear_dummy_data_param() { + if (dummy_data_param_ != NULL) dummy_data_param_->::ditcaffe::DummyDataParameter::Clear(); + clear_has_dummy_data_param(); +} +const ::ditcaffe::DummyDataParameter& LayerParameter::dummy_data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.dummy_data_param) + return dummy_data_param_ != NULL ? *dummy_data_param_ : *default_instance_->dummy_data_param_; +} +::ditcaffe::DummyDataParameter* LayerParameter::mutable_dummy_data_param() { + set_has_dummy_data_param(); + if (dummy_data_param_ == NULL) { + dummy_data_param_ = new ::ditcaffe::DummyDataParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.dummy_data_param) + return dummy_data_param_; +} +::ditcaffe::DummyDataParameter* LayerParameter::release_dummy_data_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.dummy_data_param) + clear_has_dummy_data_param(); + ::ditcaffe::DummyDataParameter* temp = dummy_data_param_; + dummy_data_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_dummy_data_param(::ditcaffe::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:ditcaffe.LayerParameter.dummy_data_param) +} + +// optional .ditcaffe.EltwiseParameter eltwise_param = 110; +bool LayerParameter::has_eltwise_param() const { + return (_has_bits_[0] & 0x01000000u) != 0; +} +void LayerParameter::set_has_eltwise_param() { + _has_bits_[0] |= 0x01000000u; +} +void LayerParameter::clear_has_eltwise_param() { + _has_bits_[0] &= ~0x01000000u; +} +void LayerParameter::clear_eltwise_param() { + if (eltwise_param_ != NULL) eltwise_param_->::ditcaffe::EltwiseParameter::Clear(); + clear_has_eltwise_param(); +} +const ::ditcaffe::EltwiseParameter& LayerParameter::eltwise_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.eltwise_param) + return eltwise_param_ != NULL ? *eltwise_param_ : *default_instance_->eltwise_param_; +} +::ditcaffe::EltwiseParameter* LayerParameter::mutable_eltwise_param() { + set_has_eltwise_param(); + if (eltwise_param_ == NULL) { + eltwise_param_ = new ::ditcaffe::EltwiseParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.eltwise_param) + return eltwise_param_; +} +::ditcaffe::EltwiseParameter* LayerParameter::release_eltwise_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.eltwise_param) + clear_has_eltwise_param(); + ::ditcaffe::EltwiseParameter* temp = eltwise_param_; + eltwise_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_eltwise_param(::ditcaffe::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:ditcaffe.LayerParameter.eltwise_param) +} + +// optional .ditcaffe.ELUParameter elu_param = 140; +bool LayerParameter::has_elu_param() const { + return (_has_bits_[0] & 0x02000000u) != 0; +} +void LayerParameter::set_has_elu_param() { + _has_bits_[0] |= 0x02000000u; +} +void LayerParameter::clear_has_elu_param() { + _has_bits_[0] &= ~0x02000000u; +} +void LayerParameter::clear_elu_param() { + if (elu_param_ != NULL) elu_param_->::ditcaffe::ELUParameter::Clear(); + clear_has_elu_param(); +} +const ::ditcaffe::ELUParameter& LayerParameter::elu_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.elu_param) + return elu_param_ != NULL ? *elu_param_ : *default_instance_->elu_param_; +} +::ditcaffe::ELUParameter* LayerParameter::mutable_elu_param() { + set_has_elu_param(); + if (elu_param_ == NULL) { + elu_param_ = new ::ditcaffe::ELUParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.elu_param) + return elu_param_; +} +::ditcaffe::ELUParameter* LayerParameter::release_elu_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.elu_param) + clear_has_elu_param(); + ::ditcaffe::ELUParameter* temp = elu_param_; + elu_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_elu_param(::ditcaffe::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:ditcaffe.LayerParameter.elu_param) +} + +// optional .ditcaffe.EmbedParameter embed_param = 137; +bool LayerParameter::has_embed_param() const { + return (_has_bits_[0] & 0x04000000u) != 0; +} +void LayerParameter::set_has_embed_param() { + _has_bits_[0] |= 0x04000000u; +} +void LayerParameter::clear_has_embed_param() { + _has_bits_[0] &= ~0x04000000u; +} +void LayerParameter::clear_embed_param() { + if (embed_param_ != NULL) embed_param_->::ditcaffe::EmbedParameter::Clear(); + clear_has_embed_param(); +} +const ::ditcaffe::EmbedParameter& LayerParameter::embed_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.embed_param) + return embed_param_ != NULL ? *embed_param_ : *default_instance_->embed_param_; +} +::ditcaffe::EmbedParameter* LayerParameter::mutable_embed_param() { + set_has_embed_param(); + if (embed_param_ == NULL) { + embed_param_ = new ::ditcaffe::EmbedParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.embed_param) + return embed_param_; +} +::ditcaffe::EmbedParameter* LayerParameter::release_embed_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.embed_param) + clear_has_embed_param(); + ::ditcaffe::EmbedParameter* temp = embed_param_; + embed_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_embed_param(::ditcaffe::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:ditcaffe.LayerParameter.embed_param) +} + +// optional .ditcaffe.ExpParameter exp_param = 111; +bool LayerParameter::has_exp_param() const { + return (_has_bits_[0] & 0x08000000u) != 0; +} +void LayerParameter::set_has_exp_param() { + _has_bits_[0] |= 0x08000000u; +} +void LayerParameter::clear_has_exp_param() { + _has_bits_[0] &= ~0x08000000u; +} +void LayerParameter::clear_exp_param() { + if (exp_param_ != NULL) exp_param_->::ditcaffe::ExpParameter::Clear(); + clear_has_exp_param(); +} +const ::ditcaffe::ExpParameter& LayerParameter::exp_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.exp_param) + return exp_param_ != NULL ? *exp_param_ : *default_instance_->exp_param_; +} +::ditcaffe::ExpParameter* LayerParameter::mutable_exp_param() { + set_has_exp_param(); + if (exp_param_ == NULL) { + exp_param_ = new ::ditcaffe::ExpParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.exp_param) + return exp_param_; +} +::ditcaffe::ExpParameter* LayerParameter::release_exp_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.exp_param) + clear_has_exp_param(); + ::ditcaffe::ExpParameter* temp = exp_param_; + exp_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_exp_param(::ditcaffe::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:ditcaffe.LayerParameter.exp_param) +} + +// optional .ditcaffe.FlattenParameter flatten_param = 135; +bool LayerParameter::has_flatten_param() const { + return (_has_bits_[0] & 0x10000000u) != 0; +} +void LayerParameter::set_has_flatten_param() { + _has_bits_[0] |= 0x10000000u; +} +void LayerParameter::clear_has_flatten_param() { + _has_bits_[0] &= ~0x10000000u; +} +void LayerParameter::clear_flatten_param() { + if (flatten_param_ != NULL) flatten_param_->::ditcaffe::FlattenParameter::Clear(); + clear_has_flatten_param(); +} +const ::ditcaffe::FlattenParameter& LayerParameter::flatten_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.flatten_param) + return flatten_param_ != NULL ? *flatten_param_ : *default_instance_->flatten_param_; +} +::ditcaffe::FlattenParameter* LayerParameter::mutable_flatten_param() { + set_has_flatten_param(); + if (flatten_param_ == NULL) { + flatten_param_ = new ::ditcaffe::FlattenParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.flatten_param) + return flatten_param_; +} +::ditcaffe::FlattenParameter* LayerParameter::release_flatten_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.flatten_param) + clear_has_flatten_param(); + ::ditcaffe::FlattenParameter* temp = flatten_param_; + flatten_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_flatten_param(::ditcaffe::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:ditcaffe.LayerParameter.flatten_param) +} + +// optional .ditcaffe.HDF5DataParameter hdf5_data_param = 112; +bool LayerParameter::has_hdf5_data_param() const { + return (_has_bits_[0] & 0x20000000u) != 0; +} +void LayerParameter::set_has_hdf5_data_param() { + _has_bits_[0] |= 0x20000000u; +} +void LayerParameter::clear_has_hdf5_data_param() { + _has_bits_[0] &= ~0x20000000u; +} +void LayerParameter::clear_hdf5_data_param() { + if (hdf5_data_param_ != NULL) hdf5_data_param_->::ditcaffe::HDF5DataParameter::Clear(); + clear_has_hdf5_data_param(); +} +const ::ditcaffe::HDF5DataParameter& LayerParameter::hdf5_data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.hdf5_data_param) + return hdf5_data_param_ != NULL ? *hdf5_data_param_ : *default_instance_->hdf5_data_param_; +} +::ditcaffe::HDF5DataParameter* LayerParameter::mutable_hdf5_data_param() { + set_has_hdf5_data_param(); + if (hdf5_data_param_ == NULL) { + hdf5_data_param_ = new ::ditcaffe::HDF5DataParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.hdf5_data_param) + return hdf5_data_param_; +} +::ditcaffe::HDF5DataParameter* LayerParameter::release_hdf5_data_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.hdf5_data_param) + clear_has_hdf5_data_param(); + ::ditcaffe::HDF5DataParameter* temp = hdf5_data_param_; + hdf5_data_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_hdf5_data_param(::ditcaffe::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:ditcaffe.LayerParameter.hdf5_data_param) +} + +// optional .ditcaffe.HDF5OutputParameter hdf5_output_param = 113; +bool LayerParameter::has_hdf5_output_param() const { + return (_has_bits_[0] & 0x40000000u) != 0; +} +void LayerParameter::set_has_hdf5_output_param() { + _has_bits_[0] |= 0x40000000u; +} +void LayerParameter::clear_has_hdf5_output_param() { + _has_bits_[0] &= ~0x40000000u; +} +void LayerParameter::clear_hdf5_output_param() { + if (hdf5_output_param_ != NULL) hdf5_output_param_->::ditcaffe::HDF5OutputParameter::Clear(); + clear_has_hdf5_output_param(); +} +const ::ditcaffe::HDF5OutputParameter& LayerParameter::hdf5_output_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.hdf5_output_param) + return hdf5_output_param_ != NULL ? *hdf5_output_param_ : *default_instance_->hdf5_output_param_; +} +::ditcaffe::HDF5OutputParameter* LayerParameter::mutable_hdf5_output_param() { + set_has_hdf5_output_param(); + if (hdf5_output_param_ == NULL) { + hdf5_output_param_ = new ::ditcaffe::HDF5OutputParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.hdf5_output_param) + return hdf5_output_param_; +} +::ditcaffe::HDF5OutputParameter* LayerParameter::release_hdf5_output_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.hdf5_output_param) + clear_has_hdf5_output_param(); + ::ditcaffe::HDF5OutputParameter* temp = hdf5_output_param_; + hdf5_output_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_hdf5_output_param(::ditcaffe::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:ditcaffe.LayerParameter.hdf5_output_param) +} + +// optional .ditcaffe.HingeLossParameter hinge_loss_param = 114; +bool LayerParameter::has_hinge_loss_param() const { + return (_has_bits_[0] & 0x80000000u) != 0; +} +void LayerParameter::set_has_hinge_loss_param() { + _has_bits_[0] |= 0x80000000u; +} +void LayerParameter::clear_has_hinge_loss_param() { + _has_bits_[0] &= ~0x80000000u; +} +void LayerParameter::clear_hinge_loss_param() { + if (hinge_loss_param_ != NULL) hinge_loss_param_->::ditcaffe::HingeLossParameter::Clear(); + clear_has_hinge_loss_param(); +} +const ::ditcaffe::HingeLossParameter& LayerParameter::hinge_loss_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.hinge_loss_param) + return hinge_loss_param_ != NULL ? *hinge_loss_param_ : *default_instance_->hinge_loss_param_; +} +::ditcaffe::HingeLossParameter* LayerParameter::mutable_hinge_loss_param() { + set_has_hinge_loss_param(); + if (hinge_loss_param_ == NULL) { + hinge_loss_param_ = new ::ditcaffe::HingeLossParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.hinge_loss_param) + return hinge_loss_param_; +} +::ditcaffe::HingeLossParameter* LayerParameter::release_hinge_loss_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.hinge_loss_param) + clear_has_hinge_loss_param(); + ::ditcaffe::HingeLossParameter* temp = hinge_loss_param_; + hinge_loss_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_hinge_loss_param(::ditcaffe::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:ditcaffe.LayerParameter.hinge_loss_param) +} + +// optional .ditcaffe.ImageDataParameter image_data_param = 115; +bool LayerParameter::has_image_data_param() const { + return (_has_bits_[1] & 0x00000001u) != 0; +} +void LayerParameter::set_has_image_data_param() { + _has_bits_[1] |= 0x00000001u; +} +void LayerParameter::clear_has_image_data_param() { + _has_bits_[1] &= ~0x00000001u; +} +void LayerParameter::clear_image_data_param() { + if (image_data_param_ != NULL) image_data_param_->::ditcaffe::ImageDataParameter::Clear(); + clear_has_image_data_param(); +} +const ::ditcaffe::ImageDataParameter& LayerParameter::image_data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.image_data_param) + return image_data_param_ != NULL ? *image_data_param_ : *default_instance_->image_data_param_; +} +::ditcaffe::ImageDataParameter* LayerParameter::mutable_image_data_param() { + set_has_image_data_param(); + if (image_data_param_ == NULL) { + image_data_param_ = new ::ditcaffe::ImageDataParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.image_data_param) + return image_data_param_; +} +::ditcaffe::ImageDataParameter* LayerParameter::release_image_data_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.image_data_param) + clear_has_image_data_param(); + ::ditcaffe::ImageDataParameter* temp = image_data_param_; + image_data_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_image_data_param(::ditcaffe::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:ditcaffe.LayerParameter.image_data_param) +} + +// optional .ditcaffe.InfogainLossParameter infogain_loss_param = 116; +bool LayerParameter::has_infogain_loss_param() const { + return (_has_bits_[1] & 0x00000002u) != 0; +} +void LayerParameter::set_has_infogain_loss_param() { + _has_bits_[1] |= 0x00000002u; +} +void LayerParameter::clear_has_infogain_loss_param() { + _has_bits_[1] &= ~0x00000002u; +} +void LayerParameter::clear_infogain_loss_param() { + if (infogain_loss_param_ != NULL) infogain_loss_param_->::ditcaffe::InfogainLossParameter::Clear(); + clear_has_infogain_loss_param(); +} +const ::ditcaffe::InfogainLossParameter& LayerParameter::infogain_loss_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.infogain_loss_param) + return infogain_loss_param_ != NULL ? *infogain_loss_param_ : *default_instance_->infogain_loss_param_; +} +::ditcaffe::InfogainLossParameter* LayerParameter::mutable_infogain_loss_param() { + set_has_infogain_loss_param(); + if (infogain_loss_param_ == NULL) { + infogain_loss_param_ = new ::ditcaffe::InfogainLossParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.infogain_loss_param) + return infogain_loss_param_; +} +::ditcaffe::InfogainLossParameter* LayerParameter::release_infogain_loss_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.infogain_loss_param) + clear_has_infogain_loss_param(); + ::ditcaffe::InfogainLossParameter* temp = infogain_loss_param_; + infogain_loss_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_infogain_loss_param(::ditcaffe::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:ditcaffe.LayerParameter.infogain_loss_param) +} + +// optional .ditcaffe.InnerProductParameter inner_product_param = 117; +bool LayerParameter::has_inner_product_param() const { + return (_has_bits_[1] & 0x00000004u) != 0; +} +void LayerParameter::set_has_inner_product_param() { + _has_bits_[1] |= 0x00000004u; +} +void LayerParameter::clear_has_inner_product_param() { + _has_bits_[1] &= ~0x00000004u; +} +void LayerParameter::clear_inner_product_param() { + if (inner_product_param_ != NULL) inner_product_param_->::ditcaffe::InnerProductParameter::Clear(); + clear_has_inner_product_param(); +} +const ::ditcaffe::InnerProductParameter& LayerParameter::inner_product_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.inner_product_param) + return inner_product_param_ != NULL ? *inner_product_param_ : *default_instance_->inner_product_param_; +} +::ditcaffe::InnerProductParameter* LayerParameter::mutable_inner_product_param() { + set_has_inner_product_param(); + if (inner_product_param_ == NULL) { + inner_product_param_ = new ::ditcaffe::InnerProductParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.inner_product_param) + return inner_product_param_; +} +::ditcaffe::InnerProductParameter* LayerParameter::release_inner_product_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.inner_product_param) + clear_has_inner_product_param(); + ::ditcaffe::InnerProductParameter* temp = inner_product_param_; + inner_product_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_inner_product_param(::ditcaffe::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:ditcaffe.LayerParameter.inner_product_param) +} + +// optional .ditcaffe.InputParameter input_param = 143; +bool LayerParameter::has_input_param() const { + return (_has_bits_[1] & 0x00000008u) != 0; +} +void LayerParameter::set_has_input_param() { + _has_bits_[1] |= 0x00000008u; +} +void LayerParameter::clear_has_input_param() { + _has_bits_[1] &= ~0x00000008u; +} +void LayerParameter::clear_input_param() { + if (input_param_ != NULL) input_param_->::ditcaffe::InputParameter::Clear(); + clear_has_input_param(); +} +const ::ditcaffe::InputParameter& LayerParameter::input_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.input_param) + return input_param_ != NULL ? *input_param_ : *default_instance_->input_param_; +} +::ditcaffe::InputParameter* LayerParameter::mutable_input_param() { + set_has_input_param(); + if (input_param_ == NULL) { + input_param_ = new ::ditcaffe::InputParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.input_param) + return input_param_; +} +::ditcaffe::InputParameter* LayerParameter::release_input_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.input_param) + clear_has_input_param(); + ::ditcaffe::InputParameter* temp = input_param_; + input_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_input_param(::ditcaffe::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:ditcaffe.LayerParameter.input_param) +} + +// optional .ditcaffe.LogParameter log_param = 134; +bool LayerParameter::has_log_param() const { + return (_has_bits_[1] & 0x00000010u) != 0; +} +void LayerParameter::set_has_log_param() { + _has_bits_[1] |= 0x00000010u; +} +void LayerParameter::clear_has_log_param() { + _has_bits_[1] &= ~0x00000010u; +} +void LayerParameter::clear_log_param() { + if (log_param_ != NULL) log_param_->::ditcaffe::LogParameter::Clear(); + clear_has_log_param(); +} +const ::ditcaffe::LogParameter& LayerParameter::log_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.log_param) + return log_param_ != NULL ? *log_param_ : *default_instance_->log_param_; +} +::ditcaffe::LogParameter* LayerParameter::mutable_log_param() { + set_has_log_param(); + if (log_param_ == NULL) { + log_param_ = new ::ditcaffe::LogParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.log_param) + return log_param_; +} +::ditcaffe::LogParameter* LayerParameter::release_log_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.log_param) + clear_has_log_param(); + ::ditcaffe::LogParameter* temp = log_param_; + log_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_log_param(::ditcaffe::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:ditcaffe.LayerParameter.log_param) +} + +// optional .ditcaffe.LRNParameter lrn_param = 118; +bool LayerParameter::has_lrn_param() const { + return (_has_bits_[1] & 0x00000020u) != 0; +} +void LayerParameter::set_has_lrn_param() { + _has_bits_[1] |= 0x00000020u; +} +void LayerParameter::clear_has_lrn_param() { + _has_bits_[1] &= ~0x00000020u; +} +void LayerParameter::clear_lrn_param() { + if (lrn_param_ != NULL) lrn_param_->::ditcaffe::LRNParameter::Clear(); + clear_has_lrn_param(); +} +const ::ditcaffe::LRNParameter& LayerParameter::lrn_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.lrn_param) + return lrn_param_ != NULL ? *lrn_param_ : *default_instance_->lrn_param_; +} +::ditcaffe::LRNParameter* LayerParameter::mutable_lrn_param() { + set_has_lrn_param(); + if (lrn_param_ == NULL) { + lrn_param_ = new ::ditcaffe::LRNParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.lrn_param) + return lrn_param_; +} +::ditcaffe::LRNParameter* LayerParameter::release_lrn_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.lrn_param) + clear_has_lrn_param(); + ::ditcaffe::LRNParameter* temp = lrn_param_; + lrn_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_lrn_param(::ditcaffe::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:ditcaffe.LayerParameter.lrn_param) +} + +// optional .ditcaffe.MemoryDataParameter memory_data_param = 119; +bool LayerParameter::has_memory_data_param() const { + return (_has_bits_[1] & 0x00000040u) != 0; +} +void LayerParameter::set_has_memory_data_param() { + _has_bits_[1] |= 0x00000040u; +} +void LayerParameter::clear_has_memory_data_param() { + _has_bits_[1] &= ~0x00000040u; +} +void LayerParameter::clear_memory_data_param() { + if (memory_data_param_ != NULL) memory_data_param_->::ditcaffe::MemoryDataParameter::Clear(); + clear_has_memory_data_param(); +} +const ::ditcaffe::MemoryDataParameter& LayerParameter::memory_data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.memory_data_param) + return memory_data_param_ != NULL ? *memory_data_param_ : *default_instance_->memory_data_param_; +} +::ditcaffe::MemoryDataParameter* LayerParameter::mutable_memory_data_param() { + set_has_memory_data_param(); + if (memory_data_param_ == NULL) { + memory_data_param_ = new ::ditcaffe::MemoryDataParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.memory_data_param) + return memory_data_param_; +} +::ditcaffe::MemoryDataParameter* LayerParameter::release_memory_data_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.memory_data_param) + clear_has_memory_data_param(); + ::ditcaffe::MemoryDataParameter* temp = memory_data_param_; + memory_data_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_memory_data_param(::ditcaffe::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:ditcaffe.LayerParameter.memory_data_param) +} + +// optional .ditcaffe.MVNParameter mvn_param = 120; +bool LayerParameter::has_mvn_param() const { + return (_has_bits_[1] & 0x00000080u) != 0; +} +void LayerParameter::set_has_mvn_param() { + _has_bits_[1] |= 0x00000080u; +} +void LayerParameter::clear_has_mvn_param() { + _has_bits_[1] &= ~0x00000080u; +} +void LayerParameter::clear_mvn_param() { + if (mvn_param_ != NULL) mvn_param_->::ditcaffe::MVNParameter::Clear(); + clear_has_mvn_param(); +} +const ::ditcaffe::MVNParameter& LayerParameter::mvn_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.mvn_param) + return mvn_param_ != NULL ? *mvn_param_ : *default_instance_->mvn_param_; +} +::ditcaffe::MVNParameter* LayerParameter::mutable_mvn_param() { + set_has_mvn_param(); + if (mvn_param_ == NULL) { + mvn_param_ = new ::ditcaffe::MVNParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.mvn_param) + return mvn_param_; +} +::ditcaffe::MVNParameter* LayerParameter::release_mvn_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.mvn_param) + clear_has_mvn_param(); + ::ditcaffe::MVNParameter* temp = mvn_param_; + mvn_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_mvn_param(::ditcaffe::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:ditcaffe.LayerParameter.mvn_param) +} + +// optional .ditcaffe.ParameterParameter parameter_param = 145; +bool LayerParameter::has_parameter_param() const { + return (_has_bits_[1] & 0x00000100u) != 0; +} +void LayerParameter::set_has_parameter_param() { + _has_bits_[1] |= 0x00000100u; +} +void LayerParameter::clear_has_parameter_param() { + _has_bits_[1] &= ~0x00000100u; +} +void LayerParameter::clear_parameter_param() { + if (parameter_param_ != NULL) parameter_param_->::ditcaffe::ParameterParameter::Clear(); + clear_has_parameter_param(); +} +const ::ditcaffe::ParameterParameter& LayerParameter::parameter_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.parameter_param) + return parameter_param_ != NULL ? *parameter_param_ : *default_instance_->parameter_param_; +} +::ditcaffe::ParameterParameter* LayerParameter::mutable_parameter_param() { + set_has_parameter_param(); + if (parameter_param_ == NULL) { + parameter_param_ = new ::ditcaffe::ParameterParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.parameter_param) + return parameter_param_; +} +::ditcaffe::ParameterParameter* LayerParameter::release_parameter_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.parameter_param) + clear_has_parameter_param(); + ::ditcaffe::ParameterParameter* temp = parameter_param_; + parameter_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_parameter_param(::ditcaffe::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:ditcaffe.LayerParameter.parameter_param) +} + +// optional .ditcaffe.PoolingParameter pooling_param = 121; +bool LayerParameter::has_pooling_param() const { + return (_has_bits_[1] & 0x00000200u) != 0; +} +void LayerParameter::set_has_pooling_param() { + _has_bits_[1] |= 0x00000200u; +} +void LayerParameter::clear_has_pooling_param() { + _has_bits_[1] &= ~0x00000200u; +} +void LayerParameter::clear_pooling_param() { + if (pooling_param_ != NULL) pooling_param_->::ditcaffe::PoolingParameter::Clear(); + clear_has_pooling_param(); +} +const ::ditcaffe::PoolingParameter& LayerParameter::pooling_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.pooling_param) + return pooling_param_ != NULL ? *pooling_param_ : *default_instance_->pooling_param_; +} +::ditcaffe::PoolingParameter* LayerParameter::mutable_pooling_param() { + set_has_pooling_param(); + if (pooling_param_ == NULL) { + pooling_param_ = new ::ditcaffe::PoolingParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.pooling_param) + return pooling_param_; +} +::ditcaffe::PoolingParameter* LayerParameter::release_pooling_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.pooling_param) + clear_has_pooling_param(); + ::ditcaffe::PoolingParameter* temp = pooling_param_; + pooling_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_pooling_param(::ditcaffe::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:ditcaffe.LayerParameter.pooling_param) +} + +// optional .ditcaffe.PowerParameter power_param = 122; +bool LayerParameter::has_power_param() const { + return (_has_bits_[1] & 0x00000400u) != 0; +} +void LayerParameter::set_has_power_param() { + _has_bits_[1] |= 0x00000400u; +} +void LayerParameter::clear_has_power_param() { + _has_bits_[1] &= ~0x00000400u; +} +void LayerParameter::clear_power_param() { + if (power_param_ != NULL) power_param_->::ditcaffe::PowerParameter::Clear(); + clear_has_power_param(); +} +const ::ditcaffe::PowerParameter& LayerParameter::power_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.power_param) + return power_param_ != NULL ? *power_param_ : *default_instance_->power_param_; +} +::ditcaffe::PowerParameter* LayerParameter::mutable_power_param() { + set_has_power_param(); + if (power_param_ == NULL) { + power_param_ = new ::ditcaffe::PowerParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.power_param) + return power_param_; +} +::ditcaffe::PowerParameter* LayerParameter::release_power_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.power_param) + clear_has_power_param(); + ::ditcaffe::PowerParameter* temp = power_param_; + power_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_power_param(::ditcaffe::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:ditcaffe.LayerParameter.power_param) +} + +// optional .ditcaffe.PReLUParameter prelu_param = 131; +bool LayerParameter::has_prelu_param() const { + return (_has_bits_[1] & 0x00000800u) != 0; +} +void LayerParameter::set_has_prelu_param() { + _has_bits_[1] |= 0x00000800u; +} +void LayerParameter::clear_has_prelu_param() { + _has_bits_[1] &= ~0x00000800u; +} +void LayerParameter::clear_prelu_param() { + if (prelu_param_ != NULL) prelu_param_->::ditcaffe::PReLUParameter::Clear(); + clear_has_prelu_param(); +} +const ::ditcaffe::PReLUParameter& LayerParameter::prelu_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.prelu_param) + return prelu_param_ != NULL ? *prelu_param_ : *default_instance_->prelu_param_; +} +::ditcaffe::PReLUParameter* LayerParameter::mutable_prelu_param() { + set_has_prelu_param(); + if (prelu_param_ == NULL) { + prelu_param_ = new ::ditcaffe::PReLUParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.prelu_param) + return prelu_param_; +} +::ditcaffe::PReLUParameter* LayerParameter::release_prelu_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.prelu_param) + clear_has_prelu_param(); + ::ditcaffe::PReLUParameter* temp = prelu_param_; + prelu_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_prelu_param(::ditcaffe::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:ditcaffe.LayerParameter.prelu_param) +} + +// optional .ditcaffe.PythonParameter python_param = 130; +bool LayerParameter::has_python_param() const { + return (_has_bits_[1] & 0x00001000u) != 0; +} +void LayerParameter::set_has_python_param() { + _has_bits_[1] |= 0x00001000u; +} +void LayerParameter::clear_has_python_param() { + _has_bits_[1] &= ~0x00001000u; +} +void LayerParameter::clear_python_param() { + if (python_param_ != NULL) python_param_->::ditcaffe::PythonParameter::Clear(); + clear_has_python_param(); +} +const ::ditcaffe::PythonParameter& LayerParameter::python_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.python_param) + return python_param_ != NULL ? *python_param_ : *default_instance_->python_param_; +} +::ditcaffe::PythonParameter* LayerParameter::mutable_python_param() { + set_has_python_param(); + if (python_param_ == NULL) { + python_param_ = new ::ditcaffe::PythonParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.python_param) + return python_param_; +} +::ditcaffe::PythonParameter* LayerParameter::release_python_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.python_param) + clear_has_python_param(); + ::ditcaffe::PythonParameter* temp = python_param_; + python_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_python_param(::ditcaffe::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:ditcaffe.LayerParameter.python_param) +} + +// optional .ditcaffe.ReductionParameter reduction_param = 136; +bool LayerParameter::has_reduction_param() const { + return (_has_bits_[1] & 0x00002000u) != 0; +} +void LayerParameter::set_has_reduction_param() { + _has_bits_[1] |= 0x00002000u; +} +void LayerParameter::clear_has_reduction_param() { + _has_bits_[1] &= ~0x00002000u; +} +void LayerParameter::clear_reduction_param() { + if (reduction_param_ != NULL) reduction_param_->::ditcaffe::ReductionParameter::Clear(); + clear_has_reduction_param(); +} +const ::ditcaffe::ReductionParameter& LayerParameter::reduction_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.reduction_param) + return reduction_param_ != NULL ? *reduction_param_ : *default_instance_->reduction_param_; +} +::ditcaffe::ReductionParameter* LayerParameter::mutable_reduction_param() { + set_has_reduction_param(); + if (reduction_param_ == NULL) { + reduction_param_ = new ::ditcaffe::ReductionParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.reduction_param) + return reduction_param_; +} +::ditcaffe::ReductionParameter* LayerParameter::release_reduction_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.reduction_param) + clear_has_reduction_param(); + ::ditcaffe::ReductionParameter* temp = reduction_param_; + reduction_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_reduction_param(::ditcaffe::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:ditcaffe.LayerParameter.reduction_param) +} + +// optional .ditcaffe.ReLUParameter relu_param = 123; +bool LayerParameter::has_relu_param() const { + return (_has_bits_[1] & 0x00004000u) != 0; +} +void LayerParameter::set_has_relu_param() { + _has_bits_[1] |= 0x00004000u; +} +void LayerParameter::clear_has_relu_param() { + _has_bits_[1] &= ~0x00004000u; +} +void LayerParameter::clear_relu_param() { + if (relu_param_ != NULL) relu_param_->::ditcaffe::ReLUParameter::Clear(); + clear_has_relu_param(); +} +const ::ditcaffe::ReLUParameter& LayerParameter::relu_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.relu_param) + return relu_param_ != NULL ? *relu_param_ : *default_instance_->relu_param_; +} +::ditcaffe::ReLUParameter* LayerParameter::mutable_relu_param() { + set_has_relu_param(); + if (relu_param_ == NULL) { + relu_param_ = new ::ditcaffe::ReLUParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.relu_param) + return relu_param_; +} +::ditcaffe::ReLUParameter* LayerParameter::release_relu_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.relu_param) + clear_has_relu_param(); + ::ditcaffe::ReLUParameter* temp = relu_param_; + relu_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_relu_param(::ditcaffe::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:ditcaffe.LayerParameter.relu_param) +} + +// optional .ditcaffe.ReshapeParameter reshape_param = 133; +bool LayerParameter::has_reshape_param() const { + return (_has_bits_[1] & 0x00008000u) != 0; +} +void LayerParameter::set_has_reshape_param() { + _has_bits_[1] |= 0x00008000u; +} +void LayerParameter::clear_has_reshape_param() { + _has_bits_[1] &= ~0x00008000u; +} +void LayerParameter::clear_reshape_param() { + if (reshape_param_ != NULL) reshape_param_->::ditcaffe::ReshapeParameter::Clear(); + clear_has_reshape_param(); +} +const ::ditcaffe::ReshapeParameter& LayerParameter::reshape_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.reshape_param) + return reshape_param_ != NULL ? *reshape_param_ : *default_instance_->reshape_param_; +} +::ditcaffe::ReshapeParameter* LayerParameter::mutable_reshape_param() { + set_has_reshape_param(); + if (reshape_param_ == NULL) { + reshape_param_ = new ::ditcaffe::ReshapeParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.reshape_param) + return reshape_param_; +} +::ditcaffe::ReshapeParameter* LayerParameter::release_reshape_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.reshape_param) + clear_has_reshape_param(); + ::ditcaffe::ReshapeParameter* temp = reshape_param_; + reshape_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_reshape_param(::ditcaffe::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:ditcaffe.LayerParameter.reshape_param) +} + +// optional .ditcaffe.ScaleParameter scale_param = 142; +bool LayerParameter::has_scale_param() const { + return (_has_bits_[1] & 0x00010000u) != 0; +} +void LayerParameter::set_has_scale_param() { + _has_bits_[1] |= 0x00010000u; +} +void LayerParameter::clear_has_scale_param() { + _has_bits_[1] &= ~0x00010000u; +} +void LayerParameter::clear_scale_param() { + if (scale_param_ != NULL) scale_param_->::ditcaffe::ScaleParameter::Clear(); + clear_has_scale_param(); +} +const ::ditcaffe::ScaleParameter& LayerParameter::scale_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.scale_param) + return scale_param_ != NULL ? *scale_param_ : *default_instance_->scale_param_; +} +::ditcaffe::ScaleParameter* LayerParameter::mutable_scale_param() { + set_has_scale_param(); + if (scale_param_ == NULL) { + scale_param_ = new ::ditcaffe::ScaleParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.scale_param) + return scale_param_; +} +::ditcaffe::ScaleParameter* LayerParameter::release_scale_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.scale_param) + clear_has_scale_param(); + ::ditcaffe::ScaleParameter* temp = scale_param_; + scale_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_scale_param(::ditcaffe::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:ditcaffe.LayerParameter.scale_param) +} + +// optional .ditcaffe.SigmoidParameter sigmoid_param = 124; +bool LayerParameter::has_sigmoid_param() const { + return (_has_bits_[1] & 0x00020000u) != 0; +} +void LayerParameter::set_has_sigmoid_param() { + _has_bits_[1] |= 0x00020000u; +} +void LayerParameter::clear_has_sigmoid_param() { + _has_bits_[1] &= ~0x00020000u; +} +void LayerParameter::clear_sigmoid_param() { + if (sigmoid_param_ != NULL) sigmoid_param_->::ditcaffe::SigmoidParameter::Clear(); + clear_has_sigmoid_param(); +} +const ::ditcaffe::SigmoidParameter& LayerParameter::sigmoid_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.sigmoid_param) + return sigmoid_param_ != NULL ? *sigmoid_param_ : *default_instance_->sigmoid_param_; +} +::ditcaffe::SigmoidParameter* LayerParameter::mutable_sigmoid_param() { + set_has_sigmoid_param(); + if (sigmoid_param_ == NULL) { + sigmoid_param_ = new ::ditcaffe::SigmoidParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.sigmoid_param) + return sigmoid_param_; +} +::ditcaffe::SigmoidParameter* LayerParameter::release_sigmoid_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.sigmoid_param) + clear_has_sigmoid_param(); + ::ditcaffe::SigmoidParameter* temp = sigmoid_param_; + sigmoid_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_sigmoid_param(::ditcaffe::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:ditcaffe.LayerParameter.sigmoid_param) +} + +// optional .ditcaffe.SoftmaxParameter softmax_param = 125; +bool LayerParameter::has_softmax_param() const { + return (_has_bits_[1] & 0x00040000u) != 0; +} +void LayerParameter::set_has_softmax_param() { + _has_bits_[1] |= 0x00040000u; +} +void LayerParameter::clear_has_softmax_param() { + _has_bits_[1] &= ~0x00040000u; +} +void LayerParameter::clear_softmax_param() { + if (softmax_param_ != NULL) softmax_param_->::ditcaffe::SoftmaxParameter::Clear(); + clear_has_softmax_param(); +} +const ::ditcaffe::SoftmaxParameter& LayerParameter::softmax_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.softmax_param) + return softmax_param_ != NULL ? *softmax_param_ : *default_instance_->softmax_param_; +} +::ditcaffe::SoftmaxParameter* LayerParameter::mutable_softmax_param() { + set_has_softmax_param(); + if (softmax_param_ == NULL) { + softmax_param_ = new ::ditcaffe::SoftmaxParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.softmax_param) + return softmax_param_; +} +::ditcaffe::SoftmaxParameter* LayerParameter::release_softmax_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.softmax_param) + clear_has_softmax_param(); + ::ditcaffe::SoftmaxParameter* temp = softmax_param_; + softmax_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_softmax_param(::ditcaffe::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:ditcaffe.LayerParameter.softmax_param) +} + +// optional .ditcaffe.SPPParameter spp_param = 132; +bool LayerParameter::has_spp_param() const { + return (_has_bits_[1] & 0x00080000u) != 0; +} +void LayerParameter::set_has_spp_param() { + _has_bits_[1] |= 0x00080000u; +} +void LayerParameter::clear_has_spp_param() { + _has_bits_[1] &= ~0x00080000u; +} +void LayerParameter::clear_spp_param() { + if (spp_param_ != NULL) spp_param_->::ditcaffe::SPPParameter::Clear(); + clear_has_spp_param(); +} +const ::ditcaffe::SPPParameter& LayerParameter::spp_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.spp_param) + return spp_param_ != NULL ? *spp_param_ : *default_instance_->spp_param_; +} +::ditcaffe::SPPParameter* LayerParameter::mutable_spp_param() { + set_has_spp_param(); + if (spp_param_ == NULL) { + spp_param_ = new ::ditcaffe::SPPParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.spp_param) + return spp_param_; +} +::ditcaffe::SPPParameter* LayerParameter::release_spp_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.spp_param) + clear_has_spp_param(); + ::ditcaffe::SPPParameter* temp = spp_param_; + spp_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_spp_param(::ditcaffe::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:ditcaffe.LayerParameter.spp_param) +} + +// optional .ditcaffe.SliceParameter slice_param = 126; +bool LayerParameter::has_slice_param() const { + return (_has_bits_[1] & 0x00100000u) != 0; +} +void LayerParameter::set_has_slice_param() { + _has_bits_[1] |= 0x00100000u; +} +void LayerParameter::clear_has_slice_param() { + _has_bits_[1] &= ~0x00100000u; +} +void LayerParameter::clear_slice_param() { + if (slice_param_ != NULL) slice_param_->::ditcaffe::SliceParameter::Clear(); + clear_has_slice_param(); +} +const ::ditcaffe::SliceParameter& LayerParameter::slice_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.slice_param) + return slice_param_ != NULL ? *slice_param_ : *default_instance_->slice_param_; +} +::ditcaffe::SliceParameter* LayerParameter::mutable_slice_param() { + set_has_slice_param(); + if (slice_param_ == NULL) { + slice_param_ = new ::ditcaffe::SliceParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.slice_param) + return slice_param_; +} +::ditcaffe::SliceParameter* LayerParameter::release_slice_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.slice_param) + clear_has_slice_param(); + ::ditcaffe::SliceParameter* temp = slice_param_; + slice_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_slice_param(::ditcaffe::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:ditcaffe.LayerParameter.slice_param) +} + +// optional .ditcaffe.TanHParameter tanh_param = 127; +bool LayerParameter::has_tanh_param() const { + return (_has_bits_[1] & 0x00200000u) != 0; +} +void LayerParameter::set_has_tanh_param() { + _has_bits_[1] |= 0x00200000u; +} +void LayerParameter::clear_has_tanh_param() { + _has_bits_[1] &= ~0x00200000u; +} +void LayerParameter::clear_tanh_param() { + if (tanh_param_ != NULL) tanh_param_->::ditcaffe::TanHParameter::Clear(); + clear_has_tanh_param(); +} +const ::ditcaffe::TanHParameter& LayerParameter::tanh_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.tanh_param) + return tanh_param_ != NULL ? *tanh_param_ : *default_instance_->tanh_param_; +} +::ditcaffe::TanHParameter* LayerParameter::mutable_tanh_param() { + set_has_tanh_param(); + if (tanh_param_ == NULL) { + tanh_param_ = new ::ditcaffe::TanHParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.tanh_param) + return tanh_param_; +} +::ditcaffe::TanHParameter* LayerParameter::release_tanh_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.tanh_param) + clear_has_tanh_param(); + ::ditcaffe::TanHParameter* temp = tanh_param_; + tanh_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_tanh_param(::ditcaffe::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:ditcaffe.LayerParameter.tanh_param) +} + +// optional .ditcaffe.ThresholdParameter threshold_param = 128; +bool LayerParameter::has_threshold_param() const { + return (_has_bits_[1] & 0x00400000u) != 0; +} +void LayerParameter::set_has_threshold_param() { + _has_bits_[1] |= 0x00400000u; +} +void LayerParameter::clear_has_threshold_param() { + _has_bits_[1] &= ~0x00400000u; +} +void LayerParameter::clear_threshold_param() { + if (threshold_param_ != NULL) threshold_param_->::ditcaffe::ThresholdParameter::Clear(); + clear_has_threshold_param(); +} +const ::ditcaffe::ThresholdParameter& LayerParameter::threshold_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.threshold_param) + return threshold_param_ != NULL ? *threshold_param_ : *default_instance_->threshold_param_; +} +::ditcaffe::ThresholdParameter* LayerParameter::mutable_threshold_param() { + set_has_threshold_param(); + if (threshold_param_ == NULL) { + threshold_param_ = new ::ditcaffe::ThresholdParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.threshold_param) + return threshold_param_; +} +::ditcaffe::ThresholdParameter* LayerParameter::release_threshold_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.threshold_param) + clear_has_threshold_param(); + ::ditcaffe::ThresholdParameter* temp = threshold_param_; + threshold_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_threshold_param(::ditcaffe::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:ditcaffe.LayerParameter.threshold_param) +} + +// optional .ditcaffe.TileParameter tile_param = 138; +bool LayerParameter::has_tile_param() const { + return (_has_bits_[1] & 0x00800000u) != 0; +} +void LayerParameter::set_has_tile_param() { + _has_bits_[1] |= 0x00800000u; +} +void LayerParameter::clear_has_tile_param() { + _has_bits_[1] &= ~0x00800000u; +} +void LayerParameter::clear_tile_param() { + if (tile_param_ != NULL) tile_param_->::ditcaffe::TileParameter::Clear(); + clear_has_tile_param(); +} +const ::ditcaffe::TileParameter& LayerParameter::tile_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.tile_param) + return tile_param_ != NULL ? *tile_param_ : *default_instance_->tile_param_; +} +::ditcaffe::TileParameter* LayerParameter::mutable_tile_param() { + set_has_tile_param(); + if (tile_param_ == NULL) { + tile_param_ = new ::ditcaffe::TileParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.tile_param) + return tile_param_; +} +::ditcaffe::TileParameter* LayerParameter::release_tile_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.tile_param) + clear_has_tile_param(); + ::ditcaffe::TileParameter* temp = tile_param_; + tile_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_tile_param(::ditcaffe::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:ditcaffe.LayerParameter.tile_param) +} + +// optional .ditcaffe.WindowDataParameter window_data_param = 129; +bool LayerParameter::has_window_data_param() const { + return (_has_bits_[1] & 0x01000000u) != 0; +} +void LayerParameter::set_has_window_data_param() { + _has_bits_[1] |= 0x01000000u; +} +void LayerParameter::clear_has_window_data_param() { + _has_bits_[1] &= ~0x01000000u; +} +void LayerParameter::clear_window_data_param() { + if (window_data_param_ != NULL) window_data_param_->::ditcaffe::WindowDataParameter::Clear(); + clear_has_window_data_param(); +} +const ::ditcaffe::WindowDataParameter& LayerParameter::window_data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.window_data_param) + return window_data_param_ != NULL ? *window_data_param_ : *default_instance_->window_data_param_; +} +::ditcaffe::WindowDataParameter* LayerParameter::mutable_window_data_param() { + set_has_window_data_param(); + if (window_data_param_ == NULL) { + window_data_param_ = new ::ditcaffe::WindowDataParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.window_data_param) + return window_data_param_; +} +::ditcaffe::WindowDataParameter* LayerParameter::release_window_data_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.window_data_param) + clear_has_window_data_param(); + ::ditcaffe::WindowDataParameter* temp = window_data_param_; + window_data_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_window_data_param(::ditcaffe::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:ditcaffe.LayerParameter.window_data_param) +} + +#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) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.TransformationParameter) +} + +void TransformationParameter::InitAsDefaultInstance() { +} + +TransformationParameter::TransformationParameter(const TransformationParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.TransformationParameter) +} + +void TransformationParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + scale_ = 1; + mirror_ = false; + crop_size_ = 0u; + mean_file_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + force_color_ = false; + force_gray_ = false; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +TransformationParameter::~TransformationParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.TransformationParameter) + SharedDtor(); +} + +void TransformationParameter::SharedDtor() { + mean_file_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +TransformationParameter* TransformationParameter::default_instance_ = NULL; + +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:ditcaffe.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_(mirror_, force_gray_); + scale_ = 1; + crop_size_ = 0u; + if (has_mean_file()) { + mean_file_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + } + +#undef ZR_HELPER_ +#undef ZR_ + + mean_value_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + 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:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &scale_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &mirror_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &crop_size_))); + set_has_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, + "ditcaffe.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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &force_color_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &force_gray_))); + set_has_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:ditcaffe.TransformationParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.TransformationParameter) + return false; +#undef DO_ +} + +void TransformationParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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, + "ditcaffe.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:ditcaffe.TransformationParameter) +} + +::google::protobuf::uint8* TransformationParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.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, + "ditcaffe.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:ditcaffe.TransformationParameter) + return target; +} + +int TransformationParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.TransformationParameter) + int 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; + { + int data_size = 0; + data_size = 4 * this->mean_value_size(); + total_size += 1 * this->mean_value_size() + data_size; + } + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void TransformationParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:ditcaffe.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:ditcaffe.TransformationParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:ditcaffe.TransformationParameter) + MergeFrom(*source); + } +} + +void TransformationParameter::MergeFrom(const TransformationParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.TransformationParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + mean_value_.MergeFrom(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()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void TransformationParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:ditcaffe.TransformationParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void TransformationParameter::CopyFrom(const TransformationParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.TransformationParameter) + if (&from == this) return; + Clear(); + MergeFrom(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:ditcaffe.TransformationParameter.scale) + return scale_; +} + void TransformationParameter::set_scale(float value) { + set_has_scale(); + scale_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.TransformationParameter.mirror) + return mirror_; +} + void TransformationParameter::set_mirror(bool value) { + set_has_mirror(); + mirror_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.TransformationParameter.mean_file) +} + ::std::string* TransformationParameter::mutable_mean_file() { + set_has_mean_file(); + // @@protoc_insertion_point(field_mutable:ditcaffe.TransformationParameter.mean_file) + return mean_file_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* TransformationParameter::release_mean_file() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.TransformationParameter.mean_value) +} + void TransformationParameter::add_mean_value(float value) { + mean_value_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.TransformationParameter.mean_value) +} + const ::google::protobuf::RepeatedField< float >& +TransformationParameter::mean_value() const { + // @@protoc_insertion_point(field_list:ditcaffe.TransformationParameter.mean_value) + return mean_value_; +} + ::google::protobuf::RepeatedField< float >* +TransformationParameter::mutable_mean_value() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.TransformationParameter.force_gray) +} + +#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) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.LossParameter) +} + +void LossParameter::InitAsDefaultInstance() { +} + +LossParameter::LossParameter(const LossParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.LossParameter) +} + +void LossParameter::SharedCtor() { + _cached_size_ = 0; + ignore_label_ = 0; + normalization_ = 1; + normalize_ = false; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +LossParameter::~LossParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.LossParameter) + SharedDtor(); +} + +void LossParameter::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +LossParameter* LossParameter::default_instance_ = NULL; + +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:ditcaffe.LossParameter) + if (_has_bits_[0 / 32] & 7u) { + ignore_label_ = 0; + normalization_ = 1; + normalize_ = false; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + 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:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &ignore_label_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &normalize_))); + set_has_normalize(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(24)) goto parse_normalization; + break; + } + + // optional .ditcaffe.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 (::ditcaffe::LossParameter_NormalizationMode_IsValid(value)) { + set_normalization(static_cast< ::ditcaffe::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:ditcaffe.LossParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.LossParameter) + return false; +#undef DO_ +} + +void LossParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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 .ditcaffe.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:ditcaffe.LossParameter) +} + +::google::protobuf::uint8* LossParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.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 .ditcaffe.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:ditcaffe.LossParameter) + return target; +} + +int LossParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.LossParameter) + int 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 .ditcaffe.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()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void LossParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:ditcaffe.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:ditcaffe.LossParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:ditcaffe.LossParameter) + MergeFrom(*source); + } +} + +void LossParameter::MergeFrom(const LossParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.LossParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void LossParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:ditcaffe.LossParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void LossParameter::CopyFrom(const LossParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.LossParameter) + if (&from == this) return; + Clear(); + MergeFrom(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:ditcaffe.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:ditcaffe.LossParameter.ignore_label) +} + +// optional .ditcaffe.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(); +} + ::ditcaffe::LossParameter_NormalizationMode LossParameter::normalization() const { + // @@protoc_insertion_point(field_get:ditcaffe.LossParameter.normalization) + return static_cast< ::ditcaffe::LossParameter_NormalizationMode >(normalization_); +} + void LossParameter::set_normalization(::ditcaffe::LossParameter_NormalizationMode value) { + assert(::ditcaffe::LossParameter_NormalizationMode_IsValid(value)); + set_has_normalization(); + normalization_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.LossParameter.normalize) + return normalize_; +} + void LossParameter::set_normalize(bool value) { + set_has_normalize(); + normalize_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.LossParameter.normalize) +} + +#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) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.AccuracyParameter) +} + +void AccuracyParameter::InitAsDefaultInstance() { +} + +AccuracyParameter::AccuracyParameter(const AccuracyParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.AccuracyParameter) +} + +void AccuracyParameter::SharedCtor() { + _cached_size_ = 0; + top_k_ = 1u; + axis_ = 1; + ignore_label_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +AccuracyParameter::~AccuracyParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.AccuracyParameter) + SharedDtor(); +} + +void AccuracyParameter::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +AccuracyParameter* AccuracyParameter::default_instance_ = NULL; + +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:ditcaffe.AccuracyParameter) + if (_has_bits_[0 / 32] & 7u) { + top_k_ = 1u; + axis_ = 1; + ignore_label_ = 0; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + 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:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &top_k_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &ignore_label_))); + set_has_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:ditcaffe.AccuracyParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.AccuracyParameter) + return false; +#undef DO_ +} + +void AccuracyParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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:ditcaffe.AccuracyParameter) +} + +::google::protobuf::uint8* AccuracyParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.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:ditcaffe.AccuracyParameter) + return target; +} + +int AccuracyParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.AccuracyParameter) + int 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()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void AccuracyParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:ditcaffe.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:ditcaffe.AccuracyParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:ditcaffe.AccuracyParameter) + MergeFrom(*source); + } +} + +void AccuracyParameter::MergeFrom(const AccuracyParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.AccuracyParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void AccuracyParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:ditcaffe.AccuracyParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void AccuracyParameter::CopyFrom(const AccuracyParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.AccuracyParameter) + if (&from == this) return; + Clear(); + MergeFrom(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:ditcaffe.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:ditcaffe.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:ditcaffe.AccuracyParameter.axis) + return axis_; +} + void AccuracyParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.AccuracyParameter.ignore_label) +} + +#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) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.ArgMaxParameter) +} + +void ArgMaxParameter::InitAsDefaultInstance() { +} + +ArgMaxParameter::ArgMaxParameter(const ArgMaxParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.ArgMaxParameter) +} + +void ArgMaxParameter::SharedCtor() { + _cached_size_ = 0; + out_max_val_ = false; + top_k_ = 1u; + axis_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ArgMaxParameter::~ArgMaxParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.ArgMaxParameter) + SharedDtor(); +} + +void ArgMaxParameter::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +ArgMaxParameter* ArgMaxParameter::default_instance_ = NULL; + +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:ditcaffe.ArgMaxParameter) + if (_has_bits_[0 / 32] & 7u) { + out_max_val_ = false; + top_k_ = 1u; + axis_ = 0; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + 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:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &out_max_val_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &top_k_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + set_has_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:ditcaffe.ArgMaxParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.ArgMaxParameter) + return false; +#undef DO_ +} + +void ArgMaxParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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:ditcaffe.ArgMaxParameter) +} + +::google::protobuf::uint8* ArgMaxParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.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:ditcaffe.ArgMaxParameter) + return target; +} + +int ArgMaxParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.ArgMaxParameter) + int 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()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ArgMaxParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:ditcaffe.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:ditcaffe.ArgMaxParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:ditcaffe.ArgMaxParameter) + MergeFrom(*source); + } +} + +void ArgMaxParameter::MergeFrom(const ArgMaxParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.ArgMaxParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void ArgMaxParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:ditcaffe.ArgMaxParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ArgMaxParameter::CopyFrom(const ArgMaxParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.ArgMaxParameter) + if (&from == this) return; + Clear(); + MergeFrom(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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.ArgMaxParameter.axis) + return axis_; +} + void ArgMaxParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.ArgMaxParameter.axis) +} + +#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) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.ConcatParameter) +} + +void ConcatParameter::InitAsDefaultInstance() { +} + +ConcatParameter::ConcatParameter(const ConcatParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.ConcatParameter) +} + +void ConcatParameter::SharedCtor() { + _cached_size_ = 0; + axis_ = 1; + concat_dim_ = 1u; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ConcatParameter::~ConcatParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.ConcatParameter) + SharedDtor(); +} + +void ConcatParameter::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +ConcatParameter* ConcatParameter::default_instance_ = NULL; + +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:ditcaffe.ConcatParameter) + if (_has_bits_[0 / 32] & 3u) { + axis_ = 1; + concat_dim_ = 1u; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + 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:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &concat_dim_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + set_has_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:ditcaffe.ConcatParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.ConcatParameter) + return false; +#undef DO_ +} + +void ConcatParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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:ditcaffe.ConcatParameter) +} + +::google::protobuf::uint8* ConcatParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.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:ditcaffe.ConcatParameter) + return target; +} + +int ConcatParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.ConcatParameter) + int 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()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ConcatParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:ditcaffe.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:ditcaffe.ConcatParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:ditcaffe.ConcatParameter) + MergeFrom(*source); + } +} + +void ConcatParameter::MergeFrom(const ConcatParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.ConcatParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void ConcatParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:ditcaffe.ConcatParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ConcatParameter::CopyFrom(const ConcatParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.ConcatParameter) + if (&from == this) return; + Clear(); + MergeFrom(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:ditcaffe.ConcatParameter.axis) + return axis_; +} + void ConcatParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.ConcatParameter.concat_dim) +} + +#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) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.BatchNormParameter) +} + +void BatchNormParameter::InitAsDefaultInstance() { +} + +BatchNormParameter::BatchNormParameter(const BatchNormParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.BatchNormParameter) +} + +void BatchNormParameter::SharedCtor() { + _cached_size_ = 0; + use_global_stats_ = false; + moving_average_fraction_ = 0.999f; + eps_ = 1e-05f; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +BatchNormParameter::~BatchNormParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.BatchNormParameter) + SharedDtor(); +} + +void BatchNormParameter::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +BatchNormParameter* BatchNormParameter::default_instance_ = NULL; + +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:ditcaffe.BatchNormParameter) + if (_has_bits_[0 / 32] & 7u) { + use_global_stats_ = false; + moving_average_fraction_ = 0.999f; + eps_ = 1e-05f; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + 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:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &use_global_stats_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &moving_average_fraction_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &eps_))); + set_has_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:ditcaffe.BatchNormParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.BatchNormParameter) + return false; +#undef DO_ +} + +void BatchNormParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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:ditcaffe.BatchNormParameter) +} + +::google::protobuf::uint8* BatchNormParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.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:ditcaffe.BatchNormParameter) + return target; +} + +int BatchNormParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.BatchNormParameter) + int 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()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void BatchNormParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:ditcaffe.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:ditcaffe.BatchNormParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:ditcaffe.BatchNormParameter) + MergeFrom(*source); + } +} + +void BatchNormParameter::MergeFrom(const BatchNormParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.BatchNormParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void BatchNormParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:ditcaffe.BatchNormParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void BatchNormParameter::CopyFrom(const BatchNormParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.BatchNormParameter) + if (&from == this) return; + Clear(); + MergeFrom(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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.BatchNormParameter.eps) + return eps_; +} + void BatchNormParameter::set_eps(float value) { + set_has_eps(); + eps_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.BatchNormParameter.eps) +} + +#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) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.BiasParameter) +} + +void BiasParameter::InitAsDefaultInstance() { + filler_ = const_cast< ::ditcaffe::FillerParameter*>(&::ditcaffe::FillerParameter::default_instance()); +} + +BiasParameter::BiasParameter(const BiasParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.BiasParameter) +} + +void BiasParameter::SharedCtor() { + _cached_size_ = 0; + axis_ = 1; + num_axes_ = 1; + filler_ = NULL; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +BiasParameter::~BiasParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.BiasParameter) + SharedDtor(); +} + +void BiasParameter::SharedDtor() { + if (this != default_instance_) { + 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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +BiasParameter* BiasParameter::default_instance_ = NULL; + +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:ditcaffe.BiasParameter) + if (_has_bits_[0 / 32] & 7u) { + axis_ = 1; + num_axes_ = 1; + if (has_filler()) { + if (filler_ != NULL) filler_->::ditcaffe::FillerParameter::Clear(); + } + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + 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:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &num_axes_))); + set_has_num_axes(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_filler; + break; + } + + // optional .ditcaffe.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:ditcaffe.BiasParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.BiasParameter) + return false; +#undef DO_ +} + +void BiasParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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 .ditcaffe.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:ditcaffe.BiasParameter) +} + +::google::protobuf::uint8* BiasParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.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 .ditcaffe.FillerParameter filler = 3; + if (has_filler()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 3, *this->filler_, target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.BiasParameter) + return target; +} + +int BiasParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.BiasParameter) + int 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 .ditcaffe.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()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void BiasParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:ditcaffe.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:ditcaffe.BiasParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:ditcaffe.BiasParameter) + MergeFrom(*source); + } +} + +void BiasParameter::MergeFrom(const BiasParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.BiasParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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()->::ditcaffe::FillerParameter::MergeFrom(from.filler()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void BiasParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:ditcaffe.BiasParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void BiasParameter::CopyFrom(const BiasParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.BiasParameter) + if (&from == this) return; + Clear(); + MergeFrom(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:ditcaffe.BiasParameter.axis) + return axis_; +} + void BiasParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.BiasParameter.num_axes) +} + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_filler(); +} +const ::ditcaffe::FillerParameter& BiasParameter::filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.BiasParameter.filler) + return filler_ != NULL ? *filler_ : *default_instance_->filler_; +} +::ditcaffe::FillerParameter* BiasParameter::mutable_filler() { + set_has_filler(); + if (filler_ == NULL) { + filler_ = new ::ditcaffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.BiasParameter.filler) + return filler_; +} +::ditcaffe::FillerParameter* BiasParameter::release_filler() { + // @@protoc_insertion_point(field_release:ditcaffe.BiasParameter.filler) + clear_has_filler(); + ::ditcaffe::FillerParameter* temp = filler_; + filler_ = NULL; + return temp; +} +void BiasParameter::set_allocated_filler(::ditcaffe::FillerParameter* filler) { + delete filler_; + filler_ = filler; + if (filler) { + set_has_filler(); + } else { + clear_has_filler(); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.BiasParameter.filler) +} + +#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) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.ContrastiveLossParameter) +} + +void ContrastiveLossParameter::InitAsDefaultInstance() { +} + +ContrastiveLossParameter::ContrastiveLossParameter(const ContrastiveLossParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.ContrastiveLossParameter) +} + +void ContrastiveLossParameter::SharedCtor() { + _cached_size_ = 0; + margin_ = 1; + legacy_version_ = false; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ContrastiveLossParameter::~ContrastiveLossParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.ContrastiveLossParameter) + SharedDtor(); +} + +void ContrastiveLossParameter::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +ContrastiveLossParameter* ContrastiveLossParameter::default_instance_ = NULL; + +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:ditcaffe.ContrastiveLossParameter) + if (_has_bits_[0 / 32] & 3u) { + margin_ = 1; + legacy_version_ = false; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + 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:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &margin_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &legacy_version_))); + set_has_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:ditcaffe.ContrastiveLossParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.ContrastiveLossParameter) + return false; +#undef DO_ +} + +void ContrastiveLossParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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:ditcaffe.ContrastiveLossParameter) +} + +::google::protobuf::uint8* ContrastiveLossParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.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:ditcaffe.ContrastiveLossParameter) + return target; +} + +int ContrastiveLossParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.ContrastiveLossParameter) + int 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()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ContrastiveLossParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:ditcaffe.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:ditcaffe.ContrastiveLossParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:ditcaffe.ContrastiveLossParameter) + MergeFrom(*source); + } +} + +void ContrastiveLossParameter::MergeFrom(const ContrastiveLossParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.ContrastiveLossParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void ContrastiveLossParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:ditcaffe.ContrastiveLossParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ContrastiveLossParameter::CopyFrom(const ContrastiveLossParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.ContrastiveLossParameter) + if (&from == this) return; + Clear(); + MergeFrom(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:ditcaffe.ContrastiveLossParameter.margin) + return margin_; +} + void ContrastiveLossParameter::set_margin(float value) { + set_has_margin(); + margin_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.ContrastiveLossParameter.legacy_version) +} + +#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) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.ConvolutionParameter) +} + +void ConvolutionParameter::InitAsDefaultInstance() { + weight_filler_ = const_cast< ::ditcaffe::FillerParameter*>(&::ditcaffe::FillerParameter::default_instance()); + bias_filler_ = const_cast< ::ditcaffe::FillerParameter*>(&::ditcaffe::FillerParameter::default_instance()); +} + +ConvolutionParameter::ConvolutionParameter(const ConvolutionParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.ConvolutionParameter) +} + +void ConvolutionParameter::SharedCtor() { + _cached_size_ = 0; + num_output_ = 0u; + bias_term_ = true; + pad_h_ = 0u; + pad_w_ = 0u; + kernel_h_ = 0u; + kernel_w_ = 0u; + stride_h_ = 0u; + stride_w_ = 0u; + group_ = 1u; + weight_filler_ = NULL; + bias_filler_ = NULL; + engine_ = 0; + axis_ = 1; + force_nd_im2col_ = false; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ConvolutionParameter::~ConvolutionParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.ConvolutionParameter) + SharedDtor(); +} + +void ConvolutionParameter::SharedDtor() { + if (this != default_instance_) { + 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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +ConvolutionParameter* ConvolutionParameter::default_instance_ = NULL; + +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:ditcaffe.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_h_); + bias_term_ = true; + pad_w_ = 0u; + } + if (_has_bits_[8 / 32] & 65280u) { + ZR_(kernel_h_, kernel_w_); + ZR_(stride_h_, stride_w_); + group_ = 1u; + if (has_weight_filler()) { + if (weight_filler_ != NULL) weight_filler_->::ditcaffe::FillerParameter::Clear(); + } + if (has_bias_filler()) { + if (bias_filler_ != NULL) bias_filler_->::ditcaffe::FillerParameter::Clear(); + } + engine_ = 0; + } + 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(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + 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:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &num_output_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &bias_term_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &group_))); + set_has_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 .ditcaffe.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 .ditcaffe.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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &pad_h_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &pad_w_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &kernel_h_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &kernel_w_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &stride_h_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &stride_w_))); + set_has_stride_w(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(120)) goto parse_engine; + break; + } + + // optional .ditcaffe.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 (::ditcaffe::ConvolutionParameter_Engine_IsValid(value)) { + set_engine(static_cast< ::ditcaffe::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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &force_nd_im2col_))); + set_has_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:ditcaffe.ConvolutionParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.ConvolutionParameter) + return false; +#undef DO_ +} + +void ConvolutionParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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 .ditcaffe.FillerParameter weight_filler = 7; + if (has_weight_filler()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 7, *this->weight_filler_, output); + } + + // optional .ditcaffe.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 .ditcaffe.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:ditcaffe.ConvolutionParameter) +} + +::google::protobuf::uint8* ConvolutionParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.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 .ditcaffe.FillerParameter weight_filler = 7; + if (has_weight_filler()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 7, *this->weight_filler_, target); + } + + // optional .ditcaffe.FillerParameter bias_filler = 8; + if (has_bias_filler()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 8, *this->bias_filler_, 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 .ditcaffe.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:ditcaffe.ConvolutionParameter) + return target; +} + +int ConvolutionParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.ConvolutionParameter) + int 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 .ditcaffe.FillerParameter weight_filler = 7; + if (has_weight_filler()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->weight_filler_); + } + + // optional .ditcaffe.FillerParameter bias_filler = 8; + if (has_bias_filler()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->bias_filler_); + } + + // optional .ditcaffe.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; + { + int data_size = 0; + for (int i = 0; i < this->pad_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->pad(i)); + } + total_size += 1 * this->pad_size() + data_size; + } + + // repeated uint32 kernel_size = 4; + { + int data_size = 0; + for (int i = 0; i < this->kernel_size_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->kernel_size(i)); + } + total_size += 1 * this->kernel_size_size() + data_size; + } + + // repeated uint32 stride = 6; + { + int data_size = 0; + for (int i = 0; i < this->stride_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->stride(i)); + } + total_size += 1 * this->stride_size() + data_size; + } + + // repeated uint32 dilation = 18; + { + int data_size = 0; + for (int i = 0; i < this->dilation_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->dilation(i)); + } + total_size += 2 * this->dilation_size() + data_size; + } + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ConvolutionParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:ditcaffe.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:ditcaffe.ConvolutionParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:ditcaffe.ConvolutionParameter) + MergeFrom(*source); + } +} + +void ConvolutionParameter::MergeFrom(const ConvolutionParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.ConvolutionParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + pad_.MergeFrom(from.pad_); + kernel_size_.MergeFrom(from.kernel_size_); + stride_.MergeFrom(from.stride_); + dilation_.MergeFrom(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()->::ditcaffe::FillerParameter::MergeFrom(from.weight_filler()); + } + if (from.has_bias_filler()) { + mutable_bias_filler()->::ditcaffe::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()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void ConvolutionParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:ditcaffe.ConvolutionParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ConvolutionParameter::CopyFrom(const ConvolutionParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.ConvolutionParameter) + if (&from == this) return; + Clear(); + MergeFrom(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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.ConvolutionParameter.pad) +} + void ConvolutionParameter::add_pad(::google::protobuf::uint32 value) { + pad_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.ConvolutionParameter.pad) +} + const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +ConvolutionParameter::pad() const { + // @@protoc_insertion_point(field_list:ditcaffe.ConvolutionParameter.pad) + return pad_; +} + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +ConvolutionParameter::mutable_pad() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.ConvolutionParameter.kernel_size) +} + void ConvolutionParameter::add_kernel_size(::google::protobuf::uint32 value) { + kernel_size_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.ConvolutionParameter.kernel_size) +} + const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +ConvolutionParameter::kernel_size() const { + // @@protoc_insertion_point(field_list:ditcaffe.ConvolutionParameter.kernel_size) + return kernel_size_; +} + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +ConvolutionParameter::mutable_kernel_size() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.ConvolutionParameter.stride) +} + void ConvolutionParameter::add_stride(::google::protobuf::uint32 value) { + stride_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.ConvolutionParameter.stride) +} + const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +ConvolutionParameter::stride() const { + // @@protoc_insertion_point(field_list:ditcaffe.ConvolutionParameter.stride) + return stride_; +} + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +ConvolutionParameter::mutable_stride() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.ConvolutionParameter.dilation) +} + void ConvolutionParameter::add_dilation(::google::protobuf::uint32 value) { + dilation_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.ConvolutionParameter.dilation) +} + const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +ConvolutionParameter::dilation() const { + // @@protoc_insertion_point(field_list:ditcaffe.ConvolutionParameter.dilation) + return dilation_; +} + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +ConvolutionParameter::mutable_dilation() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.ConvolutionParameter.group) + return group_; +} + void ConvolutionParameter::set_group(::google::protobuf::uint32 value) { + set_has_group(); + group_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.ConvolutionParameter.group) +} + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_weight_filler(); +} +const ::ditcaffe::FillerParameter& ConvolutionParameter::weight_filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.ConvolutionParameter.weight_filler) + return weight_filler_ != NULL ? *weight_filler_ : *default_instance_->weight_filler_; +} +::ditcaffe::FillerParameter* ConvolutionParameter::mutable_weight_filler() { + set_has_weight_filler(); + if (weight_filler_ == NULL) { + weight_filler_ = new ::ditcaffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.ConvolutionParameter.weight_filler) + return weight_filler_; +} +::ditcaffe::FillerParameter* ConvolutionParameter::release_weight_filler() { + // @@protoc_insertion_point(field_release:ditcaffe.ConvolutionParameter.weight_filler) + clear_has_weight_filler(); + ::ditcaffe::FillerParameter* temp = weight_filler_; + weight_filler_ = NULL; + return temp; +} +void ConvolutionParameter::set_allocated_weight_filler(::ditcaffe::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:ditcaffe.ConvolutionParameter.weight_filler) +} + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_bias_filler(); +} +const ::ditcaffe::FillerParameter& ConvolutionParameter::bias_filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.ConvolutionParameter.bias_filler) + return bias_filler_ != NULL ? *bias_filler_ : *default_instance_->bias_filler_; +} +::ditcaffe::FillerParameter* ConvolutionParameter::mutable_bias_filler() { + set_has_bias_filler(); + if (bias_filler_ == NULL) { + bias_filler_ = new ::ditcaffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.ConvolutionParameter.bias_filler) + return bias_filler_; +} +::ditcaffe::FillerParameter* ConvolutionParameter::release_bias_filler() { + // @@protoc_insertion_point(field_release:ditcaffe.ConvolutionParameter.bias_filler) + clear_has_bias_filler(); + ::ditcaffe::FillerParameter* temp = bias_filler_; + bias_filler_ = NULL; + return temp; +} +void ConvolutionParameter::set_allocated_bias_filler(::ditcaffe::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:ditcaffe.ConvolutionParameter.bias_filler) +} + +// optional .ditcaffe.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(); +} + ::ditcaffe::ConvolutionParameter_Engine ConvolutionParameter::engine() const { + // @@protoc_insertion_point(field_get:ditcaffe.ConvolutionParameter.engine) + return static_cast< ::ditcaffe::ConvolutionParameter_Engine >(engine_); +} + void ConvolutionParameter::set_engine(::ditcaffe::ConvolutionParameter_Engine value) { + assert(::ditcaffe::ConvolutionParameter_Engine_IsValid(value)); + set_has_engine(); + engine_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.ConvolutionParameter.axis) + return axis_; +} + void ConvolutionParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.ConvolutionParameter.force_nd_im2col) +} + +#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) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.CropParameter) +} + +void CropParameter::InitAsDefaultInstance() { +} + +CropParameter::CropParameter(const CropParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.CropParameter) +} + +void CropParameter::SharedCtor() { + _cached_size_ = 0; + axis_ = 2; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +CropParameter::~CropParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.CropParameter) + SharedDtor(); +} + +void CropParameter::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +CropParameter* CropParameter::default_instance_ = NULL; + +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:ditcaffe.CropParameter) + axis_ = 2; + offset_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + 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:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + set_has_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:ditcaffe.CropParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.CropParameter) + return false; +#undef DO_ +} + +void CropParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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:ditcaffe.CropParameter) +} + +::google::protobuf::uint8* CropParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.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:ditcaffe.CropParameter) + return target; +} + +int CropParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.CropParameter) + int 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; + { + int data_size = 0; + for (int i = 0; i < this->offset_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->offset(i)); + } + total_size += 1 * this->offset_size() + data_size; + } + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void CropParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:ditcaffe.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:ditcaffe.CropParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:ditcaffe.CropParameter) + MergeFrom(*source); + } +} + +void CropParameter::MergeFrom(const CropParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.CropParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + offset_.MergeFrom(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()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void CropParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:ditcaffe.CropParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void CropParameter::CopyFrom(const CropParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.CropParameter) + if (&from == this) return; + Clear(); + MergeFrom(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:ditcaffe.CropParameter.axis) + return axis_; +} + void CropParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.CropParameter.offset) +} + void CropParameter::add_offset(::google::protobuf::uint32 value) { + offset_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.CropParameter.offset) +} + const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +CropParameter::offset() const { + // @@protoc_insertion_point(field_list:ditcaffe.CropParameter.offset) + return offset_; +} + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +CropParameter::mutable_offset() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.CropParameter.offset) + return &offset_; +} + +#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) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.DataParameter) +} + +void DataParameter::InitAsDefaultInstance() { +} + +DataParameter::DataParameter(const DataParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.DataParameter) +} + +void DataParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + source_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + batch_size_ = 0u; + rand_skip_ = 0u; + backend_ = 0; + scale_ = 1; + mean_file_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + crop_size_ = 0u; + mirror_ = false; + force_encoded_color_ = false; + prefetch_ = 4u; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +DataParameter::~DataParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.DataParameter) + SharedDtor(); +} + +void DataParameter::SharedDtor() { + source_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + mean_file_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +DataParameter* DataParameter::default_instance_ = NULL; + +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:ditcaffe.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_, backend_); + ZR_(crop_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_ + + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + 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:ditcaffe.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, + "ditcaffe.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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &scale_))); + set_has_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, + "ditcaffe.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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &batch_size_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &crop_size_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &mirror_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &rand_skip_))); + set_has_rand_skip(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(64)) goto parse_backend; + break; + } + + // optional .ditcaffe.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 (::ditcaffe::DataParameter_DB_IsValid(value)) { + set_backend(static_cast< ::ditcaffe::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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &force_encoded_color_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &prefetch_))); + set_has_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:ditcaffe.DataParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.DataParameter) + return false; +#undef DO_ +} + +void DataParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.DataParameter) + // optional string source = 1; + if (has_source()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->source().data(), this->source().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "ditcaffe.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, + "ditcaffe.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 .ditcaffe.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:ditcaffe.DataParameter) +} + +::google::protobuf::uint8* DataParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.DataParameter) + // optional string source = 1; + if (has_source()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->source().data(), this->source().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "ditcaffe.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, + "ditcaffe.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 .ditcaffe.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:ditcaffe.DataParameter) + return target; +} + +int DataParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.DataParameter) + int 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 .ditcaffe.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()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void DataParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:ditcaffe.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:ditcaffe.DataParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:ditcaffe.DataParameter) + MergeFrom(*source); + } +} + +void DataParameter::MergeFrom(const DataParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.DataParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void DataParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:ditcaffe.DataParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void DataParameter::CopyFrom(const DataParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.DataParameter) + if (&from == this) return; + Clear(); + MergeFrom(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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.DataParameter.source) +} + ::std::string* DataParameter::mutable_source() { + set_has_source(); + // @@protoc_insertion_point(field_mutable:ditcaffe.DataParameter.source) + return source_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* DataParameter::release_source() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.DataParameter.rand_skip) +} + +// optional .ditcaffe.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(); +} + ::ditcaffe::DataParameter_DB DataParameter::backend() const { + // @@protoc_insertion_point(field_get:ditcaffe.DataParameter.backend) + return static_cast< ::ditcaffe::DataParameter_DB >(backend_); +} + void DataParameter::set_backend(::ditcaffe::DataParameter_DB value) { + assert(::ditcaffe::DataParameter_DB_IsValid(value)); + set_has_backend(); + backend_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.DataParameter.scale) + return scale_; +} + void DataParameter::set_scale(float value) { + set_has_scale(); + scale_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.DataParameter.mean_file) +} + ::std::string* DataParameter::mutable_mean_file() { + set_has_mean_file(); + // @@protoc_insertion_point(field_mutable:ditcaffe.DataParameter.mean_file) + return mean_file_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* DataParameter::release_mean_file() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.DataParameter.mirror) + return mirror_; +} + void DataParameter::set_mirror(bool value) { + set_has_mirror(); + mirror_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.DataParameter.prefetch) + return prefetch_; +} + void DataParameter::set_prefetch(::google::protobuf::uint32 value) { + set_has_prefetch(); + prefetch_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.DataParameter.prefetch) +} + +#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) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.DropoutParameter) +} + +void DropoutParameter::InitAsDefaultInstance() { +} + +DropoutParameter::DropoutParameter(const DropoutParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.DropoutParameter) +} + +void DropoutParameter::SharedCtor() { + _cached_size_ = 0; + dropout_ratio_ = 0.5f; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +DropoutParameter::~DropoutParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.DropoutParameter) + SharedDtor(); +} + +void DropoutParameter::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +DropoutParameter* DropoutParameter::default_instance_ = NULL; + +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:ditcaffe.DropoutParameter) + dropout_ratio_ = 0.5f; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + 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:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &dropout_ratio_))); + set_has_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:ditcaffe.DropoutParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.DropoutParameter) + return false; +#undef DO_ +} + +void DropoutParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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:ditcaffe.DropoutParameter) +} + +::google::protobuf::uint8* DropoutParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.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:ditcaffe.DropoutParameter) + return target; +} + +int DropoutParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.DropoutParameter) + int 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()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void DropoutParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:ditcaffe.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:ditcaffe.DropoutParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:ditcaffe.DropoutParameter) + MergeFrom(*source); + } +} + +void DropoutParameter::MergeFrom(const DropoutParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.DropoutParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void DropoutParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:ditcaffe.DropoutParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void DropoutParameter::CopyFrom(const DropoutParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.DropoutParameter) + if (&from == this) return; + Clear(); + MergeFrom(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:ditcaffe.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:ditcaffe.DropoutParameter.dropout_ratio) +} + +#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) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.DummyDataParameter) +} + +void DummyDataParameter::InitAsDefaultInstance() { +} + +DummyDataParameter::DummyDataParameter(const DummyDataParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.DummyDataParameter) +} + +void DummyDataParameter::SharedCtor() { + _cached_size_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +DummyDataParameter::~DummyDataParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.DummyDataParameter) + SharedDtor(); +} + +void DummyDataParameter::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +DummyDataParameter* DummyDataParameter::default_instance_ = NULL; + +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:ditcaffe.DummyDataParameter) + data_filler_.Clear(); + shape_.Clear(); + num_.Clear(); + channels_.Clear(); + height_.Clear(); + width_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + 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:ditcaffe.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 .ditcaffe.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 .ditcaffe.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:ditcaffe.DummyDataParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.DummyDataParameter) + return false; +#undef DO_ +} + +void DummyDataParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.DummyDataParameter) + // repeated .ditcaffe.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 .ditcaffe.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:ditcaffe.DummyDataParameter) +} + +::google::protobuf::uint8* DummyDataParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.DummyDataParameter) + // repeated .ditcaffe.FillerParameter data_filler = 1; + for (unsigned int i = 0, n = this->data_filler_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 1, this->data_filler(i), 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 .ditcaffe.BlobShape shape = 6; + for (unsigned int i = 0, n = this->shape_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 6, this->shape(i), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.DummyDataParameter) + return target; +} + +int DummyDataParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.DummyDataParameter) + int total_size = 0; + + // repeated .ditcaffe.FillerParameter data_filler = 1; + total_size += 1 * this->data_filler_size(); + for (int i = 0; i < this->data_filler_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->data_filler(i)); + } + + // repeated .ditcaffe.BlobShape shape = 6; + total_size += 1 * this->shape_size(); + for (int i = 0; i < this->shape_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->shape(i)); + } + + // repeated uint32 num = 2; + { + int data_size = 0; + for (int i = 0; i < this->num_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->num(i)); + } + total_size += 1 * this->num_size() + data_size; + } + + // repeated uint32 channels = 3; + { + int data_size = 0; + for (int i = 0; i < this->channels_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->channels(i)); + } + total_size += 1 * this->channels_size() + data_size; + } + + // repeated uint32 height = 4; + { + int data_size = 0; + for (int i = 0; i < this->height_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->height(i)); + } + total_size += 1 * this->height_size() + data_size; + } + + // repeated uint32 width = 5; + { + int data_size = 0; + for (int i = 0; i < this->width_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->width(i)); + } + total_size += 1 * this->width_size() + data_size; + } + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void DummyDataParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:ditcaffe.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:ditcaffe.DummyDataParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:ditcaffe.DummyDataParameter) + MergeFrom(*source); + } +} + +void DummyDataParameter::MergeFrom(const DummyDataParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.DummyDataParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + data_filler_.MergeFrom(from.data_filler_); + shape_.MergeFrom(from.shape_); + num_.MergeFrom(from.num_); + channels_.MergeFrom(from.channels_); + height_.MergeFrom(from.height_); + width_.MergeFrom(from.width_); + if (from._internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void DummyDataParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:ditcaffe.DummyDataParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void DummyDataParameter::CopyFrom(const DummyDataParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.DummyDataParameter) + if (&from == this) return; + Clear(); + MergeFrom(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 .ditcaffe.FillerParameter data_filler = 1; +int DummyDataParameter::data_filler_size() const { + return data_filler_.size(); +} +void DummyDataParameter::clear_data_filler() { + data_filler_.Clear(); +} +const ::ditcaffe::FillerParameter& DummyDataParameter::data_filler(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.DummyDataParameter.data_filler) + return data_filler_.Get(index); +} +::ditcaffe::FillerParameter* DummyDataParameter::mutable_data_filler(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.DummyDataParameter.data_filler) + return data_filler_.Mutable(index); +} +::ditcaffe::FillerParameter* DummyDataParameter::add_data_filler() { + // @@protoc_insertion_point(field_add:ditcaffe.DummyDataParameter.data_filler) + return data_filler_.Add(); +} +::google::protobuf::RepeatedPtrField< ::ditcaffe::FillerParameter >* +DummyDataParameter::mutable_data_filler() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.DummyDataParameter.data_filler) + return &data_filler_; +} +const ::google::protobuf::RepeatedPtrField< ::ditcaffe::FillerParameter >& +DummyDataParameter::data_filler() const { + // @@protoc_insertion_point(field_list:ditcaffe.DummyDataParameter.data_filler) + return data_filler_; +} + +// repeated .ditcaffe.BlobShape shape = 6; +int DummyDataParameter::shape_size() const { + return shape_.size(); +} +void DummyDataParameter::clear_shape() { + shape_.Clear(); +} +const ::ditcaffe::BlobShape& DummyDataParameter::shape(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.DummyDataParameter.shape) + return shape_.Get(index); +} +::ditcaffe::BlobShape* DummyDataParameter::mutable_shape(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.DummyDataParameter.shape) + return shape_.Mutable(index); +} +::ditcaffe::BlobShape* DummyDataParameter::add_shape() { + // @@protoc_insertion_point(field_add:ditcaffe.DummyDataParameter.shape) + return shape_.Add(); +} +::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobShape >* +DummyDataParameter::mutable_shape() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.DummyDataParameter.shape) + return &shape_; +} +const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobShape >& +DummyDataParameter::shape() const { + // @@protoc_insertion_point(field_list:ditcaffe.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:ditcaffe.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:ditcaffe.DummyDataParameter.num) +} + void DummyDataParameter::add_num(::google::protobuf::uint32 value) { + num_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.DummyDataParameter.num) +} + const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +DummyDataParameter::num() const { + // @@protoc_insertion_point(field_list:ditcaffe.DummyDataParameter.num) + return num_; +} + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +DummyDataParameter::mutable_num() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.DummyDataParameter.channels) +} + void DummyDataParameter::add_channels(::google::protobuf::uint32 value) { + channels_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.DummyDataParameter.channels) +} + const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +DummyDataParameter::channels() const { + // @@protoc_insertion_point(field_list:ditcaffe.DummyDataParameter.channels) + return channels_; +} + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +DummyDataParameter::mutable_channels() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.DummyDataParameter.height) +} + void DummyDataParameter::add_height(::google::protobuf::uint32 value) { + height_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.DummyDataParameter.height) +} + const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +DummyDataParameter::height() const { + // @@protoc_insertion_point(field_list:ditcaffe.DummyDataParameter.height) + return height_; +} + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +DummyDataParameter::mutable_height() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.DummyDataParameter.width) +} + void DummyDataParameter::add_width(::google::protobuf::uint32 value) { + width_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.DummyDataParameter.width) +} + const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +DummyDataParameter::width() const { + // @@protoc_insertion_point(field_list:ditcaffe.DummyDataParameter.width) + return width_; +} + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +DummyDataParameter::mutable_width() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.DummyDataParameter.width) + return &width_; +} + +#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) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.EltwiseParameter) +} + +void EltwiseParameter::InitAsDefaultInstance() { +} + +EltwiseParameter::EltwiseParameter(const EltwiseParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.EltwiseParameter) +} + +void EltwiseParameter::SharedCtor() { + _cached_size_ = 0; + operation_ = 1; + stable_prod_grad_ = true; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +EltwiseParameter::~EltwiseParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.EltwiseParameter) + SharedDtor(); +} + +void EltwiseParameter::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +EltwiseParameter* EltwiseParameter::default_instance_ = NULL; + +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:ditcaffe.EltwiseParameter) + if (_has_bits_[0 / 32] & 5u) { + operation_ = 1; + stable_prod_grad_ = true; + } + coeff_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + 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:ditcaffe.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 .ditcaffe.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 (::ditcaffe::EltwiseParameter_EltwiseOp_IsValid(value)) { + set_operation(static_cast< ::ditcaffe::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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &stable_prod_grad_))); + set_has_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:ditcaffe.EltwiseParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.EltwiseParameter) + return false; +#undef DO_ +} + +void EltwiseParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.EltwiseParameter) + // optional .ditcaffe.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:ditcaffe.EltwiseParameter) +} + +::google::protobuf::uint8* EltwiseParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.EltwiseParameter) + // optional .ditcaffe.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:ditcaffe.EltwiseParameter) + return target; +} + +int EltwiseParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.EltwiseParameter) + int total_size = 0; + + if (_has_bits_[0 / 32] & 5u) { + // optional .ditcaffe.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; + { + int data_size = 0; + data_size = 4 * this->coeff_size(); + total_size += 1 * this->coeff_size() + data_size; + } + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void EltwiseParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:ditcaffe.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:ditcaffe.EltwiseParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:ditcaffe.EltwiseParameter) + MergeFrom(*source); + } +} + +void EltwiseParameter::MergeFrom(const EltwiseParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.EltwiseParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + coeff_.MergeFrom(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()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void EltwiseParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:ditcaffe.EltwiseParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void EltwiseParameter::CopyFrom(const EltwiseParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.EltwiseParameter) + if (&from == this) return; + Clear(); + MergeFrom(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 .ditcaffe.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(); +} + ::ditcaffe::EltwiseParameter_EltwiseOp EltwiseParameter::operation() const { + // @@protoc_insertion_point(field_get:ditcaffe.EltwiseParameter.operation) + return static_cast< ::ditcaffe::EltwiseParameter_EltwiseOp >(operation_); +} + void EltwiseParameter::set_operation(::ditcaffe::EltwiseParameter_EltwiseOp value) { + assert(::ditcaffe::EltwiseParameter_EltwiseOp_IsValid(value)); + set_has_operation(); + operation_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.EltwiseParameter.coeff) + return coeff_.Get(index); +} + void EltwiseParameter::set_coeff(int index, float value) { + coeff_.Set(index, value); + // @@protoc_insertion_point(field_set:ditcaffe.EltwiseParameter.coeff) +} + void EltwiseParameter::add_coeff(float value) { + coeff_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.EltwiseParameter.coeff) +} + const ::google::protobuf::RepeatedField< float >& +EltwiseParameter::coeff() const { + // @@protoc_insertion_point(field_list:ditcaffe.EltwiseParameter.coeff) + return coeff_; +} + ::google::protobuf::RepeatedField< float >* +EltwiseParameter::mutable_coeff() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.EltwiseParameter.stable_prod_grad) +} + +#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) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.ELUParameter) +} + +void ELUParameter::InitAsDefaultInstance() { +} + +ELUParameter::ELUParameter(const ELUParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.ELUParameter) +} + +void ELUParameter::SharedCtor() { + _cached_size_ = 0; + alpha_ = 1; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ELUParameter::~ELUParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.ELUParameter) + SharedDtor(); +} + +void ELUParameter::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +ELUParameter* ELUParameter::default_instance_ = NULL; + +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:ditcaffe.ELUParameter) + alpha_ = 1; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + 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:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &alpha_))); + set_has_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:ditcaffe.ELUParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.ELUParameter) + return false; +#undef DO_ +} + +void ELUParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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:ditcaffe.ELUParameter) +} + +::google::protobuf::uint8* ELUParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.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:ditcaffe.ELUParameter) + return target; +} + +int ELUParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.ELUParameter) + int 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()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ELUParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:ditcaffe.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:ditcaffe.ELUParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:ditcaffe.ELUParameter) + MergeFrom(*source); + } +} + +void ELUParameter::MergeFrom(const ELUParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.ELUParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_alpha()) { + set_alpha(from.alpha()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void ELUParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:ditcaffe.ELUParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ELUParameter::CopyFrom(const ELUParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.ELUParameter) + if (&from == this) return; + Clear(); + MergeFrom(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:ditcaffe.ELUParameter.alpha) + return alpha_; +} + void ELUParameter::set_alpha(float value) { + set_has_alpha(); + alpha_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.ELUParameter.alpha) +} + +#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) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.EmbedParameter) +} + +void EmbedParameter::InitAsDefaultInstance() { + weight_filler_ = const_cast< ::ditcaffe::FillerParameter*>(&::ditcaffe::FillerParameter::default_instance()); + bias_filler_ = const_cast< ::ditcaffe::FillerParameter*>(&::ditcaffe::FillerParameter::default_instance()); +} + +EmbedParameter::EmbedParameter(const EmbedParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.EmbedParameter) +} + +void EmbedParameter::SharedCtor() { + _cached_size_ = 0; + num_output_ = 0u; + input_dim_ = 0u; + bias_term_ = true; + weight_filler_ = NULL; + bias_filler_ = NULL; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +EmbedParameter::~EmbedParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.EmbedParameter) + SharedDtor(); +} + +void EmbedParameter::SharedDtor() { + if (this != default_instance_) { + 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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +EmbedParameter* EmbedParameter::default_instance_ = NULL; + +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:ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + } + if (has_bias_filler()) { + if (bias_filler_ != NULL) bias_filler_->::ditcaffe::FillerParameter::Clear(); + } + } + +#undef ZR_HELPER_ +#undef ZR_ + + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + 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:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &num_output_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &input_dim_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &bias_term_))); + set_has_bias_term(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(34)) goto parse_weight_filler; + break; + } + + // optional .ditcaffe.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 .ditcaffe.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:ditcaffe.EmbedParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.EmbedParameter) + return false; +#undef DO_ +} + +void EmbedParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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 .ditcaffe.FillerParameter weight_filler = 4; + if (has_weight_filler()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, *this->weight_filler_, output); + } + + // optional .ditcaffe.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:ditcaffe.EmbedParameter) +} + +::google::protobuf::uint8* EmbedParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.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 .ditcaffe.FillerParameter weight_filler = 4; + if (has_weight_filler()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 4, *this->weight_filler_, target); + } + + // optional .ditcaffe.FillerParameter bias_filler = 5; + if (has_bias_filler()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 5, *this->bias_filler_, target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.EmbedParameter) + return target; +} + +int EmbedParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.EmbedParameter) + int 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 .ditcaffe.FillerParameter weight_filler = 4; + if (has_weight_filler()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->weight_filler_); + } + + // optional .ditcaffe.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()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void EmbedParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:ditcaffe.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:ditcaffe.EmbedParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:ditcaffe.EmbedParameter) + MergeFrom(*source); + } +} + +void EmbedParameter::MergeFrom(const EmbedParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.EmbedParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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()->::ditcaffe::FillerParameter::MergeFrom(from.weight_filler()); + } + if (from.has_bias_filler()) { + mutable_bias_filler()->::ditcaffe::FillerParameter::MergeFrom(from.bias_filler()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void EmbedParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:ditcaffe.EmbedParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void EmbedParameter::CopyFrom(const EmbedParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.EmbedParameter) + if (&from == this) return; + Clear(); + MergeFrom(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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.EmbedParameter.bias_term) +} + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_weight_filler(); +} +const ::ditcaffe::FillerParameter& EmbedParameter::weight_filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.EmbedParameter.weight_filler) + return weight_filler_ != NULL ? *weight_filler_ : *default_instance_->weight_filler_; +} +::ditcaffe::FillerParameter* EmbedParameter::mutable_weight_filler() { + set_has_weight_filler(); + if (weight_filler_ == NULL) { + weight_filler_ = new ::ditcaffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.EmbedParameter.weight_filler) + return weight_filler_; +} +::ditcaffe::FillerParameter* EmbedParameter::release_weight_filler() { + // @@protoc_insertion_point(field_release:ditcaffe.EmbedParameter.weight_filler) + clear_has_weight_filler(); + ::ditcaffe::FillerParameter* temp = weight_filler_; + weight_filler_ = NULL; + return temp; +} +void EmbedParameter::set_allocated_weight_filler(::ditcaffe::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:ditcaffe.EmbedParameter.weight_filler) +} + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_bias_filler(); +} +const ::ditcaffe::FillerParameter& EmbedParameter::bias_filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.EmbedParameter.bias_filler) + return bias_filler_ != NULL ? *bias_filler_ : *default_instance_->bias_filler_; +} +::ditcaffe::FillerParameter* EmbedParameter::mutable_bias_filler() { + set_has_bias_filler(); + if (bias_filler_ == NULL) { + bias_filler_ = new ::ditcaffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.EmbedParameter.bias_filler) + return bias_filler_; +} +::ditcaffe::FillerParameter* EmbedParameter::release_bias_filler() { + // @@protoc_insertion_point(field_release:ditcaffe.EmbedParameter.bias_filler) + clear_has_bias_filler(); + ::ditcaffe::FillerParameter* temp = bias_filler_; + bias_filler_ = NULL; + return temp; +} +void EmbedParameter::set_allocated_bias_filler(::ditcaffe::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:ditcaffe.EmbedParameter.bias_filler) +} + +#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) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.ExpParameter) +} + +void ExpParameter::InitAsDefaultInstance() { +} + +ExpParameter::ExpParameter(const ExpParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.ExpParameter) +} + +void ExpParameter::SharedCtor() { + _cached_size_ = 0; + base_ = -1; + scale_ = 1; + shift_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ExpParameter::~ExpParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.ExpParameter) + SharedDtor(); +} + +void ExpParameter::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +ExpParameter* ExpParameter::default_instance_ = NULL; + +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:ditcaffe.ExpParameter) + if (_has_bits_[0 / 32] & 7u) { + base_ = -1; + scale_ = 1; + shift_ = 0; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + 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:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &base_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &scale_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &shift_))); + set_has_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:ditcaffe.ExpParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.ExpParameter) + return false; +#undef DO_ +} + +void ExpParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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:ditcaffe.ExpParameter) +} + +::google::protobuf::uint8* ExpParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.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:ditcaffe.ExpParameter) + return target; +} + +int ExpParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.ExpParameter) + int 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()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ExpParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:ditcaffe.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:ditcaffe.ExpParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:ditcaffe.ExpParameter) + MergeFrom(*source); + } +} + +void ExpParameter::MergeFrom(const ExpParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.ExpParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void ExpParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:ditcaffe.ExpParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ExpParameter::CopyFrom(const ExpParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.ExpParameter) + if (&from == this) return; + Clear(); + MergeFrom(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:ditcaffe.ExpParameter.base) + return base_; +} + void ExpParameter::set_base(float value) { + set_has_base(); + base_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.ExpParameter.scale) + return scale_; +} + void ExpParameter::set_scale(float value) { + set_has_scale(); + scale_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.ExpParameter.shift) + return shift_; +} + void ExpParameter::set_shift(float value) { + set_has_shift(); + shift_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.ExpParameter.shift) +} + +#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) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.FlattenParameter) +} + +void FlattenParameter::InitAsDefaultInstance() { +} + +FlattenParameter::FlattenParameter(const FlattenParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.FlattenParameter) +} + +void FlattenParameter::SharedCtor() { + _cached_size_ = 0; + axis_ = 1; + end_axis_ = -1; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +FlattenParameter::~FlattenParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.FlattenParameter) + SharedDtor(); +} + +void FlattenParameter::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +FlattenParameter* FlattenParameter::default_instance_ = NULL; + +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:ditcaffe.FlattenParameter) + if (_has_bits_[0 / 32] & 3u) { + axis_ = 1; + end_axis_ = -1; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + 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:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &end_axis_))); + set_has_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:ditcaffe.FlattenParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.FlattenParameter) + return false; +#undef DO_ +} + +void FlattenParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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:ditcaffe.FlattenParameter) +} + +::google::protobuf::uint8* FlattenParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.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:ditcaffe.FlattenParameter) + return target; +} + +int FlattenParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.FlattenParameter) + int 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()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void FlattenParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:ditcaffe.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:ditcaffe.FlattenParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:ditcaffe.FlattenParameter) + MergeFrom(*source); + } +} + +void FlattenParameter::MergeFrom(const FlattenParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.FlattenParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void FlattenParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:ditcaffe.FlattenParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void FlattenParameter::CopyFrom(const FlattenParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.FlattenParameter) + if (&from == this) return; + Clear(); + MergeFrom(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:ditcaffe.FlattenParameter.axis) + return axis_; +} + void FlattenParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.FlattenParameter.end_axis) +} + +#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) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.HDF5DataParameter) +} + +void HDF5DataParameter::InitAsDefaultInstance() { +} + +HDF5DataParameter::HDF5DataParameter(const HDF5DataParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.HDF5DataParameter) +} + +void HDF5DataParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + source_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + batch_size_ = 0u; + shuffle_ = false; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +HDF5DataParameter::~HDF5DataParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.HDF5DataParameter) + SharedDtor(); +} + +void HDF5DataParameter::SharedDtor() { + source_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +HDF5DataParameter* HDF5DataParameter::default_instance_ = NULL; + +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:ditcaffe.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_ + + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + 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:ditcaffe.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, + "ditcaffe.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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &batch_size_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &shuffle_))); + set_has_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:ditcaffe.HDF5DataParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.HDF5DataParameter) + return false; +#undef DO_ +} + +void HDF5DataParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.HDF5DataParameter) + // optional string source = 1; + if (has_source()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->source().data(), this->source().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "ditcaffe.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:ditcaffe.HDF5DataParameter) +} + +::google::protobuf::uint8* HDF5DataParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.HDF5DataParameter) + // optional string source = 1; + if (has_source()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->source().data(), this->source().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "ditcaffe.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:ditcaffe.HDF5DataParameter) + return target; +} + +int HDF5DataParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.HDF5DataParameter) + int 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()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void HDF5DataParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:ditcaffe.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:ditcaffe.HDF5DataParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:ditcaffe.HDF5DataParameter) + MergeFrom(*source); + } +} + +void HDF5DataParameter::MergeFrom(const HDF5DataParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.HDF5DataParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void HDF5DataParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:ditcaffe.HDF5DataParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void HDF5DataParameter::CopyFrom(const HDF5DataParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.HDF5DataParameter) + if (&from == this) return; + Clear(); + MergeFrom(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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.HDF5DataParameter.source) +} + ::std::string* HDF5DataParameter::mutable_source() { + set_has_source(); + // @@protoc_insertion_point(field_mutable:ditcaffe.HDF5DataParameter.source) + return source_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* HDF5DataParameter::release_source() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.HDF5DataParameter.shuffle) + return shuffle_; +} + void HDF5DataParameter::set_shuffle(bool value) { + set_has_shuffle(); + shuffle_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.HDF5DataParameter.shuffle) +} + +#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) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.HDF5OutputParameter) +} + +void HDF5OutputParameter::InitAsDefaultInstance() { +} + +HDF5OutputParameter::HDF5OutputParameter(const HDF5OutputParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.HDF5OutputParameter) +} + +void HDF5OutputParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + file_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +HDF5OutputParameter::~HDF5OutputParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.HDF5OutputParameter) + SharedDtor(); +} + +void HDF5OutputParameter::SharedDtor() { + file_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +HDF5OutputParameter* HDF5OutputParameter::default_instance_ = NULL; + +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:ditcaffe.HDF5OutputParameter) + if (has_file_name()) { + file_name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + 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:ditcaffe.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, + "ditcaffe.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:ditcaffe.HDF5OutputParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.HDF5OutputParameter) + return false; +#undef DO_ +} + +void HDF5OutputParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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, + "ditcaffe.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:ditcaffe.HDF5OutputParameter) +} + +::google::protobuf::uint8* HDF5OutputParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.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, + "ditcaffe.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:ditcaffe.HDF5OutputParameter) + return target; +} + +int HDF5OutputParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.HDF5OutputParameter) + int 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()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void HDF5OutputParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:ditcaffe.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:ditcaffe.HDF5OutputParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:ditcaffe.HDF5OutputParameter) + MergeFrom(*source); + } +} + +void HDF5OutputParameter::MergeFrom(const HDF5OutputParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.HDF5OutputParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void HDF5OutputParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:ditcaffe.HDF5OutputParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void HDF5OutputParameter::CopyFrom(const HDF5OutputParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.HDF5OutputParameter) + if (&from == this) return; + Clear(); + MergeFrom(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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.HDF5OutputParameter.file_name) +} + ::std::string* HDF5OutputParameter::mutable_file_name() { + set_has_file_name(); + // @@protoc_insertion_point(field_mutable:ditcaffe.HDF5OutputParameter.file_name) + return file_name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* HDF5OutputParameter::release_file_name() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.HDF5OutputParameter.file_name) +} + +#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) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.HingeLossParameter) +} + +void HingeLossParameter::InitAsDefaultInstance() { +} + +HingeLossParameter::HingeLossParameter(const HingeLossParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.HingeLossParameter) +} + +void HingeLossParameter::SharedCtor() { + _cached_size_ = 0; + norm_ = 1; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +HingeLossParameter::~HingeLossParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.HingeLossParameter) + SharedDtor(); +} + +void HingeLossParameter::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +HingeLossParameter* HingeLossParameter::default_instance_ = NULL; + +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:ditcaffe.HingeLossParameter) + norm_ = 1; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + 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:ditcaffe.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 .ditcaffe.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 (::ditcaffe::HingeLossParameter_Norm_IsValid(value)) { + set_norm(static_cast< ::ditcaffe::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:ditcaffe.HingeLossParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.HingeLossParameter) + return false; +#undef DO_ +} + +void HingeLossParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.HingeLossParameter) + // optional .ditcaffe.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:ditcaffe.HingeLossParameter) +} + +::google::protobuf::uint8* HingeLossParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.HingeLossParameter) + // optional .ditcaffe.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:ditcaffe.HingeLossParameter) + return target; +} + +int HingeLossParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.HingeLossParameter) + int total_size = 0; + + // optional .ditcaffe.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()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void HingeLossParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:ditcaffe.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:ditcaffe.HingeLossParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:ditcaffe.HingeLossParameter) + MergeFrom(*source); + } +} + +void HingeLossParameter::MergeFrom(const HingeLossParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.HingeLossParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_norm()) { + set_norm(from.norm()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void HingeLossParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:ditcaffe.HingeLossParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void HingeLossParameter::CopyFrom(const HingeLossParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.HingeLossParameter) + if (&from == this) return; + Clear(); + MergeFrom(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 .ditcaffe.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(); +} + ::ditcaffe::HingeLossParameter_Norm HingeLossParameter::norm() const { + // @@protoc_insertion_point(field_get:ditcaffe.HingeLossParameter.norm) + return static_cast< ::ditcaffe::HingeLossParameter_Norm >(norm_); +} + void HingeLossParameter::set_norm(::ditcaffe::HingeLossParameter_Norm value) { + assert(::ditcaffe::HingeLossParameter_Norm_IsValid(value)); + set_has_norm(); + norm_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.HingeLossParameter.norm) +} + +#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) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.ImageDataParameter) +} + +void ImageDataParameter::InitAsDefaultInstance() { +} + +ImageDataParameter::ImageDataParameter(const ImageDataParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.ImageDataParameter) +} + +void ImageDataParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + source_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + batch_size_ = 1u; + rand_skip_ = 0u; + shuffle_ = false; + new_height_ = 0u; + new_width_ = 0u; + is_color_ = true; + scale_ = 1; + mean_file_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + crop_size_ = 0u; + mirror_ = false; + root_folder_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ImageDataParameter::~ImageDataParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.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()); + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +ImageDataParameter* ImageDataParameter::default_instance_ = NULL; + +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:ditcaffe.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) { + if (has_mean_file()) { + mean_file_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + crop_size_ = 0u; + mirror_ = false; + if (has_root_folder()) { + root_folder_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + } + +#undef ZR_HELPER_ +#undef ZR_ + + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + 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:ditcaffe.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, + "ditcaffe.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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &scale_))); + set_has_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, + "ditcaffe.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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &batch_size_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &crop_size_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &mirror_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &rand_skip_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &shuffle_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &new_height_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &new_width_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &is_color_))); + set_has_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, + "ditcaffe.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:ditcaffe.ImageDataParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.ImageDataParameter) + return false; +#undef DO_ +} + +void ImageDataParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.ImageDataParameter) + // optional string source = 1; + if (has_source()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->source().data(), this->source().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "ditcaffe.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, + "ditcaffe.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, + "ditcaffe.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:ditcaffe.ImageDataParameter) +} + +::google::protobuf::uint8* ImageDataParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.ImageDataParameter) + // optional string source = 1; + if (has_source()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->source().data(), this->source().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "ditcaffe.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, + "ditcaffe.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, + "ditcaffe.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:ditcaffe.ImageDataParameter) + return target; +} + +int ImageDataParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.ImageDataParameter) + int 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()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ImageDataParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:ditcaffe.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:ditcaffe.ImageDataParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:ditcaffe.ImageDataParameter) + MergeFrom(*source); + } +} + +void ImageDataParameter::MergeFrom(const ImageDataParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.ImageDataParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void ImageDataParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:ditcaffe.ImageDataParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ImageDataParameter::CopyFrom(const ImageDataParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.ImageDataParameter) + if (&from == this) return; + Clear(); + MergeFrom(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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.ImageDataParameter.source) +} + ::std::string* ImageDataParameter::mutable_source() { + set_has_source(); + // @@protoc_insertion_point(field_mutable:ditcaffe.ImageDataParameter.source) + return source_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* ImageDataParameter::release_source() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.ImageDataParameter.shuffle) + return shuffle_; +} + void ImageDataParameter::set_shuffle(bool value) { + set_has_shuffle(); + shuffle_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.ImageDataParameter.scale) + return scale_; +} + void ImageDataParameter::set_scale(float value) { + set_has_scale(); + scale_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.ImageDataParameter.mean_file) +} + ::std::string* ImageDataParameter::mutable_mean_file() { + set_has_mean_file(); + // @@protoc_insertion_point(field_mutable:ditcaffe.ImageDataParameter.mean_file) + return mean_file_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* ImageDataParameter::release_mean_file() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.ImageDataParameter.mirror) + return mirror_; +} + void ImageDataParameter::set_mirror(bool value) { + set_has_mirror(); + mirror_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.ImageDataParameter.root_folder) +} + ::std::string* ImageDataParameter::mutable_root_folder() { + set_has_root_folder(); + // @@protoc_insertion_point(field_mutable:ditcaffe.ImageDataParameter.root_folder) + return root_folder_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* ImageDataParameter::release_root_folder() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.ImageDataParameter.root_folder) +} + +#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) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.InfogainLossParameter) +} + +void InfogainLossParameter::InitAsDefaultInstance() { +} + +InfogainLossParameter::InfogainLossParameter(const InfogainLossParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.InfogainLossParameter) +} + +void InfogainLossParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + source_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +InfogainLossParameter::~InfogainLossParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.InfogainLossParameter) + SharedDtor(); +} + +void InfogainLossParameter::SharedDtor() { + source_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +InfogainLossParameter* InfogainLossParameter::default_instance_ = NULL; + +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:ditcaffe.InfogainLossParameter) + if (has_source()) { + source_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + 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:ditcaffe.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, + "ditcaffe.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:ditcaffe.InfogainLossParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.InfogainLossParameter) + return false; +#undef DO_ +} + +void InfogainLossParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.InfogainLossParameter) + // optional string source = 1; + if (has_source()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->source().data(), this->source().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "ditcaffe.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:ditcaffe.InfogainLossParameter) +} + +::google::protobuf::uint8* InfogainLossParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.InfogainLossParameter) + // optional string source = 1; + if (has_source()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->source().data(), this->source().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "ditcaffe.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:ditcaffe.InfogainLossParameter) + return target; +} + +int InfogainLossParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.InfogainLossParameter) + int 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()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void InfogainLossParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:ditcaffe.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:ditcaffe.InfogainLossParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:ditcaffe.InfogainLossParameter) + MergeFrom(*source); + } +} + +void InfogainLossParameter::MergeFrom(const InfogainLossParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.InfogainLossParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void InfogainLossParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:ditcaffe.InfogainLossParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void InfogainLossParameter::CopyFrom(const InfogainLossParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.InfogainLossParameter) + if (&from == this) return; + Clear(); + MergeFrom(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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.InfogainLossParameter.source) +} + ::std::string* InfogainLossParameter::mutable_source() { + set_has_source(); + // @@protoc_insertion_point(field_mutable:ditcaffe.InfogainLossParameter.source) + return source_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* InfogainLossParameter::release_source() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.InfogainLossParameter.source) +} + +#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) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.InnerProductParameter) +} + +void InnerProductParameter::InitAsDefaultInstance() { + weight_filler_ = const_cast< ::ditcaffe::FillerParameter*>(&::ditcaffe::FillerParameter::default_instance()); + bias_filler_ = const_cast< ::ditcaffe::FillerParameter*>(&::ditcaffe::FillerParameter::default_instance()); +} + +InnerProductParameter::InnerProductParameter(const InnerProductParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.InnerProductParameter) +} + +void InnerProductParameter::SharedCtor() { + _cached_size_ = 0; + num_output_ = 0u; + bias_term_ = true; + weight_filler_ = NULL; + bias_filler_ = NULL; + axis_ = 1; + transpose_ = false; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +InnerProductParameter::~InnerProductParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.InnerProductParameter) + SharedDtor(); +} + +void InnerProductParameter::SharedDtor() { + if (this != default_instance_) { + 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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +InnerProductParameter* InnerProductParameter::default_instance_ = NULL; + +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:ditcaffe.InnerProductParameter) + if (_has_bits_[0 / 32] & 63u) { + num_output_ = 0u; + bias_term_ = true; + if (has_weight_filler()) { + if (weight_filler_ != NULL) weight_filler_->::ditcaffe::FillerParameter::Clear(); + } + if (has_bias_filler()) { + if (bias_filler_ != NULL) bias_filler_->::ditcaffe::FillerParameter::Clear(); + } + axis_ = 1; + transpose_ = false; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + 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:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &num_output_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &bias_term_))); + set_has_bias_term(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_weight_filler; + break; + } + + // optional .ditcaffe.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 .ditcaffe.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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &transpose_))); + set_has_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:ditcaffe.InnerProductParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.InnerProductParameter) + return false; +#undef DO_ +} + +void InnerProductParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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 .ditcaffe.FillerParameter weight_filler = 3; + if (has_weight_filler()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, *this->weight_filler_, output); + } + + // optional .ditcaffe.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:ditcaffe.InnerProductParameter) +} + +::google::protobuf::uint8* InnerProductParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.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 .ditcaffe.FillerParameter weight_filler = 3; + if (has_weight_filler()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 3, *this->weight_filler_, target); + } + + // optional .ditcaffe.FillerParameter bias_filler = 4; + if (has_bias_filler()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 4, *this->bias_filler_, 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:ditcaffe.InnerProductParameter) + return target; +} + +int InnerProductParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.InnerProductParameter) + int 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 .ditcaffe.FillerParameter weight_filler = 3; + if (has_weight_filler()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->weight_filler_); + } + + // optional .ditcaffe.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()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void InnerProductParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:ditcaffe.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:ditcaffe.InnerProductParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:ditcaffe.InnerProductParameter) + MergeFrom(*source); + } +} + +void InnerProductParameter::MergeFrom(const InnerProductParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.InnerProductParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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()->::ditcaffe::FillerParameter::MergeFrom(from.weight_filler()); + } + if (from.has_bias_filler()) { + mutable_bias_filler()->::ditcaffe::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()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void InnerProductParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:ditcaffe.InnerProductParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void InnerProductParameter::CopyFrom(const InnerProductParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.InnerProductParameter) + if (&from == this) return; + Clear(); + MergeFrom(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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.InnerProductParameter.bias_term) +} + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_weight_filler(); +} +const ::ditcaffe::FillerParameter& InnerProductParameter::weight_filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.InnerProductParameter.weight_filler) + return weight_filler_ != NULL ? *weight_filler_ : *default_instance_->weight_filler_; +} +::ditcaffe::FillerParameter* InnerProductParameter::mutable_weight_filler() { + set_has_weight_filler(); + if (weight_filler_ == NULL) { + weight_filler_ = new ::ditcaffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.InnerProductParameter.weight_filler) + return weight_filler_; +} +::ditcaffe::FillerParameter* InnerProductParameter::release_weight_filler() { + // @@protoc_insertion_point(field_release:ditcaffe.InnerProductParameter.weight_filler) + clear_has_weight_filler(); + ::ditcaffe::FillerParameter* temp = weight_filler_; + weight_filler_ = NULL; + return temp; +} +void InnerProductParameter::set_allocated_weight_filler(::ditcaffe::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:ditcaffe.InnerProductParameter.weight_filler) +} + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_bias_filler(); +} +const ::ditcaffe::FillerParameter& InnerProductParameter::bias_filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.InnerProductParameter.bias_filler) + return bias_filler_ != NULL ? *bias_filler_ : *default_instance_->bias_filler_; +} +::ditcaffe::FillerParameter* InnerProductParameter::mutable_bias_filler() { + set_has_bias_filler(); + if (bias_filler_ == NULL) { + bias_filler_ = new ::ditcaffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.InnerProductParameter.bias_filler) + return bias_filler_; +} +::ditcaffe::FillerParameter* InnerProductParameter::release_bias_filler() { + // @@protoc_insertion_point(field_release:ditcaffe.InnerProductParameter.bias_filler) + clear_has_bias_filler(); + ::ditcaffe::FillerParameter* temp = bias_filler_; + bias_filler_ = NULL; + return temp; +} +void InnerProductParameter::set_allocated_bias_filler(::ditcaffe::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:ditcaffe.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:ditcaffe.InnerProductParameter.axis) + return axis_; +} + void InnerProductParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.InnerProductParameter.transpose) + return transpose_; +} + void InnerProductParameter::set_transpose(bool value) { + set_has_transpose(); + transpose_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.InnerProductParameter.transpose) +} + +#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) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.InputParameter) +} + +void InputParameter::InitAsDefaultInstance() { +} + +InputParameter::InputParameter(const InputParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.InputParameter) +} + +void InputParameter::SharedCtor() { + _cached_size_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +InputParameter::~InputParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.InputParameter) + SharedDtor(); +} + +void InputParameter::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +InputParameter* InputParameter::default_instance_ = NULL; + +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:ditcaffe.InputParameter) + shape_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + 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:ditcaffe.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 .ditcaffe.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:ditcaffe.InputParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.InputParameter) + return false; +#undef DO_ +} + +void InputParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.InputParameter) + // repeated .ditcaffe.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:ditcaffe.InputParameter) +} + +::google::protobuf::uint8* InputParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.InputParameter) + // repeated .ditcaffe.BlobShape shape = 1; + for (unsigned int i = 0, n = this->shape_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 1, this->shape(i), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.InputParameter) + return target; +} + +int InputParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.InputParameter) + int total_size = 0; + + // repeated .ditcaffe.BlobShape shape = 1; + total_size += 1 * this->shape_size(); + for (int i = 0; i < this->shape_size(); 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()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void InputParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:ditcaffe.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:ditcaffe.InputParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:ditcaffe.InputParameter) + MergeFrom(*source); + } +} + +void InputParameter::MergeFrom(const InputParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.InputParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + shape_.MergeFrom(from.shape_); + if (from._internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void InputParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:ditcaffe.InputParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void InputParameter::CopyFrom(const InputParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.InputParameter) + if (&from == this) return; + Clear(); + MergeFrom(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 .ditcaffe.BlobShape shape = 1; +int InputParameter::shape_size() const { + return shape_.size(); +} +void InputParameter::clear_shape() { + shape_.Clear(); +} +const ::ditcaffe::BlobShape& InputParameter::shape(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.InputParameter.shape) + return shape_.Get(index); +} +::ditcaffe::BlobShape* InputParameter::mutable_shape(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.InputParameter.shape) + return shape_.Mutable(index); +} +::ditcaffe::BlobShape* InputParameter::add_shape() { + // @@protoc_insertion_point(field_add:ditcaffe.InputParameter.shape) + return shape_.Add(); +} +::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobShape >* +InputParameter::mutable_shape() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.InputParameter.shape) + return &shape_; +} +const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobShape >& +InputParameter::shape() const { + // @@protoc_insertion_point(field_list:ditcaffe.InputParameter.shape) + return shape_; +} + +#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) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.LogParameter) +} + +void LogParameter::InitAsDefaultInstance() { +} + +LogParameter::LogParameter(const LogParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.LogParameter) +} + +void LogParameter::SharedCtor() { + _cached_size_ = 0; + base_ = -1; + scale_ = 1; + shift_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +LogParameter::~LogParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.LogParameter) + SharedDtor(); +} + +void LogParameter::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +LogParameter* LogParameter::default_instance_ = NULL; + +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:ditcaffe.LogParameter) + if (_has_bits_[0 / 32] & 7u) { + base_ = -1; + scale_ = 1; + shift_ = 0; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + 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:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &base_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &scale_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &shift_))); + set_has_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:ditcaffe.LogParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.LogParameter) + return false; +#undef DO_ +} + +void LogParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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:ditcaffe.LogParameter) +} + +::google::protobuf::uint8* LogParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.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:ditcaffe.LogParameter) + return target; +} + +int LogParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.LogParameter) + int 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()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void LogParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:ditcaffe.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:ditcaffe.LogParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:ditcaffe.LogParameter) + MergeFrom(*source); + } +} + +void LogParameter::MergeFrom(const LogParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.LogParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void LogParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:ditcaffe.LogParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void LogParameter::CopyFrom(const LogParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.LogParameter) + if (&from == this) return; + Clear(); + MergeFrom(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:ditcaffe.LogParameter.base) + return base_; +} + void LogParameter::set_base(float value) { + set_has_base(); + base_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.LogParameter.scale) + return scale_; +} + void LogParameter::set_scale(float value) { + set_has_scale(); + scale_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.LogParameter.shift) + return shift_; +} + void LogParameter::set_shift(float value) { + set_has_shift(); + shift_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.LogParameter.shift) +} + +#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) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.LRNParameter) +} + +void LRNParameter::InitAsDefaultInstance() { +} + +LRNParameter::LRNParameter(const LRNParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.LRNParameter) +} + +void LRNParameter::SharedCtor() { + _cached_size_ = 0; + local_size_ = 5u; + alpha_ = 1; + beta_ = 0.75f; + norm_region_ = 0; + k_ = 1; + engine_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +LRNParameter::~LRNParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.LRNParameter) + SharedDtor(); +} + +void LRNParameter::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +LRNParameter* LRNParameter::default_instance_ = NULL; + +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:ditcaffe.LRNParameter) + if (_has_bits_[0 / 32] & 63u) { + local_size_ = 5u; + alpha_ = 1; + beta_ = 0.75f; + norm_region_ = 0; + k_ = 1; + engine_ = 0; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + 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:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &local_size_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &alpha_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &beta_))); + set_has_beta(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(32)) goto parse_norm_region; + break; + } + + // optional .ditcaffe.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 (::ditcaffe::LRNParameter_NormRegion_IsValid(value)) { + set_norm_region(static_cast< ::ditcaffe::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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &k_))); + set_has_k(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(48)) goto parse_engine; + break; + } + + // optional .ditcaffe.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 (::ditcaffe::LRNParameter_Engine_IsValid(value)) { + set_engine(static_cast< ::ditcaffe::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:ditcaffe.LRNParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.LRNParameter) + return false; +#undef DO_ +} + +void LRNParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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 .ditcaffe.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 .ditcaffe.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:ditcaffe.LRNParameter) +} + +::google::protobuf::uint8* LRNParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.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 .ditcaffe.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 .ditcaffe.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:ditcaffe.LRNParameter) + return target; +} + +int LRNParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.LRNParameter) + int 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 .ditcaffe.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 .ditcaffe.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()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void LRNParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:ditcaffe.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:ditcaffe.LRNParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:ditcaffe.LRNParameter) + MergeFrom(*source); + } +} + +void LRNParameter::MergeFrom(const LRNParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.LRNParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void LRNParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:ditcaffe.LRNParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void LRNParameter::CopyFrom(const LRNParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.LRNParameter) + if (&from == this) return; + Clear(); + MergeFrom(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:ditcaffe.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:ditcaffe.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:ditcaffe.LRNParameter.alpha) + return alpha_; +} + void LRNParameter::set_alpha(float value) { + set_has_alpha(); + alpha_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.LRNParameter.beta) + return beta_; +} + void LRNParameter::set_beta(float value) { + set_has_beta(); + beta_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.LRNParameter.beta) +} + +// optional .ditcaffe.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(); +} + ::ditcaffe::LRNParameter_NormRegion LRNParameter::norm_region() const { + // @@protoc_insertion_point(field_get:ditcaffe.LRNParameter.norm_region) + return static_cast< ::ditcaffe::LRNParameter_NormRegion >(norm_region_); +} + void LRNParameter::set_norm_region(::ditcaffe::LRNParameter_NormRegion value) { + assert(::ditcaffe::LRNParameter_NormRegion_IsValid(value)); + set_has_norm_region(); + norm_region_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.LRNParameter.k) + return k_; +} + void LRNParameter::set_k(float value) { + set_has_k(); + k_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.LRNParameter.k) +} + +// optional .ditcaffe.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(); +} + ::ditcaffe::LRNParameter_Engine LRNParameter::engine() const { + // @@protoc_insertion_point(field_get:ditcaffe.LRNParameter.engine) + return static_cast< ::ditcaffe::LRNParameter_Engine >(engine_); +} + void LRNParameter::set_engine(::ditcaffe::LRNParameter_Engine value) { + assert(::ditcaffe::LRNParameter_Engine_IsValid(value)); + set_has_engine(); + engine_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.LRNParameter.engine) +} + +#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) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.MemoryDataParameter) +} + +void MemoryDataParameter::InitAsDefaultInstance() { +} + +MemoryDataParameter::MemoryDataParameter(const MemoryDataParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.MemoryDataParameter) +} + +void MemoryDataParameter::SharedCtor() { + _cached_size_ = 0; + batch_size_ = 0u; + channels_ = 0u; + height_ = 0u; + width_ = 0u; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +MemoryDataParameter::~MemoryDataParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.MemoryDataParameter) + SharedDtor(); +} + +void MemoryDataParameter::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +MemoryDataParameter* MemoryDataParameter::default_instance_ = NULL; + +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:ditcaffe.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_ + + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + 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:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &batch_size_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &channels_))); + set_has_channels(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(24)) goto parse_height; + break; + } + + // optional uint32 height = 3; + case 3: { + if (tag == 24) { + parse_height: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &height_))); + set_has_height(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(32)) goto parse_width; + break; + } + + // optional uint32 width = 4; + case 4: { + if (tag == 32) { + parse_width: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &width_))); + set_has_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:ditcaffe.MemoryDataParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.MemoryDataParameter) + return false; +#undef DO_ +} + +void MemoryDataParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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:ditcaffe.MemoryDataParameter) +} + +::google::protobuf::uint8* MemoryDataParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.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:ditcaffe.MemoryDataParameter) + return target; +} + +int MemoryDataParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.MemoryDataParameter) + int 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()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void MemoryDataParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:ditcaffe.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:ditcaffe.MemoryDataParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:ditcaffe.MemoryDataParameter) + MergeFrom(*source); + } +} + +void MemoryDataParameter::MergeFrom(const MemoryDataParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.MemoryDataParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void MemoryDataParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:ditcaffe.MemoryDataParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void MemoryDataParameter::CopyFrom(const MemoryDataParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.MemoryDataParameter) + if (&from == this) return; + Clear(); + MergeFrom(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:ditcaffe.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:ditcaffe.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:ditcaffe.MemoryDataParameter.channels) + return channels_; +} + void MemoryDataParameter::set_channels(::google::protobuf::uint32 value) { + set_has_channels(); + channels_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.MemoryDataParameter.height) + return height_; +} + void MemoryDataParameter::set_height(::google::protobuf::uint32 value) { + set_has_height(); + height_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.MemoryDataParameter.width) + return width_; +} + void MemoryDataParameter::set_width(::google::protobuf::uint32 value) { + set_has_width(); + width_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.MemoryDataParameter.width) +} + +#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) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.MVNParameter) +} + +void MVNParameter::InitAsDefaultInstance() { +} + +MVNParameter::MVNParameter(const MVNParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.MVNParameter) +} + +void MVNParameter::SharedCtor() { + _cached_size_ = 0; + normalize_variance_ = true; + across_channels_ = false; + eps_ = 1e-09f; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +MVNParameter::~MVNParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.MVNParameter) + SharedDtor(); +} + +void MVNParameter::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +MVNParameter* MVNParameter::default_instance_ = NULL; + +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:ditcaffe.MVNParameter) + if (_has_bits_[0 / 32] & 7u) { + normalize_variance_ = true; + across_channels_ = false; + eps_ = 1e-09f; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + 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:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &normalize_variance_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &across_channels_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &eps_))); + set_has_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:ditcaffe.MVNParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.MVNParameter) + return false; +#undef DO_ +} + +void MVNParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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:ditcaffe.MVNParameter) +} + +::google::protobuf::uint8* MVNParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.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:ditcaffe.MVNParameter) + return target; +} + +int MVNParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.MVNParameter) + int 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()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void MVNParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:ditcaffe.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:ditcaffe.MVNParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:ditcaffe.MVNParameter) + MergeFrom(*source); + } +} + +void MVNParameter::MergeFrom(const MVNParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.MVNParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void MVNParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:ditcaffe.MVNParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void MVNParameter::CopyFrom(const MVNParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.MVNParameter) + if (&from == this) return; + Clear(); + MergeFrom(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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.MVNParameter.eps) + return eps_; +} + void MVNParameter::set_eps(float value) { + set_has_eps(); + eps_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.MVNParameter.eps) +} + +#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) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.ParameterParameter) +} + +void ParameterParameter::InitAsDefaultInstance() { + shape_ = const_cast< ::ditcaffe::BlobShape*>(&::ditcaffe::BlobShape::default_instance()); +} + +ParameterParameter::ParameterParameter(const ParameterParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.ParameterParameter) +} + +void ParameterParameter::SharedCtor() { + _cached_size_ = 0; + shape_ = NULL; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ParameterParameter::~ParameterParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.ParameterParameter) + SharedDtor(); +} + +void ParameterParameter::SharedDtor() { + if (this != default_instance_) { + 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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +ParameterParameter* ParameterParameter::default_instance_ = NULL; + +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:ditcaffe.ParameterParameter) + if (has_shape()) { + if (shape_ != NULL) shape_->::ditcaffe::BlobShape::Clear(); + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + 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:ditcaffe.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 .ditcaffe.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:ditcaffe.ParameterParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.ParameterParameter) + return false; +#undef DO_ +} + +void ParameterParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.ParameterParameter) + // optional .ditcaffe.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:ditcaffe.ParameterParameter) +} + +::google::protobuf::uint8* ParameterParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.ParameterParameter) + // optional .ditcaffe.BlobShape shape = 1; + if (has_shape()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 1, *this->shape_, target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.ParameterParameter) + return target; +} + +int ParameterParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.ParameterParameter) + int total_size = 0; + + // optional .ditcaffe.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()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ParameterParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:ditcaffe.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:ditcaffe.ParameterParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:ditcaffe.ParameterParameter) + MergeFrom(*source); + } +} + +void ParameterParameter::MergeFrom(const ParameterParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.ParameterParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_shape()) { + mutable_shape()->::ditcaffe::BlobShape::MergeFrom(from.shape()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void ParameterParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:ditcaffe.ParameterParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ParameterParameter::CopyFrom(const ParameterParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.ParameterParameter) + if (&from == this) return; + Clear(); + MergeFrom(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 .ditcaffe.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_->::ditcaffe::BlobShape::Clear(); + clear_has_shape(); +} +const ::ditcaffe::BlobShape& ParameterParameter::shape() const { + // @@protoc_insertion_point(field_get:ditcaffe.ParameterParameter.shape) + return shape_ != NULL ? *shape_ : *default_instance_->shape_; +} +::ditcaffe::BlobShape* ParameterParameter::mutable_shape() { + set_has_shape(); + if (shape_ == NULL) { + shape_ = new ::ditcaffe::BlobShape; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.ParameterParameter.shape) + return shape_; +} +::ditcaffe::BlobShape* ParameterParameter::release_shape() { + // @@protoc_insertion_point(field_release:ditcaffe.ParameterParameter.shape) + clear_has_shape(); + ::ditcaffe::BlobShape* temp = shape_; + shape_ = NULL; + return temp; +} +void ParameterParameter::set_allocated_shape(::ditcaffe::BlobShape* shape) { + delete shape_; + shape_ = shape; + if (shape) { + set_has_shape(); + } else { + clear_has_shape(); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.ParameterParameter.shape) +} + +#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; +const int PoolingParameter::kTorchPoolingFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +PoolingParameter::PoolingParameter() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.PoolingParameter) +} + +void PoolingParameter::InitAsDefaultInstance() { +} + +PoolingParameter::PoolingParameter(const PoolingParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.PoolingParameter) +} + +void PoolingParameter::SharedCtor() { + _cached_size_ = 0; + pool_ = 0; + pad_ = 0u; + pad_h_ = 0u; + pad_w_ = 0u; + kernel_size_ = 0u; + kernel_h_ = 0u; + kernel_w_ = 0u; + stride_ = 1u; + stride_h_ = 0u; + stride_w_ = 0u; + engine_ = 0; + global_pooling_ = false; + torch_pooling_ = false; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +PoolingParameter::~PoolingParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.PoolingParameter) + SharedDtor(); +} + +void PoolingParameter::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +PoolingParameter* PoolingParameter::default_instance_ = NULL; + +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:ditcaffe.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; + } + if (_has_bits_[8 / 32] & 7936u) { + ZR_(stride_h_, torch_pooling_); + } + +#undef ZR_HELPER_ +#undef ZR_ + + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + 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:ditcaffe.PoolingParameter) + 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 .ditcaffe.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 (::ditcaffe::PoolingParameter_PoolMethod_IsValid(value)) { + set_pool(static_cast< ::ditcaffe::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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &kernel_size_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &stride_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &pad_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &kernel_h_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &kernel_w_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &stride_h_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &stride_w_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &pad_h_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &pad_w_))); + set_has_pad_w(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(88)) goto parse_engine; + break; + } + + // optional .ditcaffe.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 (::ditcaffe::PoolingParameter_Engine_IsValid(value)) { + set_engine(static_cast< ::ditcaffe::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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &global_pooling_))); + set_has_global_pooling(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(320)) goto parse_torch_pooling; + break; + } + + // optional bool torch_pooling = 40 [default = false]; + case 40: { + if (tag == 320) { + parse_torch_pooling: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &torch_pooling_))); + set_has_torch_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:ditcaffe.PoolingParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.PoolingParameter) + return false; +#undef DO_ +} + +void PoolingParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.PoolingParameter) + // optional .ditcaffe.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 .ditcaffe.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); + } + + // optional bool torch_pooling = 40 [default = false]; + if (has_torch_pooling()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(40, this->torch_pooling(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:ditcaffe.PoolingParameter) +} + +::google::protobuf::uint8* PoolingParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.PoolingParameter) + // optional .ditcaffe.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 .ditcaffe.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); + } + + // optional bool torch_pooling = 40 [default = false]; + if (has_torch_pooling()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(40, this->torch_pooling(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.PoolingParameter) + return target; +} + +int PoolingParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.PoolingParameter) + int total_size = 0; + + if (_has_bits_[0 / 32] & 255u) { + // optional .ditcaffe.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] & 7936u) { + // 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 .ditcaffe.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; + } + + // optional bool torch_pooling = 40 [default = false]; + if (has_torch_pooling()) { + total_size += 2 + 1; + } + + } + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void PoolingParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:ditcaffe.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:ditcaffe.PoolingParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:ditcaffe.PoolingParameter) + MergeFrom(*source); + } +} + +void PoolingParameter::MergeFrom(const PoolingParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.PoolingParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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.has_torch_pooling()) { + set_torch_pooling(from.torch_pooling()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void PoolingParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:ditcaffe.PoolingParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void PoolingParameter::CopyFrom(const PoolingParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.PoolingParameter) + if (&from == this) return; + Clear(); + MergeFrom(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(torch_pooling_, other->torch_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 .ditcaffe.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(); +} + ::ditcaffe::PoolingParameter_PoolMethod PoolingParameter::pool() const { + // @@protoc_insertion_point(field_get:ditcaffe.PoolingParameter.pool) + return static_cast< ::ditcaffe::PoolingParameter_PoolMethod >(pool_); +} + void PoolingParameter::set_pool(::ditcaffe::PoolingParameter_PoolMethod value) { + assert(::ditcaffe::PoolingParameter_PoolMethod_IsValid(value)); + set_has_pool(); + pool_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.PoolingParameter.pad) + return pad_; +} + void PoolingParameter::set_pad(::google::protobuf::uint32 value) { + set_has_pad(); + pad_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.PoolingParameter.stride) + return stride_; +} + void PoolingParameter::set_stride(::google::protobuf::uint32 value) { + set_has_stride(); + stride_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.PoolingParameter.stride_w) +} + +// optional .ditcaffe.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(); +} + ::ditcaffe::PoolingParameter_Engine PoolingParameter::engine() const { + // @@protoc_insertion_point(field_get:ditcaffe.PoolingParameter.engine) + return static_cast< ::ditcaffe::PoolingParameter_Engine >(engine_); +} + void PoolingParameter::set_engine(::ditcaffe::PoolingParameter_Engine value) { + assert(::ditcaffe::PoolingParameter_Engine_IsValid(value)); + set_has_engine(); + engine_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.PoolingParameter.global_pooling) +} + +// optional bool torch_pooling = 40 [default = false]; +bool PoolingParameter::has_torch_pooling() const { + return (_has_bits_[0] & 0x00001000u) != 0; +} +void PoolingParameter::set_has_torch_pooling() { + _has_bits_[0] |= 0x00001000u; +} +void PoolingParameter::clear_has_torch_pooling() { + _has_bits_[0] &= ~0x00001000u; +} +void PoolingParameter::clear_torch_pooling() { + torch_pooling_ = false; + clear_has_torch_pooling(); +} + bool PoolingParameter::torch_pooling() const { + // @@protoc_insertion_point(field_get:ditcaffe.PoolingParameter.torch_pooling) + return torch_pooling_; +} + void PoolingParameter::set_torch_pooling(bool value) { + set_has_torch_pooling(); + torch_pooling_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.PoolingParameter.torch_pooling) +} + +#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) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.PowerParameter) +} + +void PowerParameter::InitAsDefaultInstance() { +} + +PowerParameter::PowerParameter(const PowerParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.PowerParameter) +} + +void PowerParameter::SharedCtor() { + _cached_size_ = 0; + power_ = 1; + scale_ = 1; + shift_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +PowerParameter::~PowerParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.PowerParameter) + SharedDtor(); +} + +void PowerParameter::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +PowerParameter* PowerParameter::default_instance_ = NULL; + +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:ditcaffe.PowerParameter) + if (_has_bits_[0 / 32] & 7u) { + power_ = 1; + scale_ = 1; + shift_ = 0; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + 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:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &power_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &scale_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &shift_))); + set_has_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:ditcaffe.PowerParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.PowerParameter) + return false; +#undef DO_ +} + +void PowerParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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:ditcaffe.PowerParameter) +} + +::google::protobuf::uint8* PowerParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.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:ditcaffe.PowerParameter) + return target; +} + +int PowerParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.PowerParameter) + int 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()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void PowerParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:ditcaffe.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:ditcaffe.PowerParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:ditcaffe.PowerParameter) + MergeFrom(*source); + } +} + +void PowerParameter::MergeFrom(const PowerParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.PowerParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void PowerParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:ditcaffe.PowerParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void PowerParameter::CopyFrom(const PowerParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.PowerParameter) + if (&from == this) return; + Clear(); + MergeFrom(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:ditcaffe.PowerParameter.power) + return power_; +} + void PowerParameter::set_power(float value) { + set_has_power(); + power_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.PowerParameter.scale) + return scale_; +} + void PowerParameter::set_scale(float value) { + set_has_scale(); + scale_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.PowerParameter.shift) + return shift_; +} + void PowerParameter::set_shift(float value) { + set_has_shift(); + shift_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.PowerParameter.shift) +} + +#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) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.PythonParameter) +} + +void PythonParameter::InitAsDefaultInstance() { +} + +PythonParameter::PythonParameter(const PythonParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.PythonParameter) +} + +void PythonParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _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; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +PythonParameter::~PythonParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.PythonParameter) + SharedDtor(); +} + +void PythonParameter::SharedDtor() { + module_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + layer_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + param_str_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +PythonParameter* PythonParameter::default_instance_ = NULL; + +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:ditcaffe.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; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + 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:ditcaffe.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, + "ditcaffe.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, + "ditcaffe.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, + "ditcaffe.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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &share_in_parallel_))); + set_has_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:ditcaffe.PythonParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.PythonParameter) + return false; +#undef DO_ +} + +void PythonParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.PythonParameter) + // optional string module = 1; + if (has_module()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->module().data(), this->module().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "ditcaffe.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, + "ditcaffe.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, + "ditcaffe.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:ditcaffe.PythonParameter) +} + +::google::protobuf::uint8* PythonParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.PythonParameter) + // optional string module = 1; + if (has_module()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->module().data(), this->module().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "ditcaffe.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, + "ditcaffe.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, + "ditcaffe.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:ditcaffe.PythonParameter) + return target; +} + +int PythonParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.PythonParameter) + int 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()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void PythonParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:ditcaffe.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:ditcaffe.PythonParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:ditcaffe.PythonParameter) + MergeFrom(*source); + } +} + +void PythonParameter::MergeFrom(const PythonParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.PythonParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void PythonParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:ditcaffe.PythonParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void PythonParameter::CopyFrom(const PythonParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.PythonParameter) + if (&from == this) return; + Clear(); + MergeFrom(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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.PythonParameter.module) +} + ::std::string* PythonParameter::mutable_module() { + set_has_module(); + // @@protoc_insertion_point(field_mutable:ditcaffe.PythonParameter.module) + return module_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* PythonParameter::release_module() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.PythonParameter.layer) +} + ::std::string* PythonParameter::mutable_layer() { + set_has_layer(); + // @@protoc_insertion_point(field_mutable:ditcaffe.PythonParameter.layer) + return layer_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* PythonParameter::release_layer() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.PythonParameter.param_str) +} + ::std::string* PythonParameter::mutable_param_str() { + set_has_param_str(); + // @@protoc_insertion_point(field_mutable:ditcaffe.PythonParameter.param_str) + return param_str_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* PythonParameter::release_param_str() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.PythonParameter.share_in_parallel) +} + +#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) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.ReductionParameter) +} + +void ReductionParameter::InitAsDefaultInstance() { +} + +ReductionParameter::ReductionParameter(const ReductionParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.ReductionParameter) +} + +void ReductionParameter::SharedCtor() { + _cached_size_ = 0; + operation_ = 1; + axis_ = 0; + coeff_ = 1; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ReductionParameter::~ReductionParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.ReductionParameter) + SharedDtor(); +} + +void ReductionParameter::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +ReductionParameter* ReductionParameter::default_instance_ = NULL; + +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:ditcaffe.ReductionParameter) + if (_has_bits_[0 / 32] & 7u) { + operation_ = 1; + axis_ = 0; + coeff_ = 1; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + 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:ditcaffe.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 .ditcaffe.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 (::ditcaffe::ReductionParameter_ReductionOp_IsValid(value)) { + set_operation(static_cast< ::ditcaffe::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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &coeff_))); + set_has_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:ditcaffe.ReductionParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.ReductionParameter) + return false; +#undef DO_ +} + +void ReductionParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.ReductionParameter) + // optional .ditcaffe.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:ditcaffe.ReductionParameter) +} + +::google::protobuf::uint8* ReductionParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.ReductionParameter) + // optional .ditcaffe.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:ditcaffe.ReductionParameter) + return target; +} + +int ReductionParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.ReductionParameter) + int total_size = 0; + + if (_has_bits_[0 / 32] & 7u) { + // optional .ditcaffe.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()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ReductionParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:ditcaffe.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:ditcaffe.ReductionParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:ditcaffe.ReductionParameter) + MergeFrom(*source); + } +} + +void ReductionParameter::MergeFrom(const ReductionParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.ReductionParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void ReductionParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:ditcaffe.ReductionParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ReductionParameter::CopyFrom(const ReductionParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.ReductionParameter) + if (&from == this) return; + Clear(); + MergeFrom(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 .ditcaffe.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(); +} + ::ditcaffe::ReductionParameter_ReductionOp ReductionParameter::operation() const { + // @@protoc_insertion_point(field_get:ditcaffe.ReductionParameter.operation) + return static_cast< ::ditcaffe::ReductionParameter_ReductionOp >(operation_); +} + void ReductionParameter::set_operation(::ditcaffe::ReductionParameter_ReductionOp value) { + assert(::ditcaffe::ReductionParameter_ReductionOp_IsValid(value)); + set_has_operation(); + operation_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.ReductionParameter.axis) + return axis_; +} + void ReductionParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.ReductionParameter.coeff) + return coeff_; +} + void ReductionParameter::set_coeff(float value) { + set_has_coeff(); + coeff_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.ReductionParameter.coeff) +} + +#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) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.ReLUParameter) +} + +void ReLUParameter::InitAsDefaultInstance() { +} + +ReLUParameter::ReLUParameter(const ReLUParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.ReLUParameter) +} + +void ReLUParameter::SharedCtor() { + _cached_size_ = 0; + negative_slope_ = 0; + engine_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ReLUParameter::~ReLUParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.ReLUParameter) + SharedDtor(); +} + +void ReLUParameter::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +ReLUParameter* ReLUParameter::default_instance_ = NULL; + +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:ditcaffe.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_ + + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + 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:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &negative_slope_))); + set_has_negative_slope(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_engine; + break; + } + + // optional .ditcaffe.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 (::ditcaffe::ReLUParameter_Engine_IsValid(value)) { + set_engine(static_cast< ::ditcaffe::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:ditcaffe.ReLUParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.ReLUParameter) + return false; +#undef DO_ +} + +void ReLUParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.ReLUParameter) + // optional float negative_slope = 1 [default = 0]; + if (has_negative_slope()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->negative_slope(), output); + } + + // optional .ditcaffe.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:ditcaffe.ReLUParameter) +} + +::google::protobuf::uint8* ReLUParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.ReLUParameter) + // optional float negative_slope = 1 [default = 0]; + if (has_negative_slope()) { + target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(1, this->negative_slope(), target); + } + + // optional .ditcaffe.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:ditcaffe.ReLUParameter) + return target; +} + +int ReLUParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.ReLUParameter) + int 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 .ditcaffe.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()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ReLUParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:ditcaffe.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:ditcaffe.ReLUParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:ditcaffe.ReLUParameter) + MergeFrom(*source); + } +} + +void ReLUParameter::MergeFrom(const ReLUParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.ReLUParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void ReLUParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:ditcaffe.ReLUParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ReLUParameter::CopyFrom(const ReLUParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.ReLUParameter) + if (&from == this) return; + Clear(); + MergeFrom(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:ditcaffe.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:ditcaffe.ReLUParameter.negative_slope) +} + +// optional .ditcaffe.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(); +} + ::ditcaffe::ReLUParameter_Engine ReLUParameter::engine() const { + // @@protoc_insertion_point(field_get:ditcaffe.ReLUParameter.engine) + return static_cast< ::ditcaffe::ReLUParameter_Engine >(engine_); +} + void ReLUParameter::set_engine(::ditcaffe::ReLUParameter_Engine value) { + assert(::ditcaffe::ReLUParameter_Engine_IsValid(value)); + set_has_engine(); + engine_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.ReLUParameter.engine) +} + +#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) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.ReshapeParameter) +} + +void ReshapeParameter::InitAsDefaultInstance() { + shape_ = const_cast< ::ditcaffe::BlobShape*>(&::ditcaffe::BlobShape::default_instance()); +} + +ReshapeParameter::ReshapeParameter(const ReshapeParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.ReshapeParameter) +} + +void ReshapeParameter::SharedCtor() { + _cached_size_ = 0; + shape_ = NULL; + axis_ = 0; + num_axes_ = -1; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ReshapeParameter::~ReshapeParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.ReshapeParameter) + SharedDtor(); +} + +void ReshapeParameter::SharedDtor() { + if (this != default_instance_) { + 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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +ReshapeParameter* ReshapeParameter::default_instance_ = NULL; + +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:ditcaffe.ReshapeParameter) + if (_has_bits_[0 / 32] & 7u) { + if (has_shape()) { + if (shape_ != NULL) shape_->::ditcaffe::BlobShape::Clear(); + } + axis_ = 0; + num_axes_ = -1; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + 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:ditcaffe.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 .ditcaffe.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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &num_axes_))); + set_has_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:ditcaffe.ReshapeParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.ReshapeParameter) + return false; +#undef DO_ +} + +void ReshapeParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.ReshapeParameter) + // optional .ditcaffe.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:ditcaffe.ReshapeParameter) +} + +::google::protobuf::uint8* ReshapeParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.ReshapeParameter) + // optional .ditcaffe.BlobShape shape = 1; + if (has_shape()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 1, *this->shape_, 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:ditcaffe.ReshapeParameter) + return target; +} + +int ReshapeParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.ReshapeParameter) + int total_size = 0; + + if (_has_bits_[0 / 32] & 7u) { + // optional .ditcaffe.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()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ReshapeParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:ditcaffe.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:ditcaffe.ReshapeParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:ditcaffe.ReshapeParameter) + MergeFrom(*source); + } +} + +void ReshapeParameter::MergeFrom(const ReshapeParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.ReshapeParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_shape()) { + mutable_shape()->::ditcaffe::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()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void ReshapeParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:ditcaffe.ReshapeParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ReshapeParameter::CopyFrom(const ReshapeParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.ReshapeParameter) + if (&from == this) return; + Clear(); + MergeFrom(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 .ditcaffe.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_->::ditcaffe::BlobShape::Clear(); + clear_has_shape(); +} +const ::ditcaffe::BlobShape& ReshapeParameter::shape() const { + // @@protoc_insertion_point(field_get:ditcaffe.ReshapeParameter.shape) + return shape_ != NULL ? *shape_ : *default_instance_->shape_; +} +::ditcaffe::BlobShape* ReshapeParameter::mutable_shape() { + set_has_shape(); + if (shape_ == NULL) { + shape_ = new ::ditcaffe::BlobShape; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.ReshapeParameter.shape) + return shape_; +} +::ditcaffe::BlobShape* ReshapeParameter::release_shape() { + // @@protoc_insertion_point(field_release:ditcaffe.ReshapeParameter.shape) + clear_has_shape(); + ::ditcaffe::BlobShape* temp = shape_; + shape_ = NULL; + return temp; +} +void ReshapeParameter::set_allocated_shape(::ditcaffe::BlobShape* shape) { + delete shape_; + shape_ = shape; + if (shape) { + set_has_shape(); + } else { + clear_has_shape(); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.ReshapeParameter.axis) + return axis_; +} + void ReshapeParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.ReshapeParameter.num_axes) +} + +#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) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.ScaleParameter) +} + +void ScaleParameter::InitAsDefaultInstance() { + filler_ = const_cast< ::ditcaffe::FillerParameter*>(&::ditcaffe::FillerParameter::default_instance()); + bias_filler_ = const_cast< ::ditcaffe::FillerParameter*>(&::ditcaffe::FillerParameter::default_instance()); +} + +ScaleParameter::ScaleParameter(const ScaleParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.ScaleParameter) +} + +void ScaleParameter::SharedCtor() { + _cached_size_ = 0; + axis_ = 1; + num_axes_ = 1; + filler_ = NULL; + bias_term_ = false; + bias_filler_ = NULL; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ScaleParameter::~ScaleParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.ScaleParameter) + SharedDtor(); +} + +void ScaleParameter::SharedDtor() { + if (this != default_instance_) { + 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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +ScaleParameter* ScaleParameter::default_instance_ = NULL; + +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:ditcaffe.ScaleParameter) + if (_has_bits_[0 / 32] & 31u) { + axis_ = 1; + num_axes_ = 1; + if (has_filler()) { + if (filler_ != NULL) filler_->::ditcaffe::FillerParameter::Clear(); + } + bias_term_ = false; + if (has_bias_filler()) { + if (bias_filler_ != NULL) bias_filler_->::ditcaffe::FillerParameter::Clear(); + } + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + 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:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &num_axes_))); + set_has_num_axes(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_filler; + break; + } + + // optional .ditcaffe.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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &bias_term_))); + set_has_bias_term(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(42)) goto parse_bias_filler; + break; + } + + // optional .ditcaffe.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:ditcaffe.ScaleParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.ScaleParameter) + return false; +#undef DO_ +} + +void ScaleParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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 .ditcaffe.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 .ditcaffe.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:ditcaffe.ScaleParameter) +} + +::google::protobuf::uint8* ScaleParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.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 .ditcaffe.FillerParameter filler = 3; + if (has_filler()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 3, *this->filler_, target); + } + + // optional bool bias_term = 4 [default = false]; + if (has_bias_term()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(4, this->bias_term(), target); + } + + // optional .ditcaffe.FillerParameter bias_filler = 5; + if (has_bias_filler()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 5, *this->bias_filler_, target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.ScaleParameter) + return target; +} + +int ScaleParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.ScaleParameter) + int 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 .ditcaffe.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 .ditcaffe.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()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ScaleParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:ditcaffe.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:ditcaffe.ScaleParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:ditcaffe.ScaleParameter) + MergeFrom(*source); + } +} + +void ScaleParameter::MergeFrom(const ScaleParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.ScaleParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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()->::ditcaffe::FillerParameter::MergeFrom(from.filler()); + } + if (from.has_bias_term()) { + set_bias_term(from.bias_term()); + } + if (from.has_bias_filler()) { + mutable_bias_filler()->::ditcaffe::FillerParameter::MergeFrom(from.bias_filler()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void ScaleParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:ditcaffe.ScaleParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ScaleParameter::CopyFrom(const ScaleParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.ScaleParameter) + if (&from == this) return; + Clear(); + MergeFrom(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:ditcaffe.ScaleParameter.axis) + return axis_; +} + void ScaleParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.ScaleParameter.num_axes) +} + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_filler(); +} +const ::ditcaffe::FillerParameter& ScaleParameter::filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.ScaleParameter.filler) + return filler_ != NULL ? *filler_ : *default_instance_->filler_; +} +::ditcaffe::FillerParameter* ScaleParameter::mutable_filler() { + set_has_filler(); + if (filler_ == NULL) { + filler_ = new ::ditcaffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.ScaleParameter.filler) + return filler_; +} +::ditcaffe::FillerParameter* ScaleParameter::release_filler() { + // @@protoc_insertion_point(field_release:ditcaffe.ScaleParameter.filler) + clear_has_filler(); + ::ditcaffe::FillerParameter* temp = filler_; + filler_ = NULL; + return temp; +} +void ScaleParameter::set_allocated_filler(::ditcaffe::FillerParameter* filler) { + delete filler_; + filler_ = filler; + if (filler) { + set_has_filler(); + } else { + clear_has_filler(); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.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:ditcaffe.ScaleParameter.bias_term) +} + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_bias_filler(); +} +const ::ditcaffe::FillerParameter& ScaleParameter::bias_filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.ScaleParameter.bias_filler) + return bias_filler_ != NULL ? *bias_filler_ : *default_instance_->bias_filler_; +} +::ditcaffe::FillerParameter* ScaleParameter::mutable_bias_filler() { + set_has_bias_filler(); + if (bias_filler_ == NULL) { + bias_filler_ = new ::ditcaffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.ScaleParameter.bias_filler) + return bias_filler_; +} +::ditcaffe::FillerParameter* ScaleParameter::release_bias_filler() { + // @@protoc_insertion_point(field_release:ditcaffe.ScaleParameter.bias_filler) + clear_has_bias_filler(); + ::ditcaffe::FillerParameter* temp = bias_filler_; + bias_filler_ = NULL; + return temp; +} +void ScaleParameter::set_allocated_bias_filler(::ditcaffe::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:ditcaffe.ScaleParameter.bias_filler) +} + +#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) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.SigmoidParameter) +} + +void SigmoidParameter::InitAsDefaultInstance() { +} + +SigmoidParameter::SigmoidParameter(const SigmoidParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.SigmoidParameter) +} + +void SigmoidParameter::SharedCtor() { + _cached_size_ = 0; + engine_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +SigmoidParameter::~SigmoidParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.SigmoidParameter) + SharedDtor(); +} + +void SigmoidParameter::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +SigmoidParameter* SigmoidParameter::default_instance_ = NULL; + +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:ditcaffe.SigmoidParameter) + engine_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + 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:ditcaffe.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 .ditcaffe.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 (::ditcaffe::SigmoidParameter_Engine_IsValid(value)) { + set_engine(static_cast< ::ditcaffe::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:ditcaffe.SigmoidParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.SigmoidParameter) + return false; +#undef DO_ +} + +void SigmoidParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.SigmoidParameter) + // optional .ditcaffe.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:ditcaffe.SigmoidParameter) +} + +::google::protobuf::uint8* SigmoidParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.SigmoidParameter) + // optional .ditcaffe.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:ditcaffe.SigmoidParameter) + return target; +} + +int SigmoidParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.SigmoidParameter) + int total_size = 0; + + // optional .ditcaffe.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()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void SigmoidParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:ditcaffe.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:ditcaffe.SigmoidParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:ditcaffe.SigmoidParameter) + MergeFrom(*source); + } +} + +void SigmoidParameter::MergeFrom(const SigmoidParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.SigmoidParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_engine()) { + set_engine(from.engine()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void SigmoidParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:ditcaffe.SigmoidParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void SigmoidParameter::CopyFrom(const SigmoidParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.SigmoidParameter) + if (&from == this) return; + Clear(); + MergeFrom(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 .ditcaffe.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(); +} + ::ditcaffe::SigmoidParameter_Engine SigmoidParameter::engine() const { + // @@protoc_insertion_point(field_get:ditcaffe.SigmoidParameter.engine) + return static_cast< ::ditcaffe::SigmoidParameter_Engine >(engine_); +} + void SigmoidParameter::set_engine(::ditcaffe::SigmoidParameter_Engine value) { + assert(::ditcaffe::SigmoidParameter_Engine_IsValid(value)); + set_has_engine(); + engine_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.SigmoidParameter.engine) +} + +#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) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.SliceParameter) +} + +void SliceParameter::InitAsDefaultInstance() { +} + +SliceParameter::SliceParameter(const SliceParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.SliceParameter) +} + +void SliceParameter::SharedCtor() { + _cached_size_ = 0; + axis_ = 1; + slice_dim_ = 1u; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +SliceParameter::~SliceParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.SliceParameter) + SharedDtor(); +} + +void SliceParameter::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +SliceParameter* SliceParameter::default_instance_ = NULL; + +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:ditcaffe.SliceParameter) + if (_has_bits_[0 / 32] & 5u) { + axis_ = 1; + slice_dim_ = 1u; + } + slice_point_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + 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:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &slice_dim_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + set_has_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:ditcaffe.SliceParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.SliceParameter) + return false; +#undef DO_ +} + +void SliceParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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:ditcaffe.SliceParameter) +} + +::google::protobuf::uint8* SliceParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.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:ditcaffe.SliceParameter) + return target; +} + +int SliceParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.SliceParameter) + int 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; + { + int data_size = 0; + for (int i = 0; i < this->slice_point_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->slice_point(i)); + } + total_size += 1 * this->slice_point_size() + data_size; + } + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void SliceParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:ditcaffe.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:ditcaffe.SliceParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:ditcaffe.SliceParameter) + MergeFrom(*source); + } +} + +void SliceParameter::MergeFrom(const SliceParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.SliceParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + slice_point_.MergeFrom(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()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void SliceParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:ditcaffe.SliceParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void SliceParameter::CopyFrom(const SliceParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.SliceParameter) + if (&from == this) return; + Clear(); + MergeFrom(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:ditcaffe.SliceParameter.axis) + return axis_; +} + void SliceParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.SliceParameter.slice_point) +} + void SliceParameter::add_slice_point(::google::protobuf::uint32 value) { + slice_point_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.SliceParameter.slice_point) +} + const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +SliceParameter::slice_point() const { + // @@protoc_insertion_point(field_list:ditcaffe.SliceParameter.slice_point) + return slice_point_; +} + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +SliceParameter::mutable_slice_point() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.SliceParameter.slice_dim) +} + +#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) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.SoftmaxParameter) +} + +void SoftmaxParameter::InitAsDefaultInstance() { +} + +SoftmaxParameter::SoftmaxParameter(const SoftmaxParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.SoftmaxParameter) +} + +void SoftmaxParameter::SharedCtor() { + _cached_size_ = 0; + engine_ = 0; + axis_ = 1; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +SoftmaxParameter::~SoftmaxParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.SoftmaxParameter) + SharedDtor(); +} + +void SoftmaxParameter::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +SoftmaxParameter* SoftmaxParameter::default_instance_ = NULL; + +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:ditcaffe.SoftmaxParameter) + if (_has_bits_[0 / 32] & 3u) { + engine_ = 0; + axis_ = 1; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + 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:ditcaffe.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 .ditcaffe.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 (::ditcaffe::SoftmaxParameter_Engine_IsValid(value)) { + set_engine(static_cast< ::ditcaffe::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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + set_has_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:ditcaffe.SoftmaxParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.SoftmaxParameter) + return false; +#undef DO_ +} + +void SoftmaxParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.SoftmaxParameter) + // optional .ditcaffe.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:ditcaffe.SoftmaxParameter) +} + +::google::protobuf::uint8* SoftmaxParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.SoftmaxParameter) + // optional .ditcaffe.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:ditcaffe.SoftmaxParameter) + return target; +} + +int SoftmaxParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.SoftmaxParameter) + int total_size = 0; + + if (_has_bits_[0 / 32] & 3u) { + // optional .ditcaffe.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()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void SoftmaxParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:ditcaffe.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:ditcaffe.SoftmaxParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:ditcaffe.SoftmaxParameter) + MergeFrom(*source); + } +} + +void SoftmaxParameter::MergeFrom(const SoftmaxParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.SoftmaxParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void SoftmaxParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:ditcaffe.SoftmaxParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void SoftmaxParameter::CopyFrom(const SoftmaxParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.SoftmaxParameter) + if (&from == this) return; + Clear(); + MergeFrom(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 .ditcaffe.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(); +} + ::ditcaffe::SoftmaxParameter_Engine SoftmaxParameter::engine() const { + // @@protoc_insertion_point(field_get:ditcaffe.SoftmaxParameter.engine) + return static_cast< ::ditcaffe::SoftmaxParameter_Engine >(engine_); +} + void SoftmaxParameter::set_engine(::ditcaffe::SoftmaxParameter_Engine value) { + assert(::ditcaffe::SoftmaxParameter_Engine_IsValid(value)); + set_has_engine(); + engine_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.SoftmaxParameter.axis) + return axis_; +} + void SoftmaxParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.SoftmaxParameter.axis) +} + +#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) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.TanHParameter) +} + +void TanHParameter::InitAsDefaultInstance() { +} + +TanHParameter::TanHParameter(const TanHParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.TanHParameter) +} + +void TanHParameter::SharedCtor() { + _cached_size_ = 0; + engine_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +TanHParameter::~TanHParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.TanHParameter) + SharedDtor(); +} + +void TanHParameter::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +TanHParameter* TanHParameter::default_instance_ = NULL; + +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:ditcaffe.TanHParameter) + engine_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + 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:ditcaffe.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 .ditcaffe.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 (::ditcaffe::TanHParameter_Engine_IsValid(value)) { + set_engine(static_cast< ::ditcaffe::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:ditcaffe.TanHParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.TanHParameter) + return false; +#undef DO_ +} + +void TanHParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.TanHParameter) + // optional .ditcaffe.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:ditcaffe.TanHParameter) +} + +::google::protobuf::uint8* TanHParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.TanHParameter) + // optional .ditcaffe.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:ditcaffe.TanHParameter) + return target; +} + +int TanHParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.TanHParameter) + int total_size = 0; + + // optional .ditcaffe.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()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void TanHParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:ditcaffe.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:ditcaffe.TanHParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:ditcaffe.TanHParameter) + MergeFrom(*source); + } +} + +void TanHParameter::MergeFrom(const TanHParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.TanHParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_engine()) { + set_engine(from.engine()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void TanHParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:ditcaffe.TanHParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void TanHParameter::CopyFrom(const TanHParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.TanHParameter) + if (&from == this) return; + Clear(); + MergeFrom(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 .ditcaffe.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(); +} + ::ditcaffe::TanHParameter_Engine TanHParameter::engine() const { + // @@protoc_insertion_point(field_get:ditcaffe.TanHParameter.engine) + return static_cast< ::ditcaffe::TanHParameter_Engine >(engine_); +} + void TanHParameter::set_engine(::ditcaffe::TanHParameter_Engine value) { + assert(::ditcaffe::TanHParameter_Engine_IsValid(value)); + set_has_engine(); + engine_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.TanHParameter.engine) +} + +#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) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.TileParameter) +} + +void TileParameter::InitAsDefaultInstance() { +} + +TileParameter::TileParameter(const TileParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.TileParameter) +} + +void TileParameter::SharedCtor() { + _cached_size_ = 0; + axis_ = 1; + tiles_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +TileParameter::~TileParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.TileParameter) + SharedDtor(); +} + +void TileParameter::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +TileParameter* TileParameter::default_instance_ = NULL; + +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:ditcaffe.TileParameter) + if (_has_bits_[0 / 32] & 3u) { + axis_ = 1; + tiles_ = 0; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + 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:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + set_has_axis(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_tiles; + break; + } + + // optional int32 tiles = 2; + case 2: { + if (tag == 16) { + parse_tiles: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &tiles_))); + set_has_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:ditcaffe.TileParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.TileParameter) + return false; +#undef DO_ +} + +void TileParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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:ditcaffe.TileParameter) +} + +::google::protobuf::uint8* TileParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.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:ditcaffe.TileParameter) + return target; +} + +int TileParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.TileParameter) + int 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()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void TileParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:ditcaffe.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:ditcaffe.TileParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:ditcaffe.TileParameter) + MergeFrom(*source); + } +} + +void TileParameter::MergeFrom(const TileParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.TileParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void TileParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:ditcaffe.TileParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void TileParameter::CopyFrom(const TileParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.TileParameter) + if (&from == this) return; + Clear(); + MergeFrom(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:ditcaffe.TileParameter.axis) + return axis_; +} + void TileParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.TileParameter.tiles) + return tiles_; +} + void TileParameter::set_tiles(::google::protobuf::int32 value) { + set_has_tiles(); + tiles_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.TileParameter.tiles) +} + +#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) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.ThresholdParameter) +} + +void ThresholdParameter::InitAsDefaultInstance() { +} + +ThresholdParameter::ThresholdParameter(const ThresholdParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.ThresholdParameter) +} + +void ThresholdParameter::SharedCtor() { + _cached_size_ = 0; + threshold_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ThresholdParameter::~ThresholdParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.ThresholdParameter) + SharedDtor(); +} + +void ThresholdParameter::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +ThresholdParameter* ThresholdParameter::default_instance_ = NULL; + +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:ditcaffe.ThresholdParameter) + threshold_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + 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:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &threshold_))); + set_has_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:ditcaffe.ThresholdParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.ThresholdParameter) + return false; +#undef DO_ +} + +void ThresholdParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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:ditcaffe.ThresholdParameter) +} + +::google::protobuf::uint8* ThresholdParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.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:ditcaffe.ThresholdParameter) + return target; +} + +int ThresholdParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.ThresholdParameter) + int 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()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ThresholdParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:ditcaffe.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:ditcaffe.ThresholdParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:ditcaffe.ThresholdParameter) + MergeFrom(*source); + } +} + +void ThresholdParameter::MergeFrom(const ThresholdParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.ThresholdParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_threshold()) { + set_threshold(from.threshold()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void ThresholdParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:ditcaffe.ThresholdParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ThresholdParameter::CopyFrom(const ThresholdParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.ThresholdParameter) + if (&from == this) return; + Clear(); + MergeFrom(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:ditcaffe.ThresholdParameter.threshold) + return threshold_; +} + void ThresholdParameter::set_threshold(float value) { + set_has_threshold(); + threshold_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.ThresholdParameter.threshold) +} + +#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) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.WindowDataParameter) +} + +void WindowDataParameter::InitAsDefaultInstance() { +} + +WindowDataParameter::WindowDataParameter(const WindowDataParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.WindowDataParameter) +} + +void WindowDataParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + source_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + scale_ = 1; + mean_file_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + batch_size_ = 0u; + crop_size_ = 0u; + mirror_ = false; + fg_threshold_ = 0.5f; + bg_threshold_ = 0.5f; + fg_fraction_ = 0.25f; + context_pad_ = 0u; + crop_mode_.UnsafeSetDefault(_default_crop_mode_); + cache_images_ = false; + root_folder_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +WindowDataParameter::~WindowDataParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.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()); + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +WindowDataParameter* WindowDataParameter::default_instance_ = NULL; + +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:ditcaffe.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_, crop_size_); + if (has_source()) { + source_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + scale_ = 1; + if (has_mean_file()) { + mean_file_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + mirror_ = false; + 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_ + + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + 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:ditcaffe.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, + "ditcaffe.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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &scale_))); + set_has_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, + "ditcaffe.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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &batch_size_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &crop_size_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &mirror_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &fg_threshold_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &bg_threshold_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &fg_fraction_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &context_pad_))); + set_has_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, + "ditcaffe.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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &cache_images_))); + set_has_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, + "ditcaffe.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:ditcaffe.WindowDataParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.WindowDataParameter) + return false; +#undef DO_ +} + +void WindowDataParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.WindowDataParameter) + // optional string source = 1; + if (has_source()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->source().data(), this->source().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "ditcaffe.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, + "ditcaffe.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, + "ditcaffe.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, + "ditcaffe.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:ditcaffe.WindowDataParameter) +} + +::google::protobuf::uint8* WindowDataParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.WindowDataParameter) + // optional string source = 1; + if (has_source()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->source().data(), this->source().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "ditcaffe.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, + "ditcaffe.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, + "ditcaffe.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, + "ditcaffe.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:ditcaffe.WindowDataParameter) + return target; +} + +int WindowDataParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.WindowDataParameter) + int 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()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void WindowDataParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:ditcaffe.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:ditcaffe.WindowDataParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:ditcaffe.WindowDataParameter) + MergeFrom(*source); + } +} + +void WindowDataParameter::MergeFrom(const WindowDataParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.WindowDataParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void WindowDataParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:ditcaffe.WindowDataParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void WindowDataParameter::CopyFrom(const WindowDataParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.WindowDataParameter) + if (&from == this) return; + Clear(); + MergeFrom(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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.WindowDataParameter.source) +} + ::std::string* WindowDataParameter::mutable_source() { + set_has_source(); + // @@protoc_insertion_point(field_mutable:ditcaffe.WindowDataParameter.source) + return source_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* WindowDataParameter::release_source() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.WindowDataParameter.scale) + return scale_; +} + void WindowDataParameter::set_scale(float value) { + set_has_scale(); + scale_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.WindowDataParameter.mean_file) +} + ::std::string* WindowDataParameter::mutable_mean_file() { + set_has_mean_file(); + // @@protoc_insertion_point(field_mutable:ditcaffe.WindowDataParameter.mean_file) + return mean_file_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* WindowDataParameter::release_mean_file() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.WindowDataParameter.mirror) + return mirror_; +} + void WindowDataParameter::set_mirror(bool value) { + set_has_mirror(); + mirror_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.WindowDataParameter.crop_mode) +} + ::std::string* WindowDataParameter::mutable_crop_mode() { + set_has_crop_mode(); + // @@protoc_insertion_point(field_mutable:ditcaffe.WindowDataParameter.crop_mode) + return crop_mode_.MutableNoArena(_default_crop_mode_); +} + ::std::string* WindowDataParameter::release_crop_mode() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.WindowDataParameter.root_folder) +} + ::std::string* WindowDataParameter::mutable_root_folder() { + set_has_root_folder(); + // @@protoc_insertion_point(field_mutable:ditcaffe.WindowDataParameter.root_folder) + return root_folder_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* WindowDataParameter::release_root_folder() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.WindowDataParameter.root_folder) +} + +#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) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.SPPParameter) +} + +void SPPParameter::InitAsDefaultInstance() { +} + +SPPParameter::SPPParameter(const SPPParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.SPPParameter) +} + +void SPPParameter::SharedCtor() { + _cached_size_ = 0; + pyramid_height_ = 0u; + pool_ = 0; + engine_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +SPPParameter::~SPPParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.SPPParameter) + SharedDtor(); +} + +void SPPParameter::SharedDtor() { + if (this != default_instance_) { + } +} + +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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +SPPParameter* SPPParameter::default_instance_ = NULL; + +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:ditcaffe.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_ + + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + 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:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &pyramid_height_))); + set_has_pyramid_height(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_pool; + break; + } + + // optional .ditcaffe.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 (::ditcaffe::SPPParameter_PoolMethod_IsValid(value)) { + set_pool(static_cast< ::ditcaffe::SPPParameter_PoolMethod >(value)); + } else { + mutable_unknown_fields()->AddVarint(2, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(48)) goto parse_engine; + break; + } + + // optional .ditcaffe.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 (::ditcaffe::SPPParameter_Engine_IsValid(value)) { + set_engine(static_cast< ::ditcaffe::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:ditcaffe.SPPParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.SPPParameter) + return false; +#undef DO_ +} + +void SPPParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.SPPParameter) + // optional uint32 pyramid_height = 1; + if (has_pyramid_height()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->pyramid_height(), output); + } + + // optional .ditcaffe.SPPParameter.PoolMethod pool = 2 [default = MAX]; + if (has_pool()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 2, this->pool(), output); + } + + // optional .ditcaffe.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:ditcaffe.SPPParameter) +} + +::google::protobuf::uint8* SPPParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.SPPParameter) + // optional uint32 pyramid_height = 1; + if (has_pyramid_height()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->pyramid_height(), target); + } + + // optional .ditcaffe.SPPParameter.PoolMethod pool = 2 [default = MAX]; + if (has_pool()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 2, this->pool(), target); + } + + // optional .ditcaffe.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:ditcaffe.SPPParameter) + return target; +} + +int SPPParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.SPPParameter) + int 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 .ditcaffe.SPPParameter.PoolMethod pool = 2 [default = MAX]; + if (has_pool()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->pool()); + } + + // optional .ditcaffe.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()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void SPPParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:ditcaffe.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:ditcaffe.SPPParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:ditcaffe.SPPParameter) + MergeFrom(*source); + } +} + +void SPPParameter::MergeFrom(const SPPParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.SPPParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void SPPParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:ditcaffe.SPPParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void SPPParameter::CopyFrom(const SPPParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.SPPParameter) + if (&from == this) return; + Clear(); + MergeFrom(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:ditcaffe.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:ditcaffe.SPPParameter.pyramid_height) +} + +// optional .ditcaffe.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(); +} + ::ditcaffe::SPPParameter_PoolMethod SPPParameter::pool() const { + // @@protoc_insertion_point(field_get:ditcaffe.SPPParameter.pool) + return static_cast< ::ditcaffe::SPPParameter_PoolMethod >(pool_); +} + void SPPParameter::set_pool(::ditcaffe::SPPParameter_PoolMethod value) { + assert(::ditcaffe::SPPParameter_PoolMethod_IsValid(value)); + set_has_pool(); + pool_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.SPPParameter.pool) +} + +// optional .ditcaffe.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(); +} + ::ditcaffe::SPPParameter_Engine SPPParameter::engine() const { + // @@protoc_insertion_point(field_get:ditcaffe.SPPParameter.engine) + return static_cast< ::ditcaffe::SPPParameter_Engine >(engine_); +} + void SPPParameter::set_engine(::ditcaffe::SPPParameter_Engine value) { + assert(::ditcaffe::SPPParameter_Engine_IsValid(value)); + set_has_engine(); + engine_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.SPPParameter.engine) +} + +#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) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.V1LayerParameter) +} + +void V1LayerParameter::InitAsDefaultInstance() { + accuracy_param_ = const_cast< ::ditcaffe::AccuracyParameter*>(&::ditcaffe::AccuracyParameter::default_instance()); + argmax_param_ = const_cast< ::ditcaffe::ArgMaxParameter*>(&::ditcaffe::ArgMaxParameter::default_instance()); + concat_param_ = const_cast< ::ditcaffe::ConcatParameter*>(&::ditcaffe::ConcatParameter::default_instance()); + contrastive_loss_param_ = const_cast< ::ditcaffe::ContrastiveLossParameter*>(&::ditcaffe::ContrastiveLossParameter::default_instance()); + convolution_param_ = const_cast< ::ditcaffe::ConvolutionParameter*>(&::ditcaffe::ConvolutionParameter::default_instance()); + data_param_ = const_cast< ::ditcaffe::DataParameter*>(&::ditcaffe::DataParameter::default_instance()); + dropout_param_ = const_cast< ::ditcaffe::DropoutParameter*>(&::ditcaffe::DropoutParameter::default_instance()); + dummy_data_param_ = const_cast< ::ditcaffe::DummyDataParameter*>(&::ditcaffe::DummyDataParameter::default_instance()); + eltwise_param_ = const_cast< ::ditcaffe::EltwiseParameter*>(&::ditcaffe::EltwiseParameter::default_instance()); + exp_param_ = const_cast< ::ditcaffe::ExpParameter*>(&::ditcaffe::ExpParameter::default_instance()); + hdf5_data_param_ = const_cast< ::ditcaffe::HDF5DataParameter*>(&::ditcaffe::HDF5DataParameter::default_instance()); + hdf5_output_param_ = const_cast< ::ditcaffe::HDF5OutputParameter*>(&::ditcaffe::HDF5OutputParameter::default_instance()); + hinge_loss_param_ = const_cast< ::ditcaffe::HingeLossParameter*>(&::ditcaffe::HingeLossParameter::default_instance()); + image_data_param_ = const_cast< ::ditcaffe::ImageDataParameter*>(&::ditcaffe::ImageDataParameter::default_instance()); + infogain_loss_param_ = const_cast< ::ditcaffe::InfogainLossParameter*>(&::ditcaffe::InfogainLossParameter::default_instance()); + inner_product_param_ = const_cast< ::ditcaffe::InnerProductParameter*>(&::ditcaffe::InnerProductParameter::default_instance()); + lrn_param_ = const_cast< ::ditcaffe::LRNParameter*>(&::ditcaffe::LRNParameter::default_instance()); + memory_data_param_ = const_cast< ::ditcaffe::MemoryDataParameter*>(&::ditcaffe::MemoryDataParameter::default_instance()); + mvn_param_ = const_cast< ::ditcaffe::MVNParameter*>(&::ditcaffe::MVNParameter::default_instance()); + pooling_param_ = const_cast< ::ditcaffe::PoolingParameter*>(&::ditcaffe::PoolingParameter::default_instance()); + power_param_ = const_cast< ::ditcaffe::PowerParameter*>(&::ditcaffe::PowerParameter::default_instance()); + relu_param_ = const_cast< ::ditcaffe::ReLUParameter*>(&::ditcaffe::ReLUParameter::default_instance()); + sigmoid_param_ = const_cast< ::ditcaffe::SigmoidParameter*>(&::ditcaffe::SigmoidParameter::default_instance()); + softmax_param_ = const_cast< ::ditcaffe::SoftmaxParameter*>(&::ditcaffe::SoftmaxParameter::default_instance()); + slice_param_ = const_cast< ::ditcaffe::SliceParameter*>(&::ditcaffe::SliceParameter::default_instance()); + tanh_param_ = const_cast< ::ditcaffe::TanHParameter*>(&::ditcaffe::TanHParameter::default_instance()); + threshold_param_ = const_cast< ::ditcaffe::ThresholdParameter*>(&::ditcaffe::ThresholdParameter::default_instance()); + window_data_param_ = const_cast< ::ditcaffe::WindowDataParameter*>(&::ditcaffe::WindowDataParameter::default_instance()); + transform_param_ = const_cast< ::ditcaffe::TransformationParameter*>(&::ditcaffe::TransformationParameter::default_instance()); + loss_param_ = const_cast< ::ditcaffe::LossParameter*>(&::ditcaffe::LossParameter::default_instance()); + layer_ = const_cast< ::ditcaffe::V0LayerParameter*>(&::ditcaffe::V0LayerParameter::default_instance()); +} + +V1LayerParameter::V1LayerParameter(const V1LayerParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.V1LayerParameter) +} + +void V1LayerParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + type_ = 0; + 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; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +V1LayerParameter::~V1LayerParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.V1LayerParameter) + SharedDtor(); +} + +void V1LayerParameter::SharedDtor() { + name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != default_instance_) { + 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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +V1LayerParameter* V1LayerParameter::default_instance_ = NULL; + +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:ditcaffe.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_->::ditcaffe::AccuracyParameter::Clear(); + } + if (has_argmax_param()) { + if (argmax_param_ != NULL) argmax_param_->::ditcaffe::ArgMaxParameter::Clear(); + } + if (has_concat_param()) { + if (concat_param_ != NULL) concat_param_->::ditcaffe::ConcatParameter::Clear(); + } + if (has_contrastive_loss_param()) { + if (contrastive_loss_param_ != NULL) contrastive_loss_param_->::ditcaffe::ContrastiveLossParameter::Clear(); + } + } + if (_has_bits_[16 / 32] & 16711680u) { + if (has_convolution_param()) { + if (convolution_param_ != NULL) convolution_param_->::ditcaffe::ConvolutionParameter::Clear(); + } + if (has_data_param()) { + if (data_param_ != NULL) data_param_->::ditcaffe::DataParameter::Clear(); + } + if (has_dropout_param()) { + if (dropout_param_ != NULL) dropout_param_->::ditcaffe::DropoutParameter::Clear(); + } + if (has_dummy_data_param()) { + if (dummy_data_param_ != NULL) dummy_data_param_->::ditcaffe::DummyDataParameter::Clear(); + } + if (has_eltwise_param()) { + if (eltwise_param_ != NULL) eltwise_param_->::ditcaffe::EltwiseParameter::Clear(); + } + if (has_exp_param()) { + if (exp_param_ != NULL) exp_param_->::ditcaffe::ExpParameter::Clear(); + } + if (has_hdf5_data_param()) { + if (hdf5_data_param_ != NULL) hdf5_data_param_->::ditcaffe::HDF5DataParameter::Clear(); + } + if (has_hdf5_output_param()) { + if (hdf5_output_param_ != NULL) hdf5_output_param_->::ditcaffe::HDF5OutputParameter::Clear(); + } + } + if (_has_bits_[24 / 32] & 4278190080u) { + if (has_hinge_loss_param()) { + if (hinge_loss_param_ != NULL) hinge_loss_param_->::ditcaffe::HingeLossParameter::Clear(); + } + if (has_image_data_param()) { + if (image_data_param_ != NULL) image_data_param_->::ditcaffe::ImageDataParameter::Clear(); + } + if (has_infogain_loss_param()) { + if (infogain_loss_param_ != NULL) infogain_loss_param_->::ditcaffe::InfogainLossParameter::Clear(); + } + if (has_inner_product_param()) { + if (inner_product_param_ != NULL) inner_product_param_->::ditcaffe::InnerProductParameter::Clear(); + } + if (has_lrn_param()) { + if (lrn_param_ != NULL) lrn_param_->::ditcaffe::LRNParameter::Clear(); + } + if (has_memory_data_param()) { + if (memory_data_param_ != NULL) memory_data_param_->::ditcaffe::MemoryDataParameter::Clear(); + } + if (has_mvn_param()) { + if (mvn_param_ != NULL) mvn_param_->::ditcaffe::MVNParameter::Clear(); + } + if (has_pooling_param()) { + if (pooling_param_ != NULL) pooling_param_->::ditcaffe::PoolingParameter::Clear(); + } + } + if (_has_bits_[32 / 32] & 255u) { + if (has_power_param()) { + if (power_param_ != NULL) power_param_->::ditcaffe::PowerParameter::Clear(); + } + if (has_relu_param()) { + if (relu_param_ != NULL) relu_param_->::ditcaffe::ReLUParameter::Clear(); + } + if (has_sigmoid_param()) { + if (sigmoid_param_ != NULL) sigmoid_param_->::ditcaffe::SigmoidParameter::Clear(); + } + if (has_softmax_param()) { + if (softmax_param_ != NULL) softmax_param_->::ditcaffe::SoftmaxParameter::Clear(); + } + if (has_slice_param()) { + if (slice_param_ != NULL) slice_param_->::ditcaffe::SliceParameter::Clear(); + } + if (has_tanh_param()) { + if (tanh_param_ != NULL) tanh_param_->::ditcaffe::TanHParameter::Clear(); + } + if (has_threshold_param()) { + if (threshold_param_ != NULL) threshold_param_->::ditcaffe::ThresholdParameter::Clear(); + } + if (has_window_data_param()) { + if (window_data_param_ != NULL) window_data_param_->::ditcaffe::WindowDataParameter::Clear(); + } + } + if (_has_bits_[40 / 32] & 1792u) { + if (has_transform_param()) { + if (transform_param_ != NULL) transform_param_->::ditcaffe::TransformationParameter::Clear(); + } + if (has_loss_param()) { + if (loss_param_ != NULL) loss_param_->::ditcaffe::LossParameter::Clear(); + } + if (has_layer()) { + if (layer_ != NULL) layer_->::ditcaffe::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(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + 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:ditcaffe.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 .ditcaffe.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, + "ditcaffe.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, + "ditcaffe.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, + "ditcaffe.V1LayerParameter.name"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(40)) goto parse_type; + break; + } + + // optional .ditcaffe.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 (::ditcaffe::V1LayerParameter_LayerType_IsValid(value)) { + set_type(static_cast< ::ditcaffe::V1LayerParameter_LayerType >(value)); + } else { + mutable_unknown_fields()->AddVarint(5, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(50)) goto parse_blobs; + break; + } + + // repeated .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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, + "ditcaffe.V1LayerParameter.param"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(8010)) goto parse_param; + if (input->ExpectTag(8016)) goto parse_blob_share_mode; + break; + } + + // repeated .ditcaffe.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 (::ditcaffe::V1LayerParameter_DimCheckMode_IsValid(value)) { + add_blob_share_mode(static_cast< ::ditcaffe::V1LayerParameter_DimCheckMode >(value)); + } else { + mutable_unknown_fields()->AddVarint(1002, value); + } + } else if (tag == 8018) { + DO_((::google::protobuf::internal::WireFormat::ReadPackedEnumPreserveUnknowns( + input, + 1002, + ::ditcaffe::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:ditcaffe.V1LayerParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.V1LayerParameter) + return false; +#undef DO_ +} + +void V1LayerParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.V1LayerParameter) + // optional .ditcaffe.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, + "ditcaffe.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, + "ditcaffe.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, + "ditcaffe.V1LayerParameter.name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 4, this->name(), output); + } + + // optional .ditcaffe.V1LayerParameter.LayerType type = 5; + if (has_type()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 5, this->type(), output); + } + + // repeated .ditcaffe.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 .ditcaffe.ConcatParameter concat_param = 9; + if (has_concat_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 9, *this->concat_param_, output); + } + + // optional .ditcaffe.ConvolutionParameter convolution_param = 10; + if (has_convolution_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 10, *this->convolution_param_, output); + } + + // optional .ditcaffe.DataParameter data_param = 11; + if (has_data_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 11, *this->data_param_, output); + } + + // optional .ditcaffe.DropoutParameter dropout_param = 12; + if (has_dropout_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 12, *this->dropout_param_, output); + } + + // optional .ditcaffe.HDF5DataParameter hdf5_data_param = 13; + if (has_hdf5_data_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 13, *this->hdf5_data_param_, output); + } + + // optional .ditcaffe.HDF5OutputParameter hdf5_output_param = 14; + if (has_hdf5_output_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 14, *this->hdf5_output_param_, output); + } + + // optional .ditcaffe.ImageDataParameter image_data_param = 15; + if (has_image_data_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 15, *this->image_data_param_, output); + } + + // optional .ditcaffe.InfogainLossParameter infogain_loss_param = 16; + if (has_infogain_loss_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 16, *this->infogain_loss_param_, output); + } + + // optional .ditcaffe.InnerProductParameter inner_product_param = 17; + if (has_inner_product_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 17, *this->inner_product_param_, output); + } + + // optional .ditcaffe.LRNParameter lrn_param = 18; + if (has_lrn_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 18, *this->lrn_param_, output); + } + + // optional .ditcaffe.PoolingParameter pooling_param = 19; + if (has_pooling_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 19, *this->pooling_param_, output); + } + + // optional .ditcaffe.WindowDataParameter window_data_param = 20; + if (has_window_data_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 20, *this->window_data_param_, output); + } + + // optional .ditcaffe.PowerParameter power_param = 21; + if (has_power_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 21, *this->power_param_, output); + } + + // optional .ditcaffe.MemoryDataParameter memory_data_param = 22; + if (has_memory_data_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 22, *this->memory_data_param_, output); + } + + // optional .ditcaffe.ArgMaxParameter argmax_param = 23; + if (has_argmax_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 23, *this->argmax_param_, output); + } + + // optional .ditcaffe.EltwiseParameter eltwise_param = 24; + if (has_eltwise_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 24, *this->eltwise_param_, output); + } + + // optional .ditcaffe.ThresholdParameter threshold_param = 25; + if (has_threshold_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 25, *this->threshold_param_, output); + } + + // optional .ditcaffe.DummyDataParameter dummy_data_param = 26; + if (has_dummy_data_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 26, *this->dummy_data_param_, output); + } + + // optional .ditcaffe.AccuracyParameter accuracy_param = 27; + if (has_accuracy_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 27, *this->accuracy_param_, output); + } + + // optional .ditcaffe.HingeLossParameter hinge_loss_param = 29; + if (has_hinge_loss_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 29, *this->hinge_loss_param_, output); + } + + // optional .ditcaffe.ReLUParameter relu_param = 30; + if (has_relu_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 30, *this->relu_param_, output); + } + + // optional .ditcaffe.SliceParameter slice_param = 31; + if (has_slice_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 31, *this->slice_param_, output); + } + + // repeated .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.TransformationParameter transform_param = 36; + if (has_transform_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 36, *this->transform_param_, output); + } + + // optional .ditcaffe.TanHParameter tanh_param = 37; + if (has_tanh_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 37, *this->tanh_param_, output); + } + + // optional .ditcaffe.SigmoidParameter sigmoid_param = 38; + if (has_sigmoid_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 38, *this->sigmoid_param_, output); + } + + // optional .ditcaffe.SoftmaxParameter softmax_param = 39; + if (has_softmax_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 39, *this->softmax_param_, output); + } + + // optional .ditcaffe.ContrastiveLossParameter contrastive_loss_param = 40; + if (has_contrastive_loss_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 40, *this->contrastive_loss_param_, output); + } + + // optional .ditcaffe.ExpParameter exp_param = 41; + if (has_exp_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 41, *this->exp_param_, output); + } + + // optional .ditcaffe.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, + "ditcaffe.V1LayerParameter.param"); + ::google::protobuf::internal::WireFormatLite::WriteString( + 1001, this->param(i), output); + } + + // repeated .ditcaffe.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:ditcaffe.V1LayerParameter) +} + +::google::protobuf::uint8* V1LayerParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.V1LayerParameter) + // optional .ditcaffe.V0LayerParameter layer = 1; + if (has_layer()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 1, *this->layer_, 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, + "ditcaffe.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, + "ditcaffe.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, + "ditcaffe.V1LayerParameter.name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 4, this->name(), target); + } + + // optional .ditcaffe.V1LayerParameter.LayerType type = 5; + if (has_type()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 5, this->type(), target); + } + + // repeated .ditcaffe.BlobProto blobs = 6; + for (unsigned int i = 0, n = this->blobs_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 6, this->blobs(i), 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 .ditcaffe.ConcatParameter concat_param = 9; + if (has_concat_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 9, *this->concat_param_, target); + } + + // optional .ditcaffe.ConvolutionParameter convolution_param = 10; + if (has_convolution_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 10, *this->convolution_param_, target); + } + + // optional .ditcaffe.DataParameter data_param = 11; + if (has_data_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 11, *this->data_param_, target); + } + + // optional .ditcaffe.DropoutParameter dropout_param = 12; + if (has_dropout_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 12, *this->dropout_param_, target); + } + + // optional .ditcaffe.HDF5DataParameter hdf5_data_param = 13; + if (has_hdf5_data_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 13, *this->hdf5_data_param_, target); + } + + // optional .ditcaffe.HDF5OutputParameter hdf5_output_param = 14; + if (has_hdf5_output_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 14, *this->hdf5_output_param_, target); + } + + // optional .ditcaffe.ImageDataParameter image_data_param = 15; + if (has_image_data_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 15, *this->image_data_param_, target); + } + + // optional .ditcaffe.InfogainLossParameter infogain_loss_param = 16; + if (has_infogain_loss_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 16, *this->infogain_loss_param_, target); + } + + // optional .ditcaffe.InnerProductParameter inner_product_param = 17; + if (has_inner_product_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 17, *this->inner_product_param_, target); + } + + // optional .ditcaffe.LRNParameter lrn_param = 18; + if (has_lrn_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 18, *this->lrn_param_, target); + } + + // optional .ditcaffe.PoolingParameter pooling_param = 19; + if (has_pooling_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 19, *this->pooling_param_, target); + } + + // optional .ditcaffe.WindowDataParameter window_data_param = 20; + if (has_window_data_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 20, *this->window_data_param_, target); + } + + // optional .ditcaffe.PowerParameter power_param = 21; + if (has_power_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 21, *this->power_param_, target); + } + + // optional .ditcaffe.MemoryDataParameter memory_data_param = 22; + if (has_memory_data_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 22, *this->memory_data_param_, target); + } + + // optional .ditcaffe.ArgMaxParameter argmax_param = 23; + if (has_argmax_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 23, *this->argmax_param_, target); + } + + // optional .ditcaffe.EltwiseParameter eltwise_param = 24; + if (has_eltwise_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 24, *this->eltwise_param_, target); + } + + // optional .ditcaffe.ThresholdParameter threshold_param = 25; + if (has_threshold_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 25, *this->threshold_param_, target); + } + + // optional .ditcaffe.DummyDataParameter dummy_data_param = 26; + if (has_dummy_data_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 26, *this->dummy_data_param_, target); + } + + // optional .ditcaffe.AccuracyParameter accuracy_param = 27; + if (has_accuracy_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 27, *this->accuracy_param_, target); + } + + // optional .ditcaffe.HingeLossParameter hinge_loss_param = 29; + if (has_hinge_loss_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 29, *this->hinge_loss_param_, target); + } + + // optional .ditcaffe.ReLUParameter relu_param = 30; + if (has_relu_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 30, *this->relu_param_, target); + } + + // optional .ditcaffe.SliceParameter slice_param = 31; + if (has_slice_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 31, *this->slice_param_, target); + } + + // repeated .ditcaffe.NetStateRule include = 32; + for (unsigned int i = 0, n = this->include_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 32, this->include(i), target); + } + + // repeated .ditcaffe.NetStateRule exclude = 33; + for (unsigned int i = 0, n = this->exclude_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 33, this->exclude(i), target); + } + + // optional .ditcaffe.MVNParameter mvn_param = 34; + if (has_mvn_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 34, *this->mvn_param_, 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 .ditcaffe.TransformationParameter transform_param = 36; + if (has_transform_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 36, *this->transform_param_, target); + } + + // optional .ditcaffe.TanHParameter tanh_param = 37; + if (has_tanh_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 37, *this->tanh_param_, target); + } + + // optional .ditcaffe.SigmoidParameter sigmoid_param = 38; + if (has_sigmoid_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 38, *this->sigmoid_param_, target); + } + + // optional .ditcaffe.SoftmaxParameter softmax_param = 39; + if (has_softmax_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 39, *this->softmax_param_, target); + } + + // optional .ditcaffe.ContrastiveLossParameter contrastive_loss_param = 40; + if (has_contrastive_loss_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 40, *this->contrastive_loss_param_, target); + } + + // optional .ditcaffe.ExpParameter exp_param = 41; + if (has_exp_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 41, *this->exp_param_, target); + } + + // optional .ditcaffe.LossParameter loss_param = 42; + if (has_loss_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 42, *this->loss_param_, 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, + "ditcaffe.V1LayerParameter.param"); + target = ::google::protobuf::internal::WireFormatLite:: + WriteStringToArray(1001, this->param(i), target); + } + + // repeated .ditcaffe.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:ditcaffe.V1LayerParameter) + return target; +} + +int V1LayerParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.V1LayerParameter) + int 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 .ditcaffe.V1LayerParameter.LayerType type = 5; + if (has_type()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->type()); + } + + } + if (_has_bits_[12 / 32] & 61440u) { + // optional .ditcaffe.AccuracyParameter accuracy_param = 27; + if (has_accuracy_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->accuracy_param_); + } + + // optional .ditcaffe.ArgMaxParameter argmax_param = 23; + if (has_argmax_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->argmax_param_); + } + + // optional .ditcaffe.ConcatParameter concat_param = 9; + if (has_concat_param()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->concat_param_); + } + + // optional .ditcaffe.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 .ditcaffe.ConvolutionParameter convolution_param = 10; + if (has_convolution_param()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->convolution_param_); + } + + // optional .ditcaffe.DataParameter data_param = 11; + if (has_data_param()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->data_param_); + } + + // optional .ditcaffe.DropoutParameter dropout_param = 12; + if (has_dropout_param()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->dropout_param_); + } + + // optional .ditcaffe.DummyDataParameter dummy_data_param = 26; + if (has_dummy_data_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->dummy_data_param_); + } + + // optional .ditcaffe.EltwiseParameter eltwise_param = 24; + if (has_eltwise_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->eltwise_param_); + } + + // optional .ditcaffe.ExpParameter exp_param = 41; + if (has_exp_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->exp_param_); + } + + // optional .ditcaffe.HDF5DataParameter hdf5_data_param = 13; + if (has_hdf5_data_param()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->hdf5_data_param_); + } + + // optional .ditcaffe.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 .ditcaffe.HingeLossParameter hinge_loss_param = 29; + if (has_hinge_loss_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->hinge_loss_param_); + } + + // optional .ditcaffe.ImageDataParameter image_data_param = 15; + if (has_image_data_param()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->image_data_param_); + } + + // optional .ditcaffe.InfogainLossParameter infogain_loss_param = 16; + if (has_infogain_loss_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->infogain_loss_param_); + } + + // optional .ditcaffe.InnerProductParameter inner_product_param = 17; + if (has_inner_product_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->inner_product_param_); + } + + // optional .ditcaffe.LRNParameter lrn_param = 18; + if (has_lrn_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->lrn_param_); + } + + // optional .ditcaffe.MemoryDataParameter memory_data_param = 22; + if (has_memory_data_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->memory_data_param_); + } + + // optional .ditcaffe.MVNParameter mvn_param = 34; + if (has_mvn_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->mvn_param_); + } + + // optional .ditcaffe.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 .ditcaffe.PowerParameter power_param = 21; + if (has_power_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->power_param_); + } + + // optional .ditcaffe.ReLUParameter relu_param = 30; + if (has_relu_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->relu_param_); + } + + // optional .ditcaffe.SigmoidParameter sigmoid_param = 38; + if (has_sigmoid_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->sigmoid_param_); + } + + // optional .ditcaffe.SoftmaxParameter softmax_param = 39; + if (has_softmax_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->softmax_param_); + } + + // optional .ditcaffe.SliceParameter slice_param = 31; + if (has_slice_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->slice_param_); + } + + // optional .ditcaffe.TanHParameter tanh_param = 37; + if (has_tanh_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->tanh_param_); + } + + // optional .ditcaffe.ThresholdParameter threshold_param = 25; + if (has_threshold_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->threshold_param_); + } + + // optional .ditcaffe.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 .ditcaffe.TransformationParameter transform_param = 36; + if (has_transform_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->transform_param_); + } + + // optional .ditcaffe.LossParameter loss_param = 42; + if (has_loss_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->loss_param_); + } + + // optional .ditcaffe.V0LayerParameter layer = 1; + if (has_layer()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->layer_); + } + + } + // repeated string bottom = 2; + total_size += 1 * 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 * this->top_size(); + for (int i = 0; i < this->top_size(); i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->top(i)); + } + + // repeated .ditcaffe.NetStateRule include = 32; + total_size += 2 * this->include_size(); + for (int i = 0; i < this->include_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->include(i)); + } + + // repeated .ditcaffe.NetStateRule exclude = 33; + total_size += 2 * this->exclude_size(); + for (int i = 0; i < this->exclude_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->exclude(i)); + } + + // repeated .ditcaffe.BlobProto blobs = 6; + total_size += 1 * this->blobs_size(); + for (int i = 0; i < this->blobs_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->blobs(i)); + } + + // repeated string param = 1001; + total_size += 2 * this->param_size(); + for (int i = 0; i < this->param_size(); i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->param(i)); + } + + // repeated .ditcaffe.V1LayerParameter.DimCheckMode blob_share_mode = 1002; + { + int data_size = 0; + for (int i = 0; i < this->blob_share_mode_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite::EnumSize( + this->blob_share_mode(i)); + } + total_size += 2 * this->blob_share_mode_size() + data_size; + } + + // repeated float blobs_lr = 7; + { + int data_size = 0; + data_size = 4 * this->blobs_lr_size(); + total_size += 1 * this->blobs_lr_size() + data_size; + } + + // repeated float weight_decay = 8; + { + int data_size = 0; + data_size = 4 * this->weight_decay_size(); + total_size += 1 * this->weight_decay_size() + data_size; + } + + // repeated float loss_weight = 35; + { + int data_size = 0; + data_size = 4 * this->loss_weight_size(); + total_size += 2 * this->loss_weight_size() + data_size; + } + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void V1LayerParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:ditcaffe.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:ditcaffe.V1LayerParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:ditcaffe.V1LayerParameter) + MergeFrom(*source); + } +} + +void V1LayerParameter::MergeFrom(const V1LayerParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.V1LayerParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + bottom_.MergeFrom(from.bottom_); + top_.MergeFrom(from.top_); + include_.MergeFrom(from.include_); + exclude_.MergeFrom(from.exclude_); + blobs_.MergeFrom(from.blobs_); + param_.MergeFrom(from.param_); + blob_share_mode_.MergeFrom(from.blob_share_mode_); + blobs_lr_.MergeFrom(from.blobs_lr_); + weight_decay_.MergeFrom(from.weight_decay_); + loss_weight_.MergeFrom(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()->::ditcaffe::AccuracyParameter::MergeFrom(from.accuracy_param()); + } + if (from.has_argmax_param()) { + mutable_argmax_param()->::ditcaffe::ArgMaxParameter::MergeFrom(from.argmax_param()); + } + if (from.has_concat_param()) { + mutable_concat_param()->::ditcaffe::ConcatParameter::MergeFrom(from.concat_param()); + } + if (from.has_contrastive_loss_param()) { + mutable_contrastive_loss_param()->::ditcaffe::ContrastiveLossParameter::MergeFrom(from.contrastive_loss_param()); + } + } + if (from._has_bits_[16 / 32] & (0xffu << (16 % 32))) { + if (from.has_convolution_param()) { + mutable_convolution_param()->::ditcaffe::ConvolutionParameter::MergeFrom(from.convolution_param()); + } + if (from.has_data_param()) { + mutable_data_param()->::ditcaffe::DataParameter::MergeFrom(from.data_param()); + } + if (from.has_dropout_param()) { + mutable_dropout_param()->::ditcaffe::DropoutParameter::MergeFrom(from.dropout_param()); + } + if (from.has_dummy_data_param()) { + mutable_dummy_data_param()->::ditcaffe::DummyDataParameter::MergeFrom(from.dummy_data_param()); + } + if (from.has_eltwise_param()) { + mutable_eltwise_param()->::ditcaffe::EltwiseParameter::MergeFrom(from.eltwise_param()); + } + if (from.has_exp_param()) { + mutable_exp_param()->::ditcaffe::ExpParameter::MergeFrom(from.exp_param()); + } + if (from.has_hdf5_data_param()) { + mutable_hdf5_data_param()->::ditcaffe::HDF5DataParameter::MergeFrom(from.hdf5_data_param()); + } + if (from.has_hdf5_output_param()) { + mutable_hdf5_output_param()->::ditcaffe::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()->::ditcaffe::HingeLossParameter::MergeFrom(from.hinge_loss_param()); + } + if (from.has_image_data_param()) { + mutable_image_data_param()->::ditcaffe::ImageDataParameter::MergeFrom(from.image_data_param()); + } + if (from.has_infogain_loss_param()) { + mutable_infogain_loss_param()->::ditcaffe::InfogainLossParameter::MergeFrom(from.infogain_loss_param()); + } + if (from.has_inner_product_param()) { + mutable_inner_product_param()->::ditcaffe::InnerProductParameter::MergeFrom(from.inner_product_param()); + } + if (from.has_lrn_param()) { + mutable_lrn_param()->::ditcaffe::LRNParameter::MergeFrom(from.lrn_param()); + } + if (from.has_memory_data_param()) { + mutable_memory_data_param()->::ditcaffe::MemoryDataParameter::MergeFrom(from.memory_data_param()); + } + if (from.has_mvn_param()) { + mutable_mvn_param()->::ditcaffe::MVNParameter::MergeFrom(from.mvn_param()); + } + if (from.has_pooling_param()) { + mutable_pooling_param()->::ditcaffe::PoolingParameter::MergeFrom(from.pooling_param()); + } + } + if (from._has_bits_[32 / 32] & (0xffu << (32 % 32))) { + if (from.has_power_param()) { + mutable_power_param()->::ditcaffe::PowerParameter::MergeFrom(from.power_param()); + } + if (from.has_relu_param()) { + mutable_relu_param()->::ditcaffe::ReLUParameter::MergeFrom(from.relu_param()); + } + if (from.has_sigmoid_param()) { + mutable_sigmoid_param()->::ditcaffe::SigmoidParameter::MergeFrom(from.sigmoid_param()); + } + if (from.has_softmax_param()) { + mutable_softmax_param()->::ditcaffe::SoftmaxParameter::MergeFrom(from.softmax_param()); + } + if (from.has_slice_param()) { + mutable_slice_param()->::ditcaffe::SliceParameter::MergeFrom(from.slice_param()); + } + if (from.has_tanh_param()) { + mutable_tanh_param()->::ditcaffe::TanHParameter::MergeFrom(from.tanh_param()); + } + if (from.has_threshold_param()) { + mutable_threshold_param()->::ditcaffe::ThresholdParameter::MergeFrom(from.threshold_param()); + } + if (from.has_window_data_param()) { + mutable_window_data_param()->::ditcaffe::WindowDataParameter::MergeFrom(from.window_data_param()); + } + } + if (from._has_bits_[40 / 32] & (0xffu << (40 % 32))) { + if (from.has_transform_param()) { + mutable_transform_param()->::ditcaffe::TransformationParameter::MergeFrom(from.transform_param()); + } + if (from.has_loss_param()) { + mutable_loss_param()->::ditcaffe::LossParameter::MergeFrom(from.loss_param()); + } + if (from.has_layer()) { + mutable_layer()->::ditcaffe::V0LayerParameter::MergeFrom(from.layer()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void V1LayerParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:ditcaffe.V1LayerParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void V1LayerParameter::CopyFrom(const V1LayerParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.V1LayerParameter) + if (&from == this) return; + Clear(); + MergeFrom(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:ditcaffe.V1LayerParameter.bottom) + return bottom_.Get(index); +} + ::std::string* V1LayerParameter::mutable_bottom(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.bottom) + return bottom_.Mutable(index); +} + void V1LayerParameter::set_bottom(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.V1LayerParameter.bottom) +} + ::std::string* V1LayerParameter::add_bottom() { + // @@protoc_insertion_point(field_add_mutable:ditcaffe.V1LayerParameter.bottom) + return bottom_.Add(); +} + void V1LayerParameter::add_bottom(const ::std::string& value) { + bottom_.Add()->assign(value); + // @@protoc_insertion_point(field_add:ditcaffe.V1LayerParameter.bottom) +} + void V1LayerParameter::add_bottom(const char* value) { + bottom_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:ditcaffe.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:ditcaffe.V1LayerParameter.bottom) +} + const ::google::protobuf::RepeatedPtrField< ::std::string>& +V1LayerParameter::bottom() const { + // @@protoc_insertion_point(field_list:ditcaffe.V1LayerParameter.bottom) + return bottom_; +} + ::google::protobuf::RepeatedPtrField< ::std::string>* +V1LayerParameter::mutable_bottom() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.V1LayerParameter.top) + return top_.Get(index); +} + ::std::string* V1LayerParameter::mutable_top(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.top) + return top_.Mutable(index); +} + void V1LayerParameter::set_top(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.V1LayerParameter.top) +} + ::std::string* V1LayerParameter::add_top() { + // @@protoc_insertion_point(field_add_mutable:ditcaffe.V1LayerParameter.top) + return top_.Add(); +} + void V1LayerParameter::add_top(const ::std::string& value) { + top_.Add()->assign(value); + // @@protoc_insertion_point(field_add:ditcaffe.V1LayerParameter.top) +} + void V1LayerParameter::add_top(const char* value) { + top_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:ditcaffe.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:ditcaffe.V1LayerParameter.top) +} + const ::google::protobuf::RepeatedPtrField< ::std::string>& +V1LayerParameter::top() const { + // @@protoc_insertion_point(field_list:ditcaffe.V1LayerParameter.top) + return top_; +} + ::google::protobuf::RepeatedPtrField< ::std::string>* +V1LayerParameter::mutable_top() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.V1LayerParameter.name) +} + ::std::string* V1LayerParameter::mutable_name() { + set_has_name(); + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.name) + return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* V1LayerParameter::release_name() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.V1LayerParameter.name) +} + +// repeated .ditcaffe.NetStateRule include = 32; +int V1LayerParameter::include_size() const { + return include_.size(); +} +void V1LayerParameter::clear_include() { + include_.Clear(); +} +const ::ditcaffe::NetStateRule& V1LayerParameter::include(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.include) + return include_.Get(index); +} +::ditcaffe::NetStateRule* V1LayerParameter::mutable_include(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.include) + return include_.Mutable(index); +} +::ditcaffe::NetStateRule* V1LayerParameter::add_include() { + // @@protoc_insertion_point(field_add:ditcaffe.V1LayerParameter.include) + return include_.Add(); +} +::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >* +V1LayerParameter::mutable_include() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.V1LayerParameter.include) + return &include_; +} +const ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >& +V1LayerParameter::include() const { + // @@protoc_insertion_point(field_list:ditcaffe.V1LayerParameter.include) + return include_; +} + +// repeated .ditcaffe.NetStateRule exclude = 33; +int V1LayerParameter::exclude_size() const { + return exclude_.size(); +} +void V1LayerParameter::clear_exclude() { + exclude_.Clear(); +} +const ::ditcaffe::NetStateRule& V1LayerParameter::exclude(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.exclude) + return exclude_.Get(index); +} +::ditcaffe::NetStateRule* V1LayerParameter::mutable_exclude(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.exclude) + return exclude_.Mutable(index); +} +::ditcaffe::NetStateRule* V1LayerParameter::add_exclude() { + // @@protoc_insertion_point(field_add:ditcaffe.V1LayerParameter.exclude) + return exclude_.Add(); +} +::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >* +V1LayerParameter::mutable_exclude() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.V1LayerParameter.exclude) + return &exclude_; +} +const ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >& +V1LayerParameter::exclude() const { + // @@protoc_insertion_point(field_list:ditcaffe.V1LayerParameter.exclude) + return exclude_; +} + +// optional .ditcaffe.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(); +} + ::ditcaffe::V1LayerParameter_LayerType V1LayerParameter::type() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.type) + return static_cast< ::ditcaffe::V1LayerParameter_LayerType >(type_); +} + void V1LayerParameter::set_type(::ditcaffe::V1LayerParameter_LayerType value) { + assert(::ditcaffe::V1LayerParameter_LayerType_IsValid(value)); + set_has_type(); + type_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.V1LayerParameter.type) +} + +// repeated .ditcaffe.BlobProto blobs = 6; +int V1LayerParameter::blobs_size() const { + return blobs_.size(); +} +void V1LayerParameter::clear_blobs() { + blobs_.Clear(); +} +const ::ditcaffe::BlobProto& V1LayerParameter::blobs(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.blobs) + return blobs_.Get(index); +} +::ditcaffe::BlobProto* V1LayerParameter::mutable_blobs(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.blobs) + return blobs_.Mutable(index); +} +::ditcaffe::BlobProto* V1LayerParameter::add_blobs() { + // @@protoc_insertion_point(field_add:ditcaffe.V1LayerParameter.blobs) + return blobs_.Add(); +} +::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >* +V1LayerParameter::mutable_blobs() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.V1LayerParameter.blobs) + return &blobs_; +} +const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >& +V1LayerParameter::blobs() const { + // @@protoc_insertion_point(field_list:ditcaffe.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:ditcaffe.V1LayerParameter.param) + return param_.Get(index); +} + ::std::string* V1LayerParameter::mutable_param(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.param) + return param_.Mutable(index); +} + void V1LayerParameter::set_param(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.V1LayerParameter.param) +} + ::std::string* V1LayerParameter::add_param() { + // @@protoc_insertion_point(field_add_mutable:ditcaffe.V1LayerParameter.param) + return param_.Add(); +} + void V1LayerParameter::add_param(const ::std::string& value) { + param_.Add()->assign(value); + // @@protoc_insertion_point(field_add:ditcaffe.V1LayerParameter.param) +} + void V1LayerParameter::add_param(const char* value) { + param_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:ditcaffe.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:ditcaffe.V1LayerParameter.param) +} + const ::google::protobuf::RepeatedPtrField< ::std::string>& +V1LayerParameter::param() const { + // @@protoc_insertion_point(field_list:ditcaffe.V1LayerParameter.param) + return param_; +} + ::google::protobuf::RepeatedPtrField< ::std::string>* +V1LayerParameter::mutable_param() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.V1LayerParameter.param) + return ¶m_; +} + +// repeated .ditcaffe.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(); +} + ::ditcaffe::V1LayerParameter_DimCheckMode V1LayerParameter::blob_share_mode(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.blob_share_mode) + return static_cast< ::ditcaffe::V1LayerParameter_DimCheckMode >(blob_share_mode_.Get(index)); +} + void V1LayerParameter::set_blob_share_mode(int index, ::ditcaffe::V1LayerParameter_DimCheckMode value) { + assert(::ditcaffe::V1LayerParameter_DimCheckMode_IsValid(value)); + blob_share_mode_.Set(index, value); + // @@protoc_insertion_point(field_set:ditcaffe.V1LayerParameter.blob_share_mode) +} + void V1LayerParameter::add_blob_share_mode(::ditcaffe::V1LayerParameter_DimCheckMode value) { + assert(::ditcaffe::V1LayerParameter_DimCheckMode_IsValid(value)); + blob_share_mode_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.V1LayerParameter.blob_share_mode) +} + const ::google::protobuf::RepeatedField& +V1LayerParameter::blob_share_mode() const { + // @@protoc_insertion_point(field_list:ditcaffe.V1LayerParameter.blob_share_mode) + return blob_share_mode_; +} + ::google::protobuf::RepeatedField* +V1LayerParameter::mutable_blob_share_mode() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.V1LayerParameter.blobs_lr) +} + void V1LayerParameter::add_blobs_lr(float value) { + blobs_lr_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.V1LayerParameter.blobs_lr) +} + const ::google::protobuf::RepeatedField< float >& +V1LayerParameter::blobs_lr() const { + // @@protoc_insertion_point(field_list:ditcaffe.V1LayerParameter.blobs_lr) + return blobs_lr_; +} + ::google::protobuf::RepeatedField< float >* +V1LayerParameter::mutable_blobs_lr() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.V1LayerParameter.weight_decay) +} + void V1LayerParameter::add_weight_decay(float value) { + weight_decay_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.V1LayerParameter.weight_decay) +} + const ::google::protobuf::RepeatedField< float >& +V1LayerParameter::weight_decay() const { + // @@protoc_insertion_point(field_list:ditcaffe.V1LayerParameter.weight_decay) + return weight_decay_; +} + ::google::protobuf::RepeatedField< float >* +V1LayerParameter::mutable_weight_decay() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.V1LayerParameter.loss_weight) +} + void V1LayerParameter::add_loss_weight(float value) { + loss_weight_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.V1LayerParameter.loss_weight) +} + const ::google::protobuf::RepeatedField< float >& +V1LayerParameter::loss_weight() const { + // @@protoc_insertion_point(field_list:ditcaffe.V1LayerParameter.loss_weight) + return loss_weight_; +} + ::google::protobuf::RepeatedField< float >* +V1LayerParameter::mutable_loss_weight() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.V1LayerParameter.loss_weight) + return &loss_weight_; +} + +// optional .ditcaffe.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_->::ditcaffe::AccuracyParameter::Clear(); + clear_has_accuracy_param(); +} +const ::ditcaffe::AccuracyParameter& V1LayerParameter::accuracy_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.accuracy_param) + return accuracy_param_ != NULL ? *accuracy_param_ : *default_instance_->accuracy_param_; +} +::ditcaffe::AccuracyParameter* V1LayerParameter::mutable_accuracy_param() { + set_has_accuracy_param(); + if (accuracy_param_ == NULL) { + accuracy_param_ = new ::ditcaffe::AccuracyParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.accuracy_param) + return accuracy_param_; +} +::ditcaffe::AccuracyParameter* V1LayerParameter::release_accuracy_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.accuracy_param) + clear_has_accuracy_param(); + ::ditcaffe::AccuracyParameter* temp = accuracy_param_; + accuracy_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_accuracy_param(::ditcaffe::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:ditcaffe.V1LayerParameter.accuracy_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ArgMaxParameter::Clear(); + clear_has_argmax_param(); +} +const ::ditcaffe::ArgMaxParameter& V1LayerParameter::argmax_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.argmax_param) + return argmax_param_ != NULL ? *argmax_param_ : *default_instance_->argmax_param_; +} +::ditcaffe::ArgMaxParameter* V1LayerParameter::mutable_argmax_param() { + set_has_argmax_param(); + if (argmax_param_ == NULL) { + argmax_param_ = new ::ditcaffe::ArgMaxParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.argmax_param) + return argmax_param_; +} +::ditcaffe::ArgMaxParameter* V1LayerParameter::release_argmax_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.argmax_param) + clear_has_argmax_param(); + ::ditcaffe::ArgMaxParameter* temp = argmax_param_; + argmax_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_argmax_param(::ditcaffe::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:ditcaffe.V1LayerParameter.argmax_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ConcatParameter::Clear(); + clear_has_concat_param(); +} +const ::ditcaffe::ConcatParameter& V1LayerParameter::concat_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.concat_param) + return concat_param_ != NULL ? *concat_param_ : *default_instance_->concat_param_; +} +::ditcaffe::ConcatParameter* V1LayerParameter::mutable_concat_param() { + set_has_concat_param(); + if (concat_param_ == NULL) { + concat_param_ = new ::ditcaffe::ConcatParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.concat_param) + return concat_param_; +} +::ditcaffe::ConcatParameter* V1LayerParameter::release_concat_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.concat_param) + clear_has_concat_param(); + ::ditcaffe::ConcatParameter* temp = concat_param_; + concat_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_concat_param(::ditcaffe::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:ditcaffe.V1LayerParameter.concat_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ContrastiveLossParameter::Clear(); + clear_has_contrastive_loss_param(); +} +const ::ditcaffe::ContrastiveLossParameter& V1LayerParameter::contrastive_loss_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.contrastive_loss_param) + return contrastive_loss_param_ != NULL ? *contrastive_loss_param_ : *default_instance_->contrastive_loss_param_; +} +::ditcaffe::ContrastiveLossParameter* V1LayerParameter::mutable_contrastive_loss_param() { + set_has_contrastive_loss_param(); + if (contrastive_loss_param_ == NULL) { + contrastive_loss_param_ = new ::ditcaffe::ContrastiveLossParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.contrastive_loss_param) + return contrastive_loss_param_; +} +::ditcaffe::ContrastiveLossParameter* V1LayerParameter::release_contrastive_loss_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.contrastive_loss_param) + clear_has_contrastive_loss_param(); + ::ditcaffe::ContrastiveLossParameter* temp = contrastive_loss_param_; + contrastive_loss_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_contrastive_loss_param(::ditcaffe::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:ditcaffe.V1LayerParameter.contrastive_loss_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ConvolutionParameter::Clear(); + clear_has_convolution_param(); +} +const ::ditcaffe::ConvolutionParameter& V1LayerParameter::convolution_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.convolution_param) + return convolution_param_ != NULL ? *convolution_param_ : *default_instance_->convolution_param_; +} +::ditcaffe::ConvolutionParameter* V1LayerParameter::mutable_convolution_param() { + set_has_convolution_param(); + if (convolution_param_ == NULL) { + convolution_param_ = new ::ditcaffe::ConvolutionParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.convolution_param) + return convolution_param_; +} +::ditcaffe::ConvolutionParameter* V1LayerParameter::release_convolution_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.convolution_param) + clear_has_convolution_param(); + ::ditcaffe::ConvolutionParameter* temp = convolution_param_; + convolution_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_convolution_param(::ditcaffe::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:ditcaffe.V1LayerParameter.convolution_param) +} + +// optional .ditcaffe.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_->::ditcaffe::DataParameter::Clear(); + clear_has_data_param(); +} +const ::ditcaffe::DataParameter& V1LayerParameter::data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.data_param) + return data_param_ != NULL ? *data_param_ : *default_instance_->data_param_; +} +::ditcaffe::DataParameter* V1LayerParameter::mutable_data_param() { + set_has_data_param(); + if (data_param_ == NULL) { + data_param_ = new ::ditcaffe::DataParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.data_param) + return data_param_; +} +::ditcaffe::DataParameter* V1LayerParameter::release_data_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.data_param) + clear_has_data_param(); + ::ditcaffe::DataParameter* temp = data_param_; + data_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_data_param(::ditcaffe::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:ditcaffe.V1LayerParameter.data_param) +} + +// optional .ditcaffe.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_->::ditcaffe::DropoutParameter::Clear(); + clear_has_dropout_param(); +} +const ::ditcaffe::DropoutParameter& V1LayerParameter::dropout_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.dropout_param) + return dropout_param_ != NULL ? *dropout_param_ : *default_instance_->dropout_param_; +} +::ditcaffe::DropoutParameter* V1LayerParameter::mutable_dropout_param() { + set_has_dropout_param(); + if (dropout_param_ == NULL) { + dropout_param_ = new ::ditcaffe::DropoutParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.dropout_param) + return dropout_param_; +} +::ditcaffe::DropoutParameter* V1LayerParameter::release_dropout_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.dropout_param) + clear_has_dropout_param(); + ::ditcaffe::DropoutParameter* temp = dropout_param_; + dropout_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_dropout_param(::ditcaffe::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:ditcaffe.V1LayerParameter.dropout_param) +} + +// optional .ditcaffe.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_->::ditcaffe::DummyDataParameter::Clear(); + clear_has_dummy_data_param(); +} +const ::ditcaffe::DummyDataParameter& V1LayerParameter::dummy_data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.dummy_data_param) + return dummy_data_param_ != NULL ? *dummy_data_param_ : *default_instance_->dummy_data_param_; +} +::ditcaffe::DummyDataParameter* V1LayerParameter::mutable_dummy_data_param() { + set_has_dummy_data_param(); + if (dummy_data_param_ == NULL) { + dummy_data_param_ = new ::ditcaffe::DummyDataParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.dummy_data_param) + return dummy_data_param_; +} +::ditcaffe::DummyDataParameter* V1LayerParameter::release_dummy_data_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.dummy_data_param) + clear_has_dummy_data_param(); + ::ditcaffe::DummyDataParameter* temp = dummy_data_param_; + dummy_data_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_dummy_data_param(::ditcaffe::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:ditcaffe.V1LayerParameter.dummy_data_param) +} + +// optional .ditcaffe.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_->::ditcaffe::EltwiseParameter::Clear(); + clear_has_eltwise_param(); +} +const ::ditcaffe::EltwiseParameter& V1LayerParameter::eltwise_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.eltwise_param) + return eltwise_param_ != NULL ? *eltwise_param_ : *default_instance_->eltwise_param_; +} +::ditcaffe::EltwiseParameter* V1LayerParameter::mutable_eltwise_param() { + set_has_eltwise_param(); + if (eltwise_param_ == NULL) { + eltwise_param_ = new ::ditcaffe::EltwiseParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.eltwise_param) + return eltwise_param_; +} +::ditcaffe::EltwiseParameter* V1LayerParameter::release_eltwise_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.eltwise_param) + clear_has_eltwise_param(); + ::ditcaffe::EltwiseParameter* temp = eltwise_param_; + eltwise_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_eltwise_param(::ditcaffe::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:ditcaffe.V1LayerParameter.eltwise_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ExpParameter::Clear(); + clear_has_exp_param(); +} +const ::ditcaffe::ExpParameter& V1LayerParameter::exp_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.exp_param) + return exp_param_ != NULL ? *exp_param_ : *default_instance_->exp_param_; +} +::ditcaffe::ExpParameter* V1LayerParameter::mutable_exp_param() { + set_has_exp_param(); + if (exp_param_ == NULL) { + exp_param_ = new ::ditcaffe::ExpParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.exp_param) + return exp_param_; +} +::ditcaffe::ExpParameter* V1LayerParameter::release_exp_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.exp_param) + clear_has_exp_param(); + ::ditcaffe::ExpParameter* temp = exp_param_; + exp_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_exp_param(::ditcaffe::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:ditcaffe.V1LayerParameter.exp_param) +} + +// optional .ditcaffe.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_->::ditcaffe::HDF5DataParameter::Clear(); + clear_has_hdf5_data_param(); +} +const ::ditcaffe::HDF5DataParameter& V1LayerParameter::hdf5_data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.hdf5_data_param) + return hdf5_data_param_ != NULL ? *hdf5_data_param_ : *default_instance_->hdf5_data_param_; +} +::ditcaffe::HDF5DataParameter* V1LayerParameter::mutable_hdf5_data_param() { + set_has_hdf5_data_param(); + if (hdf5_data_param_ == NULL) { + hdf5_data_param_ = new ::ditcaffe::HDF5DataParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.hdf5_data_param) + return hdf5_data_param_; +} +::ditcaffe::HDF5DataParameter* V1LayerParameter::release_hdf5_data_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.hdf5_data_param) + clear_has_hdf5_data_param(); + ::ditcaffe::HDF5DataParameter* temp = hdf5_data_param_; + hdf5_data_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_hdf5_data_param(::ditcaffe::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:ditcaffe.V1LayerParameter.hdf5_data_param) +} + +// optional .ditcaffe.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_->::ditcaffe::HDF5OutputParameter::Clear(); + clear_has_hdf5_output_param(); +} +const ::ditcaffe::HDF5OutputParameter& V1LayerParameter::hdf5_output_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.hdf5_output_param) + return hdf5_output_param_ != NULL ? *hdf5_output_param_ : *default_instance_->hdf5_output_param_; +} +::ditcaffe::HDF5OutputParameter* V1LayerParameter::mutable_hdf5_output_param() { + set_has_hdf5_output_param(); + if (hdf5_output_param_ == NULL) { + hdf5_output_param_ = new ::ditcaffe::HDF5OutputParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.hdf5_output_param) + return hdf5_output_param_; +} +::ditcaffe::HDF5OutputParameter* V1LayerParameter::release_hdf5_output_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.hdf5_output_param) + clear_has_hdf5_output_param(); + ::ditcaffe::HDF5OutputParameter* temp = hdf5_output_param_; + hdf5_output_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_hdf5_output_param(::ditcaffe::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:ditcaffe.V1LayerParameter.hdf5_output_param) +} + +// optional .ditcaffe.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_->::ditcaffe::HingeLossParameter::Clear(); + clear_has_hinge_loss_param(); +} +const ::ditcaffe::HingeLossParameter& V1LayerParameter::hinge_loss_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.hinge_loss_param) + return hinge_loss_param_ != NULL ? *hinge_loss_param_ : *default_instance_->hinge_loss_param_; +} +::ditcaffe::HingeLossParameter* V1LayerParameter::mutable_hinge_loss_param() { + set_has_hinge_loss_param(); + if (hinge_loss_param_ == NULL) { + hinge_loss_param_ = new ::ditcaffe::HingeLossParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.hinge_loss_param) + return hinge_loss_param_; +} +::ditcaffe::HingeLossParameter* V1LayerParameter::release_hinge_loss_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.hinge_loss_param) + clear_has_hinge_loss_param(); + ::ditcaffe::HingeLossParameter* temp = hinge_loss_param_; + hinge_loss_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_hinge_loss_param(::ditcaffe::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:ditcaffe.V1LayerParameter.hinge_loss_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ImageDataParameter::Clear(); + clear_has_image_data_param(); +} +const ::ditcaffe::ImageDataParameter& V1LayerParameter::image_data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.image_data_param) + return image_data_param_ != NULL ? *image_data_param_ : *default_instance_->image_data_param_; +} +::ditcaffe::ImageDataParameter* V1LayerParameter::mutable_image_data_param() { + set_has_image_data_param(); + if (image_data_param_ == NULL) { + image_data_param_ = new ::ditcaffe::ImageDataParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.image_data_param) + return image_data_param_; +} +::ditcaffe::ImageDataParameter* V1LayerParameter::release_image_data_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.image_data_param) + clear_has_image_data_param(); + ::ditcaffe::ImageDataParameter* temp = image_data_param_; + image_data_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_image_data_param(::ditcaffe::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:ditcaffe.V1LayerParameter.image_data_param) +} + +// optional .ditcaffe.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_->::ditcaffe::InfogainLossParameter::Clear(); + clear_has_infogain_loss_param(); +} +const ::ditcaffe::InfogainLossParameter& V1LayerParameter::infogain_loss_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.infogain_loss_param) + return infogain_loss_param_ != NULL ? *infogain_loss_param_ : *default_instance_->infogain_loss_param_; +} +::ditcaffe::InfogainLossParameter* V1LayerParameter::mutable_infogain_loss_param() { + set_has_infogain_loss_param(); + if (infogain_loss_param_ == NULL) { + infogain_loss_param_ = new ::ditcaffe::InfogainLossParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.infogain_loss_param) + return infogain_loss_param_; +} +::ditcaffe::InfogainLossParameter* V1LayerParameter::release_infogain_loss_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.infogain_loss_param) + clear_has_infogain_loss_param(); + ::ditcaffe::InfogainLossParameter* temp = infogain_loss_param_; + infogain_loss_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_infogain_loss_param(::ditcaffe::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:ditcaffe.V1LayerParameter.infogain_loss_param) +} + +// optional .ditcaffe.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_->::ditcaffe::InnerProductParameter::Clear(); + clear_has_inner_product_param(); +} +const ::ditcaffe::InnerProductParameter& V1LayerParameter::inner_product_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.inner_product_param) + return inner_product_param_ != NULL ? *inner_product_param_ : *default_instance_->inner_product_param_; +} +::ditcaffe::InnerProductParameter* V1LayerParameter::mutable_inner_product_param() { + set_has_inner_product_param(); + if (inner_product_param_ == NULL) { + inner_product_param_ = new ::ditcaffe::InnerProductParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.inner_product_param) + return inner_product_param_; +} +::ditcaffe::InnerProductParameter* V1LayerParameter::release_inner_product_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.inner_product_param) + clear_has_inner_product_param(); + ::ditcaffe::InnerProductParameter* temp = inner_product_param_; + inner_product_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_inner_product_param(::ditcaffe::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:ditcaffe.V1LayerParameter.inner_product_param) +} + +// optional .ditcaffe.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_->::ditcaffe::LRNParameter::Clear(); + clear_has_lrn_param(); +} +const ::ditcaffe::LRNParameter& V1LayerParameter::lrn_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.lrn_param) + return lrn_param_ != NULL ? *lrn_param_ : *default_instance_->lrn_param_; +} +::ditcaffe::LRNParameter* V1LayerParameter::mutable_lrn_param() { + set_has_lrn_param(); + if (lrn_param_ == NULL) { + lrn_param_ = new ::ditcaffe::LRNParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.lrn_param) + return lrn_param_; +} +::ditcaffe::LRNParameter* V1LayerParameter::release_lrn_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.lrn_param) + clear_has_lrn_param(); + ::ditcaffe::LRNParameter* temp = lrn_param_; + lrn_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_lrn_param(::ditcaffe::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:ditcaffe.V1LayerParameter.lrn_param) +} + +// optional .ditcaffe.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_->::ditcaffe::MemoryDataParameter::Clear(); + clear_has_memory_data_param(); +} +const ::ditcaffe::MemoryDataParameter& V1LayerParameter::memory_data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.memory_data_param) + return memory_data_param_ != NULL ? *memory_data_param_ : *default_instance_->memory_data_param_; +} +::ditcaffe::MemoryDataParameter* V1LayerParameter::mutable_memory_data_param() { + set_has_memory_data_param(); + if (memory_data_param_ == NULL) { + memory_data_param_ = new ::ditcaffe::MemoryDataParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.memory_data_param) + return memory_data_param_; +} +::ditcaffe::MemoryDataParameter* V1LayerParameter::release_memory_data_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.memory_data_param) + clear_has_memory_data_param(); + ::ditcaffe::MemoryDataParameter* temp = memory_data_param_; + memory_data_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_memory_data_param(::ditcaffe::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:ditcaffe.V1LayerParameter.memory_data_param) +} + +// optional .ditcaffe.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_->::ditcaffe::MVNParameter::Clear(); + clear_has_mvn_param(); +} +const ::ditcaffe::MVNParameter& V1LayerParameter::mvn_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.mvn_param) + return mvn_param_ != NULL ? *mvn_param_ : *default_instance_->mvn_param_; +} +::ditcaffe::MVNParameter* V1LayerParameter::mutable_mvn_param() { + set_has_mvn_param(); + if (mvn_param_ == NULL) { + mvn_param_ = new ::ditcaffe::MVNParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.mvn_param) + return mvn_param_; +} +::ditcaffe::MVNParameter* V1LayerParameter::release_mvn_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.mvn_param) + clear_has_mvn_param(); + ::ditcaffe::MVNParameter* temp = mvn_param_; + mvn_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_mvn_param(::ditcaffe::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:ditcaffe.V1LayerParameter.mvn_param) +} + +// optional .ditcaffe.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_->::ditcaffe::PoolingParameter::Clear(); + clear_has_pooling_param(); +} +const ::ditcaffe::PoolingParameter& V1LayerParameter::pooling_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.pooling_param) + return pooling_param_ != NULL ? *pooling_param_ : *default_instance_->pooling_param_; +} +::ditcaffe::PoolingParameter* V1LayerParameter::mutable_pooling_param() { + set_has_pooling_param(); + if (pooling_param_ == NULL) { + pooling_param_ = new ::ditcaffe::PoolingParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.pooling_param) + return pooling_param_; +} +::ditcaffe::PoolingParameter* V1LayerParameter::release_pooling_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.pooling_param) + clear_has_pooling_param(); + ::ditcaffe::PoolingParameter* temp = pooling_param_; + pooling_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_pooling_param(::ditcaffe::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:ditcaffe.V1LayerParameter.pooling_param) +} + +// optional .ditcaffe.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_->::ditcaffe::PowerParameter::Clear(); + clear_has_power_param(); +} +const ::ditcaffe::PowerParameter& V1LayerParameter::power_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.power_param) + return power_param_ != NULL ? *power_param_ : *default_instance_->power_param_; +} +::ditcaffe::PowerParameter* V1LayerParameter::mutable_power_param() { + set_has_power_param(); + if (power_param_ == NULL) { + power_param_ = new ::ditcaffe::PowerParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.power_param) + return power_param_; +} +::ditcaffe::PowerParameter* V1LayerParameter::release_power_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.power_param) + clear_has_power_param(); + ::ditcaffe::PowerParameter* temp = power_param_; + power_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_power_param(::ditcaffe::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:ditcaffe.V1LayerParameter.power_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ReLUParameter::Clear(); + clear_has_relu_param(); +} +const ::ditcaffe::ReLUParameter& V1LayerParameter::relu_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.relu_param) + return relu_param_ != NULL ? *relu_param_ : *default_instance_->relu_param_; +} +::ditcaffe::ReLUParameter* V1LayerParameter::mutable_relu_param() { + set_has_relu_param(); + if (relu_param_ == NULL) { + relu_param_ = new ::ditcaffe::ReLUParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.relu_param) + return relu_param_; +} +::ditcaffe::ReLUParameter* V1LayerParameter::release_relu_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.relu_param) + clear_has_relu_param(); + ::ditcaffe::ReLUParameter* temp = relu_param_; + relu_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_relu_param(::ditcaffe::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:ditcaffe.V1LayerParameter.relu_param) +} + +// optional .ditcaffe.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_->::ditcaffe::SigmoidParameter::Clear(); + clear_has_sigmoid_param(); +} +const ::ditcaffe::SigmoidParameter& V1LayerParameter::sigmoid_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.sigmoid_param) + return sigmoid_param_ != NULL ? *sigmoid_param_ : *default_instance_->sigmoid_param_; +} +::ditcaffe::SigmoidParameter* V1LayerParameter::mutable_sigmoid_param() { + set_has_sigmoid_param(); + if (sigmoid_param_ == NULL) { + sigmoid_param_ = new ::ditcaffe::SigmoidParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.sigmoid_param) + return sigmoid_param_; +} +::ditcaffe::SigmoidParameter* V1LayerParameter::release_sigmoid_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.sigmoid_param) + clear_has_sigmoid_param(); + ::ditcaffe::SigmoidParameter* temp = sigmoid_param_; + sigmoid_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_sigmoid_param(::ditcaffe::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:ditcaffe.V1LayerParameter.sigmoid_param) +} + +// optional .ditcaffe.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_->::ditcaffe::SoftmaxParameter::Clear(); + clear_has_softmax_param(); +} +const ::ditcaffe::SoftmaxParameter& V1LayerParameter::softmax_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.softmax_param) + return softmax_param_ != NULL ? *softmax_param_ : *default_instance_->softmax_param_; +} +::ditcaffe::SoftmaxParameter* V1LayerParameter::mutable_softmax_param() { + set_has_softmax_param(); + if (softmax_param_ == NULL) { + softmax_param_ = new ::ditcaffe::SoftmaxParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.softmax_param) + return softmax_param_; +} +::ditcaffe::SoftmaxParameter* V1LayerParameter::release_softmax_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.softmax_param) + clear_has_softmax_param(); + ::ditcaffe::SoftmaxParameter* temp = softmax_param_; + softmax_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_softmax_param(::ditcaffe::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:ditcaffe.V1LayerParameter.softmax_param) +} + +// optional .ditcaffe.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_->::ditcaffe::SliceParameter::Clear(); + clear_has_slice_param(); +} +const ::ditcaffe::SliceParameter& V1LayerParameter::slice_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.slice_param) + return slice_param_ != NULL ? *slice_param_ : *default_instance_->slice_param_; +} +::ditcaffe::SliceParameter* V1LayerParameter::mutable_slice_param() { + set_has_slice_param(); + if (slice_param_ == NULL) { + slice_param_ = new ::ditcaffe::SliceParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.slice_param) + return slice_param_; +} +::ditcaffe::SliceParameter* V1LayerParameter::release_slice_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.slice_param) + clear_has_slice_param(); + ::ditcaffe::SliceParameter* temp = slice_param_; + slice_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_slice_param(::ditcaffe::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:ditcaffe.V1LayerParameter.slice_param) +} + +// optional .ditcaffe.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_->::ditcaffe::TanHParameter::Clear(); + clear_has_tanh_param(); +} +const ::ditcaffe::TanHParameter& V1LayerParameter::tanh_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.tanh_param) + return tanh_param_ != NULL ? *tanh_param_ : *default_instance_->tanh_param_; +} +::ditcaffe::TanHParameter* V1LayerParameter::mutable_tanh_param() { + set_has_tanh_param(); + if (tanh_param_ == NULL) { + tanh_param_ = new ::ditcaffe::TanHParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.tanh_param) + return tanh_param_; +} +::ditcaffe::TanHParameter* V1LayerParameter::release_tanh_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.tanh_param) + clear_has_tanh_param(); + ::ditcaffe::TanHParameter* temp = tanh_param_; + tanh_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_tanh_param(::ditcaffe::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:ditcaffe.V1LayerParameter.tanh_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ThresholdParameter::Clear(); + clear_has_threshold_param(); +} +const ::ditcaffe::ThresholdParameter& V1LayerParameter::threshold_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.threshold_param) + return threshold_param_ != NULL ? *threshold_param_ : *default_instance_->threshold_param_; +} +::ditcaffe::ThresholdParameter* V1LayerParameter::mutable_threshold_param() { + set_has_threshold_param(); + if (threshold_param_ == NULL) { + threshold_param_ = new ::ditcaffe::ThresholdParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.threshold_param) + return threshold_param_; +} +::ditcaffe::ThresholdParameter* V1LayerParameter::release_threshold_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.threshold_param) + clear_has_threshold_param(); + ::ditcaffe::ThresholdParameter* temp = threshold_param_; + threshold_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_threshold_param(::ditcaffe::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:ditcaffe.V1LayerParameter.threshold_param) +} + +// optional .ditcaffe.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_->::ditcaffe::WindowDataParameter::Clear(); + clear_has_window_data_param(); +} +const ::ditcaffe::WindowDataParameter& V1LayerParameter::window_data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.window_data_param) + return window_data_param_ != NULL ? *window_data_param_ : *default_instance_->window_data_param_; +} +::ditcaffe::WindowDataParameter* V1LayerParameter::mutable_window_data_param() { + set_has_window_data_param(); + if (window_data_param_ == NULL) { + window_data_param_ = new ::ditcaffe::WindowDataParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.window_data_param) + return window_data_param_; +} +::ditcaffe::WindowDataParameter* V1LayerParameter::release_window_data_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.window_data_param) + clear_has_window_data_param(); + ::ditcaffe::WindowDataParameter* temp = window_data_param_; + window_data_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_window_data_param(::ditcaffe::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:ditcaffe.V1LayerParameter.window_data_param) +} + +// optional .ditcaffe.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_->::ditcaffe::TransformationParameter::Clear(); + clear_has_transform_param(); +} +const ::ditcaffe::TransformationParameter& V1LayerParameter::transform_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.transform_param) + return transform_param_ != NULL ? *transform_param_ : *default_instance_->transform_param_; +} +::ditcaffe::TransformationParameter* V1LayerParameter::mutable_transform_param() { + set_has_transform_param(); + if (transform_param_ == NULL) { + transform_param_ = new ::ditcaffe::TransformationParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.transform_param) + return transform_param_; +} +::ditcaffe::TransformationParameter* V1LayerParameter::release_transform_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.transform_param) + clear_has_transform_param(); + ::ditcaffe::TransformationParameter* temp = transform_param_; + transform_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_transform_param(::ditcaffe::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:ditcaffe.V1LayerParameter.transform_param) +} + +// optional .ditcaffe.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_->::ditcaffe::LossParameter::Clear(); + clear_has_loss_param(); +} +const ::ditcaffe::LossParameter& V1LayerParameter::loss_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.loss_param) + return loss_param_ != NULL ? *loss_param_ : *default_instance_->loss_param_; +} +::ditcaffe::LossParameter* V1LayerParameter::mutable_loss_param() { + set_has_loss_param(); + if (loss_param_ == NULL) { + loss_param_ = new ::ditcaffe::LossParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.loss_param) + return loss_param_; +} +::ditcaffe::LossParameter* V1LayerParameter::release_loss_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.loss_param) + clear_has_loss_param(); + ::ditcaffe::LossParameter* temp = loss_param_; + loss_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_loss_param(::ditcaffe::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:ditcaffe.V1LayerParameter.loss_param) +} + +// optional .ditcaffe.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_->::ditcaffe::V0LayerParameter::Clear(); + clear_has_layer(); +} +const ::ditcaffe::V0LayerParameter& V1LayerParameter::layer() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.layer) + return layer_ != NULL ? *layer_ : *default_instance_->layer_; +} +::ditcaffe::V0LayerParameter* V1LayerParameter::mutable_layer() { + set_has_layer(); + if (layer_ == NULL) { + layer_ = new ::ditcaffe::V0LayerParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.layer) + return layer_; +} +::ditcaffe::V0LayerParameter* V1LayerParameter::release_layer() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.layer) + clear_has_layer(); + ::ditcaffe::V0LayerParameter* temp = layer_; + layer_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_layer(::ditcaffe::V0LayerParameter* layer) { + delete layer_; + layer_ = layer; + if (layer) { + set_has_layer(); + } else { + clear_has_layer(); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.V1LayerParameter.layer) +} + +#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) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.V0LayerParameter) +} + +void V0LayerParameter::InitAsDefaultInstance() { + weight_filler_ = const_cast< ::ditcaffe::FillerParameter*>(&::ditcaffe::FillerParameter::default_instance()); + bias_filler_ = const_cast< ::ditcaffe::FillerParameter*>(&::ditcaffe::FillerParameter::default_instance()); + hdf5_output_param_ = const_cast< ::ditcaffe::HDF5OutputParameter*>(&::ditcaffe::HDF5OutputParameter::default_instance()); +} + +V0LayerParameter::V0LayerParameter(const V0LayerParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.V0LayerParameter) +} + +void V0LayerParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + type_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + num_output_ = 0u; + biasterm_ = true; + weight_filler_ = NULL; + bias_filler_ = NULL; + pad_ = 0u; + kernelsize_ = 0u; + group_ = 1u; + stride_ = 1u; + pool_ = 0; + dropout_ratio_ = 0.5f; + local_size_ = 5u; + alpha_ = 1; + beta_ = 0.75f; + k_ = 1; + source_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + scale_ = 1; + meanfile_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + batchsize_ = 0u; + cropsize_ = 0u; + mirror_ = false; + rand_skip_ = 0u; + det_fg_threshold_ = 0.5f; + det_bg_threshold_ = 0.5f; + det_fg_fraction_ = 0.25f; + det_context_pad_ = 0u; + det_crop_mode_.UnsafeSetDefault(_default_det_crop_mode_); + new_num_ = 0; + new_channels_ = 0; + new_height_ = 0; + new_width_ = 0; + shuffle_images_ = false; + concat_dim_ = 1u; + hdf5_output_param_ = NULL; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +V0LayerParameter::~V0LayerParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.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 != default_instance_) { + 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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +V0LayerParameter* V0LayerParameter::default_instance_ = NULL; + +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:ditcaffe.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_, pad_); + 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_->::ditcaffe::FillerParameter::Clear(); + } + if (has_bias_filler()) { + if (bias_filler_ != NULL) bias_filler_->::ditcaffe::FillerParameter::Clear(); + } + kernelsize_ = 0u; + } + 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) { + if (has_source()) { + source_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + scale_ = 1; + if (has_meanfile()) { + meanfile_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + batchsize_ = 0u; + cropsize_ = 0u; + mirror_ = false; + } + if (_has_bits_[24 / 32] & 4261412864u) { + rand_skip_ = 0u; + det_fg_threshold_ = 0.5f; + det_bg_threshold_ = 0.5f; + det_fg_fraction_ = 0.25f; + det_context_pad_ = 0u; + if (has_det_crop_mode()) { + det_crop_mode_.ClearToDefaultNoArena(_default_det_crop_mode_); + } + new_num_ = 0; + } + 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_->::ditcaffe::HDF5OutputParameter::Clear(); + } + } + +#undef ZR_HELPER_ +#undef ZR_ + + blobs_.Clear(); + blobs_lr_.Clear(); + weight_decay_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + 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:ditcaffe.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, + "ditcaffe.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, + "ditcaffe.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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &num_output_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &biasterm_))); + set_has_biasterm(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(42)) goto parse_weight_filler; + break; + } + + // optional .ditcaffe.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 .ditcaffe.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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &pad_))); + set_has_pad(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(64)) goto parse_kernelsize; + break; + } + + // optional uint32 kernelsize = 8; + case 8: { + if (tag == 64) { + parse_kernelsize: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &kernelsize_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &group_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &stride_))); + set_has_stride(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(88)) goto parse_pool; + break; + } + + // optional .ditcaffe.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 (::ditcaffe::V0LayerParameter_PoolMethod_IsValid(value)) { + set_pool(static_cast< ::ditcaffe::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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &dropout_ratio_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &local_size_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &alpha_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &beta_))); + set_has_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, + "ditcaffe.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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &scale_))); + set_has_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, + "ditcaffe.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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &batchsize_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &cropsize_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &mirror_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &k_))); + set_has_k(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(402)) goto parse_blobs; + break; + } + + // repeated .ditcaffe.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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &rand_skip_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &det_fg_threshold_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &det_bg_threshold_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &det_fg_fraction_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &det_context_pad_))); + set_has_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, + "ditcaffe.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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &new_num_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &new_channels_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &new_height_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &new_width_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &shuffle_images_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &concat_dim_))); + set_has_concat_dim(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(8010)) goto parse_hdf5_output_param; + break; + } + + // optional .ditcaffe.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:ditcaffe.V0LayerParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.V0LayerParameter) + return false; +#undef DO_ +} + +void V0LayerParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.V0LayerParameter) + // optional string name = 1; + if (has_name()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "ditcaffe.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, + "ditcaffe.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 .ditcaffe.FillerParameter weight_filler = 5; + if (has_weight_filler()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 5, *this->weight_filler_, output); + } + + // optional .ditcaffe.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 .ditcaffe.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, + "ditcaffe.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, + "ditcaffe.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 .ditcaffe.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, + "ditcaffe.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 .ditcaffe.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:ditcaffe.V0LayerParameter) +} + +::google::protobuf::uint8* V0LayerParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.V0LayerParameter) + // optional string name = 1; + if (has_name()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "ditcaffe.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, + "ditcaffe.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 .ditcaffe.FillerParameter weight_filler = 5; + if (has_weight_filler()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 5, *this->weight_filler_, target); + } + + // optional .ditcaffe.FillerParameter bias_filler = 6; + if (has_bias_filler()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 6, *this->bias_filler_, 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 .ditcaffe.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, + "ditcaffe.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, + "ditcaffe.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 .ditcaffe.BlobProto blobs = 50; + for (unsigned int i = 0, n = this->blobs_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 50, this->blobs(i), 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, + "ditcaffe.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 .ditcaffe.HDF5OutputParameter hdf5_output_param = 1001; + if (has_hdf5_output_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 1001, *this->hdf5_output_param_, target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:ditcaffe.V0LayerParameter) + return target; +} + +int V0LayerParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.V0LayerParameter) + int 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 .ditcaffe.FillerParameter weight_filler = 5; + if (has_weight_filler()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->weight_filler_); + } + + // optional .ditcaffe.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 .ditcaffe.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 .ditcaffe.HDF5OutputParameter hdf5_output_param = 1001; + if (has_hdf5_output_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->hdf5_output_param_); + } + + } + // repeated .ditcaffe.BlobProto blobs = 50; + total_size += 2 * this->blobs_size(); + for (int i = 0; i < this->blobs_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->blobs(i)); + } + + // repeated float blobs_lr = 51; + { + int data_size = 0; + data_size = 4 * this->blobs_lr_size(); + total_size += 2 * this->blobs_lr_size() + data_size; + } + + // repeated float weight_decay = 52; + { + int data_size = 0; + data_size = 4 * this->weight_decay_size(); + total_size += 2 * this->weight_decay_size() + data_size; + } + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void V0LayerParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:ditcaffe.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:ditcaffe.V0LayerParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:ditcaffe.V0LayerParameter) + MergeFrom(*source); + } +} + +void V0LayerParameter::MergeFrom(const V0LayerParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.V0LayerParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + blobs_.MergeFrom(from.blobs_); + blobs_lr_.MergeFrom(from.blobs_lr_); + weight_decay_.MergeFrom(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()->::ditcaffe::FillerParameter::MergeFrom(from.weight_filler()); + } + if (from.has_bias_filler()) { + mutable_bias_filler()->::ditcaffe::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()->::ditcaffe::HDF5OutputParameter::MergeFrom(from.hdf5_output_param()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void V0LayerParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:ditcaffe.V0LayerParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void V0LayerParameter::CopyFrom(const V0LayerParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.V0LayerParameter) + if (&from == this) return; + Clear(); + MergeFrom(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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.V0LayerParameter.name) +} + ::std::string* V0LayerParameter::mutable_name() { + set_has_name(); + // @@protoc_insertion_point(field_mutable:ditcaffe.V0LayerParameter.name) + return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* V0LayerParameter::release_name() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.V0LayerParameter.type) +} + ::std::string* V0LayerParameter::mutable_type() { + set_has_type(); + // @@protoc_insertion_point(field_mutable:ditcaffe.V0LayerParameter.type) + return type_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* V0LayerParameter::release_type() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.V0LayerParameter.biasterm) + return biasterm_; +} + void V0LayerParameter::set_biasterm(bool value) { + set_has_biasterm(); + biasterm_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.V0LayerParameter.biasterm) +} + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_weight_filler(); +} +const ::ditcaffe::FillerParameter& V0LayerParameter::weight_filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.V0LayerParameter.weight_filler) + return weight_filler_ != NULL ? *weight_filler_ : *default_instance_->weight_filler_; +} +::ditcaffe::FillerParameter* V0LayerParameter::mutable_weight_filler() { + set_has_weight_filler(); + if (weight_filler_ == NULL) { + weight_filler_ = new ::ditcaffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V0LayerParameter.weight_filler) + return weight_filler_; +} +::ditcaffe::FillerParameter* V0LayerParameter::release_weight_filler() { + // @@protoc_insertion_point(field_release:ditcaffe.V0LayerParameter.weight_filler) + clear_has_weight_filler(); + ::ditcaffe::FillerParameter* temp = weight_filler_; + weight_filler_ = NULL; + return temp; +} +void V0LayerParameter::set_allocated_weight_filler(::ditcaffe::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:ditcaffe.V0LayerParameter.weight_filler) +} + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_bias_filler(); +} +const ::ditcaffe::FillerParameter& V0LayerParameter::bias_filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.V0LayerParameter.bias_filler) + return bias_filler_ != NULL ? *bias_filler_ : *default_instance_->bias_filler_; +} +::ditcaffe::FillerParameter* V0LayerParameter::mutable_bias_filler() { + set_has_bias_filler(); + if (bias_filler_ == NULL) { + bias_filler_ = new ::ditcaffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V0LayerParameter.bias_filler) + return bias_filler_; +} +::ditcaffe::FillerParameter* V0LayerParameter::release_bias_filler() { + // @@protoc_insertion_point(field_release:ditcaffe.V0LayerParameter.bias_filler) + clear_has_bias_filler(); + ::ditcaffe::FillerParameter* temp = bias_filler_; + bias_filler_ = NULL; + return temp; +} +void V0LayerParameter::set_allocated_bias_filler(::ditcaffe::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:ditcaffe.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:ditcaffe.V0LayerParameter.pad) + return pad_; +} + void V0LayerParameter::set_pad(::google::protobuf::uint32 value) { + set_has_pad(); + pad_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.V0LayerParameter.kernelsize) + return kernelsize_; +} + void V0LayerParameter::set_kernelsize(::google::protobuf::uint32 value) { + set_has_kernelsize(); + kernelsize_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.V0LayerParameter.group) + return group_; +} + void V0LayerParameter::set_group(::google::protobuf::uint32 value) { + set_has_group(); + group_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.V0LayerParameter.stride) + return stride_; +} + void V0LayerParameter::set_stride(::google::protobuf::uint32 value) { + set_has_stride(); + stride_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.V0LayerParameter.stride) +} + +// optional .ditcaffe.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(); +} + ::ditcaffe::V0LayerParameter_PoolMethod V0LayerParameter::pool() const { + // @@protoc_insertion_point(field_get:ditcaffe.V0LayerParameter.pool) + return static_cast< ::ditcaffe::V0LayerParameter_PoolMethod >(pool_); +} + void V0LayerParameter::set_pool(::ditcaffe::V0LayerParameter_PoolMethod value) { + assert(::ditcaffe::V0LayerParameter_PoolMethod_IsValid(value)); + set_has_pool(); + pool_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.V0LayerParameter.alpha) + return alpha_; +} + void V0LayerParameter::set_alpha(float value) { + set_has_alpha(); + alpha_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.V0LayerParameter.beta) + return beta_; +} + void V0LayerParameter::set_beta(float value) { + set_has_beta(); + beta_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.V0LayerParameter.k) + return k_; +} + void V0LayerParameter::set_k(float value) { + set_has_k(); + k_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.V0LayerParameter.source) +} + ::std::string* V0LayerParameter::mutable_source() { + set_has_source(); + // @@protoc_insertion_point(field_mutable:ditcaffe.V0LayerParameter.source) + return source_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* V0LayerParameter::release_source() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.V0LayerParameter.scale) + return scale_; +} + void V0LayerParameter::set_scale(float value) { + set_has_scale(); + scale_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.V0LayerParameter.meanfile) +} + ::std::string* V0LayerParameter::mutable_meanfile() { + set_has_meanfile(); + // @@protoc_insertion_point(field_mutable:ditcaffe.V0LayerParameter.meanfile) + return meanfile_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* V0LayerParameter::release_meanfile() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.V0LayerParameter.batchsize) + return batchsize_; +} + void V0LayerParameter::set_batchsize(::google::protobuf::uint32 value) { + set_has_batchsize(); + batchsize_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.V0LayerParameter.cropsize) + return cropsize_; +} + void V0LayerParameter::set_cropsize(::google::protobuf::uint32 value) { + set_has_cropsize(); + cropsize_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.V0LayerParameter.mirror) + return mirror_; +} + void V0LayerParameter::set_mirror(bool value) { + set_has_mirror(); + mirror_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.V0LayerParameter.mirror) +} + +// repeated .ditcaffe.BlobProto blobs = 50; +int V0LayerParameter::blobs_size() const { + return blobs_.size(); +} +void V0LayerParameter::clear_blobs() { + blobs_.Clear(); +} +const ::ditcaffe::BlobProto& V0LayerParameter::blobs(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.V0LayerParameter.blobs) + return blobs_.Get(index); +} +::ditcaffe::BlobProto* V0LayerParameter::mutable_blobs(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.V0LayerParameter.blobs) + return blobs_.Mutable(index); +} +::ditcaffe::BlobProto* V0LayerParameter::add_blobs() { + // @@protoc_insertion_point(field_add:ditcaffe.V0LayerParameter.blobs) + return blobs_.Add(); +} +::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >* +V0LayerParameter::mutable_blobs() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.V0LayerParameter.blobs) + return &blobs_; +} +const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >& +V0LayerParameter::blobs() const { + // @@protoc_insertion_point(field_list:ditcaffe.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:ditcaffe.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:ditcaffe.V0LayerParameter.blobs_lr) +} + void V0LayerParameter::add_blobs_lr(float value) { + blobs_lr_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.V0LayerParameter.blobs_lr) +} + const ::google::protobuf::RepeatedField< float >& +V0LayerParameter::blobs_lr() const { + // @@protoc_insertion_point(field_list:ditcaffe.V0LayerParameter.blobs_lr) + return blobs_lr_; +} + ::google::protobuf::RepeatedField< float >* +V0LayerParameter::mutable_blobs_lr() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.V0LayerParameter.weight_decay) +} + void V0LayerParameter::add_weight_decay(float value) { + weight_decay_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.V0LayerParameter.weight_decay) +} + const ::google::protobuf::RepeatedField< float >& +V0LayerParameter::weight_decay() const { + // @@protoc_insertion_point(field_list:ditcaffe.V0LayerParameter.weight_decay) + return weight_decay_; +} + ::google::protobuf::RepeatedField< float >* +V0LayerParameter::mutable_weight_decay() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.V0LayerParameter.det_crop_mode) +} + ::std::string* V0LayerParameter::mutable_det_crop_mode() { + set_has_det_crop_mode(); + // @@protoc_insertion_point(field_mutable:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.V0LayerParameter.concat_dim) +} + +// optional .ditcaffe.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_->::ditcaffe::HDF5OutputParameter::Clear(); + clear_has_hdf5_output_param(); +} +const ::ditcaffe::HDF5OutputParameter& V0LayerParameter::hdf5_output_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V0LayerParameter.hdf5_output_param) + return hdf5_output_param_ != NULL ? *hdf5_output_param_ : *default_instance_->hdf5_output_param_; +} +::ditcaffe::HDF5OutputParameter* V0LayerParameter::mutable_hdf5_output_param() { + set_has_hdf5_output_param(); + if (hdf5_output_param_ == NULL) { + hdf5_output_param_ = new ::ditcaffe::HDF5OutputParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V0LayerParameter.hdf5_output_param) + return hdf5_output_param_; +} +::ditcaffe::HDF5OutputParameter* V0LayerParameter::release_hdf5_output_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V0LayerParameter.hdf5_output_param) + clear_has_hdf5_output_param(); + ::ditcaffe::HDF5OutputParameter* temp = hdf5_output_param_; + hdf5_output_param_ = NULL; + return temp; +} +void V0LayerParameter::set_allocated_hdf5_output_param(::ditcaffe::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:ditcaffe.V0LayerParameter.hdf5_output_param) +} + +#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) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.PReLUParameter) +} + +void PReLUParameter::InitAsDefaultInstance() { + filler_ = const_cast< ::ditcaffe::FillerParameter*>(&::ditcaffe::FillerParameter::default_instance()); +} + +PReLUParameter::PReLUParameter(const PReLUParameter& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.PReLUParameter) +} + +void PReLUParameter::SharedCtor() { + _cached_size_ = 0; + filler_ = NULL; + channel_shared_ = false; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +PReLUParameter::~PReLUParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.PReLUParameter) + SharedDtor(); +} + +void PReLUParameter::SharedDtor() { + if (this != default_instance_) { + 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() { + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eproto(); + return *default_instance_; +} + +PReLUParameter* PReLUParameter::default_instance_ = NULL; + +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:ditcaffe.PReLUParameter) + if (_has_bits_[0 / 32] & 3u) { + if (has_filler()) { + if (filler_ != NULL) filler_->::ditcaffe::FillerParameter::Clear(); + } + channel_shared_ = false; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + 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:ditcaffe.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 .ditcaffe.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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &channel_shared_))); + set_has_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:ditcaffe.PReLUParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.PReLUParameter) + return false; +#undef DO_ +} + +void PReLUParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.PReLUParameter) + // optional .ditcaffe.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:ditcaffe.PReLUParameter) +} + +::google::protobuf::uint8* PReLUParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:ditcaffe.PReLUParameter) + // optional .ditcaffe.FillerParameter filler = 1; + if (has_filler()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 1, *this->filler_, 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:ditcaffe.PReLUParameter) + return target; +} + +int PReLUParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.PReLUParameter) + int total_size = 0; + + if (_has_bits_[0 / 32] & 3u) { + // optional .ditcaffe.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()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void PReLUParameter::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:ditcaffe.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:ditcaffe.PReLUParameter) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:ditcaffe.PReLUParameter) + MergeFrom(*source); + } +} + +void PReLUParameter::MergeFrom(const PReLUParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.PReLUParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_filler()) { + mutable_filler()->::ditcaffe::FillerParameter::MergeFrom(from.filler()); + } + if (from.has_channel_shared()) { + set_channel_shared(from.channel_shared()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void PReLUParameter::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:ditcaffe.PReLUParameter) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void PReLUParameter::CopyFrom(const PReLUParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.PReLUParameter) + if (&from == this) return; + Clear(); + MergeFrom(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 .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_filler(); +} +const ::ditcaffe::FillerParameter& PReLUParameter::filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.PReLUParameter.filler) + return filler_ != NULL ? *filler_ : *default_instance_->filler_; +} +::ditcaffe::FillerParameter* PReLUParameter::mutable_filler() { + set_has_filler(); + if (filler_ == NULL) { + filler_ = new ::ditcaffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.PReLUParameter.filler) + return filler_; +} +::ditcaffe::FillerParameter* PReLUParameter::release_filler() { + // @@protoc_insertion_point(field_release:ditcaffe.PReLUParameter.filler) + clear_has_filler(); + ::ditcaffe::FillerParameter* temp = filler_; + filler_ = NULL; + return temp; +} +void PReLUParameter::set_allocated_filler(::ditcaffe::FillerParameter* filler) { + delete filler_; + filler_ = filler; + if (filler) { + set_has_filler(); + } else { + clear_has_filler(); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.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:ditcaffe.PReLUParameter.channel_shared) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// @@protoc_insertion_point(namespace_scope) + +} // namespace ditcaffe + +// @@protoc_insertion_point(global_scope) diff --git a/umd/core/src/compiler/caffe/ditcaffe/protobuf-3.0.0/ditcaffe.pb.h b/umd/core/src/compiler/caffe/ditcaffe/protobuf-3.0.0/ditcaffe.pb.h new file mode 100644 index 00000000..58462d1d --- /dev/null +++ b/umd/core/src/compiler/caffe/ditcaffe/protobuf-3.0.0/ditcaffe.pb.h @@ -0,0 +1,24813 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: ditcaffe.proto + +#ifndef PROTOBUF_ditcaffe_2eproto__INCLUDED +#define PROTOBUF_ditcaffe_2eproto__INCLUDED + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3000000 +#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 3000000 < 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 ditcaffe { + +// Internal implementation detail -- do not call these. +void protobuf_AddDesc_ditcaffe_2eproto(); +void protobuf_AssignDesc_ditcaffe_2eproto(); +void protobuf_ShutdownFile_ditcaffe_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 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 PReLUParameter; +class ParamSpec; +class ParameterParameter; +class PoolingParameter; +class PowerParameter; +class PythonParameter; +class ReLUParameter; +class ReductionParameter; +class ReshapeParameter; +class SPPParameter; +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 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 { + 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(); + + 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(BlobShape* other); + 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:ditcaffe.BlobShape) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 > dim_; + mutable int _dim_cached_byte_size_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static BlobShape* default_instance_; +}; +// ------------------------------------------------------------------- + +class BlobProto : public ::google::protobuf::Message { + 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(); + + 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(BlobProto* other); + 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 .ditcaffe.BlobShape shape = 7; + bool has_shape() const; + void clear_shape(); + static const int kShapeFieldNumber = 7; + const ::ditcaffe::BlobShape& shape() const; + ::ditcaffe::BlobShape* mutable_shape(); + ::ditcaffe::BlobShape* release_shape(); + void set_allocated_shape(::ditcaffe::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(); + + // repeated uint32 half_data = 10 [packed = true]; + int half_data_size() const; + void clear_half_data(); + static const int kHalfDataFieldNumber = 10; + ::google::protobuf::uint32 half_data(int index) const; + void set_half_data(int index, ::google::protobuf::uint32 value); + void add_half_data(::google::protobuf::uint32 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& + half_data() const; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* + mutable_half_data(); + + // repeated uint32 half_diff = 11 [packed = true]; + int half_diff_size() const; + void clear_half_diff(); + static const int kHalfDiffFieldNumber = 11; + ::google::protobuf::uint32 half_diff(int index) const; + void set_half_diff(int index, ::google::protobuf::uint32 value); + void add_half_diff(::google::protobuf::uint32 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& + half_diff() const; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* + mutable_half_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:ditcaffe.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::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::ditcaffe::BlobShape* shape_; + ::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_; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > half_data_; + mutable int _half_data_cached_byte_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > half_diff_; + mutable int _half_diff_cached_byte_size_; + ::google::protobuf::int32 num_; + ::google::protobuf::int32 channels_; + ::google::protobuf::int32 height_; + ::google::protobuf::int32 width_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static BlobProto* default_instance_; +}; +// ------------------------------------------------------------------- + +class BlobProtoVector : public ::google::protobuf::Message { + 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(); + + 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(BlobProtoVector* other); + 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 .ditcaffe.BlobProto blobs = 1; + int blobs_size() const; + void clear_blobs(); + static const int kBlobsFieldNumber = 1; + const ::ditcaffe::BlobProto& blobs(int index) const; + ::ditcaffe::BlobProto* mutable_blobs(int index); + ::ditcaffe::BlobProto* add_blobs(); + ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >* + mutable_blobs(); + const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >& + blobs() const; + + // @@protoc_insertion_point(class_scope:ditcaffe.BlobProtoVector) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto > blobs_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static BlobProtoVector* default_instance_; +}; +// ------------------------------------------------------------------- + +class Datum : public ::google::protobuf::Message { + 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(); + + 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(Datum* other); + 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:ditcaffe.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::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::int32 channels_; + ::google::protobuf::int32 height_; + ::google::protobuf::internal::ArenaStringPtr data_; + ::google::protobuf::int32 width_; + ::google::protobuf::int32 label_; + ::google::protobuf::RepeatedField< float > float_data_; + bool encoded_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static Datum* default_instance_; +}; +// ------------------------------------------------------------------- + +class FillerParameter : public ::google::protobuf::Message { + 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(); + + 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(FillerParameter* other); + 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 .ditcaffe.FillerParameter.VarianceNorm variance_norm = 8 [default = FAN_IN]; + bool has_variance_norm() const; + void clear_variance_norm(); + static const int kVarianceNormFieldNumber = 8; + ::ditcaffe::FillerParameter_VarianceNorm variance_norm() const; + void set_variance_norm(::ditcaffe::FillerParameter_VarianceNorm value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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::uint32 _has_bits_[1]; + mutable int _cached_size_; + static ::std::string* _default_type_; + ::google::protobuf::internal::ArenaStringPtr type_; + float value_; + float min_; + float max_; + float mean_; + float std_; + ::google::protobuf::int32 sparse_; + int variance_norm_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static FillerParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class NetParameter : public ::google::protobuf::Message { + 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(); + + 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(NetParameter* other); + 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 .ditcaffe.BlobShape input_shape = 8; + int input_shape_size() const; + void clear_input_shape(); + static const int kInputShapeFieldNumber = 8; + const ::ditcaffe::BlobShape& input_shape(int index) const; + ::ditcaffe::BlobShape* mutable_input_shape(int index); + ::ditcaffe::BlobShape* add_input_shape(); + ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobShape >* + mutable_input_shape(); + const ::google::protobuf::RepeatedPtrField< ::ditcaffe::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 .ditcaffe.NetState state = 6; + bool has_state() const; + void clear_state(); + static const int kStateFieldNumber = 6; + const ::ditcaffe::NetState& state() const; + ::ditcaffe::NetState* mutable_state(); + ::ditcaffe::NetState* release_state(); + void set_allocated_state(::ditcaffe::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 .ditcaffe.LayerParameter layer = 100; + int layer_size() const; + void clear_layer(); + static const int kLayerFieldNumber = 100; + const ::ditcaffe::LayerParameter& layer(int index) const; + ::ditcaffe::LayerParameter* mutable_layer(int index); + ::ditcaffe::LayerParameter* add_layer(); + ::google::protobuf::RepeatedPtrField< ::ditcaffe::LayerParameter >* + mutable_layer(); + const ::google::protobuf::RepeatedPtrField< ::ditcaffe::LayerParameter >& + layer() const; + + // repeated .ditcaffe.V1LayerParameter layers = 2; + int layers_size() const; + void clear_layers(); + static const int kLayersFieldNumber = 2; + const ::ditcaffe::V1LayerParameter& layers(int index) const; + ::ditcaffe::V1LayerParameter* mutable_layers(int index); + ::ditcaffe::V1LayerParameter* add_layers(); + ::google::protobuf::RepeatedPtrField< ::ditcaffe::V1LayerParameter >* + mutable_layers(); + const ::google::protobuf::RepeatedPtrField< ::ditcaffe::V1LayerParameter >& + layers() const; + + // @@protoc_insertion_point(class_scope:ditcaffe.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::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::internal::ArenaStringPtr name_; + ::google::protobuf::RepeatedPtrField< ::std::string> input_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobShape > input_shape_; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 > input_dim_; + ::ditcaffe::NetState* state_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::LayerParameter > layer_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::V1LayerParameter > layers_; + bool force_backward_; + bool debug_info_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static NetParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class SolverParameter : public ::google::protobuf::Message { + 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(); + + 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(SolverParameter* other); + 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 .ditcaffe.NetParameter net_param = 25; + bool has_net_param() const; + void clear_net_param(); + static const int kNetParamFieldNumber = 25; + const ::ditcaffe::NetParameter& net_param() const; + ::ditcaffe::NetParameter* mutable_net_param(); + ::ditcaffe::NetParameter* release_net_param(); + void set_allocated_net_param(::ditcaffe::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 .ditcaffe.NetParameter train_net_param = 21; + bool has_train_net_param() const; + void clear_train_net_param(); + static const int kTrainNetParamFieldNumber = 21; + const ::ditcaffe::NetParameter& train_net_param() const; + ::ditcaffe::NetParameter* mutable_train_net_param(); + ::ditcaffe::NetParameter* release_train_net_param(); + void set_allocated_train_net_param(::ditcaffe::NetParameter* train_net_param); + + // repeated .ditcaffe.NetParameter test_net_param = 22; + int test_net_param_size() const; + void clear_test_net_param(); + static const int kTestNetParamFieldNumber = 22; + const ::ditcaffe::NetParameter& test_net_param(int index) const; + ::ditcaffe::NetParameter* mutable_test_net_param(int index); + ::ditcaffe::NetParameter* add_test_net_param(); + ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetParameter >* + mutable_test_net_param(); + const ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetParameter >& + test_net_param() const; + + // optional .ditcaffe.NetState train_state = 26; + bool has_train_state() const; + void clear_train_state(); + static const int kTrainStateFieldNumber = 26; + const ::ditcaffe::NetState& train_state() const; + ::ditcaffe::NetState* mutable_train_state(); + ::ditcaffe::NetState* release_train_state(); + void set_allocated_train_state(::ditcaffe::NetState* train_state); + + // repeated .ditcaffe.NetState test_state = 27; + int test_state_size() const; + void clear_test_state(); + static const int kTestStateFieldNumber = 27; + const ::ditcaffe::NetState& test_state(int index) const; + ::ditcaffe::NetState* mutable_test_state(int index); + ::ditcaffe::NetState* add_test_state(); + ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetState >* + mutable_test_state(); + const ::google::protobuf::RepeatedPtrField< ::ditcaffe::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 .ditcaffe.SolverParameter.SnapshotFormat snapshot_format = 37 [default = BINARYPROTO]; + bool has_snapshot_format() const; + void clear_snapshot_format(); + static const int kSnapshotFormatFieldNumber = 37; + ::ditcaffe::SolverParameter_SnapshotFormat snapshot_format() const; + void set_snapshot_format(::ditcaffe::SolverParameter_SnapshotFormat value); + + // optional .ditcaffe.SolverParameter.SolverMode solver_mode = 17 [default = GPU]; + bool has_solver_mode() const; + void clear_solver_mode(); + static const int kSolverModeFieldNumber = 17; + ::ditcaffe::SolverParameter_SolverMode solver_mode() const; + void set_solver_mode(::ditcaffe::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; + 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 .ditcaffe.SolverParameter.SolverType solver_type = 30 [default = SGD]; + bool has_solver_type() const; + void clear_solver_type(); + static const int kSolverTypeFieldNumber = 30; + ::ditcaffe::SolverParameter_SolverType solver_type() const; + void set_solver_type(::ditcaffe::SolverParameter_SolverType value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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::uint32 _has_bits_[2]; + ::google::protobuf::internal::ArenaStringPtr net_; + ::ditcaffe::NetParameter* net_param_; + ::google::protobuf::internal::ArenaStringPtr train_net_; + ::google::protobuf::RepeatedPtrField< ::std::string> test_net_; + ::ditcaffe::NetParameter* train_net_param_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetParameter > test_net_param_; + ::ditcaffe::NetState* train_state_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetState > test_state_; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 > test_iter_; + ::google::protobuf::int32 test_interval_; + float base_lr_; + ::google::protobuf::int32 display_; + ::google::protobuf::int32 average_loss_; + ::google::protobuf::int32 max_iter_; + ::google::protobuf::int32 iter_size_; + ::google::protobuf::internal::ArenaStringPtr lr_policy_; + float gamma_; + float power_; + float momentum_; + float weight_decay_; + bool test_compute_loss_; + bool test_initialization_; + bool snapshot_diff_; + bool debug_info_; + ::google::protobuf::int32 stepsize_; + static ::std::string* _default_regularization_type_; + ::google::protobuf::internal::ArenaStringPtr regularization_type_; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 > stepvalue_; + float clip_gradients_; + ::google::protobuf::int32 snapshot_; + ::google::protobuf::internal::ArenaStringPtr snapshot_prefix_; + int snapshot_format_; + int solver_mode_; + ::google::protobuf::int64 random_seed_; + ::google::protobuf::int32 device_id_; + float delta_; + static ::std::string* _default_type_; + ::google::protobuf::internal::ArenaStringPtr type_; + float momentum2_; + float rms_decay_; + bool snapshot_after_train_; + int solver_type_; + mutable int _cached_size_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static SolverParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class SolverState : public ::google::protobuf::Message { + 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(); + + 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(SolverState* other); + 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 .ditcaffe.BlobProto history = 3; + int history_size() const; + void clear_history(); + static const int kHistoryFieldNumber = 3; + const ::ditcaffe::BlobProto& history(int index) const; + ::ditcaffe::BlobProto* mutable_history(int index); + ::ditcaffe::BlobProto* add_history(); + ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >* + mutable_history(); + const ::google::protobuf::RepeatedPtrField< ::ditcaffe::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:ditcaffe.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::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::internal::ArenaStringPtr learned_net_; + ::google::protobuf::int32 iter_; + ::google::protobuf::int32 current_step_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto > history_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static SolverState* default_instance_; +}; +// ------------------------------------------------------------------- + +class NetState : public ::google::protobuf::Message { + 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(); + + 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(NetState* other); + 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 .ditcaffe.Phase phase = 1 [default = TEST]; + bool has_phase() const; + void clear_phase(); + static const int kPhaseFieldNumber = 1; + ::ditcaffe::Phase phase() const; + void set_phase(::ditcaffe::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:ditcaffe.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::uint32 _has_bits_[1]; + mutable int _cached_size_; + int phase_; + ::google::protobuf::int32 level_; + ::google::protobuf::RepeatedPtrField< ::std::string> stage_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static NetState* default_instance_; +}; +// ------------------------------------------------------------------- + +class NetStateRule : public ::google::protobuf::Message { + 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(); + + 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(NetStateRule* other); + 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 .ditcaffe.Phase phase = 1; + bool has_phase() const; + void clear_phase(); + static const int kPhaseFieldNumber = 1; + ::ditcaffe::Phase phase() const; + void set_phase(::ditcaffe::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:ditcaffe.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::uint32 _has_bits_[1]; + mutable int _cached_size_; + int phase_; + ::google::protobuf::int32 min_level_; + ::google::protobuf::RepeatedPtrField< ::std::string> stage_; + ::google::protobuf::RepeatedPtrField< ::std::string> not_stage_; + ::google::protobuf::int32 max_level_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static NetStateRule* default_instance_; +}; +// ------------------------------------------------------------------- + +class ParamSpec : public ::google::protobuf::Message { + 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(); + + 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(ParamSpec* other); + 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 .ditcaffe.ParamSpec.DimCheckMode share_mode = 2; + bool has_share_mode() const; + void clear_share_mode(); + static const int kShareModeFieldNumber = 2; + ::ditcaffe::ParamSpec_DimCheckMode share_mode() const; + void set_share_mode(::ditcaffe::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:ditcaffe.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::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::internal::ArenaStringPtr name_; + int share_mode_; + float lr_mult_; + float decay_mult_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static ParamSpec* default_instance_; +}; +// ------------------------------------------------------------------- + +class LayerParameter : public ::google::protobuf::Message { + 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(); + + 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(LayerParameter* other); + 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 .ditcaffe.Phase phase = 10; + bool has_phase() const; + void clear_phase(); + static const int kPhaseFieldNumber = 10; + ::ditcaffe::Phase phase() const; + void set_phase(::ditcaffe::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 .ditcaffe.ParamSpec param = 6; + int param_size() const; + void clear_param(); + static const int kParamFieldNumber = 6; + const ::ditcaffe::ParamSpec& param(int index) const; + ::ditcaffe::ParamSpec* mutable_param(int index); + ::ditcaffe::ParamSpec* add_param(); + ::google::protobuf::RepeatedPtrField< ::ditcaffe::ParamSpec >* + mutable_param(); + const ::google::protobuf::RepeatedPtrField< ::ditcaffe::ParamSpec >& + param() const; + + // repeated .ditcaffe.BlobProto blobs = 7; + int blobs_size() const; + void clear_blobs(); + static const int kBlobsFieldNumber = 7; + const ::ditcaffe::BlobProto& blobs(int index) const; + ::ditcaffe::BlobProto* mutable_blobs(int index); + ::ditcaffe::BlobProto* add_blobs(); + ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >* + mutable_blobs(); + const ::google::protobuf::RepeatedPtrField< ::ditcaffe::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 .ditcaffe.NetStateRule include = 8; + int include_size() const; + void clear_include(); + static const int kIncludeFieldNumber = 8; + const ::ditcaffe::NetStateRule& include(int index) const; + ::ditcaffe::NetStateRule* mutable_include(int index); + ::ditcaffe::NetStateRule* add_include(); + ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >* + mutable_include(); + const ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >& + include() const; + + // repeated .ditcaffe.NetStateRule exclude = 9; + int exclude_size() const; + void clear_exclude(); + static const int kExcludeFieldNumber = 9; + const ::ditcaffe::NetStateRule& exclude(int index) const; + ::ditcaffe::NetStateRule* mutable_exclude(int index); + ::ditcaffe::NetStateRule* add_exclude(); + ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >* + mutable_exclude(); + const ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >& + exclude() const; + + // optional .ditcaffe.TransformationParameter transform_param = 100; + bool has_transform_param() const; + void clear_transform_param(); + static const int kTransformParamFieldNumber = 100; + const ::ditcaffe::TransformationParameter& transform_param() const; + ::ditcaffe::TransformationParameter* mutable_transform_param(); + ::ditcaffe::TransformationParameter* release_transform_param(); + void set_allocated_transform_param(::ditcaffe::TransformationParameter* transform_param); + + // optional .ditcaffe.LossParameter loss_param = 101; + bool has_loss_param() const; + void clear_loss_param(); + static const int kLossParamFieldNumber = 101; + const ::ditcaffe::LossParameter& loss_param() const; + ::ditcaffe::LossParameter* mutable_loss_param(); + ::ditcaffe::LossParameter* release_loss_param(); + void set_allocated_loss_param(::ditcaffe::LossParameter* loss_param); + + // optional .ditcaffe.AccuracyParameter accuracy_param = 102; + bool has_accuracy_param() const; + void clear_accuracy_param(); + static const int kAccuracyParamFieldNumber = 102; + const ::ditcaffe::AccuracyParameter& accuracy_param() const; + ::ditcaffe::AccuracyParameter* mutable_accuracy_param(); + ::ditcaffe::AccuracyParameter* release_accuracy_param(); + void set_allocated_accuracy_param(::ditcaffe::AccuracyParameter* accuracy_param); + + // optional .ditcaffe.ArgMaxParameter argmax_param = 103; + bool has_argmax_param() const; + void clear_argmax_param(); + static const int kArgmaxParamFieldNumber = 103; + const ::ditcaffe::ArgMaxParameter& argmax_param() const; + ::ditcaffe::ArgMaxParameter* mutable_argmax_param(); + ::ditcaffe::ArgMaxParameter* release_argmax_param(); + void set_allocated_argmax_param(::ditcaffe::ArgMaxParameter* argmax_param); + + // optional .ditcaffe.BatchNormParameter batch_norm_param = 139; + bool has_batch_norm_param() const; + void clear_batch_norm_param(); + static const int kBatchNormParamFieldNumber = 139; + const ::ditcaffe::BatchNormParameter& batch_norm_param() const; + ::ditcaffe::BatchNormParameter* mutable_batch_norm_param(); + ::ditcaffe::BatchNormParameter* release_batch_norm_param(); + void set_allocated_batch_norm_param(::ditcaffe::BatchNormParameter* batch_norm_param); + + // optional .ditcaffe.BiasParameter bias_param = 141; + bool has_bias_param() const; + void clear_bias_param(); + static const int kBiasParamFieldNumber = 141; + const ::ditcaffe::BiasParameter& bias_param() const; + ::ditcaffe::BiasParameter* mutable_bias_param(); + ::ditcaffe::BiasParameter* release_bias_param(); + void set_allocated_bias_param(::ditcaffe::BiasParameter* bias_param); + + // optional .ditcaffe.ConcatParameter concat_param = 104; + bool has_concat_param() const; + void clear_concat_param(); + static const int kConcatParamFieldNumber = 104; + const ::ditcaffe::ConcatParameter& concat_param() const; + ::ditcaffe::ConcatParameter* mutable_concat_param(); + ::ditcaffe::ConcatParameter* release_concat_param(); + void set_allocated_concat_param(::ditcaffe::ConcatParameter* concat_param); + + // optional .ditcaffe.ContrastiveLossParameter contrastive_loss_param = 105; + bool has_contrastive_loss_param() const; + void clear_contrastive_loss_param(); + static const int kContrastiveLossParamFieldNumber = 105; + const ::ditcaffe::ContrastiveLossParameter& contrastive_loss_param() const; + ::ditcaffe::ContrastiveLossParameter* mutable_contrastive_loss_param(); + ::ditcaffe::ContrastiveLossParameter* release_contrastive_loss_param(); + void set_allocated_contrastive_loss_param(::ditcaffe::ContrastiveLossParameter* contrastive_loss_param); + + // optional .ditcaffe.ConvolutionParameter convolution_param = 106; + bool has_convolution_param() const; + void clear_convolution_param(); + static const int kConvolutionParamFieldNumber = 106; + const ::ditcaffe::ConvolutionParameter& convolution_param() const; + ::ditcaffe::ConvolutionParameter* mutable_convolution_param(); + ::ditcaffe::ConvolutionParameter* release_convolution_param(); + void set_allocated_convolution_param(::ditcaffe::ConvolutionParameter* convolution_param); + + // optional .ditcaffe.CropParameter crop_param = 144; + bool has_crop_param() const; + void clear_crop_param(); + static const int kCropParamFieldNumber = 144; + const ::ditcaffe::CropParameter& crop_param() const; + ::ditcaffe::CropParameter* mutable_crop_param(); + ::ditcaffe::CropParameter* release_crop_param(); + void set_allocated_crop_param(::ditcaffe::CropParameter* crop_param); + + // optional .ditcaffe.DataParameter data_param = 107; + bool has_data_param() const; + void clear_data_param(); + static const int kDataParamFieldNumber = 107; + const ::ditcaffe::DataParameter& data_param() const; + ::ditcaffe::DataParameter* mutable_data_param(); + ::ditcaffe::DataParameter* release_data_param(); + void set_allocated_data_param(::ditcaffe::DataParameter* data_param); + + // optional .ditcaffe.DropoutParameter dropout_param = 108; + bool has_dropout_param() const; + void clear_dropout_param(); + static const int kDropoutParamFieldNumber = 108; + const ::ditcaffe::DropoutParameter& dropout_param() const; + ::ditcaffe::DropoutParameter* mutable_dropout_param(); + ::ditcaffe::DropoutParameter* release_dropout_param(); + void set_allocated_dropout_param(::ditcaffe::DropoutParameter* dropout_param); + + // optional .ditcaffe.DummyDataParameter dummy_data_param = 109; + bool has_dummy_data_param() const; + void clear_dummy_data_param(); + static const int kDummyDataParamFieldNumber = 109; + const ::ditcaffe::DummyDataParameter& dummy_data_param() const; + ::ditcaffe::DummyDataParameter* mutable_dummy_data_param(); + ::ditcaffe::DummyDataParameter* release_dummy_data_param(); + void set_allocated_dummy_data_param(::ditcaffe::DummyDataParameter* dummy_data_param); + + // optional .ditcaffe.EltwiseParameter eltwise_param = 110; + bool has_eltwise_param() const; + void clear_eltwise_param(); + static const int kEltwiseParamFieldNumber = 110; + const ::ditcaffe::EltwiseParameter& eltwise_param() const; + ::ditcaffe::EltwiseParameter* mutable_eltwise_param(); + ::ditcaffe::EltwiseParameter* release_eltwise_param(); + void set_allocated_eltwise_param(::ditcaffe::EltwiseParameter* eltwise_param); + + // optional .ditcaffe.ELUParameter elu_param = 140; + bool has_elu_param() const; + void clear_elu_param(); + static const int kEluParamFieldNumber = 140; + const ::ditcaffe::ELUParameter& elu_param() const; + ::ditcaffe::ELUParameter* mutable_elu_param(); + ::ditcaffe::ELUParameter* release_elu_param(); + void set_allocated_elu_param(::ditcaffe::ELUParameter* elu_param); + + // optional .ditcaffe.EmbedParameter embed_param = 137; + bool has_embed_param() const; + void clear_embed_param(); + static const int kEmbedParamFieldNumber = 137; + const ::ditcaffe::EmbedParameter& embed_param() const; + ::ditcaffe::EmbedParameter* mutable_embed_param(); + ::ditcaffe::EmbedParameter* release_embed_param(); + void set_allocated_embed_param(::ditcaffe::EmbedParameter* embed_param); + + // optional .ditcaffe.ExpParameter exp_param = 111; + bool has_exp_param() const; + void clear_exp_param(); + static const int kExpParamFieldNumber = 111; + const ::ditcaffe::ExpParameter& exp_param() const; + ::ditcaffe::ExpParameter* mutable_exp_param(); + ::ditcaffe::ExpParameter* release_exp_param(); + void set_allocated_exp_param(::ditcaffe::ExpParameter* exp_param); + + // optional .ditcaffe.FlattenParameter flatten_param = 135; + bool has_flatten_param() const; + void clear_flatten_param(); + static const int kFlattenParamFieldNumber = 135; + const ::ditcaffe::FlattenParameter& flatten_param() const; + ::ditcaffe::FlattenParameter* mutable_flatten_param(); + ::ditcaffe::FlattenParameter* release_flatten_param(); + void set_allocated_flatten_param(::ditcaffe::FlattenParameter* flatten_param); + + // optional .ditcaffe.HDF5DataParameter hdf5_data_param = 112; + bool has_hdf5_data_param() const; + void clear_hdf5_data_param(); + static const int kHdf5DataParamFieldNumber = 112; + const ::ditcaffe::HDF5DataParameter& hdf5_data_param() const; + ::ditcaffe::HDF5DataParameter* mutable_hdf5_data_param(); + ::ditcaffe::HDF5DataParameter* release_hdf5_data_param(); + void set_allocated_hdf5_data_param(::ditcaffe::HDF5DataParameter* hdf5_data_param); + + // optional .ditcaffe.HDF5OutputParameter hdf5_output_param = 113; + bool has_hdf5_output_param() const; + void clear_hdf5_output_param(); + static const int kHdf5OutputParamFieldNumber = 113; + const ::ditcaffe::HDF5OutputParameter& hdf5_output_param() const; + ::ditcaffe::HDF5OutputParameter* mutable_hdf5_output_param(); + ::ditcaffe::HDF5OutputParameter* release_hdf5_output_param(); + void set_allocated_hdf5_output_param(::ditcaffe::HDF5OutputParameter* hdf5_output_param); + + // optional .ditcaffe.HingeLossParameter hinge_loss_param = 114; + bool has_hinge_loss_param() const; + void clear_hinge_loss_param(); + static const int kHingeLossParamFieldNumber = 114; + const ::ditcaffe::HingeLossParameter& hinge_loss_param() const; + ::ditcaffe::HingeLossParameter* mutable_hinge_loss_param(); + ::ditcaffe::HingeLossParameter* release_hinge_loss_param(); + void set_allocated_hinge_loss_param(::ditcaffe::HingeLossParameter* hinge_loss_param); + + // optional .ditcaffe.ImageDataParameter image_data_param = 115; + bool has_image_data_param() const; + void clear_image_data_param(); + static const int kImageDataParamFieldNumber = 115; + const ::ditcaffe::ImageDataParameter& image_data_param() const; + ::ditcaffe::ImageDataParameter* mutable_image_data_param(); + ::ditcaffe::ImageDataParameter* release_image_data_param(); + void set_allocated_image_data_param(::ditcaffe::ImageDataParameter* image_data_param); + + // optional .ditcaffe.InfogainLossParameter infogain_loss_param = 116; + bool has_infogain_loss_param() const; + void clear_infogain_loss_param(); + static const int kInfogainLossParamFieldNumber = 116; + const ::ditcaffe::InfogainLossParameter& infogain_loss_param() const; + ::ditcaffe::InfogainLossParameter* mutable_infogain_loss_param(); + ::ditcaffe::InfogainLossParameter* release_infogain_loss_param(); + void set_allocated_infogain_loss_param(::ditcaffe::InfogainLossParameter* infogain_loss_param); + + // optional .ditcaffe.InnerProductParameter inner_product_param = 117; + bool has_inner_product_param() const; + void clear_inner_product_param(); + static const int kInnerProductParamFieldNumber = 117; + const ::ditcaffe::InnerProductParameter& inner_product_param() const; + ::ditcaffe::InnerProductParameter* mutable_inner_product_param(); + ::ditcaffe::InnerProductParameter* release_inner_product_param(); + void set_allocated_inner_product_param(::ditcaffe::InnerProductParameter* inner_product_param); + + // optional .ditcaffe.InputParameter input_param = 143; + bool has_input_param() const; + void clear_input_param(); + static const int kInputParamFieldNumber = 143; + const ::ditcaffe::InputParameter& input_param() const; + ::ditcaffe::InputParameter* mutable_input_param(); + ::ditcaffe::InputParameter* release_input_param(); + void set_allocated_input_param(::ditcaffe::InputParameter* input_param); + + // optional .ditcaffe.LogParameter log_param = 134; + bool has_log_param() const; + void clear_log_param(); + static const int kLogParamFieldNumber = 134; + const ::ditcaffe::LogParameter& log_param() const; + ::ditcaffe::LogParameter* mutable_log_param(); + ::ditcaffe::LogParameter* release_log_param(); + void set_allocated_log_param(::ditcaffe::LogParameter* log_param); + + // optional .ditcaffe.LRNParameter lrn_param = 118; + bool has_lrn_param() const; + void clear_lrn_param(); + static const int kLrnParamFieldNumber = 118; + const ::ditcaffe::LRNParameter& lrn_param() const; + ::ditcaffe::LRNParameter* mutable_lrn_param(); + ::ditcaffe::LRNParameter* release_lrn_param(); + void set_allocated_lrn_param(::ditcaffe::LRNParameter* lrn_param); + + // optional .ditcaffe.MemoryDataParameter memory_data_param = 119; + bool has_memory_data_param() const; + void clear_memory_data_param(); + static const int kMemoryDataParamFieldNumber = 119; + const ::ditcaffe::MemoryDataParameter& memory_data_param() const; + ::ditcaffe::MemoryDataParameter* mutable_memory_data_param(); + ::ditcaffe::MemoryDataParameter* release_memory_data_param(); + void set_allocated_memory_data_param(::ditcaffe::MemoryDataParameter* memory_data_param); + + // optional .ditcaffe.MVNParameter mvn_param = 120; + bool has_mvn_param() const; + void clear_mvn_param(); + static const int kMvnParamFieldNumber = 120; + const ::ditcaffe::MVNParameter& mvn_param() const; + ::ditcaffe::MVNParameter* mutable_mvn_param(); + ::ditcaffe::MVNParameter* release_mvn_param(); + void set_allocated_mvn_param(::ditcaffe::MVNParameter* mvn_param); + + // optional .ditcaffe.ParameterParameter parameter_param = 145; + bool has_parameter_param() const; + void clear_parameter_param(); + static const int kParameterParamFieldNumber = 145; + const ::ditcaffe::ParameterParameter& parameter_param() const; + ::ditcaffe::ParameterParameter* mutable_parameter_param(); + ::ditcaffe::ParameterParameter* release_parameter_param(); + void set_allocated_parameter_param(::ditcaffe::ParameterParameter* parameter_param); + + // optional .ditcaffe.PoolingParameter pooling_param = 121; + bool has_pooling_param() const; + void clear_pooling_param(); + static const int kPoolingParamFieldNumber = 121; + const ::ditcaffe::PoolingParameter& pooling_param() const; + ::ditcaffe::PoolingParameter* mutable_pooling_param(); + ::ditcaffe::PoolingParameter* release_pooling_param(); + void set_allocated_pooling_param(::ditcaffe::PoolingParameter* pooling_param); + + // optional .ditcaffe.PowerParameter power_param = 122; + bool has_power_param() const; + void clear_power_param(); + static const int kPowerParamFieldNumber = 122; + const ::ditcaffe::PowerParameter& power_param() const; + ::ditcaffe::PowerParameter* mutable_power_param(); + ::ditcaffe::PowerParameter* release_power_param(); + void set_allocated_power_param(::ditcaffe::PowerParameter* power_param); + + // optional .ditcaffe.PReLUParameter prelu_param = 131; + bool has_prelu_param() const; + void clear_prelu_param(); + static const int kPreluParamFieldNumber = 131; + const ::ditcaffe::PReLUParameter& prelu_param() const; + ::ditcaffe::PReLUParameter* mutable_prelu_param(); + ::ditcaffe::PReLUParameter* release_prelu_param(); + void set_allocated_prelu_param(::ditcaffe::PReLUParameter* prelu_param); + + // optional .ditcaffe.PythonParameter python_param = 130; + bool has_python_param() const; + void clear_python_param(); + static const int kPythonParamFieldNumber = 130; + const ::ditcaffe::PythonParameter& python_param() const; + ::ditcaffe::PythonParameter* mutable_python_param(); + ::ditcaffe::PythonParameter* release_python_param(); + void set_allocated_python_param(::ditcaffe::PythonParameter* python_param); + + // optional .ditcaffe.ReductionParameter reduction_param = 136; + bool has_reduction_param() const; + void clear_reduction_param(); + static const int kReductionParamFieldNumber = 136; + const ::ditcaffe::ReductionParameter& reduction_param() const; + ::ditcaffe::ReductionParameter* mutable_reduction_param(); + ::ditcaffe::ReductionParameter* release_reduction_param(); + void set_allocated_reduction_param(::ditcaffe::ReductionParameter* reduction_param); + + // optional .ditcaffe.ReLUParameter relu_param = 123; + bool has_relu_param() const; + void clear_relu_param(); + static const int kReluParamFieldNumber = 123; + const ::ditcaffe::ReLUParameter& relu_param() const; + ::ditcaffe::ReLUParameter* mutable_relu_param(); + ::ditcaffe::ReLUParameter* release_relu_param(); + void set_allocated_relu_param(::ditcaffe::ReLUParameter* relu_param); + + // optional .ditcaffe.ReshapeParameter reshape_param = 133; + bool has_reshape_param() const; + void clear_reshape_param(); + static const int kReshapeParamFieldNumber = 133; + const ::ditcaffe::ReshapeParameter& reshape_param() const; + ::ditcaffe::ReshapeParameter* mutable_reshape_param(); + ::ditcaffe::ReshapeParameter* release_reshape_param(); + void set_allocated_reshape_param(::ditcaffe::ReshapeParameter* reshape_param); + + // optional .ditcaffe.ScaleParameter scale_param = 142; + bool has_scale_param() const; + void clear_scale_param(); + static const int kScaleParamFieldNumber = 142; + const ::ditcaffe::ScaleParameter& scale_param() const; + ::ditcaffe::ScaleParameter* mutable_scale_param(); + ::ditcaffe::ScaleParameter* release_scale_param(); + void set_allocated_scale_param(::ditcaffe::ScaleParameter* scale_param); + + // optional .ditcaffe.SigmoidParameter sigmoid_param = 124; + bool has_sigmoid_param() const; + void clear_sigmoid_param(); + static const int kSigmoidParamFieldNumber = 124; + const ::ditcaffe::SigmoidParameter& sigmoid_param() const; + ::ditcaffe::SigmoidParameter* mutable_sigmoid_param(); + ::ditcaffe::SigmoidParameter* release_sigmoid_param(); + void set_allocated_sigmoid_param(::ditcaffe::SigmoidParameter* sigmoid_param); + + // optional .ditcaffe.SoftmaxParameter softmax_param = 125; + bool has_softmax_param() const; + void clear_softmax_param(); + static const int kSoftmaxParamFieldNumber = 125; + const ::ditcaffe::SoftmaxParameter& softmax_param() const; + ::ditcaffe::SoftmaxParameter* mutable_softmax_param(); + ::ditcaffe::SoftmaxParameter* release_softmax_param(); + void set_allocated_softmax_param(::ditcaffe::SoftmaxParameter* softmax_param); + + // optional .ditcaffe.SPPParameter spp_param = 132; + bool has_spp_param() const; + void clear_spp_param(); + static const int kSppParamFieldNumber = 132; + const ::ditcaffe::SPPParameter& spp_param() const; + ::ditcaffe::SPPParameter* mutable_spp_param(); + ::ditcaffe::SPPParameter* release_spp_param(); + void set_allocated_spp_param(::ditcaffe::SPPParameter* spp_param); + + // optional .ditcaffe.SliceParameter slice_param = 126; + bool has_slice_param() const; + void clear_slice_param(); + static const int kSliceParamFieldNumber = 126; + const ::ditcaffe::SliceParameter& slice_param() const; + ::ditcaffe::SliceParameter* mutable_slice_param(); + ::ditcaffe::SliceParameter* release_slice_param(); + void set_allocated_slice_param(::ditcaffe::SliceParameter* slice_param); + + // optional .ditcaffe.TanHParameter tanh_param = 127; + bool has_tanh_param() const; + void clear_tanh_param(); + static const int kTanhParamFieldNumber = 127; + const ::ditcaffe::TanHParameter& tanh_param() const; + ::ditcaffe::TanHParameter* mutable_tanh_param(); + ::ditcaffe::TanHParameter* release_tanh_param(); + void set_allocated_tanh_param(::ditcaffe::TanHParameter* tanh_param); + + // optional .ditcaffe.ThresholdParameter threshold_param = 128; + bool has_threshold_param() const; + void clear_threshold_param(); + static const int kThresholdParamFieldNumber = 128; + const ::ditcaffe::ThresholdParameter& threshold_param() const; + ::ditcaffe::ThresholdParameter* mutable_threshold_param(); + ::ditcaffe::ThresholdParameter* release_threshold_param(); + void set_allocated_threshold_param(::ditcaffe::ThresholdParameter* threshold_param); + + // optional .ditcaffe.TileParameter tile_param = 138; + bool has_tile_param() const; + void clear_tile_param(); + static const int kTileParamFieldNumber = 138; + const ::ditcaffe::TileParameter& tile_param() const; + ::ditcaffe::TileParameter* mutable_tile_param(); + ::ditcaffe::TileParameter* release_tile_param(); + void set_allocated_tile_param(::ditcaffe::TileParameter* tile_param); + + // optional .ditcaffe.WindowDataParameter window_data_param = 129; + bool has_window_data_param() const; + void clear_window_data_param(); + static const int kWindowDataParamFieldNumber = 129; + const ::ditcaffe::WindowDataParameter& window_data_param() const; + ::ditcaffe::WindowDataParameter* mutable_window_data_param(); + ::ditcaffe::WindowDataParameter* release_window_data_param(); + void set_allocated_window_data_param(::ditcaffe::WindowDataParameter* window_data_param); + + // @@protoc_insertion_point(class_scope:ditcaffe.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_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_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_python_param(); + inline void clear_has_python_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::uint32 _has_bits_[2]; + ::google::protobuf::internal::ArenaStringPtr name_; + ::google::protobuf::internal::ArenaStringPtr type_; + ::google::protobuf::RepeatedPtrField< ::std::string> bottom_; + ::google::protobuf::RepeatedPtrField< ::std::string> top_; + ::google::protobuf::RepeatedField< float > loss_weight_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::ParamSpec > param_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto > blobs_; + ::google::protobuf::RepeatedField< bool > propagate_down_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule > include_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule > exclude_; + ::ditcaffe::TransformationParameter* transform_param_; + ::ditcaffe::LossParameter* loss_param_; + ::ditcaffe::AccuracyParameter* accuracy_param_; + ::ditcaffe::ArgMaxParameter* argmax_param_; + ::ditcaffe::BatchNormParameter* batch_norm_param_; + ::ditcaffe::BiasParameter* bias_param_; + ::ditcaffe::ConcatParameter* concat_param_; + ::ditcaffe::ContrastiveLossParameter* contrastive_loss_param_; + ::ditcaffe::ConvolutionParameter* convolution_param_; + ::ditcaffe::CropParameter* crop_param_; + ::ditcaffe::DataParameter* data_param_; + ::ditcaffe::DropoutParameter* dropout_param_; + ::ditcaffe::DummyDataParameter* dummy_data_param_; + ::ditcaffe::EltwiseParameter* eltwise_param_; + ::ditcaffe::ELUParameter* elu_param_; + ::ditcaffe::EmbedParameter* embed_param_; + ::ditcaffe::ExpParameter* exp_param_; + ::ditcaffe::FlattenParameter* flatten_param_; + ::ditcaffe::HDF5DataParameter* hdf5_data_param_; + ::ditcaffe::HDF5OutputParameter* hdf5_output_param_; + ::ditcaffe::HingeLossParameter* hinge_loss_param_; + ::ditcaffe::ImageDataParameter* image_data_param_; + ::ditcaffe::InfogainLossParameter* infogain_loss_param_; + ::ditcaffe::InnerProductParameter* inner_product_param_; + ::ditcaffe::InputParameter* input_param_; + ::ditcaffe::LogParameter* log_param_; + ::ditcaffe::LRNParameter* lrn_param_; + ::ditcaffe::MemoryDataParameter* memory_data_param_; + ::ditcaffe::MVNParameter* mvn_param_; + ::ditcaffe::ParameterParameter* parameter_param_; + ::ditcaffe::PoolingParameter* pooling_param_; + ::ditcaffe::PowerParameter* power_param_; + ::ditcaffe::PReLUParameter* prelu_param_; + ::ditcaffe::PythonParameter* python_param_; + ::ditcaffe::ReductionParameter* reduction_param_; + ::ditcaffe::ReLUParameter* relu_param_; + ::ditcaffe::ReshapeParameter* reshape_param_; + ::ditcaffe::ScaleParameter* scale_param_; + ::ditcaffe::SigmoidParameter* sigmoid_param_; + ::ditcaffe::SoftmaxParameter* softmax_param_; + ::ditcaffe::SPPParameter* spp_param_; + ::ditcaffe::SliceParameter* slice_param_; + ::ditcaffe::TanHParameter* tanh_param_; + ::ditcaffe::ThresholdParameter* threshold_param_; + ::ditcaffe::TileParameter* tile_param_; + ::ditcaffe::WindowDataParameter* window_data_param_; + int phase_; + mutable int _cached_size_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static LayerParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class TransformationParameter : public ::google::protobuf::Message { + 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(); + + 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(TransformationParameter* other); + 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:ditcaffe.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::uint32 _has_bits_[1]; + mutable int _cached_size_; + float scale_; + ::google::protobuf::uint32 crop_size_; + ::google::protobuf::internal::ArenaStringPtr mean_file_; + ::google::protobuf::RepeatedField< float > mean_value_; + bool mirror_; + bool force_color_; + bool force_gray_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static TransformationParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class LossParameter : public ::google::protobuf::Message { + 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(); + + 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(LossParameter* other); + 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 .ditcaffe.LossParameter.NormalizationMode normalization = 3 [default = VALID]; + bool has_normalization() const; + void clear_normalization(); + static const int kNormalizationFieldNumber = 3; + ::ditcaffe::LossParameter_NormalizationMode normalization() const; + void set_normalization(::ditcaffe::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:ditcaffe.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::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::int32 ignore_label_; + int normalization_; + bool normalize_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static LossParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class AccuracyParameter : public ::google::protobuf::Message { + 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(); + + 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(AccuracyParameter* other); + 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:ditcaffe.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::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::uint32 top_k_; + ::google::protobuf::int32 axis_; + ::google::protobuf::int32 ignore_label_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static AccuracyParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class ArgMaxParameter : public ::google::protobuf::Message { + 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(); + + 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(ArgMaxParameter* other); + 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:ditcaffe.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::uint32 _has_bits_[1]; + mutable int _cached_size_; + bool out_max_val_; + ::google::protobuf::uint32 top_k_; + ::google::protobuf::int32 axis_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static ArgMaxParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class ConcatParameter : public ::google::protobuf::Message { + 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(); + + 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(ConcatParameter* other); + 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:ditcaffe.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::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::int32 axis_; + ::google::protobuf::uint32 concat_dim_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static ConcatParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class BatchNormParameter : public ::google::protobuf::Message { + 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(); + + 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(BatchNormParameter* other); + 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:ditcaffe.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::uint32 _has_bits_[1]; + mutable int _cached_size_; + bool use_global_stats_; + float moving_average_fraction_; + float eps_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static BatchNormParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class BiasParameter : public ::google::protobuf::Message { + 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(); + + 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(BiasParameter* other); + 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 .ditcaffe.FillerParameter filler = 3; + bool has_filler() const; + void clear_filler(); + static const int kFillerFieldNumber = 3; + const ::ditcaffe::FillerParameter& filler() const; + ::ditcaffe::FillerParameter* mutable_filler(); + ::ditcaffe::FillerParameter* release_filler(); + void set_allocated_filler(::ditcaffe::FillerParameter* filler); + + // @@protoc_insertion_point(class_scope:ditcaffe.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::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::int32 axis_; + ::google::protobuf::int32 num_axes_; + ::ditcaffe::FillerParameter* filler_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static BiasParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class ContrastiveLossParameter : public ::google::protobuf::Message { + 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(); + + 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(ContrastiveLossParameter* other); + 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:ditcaffe.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::uint32 _has_bits_[1]; + mutable int _cached_size_; + float margin_; + bool legacy_version_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static ContrastiveLossParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class ConvolutionParameter : public ::google::protobuf::Message { + 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(); + + 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(ConvolutionParameter* other); + 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 .ditcaffe.FillerParameter weight_filler = 7; + bool has_weight_filler() const; + void clear_weight_filler(); + static const int kWeightFillerFieldNumber = 7; + const ::ditcaffe::FillerParameter& weight_filler() const; + ::ditcaffe::FillerParameter* mutable_weight_filler(); + ::ditcaffe::FillerParameter* release_weight_filler(); + void set_allocated_weight_filler(::ditcaffe::FillerParameter* weight_filler); + + // optional .ditcaffe.FillerParameter bias_filler = 8; + bool has_bias_filler() const; + void clear_bias_filler(); + static const int kBiasFillerFieldNumber = 8; + const ::ditcaffe::FillerParameter& bias_filler() const; + ::ditcaffe::FillerParameter* mutable_bias_filler(); + ::ditcaffe::FillerParameter* release_bias_filler(); + void set_allocated_bias_filler(::ditcaffe::FillerParameter* bias_filler); + + // optional .ditcaffe.ConvolutionParameter.Engine engine = 15 [default = DEFAULT]; + bool has_engine() const; + void clear_engine(); + static const int kEngineFieldNumber = 15; + ::ditcaffe::ConvolutionParameter_Engine engine() const; + void set_engine(::ditcaffe::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:ditcaffe.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::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > pad_; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > kernel_size_; + ::google::protobuf::uint32 num_output_; + ::google::protobuf::uint32 pad_h_; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > stride_; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > dilation_; + ::google::protobuf::uint32 pad_w_; + ::google::protobuf::uint32 kernel_h_; + ::google::protobuf::uint32 kernel_w_; + bool bias_term_; + bool force_nd_im2col_; + ::google::protobuf::uint32 stride_h_; + ::google::protobuf::uint32 stride_w_; + ::ditcaffe::FillerParameter* weight_filler_; + ::google::protobuf::uint32 group_; + int engine_; + ::ditcaffe::FillerParameter* bias_filler_; + ::google::protobuf::int32 axis_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static ConvolutionParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class CropParameter : public ::google::protobuf::Message { + 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(); + + 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(CropParameter* other); + 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:ditcaffe.CropParameter) + private: + inline void set_has_axis(); + inline void clear_has_axis(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > offset_; + ::google::protobuf::int32 axis_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static CropParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class DataParameter : public ::google::protobuf::Message { + 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(); + + 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(DataParameter* other); + 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 .ditcaffe.DataParameter.DB backend = 8 [default = LEVELDB]; + bool has_backend() const; + void clear_backend(); + static const int kBackendFieldNumber = 8; + ::ditcaffe::DataParameter_DB backend() const; + void set_backend(::ditcaffe::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:ditcaffe.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::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::internal::ArenaStringPtr source_; + ::google::protobuf::uint32 batch_size_; + ::google::protobuf::uint32 rand_skip_; + int backend_; + float scale_; + ::google::protobuf::internal::ArenaStringPtr mean_file_; + ::google::protobuf::uint32 crop_size_; + bool mirror_; + bool force_encoded_color_; + ::google::protobuf::uint32 prefetch_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static DataParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class DropoutParameter : public ::google::protobuf::Message { + 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(); + + 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(DropoutParameter* other); + 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:ditcaffe.DropoutParameter) + private: + inline void set_has_dropout_ratio(); + inline void clear_has_dropout_ratio(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + float dropout_ratio_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static DropoutParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class DummyDataParameter : public ::google::protobuf::Message { + 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(); + + 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(DummyDataParameter* other); + 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 .ditcaffe.FillerParameter data_filler = 1; + int data_filler_size() const; + void clear_data_filler(); + static const int kDataFillerFieldNumber = 1; + const ::ditcaffe::FillerParameter& data_filler(int index) const; + ::ditcaffe::FillerParameter* mutable_data_filler(int index); + ::ditcaffe::FillerParameter* add_data_filler(); + ::google::protobuf::RepeatedPtrField< ::ditcaffe::FillerParameter >* + mutable_data_filler(); + const ::google::protobuf::RepeatedPtrField< ::ditcaffe::FillerParameter >& + data_filler() const; + + // repeated .ditcaffe.BlobShape shape = 6; + int shape_size() const; + void clear_shape(); + static const int kShapeFieldNumber = 6; + const ::ditcaffe::BlobShape& shape(int index) const; + ::ditcaffe::BlobShape* mutable_shape(int index); + ::ditcaffe::BlobShape* add_shape(); + ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobShape >* + mutable_shape(); + const ::google::protobuf::RepeatedPtrField< ::ditcaffe::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:ditcaffe.DummyDataParameter) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::FillerParameter > data_filler_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::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_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static DummyDataParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class EltwiseParameter : public ::google::protobuf::Message { + 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(); + + 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(EltwiseParameter* other); + 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 .ditcaffe.EltwiseParameter.EltwiseOp operation = 1 [default = SUM]; + bool has_operation() const; + void clear_operation(); + static const int kOperationFieldNumber = 1; + ::ditcaffe::EltwiseParameter_EltwiseOp operation() const; + void set_operation(::ditcaffe::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:ditcaffe.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::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::RepeatedField< float > coeff_; + int operation_; + bool stable_prod_grad_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static EltwiseParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class ELUParameter : public ::google::protobuf::Message { + 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(); + + 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(ELUParameter* other); + 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:ditcaffe.ELUParameter) + private: + inline void set_has_alpha(); + inline void clear_has_alpha(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + float alpha_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static ELUParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class EmbedParameter : public ::google::protobuf::Message { + 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(); + + 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(EmbedParameter* other); + 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 .ditcaffe.FillerParameter weight_filler = 4; + bool has_weight_filler() const; + void clear_weight_filler(); + static const int kWeightFillerFieldNumber = 4; + const ::ditcaffe::FillerParameter& weight_filler() const; + ::ditcaffe::FillerParameter* mutable_weight_filler(); + ::ditcaffe::FillerParameter* release_weight_filler(); + void set_allocated_weight_filler(::ditcaffe::FillerParameter* weight_filler); + + // optional .ditcaffe.FillerParameter bias_filler = 5; + bool has_bias_filler() const; + void clear_bias_filler(); + static const int kBiasFillerFieldNumber = 5; + const ::ditcaffe::FillerParameter& bias_filler() const; + ::ditcaffe::FillerParameter* mutable_bias_filler(); + ::ditcaffe::FillerParameter* release_bias_filler(); + void set_allocated_bias_filler(::ditcaffe::FillerParameter* bias_filler); + + // @@protoc_insertion_point(class_scope:ditcaffe.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::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::uint32 num_output_; + ::google::protobuf::uint32 input_dim_; + ::ditcaffe::FillerParameter* weight_filler_; + ::ditcaffe::FillerParameter* bias_filler_; + bool bias_term_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static EmbedParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class ExpParameter : public ::google::protobuf::Message { + 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(); + + 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(ExpParameter* other); + 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:ditcaffe.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::uint32 _has_bits_[1]; + mutable int _cached_size_; + float base_; + float scale_; + float shift_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static ExpParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class FlattenParameter : public ::google::protobuf::Message { + 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(); + + 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(FlattenParameter* other); + 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:ditcaffe.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::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::int32 axis_; + ::google::protobuf::int32 end_axis_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static FlattenParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class HDF5DataParameter : public ::google::protobuf::Message { + 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(); + + 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(HDF5DataParameter* other); + 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:ditcaffe.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::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::internal::ArenaStringPtr source_; + ::google::protobuf::uint32 batch_size_; + bool shuffle_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static HDF5DataParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class HDF5OutputParameter : public ::google::protobuf::Message { + 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(); + + 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(HDF5OutputParameter* other); + 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:ditcaffe.HDF5OutputParameter) + private: + inline void set_has_file_name(); + inline void clear_has_file_name(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::internal::ArenaStringPtr file_name_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static HDF5OutputParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class HingeLossParameter : public ::google::protobuf::Message { + 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(); + + 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(HingeLossParameter* other); + 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 .ditcaffe.HingeLossParameter.Norm norm = 1 [default = L1]; + bool has_norm() const; + void clear_norm(); + static const int kNormFieldNumber = 1; + ::ditcaffe::HingeLossParameter_Norm norm() const; + void set_norm(::ditcaffe::HingeLossParameter_Norm value); + + // @@protoc_insertion_point(class_scope:ditcaffe.HingeLossParameter) + private: + inline void set_has_norm(); + inline void clear_has_norm(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + int norm_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static HingeLossParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class ImageDataParameter : public ::google::protobuf::Message { + 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(); + + 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(ImageDataParameter* other); + 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:ditcaffe.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::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::internal::ArenaStringPtr source_; + ::google::protobuf::uint32 batch_size_; + ::google::protobuf::uint32 rand_skip_; + ::google::protobuf::uint32 new_height_; + ::google::protobuf::uint32 new_width_; + bool shuffle_; + bool is_color_; + bool mirror_; + float scale_; + ::google::protobuf::internal::ArenaStringPtr mean_file_; + ::google::protobuf::internal::ArenaStringPtr root_folder_; + ::google::protobuf::uint32 crop_size_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static ImageDataParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class InfogainLossParameter : public ::google::protobuf::Message { + 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(); + + 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(InfogainLossParameter* other); + 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:ditcaffe.InfogainLossParameter) + private: + inline void set_has_source(); + inline void clear_has_source(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::internal::ArenaStringPtr source_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static InfogainLossParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class InnerProductParameter : public ::google::protobuf::Message { + 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(); + + 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(InnerProductParameter* other); + 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 .ditcaffe.FillerParameter weight_filler = 3; + bool has_weight_filler() const; + void clear_weight_filler(); + static const int kWeightFillerFieldNumber = 3; + const ::ditcaffe::FillerParameter& weight_filler() const; + ::ditcaffe::FillerParameter* mutable_weight_filler(); + ::ditcaffe::FillerParameter* release_weight_filler(); + void set_allocated_weight_filler(::ditcaffe::FillerParameter* weight_filler); + + // optional .ditcaffe.FillerParameter bias_filler = 4; + bool has_bias_filler() const; + void clear_bias_filler(); + static const int kBiasFillerFieldNumber = 4; + const ::ditcaffe::FillerParameter& bias_filler() const; + ::ditcaffe::FillerParameter* mutable_bias_filler(); + ::ditcaffe::FillerParameter* release_bias_filler(); + void set_allocated_bias_filler(::ditcaffe::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:ditcaffe.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::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::ditcaffe::FillerParameter* weight_filler_; + ::google::protobuf::uint32 num_output_; + bool bias_term_; + bool transpose_; + ::ditcaffe::FillerParameter* bias_filler_; + ::google::protobuf::int32 axis_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static InnerProductParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class InputParameter : public ::google::protobuf::Message { + 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(); + + 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(InputParameter* other); + 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 .ditcaffe.BlobShape shape = 1; + int shape_size() const; + void clear_shape(); + static const int kShapeFieldNumber = 1; + const ::ditcaffe::BlobShape& shape(int index) const; + ::ditcaffe::BlobShape* mutable_shape(int index); + ::ditcaffe::BlobShape* add_shape(); + ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobShape >* + mutable_shape(); + const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobShape >& + shape() const; + + // @@protoc_insertion_point(class_scope:ditcaffe.InputParameter) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobShape > shape_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static InputParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class LogParameter : public ::google::protobuf::Message { + 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(); + + 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(LogParameter* other); + 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:ditcaffe.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::uint32 _has_bits_[1]; + mutable int _cached_size_; + float base_; + float scale_; + float shift_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static LogParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class LRNParameter : public ::google::protobuf::Message { + 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(); + + 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(LRNParameter* other); + 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 .ditcaffe.LRNParameter.NormRegion norm_region = 4 [default = ACROSS_CHANNELS]; + bool has_norm_region() const; + void clear_norm_region(); + static const int kNormRegionFieldNumber = 4; + ::ditcaffe::LRNParameter_NormRegion norm_region() const; + void set_norm_region(::ditcaffe::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 .ditcaffe.LRNParameter.Engine engine = 6 [default = DEFAULT]; + bool has_engine() const; + void clear_engine(); + static const int kEngineFieldNumber = 6; + ::ditcaffe::LRNParameter_Engine engine() const; + void set_engine(::ditcaffe::LRNParameter_Engine value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::uint32 local_size_; + float alpha_; + float beta_; + int norm_region_; + float k_; + int engine_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static LRNParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class MemoryDataParameter : public ::google::protobuf::Message { + 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(); + + 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(MemoryDataParameter* other); + 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:ditcaffe.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::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::uint32 batch_size_; + ::google::protobuf::uint32 channels_; + ::google::protobuf::uint32 height_; + ::google::protobuf::uint32 width_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static MemoryDataParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class MVNParameter : public ::google::protobuf::Message { + 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(); + + 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(MVNParameter* other); + 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:ditcaffe.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::uint32 _has_bits_[1]; + mutable int _cached_size_; + bool normalize_variance_; + bool across_channels_; + float eps_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static MVNParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class ParameterParameter : public ::google::protobuf::Message { + 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(); + + 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(ParameterParameter* other); + 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 .ditcaffe.BlobShape shape = 1; + bool has_shape() const; + void clear_shape(); + static const int kShapeFieldNumber = 1; + const ::ditcaffe::BlobShape& shape() const; + ::ditcaffe::BlobShape* mutable_shape(); + ::ditcaffe::BlobShape* release_shape(); + void set_allocated_shape(::ditcaffe::BlobShape* shape); + + // @@protoc_insertion_point(class_scope:ditcaffe.ParameterParameter) + private: + inline void set_has_shape(); + inline void clear_has_shape(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::ditcaffe::BlobShape* shape_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static ParameterParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class PoolingParameter : public ::google::protobuf::Message { + 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(); + + 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(PoolingParameter* other); + 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 .ditcaffe.PoolingParameter.PoolMethod pool = 1 [default = MAX]; + bool has_pool() const; + void clear_pool(); + static const int kPoolFieldNumber = 1; + ::ditcaffe::PoolingParameter_PoolMethod pool() const; + void set_pool(::ditcaffe::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 .ditcaffe.PoolingParameter.Engine engine = 11 [default = DEFAULT]; + bool has_engine() const; + void clear_engine(); + static const int kEngineFieldNumber = 11; + ::ditcaffe::PoolingParameter_Engine engine() const; + void set_engine(::ditcaffe::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); + + // optional bool torch_pooling = 40 [default = false]; + bool has_torch_pooling() const; + void clear_torch_pooling(); + static const int kTorchPoolingFieldNumber = 40; + bool torch_pooling() const; + void set_torch_pooling(bool value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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(); + inline void set_has_torch_pooling(); + inline void clear_has_torch_pooling(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::uint32 _has_bits_[1]; + 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_; + ::google::protobuf::uint32 stride_h_; + ::google::protobuf::uint32 stride_w_; + int engine_; + bool global_pooling_; + bool torch_pooling_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static PoolingParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class PowerParameter : public ::google::protobuf::Message { + 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(); + + 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(PowerParameter* other); + 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:ditcaffe.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::uint32 _has_bits_[1]; + mutable int _cached_size_; + float power_; + float scale_; + float shift_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static PowerParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class PythonParameter : public ::google::protobuf::Message { + 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(); + + 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(PythonParameter* other); + 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:ditcaffe.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::uint32 _has_bits_[1]; + 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_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static PythonParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class ReductionParameter : public ::google::protobuf::Message { + 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(); + + 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(ReductionParameter* other); + 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 .ditcaffe.ReductionParameter.ReductionOp operation = 1 [default = SUM]; + bool has_operation() const; + void clear_operation(); + static const int kOperationFieldNumber = 1; + ::ditcaffe::ReductionParameter_ReductionOp operation() const; + void set_operation(::ditcaffe::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:ditcaffe.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::uint32 _has_bits_[1]; + mutable int _cached_size_; + int operation_; + ::google::protobuf::int32 axis_; + float coeff_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static ReductionParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class ReLUParameter : public ::google::protobuf::Message { + 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(); + + 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(ReLUParameter* other); + 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 .ditcaffe.ReLUParameter.Engine engine = 2 [default = DEFAULT]; + bool has_engine() const; + void clear_engine(); + static const int kEngineFieldNumber = 2; + ::ditcaffe::ReLUParameter_Engine engine() const; + void set_engine(::ditcaffe::ReLUParameter_Engine value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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::uint32 _has_bits_[1]; + mutable int _cached_size_; + float negative_slope_; + int engine_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static ReLUParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class ReshapeParameter : public ::google::protobuf::Message { + 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(); + + 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(ReshapeParameter* other); + 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 .ditcaffe.BlobShape shape = 1; + bool has_shape() const; + void clear_shape(); + static const int kShapeFieldNumber = 1; + const ::ditcaffe::BlobShape& shape() const; + ::ditcaffe::BlobShape* mutable_shape(); + ::ditcaffe::BlobShape* release_shape(); + void set_allocated_shape(::ditcaffe::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:ditcaffe.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::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::ditcaffe::BlobShape* shape_; + ::google::protobuf::int32 axis_; + ::google::protobuf::int32 num_axes_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static ReshapeParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class ScaleParameter : public ::google::protobuf::Message { + 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(); + + 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(ScaleParameter* other); + 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 .ditcaffe.FillerParameter filler = 3; + bool has_filler() const; + void clear_filler(); + static const int kFillerFieldNumber = 3; + const ::ditcaffe::FillerParameter& filler() const; + ::ditcaffe::FillerParameter* mutable_filler(); + ::ditcaffe::FillerParameter* release_filler(); + void set_allocated_filler(::ditcaffe::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 .ditcaffe.FillerParameter bias_filler = 5; + bool has_bias_filler() const; + void clear_bias_filler(); + static const int kBiasFillerFieldNumber = 5; + const ::ditcaffe::FillerParameter& bias_filler() const; + ::ditcaffe::FillerParameter* mutable_bias_filler(); + ::ditcaffe::FillerParameter* release_bias_filler(); + void set_allocated_bias_filler(::ditcaffe::FillerParameter* bias_filler); + + // @@protoc_insertion_point(class_scope:ditcaffe.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::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::int32 axis_; + ::google::protobuf::int32 num_axes_; + ::ditcaffe::FillerParameter* filler_; + ::ditcaffe::FillerParameter* bias_filler_; + bool bias_term_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static ScaleParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class SigmoidParameter : public ::google::protobuf::Message { + 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(); + + 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(SigmoidParameter* other); + 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 .ditcaffe.SigmoidParameter.Engine engine = 1 [default = DEFAULT]; + bool has_engine() const; + void clear_engine(); + static const int kEngineFieldNumber = 1; + ::ditcaffe::SigmoidParameter_Engine engine() const; + void set_engine(::ditcaffe::SigmoidParameter_Engine value); + + // @@protoc_insertion_point(class_scope:ditcaffe.SigmoidParameter) + private: + inline void set_has_engine(); + inline void clear_has_engine(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + int engine_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static SigmoidParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class SliceParameter : public ::google::protobuf::Message { + 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(); + + 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(SliceParameter* other); + 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:ditcaffe.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::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > slice_point_; + ::google::protobuf::int32 axis_; + ::google::protobuf::uint32 slice_dim_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static SliceParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class SoftmaxParameter : public ::google::protobuf::Message { + 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(); + + 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(SoftmaxParameter* other); + 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 .ditcaffe.SoftmaxParameter.Engine engine = 1 [default = DEFAULT]; + bool has_engine() const; + void clear_engine(); + static const int kEngineFieldNumber = 1; + ::ditcaffe::SoftmaxParameter_Engine engine() const; + void set_engine(::ditcaffe::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:ditcaffe.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::uint32 _has_bits_[1]; + mutable int _cached_size_; + int engine_; + ::google::protobuf::int32 axis_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static SoftmaxParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class TanHParameter : public ::google::protobuf::Message { + 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(); + + 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(TanHParameter* other); + 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 .ditcaffe.TanHParameter.Engine engine = 1 [default = DEFAULT]; + bool has_engine() const; + void clear_engine(); + static const int kEngineFieldNumber = 1; + ::ditcaffe::TanHParameter_Engine engine() const; + void set_engine(::ditcaffe::TanHParameter_Engine value); + + // @@protoc_insertion_point(class_scope:ditcaffe.TanHParameter) + private: + inline void set_has_engine(); + inline void clear_has_engine(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + int engine_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static TanHParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class TileParameter : public ::google::protobuf::Message { + 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(); + + 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(TileParameter* other); + 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:ditcaffe.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::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::int32 axis_; + ::google::protobuf::int32 tiles_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static TileParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class ThresholdParameter : public ::google::protobuf::Message { + 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(); + + 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(ThresholdParameter* other); + 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:ditcaffe.ThresholdParameter) + private: + inline void set_has_threshold(); + inline void clear_has_threshold(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + float threshold_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static ThresholdParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class WindowDataParameter : public ::google::protobuf::Message { + 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(); + + 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(WindowDataParameter* other); + 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:ditcaffe.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::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::internal::ArenaStringPtr source_; + ::google::protobuf::internal::ArenaStringPtr mean_file_; + float scale_; + ::google::protobuf::uint32 batch_size_; + ::google::protobuf::uint32 crop_size_; + float fg_threshold_; + float bg_threshold_; + float fg_fraction_; + bool mirror_; + bool cache_images_; + ::google::protobuf::uint32 context_pad_; + static ::std::string* _default_crop_mode_; + ::google::protobuf::internal::ArenaStringPtr crop_mode_; + ::google::protobuf::internal::ArenaStringPtr root_folder_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static WindowDataParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class SPPParameter : public ::google::protobuf::Message { + 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(); + + 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(SPPParameter* other); + 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 .ditcaffe.SPPParameter.PoolMethod pool = 2 [default = MAX]; + bool has_pool() const; + void clear_pool(); + static const int kPoolFieldNumber = 2; + ::ditcaffe::SPPParameter_PoolMethod pool() const; + void set_pool(::ditcaffe::SPPParameter_PoolMethod value); + + // optional .ditcaffe.SPPParameter.Engine engine = 6 [default = DEFAULT]; + bool has_engine() const; + void clear_engine(); + static const int kEngineFieldNumber = 6; + ::ditcaffe::SPPParameter_Engine engine() const; + void set_engine(::ditcaffe::SPPParameter_Engine value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::uint32 pyramid_height_; + int pool_; + int engine_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static SPPParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class V1LayerParameter : public ::google::protobuf::Message { + 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(); + + 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(V1LayerParameter* other); + 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 .ditcaffe.NetStateRule include = 32; + int include_size() const; + void clear_include(); + static const int kIncludeFieldNumber = 32; + const ::ditcaffe::NetStateRule& include(int index) const; + ::ditcaffe::NetStateRule* mutable_include(int index); + ::ditcaffe::NetStateRule* add_include(); + ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >* + mutable_include(); + const ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >& + include() const; + + // repeated .ditcaffe.NetStateRule exclude = 33; + int exclude_size() const; + void clear_exclude(); + static const int kExcludeFieldNumber = 33; + const ::ditcaffe::NetStateRule& exclude(int index) const; + ::ditcaffe::NetStateRule* mutable_exclude(int index); + ::ditcaffe::NetStateRule* add_exclude(); + ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >* + mutable_exclude(); + const ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >& + exclude() const; + + // optional .ditcaffe.V1LayerParameter.LayerType type = 5; + bool has_type() const; + void clear_type(); + static const int kTypeFieldNumber = 5; + ::ditcaffe::V1LayerParameter_LayerType type() const; + void set_type(::ditcaffe::V1LayerParameter_LayerType value); + + // repeated .ditcaffe.BlobProto blobs = 6; + int blobs_size() const; + void clear_blobs(); + static const int kBlobsFieldNumber = 6; + const ::ditcaffe::BlobProto& blobs(int index) const; + ::ditcaffe::BlobProto* mutable_blobs(int index); + ::ditcaffe::BlobProto* add_blobs(); + ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >* + mutable_blobs(); + const ::google::protobuf::RepeatedPtrField< ::ditcaffe::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 .ditcaffe.V1LayerParameter.DimCheckMode blob_share_mode = 1002; + int blob_share_mode_size() const; + void clear_blob_share_mode(); + static const int kBlobShareModeFieldNumber = 1002; + ::ditcaffe::V1LayerParameter_DimCheckMode blob_share_mode(int index) const; + void set_blob_share_mode(int index, ::ditcaffe::V1LayerParameter_DimCheckMode value); + void add_blob_share_mode(::ditcaffe::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 .ditcaffe.AccuracyParameter accuracy_param = 27; + bool has_accuracy_param() const; + void clear_accuracy_param(); + static const int kAccuracyParamFieldNumber = 27; + const ::ditcaffe::AccuracyParameter& accuracy_param() const; + ::ditcaffe::AccuracyParameter* mutable_accuracy_param(); + ::ditcaffe::AccuracyParameter* release_accuracy_param(); + void set_allocated_accuracy_param(::ditcaffe::AccuracyParameter* accuracy_param); + + // optional .ditcaffe.ArgMaxParameter argmax_param = 23; + bool has_argmax_param() const; + void clear_argmax_param(); + static const int kArgmaxParamFieldNumber = 23; + const ::ditcaffe::ArgMaxParameter& argmax_param() const; + ::ditcaffe::ArgMaxParameter* mutable_argmax_param(); + ::ditcaffe::ArgMaxParameter* release_argmax_param(); + void set_allocated_argmax_param(::ditcaffe::ArgMaxParameter* argmax_param); + + // optional .ditcaffe.ConcatParameter concat_param = 9; + bool has_concat_param() const; + void clear_concat_param(); + static const int kConcatParamFieldNumber = 9; + const ::ditcaffe::ConcatParameter& concat_param() const; + ::ditcaffe::ConcatParameter* mutable_concat_param(); + ::ditcaffe::ConcatParameter* release_concat_param(); + void set_allocated_concat_param(::ditcaffe::ConcatParameter* concat_param); + + // optional .ditcaffe.ContrastiveLossParameter contrastive_loss_param = 40; + bool has_contrastive_loss_param() const; + void clear_contrastive_loss_param(); + static const int kContrastiveLossParamFieldNumber = 40; + const ::ditcaffe::ContrastiveLossParameter& contrastive_loss_param() const; + ::ditcaffe::ContrastiveLossParameter* mutable_contrastive_loss_param(); + ::ditcaffe::ContrastiveLossParameter* release_contrastive_loss_param(); + void set_allocated_contrastive_loss_param(::ditcaffe::ContrastiveLossParameter* contrastive_loss_param); + + // optional .ditcaffe.ConvolutionParameter convolution_param = 10; + bool has_convolution_param() const; + void clear_convolution_param(); + static const int kConvolutionParamFieldNumber = 10; + const ::ditcaffe::ConvolutionParameter& convolution_param() const; + ::ditcaffe::ConvolutionParameter* mutable_convolution_param(); + ::ditcaffe::ConvolutionParameter* release_convolution_param(); + void set_allocated_convolution_param(::ditcaffe::ConvolutionParameter* convolution_param); + + // optional .ditcaffe.DataParameter data_param = 11; + bool has_data_param() const; + void clear_data_param(); + static const int kDataParamFieldNumber = 11; + const ::ditcaffe::DataParameter& data_param() const; + ::ditcaffe::DataParameter* mutable_data_param(); + ::ditcaffe::DataParameter* release_data_param(); + void set_allocated_data_param(::ditcaffe::DataParameter* data_param); + + // optional .ditcaffe.DropoutParameter dropout_param = 12; + bool has_dropout_param() const; + void clear_dropout_param(); + static const int kDropoutParamFieldNumber = 12; + const ::ditcaffe::DropoutParameter& dropout_param() const; + ::ditcaffe::DropoutParameter* mutable_dropout_param(); + ::ditcaffe::DropoutParameter* release_dropout_param(); + void set_allocated_dropout_param(::ditcaffe::DropoutParameter* dropout_param); + + // optional .ditcaffe.DummyDataParameter dummy_data_param = 26; + bool has_dummy_data_param() const; + void clear_dummy_data_param(); + static const int kDummyDataParamFieldNumber = 26; + const ::ditcaffe::DummyDataParameter& dummy_data_param() const; + ::ditcaffe::DummyDataParameter* mutable_dummy_data_param(); + ::ditcaffe::DummyDataParameter* release_dummy_data_param(); + void set_allocated_dummy_data_param(::ditcaffe::DummyDataParameter* dummy_data_param); + + // optional .ditcaffe.EltwiseParameter eltwise_param = 24; + bool has_eltwise_param() const; + void clear_eltwise_param(); + static const int kEltwiseParamFieldNumber = 24; + const ::ditcaffe::EltwiseParameter& eltwise_param() const; + ::ditcaffe::EltwiseParameter* mutable_eltwise_param(); + ::ditcaffe::EltwiseParameter* release_eltwise_param(); + void set_allocated_eltwise_param(::ditcaffe::EltwiseParameter* eltwise_param); + + // optional .ditcaffe.ExpParameter exp_param = 41; + bool has_exp_param() const; + void clear_exp_param(); + static const int kExpParamFieldNumber = 41; + const ::ditcaffe::ExpParameter& exp_param() const; + ::ditcaffe::ExpParameter* mutable_exp_param(); + ::ditcaffe::ExpParameter* release_exp_param(); + void set_allocated_exp_param(::ditcaffe::ExpParameter* exp_param); + + // optional .ditcaffe.HDF5DataParameter hdf5_data_param = 13; + bool has_hdf5_data_param() const; + void clear_hdf5_data_param(); + static const int kHdf5DataParamFieldNumber = 13; + const ::ditcaffe::HDF5DataParameter& hdf5_data_param() const; + ::ditcaffe::HDF5DataParameter* mutable_hdf5_data_param(); + ::ditcaffe::HDF5DataParameter* release_hdf5_data_param(); + void set_allocated_hdf5_data_param(::ditcaffe::HDF5DataParameter* hdf5_data_param); + + // optional .ditcaffe.HDF5OutputParameter hdf5_output_param = 14; + bool has_hdf5_output_param() const; + void clear_hdf5_output_param(); + static const int kHdf5OutputParamFieldNumber = 14; + const ::ditcaffe::HDF5OutputParameter& hdf5_output_param() const; + ::ditcaffe::HDF5OutputParameter* mutable_hdf5_output_param(); + ::ditcaffe::HDF5OutputParameter* release_hdf5_output_param(); + void set_allocated_hdf5_output_param(::ditcaffe::HDF5OutputParameter* hdf5_output_param); + + // optional .ditcaffe.HingeLossParameter hinge_loss_param = 29; + bool has_hinge_loss_param() const; + void clear_hinge_loss_param(); + static const int kHingeLossParamFieldNumber = 29; + const ::ditcaffe::HingeLossParameter& hinge_loss_param() const; + ::ditcaffe::HingeLossParameter* mutable_hinge_loss_param(); + ::ditcaffe::HingeLossParameter* release_hinge_loss_param(); + void set_allocated_hinge_loss_param(::ditcaffe::HingeLossParameter* hinge_loss_param); + + // optional .ditcaffe.ImageDataParameter image_data_param = 15; + bool has_image_data_param() const; + void clear_image_data_param(); + static const int kImageDataParamFieldNumber = 15; + const ::ditcaffe::ImageDataParameter& image_data_param() const; + ::ditcaffe::ImageDataParameter* mutable_image_data_param(); + ::ditcaffe::ImageDataParameter* release_image_data_param(); + void set_allocated_image_data_param(::ditcaffe::ImageDataParameter* image_data_param); + + // optional .ditcaffe.InfogainLossParameter infogain_loss_param = 16; + bool has_infogain_loss_param() const; + void clear_infogain_loss_param(); + static const int kInfogainLossParamFieldNumber = 16; + const ::ditcaffe::InfogainLossParameter& infogain_loss_param() const; + ::ditcaffe::InfogainLossParameter* mutable_infogain_loss_param(); + ::ditcaffe::InfogainLossParameter* release_infogain_loss_param(); + void set_allocated_infogain_loss_param(::ditcaffe::InfogainLossParameter* infogain_loss_param); + + // optional .ditcaffe.InnerProductParameter inner_product_param = 17; + bool has_inner_product_param() const; + void clear_inner_product_param(); + static const int kInnerProductParamFieldNumber = 17; + const ::ditcaffe::InnerProductParameter& inner_product_param() const; + ::ditcaffe::InnerProductParameter* mutable_inner_product_param(); + ::ditcaffe::InnerProductParameter* release_inner_product_param(); + void set_allocated_inner_product_param(::ditcaffe::InnerProductParameter* inner_product_param); + + // optional .ditcaffe.LRNParameter lrn_param = 18; + bool has_lrn_param() const; + void clear_lrn_param(); + static const int kLrnParamFieldNumber = 18; + const ::ditcaffe::LRNParameter& lrn_param() const; + ::ditcaffe::LRNParameter* mutable_lrn_param(); + ::ditcaffe::LRNParameter* release_lrn_param(); + void set_allocated_lrn_param(::ditcaffe::LRNParameter* lrn_param); + + // optional .ditcaffe.MemoryDataParameter memory_data_param = 22; + bool has_memory_data_param() const; + void clear_memory_data_param(); + static const int kMemoryDataParamFieldNumber = 22; + const ::ditcaffe::MemoryDataParameter& memory_data_param() const; + ::ditcaffe::MemoryDataParameter* mutable_memory_data_param(); + ::ditcaffe::MemoryDataParameter* release_memory_data_param(); + void set_allocated_memory_data_param(::ditcaffe::MemoryDataParameter* memory_data_param); + + // optional .ditcaffe.MVNParameter mvn_param = 34; + bool has_mvn_param() const; + void clear_mvn_param(); + static const int kMvnParamFieldNumber = 34; + const ::ditcaffe::MVNParameter& mvn_param() const; + ::ditcaffe::MVNParameter* mutable_mvn_param(); + ::ditcaffe::MVNParameter* release_mvn_param(); + void set_allocated_mvn_param(::ditcaffe::MVNParameter* mvn_param); + + // optional .ditcaffe.PoolingParameter pooling_param = 19; + bool has_pooling_param() const; + void clear_pooling_param(); + static const int kPoolingParamFieldNumber = 19; + const ::ditcaffe::PoolingParameter& pooling_param() const; + ::ditcaffe::PoolingParameter* mutable_pooling_param(); + ::ditcaffe::PoolingParameter* release_pooling_param(); + void set_allocated_pooling_param(::ditcaffe::PoolingParameter* pooling_param); + + // optional .ditcaffe.PowerParameter power_param = 21; + bool has_power_param() const; + void clear_power_param(); + static const int kPowerParamFieldNumber = 21; + const ::ditcaffe::PowerParameter& power_param() const; + ::ditcaffe::PowerParameter* mutable_power_param(); + ::ditcaffe::PowerParameter* release_power_param(); + void set_allocated_power_param(::ditcaffe::PowerParameter* power_param); + + // optional .ditcaffe.ReLUParameter relu_param = 30; + bool has_relu_param() const; + void clear_relu_param(); + static const int kReluParamFieldNumber = 30; + const ::ditcaffe::ReLUParameter& relu_param() const; + ::ditcaffe::ReLUParameter* mutable_relu_param(); + ::ditcaffe::ReLUParameter* release_relu_param(); + void set_allocated_relu_param(::ditcaffe::ReLUParameter* relu_param); + + // optional .ditcaffe.SigmoidParameter sigmoid_param = 38; + bool has_sigmoid_param() const; + void clear_sigmoid_param(); + static const int kSigmoidParamFieldNumber = 38; + const ::ditcaffe::SigmoidParameter& sigmoid_param() const; + ::ditcaffe::SigmoidParameter* mutable_sigmoid_param(); + ::ditcaffe::SigmoidParameter* release_sigmoid_param(); + void set_allocated_sigmoid_param(::ditcaffe::SigmoidParameter* sigmoid_param); + + // optional .ditcaffe.SoftmaxParameter softmax_param = 39; + bool has_softmax_param() const; + void clear_softmax_param(); + static const int kSoftmaxParamFieldNumber = 39; + const ::ditcaffe::SoftmaxParameter& softmax_param() const; + ::ditcaffe::SoftmaxParameter* mutable_softmax_param(); + ::ditcaffe::SoftmaxParameter* release_softmax_param(); + void set_allocated_softmax_param(::ditcaffe::SoftmaxParameter* softmax_param); + + // optional .ditcaffe.SliceParameter slice_param = 31; + bool has_slice_param() const; + void clear_slice_param(); + static const int kSliceParamFieldNumber = 31; + const ::ditcaffe::SliceParameter& slice_param() const; + ::ditcaffe::SliceParameter* mutable_slice_param(); + ::ditcaffe::SliceParameter* release_slice_param(); + void set_allocated_slice_param(::ditcaffe::SliceParameter* slice_param); + + // optional .ditcaffe.TanHParameter tanh_param = 37; + bool has_tanh_param() const; + void clear_tanh_param(); + static const int kTanhParamFieldNumber = 37; + const ::ditcaffe::TanHParameter& tanh_param() const; + ::ditcaffe::TanHParameter* mutable_tanh_param(); + ::ditcaffe::TanHParameter* release_tanh_param(); + void set_allocated_tanh_param(::ditcaffe::TanHParameter* tanh_param); + + // optional .ditcaffe.ThresholdParameter threshold_param = 25; + bool has_threshold_param() const; + void clear_threshold_param(); + static const int kThresholdParamFieldNumber = 25; + const ::ditcaffe::ThresholdParameter& threshold_param() const; + ::ditcaffe::ThresholdParameter* mutable_threshold_param(); + ::ditcaffe::ThresholdParameter* release_threshold_param(); + void set_allocated_threshold_param(::ditcaffe::ThresholdParameter* threshold_param); + + // optional .ditcaffe.WindowDataParameter window_data_param = 20; + bool has_window_data_param() const; + void clear_window_data_param(); + static const int kWindowDataParamFieldNumber = 20; + const ::ditcaffe::WindowDataParameter& window_data_param() const; + ::ditcaffe::WindowDataParameter* mutable_window_data_param(); + ::ditcaffe::WindowDataParameter* release_window_data_param(); + void set_allocated_window_data_param(::ditcaffe::WindowDataParameter* window_data_param); + + // optional .ditcaffe.TransformationParameter transform_param = 36; + bool has_transform_param() const; + void clear_transform_param(); + static const int kTransformParamFieldNumber = 36; + const ::ditcaffe::TransformationParameter& transform_param() const; + ::ditcaffe::TransformationParameter* mutable_transform_param(); + ::ditcaffe::TransformationParameter* release_transform_param(); + void set_allocated_transform_param(::ditcaffe::TransformationParameter* transform_param); + + // optional .ditcaffe.LossParameter loss_param = 42; + bool has_loss_param() const; + void clear_loss_param(); + static const int kLossParamFieldNumber = 42; + const ::ditcaffe::LossParameter& loss_param() const; + ::ditcaffe::LossParameter* mutable_loss_param(); + ::ditcaffe::LossParameter* release_loss_param(); + void set_allocated_loss_param(::ditcaffe::LossParameter* loss_param); + + // optional .ditcaffe.V0LayerParameter layer = 1; + bool has_layer() const; + void clear_layer(); + static const int kLayerFieldNumber = 1; + const ::ditcaffe::V0LayerParameter& layer() const; + ::ditcaffe::V0LayerParameter* mutable_layer(); + ::ditcaffe::V0LayerParameter* release_layer(); + void set_allocated_layer(::ditcaffe::V0LayerParameter* layer); + + // @@protoc_insertion_point(class_scope:ditcaffe.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::uint32 _has_bits_[2]; + ::google::protobuf::RepeatedPtrField< ::std::string> bottom_; + ::google::protobuf::RepeatedPtrField< ::std::string> top_; + ::google::protobuf::internal::ArenaStringPtr name_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule > include_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule > exclude_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::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_; + ::ditcaffe::AccuracyParameter* accuracy_param_; + ::ditcaffe::ArgMaxParameter* argmax_param_; + ::ditcaffe::ConcatParameter* concat_param_; + ::ditcaffe::ContrastiveLossParameter* contrastive_loss_param_; + ::ditcaffe::ConvolutionParameter* convolution_param_; + ::ditcaffe::DataParameter* data_param_; + ::ditcaffe::DropoutParameter* dropout_param_; + ::ditcaffe::DummyDataParameter* dummy_data_param_; + ::ditcaffe::EltwiseParameter* eltwise_param_; + ::ditcaffe::ExpParameter* exp_param_; + ::ditcaffe::HDF5DataParameter* hdf5_data_param_; + ::ditcaffe::HDF5OutputParameter* hdf5_output_param_; + ::ditcaffe::HingeLossParameter* hinge_loss_param_; + ::ditcaffe::ImageDataParameter* image_data_param_; + ::ditcaffe::InfogainLossParameter* infogain_loss_param_; + ::ditcaffe::InnerProductParameter* inner_product_param_; + ::ditcaffe::LRNParameter* lrn_param_; + ::ditcaffe::MemoryDataParameter* memory_data_param_; + ::ditcaffe::MVNParameter* mvn_param_; + ::ditcaffe::PoolingParameter* pooling_param_; + ::ditcaffe::PowerParameter* power_param_; + ::ditcaffe::ReLUParameter* relu_param_; + ::ditcaffe::SigmoidParameter* sigmoid_param_; + ::ditcaffe::SoftmaxParameter* softmax_param_; + ::ditcaffe::SliceParameter* slice_param_; + ::ditcaffe::TanHParameter* tanh_param_; + ::ditcaffe::ThresholdParameter* threshold_param_; + ::ditcaffe::WindowDataParameter* window_data_param_; + ::ditcaffe::TransformationParameter* transform_param_; + ::ditcaffe::LossParameter* loss_param_; + ::ditcaffe::V0LayerParameter* layer_; + int type_; + mutable int _cached_size_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static V1LayerParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class V0LayerParameter : public ::google::protobuf::Message { + 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(); + + 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(V0LayerParameter* other); + 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 .ditcaffe.FillerParameter weight_filler = 5; + bool has_weight_filler() const; + void clear_weight_filler(); + static const int kWeightFillerFieldNumber = 5; + const ::ditcaffe::FillerParameter& weight_filler() const; + ::ditcaffe::FillerParameter* mutable_weight_filler(); + ::ditcaffe::FillerParameter* release_weight_filler(); + void set_allocated_weight_filler(::ditcaffe::FillerParameter* weight_filler); + + // optional .ditcaffe.FillerParameter bias_filler = 6; + bool has_bias_filler() const; + void clear_bias_filler(); + static const int kBiasFillerFieldNumber = 6; + const ::ditcaffe::FillerParameter& bias_filler() const; + ::ditcaffe::FillerParameter* mutable_bias_filler(); + ::ditcaffe::FillerParameter* release_bias_filler(); + void set_allocated_bias_filler(::ditcaffe::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 .ditcaffe.V0LayerParameter.PoolMethod pool = 11 [default = MAX]; + bool has_pool() const; + void clear_pool(); + static const int kPoolFieldNumber = 11; + ::ditcaffe::V0LayerParameter_PoolMethod pool() const; + void set_pool(::ditcaffe::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 .ditcaffe.BlobProto blobs = 50; + int blobs_size() const; + void clear_blobs(); + static const int kBlobsFieldNumber = 50; + const ::ditcaffe::BlobProto& blobs(int index) const; + ::ditcaffe::BlobProto* mutable_blobs(int index); + ::ditcaffe::BlobProto* add_blobs(); + ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >* + mutable_blobs(); + const ::google::protobuf::RepeatedPtrField< ::ditcaffe::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 .ditcaffe.HDF5OutputParameter hdf5_output_param = 1001; + bool has_hdf5_output_param() const; + void clear_hdf5_output_param(); + static const int kHdf5OutputParamFieldNumber = 1001; + const ::ditcaffe::HDF5OutputParameter& hdf5_output_param() const; + ::ditcaffe::HDF5OutputParameter* mutable_hdf5_output_param(); + ::ditcaffe::HDF5OutputParameter* release_hdf5_output_param(); + void set_allocated_hdf5_output_param(::ditcaffe::HDF5OutputParameter* hdf5_output_param); + + // @@protoc_insertion_point(class_scope:ditcaffe.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::uint32 _has_bits_[2]; + ::google::protobuf::internal::ArenaStringPtr name_; + ::google::protobuf::internal::ArenaStringPtr type_; + ::ditcaffe::FillerParameter* weight_filler_; + ::google::protobuf::uint32 num_output_; + ::google::protobuf::uint32 pad_; + ::ditcaffe::FillerParameter* bias_filler_; + ::google::protobuf::uint32 kernelsize_; + ::google::protobuf::uint32 group_; + ::google::protobuf::uint32 stride_; + int pool_; + float dropout_ratio_; + ::google::protobuf::uint32 local_size_; + float alpha_; + float beta_; + ::google::protobuf::internal::ArenaStringPtr source_; + float k_; + float scale_; + ::google::protobuf::internal::ArenaStringPtr meanfile_; + ::google::protobuf::uint32 batchsize_; + bool biasterm_; + bool mirror_; + bool shuffle_images_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto > blobs_; + ::google::protobuf::uint32 cropsize_; + ::google::protobuf::uint32 rand_skip_; + ::google::protobuf::RepeatedField< float > blobs_lr_; + ::google::protobuf::RepeatedField< float > weight_decay_; + float det_fg_threshold_; + float det_bg_threshold_; + float det_fg_fraction_; + ::google::protobuf::uint32 det_context_pad_; + static ::std::string* _default_det_crop_mode_; + ::google::protobuf::internal::ArenaStringPtr det_crop_mode_; + ::google::protobuf::int32 new_num_; + ::google::protobuf::int32 new_channels_; + ::google::protobuf::int32 new_height_; + ::google::protobuf::int32 new_width_; + ::ditcaffe::HDF5OutputParameter* hdf5_output_param_; + ::google::protobuf::uint32 concat_dim_; + mutable int _cached_size_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static V0LayerParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class PReLUParameter : public ::google::protobuf::Message { + 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(); + + 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; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(PReLUParameter* other); + 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 .ditcaffe.FillerParameter filler = 1; + bool has_filler() const; + void clear_filler(); + static const int kFillerFieldNumber = 1; + const ::ditcaffe::FillerParameter& filler() const; + ::ditcaffe::FillerParameter* mutable_filler(); + ::ditcaffe::FillerParameter* release_filler(); + void set_allocated_filler(::ditcaffe::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:ditcaffe.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::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::ditcaffe::FillerParameter* filler_; + bool channel_shared_; + friend void protobuf_AddDesc_ditcaffe_2eproto(); + friend void protobuf_AssignDesc_ditcaffe_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eproto(); + + void InitAsDefaultInstance(); + static PReLUParameter* 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:ditcaffe.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:ditcaffe.BlobShape.dim) +} +inline void BlobShape::add_dim(::google::protobuf::int64 value) { + dim_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.BlobShape.dim) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +BlobShape::dim() const { + // @@protoc_insertion_point(field_list:ditcaffe.BlobShape.dim) + return dim_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +BlobShape::mutable_dim() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.BlobShape.dim) + return &dim_; +} + +// ------------------------------------------------------------------- + +// BlobProto + +// optional .ditcaffe.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_->::ditcaffe::BlobShape::Clear(); + clear_has_shape(); +} +inline const ::ditcaffe::BlobShape& BlobProto::shape() const { + // @@protoc_insertion_point(field_get:ditcaffe.BlobProto.shape) + return shape_ != NULL ? *shape_ : *default_instance_->shape_; +} +inline ::ditcaffe::BlobShape* BlobProto::mutable_shape() { + set_has_shape(); + if (shape_ == NULL) { + shape_ = new ::ditcaffe::BlobShape; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.BlobProto.shape) + return shape_; +} +inline ::ditcaffe::BlobShape* BlobProto::release_shape() { + // @@protoc_insertion_point(field_release:ditcaffe.BlobProto.shape) + clear_has_shape(); + ::ditcaffe::BlobShape* temp = shape_; + shape_ = NULL; + return temp; +} +inline void BlobProto::set_allocated_shape(::ditcaffe::BlobShape* shape) { + delete shape_; + shape_ = shape; + if (shape) { + set_has_shape(); + } else { + clear_has_shape(); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.BlobProto.data) + return data_.Get(index); +} +inline void BlobProto::set_data(int index, float value) { + data_.Set(index, value); + // @@protoc_insertion_point(field_set:ditcaffe.BlobProto.data) +} +inline void BlobProto::add_data(float value) { + data_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.BlobProto.data) +} +inline const ::google::protobuf::RepeatedField< float >& +BlobProto::data() const { + // @@protoc_insertion_point(field_list:ditcaffe.BlobProto.data) + return data_; +} +inline ::google::protobuf::RepeatedField< float >* +BlobProto::mutable_data() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.BlobProto.diff) + return diff_.Get(index); +} +inline void BlobProto::set_diff(int index, float value) { + diff_.Set(index, value); + // @@protoc_insertion_point(field_set:ditcaffe.BlobProto.diff) +} +inline void BlobProto::add_diff(float value) { + diff_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.BlobProto.diff) +} +inline const ::google::protobuf::RepeatedField< float >& +BlobProto::diff() const { + // @@protoc_insertion_point(field_list:ditcaffe.BlobProto.diff) + return diff_; +} +inline ::google::protobuf::RepeatedField< float >* +BlobProto::mutable_diff() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.BlobProto.double_data) +} +inline void BlobProto::add_double_data(double value) { + double_data_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.BlobProto.double_data) +} +inline const ::google::protobuf::RepeatedField< double >& +BlobProto::double_data() const { + // @@protoc_insertion_point(field_list:ditcaffe.BlobProto.double_data) + return double_data_; +} +inline ::google::protobuf::RepeatedField< double >* +BlobProto::mutable_double_data() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.BlobProto.double_diff) +} +inline void BlobProto::add_double_diff(double value) { + double_diff_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.BlobProto.double_diff) +} +inline const ::google::protobuf::RepeatedField< double >& +BlobProto::double_diff() const { + // @@protoc_insertion_point(field_list:ditcaffe.BlobProto.double_diff) + return double_diff_; +} +inline ::google::protobuf::RepeatedField< double >* +BlobProto::mutable_double_diff() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.BlobProto.double_diff) + return &double_diff_; +} + +// repeated uint32 half_data = 10 [packed = true]; +inline int BlobProto::half_data_size() const { + return half_data_.size(); +} +inline void BlobProto::clear_half_data() { + half_data_.Clear(); +} +inline ::google::protobuf::uint32 BlobProto::half_data(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.BlobProto.half_data) + return half_data_.Get(index); +} +inline void BlobProto::set_half_data(int index, ::google::protobuf::uint32 value) { + half_data_.Set(index, value); + // @@protoc_insertion_point(field_set:ditcaffe.BlobProto.half_data) +} +inline void BlobProto::add_half_data(::google::protobuf::uint32 value) { + half_data_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.BlobProto.half_data) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +BlobProto::half_data() const { + // @@protoc_insertion_point(field_list:ditcaffe.BlobProto.half_data) + return half_data_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +BlobProto::mutable_half_data() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.BlobProto.half_data) + return &half_data_; +} + +// repeated uint32 half_diff = 11 [packed = true]; +inline int BlobProto::half_diff_size() const { + return half_diff_.size(); +} +inline void BlobProto::clear_half_diff() { + half_diff_.Clear(); +} +inline ::google::protobuf::uint32 BlobProto::half_diff(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.BlobProto.half_diff) + return half_diff_.Get(index); +} +inline void BlobProto::set_half_diff(int index, ::google::protobuf::uint32 value) { + half_diff_.Set(index, value); + // @@protoc_insertion_point(field_set:ditcaffe.BlobProto.half_diff) +} +inline void BlobProto::add_half_diff(::google::protobuf::uint32 value) { + half_diff_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.BlobProto.half_diff) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +BlobProto::half_diff() const { + // @@protoc_insertion_point(field_list:ditcaffe.BlobProto.half_diff) + return half_diff_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +BlobProto::mutable_half_diff() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.BlobProto.half_diff) + return &half_diff_; +} + +// optional int32 num = 1 [default = 0]; +inline bool BlobProto::has_num() const { + return (_has_bits_[0] & 0x00000080u) != 0; +} +inline void BlobProto::set_has_num() { + _has_bits_[0] |= 0x00000080u; +} +inline void BlobProto::clear_has_num() { + _has_bits_[0] &= ~0x00000080u; +} +inline void BlobProto::clear_num() { + num_ = 0; + clear_has_num(); +} +inline ::google::protobuf::int32 BlobProto::num() const { + // @@protoc_insertion_point(field_get:ditcaffe.BlobProto.num) + return num_; +} +inline void BlobProto::set_num(::google::protobuf::int32 value) { + set_has_num(); + num_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.BlobProto.num) +} + +// optional int32 channels = 2 [default = 0]; +inline bool BlobProto::has_channels() const { + return (_has_bits_[0] & 0x00000100u) != 0; +} +inline void BlobProto::set_has_channels() { + _has_bits_[0] |= 0x00000100u; +} +inline void BlobProto::clear_has_channels() { + _has_bits_[0] &= ~0x00000100u; +} +inline void BlobProto::clear_channels() { + channels_ = 0; + clear_has_channels(); +} +inline ::google::protobuf::int32 BlobProto::channels() const { + // @@protoc_insertion_point(field_get:ditcaffe.BlobProto.channels) + return channels_; +} +inline void BlobProto::set_channels(::google::protobuf::int32 value) { + set_has_channels(); + channels_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.BlobProto.channels) +} + +// optional int32 height = 3 [default = 0]; +inline bool BlobProto::has_height() const { + return (_has_bits_[0] & 0x00000200u) != 0; +} +inline void BlobProto::set_has_height() { + _has_bits_[0] |= 0x00000200u; +} +inline void BlobProto::clear_has_height() { + _has_bits_[0] &= ~0x00000200u; +} +inline void BlobProto::clear_height() { + height_ = 0; + clear_has_height(); +} +inline ::google::protobuf::int32 BlobProto::height() const { + // @@protoc_insertion_point(field_get:ditcaffe.BlobProto.height) + return height_; +} +inline void BlobProto::set_height(::google::protobuf::int32 value) { + set_has_height(); + height_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.BlobProto.height) +} + +// optional int32 width = 4 [default = 0]; +inline bool BlobProto::has_width() const { + return (_has_bits_[0] & 0x00000400u) != 0; +} +inline void BlobProto::set_has_width() { + _has_bits_[0] |= 0x00000400u; +} +inline void BlobProto::clear_has_width() { + _has_bits_[0] &= ~0x00000400u; +} +inline void BlobProto::clear_width() { + width_ = 0; + clear_has_width(); +} +inline ::google::protobuf::int32 BlobProto::width() const { + // @@protoc_insertion_point(field_get:ditcaffe.BlobProto.width) + return width_; +} +inline void BlobProto::set_width(::google::protobuf::int32 value) { + set_has_width(); + width_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.BlobProto.width) +} + +// ------------------------------------------------------------------- + +// BlobProtoVector + +// repeated .ditcaffe.BlobProto blobs = 1; +inline int BlobProtoVector::blobs_size() const { + return blobs_.size(); +} +inline void BlobProtoVector::clear_blobs() { + blobs_.Clear(); +} +inline const ::ditcaffe::BlobProto& BlobProtoVector::blobs(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.BlobProtoVector.blobs) + return blobs_.Get(index); +} +inline ::ditcaffe::BlobProto* BlobProtoVector::mutable_blobs(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.BlobProtoVector.blobs) + return blobs_.Mutable(index); +} +inline ::ditcaffe::BlobProto* BlobProtoVector::add_blobs() { + // @@protoc_insertion_point(field_add:ditcaffe.BlobProtoVector.blobs) + return blobs_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >* +BlobProtoVector::mutable_blobs() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.BlobProtoVector.blobs) + return &blobs_; +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >& +BlobProtoVector::blobs() const { + // @@protoc_insertion_point(field_list:ditcaffe.BlobProtoVector.blobs) + return blobs_; +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.Datum.channels) + return channels_; +} +inline void Datum::set_channels(::google::protobuf::int32 value) { + set_has_channels(); + channels_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.Datum.height) + return height_; +} +inline void Datum::set_height(::google::protobuf::int32 value) { + set_has_height(); + height_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.Datum.width) + return width_; +} +inline void Datum::set_width(::google::protobuf::int32 value) { + set_has_width(); + width_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.Datum.data) +} +inline ::std::string* Datum::mutable_data() { + set_has_data(); + // @@protoc_insertion_point(field_mutable:ditcaffe.Datum.data) + return data_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* Datum::release_data() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.Datum.label) + return label_; +} +inline void Datum::set_label(::google::protobuf::int32 value) { + set_has_label(); + label_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.Datum.float_data) +} +inline void Datum::add_float_data(float value) { + float_data_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.Datum.float_data) +} +inline const ::google::protobuf::RepeatedField< float >& +Datum::float_data() const { + // @@protoc_insertion_point(field_list:ditcaffe.Datum.float_data) + return float_data_; +} +inline ::google::protobuf::RepeatedField< float >* +Datum::mutable_float_data() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.Datum.encoded) + return encoded_; +} +inline void Datum::set_encoded(bool value) { + set_has_encoded(); + encoded_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.Datum.encoded) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.FillerParameter.type) +} +inline ::std::string* FillerParameter::mutable_type() { + set_has_type(); + // @@protoc_insertion_point(field_mutable:ditcaffe.FillerParameter.type) + return type_.MutableNoArena(_default_type_); +} +inline ::std::string* FillerParameter::release_type() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.FillerParameter.value) + return value_; +} +inline void FillerParameter::set_value(float value) { + set_has_value(); + value_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.FillerParameter.min) + return min_; +} +inline void FillerParameter::set_min(float value) { + set_has_min(); + min_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.FillerParameter.max) + return max_; +} +inline void FillerParameter::set_max(float value) { + set_has_max(); + max_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.FillerParameter.mean) + return mean_; +} +inline void FillerParameter::set_mean(float value) { + set_has_mean(); + mean_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.FillerParameter.std) + return std_; +} +inline void FillerParameter::set_std(float value) { + set_has_std(); + std_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.FillerParameter.sparse) + return sparse_; +} +inline void FillerParameter::set_sparse(::google::protobuf::int32 value) { + set_has_sparse(); + sparse_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.FillerParameter.sparse) +} + +// optional .ditcaffe.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 ::ditcaffe::FillerParameter_VarianceNorm FillerParameter::variance_norm() const { + // @@protoc_insertion_point(field_get:ditcaffe.FillerParameter.variance_norm) + return static_cast< ::ditcaffe::FillerParameter_VarianceNorm >(variance_norm_); +} +inline void FillerParameter::set_variance_norm(::ditcaffe::FillerParameter_VarianceNorm value) { + assert(::ditcaffe::FillerParameter_VarianceNorm_IsValid(value)); + set_has_variance_norm(); + variance_norm_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.FillerParameter.variance_norm) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.NetParameter.name) +} +inline ::std::string* NetParameter::mutable_name() { + set_has_name(); + // @@protoc_insertion_point(field_mutable:ditcaffe.NetParameter.name) + return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* NetParameter::release_name() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.NetParameter.input) + return input_.Get(index); +} +inline ::std::string* NetParameter::mutable_input(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.NetParameter.input) + return input_.Mutable(index); +} +inline void NetParameter::set_input(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.NetParameter.input) +} +inline ::std::string* NetParameter::add_input() { + // @@protoc_insertion_point(field_add_mutable:ditcaffe.NetParameter.input) + return input_.Add(); +} +inline void NetParameter::add_input(const ::std::string& value) { + input_.Add()->assign(value); + // @@protoc_insertion_point(field_add:ditcaffe.NetParameter.input) +} +inline void NetParameter::add_input(const char* value) { + input_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:ditcaffe.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:ditcaffe.NetParameter.input) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +NetParameter::input() const { + // @@protoc_insertion_point(field_list:ditcaffe.NetParameter.input) + return input_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +NetParameter::mutable_input() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.NetParameter.input) + return &input_; +} + +// repeated .ditcaffe.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 ::ditcaffe::BlobShape& NetParameter::input_shape(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.NetParameter.input_shape) + return input_shape_.Get(index); +} +inline ::ditcaffe::BlobShape* NetParameter::mutable_input_shape(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.NetParameter.input_shape) + return input_shape_.Mutable(index); +} +inline ::ditcaffe::BlobShape* NetParameter::add_input_shape() { + // @@protoc_insertion_point(field_add:ditcaffe.NetParameter.input_shape) + return input_shape_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobShape >* +NetParameter::mutable_input_shape() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.NetParameter.input_shape) + return &input_shape_; +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobShape >& +NetParameter::input_shape() const { + // @@protoc_insertion_point(field_list:ditcaffe.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:ditcaffe.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:ditcaffe.NetParameter.input_dim) +} +inline void NetParameter::add_input_dim(::google::protobuf::int32 value) { + input_dim_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.NetParameter.input_dim) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +NetParameter::input_dim() const { + // @@protoc_insertion_point(field_list:ditcaffe.NetParameter.input_dim) + return input_dim_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +NetParameter::mutable_input_dim() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.NetParameter.force_backward) +} + +// optional .ditcaffe.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_->::ditcaffe::NetState::Clear(); + clear_has_state(); +} +inline const ::ditcaffe::NetState& NetParameter::state() const { + // @@protoc_insertion_point(field_get:ditcaffe.NetParameter.state) + return state_ != NULL ? *state_ : *default_instance_->state_; +} +inline ::ditcaffe::NetState* NetParameter::mutable_state() { + set_has_state(); + if (state_ == NULL) { + state_ = new ::ditcaffe::NetState; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.NetParameter.state) + return state_; +} +inline ::ditcaffe::NetState* NetParameter::release_state() { + // @@protoc_insertion_point(field_release:ditcaffe.NetParameter.state) + clear_has_state(); + ::ditcaffe::NetState* temp = state_; + state_ = NULL; + return temp; +} +inline void NetParameter::set_allocated_state(::ditcaffe::NetState* state) { + delete state_; + state_ = state; + if (state) { + set_has_state(); + } else { + clear_has_state(); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.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:ditcaffe.NetParameter.debug_info) +} + +// repeated .ditcaffe.LayerParameter layer = 100; +inline int NetParameter::layer_size() const { + return layer_.size(); +} +inline void NetParameter::clear_layer() { + layer_.Clear(); +} +inline const ::ditcaffe::LayerParameter& NetParameter::layer(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.NetParameter.layer) + return layer_.Get(index); +} +inline ::ditcaffe::LayerParameter* NetParameter::mutable_layer(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.NetParameter.layer) + return layer_.Mutable(index); +} +inline ::ditcaffe::LayerParameter* NetParameter::add_layer() { + // @@protoc_insertion_point(field_add:ditcaffe.NetParameter.layer) + return layer_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::LayerParameter >* +NetParameter::mutable_layer() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.NetParameter.layer) + return &layer_; +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::LayerParameter >& +NetParameter::layer() const { + // @@protoc_insertion_point(field_list:ditcaffe.NetParameter.layer) + return layer_; +} + +// repeated .ditcaffe.V1LayerParameter layers = 2; +inline int NetParameter::layers_size() const { + return layers_.size(); +} +inline void NetParameter::clear_layers() { + layers_.Clear(); +} +inline const ::ditcaffe::V1LayerParameter& NetParameter::layers(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.NetParameter.layers) + return layers_.Get(index); +} +inline ::ditcaffe::V1LayerParameter* NetParameter::mutable_layers(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.NetParameter.layers) + return layers_.Mutable(index); +} +inline ::ditcaffe::V1LayerParameter* NetParameter::add_layers() { + // @@protoc_insertion_point(field_add:ditcaffe.NetParameter.layers) + return layers_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::V1LayerParameter >* +NetParameter::mutable_layers() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.NetParameter.layers) + return &layers_; +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::V1LayerParameter >& +NetParameter::layers() const { + // @@protoc_insertion_point(field_list:ditcaffe.NetParameter.layers) + return layers_; +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.net) +} +inline ::std::string* SolverParameter::mutable_net() { + set_has_net(); + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.net) + return net_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* SolverParameter::release_net() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.SolverParameter.net) +} + +// optional .ditcaffe.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_->::ditcaffe::NetParameter::Clear(); + clear_has_net_param(); +} +inline const ::ditcaffe::NetParameter& SolverParameter::net_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverParameter.net_param) + return net_param_ != NULL ? *net_param_ : *default_instance_->net_param_; +} +inline ::ditcaffe::NetParameter* SolverParameter::mutable_net_param() { + set_has_net_param(); + if (net_param_ == NULL) { + net_param_ = new ::ditcaffe::NetParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.net_param) + return net_param_; +} +inline ::ditcaffe::NetParameter* SolverParameter::release_net_param() { + // @@protoc_insertion_point(field_release:ditcaffe.SolverParameter.net_param) + clear_has_net_param(); + ::ditcaffe::NetParameter* temp = net_param_; + net_param_ = NULL; + return temp; +} +inline void SolverParameter::set_allocated_net_param(::ditcaffe::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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.train_net) +} +inline ::std::string* SolverParameter::mutable_train_net() { + set_has_train_net(); + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.train_net) + return train_net_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* SolverParameter::release_train_net() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.test_net) + return test_net_.Get(index); +} +inline ::std::string* SolverParameter::mutable_test_net(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.test_net) +} +inline ::std::string* SolverParameter::add_test_net() { + // @@protoc_insertion_point(field_add_mutable:ditcaffe.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:ditcaffe.SolverParameter.test_net) +} +inline void SolverParameter::add_test_net(const char* value) { + test_net_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:ditcaffe.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:ditcaffe.SolverParameter.test_net) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +SolverParameter::test_net() const { + // @@protoc_insertion_point(field_list:ditcaffe.SolverParameter.test_net) + return test_net_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +SolverParameter::mutable_test_net() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.SolverParameter.test_net) + return &test_net_; +} + +// optional .ditcaffe.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_->::ditcaffe::NetParameter::Clear(); + clear_has_train_net_param(); +} +inline const ::ditcaffe::NetParameter& SolverParameter::train_net_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverParameter.train_net_param) + return train_net_param_ != NULL ? *train_net_param_ : *default_instance_->train_net_param_; +} +inline ::ditcaffe::NetParameter* SolverParameter::mutable_train_net_param() { + set_has_train_net_param(); + if (train_net_param_ == NULL) { + train_net_param_ = new ::ditcaffe::NetParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.train_net_param) + return train_net_param_; +} +inline ::ditcaffe::NetParameter* SolverParameter::release_train_net_param() { + // @@protoc_insertion_point(field_release:ditcaffe.SolverParameter.train_net_param) + clear_has_train_net_param(); + ::ditcaffe::NetParameter* temp = train_net_param_; + train_net_param_ = NULL; + return temp; +} +inline void SolverParameter::set_allocated_train_net_param(::ditcaffe::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:ditcaffe.SolverParameter.train_net_param) +} + +// repeated .ditcaffe.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 ::ditcaffe::NetParameter& SolverParameter::test_net_param(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverParameter.test_net_param) + return test_net_param_.Get(index); +} +inline ::ditcaffe::NetParameter* SolverParameter::mutable_test_net_param(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.test_net_param) + return test_net_param_.Mutable(index); +} +inline ::ditcaffe::NetParameter* SolverParameter::add_test_net_param() { + // @@protoc_insertion_point(field_add:ditcaffe.SolverParameter.test_net_param) + return test_net_param_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetParameter >* +SolverParameter::mutable_test_net_param() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.SolverParameter.test_net_param) + return &test_net_param_; +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetParameter >& +SolverParameter::test_net_param() const { + // @@protoc_insertion_point(field_list:ditcaffe.SolverParameter.test_net_param) + return test_net_param_; +} + +// optional .ditcaffe.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_->::ditcaffe::NetState::Clear(); + clear_has_train_state(); +} +inline const ::ditcaffe::NetState& SolverParameter::train_state() const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverParameter.train_state) + return train_state_ != NULL ? *train_state_ : *default_instance_->train_state_; +} +inline ::ditcaffe::NetState* SolverParameter::mutable_train_state() { + set_has_train_state(); + if (train_state_ == NULL) { + train_state_ = new ::ditcaffe::NetState; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.train_state) + return train_state_; +} +inline ::ditcaffe::NetState* SolverParameter::release_train_state() { + // @@protoc_insertion_point(field_release:ditcaffe.SolverParameter.train_state) + clear_has_train_state(); + ::ditcaffe::NetState* temp = train_state_; + train_state_ = NULL; + return temp; +} +inline void SolverParameter::set_allocated_train_state(::ditcaffe::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:ditcaffe.SolverParameter.train_state) +} + +// repeated .ditcaffe.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 ::ditcaffe::NetState& SolverParameter::test_state(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverParameter.test_state) + return test_state_.Get(index); +} +inline ::ditcaffe::NetState* SolverParameter::mutable_test_state(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.test_state) + return test_state_.Mutable(index); +} +inline ::ditcaffe::NetState* SolverParameter::add_test_state() { + // @@protoc_insertion_point(field_add:ditcaffe.SolverParameter.test_state) + return test_state_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetState >* +SolverParameter::mutable_test_state() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.SolverParameter.test_state) + return &test_state_; +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetState >& +SolverParameter::test_state() const { + // @@protoc_insertion_point(field_list:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.test_iter) +} +inline void SolverParameter::add_test_iter(::google::protobuf::int32 value) { + test_iter_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.SolverParameter.test_iter) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +SolverParameter::test_iter() const { + // @@protoc_insertion_point(field_list:ditcaffe.SolverParameter.test_iter) + return test_iter_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +SolverParameter::mutable_test_iter() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.display) + return display_; +} +inline void SolverParameter::set_display(::google::protobuf::int32 value) { + set_has_display(); + display_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.lr_policy) +} +inline ::std::string* SolverParameter::mutable_lr_policy() { + set_has_lr_policy(); + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.lr_policy) + return lr_policy_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* SolverParameter::release_lr_policy() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.gamma) + return gamma_; +} +inline void SolverParameter::set_gamma(float value) { + set_has_gamma(); + gamma_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.SolverParameter.power) + return power_; +} +inline void SolverParameter::set_power(float value) { + set_has_power(); + power_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.SolverParameter.momentum) + return momentum_; +} +inline void SolverParameter::set_momentum(float value) { + set_has_momentum(); + momentum_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.regularization_type) +} +inline ::std::string* SolverParameter::mutable_regularization_type() { + set_has_regularization_type(); + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.regularization_type) + return regularization_type_.MutableNoArena(_default_regularization_type_); +} +inline ::std::string* SolverParameter::release_regularization_type() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.stepsize) + return stepsize_; +} +inline void SolverParameter::set_stepsize(::google::protobuf::int32 value) { + set_has_stepsize(); + stepsize_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.stepvalue) +} +inline void SolverParameter::add_stepvalue(::google::protobuf::int32 value) { + stepvalue_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.SolverParameter.stepvalue) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +SolverParameter::stepvalue() const { + // @@protoc_insertion_point(field_list:ditcaffe.SolverParameter.stepvalue) + return stepvalue_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +SolverParameter::mutable_stepvalue() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.snapshot) + return snapshot_; +} +inline void SolverParameter::set_snapshot(::google::protobuf::int32 value) { + set_has_snapshot(); + snapshot_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.snapshot_prefix) +} +inline ::std::string* SolverParameter::mutable_snapshot_prefix() { + set_has_snapshot_prefix(); + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.snapshot_prefix) + return snapshot_prefix_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* SolverParameter::release_snapshot_prefix() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.snapshot_diff) +} + +// optional .ditcaffe.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 ::ditcaffe::SolverParameter_SnapshotFormat SolverParameter::snapshot_format() const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverParameter.snapshot_format) + return static_cast< ::ditcaffe::SolverParameter_SnapshotFormat >(snapshot_format_); +} +inline void SolverParameter::set_snapshot_format(::ditcaffe::SolverParameter_SnapshotFormat value) { + assert(::ditcaffe::SolverParameter_SnapshotFormat_IsValid(value)); + set_has_snapshot_format(); + snapshot_format_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.SolverParameter.snapshot_format) +} + +// optional .ditcaffe.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 ::ditcaffe::SolverParameter_SolverMode SolverParameter::solver_mode() const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverParameter.solver_mode) + return static_cast< ::ditcaffe::SolverParameter_SolverMode >(solver_mode_); +} +inline void SolverParameter::set_solver_mode(::ditcaffe::SolverParameter_SolverMode value) { + assert(::ditcaffe::SolverParameter_SolverMode_IsValid(value)); + set_has_solver_mode(); + solver_mode_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.type) +} +inline ::std::string* SolverParameter::mutable_type() { + set_has_type(); + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.type) + return type_.MutableNoArena(_default_type_); +} +inline ::std::string* SolverParameter::release_type() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.delta) + return delta_; +} +inline void SolverParameter::set_delta(float value) { + set_has_delta(); + delta_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.SolverParameter.momentum2) + return momentum2_; +} +inline void SolverParameter::set_momentum2(float value) { + set_has_momentum2(); + momentum2_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.SolverParameter.momentum2) +} + +// optional float rms_decay = 38; +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; + clear_has_rms_decay(); +} +inline float SolverParameter::rms_decay() const { + // @@protoc_insertion_point(field_get:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.snapshot_after_train) +} + +// optional .ditcaffe.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 ::ditcaffe::SolverParameter_SolverType SolverParameter::solver_type() const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverParameter.solver_type) + return static_cast< ::ditcaffe::SolverParameter_SolverType >(solver_type_); +} +inline void SolverParameter::set_solver_type(::ditcaffe::SolverParameter_SolverType value) { + assert(::ditcaffe::SolverParameter_SolverType_IsValid(value)); + set_has_solver_type(); + solver_type_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.SolverParameter.solver_type) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.SolverState.iter) + return iter_; +} +inline void SolverState::set_iter(::google::protobuf::int32 value) { + set_has_iter(); + iter_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.SolverState.learned_net) +} +inline ::std::string* SolverState::mutable_learned_net() { + set_has_learned_net(); + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverState.learned_net) + return learned_net_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* SolverState::release_learned_net() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.SolverState.learned_net) +} + +// repeated .ditcaffe.BlobProto history = 3; +inline int SolverState::history_size() const { + return history_.size(); +} +inline void SolverState::clear_history() { + history_.Clear(); +} +inline const ::ditcaffe::BlobProto& SolverState::history(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverState.history) + return history_.Get(index); +} +inline ::ditcaffe::BlobProto* SolverState::mutable_history(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverState.history) + return history_.Mutable(index); +} +inline ::ditcaffe::BlobProto* SolverState::add_history() { + // @@protoc_insertion_point(field_add:ditcaffe.SolverState.history) + return history_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >* +SolverState::mutable_history() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.SolverState.history) + return &history_; +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >& +SolverState::history() const { + // @@protoc_insertion_point(field_list:ditcaffe.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:ditcaffe.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:ditcaffe.SolverState.current_step) +} + +// ------------------------------------------------------------------- + +// NetState + +// optional .ditcaffe.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 ::ditcaffe::Phase NetState::phase() const { + // @@protoc_insertion_point(field_get:ditcaffe.NetState.phase) + return static_cast< ::ditcaffe::Phase >(phase_); +} +inline void NetState::set_phase(::ditcaffe::Phase value) { + assert(::ditcaffe::Phase_IsValid(value)); + set_has_phase(); + phase_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.NetState.level) + return level_; +} +inline void NetState::set_level(::google::protobuf::int32 value) { + set_has_level(); + level_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.NetState.stage) + return stage_.Get(index); +} +inline ::std::string* NetState::mutable_stage(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.NetState.stage) + return stage_.Mutable(index); +} +inline void NetState::set_stage(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.NetState.stage) +} +inline ::std::string* NetState::add_stage() { + // @@protoc_insertion_point(field_add_mutable:ditcaffe.NetState.stage) + return stage_.Add(); +} +inline void NetState::add_stage(const ::std::string& value) { + stage_.Add()->assign(value); + // @@protoc_insertion_point(field_add:ditcaffe.NetState.stage) +} +inline void NetState::add_stage(const char* value) { + stage_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:ditcaffe.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:ditcaffe.NetState.stage) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +NetState::stage() const { + // @@protoc_insertion_point(field_list:ditcaffe.NetState.stage) + return stage_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +NetState::mutable_stage() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.NetState.stage) + return &stage_; +} + +// ------------------------------------------------------------------- + +// NetStateRule + +// optional .ditcaffe.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 ::ditcaffe::Phase NetStateRule::phase() const { + // @@protoc_insertion_point(field_get:ditcaffe.NetStateRule.phase) + return static_cast< ::ditcaffe::Phase >(phase_); +} +inline void NetStateRule::set_phase(::ditcaffe::Phase value) { + assert(::ditcaffe::Phase_IsValid(value)); + set_has_phase(); + phase_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.NetStateRule.stage) + return stage_.Get(index); +} +inline ::std::string* NetStateRule::mutable_stage(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.NetStateRule.stage) + return stage_.Mutable(index); +} +inline void NetStateRule::set_stage(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.NetStateRule.stage) +} +inline ::std::string* NetStateRule::add_stage() { + // @@protoc_insertion_point(field_add_mutable:ditcaffe.NetStateRule.stage) + return stage_.Add(); +} +inline void NetStateRule::add_stage(const ::std::string& value) { + stage_.Add()->assign(value); + // @@protoc_insertion_point(field_add:ditcaffe.NetStateRule.stage) +} +inline void NetStateRule::add_stage(const char* value) { + stage_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:ditcaffe.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:ditcaffe.NetStateRule.stage) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +NetStateRule::stage() const { + // @@protoc_insertion_point(field_list:ditcaffe.NetStateRule.stage) + return stage_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +NetStateRule::mutable_stage() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.NetStateRule.not_stage) + return not_stage_.Get(index); +} +inline ::std::string* NetStateRule::mutable_not_stage(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.NetStateRule.not_stage) +} +inline ::std::string* NetStateRule::add_not_stage() { + // @@protoc_insertion_point(field_add_mutable:ditcaffe.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:ditcaffe.NetStateRule.not_stage) +} +inline void NetStateRule::add_not_stage(const char* value) { + not_stage_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:ditcaffe.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:ditcaffe.NetStateRule.not_stage) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +NetStateRule::not_stage() const { + // @@protoc_insertion_point(field_list:ditcaffe.NetStateRule.not_stage) + return not_stage_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +NetStateRule::mutable_not_stage() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.NetStateRule.not_stage) + return ¬_stage_; +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.ParamSpec.name) +} +inline ::std::string* ParamSpec::mutable_name() { + set_has_name(); + // @@protoc_insertion_point(field_mutable:ditcaffe.ParamSpec.name) + return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* ParamSpec::release_name() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.ParamSpec.name) +} + +// optional .ditcaffe.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 ::ditcaffe::ParamSpec_DimCheckMode ParamSpec::share_mode() const { + // @@protoc_insertion_point(field_get:ditcaffe.ParamSpec.share_mode) + return static_cast< ::ditcaffe::ParamSpec_DimCheckMode >(share_mode_); +} +inline void ParamSpec::set_share_mode(::ditcaffe::ParamSpec_DimCheckMode value) { + assert(::ditcaffe::ParamSpec_DimCheckMode_IsValid(value)); + set_has_share_mode(); + share_mode_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.ParamSpec.decay_mult) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.LayerParameter.name) +} +inline ::std::string* LayerParameter::mutable_name() { + set_has_name(); + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.name) + return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* LayerParameter::release_name() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.LayerParameter.type) +} +inline ::std::string* LayerParameter::mutable_type() { + set_has_type(); + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.type) + return type_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* LayerParameter::release_type() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.LayerParameter.bottom) + return bottom_.Get(index); +} +inline ::std::string* LayerParameter::mutable_bottom(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.bottom) + return bottom_.Mutable(index); +} +inline void LayerParameter::set_bottom(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.LayerParameter.bottom) +} +inline ::std::string* LayerParameter::add_bottom() { + // @@protoc_insertion_point(field_add_mutable:ditcaffe.LayerParameter.bottom) + return bottom_.Add(); +} +inline void LayerParameter::add_bottom(const ::std::string& value) { + bottom_.Add()->assign(value); + // @@protoc_insertion_point(field_add:ditcaffe.LayerParameter.bottom) +} +inline void LayerParameter::add_bottom(const char* value) { + bottom_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:ditcaffe.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:ditcaffe.LayerParameter.bottom) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +LayerParameter::bottom() const { + // @@protoc_insertion_point(field_list:ditcaffe.LayerParameter.bottom) + return bottom_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +LayerParameter::mutable_bottom() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.LayerParameter.top) + return top_.Get(index); +} +inline ::std::string* LayerParameter::mutable_top(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.top) + return top_.Mutable(index); +} +inline void LayerParameter::set_top(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.LayerParameter.top) +} +inline ::std::string* LayerParameter::add_top() { + // @@protoc_insertion_point(field_add_mutable:ditcaffe.LayerParameter.top) + return top_.Add(); +} +inline void LayerParameter::add_top(const ::std::string& value) { + top_.Add()->assign(value); + // @@protoc_insertion_point(field_add:ditcaffe.LayerParameter.top) +} +inline void LayerParameter::add_top(const char* value) { + top_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:ditcaffe.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:ditcaffe.LayerParameter.top) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +LayerParameter::top() const { + // @@protoc_insertion_point(field_list:ditcaffe.LayerParameter.top) + return top_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +LayerParameter::mutable_top() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.LayerParameter.top) + return &top_; +} + +// optional .ditcaffe.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 ::ditcaffe::Phase LayerParameter::phase() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.phase) + return static_cast< ::ditcaffe::Phase >(phase_); +} +inline void LayerParameter::set_phase(::ditcaffe::Phase value) { + assert(::ditcaffe::Phase_IsValid(value)); + set_has_phase(); + phase_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.LayerParameter.loss_weight) +} +inline void LayerParameter::add_loss_weight(float value) { + loss_weight_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.LayerParameter.loss_weight) +} +inline const ::google::protobuf::RepeatedField< float >& +LayerParameter::loss_weight() const { + // @@protoc_insertion_point(field_list:ditcaffe.LayerParameter.loss_weight) + return loss_weight_; +} +inline ::google::protobuf::RepeatedField< float >* +LayerParameter::mutable_loss_weight() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.LayerParameter.loss_weight) + return &loss_weight_; +} + +// repeated .ditcaffe.ParamSpec param = 6; +inline int LayerParameter::param_size() const { + return param_.size(); +} +inline void LayerParameter::clear_param() { + param_.Clear(); +} +inline const ::ditcaffe::ParamSpec& LayerParameter::param(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.param) + return param_.Get(index); +} +inline ::ditcaffe::ParamSpec* LayerParameter::mutable_param(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.param) + return param_.Mutable(index); +} +inline ::ditcaffe::ParamSpec* LayerParameter::add_param() { + // @@protoc_insertion_point(field_add:ditcaffe.LayerParameter.param) + return param_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::ParamSpec >* +LayerParameter::mutable_param() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.LayerParameter.param) + return ¶m_; +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::ParamSpec >& +LayerParameter::param() const { + // @@protoc_insertion_point(field_list:ditcaffe.LayerParameter.param) + return param_; +} + +// repeated .ditcaffe.BlobProto blobs = 7; +inline int LayerParameter::blobs_size() const { + return blobs_.size(); +} +inline void LayerParameter::clear_blobs() { + blobs_.Clear(); +} +inline const ::ditcaffe::BlobProto& LayerParameter::blobs(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.blobs) + return blobs_.Get(index); +} +inline ::ditcaffe::BlobProto* LayerParameter::mutable_blobs(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.blobs) + return blobs_.Mutable(index); +} +inline ::ditcaffe::BlobProto* LayerParameter::add_blobs() { + // @@protoc_insertion_point(field_add:ditcaffe.LayerParameter.blobs) + return blobs_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >* +LayerParameter::mutable_blobs() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.LayerParameter.blobs) + return &blobs_; +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >& +LayerParameter::blobs() const { + // @@protoc_insertion_point(field_list:ditcaffe.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:ditcaffe.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:ditcaffe.LayerParameter.propagate_down) +} +inline void LayerParameter::add_propagate_down(bool value) { + propagate_down_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.LayerParameter.propagate_down) +} +inline const ::google::protobuf::RepeatedField< bool >& +LayerParameter::propagate_down() const { + // @@protoc_insertion_point(field_list:ditcaffe.LayerParameter.propagate_down) + return propagate_down_; +} +inline ::google::protobuf::RepeatedField< bool >* +LayerParameter::mutable_propagate_down() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.LayerParameter.propagate_down) + return &propagate_down_; +} + +// repeated .ditcaffe.NetStateRule include = 8; +inline int LayerParameter::include_size() const { + return include_.size(); +} +inline void LayerParameter::clear_include() { + include_.Clear(); +} +inline const ::ditcaffe::NetStateRule& LayerParameter::include(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.include) + return include_.Get(index); +} +inline ::ditcaffe::NetStateRule* LayerParameter::mutable_include(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.include) + return include_.Mutable(index); +} +inline ::ditcaffe::NetStateRule* LayerParameter::add_include() { + // @@protoc_insertion_point(field_add:ditcaffe.LayerParameter.include) + return include_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >* +LayerParameter::mutable_include() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.LayerParameter.include) + return &include_; +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >& +LayerParameter::include() const { + // @@protoc_insertion_point(field_list:ditcaffe.LayerParameter.include) + return include_; +} + +// repeated .ditcaffe.NetStateRule exclude = 9; +inline int LayerParameter::exclude_size() const { + return exclude_.size(); +} +inline void LayerParameter::clear_exclude() { + exclude_.Clear(); +} +inline const ::ditcaffe::NetStateRule& LayerParameter::exclude(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.exclude) + return exclude_.Get(index); +} +inline ::ditcaffe::NetStateRule* LayerParameter::mutable_exclude(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.exclude) + return exclude_.Mutable(index); +} +inline ::ditcaffe::NetStateRule* LayerParameter::add_exclude() { + // @@protoc_insertion_point(field_add:ditcaffe.LayerParameter.exclude) + return exclude_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >* +LayerParameter::mutable_exclude() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.LayerParameter.exclude) + return &exclude_; +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >& +LayerParameter::exclude() const { + // @@protoc_insertion_point(field_list:ditcaffe.LayerParameter.exclude) + return exclude_; +} + +// optional .ditcaffe.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_->::ditcaffe::TransformationParameter::Clear(); + clear_has_transform_param(); +} +inline const ::ditcaffe::TransformationParameter& LayerParameter::transform_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.transform_param) + return transform_param_ != NULL ? *transform_param_ : *default_instance_->transform_param_; +} +inline ::ditcaffe::TransformationParameter* LayerParameter::mutable_transform_param() { + set_has_transform_param(); + if (transform_param_ == NULL) { + transform_param_ = new ::ditcaffe::TransformationParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.transform_param) + return transform_param_; +} +inline ::ditcaffe::TransformationParameter* LayerParameter::release_transform_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.transform_param) + clear_has_transform_param(); + ::ditcaffe::TransformationParameter* temp = transform_param_; + transform_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_transform_param(::ditcaffe::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:ditcaffe.LayerParameter.transform_param) +} + +// optional .ditcaffe.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_->::ditcaffe::LossParameter::Clear(); + clear_has_loss_param(); +} +inline const ::ditcaffe::LossParameter& LayerParameter::loss_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.loss_param) + return loss_param_ != NULL ? *loss_param_ : *default_instance_->loss_param_; +} +inline ::ditcaffe::LossParameter* LayerParameter::mutable_loss_param() { + set_has_loss_param(); + if (loss_param_ == NULL) { + loss_param_ = new ::ditcaffe::LossParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.loss_param) + return loss_param_; +} +inline ::ditcaffe::LossParameter* LayerParameter::release_loss_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.loss_param) + clear_has_loss_param(); + ::ditcaffe::LossParameter* temp = loss_param_; + loss_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_loss_param(::ditcaffe::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:ditcaffe.LayerParameter.loss_param) +} + +// optional .ditcaffe.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_->::ditcaffe::AccuracyParameter::Clear(); + clear_has_accuracy_param(); +} +inline const ::ditcaffe::AccuracyParameter& LayerParameter::accuracy_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.accuracy_param) + return accuracy_param_ != NULL ? *accuracy_param_ : *default_instance_->accuracy_param_; +} +inline ::ditcaffe::AccuracyParameter* LayerParameter::mutable_accuracy_param() { + set_has_accuracy_param(); + if (accuracy_param_ == NULL) { + accuracy_param_ = new ::ditcaffe::AccuracyParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.accuracy_param) + return accuracy_param_; +} +inline ::ditcaffe::AccuracyParameter* LayerParameter::release_accuracy_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.accuracy_param) + clear_has_accuracy_param(); + ::ditcaffe::AccuracyParameter* temp = accuracy_param_; + accuracy_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_accuracy_param(::ditcaffe::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:ditcaffe.LayerParameter.accuracy_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ArgMaxParameter::Clear(); + clear_has_argmax_param(); +} +inline const ::ditcaffe::ArgMaxParameter& LayerParameter::argmax_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.argmax_param) + return argmax_param_ != NULL ? *argmax_param_ : *default_instance_->argmax_param_; +} +inline ::ditcaffe::ArgMaxParameter* LayerParameter::mutable_argmax_param() { + set_has_argmax_param(); + if (argmax_param_ == NULL) { + argmax_param_ = new ::ditcaffe::ArgMaxParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.argmax_param) + return argmax_param_; +} +inline ::ditcaffe::ArgMaxParameter* LayerParameter::release_argmax_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.argmax_param) + clear_has_argmax_param(); + ::ditcaffe::ArgMaxParameter* temp = argmax_param_; + argmax_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_argmax_param(::ditcaffe::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:ditcaffe.LayerParameter.argmax_param) +} + +// optional .ditcaffe.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_->::ditcaffe::BatchNormParameter::Clear(); + clear_has_batch_norm_param(); +} +inline const ::ditcaffe::BatchNormParameter& LayerParameter::batch_norm_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.batch_norm_param) + return batch_norm_param_ != NULL ? *batch_norm_param_ : *default_instance_->batch_norm_param_; +} +inline ::ditcaffe::BatchNormParameter* LayerParameter::mutable_batch_norm_param() { + set_has_batch_norm_param(); + if (batch_norm_param_ == NULL) { + batch_norm_param_ = new ::ditcaffe::BatchNormParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.batch_norm_param) + return batch_norm_param_; +} +inline ::ditcaffe::BatchNormParameter* LayerParameter::release_batch_norm_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.batch_norm_param) + clear_has_batch_norm_param(); + ::ditcaffe::BatchNormParameter* temp = batch_norm_param_; + batch_norm_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_batch_norm_param(::ditcaffe::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:ditcaffe.LayerParameter.batch_norm_param) +} + +// optional .ditcaffe.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_->::ditcaffe::BiasParameter::Clear(); + clear_has_bias_param(); +} +inline const ::ditcaffe::BiasParameter& LayerParameter::bias_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.bias_param) + return bias_param_ != NULL ? *bias_param_ : *default_instance_->bias_param_; +} +inline ::ditcaffe::BiasParameter* LayerParameter::mutable_bias_param() { + set_has_bias_param(); + if (bias_param_ == NULL) { + bias_param_ = new ::ditcaffe::BiasParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.bias_param) + return bias_param_; +} +inline ::ditcaffe::BiasParameter* LayerParameter::release_bias_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.bias_param) + clear_has_bias_param(); + ::ditcaffe::BiasParameter* temp = bias_param_; + bias_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_bias_param(::ditcaffe::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:ditcaffe.LayerParameter.bias_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ConcatParameter::Clear(); + clear_has_concat_param(); +} +inline const ::ditcaffe::ConcatParameter& LayerParameter::concat_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.concat_param) + return concat_param_ != NULL ? *concat_param_ : *default_instance_->concat_param_; +} +inline ::ditcaffe::ConcatParameter* LayerParameter::mutable_concat_param() { + set_has_concat_param(); + if (concat_param_ == NULL) { + concat_param_ = new ::ditcaffe::ConcatParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.concat_param) + return concat_param_; +} +inline ::ditcaffe::ConcatParameter* LayerParameter::release_concat_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.concat_param) + clear_has_concat_param(); + ::ditcaffe::ConcatParameter* temp = concat_param_; + concat_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_concat_param(::ditcaffe::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:ditcaffe.LayerParameter.concat_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ContrastiveLossParameter::Clear(); + clear_has_contrastive_loss_param(); +} +inline const ::ditcaffe::ContrastiveLossParameter& LayerParameter::contrastive_loss_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.contrastive_loss_param) + return contrastive_loss_param_ != NULL ? *contrastive_loss_param_ : *default_instance_->contrastive_loss_param_; +} +inline ::ditcaffe::ContrastiveLossParameter* LayerParameter::mutable_contrastive_loss_param() { + set_has_contrastive_loss_param(); + if (contrastive_loss_param_ == NULL) { + contrastive_loss_param_ = new ::ditcaffe::ContrastiveLossParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.contrastive_loss_param) + return contrastive_loss_param_; +} +inline ::ditcaffe::ContrastiveLossParameter* LayerParameter::release_contrastive_loss_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.contrastive_loss_param) + clear_has_contrastive_loss_param(); + ::ditcaffe::ContrastiveLossParameter* temp = contrastive_loss_param_; + contrastive_loss_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_contrastive_loss_param(::ditcaffe::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:ditcaffe.LayerParameter.contrastive_loss_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ConvolutionParameter::Clear(); + clear_has_convolution_param(); +} +inline const ::ditcaffe::ConvolutionParameter& LayerParameter::convolution_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.convolution_param) + return convolution_param_ != NULL ? *convolution_param_ : *default_instance_->convolution_param_; +} +inline ::ditcaffe::ConvolutionParameter* LayerParameter::mutable_convolution_param() { + set_has_convolution_param(); + if (convolution_param_ == NULL) { + convolution_param_ = new ::ditcaffe::ConvolutionParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.convolution_param) + return convolution_param_; +} +inline ::ditcaffe::ConvolutionParameter* LayerParameter::release_convolution_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.convolution_param) + clear_has_convolution_param(); + ::ditcaffe::ConvolutionParameter* temp = convolution_param_; + convolution_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_convolution_param(::ditcaffe::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:ditcaffe.LayerParameter.convolution_param) +} + +// optional .ditcaffe.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_->::ditcaffe::CropParameter::Clear(); + clear_has_crop_param(); +} +inline const ::ditcaffe::CropParameter& LayerParameter::crop_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.crop_param) + return crop_param_ != NULL ? *crop_param_ : *default_instance_->crop_param_; +} +inline ::ditcaffe::CropParameter* LayerParameter::mutable_crop_param() { + set_has_crop_param(); + if (crop_param_ == NULL) { + crop_param_ = new ::ditcaffe::CropParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.crop_param) + return crop_param_; +} +inline ::ditcaffe::CropParameter* LayerParameter::release_crop_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.crop_param) + clear_has_crop_param(); + ::ditcaffe::CropParameter* temp = crop_param_; + crop_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_crop_param(::ditcaffe::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:ditcaffe.LayerParameter.crop_param) +} + +// optional .ditcaffe.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_->::ditcaffe::DataParameter::Clear(); + clear_has_data_param(); +} +inline const ::ditcaffe::DataParameter& LayerParameter::data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.data_param) + return data_param_ != NULL ? *data_param_ : *default_instance_->data_param_; +} +inline ::ditcaffe::DataParameter* LayerParameter::mutable_data_param() { + set_has_data_param(); + if (data_param_ == NULL) { + data_param_ = new ::ditcaffe::DataParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.data_param) + return data_param_; +} +inline ::ditcaffe::DataParameter* LayerParameter::release_data_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.data_param) + clear_has_data_param(); + ::ditcaffe::DataParameter* temp = data_param_; + data_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_data_param(::ditcaffe::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:ditcaffe.LayerParameter.data_param) +} + +// optional .ditcaffe.DropoutParameter dropout_param = 108; +inline bool LayerParameter::has_dropout_param() const { + return (_has_bits_[0] & 0x00400000u) != 0; +} +inline void LayerParameter::set_has_dropout_param() { + _has_bits_[0] |= 0x00400000u; +} +inline void LayerParameter::clear_has_dropout_param() { + _has_bits_[0] &= ~0x00400000u; +} +inline void LayerParameter::clear_dropout_param() { + if (dropout_param_ != NULL) dropout_param_->::ditcaffe::DropoutParameter::Clear(); + clear_has_dropout_param(); +} +inline const ::ditcaffe::DropoutParameter& LayerParameter::dropout_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.dropout_param) + return dropout_param_ != NULL ? *dropout_param_ : *default_instance_->dropout_param_; +} +inline ::ditcaffe::DropoutParameter* LayerParameter::mutable_dropout_param() { + set_has_dropout_param(); + if (dropout_param_ == NULL) { + dropout_param_ = new ::ditcaffe::DropoutParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.dropout_param) + return dropout_param_; +} +inline ::ditcaffe::DropoutParameter* LayerParameter::release_dropout_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.dropout_param) + clear_has_dropout_param(); + ::ditcaffe::DropoutParameter* temp = dropout_param_; + dropout_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_dropout_param(::ditcaffe::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:ditcaffe.LayerParameter.dropout_param) +} + +// optional .ditcaffe.DummyDataParameter dummy_data_param = 109; +inline bool LayerParameter::has_dummy_data_param() const { + return (_has_bits_[0] & 0x00800000u) != 0; +} +inline void LayerParameter::set_has_dummy_data_param() { + _has_bits_[0] |= 0x00800000u; +} +inline void LayerParameter::clear_has_dummy_data_param() { + _has_bits_[0] &= ~0x00800000u; +} +inline void LayerParameter::clear_dummy_data_param() { + if (dummy_data_param_ != NULL) dummy_data_param_->::ditcaffe::DummyDataParameter::Clear(); + clear_has_dummy_data_param(); +} +inline const ::ditcaffe::DummyDataParameter& LayerParameter::dummy_data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.dummy_data_param) + return dummy_data_param_ != NULL ? *dummy_data_param_ : *default_instance_->dummy_data_param_; +} +inline ::ditcaffe::DummyDataParameter* LayerParameter::mutable_dummy_data_param() { + set_has_dummy_data_param(); + if (dummy_data_param_ == NULL) { + dummy_data_param_ = new ::ditcaffe::DummyDataParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.dummy_data_param) + return dummy_data_param_; +} +inline ::ditcaffe::DummyDataParameter* LayerParameter::release_dummy_data_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.dummy_data_param) + clear_has_dummy_data_param(); + ::ditcaffe::DummyDataParameter* temp = dummy_data_param_; + dummy_data_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_dummy_data_param(::ditcaffe::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:ditcaffe.LayerParameter.dummy_data_param) +} + +// optional .ditcaffe.EltwiseParameter eltwise_param = 110; +inline bool LayerParameter::has_eltwise_param() const { + return (_has_bits_[0] & 0x01000000u) != 0; +} +inline void LayerParameter::set_has_eltwise_param() { + _has_bits_[0] |= 0x01000000u; +} +inline void LayerParameter::clear_has_eltwise_param() { + _has_bits_[0] &= ~0x01000000u; +} +inline void LayerParameter::clear_eltwise_param() { + if (eltwise_param_ != NULL) eltwise_param_->::ditcaffe::EltwiseParameter::Clear(); + clear_has_eltwise_param(); +} +inline const ::ditcaffe::EltwiseParameter& LayerParameter::eltwise_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.eltwise_param) + return eltwise_param_ != NULL ? *eltwise_param_ : *default_instance_->eltwise_param_; +} +inline ::ditcaffe::EltwiseParameter* LayerParameter::mutable_eltwise_param() { + set_has_eltwise_param(); + if (eltwise_param_ == NULL) { + eltwise_param_ = new ::ditcaffe::EltwiseParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.eltwise_param) + return eltwise_param_; +} +inline ::ditcaffe::EltwiseParameter* LayerParameter::release_eltwise_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.eltwise_param) + clear_has_eltwise_param(); + ::ditcaffe::EltwiseParameter* temp = eltwise_param_; + eltwise_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_eltwise_param(::ditcaffe::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:ditcaffe.LayerParameter.eltwise_param) +} + +// optional .ditcaffe.ELUParameter elu_param = 140; +inline bool LayerParameter::has_elu_param() const { + return (_has_bits_[0] & 0x02000000u) != 0; +} +inline void LayerParameter::set_has_elu_param() { + _has_bits_[0] |= 0x02000000u; +} +inline void LayerParameter::clear_has_elu_param() { + _has_bits_[0] &= ~0x02000000u; +} +inline void LayerParameter::clear_elu_param() { + if (elu_param_ != NULL) elu_param_->::ditcaffe::ELUParameter::Clear(); + clear_has_elu_param(); +} +inline const ::ditcaffe::ELUParameter& LayerParameter::elu_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.elu_param) + return elu_param_ != NULL ? *elu_param_ : *default_instance_->elu_param_; +} +inline ::ditcaffe::ELUParameter* LayerParameter::mutable_elu_param() { + set_has_elu_param(); + if (elu_param_ == NULL) { + elu_param_ = new ::ditcaffe::ELUParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.elu_param) + return elu_param_; +} +inline ::ditcaffe::ELUParameter* LayerParameter::release_elu_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.elu_param) + clear_has_elu_param(); + ::ditcaffe::ELUParameter* temp = elu_param_; + elu_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_elu_param(::ditcaffe::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:ditcaffe.LayerParameter.elu_param) +} + +// optional .ditcaffe.EmbedParameter embed_param = 137; +inline bool LayerParameter::has_embed_param() const { + return (_has_bits_[0] & 0x04000000u) != 0; +} +inline void LayerParameter::set_has_embed_param() { + _has_bits_[0] |= 0x04000000u; +} +inline void LayerParameter::clear_has_embed_param() { + _has_bits_[0] &= ~0x04000000u; +} +inline void LayerParameter::clear_embed_param() { + if (embed_param_ != NULL) embed_param_->::ditcaffe::EmbedParameter::Clear(); + clear_has_embed_param(); +} +inline const ::ditcaffe::EmbedParameter& LayerParameter::embed_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.embed_param) + return embed_param_ != NULL ? *embed_param_ : *default_instance_->embed_param_; +} +inline ::ditcaffe::EmbedParameter* LayerParameter::mutable_embed_param() { + set_has_embed_param(); + if (embed_param_ == NULL) { + embed_param_ = new ::ditcaffe::EmbedParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.embed_param) + return embed_param_; +} +inline ::ditcaffe::EmbedParameter* LayerParameter::release_embed_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.embed_param) + clear_has_embed_param(); + ::ditcaffe::EmbedParameter* temp = embed_param_; + embed_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_embed_param(::ditcaffe::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:ditcaffe.LayerParameter.embed_param) +} + +// optional .ditcaffe.ExpParameter exp_param = 111; +inline bool LayerParameter::has_exp_param() const { + return (_has_bits_[0] & 0x08000000u) != 0; +} +inline void LayerParameter::set_has_exp_param() { + _has_bits_[0] |= 0x08000000u; +} +inline void LayerParameter::clear_has_exp_param() { + _has_bits_[0] &= ~0x08000000u; +} +inline void LayerParameter::clear_exp_param() { + if (exp_param_ != NULL) exp_param_->::ditcaffe::ExpParameter::Clear(); + clear_has_exp_param(); +} +inline const ::ditcaffe::ExpParameter& LayerParameter::exp_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.exp_param) + return exp_param_ != NULL ? *exp_param_ : *default_instance_->exp_param_; +} +inline ::ditcaffe::ExpParameter* LayerParameter::mutable_exp_param() { + set_has_exp_param(); + if (exp_param_ == NULL) { + exp_param_ = new ::ditcaffe::ExpParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.exp_param) + return exp_param_; +} +inline ::ditcaffe::ExpParameter* LayerParameter::release_exp_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.exp_param) + clear_has_exp_param(); + ::ditcaffe::ExpParameter* temp = exp_param_; + exp_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_exp_param(::ditcaffe::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:ditcaffe.LayerParameter.exp_param) +} + +// optional .ditcaffe.FlattenParameter flatten_param = 135; +inline bool LayerParameter::has_flatten_param() const { + return (_has_bits_[0] & 0x10000000u) != 0; +} +inline void LayerParameter::set_has_flatten_param() { + _has_bits_[0] |= 0x10000000u; +} +inline void LayerParameter::clear_has_flatten_param() { + _has_bits_[0] &= ~0x10000000u; +} +inline void LayerParameter::clear_flatten_param() { + if (flatten_param_ != NULL) flatten_param_->::ditcaffe::FlattenParameter::Clear(); + clear_has_flatten_param(); +} +inline const ::ditcaffe::FlattenParameter& LayerParameter::flatten_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.flatten_param) + return flatten_param_ != NULL ? *flatten_param_ : *default_instance_->flatten_param_; +} +inline ::ditcaffe::FlattenParameter* LayerParameter::mutable_flatten_param() { + set_has_flatten_param(); + if (flatten_param_ == NULL) { + flatten_param_ = new ::ditcaffe::FlattenParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.flatten_param) + return flatten_param_; +} +inline ::ditcaffe::FlattenParameter* LayerParameter::release_flatten_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.flatten_param) + clear_has_flatten_param(); + ::ditcaffe::FlattenParameter* temp = flatten_param_; + flatten_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_flatten_param(::ditcaffe::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:ditcaffe.LayerParameter.flatten_param) +} + +// optional .ditcaffe.HDF5DataParameter hdf5_data_param = 112; +inline bool LayerParameter::has_hdf5_data_param() const { + return (_has_bits_[0] & 0x20000000u) != 0; +} +inline void LayerParameter::set_has_hdf5_data_param() { + _has_bits_[0] |= 0x20000000u; +} +inline void LayerParameter::clear_has_hdf5_data_param() { + _has_bits_[0] &= ~0x20000000u; +} +inline void LayerParameter::clear_hdf5_data_param() { + if (hdf5_data_param_ != NULL) hdf5_data_param_->::ditcaffe::HDF5DataParameter::Clear(); + clear_has_hdf5_data_param(); +} +inline const ::ditcaffe::HDF5DataParameter& LayerParameter::hdf5_data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.hdf5_data_param) + return hdf5_data_param_ != NULL ? *hdf5_data_param_ : *default_instance_->hdf5_data_param_; +} +inline ::ditcaffe::HDF5DataParameter* LayerParameter::mutable_hdf5_data_param() { + set_has_hdf5_data_param(); + if (hdf5_data_param_ == NULL) { + hdf5_data_param_ = new ::ditcaffe::HDF5DataParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.hdf5_data_param) + return hdf5_data_param_; +} +inline ::ditcaffe::HDF5DataParameter* LayerParameter::release_hdf5_data_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.hdf5_data_param) + clear_has_hdf5_data_param(); + ::ditcaffe::HDF5DataParameter* temp = hdf5_data_param_; + hdf5_data_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_hdf5_data_param(::ditcaffe::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:ditcaffe.LayerParameter.hdf5_data_param) +} + +// optional .ditcaffe.HDF5OutputParameter hdf5_output_param = 113; +inline bool LayerParameter::has_hdf5_output_param() const { + return (_has_bits_[0] & 0x40000000u) != 0; +} +inline void LayerParameter::set_has_hdf5_output_param() { + _has_bits_[0] |= 0x40000000u; +} +inline void LayerParameter::clear_has_hdf5_output_param() { + _has_bits_[0] &= ~0x40000000u; +} +inline void LayerParameter::clear_hdf5_output_param() { + if (hdf5_output_param_ != NULL) hdf5_output_param_->::ditcaffe::HDF5OutputParameter::Clear(); + clear_has_hdf5_output_param(); +} +inline const ::ditcaffe::HDF5OutputParameter& LayerParameter::hdf5_output_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.hdf5_output_param) + return hdf5_output_param_ != NULL ? *hdf5_output_param_ : *default_instance_->hdf5_output_param_; +} +inline ::ditcaffe::HDF5OutputParameter* LayerParameter::mutable_hdf5_output_param() { + set_has_hdf5_output_param(); + if (hdf5_output_param_ == NULL) { + hdf5_output_param_ = new ::ditcaffe::HDF5OutputParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.hdf5_output_param) + return hdf5_output_param_; +} +inline ::ditcaffe::HDF5OutputParameter* LayerParameter::release_hdf5_output_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.hdf5_output_param) + clear_has_hdf5_output_param(); + ::ditcaffe::HDF5OutputParameter* temp = hdf5_output_param_; + hdf5_output_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_hdf5_output_param(::ditcaffe::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:ditcaffe.LayerParameter.hdf5_output_param) +} + +// optional .ditcaffe.HingeLossParameter hinge_loss_param = 114; +inline bool LayerParameter::has_hinge_loss_param() const { + return (_has_bits_[0] & 0x80000000u) != 0; +} +inline void LayerParameter::set_has_hinge_loss_param() { + _has_bits_[0] |= 0x80000000u; +} +inline void LayerParameter::clear_has_hinge_loss_param() { + _has_bits_[0] &= ~0x80000000u; +} +inline void LayerParameter::clear_hinge_loss_param() { + if (hinge_loss_param_ != NULL) hinge_loss_param_->::ditcaffe::HingeLossParameter::Clear(); + clear_has_hinge_loss_param(); +} +inline const ::ditcaffe::HingeLossParameter& LayerParameter::hinge_loss_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.hinge_loss_param) + return hinge_loss_param_ != NULL ? *hinge_loss_param_ : *default_instance_->hinge_loss_param_; +} +inline ::ditcaffe::HingeLossParameter* LayerParameter::mutable_hinge_loss_param() { + set_has_hinge_loss_param(); + if (hinge_loss_param_ == NULL) { + hinge_loss_param_ = new ::ditcaffe::HingeLossParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.hinge_loss_param) + return hinge_loss_param_; +} +inline ::ditcaffe::HingeLossParameter* LayerParameter::release_hinge_loss_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.hinge_loss_param) + clear_has_hinge_loss_param(); + ::ditcaffe::HingeLossParameter* temp = hinge_loss_param_; + hinge_loss_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_hinge_loss_param(::ditcaffe::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:ditcaffe.LayerParameter.hinge_loss_param) +} + +// optional .ditcaffe.ImageDataParameter image_data_param = 115; +inline bool LayerParameter::has_image_data_param() const { + return (_has_bits_[1] & 0x00000001u) != 0; +} +inline void LayerParameter::set_has_image_data_param() { + _has_bits_[1] |= 0x00000001u; +} +inline void LayerParameter::clear_has_image_data_param() { + _has_bits_[1] &= ~0x00000001u; +} +inline void LayerParameter::clear_image_data_param() { + if (image_data_param_ != NULL) image_data_param_->::ditcaffe::ImageDataParameter::Clear(); + clear_has_image_data_param(); +} +inline const ::ditcaffe::ImageDataParameter& LayerParameter::image_data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.image_data_param) + return image_data_param_ != NULL ? *image_data_param_ : *default_instance_->image_data_param_; +} +inline ::ditcaffe::ImageDataParameter* LayerParameter::mutable_image_data_param() { + set_has_image_data_param(); + if (image_data_param_ == NULL) { + image_data_param_ = new ::ditcaffe::ImageDataParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.image_data_param) + return image_data_param_; +} +inline ::ditcaffe::ImageDataParameter* LayerParameter::release_image_data_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.image_data_param) + clear_has_image_data_param(); + ::ditcaffe::ImageDataParameter* temp = image_data_param_; + image_data_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_image_data_param(::ditcaffe::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:ditcaffe.LayerParameter.image_data_param) +} + +// optional .ditcaffe.InfogainLossParameter infogain_loss_param = 116; +inline bool LayerParameter::has_infogain_loss_param() const { + return (_has_bits_[1] & 0x00000002u) != 0; +} +inline void LayerParameter::set_has_infogain_loss_param() { + _has_bits_[1] |= 0x00000002u; +} +inline void LayerParameter::clear_has_infogain_loss_param() { + _has_bits_[1] &= ~0x00000002u; +} +inline void LayerParameter::clear_infogain_loss_param() { + if (infogain_loss_param_ != NULL) infogain_loss_param_->::ditcaffe::InfogainLossParameter::Clear(); + clear_has_infogain_loss_param(); +} +inline const ::ditcaffe::InfogainLossParameter& LayerParameter::infogain_loss_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.infogain_loss_param) + return infogain_loss_param_ != NULL ? *infogain_loss_param_ : *default_instance_->infogain_loss_param_; +} +inline ::ditcaffe::InfogainLossParameter* LayerParameter::mutable_infogain_loss_param() { + set_has_infogain_loss_param(); + if (infogain_loss_param_ == NULL) { + infogain_loss_param_ = new ::ditcaffe::InfogainLossParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.infogain_loss_param) + return infogain_loss_param_; +} +inline ::ditcaffe::InfogainLossParameter* LayerParameter::release_infogain_loss_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.infogain_loss_param) + clear_has_infogain_loss_param(); + ::ditcaffe::InfogainLossParameter* temp = infogain_loss_param_; + infogain_loss_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_infogain_loss_param(::ditcaffe::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:ditcaffe.LayerParameter.infogain_loss_param) +} + +// optional .ditcaffe.InnerProductParameter inner_product_param = 117; +inline bool LayerParameter::has_inner_product_param() const { + return (_has_bits_[1] & 0x00000004u) != 0; +} +inline void LayerParameter::set_has_inner_product_param() { + _has_bits_[1] |= 0x00000004u; +} +inline void LayerParameter::clear_has_inner_product_param() { + _has_bits_[1] &= ~0x00000004u; +} +inline void LayerParameter::clear_inner_product_param() { + if (inner_product_param_ != NULL) inner_product_param_->::ditcaffe::InnerProductParameter::Clear(); + clear_has_inner_product_param(); +} +inline const ::ditcaffe::InnerProductParameter& LayerParameter::inner_product_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.inner_product_param) + return inner_product_param_ != NULL ? *inner_product_param_ : *default_instance_->inner_product_param_; +} +inline ::ditcaffe::InnerProductParameter* LayerParameter::mutable_inner_product_param() { + set_has_inner_product_param(); + if (inner_product_param_ == NULL) { + inner_product_param_ = new ::ditcaffe::InnerProductParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.inner_product_param) + return inner_product_param_; +} +inline ::ditcaffe::InnerProductParameter* LayerParameter::release_inner_product_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.inner_product_param) + clear_has_inner_product_param(); + ::ditcaffe::InnerProductParameter* temp = inner_product_param_; + inner_product_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_inner_product_param(::ditcaffe::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:ditcaffe.LayerParameter.inner_product_param) +} + +// optional .ditcaffe.InputParameter input_param = 143; +inline bool LayerParameter::has_input_param() const { + return (_has_bits_[1] & 0x00000008u) != 0; +} +inline void LayerParameter::set_has_input_param() { + _has_bits_[1] |= 0x00000008u; +} +inline void LayerParameter::clear_has_input_param() { + _has_bits_[1] &= ~0x00000008u; +} +inline void LayerParameter::clear_input_param() { + if (input_param_ != NULL) input_param_->::ditcaffe::InputParameter::Clear(); + clear_has_input_param(); +} +inline const ::ditcaffe::InputParameter& LayerParameter::input_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.input_param) + return input_param_ != NULL ? *input_param_ : *default_instance_->input_param_; +} +inline ::ditcaffe::InputParameter* LayerParameter::mutable_input_param() { + set_has_input_param(); + if (input_param_ == NULL) { + input_param_ = new ::ditcaffe::InputParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.input_param) + return input_param_; +} +inline ::ditcaffe::InputParameter* LayerParameter::release_input_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.input_param) + clear_has_input_param(); + ::ditcaffe::InputParameter* temp = input_param_; + input_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_input_param(::ditcaffe::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:ditcaffe.LayerParameter.input_param) +} + +// optional .ditcaffe.LogParameter log_param = 134; +inline bool LayerParameter::has_log_param() const { + return (_has_bits_[1] & 0x00000010u) != 0; +} +inline void LayerParameter::set_has_log_param() { + _has_bits_[1] |= 0x00000010u; +} +inline void LayerParameter::clear_has_log_param() { + _has_bits_[1] &= ~0x00000010u; +} +inline void LayerParameter::clear_log_param() { + if (log_param_ != NULL) log_param_->::ditcaffe::LogParameter::Clear(); + clear_has_log_param(); +} +inline const ::ditcaffe::LogParameter& LayerParameter::log_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.log_param) + return log_param_ != NULL ? *log_param_ : *default_instance_->log_param_; +} +inline ::ditcaffe::LogParameter* LayerParameter::mutable_log_param() { + set_has_log_param(); + if (log_param_ == NULL) { + log_param_ = new ::ditcaffe::LogParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.log_param) + return log_param_; +} +inline ::ditcaffe::LogParameter* LayerParameter::release_log_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.log_param) + clear_has_log_param(); + ::ditcaffe::LogParameter* temp = log_param_; + log_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_log_param(::ditcaffe::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:ditcaffe.LayerParameter.log_param) +} + +// optional .ditcaffe.LRNParameter lrn_param = 118; +inline bool LayerParameter::has_lrn_param() const { + return (_has_bits_[1] & 0x00000020u) != 0; +} +inline void LayerParameter::set_has_lrn_param() { + _has_bits_[1] |= 0x00000020u; +} +inline void LayerParameter::clear_has_lrn_param() { + _has_bits_[1] &= ~0x00000020u; +} +inline void LayerParameter::clear_lrn_param() { + if (lrn_param_ != NULL) lrn_param_->::ditcaffe::LRNParameter::Clear(); + clear_has_lrn_param(); +} +inline const ::ditcaffe::LRNParameter& LayerParameter::lrn_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.lrn_param) + return lrn_param_ != NULL ? *lrn_param_ : *default_instance_->lrn_param_; +} +inline ::ditcaffe::LRNParameter* LayerParameter::mutable_lrn_param() { + set_has_lrn_param(); + if (lrn_param_ == NULL) { + lrn_param_ = new ::ditcaffe::LRNParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.lrn_param) + return lrn_param_; +} +inline ::ditcaffe::LRNParameter* LayerParameter::release_lrn_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.lrn_param) + clear_has_lrn_param(); + ::ditcaffe::LRNParameter* temp = lrn_param_; + lrn_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_lrn_param(::ditcaffe::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:ditcaffe.LayerParameter.lrn_param) +} + +// optional .ditcaffe.MemoryDataParameter memory_data_param = 119; +inline bool LayerParameter::has_memory_data_param() const { + return (_has_bits_[1] & 0x00000040u) != 0; +} +inline void LayerParameter::set_has_memory_data_param() { + _has_bits_[1] |= 0x00000040u; +} +inline void LayerParameter::clear_has_memory_data_param() { + _has_bits_[1] &= ~0x00000040u; +} +inline void LayerParameter::clear_memory_data_param() { + if (memory_data_param_ != NULL) memory_data_param_->::ditcaffe::MemoryDataParameter::Clear(); + clear_has_memory_data_param(); +} +inline const ::ditcaffe::MemoryDataParameter& LayerParameter::memory_data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.memory_data_param) + return memory_data_param_ != NULL ? *memory_data_param_ : *default_instance_->memory_data_param_; +} +inline ::ditcaffe::MemoryDataParameter* LayerParameter::mutable_memory_data_param() { + set_has_memory_data_param(); + if (memory_data_param_ == NULL) { + memory_data_param_ = new ::ditcaffe::MemoryDataParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.memory_data_param) + return memory_data_param_; +} +inline ::ditcaffe::MemoryDataParameter* LayerParameter::release_memory_data_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.memory_data_param) + clear_has_memory_data_param(); + ::ditcaffe::MemoryDataParameter* temp = memory_data_param_; + memory_data_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_memory_data_param(::ditcaffe::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:ditcaffe.LayerParameter.memory_data_param) +} + +// optional .ditcaffe.MVNParameter mvn_param = 120; +inline bool LayerParameter::has_mvn_param() const { + return (_has_bits_[1] & 0x00000080u) != 0; +} +inline void LayerParameter::set_has_mvn_param() { + _has_bits_[1] |= 0x00000080u; +} +inline void LayerParameter::clear_has_mvn_param() { + _has_bits_[1] &= ~0x00000080u; +} +inline void LayerParameter::clear_mvn_param() { + if (mvn_param_ != NULL) mvn_param_->::ditcaffe::MVNParameter::Clear(); + clear_has_mvn_param(); +} +inline const ::ditcaffe::MVNParameter& LayerParameter::mvn_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.mvn_param) + return mvn_param_ != NULL ? *mvn_param_ : *default_instance_->mvn_param_; +} +inline ::ditcaffe::MVNParameter* LayerParameter::mutable_mvn_param() { + set_has_mvn_param(); + if (mvn_param_ == NULL) { + mvn_param_ = new ::ditcaffe::MVNParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.mvn_param) + return mvn_param_; +} +inline ::ditcaffe::MVNParameter* LayerParameter::release_mvn_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.mvn_param) + clear_has_mvn_param(); + ::ditcaffe::MVNParameter* temp = mvn_param_; + mvn_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_mvn_param(::ditcaffe::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:ditcaffe.LayerParameter.mvn_param) +} + +// optional .ditcaffe.ParameterParameter parameter_param = 145; +inline bool LayerParameter::has_parameter_param() const { + return (_has_bits_[1] & 0x00000100u) != 0; +} +inline void LayerParameter::set_has_parameter_param() { + _has_bits_[1] |= 0x00000100u; +} +inline void LayerParameter::clear_has_parameter_param() { + _has_bits_[1] &= ~0x00000100u; +} +inline void LayerParameter::clear_parameter_param() { + if (parameter_param_ != NULL) parameter_param_->::ditcaffe::ParameterParameter::Clear(); + clear_has_parameter_param(); +} +inline const ::ditcaffe::ParameterParameter& LayerParameter::parameter_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.parameter_param) + return parameter_param_ != NULL ? *parameter_param_ : *default_instance_->parameter_param_; +} +inline ::ditcaffe::ParameterParameter* LayerParameter::mutable_parameter_param() { + set_has_parameter_param(); + if (parameter_param_ == NULL) { + parameter_param_ = new ::ditcaffe::ParameterParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.parameter_param) + return parameter_param_; +} +inline ::ditcaffe::ParameterParameter* LayerParameter::release_parameter_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.parameter_param) + clear_has_parameter_param(); + ::ditcaffe::ParameterParameter* temp = parameter_param_; + parameter_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_parameter_param(::ditcaffe::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:ditcaffe.LayerParameter.parameter_param) +} + +// optional .ditcaffe.PoolingParameter pooling_param = 121; +inline bool LayerParameter::has_pooling_param() const { + return (_has_bits_[1] & 0x00000200u) != 0; +} +inline void LayerParameter::set_has_pooling_param() { + _has_bits_[1] |= 0x00000200u; +} +inline void LayerParameter::clear_has_pooling_param() { + _has_bits_[1] &= ~0x00000200u; +} +inline void LayerParameter::clear_pooling_param() { + if (pooling_param_ != NULL) pooling_param_->::ditcaffe::PoolingParameter::Clear(); + clear_has_pooling_param(); +} +inline const ::ditcaffe::PoolingParameter& LayerParameter::pooling_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.pooling_param) + return pooling_param_ != NULL ? *pooling_param_ : *default_instance_->pooling_param_; +} +inline ::ditcaffe::PoolingParameter* LayerParameter::mutable_pooling_param() { + set_has_pooling_param(); + if (pooling_param_ == NULL) { + pooling_param_ = new ::ditcaffe::PoolingParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.pooling_param) + return pooling_param_; +} +inline ::ditcaffe::PoolingParameter* LayerParameter::release_pooling_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.pooling_param) + clear_has_pooling_param(); + ::ditcaffe::PoolingParameter* temp = pooling_param_; + pooling_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_pooling_param(::ditcaffe::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:ditcaffe.LayerParameter.pooling_param) +} + +// optional .ditcaffe.PowerParameter power_param = 122; +inline bool LayerParameter::has_power_param() const { + return (_has_bits_[1] & 0x00000400u) != 0; +} +inline void LayerParameter::set_has_power_param() { + _has_bits_[1] |= 0x00000400u; +} +inline void LayerParameter::clear_has_power_param() { + _has_bits_[1] &= ~0x00000400u; +} +inline void LayerParameter::clear_power_param() { + if (power_param_ != NULL) power_param_->::ditcaffe::PowerParameter::Clear(); + clear_has_power_param(); +} +inline const ::ditcaffe::PowerParameter& LayerParameter::power_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.power_param) + return power_param_ != NULL ? *power_param_ : *default_instance_->power_param_; +} +inline ::ditcaffe::PowerParameter* LayerParameter::mutable_power_param() { + set_has_power_param(); + if (power_param_ == NULL) { + power_param_ = new ::ditcaffe::PowerParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.power_param) + return power_param_; +} +inline ::ditcaffe::PowerParameter* LayerParameter::release_power_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.power_param) + clear_has_power_param(); + ::ditcaffe::PowerParameter* temp = power_param_; + power_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_power_param(::ditcaffe::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:ditcaffe.LayerParameter.power_param) +} + +// optional .ditcaffe.PReLUParameter prelu_param = 131; +inline bool LayerParameter::has_prelu_param() const { + return (_has_bits_[1] & 0x00000800u) != 0; +} +inline void LayerParameter::set_has_prelu_param() { + _has_bits_[1] |= 0x00000800u; +} +inline void LayerParameter::clear_has_prelu_param() { + _has_bits_[1] &= ~0x00000800u; +} +inline void LayerParameter::clear_prelu_param() { + if (prelu_param_ != NULL) prelu_param_->::ditcaffe::PReLUParameter::Clear(); + clear_has_prelu_param(); +} +inline const ::ditcaffe::PReLUParameter& LayerParameter::prelu_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.prelu_param) + return prelu_param_ != NULL ? *prelu_param_ : *default_instance_->prelu_param_; +} +inline ::ditcaffe::PReLUParameter* LayerParameter::mutable_prelu_param() { + set_has_prelu_param(); + if (prelu_param_ == NULL) { + prelu_param_ = new ::ditcaffe::PReLUParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.prelu_param) + return prelu_param_; +} +inline ::ditcaffe::PReLUParameter* LayerParameter::release_prelu_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.prelu_param) + clear_has_prelu_param(); + ::ditcaffe::PReLUParameter* temp = prelu_param_; + prelu_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_prelu_param(::ditcaffe::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:ditcaffe.LayerParameter.prelu_param) +} + +// optional .ditcaffe.PythonParameter python_param = 130; +inline bool LayerParameter::has_python_param() const { + return (_has_bits_[1] & 0x00001000u) != 0; +} +inline void LayerParameter::set_has_python_param() { + _has_bits_[1] |= 0x00001000u; +} +inline void LayerParameter::clear_has_python_param() { + _has_bits_[1] &= ~0x00001000u; +} +inline void LayerParameter::clear_python_param() { + if (python_param_ != NULL) python_param_->::ditcaffe::PythonParameter::Clear(); + clear_has_python_param(); +} +inline const ::ditcaffe::PythonParameter& LayerParameter::python_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.python_param) + return python_param_ != NULL ? *python_param_ : *default_instance_->python_param_; +} +inline ::ditcaffe::PythonParameter* LayerParameter::mutable_python_param() { + set_has_python_param(); + if (python_param_ == NULL) { + python_param_ = new ::ditcaffe::PythonParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.python_param) + return python_param_; +} +inline ::ditcaffe::PythonParameter* LayerParameter::release_python_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.python_param) + clear_has_python_param(); + ::ditcaffe::PythonParameter* temp = python_param_; + python_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_python_param(::ditcaffe::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:ditcaffe.LayerParameter.python_param) +} + +// optional .ditcaffe.ReductionParameter reduction_param = 136; +inline bool LayerParameter::has_reduction_param() const { + return (_has_bits_[1] & 0x00002000u) != 0; +} +inline void LayerParameter::set_has_reduction_param() { + _has_bits_[1] |= 0x00002000u; +} +inline void LayerParameter::clear_has_reduction_param() { + _has_bits_[1] &= ~0x00002000u; +} +inline void LayerParameter::clear_reduction_param() { + if (reduction_param_ != NULL) reduction_param_->::ditcaffe::ReductionParameter::Clear(); + clear_has_reduction_param(); +} +inline const ::ditcaffe::ReductionParameter& LayerParameter::reduction_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.reduction_param) + return reduction_param_ != NULL ? *reduction_param_ : *default_instance_->reduction_param_; +} +inline ::ditcaffe::ReductionParameter* LayerParameter::mutable_reduction_param() { + set_has_reduction_param(); + if (reduction_param_ == NULL) { + reduction_param_ = new ::ditcaffe::ReductionParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.reduction_param) + return reduction_param_; +} +inline ::ditcaffe::ReductionParameter* LayerParameter::release_reduction_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.reduction_param) + clear_has_reduction_param(); + ::ditcaffe::ReductionParameter* temp = reduction_param_; + reduction_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_reduction_param(::ditcaffe::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:ditcaffe.LayerParameter.reduction_param) +} + +// optional .ditcaffe.ReLUParameter relu_param = 123; +inline bool LayerParameter::has_relu_param() const { + return (_has_bits_[1] & 0x00004000u) != 0; +} +inline void LayerParameter::set_has_relu_param() { + _has_bits_[1] |= 0x00004000u; +} +inline void LayerParameter::clear_has_relu_param() { + _has_bits_[1] &= ~0x00004000u; +} +inline void LayerParameter::clear_relu_param() { + if (relu_param_ != NULL) relu_param_->::ditcaffe::ReLUParameter::Clear(); + clear_has_relu_param(); +} +inline const ::ditcaffe::ReLUParameter& LayerParameter::relu_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.relu_param) + return relu_param_ != NULL ? *relu_param_ : *default_instance_->relu_param_; +} +inline ::ditcaffe::ReLUParameter* LayerParameter::mutable_relu_param() { + set_has_relu_param(); + if (relu_param_ == NULL) { + relu_param_ = new ::ditcaffe::ReLUParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.relu_param) + return relu_param_; +} +inline ::ditcaffe::ReLUParameter* LayerParameter::release_relu_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.relu_param) + clear_has_relu_param(); + ::ditcaffe::ReLUParameter* temp = relu_param_; + relu_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_relu_param(::ditcaffe::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:ditcaffe.LayerParameter.relu_param) +} + +// optional .ditcaffe.ReshapeParameter reshape_param = 133; +inline bool LayerParameter::has_reshape_param() const { + return (_has_bits_[1] & 0x00008000u) != 0; +} +inline void LayerParameter::set_has_reshape_param() { + _has_bits_[1] |= 0x00008000u; +} +inline void LayerParameter::clear_has_reshape_param() { + _has_bits_[1] &= ~0x00008000u; +} +inline void LayerParameter::clear_reshape_param() { + if (reshape_param_ != NULL) reshape_param_->::ditcaffe::ReshapeParameter::Clear(); + clear_has_reshape_param(); +} +inline const ::ditcaffe::ReshapeParameter& LayerParameter::reshape_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.reshape_param) + return reshape_param_ != NULL ? *reshape_param_ : *default_instance_->reshape_param_; +} +inline ::ditcaffe::ReshapeParameter* LayerParameter::mutable_reshape_param() { + set_has_reshape_param(); + if (reshape_param_ == NULL) { + reshape_param_ = new ::ditcaffe::ReshapeParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.reshape_param) + return reshape_param_; +} +inline ::ditcaffe::ReshapeParameter* LayerParameter::release_reshape_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.reshape_param) + clear_has_reshape_param(); + ::ditcaffe::ReshapeParameter* temp = reshape_param_; + reshape_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_reshape_param(::ditcaffe::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:ditcaffe.LayerParameter.reshape_param) +} + +// optional .ditcaffe.ScaleParameter scale_param = 142; +inline bool LayerParameter::has_scale_param() const { + return (_has_bits_[1] & 0x00010000u) != 0; +} +inline void LayerParameter::set_has_scale_param() { + _has_bits_[1] |= 0x00010000u; +} +inline void LayerParameter::clear_has_scale_param() { + _has_bits_[1] &= ~0x00010000u; +} +inline void LayerParameter::clear_scale_param() { + if (scale_param_ != NULL) scale_param_->::ditcaffe::ScaleParameter::Clear(); + clear_has_scale_param(); +} +inline const ::ditcaffe::ScaleParameter& LayerParameter::scale_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.scale_param) + return scale_param_ != NULL ? *scale_param_ : *default_instance_->scale_param_; +} +inline ::ditcaffe::ScaleParameter* LayerParameter::mutable_scale_param() { + set_has_scale_param(); + if (scale_param_ == NULL) { + scale_param_ = new ::ditcaffe::ScaleParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.scale_param) + return scale_param_; +} +inline ::ditcaffe::ScaleParameter* LayerParameter::release_scale_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.scale_param) + clear_has_scale_param(); + ::ditcaffe::ScaleParameter* temp = scale_param_; + scale_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_scale_param(::ditcaffe::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:ditcaffe.LayerParameter.scale_param) +} + +// optional .ditcaffe.SigmoidParameter sigmoid_param = 124; +inline bool LayerParameter::has_sigmoid_param() const { + return (_has_bits_[1] & 0x00020000u) != 0; +} +inline void LayerParameter::set_has_sigmoid_param() { + _has_bits_[1] |= 0x00020000u; +} +inline void LayerParameter::clear_has_sigmoid_param() { + _has_bits_[1] &= ~0x00020000u; +} +inline void LayerParameter::clear_sigmoid_param() { + if (sigmoid_param_ != NULL) sigmoid_param_->::ditcaffe::SigmoidParameter::Clear(); + clear_has_sigmoid_param(); +} +inline const ::ditcaffe::SigmoidParameter& LayerParameter::sigmoid_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.sigmoid_param) + return sigmoid_param_ != NULL ? *sigmoid_param_ : *default_instance_->sigmoid_param_; +} +inline ::ditcaffe::SigmoidParameter* LayerParameter::mutable_sigmoid_param() { + set_has_sigmoid_param(); + if (sigmoid_param_ == NULL) { + sigmoid_param_ = new ::ditcaffe::SigmoidParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.sigmoid_param) + return sigmoid_param_; +} +inline ::ditcaffe::SigmoidParameter* LayerParameter::release_sigmoid_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.sigmoid_param) + clear_has_sigmoid_param(); + ::ditcaffe::SigmoidParameter* temp = sigmoid_param_; + sigmoid_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_sigmoid_param(::ditcaffe::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:ditcaffe.LayerParameter.sigmoid_param) +} + +// optional .ditcaffe.SoftmaxParameter softmax_param = 125; +inline bool LayerParameter::has_softmax_param() const { + return (_has_bits_[1] & 0x00040000u) != 0; +} +inline void LayerParameter::set_has_softmax_param() { + _has_bits_[1] |= 0x00040000u; +} +inline void LayerParameter::clear_has_softmax_param() { + _has_bits_[1] &= ~0x00040000u; +} +inline void LayerParameter::clear_softmax_param() { + if (softmax_param_ != NULL) softmax_param_->::ditcaffe::SoftmaxParameter::Clear(); + clear_has_softmax_param(); +} +inline const ::ditcaffe::SoftmaxParameter& LayerParameter::softmax_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.softmax_param) + return softmax_param_ != NULL ? *softmax_param_ : *default_instance_->softmax_param_; +} +inline ::ditcaffe::SoftmaxParameter* LayerParameter::mutable_softmax_param() { + set_has_softmax_param(); + if (softmax_param_ == NULL) { + softmax_param_ = new ::ditcaffe::SoftmaxParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.softmax_param) + return softmax_param_; +} +inline ::ditcaffe::SoftmaxParameter* LayerParameter::release_softmax_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.softmax_param) + clear_has_softmax_param(); + ::ditcaffe::SoftmaxParameter* temp = softmax_param_; + softmax_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_softmax_param(::ditcaffe::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:ditcaffe.LayerParameter.softmax_param) +} + +// optional .ditcaffe.SPPParameter spp_param = 132; +inline bool LayerParameter::has_spp_param() const { + return (_has_bits_[1] & 0x00080000u) != 0; +} +inline void LayerParameter::set_has_spp_param() { + _has_bits_[1] |= 0x00080000u; +} +inline void LayerParameter::clear_has_spp_param() { + _has_bits_[1] &= ~0x00080000u; +} +inline void LayerParameter::clear_spp_param() { + if (spp_param_ != NULL) spp_param_->::ditcaffe::SPPParameter::Clear(); + clear_has_spp_param(); +} +inline const ::ditcaffe::SPPParameter& LayerParameter::spp_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.spp_param) + return spp_param_ != NULL ? *spp_param_ : *default_instance_->spp_param_; +} +inline ::ditcaffe::SPPParameter* LayerParameter::mutable_spp_param() { + set_has_spp_param(); + if (spp_param_ == NULL) { + spp_param_ = new ::ditcaffe::SPPParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.spp_param) + return spp_param_; +} +inline ::ditcaffe::SPPParameter* LayerParameter::release_spp_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.spp_param) + clear_has_spp_param(); + ::ditcaffe::SPPParameter* temp = spp_param_; + spp_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_spp_param(::ditcaffe::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:ditcaffe.LayerParameter.spp_param) +} + +// optional .ditcaffe.SliceParameter slice_param = 126; +inline bool LayerParameter::has_slice_param() const { + return (_has_bits_[1] & 0x00100000u) != 0; +} +inline void LayerParameter::set_has_slice_param() { + _has_bits_[1] |= 0x00100000u; +} +inline void LayerParameter::clear_has_slice_param() { + _has_bits_[1] &= ~0x00100000u; +} +inline void LayerParameter::clear_slice_param() { + if (slice_param_ != NULL) slice_param_->::ditcaffe::SliceParameter::Clear(); + clear_has_slice_param(); +} +inline const ::ditcaffe::SliceParameter& LayerParameter::slice_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.slice_param) + return slice_param_ != NULL ? *slice_param_ : *default_instance_->slice_param_; +} +inline ::ditcaffe::SliceParameter* LayerParameter::mutable_slice_param() { + set_has_slice_param(); + if (slice_param_ == NULL) { + slice_param_ = new ::ditcaffe::SliceParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.slice_param) + return slice_param_; +} +inline ::ditcaffe::SliceParameter* LayerParameter::release_slice_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.slice_param) + clear_has_slice_param(); + ::ditcaffe::SliceParameter* temp = slice_param_; + slice_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_slice_param(::ditcaffe::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:ditcaffe.LayerParameter.slice_param) +} + +// optional .ditcaffe.TanHParameter tanh_param = 127; +inline bool LayerParameter::has_tanh_param() const { + return (_has_bits_[1] & 0x00200000u) != 0; +} +inline void LayerParameter::set_has_tanh_param() { + _has_bits_[1] |= 0x00200000u; +} +inline void LayerParameter::clear_has_tanh_param() { + _has_bits_[1] &= ~0x00200000u; +} +inline void LayerParameter::clear_tanh_param() { + if (tanh_param_ != NULL) tanh_param_->::ditcaffe::TanHParameter::Clear(); + clear_has_tanh_param(); +} +inline const ::ditcaffe::TanHParameter& LayerParameter::tanh_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.tanh_param) + return tanh_param_ != NULL ? *tanh_param_ : *default_instance_->tanh_param_; +} +inline ::ditcaffe::TanHParameter* LayerParameter::mutable_tanh_param() { + set_has_tanh_param(); + if (tanh_param_ == NULL) { + tanh_param_ = new ::ditcaffe::TanHParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.tanh_param) + return tanh_param_; +} +inline ::ditcaffe::TanHParameter* LayerParameter::release_tanh_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.tanh_param) + clear_has_tanh_param(); + ::ditcaffe::TanHParameter* temp = tanh_param_; + tanh_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_tanh_param(::ditcaffe::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:ditcaffe.LayerParameter.tanh_param) +} + +// optional .ditcaffe.ThresholdParameter threshold_param = 128; +inline bool LayerParameter::has_threshold_param() const { + return (_has_bits_[1] & 0x00400000u) != 0; +} +inline void LayerParameter::set_has_threshold_param() { + _has_bits_[1] |= 0x00400000u; +} +inline void LayerParameter::clear_has_threshold_param() { + _has_bits_[1] &= ~0x00400000u; +} +inline void LayerParameter::clear_threshold_param() { + if (threshold_param_ != NULL) threshold_param_->::ditcaffe::ThresholdParameter::Clear(); + clear_has_threshold_param(); +} +inline const ::ditcaffe::ThresholdParameter& LayerParameter::threshold_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.threshold_param) + return threshold_param_ != NULL ? *threshold_param_ : *default_instance_->threshold_param_; +} +inline ::ditcaffe::ThresholdParameter* LayerParameter::mutable_threshold_param() { + set_has_threshold_param(); + if (threshold_param_ == NULL) { + threshold_param_ = new ::ditcaffe::ThresholdParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.threshold_param) + return threshold_param_; +} +inline ::ditcaffe::ThresholdParameter* LayerParameter::release_threshold_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.threshold_param) + clear_has_threshold_param(); + ::ditcaffe::ThresholdParameter* temp = threshold_param_; + threshold_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_threshold_param(::ditcaffe::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:ditcaffe.LayerParameter.threshold_param) +} + +// optional .ditcaffe.TileParameter tile_param = 138; +inline bool LayerParameter::has_tile_param() const { + return (_has_bits_[1] & 0x00800000u) != 0; +} +inline void LayerParameter::set_has_tile_param() { + _has_bits_[1] |= 0x00800000u; +} +inline void LayerParameter::clear_has_tile_param() { + _has_bits_[1] &= ~0x00800000u; +} +inline void LayerParameter::clear_tile_param() { + if (tile_param_ != NULL) tile_param_->::ditcaffe::TileParameter::Clear(); + clear_has_tile_param(); +} +inline const ::ditcaffe::TileParameter& LayerParameter::tile_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.tile_param) + return tile_param_ != NULL ? *tile_param_ : *default_instance_->tile_param_; +} +inline ::ditcaffe::TileParameter* LayerParameter::mutable_tile_param() { + set_has_tile_param(); + if (tile_param_ == NULL) { + tile_param_ = new ::ditcaffe::TileParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.tile_param) + return tile_param_; +} +inline ::ditcaffe::TileParameter* LayerParameter::release_tile_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.tile_param) + clear_has_tile_param(); + ::ditcaffe::TileParameter* temp = tile_param_; + tile_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_tile_param(::ditcaffe::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:ditcaffe.LayerParameter.tile_param) +} + +// optional .ditcaffe.WindowDataParameter window_data_param = 129; +inline bool LayerParameter::has_window_data_param() const { + return (_has_bits_[1] & 0x01000000u) != 0; +} +inline void LayerParameter::set_has_window_data_param() { + _has_bits_[1] |= 0x01000000u; +} +inline void LayerParameter::clear_has_window_data_param() { + _has_bits_[1] &= ~0x01000000u; +} +inline void LayerParameter::clear_window_data_param() { + if (window_data_param_ != NULL) window_data_param_->::ditcaffe::WindowDataParameter::Clear(); + clear_has_window_data_param(); +} +inline const ::ditcaffe::WindowDataParameter& LayerParameter::window_data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.window_data_param) + return window_data_param_ != NULL ? *window_data_param_ : *default_instance_->window_data_param_; +} +inline ::ditcaffe::WindowDataParameter* LayerParameter::mutable_window_data_param() { + set_has_window_data_param(); + if (window_data_param_ == NULL) { + window_data_param_ = new ::ditcaffe::WindowDataParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.window_data_param) + return window_data_param_; +} +inline ::ditcaffe::WindowDataParameter* LayerParameter::release_window_data_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.window_data_param) + clear_has_window_data_param(); + ::ditcaffe::WindowDataParameter* temp = window_data_param_; + window_data_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_window_data_param(::ditcaffe::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:ditcaffe.LayerParameter.window_data_param) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.TransformationParameter.scale) + return scale_; +} +inline void TransformationParameter::set_scale(float value) { + set_has_scale(); + scale_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.TransformationParameter.mirror) + return mirror_; +} +inline void TransformationParameter::set_mirror(bool value) { + set_has_mirror(); + mirror_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.TransformationParameter.mean_file) +} +inline ::std::string* TransformationParameter::mutable_mean_file() { + set_has_mean_file(); + // @@protoc_insertion_point(field_mutable:ditcaffe.TransformationParameter.mean_file) + return mean_file_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* TransformationParameter::release_mean_file() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.TransformationParameter.mean_value) +} +inline void TransformationParameter::add_mean_value(float value) { + mean_value_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.TransformationParameter.mean_value) +} +inline const ::google::protobuf::RepeatedField< float >& +TransformationParameter::mean_value() const { + // @@protoc_insertion_point(field_list:ditcaffe.TransformationParameter.mean_value) + return mean_value_; +} +inline ::google::protobuf::RepeatedField< float >* +TransformationParameter::mutable_mean_value() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.TransformationParameter.force_gray) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.LossParameter.ignore_label) +} + +// optional .ditcaffe.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 ::ditcaffe::LossParameter_NormalizationMode LossParameter::normalization() const { + // @@protoc_insertion_point(field_get:ditcaffe.LossParameter.normalization) + return static_cast< ::ditcaffe::LossParameter_NormalizationMode >(normalization_); +} +inline void LossParameter::set_normalization(::ditcaffe::LossParameter_NormalizationMode value) { + assert(::ditcaffe::LossParameter_NormalizationMode_IsValid(value)); + set_has_normalization(); + normalization_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.LossParameter.normalize) + return normalize_; +} +inline void LossParameter::set_normalize(bool value) { + set_has_normalize(); + normalize_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.LossParameter.normalize) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.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:ditcaffe.AccuracyParameter.axis) + return axis_; +} +inline void AccuracyParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.AccuracyParameter.ignore_label) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.ArgMaxParameter.axis) + return axis_; +} +inline void ArgMaxParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.ArgMaxParameter.axis) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.ConcatParameter.axis) + return axis_; +} +inline void ConcatParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.ConcatParameter.concat_dim) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.BatchNormParameter.eps) + return eps_; +} +inline void BatchNormParameter::set_eps(float value) { + set_has_eps(); + eps_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.BatchNormParameter.eps) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.BiasParameter.axis) + return axis_; +} +inline void BiasParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.BiasParameter.num_axes) +} + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_filler(); +} +inline const ::ditcaffe::FillerParameter& BiasParameter::filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.BiasParameter.filler) + return filler_ != NULL ? *filler_ : *default_instance_->filler_; +} +inline ::ditcaffe::FillerParameter* BiasParameter::mutable_filler() { + set_has_filler(); + if (filler_ == NULL) { + filler_ = new ::ditcaffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.BiasParameter.filler) + return filler_; +} +inline ::ditcaffe::FillerParameter* BiasParameter::release_filler() { + // @@protoc_insertion_point(field_release:ditcaffe.BiasParameter.filler) + clear_has_filler(); + ::ditcaffe::FillerParameter* temp = filler_; + filler_ = NULL; + return temp; +} +inline void BiasParameter::set_allocated_filler(::ditcaffe::FillerParameter* filler) { + delete filler_; + filler_ = filler; + if (filler) { + set_has_filler(); + } else { + clear_has_filler(); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.BiasParameter.filler) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.ContrastiveLossParameter.margin) + return margin_; +} +inline void ContrastiveLossParameter::set_margin(float value) { + set_has_margin(); + margin_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.ContrastiveLossParameter.legacy_version) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.ConvolutionParameter.pad) +} +inline void ConvolutionParameter::add_pad(::google::protobuf::uint32 value) { + pad_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.ConvolutionParameter.pad) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +ConvolutionParameter::pad() const { + // @@protoc_insertion_point(field_list:ditcaffe.ConvolutionParameter.pad) + return pad_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +ConvolutionParameter::mutable_pad() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.ConvolutionParameter.kernel_size) +} +inline void ConvolutionParameter::add_kernel_size(::google::protobuf::uint32 value) { + kernel_size_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.ConvolutionParameter.kernel_size) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +ConvolutionParameter::kernel_size() const { + // @@protoc_insertion_point(field_list:ditcaffe.ConvolutionParameter.kernel_size) + return kernel_size_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +ConvolutionParameter::mutable_kernel_size() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.ConvolutionParameter.stride) +} +inline void ConvolutionParameter::add_stride(::google::protobuf::uint32 value) { + stride_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.ConvolutionParameter.stride) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +ConvolutionParameter::stride() const { + // @@protoc_insertion_point(field_list:ditcaffe.ConvolutionParameter.stride) + return stride_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +ConvolutionParameter::mutable_stride() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.ConvolutionParameter.dilation) +} +inline void ConvolutionParameter::add_dilation(::google::protobuf::uint32 value) { + dilation_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.ConvolutionParameter.dilation) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +ConvolutionParameter::dilation() const { + // @@protoc_insertion_point(field_list:ditcaffe.ConvolutionParameter.dilation) + return dilation_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +ConvolutionParameter::mutable_dilation() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.ConvolutionParameter.group) + return group_; +} +inline void ConvolutionParameter::set_group(::google::protobuf::uint32 value) { + set_has_group(); + group_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.ConvolutionParameter.group) +} + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_weight_filler(); +} +inline const ::ditcaffe::FillerParameter& ConvolutionParameter::weight_filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.ConvolutionParameter.weight_filler) + return weight_filler_ != NULL ? *weight_filler_ : *default_instance_->weight_filler_; +} +inline ::ditcaffe::FillerParameter* ConvolutionParameter::mutable_weight_filler() { + set_has_weight_filler(); + if (weight_filler_ == NULL) { + weight_filler_ = new ::ditcaffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.ConvolutionParameter.weight_filler) + return weight_filler_; +} +inline ::ditcaffe::FillerParameter* ConvolutionParameter::release_weight_filler() { + // @@protoc_insertion_point(field_release:ditcaffe.ConvolutionParameter.weight_filler) + clear_has_weight_filler(); + ::ditcaffe::FillerParameter* temp = weight_filler_; + weight_filler_ = NULL; + return temp; +} +inline void ConvolutionParameter::set_allocated_weight_filler(::ditcaffe::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:ditcaffe.ConvolutionParameter.weight_filler) +} + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_bias_filler(); +} +inline const ::ditcaffe::FillerParameter& ConvolutionParameter::bias_filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.ConvolutionParameter.bias_filler) + return bias_filler_ != NULL ? *bias_filler_ : *default_instance_->bias_filler_; +} +inline ::ditcaffe::FillerParameter* ConvolutionParameter::mutable_bias_filler() { + set_has_bias_filler(); + if (bias_filler_ == NULL) { + bias_filler_ = new ::ditcaffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.ConvolutionParameter.bias_filler) + return bias_filler_; +} +inline ::ditcaffe::FillerParameter* ConvolutionParameter::release_bias_filler() { + // @@protoc_insertion_point(field_release:ditcaffe.ConvolutionParameter.bias_filler) + clear_has_bias_filler(); + ::ditcaffe::FillerParameter* temp = bias_filler_; + bias_filler_ = NULL; + return temp; +} +inline void ConvolutionParameter::set_allocated_bias_filler(::ditcaffe::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:ditcaffe.ConvolutionParameter.bias_filler) +} + +// optional .ditcaffe.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 ::ditcaffe::ConvolutionParameter_Engine ConvolutionParameter::engine() const { + // @@protoc_insertion_point(field_get:ditcaffe.ConvolutionParameter.engine) + return static_cast< ::ditcaffe::ConvolutionParameter_Engine >(engine_); +} +inline void ConvolutionParameter::set_engine(::ditcaffe::ConvolutionParameter_Engine value) { + assert(::ditcaffe::ConvolutionParameter_Engine_IsValid(value)); + set_has_engine(); + engine_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.ConvolutionParameter.axis) + return axis_; +} +inline void ConvolutionParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.ConvolutionParameter.force_nd_im2col) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.CropParameter.axis) + return axis_; +} +inline void CropParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.CropParameter.offset) +} +inline void CropParameter::add_offset(::google::protobuf::uint32 value) { + offset_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.CropParameter.offset) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +CropParameter::offset() const { + // @@protoc_insertion_point(field_list:ditcaffe.CropParameter.offset) + return offset_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +CropParameter::mutable_offset() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.CropParameter.offset) + return &offset_; +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.DataParameter.source) +} +inline ::std::string* DataParameter::mutable_source() { + set_has_source(); + // @@protoc_insertion_point(field_mutable:ditcaffe.DataParameter.source) + return source_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* DataParameter::release_source() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.DataParameter.rand_skip) +} + +// optional .ditcaffe.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 ::ditcaffe::DataParameter_DB DataParameter::backend() const { + // @@protoc_insertion_point(field_get:ditcaffe.DataParameter.backend) + return static_cast< ::ditcaffe::DataParameter_DB >(backend_); +} +inline void DataParameter::set_backend(::ditcaffe::DataParameter_DB value) { + assert(::ditcaffe::DataParameter_DB_IsValid(value)); + set_has_backend(); + backend_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.DataParameter.scale) + return scale_; +} +inline void DataParameter::set_scale(float value) { + set_has_scale(); + scale_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.DataParameter.mean_file) +} +inline ::std::string* DataParameter::mutable_mean_file() { + set_has_mean_file(); + // @@protoc_insertion_point(field_mutable:ditcaffe.DataParameter.mean_file) + return mean_file_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* DataParameter::release_mean_file() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.DataParameter.mirror) + return mirror_; +} +inline void DataParameter::set_mirror(bool value) { + set_has_mirror(); + mirror_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.DataParameter.prefetch) + return prefetch_; +} +inline void DataParameter::set_prefetch(::google::protobuf::uint32 value) { + set_has_prefetch(); + prefetch_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.DataParameter.prefetch) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.DropoutParameter.dropout_ratio) +} + +// ------------------------------------------------------------------- + +// DummyDataParameter + +// repeated .ditcaffe.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 ::ditcaffe::FillerParameter& DummyDataParameter::data_filler(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.DummyDataParameter.data_filler) + return data_filler_.Get(index); +} +inline ::ditcaffe::FillerParameter* DummyDataParameter::mutable_data_filler(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.DummyDataParameter.data_filler) + return data_filler_.Mutable(index); +} +inline ::ditcaffe::FillerParameter* DummyDataParameter::add_data_filler() { + // @@protoc_insertion_point(field_add:ditcaffe.DummyDataParameter.data_filler) + return data_filler_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::FillerParameter >* +DummyDataParameter::mutable_data_filler() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.DummyDataParameter.data_filler) + return &data_filler_; +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::FillerParameter >& +DummyDataParameter::data_filler() const { + // @@protoc_insertion_point(field_list:ditcaffe.DummyDataParameter.data_filler) + return data_filler_; +} + +// repeated .ditcaffe.BlobShape shape = 6; +inline int DummyDataParameter::shape_size() const { + return shape_.size(); +} +inline void DummyDataParameter::clear_shape() { + shape_.Clear(); +} +inline const ::ditcaffe::BlobShape& DummyDataParameter::shape(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.DummyDataParameter.shape) + return shape_.Get(index); +} +inline ::ditcaffe::BlobShape* DummyDataParameter::mutable_shape(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.DummyDataParameter.shape) + return shape_.Mutable(index); +} +inline ::ditcaffe::BlobShape* DummyDataParameter::add_shape() { + // @@protoc_insertion_point(field_add:ditcaffe.DummyDataParameter.shape) + return shape_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobShape >* +DummyDataParameter::mutable_shape() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.DummyDataParameter.shape) + return &shape_; +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobShape >& +DummyDataParameter::shape() const { + // @@protoc_insertion_point(field_list:ditcaffe.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:ditcaffe.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:ditcaffe.DummyDataParameter.num) +} +inline void DummyDataParameter::add_num(::google::protobuf::uint32 value) { + num_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.DummyDataParameter.num) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +DummyDataParameter::num() const { + // @@protoc_insertion_point(field_list:ditcaffe.DummyDataParameter.num) + return num_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +DummyDataParameter::mutable_num() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.DummyDataParameter.channels) +} +inline void DummyDataParameter::add_channels(::google::protobuf::uint32 value) { + channels_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.DummyDataParameter.channels) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +DummyDataParameter::channels() const { + // @@protoc_insertion_point(field_list:ditcaffe.DummyDataParameter.channels) + return channels_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +DummyDataParameter::mutable_channels() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.DummyDataParameter.height) +} +inline void DummyDataParameter::add_height(::google::protobuf::uint32 value) { + height_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.DummyDataParameter.height) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +DummyDataParameter::height() const { + // @@protoc_insertion_point(field_list:ditcaffe.DummyDataParameter.height) + return height_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +DummyDataParameter::mutable_height() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.DummyDataParameter.width) +} +inline void DummyDataParameter::add_width(::google::protobuf::uint32 value) { + width_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.DummyDataParameter.width) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +DummyDataParameter::width() const { + // @@protoc_insertion_point(field_list:ditcaffe.DummyDataParameter.width) + return width_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +DummyDataParameter::mutable_width() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.DummyDataParameter.width) + return &width_; +} + +// ------------------------------------------------------------------- + +// EltwiseParameter + +// optional .ditcaffe.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 ::ditcaffe::EltwiseParameter_EltwiseOp EltwiseParameter::operation() const { + // @@protoc_insertion_point(field_get:ditcaffe.EltwiseParameter.operation) + return static_cast< ::ditcaffe::EltwiseParameter_EltwiseOp >(operation_); +} +inline void EltwiseParameter::set_operation(::ditcaffe::EltwiseParameter_EltwiseOp value) { + assert(::ditcaffe::EltwiseParameter_EltwiseOp_IsValid(value)); + set_has_operation(); + operation_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.EltwiseParameter.coeff) + return coeff_.Get(index); +} +inline void EltwiseParameter::set_coeff(int index, float value) { + coeff_.Set(index, value); + // @@protoc_insertion_point(field_set:ditcaffe.EltwiseParameter.coeff) +} +inline void EltwiseParameter::add_coeff(float value) { + coeff_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.EltwiseParameter.coeff) +} +inline const ::google::protobuf::RepeatedField< float >& +EltwiseParameter::coeff() const { + // @@protoc_insertion_point(field_list:ditcaffe.EltwiseParameter.coeff) + return coeff_; +} +inline ::google::protobuf::RepeatedField< float >* +EltwiseParameter::mutable_coeff() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.EltwiseParameter.stable_prod_grad) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.ELUParameter.alpha) + return alpha_; +} +inline void ELUParameter::set_alpha(float value) { + set_has_alpha(); + alpha_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.ELUParameter.alpha) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.EmbedParameter.bias_term) +} + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_weight_filler(); +} +inline const ::ditcaffe::FillerParameter& EmbedParameter::weight_filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.EmbedParameter.weight_filler) + return weight_filler_ != NULL ? *weight_filler_ : *default_instance_->weight_filler_; +} +inline ::ditcaffe::FillerParameter* EmbedParameter::mutable_weight_filler() { + set_has_weight_filler(); + if (weight_filler_ == NULL) { + weight_filler_ = new ::ditcaffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.EmbedParameter.weight_filler) + return weight_filler_; +} +inline ::ditcaffe::FillerParameter* EmbedParameter::release_weight_filler() { + // @@protoc_insertion_point(field_release:ditcaffe.EmbedParameter.weight_filler) + clear_has_weight_filler(); + ::ditcaffe::FillerParameter* temp = weight_filler_; + weight_filler_ = NULL; + return temp; +} +inline void EmbedParameter::set_allocated_weight_filler(::ditcaffe::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:ditcaffe.EmbedParameter.weight_filler) +} + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_bias_filler(); +} +inline const ::ditcaffe::FillerParameter& EmbedParameter::bias_filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.EmbedParameter.bias_filler) + return bias_filler_ != NULL ? *bias_filler_ : *default_instance_->bias_filler_; +} +inline ::ditcaffe::FillerParameter* EmbedParameter::mutable_bias_filler() { + set_has_bias_filler(); + if (bias_filler_ == NULL) { + bias_filler_ = new ::ditcaffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.EmbedParameter.bias_filler) + return bias_filler_; +} +inline ::ditcaffe::FillerParameter* EmbedParameter::release_bias_filler() { + // @@protoc_insertion_point(field_release:ditcaffe.EmbedParameter.bias_filler) + clear_has_bias_filler(); + ::ditcaffe::FillerParameter* temp = bias_filler_; + bias_filler_ = NULL; + return temp; +} +inline void EmbedParameter::set_allocated_bias_filler(::ditcaffe::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:ditcaffe.EmbedParameter.bias_filler) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.ExpParameter.base) + return base_; +} +inline void ExpParameter::set_base(float value) { + set_has_base(); + base_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.ExpParameter.scale) + return scale_; +} +inline void ExpParameter::set_scale(float value) { + set_has_scale(); + scale_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.ExpParameter.shift) + return shift_; +} +inline void ExpParameter::set_shift(float value) { + set_has_shift(); + shift_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.ExpParameter.shift) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.FlattenParameter.axis) + return axis_; +} +inline void FlattenParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.FlattenParameter.end_axis) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.HDF5DataParameter.source) +} +inline ::std::string* HDF5DataParameter::mutable_source() { + set_has_source(); + // @@protoc_insertion_point(field_mutable:ditcaffe.HDF5DataParameter.source) + return source_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* HDF5DataParameter::release_source() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.HDF5DataParameter.shuffle) + return shuffle_; +} +inline void HDF5DataParameter::set_shuffle(bool value) { + set_has_shuffle(); + shuffle_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.HDF5DataParameter.shuffle) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.HDF5OutputParameter.file_name) +} +inline ::std::string* HDF5OutputParameter::mutable_file_name() { + set_has_file_name(); + // @@protoc_insertion_point(field_mutable:ditcaffe.HDF5OutputParameter.file_name) + return file_name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* HDF5OutputParameter::release_file_name() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.HDF5OutputParameter.file_name) +} + +// ------------------------------------------------------------------- + +// HingeLossParameter + +// optional .ditcaffe.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 ::ditcaffe::HingeLossParameter_Norm HingeLossParameter::norm() const { + // @@protoc_insertion_point(field_get:ditcaffe.HingeLossParameter.norm) + return static_cast< ::ditcaffe::HingeLossParameter_Norm >(norm_); +} +inline void HingeLossParameter::set_norm(::ditcaffe::HingeLossParameter_Norm value) { + assert(::ditcaffe::HingeLossParameter_Norm_IsValid(value)); + set_has_norm(); + norm_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.HingeLossParameter.norm) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.ImageDataParameter.source) +} +inline ::std::string* ImageDataParameter::mutable_source() { + set_has_source(); + // @@protoc_insertion_point(field_mutable:ditcaffe.ImageDataParameter.source) + return source_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* ImageDataParameter::release_source() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.ImageDataParameter.shuffle) + return shuffle_; +} +inline void ImageDataParameter::set_shuffle(bool value) { + set_has_shuffle(); + shuffle_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.ImageDataParameter.scale) + return scale_; +} +inline void ImageDataParameter::set_scale(float value) { + set_has_scale(); + scale_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.ImageDataParameter.mean_file) +} +inline ::std::string* ImageDataParameter::mutable_mean_file() { + set_has_mean_file(); + // @@protoc_insertion_point(field_mutable:ditcaffe.ImageDataParameter.mean_file) + return mean_file_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* ImageDataParameter::release_mean_file() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.ImageDataParameter.mirror) + return mirror_; +} +inline void ImageDataParameter::set_mirror(bool value) { + set_has_mirror(); + mirror_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.ImageDataParameter.root_folder) +} +inline ::std::string* ImageDataParameter::mutable_root_folder() { + set_has_root_folder(); + // @@protoc_insertion_point(field_mutable:ditcaffe.ImageDataParameter.root_folder) + return root_folder_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* ImageDataParameter::release_root_folder() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.ImageDataParameter.root_folder) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.InfogainLossParameter.source) +} +inline ::std::string* InfogainLossParameter::mutable_source() { + set_has_source(); + // @@protoc_insertion_point(field_mutable:ditcaffe.InfogainLossParameter.source) + return source_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* InfogainLossParameter::release_source() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.InfogainLossParameter.source) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.InnerProductParameter.bias_term) +} + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_weight_filler(); +} +inline const ::ditcaffe::FillerParameter& InnerProductParameter::weight_filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.InnerProductParameter.weight_filler) + return weight_filler_ != NULL ? *weight_filler_ : *default_instance_->weight_filler_; +} +inline ::ditcaffe::FillerParameter* InnerProductParameter::mutable_weight_filler() { + set_has_weight_filler(); + if (weight_filler_ == NULL) { + weight_filler_ = new ::ditcaffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.InnerProductParameter.weight_filler) + return weight_filler_; +} +inline ::ditcaffe::FillerParameter* InnerProductParameter::release_weight_filler() { + // @@protoc_insertion_point(field_release:ditcaffe.InnerProductParameter.weight_filler) + clear_has_weight_filler(); + ::ditcaffe::FillerParameter* temp = weight_filler_; + weight_filler_ = NULL; + return temp; +} +inline void InnerProductParameter::set_allocated_weight_filler(::ditcaffe::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:ditcaffe.InnerProductParameter.weight_filler) +} + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_bias_filler(); +} +inline const ::ditcaffe::FillerParameter& InnerProductParameter::bias_filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.InnerProductParameter.bias_filler) + return bias_filler_ != NULL ? *bias_filler_ : *default_instance_->bias_filler_; +} +inline ::ditcaffe::FillerParameter* InnerProductParameter::mutable_bias_filler() { + set_has_bias_filler(); + if (bias_filler_ == NULL) { + bias_filler_ = new ::ditcaffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.InnerProductParameter.bias_filler) + return bias_filler_; +} +inline ::ditcaffe::FillerParameter* InnerProductParameter::release_bias_filler() { + // @@protoc_insertion_point(field_release:ditcaffe.InnerProductParameter.bias_filler) + clear_has_bias_filler(); + ::ditcaffe::FillerParameter* temp = bias_filler_; + bias_filler_ = NULL; + return temp; +} +inline void InnerProductParameter::set_allocated_bias_filler(::ditcaffe::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:ditcaffe.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:ditcaffe.InnerProductParameter.axis) + return axis_; +} +inline void InnerProductParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.InnerProductParameter.transpose) + return transpose_; +} +inline void InnerProductParameter::set_transpose(bool value) { + set_has_transpose(); + transpose_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.InnerProductParameter.transpose) +} + +// ------------------------------------------------------------------- + +// InputParameter + +// repeated .ditcaffe.BlobShape shape = 1; +inline int InputParameter::shape_size() const { + return shape_.size(); +} +inline void InputParameter::clear_shape() { + shape_.Clear(); +} +inline const ::ditcaffe::BlobShape& InputParameter::shape(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.InputParameter.shape) + return shape_.Get(index); +} +inline ::ditcaffe::BlobShape* InputParameter::mutable_shape(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.InputParameter.shape) + return shape_.Mutable(index); +} +inline ::ditcaffe::BlobShape* InputParameter::add_shape() { + // @@protoc_insertion_point(field_add:ditcaffe.InputParameter.shape) + return shape_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobShape >* +InputParameter::mutable_shape() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.InputParameter.shape) + return &shape_; +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobShape >& +InputParameter::shape() const { + // @@protoc_insertion_point(field_list:ditcaffe.InputParameter.shape) + return shape_; +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.LogParameter.base) + return base_; +} +inline void LogParameter::set_base(float value) { + set_has_base(); + base_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.LogParameter.scale) + return scale_; +} +inline void LogParameter::set_scale(float value) { + set_has_scale(); + scale_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.LogParameter.shift) + return shift_; +} +inline void LogParameter::set_shift(float value) { + set_has_shift(); + shift_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.LogParameter.shift) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.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:ditcaffe.LRNParameter.alpha) + return alpha_; +} +inline void LRNParameter::set_alpha(float value) { + set_has_alpha(); + alpha_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.LRNParameter.beta) + return beta_; +} +inline void LRNParameter::set_beta(float value) { + set_has_beta(); + beta_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.LRNParameter.beta) +} + +// optional .ditcaffe.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 ::ditcaffe::LRNParameter_NormRegion LRNParameter::norm_region() const { + // @@protoc_insertion_point(field_get:ditcaffe.LRNParameter.norm_region) + return static_cast< ::ditcaffe::LRNParameter_NormRegion >(norm_region_); +} +inline void LRNParameter::set_norm_region(::ditcaffe::LRNParameter_NormRegion value) { + assert(::ditcaffe::LRNParameter_NormRegion_IsValid(value)); + set_has_norm_region(); + norm_region_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.LRNParameter.k) + return k_; +} +inline void LRNParameter::set_k(float value) { + set_has_k(); + k_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.LRNParameter.k) +} + +// optional .ditcaffe.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 ::ditcaffe::LRNParameter_Engine LRNParameter::engine() const { + // @@protoc_insertion_point(field_get:ditcaffe.LRNParameter.engine) + return static_cast< ::ditcaffe::LRNParameter_Engine >(engine_); +} +inline void LRNParameter::set_engine(::ditcaffe::LRNParameter_Engine value) { + assert(::ditcaffe::LRNParameter_Engine_IsValid(value)); + set_has_engine(); + engine_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.LRNParameter.engine) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.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:ditcaffe.MemoryDataParameter.channels) + return channels_; +} +inline void MemoryDataParameter::set_channels(::google::protobuf::uint32 value) { + set_has_channels(); + channels_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.MemoryDataParameter.height) + return height_; +} +inline void MemoryDataParameter::set_height(::google::protobuf::uint32 value) { + set_has_height(); + height_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.MemoryDataParameter.width) + return width_; +} +inline void MemoryDataParameter::set_width(::google::protobuf::uint32 value) { + set_has_width(); + width_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.MemoryDataParameter.width) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.MVNParameter.eps) + return eps_; +} +inline void MVNParameter::set_eps(float value) { + set_has_eps(); + eps_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.MVNParameter.eps) +} + +// ------------------------------------------------------------------- + +// ParameterParameter + +// optional .ditcaffe.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_->::ditcaffe::BlobShape::Clear(); + clear_has_shape(); +} +inline const ::ditcaffe::BlobShape& ParameterParameter::shape() const { + // @@protoc_insertion_point(field_get:ditcaffe.ParameterParameter.shape) + return shape_ != NULL ? *shape_ : *default_instance_->shape_; +} +inline ::ditcaffe::BlobShape* ParameterParameter::mutable_shape() { + set_has_shape(); + if (shape_ == NULL) { + shape_ = new ::ditcaffe::BlobShape; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.ParameterParameter.shape) + return shape_; +} +inline ::ditcaffe::BlobShape* ParameterParameter::release_shape() { + // @@protoc_insertion_point(field_release:ditcaffe.ParameterParameter.shape) + clear_has_shape(); + ::ditcaffe::BlobShape* temp = shape_; + shape_ = NULL; + return temp; +} +inline void ParameterParameter::set_allocated_shape(::ditcaffe::BlobShape* shape) { + delete shape_; + shape_ = shape; + if (shape) { + set_has_shape(); + } else { + clear_has_shape(); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.ParameterParameter.shape) +} + +// ------------------------------------------------------------------- + +// PoolingParameter + +// optional .ditcaffe.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 ::ditcaffe::PoolingParameter_PoolMethod PoolingParameter::pool() const { + // @@protoc_insertion_point(field_get:ditcaffe.PoolingParameter.pool) + return static_cast< ::ditcaffe::PoolingParameter_PoolMethod >(pool_); +} +inline void PoolingParameter::set_pool(::ditcaffe::PoolingParameter_PoolMethod value) { + assert(::ditcaffe::PoolingParameter_PoolMethod_IsValid(value)); + set_has_pool(); + pool_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.PoolingParameter.pad) + return pad_; +} +inline void PoolingParameter::set_pad(::google::protobuf::uint32 value) { + set_has_pad(); + pad_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.PoolingParameter.stride) + return stride_; +} +inline void PoolingParameter::set_stride(::google::protobuf::uint32 value) { + set_has_stride(); + stride_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.PoolingParameter.stride_w) +} + +// optional .ditcaffe.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 ::ditcaffe::PoolingParameter_Engine PoolingParameter::engine() const { + // @@protoc_insertion_point(field_get:ditcaffe.PoolingParameter.engine) + return static_cast< ::ditcaffe::PoolingParameter_Engine >(engine_); +} +inline void PoolingParameter::set_engine(::ditcaffe::PoolingParameter_Engine value) { + assert(::ditcaffe::PoolingParameter_Engine_IsValid(value)); + set_has_engine(); + engine_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.PoolingParameter.global_pooling) +} + +// optional bool torch_pooling = 40 [default = false]; +inline bool PoolingParameter::has_torch_pooling() const { + return (_has_bits_[0] & 0x00001000u) != 0; +} +inline void PoolingParameter::set_has_torch_pooling() { + _has_bits_[0] |= 0x00001000u; +} +inline void PoolingParameter::clear_has_torch_pooling() { + _has_bits_[0] &= ~0x00001000u; +} +inline void PoolingParameter::clear_torch_pooling() { + torch_pooling_ = false; + clear_has_torch_pooling(); +} +inline bool PoolingParameter::torch_pooling() const { + // @@protoc_insertion_point(field_get:ditcaffe.PoolingParameter.torch_pooling) + return torch_pooling_; +} +inline void PoolingParameter::set_torch_pooling(bool value) { + set_has_torch_pooling(); + torch_pooling_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.PoolingParameter.torch_pooling) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.PowerParameter.power) + return power_; +} +inline void PowerParameter::set_power(float value) { + set_has_power(); + power_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.PowerParameter.scale) + return scale_; +} +inline void PowerParameter::set_scale(float value) { + set_has_scale(); + scale_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.PowerParameter.shift) + return shift_; +} +inline void PowerParameter::set_shift(float value) { + set_has_shift(); + shift_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.PowerParameter.shift) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.PythonParameter.module) +} +inline ::std::string* PythonParameter::mutable_module() { + set_has_module(); + // @@protoc_insertion_point(field_mutable:ditcaffe.PythonParameter.module) + return module_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* PythonParameter::release_module() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.PythonParameter.layer) +} +inline ::std::string* PythonParameter::mutable_layer() { + set_has_layer(); + // @@protoc_insertion_point(field_mutable:ditcaffe.PythonParameter.layer) + return layer_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* PythonParameter::release_layer() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.PythonParameter.param_str) +} +inline ::std::string* PythonParameter::mutable_param_str() { + set_has_param_str(); + // @@protoc_insertion_point(field_mutable:ditcaffe.PythonParameter.param_str) + return param_str_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* PythonParameter::release_param_str() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.PythonParameter.share_in_parallel) +} + +// ------------------------------------------------------------------- + +// ReductionParameter + +// optional .ditcaffe.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 ::ditcaffe::ReductionParameter_ReductionOp ReductionParameter::operation() const { + // @@protoc_insertion_point(field_get:ditcaffe.ReductionParameter.operation) + return static_cast< ::ditcaffe::ReductionParameter_ReductionOp >(operation_); +} +inline void ReductionParameter::set_operation(::ditcaffe::ReductionParameter_ReductionOp value) { + assert(::ditcaffe::ReductionParameter_ReductionOp_IsValid(value)); + set_has_operation(); + operation_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.ReductionParameter.axis) + return axis_; +} +inline void ReductionParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.ReductionParameter.coeff) + return coeff_; +} +inline void ReductionParameter::set_coeff(float value) { + set_has_coeff(); + coeff_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.ReductionParameter.coeff) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.ReLUParameter.negative_slope) +} + +// optional .ditcaffe.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 ::ditcaffe::ReLUParameter_Engine ReLUParameter::engine() const { + // @@protoc_insertion_point(field_get:ditcaffe.ReLUParameter.engine) + return static_cast< ::ditcaffe::ReLUParameter_Engine >(engine_); +} +inline void ReLUParameter::set_engine(::ditcaffe::ReLUParameter_Engine value) { + assert(::ditcaffe::ReLUParameter_Engine_IsValid(value)); + set_has_engine(); + engine_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.ReLUParameter.engine) +} + +// ------------------------------------------------------------------- + +// ReshapeParameter + +// optional .ditcaffe.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_->::ditcaffe::BlobShape::Clear(); + clear_has_shape(); +} +inline const ::ditcaffe::BlobShape& ReshapeParameter::shape() const { + // @@protoc_insertion_point(field_get:ditcaffe.ReshapeParameter.shape) + return shape_ != NULL ? *shape_ : *default_instance_->shape_; +} +inline ::ditcaffe::BlobShape* ReshapeParameter::mutable_shape() { + set_has_shape(); + if (shape_ == NULL) { + shape_ = new ::ditcaffe::BlobShape; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.ReshapeParameter.shape) + return shape_; +} +inline ::ditcaffe::BlobShape* ReshapeParameter::release_shape() { + // @@protoc_insertion_point(field_release:ditcaffe.ReshapeParameter.shape) + clear_has_shape(); + ::ditcaffe::BlobShape* temp = shape_; + shape_ = NULL; + return temp; +} +inline void ReshapeParameter::set_allocated_shape(::ditcaffe::BlobShape* shape) { + delete shape_; + shape_ = shape; + if (shape) { + set_has_shape(); + } else { + clear_has_shape(); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.ReshapeParameter.axis) + return axis_; +} +inline void ReshapeParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.ReshapeParameter.num_axes) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.ScaleParameter.axis) + return axis_; +} +inline void ScaleParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.ScaleParameter.num_axes) +} + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_filler(); +} +inline const ::ditcaffe::FillerParameter& ScaleParameter::filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.ScaleParameter.filler) + return filler_ != NULL ? *filler_ : *default_instance_->filler_; +} +inline ::ditcaffe::FillerParameter* ScaleParameter::mutable_filler() { + set_has_filler(); + if (filler_ == NULL) { + filler_ = new ::ditcaffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.ScaleParameter.filler) + return filler_; +} +inline ::ditcaffe::FillerParameter* ScaleParameter::release_filler() { + // @@protoc_insertion_point(field_release:ditcaffe.ScaleParameter.filler) + clear_has_filler(); + ::ditcaffe::FillerParameter* temp = filler_; + filler_ = NULL; + return temp; +} +inline void ScaleParameter::set_allocated_filler(::ditcaffe::FillerParameter* filler) { + delete filler_; + filler_ = filler; + if (filler) { + set_has_filler(); + } else { + clear_has_filler(); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.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:ditcaffe.ScaleParameter.bias_term) +} + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_bias_filler(); +} +inline const ::ditcaffe::FillerParameter& ScaleParameter::bias_filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.ScaleParameter.bias_filler) + return bias_filler_ != NULL ? *bias_filler_ : *default_instance_->bias_filler_; +} +inline ::ditcaffe::FillerParameter* ScaleParameter::mutable_bias_filler() { + set_has_bias_filler(); + if (bias_filler_ == NULL) { + bias_filler_ = new ::ditcaffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.ScaleParameter.bias_filler) + return bias_filler_; +} +inline ::ditcaffe::FillerParameter* ScaleParameter::release_bias_filler() { + // @@protoc_insertion_point(field_release:ditcaffe.ScaleParameter.bias_filler) + clear_has_bias_filler(); + ::ditcaffe::FillerParameter* temp = bias_filler_; + bias_filler_ = NULL; + return temp; +} +inline void ScaleParameter::set_allocated_bias_filler(::ditcaffe::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:ditcaffe.ScaleParameter.bias_filler) +} + +// ------------------------------------------------------------------- + +// SigmoidParameter + +// optional .ditcaffe.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 ::ditcaffe::SigmoidParameter_Engine SigmoidParameter::engine() const { + // @@protoc_insertion_point(field_get:ditcaffe.SigmoidParameter.engine) + return static_cast< ::ditcaffe::SigmoidParameter_Engine >(engine_); +} +inline void SigmoidParameter::set_engine(::ditcaffe::SigmoidParameter_Engine value) { + assert(::ditcaffe::SigmoidParameter_Engine_IsValid(value)); + set_has_engine(); + engine_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.SigmoidParameter.engine) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.SliceParameter.axis) + return axis_; +} +inline void SliceParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.SliceParameter.slice_point) +} +inline void SliceParameter::add_slice_point(::google::protobuf::uint32 value) { + slice_point_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.SliceParameter.slice_point) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +SliceParameter::slice_point() const { + // @@protoc_insertion_point(field_list:ditcaffe.SliceParameter.slice_point) + return slice_point_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +SliceParameter::mutable_slice_point() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.SliceParameter.slice_dim) +} + +// ------------------------------------------------------------------- + +// SoftmaxParameter + +// optional .ditcaffe.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 ::ditcaffe::SoftmaxParameter_Engine SoftmaxParameter::engine() const { + // @@protoc_insertion_point(field_get:ditcaffe.SoftmaxParameter.engine) + return static_cast< ::ditcaffe::SoftmaxParameter_Engine >(engine_); +} +inline void SoftmaxParameter::set_engine(::ditcaffe::SoftmaxParameter_Engine value) { + assert(::ditcaffe::SoftmaxParameter_Engine_IsValid(value)); + set_has_engine(); + engine_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.SoftmaxParameter.axis) + return axis_; +} +inline void SoftmaxParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.SoftmaxParameter.axis) +} + +// ------------------------------------------------------------------- + +// TanHParameter + +// optional .ditcaffe.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 ::ditcaffe::TanHParameter_Engine TanHParameter::engine() const { + // @@protoc_insertion_point(field_get:ditcaffe.TanHParameter.engine) + return static_cast< ::ditcaffe::TanHParameter_Engine >(engine_); +} +inline void TanHParameter::set_engine(::ditcaffe::TanHParameter_Engine value) { + assert(::ditcaffe::TanHParameter_Engine_IsValid(value)); + set_has_engine(); + engine_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.TanHParameter.engine) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.TileParameter.axis) + return axis_; +} +inline void TileParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.TileParameter.tiles) + return tiles_; +} +inline void TileParameter::set_tiles(::google::protobuf::int32 value) { + set_has_tiles(); + tiles_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.TileParameter.tiles) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.ThresholdParameter.threshold) + return threshold_; +} +inline void ThresholdParameter::set_threshold(float value) { + set_has_threshold(); + threshold_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.ThresholdParameter.threshold) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.WindowDataParameter.source) +} +inline ::std::string* WindowDataParameter::mutable_source() { + set_has_source(); + // @@protoc_insertion_point(field_mutable:ditcaffe.WindowDataParameter.source) + return source_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* WindowDataParameter::release_source() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.WindowDataParameter.scale) + return scale_; +} +inline void WindowDataParameter::set_scale(float value) { + set_has_scale(); + scale_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.WindowDataParameter.mean_file) +} +inline ::std::string* WindowDataParameter::mutable_mean_file() { + set_has_mean_file(); + // @@protoc_insertion_point(field_mutable:ditcaffe.WindowDataParameter.mean_file) + return mean_file_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* WindowDataParameter::release_mean_file() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.WindowDataParameter.mirror) + return mirror_; +} +inline void WindowDataParameter::set_mirror(bool value) { + set_has_mirror(); + mirror_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.WindowDataParameter.crop_mode) +} +inline ::std::string* WindowDataParameter::mutable_crop_mode() { + set_has_crop_mode(); + // @@protoc_insertion_point(field_mutable:ditcaffe.WindowDataParameter.crop_mode) + return crop_mode_.MutableNoArena(_default_crop_mode_); +} +inline ::std::string* WindowDataParameter::release_crop_mode() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.WindowDataParameter.root_folder) +} +inline ::std::string* WindowDataParameter::mutable_root_folder() { + set_has_root_folder(); + // @@protoc_insertion_point(field_mutable:ditcaffe.WindowDataParameter.root_folder) + return root_folder_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* WindowDataParameter::release_root_folder() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.WindowDataParameter.root_folder) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.SPPParameter.pyramid_height) +} + +// optional .ditcaffe.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 ::ditcaffe::SPPParameter_PoolMethod SPPParameter::pool() const { + // @@protoc_insertion_point(field_get:ditcaffe.SPPParameter.pool) + return static_cast< ::ditcaffe::SPPParameter_PoolMethod >(pool_); +} +inline void SPPParameter::set_pool(::ditcaffe::SPPParameter_PoolMethod value) { + assert(::ditcaffe::SPPParameter_PoolMethod_IsValid(value)); + set_has_pool(); + pool_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.SPPParameter.pool) +} + +// optional .ditcaffe.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 ::ditcaffe::SPPParameter_Engine SPPParameter::engine() const { + // @@protoc_insertion_point(field_get:ditcaffe.SPPParameter.engine) + return static_cast< ::ditcaffe::SPPParameter_Engine >(engine_); +} +inline void SPPParameter::set_engine(::ditcaffe::SPPParameter_Engine value) { + assert(::ditcaffe::SPPParameter_Engine_IsValid(value)); + set_has_engine(); + engine_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.SPPParameter.engine) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.V1LayerParameter.bottom) + return bottom_.Get(index); +} +inline ::std::string* V1LayerParameter::mutable_bottom(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.bottom) + return bottom_.Mutable(index); +} +inline void V1LayerParameter::set_bottom(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.V1LayerParameter.bottom) +} +inline ::std::string* V1LayerParameter::add_bottom() { + // @@protoc_insertion_point(field_add_mutable:ditcaffe.V1LayerParameter.bottom) + return bottom_.Add(); +} +inline void V1LayerParameter::add_bottom(const ::std::string& value) { + bottom_.Add()->assign(value); + // @@protoc_insertion_point(field_add:ditcaffe.V1LayerParameter.bottom) +} +inline void V1LayerParameter::add_bottom(const char* value) { + bottom_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:ditcaffe.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:ditcaffe.V1LayerParameter.bottom) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +V1LayerParameter::bottom() const { + // @@protoc_insertion_point(field_list:ditcaffe.V1LayerParameter.bottom) + return bottom_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +V1LayerParameter::mutable_bottom() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.V1LayerParameter.top) + return top_.Get(index); +} +inline ::std::string* V1LayerParameter::mutable_top(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.top) + return top_.Mutable(index); +} +inline void V1LayerParameter::set_top(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.V1LayerParameter.top) +} +inline ::std::string* V1LayerParameter::add_top() { + // @@protoc_insertion_point(field_add_mutable:ditcaffe.V1LayerParameter.top) + return top_.Add(); +} +inline void V1LayerParameter::add_top(const ::std::string& value) { + top_.Add()->assign(value); + // @@protoc_insertion_point(field_add:ditcaffe.V1LayerParameter.top) +} +inline void V1LayerParameter::add_top(const char* value) { + top_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:ditcaffe.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:ditcaffe.V1LayerParameter.top) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +V1LayerParameter::top() const { + // @@protoc_insertion_point(field_list:ditcaffe.V1LayerParameter.top) + return top_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +V1LayerParameter::mutable_top() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.V1LayerParameter.name) +} +inline ::std::string* V1LayerParameter::mutable_name() { + set_has_name(); + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.name) + return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* V1LayerParameter::release_name() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.V1LayerParameter.name) +} + +// repeated .ditcaffe.NetStateRule include = 32; +inline int V1LayerParameter::include_size() const { + return include_.size(); +} +inline void V1LayerParameter::clear_include() { + include_.Clear(); +} +inline const ::ditcaffe::NetStateRule& V1LayerParameter::include(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.include) + return include_.Get(index); +} +inline ::ditcaffe::NetStateRule* V1LayerParameter::mutable_include(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.include) + return include_.Mutable(index); +} +inline ::ditcaffe::NetStateRule* V1LayerParameter::add_include() { + // @@protoc_insertion_point(field_add:ditcaffe.V1LayerParameter.include) + return include_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >* +V1LayerParameter::mutable_include() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.V1LayerParameter.include) + return &include_; +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >& +V1LayerParameter::include() const { + // @@protoc_insertion_point(field_list:ditcaffe.V1LayerParameter.include) + return include_; +} + +// repeated .ditcaffe.NetStateRule exclude = 33; +inline int V1LayerParameter::exclude_size() const { + return exclude_.size(); +} +inline void V1LayerParameter::clear_exclude() { + exclude_.Clear(); +} +inline const ::ditcaffe::NetStateRule& V1LayerParameter::exclude(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.exclude) + return exclude_.Get(index); +} +inline ::ditcaffe::NetStateRule* V1LayerParameter::mutable_exclude(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.exclude) + return exclude_.Mutable(index); +} +inline ::ditcaffe::NetStateRule* V1LayerParameter::add_exclude() { + // @@protoc_insertion_point(field_add:ditcaffe.V1LayerParameter.exclude) + return exclude_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >* +V1LayerParameter::mutable_exclude() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.V1LayerParameter.exclude) + return &exclude_; +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >& +V1LayerParameter::exclude() const { + // @@protoc_insertion_point(field_list:ditcaffe.V1LayerParameter.exclude) + return exclude_; +} + +// optional .ditcaffe.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 ::ditcaffe::V1LayerParameter_LayerType V1LayerParameter::type() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.type) + return static_cast< ::ditcaffe::V1LayerParameter_LayerType >(type_); +} +inline void V1LayerParameter::set_type(::ditcaffe::V1LayerParameter_LayerType value) { + assert(::ditcaffe::V1LayerParameter_LayerType_IsValid(value)); + set_has_type(); + type_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.V1LayerParameter.type) +} + +// repeated .ditcaffe.BlobProto blobs = 6; +inline int V1LayerParameter::blobs_size() const { + return blobs_.size(); +} +inline void V1LayerParameter::clear_blobs() { + blobs_.Clear(); +} +inline const ::ditcaffe::BlobProto& V1LayerParameter::blobs(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.blobs) + return blobs_.Get(index); +} +inline ::ditcaffe::BlobProto* V1LayerParameter::mutable_blobs(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.blobs) + return blobs_.Mutable(index); +} +inline ::ditcaffe::BlobProto* V1LayerParameter::add_blobs() { + // @@protoc_insertion_point(field_add:ditcaffe.V1LayerParameter.blobs) + return blobs_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >* +V1LayerParameter::mutable_blobs() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.V1LayerParameter.blobs) + return &blobs_; +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >& +V1LayerParameter::blobs() const { + // @@protoc_insertion_point(field_list:ditcaffe.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:ditcaffe.V1LayerParameter.param) + return param_.Get(index); +} +inline ::std::string* V1LayerParameter::mutable_param(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.param) + return param_.Mutable(index); +} +inline void V1LayerParameter::set_param(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.V1LayerParameter.param) +} +inline ::std::string* V1LayerParameter::add_param() { + // @@protoc_insertion_point(field_add_mutable:ditcaffe.V1LayerParameter.param) + return param_.Add(); +} +inline void V1LayerParameter::add_param(const ::std::string& value) { + param_.Add()->assign(value); + // @@protoc_insertion_point(field_add:ditcaffe.V1LayerParameter.param) +} +inline void V1LayerParameter::add_param(const char* value) { + param_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:ditcaffe.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:ditcaffe.V1LayerParameter.param) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +V1LayerParameter::param() const { + // @@protoc_insertion_point(field_list:ditcaffe.V1LayerParameter.param) + return param_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +V1LayerParameter::mutable_param() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.V1LayerParameter.param) + return ¶m_; +} + +// repeated .ditcaffe.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 ::ditcaffe::V1LayerParameter_DimCheckMode V1LayerParameter::blob_share_mode(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.blob_share_mode) + return static_cast< ::ditcaffe::V1LayerParameter_DimCheckMode >(blob_share_mode_.Get(index)); +} +inline void V1LayerParameter::set_blob_share_mode(int index, ::ditcaffe::V1LayerParameter_DimCheckMode value) { + assert(::ditcaffe::V1LayerParameter_DimCheckMode_IsValid(value)); + blob_share_mode_.Set(index, value); + // @@protoc_insertion_point(field_set:ditcaffe.V1LayerParameter.blob_share_mode) +} +inline void V1LayerParameter::add_blob_share_mode(::ditcaffe::V1LayerParameter_DimCheckMode value) { + assert(::ditcaffe::V1LayerParameter_DimCheckMode_IsValid(value)); + blob_share_mode_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.V1LayerParameter.blob_share_mode) +} +inline const ::google::protobuf::RepeatedField& +V1LayerParameter::blob_share_mode() const { + // @@protoc_insertion_point(field_list:ditcaffe.V1LayerParameter.blob_share_mode) + return blob_share_mode_; +} +inline ::google::protobuf::RepeatedField* +V1LayerParameter::mutable_blob_share_mode() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.V1LayerParameter.blobs_lr) +} +inline void V1LayerParameter::add_blobs_lr(float value) { + blobs_lr_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.V1LayerParameter.blobs_lr) +} +inline const ::google::protobuf::RepeatedField< float >& +V1LayerParameter::blobs_lr() const { + // @@protoc_insertion_point(field_list:ditcaffe.V1LayerParameter.blobs_lr) + return blobs_lr_; +} +inline ::google::protobuf::RepeatedField< float >* +V1LayerParameter::mutable_blobs_lr() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.V1LayerParameter.weight_decay) +} +inline void V1LayerParameter::add_weight_decay(float value) { + weight_decay_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.V1LayerParameter.weight_decay) +} +inline const ::google::protobuf::RepeatedField< float >& +V1LayerParameter::weight_decay() const { + // @@protoc_insertion_point(field_list:ditcaffe.V1LayerParameter.weight_decay) + return weight_decay_; +} +inline ::google::protobuf::RepeatedField< float >* +V1LayerParameter::mutable_weight_decay() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.V1LayerParameter.loss_weight) +} +inline void V1LayerParameter::add_loss_weight(float value) { + loss_weight_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.V1LayerParameter.loss_weight) +} +inline const ::google::protobuf::RepeatedField< float >& +V1LayerParameter::loss_weight() const { + // @@protoc_insertion_point(field_list:ditcaffe.V1LayerParameter.loss_weight) + return loss_weight_; +} +inline ::google::protobuf::RepeatedField< float >* +V1LayerParameter::mutable_loss_weight() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.V1LayerParameter.loss_weight) + return &loss_weight_; +} + +// optional .ditcaffe.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_->::ditcaffe::AccuracyParameter::Clear(); + clear_has_accuracy_param(); +} +inline const ::ditcaffe::AccuracyParameter& V1LayerParameter::accuracy_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.accuracy_param) + return accuracy_param_ != NULL ? *accuracy_param_ : *default_instance_->accuracy_param_; +} +inline ::ditcaffe::AccuracyParameter* V1LayerParameter::mutable_accuracy_param() { + set_has_accuracy_param(); + if (accuracy_param_ == NULL) { + accuracy_param_ = new ::ditcaffe::AccuracyParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.accuracy_param) + return accuracy_param_; +} +inline ::ditcaffe::AccuracyParameter* V1LayerParameter::release_accuracy_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.accuracy_param) + clear_has_accuracy_param(); + ::ditcaffe::AccuracyParameter* temp = accuracy_param_; + accuracy_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_accuracy_param(::ditcaffe::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:ditcaffe.V1LayerParameter.accuracy_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ArgMaxParameter::Clear(); + clear_has_argmax_param(); +} +inline const ::ditcaffe::ArgMaxParameter& V1LayerParameter::argmax_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.argmax_param) + return argmax_param_ != NULL ? *argmax_param_ : *default_instance_->argmax_param_; +} +inline ::ditcaffe::ArgMaxParameter* V1LayerParameter::mutable_argmax_param() { + set_has_argmax_param(); + if (argmax_param_ == NULL) { + argmax_param_ = new ::ditcaffe::ArgMaxParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.argmax_param) + return argmax_param_; +} +inline ::ditcaffe::ArgMaxParameter* V1LayerParameter::release_argmax_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.argmax_param) + clear_has_argmax_param(); + ::ditcaffe::ArgMaxParameter* temp = argmax_param_; + argmax_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_argmax_param(::ditcaffe::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:ditcaffe.V1LayerParameter.argmax_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ConcatParameter::Clear(); + clear_has_concat_param(); +} +inline const ::ditcaffe::ConcatParameter& V1LayerParameter::concat_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.concat_param) + return concat_param_ != NULL ? *concat_param_ : *default_instance_->concat_param_; +} +inline ::ditcaffe::ConcatParameter* V1LayerParameter::mutable_concat_param() { + set_has_concat_param(); + if (concat_param_ == NULL) { + concat_param_ = new ::ditcaffe::ConcatParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.concat_param) + return concat_param_; +} +inline ::ditcaffe::ConcatParameter* V1LayerParameter::release_concat_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.concat_param) + clear_has_concat_param(); + ::ditcaffe::ConcatParameter* temp = concat_param_; + concat_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_concat_param(::ditcaffe::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:ditcaffe.V1LayerParameter.concat_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ContrastiveLossParameter::Clear(); + clear_has_contrastive_loss_param(); +} +inline const ::ditcaffe::ContrastiveLossParameter& V1LayerParameter::contrastive_loss_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.contrastive_loss_param) + return contrastive_loss_param_ != NULL ? *contrastive_loss_param_ : *default_instance_->contrastive_loss_param_; +} +inline ::ditcaffe::ContrastiveLossParameter* V1LayerParameter::mutable_contrastive_loss_param() { + set_has_contrastive_loss_param(); + if (contrastive_loss_param_ == NULL) { + contrastive_loss_param_ = new ::ditcaffe::ContrastiveLossParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.contrastive_loss_param) + return contrastive_loss_param_; +} +inline ::ditcaffe::ContrastiveLossParameter* V1LayerParameter::release_contrastive_loss_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.contrastive_loss_param) + clear_has_contrastive_loss_param(); + ::ditcaffe::ContrastiveLossParameter* temp = contrastive_loss_param_; + contrastive_loss_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_contrastive_loss_param(::ditcaffe::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:ditcaffe.V1LayerParameter.contrastive_loss_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ConvolutionParameter::Clear(); + clear_has_convolution_param(); +} +inline const ::ditcaffe::ConvolutionParameter& V1LayerParameter::convolution_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.convolution_param) + return convolution_param_ != NULL ? *convolution_param_ : *default_instance_->convolution_param_; +} +inline ::ditcaffe::ConvolutionParameter* V1LayerParameter::mutable_convolution_param() { + set_has_convolution_param(); + if (convolution_param_ == NULL) { + convolution_param_ = new ::ditcaffe::ConvolutionParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.convolution_param) + return convolution_param_; +} +inline ::ditcaffe::ConvolutionParameter* V1LayerParameter::release_convolution_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.convolution_param) + clear_has_convolution_param(); + ::ditcaffe::ConvolutionParameter* temp = convolution_param_; + convolution_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_convolution_param(::ditcaffe::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:ditcaffe.V1LayerParameter.convolution_param) +} + +// optional .ditcaffe.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_->::ditcaffe::DataParameter::Clear(); + clear_has_data_param(); +} +inline const ::ditcaffe::DataParameter& V1LayerParameter::data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.data_param) + return data_param_ != NULL ? *data_param_ : *default_instance_->data_param_; +} +inline ::ditcaffe::DataParameter* V1LayerParameter::mutable_data_param() { + set_has_data_param(); + if (data_param_ == NULL) { + data_param_ = new ::ditcaffe::DataParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.data_param) + return data_param_; +} +inline ::ditcaffe::DataParameter* V1LayerParameter::release_data_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.data_param) + clear_has_data_param(); + ::ditcaffe::DataParameter* temp = data_param_; + data_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_data_param(::ditcaffe::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:ditcaffe.V1LayerParameter.data_param) +} + +// optional .ditcaffe.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_->::ditcaffe::DropoutParameter::Clear(); + clear_has_dropout_param(); +} +inline const ::ditcaffe::DropoutParameter& V1LayerParameter::dropout_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.dropout_param) + return dropout_param_ != NULL ? *dropout_param_ : *default_instance_->dropout_param_; +} +inline ::ditcaffe::DropoutParameter* V1LayerParameter::mutable_dropout_param() { + set_has_dropout_param(); + if (dropout_param_ == NULL) { + dropout_param_ = new ::ditcaffe::DropoutParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.dropout_param) + return dropout_param_; +} +inline ::ditcaffe::DropoutParameter* V1LayerParameter::release_dropout_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.dropout_param) + clear_has_dropout_param(); + ::ditcaffe::DropoutParameter* temp = dropout_param_; + dropout_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_dropout_param(::ditcaffe::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:ditcaffe.V1LayerParameter.dropout_param) +} + +// optional .ditcaffe.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_->::ditcaffe::DummyDataParameter::Clear(); + clear_has_dummy_data_param(); +} +inline const ::ditcaffe::DummyDataParameter& V1LayerParameter::dummy_data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.dummy_data_param) + return dummy_data_param_ != NULL ? *dummy_data_param_ : *default_instance_->dummy_data_param_; +} +inline ::ditcaffe::DummyDataParameter* V1LayerParameter::mutable_dummy_data_param() { + set_has_dummy_data_param(); + if (dummy_data_param_ == NULL) { + dummy_data_param_ = new ::ditcaffe::DummyDataParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.dummy_data_param) + return dummy_data_param_; +} +inline ::ditcaffe::DummyDataParameter* V1LayerParameter::release_dummy_data_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.dummy_data_param) + clear_has_dummy_data_param(); + ::ditcaffe::DummyDataParameter* temp = dummy_data_param_; + dummy_data_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_dummy_data_param(::ditcaffe::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:ditcaffe.V1LayerParameter.dummy_data_param) +} + +// optional .ditcaffe.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_->::ditcaffe::EltwiseParameter::Clear(); + clear_has_eltwise_param(); +} +inline const ::ditcaffe::EltwiseParameter& V1LayerParameter::eltwise_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.eltwise_param) + return eltwise_param_ != NULL ? *eltwise_param_ : *default_instance_->eltwise_param_; +} +inline ::ditcaffe::EltwiseParameter* V1LayerParameter::mutable_eltwise_param() { + set_has_eltwise_param(); + if (eltwise_param_ == NULL) { + eltwise_param_ = new ::ditcaffe::EltwiseParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.eltwise_param) + return eltwise_param_; +} +inline ::ditcaffe::EltwiseParameter* V1LayerParameter::release_eltwise_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.eltwise_param) + clear_has_eltwise_param(); + ::ditcaffe::EltwiseParameter* temp = eltwise_param_; + eltwise_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_eltwise_param(::ditcaffe::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:ditcaffe.V1LayerParameter.eltwise_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ExpParameter::Clear(); + clear_has_exp_param(); +} +inline const ::ditcaffe::ExpParameter& V1LayerParameter::exp_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.exp_param) + return exp_param_ != NULL ? *exp_param_ : *default_instance_->exp_param_; +} +inline ::ditcaffe::ExpParameter* V1LayerParameter::mutable_exp_param() { + set_has_exp_param(); + if (exp_param_ == NULL) { + exp_param_ = new ::ditcaffe::ExpParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.exp_param) + return exp_param_; +} +inline ::ditcaffe::ExpParameter* V1LayerParameter::release_exp_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.exp_param) + clear_has_exp_param(); + ::ditcaffe::ExpParameter* temp = exp_param_; + exp_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_exp_param(::ditcaffe::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:ditcaffe.V1LayerParameter.exp_param) +} + +// optional .ditcaffe.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_->::ditcaffe::HDF5DataParameter::Clear(); + clear_has_hdf5_data_param(); +} +inline const ::ditcaffe::HDF5DataParameter& V1LayerParameter::hdf5_data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.hdf5_data_param) + return hdf5_data_param_ != NULL ? *hdf5_data_param_ : *default_instance_->hdf5_data_param_; +} +inline ::ditcaffe::HDF5DataParameter* V1LayerParameter::mutable_hdf5_data_param() { + set_has_hdf5_data_param(); + if (hdf5_data_param_ == NULL) { + hdf5_data_param_ = new ::ditcaffe::HDF5DataParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.hdf5_data_param) + return hdf5_data_param_; +} +inline ::ditcaffe::HDF5DataParameter* V1LayerParameter::release_hdf5_data_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.hdf5_data_param) + clear_has_hdf5_data_param(); + ::ditcaffe::HDF5DataParameter* temp = hdf5_data_param_; + hdf5_data_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_hdf5_data_param(::ditcaffe::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:ditcaffe.V1LayerParameter.hdf5_data_param) +} + +// optional .ditcaffe.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_->::ditcaffe::HDF5OutputParameter::Clear(); + clear_has_hdf5_output_param(); +} +inline const ::ditcaffe::HDF5OutputParameter& V1LayerParameter::hdf5_output_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.hdf5_output_param) + return hdf5_output_param_ != NULL ? *hdf5_output_param_ : *default_instance_->hdf5_output_param_; +} +inline ::ditcaffe::HDF5OutputParameter* V1LayerParameter::mutable_hdf5_output_param() { + set_has_hdf5_output_param(); + if (hdf5_output_param_ == NULL) { + hdf5_output_param_ = new ::ditcaffe::HDF5OutputParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.hdf5_output_param) + return hdf5_output_param_; +} +inline ::ditcaffe::HDF5OutputParameter* V1LayerParameter::release_hdf5_output_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.hdf5_output_param) + clear_has_hdf5_output_param(); + ::ditcaffe::HDF5OutputParameter* temp = hdf5_output_param_; + hdf5_output_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_hdf5_output_param(::ditcaffe::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:ditcaffe.V1LayerParameter.hdf5_output_param) +} + +// optional .ditcaffe.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_->::ditcaffe::HingeLossParameter::Clear(); + clear_has_hinge_loss_param(); +} +inline const ::ditcaffe::HingeLossParameter& V1LayerParameter::hinge_loss_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.hinge_loss_param) + return hinge_loss_param_ != NULL ? *hinge_loss_param_ : *default_instance_->hinge_loss_param_; +} +inline ::ditcaffe::HingeLossParameter* V1LayerParameter::mutable_hinge_loss_param() { + set_has_hinge_loss_param(); + if (hinge_loss_param_ == NULL) { + hinge_loss_param_ = new ::ditcaffe::HingeLossParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.hinge_loss_param) + return hinge_loss_param_; +} +inline ::ditcaffe::HingeLossParameter* V1LayerParameter::release_hinge_loss_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.hinge_loss_param) + clear_has_hinge_loss_param(); + ::ditcaffe::HingeLossParameter* temp = hinge_loss_param_; + hinge_loss_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_hinge_loss_param(::ditcaffe::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:ditcaffe.V1LayerParameter.hinge_loss_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ImageDataParameter::Clear(); + clear_has_image_data_param(); +} +inline const ::ditcaffe::ImageDataParameter& V1LayerParameter::image_data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.image_data_param) + return image_data_param_ != NULL ? *image_data_param_ : *default_instance_->image_data_param_; +} +inline ::ditcaffe::ImageDataParameter* V1LayerParameter::mutable_image_data_param() { + set_has_image_data_param(); + if (image_data_param_ == NULL) { + image_data_param_ = new ::ditcaffe::ImageDataParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.image_data_param) + return image_data_param_; +} +inline ::ditcaffe::ImageDataParameter* V1LayerParameter::release_image_data_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.image_data_param) + clear_has_image_data_param(); + ::ditcaffe::ImageDataParameter* temp = image_data_param_; + image_data_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_image_data_param(::ditcaffe::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:ditcaffe.V1LayerParameter.image_data_param) +} + +// optional .ditcaffe.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_->::ditcaffe::InfogainLossParameter::Clear(); + clear_has_infogain_loss_param(); +} +inline const ::ditcaffe::InfogainLossParameter& V1LayerParameter::infogain_loss_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.infogain_loss_param) + return infogain_loss_param_ != NULL ? *infogain_loss_param_ : *default_instance_->infogain_loss_param_; +} +inline ::ditcaffe::InfogainLossParameter* V1LayerParameter::mutable_infogain_loss_param() { + set_has_infogain_loss_param(); + if (infogain_loss_param_ == NULL) { + infogain_loss_param_ = new ::ditcaffe::InfogainLossParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.infogain_loss_param) + return infogain_loss_param_; +} +inline ::ditcaffe::InfogainLossParameter* V1LayerParameter::release_infogain_loss_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.infogain_loss_param) + clear_has_infogain_loss_param(); + ::ditcaffe::InfogainLossParameter* temp = infogain_loss_param_; + infogain_loss_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_infogain_loss_param(::ditcaffe::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:ditcaffe.V1LayerParameter.infogain_loss_param) +} + +// optional .ditcaffe.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_->::ditcaffe::InnerProductParameter::Clear(); + clear_has_inner_product_param(); +} +inline const ::ditcaffe::InnerProductParameter& V1LayerParameter::inner_product_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.inner_product_param) + return inner_product_param_ != NULL ? *inner_product_param_ : *default_instance_->inner_product_param_; +} +inline ::ditcaffe::InnerProductParameter* V1LayerParameter::mutable_inner_product_param() { + set_has_inner_product_param(); + if (inner_product_param_ == NULL) { + inner_product_param_ = new ::ditcaffe::InnerProductParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.inner_product_param) + return inner_product_param_; +} +inline ::ditcaffe::InnerProductParameter* V1LayerParameter::release_inner_product_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.inner_product_param) + clear_has_inner_product_param(); + ::ditcaffe::InnerProductParameter* temp = inner_product_param_; + inner_product_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_inner_product_param(::ditcaffe::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:ditcaffe.V1LayerParameter.inner_product_param) +} + +// optional .ditcaffe.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_->::ditcaffe::LRNParameter::Clear(); + clear_has_lrn_param(); +} +inline const ::ditcaffe::LRNParameter& V1LayerParameter::lrn_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.lrn_param) + return lrn_param_ != NULL ? *lrn_param_ : *default_instance_->lrn_param_; +} +inline ::ditcaffe::LRNParameter* V1LayerParameter::mutable_lrn_param() { + set_has_lrn_param(); + if (lrn_param_ == NULL) { + lrn_param_ = new ::ditcaffe::LRNParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.lrn_param) + return lrn_param_; +} +inline ::ditcaffe::LRNParameter* V1LayerParameter::release_lrn_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.lrn_param) + clear_has_lrn_param(); + ::ditcaffe::LRNParameter* temp = lrn_param_; + lrn_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_lrn_param(::ditcaffe::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:ditcaffe.V1LayerParameter.lrn_param) +} + +// optional .ditcaffe.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_->::ditcaffe::MemoryDataParameter::Clear(); + clear_has_memory_data_param(); +} +inline const ::ditcaffe::MemoryDataParameter& V1LayerParameter::memory_data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.memory_data_param) + return memory_data_param_ != NULL ? *memory_data_param_ : *default_instance_->memory_data_param_; +} +inline ::ditcaffe::MemoryDataParameter* V1LayerParameter::mutable_memory_data_param() { + set_has_memory_data_param(); + if (memory_data_param_ == NULL) { + memory_data_param_ = new ::ditcaffe::MemoryDataParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.memory_data_param) + return memory_data_param_; +} +inline ::ditcaffe::MemoryDataParameter* V1LayerParameter::release_memory_data_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.memory_data_param) + clear_has_memory_data_param(); + ::ditcaffe::MemoryDataParameter* temp = memory_data_param_; + memory_data_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_memory_data_param(::ditcaffe::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:ditcaffe.V1LayerParameter.memory_data_param) +} + +// optional .ditcaffe.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_->::ditcaffe::MVNParameter::Clear(); + clear_has_mvn_param(); +} +inline const ::ditcaffe::MVNParameter& V1LayerParameter::mvn_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.mvn_param) + return mvn_param_ != NULL ? *mvn_param_ : *default_instance_->mvn_param_; +} +inline ::ditcaffe::MVNParameter* V1LayerParameter::mutable_mvn_param() { + set_has_mvn_param(); + if (mvn_param_ == NULL) { + mvn_param_ = new ::ditcaffe::MVNParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.mvn_param) + return mvn_param_; +} +inline ::ditcaffe::MVNParameter* V1LayerParameter::release_mvn_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.mvn_param) + clear_has_mvn_param(); + ::ditcaffe::MVNParameter* temp = mvn_param_; + mvn_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_mvn_param(::ditcaffe::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:ditcaffe.V1LayerParameter.mvn_param) +} + +// optional .ditcaffe.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_->::ditcaffe::PoolingParameter::Clear(); + clear_has_pooling_param(); +} +inline const ::ditcaffe::PoolingParameter& V1LayerParameter::pooling_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.pooling_param) + return pooling_param_ != NULL ? *pooling_param_ : *default_instance_->pooling_param_; +} +inline ::ditcaffe::PoolingParameter* V1LayerParameter::mutable_pooling_param() { + set_has_pooling_param(); + if (pooling_param_ == NULL) { + pooling_param_ = new ::ditcaffe::PoolingParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.pooling_param) + return pooling_param_; +} +inline ::ditcaffe::PoolingParameter* V1LayerParameter::release_pooling_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.pooling_param) + clear_has_pooling_param(); + ::ditcaffe::PoolingParameter* temp = pooling_param_; + pooling_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_pooling_param(::ditcaffe::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:ditcaffe.V1LayerParameter.pooling_param) +} + +// optional .ditcaffe.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_->::ditcaffe::PowerParameter::Clear(); + clear_has_power_param(); +} +inline const ::ditcaffe::PowerParameter& V1LayerParameter::power_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.power_param) + return power_param_ != NULL ? *power_param_ : *default_instance_->power_param_; +} +inline ::ditcaffe::PowerParameter* V1LayerParameter::mutable_power_param() { + set_has_power_param(); + if (power_param_ == NULL) { + power_param_ = new ::ditcaffe::PowerParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.power_param) + return power_param_; +} +inline ::ditcaffe::PowerParameter* V1LayerParameter::release_power_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.power_param) + clear_has_power_param(); + ::ditcaffe::PowerParameter* temp = power_param_; + power_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_power_param(::ditcaffe::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:ditcaffe.V1LayerParameter.power_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ReLUParameter::Clear(); + clear_has_relu_param(); +} +inline const ::ditcaffe::ReLUParameter& V1LayerParameter::relu_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.relu_param) + return relu_param_ != NULL ? *relu_param_ : *default_instance_->relu_param_; +} +inline ::ditcaffe::ReLUParameter* V1LayerParameter::mutable_relu_param() { + set_has_relu_param(); + if (relu_param_ == NULL) { + relu_param_ = new ::ditcaffe::ReLUParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.relu_param) + return relu_param_; +} +inline ::ditcaffe::ReLUParameter* V1LayerParameter::release_relu_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.relu_param) + clear_has_relu_param(); + ::ditcaffe::ReLUParameter* temp = relu_param_; + relu_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_relu_param(::ditcaffe::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:ditcaffe.V1LayerParameter.relu_param) +} + +// optional .ditcaffe.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_->::ditcaffe::SigmoidParameter::Clear(); + clear_has_sigmoid_param(); +} +inline const ::ditcaffe::SigmoidParameter& V1LayerParameter::sigmoid_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.sigmoid_param) + return sigmoid_param_ != NULL ? *sigmoid_param_ : *default_instance_->sigmoid_param_; +} +inline ::ditcaffe::SigmoidParameter* V1LayerParameter::mutable_sigmoid_param() { + set_has_sigmoid_param(); + if (sigmoid_param_ == NULL) { + sigmoid_param_ = new ::ditcaffe::SigmoidParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.sigmoid_param) + return sigmoid_param_; +} +inline ::ditcaffe::SigmoidParameter* V1LayerParameter::release_sigmoid_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.sigmoid_param) + clear_has_sigmoid_param(); + ::ditcaffe::SigmoidParameter* temp = sigmoid_param_; + sigmoid_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_sigmoid_param(::ditcaffe::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:ditcaffe.V1LayerParameter.sigmoid_param) +} + +// optional .ditcaffe.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_->::ditcaffe::SoftmaxParameter::Clear(); + clear_has_softmax_param(); +} +inline const ::ditcaffe::SoftmaxParameter& V1LayerParameter::softmax_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.softmax_param) + return softmax_param_ != NULL ? *softmax_param_ : *default_instance_->softmax_param_; +} +inline ::ditcaffe::SoftmaxParameter* V1LayerParameter::mutable_softmax_param() { + set_has_softmax_param(); + if (softmax_param_ == NULL) { + softmax_param_ = new ::ditcaffe::SoftmaxParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.softmax_param) + return softmax_param_; +} +inline ::ditcaffe::SoftmaxParameter* V1LayerParameter::release_softmax_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.softmax_param) + clear_has_softmax_param(); + ::ditcaffe::SoftmaxParameter* temp = softmax_param_; + softmax_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_softmax_param(::ditcaffe::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:ditcaffe.V1LayerParameter.softmax_param) +} + +// optional .ditcaffe.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_->::ditcaffe::SliceParameter::Clear(); + clear_has_slice_param(); +} +inline const ::ditcaffe::SliceParameter& V1LayerParameter::slice_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.slice_param) + return slice_param_ != NULL ? *slice_param_ : *default_instance_->slice_param_; +} +inline ::ditcaffe::SliceParameter* V1LayerParameter::mutable_slice_param() { + set_has_slice_param(); + if (slice_param_ == NULL) { + slice_param_ = new ::ditcaffe::SliceParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.slice_param) + return slice_param_; +} +inline ::ditcaffe::SliceParameter* V1LayerParameter::release_slice_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.slice_param) + clear_has_slice_param(); + ::ditcaffe::SliceParameter* temp = slice_param_; + slice_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_slice_param(::ditcaffe::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:ditcaffe.V1LayerParameter.slice_param) +} + +// optional .ditcaffe.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_->::ditcaffe::TanHParameter::Clear(); + clear_has_tanh_param(); +} +inline const ::ditcaffe::TanHParameter& V1LayerParameter::tanh_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.tanh_param) + return tanh_param_ != NULL ? *tanh_param_ : *default_instance_->tanh_param_; +} +inline ::ditcaffe::TanHParameter* V1LayerParameter::mutable_tanh_param() { + set_has_tanh_param(); + if (tanh_param_ == NULL) { + tanh_param_ = new ::ditcaffe::TanHParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.tanh_param) + return tanh_param_; +} +inline ::ditcaffe::TanHParameter* V1LayerParameter::release_tanh_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.tanh_param) + clear_has_tanh_param(); + ::ditcaffe::TanHParameter* temp = tanh_param_; + tanh_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_tanh_param(::ditcaffe::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:ditcaffe.V1LayerParameter.tanh_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ThresholdParameter::Clear(); + clear_has_threshold_param(); +} +inline const ::ditcaffe::ThresholdParameter& V1LayerParameter::threshold_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.threshold_param) + return threshold_param_ != NULL ? *threshold_param_ : *default_instance_->threshold_param_; +} +inline ::ditcaffe::ThresholdParameter* V1LayerParameter::mutable_threshold_param() { + set_has_threshold_param(); + if (threshold_param_ == NULL) { + threshold_param_ = new ::ditcaffe::ThresholdParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.threshold_param) + return threshold_param_; +} +inline ::ditcaffe::ThresholdParameter* V1LayerParameter::release_threshold_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.threshold_param) + clear_has_threshold_param(); + ::ditcaffe::ThresholdParameter* temp = threshold_param_; + threshold_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_threshold_param(::ditcaffe::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:ditcaffe.V1LayerParameter.threshold_param) +} + +// optional .ditcaffe.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_->::ditcaffe::WindowDataParameter::Clear(); + clear_has_window_data_param(); +} +inline const ::ditcaffe::WindowDataParameter& V1LayerParameter::window_data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.window_data_param) + return window_data_param_ != NULL ? *window_data_param_ : *default_instance_->window_data_param_; +} +inline ::ditcaffe::WindowDataParameter* V1LayerParameter::mutable_window_data_param() { + set_has_window_data_param(); + if (window_data_param_ == NULL) { + window_data_param_ = new ::ditcaffe::WindowDataParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.window_data_param) + return window_data_param_; +} +inline ::ditcaffe::WindowDataParameter* V1LayerParameter::release_window_data_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.window_data_param) + clear_has_window_data_param(); + ::ditcaffe::WindowDataParameter* temp = window_data_param_; + window_data_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_window_data_param(::ditcaffe::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:ditcaffe.V1LayerParameter.window_data_param) +} + +// optional .ditcaffe.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_->::ditcaffe::TransformationParameter::Clear(); + clear_has_transform_param(); +} +inline const ::ditcaffe::TransformationParameter& V1LayerParameter::transform_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.transform_param) + return transform_param_ != NULL ? *transform_param_ : *default_instance_->transform_param_; +} +inline ::ditcaffe::TransformationParameter* V1LayerParameter::mutable_transform_param() { + set_has_transform_param(); + if (transform_param_ == NULL) { + transform_param_ = new ::ditcaffe::TransformationParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.transform_param) + return transform_param_; +} +inline ::ditcaffe::TransformationParameter* V1LayerParameter::release_transform_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.transform_param) + clear_has_transform_param(); + ::ditcaffe::TransformationParameter* temp = transform_param_; + transform_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_transform_param(::ditcaffe::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:ditcaffe.V1LayerParameter.transform_param) +} + +// optional .ditcaffe.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_->::ditcaffe::LossParameter::Clear(); + clear_has_loss_param(); +} +inline const ::ditcaffe::LossParameter& V1LayerParameter::loss_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.loss_param) + return loss_param_ != NULL ? *loss_param_ : *default_instance_->loss_param_; +} +inline ::ditcaffe::LossParameter* V1LayerParameter::mutable_loss_param() { + set_has_loss_param(); + if (loss_param_ == NULL) { + loss_param_ = new ::ditcaffe::LossParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.loss_param) + return loss_param_; +} +inline ::ditcaffe::LossParameter* V1LayerParameter::release_loss_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.loss_param) + clear_has_loss_param(); + ::ditcaffe::LossParameter* temp = loss_param_; + loss_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_loss_param(::ditcaffe::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:ditcaffe.V1LayerParameter.loss_param) +} + +// optional .ditcaffe.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_->::ditcaffe::V0LayerParameter::Clear(); + clear_has_layer(); +} +inline const ::ditcaffe::V0LayerParameter& V1LayerParameter::layer() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.layer) + return layer_ != NULL ? *layer_ : *default_instance_->layer_; +} +inline ::ditcaffe::V0LayerParameter* V1LayerParameter::mutable_layer() { + set_has_layer(); + if (layer_ == NULL) { + layer_ = new ::ditcaffe::V0LayerParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.layer) + return layer_; +} +inline ::ditcaffe::V0LayerParameter* V1LayerParameter::release_layer() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.layer) + clear_has_layer(); + ::ditcaffe::V0LayerParameter* temp = layer_; + layer_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_layer(::ditcaffe::V0LayerParameter* layer) { + delete layer_; + layer_ = layer; + if (layer) { + set_has_layer(); + } else { + clear_has_layer(); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.V1LayerParameter.layer) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.V0LayerParameter.name) +} +inline ::std::string* V0LayerParameter::mutable_name() { + set_has_name(); + // @@protoc_insertion_point(field_mutable:ditcaffe.V0LayerParameter.name) + return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* V0LayerParameter::release_name() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.V0LayerParameter.type) +} +inline ::std::string* V0LayerParameter::mutable_type() { + set_has_type(); + // @@protoc_insertion_point(field_mutable:ditcaffe.V0LayerParameter.type) + return type_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* V0LayerParameter::release_type() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.V0LayerParameter.biasterm) + return biasterm_; +} +inline void V0LayerParameter::set_biasterm(bool value) { + set_has_biasterm(); + biasterm_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.V0LayerParameter.biasterm) +} + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_weight_filler(); +} +inline const ::ditcaffe::FillerParameter& V0LayerParameter::weight_filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.V0LayerParameter.weight_filler) + return weight_filler_ != NULL ? *weight_filler_ : *default_instance_->weight_filler_; +} +inline ::ditcaffe::FillerParameter* V0LayerParameter::mutable_weight_filler() { + set_has_weight_filler(); + if (weight_filler_ == NULL) { + weight_filler_ = new ::ditcaffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V0LayerParameter.weight_filler) + return weight_filler_; +} +inline ::ditcaffe::FillerParameter* V0LayerParameter::release_weight_filler() { + // @@protoc_insertion_point(field_release:ditcaffe.V0LayerParameter.weight_filler) + clear_has_weight_filler(); + ::ditcaffe::FillerParameter* temp = weight_filler_; + weight_filler_ = NULL; + return temp; +} +inline void V0LayerParameter::set_allocated_weight_filler(::ditcaffe::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:ditcaffe.V0LayerParameter.weight_filler) +} + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_bias_filler(); +} +inline const ::ditcaffe::FillerParameter& V0LayerParameter::bias_filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.V0LayerParameter.bias_filler) + return bias_filler_ != NULL ? *bias_filler_ : *default_instance_->bias_filler_; +} +inline ::ditcaffe::FillerParameter* V0LayerParameter::mutable_bias_filler() { + set_has_bias_filler(); + if (bias_filler_ == NULL) { + bias_filler_ = new ::ditcaffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V0LayerParameter.bias_filler) + return bias_filler_; +} +inline ::ditcaffe::FillerParameter* V0LayerParameter::release_bias_filler() { + // @@protoc_insertion_point(field_release:ditcaffe.V0LayerParameter.bias_filler) + clear_has_bias_filler(); + ::ditcaffe::FillerParameter* temp = bias_filler_; + bias_filler_ = NULL; + return temp; +} +inline void V0LayerParameter::set_allocated_bias_filler(::ditcaffe::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:ditcaffe.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:ditcaffe.V0LayerParameter.pad) + return pad_; +} +inline void V0LayerParameter::set_pad(::google::protobuf::uint32 value) { + set_has_pad(); + pad_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.V0LayerParameter.kernelsize) + return kernelsize_; +} +inline void V0LayerParameter::set_kernelsize(::google::protobuf::uint32 value) { + set_has_kernelsize(); + kernelsize_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.V0LayerParameter.group) + return group_; +} +inline void V0LayerParameter::set_group(::google::protobuf::uint32 value) { + set_has_group(); + group_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.V0LayerParameter.stride) + return stride_; +} +inline void V0LayerParameter::set_stride(::google::protobuf::uint32 value) { + set_has_stride(); + stride_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.V0LayerParameter.stride) +} + +// optional .ditcaffe.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 ::ditcaffe::V0LayerParameter_PoolMethod V0LayerParameter::pool() const { + // @@protoc_insertion_point(field_get:ditcaffe.V0LayerParameter.pool) + return static_cast< ::ditcaffe::V0LayerParameter_PoolMethod >(pool_); +} +inline void V0LayerParameter::set_pool(::ditcaffe::V0LayerParameter_PoolMethod value) { + assert(::ditcaffe::V0LayerParameter_PoolMethod_IsValid(value)); + set_has_pool(); + pool_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.V0LayerParameter.alpha) + return alpha_; +} +inline void V0LayerParameter::set_alpha(float value) { + set_has_alpha(); + alpha_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.V0LayerParameter.beta) + return beta_; +} +inline void V0LayerParameter::set_beta(float value) { + set_has_beta(); + beta_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.V0LayerParameter.k) + return k_; +} +inline void V0LayerParameter::set_k(float value) { + set_has_k(); + k_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.V0LayerParameter.source) +} +inline ::std::string* V0LayerParameter::mutable_source() { + set_has_source(); + // @@protoc_insertion_point(field_mutable:ditcaffe.V0LayerParameter.source) + return source_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* V0LayerParameter::release_source() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.V0LayerParameter.scale) + return scale_; +} +inline void V0LayerParameter::set_scale(float value) { + set_has_scale(); + scale_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.V0LayerParameter.meanfile) +} +inline ::std::string* V0LayerParameter::mutable_meanfile() { + set_has_meanfile(); + // @@protoc_insertion_point(field_mutable:ditcaffe.V0LayerParameter.meanfile) + return meanfile_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* V0LayerParameter::release_meanfile() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.V0LayerParameter.batchsize) + return batchsize_; +} +inline void V0LayerParameter::set_batchsize(::google::protobuf::uint32 value) { + set_has_batchsize(); + batchsize_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.V0LayerParameter.cropsize) + return cropsize_; +} +inline void V0LayerParameter::set_cropsize(::google::protobuf::uint32 value) { + set_has_cropsize(); + cropsize_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.V0LayerParameter.mirror) + return mirror_; +} +inline void V0LayerParameter::set_mirror(bool value) { + set_has_mirror(); + mirror_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.V0LayerParameter.mirror) +} + +// repeated .ditcaffe.BlobProto blobs = 50; +inline int V0LayerParameter::blobs_size() const { + return blobs_.size(); +} +inline void V0LayerParameter::clear_blobs() { + blobs_.Clear(); +} +inline const ::ditcaffe::BlobProto& V0LayerParameter::blobs(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.V0LayerParameter.blobs) + return blobs_.Get(index); +} +inline ::ditcaffe::BlobProto* V0LayerParameter::mutable_blobs(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.V0LayerParameter.blobs) + return blobs_.Mutable(index); +} +inline ::ditcaffe::BlobProto* V0LayerParameter::add_blobs() { + // @@protoc_insertion_point(field_add:ditcaffe.V0LayerParameter.blobs) + return blobs_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >* +V0LayerParameter::mutable_blobs() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.V0LayerParameter.blobs) + return &blobs_; +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >& +V0LayerParameter::blobs() const { + // @@protoc_insertion_point(field_list:ditcaffe.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:ditcaffe.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:ditcaffe.V0LayerParameter.blobs_lr) +} +inline void V0LayerParameter::add_blobs_lr(float value) { + blobs_lr_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.V0LayerParameter.blobs_lr) +} +inline const ::google::protobuf::RepeatedField< float >& +V0LayerParameter::blobs_lr() const { + // @@protoc_insertion_point(field_list:ditcaffe.V0LayerParameter.blobs_lr) + return blobs_lr_; +} +inline ::google::protobuf::RepeatedField< float >* +V0LayerParameter::mutable_blobs_lr() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.V0LayerParameter.weight_decay) +} +inline void V0LayerParameter::add_weight_decay(float value) { + weight_decay_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.V0LayerParameter.weight_decay) +} +inline const ::google::protobuf::RepeatedField< float >& +V0LayerParameter::weight_decay() const { + // @@protoc_insertion_point(field_list:ditcaffe.V0LayerParameter.weight_decay) + return weight_decay_; +} +inline ::google::protobuf::RepeatedField< float >* +V0LayerParameter::mutable_weight_decay() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.V0LayerParameter.det_crop_mode) +} +inline ::std::string* V0LayerParameter::mutable_det_crop_mode() { + set_has_det_crop_mode(); + // @@protoc_insertion_point(field_mutable:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.V0LayerParameter.concat_dim) +} + +// optional .ditcaffe.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_->::ditcaffe::HDF5OutputParameter::Clear(); + clear_has_hdf5_output_param(); +} +inline const ::ditcaffe::HDF5OutputParameter& V0LayerParameter::hdf5_output_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V0LayerParameter.hdf5_output_param) + return hdf5_output_param_ != NULL ? *hdf5_output_param_ : *default_instance_->hdf5_output_param_; +} +inline ::ditcaffe::HDF5OutputParameter* V0LayerParameter::mutable_hdf5_output_param() { + set_has_hdf5_output_param(); + if (hdf5_output_param_ == NULL) { + hdf5_output_param_ = new ::ditcaffe::HDF5OutputParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V0LayerParameter.hdf5_output_param) + return hdf5_output_param_; +} +inline ::ditcaffe::HDF5OutputParameter* V0LayerParameter::release_hdf5_output_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V0LayerParameter.hdf5_output_param) + clear_has_hdf5_output_param(); + ::ditcaffe::HDF5OutputParameter* temp = hdf5_output_param_; + hdf5_output_param_ = NULL; + return temp; +} +inline void V0LayerParameter::set_allocated_hdf5_output_param(::ditcaffe::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:ditcaffe.V0LayerParameter.hdf5_output_param) +} + +// ------------------------------------------------------------------- + +// PReLUParameter + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_filler(); +} +inline const ::ditcaffe::FillerParameter& PReLUParameter::filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.PReLUParameter.filler) + return filler_ != NULL ? *filler_ : *default_instance_->filler_; +} +inline ::ditcaffe::FillerParameter* PReLUParameter::mutable_filler() { + set_has_filler(); + if (filler_ == NULL) { + filler_ = new ::ditcaffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.PReLUParameter.filler) + return filler_; +} +inline ::ditcaffe::FillerParameter* PReLUParameter::release_filler() { + // @@protoc_insertion_point(field_release:ditcaffe.PReLUParameter.filler) + clear_has_filler(); + ::ditcaffe::FillerParameter* temp = filler_; + filler_ = NULL; + return temp; +} +inline void PReLUParameter::set_allocated_filler(::ditcaffe::FillerParameter* filler) { + delete filler_; + filler_ = filler; + if (filler) { + set_has_filler(); + } else { + clear_has_filler(); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.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:ditcaffe.PReLUParameter.channel_shared) +} + +#endif // !PROTOBUF_INLINE_NOT_IN_HEADERS +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace ditcaffe + +#ifndef SWIG +namespace google { +namespace protobuf { + +template <> struct is_proto_enum< ::ditcaffe::FillerParameter_VarianceNorm> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::ditcaffe::FillerParameter_VarianceNorm>() { + return ::ditcaffe::FillerParameter_VarianceNorm_descriptor(); +} +template <> struct is_proto_enum< ::ditcaffe::SolverParameter_SnapshotFormat> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::ditcaffe::SolverParameter_SnapshotFormat>() { + return ::ditcaffe::SolverParameter_SnapshotFormat_descriptor(); +} +template <> struct is_proto_enum< ::ditcaffe::SolverParameter_SolverMode> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::ditcaffe::SolverParameter_SolverMode>() { + return ::ditcaffe::SolverParameter_SolverMode_descriptor(); +} +template <> struct is_proto_enum< ::ditcaffe::SolverParameter_SolverType> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::ditcaffe::SolverParameter_SolverType>() { + return ::ditcaffe::SolverParameter_SolverType_descriptor(); +} +template <> struct is_proto_enum< ::ditcaffe::ParamSpec_DimCheckMode> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::ditcaffe::ParamSpec_DimCheckMode>() { + return ::ditcaffe::ParamSpec_DimCheckMode_descriptor(); +} +template <> struct is_proto_enum< ::ditcaffe::LossParameter_NormalizationMode> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::ditcaffe::LossParameter_NormalizationMode>() { + return ::ditcaffe::LossParameter_NormalizationMode_descriptor(); +} +template <> struct is_proto_enum< ::ditcaffe::ConvolutionParameter_Engine> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::ditcaffe::ConvolutionParameter_Engine>() { + return ::ditcaffe::ConvolutionParameter_Engine_descriptor(); +} +template <> struct is_proto_enum< ::ditcaffe::DataParameter_DB> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::ditcaffe::DataParameter_DB>() { + return ::ditcaffe::DataParameter_DB_descriptor(); +} +template <> struct is_proto_enum< ::ditcaffe::EltwiseParameter_EltwiseOp> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::ditcaffe::EltwiseParameter_EltwiseOp>() { + return ::ditcaffe::EltwiseParameter_EltwiseOp_descriptor(); +} +template <> struct is_proto_enum< ::ditcaffe::HingeLossParameter_Norm> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::ditcaffe::HingeLossParameter_Norm>() { + return ::ditcaffe::HingeLossParameter_Norm_descriptor(); +} +template <> struct is_proto_enum< ::ditcaffe::LRNParameter_NormRegion> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::ditcaffe::LRNParameter_NormRegion>() { + return ::ditcaffe::LRNParameter_NormRegion_descriptor(); +} +template <> struct is_proto_enum< ::ditcaffe::LRNParameter_Engine> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::ditcaffe::LRNParameter_Engine>() { + return ::ditcaffe::LRNParameter_Engine_descriptor(); +} +template <> struct is_proto_enum< ::ditcaffe::PoolingParameter_PoolMethod> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::ditcaffe::PoolingParameter_PoolMethod>() { + return ::ditcaffe::PoolingParameter_PoolMethod_descriptor(); +} +template <> struct is_proto_enum< ::ditcaffe::PoolingParameter_Engine> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::ditcaffe::PoolingParameter_Engine>() { + return ::ditcaffe::PoolingParameter_Engine_descriptor(); +} +template <> struct is_proto_enum< ::ditcaffe::ReductionParameter_ReductionOp> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::ditcaffe::ReductionParameter_ReductionOp>() { + return ::ditcaffe::ReductionParameter_ReductionOp_descriptor(); +} +template <> struct is_proto_enum< ::ditcaffe::ReLUParameter_Engine> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::ditcaffe::ReLUParameter_Engine>() { + return ::ditcaffe::ReLUParameter_Engine_descriptor(); +} +template <> struct is_proto_enum< ::ditcaffe::SigmoidParameter_Engine> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::ditcaffe::SigmoidParameter_Engine>() { + return ::ditcaffe::SigmoidParameter_Engine_descriptor(); +} +template <> struct is_proto_enum< ::ditcaffe::SoftmaxParameter_Engine> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::ditcaffe::SoftmaxParameter_Engine>() { + return ::ditcaffe::SoftmaxParameter_Engine_descriptor(); +} +template <> struct is_proto_enum< ::ditcaffe::TanHParameter_Engine> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::ditcaffe::TanHParameter_Engine>() { + return ::ditcaffe::TanHParameter_Engine_descriptor(); +} +template <> struct is_proto_enum< ::ditcaffe::SPPParameter_PoolMethod> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::ditcaffe::SPPParameter_PoolMethod>() { + return ::ditcaffe::SPPParameter_PoolMethod_descriptor(); +} +template <> struct is_proto_enum< ::ditcaffe::SPPParameter_Engine> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::ditcaffe::SPPParameter_Engine>() { + return ::ditcaffe::SPPParameter_Engine_descriptor(); +} +template <> struct is_proto_enum< ::ditcaffe::V1LayerParameter_LayerType> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::ditcaffe::V1LayerParameter_LayerType>() { + return ::ditcaffe::V1LayerParameter_LayerType_descriptor(); +} +template <> struct is_proto_enum< ::ditcaffe::V1LayerParameter_DimCheckMode> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::ditcaffe::V1LayerParameter_DimCheckMode>() { + return ::ditcaffe::V1LayerParameter_DimCheckMode_descriptor(); +} +template <> struct is_proto_enum< ::ditcaffe::V0LayerParameter_PoolMethod> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::ditcaffe::V0LayerParameter_PoolMethod>() { + return ::ditcaffe::V0LayerParameter_PoolMethod_descriptor(); +} +template <> struct is_proto_enum< ::ditcaffe::Phase> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::ditcaffe::Phase>() { + return ::ditcaffe::Phase_descriptor(); +} + +} // namespace protobuf +} // namespace google +#endif // SWIG + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_ditcaffe_2eproto__INCLUDED diff --git a/umd/core/src/compiler/caffe/ditcaffe/protobuf-lite-2.6.1/ditcaffe.opt-for-lite.pb.cpp b/umd/core/src/compiler/caffe/ditcaffe/protobuf-lite-2.6.1/ditcaffe.opt-for-lite.pb.cpp new file mode 100644 index 00000000..492e948d --- /dev/null +++ b/umd/core/src/compiler/caffe/ditcaffe/protobuf-lite-2.6.1/ditcaffe.opt-for-lite.pb.cpp @@ -0,0 +1,25743 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: ditcaffe.opt-for-lite.proto + +#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION +#include "ditcaffe.opt-for-lite.pb.h" + +#include + +#include +#include +#include +#include +#include +// @@protoc_insertion_point(includes) + +namespace ditcaffe { + +void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto() { + delete BlobShape::default_instance_; + delete BlobProto::default_instance_; + delete BlobProtoVector::default_instance_; + delete Datum::default_instance_; + delete FillerParameter::default_instance_; + delete FillerParameter::_default_type_; + delete NetParameter::default_instance_; + delete SolverParameter::default_instance_; + delete SolverParameter::_default_regularization_type_; + delete SolverParameter::_default_type_; + delete SolverState::default_instance_; + delete NetState::default_instance_; + delete NetStateRule::default_instance_; + delete ParamSpec::default_instance_; + delete LayerParameter::default_instance_; + delete TransformationParameter::default_instance_; + delete LossParameter::default_instance_; + delete AccuracyParameter::default_instance_; + delete ArgMaxParameter::default_instance_; + delete ConcatParameter::default_instance_; + delete BatchNormParameter::default_instance_; + delete BiasParameter::default_instance_; + delete ContrastiveLossParameter::default_instance_; + delete ConvolutionParameter::default_instance_; + delete CropParameter::default_instance_; + delete DataParameter::default_instance_; + delete DropoutParameter::default_instance_; + delete DummyDataParameter::default_instance_; + delete EltwiseParameter::default_instance_; + delete ELUParameter::default_instance_; + delete EmbedParameter::default_instance_; + delete ExpParameter::default_instance_; + delete FlattenParameter::default_instance_; + delete HDF5DataParameter::default_instance_; + delete HDF5OutputParameter::default_instance_; + delete HingeLossParameter::default_instance_; + delete ImageDataParameter::default_instance_; + delete InfogainLossParameter::default_instance_; + delete InnerProductParameter::default_instance_; + delete InputParameter::default_instance_; + delete LogParameter::default_instance_; + delete LRNParameter::default_instance_; + delete MemoryDataParameter::default_instance_; + delete MVNParameter::default_instance_; + delete ParameterParameter::default_instance_; + delete PoolingParameter::default_instance_; + delete PowerParameter::default_instance_; + delete PythonParameter::default_instance_; + delete ReductionParameter::default_instance_; + delete ReLUParameter::default_instance_; + delete ReshapeParameter::default_instance_; + delete ScaleParameter::default_instance_; + delete SigmoidParameter::default_instance_; + delete SliceParameter::default_instance_; + delete SoftmaxParameter::default_instance_; + delete TanHParameter::default_instance_; + delete TileParameter::default_instance_; + delete ThresholdParameter::default_instance_; + delete WindowDataParameter::default_instance_; + delete WindowDataParameter::_default_crop_mode_; + delete SPPParameter::default_instance_; + delete V1LayerParameter::default_instance_; + delete V0LayerParameter::default_instance_; + delete V0LayerParameter::_default_det_crop_mode_; + delete PReLUParameter::default_instance_; +} + +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER +void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + +#else +void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto() { + static bool already_here = false; + if (already_here) return; + already_here = true; + GOOGLE_PROTOBUF_VERIFY_VERSION; + +#endif + BlobShape::default_instance_ = new BlobShape(); + BlobProto::default_instance_ = new BlobProto(); + BlobProtoVector::default_instance_ = new BlobProtoVector(); + Datum::default_instance_ = new Datum(); + FillerParameter::_default_type_ = + new ::std::string("constant", 8); + FillerParameter::default_instance_ = new FillerParameter(); + NetParameter::default_instance_ = new NetParameter(); + SolverParameter::_default_regularization_type_ = + new ::std::string("L2", 2); + SolverParameter::_default_type_ = + new ::std::string("SGD", 3); + SolverParameter::default_instance_ = new SolverParameter(); + SolverState::default_instance_ = new SolverState(); + NetState::default_instance_ = new NetState(); + NetStateRule::default_instance_ = new NetStateRule(); + ParamSpec::default_instance_ = new ParamSpec(); + LayerParameter::default_instance_ = new LayerParameter(); + TransformationParameter::default_instance_ = new TransformationParameter(); + LossParameter::default_instance_ = new LossParameter(); + AccuracyParameter::default_instance_ = new AccuracyParameter(); + ArgMaxParameter::default_instance_ = new ArgMaxParameter(); + ConcatParameter::default_instance_ = new ConcatParameter(); + BatchNormParameter::default_instance_ = new BatchNormParameter(); + BiasParameter::default_instance_ = new BiasParameter(); + ContrastiveLossParameter::default_instance_ = new ContrastiveLossParameter(); + ConvolutionParameter::default_instance_ = new ConvolutionParameter(); + CropParameter::default_instance_ = new CropParameter(); + DataParameter::default_instance_ = new DataParameter(); + DropoutParameter::default_instance_ = new DropoutParameter(); + DummyDataParameter::default_instance_ = new DummyDataParameter(); + EltwiseParameter::default_instance_ = new EltwiseParameter(); + ELUParameter::default_instance_ = new ELUParameter(); + EmbedParameter::default_instance_ = new EmbedParameter(); + ExpParameter::default_instance_ = new ExpParameter(); + FlattenParameter::default_instance_ = new FlattenParameter(); + HDF5DataParameter::default_instance_ = new HDF5DataParameter(); + HDF5OutputParameter::default_instance_ = new HDF5OutputParameter(); + HingeLossParameter::default_instance_ = new HingeLossParameter(); + ImageDataParameter::default_instance_ = new ImageDataParameter(); + InfogainLossParameter::default_instance_ = new InfogainLossParameter(); + InnerProductParameter::default_instance_ = new InnerProductParameter(); + InputParameter::default_instance_ = new InputParameter(); + LogParameter::default_instance_ = new LogParameter(); + LRNParameter::default_instance_ = new LRNParameter(); + MemoryDataParameter::default_instance_ = new MemoryDataParameter(); + MVNParameter::default_instance_ = new MVNParameter(); + ParameterParameter::default_instance_ = new ParameterParameter(); + PoolingParameter::default_instance_ = new PoolingParameter(); + PowerParameter::default_instance_ = new PowerParameter(); + PythonParameter::default_instance_ = new PythonParameter(); + ReductionParameter::default_instance_ = new ReductionParameter(); + ReLUParameter::default_instance_ = new ReLUParameter(); + ReshapeParameter::default_instance_ = new ReshapeParameter(); + ScaleParameter::default_instance_ = new ScaleParameter(); + SigmoidParameter::default_instance_ = new SigmoidParameter(); + SliceParameter::default_instance_ = new SliceParameter(); + SoftmaxParameter::default_instance_ = new SoftmaxParameter(); + TanHParameter::default_instance_ = new TanHParameter(); + TileParameter::default_instance_ = new TileParameter(); + ThresholdParameter::default_instance_ = new ThresholdParameter(); + WindowDataParameter::_default_crop_mode_ = + new ::std::string("warp", 4); + WindowDataParameter::default_instance_ = new WindowDataParameter(); + SPPParameter::default_instance_ = new SPPParameter(); + V1LayerParameter::default_instance_ = new V1LayerParameter(); + V0LayerParameter::_default_det_crop_mode_ = + new ::std::string("warp", 4); + V0LayerParameter::default_instance_ = new V0LayerParameter(); + PReLUParameter::default_instance_ = new PReLUParameter(); + BlobShape::default_instance_->InitAsDefaultInstance(); + BlobProto::default_instance_->InitAsDefaultInstance(); + BlobProtoVector::default_instance_->InitAsDefaultInstance(); + Datum::default_instance_->InitAsDefaultInstance(); + FillerParameter::default_instance_->InitAsDefaultInstance(); + NetParameter::default_instance_->InitAsDefaultInstance(); + SolverParameter::default_instance_->InitAsDefaultInstance(); + SolverState::default_instance_->InitAsDefaultInstance(); + NetState::default_instance_->InitAsDefaultInstance(); + NetStateRule::default_instance_->InitAsDefaultInstance(); + ParamSpec::default_instance_->InitAsDefaultInstance(); + LayerParameter::default_instance_->InitAsDefaultInstance(); + TransformationParameter::default_instance_->InitAsDefaultInstance(); + LossParameter::default_instance_->InitAsDefaultInstance(); + AccuracyParameter::default_instance_->InitAsDefaultInstance(); + ArgMaxParameter::default_instance_->InitAsDefaultInstance(); + ConcatParameter::default_instance_->InitAsDefaultInstance(); + BatchNormParameter::default_instance_->InitAsDefaultInstance(); + BiasParameter::default_instance_->InitAsDefaultInstance(); + ContrastiveLossParameter::default_instance_->InitAsDefaultInstance(); + ConvolutionParameter::default_instance_->InitAsDefaultInstance(); + CropParameter::default_instance_->InitAsDefaultInstance(); + DataParameter::default_instance_->InitAsDefaultInstance(); + DropoutParameter::default_instance_->InitAsDefaultInstance(); + DummyDataParameter::default_instance_->InitAsDefaultInstance(); + EltwiseParameter::default_instance_->InitAsDefaultInstance(); + ELUParameter::default_instance_->InitAsDefaultInstance(); + EmbedParameter::default_instance_->InitAsDefaultInstance(); + ExpParameter::default_instance_->InitAsDefaultInstance(); + FlattenParameter::default_instance_->InitAsDefaultInstance(); + HDF5DataParameter::default_instance_->InitAsDefaultInstance(); + HDF5OutputParameter::default_instance_->InitAsDefaultInstance(); + HingeLossParameter::default_instance_->InitAsDefaultInstance(); + ImageDataParameter::default_instance_->InitAsDefaultInstance(); + InfogainLossParameter::default_instance_->InitAsDefaultInstance(); + InnerProductParameter::default_instance_->InitAsDefaultInstance(); + InputParameter::default_instance_->InitAsDefaultInstance(); + LogParameter::default_instance_->InitAsDefaultInstance(); + LRNParameter::default_instance_->InitAsDefaultInstance(); + MemoryDataParameter::default_instance_->InitAsDefaultInstance(); + MVNParameter::default_instance_->InitAsDefaultInstance(); + ParameterParameter::default_instance_->InitAsDefaultInstance(); + PoolingParameter::default_instance_->InitAsDefaultInstance(); + PowerParameter::default_instance_->InitAsDefaultInstance(); + PythonParameter::default_instance_->InitAsDefaultInstance(); + ReductionParameter::default_instance_->InitAsDefaultInstance(); + ReLUParameter::default_instance_->InitAsDefaultInstance(); + ReshapeParameter::default_instance_->InitAsDefaultInstance(); + ScaleParameter::default_instance_->InitAsDefaultInstance(); + SigmoidParameter::default_instance_->InitAsDefaultInstance(); + SliceParameter::default_instance_->InitAsDefaultInstance(); + SoftmaxParameter::default_instance_->InitAsDefaultInstance(); + TanHParameter::default_instance_->InitAsDefaultInstance(); + TileParameter::default_instance_->InitAsDefaultInstance(); + ThresholdParameter::default_instance_->InitAsDefaultInstance(); + WindowDataParameter::default_instance_->InitAsDefaultInstance(); + SPPParameter::default_instance_->InitAsDefaultInstance(); + V1LayerParameter::default_instance_->InitAsDefaultInstance(); + V0LayerParameter::default_instance_->InitAsDefaultInstance(); + PReLUParameter::default_instance_->InitAsDefaultInstance(); + ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto); +} + +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER +GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_once_); +void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto() { + ::google::protobuf::GoogleOnceInit(&protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_once_, + &protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl); +} +#else +// Force AddDescriptors() to be called at static initialization time. +struct StaticDescriptorInitializer_ditcaffe_2eopt_2dfor_2dlite_2eproto { + StaticDescriptorInitializer_ditcaffe_2eopt_2dfor_2dlite_2eproto() { + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + } +} static_descriptor_initializer_ditcaffe_2eopt_2dfor_2dlite_2eproto_; +#endif +bool Phase_IsValid(int value) { + switch(value) { + case 0: + case 1: + return true; + default: + return false; + } +} + + +// =================================================================== + +#ifndef _MSC_VER +const int BlobShape::kDimFieldNumber; +#endif // !_MSC_VER + +BlobShape::BlobShape() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.BlobShape) +} + +void BlobShape::InitAsDefaultInstance() { +} + +BlobShape::BlobShape(const BlobShape& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.BlobShape) +} + +void BlobShape::SharedCtor() { + _cached_size_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +BlobShape::~BlobShape() { + // @@protoc_insertion_point(destructor:ditcaffe.BlobShape) + SharedDtor(); +} + +void BlobShape::SharedDtor() { + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void BlobShape::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const BlobShape& BlobShape::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +BlobShape* BlobShape::default_instance_ = NULL; + +BlobShape* BlobShape::New() const { + return new BlobShape; +} + +void BlobShape::Clear() { + dim_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool BlobShape::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:ditcaffe.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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.BlobShape) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.BlobShape) + return false; +#undef DO_ +} + +void BlobShape::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:ditcaffe.BlobShape) +} + +int BlobShape::ByteSize() const { + int total_size = 0; + + // repeated int64 dim = 1 [packed = true]; + { + int data_size = 0; + for (int i = 0; i < this->dim_size(); 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); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _dim_cached_byte_size_ = data_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void BlobShape::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void BlobShape::MergeFrom(const BlobShape& from) { + GOOGLE_CHECK_NE(&from, this); + dim_.MergeFrom(from.dim_); + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void BlobShape::CopyFrom(const BlobShape& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool BlobShape::IsInitialized() const { + + return true; +} + +void BlobShape::Swap(BlobShape* other) { + if (other != this) { + dim_.Swap(&other->dim_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string BlobShape::GetTypeName() const { + return "ditcaffe.BlobShape"; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int BlobProto::kShapeFieldNumber; +const int BlobProto::kDataFieldNumber; +const int BlobProto::kDiffFieldNumber; +const int BlobProto::kDoubleDataFieldNumber; +const int BlobProto::kDoubleDiffFieldNumber; +const int BlobProto::kHalfDataFieldNumber; +const int BlobProto::kHalfDiffFieldNumber; +const int BlobProto::kNumFieldNumber; +const int BlobProto::kChannelsFieldNumber; +const int BlobProto::kHeightFieldNumber; +const int BlobProto::kWidthFieldNumber; +#endif // !_MSC_VER + +BlobProto::BlobProto() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.BlobProto) +} + +void BlobProto::InitAsDefaultInstance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + shape_ = const_cast< ::ditcaffe::BlobShape*>( + ::ditcaffe::BlobShape::internal_default_instance()); +#else + shape_ = const_cast< ::ditcaffe::BlobShape*>(&::ditcaffe::BlobShape::default_instance()); +#endif +} + +BlobProto::BlobProto(const BlobProto& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.BlobProto) +} + +void BlobProto::SharedCtor() { + _cached_size_ = 0; + shape_ = NULL; + num_ = 0; + channels_ = 0; + height_ = 0; + width_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +BlobProto::~BlobProto() { + // @@protoc_insertion_point(destructor:ditcaffe.BlobProto) + SharedDtor(); +} + +void BlobProto::SharedDtor() { + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + delete shape_; + } +} + +void BlobProto::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const BlobProto& BlobProto::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +BlobProto* BlobProto::default_instance_ = NULL; + +BlobProto* BlobProto::New() const { + return new BlobProto; +} + +void BlobProto::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 129) { + if (has_shape()) { + if (shape_ != NULL) shape_->::ditcaffe::BlobShape::Clear(); + } + num_ = 0; + } + ZR_(channels_, width_); + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + data_.Clear(); + diff_.Clear(); + double_data_.Clear(); + double_diff_.Clear(); + half_data_.Clear(); + half_diff_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool BlobProto::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &num_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &channels_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &height_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &width_))); + set_has_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 .ditcaffe.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->ExpectTag(82)) goto parse_half_data; + break; + } + + // repeated uint32 half_data = 10 [packed = true]; + case 10: { + if (tag == 82) { + parse_half_data: + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, this->mutable_half_data()))); + } else if (tag == 80) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + 1, 82, input, this->mutable_half_data()))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(90)) goto parse_half_diff; + break; + } + + // repeated uint32 half_diff = 11 [packed = true]; + case 11: { + if (tag == 90) { + parse_half_diff: + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, this->mutable_half_diff()))); + } else if (tag == 88) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + 1, 90, input, this->mutable_half_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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.BlobProto) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.BlobProto) + return false; +#undef DO_ +} + +void BlobProto::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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 .ditcaffe.BlobShape shape = 7; + if (has_shape()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 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); + } + + // repeated uint32 half_data = 10 [packed = true]; + if (this->half_data_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(10, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(_half_data_cached_byte_size_); + } + for (int i = 0; i < this->half_data_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32NoTag( + this->half_data(i), output); + } + + // repeated uint32 half_diff = 11 [packed = true]; + if (this->half_diff_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(11, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(_half_diff_cached_byte_size_); + } + for (int i = 0; i < this->half_diff_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32NoTag( + this->half_diff(i), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:ditcaffe.BlobProto) +} + +int BlobProto::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional .ditcaffe.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()); + } + + } + if (_has_bits_[8 / 32] & (0xffu << (8 % 32))) { + // 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]; + { + int data_size = 0; + data_size = 4 * this->data_size(); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _data_cached_byte_size_ = data_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated float diff = 6 [packed = true]; + { + int data_size = 0; + data_size = 4 * this->diff_size(); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _diff_cached_byte_size_ = data_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated double double_data = 8 [packed = true]; + { + int data_size = 0; + data_size = 8 * this->double_data_size(); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _double_data_cached_byte_size_ = data_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated double double_diff = 9 [packed = true]; + { + int data_size = 0; + data_size = 8 * this->double_diff_size(); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _double_diff_cached_byte_size_ = data_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated uint32 half_data = 10 [packed = true]; + { + int data_size = 0; + for (int i = 0; i < this->half_data_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->half_data(i)); + } + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _half_data_cached_byte_size_ = data_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated uint32 half_diff = 11 [packed = true]; + { + int data_size = 0; + for (int i = 0; i < this->half_diff_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->half_diff(i)); + } + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _half_diff_cached_byte_size_ = data_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void BlobProto::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void BlobProto::MergeFrom(const BlobProto& from) { + GOOGLE_CHECK_NE(&from, this); + data_.MergeFrom(from.data_); + diff_.MergeFrom(from.diff_); + double_data_.MergeFrom(from.double_data_); + double_diff_.MergeFrom(from.double_diff_); + half_data_.MergeFrom(from.half_data_); + half_diff_.MergeFrom(from.half_diff_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_shape()) { + mutable_shape()->::ditcaffe::BlobShape::MergeFrom(from.shape()); + } + if (from.has_num()) { + set_num(from.num()); + } + } + if (from._has_bits_[8 / 32] & (0xffu << (8 % 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()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void BlobProto::CopyFrom(const BlobProto& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool BlobProto::IsInitialized() const { + + return true; +} + +void BlobProto::Swap(BlobProto* other) { + if (other != this) { + std::swap(shape_, other->shape_); + data_.Swap(&other->data_); + diff_.Swap(&other->diff_); + double_data_.Swap(&other->double_data_); + double_diff_.Swap(&other->double_diff_); + half_data_.Swap(&other->half_data_); + half_diff_.Swap(&other->half_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]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string BlobProto::GetTypeName() const { + return "ditcaffe.BlobProto"; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int BlobProtoVector::kBlobsFieldNumber; +#endif // !_MSC_VER + +BlobProtoVector::BlobProtoVector() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.BlobProtoVector) +} + +void BlobProtoVector::InitAsDefaultInstance() { +} + +BlobProtoVector::BlobProtoVector(const BlobProtoVector& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.BlobProtoVector) +} + +void BlobProtoVector::SharedCtor() { + _cached_size_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +BlobProtoVector::~BlobProtoVector() { + // @@protoc_insertion_point(destructor:ditcaffe.BlobProtoVector) + SharedDtor(); +} + +void BlobProtoVector::SharedDtor() { + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void BlobProtoVector::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const BlobProtoVector& BlobProtoVector::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +BlobProtoVector* BlobProtoVector::default_instance_ = NULL; + +BlobProtoVector* BlobProtoVector::New() const { + return new BlobProtoVector; +} + +void BlobProtoVector::Clear() { + blobs_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool BlobProtoVector::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:ditcaffe.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 .ditcaffe.BlobProto blobs = 1; + case 1: { + if (tag == 10) { + parse_blobs: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_blobs())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(10)) goto parse_blobs; + 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, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.BlobProtoVector) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.BlobProtoVector) + return false; +#undef DO_ +} + +void BlobProtoVector::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.BlobProtoVector) + // repeated .ditcaffe.BlobProto blobs = 1; + for (int i = 0; i < this->blobs_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 1, this->blobs(i), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:ditcaffe.BlobProtoVector) +} + +int BlobProtoVector::ByteSize() const { + int total_size = 0; + + // repeated .ditcaffe.BlobProto blobs = 1; + total_size += 1 * this->blobs_size(); + for (int i = 0; i < this->blobs_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->blobs(i)); + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void BlobProtoVector::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void BlobProtoVector::MergeFrom(const BlobProtoVector& from) { + GOOGLE_CHECK_NE(&from, this); + blobs_.MergeFrom(from.blobs_); + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void BlobProtoVector::CopyFrom(const BlobProtoVector& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool BlobProtoVector::IsInitialized() const { + + return true; +} + +void BlobProtoVector::Swap(BlobProtoVector* other) { + if (other != this) { + blobs_.Swap(&other->blobs_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string BlobProtoVector::GetTypeName() const { + return "ditcaffe.BlobProtoVector"; +} + + +// =================================================================== + +#ifndef _MSC_VER +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 // !_MSC_VER + +Datum::Datum() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.Datum) +} + +void Datum::InitAsDefaultInstance() { +} + +Datum::Datum(const Datum& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.Datum) +} + +void Datum::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + channels_ = 0; + height_ = 0; + width_ = 0; + data_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + label_ = 0; + encoded_ = false; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +Datum::~Datum() { + // @@protoc_insertion_point(destructor:ditcaffe.Datum) + SharedDtor(); +} + +void Datum::SharedDtor() { + if (data_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete data_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void Datum::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const Datum& Datum::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +Datum* Datum::default_instance_ = NULL; + +Datum* Datum::New() const { + return new Datum; +} + +void Datum::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 95) { + ZR_(channels_, height_); + ZR_(width_, label_); + if (has_data()) { + if (data_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + data_->clear(); + } + } + encoded_ = false; + } + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + float_data_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool Datum::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &channels_))); + set_has_channels(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_height; + break; + } + + // optional int32 height = 2; + case 2: { + if (tag == 16) { + parse_height: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &height_))); + set_has_height(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(24)) goto parse_width; + break; + } + + // optional int32 width = 3; + case 3: { + if (tag == 24) { + parse_width: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &width_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &label_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &encoded_))); + set_has_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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.Datum) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.Datum) + return false; +#undef DO_ +} + +void Datum::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:ditcaffe.Datum) +} + +int Datum::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // 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; + { + int data_size = 0; + data_size = 4 * this->float_data_size(); + total_size += 1 * this->float_data_size() + data_size; + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void Datum::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void Datum::MergeFrom(const Datum& from) { + GOOGLE_CHECK_NE(&from, this); + float_data_.MergeFrom(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_data(from.data()); + } + if (from.has_label()) { + set_label(from.label()); + } + if (from.has_encoded()) { + set_encoded(from.encoded()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void Datum::CopyFrom(const Datum& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Datum::IsInitialized() const { + + return true; +} + +void Datum::Swap(Datum* other) { + if (other != this) { + std::swap(channels_, other->channels_); + std::swap(height_, other->height_); + std::swap(width_, other->width_); + std::swap(data_, other->data_); + std::swap(label_, other->label_); + float_data_.Swap(&other->float_data_); + std::swap(encoded_, other->encoded_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string Datum::GetTypeName() const { + return "ditcaffe.Datum"; +} + + +// =================================================================== + +bool FillerParameter_VarianceNorm_IsValid(int value) { + switch(value) { + case 0: + case 1: + case 2: + return true; + default: + return false; + } +} + +#ifndef _MSC_VER +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 // _MSC_VER +::std::string* FillerParameter::_default_type_ = NULL; +#ifndef _MSC_VER +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 // !_MSC_VER + +FillerParameter::FillerParameter() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.FillerParameter) +} + +void FillerParameter::InitAsDefaultInstance() { +} + +FillerParameter::FillerParameter(const FillerParameter& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.FillerParameter) +} + +void FillerParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + type_ = const_cast< ::std::string*>(_default_type_); + value_ = 0; + min_ = 0; + max_ = 1; + mean_ = 0; + std_ = 1; + sparse_ = -1; + variance_norm_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +FillerParameter::~FillerParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.FillerParameter) + SharedDtor(); +} + +void FillerParameter::SharedDtor() { + if (type_ != _default_type_) { + delete type_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void FillerParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const FillerParameter& FillerParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +FillerParameter* FillerParameter::default_instance_ = NULL; + +FillerParameter* FillerParameter::New() const { + return new FillerParameter; +} + +void FillerParameter::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 255) { + ZR_(value_, min_); + if (has_type()) { + if (type_ != _default_type_) { + type_->assign(*_default_type_); + } + } + max_ = 1; + mean_ = 0; + std_ = 1; + sparse_ = -1; + variance_norm_ = 0; + } + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool FillerParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:ditcaffe.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())); + } 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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &value_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &min_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &max_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &mean_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &std_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &sparse_))); + set_has_sparse(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(64)) goto parse_variance_norm; + break; + } + + // optional .ditcaffe.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 (::ditcaffe::FillerParameter_VarianceNorm_IsValid(value)) { + set_variance_norm(static_cast< ::ditcaffe::FillerParameter_VarianceNorm >(value)); + } else { + unknown_fields_stream.WriteVarint32(tag); + unknown_fields_stream.WriteVarint32(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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.FillerParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.FillerParameter) + return false; +#undef DO_ +} + +void FillerParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.FillerParameter) + // optional string type = 1 [default = "constant"]; + if (has_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 .ditcaffe.FillerParameter.VarianceNorm variance_norm = 8 [default = FAN_IN]; + if (has_variance_norm()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 8, this->variance_norm(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:ditcaffe.FillerParameter) +} + +int FillerParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // 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 .ditcaffe.FillerParameter.VarianceNorm variance_norm = 8 [default = FAN_IN]; + if (has_variance_norm()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->variance_norm()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void FillerParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void FillerParameter::MergeFrom(const FillerParameter& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_type()) { + set_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()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void FillerParameter::CopyFrom(const FillerParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool FillerParameter::IsInitialized() const { + + return true; +} + +void FillerParameter::Swap(FillerParameter* other) { + if (other != this) { + std::swap(type_, 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]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string FillerParameter::GetTypeName() const { + return "ditcaffe.FillerParameter"; +} + + +// =================================================================== + +#ifndef _MSC_VER +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 // !_MSC_VER + +NetParameter::NetParameter() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.NetParameter) +} + +void NetParameter::InitAsDefaultInstance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + state_ = const_cast< ::ditcaffe::NetState*>( + ::ditcaffe::NetState::internal_default_instance()); +#else + state_ = const_cast< ::ditcaffe::NetState*>(&::ditcaffe::NetState::default_instance()); +#endif +} + +NetParameter::NetParameter(const NetParameter& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.NetParameter) +} + +void NetParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + force_backward_ = false; + state_ = NULL; + debug_info_ = false; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +NetParameter::~NetParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.NetParameter) + SharedDtor(); +} + +void NetParameter::SharedDtor() { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete name_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + delete state_; + } +} + +void NetParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const NetParameter& NetParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +NetParameter* NetParameter::default_instance_ = NULL; + +NetParameter* NetParameter::New() const { + return new NetParameter; +} + +void NetParameter::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 113) { + ZR_(force_backward_, debug_info_); + if (has_name()) { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_->clear(); + } + } + if (has_state()) { + if (state_ != NULL) state_->::ditcaffe::NetState::Clear(); + } + } + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + input_.Clear(); + input_shape_.Clear(); + input_dim_.Clear(); + layer_.Clear(); + layers_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool NetParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:ditcaffe.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())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_layers; + break; + } + + // repeated .ditcaffe.V1LayerParameter layers = 2; + case 2: { + if (tag == 18) { + parse_layers: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_layers())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_layers; + 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())); + } 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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &force_backward_))); + set_has_force_backward(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(50)) goto parse_state; + break; + } + + // optional .ditcaffe.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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &debug_info_))); + set_has_debug_info(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(66)) goto parse_input_shape; + break; + } + + // repeated .ditcaffe.BlobShape input_shape = 8; + case 8: { + if (tag == 66) { + parse_input_shape: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_input_shape())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(66)) goto parse_input_shape; + if (input->ExpectTag(802)) goto parse_layer; + break; + } + + // repeated .ditcaffe.LayerParameter layer = 100; + case 100: { + if (tag == 802) { + parse_layer: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_layer())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(802)) goto parse_layer; + 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, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.NetParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.NetParameter) + return false; +#undef DO_ +} + +void NetParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.NetParameter) + // optional string name = 1; + if (has_name()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // repeated .ditcaffe.V1LayerParameter layers = 2; + for (int i = 0; i < this->layers_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 2, this->layers(i), output); + } + + // repeated string input = 3; + for (int i = 0; i < this->input_size(); i++) { + ::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 .ditcaffe.NetState state = 6; + if (has_state()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 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 .ditcaffe.BlobShape input_shape = 8; + for (int i = 0; i < this->input_shape_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 8, this->input_shape(i), output); + } + + // repeated .ditcaffe.LayerParameter layer = 100; + for (int i = 0; i < this->layer_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 100, this->layer(i), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:ditcaffe.NetParameter) +} + +int NetParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // 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 .ditcaffe.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 * this->input_size(); + for (int i = 0; i < this->input_size(); i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->input(i)); + } + + // repeated .ditcaffe.BlobShape input_shape = 8; + total_size += 1 * this->input_shape_size(); + for (int i = 0; i < this->input_shape_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->input_shape(i)); + } + + // repeated int32 input_dim = 4; + { + int data_size = 0; + for (int i = 0; i < this->input_dim_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + Int32Size(this->input_dim(i)); + } + total_size += 1 * this->input_dim_size() + data_size; + } + + // repeated .ditcaffe.LayerParameter layer = 100; + total_size += 2 * this->layer_size(); + for (int i = 0; i < this->layer_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->layer(i)); + } + + // repeated .ditcaffe.V1LayerParameter layers = 2; + total_size += 1 * this->layers_size(); + for (int i = 0; i < this->layers_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->layers(i)); + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void NetParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void NetParameter::MergeFrom(const NetParameter& from) { + GOOGLE_CHECK_NE(&from, this); + input_.MergeFrom(from.input_); + input_shape_.MergeFrom(from.input_shape_); + input_dim_.MergeFrom(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_name(from.name()); + } + if (from.has_force_backward()) { + set_force_backward(from.force_backward()); + } + if (from.has_state()) { + mutable_state()->::ditcaffe::NetState::MergeFrom(from.state()); + } + if (from.has_debug_info()) { + set_debug_info(from.debug_info()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void NetParameter::CopyFrom(const NetParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool NetParameter::IsInitialized() const { + + return true; +} + +void NetParameter::Swap(NetParameter* other) { + if (other != this) { + std::swap(name_, other->name_); + input_.Swap(&other->input_); + input_shape_.Swap(&other->input_shape_); + input_dim_.Swap(&other->input_dim_); + std::swap(force_backward_, other->force_backward_); + std::swap(state_, other->state_); + std::swap(debug_info_, other->debug_info_); + layer_.Swap(&other->layer_); + layers_.Swap(&other->layers_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string NetParameter::GetTypeName() const { + return "ditcaffe.NetParameter"; +} + + +// =================================================================== + +bool SolverParameter_SnapshotFormat_IsValid(int value) { + switch(value) { + case 0: + case 1: + return true; + default: + return false; + } +} + +#ifndef _MSC_VER +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 // _MSC_VER +bool SolverParameter_SolverMode_IsValid(int value) { + switch(value) { + case 0: + case 1: + return true; + default: + return false; + } +} + +#ifndef _MSC_VER +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 // _MSC_VER +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; + } +} + +#ifndef _MSC_VER +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 // _MSC_VER +::std::string* SolverParameter::_default_regularization_type_ = NULL; +::std::string* SolverParameter::_default_type_ = NULL; +#ifndef _MSC_VER +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 // !_MSC_VER + +SolverParameter::SolverParameter() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.SolverParameter) +} + +void SolverParameter::InitAsDefaultInstance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + net_param_ = const_cast< ::ditcaffe::NetParameter*>( + ::ditcaffe::NetParameter::internal_default_instance()); +#else + net_param_ = const_cast< ::ditcaffe::NetParameter*>(&::ditcaffe::NetParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + train_net_param_ = const_cast< ::ditcaffe::NetParameter*>( + ::ditcaffe::NetParameter::internal_default_instance()); +#else + train_net_param_ = const_cast< ::ditcaffe::NetParameter*>(&::ditcaffe::NetParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + train_state_ = const_cast< ::ditcaffe::NetState*>( + ::ditcaffe::NetState::internal_default_instance()); +#else + train_state_ = const_cast< ::ditcaffe::NetState*>(&::ditcaffe::NetState::default_instance()); +#endif +} + +SolverParameter::SolverParameter(const SolverParameter& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.SolverParameter) +} + +void SolverParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + net_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + net_param_ = NULL; + train_net_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + train_net_param_ = NULL; + train_state_ = NULL; + test_interval_ = 0; + test_compute_loss_ = false; + test_initialization_ = true; + base_lr_ = 0; + display_ = 0; + average_loss_ = 1; + max_iter_ = 0; + iter_size_ = 1; + lr_policy_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + gamma_ = 0; + power_ = 0; + momentum_ = 0; + weight_decay_ = 0; + regularization_type_ = const_cast< ::std::string*>(_default_regularization_type_); + stepsize_ = 0; + clip_gradients_ = -1; + snapshot_ = 0; + snapshot_prefix_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + snapshot_diff_ = false; + snapshot_format_ = 1; + solver_mode_ = 1; + device_id_ = 0; + random_seed_ = GOOGLE_LONGLONG(-1); + type_ = const_cast< ::std::string*>(_default_type_); + delta_ = 1e-08f; + momentum2_ = 0.999f; + rms_decay_ = 0; + debug_info_ = false; + snapshot_after_train_ = true; + solver_type_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +SolverParameter::~SolverParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.SolverParameter) + SharedDtor(); +} + +void SolverParameter::SharedDtor() { + if (net_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete net_; + } + if (train_net_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete train_net_; + } + if (lr_policy_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete lr_policy_; + } + if (regularization_type_ != _default_regularization_type_) { + delete regularization_type_; + } + if (snapshot_prefix_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete snapshot_prefix_; + } + if (type_ != _default_type_) { + delete type_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + 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 SolverParameter& SolverParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +SolverParameter* SolverParameter::default_instance_ = NULL; + +SolverParameter* SolverParameter::New() const { + return new SolverParameter; +} + +void SolverParameter::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 87) { + if (has_net()) { + if (net_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + net_->clear(); + } + } + if (has_net_param()) { + if (net_param_ != NULL) net_param_->::ditcaffe::NetParameter::Clear(); + } + if (has_train_net()) { + if (train_net_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + train_net_->clear(); + } + } + if (has_train_net_param()) { + if (train_net_param_ != NULL) train_net_param_->::ditcaffe::NetParameter::Clear(); + } + if (has_train_state()) { + if (train_state_ != NULL) train_state_->::ditcaffe::NetState::Clear(); + } + } + if (_has_bits_[8 / 32] & 65024) { + ZR_(test_interval_, display_); + test_compute_loss_ = false; + test_initialization_ = true; + average_loss_ = 1; + max_iter_ = 0; + } + if (_has_bits_[16 / 32] & 16711680) { + ZR_(gamma_, weight_decay_); + iter_size_ = 1; + if (has_lr_policy()) { + if (lr_policy_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + lr_policy_->clear(); + } + } + if (has_regularization_type()) { + if (regularization_type_ != _default_regularization_type_) { + regularization_type_->assign(*_default_regularization_type_); + } + } + stepsize_ = 0; + } + if (_has_bits_[24 / 32] & 4261412864) { + clip_gradients_ = -1; + snapshot_ = 0; + if (has_snapshot_prefix()) { + if (snapshot_prefix_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + snapshot_prefix_->clear(); + } + } + snapshot_diff_ = false; + snapshot_format_ = 1; + solver_mode_ = 1; + device_id_ = 0; + } + if (_has_bits_[32 / 32] & 255) { + random_seed_ = GOOGLE_LONGLONG(-1); + if (has_type()) { + if (type_ != _default_type_) { + type_->assign(*_default_type_); + } + } + delta_ = 1e-08f; + momentum2_ = 0.999f; + rms_decay_ = 0; + debug_info_ = false; + snapshot_after_train_ = true; + solver_type_ = 0; + } + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + test_net_.Clear(); + test_net_param_.Clear(); + test_state_.Clear(); + test_iter_.Clear(); + stepvalue_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool SolverParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:ditcaffe.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())); + } 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())); + } 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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &test_interval_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &base_lr_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &display_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &max_iter_))); + set_has_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())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(77)) goto parse_gamma; + break; + } + + // optional float gamma = 9; + case 9: { + if (tag == 77) { + parse_gamma: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &gamma_))); + set_has_gamma(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(85)) goto parse_power; + break; + } + + // optional float power = 10; + case 10: { + if (tag == 85) { + parse_power: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &power_))); + set_has_power(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(93)) goto parse_momentum; + break; + } + + // optional float momentum = 11; + case 11: { + if (tag == 93) { + parse_momentum: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &momentum_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &weight_decay_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &stepsize_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &snapshot_))); + set_has_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())); + } 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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &snapshot_diff_))); + set_has_snapshot_diff(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(136)) goto parse_solver_mode; + break; + } + + // optional .ditcaffe.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 (::ditcaffe::SolverParameter_SolverMode_IsValid(value)) { + set_solver_mode(static_cast< ::ditcaffe::SolverParameter_SolverMode >(value)); + } else { + unknown_fields_stream.WriteVarint32(tag); + unknown_fields_stream.WriteVarint32(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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &device_id_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &test_compute_loss_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &random_seed_))); + set_has_random_seed(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(170)) goto parse_train_net_param; + break; + } + + // optional .ditcaffe.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 .ditcaffe.NetParameter test_net_param = 22; + case 22: { + if (tag == 178) { + parse_test_net_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_test_net_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(178)) goto parse_test_net_param; + if (input->ExpectTag(184)) goto parse_debug_info; + break; + } + + // optional bool debug_info = 23 [default = false]; + case 23: { + if (tag == 184) { + parse_debug_info: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &debug_info_))); + set_has_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())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(202)) goto parse_net_param; + break; + } + + // optional .ditcaffe.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 .ditcaffe.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 .ditcaffe.NetState test_state = 27; + case 27: { + if (tag == 218) { + parse_test_state: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_test_state())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(218)) goto parse_test_state; + 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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &snapshot_after_train_))); + set_has_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())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(240)) goto parse_solver_type; + break; + } + + // optional .ditcaffe.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 (::ditcaffe::SolverParameter_SolverType_IsValid(value)) { + set_solver_type(static_cast< ::ditcaffe::SolverParameter_SolverType >(value)); + } else { + unknown_fields_stream.WriteVarint32(tag); + unknown_fields_stream.WriteVarint32(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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &delta_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &test_initialization_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &average_loss_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &clip_gradients_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &iter_size_))); + set_has_iter_size(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(296)) goto parse_snapshot_format; + break; + } + + // optional .ditcaffe.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 (::ditcaffe::SolverParameter_SnapshotFormat_IsValid(value)) { + set_snapshot_format(static_cast< ::ditcaffe::SolverParameter_SnapshotFormat >(value)); + } else { + unknown_fields_stream.WriteVarint32(tag); + unknown_fields_stream.WriteVarint32(value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(309)) goto parse_rms_decay; + break; + } + + // optional float rms_decay = 38; + case 38: { + if (tag == 309) { + parse_rms_decay: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &rms_decay_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &momentum2_))); + set_has_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())); + } 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, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.SolverParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.SolverParameter) + return false; +#undef DO_ +} + +void SolverParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.SolverParameter) + // optional string train_net = 1; + if (has_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::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::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::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 .ditcaffe.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 .ditcaffe.NetParameter train_net_param = 21; + if (has_train_net_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 21, this->train_net_param(), output); + } + + // repeated .ditcaffe.NetParameter test_net_param = 22; + for (int i = 0; i < this->test_net_param_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 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::WireFormatLite::WriteStringMaybeAliased( + 24, this->net(), output); + } + + // optional .ditcaffe.NetParameter net_param = 25; + if (has_net_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 25, this->net_param(), output); + } + + // optional .ditcaffe.NetState train_state = 26; + if (has_train_state()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 26, this->train_state(), output); + } + + // repeated .ditcaffe.NetState test_state = 27; + for (int i = 0; i < this->test_state_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 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::WireFormatLite::WriteStringMaybeAliased( + 29, this->regularization_type(), output); + } + + // optional .ditcaffe.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 .ditcaffe.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; + 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::WireFormatLite::WriteStringMaybeAliased( + 40, this->type(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:ditcaffe.SolverParameter) +} + +int SolverParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional string net = 24; + if (has_net()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->net()); + } + + // optional .ditcaffe.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 .ditcaffe.NetParameter train_net_param = 21; + if (has_train_net_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->train_net_param()); + } + + // optional .ditcaffe.NetState train_state = 26; + if (has_train_state()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->train_state()); + } + + } + if (_has_bits_[9 / 32] & (0xffu << (9 % 32))) { + // 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] & (0xffu << (16 % 32))) { + // 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] & (0xffu << (25 % 32))) { + // 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 .ditcaffe.SolverParameter.SnapshotFormat snapshot_format = 37 [default = BINARYPROTO]; + if (has_snapshot_format()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->snapshot_format()); + } + + // optional .ditcaffe.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] & (0xffu << (32 % 32))) { + // 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; + 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 .ditcaffe.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 * 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 .ditcaffe.NetParameter test_net_param = 22; + total_size += 2 * this->test_net_param_size(); + for (int i = 0; i < this->test_net_param_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->test_net_param(i)); + } + + // repeated .ditcaffe.NetState test_state = 27; + total_size += 2 * this->test_state_size(); + for (int i = 0; i < this->test_state_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->test_state(i)); + } + + // repeated int32 test_iter = 3; + { + int data_size = 0; + for (int i = 0; i < this->test_iter_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + Int32Size(this->test_iter(i)); + } + total_size += 1 * this->test_iter_size() + data_size; + } + + // repeated int32 stepvalue = 34; + { + int data_size = 0; + for (int i = 0; i < this->stepvalue_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + Int32Size(this->stepvalue(i)); + } + total_size += 2 * this->stepvalue_size() + data_size; + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void SolverParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void SolverParameter::MergeFrom(const SolverParameter& from) { + GOOGLE_CHECK_NE(&from, this); + test_net_.MergeFrom(from.test_net_); + test_net_param_.MergeFrom(from.test_net_param_); + test_state_.MergeFrom(from.test_state_); + test_iter_.MergeFrom(from.test_iter_); + stepvalue_.MergeFrom(from.stepvalue_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_net()) { + set_net(from.net()); + } + if (from.has_net_param()) { + mutable_net_param()->::ditcaffe::NetParameter::MergeFrom(from.net_param()); + } + if (from.has_train_net()) { + set_train_net(from.train_net()); + } + if (from.has_train_net_param()) { + mutable_train_net_param()->::ditcaffe::NetParameter::MergeFrom(from.train_net_param()); + } + if (from.has_train_state()) { + mutable_train_state()->::ditcaffe::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_lr_policy(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_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_snapshot_prefix(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_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()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void SolverParameter::CopyFrom(const SolverParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool SolverParameter::IsInitialized() const { + + return true; +} + +void SolverParameter::Swap(SolverParameter* other) { + if (other != this) { + std::swap(net_, other->net_); + std::swap(net_param_, other->net_param_); + std::swap(train_net_, other->train_net_); + test_net_.Swap(&other->test_net_); + std::swap(train_net_param_, other->train_net_param_); + test_net_param_.Swap(&other->test_net_param_); + std::swap(train_state_, other->train_state_); + test_state_.Swap(&other->test_state_); + test_iter_.Swap(&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_); + std::swap(lr_policy_, 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_); + std::swap(regularization_type_, other->regularization_type_); + std::swap(stepsize_, other->stepsize_); + stepvalue_.Swap(&other->stepvalue_); + std::swap(clip_gradients_, other->clip_gradients_); + std::swap(snapshot_, other->snapshot_); + std::swap(snapshot_prefix_, 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_); + std::swap(type_, 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]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string SolverParameter::GetTypeName() const { + return "ditcaffe.SolverParameter"; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int SolverState::kIterFieldNumber; +const int SolverState::kLearnedNetFieldNumber; +const int SolverState::kHistoryFieldNumber; +const int SolverState::kCurrentStepFieldNumber; +#endif // !_MSC_VER + +SolverState::SolverState() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.SolverState) +} + +void SolverState::InitAsDefaultInstance() { +} + +SolverState::SolverState(const SolverState& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.SolverState) +} + +void SolverState::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + iter_ = 0; + learned_net_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + current_step_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +SolverState::~SolverState() { + // @@protoc_insertion_point(destructor:ditcaffe.SolverState) + SharedDtor(); +} + +void SolverState::SharedDtor() { + if (learned_net_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete learned_net_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void SolverState::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const SolverState& SolverState::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +SolverState* SolverState::default_instance_ = NULL; + +SolverState* SolverState::New() const { + return new SolverState; +} + +void SolverState::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 11) { + ZR_(iter_, current_step_); + if (has_learned_net()) { + if (learned_net_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + learned_net_->clear(); + } + } + } + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + history_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool SolverState::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &iter_))); + set_has_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())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_history; + break; + } + + // repeated .ditcaffe.BlobProto history = 3; + case 3: { + if (tag == 26) { + parse_history: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_history())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_history; + if (input->ExpectTag(32)) goto parse_current_step; + break; + } + + // optional int32 current_step = 4 [default = 0]; + case 4: { + if (tag == 32) { + parse_current_step: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, ¤t_step_))); + set_has_current_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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.SolverState) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.SolverState) + return false; +#undef DO_ +} + +void SolverState::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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::WireFormatLite::WriteStringMaybeAliased( + 2, this->learned_net(), output); + } + + // repeated .ditcaffe.BlobProto history = 3; + for (int i = 0; i < this->history_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 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); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:ditcaffe.SolverState) +} + +int SolverState::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // 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 .ditcaffe.BlobProto history = 3; + total_size += 1 * this->history_size(); + for (int i = 0; i < this->history_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->history(i)); + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void SolverState::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void SolverState::MergeFrom(const SolverState& from) { + GOOGLE_CHECK_NE(&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_learned_net(from.learned_net()); + } + if (from.has_current_step()) { + set_current_step(from.current_step()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void SolverState::CopyFrom(const SolverState& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool SolverState::IsInitialized() const { + + return true; +} + +void SolverState::Swap(SolverState* other) { + if (other != this) { + std::swap(iter_, other->iter_); + std::swap(learned_net_, other->learned_net_); + history_.Swap(&other->history_); + std::swap(current_step_, other->current_step_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string SolverState::GetTypeName() const { + return "ditcaffe.SolverState"; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int NetState::kPhaseFieldNumber; +const int NetState::kLevelFieldNumber; +const int NetState::kStageFieldNumber; +#endif // !_MSC_VER + +NetState::NetState() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.NetState) +} + +void NetState::InitAsDefaultInstance() { +} + +NetState::NetState(const NetState& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.NetState) +} + +void NetState::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + phase_ = 1; + level_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +NetState::~NetState() { + // @@protoc_insertion_point(destructor:ditcaffe.NetState) + SharedDtor(); +} + +void NetState::SharedDtor() { + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void NetState::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const NetState& NetState::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +NetState* NetState::default_instance_ = NULL; + +NetState* NetState::New() const { + return new NetState; +} + +void NetState::Clear() { + if (_has_bits_[0 / 32] & 3) { + phase_ = 1; + level_ = 0; + } + stage_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool NetState::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:ditcaffe.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 .ditcaffe.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 (::ditcaffe::Phase_IsValid(value)) { + set_phase(static_cast< ::ditcaffe::Phase >(value)); + } else { + unknown_fields_stream.WriteVarint32(tag); + unknown_fields_stream.WriteVarint32(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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &level_))); + set_has_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())); + } 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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.NetState) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.NetState) + return false; +#undef DO_ +} + +void NetState::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.NetState) + // optional .ditcaffe.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::WireFormatLite::WriteString( + 3, this->stage(i), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:ditcaffe.NetState) +} + +int NetState::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional .ditcaffe.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 * this->stage_size(); + for (int i = 0; i < this->stage_size(); i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->stage(i)); + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void NetState::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void NetState::MergeFrom(const NetState& from) { + GOOGLE_CHECK_NE(&from, this); + stage_.MergeFrom(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()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void NetState::CopyFrom(const NetState& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool NetState::IsInitialized() const { + + return true; +} + +void NetState::Swap(NetState* other) { + if (other != this) { + std::swap(phase_, other->phase_); + std::swap(level_, other->level_); + stage_.Swap(&other->stage_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string NetState::GetTypeName() const { + return "ditcaffe.NetState"; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int NetStateRule::kPhaseFieldNumber; +const int NetStateRule::kMinLevelFieldNumber; +const int NetStateRule::kMaxLevelFieldNumber; +const int NetStateRule::kStageFieldNumber; +const int NetStateRule::kNotStageFieldNumber; +#endif // !_MSC_VER + +NetStateRule::NetStateRule() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.NetStateRule) +} + +void NetStateRule::InitAsDefaultInstance() { +} + +NetStateRule::NetStateRule(const NetStateRule& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.NetStateRule) +} + +void NetStateRule::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + phase_ = 0; + min_level_ = 0; + max_level_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +NetStateRule::~NetStateRule() { + // @@protoc_insertion_point(destructor:ditcaffe.NetStateRule) + SharedDtor(); +} + +void NetStateRule::SharedDtor() { + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void NetStateRule::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const NetStateRule& NetStateRule::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +NetStateRule* NetStateRule::default_instance_ = NULL; + +NetStateRule* NetStateRule::New() const { + return new NetStateRule; +} + +void NetStateRule::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 7) { + ZR_(phase_, min_level_); + max_level_ = 0; + } + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + stage_.Clear(); + not_stage_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool NetStateRule::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:ditcaffe.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 .ditcaffe.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 (::ditcaffe::Phase_IsValid(value)) { + set_phase(static_cast< ::ditcaffe::Phase >(value)); + } else { + unknown_fields_stream.WriteVarint32(tag); + unknown_fields_stream.WriteVarint32(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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &min_level_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &max_level_))); + set_has_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())); + } 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())); + } 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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.NetStateRule) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.NetStateRule) + return false; +#undef DO_ +} + +void NetStateRule::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.NetStateRule) + // optional .ditcaffe.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::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::WireFormatLite::WriteString( + 5, this->not_stage(i), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:ditcaffe.NetStateRule) +} + +int NetStateRule::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional .ditcaffe.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 * 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 * 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)); + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void NetStateRule::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void NetStateRule::MergeFrom(const NetStateRule& from) { + GOOGLE_CHECK_NE(&from, this); + stage_.MergeFrom(from.stage_); + not_stage_.MergeFrom(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()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void NetStateRule::CopyFrom(const NetStateRule& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool NetStateRule::IsInitialized() const { + + return true; +} + +void NetStateRule::Swap(NetStateRule* other) { + if (other != this) { + std::swap(phase_, other->phase_); + std::swap(min_level_, other->min_level_); + std::swap(max_level_, other->max_level_); + stage_.Swap(&other->stage_); + not_stage_.Swap(&other->not_stage_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string NetStateRule::GetTypeName() const { + return "ditcaffe.NetStateRule"; +} + + +// =================================================================== + +bool ParamSpec_DimCheckMode_IsValid(int value) { + switch(value) { + case 0: + case 1: + return true; + default: + return false; + } +} + +#ifndef _MSC_VER +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 // _MSC_VER +#ifndef _MSC_VER +const int ParamSpec::kNameFieldNumber; +const int ParamSpec::kShareModeFieldNumber; +const int ParamSpec::kLrMultFieldNumber; +const int ParamSpec::kDecayMultFieldNumber; +#endif // !_MSC_VER + +ParamSpec::ParamSpec() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.ParamSpec) +} + +void ParamSpec::InitAsDefaultInstance() { +} + +ParamSpec::ParamSpec(const ParamSpec& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.ParamSpec) +} + +void ParamSpec::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + share_mode_ = 0; + lr_mult_ = 1; + decay_mult_ = 1; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ParamSpec::~ParamSpec() { + // @@protoc_insertion_point(destructor:ditcaffe.ParamSpec) + SharedDtor(); +} + +void ParamSpec::SharedDtor() { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete name_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void ParamSpec::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ParamSpec& ParamSpec::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +ParamSpec* ParamSpec::default_instance_ = NULL; + +ParamSpec* ParamSpec::New() const { + return new ParamSpec; +} + +void ParamSpec::Clear() { + if (_has_bits_[0 / 32] & 15) { + if (has_name()) { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_->clear(); + } + } + share_mode_ = 0; + lr_mult_ = 1; + decay_mult_ = 1; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ParamSpec::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:ditcaffe.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())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_share_mode; + break; + } + + // optional .ditcaffe.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 (::ditcaffe::ParamSpec_DimCheckMode_IsValid(value)) { + set_share_mode(static_cast< ::ditcaffe::ParamSpec_DimCheckMode >(value)); + } else { + unknown_fields_stream.WriteVarint32(tag); + unknown_fields_stream.WriteVarint32(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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &lr_mult_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &decay_mult_))); + set_has_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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.ParamSpec) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.ParamSpec) + return false; +#undef DO_ +} + +void ParamSpec::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.ParamSpec) + // optional string name = 1; + if (has_name()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // optional .ditcaffe.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); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:ditcaffe.ParamSpec) +} + +int ParamSpec::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional string name = 1; + if (has_name()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } + + // optional .ditcaffe.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; + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ParamSpec::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void ParamSpec::MergeFrom(const ParamSpec& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_name()) { + set_name(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()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ParamSpec::CopyFrom(const ParamSpec& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ParamSpec::IsInitialized() const { + + return true; +} + +void ParamSpec::Swap(ParamSpec* other) { + if (other != this) { + std::swap(name_, 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]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ParamSpec::GetTypeName() const { + return "ditcaffe.ParamSpec"; +} + + +// =================================================================== + +#ifndef _MSC_VER +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::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::kParameterParamFieldNumber; +const int LayerParameter::kPoolingParamFieldNumber; +const int LayerParameter::kPowerParamFieldNumber; +const int LayerParameter::kPreluParamFieldNumber; +const int LayerParameter::kPythonParamFieldNumber; +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 // !_MSC_VER + +LayerParameter::LayerParameter() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.LayerParameter) +} + +void LayerParameter::InitAsDefaultInstance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + transform_param_ = const_cast< ::ditcaffe::TransformationParameter*>( + ::ditcaffe::TransformationParameter::internal_default_instance()); +#else + transform_param_ = const_cast< ::ditcaffe::TransformationParameter*>(&::ditcaffe::TransformationParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + loss_param_ = const_cast< ::ditcaffe::LossParameter*>( + ::ditcaffe::LossParameter::internal_default_instance()); +#else + loss_param_ = const_cast< ::ditcaffe::LossParameter*>(&::ditcaffe::LossParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + accuracy_param_ = const_cast< ::ditcaffe::AccuracyParameter*>( + ::ditcaffe::AccuracyParameter::internal_default_instance()); +#else + accuracy_param_ = const_cast< ::ditcaffe::AccuracyParameter*>(&::ditcaffe::AccuracyParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + argmax_param_ = const_cast< ::ditcaffe::ArgMaxParameter*>( + ::ditcaffe::ArgMaxParameter::internal_default_instance()); +#else + argmax_param_ = const_cast< ::ditcaffe::ArgMaxParameter*>(&::ditcaffe::ArgMaxParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + batch_norm_param_ = const_cast< ::ditcaffe::BatchNormParameter*>( + ::ditcaffe::BatchNormParameter::internal_default_instance()); +#else + batch_norm_param_ = const_cast< ::ditcaffe::BatchNormParameter*>(&::ditcaffe::BatchNormParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + bias_param_ = const_cast< ::ditcaffe::BiasParameter*>( + ::ditcaffe::BiasParameter::internal_default_instance()); +#else + bias_param_ = const_cast< ::ditcaffe::BiasParameter*>(&::ditcaffe::BiasParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + concat_param_ = const_cast< ::ditcaffe::ConcatParameter*>( + ::ditcaffe::ConcatParameter::internal_default_instance()); +#else + concat_param_ = const_cast< ::ditcaffe::ConcatParameter*>(&::ditcaffe::ConcatParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + contrastive_loss_param_ = const_cast< ::ditcaffe::ContrastiveLossParameter*>( + ::ditcaffe::ContrastiveLossParameter::internal_default_instance()); +#else + contrastive_loss_param_ = const_cast< ::ditcaffe::ContrastiveLossParameter*>(&::ditcaffe::ContrastiveLossParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + convolution_param_ = const_cast< ::ditcaffe::ConvolutionParameter*>( + ::ditcaffe::ConvolutionParameter::internal_default_instance()); +#else + convolution_param_ = const_cast< ::ditcaffe::ConvolutionParameter*>(&::ditcaffe::ConvolutionParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + crop_param_ = const_cast< ::ditcaffe::CropParameter*>( + ::ditcaffe::CropParameter::internal_default_instance()); +#else + crop_param_ = const_cast< ::ditcaffe::CropParameter*>(&::ditcaffe::CropParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + data_param_ = const_cast< ::ditcaffe::DataParameter*>( + ::ditcaffe::DataParameter::internal_default_instance()); +#else + data_param_ = const_cast< ::ditcaffe::DataParameter*>(&::ditcaffe::DataParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + dropout_param_ = const_cast< ::ditcaffe::DropoutParameter*>( + ::ditcaffe::DropoutParameter::internal_default_instance()); +#else + dropout_param_ = const_cast< ::ditcaffe::DropoutParameter*>(&::ditcaffe::DropoutParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + dummy_data_param_ = const_cast< ::ditcaffe::DummyDataParameter*>( + ::ditcaffe::DummyDataParameter::internal_default_instance()); +#else + dummy_data_param_ = const_cast< ::ditcaffe::DummyDataParameter*>(&::ditcaffe::DummyDataParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + eltwise_param_ = const_cast< ::ditcaffe::EltwiseParameter*>( + ::ditcaffe::EltwiseParameter::internal_default_instance()); +#else + eltwise_param_ = const_cast< ::ditcaffe::EltwiseParameter*>(&::ditcaffe::EltwiseParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + elu_param_ = const_cast< ::ditcaffe::ELUParameter*>( + ::ditcaffe::ELUParameter::internal_default_instance()); +#else + elu_param_ = const_cast< ::ditcaffe::ELUParameter*>(&::ditcaffe::ELUParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + embed_param_ = const_cast< ::ditcaffe::EmbedParameter*>( + ::ditcaffe::EmbedParameter::internal_default_instance()); +#else + embed_param_ = const_cast< ::ditcaffe::EmbedParameter*>(&::ditcaffe::EmbedParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + exp_param_ = const_cast< ::ditcaffe::ExpParameter*>( + ::ditcaffe::ExpParameter::internal_default_instance()); +#else + exp_param_ = const_cast< ::ditcaffe::ExpParameter*>(&::ditcaffe::ExpParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + flatten_param_ = const_cast< ::ditcaffe::FlattenParameter*>( + ::ditcaffe::FlattenParameter::internal_default_instance()); +#else + flatten_param_ = const_cast< ::ditcaffe::FlattenParameter*>(&::ditcaffe::FlattenParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + hdf5_data_param_ = const_cast< ::ditcaffe::HDF5DataParameter*>( + ::ditcaffe::HDF5DataParameter::internal_default_instance()); +#else + hdf5_data_param_ = const_cast< ::ditcaffe::HDF5DataParameter*>(&::ditcaffe::HDF5DataParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + hdf5_output_param_ = const_cast< ::ditcaffe::HDF5OutputParameter*>( + ::ditcaffe::HDF5OutputParameter::internal_default_instance()); +#else + hdf5_output_param_ = const_cast< ::ditcaffe::HDF5OutputParameter*>(&::ditcaffe::HDF5OutputParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + hinge_loss_param_ = const_cast< ::ditcaffe::HingeLossParameter*>( + ::ditcaffe::HingeLossParameter::internal_default_instance()); +#else + hinge_loss_param_ = const_cast< ::ditcaffe::HingeLossParameter*>(&::ditcaffe::HingeLossParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + image_data_param_ = const_cast< ::ditcaffe::ImageDataParameter*>( + ::ditcaffe::ImageDataParameter::internal_default_instance()); +#else + image_data_param_ = const_cast< ::ditcaffe::ImageDataParameter*>(&::ditcaffe::ImageDataParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + infogain_loss_param_ = const_cast< ::ditcaffe::InfogainLossParameter*>( + ::ditcaffe::InfogainLossParameter::internal_default_instance()); +#else + infogain_loss_param_ = const_cast< ::ditcaffe::InfogainLossParameter*>(&::ditcaffe::InfogainLossParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + inner_product_param_ = const_cast< ::ditcaffe::InnerProductParameter*>( + ::ditcaffe::InnerProductParameter::internal_default_instance()); +#else + inner_product_param_ = const_cast< ::ditcaffe::InnerProductParameter*>(&::ditcaffe::InnerProductParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + input_param_ = const_cast< ::ditcaffe::InputParameter*>( + ::ditcaffe::InputParameter::internal_default_instance()); +#else + input_param_ = const_cast< ::ditcaffe::InputParameter*>(&::ditcaffe::InputParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + log_param_ = const_cast< ::ditcaffe::LogParameter*>( + ::ditcaffe::LogParameter::internal_default_instance()); +#else + log_param_ = const_cast< ::ditcaffe::LogParameter*>(&::ditcaffe::LogParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + lrn_param_ = const_cast< ::ditcaffe::LRNParameter*>( + ::ditcaffe::LRNParameter::internal_default_instance()); +#else + lrn_param_ = const_cast< ::ditcaffe::LRNParameter*>(&::ditcaffe::LRNParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + memory_data_param_ = const_cast< ::ditcaffe::MemoryDataParameter*>( + ::ditcaffe::MemoryDataParameter::internal_default_instance()); +#else + memory_data_param_ = const_cast< ::ditcaffe::MemoryDataParameter*>(&::ditcaffe::MemoryDataParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + mvn_param_ = const_cast< ::ditcaffe::MVNParameter*>( + ::ditcaffe::MVNParameter::internal_default_instance()); +#else + mvn_param_ = const_cast< ::ditcaffe::MVNParameter*>(&::ditcaffe::MVNParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + parameter_param_ = const_cast< ::ditcaffe::ParameterParameter*>( + ::ditcaffe::ParameterParameter::internal_default_instance()); +#else + parameter_param_ = const_cast< ::ditcaffe::ParameterParameter*>(&::ditcaffe::ParameterParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + pooling_param_ = const_cast< ::ditcaffe::PoolingParameter*>( + ::ditcaffe::PoolingParameter::internal_default_instance()); +#else + pooling_param_ = const_cast< ::ditcaffe::PoolingParameter*>(&::ditcaffe::PoolingParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + power_param_ = const_cast< ::ditcaffe::PowerParameter*>( + ::ditcaffe::PowerParameter::internal_default_instance()); +#else + power_param_ = const_cast< ::ditcaffe::PowerParameter*>(&::ditcaffe::PowerParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + prelu_param_ = const_cast< ::ditcaffe::PReLUParameter*>( + ::ditcaffe::PReLUParameter::internal_default_instance()); +#else + prelu_param_ = const_cast< ::ditcaffe::PReLUParameter*>(&::ditcaffe::PReLUParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + python_param_ = const_cast< ::ditcaffe::PythonParameter*>( + ::ditcaffe::PythonParameter::internal_default_instance()); +#else + python_param_ = const_cast< ::ditcaffe::PythonParameter*>(&::ditcaffe::PythonParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + reduction_param_ = const_cast< ::ditcaffe::ReductionParameter*>( + ::ditcaffe::ReductionParameter::internal_default_instance()); +#else + reduction_param_ = const_cast< ::ditcaffe::ReductionParameter*>(&::ditcaffe::ReductionParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + relu_param_ = const_cast< ::ditcaffe::ReLUParameter*>( + ::ditcaffe::ReLUParameter::internal_default_instance()); +#else + relu_param_ = const_cast< ::ditcaffe::ReLUParameter*>(&::ditcaffe::ReLUParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + reshape_param_ = const_cast< ::ditcaffe::ReshapeParameter*>( + ::ditcaffe::ReshapeParameter::internal_default_instance()); +#else + reshape_param_ = const_cast< ::ditcaffe::ReshapeParameter*>(&::ditcaffe::ReshapeParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + scale_param_ = const_cast< ::ditcaffe::ScaleParameter*>( + ::ditcaffe::ScaleParameter::internal_default_instance()); +#else + scale_param_ = const_cast< ::ditcaffe::ScaleParameter*>(&::ditcaffe::ScaleParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + sigmoid_param_ = const_cast< ::ditcaffe::SigmoidParameter*>( + ::ditcaffe::SigmoidParameter::internal_default_instance()); +#else + sigmoid_param_ = const_cast< ::ditcaffe::SigmoidParameter*>(&::ditcaffe::SigmoidParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + softmax_param_ = const_cast< ::ditcaffe::SoftmaxParameter*>( + ::ditcaffe::SoftmaxParameter::internal_default_instance()); +#else + softmax_param_ = const_cast< ::ditcaffe::SoftmaxParameter*>(&::ditcaffe::SoftmaxParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + spp_param_ = const_cast< ::ditcaffe::SPPParameter*>( + ::ditcaffe::SPPParameter::internal_default_instance()); +#else + spp_param_ = const_cast< ::ditcaffe::SPPParameter*>(&::ditcaffe::SPPParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + slice_param_ = const_cast< ::ditcaffe::SliceParameter*>( + ::ditcaffe::SliceParameter::internal_default_instance()); +#else + slice_param_ = const_cast< ::ditcaffe::SliceParameter*>(&::ditcaffe::SliceParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + tanh_param_ = const_cast< ::ditcaffe::TanHParameter*>( + ::ditcaffe::TanHParameter::internal_default_instance()); +#else + tanh_param_ = const_cast< ::ditcaffe::TanHParameter*>(&::ditcaffe::TanHParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + threshold_param_ = const_cast< ::ditcaffe::ThresholdParameter*>( + ::ditcaffe::ThresholdParameter::internal_default_instance()); +#else + threshold_param_ = const_cast< ::ditcaffe::ThresholdParameter*>(&::ditcaffe::ThresholdParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + tile_param_ = const_cast< ::ditcaffe::TileParameter*>( + ::ditcaffe::TileParameter::internal_default_instance()); +#else + tile_param_ = const_cast< ::ditcaffe::TileParameter*>(&::ditcaffe::TileParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + window_data_param_ = const_cast< ::ditcaffe::WindowDataParameter*>( + ::ditcaffe::WindowDataParameter::internal_default_instance()); +#else + window_data_param_ = const_cast< ::ditcaffe::WindowDataParameter*>(&::ditcaffe::WindowDataParameter::default_instance()); +#endif +} + +LayerParameter::LayerParameter(const LayerParameter& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.LayerParameter) +} + +void LayerParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + type_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + phase_ = 0; + 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; + 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; + parameter_param_ = NULL; + pooling_param_ = NULL; + power_param_ = NULL; + prelu_param_ = NULL; + python_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; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +LayerParameter::~LayerParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.LayerParameter) + SharedDtor(); +} + +void LayerParameter::SharedDtor() { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete name_; + } + if (type_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete type_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + 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 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 parameter_param_; + delete pooling_param_; + delete power_param_; + delete prelu_param_; + delete python_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 LayerParameter& LayerParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +LayerParameter* LayerParameter::default_instance_ = NULL; + +LayerParameter* LayerParameter::New() const { + return new LayerParameter; +} + +void LayerParameter::Clear() { + if (_has_bits_[0 / 32] & 19) { + if (has_name()) { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_->clear(); + } + } + if (has_type()) { + if (type_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + type_->clear(); + } + } + phase_ = 0; + } + if (_has_bits_[8 / 32] & 63488) { + if (has_transform_param()) { + if (transform_param_ != NULL) transform_param_->::ditcaffe::TransformationParameter::Clear(); + } + if (has_loss_param()) { + if (loss_param_ != NULL) loss_param_->::ditcaffe::LossParameter::Clear(); + } + if (has_accuracy_param()) { + if (accuracy_param_ != NULL) accuracy_param_->::ditcaffe::AccuracyParameter::Clear(); + } + if (has_argmax_param()) { + if (argmax_param_ != NULL) argmax_param_->::ditcaffe::ArgMaxParameter::Clear(); + } + if (has_batch_norm_param()) { + if (batch_norm_param_ != NULL) batch_norm_param_->::ditcaffe::BatchNormParameter::Clear(); + } + } + if (_has_bits_[16 / 32] & 16711680) { + if (has_bias_param()) { + if (bias_param_ != NULL) bias_param_->::ditcaffe::BiasParameter::Clear(); + } + if (has_concat_param()) { + if (concat_param_ != NULL) concat_param_->::ditcaffe::ConcatParameter::Clear(); + } + if (has_contrastive_loss_param()) { + if (contrastive_loss_param_ != NULL) contrastive_loss_param_->::ditcaffe::ContrastiveLossParameter::Clear(); + } + if (has_convolution_param()) { + if (convolution_param_ != NULL) convolution_param_->::ditcaffe::ConvolutionParameter::Clear(); + } + if (has_crop_param()) { + if (crop_param_ != NULL) crop_param_->::ditcaffe::CropParameter::Clear(); + } + if (has_data_param()) { + if (data_param_ != NULL) data_param_->::ditcaffe::DataParameter::Clear(); + } + if (has_dropout_param()) { + if (dropout_param_ != NULL) dropout_param_->::ditcaffe::DropoutParameter::Clear(); + } + if (has_dummy_data_param()) { + if (dummy_data_param_ != NULL) dummy_data_param_->::ditcaffe::DummyDataParameter::Clear(); + } + } + if (_has_bits_[24 / 32] & 4278190080) { + if (has_eltwise_param()) { + if (eltwise_param_ != NULL) eltwise_param_->::ditcaffe::EltwiseParameter::Clear(); + } + if (has_elu_param()) { + if (elu_param_ != NULL) elu_param_->::ditcaffe::ELUParameter::Clear(); + } + if (has_embed_param()) { + if (embed_param_ != NULL) embed_param_->::ditcaffe::EmbedParameter::Clear(); + } + if (has_exp_param()) { + if (exp_param_ != NULL) exp_param_->::ditcaffe::ExpParameter::Clear(); + } + if (has_flatten_param()) { + if (flatten_param_ != NULL) flatten_param_->::ditcaffe::FlattenParameter::Clear(); + } + if (has_hdf5_data_param()) { + if (hdf5_data_param_ != NULL) hdf5_data_param_->::ditcaffe::HDF5DataParameter::Clear(); + } + if (has_hdf5_output_param()) { + if (hdf5_output_param_ != NULL) hdf5_output_param_->::ditcaffe::HDF5OutputParameter::Clear(); + } + if (has_hinge_loss_param()) { + if (hinge_loss_param_ != NULL) hinge_loss_param_->::ditcaffe::HingeLossParameter::Clear(); + } + } + if (_has_bits_[32 / 32] & 255) { + if (has_image_data_param()) { + if (image_data_param_ != NULL) image_data_param_->::ditcaffe::ImageDataParameter::Clear(); + } + if (has_infogain_loss_param()) { + if (infogain_loss_param_ != NULL) infogain_loss_param_->::ditcaffe::InfogainLossParameter::Clear(); + } + if (has_inner_product_param()) { + if (inner_product_param_ != NULL) inner_product_param_->::ditcaffe::InnerProductParameter::Clear(); + } + if (has_input_param()) { + if (input_param_ != NULL) input_param_->::ditcaffe::InputParameter::Clear(); + } + if (has_log_param()) { + if (log_param_ != NULL) log_param_->::ditcaffe::LogParameter::Clear(); + } + if (has_lrn_param()) { + if (lrn_param_ != NULL) lrn_param_->::ditcaffe::LRNParameter::Clear(); + } + if (has_memory_data_param()) { + if (memory_data_param_ != NULL) memory_data_param_->::ditcaffe::MemoryDataParameter::Clear(); + } + if (has_mvn_param()) { + if (mvn_param_ != NULL) mvn_param_->::ditcaffe::MVNParameter::Clear(); + } + } + if (_has_bits_[40 / 32] & 65280) { + if (has_parameter_param()) { + if (parameter_param_ != NULL) parameter_param_->::ditcaffe::ParameterParameter::Clear(); + } + if (has_pooling_param()) { + if (pooling_param_ != NULL) pooling_param_->::ditcaffe::PoolingParameter::Clear(); + } + if (has_power_param()) { + if (power_param_ != NULL) power_param_->::ditcaffe::PowerParameter::Clear(); + } + if (has_prelu_param()) { + if (prelu_param_ != NULL) prelu_param_->::ditcaffe::PReLUParameter::Clear(); + } + if (has_python_param()) { + if (python_param_ != NULL) python_param_->::ditcaffe::PythonParameter::Clear(); + } + if (has_reduction_param()) { + if (reduction_param_ != NULL) reduction_param_->::ditcaffe::ReductionParameter::Clear(); + } + if (has_relu_param()) { + if (relu_param_ != NULL) relu_param_->::ditcaffe::ReLUParameter::Clear(); + } + if (has_reshape_param()) { + if (reshape_param_ != NULL) reshape_param_->::ditcaffe::ReshapeParameter::Clear(); + } + } + if (_has_bits_[48 / 32] & 16711680) { + if (has_scale_param()) { + if (scale_param_ != NULL) scale_param_->::ditcaffe::ScaleParameter::Clear(); + } + if (has_sigmoid_param()) { + if (sigmoid_param_ != NULL) sigmoid_param_->::ditcaffe::SigmoidParameter::Clear(); + } + if (has_softmax_param()) { + if (softmax_param_ != NULL) softmax_param_->::ditcaffe::SoftmaxParameter::Clear(); + } + if (has_spp_param()) { + if (spp_param_ != NULL) spp_param_->::ditcaffe::SPPParameter::Clear(); + } + if (has_slice_param()) { + if (slice_param_ != NULL) slice_param_->::ditcaffe::SliceParameter::Clear(); + } + if (has_tanh_param()) { + if (tanh_param_ != NULL) tanh_param_->::ditcaffe::TanHParameter::Clear(); + } + if (has_threshold_param()) { + if (threshold_param_ != NULL) threshold_param_->::ditcaffe::ThresholdParameter::Clear(); + } + if (has_tile_param()) { + if (tile_param_ != NULL) tile_param_->::ditcaffe::TileParameter::Clear(); + } + } + if (has_window_data_param()) { + if (window_data_param_ != NULL) window_data_param_->::ditcaffe::WindowDataParameter::Clear(); + } + bottom_.Clear(); + top_.Clear(); + loss_weight_.Clear(); + param_.Clear(); + blobs_.Clear(); + propagate_down_.Clear(); + include_.Clear(); + exclude_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool LayerParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:ditcaffe.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())); + } 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())); + } 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())); + } 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())); + } 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 .ditcaffe.ParamSpec param = 6; + case 6: { + if (tag == 50) { + parse_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_param())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(50)) goto parse_param; + if (input->ExpectTag(58)) goto parse_blobs; + break; + } + + // repeated .ditcaffe.BlobProto blobs = 7; + case 7: { + if (tag == 58) { + parse_blobs: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_blobs())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(58)) goto parse_blobs; + if (input->ExpectTag(66)) goto parse_include; + break; + } + + // repeated .ditcaffe.NetStateRule include = 8; + case 8: { + if (tag == 66) { + parse_include: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_include())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(66)) goto parse_include; + if (input->ExpectTag(74)) goto parse_exclude; + break; + } + + // repeated .ditcaffe.NetStateRule exclude = 9; + case 9: { + if (tag == 74) { + parse_exclude: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_exclude())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(74)) goto parse_exclude; + if (input->ExpectTag(80)) goto parse_phase; + break; + } + + // optional .ditcaffe.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 (::ditcaffe::Phase_IsValid(value)) { + set_phase(static_cast< ::ditcaffe::Phase >(value)); + } else { + unknown_fields_stream.WriteVarint32(tag); + unknown_fields_stream.WriteVarint32(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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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->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, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.LayerParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.LayerParameter) + return false; +#undef DO_ +} + +void LayerParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.LayerParameter) + // optional string name = 1; + if (has_name()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // optional string type = 2; + if (has_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::WireFormatLite::WriteString( + 3, this->bottom(i), output); + } + + // repeated string top = 4; + for (int i = 0; i < this->top_size(); i++) { + ::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 .ditcaffe.ParamSpec param = 6; + for (int i = 0; i < this->param_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 6, this->param(i), output); + } + + // repeated .ditcaffe.BlobProto blobs = 7; + for (int i = 0; i < this->blobs_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 7, this->blobs(i), output); + } + + // repeated .ditcaffe.NetStateRule include = 8; + for (int i = 0; i < this->include_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 8, this->include(i), output); + } + + // repeated .ditcaffe.NetStateRule exclude = 9; + for (int i = 0; i < this->exclude_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 9, this->exclude(i), output); + } + + // optional .ditcaffe.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 .ditcaffe.TransformationParameter transform_param = 100; + if (has_transform_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 100, this->transform_param(), output); + } + + // optional .ditcaffe.LossParameter loss_param = 101; + if (has_loss_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 101, this->loss_param(), output); + } + + // optional .ditcaffe.AccuracyParameter accuracy_param = 102; + if (has_accuracy_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 102, this->accuracy_param(), output); + } + + // optional .ditcaffe.ArgMaxParameter argmax_param = 103; + if (has_argmax_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 103, this->argmax_param(), output); + } + + // optional .ditcaffe.ConcatParameter concat_param = 104; + if (has_concat_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 104, this->concat_param(), output); + } + + // optional .ditcaffe.ContrastiveLossParameter contrastive_loss_param = 105; + if (has_contrastive_loss_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 105, this->contrastive_loss_param(), output); + } + + // optional .ditcaffe.ConvolutionParameter convolution_param = 106; + if (has_convolution_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 106, this->convolution_param(), output); + } + + // optional .ditcaffe.DataParameter data_param = 107; + if (has_data_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 107, this->data_param(), output); + } + + // optional .ditcaffe.DropoutParameter dropout_param = 108; + if (has_dropout_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 108, this->dropout_param(), output); + } + + // optional .ditcaffe.DummyDataParameter dummy_data_param = 109; + if (has_dummy_data_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 109, this->dummy_data_param(), output); + } + + // optional .ditcaffe.EltwiseParameter eltwise_param = 110; + if (has_eltwise_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 110, this->eltwise_param(), output); + } + + // optional .ditcaffe.ExpParameter exp_param = 111; + if (has_exp_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 111, this->exp_param(), output); + } + + // optional .ditcaffe.HDF5DataParameter hdf5_data_param = 112; + if (has_hdf5_data_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 112, this->hdf5_data_param(), output); + } + + // optional .ditcaffe.HDF5OutputParameter hdf5_output_param = 113; + if (has_hdf5_output_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 113, this->hdf5_output_param(), output); + } + + // optional .ditcaffe.HingeLossParameter hinge_loss_param = 114; + if (has_hinge_loss_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 114, this->hinge_loss_param(), output); + } + + // optional .ditcaffe.ImageDataParameter image_data_param = 115; + if (has_image_data_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 115, this->image_data_param(), output); + } + + // optional .ditcaffe.InfogainLossParameter infogain_loss_param = 116; + if (has_infogain_loss_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 116, this->infogain_loss_param(), output); + } + + // optional .ditcaffe.InnerProductParameter inner_product_param = 117; + if (has_inner_product_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 117, this->inner_product_param(), output); + } + + // optional .ditcaffe.LRNParameter lrn_param = 118; + if (has_lrn_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 118, this->lrn_param(), output); + } + + // optional .ditcaffe.MemoryDataParameter memory_data_param = 119; + if (has_memory_data_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 119, this->memory_data_param(), output); + } + + // optional .ditcaffe.MVNParameter mvn_param = 120; + if (has_mvn_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 120, this->mvn_param(), output); + } + + // optional .ditcaffe.PoolingParameter pooling_param = 121; + if (has_pooling_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 121, this->pooling_param(), output); + } + + // optional .ditcaffe.PowerParameter power_param = 122; + if (has_power_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 122, this->power_param(), output); + } + + // optional .ditcaffe.ReLUParameter relu_param = 123; + if (has_relu_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 123, this->relu_param(), output); + } + + // optional .ditcaffe.SigmoidParameter sigmoid_param = 124; + if (has_sigmoid_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 124, this->sigmoid_param(), output); + } + + // optional .ditcaffe.SoftmaxParameter softmax_param = 125; + if (has_softmax_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 125, this->softmax_param(), output); + } + + // optional .ditcaffe.SliceParameter slice_param = 126; + if (has_slice_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 126, this->slice_param(), output); + } + + // optional .ditcaffe.TanHParameter tanh_param = 127; + if (has_tanh_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 127, this->tanh_param(), output); + } + + // optional .ditcaffe.ThresholdParameter threshold_param = 128; + if (has_threshold_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 128, this->threshold_param(), output); + } + + // optional .ditcaffe.WindowDataParameter window_data_param = 129; + if (has_window_data_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 129, this->window_data_param(), output); + } + + // optional .ditcaffe.PythonParameter python_param = 130; + if (has_python_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 130, this->python_param(), output); + } + + // optional .ditcaffe.PReLUParameter prelu_param = 131; + if (has_prelu_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 131, this->prelu_param(), output); + } + + // optional .ditcaffe.SPPParameter spp_param = 132; + if (has_spp_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 132, this->spp_param(), output); + } + + // optional .ditcaffe.ReshapeParameter reshape_param = 133; + if (has_reshape_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 133, this->reshape_param(), output); + } + + // optional .ditcaffe.LogParameter log_param = 134; + if (has_log_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 134, this->log_param(), output); + } + + // optional .ditcaffe.FlattenParameter flatten_param = 135; + if (has_flatten_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 135, this->flatten_param(), output); + } + + // optional .ditcaffe.ReductionParameter reduction_param = 136; + if (has_reduction_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 136, this->reduction_param(), output); + } + + // optional .ditcaffe.EmbedParameter embed_param = 137; + if (has_embed_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 137, this->embed_param(), output); + } + + // optional .ditcaffe.TileParameter tile_param = 138; + if (has_tile_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 138, this->tile_param(), output); + } + + // optional .ditcaffe.BatchNormParameter batch_norm_param = 139; + if (has_batch_norm_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 139, this->batch_norm_param(), output); + } + + // optional .ditcaffe.ELUParameter elu_param = 140; + if (has_elu_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 140, this->elu_param(), output); + } + + // optional .ditcaffe.BiasParameter bias_param = 141; + if (has_bias_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 141, this->bias_param(), output); + } + + // optional .ditcaffe.ScaleParameter scale_param = 142; + if (has_scale_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 142, this->scale_param(), output); + } + + // optional .ditcaffe.InputParameter input_param = 143; + if (has_input_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 143, this->input_param(), output); + } + + // optional .ditcaffe.CropParameter crop_param = 144; + if (has_crop_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 144, this->crop_param(), output); + } + + // optional .ditcaffe.ParameterParameter parameter_param = 145; + if (has_parameter_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 145, this->parameter_param(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:ditcaffe.LayerParameter) +} + +int LayerParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // 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 .ditcaffe.Phase phase = 10; + if (has_phase()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->phase()); + } + + } + if (_has_bits_[11 / 32] & (0xffu << (11 % 32))) { + // optional .ditcaffe.TransformationParameter transform_param = 100; + if (has_transform_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->transform_param()); + } + + // optional .ditcaffe.LossParameter loss_param = 101; + if (has_loss_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->loss_param()); + } + + // optional .ditcaffe.AccuracyParameter accuracy_param = 102; + if (has_accuracy_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->accuracy_param()); + } + + // optional .ditcaffe.ArgMaxParameter argmax_param = 103; + if (has_argmax_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->argmax_param()); + } + + // optional .ditcaffe.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] & (0xffu << (16 % 32))) { + // optional .ditcaffe.BiasParameter bias_param = 141; + if (has_bias_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->bias_param()); + } + + // optional .ditcaffe.ConcatParameter concat_param = 104; + if (has_concat_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->concat_param()); + } + + // optional .ditcaffe.ContrastiveLossParameter contrastive_loss_param = 105; + if (has_contrastive_loss_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->contrastive_loss_param()); + } + + // optional .ditcaffe.ConvolutionParameter convolution_param = 106; + if (has_convolution_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->convolution_param()); + } + + // optional .ditcaffe.CropParameter crop_param = 144; + if (has_crop_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->crop_param()); + } + + // optional .ditcaffe.DataParameter data_param = 107; + if (has_data_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->data_param()); + } + + // optional .ditcaffe.DropoutParameter dropout_param = 108; + if (has_dropout_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->dropout_param()); + } + + // optional .ditcaffe.DummyDataParameter dummy_data_param = 109; + if (has_dummy_data_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->dummy_data_param()); + } + + } + if (_has_bits_[24 / 32] & (0xffu << (24 % 32))) { + // optional .ditcaffe.EltwiseParameter eltwise_param = 110; + if (has_eltwise_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->eltwise_param()); + } + + // optional .ditcaffe.ELUParameter elu_param = 140; + if (has_elu_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->elu_param()); + } + + // optional .ditcaffe.EmbedParameter embed_param = 137; + if (has_embed_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->embed_param()); + } + + // optional .ditcaffe.ExpParameter exp_param = 111; + if (has_exp_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->exp_param()); + } + + // optional .ditcaffe.FlattenParameter flatten_param = 135; + if (has_flatten_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->flatten_param()); + } + + // optional .ditcaffe.HDF5DataParameter hdf5_data_param = 112; + if (has_hdf5_data_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->hdf5_data_param()); + } + + // optional .ditcaffe.HDF5OutputParameter hdf5_output_param = 113; + if (has_hdf5_output_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->hdf5_output_param()); + } + + // optional .ditcaffe.HingeLossParameter hinge_loss_param = 114; + if (has_hinge_loss_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->hinge_loss_param()); + } + + } + if (_has_bits_[32 / 32] & (0xffu << (32 % 32))) { + // optional .ditcaffe.ImageDataParameter image_data_param = 115; + if (has_image_data_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->image_data_param()); + } + + // optional .ditcaffe.InfogainLossParameter infogain_loss_param = 116; + if (has_infogain_loss_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->infogain_loss_param()); + } + + // optional .ditcaffe.InnerProductParameter inner_product_param = 117; + if (has_inner_product_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->inner_product_param()); + } + + // optional .ditcaffe.InputParameter input_param = 143; + if (has_input_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->input_param()); + } + + // optional .ditcaffe.LogParameter log_param = 134; + if (has_log_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->log_param()); + } + + // optional .ditcaffe.LRNParameter lrn_param = 118; + if (has_lrn_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->lrn_param()); + } + + // optional .ditcaffe.MemoryDataParameter memory_data_param = 119; + if (has_memory_data_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->memory_data_param()); + } + + // optional .ditcaffe.MVNParameter mvn_param = 120; + if (has_mvn_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->mvn_param()); + } + + } + if (_has_bits_[40 / 32] & (0xffu << (40 % 32))) { + // optional .ditcaffe.ParameterParameter parameter_param = 145; + if (has_parameter_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->parameter_param()); + } + + // optional .ditcaffe.PoolingParameter pooling_param = 121; + if (has_pooling_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->pooling_param()); + } + + // optional .ditcaffe.PowerParameter power_param = 122; + if (has_power_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->power_param()); + } + + // optional .ditcaffe.PReLUParameter prelu_param = 131; + if (has_prelu_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->prelu_param()); + } + + // optional .ditcaffe.PythonParameter python_param = 130; + if (has_python_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->python_param()); + } + + // optional .ditcaffe.ReductionParameter reduction_param = 136; + if (has_reduction_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->reduction_param()); + } + + // optional .ditcaffe.ReLUParameter relu_param = 123; + if (has_relu_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->relu_param()); + } + + // optional .ditcaffe.ReshapeParameter reshape_param = 133; + if (has_reshape_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->reshape_param()); + } + + } + if (_has_bits_[48 / 32] & (0xffu << (48 % 32))) { + // optional .ditcaffe.ScaleParameter scale_param = 142; + if (has_scale_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->scale_param()); + } + + // optional .ditcaffe.SigmoidParameter sigmoid_param = 124; + if (has_sigmoid_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->sigmoid_param()); + } + + // optional .ditcaffe.SoftmaxParameter softmax_param = 125; + if (has_softmax_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->softmax_param()); + } + + // optional .ditcaffe.SPPParameter spp_param = 132; + if (has_spp_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->spp_param()); + } + + // optional .ditcaffe.SliceParameter slice_param = 126; + if (has_slice_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->slice_param()); + } + + // optional .ditcaffe.TanHParameter tanh_param = 127; + if (has_tanh_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->tanh_param()); + } + + // optional .ditcaffe.ThresholdParameter threshold_param = 128; + if (has_threshold_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->threshold_param()); + } + + // optional .ditcaffe.TileParameter tile_param = 138; + if (has_tile_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->tile_param()); + } + + } + if (_has_bits_[56 / 32] & (0xffu << (56 % 32))) { + // optional .ditcaffe.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 * 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 * 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; + { + int data_size = 0; + data_size = 4 * this->loss_weight_size(); + total_size += 1 * this->loss_weight_size() + data_size; + } + + // repeated .ditcaffe.ParamSpec param = 6; + total_size += 1 * this->param_size(); + for (int i = 0; i < this->param_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->param(i)); + } + + // repeated .ditcaffe.BlobProto blobs = 7; + total_size += 1 * this->blobs_size(); + for (int i = 0; i < this->blobs_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->blobs(i)); + } + + // repeated bool propagate_down = 11; + { + int data_size = 0; + data_size = 1 * this->propagate_down_size(); + total_size += 1 * this->propagate_down_size() + data_size; + } + + // repeated .ditcaffe.NetStateRule include = 8; + total_size += 1 * this->include_size(); + for (int i = 0; i < this->include_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->include(i)); + } + + // repeated .ditcaffe.NetStateRule exclude = 9; + total_size += 1 * this->exclude_size(); + for (int i = 0; i < this->exclude_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->exclude(i)); + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void LayerParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void LayerParameter::MergeFrom(const LayerParameter& from) { + GOOGLE_CHECK_NE(&from, this); + bottom_.MergeFrom(from.bottom_); + top_.MergeFrom(from.top_); + loss_weight_.MergeFrom(from.loss_weight_); + param_.MergeFrom(from.param_); + blobs_.MergeFrom(from.blobs_); + propagate_down_.MergeFrom(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_name(from.name()); + } + if (from.has_type()) { + set_type(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()->::ditcaffe::TransformationParameter::MergeFrom(from.transform_param()); + } + if (from.has_loss_param()) { + mutable_loss_param()->::ditcaffe::LossParameter::MergeFrom(from.loss_param()); + } + if (from.has_accuracy_param()) { + mutable_accuracy_param()->::ditcaffe::AccuracyParameter::MergeFrom(from.accuracy_param()); + } + if (from.has_argmax_param()) { + mutable_argmax_param()->::ditcaffe::ArgMaxParameter::MergeFrom(from.argmax_param()); + } + if (from.has_batch_norm_param()) { + mutable_batch_norm_param()->::ditcaffe::BatchNormParameter::MergeFrom(from.batch_norm_param()); + } + } + if (from._has_bits_[16 / 32] & (0xffu << (16 % 32))) { + if (from.has_bias_param()) { + mutable_bias_param()->::ditcaffe::BiasParameter::MergeFrom(from.bias_param()); + } + if (from.has_concat_param()) { + mutable_concat_param()->::ditcaffe::ConcatParameter::MergeFrom(from.concat_param()); + } + if (from.has_contrastive_loss_param()) { + mutable_contrastive_loss_param()->::ditcaffe::ContrastiveLossParameter::MergeFrom(from.contrastive_loss_param()); + } + if (from.has_convolution_param()) { + mutable_convolution_param()->::ditcaffe::ConvolutionParameter::MergeFrom(from.convolution_param()); + } + if (from.has_crop_param()) { + mutable_crop_param()->::ditcaffe::CropParameter::MergeFrom(from.crop_param()); + } + if (from.has_data_param()) { + mutable_data_param()->::ditcaffe::DataParameter::MergeFrom(from.data_param()); + } + if (from.has_dropout_param()) { + mutable_dropout_param()->::ditcaffe::DropoutParameter::MergeFrom(from.dropout_param()); + } + if (from.has_dummy_data_param()) { + mutable_dummy_data_param()->::ditcaffe::DummyDataParameter::MergeFrom(from.dummy_data_param()); + } + } + if (from._has_bits_[24 / 32] & (0xffu << (24 % 32))) { + if (from.has_eltwise_param()) { + mutable_eltwise_param()->::ditcaffe::EltwiseParameter::MergeFrom(from.eltwise_param()); + } + if (from.has_elu_param()) { + mutable_elu_param()->::ditcaffe::ELUParameter::MergeFrom(from.elu_param()); + } + if (from.has_embed_param()) { + mutable_embed_param()->::ditcaffe::EmbedParameter::MergeFrom(from.embed_param()); + } + if (from.has_exp_param()) { + mutable_exp_param()->::ditcaffe::ExpParameter::MergeFrom(from.exp_param()); + } + if (from.has_flatten_param()) { + mutable_flatten_param()->::ditcaffe::FlattenParameter::MergeFrom(from.flatten_param()); + } + if (from.has_hdf5_data_param()) { + mutable_hdf5_data_param()->::ditcaffe::HDF5DataParameter::MergeFrom(from.hdf5_data_param()); + } + if (from.has_hdf5_output_param()) { + mutable_hdf5_output_param()->::ditcaffe::HDF5OutputParameter::MergeFrom(from.hdf5_output_param()); + } + if (from.has_hinge_loss_param()) { + mutable_hinge_loss_param()->::ditcaffe::HingeLossParameter::MergeFrom(from.hinge_loss_param()); + } + } + if (from._has_bits_[32 / 32] & (0xffu << (32 % 32))) { + if (from.has_image_data_param()) { + mutable_image_data_param()->::ditcaffe::ImageDataParameter::MergeFrom(from.image_data_param()); + } + if (from.has_infogain_loss_param()) { + mutable_infogain_loss_param()->::ditcaffe::InfogainLossParameter::MergeFrom(from.infogain_loss_param()); + } + if (from.has_inner_product_param()) { + mutable_inner_product_param()->::ditcaffe::InnerProductParameter::MergeFrom(from.inner_product_param()); + } + if (from.has_input_param()) { + mutable_input_param()->::ditcaffe::InputParameter::MergeFrom(from.input_param()); + } + if (from.has_log_param()) { + mutable_log_param()->::ditcaffe::LogParameter::MergeFrom(from.log_param()); + } + if (from.has_lrn_param()) { + mutable_lrn_param()->::ditcaffe::LRNParameter::MergeFrom(from.lrn_param()); + } + if (from.has_memory_data_param()) { + mutable_memory_data_param()->::ditcaffe::MemoryDataParameter::MergeFrom(from.memory_data_param()); + } + if (from.has_mvn_param()) { + mutable_mvn_param()->::ditcaffe::MVNParameter::MergeFrom(from.mvn_param()); + } + } + if (from._has_bits_[40 / 32] & (0xffu << (40 % 32))) { + if (from.has_parameter_param()) { + mutable_parameter_param()->::ditcaffe::ParameterParameter::MergeFrom(from.parameter_param()); + } + if (from.has_pooling_param()) { + mutable_pooling_param()->::ditcaffe::PoolingParameter::MergeFrom(from.pooling_param()); + } + if (from.has_power_param()) { + mutable_power_param()->::ditcaffe::PowerParameter::MergeFrom(from.power_param()); + } + if (from.has_prelu_param()) { + mutable_prelu_param()->::ditcaffe::PReLUParameter::MergeFrom(from.prelu_param()); + } + if (from.has_python_param()) { + mutable_python_param()->::ditcaffe::PythonParameter::MergeFrom(from.python_param()); + } + if (from.has_reduction_param()) { + mutable_reduction_param()->::ditcaffe::ReductionParameter::MergeFrom(from.reduction_param()); + } + if (from.has_relu_param()) { + mutable_relu_param()->::ditcaffe::ReLUParameter::MergeFrom(from.relu_param()); + } + if (from.has_reshape_param()) { + mutable_reshape_param()->::ditcaffe::ReshapeParameter::MergeFrom(from.reshape_param()); + } + } + if (from._has_bits_[48 / 32] & (0xffu << (48 % 32))) { + if (from.has_scale_param()) { + mutable_scale_param()->::ditcaffe::ScaleParameter::MergeFrom(from.scale_param()); + } + if (from.has_sigmoid_param()) { + mutable_sigmoid_param()->::ditcaffe::SigmoidParameter::MergeFrom(from.sigmoid_param()); + } + if (from.has_softmax_param()) { + mutable_softmax_param()->::ditcaffe::SoftmaxParameter::MergeFrom(from.softmax_param()); + } + if (from.has_spp_param()) { + mutable_spp_param()->::ditcaffe::SPPParameter::MergeFrom(from.spp_param()); + } + if (from.has_slice_param()) { + mutable_slice_param()->::ditcaffe::SliceParameter::MergeFrom(from.slice_param()); + } + if (from.has_tanh_param()) { + mutable_tanh_param()->::ditcaffe::TanHParameter::MergeFrom(from.tanh_param()); + } + if (from.has_threshold_param()) { + mutable_threshold_param()->::ditcaffe::ThresholdParameter::MergeFrom(from.threshold_param()); + } + if (from.has_tile_param()) { + mutable_tile_param()->::ditcaffe::TileParameter::MergeFrom(from.tile_param()); + } + } + if (from._has_bits_[56 / 32] & (0xffu << (56 % 32))) { + if (from.has_window_data_param()) { + mutable_window_data_param()->::ditcaffe::WindowDataParameter::MergeFrom(from.window_data_param()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void LayerParameter::CopyFrom(const LayerParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool LayerParameter::IsInitialized() const { + + return true; +} + +void LayerParameter::Swap(LayerParameter* other) { + if (other != this) { + std::swap(name_, other->name_); + std::swap(type_, other->type_); + bottom_.Swap(&other->bottom_); + top_.Swap(&other->top_); + std::swap(phase_, other->phase_); + loss_weight_.Swap(&other->loss_weight_); + param_.Swap(&other->param_); + blobs_.Swap(&other->blobs_); + propagate_down_.Swap(&other->propagate_down_); + include_.Swap(&other->include_); + exclude_.Swap(&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(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(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(python_param_, other->python_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]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string LayerParameter::GetTypeName() const { + return "ditcaffe.LayerParameter"; +} + + +// =================================================================== + +#ifndef _MSC_VER +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 // !_MSC_VER + +TransformationParameter::TransformationParameter() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.TransformationParameter) +} + +void TransformationParameter::InitAsDefaultInstance() { +} + +TransformationParameter::TransformationParameter(const TransformationParameter& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.TransformationParameter) +} + +void TransformationParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + scale_ = 1; + mirror_ = false; + crop_size_ = 0u; + mean_file_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + force_color_ = false; + force_gray_ = false; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +TransformationParameter::~TransformationParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.TransformationParameter) + SharedDtor(); +} + +void TransformationParameter::SharedDtor() { + if (mean_file_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete mean_file_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void TransformationParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const TransformationParameter& TransformationParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +TransformationParameter* TransformationParameter::default_instance_ = NULL; + +TransformationParameter* TransformationParameter::New() const { + return new TransformationParameter; +} + +void TransformationParameter::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 111) { + ZR_(mirror_, force_gray_); + scale_ = 1; + crop_size_ = 0u; + if (has_mean_file()) { + if (mean_file_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + mean_file_->clear(); + } + } + } + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + mean_value_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool TransformationParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &scale_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &mirror_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &crop_size_))); + set_has_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())); + } 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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &force_color_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &force_gray_))); + set_has_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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.TransformationParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.TransformationParameter) + return false; +#undef DO_ +} + +void TransformationParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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::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); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:ditcaffe.TransformationParameter) +} + +int TransformationParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // 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; + { + int data_size = 0; + data_size = 4 * this->mean_value_size(); + total_size += 1 * this->mean_value_size() + data_size; + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void TransformationParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void TransformationParameter::MergeFrom(const TransformationParameter& from) { + GOOGLE_CHECK_NE(&from, this); + mean_value_.MergeFrom(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_mean_file(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()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void TransformationParameter::CopyFrom(const TransformationParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool TransformationParameter::IsInitialized() const { + + return true; +} + +void TransformationParameter::Swap(TransformationParameter* other) { + if (other != this) { + std::swap(scale_, other->scale_); + std::swap(mirror_, other->mirror_); + std::swap(crop_size_, other->crop_size_); + std::swap(mean_file_, other->mean_file_); + mean_value_.Swap(&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]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string TransformationParameter::GetTypeName() const { + return "ditcaffe.TransformationParameter"; +} + + +// =================================================================== + +bool LossParameter_NormalizationMode_IsValid(int value) { + switch(value) { + case 0: + case 1: + case 2: + case 3: + return true; + default: + return false; + } +} + +#ifndef _MSC_VER +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 // _MSC_VER +#ifndef _MSC_VER +const int LossParameter::kIgnoreLabelFieldNumber; +const int LossParameter::kNormalizationFieldNumber; +const int LossParameter::kNormalizeFieldNumber; +#endif // !_MSC_VER + +LossParameter::LossParameter() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.LossParameter) +} + +void LossParameter::InitAsDefaultInstance() { +} + +LossParameter::LossParameter(const LossParameter& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.LossParameter) +} + +void LossParameter::SharedCtor() { + _cached_size_ = 0; + ignore_label_ = 0; + normalization_ = 1; + normalize_ = false; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +LossParameter::~LossParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.LossParameter) + SharedDtor(); +} + +void LossParameter::SharedDtor() { + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void LossParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const LossParameter& LossParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +LossParameter* LossParameter::default_instance_ = NULL; + +LossParameter* LossParameter::New() const { + return new LossParameter; +} + +void LossParameter::Clear() { + if (_has_bits_[0 / 32] & 7) { + ignore_label_ = 0; + normalization_ = 1; + normalize_ = false; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool LossParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &ignore_label_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &normalize_))); + set_has_normalize(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(24)) goto parse_normalization; + break; + } + + // optional .ditcaffe.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 (::ditcaffe::LossParameter_NormalizationMode_IsValid(value)) { + set_normalization(static_cast< ::ditcaffe::LossParameter_NormalizationMode >(value)); + } else { + unknown_fields_stream.WriteVarint32(tag); + unknown_fields_stream.WriteVarint32(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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.LossParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.LossParameter) + return false; +#undef DO_ +} + +void LossParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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 .ditcaffe.LossParameter.NormalizationMode normalization = 3 [default = VALID]; + if (has_normalization()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 3, this->normalization(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:ditcaffe.LossParameter) +} + +int LossParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional int32 ignore_label = 1; + if (has_ignore_label()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->ignore_label()); + } + + // optional .ditcaffe.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; + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void LossParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void LossParameter::MergeFrom(const LossParameter& from) { + GOOGLE_CHECK_NE(&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()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void LossParameter::CopyFrom(const LossParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool LossParameter::IsInitialized() const { + + return true; +} + +void LossParameter::Swap(LossParameter* other) { + if (other != this) { + 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]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string LossParameter::GetTypeName() const { + return "ditcaffe.LossParameter"; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int AccuracyParameter::kTopKFieldNumber; +const int AccuracyParameter::kAxisFieldNumber; +const int AccuracyParameter::kIgnoreLabelFieldNumber; +#endif // !_MSC_VER + +AccuracyParameter::AccuracyParameter() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.AccuracyParameter) +} + +void AccuracyParameter::InitAsDefaultInstance() { +} + +AccuracyParameter::AccuracyParameter(const AccuracyParameter& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.AccuracyParameter) +} + +void AccuracyParameter::SharedCtor() { + _cached_size_ = 0; + top_k_ = 1u; + axis_ = 1; + ignore_label_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +AccuracyParameter::~AccuracyParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.AccuracyParameter) + SharedDtor(); +} + +void AccuracyParameter::SharedDtor() { + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void AccuracyParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const AccuracyParameter& AccuracyParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +AccuracyParameter* AccuracyParameter::default_instance_ = NULL; + +AccuracyParameter* AccuracyParameter::New() const { + return new AccuracyParameter; +} + +void AccuracyParameter::Clear() { + if (_has_bits_[0 / 32] & 7) { + top_k_ = 1u; + axis_ = 1; + ignore_label_ = 0; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool AccuracyParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &top_k_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &ignore_label_))); + set_has_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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.AccuracyParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.AccuracyParameter) + return false; +#undef DO_ +} + +void AccuracyParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:ditcaffe.AccuracyParameter) +} + +int AccuracyParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // 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()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void AccuracyParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void AccuracyParameter::MergeFrom(const AccuracyParameter& from) { + GOOGLE_CHECK_NE(&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()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void AccuracyParameter::CopyFrom(const AccuracyParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool AccuracyParameter::IsInitialized() const { + + return true; +} + +void AccuracyParameter::Swap(AccuracyParameter* other) { + if (other != this) { + 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]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string AccuracyParameter::GetTypeName() const { + return "ditcaffe.AccuracyParameter"; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int ArgMaxParameter::kOutMaxValFieldNumber; +const int ArgMaxParameter::kTopKFieldNumber; +const int ArgMaxParameter::kAxisFieldNumber; +#endif // !_MSC_VER + +ArgMaxParameter::ArgMaxParameter() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.ArgMaxParameter) +} + +void ArgMaxParameter::InitAsDefaultInstance() { +} + +ArgMaxParameter::ArgMaxParameter(const ArgMaxParameter& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.ArgMaxParameter) +} + +void ArgMaxParameter::SharedCtor() { + _cached_size_ = 0; + out_max_val_ = false; + top_k_ = 1u; + axis_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ArgMaxParameter::~ArgMaxParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.ArgMaxParameter) + SharedDtor(); +} + +void ArgMaxParameter::SharedDtor() { + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void ArgMaxParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ArgMaxParameter& ArgMaxParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +ArgMaxParameter* ArgMaxParameter::default_instance_ = NULL; + +ArgMaxParameter* ArgMaxParameter::New() const { + return new ArgMaxParameter; +} + +void ArgMaxParameter::Clear() { + if (_has_bits_[0 / 32] & 7) { + out_max_val_ = false; + top_k_ = 1u; + axis_ = 0; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ArgMaxParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &out_max_val_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &top_k_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + set_has_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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.ArgMaxParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.ArgMaxParameter) + return false; +#undef DO_ +} + +void ArgMaxParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:ditcaffe.ArgMaxParameter) +} + +int ArgMaxParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // 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()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ArgMaxParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void ArgMaxParameter::MergeFrom(const ArgMaxParameter& from) { + GOOGLE_CHECK_NE(&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()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ArgMaxParameter::CopyFrom(const ArgMaxParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ArgMaxParameter::IsInitialized() const { + + return true; +} + +void ArgMaxParameter::Swap(ArgMaxParameter* other) { + if (other != this) { + 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]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ArgMaxParameter::GetTypeName() const { + return "ditcaffe.ArgMaxParameter"; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int ConcatParameter::kAxisFieldNumber; +const int ConcatParameter::kConcatDimFieldNumber; +#endif // !_MSC_VER + +ConcatParameter::ConcatParameter() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.ConcatParameter) +} + +void ConcatParameter::InitAsDefaultInstance() { +} + +ConcatParameter::ConcatParameter(const ConcatParameter& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.ConcatParameter) +} + +void ConcatParameter::SharedCtor() { + _cached_size_ = 0; + axis_ = 1; + concat_dim_ = 1u; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ConcatParameter::~ConcatParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.ConcatParameter) + SharedDtor(); +} + +void ConcatParameter::SharedDtor() { + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void ConcatParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ConcatParameter& ConcatParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +ConcatParameter* ConcatParameter::default_instance_ = NULL; + +ConcatParameter* ConcatParameter::New() const { + return new ConcatParameter; +} + +void ConcatParameter::Clear() { + if (_has_bits_[0 / 32] & 3) { + axis_ = 1; + concat_dim_ = 1u; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ConcatParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &concat_dim_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + set_has_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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.ConcatParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.ConcatParameter) + return false; +#undef DO_ +} + +void ConcatParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:ditcaffe.ConcatParameter) +} + +int ConcatParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // 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()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ConcatParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void ConcatParameter::MergeFrom(const ConcatParameter& from) { + GOOGLE_CHECK_NE(&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()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ConcatParameter::CopyFrom(const ConcatParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ConcatParameter::IsInitialized() const { + + return true; +} + +void ConcatParameter::Swap(ConcatParameter* other) { + if (other != this) { + std::swap(axis_, other->axis_); + std::swap(concat_dim_, other->concat_dim_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ConcatParameter::GetTypeName() const { + return "ditcaffe.ConcatParameter"; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int BatchNormParameter::kUseGlobalStatsFieldNumber; +const int BatchNormParameter::kMovingAverageFractionFieldNumber; +const int BatchNormParameter::kEpsFieldNumber; +#endif // !_MSC_VER + +BatchNormParameter::BatchNormParameter() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.BatchNormParameter) +} + +void BatchNormParameter::InitAsDefaultInstance() { +} + +BatchNormParameter::BatchNormParameter(const BatchNormParameter& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.BatchNormParameter) +} + +void BatchNormParameter::SharedCtor() { + _cached_size_ = 0; + use_global_stats_ = false; + moving_average_fraction_ = 0.999f; + eps_ = 1e-05f; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +BatchNormParameter::~BatchNormParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.BatchNormParameter) + SharedDtor(); +} + +void BatchNormParameter::SharedDtor() { + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void BatchNormParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const BatchNormParameter& BatchNormParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +BatchNormParameter* BatchNormParameter::default_instance_ = NULL; + +BatchNormParameter* BatchNormParameter::New() const { + return new BatchNormParameter; +} + +void BatchNormParameter::Clear() { + if (_has_bits_[0 / 32] & 7) { + use_global_stats_ = false; + moving_average_fraction_ = 0.999f; + eps_ = 1e-05f; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool BatchNormParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &use_global_stats_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &moving_average_fraction_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &eps_))); + set_has_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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.BatchNormParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.BatchNormParameter) + return false; +#undef DO_ +} + +void BatchNormParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:ditcaffe.BatchNormParameter) +} + +int BatchNormParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // 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; + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void BatchNormParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void BatchNormParameter::MergeFrom(const BatchNormParameter& from) { + GOOGLE_CHECK_NE(&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()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void BatchNormParameter::CopyFrom(const BatchNormParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool BatchNormParameter::IsInitialized() const { + + return true; +} + +void BatchNormParameter::Swap(BatchNormParameter* other) { + if (other != this) { + 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]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string BatchNormParameter::GetTypeName() const { + return "ditcaffe.BatchNormParameter"; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int BiasParameter::kAxisFieldNumber; +const int BiasParameter::kNumAxesFieldNumber; +const int BiasParameter::kFillerFieldNumber; +#endif // !_MSC_VER + +BiasParameter::BiasParameter() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.BiasParameter) +} + +void BiasParameter::InitAsDefaultInstance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + filler_ = const_cast< ::ditcaffe::FillerParameter*>( + ::ditcaffe::FillerParameter::internal_default_instance()); +#else + filler_ = const_cast< ::ditcaffe::FillerParameter*>(&::ditcaffe::FillerParameter::default_instance()); +#endif +} + +BiasParameter::BiasParameter(const BiasParameter& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.BiasParameter) +} + +void BiasParameter::SharedCtor() { + _cached_size_ = 0; + axis_ = 1; + num_axes_ = 1; + filler_ = NULL; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +BiasParameter::~BiasParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.BiasParameter) + SharedDtor(); +} + +void BiasParameter::SharedDtor() { + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + delete filler_; + } +} + +void BiasParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const BiasParameter& BiasParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +BiasParameter* BiasParameter::default_instance_ = NULL; + +BiasParameter* BiasParameter::New() const { + return new BiasParameter; +} + +void BiasParameter::Clear() { + if (_has_bits_[0 / 32] & 7) { + axis_ = 1; + num_axes_ = 1; + if (has_filler()) { + if (filler_ != NULL) filler_->::ditcaffe::FillerParameter::Clear(); + } + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool BiasParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &num_axes_))); + set_has_num_axes(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_filler; + break; + } + + // optional .ditcaffe.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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.BiasParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.BiasParameter) + return false; +#undef DO_ +} + +void BiasParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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 .ditcaffe.FillerParameter filler = 3; + if (has_filler()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 3, this->filler(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:ditcaffe.BiasParameter) +} + +int BiasParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // 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 .ditcaffe.FillerParameter filler = 3; + if (has_filler()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->filler()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void BiasParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void BiasParameter::MergeFrom(const BiasParameter& from) { + GOOGLE_CHECK_NE(&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()->::ditcaffe::FillerParameter::MergeFrom(from.filler()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void BiasParameter::CopyFrom(const BiasParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool BiasParameter::IsInitialized() const { + + return true; +} + +void BiasParameter::Swap(BiasParameter* other) { + if (other != this) { + 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]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string BiasParameter::GetTypeName() const { + return "ditcaffe.BiasParameter"; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int ContrastiveLossParameter::kMarginFieldNumber; +const int ContrastiveLossParameter::kLegacyVersionFieldNumber; +#endif // !_MSC_VER + +ContrastiveLossParameter::ContrastiveLossParameter() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.ContrastiveLossParameter) +} + +void ContrastiveLossParameter::InitAsDefaultInstance() { +} + +ContrastiveLossParameter::ContrastiveLossParameter(const ContrastiveLossParameter& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.ContrastiveLossParameter) +} + +void ContrastiveLossParameter::SharedCtor() { + _cached_size_ = 0; + margin_ = 1; + legacy_version_ = false; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ContrastiveLossParameter::~ContrastiveLossParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.ContrastiveLossParameter) + SharedDtor(); +} + +void ContrastiveLossParameter::SharedDtor() { + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void ContrastiveLossParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ContrastiveLossParameter& ContrastiveLossParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +ContrastiveLossParameter* ContrastiveLossParameter::default_instance_ = NULL; + +ContrastiveLossParameter* ContrastiveLossParameter::New() const { + return new ContrastiveLossParameter; +} + +void ContrastiveLossParameter::Clear() { + if (_has_bits_[0 / 32] & 3) { + margin_ = 1; + legacy_version_ = false; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ContrastiveLossParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &margin_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &legacy_version_))); + set_has_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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.ContrastiveLossParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.ContrastiveLossParameter) + return false; +#undef DO_ +} + +void ContrastiveLossParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:ditcaffe.ContrastiveLossParameter) +} + +int ContrastiveLossParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // 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; + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ContrastiveLossParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void ContrastiveLossParameter::MergeFrom(const ContrastiveLossParameter& from) { + GOOGLE_CHECK_NE(&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()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ContrastiveLossParameter::CopyFrom(const ContrastiveLossParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ContrastiveLossParameter::IsInitialized() const { + + return true; +} + +void ContrastiveLossParameter::Swap(ContrastiveLossParameter* other) { + if (other != this) { + std::swap(margin_, other->margin_); + std::swap(legacy_version_, other->legacy_version_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ContrastiveLossParameter::GetTypeName() const { + return "ditcaffe.ContrastiveLossParameter"; +} + + +// =================================================================== + +bool ConvolutionParameter_Engine_IsValid(int value) { + switch(value) { + case 0: + case 1: + case 2: + return true; + default: + return false; + } +} + +#ifndef _MSC_VER +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 // _MSC_VER +#ifndef _MSC_VER +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 // !_MSC_VER + +ConvolutionParameter::ConvolutionParameter() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.ConvolutionParameter) +} + +void ConvolutionParameter::InitAsDefaultInstance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + weight_filler_ = const_cast< ::ditcaffe::FillerParameter*>( + ::ditcaffe::FillerParameter::internal_default_instance()); +#else + weight_filler_ = const_cast< ::ditcaffe::FillerParameter*>(&::ditcaffe::FillerParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + bias_filler_ = const_cast< ::ditcaffe::FillerParameter*>( + ::ditcaffe::FillerParameter::internal_default_instance()); +#else + bias_filler_ = const_cast< ::ditcaffe::FillerParameter*>(&::ditcaffe::FillerParameter::default_instance()); +#endif +} + +ConvolutionParameter::ConvolutionParameter(const ConvolutionParameter& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.ConvolutionParameter) +} + +void ConvolutionParameter::SharedCtor() { + _cached_size_ = 0; + num_output_ = 0u; + bias_term_ = true; + pad_h_ = 0u; + pad_w_ = 0u; + kernel_h_ = 0u; + kernel_w_ = 0u; + stride_h_ = 0u; + stride_w_ = 0u; + group_ = 1u; + weight_filler_ = NULL; + bias_filler_ = NULL; + engine_ = 0; + axis_ = 1; + force_nd_im2col_ = false; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ConvolutionParameter::~ConvolutionParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.ConvolutionParameter) + SharedDtor(); +} + +void ConvolutionParameter::SharedDtor() { + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + 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 ConvolutionParameter& ConvolutionParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +ConvolutionParameter* ConvolutionParameter::default_instance_ = NULL; + +ConvolutionParameter* ConvolutionParameter::New() const { + return new ConvolutionParameter; +} + +void ConvolutionParameter::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 195) { + ZR_(num_output_, pad_h_); + bias_term_ = true; + pad_w_ = 0u; + } + if (_has_bits_[8 / 32] & 65280) { + ZR_(kernel_h_, kernel_w_); + ZR_(stride_h_, stride_w_); + group_ = 1u; + if (has_weight_filler()) { + if (weight_filler_ != NULL) weight_filler_->::ditcaffe::FillerParameter::Clear(); + } + if (has_bias_filler()) { + if (bias_filler_ != NULL) bias_filler_->::ditcaffe::FillerParameter::Clear(); + } + engine_ = 0; + } + if (_has_bits_[16 / 32] & 196608) { + axis_ = 1; + force_nd_im2col_ = false; + } + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + pad_.Clear(); + kernel_size_.Clear(); + stride_.Clear(); + dilation_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ConvolutionParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &num_output_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &bias_term_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &group_))); + set_has_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 .ditcaffe.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 .ditcaffe.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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &pad_h_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &pad_w_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &kernel_h_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &kernel_w_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &stride_h_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &stride_w_))); + set_has_stride_w(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(120)) goto parse_engine; + break; + } + + // optional .ditcaffe.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 (::ditcaffe::ConvolutionParameter_Engine_IsValid(value)) { + set_engine(static_cast< ::ditcaffe::ConvolutionParameter_Engine >(value)); + } else { + unknown_fields_stream.WriteVarint32(tag); + unknown_fields_stream.WriteVarint32(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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &force_nd_im2col_))); + set_has_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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.ConvolutionParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.ConvolutionParameter) + return false; +#undef DO_ +} + +void ConvolutionParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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 .ditcaffe.FillerParameter weight_filler = 7; + if (has_weight_filler()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 7, this->weight_filler(), output); + } + + // optional .ditcaffe.FillerParameter bias_filler = 8; + if (has_bias_filler()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 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 .ditcaffe.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); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:ditcaffe.ConvolutionParameter) +} + +int ConvolutionParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // 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] & (0xffu << (8 % 32))) { + // 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 .ditcaffe.FillerParameter weight_filler = 7; + if (has_weight_filler()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->weight_filler()); + } + + // optional .ditcaffe.FillerParameter bias_filler = 8; + if (has_bias_filler()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->bias_filler()); + } + + // optional .ditcaffe.ConvolutionParameter.Engine engine = 15 [default = DEFAULT]; + if (has_engine()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->engine()); + } + + } + if (_has_bits_[16 / 32] & (0xffu << (16 % 32))) { + // 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; + { + int data_size = 0; + for (int i = 0; i < this->pad_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->pad(i)); + } + total_size += 1 * this->pad_size() + data_size; + } + + // repeated uint32 kernel_size = 4; + { + int data_size = 0; + for (int i = 0; i < this->kernel_size_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->kernel_size(i)); + } + total_size += 1 * this->kernel_size_size() + data_size; + } + + // repeated uint32 stride = 6; + { + int data_size = 0; + for (int i = 0; i < this->stride_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->stride(i)); + } + total_size += 1 * this->stride_size() + data_size; + } + + // repeated uint32 dilation = 18; + { + int data_size = 0; + for (int i = 0; i < this->dilation_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->dilation(i)); + } + total_size += 2 * this->dilation_size() + data_size; + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ConvolutionParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void ConvolutionParameter::MergeFrom(const ConvolutionParameter& from) { + GOOGLE_CHECK_NE(&from, this); + pad_.MergeFrom(from.pad_); + kernel_size_.MergeFrom(from.kernel_size_); + stride_.MergeFrom(from.stride_); + dilation_.MergeFrom(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()->::ditcaffe::FillerParameter::MergeFrom(from.weight_filler()); + } + if (from.has_bias_filler()) { + mutable_bias_filler()->::ditcaffe::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()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ConvolutionParameter::CopyFrom(const ConvolutionParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ConvolutionParameter::IsInitialized() const { + + return true; +} + +void ConvolutionParameter::Swap(ConvolutionParameter* other) { + if (other != this) { + std::swap(num_output_, other->num_output_); + std::swap(bias_term_, other->bias_term_); + pad_.Swap(&other->pad_); + kernel_size_.Swap(&other->kernel_size_); + stride_.Swap(&other->stride_); + dilation_.Swap(&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]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ConvolutionParameter::GetTypeName() const { + return "ditcaffe.ConvolutionParameter"; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int CropParameter::kAxisFieldNumber; +const int CropParameter::kOffsetFieldNumber; +#endif // !_MSC_VER + +CropParameter::CropParameter() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.CropParameter) +} + +void CropParameter::InitAsDefaultInstance() { +} + +CropParameter::CropParameter(const CropParameter& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.CropParameter) +} + +void CropParameter::SharedCtor() { + _cached_size_ = 0; + axis_ = 2; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +CropParameter::~CropParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.CropParameter) + SharedDtor(); +} + +void CropParameter::SharedDtor() { + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void CropParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const CropParameter& CropParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +CropParameter* CropParameter::default_instance_ = NULL; + +CropParameter* CropParameter::New() const { + return new CropParameter; +} + +void CropParameter::Clear() { + axis_ = 2; + offset_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool CropParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + set_has_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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.CropParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.CropParameter) + return false; +#undef DO_ +} + +void CropParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:ditcaffe.CropParameter) +} + +int CropParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional int32 axis = 1 [default = 2]; + if (has_axis()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->axis()); + } + + } + // repeated uint32 offset = 2; + { + int data_size = 0; + for (int i = 0; i < this->offset_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->offset(i)); + } + total_size += 1 * this->offset_size() + data_size; + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void CropParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void CropParameter::MergeFrom(const CropParameter& from) { + GOOGLE_CHECK_NE(&from, this); + offset_.MergeFrom(from.offset_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_axis()) { + set_axis(from.axis()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void CropParameter::CopyFrom(const CropParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool CropParameter::IsInitialized() const { + + return true; +} + +void CropParameter::Swap(CropParameter* other) { + if (other != this) { + std::swap(axis_, other->axis_); + offset_.Swap(&other->offset_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string CropParameter::GetTypeName() const { + return "ditcaffe.CropParameter"; +} + + +// =================================================================== + +bool DataParameter_DB_IsValid(int value) { + switch(value) { + case 0: + case 1: + return true; + default: + return false; + } +} + +#ifndef _MSC_VER +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 // _MSC_VER +#ifndef _MSC_VER +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 // !_MSC_VER + +DataParameter::DataParameter() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.DataParameter) +} + +void DataParameter::InitAsDefaultInstance() { +} + +DataParameter::DataParameter(const DataParameter& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.DataParameter) +} + +void DataParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + source_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + batch_size_ = 0u; + rand_skip_ = 0u; + backend_ = 0; + scale_ = 1; + mean_file_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + crop_size_ = 0u; + mirror_ = false; + force_encoded_color_ = false; + prefetch_ = 4u; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +DataParameter::~DataParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.DataParameter) + SharedDtor(); +} + +void DataParameter::SharedDtor() { + if (source_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete source_; + } + if (mean_file_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete mean_file_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void DataParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const DataParameter& DataParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +DataParameter* DataParameter::default_instance_ = NULL; + +DataParameter* DataParameter::New() const { + return new DataParameter; +} + +void DataParameter::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 255) { + ZR_(batch_size_, backend_); + ZR_(crop_size_, mirror_); + if (has_source()) { + if (source_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_->clear(); + } + } + scale_ = 1; + if (has_mean_file()) { + if (mean_file_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + mean_file_->clear(); + } + } + } + if (_has_bits_[8 / 32] & 768) { + force_encoded_color_ = false; + prefetch_ = 4u; + } + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool DataParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:ditcaffe.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())); + } 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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &scale_))); + set_has_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())); + } 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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &batch_size_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &crop_size_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &mirror_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &rand_skip_))); + set_has_rand_skip(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(64)) goto parse_backend; + break; + } + + // optional .ditcaffe.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 (::ditcaffe::DataParameter_DB_IsValid(value)) { + set_backend(static_cast< ::ditcaffe::DataParameter_DB >(value)); + } else { + unknown_fields_stream.WriteVarint32(tag); + unknown_fields_stream.WriteVarint32(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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &force_encoded_color_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &prefetch_))); + set_has_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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.DataParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.DataParameter) + return false; +#undef DO_ +} + +void DataParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.DataParameter) + // optional string source = 1; + if (has_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::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 .ditcaffe.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); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:ditcaffe.DataParameter) +} + +int DataParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // 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 .ditcaffe.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] & (0xffu << (8 % 32))) { + // 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()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void DataParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void DataParameter::MergeFrom(const DataParameter& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_source()) { + set_source(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_mean_file(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()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void DataParameter::CopyFrom(const DataParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool DataParameter::IsInitialized() const { + + return true; +} + +void DataParameter::Swap(DataParameter* other) { + if (other != this) { + std::swap(source_, 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_); + std::swap(mean_file_, 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]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string DataParameter::GetTypeName() const { + return "ditcaffe.DataParameter"; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int DropoutParameter::kDropoutRatioFieldNumber; +#endif // !_MSC_VER + +DropoutParameter::DropoutParameter() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.DropoutParameter) +} + +void DropoutParameter::InitAsDefaultInstance() { +} + +DropoutParameter::DropoutParameter(const DropoutParameter& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.DropoutParameter) +} + +void DropoutParameter::SharedCtor() { + _cached_size_ = 0; + dropout_ratio_ = 0.5f; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +DropoutParameter::~DropoutParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.DropoutParameter) + SharedDtor(); +} + +void DropoutParameter::SharedDtor() { + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void DropoutParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const DropoutParameter& DropoutParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +DropoutParameter* DropoutParameter::default_instance_ = NULL; + +DropoutParameter* DropoutParameter::New() const { + return new DropoutParameter; +} + +void DropoutParameter::Clear() { + dropout_ratio_ = 0.5f; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool DropoutParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &dropout_ratio_))); + set_has_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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.DropoutParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.DropoutParameter) + return false; +#undef DO_ +} + +void DropoutParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.DropoutParameter) + // optional float dropout_ratio = 1 [default = 0.5]; + if (has_dropout_ratio()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->dropout_ratio(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:ditcaffe.DropoutParameter) +} + +int DropoutParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional float dropout_ratio = 1 [default = 0.5]; + if (has_dropout_ratio()) { + total_size += 1 + 4; + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void DropoutParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void DropoutParameter::MergeFrom(const DropoutParameter& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_dropout_ratio()) { + set_dropout_ratio(from.dropout_ratio()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void DropoutParameter::CopyFrom(const DropoutParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool DropoutParameter::IsInitialized() const { + + return true; +} + +void DropoutParameter::Swap(DropoutParameter* other) { + if (other != this) { + std::swap(dropout_ratio_, other->dropout_ratio_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string DropoutParameter::GetTypeName() const { + return "ditcaffe.DropoutParameter"; +} + + +// =================================================================== + +#ifndef _MSC_VER +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 // !_MSC_VER + +DummyDataParameter::DummyDataParameter() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.DummyDataParameter) +} + +void DummyDataParameter::InitAsDefaultInstance() { +} + +DummyDataParameter::DummyDataParameter(const DummyDataParameter& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.DummyDataParameter) +} + +void DummyDataParameter::SharedCtor() { + _cached_size_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +DummyDataParameter::~DummyDataParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.DummyDataParameter) + SharedDtor(); +} + +void DummyDataParameter::SharedDtor() { + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void DummyDataParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const DummyDataParameter& DummyDataParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +DummyDataParameter* DummyDataParameter::default_instance_ = NULL; + +DummyDataParameter* DummyDataParameter::New() const { + return new DummyDataParameter; +} + +void DummyDataParameter::Clear() { + data_filler_.Clear(); + shape_.Clear(); + num_.Clear(); + channels_.Clear(); + height_.Clear(); + width_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool DummyDataParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:ditcaffe.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 .ditcaffe.FillerParameter data_filler = 1; + case 1: { + if (tag == 10) { + parse_data_filler: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_data_filler())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(10)) goto parse_data_filler; + 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 .ditcaffe.BlobShape shape = 6; + case 6: { + if (tag == 50) { + parse_shape: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_shape())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(50)) goto parse_shape; + 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, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.DummyDataParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.DummyDataParameter) + return false; +#undef DO_ +} + +void DummyDataParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.DummyDataParameter) + // repeated .ditcaffe.FillerParameter data_filler = 1; + for (int i = 0; i < this->data_filler_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 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 .ditcaffe.BlobShape shape = 6; + for (int i = 0; i < this->shape_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 6, this->shape(i), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:ditcaffe.DummyDataParameter) +} + +int DummyDataParameter::ByteSize() const { + int total_size = 0; + + // repeated .ditcaffe.FillerParameter data_filler = 1; + total_size += 1 * this->data_filler_size(); + for (int i = 0; i < this->data_filler_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->data_filler(i)); + } + + // repeated .ditcaffe.BlobShape shape = 6; + total_size += 1 * this->shape_size(); + for (int i = 0; i < this->shape_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->shape(i)); + } + + // repeated uint32 num = 2; + { + int data_size = 0; + for (int i = 0; i < this->num_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->num(i)); + } + total_size += 1 * this->num_size() + data_size; + } + + // repeated uint32 channels = 3; + { + int data_size = 0; + for (int i = 0; i < this->channels_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->channels(i)); + } + total_size += 1 * this->channels_size() + data_size; + } + + // repeated uint32 height = 4; + { + int data_size = 0; + for (int i = 0; i < this->height_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->height(i)); + } + total_size += 1 * this->height_size() + data_size; + } + + // repeated uint32 width = 5; + { + int data_size = 0; + for (int i = 0; i < this->width_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->width(i)); + } + total_size += 1 * this->width_size() + data_size; + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void DummyDataParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void DummyDataParameter::MergeFrom(const DummyDataParameter& from) { + GOOGLE_CHECK_NE(&from, this); + data_filler_.MergeFrom(from.data_filler_); + shape_.MergeFrom(from.shape_); + num_.MergeFrom(from.num_); + channels_.MergeFrom(from.channels_); + height_.MergeFrom(from.height_); + width_.MergeFrom(from.width_); + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void DummyDataParameter::CopyFrom(const DummyDataParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool DummyDataParameter::IsInitialized() const { + + return true; +} + +void DummyDataParameter::Swap(DummyDataParameter* other) { + if (other != this) { + data_filler_.Swap(&other->data_filler_); + shape_.Swap(&other->shape_); + num_.Swap(&other->num_); + channels_.Swap(&other->channels_); + height_.Swap(&other->height_); + width_.Swap(&other->width_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string DummyDataParameter::GetTypeName() const { + return "ditcaffe.DummyDataParameter"; +} + + +// =================================================================== + +bool EltwiseParameter_EltwiseOp_IsValid(int value) { + switch(value) { + case 0: + case 1: + case 2: + return true; + default: + return false; + } +} + +#ifndef _MSC_VER +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 // _MSC_VER +#ifndef _MSC_VER +const int EltwiseParameter::kOperationFieldNumber; +const int EltwiseParameter::kCoeffFieldNumber; +const int EltwiseParameter::kStableProdGradFieldNumber; +#endif // !_MSC_VER + +EltwiseParameter::EltwiseParameter() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.EltwiseParameter) +} + +void EltwiseParameter::InitAsDefaultInstance() { +} + +EltwiseParameter::EltwiseParameter(const EltwiseParameter& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.EltwiseParameter) +} + +void EltwiseParameter::SharedCtor() { + _cached_size_ = 0; + operation_ = 1; + stable_prod_grad_ = true; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +EltwiseParameter::~EltwiseParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.EltwiseParameter) + SharedDtor(); +} + +void EltwiseParameter::SharedDtor() { + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void EltwiseParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const EltwiseParameter& EltwiseParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +EltwiseParameter* EltwiseParameter::default_instance_ = NULL; + +EltwiseParameter* EltwiseParameter::New() const { + return new EltwiseParameter; +} + +void EltwiseParameter::Clear() { + if (_has_bits_[0 / 32] & 5) { + operation_ = 1; + stable_prod_grad_ = true; + } + coeff_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool EltwiseParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:ditcaffe.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 .ditcaffe.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 (::ditcaffe::EltwiseParameter_EltwiseOp_IsValid(value)) { + set_operation(static_cast< ::ditcaffe::EltwiseParameter_EltwiseOp >(value)); + } else { + unknown_fields_stream.WriteVarint32(tag); + unknown_fields_stream.WriteVarint32(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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &stable_prod_grad_))); + set_has_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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.EltwiseParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.EltwiseParameter) + return false; +#undef DO_ +} + +void EltwiseParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.EltwiseParameter) + // optional .ditcaffe.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); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:ditcaffe.EltwiseParameter) +} + +int EltwiseParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional .ditcaffe.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; + { + int data_size = 0; + data_size = 4 * this->coeff_size(); + total_size += 1 * this->coeff_size() + data_size; + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void EltwiseParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void EltwiseParameter::MergeFrom(const EltwiseParameter& from) { + GOOGLE_CHECK_NE(&from, this); + coeff_.MergeFrom(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()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void EltwiseParameter::CopyFrom(const EltwiseParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool EltwiseParameter::IsInitialized() const { + + return true; +} + +void EltwiseParameter::Swap(EltwiseParameter* other) { + if (other != this) { + std::swap(operation_, other->operation_); + coeff_.Swap(&other->coeff_); + std::swap(stable_prod_grad_, other->stable_prod_grad_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string EltwiseParameter::GetTypeName() const { + return "ditcaffe.EltwiseParameter"; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int ELUParameter::kAlphaFieldNumber; +#endif // !_MSC_VER + +ELUParameter::ELUParameter() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.ELUParameter) +} + +void ELUParameter::InitAsDefaultInstance() { +} + +ELUParameter::ELUParameter(const ELUParameter& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.ELUParameter) +} + +void ELUParameter::SharedCtor() { + _cached_size_ = 0; + alpha_ = 1; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ELUParameter::~ELUParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.ELUParameter) + SharedDtor(); +} + +void ELUParameter::SharedDtor() { + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void ELUParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ELUParameter& ELUParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +ELUParameter* ELUParameter::default_instance_ = NULL; + +ELUParameter* ELUParameter::New() const { + return new ELUParameter; +} + +void ELUParameter::Clear() { + alpha_ = 1; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ELUParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &alpha_))); + set_has_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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.ELUParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.ELUParameter) + return false; +#undef DO_ +} + +void ELUParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.ELUParameter) + // optional float alpha = 1 [default = 1]; + if (has_alpha()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->alpha(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:ditcaffe.ELUParameter) +} + +int ELUParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional float alpha = 1 [default = 1]; + if (has_alpha()) { + total_size += 1 + 4; + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ELUParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void ELUParameter::MergeFrom(const ELUParameter& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_alpha()) { + set_alpha(from.alpha()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ELUParameter::CopyFrom(const ELUParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ELUParameter::IsInitialized() const { + + return true; +} + +void ELUParameter::Swap(ELUParameter* other) { + if (other != this) { + std::swap(alpha_, other->alpha_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ELUParameter::GetTypeName() const { + return "ditcaffe.ELUParameter"; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int EmbedParameter::kNumOutputFieldNumber; +const int EmbedParameter::kInputDimFieldNumber; +const int EmbedParameter::kBiasTermFieldNumber; +const int EmbedParameter::kWeightFillerFieldNumber; +const int EmbedParameter::kBiasFillerFieldNumber; +#endif // !_MSC_VER + +EmbedParameter::EmbedParameter() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.EmbedParameter) +} + +void EmbedParameter::InitAsDefaultInstance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + weight_filler_ = const_cast< ::ditcaffe::FillerParameter*>( + ::ditcaffe::FillerParameter::internal_default_instance()); +#else + weight_filler_ = const_cast< ::ditcaffe::FillerParameter*>(&::ditcaffe::FillerParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + bias_filler_ = const_cast< ::ditcaffe::FillerParameter*>( + ::ditcaffe::FillerParameter::internal_default_instance()); +#else + bias_filler_ = const_cast< ::ditcaffe::FillerParameter*>(&::ditcaffe::FillerParameter::default_instance()); +#endif +} + +EmbedParameter::EmbedParameter(const EmbedParameter& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.EmbedParameter) +} + +void EmbedParameter::SharedCtor() { + _cached_size_ = 0; + num_output_ = 0u; + input_dim_ = 0u; + bias_term_ = true; + weight_filler_ = NULL; + bias_filler_ = NULL; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +EmbedParameter::~EmbedParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.EmbedParameter) + SharedDtor(); +} + +void EmbedParameter::SharedDtor() { + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + 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 EmbedParameter& EmbedParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +EmbedParameter* EmbedParameter::default_instance_ = NULL; + +EmbedParameter* EmbedParameter::New() const { + return new EmbedParameter; +} + +void EmbedParameter::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 31) { + ZR_(num_output_, input_dim_); + bias_term_ = true; + if (has_weight_filler()) { + if (weight_filler_ != NULL) weight_filler_->::ditcaffe::FillerParameter::Clear(); + } + if (has_bias_filler()) { + if (bias_filler_ != NULL) bias_filler_->::ditcaffe::FillerParameter::Clear(); + } + } + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool EmbedParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &num_output_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &input_dim_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &bias_term_))); + set_has_bias_term(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(34)) goto parse_weight_filler; + break; + } + + // optional .ditcaffe.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 .ditcaffe.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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.EmbedParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.EmbedParameter) + return false; +#undef DO_ +} + +void EmbedParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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 .ditcaffe.FillerParameter weight_filler = 4; + if (has_weight_filler()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 4, this->weight_filler(), output); + } + + // optional .ditcaffe.FillerParameter bias_filler = 5; + if (has_bias_filler()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 5, this->bias_filler(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:ditcaffe.EmbedParameter) +} + +int EmbedParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // 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 .ditcaffe.FillerParameter weight_filler = 4; + if (has_weight_filler()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->weight_filler()); + } + + // optional .ditcaffe.FillerParameter bias_filler = 5; + if (has_bias_filler()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->bias_filler()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void EmbedParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void EmbedParameter::MergeFrom(const EmbedParameter& from) { + GOOGLE_CHECK_NE(&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()->::ditcaffe::FillerParameter::MergeFrom(from.weight_filler()); + } + if (from.has_bias_filler()) { + mutable_bias_filler()->::ditcaffe::FillerParameter::MergeFrom(from.bias_filler()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void EmbedParameter::CopyFrom(const EmbedParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool EmbedParameter::IsInitialized() const { + + return true; +} + +void EmbedParameter::Swap(EmbedParameter* other) { + if (other != this) { + 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]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string EmbedParameter::GetTypeName() const { + return "ditcaffe.EmbedParameter"; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int ExpParameter::kBaseFieldNumber; +const int ExpParameter::kScaleFieldNumber; +const int ExpParameter::kShiftFieldNumber; +#endif // !_MSC_VER + +ExpParameter::ExpParameter() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.ExpParameter) +} + +void ExpParameter::InitAsDefaultInstance() { +} + +ExpParameter::ExpParameter(const ExpParameter& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.ExpParameter) +} + +void ExpParameter::SharedCtor() { + _cached_size_ = 0; + base_ = -1; + scale_ = 1; + shift_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ExpParameter::~ExpParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.ExpParameter) + SharedDtor(); +} + +void ExpParameter::SharedDtor() { + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void ExpParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ExpParameter& ExpParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +ExpParameter* ExpParameter::default_instance_ = NULL; + +ExpParameter* ExpParameter::New() const { + return new ExpParameter; +} + +void ExpParameter::Clear() { + if (_has_bits_[0 / 32] & 7) { + base_ = -1; + scale_ = 1; + shift_ = 0; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ExpParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &base_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &scale_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &shift_))); + set_has_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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.ExpParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.ExpParameter) + return false; +#undef DO_ +} + +void ExpParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:ditcaffe.ExpParameter) +} + +int ExpParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // 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; + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ExpParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void ExpParameter::MergeFrom(const ExpParameter& from) { + GOOGLE_CHECK_NE(&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()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ExpParameter::CopyFrom(const ExpParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ExpParameter::IsInitialized() const { + + return true; +} + +void ExpParameter::Swap(ExpParameter* other) { + if (other != this) { + std::swap(base_, other->base_); + std::swap(scale_, other->scale_); + std::swap(shift_, other->shift_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ExpParameter::GetTypeName() const { + return "ditcaffe.ExpParameter"; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int FlattenParameter::kAxisFieldNumber; +const int FlattenParameter::kEndAxisFieldNumber; +#endif // !_MSC_VER + +FlattenParameter::FlattenParameter() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.FlattenParameter) +} + +void FlattenParameter::InitAsDefaultInstance() { +} + +FlattenParameter::FlattenParameter(const FlattenParameter& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.FlattenParameter) +} + +void FlattenParameter::SharedCtor() { + _cached_size_ = 0; + axis_ = 1; + end_axis_ = -1; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +FlattenParameter::~FlattenParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.FlattenParameter) + SharedDtor(); +} + +void FlattenParameter::SharedDtor() { + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void FlattenParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const FlattenParameter& FlattenParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +FlattenParameter* FlattenParameter::default_instance_ = NULL; + +FlattenParameter* FlattenParameter::New() const { + return new FlattenParameter; +} + +void FlattenParameter::Clear() { + if (_has_bits_[0 / 32] & 3) { + axis_ = 1; + end_axis_ = -1; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool FlattenParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &end_axis_))); + set_has_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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.FlattenParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.FlattenParameter) + return false; +#undef DO_ +} + +void FlattenParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:ditcaffe.FlattenParameter) +} + +int FlattenParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // 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()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void FlattenParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void FlattenParameter::MergeFrom(const FlattenParameter& from) { + GOOGLE_CHECK_NE(&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()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void FlattenParameter::CopyFrom(const FlattenParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool FlattenParameter::IsInitialized() const { + + return true; +} + +void FlattenParameter::Swap(FlattenParameter* other) { + if (other != this) { + std::swap(axis_, other->axis_); + std::swap(end_axis_, other->end_axis_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string FlattenParameter::GetTypeName() const { + return "ditcaffe.FlattenParameter"; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int HDF5DataParameter::kSourceFieldNumber; +const int HDF5DataParameter::kBatchSizeFieldNumber; +const int HDF5DataParameter::kShuffleFieldNumber; +#endif // !_MSC_VER + +HDF5DataParameter::HDF5DataParameter() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.HDF5DataParameter) +} + +void HDF5DataParameter::InitAsDefaultInstance() { +} + +HDF5DataParameter::HDF5DataParameter(const HDF5DataParameter& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.HDF5DataParameter) +} + +void HDF5DataParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + source_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + batch_size_ = 0u; + shuffle_ = false; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +HDF5DataParameter::~HDF5DataParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.HDF5DataParameter) + SharedDtor(); +} + +void HDF5DataParameter::SharedDtor() { + if (source_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete source_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void HDF5DataParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const HDF5DataParameter& HDF5DataParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +HDF5DataParameter* HDF5DataParameter::default_instance_ = NULL; + +HDF5DataParameter* HDF5DataParameter::New() const { + return new HDF5DataParameter; +} + +void HDF5DataParameter::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 7) { + ZR_(batch_size_, shuffle_); + if (has_source()) { + if (source_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_->clear(); + } + } + } + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool HDF5DataParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:ditcaffe.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())); + } 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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &batch_size_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &shuffle_))); + set_has_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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.HDF5DataParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.HDF5DataParameter) + return false; +#undef DO_ +} + +void HDF5DataParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.HDF5DataParameter) + // optional string source = 1; + if (has_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); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:ditcaffe.HDF5DataParameter) +} + +int HDF5DataParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // 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; + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void HDF5DataParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void HDF5DataParameter::MergeFrom(const HDF5DataParameter& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_source()) { + set_source(from.source()); + } + if (from.has_batch_size()) { + set_batch_size(from.batch_size()); + } + if (from.has_shuffle()) { + set_shuffle(from.shuffle()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void HDF5DataParameter::CopyFrom(const HDF5DataParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool HDF5DataParameter::IsInitialized() const { + + return true; +} + +void HDF5DataParameter::Swap(HDF5DataParameter* other) { + if (other != this) { + std::swap(source_, other->source_); + std::swap(batch_size_, other->batch_size_); + std::swap(shuffle_, other->shuffle_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string HDF5DataParameter::GetTypeName() const { + return "ditcaffe.HDF5DataParameter"; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int HDF5OutputParameter::kFileNameFieldNumber; +#endif // !_MSC_VER + +HDF5OutputParameter::HDF5OutputParameter() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.HDF5OutputParameter) +} + +void HDF5OutputParameter::InitAsDefaultInstance() { +} + +HDF5OutputParameter::HDF5OutputParameter(const HDF5OutputParameter& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.HDF5OutputParameter) +} + +void HDF5OutputParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + file_name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +HDF5OutputParameter::~HDF5OutputParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.HDF5OutputParameter) + SharedDtor(); +} + +void HDF5OutputParameter::SharedDtor() { + if (file_name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete file_name_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void HDF5OutputParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const HDF5OutputParameter& HDF5OutputParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +HDF5OutputParameter* HDF5OutputParameter::default_instance_ = NULL; + +HDF5OutputParameter* HDF5OutputParameter::New() const { + return new HDF5OutputParameter; +} + +void HDF5OutputParameter::Clear() { + if (has_file_name()) { + if (file_name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + file_name_->clear(); + } + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool HDF5OutputParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:ditcaffe.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())); + } 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, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.HDF5OutputParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.HDF5OutputParameter) + return false; +#undef DO_ +} + +void HDF5OutputParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.HDF5OutputParameter) + // optional string file_name = 1; + if (has_file_name()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->file_name(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:ditcaffe.HDF5OutputParameter) +} + +int HDF5OutputParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional string file_name = 1; + if (has_file_name()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->file_name()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void HDF5OutputParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void HDF5OutputParameter::MergeFrom(const HDF5OutputParameter& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_file_name()) { + set_file_name(from.file_name()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void HDF5OutputParameter::CopyFrom(const HDF5OutputParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool HDF5OutputParameter::IsInitialized() const { + + return true; +} + +void HDF5OutputParameter::Swap(HDF5OutputParameter* other) { + if (other != this) { + std::swap(file_name_, other->file_name_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string HDF5OutputParameter::GetTypeName() const { + return "ditcaffe.HDF5OutputParameter"; +} + + +// =================================================================== + +bool HingeLossParameter_Norm_IsValid(int value) { + switch(value) { + case 1: + case 2: + return true; + default: + return false; + } +} + +#ifndef _MSC_VER +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 // _MSC_VER +#ifndef _MSC_VER +const int HingeLossParameter::kNormFieldNumber; +#endif // !_MSC_VER + +HingeLossParameter::HingeLossParameter() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.HingeLossParameter) +} + +void HingeLossParameter::InitAsDefaultInstance() { +} + +HingeLossParameter::HingeLossParameter(const HingeLossParameter& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.HingeLossParameter) +} + +void HingeLossParameter::SharedCtor() { + _cached_size_ = 0; + norm_ = 1; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +HingeLossParameter::~HingeLossParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.HingeLossParameter) + SharedDtor(); +} + +void HingeLossParameter::SharedDtor() { + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void HingeLossParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const HingeLossParameter& HingeLossParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +HingeLossParameter* HingeLossParameter::default_instance_ = NULL; + +HingeLossParameter* HingeLossParameter::New() const { + return new HingeLossParameter; +} + +void HingeLossParameter::Clear() { + norm_ = 1; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool HingeLossParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:ditcaffe.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 .ditcaffe.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 (::ditcaffe::HingeLossParameter_Norm_IsValid(value)) { + set_norm(static_cast< ::ditcaffe::HingeLossParameter_Norm >(value)); + } else { + unknown_fields_stream.WriteVarint32(tag); + unknown_fields_stream.WriteVarint32(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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.HingeLossParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.HingeLossParameter) + return false; +#undef DO_ +} + +void HingeLossParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.HingeLossParameter) + // optional .ditcaffe.HingeLossParameter.Norm norm = 1 [default = L1]; + if (has_norm()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 1, this->norm(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:ditcaffe.HingeLossParameter) +} + +int HingeLossParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional .ditcaffe.HingeLossParameter.Norm norm = 1 [default = L1]; + if (has_norm()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->norm()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void HingeLossParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void HingeLossParameter::MergeFrom(const HingeLossParameter& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_norm()) { + set_norm(from.norm()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void HingeLossParameter::CopyFrom(const HingeLossParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool HingeLossParameter::IsInitialized() const { + + return true; +} + +void HingeLossParameter::Swap(HingeLossParameter* other) { + if (other != this) { + std::swap(norm_, other->norm_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string HingeLossParameter::GetTypeName() const { + return "ditcaffe.HingeLossParameter"; +} + + +// =================================================================== + +#ifndef _MSC_VER +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 // !_MSC_VER + +ImageDataParameter::ImageDataParameter() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.ImageDataParameter) +} + +void ImageDataParameter::InitAsDefaultInstance() { +} + +ImageDataParameter::ImageDataParameter(const ImageDataParameter& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.ImageDataParameter) +} + +void ImageDataParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + source_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + batch_size_ = 1u; + rand_skip_ = 0u; + shuffle_ = false; + new_height_ = 0u; + new_width_ = 0u; + is_color_ = true; + scale_ = 1; + mean_file_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + crop_size_ = 0u; + mirror_ = false; + root_folder_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ImageDataParameter::~ImageDataParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.ImageDataParameter) + SharedDtor(); +} + +void ImageDataParameter::SharedDtor() { + if (source_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete source_; + } + if (mean_file_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete mean_file_; + } + if (root_folder_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete root_folder_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void ImageDataParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ImageDataParameter& ImageDataParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +ImageDataParameter* ImageDataParameter::default_instance_ = NULL; + +ImageDataParameter* ImageDataParameter::New() const { + return new ImageDataParameter; +} + +void ImageDataParameter::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 255) { + ZR_(rand_skip_, shuffle_); + if (has_source()) { + if (source_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_->clear(); + } + } + batch_size_ = 1u; + is_color_ = true; + scale_ = 1; + } + if (_has_bits_[8 / 32] & 3840) { + if (has_mean_file()) { + if (mean_file_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + mean_file_->clear(); + } + } + crop_size_ = 0u; + mirror_ = false; + if (has_root_folder()) { + if (root_folder_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + root_folder_->clear(); + } + } + } + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ImageDataParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:ditcaffe.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())); + } 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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &scale_))); + set_has_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())); + } 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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &batch_size_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &crop_size_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &mirror_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &rand_skip_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &shuffle_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &new_height_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &new_width_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &is_color_))); + set_has_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())); + } 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, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.ImageDataParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.ImageDataParameter) + return false; +#undef DO_ +} + +void ImageDataParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.ImageDataParameter) + // optional string source = 1; + if (has_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::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::WireFormatLite::WriteStringMaybeAliased( + 12, this->root_folder(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:ditcaffe.ImageDataParameter) +} + +int ImageDataParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // 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] & (0xffu << (8 % 32))) { + // 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()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ImageDataParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void ImageDataParameter::MergeFrom(const ImageDataParameter& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_source()) { + set_source(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_mean_file(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_root_folder(from.root_folder()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ImageDataParameter::CopyFrom(const ImageDataParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ImageDataParameter::IsInitialized() const { + + return true; +} + +void ImageDataParameter::Swap(ImageDataParameter* other) { + if (other != this) { + std::swap(source_, 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_); + std::swap(mean_file_, other->mean_file_); + std::swap(crop_size_, other->crop_size_); + std::swap(mirror_, other->mirror_); + std::swap(root_folder_, other->root_folder_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ImageDataParameter::GetTypeName() const { + return "ditcaffe.ImageDataParameter"; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int InfogainLossParameter::kSourceFieldNumber; +#endif // !_MSC_VER + +InfogainLossParameter::InfogainLossParameter() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.InfogainLossParameter) +} + +void InfogainLossParameter::InitAsDefaultInstance() { +} + +InfogainLossParameter::InfogainLossParameter(const InfogainLossParameter& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.InfogainLossParameter) +} + +void InfogainLossParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + source_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +InfogainLossParameter::~InfogainLossParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.InfogainLossParameter) + SharedDtor(); +} + +void InfogainLossParameter::SharedDtor() { + if (source_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete source_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void InfogainLossParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const InfogainLossParameter& InfogainLossParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +InfogainLossParameter* InfogainLossParameter::default_instance_ = NULL; + +InfogainLossParameter* InfogainLossParameter::New() const { + return new InfogainLossParameter; +} + +void InfogainLossParameter::Clear() { + if (has_source()) { + if (source_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_->clear(); + } + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool InfogainLossParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:ditcaffe.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())); + } 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, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.InfogainLossParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.InfogainLossParameter) + return false; +#undef DO_ +} + +void InfogainLossParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.InfogainLossParameter) + // optional string source = 1; + if (has_source()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->source(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:ditcaffe.InfogainLossParameter) +} + +int InfogainLossParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional string source = 1; + if (has_source()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->source()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void InfogainLossParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void InfogainLossParameter::MergeFrom(const InfogainLossParameter& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_source()) { + set_source(from.source()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void InfogainLossParameter::CopyFrom(const InfogainLossParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool InfogainLossParameter::IsInitialized() const { + + return true; +} + +void InfogainLossParameter::Swap(InfogainLossParameter* other) { + if (other != this) { + std::swap(source_, other->source_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string InfogainLossParameter::GetTypeName() const { + return "ditcaffe.InfogainLossParameter"; +} + + +// =================================================================== + +#ifndef _MSC_VER +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 // !_MSC_VER + +InnerProductParameter::InnerProductParameter() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.InnerProductParameter) +} + +void InnerProductParameter::InitAsDefaultInstance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + weight_filler_ = const_cast< ::ditcaffe::FillerParameter*>( + ::ditcaffe::FillerParameter::internal_default_instance()); +#else + weight_filler_ = const_cast< ::ditcaffe::FillerParameter*>(&::ditcaffe::FillerParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + bias_filler_ = const_cast< ::ditcaffe::FillerParameter*>( + ::ditcaffe::FillerParameter::internal_default_instance()); +#else + bias_filler_ = const_cast< ::ditcaffe::FillerParameter*>(&::ditcaffe::FillerParameter::default_instance()); +#endif +} + +InnerProductParameter::InnerProductParameter(const InnerProductParameter& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.InnerProductParameter) +} + +void InnerProductParameter::SharedCtor() { + _cached_size_ = 0; + num_output_ = 0u; + bias_term_ = true; + weight_filler_ = NULL; + bias_filler_ = NULL; + axis_ = 1; + transpose_ = false; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +InnerProductParameter::~InnerProductParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.InnerProductParameter) + SharedDtor(); +} + +void InnerProductParameter::SharedDtor() { + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + 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 InnerProductParameter& InnerProductParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +InnerProductParameter* InnerProductParameter::default_instance_ = NULL; + +InnerProductParameter* InnerProductParameter::New() const { + return new InnerProductParameter; +} + +void InnerProductParameter::Clear() { + if (_has_bits_[0 / 32] & 63) { + num_output_ = 0u; + bias_term_ = true; + if (has_weight_filler()) { + if (weight_filler_ != NULL) weight_filler_->::ditcaffe::FillerParameter::Clear(); + } + if (has_bias_filler()) { + if (bias_filler_ != NULL) bias_filler_->::ditcaffe::FillerParameter::Clear(); + } + axis_ = 1; + transpose_ = false; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool InnerProductParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &num_output_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &bias_term_))); + set_has_bias_term(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_weight_filler; + break; + } + + // optional .ditcaffe.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 .ditcaffe.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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &transpose_))); + set_has_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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.InnerProductParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.InnerProductParameter) + return false; +#undef DO_ +} + +void InnerProductParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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 .ditcaffe.FillerParameter weight_filler = 3; + if (has_weight_filler()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 3, this->weight_filler(), output); + } + + // optional .ditcaffe.FillerParameter bias_filler = 4; + if (has_bias_filler()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 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); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:ditcaffe.InnerProductParameter) +} + +int InnerProductParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // 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 .ditcaffe.FillerParameter weight_filler = 3; + if (has_weight_filler()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->weight_filler()); + } + + // optional .ditcaffe.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; + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void InnerProductParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void InnerProductParameter::MergeFrom(const InnerProductParameter& from) { + GOOGLE_CHECK_NE(&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()->::ditcaffe::FillerParameter::MergeFrom(from.weight_filler()); + } + if (from.has_bias_filler()) { + mutable_bias_filler()->::ditcaffe::FillerParameter::MergeFrom(from.bias_filler()); + } + if (from.has_axis()) { + set_axis(from.axis()); + } + if (from.has_transpose()) { + set_transpose(from.transpose()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void InnerProductParameter::CopyFrom(const InnerProductParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool InnerProductParameter::IsInitialized() const { + + return true; +} + +void InnerProductParameter::Swap(InnerProductParameter* other) { + if (other != this) { + 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]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string InnerProductParameter::GetTypeName() const { + return "ditcaffe.InnerProductParameter"; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int InputParameter::kShapeFieldNumber; +#endif // !_MSC_VER + +InputParameter::InputParameter() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.InputParameter) +} + +void InputParameter::InitAsDefaultInstance() { +} + +InputParameter::InputParameter(const InputParameter& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.InputParameter) +} + +void InputParameter::SharedCtor() { + _cached_size_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +InputParameter::~InputParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.InputParameter) + SharedDtor(); +} + +void InputParameter::SharedDtor() { + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void InputParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const InputParameter& InputParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +InputParameter* InputParameter::default_instance_ = NULL; + +InputParameter* InputParameter::New() const { + return new InputParameter; +} + +void InputParameter::Clear() { + shape_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool InputParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:ditcaffe.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 .ditcaffe.BlobShape shape = 1; + case 1: { + if (tag == 10) { + parse_shape: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_shape())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(10)) goto parse_shape; + 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, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.InputParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.InputParameter) + return false; +#undef DO_ +} + +void InputParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.InputParameter) + // repeated .ditcaffe.BlobShape shape = 1; + for (int i = 0; i < this->shape_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 1, this->shape(i), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:ditcaffe.InputParameter) +} + +int InputParameter::ByteSize() const { + int total_size = 0; + + // repeated .ditcaffe.BlobShape shape = 1; + total_size += 1 * this->shape_size(); + for (int i = 0; i < this->shape_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->shape(i)); + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void InputParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void InputParameter::MergeFrom(const InputParameter& from) { + GOOGLE_CHECK_NE(&from, this); + shape_.MergeFrom(from.shape_); + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void InputParameter::CopyFrom(const InputParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool InputParameter::IsInitialized() const { + + return true; +} + +void InputParameter::Swap(InputParameter* other) { + if (other != this) { + shape_.Swap(&other->shape_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string InputParameter::GetTypeName() const { + return "ditcaffe.InputParameter"; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int LogParameter::kBaseFieldNumber; +const int LogParameter::kScaleFieldNumber; +const int LogParameter::kShiftFieldNumber; +#endif // !_MSC_VER + +LogParameter::LogParameter() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.LogParameter) +} + +void LogParameter::InitAsDefaultInstance() { +} + +LogParameter::LogParameter(const LogParameter& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.LogParameter) +} + +void LogParameter::SharedCtor() { + _cached_size_ = 0; + base_ = -1; + scale_ = 1; + shift_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +LogParameter::~LogParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.LogParameter) + SharedDtor(); +} + +void LogParameter::SharedDtor() { + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void LogParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const LogParameter& LogParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +LogParameter* LogParameter::default_instance_ = NULL; + +LogParameter* LogParameter::New() const { + return new LogParameter; +} + +void LogParameter::Clear() { + if (_has_bits_[0 / 32] & 7) { + base_ = -1; + scale_ = 1; + shift_ = 0; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool LogParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &base_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &scale_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &shift_))); + set_has_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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.LogParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.LogParameter) + return false; +#undef DO_ +} + +void LogParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:ditcaffe.LogParameter) +} + +int LogParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // 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; + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void LogParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void LogParameter::MergeFrom(const LogParameter& from) { + GOOGLE_CHECK_NE(&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()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void LogParameter::CopyFrom(const LogParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool LogParameter::IsInitialized() const { + + return true; +} + +void LogParameter::Swap(LogParameter* other) { + if (other != this) { + std::swap(base_, other->base_); + std::swap(scale_, other->scale_); + std::swap(shift_, other->shift_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string LogParameter::GetTypeName() const { + return "ditcaffe.LogParameter"; +} + + +// =================================================================== + +bool LRNParameter_NormRegion_IsValid(int value) { + switch(value) { + case 0: + case 1: + return true; + default: + return false; + } +} + +#ifndef _MSC_VER +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 // _MSC_VER +bool LRNParameter_Engine_IsValid(int value) { + switch(value) { + case 0: + case 1: + case 2: + return true; + default: + return false; + } +} + +#ifndef _MSC_VER +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 // _MSC_VER +#ifndef _MSC_VER +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 // !_MSC_VER + +LRNParameter::LRNParameter() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.LRNParameter) +} + +void LRNParameter::InitAsDefaultInstance() { +} + +LRNParameter::LRNParameter(const LRNParameter& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.LRNParameter) +} + +void LRNParameter::SharedCtor() { + _cached_size_ = 0; + local_size_ = 5u; + alpha_ = 1; + beta_ = 0.75f; + norm_region_ = 0; + k_ = 1; + engine_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +LRNParameter::~LRNParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.LRNParameter) + SharedDtor(); +} + +void LRNParameter::SharedDtor() { + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void LRNParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const LRNParameter& LRNParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +LRNParameter* LRNParameter::default_instance_ = NULL; + +LRNParameter* LRNParameter::New() const { + return new LRNParameter; +} + +void LRNParameter::Clear() { + if (_has_bits_[0 / 32] & 63) { + local_size_ = 5u; + alpha_ = 1; + beta_ = 0.75f; + norm_region_ = 0; + k_ = 1; + engine_ = 0; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool LRNParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &local_size_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &alpha_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &beta_))); + set_has_beta(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(32)) goto parse_norm_region; + break; + } + + // optional .ditcaffe.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 (::ditcaffe::LRNParameter_NormRegion_IsValid(value)) { + set_norm_region(static_cast< ::ditcaffe::LRNParameter_NormRegion >(value)); + } else { + unknown_fields_stream.WriteVarint32(tag); + unknown_fields_stream.WriteVarint32(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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &k_))); + set_has_k(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(48)) goto parse_engine; + break; + } + + // optional .ditcaffe.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 (::ditcaffe::LRNParameter_Engine_IsValid(value)) { + set_engine(static_cast< ::ditcaffe::LRNParameter_Engine >(value)); + } else { + unknown_fields_stream.WriteVarint32(tag); + unknown_fields_stream.WriteVarint32(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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.LRNParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.LRNParameter) + return false; +#undef DO_ +} + +void LRNParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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 .ditcaffe.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 .ditcaffe.LRNParameter.Engine engine = 6 [default = DEFAULT]; + if (has_engine()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 6, this->engine(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:ditcaffe.LRNParameter) +} + +int LRNParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // 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 .ditcaffe.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 .ditcaffe.LRNParameter.Engine engine = 6 [default = DEFAULT]; + if (has_engine()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->engine()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void LRNParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void LRNParameter::MergeFrom(const LRNParameter& from) { + GOOGLE_CHECK_NE(&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()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void LRNParameter::CopyFrom(const LRNParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool LRNParameter::IsInitialized() const { + + return true; +} + +void LRNParameter::Swap(LRNParameter* other) { + if (other != this) { + 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]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string LRNParameter::GetTypeName() const { + return "ditcaffe.LRNParameter"; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int MemoryDataParameter::kBatchSizeFieldNumber; +const int MemoryDataParameter::kChannelsFieldNumber; +const int MemoryDataParameter::kHeightFieldNumber; +const int MemoryDataParameter::kWidthFieldNumber; +#endif // !_MSC_VER + +MemoryDataParameter::MemoryDataParameter() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.MemoryDataParameter) +} + +void MemoryDataParameter::InitAsDefaultInstance() { +} + +MemoryDataParameter::MemoryDataParameter(const MemoryDataParameter& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.MemoryDataParameter) +} + +void MemoryDataParameter::SharedCtor() { + _cached_size_ = 0; + batch_size_ = 0u; + channels_ = 0u; + height_ = 0u; + width_ = 0u; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +MemoryDataParameter::~MemoryDataParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.MemoryDataParameter) + SharedDtor(); +} + +void MemoryDataParameter::SharedDtor() { + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void MemoryDataParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const MemoryDataParameter& MemoryDataParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +MemoryDataParameter* MemoryDataParameter::default_instance_ = NULL; + +MemoryDataParameter* MemoryDataParameter::New() const { + return new MemoryDataParameter; +} + +void MemoryDataParameter::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + ZR_(batch_size_, width_); + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool MemoryDataParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &batch_size_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &channels_))); + set_has_channels(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(24)) goto parse_height; + break; + } + + // optional uint32 height = 3; + case 3: { + if (tag == 24) { + parse_height: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &height_))); + set_has_height(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(32)) goto parse_width; + break; + } + + // optional uint32 width = 4; + case 4: { + if (tag == 32) { + parse_width: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &width_))); + set_has_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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.MemoryDataParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.MemoryDataParameter) + return false; +#undef DO_ +} + +void MemoryDataParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:ditcaffe.MemoryDataParameter) +} + +int MemoryDataParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // 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()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void MemoryDataParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void MemoryDataParameter::MergeFrom(const MemoryDataParameter& from) { + GOOGLE_CHECK_NE(&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()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void MemoryDataParameter::CopyFrom(const MemoryDataParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool MemoryDataParameter::IsInitialized() const { + + return true; +} + +void MemoryDataParameter::Swap(MemoryDataParameter* other) { + if (other != this) { + 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]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string MemoryDataParameter::GetTypeName() const { + return "ditcaffe.MemoryDataParameter"; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int MVNParameter::kNormalizeVarianceFieldNumber; +const int MVNParameter::kAcrossChannelsFieldNumber; +const int MVNParameter::kEpsFieldNumber; +#endif // !_MSC_VER + +MVNParameter::MVNParameter() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.MVNParameter) +} + +void MVNParameter::InitAsDefaultInstance() { +} + +MVNParameter::MVNParameter(const MVNParameter& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.MVNParameter) +} + +void MVNParameter::SharedCtor() { + _cached_size_ = 0; + normalize_variance_ = true; + across_channels_ = false; + eps_ = 1e-09f; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +MVNParameter::~MVNParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.MVNParameter) + SharedDtor(); +} + +void MVNParameter::SharedDtor() { + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void MVNParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const MVNParameter& MVNParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +MVNParameter* MVNParameter::default_instance_ = NULL; + +MVNParameter* MVNParameter::New() const { + return new MVNParameter; +} + +void MVNParameter::Clear() { + if (_has_bits_[0 / 32] & 7) { + normalize_variance_ = true; + across_channels_ = false; + eps_ = 1e-09f; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool MVNParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &normalize_variance_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &across_channels_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &eps_))); + set_has_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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.MVNParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.MVNParameter) + return false; +#undef DO_ +} + +void MVNParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:ditcaffe.MVNParameter) +} + +int MVNParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // 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; + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void MVNParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void MVNParameter::MergeFrom(const MVNParameter& from) { + GOOGLE_CHECK_NE(&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()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void MVNParameter::CopyFrom(const MVNParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool MVNParameter::IsInitialized() const { + + return true; +} + +void MVNParameter::Swap(MVNParameter* other) { + if (other != this) { + 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]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string MVNParameter::GetTypeName() const { + return "ditcaffe.MVNParameter"; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int ParameterParameter::kShapeFieldNumber; +#endif // !_MSC_VER + +ParameterParameter::ParameterParameter() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.ParameterParameter) +} + +void ParameterParameter::InitAsDefaultInstance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + shape_ = const_cast< ::ditcaffe::BlobShape*>( + ::ditcaffe::BlobShape::internal_default_instance()); +#else + shape_ = const_cast< ::ditcaffe::BlobShape*>(&::ditcaffe::BlobShape::default_instance()); +#endif +} + +ParameterParameter::ParameterParameter(const ParameterParameter& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.ParameterParameter) +} + +void ParameterParameter::SharedCtor() { + _cached_size_ = 0; + shape_ = NULL; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ParameterParameter::~ParameterParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.ParameterParameter) + SharedDtor(); +} + +void ParameterParameter::SharedDtor() { + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + delete shape_; + } +} + +void ParameterParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ParameterParameter& ParameterParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +ParameterParameter* ParameterParameter::default_instance_ = NULL; + +ParameterParameter* ParameterParameter::New() const { + return new ParameterParameter; +} + +void ParameterParameter::Clear() { + if (has_shape()) { + if (shape_ != NULL) shape_->::ditcaffe::BlobShape::Clear(); + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ParameterParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:ditcaffe.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 .ditcaffe.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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.ParameterParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.ParameterParameter) + return false; +#undef DO_ +} + +void ParameterParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.ParameterParameter) + // optional .ditcaffe.BlobShape shape = 1; + if (has_shape()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 1, this->shape(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:ditcaffe.ParameterParameter) +} + +int ParameterParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional .ditcaffe.BlobShape shape = 1; + if (has_shape()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->shape()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ParameterParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void ParameterParameter::MergeFrom(const ParameterParameter& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_shape()) { + mutable_shape()->::ditcaffe::BlobShape::MergeFrom(from.shape()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ParameterParameter::CopyFrom(const ParameterParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ParameterParameter::IsInitialized() const { + + return true; +} + +void ParameterParameter::Swap(ParameterParameter* other) { + if (other != this) { + std::swap(shape_, other->shape_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ParameterParameter::GetTypeName() const { + return "ditcaffe.ParameterParameter"; +} + + +// =================================================================== + +bool PoolingParameter_PoolMethod_IsValid(int value) { + switch(value) { + case 0: + case 1: + case 2: + return true; + default: + return false; + } +} + +#ifndef _MSC_VER +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 // _MSC_VER +bool PoolingParameter_Engine_IsValid(int value) { + switch(value) { + case 0: + case 1: + case 2: + return true; + default: + return false; + } +} + +#ifndef _MSC_VER +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 // _MSC_VER +#ifndef _MSC_VER +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; +const int PoolingParameter::kTorchPoolingFieldNumber; +#endif // !_MSC_VER + +PoolingParameter::PoolingParameter() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.PoolingParameter) +} + +void PoolingParameter::InitAsDefaultInstance() { +} + +PoolingParameter::PoolingParameter(const PoolingParameter& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.PoolingParameter) +} + +void PoolingParameter::SharedCtor() { + _cached_size_ = 0; + pool_ = 0; + pad_ = 0u; + pad_h_ = 0u; + pad_w_ = 0u; + kernel_size_ = 0u; + kernel_h_ = 0u; + kernel_w_ = 0u; + stride_ = 1u; + stride_h_ = 0u; + stride_w_ = 0u; + engine_ = 0; + global_pooling_ = false; + torch_pooling_ = false; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +PoolingParameter::~PoolingParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.PoolingParameter) + SharedDtor(); +} + +void PoolingParameter::SharedDtor() { + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void PoolingParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const PoolingParameter& PoolingParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +PoolingParameter* PoolingParameter::default_instance_ = NULL; + +PoolingParameter* PoolingParameter::New() const { + return new PoolingParameter; +} + +void PoolingParameter::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 255) { + ZR_(pool_, kernel_w_); + stride_ = 1u; + } + if (_has_bits_[8 / 32] & 7936) { + ZR_(stride_h_, torch_pooling_); + } + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool PoolingParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:ditcaffe.PoolingParameter) + 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 .ditcaffe.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 (::ditcaffe::PoolingParameter_PoolMethod_IsValid(value)) { + set_pool(static_cast< ::ditcaffe::PoolingParameter_PoolMethod >(value)); + } else { + unknown_fields_stream.WriteVarint32(tag); + unknown_fields_stream.WriteVarint32(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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &kernel_size_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &stride_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &pad_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &kernel_h_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &kernel_w_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &stride_h_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &stride_w_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &pad_h_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &pad_w_))); + set_has_pad_w(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(88)) goto parse_engine; + break; + } + + // optional .ditcaffe.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 (::ditcaffe::PoolingParameter_Engine_IsValid(value)) { + set_engine(static_cast< ::ditcaffe::PoolingParameter_Engine >(value)); + } else { + unknown_fields_stream.WriteVarint32(tag); + unknown_fields_stream.WriteVarint32(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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &global_pooling_))); + set_has_global_pooling(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(320)) goto parse_torch_pooling; + break; + } + + // optional bool torch_pooling = 40 [default = false]; + case 40: { + if (tag == 320) { + parse_torch_pooling: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &torch_pooling_))); + set_has_torch_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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.PoolingParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.PoolingParameter) + return false; +#undef DO_ +} + +void PoolingParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.PoolingParameter) + // optional .ditcaffe.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 .ditcaffe.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); + } + + // optional bool torch_pooling = 40 [default = false]; + if (has_torch_pooling()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(40, this->torch_pooling(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:ditcaffe.PoolingParameter) +} + +int PoolingParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional .ditcaffe.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] & (0xffu << (8 % 32))) { + // 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 .ditcaffe.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; + } + + // optional bool torch_pooling = 40 [default = false]; + if (has_torch_pooling()) { + total_size += 2 + 1; + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void PoolingParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void PoolingParameter::MergeFrom(const PoolingParameter& from) { + GOOGLE_CHECK_NE(&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.has_torch_pooling()) { + set_torch_pooling(from.torch_pooling()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void PoolingParameter::CopyFrom(const PoolingParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool PoolingParameter::IsInitialized() const { + + return true; +} + +void PoolingParameter::Swap(PoolingParameter* other) { + if (other != this) { + 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(torch_pooling_, other->torch_pooling_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string PoolingParameter::GetTypeName() const { + return "ditcaffe.PoolingParameter"; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int PowerParameter::kPowerFieldNumber; +const int PowerParameter::kScaleFieldNumber; +const int PowerParameter::kShiftFieldNumber; +#endif // !_MSC_VER + +PowerParameter::PowerParameter() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.PowerParameter) +} + +void PowerParameter::InitAsDefaultInstance() { +} + +PowerParameter::PowerParameter(const PowerParameter& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.PowerParameter) +} + +void PowerParameter::SharedCtor() { + _cached_size_ = 0; + power_ = 1; + scale_ = 1; + shift_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +PowerParameter::~PowerParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.PowerParameter) + SharedDtor(); +} + +void PowerParameter::SharedDtor() { + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void PowerParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const PowerParameter& PowerParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +PowerParameter* PowerParameter::default_instance_ = NULL; + +PowerParameter* PowerParameter::New() const { + return new PowerParameter; +} + +void PowerParameter::Clear() { + if (_has_bits_[0 / 32] & 7) { + power_ = 1; + scale_ = 1; + shift_ = 0; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool PowerParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &power_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &scale_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &shift_))); + set_has_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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.PowerParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.PowerParameter) + return false; +#undef DO_ +} + +void PowerParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:ditcaffe.PowerParameter) +} + +int PowerParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // 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; + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void PowerParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void PowerParameter::MergeFrom(const PowerParameter& from) { + GOOGLE_CHECK_NE(&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()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void PowerParameter::CopyFrom(const PowerParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool PowerParameter::IsInitialized() const { + + return true; +} + +void PowerParameter::Swap(PowerParameter* other) { + if (other != this) { + std::swap(power_, other->power_); + std::swap(scale_, other->scale_); + std::swap(shift_, other->shift_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string PowerParameter::GetTypeName() const { + return "ditcaffe.PowerParameter"; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int PythonParameter::kModuleFieldNumber; +const int PythonParameter::kLayerFieldNumber; +const int PythonParameter::kParamStrFieldNumber; +const int PythonParameter::kShareInParallelFieldNumber; +#endif // !_MSC_VER + +PythonParameter::PythonParameter() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.PythonParameter) +} + +void PythonParameter::InitAsDefaultInstance() { +} + +PythonParameter::PythonParameter(const PythonParameter& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.PythonParameter) +} + +void PythonParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + module_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + layer_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + param_str_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + share_in_parallel_ = false; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +PythonParameter::~PythonParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.PythonParameter) + SharedDtor(); +} + +void PythonParameter::SharedDtor() { + if (module_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete module_; + } + if (layer_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete layer_; + } + if (param_str_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete param_str_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void PythonParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const PythonParameter& PythonParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +PythonParameter* PythonParameter::default_instance_ = NULL; + +PythonParameter* PythonParameter::New() const { + return new PythonParameter; +} + +void PythonParameter::Clear() { + if (_has_bits_[0 / 32] & 15) { + if (has_module()) { + if (module_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + module_->clear(); + } + } + if (has_layer()) { + if (layer_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + layer_->clear(); + } + } + if (has_param_str()) { + if (param_str_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + param_str_->clear(); + } + } + share_in_parallel_ = false; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool PythonParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:ditcaffe.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())); + } 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())); + } 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())); + } 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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &share_in_parallel_))); + set_has_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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.PythonParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.PythonParameter) + return false; +#undef DO_ +} + +void PythonParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.PythonParameter) + // optional string module = 1; + if (has_module()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->module(), output); + } + + // optional string layer = 2; + if (has_layer()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->layer(), output); + } + + // optional string param_str = 3 [default = ""]; + if (has_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); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:ditcaffe.PythonParameter) +} + +int PythonParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // 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; + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void PythonParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void PythonParameter::MergeFrom(const PythonParameter& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_module()) { + set_module(from.module()); + } + if (from.has_layer()) { + set_layer(from.layer()); + } + if (from.has_param_str()) { + set_param_str(from.param_str()); + } + if (from.has_share_in_parallel()) { + set_share_in_parallel(from.share_in_parallel()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void PythonParameter::CopyFrom(const PythonParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool PythonParameter::IsInitialized() const { + + return true; +} + +void PythonParameter::Swap(PythonParameter* other) { + if (other != this) { + std::swap(module_, other->module_); + std::swap(layer_, other->layer_); + std::swap(param_str_, other->param_str_); + std::swap(share_in_parallel_, other->share_in_parallel_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string PythonParameter::GetTypeName() const { + return "ditcaffe.PythonParameter"; +} + + +// =================================================================== + +bool ReductionParameter_ReductionOp_IsValid(int value) { + switch(value) { + case 1: + case 2: + case 3: + case 4: + return true; + default: + return false; + } +} + +#ifndef _MSC_VER +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 // _MSC_VER +#ifndef _MSC_VER +const int ReductionParameter::kOperationFieldNumber; +const int ReductionParameter::kAxisFieldNumber; +const int ReductionParameter::kCoeffFieldNumber; +#endif // !_MSC_VER + +ReductionParameter::ReductionParameter() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.ReductionParameter) +} + +void ReductionParameter::InitAsDefaultInstance() { +} + +ReductionParameter::ReductionParameter(const ReductionParameter& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.ReductionParameter) +} + +void ReductionParameter::SharedCtor() { + _cached_size_ = 0; + operation_ = 1; + axis_ = 0; + coeff_ = 1; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ReductionParameter::~ReductionParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.ReductionParameter) + SharedDtor(); +} + +void ReductionParameter::SharedDtor() { + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void ReductionParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ReductionParameter& ReductionParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +ReductionParameter* ReductionParameter::default_instance_ = NULL; + +ReductionParameter* ReductionParameter::New() const { + return new ReductionParameter; +} + +void ReductionParameter::Clear() { + if (_has_bits_[0 / 32] & 7) { + operation_ = 1; + axis_ = 0; + coeff_ = 1; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ReductionParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:ditcaffe.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 .ditcaffe.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 (::ditcaffe::ReductionParameter_ReductionOp_IsValid(value)) { + set_operation(static_cast< ::ditcaffe::ReductionParameter_ReductionOp >(value)); + } else { + unknown_fields_stream.WriteVarint32(tag); + unknown_fields_stream.WriteVarint32(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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &coeff_))); + set_has_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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.ReductionParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.ReductionParameter) + return false; +#undef DO_ +} + +void ReductionParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.ReductionParameter) + // optional .ditcaffe.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); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:ditcaffe.ReductionParameter) +} + +int ReductionParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional .ditcaffe.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; + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ReductionParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void ReductionParameter::MergeFrom(const ReductionParameter& from) { + GOOGLE_CHECK_NE(&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()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ReductionParameter::CopyFrom(const ReductionParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ReductionParameter::IsInitialized() const { + + return true; +} + +void ReductionParameter::Swap(ReductionParameter* other) { + if (other != this) { + std::swap(operation_, other->operation_); + std::swap(axis_, other->axis_); + std::swap(coeff_, other->coeff_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ReductionParameter::GetTypeName() const { + return "ditcaffe.ReductionParameter"; +} + + +// =================================================================== + +bool ReLUParameter_Engine_IsValid(int value) { + switch(value) { + case 0: + case 1: + case 2: + return true; + default: + return false; + } +} + +#ifndef _MSC_VER +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 // _MSC_VER +#ifndef _MSC_VER +const int ReLUParameter::kNegativeSlopeFieldNumber; +const int ReLUParameter::kEngineFieldNumber; +#endif // !_MSC_VER + +ReLUParameter::ReLUParameter() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.ReLUParameter) +} + +void ReLUParameter::InitAsDefaultInstance() { +} + +ReLUParameter::ReLUParameter(const ReLUParameter& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.ReLUParameter) +} + +void ReLUParameter::SharedCtor() { + _cached_size_ = 0; + negative_slope_ = 0; + engine_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ReLUParameter::~ReLUParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.ReLUParameter) + SharedDtor(); +} + +void ReLUParameter::SharedDtor() { + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void ReLUParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ReLUParameter& ReLUParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +ReLUParameter* ReLUParameter::default_instance_ = NULL; + +ReLUParameter* ReLUParameter::New() const { + return new ReLUParameter; +} + +void ReLUParameter::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + ZR_(negative_slope_, engine_); + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ReLUParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &negative_slope_))); + set_has_negative_slope(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_engine; + break; + } + + // optional .ditcaffe.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 (::ditcaffe::ReLUParameter_Engine_IsValid(value)) { + set_engine(static_cast< ::ditcaffe::ReLUParameter_Engine >(value)); + } else { + unknown_fields_stream.WriteVarint32(tag); + unknown_fields_stream.WriteVarint32(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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.ReLUParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.ReLUParameter) + return false; +#undef DO_ +} + +void ReLUParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.ReLUParameter) + // optional float negative_slope = 1 [default = 0]; + if (has_negative_slope()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->negative_slope(), output); + } + + // optional .ditcaffe.ReLUParameter.Engine engine = 2 [default = DEFAULT]; + if (has_engine()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 2, this->engine(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:ditcaffe.ReLUParameter) +} + +int ReLUParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional float negative_slope = 1 [default = 0]; + if (has_negative_slope()) { + total_size += 1 + 4; + } + + // optional .ditcaffe.ReLUParameter.Engine engine = 2 [default = DEFAULT]; + if (has_engine()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->engine()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ReLUParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void ReLUParameter::MergeFrom(const ReLUParameter& from) { + GOOGLE_CHECK_NE(&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()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ReLUParameter::CopyFrom(const ReLUParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ReLUParameter::IsInitialized() const { + + return true; +} + +void ReLUParameter::Swap(ReLUParameter* other) { + if (other != this) { + std::swap(negative_slope_, other->negative_slope_); + std::swap(engine_, other->engine_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ReLUParameter::GetTypeName() const { + return "ditcaffe.ReLUParameter"; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int ReshapeParameter::kShapeFieldNumber; +const int ReshapeParameter::kAxisFieldNumber; +const int ReshapeParameter::kNumAxesFieldNumber; +#endif // !_MSC_VER + +ReshapeParameter::ReshapeParameter() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.ReshapeParameter) +} + +void ReshapeParameter::InitAsDefaultInstance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + shape_ = const_cast< ::ditcaffe::BlobShape*>( + ::ditcaffe::BlobShape::internal_default_instance()); +#else + shape_ = const_cast< ::ditcaffe::BlobShape*>(&::ditcaffe::BlobShape::default_instance()); +#endif +} + +ReshapeParameter::ReshapeParameter(const ReshapeParameter& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.ReshapeParameter) +} + +void ReshapeParameter::SharedCtor() { + _cached_size_ = 0; + shape_ = NULL; + axis_ = 0; + num_axes_ = -1; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ReshapeParameter::~ReshapeParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.ReshapeParameter) + SharedDtor(); +} + +void ReshapeParameter::SharedDtor() { + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + delete shape_; + } +} + +void ReshapeParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ReshapeParameter& ReshapeParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +ReshapeParameter* ReshapeParameter::default_instance_ = NULL; + +ReshapeParameter* ReshapeParameter::New() const { + return new ReshapeParameter; +} + +void ReshapeParameter::Clear() { + if (_has_bits_[0 / 32] & 7) { + if (has_shape()) { + if (shape_ != NULL) shape_->::ditcaffe::BlobShape::Clear(); + } + axis_ = 0; + num_axes_ = -1; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ReshapeParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:ditcaffe.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 .ditcaffe.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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &num_axes_))); + set_has_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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.ReshapeParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.ReshapeParameter) + return false; +#undef DO_ +} + +void ReshapeParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.ReshapeParameter) + // optional .ditcaffe.BlobShape shape = 1; + if (has_shape()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 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); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:ditcaffe.ReshapeParameter) +} + +int ReshapeParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional .ditcaffe.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()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ReshapeParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void ReshapeParameter::MergeFrom(const ReshapeParameter& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_shape()) { + mutable_shape()->::ditcaffe::BlobShape::MergeFrom(from.shape()); + } + if (from.has_axis()) { + set_axis(from.axis()); + } + if (from.has_num_axes()) { + set_num_axes(from.num_axes()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ReshapeParameter::CopyFrom(const ReshapeParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ReshapeParameter::IsInitialized() const { + + return true; +} + +void ReshapeParameter::Swap(ReshapeParameter* other) { + if (other != this) { + 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]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ReshapeParameter::GetTypeName() const { + return "ditcaffe.ReshapeParameter"; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int ScaleParameter::kAxisFieldNumber; +const int ScaleParameter::kNumAxesFieldNumber; +const int ScaleParameter::kFillerFieldNumber; +const int ScaleParameter::kBiasTermFieldNumber; +const int ScaleParameter::kBiasFillerFieldNumber; +#endif // !_MSC_VER + +ScaleParameter::ScaleParameter() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.ScaleParameter) +} + +void ScaleParameter::InitAsDefaultInstance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + filler_ = const_cast< ::ditcaffe::FillerParameter*>( + ::ditcaffe::FillerParameter::internal_default_instance()); +#else + filler_ = const_cast< ::ditcaffe::FillerParameter*>(&::ditcaffe::FillerParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + bias_filler_ = const_cast< ::ditcaffe::FillerParameter*>( + ::ditcaffe::FillerParameter::internal_default_instance()); +#else + bias_filler_ = const_cast< ::ditcaffe::FillerParameter*>(&::ditcaffe::FillerParameter::default_instance()); +#endif +} + +ScaleParameter::ScaleParameter(const ScaleParameter& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.ScaleParameter) +} + +void ScaleParameter::SharedCtor() { + _cached_size_ = 0; + axis_ = 1; + num_axes_ = 1; + filler_ = NULL; + bias_term_ = false; + bias_filler_ = NULL; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ScaleParameter::~ScaleParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.ScaleParameter) + SharedDtor(); +} + +void ScaleParameter::SharedDtor() { + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + 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 ScaleParameter& ScaleParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +ScaleParameter* ScaleParameter::default_instance_ = NULL; + +ScaleParameter* ScaleParameter::New() const { + return new ScaleParameter; +} + +void ScaleParameter::Clear() { + if (_has_bits_[0 / 32] & 31) { + axis_ = 1; + num_axes_ = 1; + if (has_filler()) { + if (filler_ != NULL) filler_->::ditcaffe::FillerParameter::Clear(); + } + bias_term_ = false; + if (has_bias_filler()) { + if (bias_filler_ != NULL) bias_filler_->::ditcaffe::FillerParameter::Clear(); + } + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ScaleParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &num_axes_))); + set_has_num_axes(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_filler; + break; + } + + // optional .ditcaffe.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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &bias_term_))); + set_has_bias_term(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(42)) goto parse_bias_filler; + break; + } + + // optional .ditcaffe.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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.ScaleParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.ScaleParameter) + return false; +#undef DO_ +} + +void ScaleParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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 .ditcaffe.FillerParameter filler = 3; + if (has_filler()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 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 .ditcaffe.FillerParameter bias_filler = 5; + if (has_bias_filler()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 5, this->bias_filler(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:ditcaffe.ScaleParameter) +} + +int ScaleParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // 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 .ditcaffe.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 .ditcaffe.FillerParameter bias_filler = 5; + if (has_bias_filler()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->bias_filler()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ScaleParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void ScaleParameter::MergeFrom(const ScaleParameter& from) { + GOOGLE_CHECK_NE(&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()->::ditcaffe::FillerParameter::MergeFrom(from.filler()); + } + if (from.has_bias_term()) { + set_bias_term(from.bias_term()); + } + if (from.has_bias_filler()) { + mutable_bias_filler()->::ditcaffe::FillerParameter::MergeFrom(from.bias_filler()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ScaleParameter::CopyFrom(const ScaleParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ScaleParameter::IsInitialized() const { + + return true; +} + +void ScaleParameter::Swap(ScaleParameter* other) { + if (other != this) { + 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]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ScaleParameter::GetTypeName() const { + return "ditcaffe.ScaleParameter"; +} + + +// =================================================================== + +bool SigmoidParameter_Engine_IsValid(int value) { + switch(value) { + case 0: + case 1: + case 2: + return true; + default: + return false; + } +} + +#ifndef _MSC_VER +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 // _MSC_VER +#ifndef _MSC_VER +const int SigmoidParameter::kEngineFieldNumber; +#endif // !_MSC_VER + +SigmoidParameter::SigmoidParameter() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.SigmoidParameter) +} + +void SigmoidParameter::InitAsDefaultInstance() { +} + +SigmoidParameter::SigmoidParameter(const SigmoidParameter& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.SigmoidParameter) +} + +void SigmoidParameter::SharedCtor() { + _cached_size_ = 0; + engine_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +SigmoidParameter::~SigmoidParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.SigmoidParameter) + SharedDtor(); +} + +void SigmoidParameter::SharedDtor() { + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void SigmoidParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const SigmoidParameter& SigmoidParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +SigmoidParameter* SigmoidParameter::default_instance_ = NULL; + +SigmoidParameter* SigmoidParameter::New() const { + return new SigmoidParameter; +} + +void SigmoidParameter::Clear() { + engine_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool SigmoidParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:ditcaffe.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 .ditcaffe.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 (::ditcaffe::SigmoidParameter_Engine_IsValid(value)) { + set_engine(static_cast< ::ditcaffe::SigmoidParameter_Engine >(value)); + } else { + unknown_fields_stream.WriteVarint32(tag); + unknown_fields_stream.WriteVarint32(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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.SigmoidParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.SigmoidParameter) + return false; +#undef DO_ +} + +void SigmoidParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.SigmoidParameter) + // optional .ditcaffe.SigmoidParameter.Engine engine = 1 [default = DEFAULT]; + if (has_engine()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 1, this->engine(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:ditcaffe.SigmoidParameter) +} + +int SigmoidParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional .ditcaffe.SigmoidParameter.Engine engine = 1 [default = DEFAULT]; + if (has_engine()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->engine()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void SigmoidParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void SigmoidParameter::MergeFrom(const SigmoidParameter& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_engine()) { + set_engine(from.engine()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void SigmoidParameter::CopyFrom(const SigmoidParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool SigmoidParameter::IsInitialized() const { + + return true; +} + +void SigmoidParameter::Swap(SigmoidParameter* other) { + if (other != this) { + std::swap(engine_, other->engine_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string SigmoidParameter::GetTypeName() const { + return "ditcaffe.SigmoidParameter"; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int SliceParameter::kAxisFieldNumber; +const int SliceParameter::kSlicePointFieldNumber; +const int SliceParameter::kSliceDimFieldNumber; +#endif // !_MSC_VER + +SliceParameter::SliceParameter() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.SliceParameter) +} + +void SliceParameter::InitAsDefaultInstance() { +} + +SliceParameter::SliceParameter(const SliceParameter& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.SliceParameter) +} + +void SliceParameter::SharedCtor() { + _cached_size_ = 0; + axis_ = 1; + slice_dim_ = 1u; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +SliceParameter::~SliceParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.SliceParameter) + SharedDtor(); +} + +void SliceParameter::SharedDtor() { + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void SliceParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const SliceParameter& SliceParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +SliceParameter* SliceParameter::default_instance_ = NULL; + +SliceParameter* SliceParameter::New() const { + return new SliceParameter; +} + +void SliceParameter::Clear() { + if (_has_bits_[0 / 32] & 5) { + axis_ = 1; + slice_dim_ = 1u; + } + slice_point_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool SliceParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &slice_dim_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + set_has_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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.SliceParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.SliceParameter) + return false; +#undef DO_ +} + +void SliceParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:ditcaffe.SliceParameter) +} + +int SliceParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // 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; + { + int data_size = 0; + for (int i = 0; i < this->slice_point_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->slice_point(i)); + } + total_size += 1 * this->slice_point_size() + data_size; + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void SliceParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void SliceParameter::MergeFrom(const SliceParameter& from) { + GOOGLE_CHECK_NE(&from, this); + slice_point_.MergeFrom(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()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void SliceParameter::CopyFrom(const SliceParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool SliceParameter::IsInitialized() const { + + return true; +} + +void SliceParameter::Swap(SliceParameter* other) { + if (other != this) { + std::swap(axis_, other->axis_); + slice_point_.Swap(&other->slice_point_); + std::swap(slice_dim_, other->slice_dim_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string SliceParameter::GetTypeName() const { + return "ditcaffe.SliceParameter"; +} + + +// =================================================================== + +bool SoftmaxParameter_Engine_IsValid(int value) { + switch(value) { + case 0: + case 1: + case 2: + return true; + default: + return false; + } +} + +#ifndef _MSC_VER +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 // _MSC_VER +#ifndef _MSC_VER +const int SoftmaxParameter::kEngineFieldNumber; +const int SoftmaxParameter::kAxisFieldNumber; +#endif // !_MSC_VER + +SoftmaxParameter::SoftmaxParameter() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.SoftmaxParameter) +} + +void SoftmaxParameter::InitAsDefaultInstance() { +} + +SoftmaxParameter::SoftmaxParameter(const SoftmaxParameter& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.SoftmaxParameter) +} + +void SoftmaxParameter::SharedCtor() { + _cached_size_ = 0; + engine_ = 0; + axis_ = 1; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +SoftmaxParameter::~SoftmaxParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.SoftmaxParameter) + SharedDtor(); +} + +void SoftmaxParameter::SharedDtor() { + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void SoftmaxParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const SoftmaxParameter& SoftmaxParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +SoftmaxParameter* SoftmaxParameter::default_instance_ = NULL; + +SoftmaxParameter* SoftmaxParameter::New() const { + return new SoftmaxParameter; +} + +void SoftmaxParameter::Clear() { + if (_has_bits_[0 / 32] & 3) { + engine_ = 0; + axis_ = 1; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool SoftmaxParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:ditcaffe.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 .ditcaffe.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 (::ditcaffe::SoftmaxParameter_Engine_IsValid(value)) { + set_engine(static_cast< ::ditcaffe::SoftmaxParameter_Engine >(value)); + } else { + unknown_fields_stream.WriteVarint32(tag); + unknown_fields_stream.WriteVarint32(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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + set_has_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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.SoftmaxParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.SoftmaxParameter) + return false; +#undef DO_ +} + +void SoftmaxParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.SoftmaxParameter) + // optional .ditcaffe.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); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:ditcaffe.SoftmaxParameter) +} + +int SoftmaxParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional .ditcaffe.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()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void SoftmaxParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void SoftmaxParameter::MergeFrom(const SoftmaxParameter& from) { + GOOGLE_CHECK_NE(&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()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void SoftmaxParameter::CopyFrom(const SoftmaxParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool SoftmaxParameter::IsInitialized() const { + + return true; +} + +void SoftmaxParameter::Swap(SoftmaxParameter* other) { + if (other != this) { + std::swap(engine_, other->engine_); + std::swap(axis_, other->axis_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string SoftmaxParameter::GetTypeName() const { + return "ditcaffe.SoftmaxParameter"; +} + + +// =================================================================== + +bool TanHParameter_Engine_IsValid(int value) { + switch(value) { + case 0: + case 1: + case 2: + return true; + default: + return false; + } +} + +#ifndef _MSC_VER +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 // _MSC_VER +#ifndef _MSC_VER +const int TanHParameter::kEngineFieldNumber; +#endif // !_MSC_VER + +TanHParameter::TanHParameter() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.TanHParameter) +} + +void TanHParameter::InitAsDefaultInstance() { +} + +TanHParameter::TanHParameter(const TanHParameter& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.TanHParameter) +} + +void TanHParameter::SharedCtor() { + _cached_size_ = 0; + engine_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +TanHParameter::~TanHParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.TanHParameter) + SharedDtor(); +} + +void TanHParameter::SharedDtor() { + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void TanHParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const TanHParameter& TanHParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +TanHParameter* TanHParameter::default_instance_ = NULL; + +TanHParameter* TanHParameter::New() const { + return new TanHParameter; +} + +void TanHParameter::Clear() { + engine_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool TanHParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:ditcaffe.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 .ditcaffe.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 (::ditcaffe::TanHParameter_Engine_IsValid(value)) { + set_engine(static_cast< ::ditcaffe::TanHParameter_Engine >(value)); + } else { + unknown_fields_stream.WriteVarint32(tag); + unknown_fields_stream.WriteVarint32(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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.TanHParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.TanHParameter) + return false; +#undef DO_ +} + +void TanHParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.TanHParameter) + // optional .ditcaffe.TanHParameter.Engine engine = 1 [default = DEFAULT]; + if (has_engine()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 1, this->engine(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:ditcaffe.TanHParameter) +} + +int TanHParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional .ditcaffe.TanHParameter.Engine engine = 1 [default = DEFAULT]; + if (has_engine()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->engine()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void TanHParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void TanHParameter::MergeFrom(const TanHParameter& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_engine()) { + set_engine(from.engine()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void TanHParameter::CopyFrom(const TanHParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool TanHParameter::IsInitialized() const { + + return true; +} + +void TanHParameter::Swap(TanHParameter* other) { + if (other != this) { + std::swap(engine_, other->engine_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string TanHParameter::GetTypeName() const { + return "ditcaffe.TanHParameter"; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int TileParameter::kAxisFieldNumber; +const int TileParameter::kTilesFieldNumber; +#endif // !_MSC_VER + +TileParameter::TileParameter() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.TileParameter) +} + +void TileParameter::InitAsDefaultInstance() { +} + +TileParameter::TileParameter(const TileParameter& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.TileParameter) +} + +void TileParameter::SharedCtor() { + _cached_size_ = 0; + axis_ = 1; + tiles_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +TileParameter::~TileParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.TileParameter) + SharedDtor(); +} + +void TileParameter::SharedDtor() { + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void TileParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const TileParameter& TileParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +TileParameter* TileParameter::default_instance_ = NULL; + +TileParameter* TileParameter::New() const { + return new TileParameter; +} + +void TileParameter::Clear() { + if (_has_bits_[0 / 32] & 3) { + axis_ = 1; + tiles_ = 0; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool TileParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + set_has_axis(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_tiles; + break; + } + + // optional int32 tiles = 2; + case 2: { + if (tag == 16) { + parse_tiles: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &tiles_))); + set_has_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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.TileParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.TileParameter) + return false; +#undef DO_ +} + +void TileParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:ditcaffe.TileParameter) +} + +int TileParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // 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()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void TileParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void TileParameter::MergeFrom(const TileParameter& from) { + GOOGLE_CHECK_NE(&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()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void TileParameter::CopyFrom(const TileParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool TileParameter::IsInitialized() const { + + return true; +} + +void TileParameter::Swap(TileParameter* other) { + if (other != this) { + std::swap(axis_, other->axis_); + std::swap(tiles_, other->tiles_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string TileParameter::GetTypeName() const { + return "ditcaffe.TileParameter"; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int ThresholdParameter::kThresholdFieldNumber; +#endif // !_MSC_VER + +ThresholdParameter::ThresholdParameter() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.ThresholdParameter) +} + +void ThresholdParameter::InitAsDefaultInstance() { +} + +ThresholdParameter::ThresholdParameter(const ThresholdParameter& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.ThresholdParameter) +} + +void ThresholdParameter::SharedCtor() { + _cached_size_ = 0; + threshold_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ThresholdParameter::~ThresholdParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.ThresholdParameter) + SharedDtor(); +} + +void ThresholdParameter::SharedDtor() { + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void ThresholdParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ThresholdParameter& ThresholdParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +ThresholdParameter* ThresholdParameter::default_instance_ = NULL; + +ThresholdParameter* ThresholdParameter::New() const { + return new ThresholdParameter; +} + +void ThresholdParameter::Clear() { + threshold_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ThresholdParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &threshold_))); + set_has_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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.ThresholdParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.ThresholdParameter) + return false; +#undef DO_ +} + +void ThresholdParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.ThresholdParameter) + // optional float threshold = 1 [default = 0]; + if (has_threshold()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->threshold(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:ditcaffe.ThresholdParameter) +} + +int ThresholdParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional float threshold = 1 [default = 0]; + if (has_threshold()) { + total_size += 1 + 4; + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ThresholdParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void ThresholdParameter::MergeFrom(const ThresholdParameter& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_threshold()) { + set_threshold(from.threshold()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ThresholdParameter::CopyFrom(const ThresholdParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ThresholdParameter::IsInitialized() const { + + return true; +} + +void ThresholdParameter::Swap(ThresholdParameter* other) { + if (other != this) { + std::swap(threshold_, other->threshold_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ThresholdParameter::GetTypeName() const { + return "ditcaffe.ThresholdParameter"; +} + + +// =================================================================== + +::std::string* WindowDataParameter::_default_crop_mode_ = NULL; +#ifndef _MSC_VER +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 // !_MSC_VER + +WindowDataParameter::WindowDataParameter() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.WindowDataParameter) +} + +void WindowDataParameter::InitAsDefaultInstance() { +} + +WindowDataParameter::WindowDataParameter(const WindowDataParameter& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.WindowDataParameter) +} + +void WindowDataParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + source_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + scale_ = 1; + mean_file_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + batch_size_ = 0u; + crop_size_ = 0u; + mirror_ = false; + fg_threshold_ = 0.5f; + bg_threshold_ = 0.5f; + fg_fraction_ = 0.25f; + context_pad_ = 0u; + crop_mode_ = const_cast< ::std::string*>(_default_crop_mode_); + cache_images_ = false; + root_folder_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +WindowDataParameter::~WindowDataParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.WindowDataParameter) + SharedDtor(); +} + +void WindowDataParameter::SharedDtor() { + if (source_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete source_; + } + if (mean_file_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete mean_file_; + } + if (crop_mode_ != _default_crop_mode_) { + delete crop_mode_; + } + if (root_folder_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete root_folder_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void WindowDataParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const WindowDataParameter& WindowDataParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +WindowDataParameter* WindowDataParameter::default_instance_ = NULL; + +WindowDataParameter* WindowDataParameter::New() const { + return new WindowDataParameter; +} + +void WindowDataParameter::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 255) { + ZR_(batch_size_, crop_size_); + if (has_source()) { + if (source_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_->clear(); + } + } + scale_ = 1; + if (has_mean_file()) { + if (mean_file_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + mean_file_->clear(); + } + } + mirror_ = false; + fg_threshold_ = 0.5f; + bg_threshold_ = 0.5f; + } + if (_has_bits_[8 / 32] & 7936) { + ZR_(cache_images_, context_pad_); + fg_fraction_ = 0.25f; + if (has_crop_mode()) { + if (crop_mode_ != _default_crop_mode_) { + crop_mode_->assign(*_default_crop_mode_); + } + } + if (has_root_folder()) { + if (root_folder_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + root_folder_->clear(); + } + } + } + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool WindowDataParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:ditcaffe.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())); + } 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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &scale_))); + set_has_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())); + } 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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &batch_size_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &crop_size_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &mirror_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &fg_threshold_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &bg_threshold_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &fg_fraction_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &context_pad_))); + set_has_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())); + } 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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &cache_images_))); + set_has_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())); + } 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, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.WindowDataParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.WindowDataParameter) + return false; +#undef DO_ +} + +void WindowDataParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.WindowDataParameter) + // optional string source = 1; + if (has_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::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::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::WireFormatLite::WriteStringMaybeAliased( + 13, this->root_folder(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:ditcaffe.WindowDataParameter) +} + +int WindowDataParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // 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] & (0xffu << (8 % 32))) { + // 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()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void WindowDataParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void WindowDataParameter::MergeFrom(const WindowDataParameter& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_source()) { + set_source(from.source()); + } + if (from.has_scale()) { + set_scale(from.scale()); + } + if (from.has_mean_file()) { + set_mean_file(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_crop_mode(from.crop_mode()); + } + if (from.has_cache_images()) { + set_cache_images(from.cache_images()); + } + if (from.has_root_folder()) { + set_root_folder(from.root_folder()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void WindowDataParameter::CopyFrom(const WindowDataParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool WindowDataParameter::IsInitialized() const { + + return true; +} + +void WindowDataParameter::Swap(WindowDataParameter* other) { + if (other != this) { + std::swap(source_, other->source_); + std::swap(scale_, other->scale_); + std::swap(mean_file_, 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_); + std::swap(crop_mode_, other->crop_mode_); + std::swap(cache_images_, other->cache_images_); + std::swap(root_folder_, other->root_folder_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string WindowDataParameter::GetTypeName() const { + return "ditcaffe.WindowDataParameter"; +} + + +// =================================================================== + +bool SPPParameter_PoolMethod_IsValid(int value) { + switch(value) { + case 0: + case 1: + case 2: + return true; + default: + return false; + } +} + +#ifndef _MSC_VER +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 // _MSC_VER +bool SPPParameter_Engine_IsValid(int value) { + switch(value) { + case 0: + case 1: + case 2: + return true; + default: + return false; + } +} + +#ifndef _MSC_VER +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 // _MSC_VER +#ifndef _MSC_VER +const int SPPParameter::kPyramidHeightFieldNumber; +const int SPPParameter::kPoolFieldNumber; +const int SPPParameter::kEngineFieldNumber; +#endif // !_MSC_VER + +SPPParameter::SPPParameter() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.SPPParameter) +} + +void SPPParameter::InitAsDefaultInstance() { +} + +SPPParameter::SPPParameter(const SPPParameter& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.SPPParameter) +} + +void SPPParameter::SharedCtor() { + _cached_size_ = 0; + pyramid_height_ = 0u; + pool_ = 0; + engine_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +SPPParameter::~SPPParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.SPPParameter) + SharedDtor(); +} + +void SPPParameter::SharedDtor() { + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void SPPParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const SPPParameter& SPPParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +SPPParameter* SPPParameter::default_instance_ = NULL; + +SPPParameter* SPPParameter::New() const { + return new SPPParameter; +} + +void SPPParameter::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + ZR_(pyramid_height_, engine_); + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool SPPParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &pyramid_height_))); + set_has_pyramid_height(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_pool; + break; + } + + // optional .ditcaffe.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 (::ditcaffe::SPPParameter_PoolMethod_IsValid(value)) { + set_pool(static_cast< ::ditcaffe::SPPParameter_PoolMethod >(value)); + } else { + unknown_fields_stream.WriteVarint32(tag); + unknown_fields_stream.WriteVarint32(value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(48)) goto parse_engine; + break; + } + + // optional .ditcaffe.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 (::ditcaffe::SPPParameter_Engine_IsValid(value)) { + set_engine(static_cast< ::ditcaffe::SPPParameter_Engine >(value)); + } else { + unknown_fields_stream.WriteVarint32(tag); + unknown_fields_stream.WriteVarint32(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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.SPPParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.SPPParameter) + return false; +#undef DO_ +} + +void SPPParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.SPPParameter) + // optional uint32 pyramid_height = 1; + if (has_pyramid_height()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->pyramid_height(), output); + } + + // optional .ditcaffe.SPPParameter.PoolMethod pool = 2 [default = MAX]; + if (has_pool()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 2, this->pool(), output); + } + + // optional .ditcaffe.SPPParameter.Engine engine = 6 [default = DEFAULT]; + if (has_engine()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 6, this->engine(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:ditcaffe.SPPParameter) +} + +int SPPParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional uint32 pyramid_height = 1; + if (has_pyramid_height()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->pyramid_height()); + } + + // optional .ditcaffe.SPPParameter.PoolMethod pool = 2 [default = MAX]; + if (has_pool()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->pool()); + } + + // optional .ditcaffe.SPPParameter.Engine engine = 6 [default = DEFAULT]; + if (has_engine()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->engine()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void SPPParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void SPPParameter::MergeFrom(const SPPParameter& from) { + GOOGLE_CHECK_NE(&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()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void SPPParameter::CopyFrom(const SPPParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool SPPParameter::IsInitialized() const { + + return true; +} + +void SPPParameter::Swap(SPPParameter* other) { + if (other != this) { + 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]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string SPPParameter::GetTypeName() const { + return "ditcaffe.SPPParameter"; +} + + +// =================================================================== + +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; + } +} + +#ifndef _MSC_VER +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 // _MSC_VER +bool V1LayerParameter_DimCheckMode_IsValid(int value) { + switch(value) { + case 0: + case 1: + return true; + default: + return false; + } +} + +#ifndef _MSC_VER +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 // _MSC_VER +#ifndef _MSC_VER +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 // !_MSC_VER + +V1LayerParameter::V1LayerParameter() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.V1LayerParameter) +} + +void V1LayerParameter::InitAsDefaultInstance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + accuracy_param_ = const_cast< ::ditcaffe::AccuracyParameter*>( + ::ditcaffe::AccuracyParameter::internal_default_instance()); +#else + accuracy_param_ = const_cast< ::ditcaffe::AccuracyParameter*>(&::ditcaffe::AccuracyParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + argmax_param_ = const_cast< ::ditcaffe::ArgMaxParameter*>( + ::ditcaffe::ArgMaxParameter::internal_default_instance()); +#else + argmax_param_ = const_cast< ::ditcaffe::ArgMaxParameter*>(&::ditcaffe::ArgMaxParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + concat_param_ = const_cast< ::ditcaffe::ConcatParameter*>( + ::ditcaffe::ConcatParameter::internal_default_instance()); +#else + concat_param_ = const_cast< ::ditcaffe::ConcatParameter*>(&::ditcaffe::ConcatParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + contrastive_loss_param_ = const_cast< ::ditcaffe::ContrastiveLossParameter*>( + ::ditcaffe::ContrastiveLossParameter::internal_default_instance()); +#else + contrastive_loss_param_ = const_cast< ::ditcaffe::ContrastiveLossParameter*>(&::ditcaffe::ContrastiveLossParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + convolution_param_ = const_cast< ::ditcaffe::ConvolutionParameter*>( + ::ditcaffe::ConvolutionParameter::internal_default_instance()); +#else + convolution_param_ = const_cast< ::ditcaffe::ConvolutionParameter*>(&::ditcaffe::ConvolutionParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + data_param_ = const_cast< ::ditcaffe::DataParameter*>( + ::ditcaffe::DataParameter::internal_default_instance()); +#else + data_param_ = const_cast< ::ditcaffe::DataParameter*>(&::ditcaffe::DataParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + dropout_param_ = const_cast< ::ditcaffe::DropoutParameter*>( + ::ditcaffe::DropoutParameter::internal_default_instance()); +#else + dropout_param_ = const_cast< ::ditcaffe::DropoutParameter*>(&::ditcaffe::DropoutParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + dummy_data_param_ = const_cast< ::ditcaffe::DummyDataParameter*>( + ::ditcaffe::DummyDataParameter::internal_default_instance()); +#else + dummy_data_param_ = const_cast< ::ditcaffe::DummyDataParameter*>(&::ditcaffe::DummyDataParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + eltwise_param_ = const_cast< ::ditcaffe::EltwiseParameter*>( + ::ditcaffe::EltwiseParameter::internal_default_instance()); +#else + eltwise_param_ = const_cast< ::ditcaffe::EltwiseParameter*>(&::ditcaffe::EltwiseParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + exp_param_ = const_cast< ::ditcaffe::ExpParameter*>( + ::ditcaffe::ExpParameter::internal_default_instance()); +#else + exp_param_ = const_cast< ::ditcaffe::ExpParameter*>(&::ditcaffe::ExpParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + hdf5_data_param_ = const_cast< ::ditcaffe::HDF5DataParameter*>( + ::ditcaffe::HDF5DataParameter::internal_default_instance()); +#else + hdf5_data_param_ = const_cast< ::ditcaffe::HDF5DataParameter*>(&::ditcaffe::HDF5DataParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + hdf5_output_param_ = const_cast< ::ditcaffe::HDF5OutputParameter*>( + ::ditcaffe::HDF5OutputParameter::internal_default_instance()); +#else + hdf5_output_param_ = const_cast< ::ditcaffe::HDF5OutputParameter*>(&::ditcaffe::HDF5OutputParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + hinge_loss_param_ = const_cast< ::ditcaffe::HingeLossParameter*>( + ::ditcaffe::HingeLossParameter::internal_default_instance()); +#else + hinge_loss_param_ = const_cast< ::ditcaffe::HingeLossParameter*>(&::ditcaffe::HingeLossParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + image_data_param_ = const_cast< ::ditcaffe::ImageDataParameter*>( + ::ditcaffe::ImageDataParameter::internal_default_instance()); +#else + image_data_param_ = const_cast< ::ditcaffe::ImageDataParameter*>(&::ditcaffe::ImageDataParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + infogain_loss_param_ = const_cast< ::ditcaffe::InfogainLossParameter*>( + ::ditcaffe::InfogainLossParameter::internal_default_instance()); +#else + infogain_loss_param_ = const_cast< ::ditcaffe::InfogainLossParameter*>(&::ditcaffe::InfogainLossParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + inner_product_param_ = const_cast< ::ditcaffe::InnerProductParameter*>( + ::ditcaffe::InnerProductParameter::internal_default_instance()); +#else + inner_product_param_ = const_cast< ::ditcaffe::InnerProductParameter*>(&::ditcaffe::InnerProductParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + lrn_param_ = const_cast< ::ditcaffe::LRNParameter*>( + ::ditcaffe::LRNParameter::internal_default_instance()); +#else + lrn_param_ = const_cast< ::ditcaffe::LRNParameter*>(&::ditcaffe::LRNParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + memory_data_param_ = const_cast< ::ditcaffe::MemoryDataParameter*>( + ::ditcaffe::MemoryDataParameter::internal_default_instance()); +#else + memory_data_param_ = const_cast< ::ditcaffe::MemoryDataParameter*>(&::ditcaffe::MemoryDataParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + mvn_param_ = const_cast< ::ditcaffe::MVNParameter*>( + ::ditcaffe::MVNParameter::internal_default_instance()); +#else + mvn_param_ = const_cast< ::ditcaffe::MVNParameter*>(&::ditcaffe::MVNParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + pooling_param_ = const_cast< ::ditcaffe::PoolingParameter*>( + ::ditcaffe::PoolingParameter::internal_default_instance()); +#else + pooling_param_ = const_cast< ::ditcaffe::PoolingParameter*>(&::ditcaffe::PoolingParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + power_param_ = const_cast< ::ditcaffe::PowerParameter*>( + ::ditcaffe::PowerParameter::internal_default_instance()); +#else + power_param_ = const_cast< ::ditcaffe::PowerParameter*>(&::ditcaffe::PowerParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + relu_param_ = const_cast< ::ditcaffe::ReLUParameter*>( + ::ditcaffe::ReLUParameter::internal_default_instance()); +#else + relu_param_ = const_cast< ::ditcaffe::ReLUParameter*>(&::ditcaffe::ReLUParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + sigmoid_param_ = const_cast< ::ditcaffe::SigmoidParameter*>( + ::ditcaffe::SigmoidParameter::internal_default_instance()); +#else + sigmoid_param_ = const_cast< ::ditcaffe::SigmoidParameter*>(&::ditcaffe::SigmoidParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + softmax_param_ = const_cast< ::ditcaffe::SoftmaxParameter*>( + ::ditcaffe::SoftmaxParameter::internal_default_instance()); +#else + softmax_param_ = const_cast< ::ditcaffe::SoftmaxParameter*>(&::ditcaffe::SoftmaxParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + slice_param_ = const_cast< ::ditcaffe::SliceParameter*>( + ::ditcaffe::SliceParameter::internal_default_instance()); +#else + slice_param_ = const_cast< ::ditcaffe::SliceParameter*>(&::ditcaffe::SliceParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + tanh_param_ = const_cast< ::ditcaffe::TanHParameter*>( + ::ditcaffe::TanHParameter::internal_default_instance()); +#else + tanh_param_ = const_cast< ::ditcaffe::TanHParameter*>(&::ditcaffe::TanHParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + threshold_param_ = const_cast< ::ditcaffe::ThresholdParameter*>( + ::ditcaffe::ThresholdParameter::internal_default_instance()); +#else + threshold_param_ = const_cast< ::ditcaffe::ThresholdParameter*>(&::ditcaffe::ThresholdParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + window_data_param_ = const_cast< ::ditcaffe::WindowDataParameter*>( + ::ditcaffe::WindowDataParameter::internal_default_instance()); +#else + window_data_param_ = const_cast< ::ditcaffe::WindowDataParameter*>(&::ditcaffe::WindowDataParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + transform_param_ = const_cast< ::ditcaffe::TransformationParameter*>( + ::ditcaffe::TransformationParameter::internal_default_instance()); +#else + transform_param_ = const_cast< ::ditcaffe::TransformationParameter*>(&::ditcaffe::TransformationParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + loss_param_ = const_cast< ::ditcaffe::LossParameter*>( + ::ditcaffe::LossParameter::internal_default_instance()); +#else + loss_param_ = const_cast< ::ditcaffe::LossParameter*>(&::ditcaffe::LossParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + layer_ = const_cast< ::ditcaffe::V0LayerParameter*>( + ::ditcaffe::V0LayerParameter::internal_default_instance()); +#else + layer_ = const_cast< ::ditcaffe::V0LayerParameter*>(&::ditcaffe::V0LayerParameter::default_instance()); +#endif +} + +V1LayerParameter::V1LayerParameter(const V1LayerParameter& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.V1LayerParameter) +} + +void V1LayerParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + type_ = 0; + 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; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +V1LayerParameter::~V1LayerParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.V1LayerParameter) + SharedDtor(); +} + +void V1LayerParameter::SharedDtor() { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete name_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + 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 V1LayerParameter& V1LayerParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +V1LayerParameter* V1LayerParameter::default_instance_ = NULL; + +V1LayerParameter* V1LayerParameter::New() const { + return new V1LayerParameter; +} + +void V1LayerParameter::Clear() { + if (_has_bits_[0 / 32] & 36) { + if (has_name()) { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_->clear(); + } + } + type_ = 0; + } + if (_has_bits_[8 / 32] & 61440) { + if (has_accuracy_param()) { + if (accuracy_param_ != NULL) accuracy_param_->::ditcaffe::AccuracyParameter::Clear(); + } + if (has_argmax_param()) { + if (argmax_param_ != NULL) argmax_param_->::ditcaffe::ArgMaxParameter::Clear(); + } + if (has_concat_param()) { + if (concat_param_ != NULL) concat_param_->::ditcaffe::ConcatParameter::Clear(); + } + if (has_contrastive_loss_param()) { + if (contrastive_loss_param_ != NULL) contrastive_loss_param_->::ditcaffe::ContrastiveLossParameter::Clear(); + } + } + if (_has_bits_[16 / 32] & 16711680) { + if (has_convolution_param()) { + if (convolution_param_ != NULL) convolution_param_->::ditcaffe::ConvolutionParameter::Clear(); + } + if (has_data_param()) { + if (data_param_ != NULL) data_param_->::ditcaffe::DataParameter::Clear(); + } + if (has_dropout_param()) { + if (dropout_param_ != NULL) dropout_param_->::ditcaffe::DropoutParameter::Clear(); + } + if (has_dummy_data_param()) { + if (dummy_data_param_ != NULL) dummy_data_param_->::ditcaffe::DummyDataParameter::Clear(); + } + if (has_eltwise_param()) { + if (eltwise_param_ != NULL) eltwise_param_->::ditcaffe::EltwiseParameter::Clear(); + } + if (has_exp_param()) { + if (exp_param_ != NULL) exp_param_->::ditcaffe::ExpParameter::Clear(); + } + if (has_hdf5_data_param()) { + if (hdf5_data_param_ != NULL) hdf5_data_param_->::ditcaffe::HDF5DataParameter::Clear(); + } + if (has_hdf5_output_param()) { + if (hdf5_output_param_ != NULL) hdf5_output_param_->::ditcaffe::HDF5OutputParameter::Clear(); + } + } + if (_has_bits_[24 / 32] & 4278190080) { + if (has_hinge_loss_param()) { + if (hinge_loss_param_ != NULL) hinge_loss_param_->::ditcaffe::HingeLossParameter::Clear(); + } + if (has_image_data_param()) { + if (image_data_param_ != NULL) image_data_param_->::ditcaffe::ImageDataParameter::Clear(); + } + if (has_infogain_loss_param()) { + if (infogain_loss_param_ != NULL) infogain_loss_param_->::ditcaffe::InfogainLossParameter::Clear(); + } + if (has_inner_product_param()) { + if (inner_product_param_ != NULL) inner_product_param_->::ditcaffe::InnerProductParameter::Clear(); + } + if (has_lrn_param()) { + if (lrn_param_ != NULL) lrn_param_->::ditcaffe::LRNParameter::Clear(); + } + if (has_memory_data_param()) { + if (memory_data_param_ != NULL) memory_data_param_->::ditcaffe::MemoryDataParameter::Clear(); + } + if (has_mvn_param()) { + if (mvn_param_ != NULL) mvn_param_->::ditcaffe::MVNParameter::Clear(); + } + if (has_pooling_param()) { + if (pooling_param_ != NULL) pooling_param_->::ditcaffe::PoolingParameter::Clear(); + } + } + if (_has_bits_[32 / 32] & 255) { + if (has_power_param()) { + if (power_param_ != NULL) power_param_->::ditcaffe::PowerParameter::Clear(); + } + if (has_relu_param()) { + if (relu_param_ != NULL) relu_param_->::ditcaffe::ReLUParameter::Clear(); + } + if (has_sigmoid_param()) { + if (sigmoid_param_ != NULL) sigmoid_param_->::ditcaffe::SigmoidParameter::Clear(); + } + if (has_softmax_param()) { + if (softmax_param_ != NULL) softmax_param_->::ditcaffe::SoftmaxParameter::Clear(); + } + if (has_slice_param()) { + if (slice_param_ != NULL) slice_param_->::ditcaffe::SliceParameter::Clear(); + } + if (has_tanh_param()) { + if (tanh_param_ != NULL) tanh_param_->::ditcaffe::TanHParameter::Clear(); + } + if (has_threshold_param()) { + if (threshold_param_ != NULL) threshold_param_->::ditcaffe::ThresholdParameter::Clear(); + } + if (has_window_data_param()) { + if (window_data_param_ != NULL) window_data_param_->::ditcaffe::WindowDataParameter::Clear(); + } + } + if (_has_bits_[40 / 32] & 1792) { + if (has_transform_param()) { + if (transform_param_ != NULL) transform_param_->::ditcaffe::TransformationParameter::Clear(); + } + if (has_loss_param()) { + if (loss_param_ != NULL) loss_param_->::ditcaffe::LossParameter::Clear(); + } + if (has_layer()) { + if (layer_ != NULL) layer_->::ditcaffe::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(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool V1LayerParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:ditcaffe.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 .ditcaffe.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())); + } 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())); + } 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())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(40)) goto parse_type; + break; + } + + // optional .ditcaffe.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 (::ditcaffe::V1LayerParameter_LayerType_IsValid(value)) { + set_type(static_cast< ::ditcaffe::V1LayerParameter_LayerType >(value)); + } else { + unknown_fields_stream.WriteVarint32(tag); + unknown_fields_stream.WriteVarint32(value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(50)) goto parse_blobs; + break; + } + + // repeated .ditcaffe.BlobProto blobs = 6; + case 6: { + if (tag == 50) { + parse_blobs: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_blobs())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(50)) goto parse_blobs; + 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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.NetStateRule include = 32; + case 32: { + if (tag == 258) { + parse_include: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_include())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(258)) goto parse_include; + if (input->ExpectTag(266)) goto parse_exclude; + break; + } + + // repeated .ditcaffe.NetStateRule exclude = 33; + case 33: { + if (tag == 266) { + parse_exclude: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_exclude())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(266)) goto parse_exclude; + if (input->ExpectTag(274)) goto parse_mvn_param; + break; + } + + // optional .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(8010)) goto parse_param; + if (input->ExpectTag(8016)) goto parse_blob_share_mode; + break; + } + + // repeated .ditcaffe.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 (::ditcaffe::V1LayerParameter_DimCheckMode_IsValid(value)) { + add_blob_share_mode(static_cast< ::ditcaffe::V1LayerParameter_DimCheckMode >(value)); + } else { + unknown_fields_stream.WriteVarint32(tag); + unknown_fields_stream.WriteVarint32(value); + } + } else if (tag == 8018) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedEnumNoInline( + input, + &::ditcaffe::V1LayerParameter_DimCheckMode_IsValid, + 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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.V1LayerParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.V1LayerParameter) + return false; +#undef DO_ +} + +void V1LayerParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.V1LayerParameter) + // optional .ditcaffe.V0LayerParameter layer = 1; + if (has_layer()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 1, this->layer(), output); + } + + // repeated string bottom = 2; + for (int i = 0; i < this->bottom_size(); i++) { + ::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::WireFormatLite::WriteString( + 3, this->top(i), output); + } + + // optional string name = 4; + if (has_name()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 4, this->name(), output); + } + + // optional .ditcaffe.V1LayerParameter.LayerType type = 5; + if (has_type()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 5, this->type(), output); + } + + // repeated .ditcaffe.BlobProto blobs = 6; + for (int i = 0; i < this->blobs_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 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 .ditcaffe.ConcatParameter concat_param = 9; + if (has_concat_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 9, this->concat_param(), output); + } + + // optional .ditcaffe.ConvolutionParameter convolution_param = 10; + if (has_convolution_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 10, this->convolution_param(), output); + } + + // optional .ditcaffe.DataParameter data_param = 11; + if (has_data_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 11, this->data_param(), output); + } + + // optional .ditcaffe.DropoutParameter dropout_param = 12; + if (has_dropout_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 12, this->dropout_param(), output); + } + + // optional .ditcaffe.HDF5DataParameter hdf5_data_param = 13; + if (has_hdf5_data_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 13, this->hdf5_data_param(), output); + } + + // optional .ditcaffe.HDF5OutputParameter hdf5_output_param = 14; + if (has_hdf5_output_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 14, this->hdf5_output_param(), output); + } + + // optional .ditcaffe.ImageDataParameter image_data_param = 15; + if (has_image_data_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 15, this->image_data_param(), output); + } + + // optional .ditcaffe.InfogainLossParameter infogain_loss_param = 16; + if (has_infogain_loss_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 16, this->infogain_loss_param(), output); + } + + // optional .ditcaffe.InnerProductParameter inner_product_param = 17; + if (has_inner_product_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 17, this->inner_product_param(), output); + } + + // optional .ditcaffe.LRNParameter lrn_param = 18; + if (has_lrn_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 18, this->lrn_param(), output); + } + + // optional .ditcaffe.PoolingParameter pooling_param = 19; + if (has_pooling_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 19, this->pooling_param(), output); + } + + // optional .ditcaffe.WindowDataParameter window_data_param = 20; + if (has_window_data_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 20, this->window_data_param(), output); + } + + // optional .ditcaffe.PowerParameter power_param = 21; + if (has_power_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 21, this->power_param(), output); + } + + // optional .ditcaffe.MemoryDataParameter memory_data_param = 22; + if (has_memory_data_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 22, this->memory_data_param(), output); + } + + // optional .ditcaffe.ArgMaxParameter argmax_param = 23; + if (has_argmax_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 23, this->argmax_param(), output); + } + + // optional .ditcaffe.EltwiseParameter eltwise_param = 24; + if (has_eltwise_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 24, this->eltwise_param(), output); + } + + // optional .ditcaffe.ThresholdParameter threshold_param = 25; + if (has_threshold_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 25, this->threshold_param(), output); + } + + // optional .ditcaffe.DummyDataParameter dummy_data_param = 26; + if (has_dummy_data_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 26, this->dummy_data_param(), output); + } + + // optional .ditcaffe.AccuracyParameter accuracy_param = 27; + if (has_accuracy_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 27, this->accuracy_param(), output); + } + + // optional .ditcaffe.HingeLossParameter hinge_loss_param = 29; + if (has_hinge_loss_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 29, this->hinge_loss_param(), output); + } + + // optional .ditcaffe.ReLUParameter relu_param = 30; + if (has_relu_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 30, this->relu_param(), output); + } + + // optional .ditcaffe.SliceParameter slice_param = 31; + if (has_slice_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 31, this->slice_param(), output); + } + + // repeated .ditcaffe.NetStateRule include = 32; + for (int i = 0; i < this->include_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 32, this->include(i), output); + } + + // repeated .ditcaffe.NetStateRule exclude = 33; + for (int i = 0; i < this->exclude_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 33, this->exclude(i), output); + } + + // optional .ditcaffe.MVNParameter mvn_param = 34; + if (has_mvn_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 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 .ditcaffe.TransformationParameter transform_param = 36; + if (has_transform_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 36, this->transform_param(), output); + } + + // optional .ditcaffe.TanHParameter tanh_param = 37; + if (has_tanh_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 37, this->tanh_param(), output); + } + + // optional .ditcaffe.SigmoidParameter sigmoid_param = 38; + if (has_sigmoid_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 38, this->sigmoid_param(), output); + } + + // optional .ditcaffe.SoftmaxParameter softmax_param = 39; + if (has_softmax_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 39, this->softmax_param(), output); + } + + // optional .ditcaffe.ContrastiveLossParameter contrastive_loss_param = 40; + if (has_contrastive_loss_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 40, this->contrastive_loss_param(), output); + } + + // optional .ditcaffe.ExpParameter exp_param = 41; + if (has_exp_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 41, this->exp_param(), output); + } + + // optional .ditcaffe.LossParameter loss_param = 42; + if (has_loss_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 42, this->loss_param(), output); + } + + // repeated string param = 1001; + for (int i = 0; i < this->param_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteString( + 1001, this->param(i), output); + } + + // repeated .ditcaffe.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); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:ditcaffe.V1LayerParameter) +} + +int V1LayerParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[2 / 32] & (0xffu << (2 % 32))) { + // optional string name = 4; + if (has_name()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } + + // optional .ditcaffe.V1LayerParameter.LayerType type = 5; + if (has_type()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->type()); + } + + } + if (_has_bits_[12 / 32] & (0xffu << (12 % 32))) { + // optional .ditcaffe.AccuracyParameter accuracy_param = 27; + if (has_accuracy_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->accuracy_param()); + } + + // optional .ditcaffe.ArgMaxParameter argmax_param = 23; + if (has_argmax_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->argmax_param()); + } + + // optional .ditcaffe.ConcatParameter concat_param = 9; + if (has_concat_param()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->concat_param()); + } + + // optional .ditcaffe.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] & (0xffu << (16 % 32))) { + // optional .ditcaffe.ConvolutionParameter convolution_param = 10; + if (has_convolution_param()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->convolution_param()); + } + + // optional .ditcaffe.DataParameter data_param = 11; + if (has_data_param()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->data_param()); + } + + // optional .ditcaffe.DropoutParameter dropout_param = 12; + if (has_dropout_param()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->dropout_param()); + } + + // optional .ditcaffe.DummyDataParameter dummy_data_param = 26; + if (has_dummy_data_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->dummy_data_param()); + } + + // optional .ditcaffe.EltwiseParameter eltwise_param = 24; + if (has_eltwise_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->eltwise_param()); + } + + // optional .ditcaffe.ExpParameter exp_param = 41; + if (has_exp_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->exp_param()); + } + + // optional .ditcaffe.HDF5DataParameter hdf5_data_param = 13; + if (has_hdf5_data_param()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->hdf5_data_param()); + } + + // optional .ditcaffe.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] & (0xffu << (24 % 32))) { + // optional .ditcaffe.HingeLossParameter hinge_loss_param = 29; + if (has_hinge_loss_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->hinge_loss_param()); + } + + // optional .ditcaffe.ImageDataParameter image_data_param = 15; + if (has_image_data_param()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->image_data_param()); + } + + // optional .ditcaffe.InfogainLossParameter infogain_loss_param = 16; + if (has_infogain_loss_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->infogain_loss_param()); + } + + // optional .ditcaffe.InnerProductParameter inner_product_param = 17; + if (has_inner_product_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->inner_product_param()); + } + + // optional .ditcaffe.LRNParameter lrn_param = 18; + if (has_lrn_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->lrn_param()); + } + + // optional .ditcaffe.MemoryDataParameter memory_data_param = 22; + if (has_memory_data_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->memory_data_param()); + } + + // optional .ditcaffe.MVNParameter mvn_param = 34; + if (has_mvn_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->mvn_param()); + } + + // optional .ditcaffe.PoolingParameter pooling_param = 19; + if (has_pooling_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->pooling_param()); + } + + } + if (_has_bits_[32 / 32] & (0xffu << (32 % 32))) { + // optional .ditcaffe.PowerParameter power_param = 21; + if (has_power_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->power_param()); + } + + // optional .ditcaffe.ReLUParameter relu_param = 30; + if (has_relu_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->relu_param()); + } + + // optional .ditcaffe.SigmoidParameter sigmoid_param = 38; + if (has_sigmoid_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->sigmoid_param()); + } + + // optional .ditcaffe.SoftmaxParameter softmax_param = 39; + if (has_softmax_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->softmax_param()); + } + + // optional .ditcaffe.SliceParameter slice_param = 31; + if (has_slice_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->slice_param()); + } + + // optional .ditcaffe.TanHParameter tanh_param = 37; + if (has_tanh_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->tanh_param()); + } + + // optional .ditcaffe.ThresholdParameter threshold_param = 25; + if (has_threshold_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->threshold_param()); + } + + // optional .ditcaffe.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] & (0xffu << (40 % 32))) { + // optional .ditcaffe.TransformationParameter transform_param = 36; + if (has_transform_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->transform_param()); + } + + // optional .ditcaffe.LossParameter loss_param = 42; + if (has_loss_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->loss_param()); + } + + // optional .ditcaffe.V0LayerParameter layer = 1; + if (has_layer()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->layer()); + } + + } + // repeated string bottom = 2; + total_size += 1 * 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 * this->top_size(); + for (int i = 0; i < this->top_size(); i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->top(i)); + } + + // repeated .ditcaffe.NetStateRule include = 32; + total_size += 2 * this->include_size(); + for (int i = 0; i < this->include_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->include(i)); + } + + // repeated .ditcaffe.NetStateRule exclude = 33; + total_size += 2 * this->exclude_size(); + for (int i = 0; i < this->exclude_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->exclude(i)); + } + + // repeated .ditcaffe.BlobProto blobs = 6; + total_size += 1 * this->blobs_size(); + for (int i = 0; i < this->blobs_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->blobs(i)); + } + + // repeated string param = 1001; + total_size += 2 * this->param_size(); + for (int i = 0; i < this->param_size(); i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->param(i)); + } + + // repeated .ditcaffe.V1LayerParameter.DimCheckMode blob_share_mode = 1002; + { + int data_size = 0; + for (int i = 0; i < this->blob_share_mode_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite::EnumSize( + this->blob_share_mode(i)); + } + total_size += 2 * this->blob_share_mode_size() + data_size; + } + + // repeated float blobs_lr = 7; + { + int data_size = 0; + data_size = 4 * this->blobs_lr_size(); + total_size += 1 * this->blobs_lr_size() + data_size; + } + + // repeated float weight_decay = 8; + { + int data_size = 0; + data_size = 4 * this->weight_decay_size(); + total_size += 1 * this->weight_decay_size() + data_size; + } + + // repeated float loss_weight = 35; + { + int data_size = 0; + data_size = 4 * this->loss_weight_size(); + total_size += 2 * this->loss_weight_size() + data_size; + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void V1LayerParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void V1LayerParameter::MergeFrom(const V1LayerParameter& from) { + GOOGLE_CHECK_NE(&from, this); + bottom_.MergeFrom(from.bottom_); + top_.MergeFrom(from.top_); + include_.MergeFrom(from.include_); + exclude_.MergeFrom(from.exclude_); + blobs_.MergeFrom(from.blobs_); + param_.MergeFrom(from.param_); + blob_share_mode_.MergeFrom(from.blob_share_mode_); + blobs_lr_.MergeFrom(from.blobs_lr_); + weight_decay_.MergeFrom(from.weight_decay_); + loss_weight_.MergeFrom(from.loss_weight_); + if (from._has_bits_[2 / 32] & (0xffu << (2 % 32))) { + if (from.has_name()) { + set_name(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()->::ditcaffe::AccuracyParameter::MergeFrom(from.accuracy_param()); + } + if (from.has_argmax_param()) { + mutable_argmax_param()->::ditcaffe::ArgMaxParameter::MergeFrom(from.argmax_param()); + } + if (from.has_concat_param()) { + mutable_concat_param()->::ditcaffe::ConcatParameter::MergeFrom(from.concat_param()); + } + if (from.has_contrastive_loss_param()) { + mutable_contrastive_loss_param()->::ditcaffe::ContrastiveLossParameter::MergeFrom(from.contrastive_loss_param()); + } + } + if (from._has_bits_[16 / 32] & (0xffu << (16 % 32))) { + if (from.has_convolution_param()) { + mutable_convolution_param()->::ditcaffe::ConvolutionParameter::MergeFrom(from.convolution_param()); + } + if (from.has_data_param()) { + mutable_data_param()->::ditcaffe::DataParameter::MergeFrom(from.data_param()); + } + if (from.has_dropout_param()) { + mutable_dropout_param()->::ditcaffe::DropoutParameter::MergeFrom(from.dropout_param()); + } + if (from.has_dummy_data_param()) { + mutable_dummy_data_param()->::ditcaffe::DummyDataParameter::MergeFrom(from.dummy_data_param()); + } + if (from.has_eltwise_param()) { + mutable_eltwise_param()->::ditcaffe::EltwiseParameter::MergeFrom(from.eltwise_param()); + } + if (from.has_exp_param()) { + mutable_exp_param()->::ditcaffe::ExpParameter::MergeFrom(from.exp_param()); + } + if (from.has_hdf5_data_param()) { + mutable_hdf5_data_param()->::ditcaffe::HDF5DataParameter::MergeFrom(from.hdf5_data_param()); + } + if (from.has_hdf5_output_param()) { + mutable_hdf5_output_param()->::ditcaffe::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()->::ditcaffe::HingeLossParameter::MergeFrom(from.hinge_loss_param()); + } + if (from.has_image_data_param()) { + mutable_image_data_param()->::ditcaffe::ImageDataParameter::MergeFrom(from.image_data_param()); + } + if (from.has_infogain_loss_param()) { + mutable_infogain_loss_param()->::ditcaffe::InfogainLossParameter::MergeFrom(from.infogain_loss_param()); + } + if (from.has_inner_product_param()) { + mutable_inner_product_param()->::ditcaffe::InnerProductParameter::MergeFrom(from.inner_product_param()); + } + if (from.has_lrn_param()) { + mutable_lrn_param()->::ditcaffe::LRNParameter::MergeFrom(from.lrn_param()); + } + if (from.has_memory_data_param()) { + mutable_memory_data_param()->::ditcaffe::MemoryDataParameter::MergeFrom(from.memory_data_param()); + } + if (from.has_mvn_param()) { + mutable_mvn_param()->::ditcaffe::MVNParameter::MergeFrom(from.mvn_param()); + } + if (from.has_pooling_param()) { + mutable_pooling_param()->::ditcaffe::PoolingParameter::MergeFrom(from.pooling_param()); + } + } + if (from._has_bits_[32 / 32] & (0xffu << (32 % 32))) { + if (from.has_power_param()) { + mutable_power_param()->::ditcaffe::PowerParameter::MergeFrom(from.power_param()); + } + if (from.has_relu_param()) { + mutable_relu_param()->::ditcaffe::ReLUParameter::MergeFrom(from.relu_param()); + } + if (from.has_sigmoid_param()) { + mutable_sigmoid_param()->::ditcaffe::SigmoidParameter::MergeFrom(from.sigmoid_param()); + } + if (from.has_softmax_param()) { + mutable_softmax_param()->::ditcaffe::SoftmaxParameter::MergeFrom(from.softmax_param()); + } + if (from.has_slice_param()) { + mutable_slice_param()->::ditcaffe::SliceParameter::MergeFrom(from.slice_param()); + } + if (from.has_tanh_param()) { + mutable_tanh_param()->::ditcaffe::TanHParameter::MergeFrom(from.tanh_param()); + } + if (from.has_threshold_param()) { + mutable_threshold_param()->::ditcaffe::ThresholdParameter::MergeFrom(from.threshold_param()); + } + if (from.has_window_data_param()) { + mutable_window_data_param()->::ditcaffe::WindowDataParameter::MergeFrom(from.window_data_param()); + } + } + if (from._has_bits_[40 / 32] & (0xffu << (40 % 32))) { + if (from.has_transform_param()) { + mutable_transform_param()->::ditcaffe::TransformationParameter::MergeFrom(from.transform_param()); + } + if (from.has_loss_param()) { + mutable_loss_param()->::ditcaffe::LossParameter::MergeFrom(from.loss_param()); + } + if (from.has_layer()) { + mutable_layer()->::ditcaffe::V0LayerParameter::MergeFrom(from.layer()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void V1LayerParameter::CopyFrom(const V1LayerParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool V1LayerParameter::IsInitialized() const { + + return true; +} + +void V1LayerParameter::Swap(V1LayerParameter* other) { + if (other != this) { + bottom_.Swap(&other->bottom_); + top_.Swap(&other->top_); + std::swap(name_, other->name_); + include_.Swap(&other->include_); + exclude_.Swap(&other->exclude_); + std::swap(type_, other->type_); + blobs_.Swap(&other->blobs_); + param_.Swap(&other->param_); + blob_share_mode_.Swap(&other->blob_share_mode_); + blobs_lr_.Swap(&other->blobs_lr_); + weight_decay_.Swap(&other->weight_decay_); + loss_weight_.Swap(&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]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string V1LayerParameter::GetTypeName() const { + return "ditcaffe.V1LayerParameter"; +} + + +// =================================================================== + +bool V0LayerParameter_PoolMethod_IsValid(int value) { + switch(value) { + case 0: + case 1: + case 2: + return true; + default: + return false; + } +} + +#ifndef _MSC_VER +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 // _MSC_VER +::std::string* V0LayerParameter::_default_det_crop_mode_ = NULL; +#ifndef _MSC_VER +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 // !_MSC_VER + +V0LayerParameter::V0LayerParameter() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.V0LayerParameter) +} + +void V0LayerParameter::InitAsDefaultInstance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + weight_filler_ = const_cast< ::ditcaffe::FillerParameter*>( + ::ditcaffe::FillerParameter::internal_default_instance()); +#else + weight_filler_ = const_cast< ::ditcaffe::FillerParameter*>(&::ditcaffe::FillerParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + bias_filler_ = const_cast< ::ditcaffe::FillerParameter*>( + ::ditcaffe::FillerParameter::internal_default_instance()); +#else + bias_filler_ = const_cast< ::ditcaffe::FillerParameter*>(&::ditcaffe::FillerParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + hdf5_output_param_ = const_cast< ::ditcaffe::HDF5OutputParameter*>( + ::ditcaffe::HDF5OutputParameter::internal_default_instance()); +#else + hdf5_output_param_ = const_cast< ::ditcaffe::HDF5OutputParameter*>(&::ditcaffe::HDF5OutputParameter::default_instance()); +#endif +} + +V0LayerParameter::V0LayerParameter(const V0LayerParameter& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.V0LayerParameter) +} + +void V0LayerParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + type_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + num_output_ = 0u; + biasterm_ = true; + weight_filler_ = NULL; + bias_filler_ = NULL; + pad_ = 0u; + kernelsize_ = 0u; + group_ = 1u; + stride_ = 1u; + pool_ = 0; + dropout_ratio_ = 0.5f; + local_size_ = 5u; + alpha_ = 1; + beta_ = 0.75f; + k_ = 1; + source_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + scale_ = 1; + meanfile_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + batchsize_ = 0u; + cropsize_ = 0u; + mirror_ = false; + rand_skip_ = 0u; + det_fg_threshold_ = 0.5f; + det_bg_threshold_ = 0.5f; + det_fg_fraction_ = 0.25f; + det_context_pad_ = 0u; + det_crop_mode_ = const_cast< ::std::string*>(_default_det_crop_mode_); + new_num_ = 0; + new_channels_ = 0; + new_height_ = 0; + new_width_ = 0; + shuffle_images_ = false; + concat_dim_ = 1u; + hdf5_output_param_ = NULL; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +V0LayerParameter::~V0LayerParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.V0LayerParameter) + SharedDtor(); +} + +void V0LayerParameter::SharedDtor() { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete name_; + } + if (type_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete type_; + } + if (source_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete source_; + } + if (meanfile_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete meanfile_; + } + if (det_crop_mode_ != _default_det_crop_mode_) { + delete det_crop_mode_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + 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 V0LayerParameter& V0LayerParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +V0LayerParameter* V0LayerParameter::default_instance_ = NULL; + +V0LayerParameter* V0LayerParameter::New() const { + return new V0LayerParameter; +} + +void V0LayerParameter::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast( \ + &reinterpret_cast(16)->f) - \ + reinterpret_cast(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 255) { + ZR_(num_output_, pad_); + if (has_name()) { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_->clear(); + } + } + if (has_type()) { + if (type_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + type_->clear(); + } + } + biasterm_ = true; + if (has_weight_filler()) { + if (weight_filler_ != NULL) weight_filler_->::ditcaffe::FillerParameter::Clear(); + } + if (has_bias_filler()) { + if (bias_filler_ != NULL) bias_filler_->::ditcaffe::FillerParameter::Clear(); + } + kernelsize_ = 0u; + } + if (_has_bits_[8 / 32] & 65280) { + 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] & 4128768) { + if (has_source()) { + if (source_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_->clear(); + } + } + scale_ = 1; + if (has_meanfile()) { + if (meanfile_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + meanfile_->clear(); + } + } + batchsize_ = 0u; + cropsize_ = 0u; + mirror_ = false; + } + if (_has_bits_[24 / 32] & 4261412864) { + rand_skip_ = 0u; + det_fg_threshold_ = 0.5f; + det_bg_threshold_ = 0.5f; + det_fg_fraction_ = 0.25f; + det_context_pad_ = 0u; + if (has_det_crop_mode()) { + if (det_crop_mode_ != _default_det_crop_mode_) { + det_crop_mode_->assign(*_default_det_crop_mode_); + } + } + new_num_ = 0; + } + if (_has_bits_[32 / 32] & 63) { + ZR_(new_channels_, new_width_); + shuffle_images_ = false; + concat_dim_ = 1u; + if (has_hdf5_output_param()) { + if (hdf5_output_param_ != NULL) hdf5_output_param_->::ditcaffe::HDF5OutputParameter::Clear(); + } + } + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + blobs_.Clear(); + blobs_lr_.Clear(); + weight_decay_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool V0LayerParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:ditcaffe.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())); + } 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())); + } 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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &num_output_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &biasterm_))); + set_has_biasterm(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(42)) goto parse_weight_filler; + break; + } + + // optional .ditcaffe.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 .ditcaffe.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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &pad_))); + set_has_pad(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(64)) goto parse_kernelsize; + break; + } + + // optional uint32 kernelsize = 8; + case 8: { + if (tag == 64) { + parse_kernelsize: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &kernelsize_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &group_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &stride_))); + set_has_stride(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(88)) goto parse_pool; + break; + } + + // optional .ditcaffe.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 (::ditcaffe::V0LayerParameter_PoolMethod_IsValid(value)) { + set_pool(static_cast< ::ditcaffe::V0LayerParameter_PoolMethod >(value)); + } else { + unknown_fields_stream.WriteVarint32(tag); + unknown_fields_stream.WriteVarint32(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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &dropout_ratio_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &local_size_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &alpha_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &beta_))); + set_has_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())); + } 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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &scale_))); + set_has_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())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(152)) goto parse_batchsize; + break; + } + + // optional uint32 batchsize = 19; + case 19: { + if (tag == 152) { + parse_batchsize: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &batchsize_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &cropsize_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &mirror_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &k_))); + set_has_k(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(402)) goto parse_blobs; + break; + } + + // repeated .ditcaffe.BlobProto blobs = 50; + case 50: { + if (tag == 402) { + parse_blobs: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_blobs())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(402)) goto parse_blobs; + 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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &rand_skip_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &det_fg_threshold_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &det_bg_threshold_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &det_fg_fraction_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &det_context_pad_))); + set_has_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())); + } 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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &new_num_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &new_channels_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &new_height_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &new_width_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &shuffle_images_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &concat_dim_))); + set_has_concat_dim(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(8010)) goto parse_hdf5_output_param; + break; + } + + // optional .ditcaffe.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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.V0LayerParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.V0LayerParameter) + return false; +#undef DO_ +} + +void V0LayerParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.V0LayerParameter) + // optional string name = 1; + if (has_name()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // optional string type = 2; + if (has_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 .ditcaffe.FillerParameter weight_filler = 5; + if (has_weight_filler()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 5, this->weight_filler(), output); + } + + // optional .ditcaffe.FillerParameter bias_filler = 6; + if (has_bias_filler()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 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 .ditcaffe.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::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::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 .ditcaffe.BlobProto blobs = 50; + for (int i = 0; i < this->blobs_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 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::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 .ditcaffe.HDF5OutputParameter hdf5_output_param = 1001; + if (has_hdf5_output_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 1001, this->hdf5_output_param(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:ditcaffe.V0LayerParameter) +} + +int V0LayerParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // 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 .ditcaffe.FillerParameter weight_filler = 5; + if (has_weight_filler()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->weight_filler()); + } + + // optional .ditcaffe.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] & (0xffu << (8 % 32))) { + // 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 .ditcaffe.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] & (0xffu << (16 % 32))) { + // 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] & (0xffu << (25 % 32))) { + // 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] & (0xffu << (32 % 32))) { + // 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 .ditcaffe.HDF5OutputParameter hdf5_output_param = 1001; + if (has_hdf5_output_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->hdf5_output_param()); + } + + } + // repeated .ditcaffe.BlobProto blobs = 50; + total_size += 2 * this->blobs_size(); + for (int i = 0; i < this->blobs_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->blobs(i)); + } + + // repeated float blobs_lr = 51; + { + int data_size = 0; + data_size = 4 * this->blobs_lr_size(); + total_size += 2 * this->blobs_lr_size() + data_size; + } + + // repeated float weight_decay = 52; + { + int data_size = 0; + data_size = 4 * this->weight_decay_size(); + total_size += 2 * this->weight_decay_size() + data_size; + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void V0LayerParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void V0LayerParameter::MergeFrom(const V0LayerParameter& from) { + GOOGLE_CHECK_NE(&from, this); + blobs_.MergeFrom(from.blobs_); + blobs_lr_.MergeFrom(from.blobs_lr_); + weight_decay_.MergeFrom(from.weight_decay_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_name()) { + set_name(from.name()); + } + if (from.has_type()) { + set_type(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()->::ditcaffe::FillerParameter::MergeFrom(from.weight_filler()); + } + if (from.has_bias_filler()) { + mutable_bias_filler()->::ditcaffe::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_source(from.source()); + } + if (from.has_scale()) { + set_scale(from.scale()); + } + if (from.has_meanfile()) { + set_meanfile(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_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()->::ditcaffe::HDF5OutputParameter::MergeFrom(from.hdf5_output_param()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void V0LayerParameter::CopyFrom(const V0LayerParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool V0LayerParameter::IsInitialized() const { + + return true; +} + +void V0LayerParameter::Swap(V0LayerParameter* other) { + if (other != this) { + std::swap(name_, other->name_); + std::swap(type_, 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_); + std::swap(source_, other->source_); + std::swap(scale_, other->scale_); + std::swap(meanfile_, other->meanfile_); + std::swap(batchsize_, other->batchsize_); + std::swap(cropsize_, other->cropsize_); + std::swap(mirror_, other->mirror_); + blobs_.Swap(&other->blobs_); + blobs_lr_.Swap(&other->blobs_lr_); + weight_decay_.Swap(&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_); + std::swap(det_crop_mode_, 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]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string V0LayerParameter::GetTypeName() const { + return "ditcaffe.V0LayerParameter"; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int PReLUParameter::kFillerFieldNumber; +const int PReLUParameter::kChannelSharedFieldNumber; +#endif // !_MSC_VER + +PReLUParameter::PReLUParameter() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.PReLUParameter) +} + +void PReLUParameter::InitAsDefaultInstance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + filler_ = const_cast< ::ditcaffe::FillerParameter*>( + ::ditcaffe::FillerParameter::internal_default_instance()); +#else + filler_ = const_cast< ::ditcaffe::FillerParameter*>(&::ditcaffe::FillerParameter::default_instance()); +#endif +} + +PReLUParameter::PReLUParameter(const PReLUParameter& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.PReLUParameter) +} + +void PReLUParameter::SharedCtor() { + _cached_size_ = 0; + filler_ = NULL; + channel_shared_ = false; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +PReLUParameter::~PReLUParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.PReLUParameter) + SharedDtor(); +} + +void PReLUParameter::SharedDtor() { + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + delete filler_; + } +} + +void PReLUParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const PReLUParameter& PReLUParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +PReLUParameter* PReLUParameter::default_instance_ = NULL; + +PReLUParameter* PReLUParameter::New() const { + return new PReLUParameter; +} + +void PReLUParameter::Clear() { + if (_has_bits_[0 / 32] & 3) { + if (has_filler()) { + if (filler_ != NULL) filler_->::ditcaffe::FillerParameter::Clear(); + } + channel_shared_ = false; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool PReLUParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:ditcaffe.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 .ditcaffe.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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &channel_shared_))); + set_has_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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.PReLUParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.PReLUParameter) + return false; +#undef DO_ +} + +void PReLUParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.PReLUParameter) + // optional .ditcaffe.FillerParameter filler = 1; + if (has_filler()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 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); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:ditcaffe.PReLUParameter) +} + +int PReLUParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional .ditcaffe.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; + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void PReLUParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void PReLUParameter::MergeFrom(const PReLUParameter& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_filler()) { + mutable_filler()->::ditcaffe::FillerParameter::MergeFrom(from.filler()); + } + if (from.has_channel_shared()) { + set_channel_shared(from.channel_shared()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void PReLUParameter::CopyFrom(const PReLUParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool PReLUParameter::IsInitialized() const { + + return true; +} + +void PReLUParameter::Swap(PReLUParameter* other) { + if (other != this) { + std::swap(filler_, other->filler_); + std::swap(channel_shared_, other->channel_shared_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string PReLUParameter::GetTypeName() const { + return "ditcaffe.PReLUParameter"; +} + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace ditcaffe + +// @@protoc_insertion_point(global_scope) diff --git a/umd/core/src/compiler/caffe/ditcaffe/protobuf-lite-2.6.1/ditcaffe.opt-for-lite.pb.h b/umd/core/src/compiler/caffe/ditcaffe/protobuf-lite-2.6.1/ditcaffe.opt-for-lite.pb.h new file mode 100644 index 00000000..2aa0cf70 --- /dev/null +++ b/umd/core/src/compiler/caffe/ditcaffe/protobuf-lite-2.6.1/ditcaffe.opt-for-lite.pb.h @@ -0,0 +1,24910 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: ditcaffe.opt-for-lite.proto + +#ifndef PROTOBUF_ditcaffe_2eopt_2dfor_2dlite_2eproto__INCLUDED +#define PROTOBUF_ditcaffe_2eopt_2dfor_2dlite_2eproto__INCLUDED + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 2006000 +#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 2006001 < 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 +// @@protoc_insertion_point(includes) + +namespace ditcaffe { + +// Internal implementation detail -- do not call these. +void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + +class BlobShape; +class BlobProto; +class BlobProtoVector; +class Datum; +class FillerParameter; +class NetParameter; +class SolverParameter; +class SolverState; +class NetState; +class NetStateRule; +class ParamSpec; +class LayerParameter; +class TransformationParameter; +class LossParameter; +class AccuracyParameter; +class ArgMaxParameter; +class ConcatParameter; +class BatchNormParameter; +class BiasParameter; +class ContrastiveLossParameter; +class ConvolutionParameter; +class CropParameter; +class DataParameter; +class DropoutParameter; +class DummyDataParameter; +class EltwiseParameter; +class ELUParameter; +class EmbedParameter; +class ExpParameter; +class FlattenParameter; +class HDF5DataParameter; +class HDF5OutputParameter; +class HingeLossParameter; +class ImageDataParameter; +class InfogainLossParameter; +class InnerProductParameter; +class InputParameter; +class LogParameter; +class LRNParameter; +class MemoryDataParameter; +class MVNParameter; +class ParameterParameter; +class PoolingParameter; +class PowerParameter; +class PythonParameter; +class ReductionParameter; +class ReLUParameter; +class ReshapeParameter; +class ScaleParameter; +class SigmoidParameter; +class SliceParameter; +class SoftmaxParameter; +class TanHParameter; +class TileParameter; +class ThresholdParameter; +class WindowDataParameter; +class SPPParameter; +class V1LayerParameter; +class V0LayerParameter; +class PReLUParameter; + +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; + +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; + +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; + +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; + +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; + +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; + +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; + +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; + +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; + +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; + +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; + +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; + +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; + +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; + +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; + +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; + +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; + +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; + +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; + +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; + +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; + +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; + +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; + +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; + +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; + +// =================================================================== + +class BlobShape : public ::google::protobuf::MessageLite { + public: + BlobShape(); + virtual ~BlobShape(); + + BlobShape(const BlobShape& from); + + inline BlobShape& operator=(const BlobShape& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const BlobShape& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const BlobShape* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(BlobShape* other); + + // implements Message ---------------------------------------------- + + BlobShape* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const BlobShape& from); + void MergeFrom(const BlobShape& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated int64 dim = 1 [packed = true]; + inline int dim_size() const; + inline void clear_dim(); + static const int kDimFieldNumber = 1; + inline ::google::protobuf::int64 dim(int index) const; + inline void set_dim(int index, ::google::protobuf::int64 value); + inline void add_dim(::google::protobuf::int64 value); + inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& + dim() const; + inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* + mutable_dim(); + + // @@protoc_insertion_point(class_scope:ditcaffe.BlobShape) + private: + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 > dim_; + mutable int _dim_cached_byte_size_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static BlobShape* default_instance_; +}; +// ------------------------------------------------------------------- + +class BlobProto : public ::google::protobuf::MessageLite { + public: + BlobProto(); + virtual ~BlobProto(); + + BlobProto(const BlobProto& from); + + inline BlobProto& operator=(const BlobProto& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const BlobProto& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const BlobProto* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(BlobProto* other); + + // implements Message ---------------------------------------------- + + BlobProto* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const BlobProto& from); + void MergeFrom(const BlobProto& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional .ditcaffe.BlobShape shape = 7; + inline bool has_shape() const; + inline void clear_shape(); + static const int kShapeFieldNumber = 7; + inline const ::ditcaffe::BlobShape& shape() const; + inline ::ditcaffe::BlobShape* mutable_shape(); + inline ::ditcaffe::BlobShape* release_shape(); + inline void set_allocated_shape(::ditcaffe::BlobShape* shape); + + // repeated float data = 5 [packed = true]; + inline int data_size() const; + inline void clear_data(); + static const int kDataFieldNumber = 5; + inline float data(int index) const; + inline void set_data(int index, float value); + inline void add_data(float value); + inline const ::google::protobuf::RepeatedField< float >& + data() const; + inline ::google::protobuf::RepeatedField< float >* + mutable_data(); + + // repeated float diff = 6 [packed = true]; + inline int diff_size() const; + inline void clear_diff(); + static const int kDiffFieldNumber = 6; + inline float diff(int index) const; + inline void set_diff(int index, float value); + inline void add_diff(float value); + inline const ::google::protobuf::RepeatedField< float >& + diff() const; + inline ::google::protobuf::RepeatedField< float >* + mutable_diff(); + + // repeated double double_data = 8 [packed = true]; + inline int double_data_size() const; + inline void clear_double_data(); + static const int kDoubleDataFieldNumber = 8; + inline double double_data(int index) const; + inline void set_double_data(int index, double value); + inline void add_double_data(double value); + inline const ::google::protobuf::RepeatedField< double >& + double_data() const; + inline ::google::protobuf::RepeatedField< double >* + mutable_double_data(); + + // repeated double double_diff = 9 [packed = true]; + inline int double_diff_size() const; + inline void clear_double_diff(); + static const int kDoubleDiffFieldNumber = 9; + inline double double_diff(int index) const; + inline void set_double_diff(int index, double value); + inline void add_double_diff(double value); + inline const ::google::protobuf::RepeatedField< double >& + double_diff() const; + inline ::google::protobuf::RepeatedField< double >* + mutable_double_diff(); + + // repeated uint32 half_data = 10 [packed = true]; + inline int half_data_size() const; + inline void clear_half_data(); + static const int kHalfDataFieldNumber = 10; + inline ::google::protobuf::uint32 half_data(int index) const; + inline void set_half_data(int index, ::google::protobuf::uint32 value); + inline void add_half_data(::google::protobuf::uint32 value); + inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& + half_data() const; + inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* + mutable_half_data(); + + // repeated uint32 half_diff = 11 [packed = true]; + inline int half_diff_size() const; + inline void clear_half_diff(); + static const int kHalfDiffFieldNumber = 11; + inline ::google::protobuf::uint32 half_diff(int index) const; + inline void set_half_diff(int index, ::google::protobuf::uint32 value); + inline void add_half_diff(::google::protobuf::uint32 value); + inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& + half_diff() const; + inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* + mutable_half_diff(); + + // optional int32 num = 1 [default = 0]; + inline bool has_num() const; + inline void clear_num(); + static const int kNumFieldNumber = 1; + inline ::google::protobuf::int32 num() const; + inline void set_num(::google::protobuf::int32 value); + + // optional int32 channels = 2 [default = 0]; + inline bool has_channels() const; + inline void clear_channels(); + static const int kChannelsFieldNumber = 2; + inline ::google::protobuf::int32 channels() const; + inline void set_channels(::google::protobuf::int32 value); + + // optional int32 height = 3 [default = 0]; + inline bool has_height() const; + inline void clear_height(); + static const int kHeightFieldNumber = 3; + inline ::google::protobuf::int32 height() const; + inline void set_height(::google::protobuf::int32 value); + + // optional int32 width = 4 [default = 0]; + inline bool has_width() const; + inline void clear_width(); + static const int kWidthFieldNumber = 4; + inline ::google::protobuf::int32 width() const; + inline void set_width(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::ditcaffe::BlobShape* shape_; + ::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_; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > half_data_; + mutable int _half_data_cached_byte_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > half_diff_; + mutable int _half_diff_cached_byte_size_; + ::google::protobuf::int32 num_; + ::google::protobuf::int32 channels_; + ::google::protobuf::int32 height_; + ::google::protobuf::int32 width_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static BlobProto* default_instance_; +}; +// ------------------------------------------------------------------- + +class BlobProtoVector : public ::google::protobuf::MessageLite { + public: + BlobProtoVector(); + virtual ~BlobProtoVector(); + + BlobProtoVector(const BlobProtoVector& from); + + inline BlobProtoVector& operator=(const BlobProtoVector& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const BlobProtoVector& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const BlobProtoVector* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(BlobProtoVector* other); + + // implements Message ---------------------------------------------- + + BlobProtoVector* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const BlobProtoVector& from); + void MergeFrom(const BlobProtoVector& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .ditcaffe.BlobProto blobs = 1; + inline int blobs_size() const; + inline void clear_blobs(); + static const int kBlobsFieldNumber = 1; + inline const ::ditcaffe::BlobProto& blobs(int index) const; + inline ::ditcaffe::BlobProto* mutable_blobs(int index); + inline ::ditcaffe::BlobProto* add_blobs(); + inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >& + blobs() const; + inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >* + mutable_blobs(); + + // @@protoc_insertion_point(class_scope:ditcaffe.BlobProtoVector) + private: + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto > blobs_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static BlobProtoVector* default_instance_; +}; +// ------------------------------------------------------------------- + +class Datum : public ::google::protobuf::MessageLite { + public: + Datum(); + virtual ~Datum(); + + Datum(const Datum& from); + + inline Datum& operator=(const Datum& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const Datum& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const Datum* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(Datum* other); + + // implements Message ---------------------------------------------- + + Datum* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const Datum& from); + void MergeFrom(const Datum& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional int32 channels = 1; + inline bool has_channels() const; + inline void clear_channels(); + static const int kChannelsFieldNumber = 1; + inline ::google::protobuf::int32 channels() const; + inline void set_channels(::google::protobuf::int32 value); + + // optional int32 height = 2; + inline bool has_height() const; + inline void clear_height(); + static const int kHeightFieldNumber = 2; + inline ::google::protobuf::int32 height() const; + inline void set_height(::google::protobuf::int32 value); + + // optional int32 width = 3; + inline bool has_width() const; + inline void clear_width(); + static const int kWidthFieldNumber = 3; + inline ::google::protobuf::int32 width() const; + inline void set_width(::google::protobuf::int32 value); + + // optional bytes data = 4; + inline bool has_data() const; + inline void clear_data(); + static const int kDataFieldNumber = 4; + inline const ::std::string& data() const; + inline void set_data(const ::std::string& value); + inline void set_data(const char* value); + inline void set_data(const void* value, size_t size); + inline ::std::string* mutable_data(); + inline ::std::string* release_data(); + inline void set_allocated_data(::std::string* data); + + // optional int32 label = 5; + inline bool has_label() const; + inline void clear_label(); + static const int kLabelFieldNumber = 5; + inline ::google::protobuf::int32 label() const; + inline void set_label(::google::protobuf::int32 value); + + // repeated float float_data = 6; + inline int float_data_size() const; + inline void clear_float_data(); + static const int kFloatDataFieldNumber = 6; + inline float float_data(int index) const; + inline void set_float_data(int index, float value); + inline void add_float_data(float value); + inline const ::google::protobuf::RepeatedField< float >& + float_data() const; + inline ::google::protobuf::RepeatedField< float >* + mutable_float_data(); + + // optional bool encoded = 7 [default = false]; + inline bool has_encoded() const; + inline void clear_encoded(); + static const int kEncodedFieldNumber = 7; + inline bool encoded() const; + inline void set_encoded(bool value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::int32 channels_; + ::google::protobuf::int32 height_; + ::std::string* data_; + ::google::protobuf::int32 width_; + ::google::protobuf::int32 label_; + ::google::protobuf::RepeatedField< float > float_data_; + bool encoded_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static Datum* default_instance_; +}; +// ------------------------------------------------------------------- + +class FillerParameter : public ::google::protobuf::MessageLite { + public: + FillerParameter(); + virtual ~FillerParameter(); + + FillerParameter(const FillerParameter& from); + + inline FillerParameter& operator=(const FillerParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const FillerParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const FillerParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(FillerParameter* other); + + // implements Message ---------------------------------------------- + + FillerParameter* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const FillerParameter& from); + void MergeFrom(const FillerParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() 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; + + // accessors ------------------------------------------------------- + + // optional string type = 1 [default = "constant"]; + inline bool has_type() const; + inline void clear_type(); + static const int kTypeFieldNumber = 1; + inline const ::std::string& type() const; + inline void set_type(const ::std::string& value); + inline void set_type(const char* value); + inline void set_type(const char* value, size_t size); + inline ::std::string* mutable_type(); + inline ::std::string* release_type(); + inline void set_allocated_type(::std::string* type); + + // optional float value = 2 [default = 0]; + inline bool has_value() const; + inline void clear_value(); + static const int kValueFieldNumber = 2; + inline float value() const; + inline void set_value(float value); + + // optional float min = 3 [default = 0]; + inline bool has_min() const; + inline void clear_min(); + static const int kMinFieldNumber = 3; + inline float min() const; + inline void set_min(float value); + + // optional float max = 4 [default = 1]; + inline bool has_max() const; + inline void clear_max(); + static const int kMaxFieldNumber = 4; + inline float max() const; + inline void set_max(float value); + + // optional float mean = 5 [default = 0]; + inline bool has_mean() const; + inline void clear_mean(); + static const int kMeanFieldNumber = 5; + inline float mean() const; + inline void set_mean(float value); + + // optional float std = 6 [default = 1]; + inline bool has_std() const; + inline void clear_std(); + static const int kStdFieldNumber = 6; + inline float std() const; + inline void set_std(float value); + + // optional int32 sparse = 7 [default = -1]; + inline bool has_sparse() const; + inline void clear_sparse(); + static const int kSparseFieldNumber = 7; + inline ::google::protobuf::int32 sparse() const; + inline void set_sparse(::google::protobuf::int32 value); + + // optional .ditcaffe.FillerParameter.VarianceNorm variance_norm = 8 [default = FAN_IN]; + inline bool has_variance_norm() const; + inline void clear_variance_norm(); + static const int kVarianceNormFieldNumber = 8; + inline ::ditcaffe::FillerParameter_VarianceNorm variance_norm() const; + inline void set_variance_norm(::ditcaffe::FillerParameter_VarianceNorm value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + static ::std::string* _default_type_; + ::std::string* type_; + float value_; + float min_; + float max_; + float mean_; + float std_; + ::google::protobuf::int32 sparse_; + int variance_norm_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static FillerParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class NetParameter : public ::google::protobuf::MessageLite { + public: + NetParameter(); + virtual ~NetParameter(); + + NetParameter(const NetParameter& from); + + inline NetParameter& operator=(const NetParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const NetParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const NetParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(NetParameter* other); + + // implements Message ---------------------------------------------- + + NetParameter* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const NetParameter& from); + void MergeFrom(const NetParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional string name = 1; + inline bool has_name() const; + inline void clear_name(); + static const int kNameFieldNumber = 1; + inline const ::std::string& name() const; + inline void set_name(const ::std::string& value); + inline void set_name(const char* value); + inline void set_name(const char* value, size_t size); + inline ::std::string* mutable_name(); + inline ::std::string* release_name(); + inline void set_allocated_name(::std::string* name); + + // repeated string input = 3; + inline int input_size() const; + inline void clear_input(); + static const int kInputFieldNumber = 3; + inline const ::std::string& input(int index) const; + inline ::std::string* mutable_input(int index); + inline void set_input(int index, const ::std::string& value); + inline void set_input(int index, const char* value); + inline void set_input(int index, const char* value, size_t size); + inline ::std::string* add_input(); + inline void add_input(const ::std::string& value); + inline void add_input(const char* value); + inline void add_input(const char* value, size_t size); + inline const ::google::protobuf::RepeatedPtrField< ::std::string>& input() const; + inline ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_input(); + + // repeated .ditcaffe.BlobShape input_shape = 8; + inline int input_shape_size() const; + inline void clear_input_shape(); + static const int kInputShapeFieldNumber = 8; + inline const ::ditcaffe::BlobShape& input_shape(int index) const; + inline ::ditcaffe::BlobShape* mutable_input_shape(int index); + inline ::ditcaffe::BlobShape* add_input_shape(); + inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobShape >& + input_shape() const; + inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobShape >* + mutable_input_shape(); + + // repeated int32 input_dim = 4; + inline int input_dim_size() const; + inline void clear_input_dim(); + static const int kInputDimFieldNumber = 4; + inline ::google::protobuf::int32 input_dim(int index) const; + inline void set_input_dim(int index, ::google::protobuf::int32 value); + inline void add_input_dim(::google::protobuf::int32 value); + inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& + input_dim() const; + inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* + mutable_input_dim(); + + // optional bool force_backward = 5 [default = false]; + inline bool has_force_backward() const; + inline void clear_force_backward(); + static const int kForceBackwardFieldNumber = 5; + inline bool force_backward() const; + inline void set_force_backward(bool value); + + // optional .ditcaffe.NetState state = 6; + inline bool has_state() const; + inline void clear_state(); + static const int kStateFieldNumber = 6; + inline const ::ditcaffe::NetState& state() const; + inline ::ditcaffe::NetState* mutable_state(); + inline ::ditcaffe::NetState* release_state(); + inline void set_allocated_state(::ditcaffe::NetState* state); + + // optional bool debug_info = 7 [default = false]; + inline bool has_debug_info() const; + inline void clear_debug_info(); + static const int kDebugInfoFieldNumber = 7; + inline bool debug_info() const; + inline void set_debug_info(bool value); + + // repeated .ditcaffe.LayerParameter layer = 100; + inline int layer_size() const; + inline void clear_layer(); + static const int kLayerFieldNumber = 100; + inline const ::ditcaffe::LayerParameter& layer(int index) const; + inline ::ditcaffe::LayerParameter* mutable_layer(int index); + inline ::ditcaffe::LayerParameter* add_layer(); + inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::LayerParameter >& + layer() const; + inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::LayerParameter >* + mutable_layer(); + + // repeated .ditcaffe.V1LayerParameter layers = 2; + inline int layers_size() const; + inline void clear_layers(); + static const int kLayersFieldNumber = 2; + inline const ::ditcaffe::V1LayerParameter& layers(int index) const; + inline ::ditcaffe::V1LayerParameter* mutable_layers(int index); + inline ::ditcaffe::V1LayerParameter* add_layers(); + inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::V1LayerParameter >& + layers() const; + inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::V1LayerParameter >* + mutable_layers(); + + // @@protoc_insertion_point(class_scope:ditcaffe.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(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::std::string* name_; + ::google::protobuf::RepeatedPtrField< ::std::string> input_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobShape > input_shape_; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 > input_dim_; + ::ditcaffe::NetState* state_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::LayerParameter > layer_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::V1LayerParameter > layers_; + bool force_backward_; + bool debug_info_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static NetParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class SolverParameter : public ::google::protobuf::MessageLite { + public: + SolverParameter(); + virtual ~SolverParameter(); + + SolverParameter(const SolverParameter& from); + + inline SolverParameter& operator=(const SolverParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const SolverParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const SolverParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(SolverParameter* other); + + // implements Message ---------------------------------------------- + + SolverParameter* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const SolverParameter& from); + void MergeFrom(const SolverParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() 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; + + 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; + + 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; + + // accessors ------------------------------------------------------- + + // optional string net = 24; + inline bool has_net() const; + inline void clear_net(); + static const int kNetFieldNumber = 24; + inline const ::std::string& net() const; + inline void set_net(const ::std::string& value); + inline void set_net(const char* value); + inline void set_net(const char* value, size_t size); + inline ::std::string* mutable_net(); + inline ::std::string* release_net(); + inline void set_allocated_net(::std::string* net); + + // optional .ditcaffe.NetParameter net_param = 25; + inline bool has_net_param() const; + inline void clear_net_param(); + static const int kNetParamFieldNumber = 25; + inline const ::ditcaffe::NetParameter& net_param() const; + inline ::ditcaffe::NetParameter* mutable_net_param(); + inline ::ditcaffe::NetParameter* release_net_param(); + inline void set_allocated_net_param(::ditcaffe::NetParameter* net_param); + + // optional string train_net = 1; + inline bool has_train_net() const; + inline void clear_train_net(); + static const int kTrainNetFieldNumber = 1; + inline const ::std::string& train_net() const; + inline void set_train_net(const ::std::string& value); + inline void set_train_net(const char* value); + inline void set_train_net(const char* value, size_t size); + inline ::std::string* mutable_train_net(); + inline ::std::string* release_train_net(); + inline void set_allocated_train_net(::std::string* train_net); + + // repeated string test_net = 2; + inline int test_net_size() const; + inline void clear_test_net(); + static const int kTestNetFieldNumber = 2; + inline const ::std::string& test_net(int index) const; + inline ::std::string* mutable_test_net(int index); + inline void set_test_net(int index, const ::std::string& value); + inline void set_test_net(int index, const char* value); + inline void set_test_net(int index, const char* value, size_t size); + inline ::std::string* add_test_net(); + inline void add_test_net(const ::std::string& value); + inline void add_test_net(const char* value); + inline void add_test_net(const char* value, size_t size); + inline const ::google::protobuf::RepeatedPtrField< ::std::string>& test_net() const; + inline ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_test_net(); + + // optional .ditcaffe.NetParameter train_net_param = 21; + inline bool has_train_net_param() const; + inline void clear_train_net_param(); + static const int kTrainNetParamFieldNumber = 21; + inline const ::ditcaffe::NetParameter& train_net_param() const; + inline ::ditcaffe::NetParameter* mutable_train_net_param(); + inline ::ditcaffe::NetParameter* release_train_net_param(); + inline void set_allocated_train_net_param(::ditcaffe::NetParameter* train_net_param); + + // repeated .ditcaffe.NetParameter test_net_param = 22; + inline int test_net_param_size() const; + inline void clear_test_net_param(); + static const int kTestNetParamFieldNumber = 22; + inline const ::ditcaffe::NetParameter& test_net_param(int index) const; + inline ::ditcaffe::NetParameter* mutable_test_net_param(int index); + inline ::ditcaffe::NetParameter* add_test_net_param(); + inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetParameter >& + test_net_param() const; + inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetParameter >* + mutable_test_net_param(); + + // optional .ditcaffe.NetState train_state = 26; + inline bool has_train_state() const; + inline void clear_train_state(); + static const int kTrainStateFieldNumber = 26; + inline const ::ditcaffe::NetState& train_state() const; + inline ::ditcaffe::NetState* mutable_train_state(); + inline ::ditcaffe::NetState* release_train_state(); + inline void set_allocated_train_state(::ditcaffe::NetState* train_state); + + // repeated .ditcaffe.NetState test_state = 27; + inline int test_state_size() const; + inline void clear_test_state(); + static const int kTestStateFieldNumber = 27; + inline const ::ditcaffe::NetState& test_state(int index) const; + inline ::ditcaffe::NetState* mutable_test_state(int index); + inline ::ditcaffe::NetState* add_test_state(); + inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetState >& + test_state() const; + inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetState >* + mutable_test_state(); + + // repeated int32 test_iter = 3; + inline int test_iter_size() const; + inline void clear_test_iter(); + static const int kTestIterFieldNumber = 3; + inline ::google::protobuf::int32 test_iter(int index) const; + inline void set_test_iter(int index, ::google::protobuf::int32 value); + inline void add_test_iter(::google::protobuf::int32 value); + inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& + test_iter() const; + inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* + mutable_test_iter(); + + // optional int32 test_interval = 4 [default = 0]; + inline bool has_test_interval() const; + inline void clear_test_interval(); + static const int kTestIntervalFieldNumber = 4; + inline ::google::protobuf::int32 test_interval() const; + inline void set_test_interval(::google::protobuf::int32 value); + + // optional bool test_compute_loss = 19 [default = false]; + inline bool has_test_compute_loss() const; + inline void clear_test_compute_loss(); + static const int kTestComputeLossFieldNumber = 19; + inline bool test_compute_loss() const; + inline void set_test_compute_loss(bool value); + + // optional bool test_initialization = 32 [default = true]; + inline bool has_test_initialization() const; + inline void clear_test_initialization(); + static const int kTestInitializationFieldNumber = 32; + inline bool test_initialization() const; + inline void set_test_initialization(bool value); + + // optional float base_lr = 5; + inline bool has_base_lr() const; + inline void clear_base_lr(); + static const int kBaseLrFieldNumber = 5; + inline float base_lr() const; + inline void set_base_lr(float value); + + // optional int32 display = 6; + inline bool has_display() const; + inline void clear_display(); + static const int kDisplayFieldNumber = 6; + inline ::google::protobuf::int32 display() const; + inline void set_display(::google::protobuf::int32 value); + + // optional int32 average_loss = 33 [default = 1]; + inline bool has_average_loss() const; + inline void clear_average_loss(); + static const int kAverageLossFieldNumber = 33; + inline ::google::protobuf::int32 average_loss() const; + inline void set_average_loss(::google::protobuf::int32 value); + + // optional int32 max_iter = 7; + inline bool has_max_iter() const; + inline void clear_max_iter(); + static const int kMaxIterFieldNumber = 7; + inline ::google::protobuf::int32 max_iter() const; + inline void set_max_iter(::google::protobuf::int32 value); + + // optional int32 iter_size = 36 [default = 1]; + inline bool has_iter_size() const; + inline void clear_iter_size(); + static const int kIterSizeFieldNumber = 36; + inline ::google::protobuf::int32 iter_size() const; + inline void set_iter_size(::google::protobuf::int32 value); + + // optional string lr_policy = 8; + inline bool has_lr_policy() const; + inline void clear_lr_policy(); + static const int kLrPolicyFieldNumber = 8; + inline const ::std::string& lr_policy() const; + inline void set_lr_policy(const ::std::string& value); + inline void set_lr_policy(const char* value); + inline void set_lr_policy(const char* value, size_t size); + inline ::std::string* mutable_lr_policy(); + inline ::std::string* release_lr_policy(); + inline void set_allocated_lr_policy(::std::string* lr_policy); + + // optional float gamma = 9; + inline bool has_gamma() const; + inline void clear_gamma(); + static const int kGammaFieldNumber = 9; + inline float gamma() const; + inline void set_gamma(float value); + + // optional float power = 10; + inline bool has_power() const; + inline void clear_power(); + static const int kPowerFieldNumber = 10; + inline float power() const; + inline void set_power(float value); + + // optional float momentum = 11; + inline bool has_momentum() const; + inline void clear_momentum(); + static const int kMomentumFieldNumber = 11; + inline float momentum() const; + inline void set_momentum(float value); + + // optional float weight_decay = 12; + inline bool has_weight_decay() const; + inline void clear_weight_decay(); + static const int kWeightDecayFieldNumber = 12; + inline float weight_decay() const; + inline void set_weight_decay(float value); + + // optional string regularization_type = 29 [default = "L2"]; + inline bool has_regularization_type() const; + inline void clear_regularization_type(); + static const int kRegularizationTypeFieldNumber = 29; + inline const ::std::string& regularization_type() const; + inline void set_regularization_type(const ::std::string& value); + inline void set_regularization_type(const char* value); + inline void set_regularization_type(const char* value, size_t size); + inline ::std::string* mutable_regularization_type(); + inline ::std::string* release_regularization_type(); + inline void set_allocated_regularization_type(::std::string* regularization_type); + + // optional int32 stepsize = 13; + inline bool has_stepsize() const; + inline void clear_stepsize(); + static const int kStepsizeFieldNumber = 13; + inline ::google::protobuf::int32 stepsize() const; + inline void set_stepsize(::google::protobuf::int32 value); + + // repeated int32 stepvalue = 34; + inline int stepvalue_size() const; + inline void clear_stepvalue(); + static const int kStepvalueFieldNumber = 34; + inline ::google::protobuf::int32 stepvalue(int index) const; + inline void set_stepvalue(int index, ::google::protobuf::int32 value); + inline void add_stepvalue(::google::protobuf::int32 value); + inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& + stepvalue() const; + inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* + mutable_stepvalue(); + + // optional float clip_gradients = 35 [default = -1]; + inline bool has_clip_gradients() const; + inline void clear_clip_gradients(); + static const int kClipGradientsFieldNumber = 35; + inline float clip_gradients() const; + inline void set_clip_gradients(float value); + + // optional int32 snapshot = 14 [default = 0]; + inline bool has_snapshot() const; + inline void clear_snapshot(); + static const int kSnapshotFieldNumber = 14; + inline ::google::protobuf::int32 snapshot() const; + inline void set_snapshot(::google::protobuf::int32 value); + + // optional string snapshot_prefix = 15; + inline bool has_snapshot_prefix() const; + inline void clear_snapshot_prefix(); + static const int kSnapshotPrefixFieldNumber = 15; + inline const ::std::string& snapshot_prefix() const; + inline void set_snapshot_prefix(const ::std::string& value); + inline void set_snapshot_prefix(const char* value); + inline void set_snapshot_prefix(const char* value, size_t size); + inline ::std::string* mutable_snapshot_prefix(); + inline ::std::string* release_snapshot_prefix(); + inline void set_allocated_snapshot_prefix(::std::string* snapshot_prefix); + + // optional bool snapshot_diff = 16 [default = false]; + inline bool has_snapshot_diff() const; + inline void clear_snapshot_diff(); + static const int kSnapshotDiffFieldNumber = 16; + inline bool snapshot_diff() const; + inline void set_snapshot_diff(bool value); + + // optional .ditcaffe.SolverParameter.SnapshotFormat snapshot_format = 37 [default = BINARYPROTO]; + inline bool has_snapshot_format() const; + inline void clear_snapshot_format(); + static const int kSnapshotFormatFieldNumber = 37; + inline ::ditcaffe::SolverParameter_SnapshotFormat snapshot_format() const; + inline void set_snapshot_format(::ditcaffe::SolverParameter_SnapshotFormat value); + + // optional .ditcaffe.SolverParameter.SolverMode solver_mode = 17 [default = GPU]; + inline bool has_solver_mode() const; + inline void clear_solver_mode(); + static const int kSolverModeFieldNumber = 17; + inline ::ditcaffe::SolverParameter_SolverMode solver_mode() const; + inline void set_solver_mode(::ditcaffe::SolverParameter_SolverMode value); + + // optional int32 device_id = 18 [default = 0]; + inline bool has_device_id() const; + inline void clear_device_id(); + static const int kDeviceIdFieldNumber = 18; + inline ::google::protobuf::int32 device_id() const; + inline void set_device_id(::google::protobuf::int32 value); + + // optional int64 random_seed = 20 [default = -1]; + inline bool has_random_seed() const; + inline void clear_random_seed(); + static const int kRandomSeedFieldNumber = 20; + inline ::google::protobuf::int64 random_seed() const; + inline void set_random_seed(::google::protobuf::int64 value); + + // optional string type = 40 [default = "SGD"]; + inline bool has_type() const; + inline void clear_type(); + static const int kTypeFieldNumber = 40; + inline const ::std::string& type() const; + inline void set_type(const ::std::string& value); + inline void set_type(const char* value); + inline void set_type(const char* value, size_t size); + inline ::std::string* mutable_type(); + inline ::std::string* release_type(); + inline void set_allocated_type(::std::string* type); + + // optional float delta = 31 [default = 1e-08]; + inline bool has_delta() const; + inline void clear_delta(); + static const int kDeltaFieldNumber = 31; + inline float delta() const; + inline void set_delta(float value); + + // optional float momentum2 = 39 [default = 0.999]; + inline bool has_momentum2() const; + inline void clear_momentum2(); + static const int kMomentum2FieldNumber = 39; + inline float momentum2() const; + inline void set_momentum2(float value); + + // optional float rms_decay = 38; + inline bool has_rms_decay() const; + inline void clear_rms_decay(); + static const int kRmsDecayFieldNumber = 38; + inline float rms_decay() const; + inline void set_rms_decay(float value); + + // optional bool debug_info = 23 [default = false]; + inline bool has_debug_info() const; + inline void clear_debug_info(); + static const int kDebugInfoFieldNumber = 23; + inline bool debug_info() const; + inline void set_debug_info(bool value); + + // optional bool snapshot_after_train = 28 [default = true]; + inline bool has_snapshot_after_train() const; + inline void clear_snapshot_after_train(); + static const int kSnapshotAfterTrainFieldNumber = 28; + inline bool snapshot_after_train() const; + inline void set_snapshot_after_train(bool value); + + // optional .ditcaffe.SolverParameter.SolverType solver_type = 30 [default = SGD]; + inline bool has_solver_type() const; + inline void clear_solver_type(); + static const int kSolverTypeFieldNumber = 30; + inline ::ditcaffe::SolverParameter_SolverType solver_type() const; + inline void set_solver_type(::ditcaffe::SolverParameter_SolverType value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[2]; + ::std::string* net_; + ::ditcaffe::NetParameter* net_param_; + ::std::string* train_net_; + ::google::protobuf::RepeatedPtrField< ::std::string> test_net_; + ::ditcaffe::NetParameter* train_net_param_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetParameter > test_net_param_; + ::ditcaffe::NetState* train_state_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetState > test_state_; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 > test_iter_; + ::google::protobuf::int32 test_interval_; + float base_lr_; + ::google::protobuf::int32 display_; + ::google::protobuf::int32 average_loss_; + ::google::protobuf::int32 max_iter_; + ::google::protobuf::int32 iter_size_; + ::std::string* lr_policy_; + float gamma_; + float power_; + float momentum_; + float weight_decay_; + bool test_compute_loss_; + bool test_initialization_; + bool snapshot_diff_; + bool debug_info_; + ::google::protobuf::int32 stepsize_; + static ::std::string* _default_regularization_type_; + ::std::string* regularization_type_; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 > stepvalue_; + float clip_gradients_; + ::google::protobuf::int32 snapshot_; + ::std::string* snapshot_prefix_; + int snapshot_format_; + int solver_mode_; + ::google::protobuf::int64 random_seed_; + ::google::protobuf::int32 device_id_; + float delta_; + static ::std::string* _default_type_; + ::std::string* type_; + float momentum2_; + float rms_decay_; + bool snapshot_after_train_; + int solver_type_; + mutable int _cached_size_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static SolverParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class SolverState : public ::google::protobuf::MessageLite { + public: + SolverState(); + virtual ~SolverState(); + + SolverState(const SolverState& from); + + inline SolverState& operator=(const SolverState& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const SolverState& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const SolverState* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(SolverState* other); + + // implements Message ---------------------------------------------- + + SolverState* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const SolverState& from); + void MergeFrom(const SolverState& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional int32 iter = 1; + inline bool has_iter() const; + inline void clear_iter(); + static const int kIterFieldNumber = 1; + inline ::google::protobuf::int32 iter() const; + inline void set_iter(::google::protobuf::int32 value); + + // optional string learned_net = 2; + inline bool has_learned_net() const; + inline void clear_learned_net(); + static const int kLearnedNetFieldNumber = 2; + inline const ::std::string& learned_net() const; + inline void set_learned_net(const ::std::string& value); + inline void set_learned_net(const char* value); + inline void set_learned_net(const char* value, size_t size); + inline ::std::string* mutable_learned_net(); + inline ::std::string* release_learned_net(); + inline void set_allocated_learned_net(::std::string* learned_net); + + // repeated .ditcaffe.BlobProto history = 3; + inline int history_size() const; + inline void clear_history(); + static const int kHistoryFieldNumber = 3; + inline const ::ditcaffe::BlobProto& history(int index) const; + inline ::ditcaffe::BlobProto* mutable_history(int index); + inline ::ditcaffe::BlobProto* add_history(); + inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >& + history() const; + inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >* + mutable_history(); + + // optional int32 current_step = 4 [default = 0]; + inline bool has_current_step() const; + inline void clear_current_step(); + static const int kCurrentStepFieldNumber = 4; + inline ::google::protobuf::int32 current_step() const; + inline void set_current_step(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::std::string* learned_net_; + ::google::protobuf::int32 iter_; + ::google::protobuf::int32 current_step_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto > history_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static SolverState* default_instance_; +}; +// ------------------------------------------------------------------- + +class NetState : public ::google::protobuf::MessageLite { + public: + NetState(); + virtual ~NetState(); + + NetState(const NetState& from); + + inline NetState& operator=(const NetState& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const NetState& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const NetState* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(NetState* other); + + // implements Message ---------------------------------------------- + + NetState* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const NetState& from); + void MergeFrom(const NetState& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional .ditcaffe.Phase phase = 1 [default = TEST]; + inline bool has_phase() const; + inline void clear_phase(); + static const int kPhaseFieldNumber = 1; + inline ::ditcaffe::Phase phase() const; + inline void set_phase(::ditcaffe::Phase value); + + // optional int32 level = 2 [default = 0]; + inline bool has_level() const; + inline void clear_level(); + static const int kLevelFieldNumber = 2; + inline ::google::protobuf::int32 level() const; + inline void set_level(::google::protobuf::int32 value); + + // repeated string stage = 3; + inline int stage_size() const; + inline void clear_stage(); + static const int kStageFieldNumber = 3; + inline const ::std::string& stage(int index) const; + inline ::std::string* mutable_stage(int index); + inline void set_stage(int index, const ::std::string& value); + inline void set_stage(int index, const char* value); + inline void set_stage(int index, const char* value, size_t size); + inline ::std::string* add_stage(); + inline void add_stage(const ::std::string& value); + inline void add_stage(const char* value); + inline void add_stage(const char* value, size_t size); + inline const ::google::protobuf::RepeatedPtrField< ::std::string>& stage() const; + inline ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_stage(); + + // @@protoc_insertion_point(class_scope:ditcaffe.NetState) + private: + inline void set_has_phase(); + inline void clear_has_phase(); + inline void set_has_level(); + inline void clear_has_level(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + int phase_; + ::google::protobuf::int32 level_; + ::google::protobuf::RepeatedPtrField< ::std::string> stage_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static NetState* default_instance_; +}; +// ------------------------------------------------------------------- + +class NetStateRule : public ::google::protobuf::MessageLite { + public: + NetStateRule(); + virtual ~NetStateRule(); + + NetStateRule(const NetStateRule& from); + + inline NetStateRule& operator=(const NetStateRule& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const NetStateRule& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const NetStateRule* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(NetStateRule* other); + + // implements Message ---------------------------------------------- + + NetStateRule* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const NetStateRule& from); + void MergeFrom(const NetStateRule& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional .ditcaffe.Phase phase = 1; + inline bool has_phase() const; + inline void clear_phase(); + static const int kPhaseFieldNumber = 1; + inline ::ditcaffe::Phase phase() const; + inline void set_phase(::ditcaffe::Phase value); + + // optional int32 min_level = 2; + inline bool has_min_level() const; + inline void clear_min_level(); + static const int kMinLevelFieldNumber = 2; + inline ::google::protobuf::int32 min_level() const; + inline void set_min_level(::google::protobuf::int32 value); + + // optional int32 max_level = 3; + inline bool has_max_level() const; + inline void clear_max_level(); + static const int kMaxLevelFieldNumber = 3; + inline ::google::protobuf::int32 max_level() const; + inline void set_max_level(::google::protobuf::int32 value); + + // repeated string stage = 4; + inline int stage_size() const; + inline void clear_stage(); + static const int kStageFieldNumber = 4; + inline const ::std::string& stage(int index) const; + inline ::std::string* mutable_stage(int index); + inline void set_stage(int index, const ::std::string& value); + inline void set_stage(int index, const char* value); + inline void set_stage(int index, const char* value, size_t size); + inline ::std::string* add_stage(); + inline void add_stage(const ::std::string& value); + inline void add_stage(const char* value); + inline void add_stage(const char* value, size_t size); + inline const ::google::protobuf::RepeatedPtrField< ::std::string>& stage() const; + inline ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_stage(); + + // repeated string not_stage = 5; + inline int not_stage_size() const; + inline void clear_not_stage(); + static const int kNotStageFieldNumber = 5; + inline const ::std::string& not_stage(int index) const; + inline ::std::string* mutable_not_stage(int index); + inline void set_not_stage(int index, const ::std::string& value); + inline void set_not_stage(int index, const char* value); + inline void set_not_stage(int index, const char* value, size_t size); + inline ::std::string* add_not_stage(); + inline void add_not_stage(const ::std::string& value); + inline void add_not_stage(const char* value); + inline void add_not_stage(const char* value, size_t size); + inline const ::google::protobuf::RepeatedPtrField< ::std::string>& not_stage() const; + inline ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_not_stage(); + + // @@protoc_insertion_point(class_scope:ditcaffe.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(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + int phase_; + ::google::protobuf::int32 min_level_; + ::google::protobuf::RepeatedPtrField< ::std::string> stage_; + ::google::protobuf::RepeatedPtrField< ::std::string> not_stage_; + ::google::protobuf::int32 max_level_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static NetStateRule* default_instance_; +}; +// ------------------------------------------------------------------- + +class ParamSpec : public ::google::protobuf::MessageLite { + public: + ParamSpec(); + virtual ~ParamSpec(); + + ParamSpec(const ParamSpec& from); + + inline ParamSpec& operator=(const ParamSpec& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ParamSpec& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ParamSpec* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ParamSpec* other); + + // implements Message ---------------------------------------------- + + ParamSpec* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ParamSpec& from); + void MergeFrom(const ParamSpec& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() 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; + + // accessors ------------------------------------------------------- + + // optional string name = 1; + inline bool has_name() const; + inline void clear_name(); + static const int kNameFieldNumber = 1; + inline const ::std::string& name() const; + inline void set_name(const ::std::string& value); + inline void set_name(const char* value); + inline void set_name(const char* value, size_t size); + inline ::std::string* mutable_name(); + inline ::std::string* release_name(); + inline void set_allocated_name(::std::string* name); + + // optional .ditcaffe.ParamSpec.DimCheckMode share_mode = 2; + inline bool has_share_mode() const; + inline void clear_share_mode(); + static const int kShareModeFieldNumber = 2; + inline ::ditcaffe::ParamSpec_DimCheckMode share_mode() const; + inline void set_share_mode(::ditcaffe::ParamSpec_DimCheckMode value); + + // optional float lr_mult = 3 [default = 1]; + inline bool has_lr_mult() const; + inline void clear_lr_mult(); + static const int kLrMultFieldNumber = 3; + inline float lr_mult() const; + inline void set_lr_mult(float value); + + // optional float decay_mult = 4 [default = 1]; + inline bool has_decay_mult() const; + inline void clear_decay_mult(); + static const int kDecayMultFieldNumber = 4; + inline float decay_mult() const; + inline void set_decay_mult(float value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::std::string* name_; + int share_mode_; + float lr_mult_; + float decay_mult_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static ParamSpec* default_instance_; +}; +// ------------------------------------------------------------------- + +class LayerParameter : public ::google::protobuf::MessageLite { + public: + LayerParameter(); + virtual ~LayerParameter(); + + LayerParameter(const LayerParameter& from); + + inline LayerParameter& operator=(const LayerParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const LayerParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const LayerParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(LayerParameter* other); + + // implements Message ---------------------------------------------- + + LayerParameter* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const LayerParameter& from); + void MergeFrom(const LayerParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional string name = 1; + inline bool has_name() const; + inline void clear_name(); + static const int kNameFieldNumber = 1; + inline const ::std::string& name() const; + inline void set_name(const ::std::string& value); + inline void set_name(const char* value); + inline void set_name(const char* value, size_t size); + inline ::std::string* mutable_name(); + inline ::std::string* release_name(); + inline void set_allocated_name(::std::string* name); + + // optional string type = 2; + inline bool has_type() const; + inline void clear_type(); + static const int kTypeFieldNumber = 2; + inline const ::std::string& type() const; + inline void set_type(const ::std::string& value); + inline void set_type(const char* value); + inline void set_type(const char* value, size_t size); + inline ::std::string* mutable_type(); + inline ::std::string* release_type(); + inline void set_allocated_type(::std::string* type); + + // repeated string bottom = 3; + inline int bottom_size() const; + inline void clear_bottom(); + static const int kBottomFieldNumber = 3; + inline const ::std::string& bottom(int index) const; + inline ::std::string* mutable_bottom(int index); + inline void set_bottom(int index, const ::std::string& value); + inline void set_bottom(int index, const char* value); + inline void set_bottom(int index, const char* value, size_t size); + inline ::std::string* add_bottom(); + inline void add_bottom(const ::std::string& value); + inline void add_bottom(const char* value); + inline void add_bottom(const char* value, size_t size); + inline const ::google::protobuf::RepeatedPtrField< ::std::string>& bottom() const; + inline ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_bottom(); + + // repeated string top = 4; + inline int top_size() const; + inline void clear_top(); + static const int kTopFieldNumber = 4; + inline const ::std::string& top(int index) const; + inline ::std::string* mutable_top(int index); + inline void set_top(int index, const ::std::string& value); + inline void set_top(int index, const char* value); + inline void set_top(int index, const char* value, size_t size); + inline ::std::string* add_top(); + inline void add_top(const ::std::string& value); + inline void add_top(const char* value); + inline void add_top(const char* value, size_t size); + inline const ::google::protobuf::RepeatedPtrField< ::std::string>& top() const; + inline ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_top(); + + // optional .ditcaffe.Phase phase = 10; + inline bool has_phase() const; + inline void clear_phase(); + static const int kPhaseFieldNumber = 10; + inline ::ditcaffe::Phase phase() const; + inline void set_phase(::ditcaffe::Phase value); + + // repeated float loss_weight = 5; + inline int loss_weight_size() const; + inline void clear_loss_weight(); + static const int kLossWeightFieldNumber = 5; + inline float loss_weight(int index) const; + inline void set_loss_weight(int index, float value); + inline void add_loss_weight(float value); + inline const ::google::protobuf::RepeatedField< float >& + loss_weight() const; + inline ::google::protobuf::RepeatedField< float >* + mutable_loss_weight(); + + // repeated .ditcaffe.ParamSpec param = 6; + inline int param_size() const; + inline void clear_param(); + static const int kParamFieldNumber = 6; + inline const ::ditcaffe::ParamSpec& param(int index) const; + inline ::ditcaffe::ParamSpec* mutable_param(int index); + inline ::ditcaffe::ParamSpec* add_param(); + inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::ParamSpec >& + param() const; + inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::ParamSpec >* + mutable_param(); + + // repeated .ditcaffe.BlobProto blobs = 7; + inline int blobs_size() const; + inline void clear_blobs(); + static const int kBlobsFieldNumber = 7; + inline const ::ditcaffe::BlobProto& blobs(int index) const; + inline ::ditcaffe::BlobProto* mutable_blobs(int index); + inline ::ditcaffe::BlobProto* add_blobs(); + inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >& + blobs() const; + inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >* + mutable_blobs(); + + // repeated bool propagate_down = 11; + inline int propagate_down_size() const; + inline void clear_propagate_down(); + static const int kPropagateDownFieldNumber = 11; + inline bool propagate_down(int index) const; + inline void set_propagate_down(int index, bool value); + inline void add_propagate_down(bool value); + inline const ::google::protobuf::RepeatedField< bool >& + propagate_down() const; + inline ::google::protobuf::RepeatedField< bool >* + mutable_propagate_down(); + + // repeated .ditcaffe.NetStateRule include = 8; + inline int include_size() const; + inline void clear_include(); + static const int kIncludeFieldNumber = 8; + inline const ::ditcaffe::NetStateRule& include(int index) const; + inline ::ditcaffe::NetStateRule* mutable_include(int index); + inline ::ditcaffe::NetStateRule* add_include(); + inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >& + include() const; + inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >* + mutable_include(); + + // repeated .ditcaffe.NetStateRule exclude = 9; + inline int exclude_size() const; + inline void clear_exclude(); + static const int kExcludeFieldNumber = 9; + inline const ::ditcaffe::NetStateRule& exclude(int index) const; + inline ::ditcaffe::NetStateRule* mutable_exclude(int index); + inline ::ditcaffe::NetStateRule* add_exclude(); + inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >& + exclude() const; + inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >* + mutable_exclude(); + + // optional .ditcaffe.TransformationParameter transform_param = 100; + inline bool has_transform_param() const; + inline void clear_transform_param(); + static const int kTransformParamFieldNumber = 100; + inline const ::ditcaffe::TransformationParameter& transform_param() const; + inline ::ditcaffe::TransformationParameter* mutable_transform_param(); + inline ::ditcaffe::TransformationParameter* release_transform_param(); + inline void set_allocated_transform_param(::ditcaffe::TransformationParameter* transform_param); + + // optional .ditcaffe.LossParameter loss_param = 101; + inline bool has_loss_param() const; + inline void clear_loss_param(); + static const int kLossParamFieldNumber = 101; + inline const ::ditcaffe::LossParameter& loss_param() const; + inline ::ditcaffe::LossParameter* mutable_loss_param(); + inline ::ditcaffe::LossParameter* release_loss_param(); + inline void set_allocated_loss_param(::ditcaffe::LossParameter* loss_param); + + // optional .ditcaffe.AccuracyParameter accuracy_param = 102; + inline bool has_accuracy_param() const; + inline void clear_accuracy_param(); + static const int kAccuracyParamFieldNumber = 102; + inline const ::ditcaffe::AccuracyParameter& accuracy_param() const; + inline ::ditcaffe::AccuracyParameter* mutable_accuracy_param(); + inline ::ditcaffe::AccuracyParameter* release_accuracy_param(); + inline void set_allocated_accuracy_param(::ditcaffe::AccuracyParameter* accuracy_param); + + // optional .ditcaffe.ArgMaxParameter argmax_param = 103; + inline bool has_argmax_param() const; + inline void clear_argmax_param(); + static const int kArgmaxParamFieldNumber = 103; + inline const ::ditcaffe::ArgMaxParameter& argmax_param() const; + inline ::ditcaffe::ArgMaxParameter* mutable_argmax_param(); + inline ::ditcaffe::ArgMaxParameter* release_argmax_param(); + inline void set_allocated_argmax_param(::ditcaffe::ArgMaxParameter* argmax_param); + + // optional .ditcaffe.BatchNormParameter batch_norm_param = 139; + inline bool has_batch_norm_param() const; + inline void clear_batch_norm_param(); + static const int kBatchNormParamFieldNumber = 139; + inline const ::ditcaffe::BatchNormParameter& batch_norm_param() const; + inline ::ditcaffe::BatchNormParameter* mutable_batch_norm_param(); + inline ::ditcaffe::BatchNormParameter* release_batch_norm_param(); + inline void set_allocated_batch_norm_param(::ditcaffe::BatchNormParameter* batch_norm_param); + + // optional .ditcaffe.BiasParameter bias_param = 141; + inline bool has_bias_param() const; + inline void clear_bias_param(); + static const int kBiasParamFieldNumber = 141; + inline const ::ditcaffe::BiasParameter& bias_param() const; + inline ::ditcaffe::BiasParameter* mutable_bias_param(); + inline ::ditcaffe::BiasParameter* release_bias_param(); + inline void set_allocated_bias_param(::ditcaffe::BiasParameter* bias_param); + + // optional .ditcaffe.ConcatParameter concat_param = 104; + inline bool has_concat_param() const; + inline void clear_concat_param(); + static const int kConcatParamFieldNumber = 104; + inline const ::ditcaffe::ConcatParameter& concat_param() const; + inline ::ditcaffe::ConcatParameter* mutable_concat_param(); + inline ::ditcaffe::ConcatParameter* release_concat_param(); + inline void set_allocated_concat_param(::ditcaffe::ConcatParameter* concat_param); + + // optional .ditcaffe.ContrastiveLossParameter contrastive_loss_param = 105; + inline bool has_contrastive_loss_param() const; + inline void clear_contrastive_loss_param(); + static const int kContrastiveLossParamFieldNumber = 105; + inline const ::ditcaffe::ContrastiveLossParameter& contrastive_loss_param() const; + inline ::ditcaffe::ContrastiveLossParameter* mutable_contrastive_loss_param(); + inline ::ditcaffe::ContrastiveLossParameter* release_contrastive_loss_param(); + inline void set_allocated_contrastive_loss_param(::ditcaffe::ContrastiveLossParameter* contrastive_loss_param); + + // optional .ditcaffe.ConvolutionParameter convolution_param = 106; + inline bool has_convolution_param() const; + inline void clear_convolution_param(); + static const int kConvolutionParamFieldNumber = 106; + inline const ::ditcaffe::ConvolutionParameter& convolution_param() const; + inline ::ditcaffe::ConvolutionParameter* mutable_convolution_param(); + inline ::ditcaffe::ConvolutionParameter* release_convolution_param(); + inline void set_allocated_convolution_param(::ditcaffe::ConvolutionParameter* convolution_param); + + // optional .ditcaffe.CropParameter crop_param = 144; + inline bool has_crop_param() const; + inline void clear_crop_param(); + static const int kCropParamFieldNumber = 144; + inline const ::ditcaffe::CropParameter& crop_param() const; + inline ::ditcaffe::CropParameter* mutable_crop_param(); + inline ::ditcaffe::CropParameter* release_crop_param(); + inline void set_allocated_crop_param(::ditcaffe::CropParameter* crop_param); + + // optional .ditcaffe.DataParameter data_param = 107; + inline bool has_data_param() const; + inline void clear_data_param(); + static const int kDataParamFieldNumber = 107; + inline const ::ditcaffe::DataParameter& data_param() const; + inline ::ditcaffe::DataParameter* mutable_data_param(); + inline ::ditcaffe::DataParameter* release_data_param(); + inline void set_allocated_data_param(::ditcaffe::DataParameter* data_param); + + // optional .ditcaffe.DropoutParameter dropout_param = 108; + inline bool has_dropout_param() const; + inline void clear_dropout_param(); + static const int kDropoutParamFieldNumber = 108; + inline const ::ditcaffe::DropoutParameter& dropout_param() const; + inline ::ditcaffe::DropoutParameter* mutable_dropout_param(); + inline ::ditcaffe::DropoutParameter* release_dropout_param(); + inline void set_allocated_dropout_param(::ditcaffe::DropoutParameter* dropout_param); + + // optional .ditcaffe.DummyDataParameter dummy_data_param = 109; + inline bool has_dummy_data_param() const; + inline void clear_dummy_data_param(); + static const int kDummyDataParamFieldNumber = 109; + inline const ::ditcaffe::DummyDataParameter& dummy_data_param() const; + inline ::ditcaffe::DummyDataParameter* mutable_dummy_data_param(); + inline ::ditcaffe::DummyDataParameter* release_dummy_data_param(); + inline void set_allocated_dummy_data_param(::ditcaffe::DummyDataParameter* dummy_data_param); + + // optional .ditcaffe.EltwiseParameter eltwise_param = 110; + inline bool has_eltwise_param() const; + inline void clear_eltwise_param(); + static const int kEltwiseParamFieldNumber = 110; + inline const ::ditcaffe::EltwiseParameter& eltwise_param() const; + inline ::ditcaffe::EltwiseParameter* mutable_eltwise_param(); + inline ::ditcaffe::EltwiseParameter* release_eltwise_param(); + inline void set_allocated_eltwise_param(::ditcaffe::EltwiseParameter* eltwise_param); + + // optional .ditcaffe.ELUParameter elu_param = 140; + inline bool has_elu_param() const; + inline void clear_elu_param(); + static const int kEluParamFieldNumber = 140; + inline const ::ditcaffe::ELUParameter& elu_param() const; + inline ::ditcaffe::ELUParameter* mutable_elu_param(); + inline ::ditcaffe::ELUParameter* release_elu_param(); + inline void set_allocated_elu_param(::ditcaffe::ELUParameter* elu_param); + + // optional .ditcaffe.EmbedParameter embed_param = 137; + inline bool has_embed_param() const; + inline void clear_embed_param(); + static const int kEmbedParamFieldNumber = 137; + inline const ::ditcaffe::EmbedParameter& embed_param() const; + inline ::ditcaffe::EmbedParameter* mutable_embed_param(); + inline ::ditcaffe::EmbedParameter* release_embed_param(); + inline void set_allocated_embed_param(::ditcaffe::EmbedParameter* embed_param); + + // optional .ditcaffe.ExpParameter exp_param = 111; + inline bool has_exp_param() const; + inline void clear_exp_param(); + static const int kExpParamFieldNumber = 111; + inline const ::ditcaffe::ExpParameter& exp_param() const; + inline ::ditcaffe::ExpParameter* mutable_exp_param(); + inline ::ditcaffe::ExpParameter* release_exp_param(); + inline void set_allocated_exp_param(::ditcaffe::ExpParameter* exp_param); + + // optional .ditcaffe.FlattenParameter flatten_param = 135; + inline bool has_flatten_param() const; + inline void clear_flatten_param(); + static const int kFlattenParamFieldNumber = 135; + inline const ::ditcaffe::FlattenParameter& flatten_param() const; + inline ::ditcaffe::FlattenParameter* mutable_flatten_param(); + inline ::ditcaffe::FlattenParameter* release_flatten_param(); + inline void set_allocated_flatten_param(::ditcaffe::FlattenParameter* flatten_param); + + // optional .ditcaffe.HDF5DataParameter hdf5_data_param = 112; + inline bool has_hdf5_data_param() const; + inline void clear_hdf5_data_param(); + static const int kHdf5DataParamFieldNumber = 112; + inline const ::ditcaffe::HDF5DataParameter& hdf5_data_param() const; + inline ::ditcaffe::HDF5DataParameter* mutable_hdf5_data_param(); + inline ::ditcaffe::HDF5DataParameter* release_hdf5_data_param(); + inline void set_allocated_hdf5_data_param(::ditcaffe::HDF5DataParameter* hdf5_data_param); + + // optional .ditcaffe.HDF5OutputParameter hdf5_output_param = 113; + inline bool has_hdf5_output_param() const; + inline void clear_hdf5_output_param(); + static const int kHdf5OutputParamFieldNumber = 113; + inline const ::ditcaffe::HDF5OutputParameter& hdf5_output_param() const; + inline ::ditcaffe::HDF5OutputParameter* mutable_hdf5_output_param(); + inline ::ditcaffe::HDF5OutputParameter* release_hdf5_output_param(); + inline void set_allocated_hdf5_output_param(::ditcaffe::HDF5OutputParameter* hdf5_output_param); + + // optional .ditcaffe.HingeLossParameter hinge_loss_param = 114; + inline bool has_hinge_loss_param() const; + inline void clear_hinge_loss_param(); + static const int kHingeLossParamFieldNumber = 114; + inline const ::ditcaffe::HingeLossParameter& hinge_loss_param() const; + inline ::ditcaffe::HingeLossParameter* mutable_hinge_loss_param(); + inline ::ditcaffe::HingeLossParameter* release_hinge_loss_param(); + inline void set_allocated_hinge_loss_param(::ditcaffe::HingeLossParameter* hinge_loss_param); + + // optional .ditcaffe.ImageDataParameter image_data_param = 115; + inline bool has_image_data_param() const; + inline void clear_image_data_param(); + static const int kImageDataParamFieldNumber = 115; + inline const ::ditcaffe::ImageDataParameter& image_data_param() const; + inline ::ditcaffe::ImageDataParameter* mutable_image_data_param(); + inline ::ditcaffe::ImageDataParameter* release_image_data_param(); + inline void set_allocated_image_data_param(::ditcaffe::ImageDataParameter* image_data_param); + + // optional .ditcaffe.InfogainLossParameter infogain_loss_param = 116; + inline bool has_infogain_loss_param() const; + inline void clear_infogain_loss_param(); + static const int kInfogainLossParamFieldNumber = 116; + inline const ::ditcaffe::InfogainLossParameter& infogain_loss_param() const; + inline ::ditcaffe::InfogainLossParameter* mutable_infogain_loss_param(); + inline ::ditcaffe::InfogainLossParameter* release_infogain_loss_param(); + inline void set_allocated_infogain_loss_param(::ditcaffe::InfogainLossParameter* infogain_loss_param); + + // optional .ditcaffe.InnerProductParameter inner_product_param = 117; + inline bool has_inner_product_param() const; + inline void clear_inner_product_param(); + static const int kInnerProductParamFieldNumber = 117; + inline const ::ditcaffe::InnerProductParameter& inner_product_param() const; + inline ::ditcaffe::InnerProductParameter* mutable_inner_product_param(); + inline ::ditcaffe::InnerProductParameter* release_inner_product_param(); + inline void set_allocated_inner_product_param(::ditcaffe::InnerProductParameter* inner_product_param); + + // optional .ditcaffe.InputParameter input_param = 143; + inline bool has_input_param() const; + inline void clear_input_param(); + static const int kInputParamFieldNumber = 143; + inline const ::ditcaffe::InputParameter& input_param() const; + inline ::ditcaffe::InputParameter* mutable_input_param(); + inline ::ditcaffe::InputParameter* release_input_param(); + inline void set_allocated_input_param(::ditcaffe::InputParameter* input_param); + + // optional .ditcaffe.LogParameter log_param = 134; + inline bool has_log_param() const; + inline void clear_log_param(); + static const int kLogParamFieldNumber = 134; + inline const ::ditcaffe::LogParameter& log_param() const; + inline ::ditcaffe::LogParameter* mutable_log_param(); + inline ::ditcaffe::LogParameter* release_log_param(); + inline void set_allocated_log_param(::ditcaffe::LogParameter* log_param); + + // optional .ditcaffe.LRNParameter lrn_param = 118; + inline bool has_lrn_param() const; + inline void clear_lrn_param(); + static const int kLrnParamFieldNumber = 118; + inline const ::ditcaffe::LRNParameter& lrn_param() const; + inline ::ditcaffe::LRNParameter* mutable_lrn_param(); + inline ::ditcaffe::LRNParameter* release_lrn_param(); + inline void set_allocated_lrn_param(::ditcaffe::LRNParameter* lrn_param); + + // optional .ditcaffe.MemoryDataParameter memory_data_param = 119; + inline bool has_memory_data_param() const; + inline void clear_memory_data_param(); + static const int kMemoryDataParamFieldNumber = 119; + inline const ::ditcaffe::MemoryDataParameter& memory_data_param() const; + inline ::ditcaffe::MemoryDataParameter* mutable_memory_data_param(); + inline ::ditcaffe::MemoryDataParameter* release_memory_data_param(); + inline void set_allocated_memory_data_param(::ditcaffe::MemoryDataParameter* memory_data_param); + + // optional .ditcaffe.MVNParameter mvn_param = 120; + inline bool has_mvn_param() const; + inline void clear_mvn_param(); + static const int kMvnParamFieldNumber = 120; + inline const ::ditcaffe::MVNParameter& mvn_param() const; + inline ::ditcaffe::MVNParameter* mutable_mvn_param(); + inline ::ditcaffe::MVNParameter* release_mvn_param(); + inline void set_allocated_mvn_param(::ditcaffe::MVNParameter* mvn_param); + + // optional .ditcaffe.ParameterParameter parameter_param = 145; + inline bool has_parameter_param() const; + inline void clear_parameter_param(); + static const int kParameterParamFieldNumber = 145; + inline const ::ditcaffe::ParameterParameter& parameter_param() const; + inline ::ditcaffe::ParameterParameter* mutable_parameter_param(); + inline ::ditcaffe::ParameterParameter* release_parameter_param(); + inline void set_allocated_parameter_param(::ditcaffe::ParameterParameter* parameter_param); + + // optional .ditcaffe.PoolingParameter pooling_param = 121; + inline bool has_pooling_param() const; + inline void clear_pooling_param(); + static const int kPoolingParamFieldNumber = 121; + inline const ::ditcaffe::PoolingParameter& pooling_param() const; + inline ::ditcaffe::PoolingParameter* mutable_pooling_param(); + inline ::ditcaffe::PoolingParameter* release_pooling_param(); + inline void set_allocated_pooling_param(::ditcaffe::PoolingParameter* pooling_param); + + // optional .ditcaffe.PowerParameter power_param = 122; + inline bool has_power_param() const; + inline void clear_power_param(); + static const int kPowerParamFieldNumber = 122; + inline const ::ditcaffe::PowerParameter& power_param() const; + inline ::ditcaffe::PowerParameter* mutable_power_param(); + inline ::ditcaffe::PowerParameter* release_power_param(); + inline void set_allocated_power_param(::ditcaffe::PowerParameter* power_param); + + // optional .ditcaffe.PReLUParameter prelu_param = 131; + inline bool has_prelu_param() const; + inline void clear_prelu_param(); + static const int kPreluParamFieldNumber = 131; + inline const ::ditcaffe::PReLUParameter& prelu_param() const; + inline ::ditcaffe::PReLUParameter* mutable_prelu_param(); + inline ::ditcaffe::PReLUParameter* release_prelu_param(); + inline void set_allocated_prelu_param(::ditcaffe::PReLUParameter* prelu_param); + + // optional .ditcaffe.PythonParameter python_param = 130; + inline bool has_python_param() const; + inline void clear_python_param(); + static const int kPythonParamFieldNumber = 130; + inline const ::ditcaffe::PythonParameter& python_param() const; + inline ::ditcaffe::PythonParameter* mutable_python_param(); + inline ::ditcaffe::PythonParameter* release_python_param(); + inline void set_allocated_python_param(::ditcaffe::PythonParameter* python_param); + + // optional .ditcaffe.ReductionParameter reduction_param = 136; + inline bool has_reduction_param() const; + inline void clear_reduction_param(); + static const int kReductionParamFieldNumber = 136; + inline const ::ditcaffe::ReductionParameter& reduction_param() const; + inline ::ditcaffe::ReductionParameter* mutable_reduction_param(); + inline ::ditcaffe::ReductionParameter* release_reduction_param(); + inline void set_allocated_reduction_param(::ditcaffe::ReductionParameter* reduction_param); + + // optional .ditcaffe.ReLUParameter relu_param = 123; + inline bool has_relu_param() const; + inline void clear_relu_param(); + static const int kReluParamFieldNumber = 123; + inline const ::ditcaffe::ReLUParameter& relu_param() const; + inline ::ditcaffe::ReLUParameter* mutable_relu_param(); + inline ::ditcaffe::ReLUParameter* release_relu_param(); + inline void set_allocated_relu_param(::ditcaffe::ReLUParameter* relu_param); + + // optional .ditcaffe.ReshapeParameter reshape_param = 133; + inline bool has_reshape_param() const; + inline void clear_reshape_param(); + static const int kReshapeParamFieldNumber = 133; + inline const ::ditcaffe::ReshapeParameter& reshape_param() const; + inline ::ditcaffe::ReshapeParameter* mutable_reshape_param(); + inline ::ditcaffe::ReshapeParameter* release_reshape_param(); + inline void set_allocated_reshape_param(::ditcaffe::ReshapeParameter* reshape_param); + + // optional .ditcaffe.ScaleParameter scale_param = 142; + inline bool has_scale_param() const; + inline void clear_scale_param(); + static const int kScaleParamFieldNumber = 142; + inline const ::ditcaffe::ScaleParameter& scale_param() const; + inline ::ditcaffe::ScaleParameter* mutable_scale_param(); + inline ::ditcaffe::ScaleParameter* release_scale_param(); + inline void set_allocated_scale_param(::ditcaffe::ScaleParameter* scale_param); + + // optional .ditcaffe.SigmoidParameter sigmoid_param = 124; + inline bool has_sigmoid_param() const; + inline void clear_sigmoid_param(); + static const int kSigmoidParamFieldNumber = 124; + inline const ::ditcaffe::SigmoidParameter& sigmoid_param() const; + inline ::ditcaffe::SigmoidParameter* mutable_sigmoid_param(); + inline ::ditcaffe::SigmoidParameter* release_sigmoid_param(); + inline void set_allocated_sigmoid_param(::ditcaffe::SigmoidParameter* sigmoid_param); + + // optional .ditcaffe.SoftmaxParameter softmax_param = 125; + inline bool has_softmax_param() const; + inline void clear_softmax_param(); + static const int kSoftmaxParamFieldNumber = 125; + inline const ::ditcaffe::SoftmaxParameter& softmax_param() const; + inline ::ditcaffe::SoftmaxParameter* mutable_softmax_param(); + inline ::ditcaffe::SoftmaxParameter* release_softmax_param(); + inline void set_allocated_softmax_param(::ditcaffe::SoftmaxParameter* softmax_param); + + // optional .ditcaffe.SPPParameter spp_param = 132; + inline bool has_spp_param() const; + inline void clear_spp_param(); + static const int kSppParamFieldNumber = 132; + inline const ::ditcaffe::SPPParameter& spp_param() const; + inline ::ditcaffe::SPPParameter* mutable_spp_param(); + inline ::ditcaffe::SPPParameter* release_spp_param(); + inline void set_allocated_spp_param(::ditcaffe::SPPParameter* spp_param); + + // optional .ditcaffe.SliceParameter slice_param = 126; + inline bool has_slice_param() const; + inline void clear_slice_param(); + static const int kSliceParamFieldNumber = 126; + inline const ::ditcaffe::SliceParameter& slice_param() const; + inline ::ditcaffe::SliceParameter* mutable_slice_param(); + inline ::ditcaffe::SliceParameter* release_slice_param(); + inline void set_allocated_slice_param(::ditcaffe::SliceParameter* slice_param); + + // optional .ditcaffe.TanHParameter tanh_param = 127; + inline bool has_tanh_param() const; + inline void clear_tanh_param(); + static const int kTanhParamFieldNumber = 127; + inline const ::ditcaffe::TanHParameter& tanh_param() const; + inline ::ditcaffe::TanHParameter* mutable_tanh_param(); + inline ::ditcaffe::TanHParameter* release_tanh_param(); + inline void set_allocated_tanh_param(::ditcaffe::TanHParameter* tanh_param); + + // optional .ditcaffe.ThresholdParameter threshold_param = 128; + inline bool has_threshold_param() const; + inline void clear_threshold_param(); + static const int kThresholdParamFieldNumber = 128; + inline const ::ditcaffe::ThresholdParameter& threshold_param() const; + inline ::ditcaffe::ThresholdParameter* mutable_threshold_param(); + inline ::ditcaffe::ThresholdParameter* release_threshold_param(); + inline void set_allocated_threshold_param(::ditcaffe::ThresholdParameter* threshold_param); + + // optional .ditcaffe.TileParameter tile_param = 138; + inline bool has_tile_param() const; + inline void clear_tile_param(); + static const int kTileParamFieldNumber = 138; + inline const ::ditcaffe::TileParameter& tile_param() const; + inline ::ditcaffe::TileParameter* mutable_tile_param(); + inline ::ditcaffe::TileParameter* release_tile_param(); + inline void set_allocated_tile_param(::ditcaffe::TileParameter* tile_param); + + // optional .ditcaffe.WindowDataParameter window_data_param = 129; + inline bool has_window_data_param() const; + inline void clear_window_data_param(); + static const int kWindowDataParamFieldNumber = 129; + inline const ::ditcaffe::WindowDataParameter& window_data_param() const; + inline ::ditcaffe::WindowDataParameter* mutable_window_data_param(); + inline ::ditcaffe::WindowDataParameter* release_window_data_param(); + inline void set_allocated_window_data_param(::ditcaffe::WindowDataParameter* window_data_param); + + // @@protoc_insertion_point(class_scope:ditcaffe.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_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_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_python_param(); + inline void clear_has_python_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(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[2]; + ::std::string* name_; + ::std::string* type_; + ::google::protobuf::RepeatedPtrField< ::std::string> bottom_; + ::google::protobuf::RepeatedPtrField< ::std::string> top_; + ::google::protobuf::RepeatedField< float > loss_weight_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::ParamSpec > param_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto > blobs_; + ::google::protobuf::RepeatedField< bool > propagate_down_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule > include_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule > exclude_; + ::ditcaffe::TransformationParameter* transform_param_; + ::ditcaffe::LossParameter* loss_param_; + ::ditcaffe::AccuracyParameter* accuracy_param_; + ::ditcaffe::ArgMaxParameter* argmax_param_; + ::ditcaffe::BatchNormParameter* batch_norm_param_; + ::ditcaffe::BiasParameter* bias_param_; + ::ditcaffe::ConcatParameter* concat_param_; + ::ditcaffe::ContrastiveLossParameter* contrastive_loss_param_; + ::ditcaffe::ConvolutionParameter* convolution_param_; + ::ditcaffe::CropParameter* crop_param_; + ::ditcaffe::DataParameter* data_param_; + ::ditcaffe::DropoutParameter* dropout_param_; + ::ditcaffe::DummyDataParameter* dummy_data_param_; + ::ditcaffe::EltwiseParameter* eltwise_param_; + ::ditcaffe::ELUParameter* elu_param_; + ::ditcaffe::EmbedParameter* embed_param_; + ::ditcaffe::ExpParameter* exp_param_; + ::ditcaffe::FlattenParameter* flatten_param_; + ::ditcaffe::HDF5DataParameter* hdf5_data_param_; + ::ditcaffe::HDF5OutputParameter* hdf5_output_param_; + ::ditcaffe::HingeLossParameter* hinge_loss_param_; + ::ditcaffe::ImageDataParameter* image_data_param_; + ::ditcaffe::InfogainLossParameter* infogain_loss_param_; + ::ditcaffe::InnerProductParameter* inner_product_param_; + ::ditcaffe::InputParameter* input_param_; + ::ditcaffe::LogParameter* log_param_; + ::ditcaffe::LRNParameter* lrn_param_; + ::ditcaffe::MemoryDataParameter* memory_data_param_; + ::ditcaffe::MVNParameter* mvn_param_; + ::ditcaffe::ParameterParameter* parameter_param_; + ::ditcaffe::PoolingParameter* pooling_param_; + ::ditcaffe::PowerParameter* power_param_; + ::ditcaffe::PReLUParameter* prelu_param_; + ::ditcaffe::PythonParameter* python_param_; + ::ditcaffe::ReductionParameter* reduction_param_; + ::ditcaffe::ReLUParameter* relu_param_; + ::ditcaffe::ReshapeParameter* reshape_param_; + ::ditcaffe::ScaleParameter* scale_param_; + ::ditcaffe::SigmoidParameter* sigmoid_param_; + ::ditcaffe::SoftmaxParameter* softmax_param_; + ::ditcaffe::SPPParameter* spp_param_; + ::ditcaffe::SliceParameter* slice_param_; + ::ditcaffe::TanHParameter* tanh_param_; + ::ditcaffe::ThresholdParameter* threshold_param_; + ::ditcaffe::TileParameter* tile_param_; + ::ditcaffe::WindowDataParameter* window_data_param_; + int phase_; + mutable int _cached_size_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static LayerParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class TransformationParameter : public ::google::protobuf::MessageLite { + public: + TransformationParameter(); + virtual ~TransformationParameter(); + + TransformationParameter(const TransformationParameter& from); + + inline TransformationParameter& operator=(const TransformationParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const TransformationParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const TransformationParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(TransformationParameter* other); + + // implements Message ---------------------------------------------- + + TransformationParameter* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const TransformationParameter& from); + void MergeFrom(const TransformationParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional float scale = 1 [default = 1]; + inline bool has_scale() const; + inline void clear_scale(); + static const int kScaleFieldNumber = 1; + inline float scale() const; + inline void set_scale(float value); + + // optional bool mirror = 2 [default = false]; + inline bool has_mirror() const; + inline void clear_mirror(); + static const int kMirrorFieldNumber = 2; + inline bool mirror() const; + inline void set_mirror(bool value); + + // optional uint32 crop_size = 3 [default = 0]; + inline bool has_crop_size() const; + inline void clear_crop_size(); + static const int kCropSizeFieldNumber = 3; + inline ::google::protobuf::uint32 crop_size() const; + inline void set_crop_size(::google::protobuf::uint32 value); + + // optional string mean_file = 4; + inline bool has_mean_file() const; + inline void clear_mean_file(); + static const int kMeanFileFieldNumber = 4; + inline const ::std::string& mean_file() const; + inline void set_mean_file(const ::std::string& value); + inline void set_mean_file(const char* value); + inline void set_mean_file(const char* value, size_t size); + inline ::std::string* mutable_mean_file(); + inline ::std::string* release_mean_file(); + inline void set_allocated_mean_file(::std::string* mean_file); + + // repeated float mean_value = 5; + inline int mean_value_size() const; + inline void clear_mean_value(); + static const int kMeanValueFieldNumber = 5; + inline float mean_value(int index) const; + inline void set_mean_value(int index, float value); + inline void add_mean_value(float value); + inline const ::google::protobuf::RepeatedField< float >& + mean_value() const; + inline ::google::protobuf::RepeatedField< float >* + mutable_mean_value(); + + // optional bool force_color = 6 [default = false]; + inline bool has_force_color() const; + inline void clear_force_color(); + static const int kForceColorFieldNumber = 6; + inline bool force_color() const; + inline void set_force_color(bool value); + + // optional bool force_gray = 7 [default = false]; + inline bool has_force_gray() const; + inline void clear_force_gray(); + static const int kForceGrayFieldNumber = 7; + inline bool force_gray() const; + inline void set_force_gray(bool value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + float scale_; + ::google::protobuf::uint32 crop_size_; + ::std::string* mean_file_; + ::google::protobuf::RepeatedField< float > mean_value_; + bool mirror_; + bool force_color_; + bool force_gray_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static TransformationParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class LossParameter : public ::google::protobuf::MessageLite { + public: + LossParameter(); + virtual ~LossParameter(); + + LossParameter(const LossParameter& from); + + inline LossParameter& operator=(const LossParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const LossParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const LossParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(LossParameter* other); + + // implements Message ---------------------------------------------- + + LossParameter* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const LossParameter& from); + void MergeFrom(const LossParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() 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; + + // accessors ------------------------------------------------------- + + // optional int32 ignore_label = 1; + inline bool has_ignore_label() const; + inline void clear_ignore_label(); + static const int kIgnoreLabelFieldNumber = 1; + inline ::google::protobuf::int32 ignore_label() const; + inline void set_ignore_label(::google::protobuf::int32 value); + + // optional .ditcaffe.LossParameter.NormalizationMode normalization = 3 [default = VALID]; + inline bool has_normalization() const; + inline void clear_normalization(); + static const int kNormalizationFieldNumber = 3; + inline ::ditcaffe::LossParameter_NormalizationMode normalization() const; + inline void set_normalization(::ditcaffe::LossParameter_NormalizationMode value); + + // optional bool normalize = 2; + inline bool has_normalize() const; + inline void clear_normalize(); + static const int kNormalizeFieldNumber = 2; + inline bool normalize() const; + inline void set_normalize(bool value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::int32 ignore_label_; + int normalization_; + bool normalize_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static LossParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class AccuracyParameter : public ::google::protobuf::MessageLite { + public: + AccuracyParameter(); + virtual ~AccuracyParameter(); + + AccuracyParameter(const AccuracyParameter& from); + + inline AccuracyParameter& operator=(const AccuracyParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const AccuracyParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const AccuracyParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(AccuracyParameter* other); + + // implements Message ---------------------------------------------- + + AccuracyParameter* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const AccuracyParameter& from); + void MergeFrom(const AccuracyParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional uint32 top_k = 1 [default = 1]; + inline bool has_top_k() const; + inline void clear_top_k(); + static const int kTopKFieldNumber = 1; + inline ::google::protobuf::uint32 top_k() const; + inline void set_top_k(::google::protobuf::uint32 value); + + // optional int32 axis = 2 [default = 1]; + inline bool has_axis() const; + inline void clear_axis(); + static const int kAxisFieldNumber = 2; + inline ::google::protobuf::int32 axis() const; + inline void set_axis(::google::protobuf::int32 value); + + // optional int32 ignore_label = 3; + inline bool has_ignore_label() const; + inline void clear_ignore_label(); + static const int kIgnoreLabelFieldNumber = 3; + inline ::google::protobuf::int32 ignore_label() const; + inline void set_ignore_label(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::uint32 top_k_; + ::google::protobuf::int32 axis_; + ::google::protobuf::int32 ignore_label_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static AccuracyParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class ArgMaxParameter : public ::google::protobuf::MessageLite { + public: + ArgMaxParameter(); + virtual ~ArgMaxParameter(); + + ArgMaxParameter(const ArgMaxParameter& from); + + inline ArgMaxParameter& operator=(const ArgMaxParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ArgMaxParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ArgMaxParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ArgMaxParameter* other); + + // implements Message ---------------------------------------------- + + ArgMaxParameter* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ArgMaxParameter& from); + void MergeFrom(const ArgMaxParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional bool out_max_val = 1 [default = false]; + inline bool has_out_max_val() const; + inline void clear_out_max_val(); + static const int kOutMaxValFieldNumber = 1; + inline bool out_max_val() const; + inline void set_out_max_val(bool value); + + // optional uint32 top_k = 2 [default = 1]; + inline bool has_top_k() const; + inline void clear_top_k(); + static const int kTopKFieldNumber = 2; + inline ::google::protobuf::uint32 top_k() const; + inline void set_top_k(::google::protobuf::uint32 value); + + // optional int32 axis = 3; + inline bool has_axis() const; + inline void clear_axis(); + static const int kAxisFieldNumber = 3; + inline ::google::protobuf::int32 axis() const; + inline void set_axis(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + bool out_max_val_; + ::google::protobuf::uint32 top_k_; + ::google::protobuf::int32 axis_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static ArgMaxParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class ConcatParameter : public ::google::protobuf::MessageLite { + public: + ConcatParameter(); + virtual ~ConcatParameter(); + + ConcatParameter(const ConcatParameter& from); + + inline ConcatParameter& operator=(const ConcatParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ConcatParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ConcatParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ConcatParameter* other); + + // implements Message ---------------------------------------------- + + ConcatParameter* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ConcatParameter& from); + void MergeFrom(const ConcatParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional int32 axis = 2 [default = 1]; + inline bool has_axis() const; + inline void clear_axis(); + static const int kAxisFieldNumber = 2; + inline ::google::protobuf::int32 axis() const; + inline void set_axis(::google::protobuf::int32 value); + + // optional uint32 concat_dim = 1 [default = 1]; + inline bool has_concat_dim() const; + inline void clear_concat_dim(); + static const int kConcatDimFieldNumber = 1; + inline ::google::protobuf::uint32 concat_dim() const; + inline void set_concat_dim(::google::protobuf::uint32 value); + + // @@protoc_insertion_point(class_scope:ditcaffe.ConcatParameter) + private: + inline void set_has_axis(); + inline void clear_has_axis(); + inline void set_has_concat_dim(); + inline void clear_has_concat_dim(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::int32 axis_; + ::google::protobuf::uint32 concat_dim_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static ConcatParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class BatchNormParameter : public ::google::protobuf::MessageLite { + public: + BatchNormParameter(); + virtual ~BatchNormParameter(); + + BatchNormParameter(const BatchNormParameter& from); + + inline BatchNormParameter& operator=(const BatchNormParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const BatchNormParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const BatchNormParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(BatchNormParameter* other); + + // implements Message ---------------------------------------------- + + BatchNormParameter* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const BatchNormParameter& from); + void MergeFrom(const BatchNormParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional bool use_global_stats = 1; + inline bool has_use_global_stats() const; + inline void clear_use_global_stats(); + static const int kUseGlobalStatsFieldNumber = 1; + inline bool use_global_stats() const; + inline void set_use_global_stats(bool value); + + // optional float moving_average_fraction = 2 [default = 0.999]; + inline bool has_moving_average_fraction() const; + inline void clear_moving_average_fraction(); + static const int kMovingAverageFractionFieldNumber = 2; + inline float moving_average_fraction() const; + inline void set_moving_average_fraction(float value); + + // optional float eps = 3 [default = 1e-05]; + inline bool has_eps() const; + inline void clear_eps(); + static const int kEpsFieldNumber = 3; + inline float eps() const; + inline void set_eps(float value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + bool use_global_stats_; + float moving_average_fraction_; + float eps_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static BatchNormParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class BiasParameter : public ::google::protobuf::MessageLite { + public: + BiasParameter(); + virtual ~BiasParameter(); + + BiasParameter(const BiasParameter& from); + + inline BiasParameter& operator=(const BiasParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const BiasParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const BiasParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(BiasParameter* other); + + // implements Message ---------------------------------------------- + + BiasParameter* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const BiasParameter& from); + void MergeFrom(const BiasParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional int32 axis = 1 [default = 1]; + inline bool has_axis() const; + inline void clear_axis(); + static const int kAxisFieldNumber = 1; + inline ::google::protobuf::int32 axis() const; + inline void set_axis(::google::protobuf::int32 value); + + // optional int32 num_axes = 2 [default = 1]; + inline bool has_num_axes() const; + inline void clear_num_axes(); + static const int kNumAxesFieldNumber = 2; + inline ::google::protobuf::int32 num_axes() const; + inline void set_num_axes(::google::protobuf::int32 value); + + // optional .ditcaffe.FillerParameter filler = 3; + inline bool has_filler() const; + inline void clear_filler(); + static const int kFillerFieldNumber = 3; + inline const ::ditcaffe::FillerParameter& filler() const; + inline ::ditcaffe::FillerParameter* mutable_filler(); + inline ::ditcaffe::FillerParameter* release_filler(); + inline void set_allocated_filler(::ditcaffe::FillerParameter* filler); + + // @@protoc_insertion_point(class_scope:ditcaffe.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(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::int32 axis_; + ::google::protobuf::int32 num_axes_; + ::ditcaffe::FillerParameter* filler_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static BiasParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class ContrastiveLossParameter : public ::google::protobuf::MessageLite { + public: + ContrastiveLossParameter(); + virtual ~ContrastiveLossParameter(); + + ContrastiveLossParameter(const ContrastiveLossParameter& from); + + inline ContrastiveLossParameter& operator=(const ContrastiveLossParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ContrastiveLossParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ContrastiveLossParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ContrastiveLossParameter* other); + + // implements Message ---------------------------------------------- + + ContrastiveLossParameter* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ContrastiveLossParameter& from); + void MergeFrom(const ContrastiveLossParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional float margin = 1 [default = 1]; + inline bool has_margin() const; + inline void clear_margin(); + static const int kMarginFieldNumber = 1; + inline float margin() const; + inline void set_margin(float value); + + // optional bool legacy_version = 2 [default = false]; + inline bool has_legacy_version() const; + inline void clear_legacy_version(); + static const int kLegacyVersionFieldNumber = 2; + inline bool legacy_version() const; + inline void set_legacy_version(bool value); + + // @@protoc_insertion_point(class_scope:ditcaffe.ContrastiveLossParameter) + private: + inline void set_has_margin(); + inline void clear_has_margin(); + inline void set_has_legacy_version(); + inline void clear_has_legacy_version(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + float margin_; + bool legacy_version_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static ContrastiveLossParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class ConvolutionParameter : public ::google::protobuf::MessageLite { + public: + ConvolutionParameter(); + virtual ~ConvolutionParameter(); + + ConvolutionParameter(const ConvolutionParameter& from); + + inline ConvolutionParameter& operator=(const ConvolutionParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ConvolutionParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ConvolutionParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ConvolutionParameter* other); + + // implements Message ---------------------------------------------- + + ConvolutionParameter* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ConvolutionParameter& from); + void MergeFrom(const ConvolutionParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() 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; + + // accessors ------------------------------------------------------- + + // optional uint32 num_output = 1; + inline bool has_num_output() const; + inline void clear_num_output(); + static const int kNumOutputFieldNumber = 1; + inline ::google::protobuf::uint32 num_output() const; + inline void set_num_output(::google::protobuf::uint32 value); + + // optional bool bias_term = 2 [default = true]; + inline bool has_bias_term() const; + inline void clear_bias_term(); + static const int kBiasTermFieldNumber = 2; + inline bool bias_term() const; + inline void set_bias_term(bool value); + + // repeated uint32 pad = 3; + inline int pad_size() const; + inline void clear_pad(); + static const int kPadFieldNumber = 3; + inline ::google::protobuf::uint32 pad(int index) const; + inline void set_pad(int index, ::google::protobuf::uint32 value); + inline void add_pad(::google::protobuf::uint32 value); + inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& + pad() const; + inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* + mutable_pad(); + + // repeated uint32 kernel_size = 4; + inline int kernel_size_size() const; + inline void clear_kernel_size(); + static const int kKernelSizeFieldNumber = 4; + inline ::google::protobuf::uint32 kernel_size(int index) const; + inline void set_kernel_size(int index, ::google::protobuf::uint32 value); + inline void add_kernel_size(::google::protobuf::uint32 value); + inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& + kernel_size() const; + inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* + mutable_kernel_size(); + + // repeated uint32 stride = 6; + inline int stride_size() const; + inline void clear_stride(); + static const int kStrideFieldNumber = 6; + inline ::google::protobuf::uint32 stride(int index) const; + inline void set_stride(int index, ::google::protobuf::uint32 value); + inline void add_stride(::google::protobuf::uint32 value); + inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& + stride() const; + inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* + mutable_stride(); + + // repeated uint32 dilation = 18; + inline int dilation_size() const; + inline void clear_dilation(); + static const int kDilationFieldNumber = 18; + inline ::google::protobuf::uint32 dilation(int index) const; + inline void set_dilation(int index, ::google::protobuf::uint32 value); + inline void add_dilation(::google::protobuf::uint32 value); + inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& + dilation() const; + inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* + mutable_dilation(); + + // optional uint32 pad_h = 9 [default = 0]; + inline bool has_pad_h() const; + inline void clear_pad_h(); + static const int kPadHFieldNumber = 9; + inline ::google::protobuf::uint32 pad_h() const; + inline void set_pad_h(::google::protobuf::uint32 value); + + // optional uint32 pad_w = 10 [default = 0]; + inline bool has_pad_w() const; + inline void clear_pad_w(); + static const int kPadWFieldNumber = 10; + inline ::google::protobuf::uint32 pad_w() const; + inline void set_pad_w(::google::protobuf::uint32 value); + + // optional uint32 kernel_h = 11; + inline bool has_kernel_h() const; + inline void clear_kernel_h(); + static const int kKernelHFieldNumber = 11; + inline ::google::protobuf::uint32 kernel_h() const; + inline void set_kernel_h(::google::protobuf::uint32 value); + + // optional uint32 kernel_w = 12; + inline bool has_kernel_w() const; + inline void clear_kernel_w(); + static const int kKernelWFieldNumber = 12; + inline ::google::protobuf::uint32 kernel_w() const; + inline void set_kernel_w(::google::protobuf::uint32 value); + + // optional uint32 stride_h = 13; + inline bool has_stride_h() const; + inline void clear_stride_h(); + static const int kStrideHFieldNumber = 13; + inline ::google::protobuf::uint32 stride_h() const; + inline void set_stride_h(::google::protobuf::uint32 value); + + // optional uint32 stride_w = 14; + inline bool has_stride_w() const; + inline void clear_stride_w(); + static const int kStrideWFieldNumber = 14; + inline ::google::protobuf::uint32 stride_w() const; + inline void set_stride_w(::google::protobuf::uint32 value); + + // optional uint32 group = 5 [default = 1]; + inline bool has_group() const; + inline void clear_group(); + static const int kGroupFieldNumber = 5; + inline ::google::protobuf::uint32 group() const; + inline void set_group(::google::protobuf::uint32 value); + + // optional .ditcaffe.FillerParameter weight_filler = 7; + inline bool has_weight_filler() const; + inline void clear_weight_filler(); + static const int kWeightFillerFieldNumber = 7; + inline const ::ditcaffe::FillerParameter& weight_filler() const; + inline ::ditcaffe::FillerParameter* mutable_weight_filler(); + inline ::ditcaffe::FillerParameter* release_weight_filler(); + inline void set_allocated_weight_filler(::ditcaffe::FillerParameter* weight_filler); + + // optional .ditcaffe.FillerParameter bias_filler = 8; + inline bool has_bias_filler() const; + inline void clear_bias_filler(); + static const int kBiasFillerFieldNumber = 8; + inline const ::ditcaffe::FillerParameter& bias_filler() const; + inline ::ditcaffe::FillerParameter* mutable_bias_filler(); + inline ::ditcaffe::FillerParameter* release_bias_filler(); + inline void set_allocated_bias_filler(::ditcaffe::FillerParameter* bias_filler); + + // optional .ditcaffe.ConvolutionParameter.Engine engine = 15 [default = DEFAULT]; + inline bool has_engine() const; + inline void clear_engine(); + static const int kEngineFieldNumber = 15; + inline ::ditcaffe::ConvolutionParameter_Engine engine() const; + inline void set_engine(::ditcaffe::ConvolutionParameter_Engine value); + + // optional int32 axis = 16 [default = 1]; + inline bool has_axis() const; + inline void clear_axis(); + static const int kAxisFieldNumber = 16; + inline ::google::protobuf::int32 axis() const; + inline void set_axis(::google::protobuf::int32 value); + + // optional bool force_nd_im2col = 17 [default = false]; + inline bool has_force_nd_im2col() const; + inline void clear_force_nd_im2col(); + static const int kForceNdIm2ColFieldNumber = 17; + inline bool force_nd_im2col() const; + inline void set_force_nd_im2col(bool value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > pad_; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > kernel_size_; + ::google::protobuf::uint32 num_output_; + ::google::protobuf::uint32 pad_h_; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > stride_; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > dilation_; + ::google::protobuf::uint32 pad_w_; + ::google::protobuf::uint32 kernel_h_; + ::google::protobuf::uint32 kernel_w_; + bool bias_term_; + bool force_nd_im2col_; + ::google::protobuf::uint32 stride_h_; + ::google::protobuf::uint32 stride_w_; + ::ditcaffe::FillerParameter* weight_filler_; + ::google::protobuf::uint32 group_; + int engine_; + ::ditcaffe::FillerParameter* bias_filler_; + ::google::protobuf::int32 axis_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static ConvolutionParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class CropParameter : public ::google::protobuf::MessageLite { + public: + CropParameter(); + virtual ~CropParameter(); + + CropParameter(const CropParameter& from); + + inline CropParameter& operator=(const CropParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const CropParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const CropParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(CropParameter* other); + + // implements Message ---------------------------------------------- + + CropParameter* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const CropParameter& from); + void MergeFrom(const CropParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional int32 axis = 1 [default = 2]; + inline bool has_axis() const; + inline void clear_axis(); + static const int kAxisFieldNumber = 1; + inline ::google::protobuf::int32 axis() const; + inline void set_axis(::google::protobuf::int32 value); + + // repeated uint32 offset = 2; + inline int offset_size() const; + inline void clear_offset(); + static const int kOffsetFieldNumber = 2; + inline ::google::protobuf::uint32 offset(int index) const; + inline void set_offset(int index, ::google::protobuf::uint32 value); + inline void add_offset(::google::protobuf::uint32 value); + inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& + offset() const; + inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* + mutable_offset(); + + // @@protoc_insertion_point(class_scope:ditcaffe.CropParameter) + private: + inline void set_has_axis(); + inline void clear_has_axis(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > offset_; + ::google::protobuf::int32 axis_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static CropParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class DataParameter : public ::google::protobuf::MessageLite { + public: + DataParameter(); + virtual ~DataParameter(); + + DataParameter(const DataParameter& from); + + inline DataParameter& operator=(const DataParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const DataParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const DataParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(DataParameter* other); + + // implements Message ---------------------------------------------- + + DataParameter* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const DataParameter& from); + void MergeFrom(const DataParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() 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; + + // accessors ------------------------------------------------------- + + // optional string source = 1; + inline bool has_source() const; + inline void clear_source(); + static const int kSourceFieldNumber = 1; + inline const ::std::string& source() const; + inline void set_source(const ::std::string& value); + inline void set_source(const char* value); + inline void set_source(const char* value, size_t size); + inline ::std::string* mutable_source(); + inline ::std::string* release_source(); + inline void set_allocated_source(::std::string* source); + + // optional uint32 batch_size = 4; + inline bool has_batch_size() const; + inline void clear_batch_size(); + static const int kBatchSizeFieldNumber = 4; + inline ::google::protobuf::uint32 batch_size() const; + inline void set_batch_size(::google::protobuf::uint32 value); + + // optional uint32 rand_skip = 7 [default = 0]; + inline bool has_rand_skip() const; + inline void clear_rand_skip(); + static const int kRandSkipFieldNumber = 7; + inline ::google::protobuf::uint32 rand_skip() const; + inline void set_rand_skip(::google::protobuf::uint32 value); + + // optional .ditcaffe.DataParameter.DB backend = 8 [default = LEVELDB]; + inline bool has_backend() const; + inline void clear_backend(); + static const int kBackendFieldNumber = 8; + inline ::ditcaffe::DataParameter_DB backend() const; + inline void set_backend(::ditcaffe::DataParameter_DB value); + + // optional float scale = 2 [default = 1]; + inline bool has_scale() const; + inline void clear_scale(); + static const int kScaleFieldNumber = 2; + inline float scale() const; + inline void set_scale(float value); + + // optional string mean_file = 3; + inline bool has_mean_file() const; + inline void clear_mean_file(); + static const int kMeanFileFieldNumber = 3; + inline const ::std::string& mean_file() const; + inline void set_mean_file(const ::std::string& value); + inline void set_mean_file(const char* value); + inline void set_mean_file(const char* value, size_t size); + inline ::std::string* mutable_mean_file(); + inline ::std::string* release_mean_file(); + inline void set_allocated_mean_file(::std::string* mean_file); + + // optional uint32 crop_size = 5 [default = 0]; + inline bool has_crop_size() const; + inline void clear_crop_size(); + static const int kCropSizeFieldNumber = 5; + inline ::google::protobuf::uint32 crop_size() const; + inline void set_crop_size(::google::protobuf::uint32 value); + + // optional bool mirror = 6 [default = false]; + inline bool has_mirror() const; + inline void clear_mirror(); + static const int kMirrorFieldNumber = 6; + inline bool mirror() const; + inline void set_mirror(bool value); + + // optional bool force_encoded_color = 9 [default = false]; + inline bool has_force_encoded_color() const; + inline void clear_force_encoded_color(); + static const int kForceEncodedColorFieldNumber = 9; + inline bool force_encoded_color() const; + inline void set_force_encoded_color(bool value); + + // optional uint32 prefetch = 10 [default = 4]; + inline bool has_prefetch() const; + inline void clear_prefetch(); + static const int kPrefetchFieldNumber = 10; + inline ::google::protobuf::uint32 prefetch() const; + inline void set_prefetch(::google::protobuf::uint32 value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::std::string* source_; + ::google::protobuf::uint32 batch_size_; + ::google::protobuf::uint32 rand_skip_; + int backend_; + float scale_; + ::std::string* mean_file_; + ::google::protobuf::uint32 crop_size_; + bool mirror_; + bool force_encoded_color_; + ::google::protobuf::uint32 prefetch_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static DataParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class DropoutParameter : public ::google::protobuf::MessageLite { + public: + DropoutParameter(); + virtual ~DropoutParameter(); + + DropoutParameter(const DropoutParameter& from); + + inline DropoutParameter& operator=(const DropoutParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const DropoutParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const DropoutParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(DropoutParameter* other); + + // implements Message ---------------------------------------------- + + DropoutParameter* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const DropoutParameter& from); + void MergeFrom(const DropoutParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional float dropout_ratio = 1 [default = 0.5]; + inline bool has_dropout_ratio() const; + inline void clear_dropout_ratio(); + static const int kDropoutRatioFieldNumber = 1; + inline float dropout_ratio() const; + inline void set_dropout_ratio(float value); + + // @@protoc_insertion_point(class_scope:ditcaffe.DropoutParameter) + private: + inline void set_has_dropout_ratio(); + inline void clear_has_dropout_ratio(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + float dropout_ratio_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static DropoutParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class DummyDataParameter : public ::google::protobuf::MessageLite { + public: + DummyDataParameter(); + virtual ~DummyDataParameter(); + + DummyDataParameter(const DummyDataParameter& from); + + inline DummyDataParameter& operator=(const DummyDataParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const DummyDataParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const DummyDataParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(DummyDataParameter* other); + + // implements Message ---------------------------------------------- + + DummyDataParameter* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const DummyDataParameter& from); + void MergeFrom(const DummyDataParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .ditcaffe.FillerParameter data_filler = 1; + inline int data_filler_size() const; + inline void clear_data_filler(); + static const int kDataFillerFieldNumber = 1; + inline const ::ditcaffe::FillerParameter& data_filler(int index) const; + inline ::ditcaffe::FillerParameter* mutable_data_filler(int index); + inline ::ditcaffe::FillerParameter* add_data_filler(); + inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::FillerParameter >& + data_filler() const; + inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::FillerParameter >* + mutable_data_filler(); + + // repeated .ditcaffe.BlobShape shape = 6; + inline int shape_size() const; + inline void clear_shape(); + static const int kShapeFieldNumber = 6; + inline const ::ditcaffe::BlobShape& shape(int index) const; + inline ::ditcaffe::BlobShape* mutable_shape(int index); + inline ::ditcaffe::BlobShape* add_shape(); + inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobShape >& + shape() const; + inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobShape >* + mutable_shape(); + + // repeated uint32 num = 2; + inline int num_size() const; + inline void clear_num(); + static const int kNumFieldNumber = 2; + inline ::google::protobuf::uint32 num(int index) const; + inline void set_num(int index, ::google::protobuf::uint32 value); + inline void add_num(::google::protobuf::uint32 value); + inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& + num() const; + inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* + mutable_num(); + + // repeated uint32 channels = 3; + inline int channels_size() const; + inline void clear_channels(); + static const int kChannelsFieldNumber = 3; + inline ::google::protobuf::uint32 channels(int index) const; + inline void set_channels(int index, ::google::protobuf::uint32 value); + inline void add_channels(::google::protobuf::uint32 value); + inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& + channels() const; + inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* + mutable_channels(); + + // repeated uint32 height = 4; + inline int height_size() const; + inline void clear_height(); + static const int kHeightFieldNumber = 4; + inline ::google::protobuf::uint32 height(int index) const; + inline void set_height(int index, ::google::protobuf::uint32 value); + inline void add_height(::google::protobuf::uint32 value); + inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& + height() const; + inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* + mutable_height(); + + // repeated uint32 width = 5; + inline int width_size() const; + inline void clear_width(); + static const int kWidthFieldNumber = 5; + inline ::google::protobuf::uint32 width(int index) const; + inline void set_width(int index, ::google::protobuf::uint32 value); + inline void add_width(::google::protobuf::uint32 value); + inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& + width() const; + inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* + mutable_width(); + + // @@protoc_insertion_point(class_scope:ditcaffe.DummyDataParameter) + private: + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::FillerParameter > data_filler_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::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_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static DummyDataParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class EltwiseParameter : public ::google::protobuf::MessageLite { + public: + EltwiseParameter(); + virtual ~EltwiseParameter(); + + EltwiseParameter(const EltwiseParameter& from); + + inline EltwiseParameter& operator=(const EltwiseParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const EltwiseParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const EltwiseParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(EltwiseParameter* other); + + // implements Message ---------------------------------------------- + + EltwiseParameter* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const EltwiseParameter& from); + void MergeFrom(const EltwiseParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() 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; + + // accessors ------------------------------------------------------- + + // optional .ditcaffe.EltwiseParameter.EltwiseOp operation = 1 [default = SUM]; + inline bool has_operation() const; + inline void clear_operation(); + static const int kOperationFieldNumber = 1; + inline ::ditcaffe::EltwiseParameter_EltwiseOp operation() const; + inline void set_operation(::ditcaffe::EltwiseParameter_EltwiseOp value); + + // repeated float coeff = 2; + inline int coeff_size() const; + inline void clear_coeff(); + static const int kCoeffFieldNumber = 2; + inline float coeff(int index) const; + inline void set_coeff(int index, float value); + inline void add_coeff(float value); + inline const ::google::protobuf::RepeatedField< float >& + coeff() const; + inline ::google::protobuf::RepeatedField< float >* + mutable_coeff(); + + // optional bool stable_prod_grad = 3 [default = true]; + inline bool has_stable_prod_grad() const; + inline void clear_stable_prod_grad(); + static const int kStableProdGradFieldNumber = 3; + inline bool stable_prod_grad() const; + inline void set_stable_prod_grad(bool value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::RepeatedField< float > coeff_; + int operation_; + bool stable_prod_grad_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static EltwiseParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class ELUParameter : public ::google::protobuf::MessageLite { + public: + ELUParameter(); + virtual ~ELUParameter(); + + ELUParameter(const ELUParameter& from); + + inline ELUParameter& operator=(const ELUParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ELUParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ELUParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ELUParameter* other); + + // implements Message ---------------------------------------------- + + ELUParameter* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ELUParameter& from); + void MergeFrom(const ELUParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional float alpha = 1 [default = 1]; + inline bool has_alpha() const; + inline void clear_alpha(); + static const int kAlphaFieldNumber = 1; + inline float alpha() const; + inline void set_alpha(float value); + + // @@protoc_insertion_point(class_scope:ditcaffe.ELUParameter) + private: + inline void set_has_alpha(); + inline void clear_has_alpha(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + float alpha_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static ELUParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class EmbedParameter : public ::google::protobuf::MessageLite { + public: + EmbedParameter(); + virtual ~EmbedParameter(); + + EmbedParameter(const EmbedParameter& from); + + inline EmbedParameter& operator=(const EmbedParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const EmbedParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const EmbedParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(EmbedParameter* other); + + // implements Message ---------------------------------------------- + + EmbedParameter* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const EmbedParameter& from); + void MergeFrom(const EmbedParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional uint32 num_output = 1; + inline bool has_num_output() const; + inline void clear_num_output(); + static const int kNumOutputFieldNumber = 1; + inline ::google::protobuf::uint32 num_output() const; + inline void set_num_output(::google::protobuf::uint32 value); + + // optional uint32 input_dim = 2; + inline bool has_input_dim() const; + inline void clear_input_dim(); + static const int kInputDimFieldNumber = 2; + inline ::google::protobuf::uint32 input_dim() const; + inline void set_input_dim(::google::protobuf::uint32 value); + + // optional bool bias_term = 3 [default = true]; + inline bool has_bias_term() const; + inline void clear_bias_term(); + static const int kBiasTermFieldNumber = 3; + inline bool bias_term() const; + inline void set_bias_term(bool value); + + // optional .ditcaffe.FillerParameter weight_filler = 4; + inline bool has_weight_filler() const; + inline void clear_weight_filler(); + static const int kWeightFillerFieldNumber = 4; + inline const ::ditcaffe::FillerParameter& weight_filler() const; + inline ::ditcaffe::FillerParameter* mutable_weight_filler(); + inline ::ditcaffe::FillerParameter* release_weight_filler(); + inline void set_allocated_weight_filler(::ditcaffe::FillerParameter* weight_filler); + + // optional .ditcaffe.FillerParameter bias_filler = 5; + inline bool has_bias_filler() const; + inline void clear_bias_filler(); + static const int kBiasFillerFieldNumber = 5; + inline const ::ditcaffe::FillerParameter& bias_filler() const; + inline ::ditcaffe::FillerParameter* mutable_bias_filler(); + inline ::ditcaffe::FillerParameter* release_bias_filler(); + inline void set_allocated_bias_filler(::ditcaffe::FillerParameter* bias_filler); + + // @@protoc_insertion_point(class_scope:ditcaffe.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(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::uint32 num_output_; + ::google::protobuf::uint32 input_dim_; + ::ditcaffe::FillerParameter* weight_filler_; + ::ditcaffe::FillerParameter* bias_filler_; + bool bias_term_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static EmbedParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class ExpParameter : public ::google::protobuf::MessageLite { + public: + ExpParameter(); + virtual ~ExpParameter(); + + ExpParameter(const ExpParameter& from); + + inline ExpParameter& operator=(const ExpParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ExpParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ExpParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ExpParameter* other); + + // implements Message ---------------------------------------------- + + ExpParameter* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ExpParameter& from); + void MergeFrom(const ExpParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional float base = 1 [default = -1]; + inline bool has_base() const; + inline void clear_base(); + static const int kBaseFieldNumber = 1; + inline float base() const; + inline void set_base(float value); + + // optional float scale = 2 [default = 1]; + inline bool has_scale() const; + inline void clear_scale(); + static const int kScaleFieldNumber = 2; + inline float scale() const; + inline void set_scale(float value); + + // optional float shift = 3 [default = 0]; + inline bool has_shift() const; + inline void clear_shift(); + static const int kShiftFieldNumber = 3; + inline float shift() const; + inline void set_shift(float value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + float base_; + float scale_; + float shift_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static ExpParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class FlattenParameter : public ::google::protobuf::MessageLite { + public: + FlattenParameter(); + virtual ~FlattenParameter(); + + FlattenParameter(const FlattenParameter& from); + + inline FlattenParameter& operator=(const FlattenParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const FlattenParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const FlattenParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(FlattenParameter* other); + + // implements Message ---------------------------------------------- + + FlattenParameter* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const FlattenParameter& from); + void MergeFrom(const FlattenParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional int32 axis = 1 [default = 1]; + inline bool has_axis() const; + inline void clear_axis(); + static const int kAxisFieldNumber = 1; + inline ::google::protobuf::int32 axis() const; + inline void set_axis(::google::protobuf::int32 value); + + // optional int32 end_axis = 2 [default = -1]; + inline bool has_end_axis() const; + inline void clear_end_axis(); + static const int kEndAxisFieldNumber = 2; + inline ::google::protobuf::int32 end_axis() const; + inline void set_end_axis(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:ditcaffe.FlattenParameter) + private: + inline void set_has_axis(); + inline void clear_has_axis(); + inline void set_has_end_axis(); + inline void clear_has_end_axis(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::int32 axis_; + ::google::protobuf::int32 end_axis_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static FlattenParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class HDF5DataParameter : public ::google::protobuf::MessageLite { + public: + HDF5DataParameter(); + virtual ~HDF5DataParameter(); + + HDF5DataParameter(const HDF5DataParameter& from); + + inline HDF5DataParameter& operator=(const HDF5DataParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const HDF5DataParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const HDF5DataParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(HDF5DataParameter* other); + + // implements Message ---------------------------------------------- + + HDF5DataParameter* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const HDF5DataParameter& from); + void MergeFrom(const HDF5DataParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional string source = 1; + inline bool has_source() const; + inline void clear_source(); + static const int kSourceFieldNumber = 1; + inline const ::std::string& source() const; + inline void set_source(const ::std::string& value); + inline void set_source(const char* value); + inline void set_source(const char* value, size_t size); + inline ::std::string* mutable_source(); + inline ::std::string* release_source(); + inline void set_allocated_source(::std::string* source); + + // optional uint32 batch_size = 2; + inline bool has_batch_size() const; + inline void clear_batch_size(); + static const int kBatchSizeFieldNumber = 2; + inline ::google::protobuf::uint32 batch_size() const; + inline void set_batch_size(::google::protobuf::uint32 value); + + // optional bool shuffle = 3 [default = false]; + inline bool has_shuffle() const; + inline void clear_shuffle(); + static const int kShuffleFieldNumber = 3; + inline bool shuffle() const; + inline void set_shuffle(bool value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::std::string* source_; + ::google::protobuf::uint32 batch_size_; + bool shuffle_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static HDF5DataParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class HDF5OutputParameter : public ::google::protobuf::MessageLite { + public: + HDF5OutputParameter(); + virtual ~HDF5OutputParameter(); + + HDF5OutputParameter(const HDF5OutputParameter& from); + + inline HDF5OutputParameter& operator=(const HDF5OutputParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const HDF5OutputParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const HDF5OutputParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(HDF5OutputParameter* other); + + // implements Message ---------------------------------------------- + + HDF5OutputParameter* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const HDF5OutputParameter& from); + void MergeFrom(const HDF5OutputParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional string file_name = 1; + inline bool has_file_name() const; + inline void clear_file_name(); + static const int kFileNameFieldNumber = 1; + inline const ::std::string& file_name() const; + inline void set_file_name(const ::std::string& value); + inline void set_file_name(const char* value); + inline void set_file_name(const char* value, size_t size); + inline ::std::string* mutable_file_name(); + inline ::std::string* release_file_name(); + inline void set_allocated_file_name(::std::string* file_name); + + // @@protoc_insertion_point(class_scope:ditcaffe.HDF5OutputParameter) + private: + inline void set_has_file_name(); + inline void clear_has_file_name(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::std::string* file_name_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static HDF5OutputParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class HingeLossParameter : public ::google::protobuf::MessageLite { + public: + HingeLossParameter(); + virtual ~HingeLossParameter(); + + HingeLossParameter(const HingeLossParameter& from); + + inline HingeLossParameter& operator=(const HingeLossParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const HingeLossParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const HingeLossParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(HingeLossParameter* other); + + // implements Message ---------------------------------------------- + + HingeLossParameter* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const HingeLossParameter& from); + void MergeFrom(const HingeLossParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() 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; + + // accessors ------------------------------------------------------- + + // optional .ditcaffe.HingeLossParameter.Norm norm = 1 [default = L1]; + inline bool has_norm() const; + inline void clear_norm(); + static const int kNormFieldNumber = 1; + inline ::ditcaffe::HingeLossParameter_Norm norm() const; + inline void set_norm(::ditcaffe::HingeLossParameter_Norm value); + + // @@protoc_insertion_point(class_scope:ditcaffe.HingeLossParameter) + private: + inline void set_has_norm(); + inline void clear_has_norm(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + int norm_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static HingeLossParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class ImageDataParameter : public ::google::protobuf::MessageLite { + public: + ImageDataParameter(); + virtual ~ImageDataParameter(); + + ImageDataParameter(const ImageDataParameter& from); + + inline ImageDataParameter& operator=(const ImageDataParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ImageDataParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ImageDataParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ImageDataParameter* other); + + // implements Message ---------------------------------------------- + + ImageDataParameter* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ImageDataParameter& from); + void MergeFrom(const ImageDataParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional string source = 1; + inline bool has_source() const; + inline void clear_source(); + static const int kSourceFieldNumber = 1; + inline const ::std::string& source() const; + inline void set_source(const ::std::string& value); + inline void set_source(const char* value); + inline void set_source(const char* value, size_t size); + inline ::std::string* mutable_source(); + inline ::std::string* release_source(); + inline void set_allocated_source(::std::string* source); + + // optional uint32 batch_size = 4 [default = 1]; + inline bool has_batch_size() const; + inline void clear_batch_size(); + static const int kBatchSizeFieldNumber = 4; + inline ::google::protobuf::uint32 batch_size() const; + inline void set_batch_size(::google::protobuf::uint32 value); + + // optional uint32 rand_skip = 7 [default = 0]; + inline bool has_rand_skip() const; + inline void clear_rand_skip(); + static const int kRandSkipFieldNumber = 7; + inline ::google::protobuf::uint32 rand_skip() const; + inline void set_rand_skip(::google::protobuf::uint32 value); + + // optional bool shuffle = 8 [default = false]; + inline bool has_shuffle() const; + inline void clear_shuffle(); + static const int kShuffleFieldNumber = 8; + inline bool shuffle() const; + inline void set_shuffle(bool value); + + // optional uint32 new_height = 9 [default = 0]; + inline bool has_new_height() const; + inline void clear_new_height(); + static const int kNewHeightFieldNumber = 9; + inline ::google::protobuf::uint32 new_height() const; + inline void set_new_height(::google::protobuf::uint32 value); + + // optional uint32 new_width = 10 [default = 0]; + inline bool has_new_width() const; + inline void clear_new_width(); + static const int kNewWidthFieldNumber = 10; + inline ::google::protobuf::uint32 new_width() const; + inline void set_new_width(::google::protobuf::uint32 value); + + // optional bool is_color = 11 [default = true]; + inline bool has_is_color() const; + inline void clear_is_color(); + static const int kIsColorFieldNumber = 11; + inline bool is_color() const; + inline void set_is_color(bool value); + + // optional float scale = 2 [default = 1]; + inline bool has_scale() const; + inline void clear_scale(); + static const int kScaleFieldNumber = 2; + inline float scale() const; + inline void set_scale(float value); + + // optional string mean_file = 3; + inline bool has_mean_file() const; + inline void clear_mean_file(); + static const int kMeanFileFieldNumber = 3; + inline const ::std::string& mean_file() const; + inline void set_mean_file(const ::std::string& value); + inline void set_mean_file(const char* value); + inline void set_mean_file(const char* value, size_t size); + inline ::std::string* mutable_mean_file(); + inline ::std::string* release_mean_file(); + inline void set_allocated_mean_file(::std::string* mean_file); + + // optional uint32 crop_size = 5 [default = 0]; + inline bool has_crop_size() const; + inline void clear_crop_size(); + static const int kCropSizeFieldNumber = 5; + inline ::google::protobuf::uint32 crop_size() const; + inline void set_crop_size(::google::protobuf::uint32 value); + + // optional bool mirror = 6 [default = false]; + inline bool has_mirror() const; + inline void clear_mirror(); + static const int kMirrorFieldNumber = 6; + inline bool mirror() const; + inline void set_mirror(bool value); + + // optional string root_folder = 12 [default = ""]; + inline bool has_root_folder() const; + inline void clear_root_folder(); + static const int kRootFolderFieldNumber = 12; + inline const ::std::string& root_folder() const; + inline void set_root_folder(const ::std::string& value); + inline void set_root_folder(const char* value); + inline void set_root_folder(const char* value, size_t size); + inline ::std::string* mutable_root_folder(); + inline ::std::string* release_root_folder(); + inline void set_allocated_root_folder(::std::string* root_folder); + + // @@protoc_insertion_point(class_scope:ditcaffe.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(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::std::string* source_; + ::google::protobuf::uint32 batch_size_; + ::google::protobuf::uint32 rand_skip_; + ::google::protobuf::uint32 new_height_; + ::google::protobuf::uint32 new_width_; + bool shuffle_; + bool is_color_; + bool mirror_; + float scale_; + ::std::string* mean_file_; + ::std::string* root_folder_; + ::google::protobuf::uint32 crop_size_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static ImageDataParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class InfogainLossParameter : public ::google::protobuf::MessageLite { + public: + InfogainLossParameter(); + virtual ~InfogainLossParameter(); + + InfogainLossParameter(const InfogainLossParameter& from); + + inline InfogainLossParameter& operator=(const InfogainLossParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const InfogainLossParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const InfogainLossParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(InfogainLossParameter* other); + + // implements Message ---------------------------------------------- + + InfogainLossParameter* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const InfogainLossParameter& from); + void MergeFrom(const InfogainLossParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional string source = 1; + inline bool has_source() const; + inline void clear_source(); + static const int kSourceFieldNumber = 1; + inline const ::std::string& source() const; + inline void set_source(const ::std::string& value); + inline void set_source(const char* value); + inline void set_source(const char* value, size_t size); + inline ::std::string* mutable_source(); + inline ::std::string* release_source(); + inline void set_allocated_source(::std::string* source); + + // @@protoc_insertion_point(class_scope:ditcaffe.InfogainLossParameter) + private: + inline void set_has_source(); + inline void clear_has_source(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::std::string* source_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static InfogainLossParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class InnerProductParameter : public ::google::protobuf::MessageLite { + public: + InnerProductParameter(); + virtual ~InnerProductParameter(); + + InnerProductParameter(const InnerProductParameter& from); + + inline InnerProductParameter& operator=(const InnerProductParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const InnerProductParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const InnerProductParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(InnerProductParameter* other); + + // implements Message ---------------------------------------------- + + InnerProductParameter* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const InnerProductParameter& from); + void MergeFrom(const InnerProductParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional uint32 num_output = 1; + inline bool has_num_output() const; + inline void clear_num_output(); + static const int kNumOutputFieldNumber = 1; + inline ::google::protobuf::uint32 num_output() const; + inline void set_num_output(::google::protobuf::uint32 value); + + // optional bool bias_term = 2 [default = true]; + inline bool has_bias_term() const; + inline void clear_bias_term(); + static const int kBiasTermFieldNumber = 2; + inline bool bias_term() const; + inline void set_bias_term(bool value); + + // optional .ditcaffe.FillerParameter weight_filler = 3; + inline bool has_weight_filler() const; + inline void clear_weight_filler(); + static const int kWeightFillerFieldNumber = 3; + inline const ::ditcaffe::FillerParameter& weight_filler() const; + inline ::ditcaffe::FillerParameter* mutable_weight_filler(); + inline ::ditcaffe::FillerParameter* release_weight_filler(); + inline void set_allocated_weight_filler(::ditcaffe::FillerParameter* weight_filler); + + // optional .ditcaffe.FillerParameter bias_filler = 4; + inline bool has_bias_filler() const; + inline void clear_bias_filler(); + static const int kBiasFillerFieldNumber = 4; + inline const ::ditcaffe::FillerParameter& bias_filler() const; + inline ::ditcaffe::FillerParameter* mutable_bias_filler(); + inline ::ditcaffe::FillerParameter* release_bias_filler(); + inline void set_allocated_bias_filler(::ditcaffe::FillerParameter* bias_filler); + + // optional int32 axis = 5 [default = 1]; + inline bool has_axis() const; + inline void clear_axis(); + static const int kAxisFieldNumber = 5; + inline ::google::protobuf::int32 axis() const; + inline void set_axis(::google::protobuf::int32 value); + + // optional bool transpose = 6 [default = false]; + inline bool has_transpose() const; + inline void clear_transpose(); + static const int kTransposeFieldNumber = 6; + inline bool transpose() const; + inline void set_transpose(bool value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::ditcaffe::FillerParameter* weight_filler_; + ::google::protobuf::uint32 num_output_; + bool bias_term_; + bool transpose_; + ::ditcaffe::FillerParameter* bias_filler_; + ::google::protobuf::int32 axis_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static InnerProductParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class InputParameter : public ::google::protobuf::MessageLite { + public: + InputParameter(); + virtual ~InputParameter(); + + InputParameter(const InputParameter& from); + + inline InputParameter& operator=(const InputParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const InputParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const InputParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(InputParameter* other); + + // implements Message ---------------------------------------------- + + InputParameter* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const InputParameter& from); + void MergeFrom(const InputParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .ditcaffe.BlobShape shape = 1; + inline int shape_size() const; + inline void clear_shape(); + static const int kShapeFieldNumber = 1; + inline const ::ditcaffe::BlobShape& shape(int index) const; + inline ::ditcaffe::BlobShape* mutable_shape(int index); + inline ::ditcaffe::BlobShape* add_shape(); + inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobShape >& + shape() const; + inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobShape >* + mutable_shape(); + + // @@protoc_insertion_point(class_scope:ditcaffe.InputParameter) + private: + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobShape > shape_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static InputParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class LogParameter : public ::google::protobuf::MessageLite { + public: + LogParameter(); + virtual ~LogParameter(); + + LogParameter(const LogParameter& from); + + inline LogParameter& operator=(const LogParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const LogParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const LogParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(LogParameter* other); + + // implements Message ---------------------------------------------- + + LogParameter* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const LogParameter& from); + void MergeFrom(const LogParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional float base = 1 [default = -1]; + inline bool has_base() const; + inline void clear_base(); + static const int kBaseFieldNumber = 1; + inline float base() const; + inline void set_base(float value); + + // optional float scale = 2 [default = 1]; + inline bool has_scale() const; + inline void clear_scale(); + static const int kScaleFieldNumber = 2; + inline float scale() const; + inline void set_scale(float value); + + // optional float shift = 3 [default = 0]; + inline bool has_shift() const; + inline void clear_shift(); + static const int kShiftFieldNumber = 3; + inline float shift() const; + inline void set_shift(float value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + float base_; + float scale_; + float shift_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static LogParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class LRNParameter : public ::google::protobuf::MessageLite { + public: + LRNParameter(); + virtual ~LRNParameter(); + + LRNParameter(const LRNParameter& from); + + inline LRNParameter& operator=(const LRNParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const LRNParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const LRNParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(LRNParameter* other); + + // implements Message ---------------------------------------------- + + LRNParameter* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const LRNParameter& from); + void MergeFrom(const LRNParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() 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; + + 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; + + // accessors ------------------------------------------------------- + + // optional uint32 local_size = 1 [default = 5]; + inline bool has_local_size() const; + inline void clear_local_size(); + static const int kLocalSizeFieldNumber = 1; + inline ::google::protobuf::uint32 local_size() const; + inline void set_local_size(::google::protobuf::uint32 value); + + // optional float alpha = 2 [default = 1]; + inline bool has_alpha() const; + inline void clear_alpha(); + static const int kAlphaFieldNumber = 2; + inline float alpha() const; + inline void set_alpha(float value); + + // optional float beta = 3 [default = 0.75]; + inline bool has_beta() const; + inline void clear_beta(); + static const int kBetaFieldNumber = 3; + inline float beta() const; + inline void set_beta(float value); + + // optional .ditcaffe.LRNParameter.NormRegion norm_region = 4 [default = ACROSS_CHANNELS]; + inline bool has_norm_region() const; + inline void clear_norm_region(); + static const int kNormRegionFieldNumber = 4; + inline ::ditcaffe::LRNParameter_NormRegion norm_region() const; + inline void set_norm_region(::ditcaffe::LRNParameter_NormRegion value); + + // optional float k = 5 [default = 1]; + inline bool has_k() const; + inline void clear_k(); + static const int kKFieldNumber = 5; + inline float k() const; + inline void set_k(float value); + + // optional .ditcaffe.LRNParameter.Engine engine = 6 [default = DEFAULT]; + inline bool has_engine() const; + inline void clear_engine(); + static const int kEngineFieldNumber = 6; + inline ::ditcaffe::LRNParameter_Engine engine() const; + inline void set_engine(::ditcaffe::LRNParameter_Engine value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::uint32 local_size_; + float alpha_; + float beta_; + int norm_region_; + float k_; + int engine_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static LRNParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class MemoryDataParameter : public ::google::protobuf::MessageLite { + public: + MemoryDataParameter(); + virtual ~MemoryDataParameter(); + + MemoryDataParameter(const MemoryDataParameter& from); + + inline MemoryDataParameter& operator=(const MemoryDataParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const MemoryDataParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const MemoryDataParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(MemoryDataParameter* other); + + // implements Message ---------------------------------------------- + + MemoryDataParameter* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const MemoryDataParameter& from); + void MergeFrom(const MemoryDataParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional uint32 batch_size = 1; + inline bool has_batch_size() const; + inline void clear_batch_size(); + static const int kBatchSizeFieldNumber = 1; + inline ::google::protobuf::uint32 batch_size() const; + inline void set_batch_size(::google::protobuf::uint32 value); + + // optional uint32 channels = 2; + inline bool has_channels() const; + inline void clear_channels(); + static const int kChannelsFieldNumber = 2; + inline ::google::protobuf::uint32 channels() const; + inline void set_channels(::google::protobuf::uint32 value); + + // optional uint32 height = 3; + inline bool has_height() const; + inline void clear_height(); + static const int kHeightFieldNumber = 3; + inline ::google::protobuf::uint32 height() const; + inline void set_height(::google::protobuf::uint32 value); + + // optional uint32 width = 4; + inline bool has_width() const; + inline void clear_width(); + static const int kWidthFieldNumber = 4; + inline ::google::protobuf::uint32 width() const; + inline void set_width(::google::protobuf::uint32 value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::uint32 batch_size_; + ::google::protobuf::uint32 channels_; + ::google::protobuf::uint32 height_; + ::google::protobuf::uint32 width_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static MemoryDataParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class MVNParameter : public ::google::protobuf::MessageLite { + public: + MVNParameter(); + virtual ~MVNParameter(); + + MVNParameter(const MVNParameter& from); + + inline MVNParameter& operator=(const MVNParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const MVNParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const MVNParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(MVNParameter* other); + + // implements Message ---------------------------------------------- + + MVNParameter* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const MVNParameter& from); + void MergeFrom(const MVNParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional bool normalize_variance = 1 [default = true]; + inline bool has_normalize_variance() const; + inline void clear_normalize_variance(); + static const int kNormalizeVarianceFieldNumber = 1; + inline bool normalize_variance() const; + inline void set_normalize_variance(bool value); + + // optional bool across_channels = 2 [default = false]; + inline bool has_across_channels() const; + inline void clear_across_channels(); + static const int kAcrossChannelsFieldNumber = 2; + inline bool across_channels() const; + inline void set_across_channels(bool value); + + // optional float eps = 3 [default = 1e-09]; + inline bool has_eps() const; + inline void clear_eps(); + static const int kEpsFieldNumber = 3; + inline float eps() const; + inline void set_eps(float value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + bool normalize_variance_; + bool across_channels_; + float eps_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static MVNParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class ParameterParameter : public ::google::protobuf::MessageLite { + public: + ParameterParameter(); + virtual ~ParameterParameter(); + + ParameterParameter(const ParameterParameter& from); + + inline ParameterParameter& operator=(const ParameterParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ParameterParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ParameterParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ParameterParameter* other); + + // implements Message ---------------------------------------------- + + ParameterParameter* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ParameterParameter& from); + void MergeFrom(const ParameterParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional .ditcaffe.BlobShape shape = 1; + inline bool has_shape() const; + inline void clear_shape(); + static const int kShapeFieldNumber = 1; + inline const ::ditcaffe::BlobShape& shape() const; + inline ::ditcaffe::BlobShape* mutable_shape(); + inline ::ditcaffe::BlobShape* release_shape(); + inline void set_allocated_shape(::ditcaffe::BlobShape* shape); + + // @@protoc_insertion_point(class_scope:ditcaffe.ParameterParameter) + private: + inline void set_has_shape(); + inline void clear_has_shape(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::ditcaffe::BlobShape* shape_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static ParameterParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class PoolingParameter : public ::google::protobuf::MessageLite { + public: + PoolingParameter(); + virtual ~PoolingParameter(); + + PoolingParameter(const PoolingParameter& from); + + inline PoolingParameter& operator=(const PoolingParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const PoolingParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const PoolingParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(PoolingParameter* other); + + // implements Message ---------------------------------------------- + + PoolingParameter* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const PoolingParameter& from); + void MergeFrom(const PoolingParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() 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; + + 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; + + // accessors ------------------------------------------------------- + + // optional .ditcaffe.PoolingParameter.PoolMethod pool = 1 [default = MAX]; + inline bool has_pool() const; + inline void clear_pool(); + static const int kPoolFieldNumber = 1; + inline ::ditcaffe::PoolingParameter_PoolMethod pool() const; + inline void set_pool(::ditcaffe::PoolingParameter_PoolMethod value); + + // optional uint32 pad = 4 [default = 0]; + inline bool has_pad() const; + inline void clear_pad(); + static const int kPadFieldNumber = 4; + inline ::google::protobuf::uint32 pad() const; + inline void set_pad(::google::protobuf::uint32 value); + + // optional uint32 pad_h = 9 [default = 0]; + inline bool has_pad_h() const; + inline void clear_pad_h(); + static const int kPadHFieldNumber = 9; + inline ::google::protobuf::uint32 pad_h() const; + inline void set_pad_h(::google::protobuf::uint32 value); + + // optional uint32 pad_w = 10 [default = 0]; + inline bool has_pad_w() const; + inline void clear_pad_w(); + static const int kPadWFieldNumber = 10; + inline ::google::protobuf::uint32 pad_w() const; + inline void set_pad_w(::google::protobuf::uint32 value); + + // optional uint32 kernel_size = 2; + inline bool has_kernel_size() const; + inline void clear_kernel_size(); + static const int kKernelSizeFieldNumber = 2; + inline ::google::protobuf::uint32 kernel_size() const; + inline void set_kernel_size(::google::protobuf::uint32 value); + + // optional uint32 kernel_h = 5; + inline bool has_kernel_h() const; + inline void clear_kernel_h(); + static const int kKernelHFieldNumber = 5; + inline ::google::protobuf::uint32 kernel_h() const; + inline void set_kernel_h(::google::protobuf::uint32 value); + + // optional uint32 kernel_w = 6; + inline bool has_kernel_w() const; + inline void clear_kernel_w(); + static const int kKernelWFieldNumber = 6; + inline ::google::protobuf::uint32 kernel_w() const; + inline void set_kernel_w(::google::protobuf::uint32 value); + + // optional uint32 stride = 3 [default = 1]; + inline bool has_stride() const; + inline void clear_stride(); + static const int kStrideFieldNumber = 3; + inline ::google::protobuf::uint32 stride() const; + inline void set_stride(::google::protobuf::uint32 value); + + // optional uint32 stride_h = 7; + inline bool has_stride_h() const; + inline void clear_stride_h(); + static const int kStrideHFieldNumber = 7; + inline ::google::protobuf::uint32 stride_h() const; + inline void set_stride_h(::google::protobuf::uint32 value); + + // optional uint32 stride_w = 8; + inline bool has_stride_w() const; + inline void clear_stride_w(); + static const int kStrideWFieldNumber = 8; + inline ::google::protobuf::uint32 stride_w() const; + inline void set_stride_w(::google::protobuf::uint32 value); + + // optional .ditcaffe.PoolingParameter.Engine engine = 11 [default = DEFAULT]; + inline bool has_engine() const; + inline void clear_engine(); + static const int kEngineFieldNumber = 11; + inline ::ditcaffe::PoolingParameter_Engine engine() const; + inline void set_engine(::ditcaffe::PoolingParameter_Engine value); + + // optional bool global_pooling = 12 [default = false]; + inline bool has_global_pooling() const; + inline void clear_global_pooling(); + static const int kGlobalPoolingFieldNumber = 12; + inline bool global_pooling() const; + inline void set_global_pooling(bool value); + + // optional bool torch_pooling = 40 [default = false]; + inline bool has_torch_pooling() const; + inline void clear_torch_pooling(); + static const int kTorchPoolingFieldNumber = 40; + inline bool torch_pooling() const; + inline void set_torch_pooling(bool value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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(); + inline void set_has_torch_pooling(); + inline void clear_has_torch_pooling(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + 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_; + ::google::protobuf::uint32 stride_h_; + ::google::protobuf::uint32 stride_w_; + int engine_; + bool global_pooling_; + bool torch_pooling_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static PoolingParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class PowerParameter : public ::google::protobuf::MessageLite { + public: + PowerParameter(); + virtual ~PowerParameter(); + + PowerParameter(const PowerParameter& from); + + inline PowerParameter& operator=(const PowerParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const PowerParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const PowerParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(PowerParameter* other); + + // implements Message ---------------------------------------------- + + PowerParameter* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const PowerParameter& from); + void MergeFrom(const PowerParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional float power = 1 [default = 1]; + inline bool has_power() const; + inline void clear_power(); + static const int kPowerFieldNumber = 1; + inline float power() const; + inline void set_power(float value); + + // optional float scale = 2 [default = 1]; + inline bool has_scale() const; + inline void clear_scale(); + static const int kScaleFieldNumber = 2; + inline float scale() const; + inline void set_scale(float value); + + // optional float shift = 3 [default = 0]; + inline bool has_shift() const; + inline void clear_shift(); + static const int kShiftFieldNumber = 3; + inline float shift() const; + inline void set_shift(float value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + float power_; + float scale_; + float shift_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static PowerParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class PythonParameter : public ::google::protobuf::MessageLite { + public: + PythonParameter(); + virtual ~PythonParameter(); + + PythonParameter(const PythonParameter& from); + + inline PythonParameter& operator=(const PythonParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const PythonParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const PythonParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(PythonParameter* other); + + // implements Message ---------------------------------------------- + + PythonParameter* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const PythonParameter& from); + void MergeFrom(const PythonParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional string module = 1; + inline bool has_module() const; + inline void clear_module(); + static const int kModuleFieldNumber = 1; + inline const ::std::string& module() const; + inline void set_module(const ::std::string& value); + inline void set_module(const char* value); + inline void set_module(const char* value, size_t size); + inline ::std::string* mutable_module(); + inline ::std::string* release_module(); + inline void set_allocated_module(::std::string* module); + + // optional string layer = 2; + inline bool has_layer() const; + inline void clear_layer(); + static const int kLayerFieldNumber = 2; + inline const ::std::string& layer() const; + inline void set_layer(const ::std::string& value); + inline void set_layer(const char* value); + inline void set_layer(const char* value, size_t size); + inline ::std::string* mutable_layer(); + inline ::std::string* release_layer(); + inline void set_allocated_layer(::std::string* layer); + + // optional string param_str = 3 [default = ""]; + inline bool has_param_str() const; + inline void clear_param_str(); + static const int kParamStrFieldNumber = 3; + inline const ::std::string& param_str() const; + inline void set_param_str(const ::std::string& value); + inline void set_param_str(const char* value); + inline void set_param_str(const char* value, size_t size); + inline ::std::string* mutable_param_str(); + inline ::std::string* release_param_str(); + inline void set_allocated_param_str(::std::string* param_str); + + // optional bool share_in_parallel = 4 [default = false]; + inline bool has_share_in_parallel() const; + inline void clear_share_in_parallel(); + static const int kShareInParallelFieldNumber = 4; + inline bool share_in_parallel() const; + inline void set_share_in_parallel(bool value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::std::string* module_; + ::std::string* layer_; + ::std::string* param_str_; + bool share_in_parallel_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static PythonParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class ReductionParameter : public ::google::protobuf::MessageLite { + public: + ReductionParameter(); + virtual ~ReductionParameter(); + + ReductionParameter(const ReductionParameter& from); + + inline ReductionParameter& operator=(const ReductionParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ReductionParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ReductionParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ReductionParameter* other); + + // implements Message ---------------------------------------------- + + ReductionParameter* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ReductionParameter& from); + void MergeFrom(const ReductionParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() 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; + + // accessors ------------------------------------------------------- + + // optional .ditcaffe.ReductionParameter.ReductionOp operation = 1 [default = SUM]; + inline bool has_operation() const; + inline void clear_operation(); + static const int kOperationFieldNumber = 1; + inline ::ditcaffe::ReductionParameter_ReductionOp operation() const; + inline void set_operation(::ditcaffe::ReductionParameter_ReductionOp value); + + // optional int32 axis = 2 [default = 0]; + inline bool has_axis() const; + inline void clear_axis(); + static const int kAxisFieldNumber = 2; + inline ::google::protobuf::int32 axis() const; + inline void set_axis(::google::protobuf::int32 value); + + // optional float coeff = 3 [default = 1]; + inline bool has_coeff() const; + inline void clear_coeff(); + static const int kCoeffFieldNumber = 3; + inline float coeff() const; + inline void set_coeff(float value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + int operation_; + ::google::protobuf::int32 axis_; + float coeff_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static ReductionParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class ReLUParameter : public ::google::protobuf::MessageLite { + public: + ReLUParameter(); + virtual ~ReLUParameter(); + + ReLUParameter(const ReLUParameter& from); + + inline ReLUParameter& operator=(const ReLUParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ReLUParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ReLUParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ReLUParameter* other); + + // implements Message ---------------------------------------------- + + ReLUParameter* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ReLUParameter& from); + void MergeFrom(const ReLUParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() 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; + + // accessors ------------------------------------------------------- + + // optional float negative_slope = 1 [default = 0]; + inline bool has_negative_slope() const; + inline void clear_negative_slope(); + static const int kNegativeSlopeFieldNumber = 1; + inline float negative_slope() const; + inline void set_negative_slope(float value); + + // optional .ditcaffe.ReLUParameter.Engine engine = 2 [default = DEFAULT]; + inline bool has_engine() const; + inline void clear_engine(); + static const int kEngineFieldNumber = 2; + inline ::ditcaffe::ReLUParameter_Engine engine() const; + inline void set_engine(::ditcaffe::ReLUParameter_Engine value); + + // @@protoc_insertion_point(class_scope:ditcaffe.ReLUParameter) + private: + inline void set_has_negative_slope(); + inline void clear_has_negative_slope(); + inline void set_has_engine(); + inline void clear_has_engine(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + float negative_slope_; + int engine_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static ReLUParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class ReshapeParameter : public ::google::protobuf::MessageLite { + public: + ReshapeParameter(); + virtual ~ReshapeParameter(); + + ReshapeParameter(const ReshapeParameter& from); + + inline ReshapeParameter& operator=(const ReshapeParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ReshapeParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ReshapeParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ReshapeParameter* other); + + // implements Message ---------------------------------------------- + + ReshapeParameter* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ReshapeParameter& from); + void MergeFrom(const ReshapeParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional .ditcaffe.BlobShape shape = 1; + inline bool has_shape() const; + inline void clear_shape(); + static const int kShapeFieldNumber = 1; + inline const ::ditcaffe::BlobShape& shape() const; + inline ::ditcaffe::BlobShape* mutable_shape(); + inline ::ditcaffe::BlobShape* release_shape(); + inline void set_allocated_shape(::ditcaffe::BlobShape* shape); + + // optional int32 axis = 2 [default = 0]; + inline bool has_axis() const; + inline void clear_axis(); + static const int kAxisFieldNumber = 2; + inline ::google::protobuf::int32 axis() const; + inline void set_axis(::google::protobuf::int32 value); + + // optional int32 num_axes = 3 [default = -1]; + inline bool has_num_axes() const; + inline void clear_num_axes(); + static const int kNumAxesFieldNumber = 3; + inline ::google::protobuf::int32 num_axes() const; + inline void set_num_axes(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::ditcaffe::BlobShape* shape_; + ::google::protobuf::int32 axis_; + ::google::protobuf::int32 num_axes_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static ReshapeParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class ScaleParameter : public ::google::protobuf::MessageLite { + public: + ScaleParameter(); + virtual ~ScaleParameter(); + + ScaleParameter(const ScaleParameter& from); + + inline ScaleParameter& operator=(const ScaleParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ScaleParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ScaleParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ScaleParameter* other); + + // implements Message ---------------------------------------------- + + ScaleParameter* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ScaleParameter& from); + void MergeFrom(const ScaleParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional int32 axis = 1 [default = 1]; + inline bool has_axis() const; + inline void clear_axis(); + static const int kAxisFieldNumber = 1; + inline ::google::protobuf::int32 axis() const; + inline void set_axis(::google::protobuf::int32 value); + + // optional int32 num_axes = 2 [default = 1]; + inline bool has_num_axes() const; + inline void clear_num_axes(); + static const int kNumAxesFieldNumber = 2; + inline ::google::protobuf::int32 num_axes() const; + inline void set_num_axes(::google::protobuf::int32 value); + + // optional .ditcaffe.FillerParameter filler = 3; + inline bool has_filler() const; + inline void clear_filler(); + static const int kFillerFieldNumber = 3; + inline const ::ditcaffe::FillerParameter& filler() const; + inline ::ditcaffe::FillerParameter* mutable_filler(); + inline ::ditcaffe::FillerParameter* release_filler(); + inline void set_allocated_filler(::ditcaffe::FillerParameter* filler); + + // optional bool bias_term = 4 [default = false]; + inline bool has_bias_term() const; + inline void clear_bias_term(); + static const int kBiasTermFieldNumber = 4; + inline bool bias_term() const; + inline void set_bias_term(bool value); + + // optional .ditcaffe.FillerParameter bias_filler = 5; + inline bool has_bias_filler() const; + inline void clear_bias_filler(); + static const int kBiasFillerFieldNumber = 5; + inline const ::ditcaffe::FillerParameter& bias_filler() const; + inline ::ditcaffe::FillerParameter* mutable_bias_filler(); + inline ::ditcaffe::FillerParameter* release_bias_filler(); + inline void set_allocated_bias_filler(::ditcaffe::FillerParameter* bias_filler); + + // @@protoc_insertion_point(class_scope:ditcaffe.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(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::int32 axis_; + ::google::protobuf::int32 num_axes_; + ::ditcaffe::FillerParameter* filler_; + ::ditcaffe::FillerParameter* bias_filler_; + bool bias_term_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static ScaleParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class SigmoidParameter : public ::google::protobuf::MessageLite { + public: + SigmoidParameter(); + virtual ~SigmoidParameter(); + + SigmoidParameter(const SigmoidParameter& from); + + inline SigmoidParameter& operator=(const SigmoidParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const SigmoidParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const SigmoidParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(SigmoidParameter* other); + + // implements Message ---------------------------------------------- + + SigmoidParameter* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const SigmoidParameter& from); + void MergeFrom(const SigmoidParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() 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; + + // accessors ------------------------------------------------------- + + // optional .ditcaffe.SigmoidParameter.Engine engine = 1 [default = DEFAULT]; + inline bool has_engine() const; + inline void clear_engine(); + static const int kEngineFieldNumber = 1; + inline ::ditcaffe::SigmoidParameter_Engine engine() const; + inline void set_engine(::ditcaffe::SigmoidParameter_Engine value); + + // @@protoc_insertion_point(class_scope:ditcaffe.SigmoidParameter) + private: + inline void set_has_engine(); + inline void clear_has_engine(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + int engine_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static SigmoidParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class SliceParameter : public ::google::protobuf::MessageLite { + public: + SliceParameter(); + virtual ~SliceParameter(); + + SliceParameter(const SliceParameter& from); + + inline SliceParameter& operator=(const SliceParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const SliceParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const SliceParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(SliceParameter* other); + + // implements Message ---------------------------------------------- + + SliceParameter* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const SliceParameter& from); + void MergeFrom(const SliceParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional int32 axis = 3 [default = 1]; + inline bool has_axis() const; + inline void clear_axis(); + static const int kAxisFieldNumber = 3; + inline ::google::protobuf::int32 axis() const; + inline void set_axis(::google::protobuf::int32 value); + + // repeated uint32 slice_point = 2; + inline int slice_point_size() const; + inline void clear_slice_point(); + static const int kSlicePointFieldNumber = 2; + inline ::google::protobuf::uint32 slice_point(int index) const; + inline void set_slice_point(int index, ::google::protobuf::uint32 value); + inline void add_slice_point(::google::protobuf::uint32 value); + inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& + slice_point() const; + inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* + mutable_slice_point(); + + // optional uint32 slice_dim = 1 [default = 1]; + inline bool has_slice_dim() const; + inline void clear_slice_dim(); + static const int kSliceDimFieldNumber = 1; + inline ::google::protobuf::uint32 slice_dim() const; + inline void set_slice_dim(::google::protobuf::uint32 value); + + // @@protoc_insertion_point(class_scope:ditcaffe.SliceParameter) + private: + inline void set_has_axis(); + inline void clear_has_axis(); + inline void set_has_slice_dim(); + inline void clear_has_slice_dim(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > slice_point_; + ::google::protobuf::int32 axis_; + ::google::protobuf::uint32 slice_dim_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static SliceParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class SoftmaxParameter : public ::google::protobuf::MessageLite { + public: + SoftmaxParameter(); + virtual ~SoftmaxParameter(); + + SoftmaxParameter(const SoftmaxParameter& from); + + inline SoftmaxParameter& operator=(const SoftmaxParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const SoftmaxParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const SoftmaxParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(SoftmaxParameter* other); + + // implements Message ---------------------------------------------- + + SoftmaxParameter* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const SoftmaxParameter& from); + void MergeFrom(const SoftmaxParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() 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; + + // accessors ------------------------------------------------------- + + // optional .ditcaffe.SoftmaxParameter.Engine engine = 1 [default = DEFAULT]; + inline bool has_engine() const; + inline void clear_engine(); + static const int kEngineFieldNumber = 1; + inline ::ditcaffe::SoftmaxParameter_Engine engine() const; + inline void set_engine(::ditcaffe::SoftmaxParameter_Engine value); + + // optional int32 axis = 2 [default = 1]; + inline bool has_axis() const; + inline void clear_axis(); + static const int kAxisFieldNumber = 2; + inline ::google::protobuf::int32 axis() const; + inline void set_axis(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:ditcaffe.SoftmaxParameter) + private: + inline void set_has_engine(); + inline void clear_has_engine(); + inline void set_has_axis(); + inline void clear_has_axis(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + int engine_; + ::google::protobuf::int32 axis_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static SoftmaxParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class TanHParameter : public ::google::protobuf::MessageLite { + public: + TanHParameter(); + virtual ~TanHParameter(); + + TanHParameter(const TanHParameter& from); + + inline TanHParameter& operator=(const TanHParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const TanHParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const TanHParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(TanHParameter* other); + + // implements Message ---------------------------------------------- + + TanHParameter* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const TanHParameter& from); + void MergeFrom(const TanHParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() 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; + + // accessors ------------------------------------------------------- + + // optional .ditcaffe.TanHParameter.Engine engine = 1 [default = DEFAULT]; + inline bool has_engine() const; + inline void clear_engine(); + static const int kEngineFieldNumber = 1; + inline ::ditcaffe::TanHParameter_Engine engine() const; + inline void set_engine(::ditcaffe::TanHParameter_Engine value); + + // @@protoc_insertion_point(class_scope:ditcaffe.TanHParameter) + private: + inline void set_has_engine(); + inline void clear_has_engine(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + int engine_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static TanHParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class TileParameter : public ::google::protobuf::MessageLite { + public: + TileParameter(); + virtual ~TileParameter(); + + TileParameter(const TileParameter& from); + + inline TileParameter& operator=(const TileParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const TileParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const TileParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(TileParameter* other); + + // implements Message ---------------------------------------------- + + TileParameter* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const TileParameter& from); + void MergeFrom(const TileParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional int32 axis = 1 [default = 1]; + inline bool has_axis() const; + inline void clear_axis(); + static const int kAxisFieldNumber = 1; + inline ::google::protobuf::int32 axis() const; + inline void set_axis(::google::protobuf::int32 value); + + // optional int32 tiles = 2; + inline bool has_tiles() const; + inline void clear_tiles(); + static const int kTilesFieldNumber = 2; + inline ::google::protobuf::int32 tiles() const; + inline void set_tiles(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:ditcaffe.TileParameter) + private: + inline void set_has_axis(); + inline void clear_has_axis(); + inline void set_has_tiles(); + inline void clear_has_tiles(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::int32 axis_; + ::google::protobuf::int32 tiles_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static TileParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class ThresholdParameter : public ::google::protobuf::MessageLite { + public: + ThresholdParameter(); + virtual ~ThresholdParameter(); + + ThresholdParameter(const ThresholdParameter& from); + + inline ThresholdParameter& operator=(const ThresholdParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ThresholdParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ThresholdParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ThresholdParameter* other); + + // implements Message ---------------------------------------------- + + ThresholdParameter* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ThresholdParameter& from); + void MergeFrom(const ThresholdParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional float threshold = 1 [default = 0]; + inline bool has_threshold() const; + inline void clear_threshold(); + static const int kThresholdFieldNumber = 1; + inline float threshold() const; + inline void set_threshold(float value); + + // @@protoc_insertion_point(class_scope:ditcaffe.ThresholdParameter) + private: + inline void set_has_threshold(); + inline void clear_has_threshold(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + float threshold_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static ThresholdParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class WindowDataParameter : public ::google::protobuf::MessageLite { + public: + WindowDataParameter(); + virtual ~WindowDataParameter(); + + WindowDataParameter(const WindowDataParameter& from); + + inline WindowDataParameter& operator=(const WindowDataParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const WindowDataParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const WindowDataParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(WindowDataParameter* other); + + // implements Message ---------------------------------------------- + + WindowDataParameter* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const WindowDataParameter& from); + void MergeFrom(const WindowDataParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional string source = 1; + inline bool has_source() const; + inline void clear_source(); + static const int kSourceFieldNumber = 1; + inline const ::std::string& source() const; + inline void set_source(const ::std::string& value); + inline void set_source(const char* value); + inline void set_source(const char* value, size_t size); + inline ::std::string* mutable_source(); + inline ::std::string* release_source(); + inline void set_allocated_source(::std::string* source); + + // optional float scale = 2 [default = 1]; + inline bool has_scale() const; + inline void clear_scale(); + static const int kScaleFieldNumber = 2; + inline float scale() const; + inline void set_scale(float value); + + // optional string mean_file = 3; + inline bool has_mean_file() const; + inline void clear_mean_file(); + static const int kMeanFileFieldNumber = 3; + inline const ::std::string& mean_file() const; + inline void set_mean_file(const ::std::string& value); + inline void set_mean_file(const char* value); + inline void set_mean_file(const char* value, size_t size); + inline ::std::string* mutable_mean_file(); + inline ::std::string* release_mean_file(); + inline void set_allocated_mean_file(::std::string* mean_file); + + // optional uint32 batch_size = 4; + inline bool has_batch_size() const; + inline void clear_batch_size(); + static const int kBatchSizeFieldNumber = 4; + inline ::google::protobuf::uint32 batch_size() const; + inline void set_batch_size(::google::protobuf::uint32 value); + + // optional uint32 crop_size = 5 [default = 0]; + inline bool has_crop_size() const; + inline void clear_crop_size(); + static const int kCropSizeFieldNumber = 5; + inline ::google::protobuf::uint32 crop_size() const; + inline void set_crop_size(::google::protobuf::uint32 value); + + // optional bool mirror = 6 [default = false]; + inline bool has_mirror() const; + inline void clear_mirror(); + static const int kMirrorFieldNumber = 6; + inline bool mirror() const; + inline void set_mirror(bool value); + + // optional float fg_threshold = 7 [default = 0.5]; + inline bool has_fg_threshold() const; + inline void clear_fg_threshold(); + static const int kFgThresholdFieldNumber = 7; + inline float fg_threshold() const; + inline void set_fg_threshold(float value); + + // optional float bg_threshold = 8 [default = 0.5]; + inline bool has_bg_threshold() const; + inline void clear_bg_threshold(); + static const int kBgThresholdFieldNumber = 8; + inline float bg_threshold() const; + inline void set_bg_threshold(float value); + + // optional float fg_fraction = 9 [default = 0.25]; + inline bool has_fg_fraction() const; + inline void clear_fg_fraction(); + static const int kFgFractionFieldNumber = 9; + inline float fg_fraction() const; + inline void set_fg_fraction(float value); + + // optional uint32 context_pad = 10 [default = 0]; + inline bool has_context_pad() const; + inline void clear_context_pad(); + static const int kContextPadFieldNumber = 10; + inline ::google::protobuf::uint32 context_pad() const; + inline void set_context_pad(::google::protobuf::uint32 value); + + // optional string crop_mode = 11 [default = "warp"]; + inline bool has_crop_mode() const; + inline void clear_crop_mode(); + static const int kCropModeFieldNumber = 11; + inline const ::std::string& crop_mode() const; + inline void set_crop_mode(const ::std::string& value); + inline void set_crop_mode(const char* value); + inline void set_crop_mode(const char* value, size_t size); + inline ::std::string* mutable_crop_mode(); + inline ::std::string* release_crop_mode(); + inline void set_allocated_crop_mode(::std::string* crop_mode); + + // optional bool cache_images = 12 [default = false]; + inline bool has_cache_images() const; + inline void clear_cache_images(); + static const int kCacheImagesFieldNumber = 12; + inline bool cache_images() const; + inline void set_cache_images(bool value); + + // optional string root_folder = 13 [default = ""]; + inline bool has_root_folder() const; + inline void clear_root_folder(); + static const int kRootFolderFieldNumber = 13; + inline const ::std::string& root_folder() const; + inline void set_root_folder(const ::std::string& value); + inline void set_root_folder(const char* value); + inline void set_root_folder(const char* value, size_t size); + inline ::std::string* mutable_root_folder(); + inline ::std::string* release_root_folder(); + inline void set_allocated_root_folder(::std::string* root_folder); + + // @@protoc_insertion_point(class_scope:ditcaffe.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(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::std::string* source_; + ::std::string* mean_file_; + float scale_; + ::google::protobuf::uint32 batch_size_; + ::google::protobuf::uint32 crop_size_; + float fg_threshold_; + float bg_threshold_; + float fg_fraction_; + bool mirror_; + bool cache_images_; + ::google::protobuf::uint32 context_pad_; + static ::std::string* _default_crop_mode_; + ::std::string* crop_mode_; + ::std::string* root_folder_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static WindowDataParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class SPPParameter : public ::google::protobuf::MessageLite { + public: + SPPParameter(); + virtual ~SPPParameter(); + + SPPParameter(const SPPParameter& from); + + inline SPPParameter& operator=(const SPPParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const SPPParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const SPPParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(SPPParameter* other); + + // implements Message ---------------------------------------------- + + SPPParameter* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const SPPParameter& from); + void MergeFrom(const SPPParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() 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; + + 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; + + // accessors ------------------------------------------------------- + + // optional uint32 pyramid_height = 1; + inline bool has_pyramid_height() const; + inline void clear_pyramid_height(); + static const int kPyramidHeightFieldNumber = 1; + inline ::google::protobuf::uint32 pyramid_height() const; + inline void set_pyramid_height(::google::protobuf::uint32 value); + + // optional .ditcaffe.SPPParameter.PoolMethod pool = 2 [default = MAX]; + inline bool has_pool() const; + inline void clear_pool(); + static const int kPoolFieldNumber = 2; + inline ::ditcaffe::SPPParameter_PoolMethod pool() const; + inline void set_pool(::ditcaffe::SPPParameter_PoolMethod value); + + // optional .ditcaffe.SPPParameter.Engine engine = 6 [default = DEFAULT]; + inline bool has_engine() const; + inline void clear_engine(); + static const int kEngineFieldNumber = 6; + inline ::ditcaffe::SPPParameter_Engine engine() const; + inline void set_engine(::ditcaffe::SPPParameter_Engine value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::uint32 pyramid_height_; + int pool_; + int engine_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static SPPParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class V1LayerParameter : public ::google::protobuf::MessageLite { + public: + V1LayerParameter(); + virtual ~V1LayerParameter(); + + V1LayerParameter(const V1LayerParameter& from); + + inline V1LayerParameter& operator=(const V1LayerParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const V1LayerParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const V1LayerParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(V1LayerParameter* other); + + // implements Message ---------------------------------------------- + + V1LayerParameter* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const V1LayerParameter& from); + void MergeFrom(const V1LayerParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() 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; + + 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; + + // accessors ------------------------------------------------------- + + // repeated string bottom = 2; + inline int bottom_size() const; + inline void clear_bottom(); + static const int kBottomFieldNumber = 2; + inline const ::std::string& bottom(int index) const; + inline ::std::string* mutable_bottom(int index); + inline void set_bottom(int index, const ::std::string& value); + inline void set_bottom(int index, const char* value); + inline void set_bottom(int index, const char* value, size_t size); + inline ::std::string* add_bottom(); + inline void add_bottom(const ::std::string& value); + inline void add_bottom(const char* value); + inline void add_bottom(const char* value, size_t size); + inline const ::google::protobuf::RepeatedPtrField< ::std::string>& bottom() const; + inline ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_bottom(); + + // repeated string top = 3; + inline int top_size() const; + inline void clear_top(); + static const int kTopFieldNumber = 3; + inline const ::std::string& top(int index) const; + inline ::std::string* mutable_top(int index); + inline void set_top(int index, const ::std::string& value); + inline void set_top(int index, const char* value); + inline void set_top(int index, const char* value, size_t size); + inline ::std::string* add_top(); + inline void add_top(const ::std::string& value); + inline void add_top(const char* value); + inline void add_top(const char* value, size_t size); + inline const ::google::protobuf::RepeatedPtrField< ::std::string>& top() const; + inline ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_top(); + + // optional string name = 4; + inline bool has_name() const; + inline void clear_name(); + static const int kNameFieldNumber = 4; + inline const ::std::string& name() const; + inline void set_name(const ::std::string& value); + inline void set_name(const char* value); + inline void set_name(const char* value, size_t size); + inline ::std::string* mutable_name(); + inline ::std::string* release_name(); + inline void set_allocated_name(::std::string* name); + + // repeated .ditcaffe.NetStateRule include = 32; + inline int include_size() const; + inline void clear_include(); + static const int kIncludeFieldNumber = 32; + inline const ::ditcaffe::NetStateRule& include(int index) const; + inline ::ditcaffe::NetStateRule* mutable_include(int index); + inline ::ditcaffe::NetStateRule* add_include(); + inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >& + include() const; + inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >* + mutable_include(); + + // repeated .ditcaffe.NetStateRule exclude = 33; + inline int exclude_size() const; + inline void clear_exclude(); + static const int kExcludeFieldNumber = 33; + inline const ::ditcaffe::NetStateRule& exclude(int index) const; + inline ::ditcaffe::NetStateRule* mutable_exclude(int index); + inline ::ditcaffe::NetStateRule* add_exclude(); + inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >& + exclude() const; + inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >* + mutable_exclude(); + + // optional .ditcaffe.V1LayerParameter.LayerType type = 5; + inline bool has_type() const; + inline void clear_type(); + static const int kTypeFieldNumber = 5; + inline ::ditcaffe::V1LayerParameter_LayerType type() const; + inline void set_type(::ditcaffe::V1LayerParameter_LayerType value); + + // repeated .ditcaffe.BlobProto blobs = 6; + inline int blobs_size() const; + inline void clear_blobs(); + static const int kBlobsFieldNumber = 6; + inline const ::ditcaffe::BlobProto& blobs(int index) const; + inline ::ditcaffe::BlobProto* mutable_blobs(int index); + inline ::ditcaffe::BlobProto* add_blobs(); + inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >& + blobs() const; + inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >* + mutable_blobs(); + + // repeated string param = 1001; + inline int param_size() const; + inline void clear_param(); + static const int kParamFieldNumber = 1001; + inline const ::std::string& param(int index) const; + inline ::std::string* mutable_param(int index); + inline void set_param(int index, const ::std::string& value); + inline void set_param(int index, const char* value); + inline void set_param(int index, const char* value, size_t size); + inline ::std::string* add_param(); + inline void add_param(const ::std::string& value); + inline void add_param(const char* value); + inline void add_param(const char* value, size_t size); + inline const ::google::protobuf::RepeatedPtrField< ::std::string>& param() const; + inline ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_param(); + + // repeated .ditcaffe.V1LayerParameter.DimCheckMode blob_share_mode = 1002; + inline int blob_share_mode_size() const; + inline void clear_blob_share_mode(); + static const int kBlobShareModeFieldNumber = 1002; + inline ::ditcaffe::V1LayerParameter_DimCheckMode blob_share_mode(int index) const; + inline void set_blob_share_mode(int index, ::ditcaffe::V1LayerParameter_DimCheckMode value); + inline void add_blob_share_mode(::ditcaffe::V1LayerParameter_DimCheckMode value); + inline const ::google::protobuf::RepeatedField& blob_share_mode() const; + inline ::google::protobuf::RepeatedField* mutable_blob_share_mode(); + + // repeated float blobs_lr = 7; + inline int blobs_lr_size() const; + inline void clear_blobs_lr(); + static const int kBlobsLrFieldNumber = 7; + inline float blobs_lr(int index) const; + inline void set_blobs_lr(int index, float value); + inline void add_blobs_lr(float value); + inline const ::google::protobuf::RepeatedField< float >& + blobs_lr() const; + inline ::google::protobuf::RepeatedField< float >* + mutable_blobs_lr(); + + // repeated float weight_decay = 8; + inline int weight_decay_size() const; + inline void clear_weight_decay(); + static const int kWeightDecayFieldNumber = 8; + inline float weight_decay(int index) const; + inline void set_weight_decay(int index, float value); + inline void add_weight_decay(float value); + inline const ::google::protobuf::RepeatedField< float >& + weight_decay() const; + inline ::google::protobuf::RepeatedField< float >* + mutable_weight_decay(); + + // repeated float loss_weight = 35; + inline int loss_weight_size() const; + inline void clear_loss_weight(); + static const int kLossWeightFieldNumber = 35; + inline float loss_weight(int index) const; + inline void set_loss_weight(int index, float value); + inline void add_loss_weight(float value); + inline const ::google::protobuf::RepeatedField< float >& + loss_weight() const; + inline ::google::protobuf::RepeatedField< float >* + mutable_loss_weight(); + + // optional .ditcaffe.AccuracyParameter accuracy_param = 27; + inline bool has_accuracy_param() const; + inline void clear_accuracy_param(); + static const int kAccuracyParamFieldNumber = 27; + inline const ::ditcaffe::AccuracyParameter& accuracy_param() const; + inline ::ditcaffe::AccuracyParameter* mutable_accuracy_param(); + inline ::ditcaffe::AccuracyParameter* release_accuracy_param(); + inline void set_allocated_accuracy_param(::ditcaffe::AccuracyParameter* accuracy_param); + + // optional .ditcaffe.ArgMaxParameter argmax_param = 23; + inline bool has_argmax_param() const; + inline void clear_argmax_param(); + static const int kArgmaxParamFieldNumber = 23; + inline const ::ditcaffe::ArgMaxParameter& argmax_param() const; + inline ::ditcaffe::ArgMaxParameter* mutable_argmax_param(); + inline ::ditcaffe::ArgMaxParameter* release_argmax_param(); + inline void set_allocated_argmax_param(::ditcaffe::ArgMaxParameter* argmax_param); + + // optional .ditcaffe.ConcatParameter concat_param = 9; + inline bool has_concat_param() const; + inline void clear_concat_param(); + static const int kConcatParamFieldNumber = 9; + inline const ::ditcaffe::ConcatParameter& concat_param() const; + inline ::ditcaffe::ConcatParameter* mutable_concat_param(); + inline ::ditcaffe::ConcatParameter* release_concat_param(); + inline void set_allocated_concat_param(::ditcaffe::ConcatParameter* concat_param); + + // optional .ditcaffe.ContrastiveLossParameter contrastive_loss_param = 40; + inline bool has_contrastive_loss_param() const; + inline void clear_contrastive_loss_param(); + static const int kContrastiveLossParamFieldNumber = 40; + inline const ::ditcaffe::ContrastiveLossParameter& contrastive_loss_param() const; + inline ::ditcaffe::ContrastiveLossParameter* mutable_contrastive_loss_param(); + inline ::ditcaffe::ContrastiveLossParameter* release_contrastive_loss_param(); + inline void set_allocated_contrastive_loss_param(::ditcaffe::ContrastiveLossParameter* contrastive_loss_param); + + // optional .ditcaffe.ConvolutionParameter convolution_param = 10; + inline bool has_convolution_param() const; + inline void clear_convolution_param(); + static const int kConvolutionParamFieldNumber = 10; + inline const ::ditcaffe::ConvolutionParameter& convolution_param() const; + inline ::ditcaffe::ConvolutionParameter* mutable_convolution_param(); + inline ::ditcaffe::ConvolutionParameter* release_convolution_param(); + inline void set_allocated_convolution_param(::ditcaffe::ConvolutionParameter* convolution_param); + + // optional .ditcaffe.DataParameter data_param = 11; + inline bool has_data_param() const; + inline void clear_data_param(); + static const int kDataParamFieldNumber = 11; + inline const ::ditcaffe::DataParameter& data_param() const; + inline ::ditcaffe::DataParameter* mutable_data_param(); + inline ::ditcaffe::DataParameter* release_data_param(); + inline void set_allocated_data_param(::ditcaffe::DataParameter* data_param); + + // optional .ditcaffe.DropoutParameter dropout_param = 12; + inline bool has_dropout_param() const; + inline void clear_dropout_param(); + static const int kDropoutParamFieldNumber = 12; + inline const ::ditcaffe::DropoutParameter& dropout_param() const; + inline ::ditcaffe::DropoutParameter* mutable_dropout_param(); + inline ::ditcaffe::DropoutParameter* release_dropout_param(); + inline void set_allocated_dropout_param(::ditcaffe::DropoutParameter* dropout_param); + + // optional .ditcaffe.DummyDataParameter dummy_data_param = 26; + inline bool has_dummy_data_param() const; + inline void clear_dummy_data_param(); + static const int kDummyDataParamFieldNumber = 26; + inline const ::ditcaffe::DummyDataParameter& dummy_data_param() const; + inline ::ditcaffe::DummyDataParameter* mutable_dummy_data_param(); + inline ::ditcaffe::DummyDataParameter* release_dummy_data_param(); + inline void set_allocated_dummy_data_param(::ditcaffe::DummyDataParameter* dummy_data_param); + + // optional .ditcaffe.EltwiseParameter eltwise_param = 24; + inline bool has_eltwise_param() const; + inline void clear_eltwise_param(); + static const int kEltwiseParamFieldNumber = 24; + inline const ::ditcaffe::EltwiseParameter& eltwise_param() const; + inline ::ditcaffe::EltwiseParameter* mutable_eltwise_param(); + inline ::ditcaffe::EltwiseParameter* release_eltwise_param(); + inline void set_allocated_eltwise_param(::ditcaffe::EltwiseParameter* eltwise_param); + + // optional .ditcaffe.ExpParameter exp_param = 41; + inline bool has_exp_param() const; + inline void clear_exp_param(); + static const int kExpParamFieldNumber = 41; + inline const ::ditcaffe::ExpParameter& exp_param() const; + inline ::ditcaffe::ExpParameter* mutable_exp_param(); + inline ::ditcaffe::ExpParameter* release_exp_param(); + inline void set_allocated_exp_param(::ditcaffe::ExpParameter* exp_param); + + // optional .ditcaffe.HDF5DataParameter hdf5_data_param = 13; + inline bool has_hdf5_data_param() const; + inline void clear_hdf5_data_param(); + static const int kHdf5DataParamFieldNumber = 13; + inline const ::ditcaffe::HDF5DataParameter& hdf5_data_param() const; + inline ::ditcaffe::HDF5DataParameter* mutable_hdf5_data_param(); + inline ::ditcaffe::HDF5DataParameter* release_hdf5_data_param(); + inline void set_allocated_hdf5_data_param(::ditcaffe::HDF5DataParameter* hdf5_data_param); + + // optional .ditcaffe.HDF5OutputParameter hdf5_output_param = 14; + inline bool has_hdf5_output_param() const; + inline void clear_hdf5_output_param(); + static const int kHdf5OutputParamFieldNumber = 14; + inline const ::ditcaffe::HDF5OutputParameter& hdf5_output_param() const; + inline ::ditcaffe::HDF5OutputParameter* mutable_hdf5_output_param(); + inline ::ditcaffe::HDF5OutputParameter* release_hdf5_output_param(); + inline void set_allocated_hdf5_output_param(::ditcaffe::HDF5OutputParameter* hdf5_output_param); + + // optional .ditcaffe.HingeLossParameter hinge_loss_param = 29; + inline bool has_hinge_loss_param() const; + inline void clear_hinge_loss_param(); + static const int kHingeLossParamFieldNumber = 29; + inline const ::ditcaffe::HingeLossParameter& hinge_loss_param() const; + inline ::ditcaffe::HingeLossParameter* mutable_hinge_loss_param(); + inline ::ditcaffe::HingeLossParameter* release_hinge_loss_param(); + inline void set_allocated_hinge_loss_param(::ditcaffe::HingeLossParameter* hinge_loss_param); + + // optional .ditcaffe.ImageDataParameter image_data_param = 15; + inline bool has_image_data_param() const; + inline void clear_image_data_param(); + static const int kImageDataParamFieldNumber = 15; + inline const ::ditcaffe::ImageDataParameter& image_data_param() const; + inline ::ditcaffe::ImageDataParameter* mutable_image_data_param(); + inline ::ditcaffe::ImageDataParameter* release_image_data_param(); + inline void set_allocated_image_data_param(::ditcaffe::ImageDataParameter* image_data_param); + + // optional .ditcaffe.InfogainLossParameter infogain_loss_param = 16; + inline bool has_infogain_loss_param() const; + inline void clear_infogain_loss_param(); + static const int kInfogainLossParamFieldNumber = 16; + inline const ::ditcaffe::InfogainLossParameter& infogain_loss_param() const; + inline ::ditcaffe::InfogainLossParameter* mutable_infogain_loss_param(); + inline ::ditcaffe::InfogainLossParameter* release_infogain_loss_param(); + inline void set_allocated_infogain_loss_param(::ditcaffe::InfogainLossParameter* infogain_loss_param); + + // optional .ditcaffe.InnerProductParameter inner_product_param = 17; + inline bool has_inner_product_param() const; + inline void clear_inner_product_param(); + static const int kInnerProductParamFieldNumber = 17; + inline const ::ditcaffe::InnerProductParameter& inner_product_param() const; + inline ::ditcaffe::InnerProductParameter* mutable_inner_product_param(); + inline ::ditcaffe::InnerProductParameter* release_inner_product_param(); + inline void set_allocated_inner_product_param(::ditcaffe::InnerProductParameter* inner_product_param); + + // optional .ditcaffe.LRNParameter lrn_param = 18; + inline bool has_lrn_param() const; + inline void clear_lrn_param(); + static const int kLrnParamFieldNumber = 18; + inline const ::ditcaffe::LRNParameter& lrn_param() const; + inline ::ditcaffe::LRNParameter* mutable_lrn_param(); + inline ::ditcaffe::LRNParameter* release_lrn_param(); + inline void set_allocated_lrn_param(::ditcaffe::LRNParameter* lrn_param); + + // optional .ditcaffe.MemoryDataParameter memory_data_param = 22; + inline bool has_memory_data_param() const; + inline void clear_memory_data_param(); + static const int kMemoryDataParamFieldNumber = 22; + inline const ::ditcaffe::MemoryDataParameter& memory_data_param() const; + inline ::ditcaffe::MemoryDataParameter* mutable_memory_data_param(); + inline ::ditcaffe::MemoryDataParameter* release_memory_data_param(); + inline void set_allocated_memory_data_param(::ditcaffe::MemoryDataParameter* memory_data_param); + + // optional .ditcaffe.MVNParameter mvn_param = 34; + inline bool has_mvn_param() const; + inline void clear_mvn_param(); + static const int kMvnParamFieldNumber = 34; + inline const ::ditcaffe::MVNParameter& mvn_param() const; + inline ::ditcaffe::MVNParameter* mutable_mvn_param(); + inline ::ditcaffe::MVNParameter* release_mvn_param(); + inline void set_allocated_mvn_param(::ditcaffe::MVNParameter* mvn_param); + + // optional .ditcaffe.PoolingParameter pooling_param = 19; + inline bool has_pooling_param() const; + inline void clear_pooling_param(); + static const int kPoolingParamFieldNumber = 19; + inline const ::ditcaffe::PoolingParameter& pooling_param() const; + inline ::ditcaffe::PoolingParameter* mutable_pooling_param(); + inline ::ditcaffe::PoolingParameter* release_pooling_param(); + inline void set_allocated_pooling_param(::ditcaffe::PoolingParameter* pooling_param); + + // optional .ditcaffe.PowerParameter power_param = 21; + inline bool has_power_param() const; + inline void clear_power_param(); + static const int kPowerParamFieldNumber = 21; + inline const ::ditcaffe::PowerParameter& power_param() const; + inline ::ditcaffe::PowerParameter* mutable_power_param(); + inline ::ditcaffe::PowerParameter* release_power_param(); + inline void set_allocated_power_param(::ditcaffe::PowerParameter* power_param); + + // optional .ditcaffe.ReLUParameter relu_param = 30; + inline bool has_relu_param() const; + inline void clear_relu_param(); + static const int kReluParamFieldNumber = 30; + inline const ::ditcaffe::ReLUParameter& relu_param() const; + inline ::ditcaffe::ReLUParameter* mutable_relu_param(); + inline ::ditcaffe::ReLUParameter* release_relu_param(); + inline void set_allocated_relu_param(::ditcaffe::ReLUParameter* relu_param); + + // optional .ditcaffe.SigmoidParameter sigmoid_param = 38; + inline bool has_sigmoid_param() const; + inline void clear_sigmoid_param(); + static const int kSigmoidParamFieldNumber = 38; + inline const ::ditcaffe::SigmoidParameter& sigmoid_param() const; + inline ::ditcaffe::SigmoidParameter* mutable_sigmoid_param(); + inline ::ditcaffe::SigmoidParameter* release_sigmoid_param(); + inline void set_allocated_sigmoid_param(::ditcaffe::SigmoidParameter* sigmoid_param); + + // optional .ditcaffe.SoftmaxParameter softmax_param = 39; + inline bool has_softmax_param() const; + inline void clear_softmax_param(); + static const int kSoftmaxParamFieldNumber = 39; + inline const ::ditcaffe::SoftmaxParameter& softmax_param() const; + inline ::ditcaffe::SoftmaxParameter* mutable_softmax_param(); + inline ::ditcaffe::SoftmaxParameter* release_softmax_param(); + inline void set_allocated_softmax_param(::ditcaffe::SoftmaxParameter* softmax_param); + + // optional .ditcaffe.SliceParameter slice_param = 31; + inline bool has_slice_param() const; + inline void clear_slice_param(); + static const int kSliceParamFieldNumber = 31; + inline const ::ditcaffe::SliceParameter& slice_param() const; + inline ::ditcaffe::SliceParameter* mutable_slice_param(); + inline ::ditcaffe::SliceParameter* release_slice_param(); + inline void set_allocated_slice_param(::ditcaffe::SliceParameter* slice_param); + + // optional .ditcaffe.TanHParameter tanh_param = 37; + inline bool has_tanh_param() const; + inline void clear_tanh_param(); + static const int kTanhParamFieldNumber = 37; + inline const ::ditcaffe::TanHParameter& tanh_param() const; + inline ::ditcaffe::TanHParameter* mutable_tanh_param(); + inline ::ditcaffe::TanHParameter* release_tanh_param(); + inline void set_allocated_tanh_param(::ditcaffe::TanHParameter* tanh_param); + + // optional .ditcaffe.ThresholdParameter threshold_param = 25; + inline bool has_threshold_param() const; + inline void clear_threshold_param(); + static const int kThresholdParamFieldNumber = 25; + inline const ::ditcaffe::ThresholdParameter& threshold_param() const; + inline ::ditcaffe::ThresholdParameter* mutable_threshold_param(); + inline ::ditcaffe::ThresholdParameter* release_threshold_param(); + inline void set_allocated_threshold_param(::ditcaffe::ThresholdParameter* threshold_param); + + // optional .ditcaffe.WindowDataParameter window_data_param = 20; + inline bool has_window_data_param() const; + inline void clear_window_data_param(); + static const int kWindowDataParamFieldNumber = 20; + inline const ::ditcaffe::WindowDataParameter& window_data_param() const; + inline ::ditcaffe::WindowDataParameter* mutable_window_data_param(); + inline ::ditcaffe::WindowDataParameter* release_window_data_param(); + inline void set_allocated_window_data_param(::ditcaffe::WindowDataParameter* window_data_param); + + // optional .ditcaffe.TransformationParameter transform_param = 36; + inline bool has_transform_param() const; + inline void clear_transform_param(); + static const int kTransformParamFieldNumber = 36; + inline const ::ditcaffe::TransformationParameter& transform_param() const; + inline ::ditcaffe::TransformationParameter* mutable_transform_param(); + inline ::ditcaffe::TransformationParameter* release_transform_param(); + inline void set_allocated_transform_param(::ditcaffe::TransformationParameter* transform_param); + + // optional .ditcaffe.LossParameter loss_param = 42; + inline bool has_loss_param() const; + inline void clear_loss_param(); + static const int kLossParamFieldNumber = 42; + inline const ::ditcaffe::LossParameter& loss_param() const; + inline ::ditcaffe::LossParameter* mutable_loss_param(); + inline ::ditcaffe::LossParameter* release_loss_param(); + inline void set_allocated_loss_param(::ditcaffe::LossParameter* loss_param); + + // optional .ditcaffe.V0LayerParameter layer = 1; + inline bool has_layer() const; + inline void clear_layer(); + static const int kLayerFieldNumber = 1; + inline const ::ditcaffe::V0LayerParameter& layer() const; + inline ::ditcaffe::V0LayerParameter* mutable_layer(); + inline ::ditcaffe::V0LayerParameter* release_layer(); + inline void set_allocated_layer(::ditcaffe::V0LayerParameter* layer); + + // @@protoc_insertion_point(class_scope:ditcaffe.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(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[2]; + ::google::protobuf::RepeatedPtrField< ::std::string> bottom_; + ::google::protobuf::RepeatedPtrField< ::std::string> top_; + ::std::string* name_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule > include_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule > exclude_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::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_; + ::ditcaffe::AccuracyParameter* accuracy_param_; + ::ditcaffe::ArgMaxParameter* argmax_param_; + ::ditcaffe::ConcatParameter* concat_param_; + ::ditcaffe::ContrastiveLossParameter* contrastive_loss_param_; + ::ditcaffe::ConvolutionParameter* convolution_param_; + ::ditcaffe::DataParameter* data_param_; + ::ditcaffe::DropoutParameter* dropout_param_; + ::ditcaffe::DummyDataParameter* dummy_data_param_; + ::ditcaffe::EltwiseParameter* eltwise_param_; + ::ditcaffe::ExpParameter* exp_param_; + ::ditcaffe::HDF5DataParameter* hdf5_data_param_; + ::ditcaffe::HDF5OutputParameter* hdf5_output_param_; + ::ditcaffe::HingeLossParameter* hinge_loss_param_; + ::ditcaffe::ImageDataParameter* image_data_param_; + ::ditcaffe::InfogainLossParameter* infogain_loss_param_; + ::ditcaffe::InnerProductParameter* inner_product_param_; + ::ditcaffe::LRNParameter* lrn_param_; + ::ditcaffe::MemoryDataParameter* memory_data_param_; + ::ditcaffe::MVNParameter* mvn_param_; + ::ditcaffe::PoolingParameter* pooling_param_; + ::ditcaffe::PowerParameter* power_param_; + ::ditcaffe::ReLUParameter* relu_param_; + ::ditcaffe::SigmoidParameter* sigmoid_param_; + ::ditcaffe::SoftmaxParameter* softmax_param_; + ::ditcaffe::SliceParameter* slice_param_; + ::ditcaffe::TanHParameter* tanh_param_; + ::ditcaffe::ThresholdParameter* threshold_param_; + ::ditcaffe::WindowDataParameter* window_data_param_; + ::ditcaffe::TransformationParameter* transform_param_; + ::ditcaffe::LossParameter* loss_param_; + ::ditcaffe::V0LayerParameter* layer_; + int type_; + mutable int _cached_size_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static V1LayerParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class V0LayerParameter : public ::google::protobuf::MessageLite { + public: + V0LayerParameter(); + virtual ~V0LayerParameter(); + + V0LayerParameter(const V0LayerParameter& from); + + inline V0LayerParameter& operator=(const V0LayerParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const V0LayerParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const V0LayerParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(V0LayerParameter* other); + + // implements Message ---------------------------------------------- + + V0LayerParameter* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const V0LayerParameter& from); + void MergeFrom(const V0LayerParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() 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; + + // accessors ------------------------------------------------------- + + // optional string name = 1; + inline bool has_name() const; + inline void clear_name(); + static const int kNameFieldNumber = 1; + inline const ::std::string& name() const; + inline void set_name(const ::std::string& value); + inline void set_name(const char* value); + inline void set_name(const char* value, size_t size); + inline ::std::string* mutable_name(); + inline ::std::string* release_name(); + inline void set_allocated_name(::std::string* name); + + // optional string type = 2; + inline bool has_type() const; + inline void clear_type(); + static const int kTypeFieldNumber = 2; + inline const ::std::string& type() const; + inline void set_type(const ::std::string& value); + inline void set_type(const char* value); + inline void set_type(const char* value, size_t size); + inline ::std::string* mutable_type(); + inline ::std::string* release_type(); + inline void set_allocated_type(::std::string* type); + + // optional uint32 num_output = 3; + inline bool has_num_output() const; + inline void clear_num_output(); + static const int kNumOutputFieldNumber = 3; + inline ::google::protobuf::uint32 num_output() const; + inline void set_num_output(::google::protobuf::uint32 value); + + // optional bool biasterm = 4 [default = true]; + inline bool has_biasterm() const; + inline void clear_biasterm(); + static const int kBiastermFieldNumber = 4; + inline bool biasterm() const; + inline void set_biasterm(bool value); + + // optional .ditcaffe.FillerParameter weight_filler = 5; + inline bool has_weight_filler() const; + inline void clear_weight_filler(); + static const int kWeightFillerFieldNumber = 5; + inline const ::ditcaffe::FillerParameter& weight_filler() const; + inline ::ditcaffe::FillerParameter* mutable_weight_filler(); + inline ::ditcaffe::FillerParameter* release_weight_filler(); + inline void set_allocated_weight_filler(::ditcaffe::FillerParameter* weight_filler); + + // optional .ditcaffe.FillerParameter bias_filler = 6; + inline bool has_bias_filler() const; + inline void clear_bias_filler(); + static const int kBiasFillerFieldNumber = 6; + inline const ::ditcaffe::FillerParameter& bias_filler() const; + inline ::ditcaffe::FillerParameter* mutable_bias_filler(); + inline ::ditcaffe::FillerParameter* release_bias_filler(); + inline void set_allocated_bias_filler(::ditcaffe::FillerParameter* bias_filler); + + // optional uint32 pad = 7 [default = 0]; + inline bool has_pad() const; + inline void clear_pad(); + static const int kPadFieldNumber = 7; + inline ::google::protobuf::uint32 pad() const; + inline void set_pad(::google::protobuf::uint32 value); + + // optional uint32 kernelsize = 8; + inline bool has_kernelsize() const; + inline void clear_kernelsize(); + static const int kKernelsizeFieldNumber = 8; + inline ::google::protobuf::uint32 kernelsize() const; + inline void set_kernelsize(::google::protobuf::uint32 value); + + // optional uint32 group = 9 [default = 1]; + inline bool has_group() const; + inline void clear_group(); + static const int kGroupFieldNumber = 9; + inline ::google::protobuf::uint32 group() const; + inline void set_group(::google::protobuf::uint32 value); + + // optional uint32 stride = 10 [default = 1]; + inline bool has_stride() const; + inline void clear_stride(); + static const int kStrideFieldNumber = 10; + inline ::google::protobuf::uint32 stride() const; + inline void set_stride(::google::protobuf::uint32 value); + + // optional .ditcaffe.V0LayerParameter.PoolMethod pool = 11 [default = MAX]; + inline bool has_pool() const; + inline void clear_pool(); + static const int kPoolFieldNumber = 11; + inline ::ditcaffe::V0LayerParameter_PoolMethod pool() const; + inline void set_pool(::ditcaffe::V0LayerParameter_PoolMethod value); + + // optional float dropout_ratio = 12 [default = 0.5]; + inline bool has_dropout_ratio() const; + inline void clear_dropout_ratio(); + static const int kDropoutRatioFieldNumber = 12; + inline float dropout_ratio() const; + inline void set_dropout_ratio(float value); + + // optional uint32 local_size = 13 [default = 5]; + inline bool has_local_size() const; + inline void clear_local_size(); + static const int kLocalSizeFieldNumber = 13; + inline ::google::protobuf::uint32 local_size() const; + inline void set_local_size(::google::protobuf::uint32 value); + + // optional float alpha = 14 [default = 1]; + inline bool has_alpha() const; + inline void clear_alpha(); + static const int kAlphaFieldNumber = 14; + inline float alpha() const; + inline void set_alpha(float value); + + // optional float beta = 15 [default = 0.75]; + inline bool has_beta() const; + inline void clear_beta(); + static const int kBetaFieldNumber = 15; + inline float beta() const; + inline void set_beta(float value); + + // optional float k = 22 [default = 1]; + inline bool has_k() const; + inline void clear_k(); + static const int kKFieldNumber = 22; + inline float k() const; + inline void set_k(float value); + + // optional string source = 16; + inline bool has_source() const; + inline void clear_source(); + static const int kSourceFieldNumber = 16; + inline const ::std::string& source() const; + inline void set_source(const ::std::string& value); + inline void set_source(const char* value); + inline void set_source(const char* value, size_t size); + inline ::std::string* mutable_source(); + inline ::std::string* release_source(); + inline void set_allocated_source(::std::string* source); + + // optional float scale = 17 [default = 1]; + inline bool has_scale() const; + inline void clear_scale(); + static const int kScaleFieldNumber = 17; + inline float scale() const; + inline void set_scale(float value); + + // optional string meanfile = 18; + inline bool has_meanfile() const; + inline void clear_meanfile(); + static const int kMeanfileFieldNumber = 18; + inline const ::std::string& meanfile() const; + inline void set_meanfile(const ::std::string& value); + inline void set_meanfile(const char* value); + inline void set_meanfile(const char* value, size_t size); + inline ::std::string* mutable_meanfile(); + inline ::std::string* release_meanfile(); + inline void set_allocated_meanfile(::std::string* meanfile); + + // optional uint32 batchsize = 19; + inline bool has_batchsize() const; + inline void clear_batchsize(); + static const int kBatchsizeFieldNumber = 19; + inline ::google::protobuf::uint32 batchsize() const; + inline void set_batchsize(::google::protobuf::uint32 value); + + // optional uint32 cropsize = 20 [default = 0]; + inline bool has_cropsize() const; + inline void clear_cropsize(); + static const int kCropsizeFieldNumber = 20; + inline ::google::protobuf::uint32 cropsize() const; + inline void set_cropsize(::google::protobuf::uint32 value); + + // optional bool mirror = 21 [default = false]; + inline bool has_mirror() const; + inline void clear_mirror(); + static const int kMirrorFieldNumber = 21; + inline bool mirror() const; + inline void set_mirror(bool value); + + // repeated .ditcaffe.BlobProto blobs = 50; + inline int blobs_size() const; + inline void clear_blobs(); + static const int kBlobsFieldNumber = 50; + inline const ::ditcaffe::BlobProto& blobs(int index) const; + inline ::ditcaffe::BlobProto* mutable_blobs(int index); + inline ::ditcaffe::BlobProto* add_blobs(); + inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >& + blobs() const; + inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >* + mutable_blobs(); + + // repeated float blobs_lr = 51; + inline int blobs_lr_size() const; + inline void clear_blobs_lr(); + static const int kBlobsLrFieldNumber = 51; + inline float blobs_lr(int index) const; + inline void set_blobs_lr(int index, float value); + inline void add_blobs_lr(float value); + inline const ::google::protobuf::RepeatedField< float >& + blobs_lr() const; + inline ::google::protobuf::RepeatedField< float >* + mutable_blobs_lr(); + + // repeated float weight_decay = 52; + inline int weight_decay_size() const; + inline void clear_weight_decay(); + static const int kWeightDecayFieldNumber = 52; + inline float weight_decay(int index) const; + inline void set_weight_decay(int index, float value); + inline void add_weight_decay(float value); + inline const ::google::protobuf::RepeatedField< float >& + weight_decay() const; + inline ::google::protobuf::RepeatedField< float >* + mutable_weight_decay(); + + // optional uint32 rand_skip = 53 [default = 0]; + inline bool has_rand_skip() const; + inline void clear_rand_skip(); + static const int kRandSkipFieldNumber = 53; + inline ::google::protobuf::uint32 rand_skip() const; + inline void set_rand_skip(::google::protobuf::uint32 value); + + // optional float det_fg_threshold = 54 [default = 0.5]; + inline bool has_det_fg_threshold() const; + inline void clear_det_fg_threshold(); + static const int kDetFgThresholdFieldNumber = 54; + inline float det_fg_threshold() const; + inline void set_det_fg_threshold(float value); + + // optional float det_bg_threshold = 55 [default = 0.5]; + inline bool has_det_bg_threshold() const; + inline void clear_det_bg_threshold(); + static const int kDetBgThresholdFieldNumber = 55; + inline float det_bg_threshold() const; + inline void set_det_bg_threshold(float value); + + // optional float det_fg_fraction = 56 [default = 0.25]; + inline bool has_det_fg_fraction() const; + inline void clear_det_fg_fraction(); + static const int kDetFgFractionFieldNumber = 56; + inline float det_fg_fraction() const; + inline void set_det_fg_fraction(float value); + + // optional uint32 det_context_pad = 58 [default = 0]; + inline bool has_det_context_pad() const; + inline void clear_det_context_pad(); + static const int kDetContextPadFieldNumber = 58; + inline ::google::protobuf::uint32 det_context_pad() const; + inline void set_det_context_pad(::google::protobuf::uint32 value); + + // optional string det_crop_mode = 59 [default = "warp"]; + inline bool has_det_crop_mode() const; + inline void clear_det_crop_mode(); + static const int kDetCropModeFieldNumber = 59; + inline const ::std::string& det_crop_mode() const; + inline void set_det_crop_mode(const ::std::string& value); + inline void set_det_crop_mode(const char* value); + inline void set_det_crop_mode(const char* value, size_t size); + inline ::std::string* mutable_det_crop_mode(); + inline ::std::string* release_det_crop_mode(); + inline void set_allocated_det_crop_mode(::std::string* det_crop_mode); + + // optional int32 new_num = 60 [default = 0]; + inline bool has_new_num() const; + inline void clear_new_num(); + static const int kNewNumFieldNumber = 60; + inline ::google::protobuf::int32 new_num() const; + inline void set_new_num(::google::protobuf::int32 value); + + // optional int32 new_channels = 61 [default = 0]; + inline bool has_new_channels() const; + inline void clear_new_channels(); + static const int kNewChannelsFieldNumber = 61; + inline ::google::protobuf::int32 new_channels() const; + inline void set_new_channels(::google::protobuf::int32 value); + + // optional int32 new_height = 62 [default = 0]; + inline bool has_new_height() const; + inline void clear_new_height(); + static const int kNewHeightFieldNumber = 62; + inline ::google::protobuf::int32 new_height() const; + inline void set_new_height(::google::protobuf::int32 value); + + // optional int32 new_width = 63 [default = 0]; + inline bool has_new_width() const; + inline void clear_new_width(); + static const int kNewWidthFieldNumber = 63; + inline ::google::protobuf::int32 new_width() const; + inline void set_new_width(::google::protobuf::int32 value); + + // optional bool shuffle_images = 64 [default = false]; + inline bool has_shuffle_images() const; + inline void clear_shuffle_images(); + static const int kShuffleImagesFieldNumber = 64; + inline bool shuffle_images() const; + inline void set_shuffle_images(bool value); + + // optional uint32 concat_dim = 65 [default = 1]; + inline bool has_concat_dim() const; + inline void clear_concat_dim(); + static const int kConcatDimFieldNumber = 65; + inline ::google::protobuf::uint32 concat_dim() const; + inline void set_concat_dim(::google::protobuf::uint32 value); + + // optional .ditcaffe.HDF5OutputParameter hdf5_output_param = 1001; + inline bool has_hdf5_output_param() const; + inline void clear_hdf5_output_param(); + static const int kHdf5OutputParamFieldNumber = 1001; + inline const ::ditcaffe::HDF5OutputParameter& hdf5_output_param() const; + inline ::ditcaffe::HDF5OutputParameter* mutable_hdf5_output_param(); + inline ::ditcaffe::HDF5OutputParameter* release_hdf5_output_param(); + inline void set_allocated_hdf5_output_param(::ditcaffe::HDF5OutputParameter* hdf5_output_param); + + // @@protoc_insertion_point(class_scope:ditcaffe.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(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[2]; + ::std::string* name_; + ::std::string* type_; + ::ditcaffe::FillerParameter* weight_filler_; + ::google::protobuf::uint32 num_output_; + ::google::protobuf::uint32 pad_; + ::ditcaffe::FillerParameter* bias_filler_; + ::google::protobuf::uint32 kernelsize_; + ::google::protobuf::uint32 group_; + ::google::protobuf::uint32 stride_; + int pool_; + float dropout_ratio_; + ::google::protobuf::uint32 local_size_; + float alpha_; + float beta_; + ::std::string* source_; + float k_; + float scale_; + ::std::string* meanfile_; + ::google::protobuf::uint32 batchsize_; + bool biasterm_; + bool mirror_; + bool shuffle_images_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto > blobs_; + ::google::protobuf::uint32 cropsize_; + ::google::protobuf::uint32 rand_skip_; + ::google::protobuf::RepeatedField< float > blobs_lr_; + ::google::protobuf::RepeatedField< float > weight_decay_; + float det_fg_threshold_; + float det_bg_threshold_; + float det_fg_fraction_; + ::google::protobuf::uint32 det_context_pad_; + static ::std::string* _default_det_crop_mode_; + ::std::string* det_crop_mode_; + ::google::protobuf::int32 new_num_; + ::google::protobuf::int32 new_channels_; + ::google::protobuf::int32 new_height_; + ::google::protobuf::int32 new_width_; + ::ditcaffe::HDF5OutputParameter* hdf5_output_param_; + ::google::protobuf::uint32 concat_dim_; + mutable int _cached_size_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static V0LayerParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class PReLUParameter : public ::google::protobuf::MessageLite { + public: + PReLUParameter(); + virtual ~PReLUParameter(); + + PReLUParameter(const PReLUParameter& from); + + inline PReLUParameter& operator=(const PReLUParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const PReLUParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const PReLUParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(PReLUParameter* other); + + // implements Message ---------------------------------------------- + + PReLUParameter* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const PReLUParameter& from); + void MergeFrom(const PReLUParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional .ditcaffe.FillerParameter filler = 1; + inline bool has_filler() const; + inline void clear_filler(); + static const int kFillerFieldNumber = 1; + inline const ::ditcaffe::FillerParameter& filler() const; + inline ::ditcaffe::FillerParameter* mutable_filler(); + inline ::ditcaffe::FillerParameter* release_filler(); + inline void set_allocated_filler(::ditcaffe::FillerParameter* filler); + + // optional bool channel_shared = 2 [default = false]; + inline bool has_channel_shared() const; + inline void clear_channel_shared(); + static const int kChannelSharedFieldNumber = 2; + inline bool channel_shared() const; + inline void set_channel_shared(bool value); + + // @@protoc_insertion_point(class_scope:ditcaffe.PReLUParameter) + private: + inline void set_has_filler(); + inline void clear_has_filler(); + inline void set_has_channel_shared(); + inline void clear_has_channel_shared(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::ditcaffe::FillerParameter* filler_; + bool channel_shared_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static PReLUParameter* default_instance_; +}; +// =================================================================== + + +// =================================================================== + +// 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:ditcaffe.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:ditcaffe.BlobShape.dim) +} +inline void BlobShape::add_dim(::google::protobuf::int64 value) { + dim_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.BlobShape.dim) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +BlobShape::dim() const { + // @@protoc_insertion_point(field_list:ditcaffe.BlobShape.dim) + return dim_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +BlobShape::mutable_dim() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.BlobShape.dim) + return &dim_; +} + +// ------------------------------------------------------------------- + +// BlobProto + +// optional .ditcaffe.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_->::ditcaffe::BlobShape::Clear(); + clear_has_shape(); +} +inline const ::ditcaffe::BlobShape& BlobProto::shape() const { + // @@protoc_insertion_point(field_get:ditcaffe.BlobProto.shape) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return shape_ != NULL ? *shape_ : *default_instance().shape_; +#else + return shape_ != NULL ? *shape_ : *default_instance_->shape_; +#endif +} +inline ::ditcaffe::BlobShape* BlobProto::mutable_shape() { + set_has_shape(); + if (shape_ == NULL) shape_ = new ::ditcaffe::BlobShape; + // @@protoc_insertion_point(field_mutable:ditcaffe.BlobProto.shape) + return shape_; +} +inline ::ditcaffe::BlobShape* BlobProto::release_shape() { + clear_has_shape(); + ::ditcaffe::BlobShape* temp = shape_; + shape_ = NULL; + return temp; +} +inline void BlobProto::set_allocated_shape(::ditcaffe::BlobShape* shape) { + delete shape_; + shape_ = shape; + if (shape) { + set_has_shape(); + } else { + clear_has_shape(); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.BlobProto.data) + return data_.Get(index); +} +inline void BlobProto::set_data(int index, float value) { + data_.Set(index, value); + // @@protoc_insertion_point(field_set:ditcaffe.BlobProto.data) +} +inline void BlobProto::add_data(float value) { + data_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.BlobProto.data) +} +inline const ::google::protobuf::RepeatedField< float >& +BlobProto::data() const { + // @@protoc_insertion_point(field_list:ditcaffe.BlobProto.data) + return data_; +} +inline ::google::protobuf::RepeatedField< float >* +BlobProto::mutable_data() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.BlobProto.diff) + return diff_.Get(index); +} +inline void BlobProto::set_diff(int index, float value) { + diff_.Set(index, value); + // @@protoc_insertion_point(field_set:ditcaffe.BlobProto.diff) +} +inline void BlobProto::add_diff(float value) { + diff_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.BlobProto.diff) +} +inline const ::google::protobuf::RepeatedField< float >& +BlobProto::diff() const { + // @@protoc_insertion_point(field_list:ditcaffe.BlobProto.diff) + return diff_; +} +inline ::google::protobuf::RepeatedField< float >* +BlobProto::mutable_diff() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.BlobProto.double_data) +} +inline void BlobProto::add_double_data(double value) { + double_data_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.BlobProto.double_data) +} +inline const ::google::protobuf::RepeatedField< double >& +BlobProto::double_data() const { + // @@protoc_insertion_point(field_list:ditcaffe.BlobProto.double_data) + return double_data_; +} +inline ::google::protobuf::RepeatedField< double >* +BlobProto::mutable_double_data() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.BlobProto.double_diff) +} +inline void BlobProto::add_double_diff(double value) { + double_diff_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.BlobProto.double_diff) +} +inline const ::google::protobuf::RepeatedField< double >& +BlobProto::double_diff() const { + // @@protoc_insertion_point(field_list:ditcaffe.BlobProto.double_diff) + return double_diff_; +} +inline ::google::protobuf::RepeatedField< double >* +BlobProto::mutable_double_diff() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.BlobProto.double_diff) + return &double_diff_; +} + +// repeated uint32 half_data = 10 [packed = true]; +inline int BlobProto::half_data_size() const { + return half_data_.size(); +} +inline void BlobProto::clear_half_data() { + half_data_.Clear(); +} +inline ::google::protobuf::uint32 BlobProto::half_data(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.BlobProto.half_data) + return half_data_.Get(index); +} +inline void BlobProto::set_half_data(int index, ::google::protobuf::uint32 value) { + half_data_.Set(index, value); + // @@protoc_insertion_point(field_set:ditcaffe.BlobProto.half_data) +} +inline void BlobProto::add_half_data(::google::protobuf::uint32 value) { + half_data_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.BlobProto.half_data) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +BlobProto::half_data() const { + // @@protoc_insertion_point(field_list:ditcaffe.BlobProto.half_data) + return half_data_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +BlobProto::mutable_half_data() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.BlobProto.half_data) + return &half_data_; +} + +// repeated uint32 half_diff = 11 [packed = true]; +inline int BlobProto::half_diff_size() const { + return half_diff_.size(); +} +inline void BlobProto::clear_half_diff() { + half_diff_.Clear(); +} +inline ::google::protobuf::uint32 BlobProto::half_diff(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.BlobProto.half_diff) + return half_diff_.Get(index); +} +inline void BlobProto::set_half_diff(int index, ::google::protobuf::uint32 value) { + half_diff_.Set(index, value); + // @@protoc_insertion_point(field_set:ditcaffe.BlobProto.half_diff) +} +inline void BlobProto::add_half_diff(::google::protobuf::uint32 value) { + half_diff_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.BlobProto.half_diff) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +BlobProto::half_diff() const { + // @@protoc_insertion_point(field_list:ditcaffe.BlobProto.half_diff) + return half_diff_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +BlobProto::mutable_half_diff() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.BlobProto.half_diff) + return &half_diff_; +} + +// optional int32 num = 1 [default = 0]; +inline bool BlobProto::has_num() const { + return (_has_bits_[0] & 0x00000080u) != 0; +} +inline void BlobProto::set_has_num() { + _has_bits_[0] |= 0x00000080u; +} +inline void BlobProto::clear_has_num() { + _has_bits_[0] &= ~0x00000080u; +} +inline void BlobProto::clear_num() { + num_ = 0; + clear_has_num(); +} +inline ::google::protobuf::int32 BlobProto::num() const { + // @@protoc_insertion_point(field_get:ditcaffe.BlobProto.num) + return num_; +} +inline void BlobProto::set_num(::google::protobuf::int32 value) { + set_has_num(); + num_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.BlobProto.num) +} + +// optional int32 channels = 2 [default = 0]; +inline bool BlobProto::has_channels() const { + return (_has_bits_[0] & 0x00000100u) != 0; +} +inline void BlobProto::set_has_channels() { + _has_bits_[0] |= 0x00000100u; +} +inline void BlobProto::clear_has_channels() { + _has_bits_[0] &= ~0x00000100u; +} +inline void BlobProto::clear_channels() { + channels_ = 0; + clear_has_channels(); +} +inline ::google::protobuf::int32 BlobProto::channels() const { + // @@protoc_insertion_point(field_get:ditcaffe.BlobProto.channels) + return channels_; +} +inline void BlobProto::set_channels(::google::protobuf::int32 value) { + set_has_channels(); + channels_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.BlobProto.channels) +} + +// optional int32 height = 3 [default = 0]; +inline bool BlobProto::has_height() const { + return (_has_bits_[0] & 0x00000200u) != 0; +} +inline void BlobProto::set_has_height() { + _has_bits_[0] |= 0x00000200u; +} +inline void BlobProto::clear_has_height() { + _has_bits_[0] &= ~0x00000200u; +} +inline void BlobProto::clear_height() { + height_ = 0; + clear_has_height(); +} +inline ::google::protobuf::int32 BlobProto::height() const { + // @@protoc_insertion_point(field_get:ditcaffe.BlobProto.height) + return height_; +} +inline void BlobProto::set_height(::google::protobuf::int32 value) { + set_has_height(); + height_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.BlobProto.height) +} + +// optional int32 width = 4 [default = 0]; +inline bool BlobProto::has_width() const { + return (_has_bits_[0] & 0x00000400u) != 0; +} +inline void BlobProto::set_has_width() { + _has_bits_[0] |= 0x00000400u; +} +inline void BlobProto::clear_has_width() { + _has_bits_[0] &= ~0x00000400u; +} +inline void BlobProto::clear_width() { + width_ = 0; + clear_has_width(); +} +inline ::google::protobuf::int32 BlobProto::width() const { + // @@protoc_insertion_point(field_get:ditcaffe.BlobProto.width) + return width_; +} +inline void BlobProto::set_width(::google::protobuf::int32 value) { + set_has_width(); + width_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.BlobProto.width) +} + +// ------------------------------------------------------------------- + +// BlobProtoVector + +// repeated .ditcaffe.BlobProto blobs = 1; +inline int BlobProtoVector::blobs_size() const { + return blobs_.size(); +} +inline void BlobProtoVector::clear_blobs() { + blobs_.Clear(); +} +inline const ::ditcaffe::BlobProto& BlobProtoVector::blobs(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.BlobProtoVector.blobs) + return blobs_.Get(index); +} +inline ::ditcaffe::BlobProto* BlobProtoVector::mutable_blobs(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.BlobProtoVector.blobs) + return blobs_.Mutable(index); +} +inline ::ditcaffe::BlobProto* BlobProtoVector::add_blobs() { + // @@protoc_insertion_point(field_add:ditcaffe.BlobProtoVector.blobs) + return blobs_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >& +BlobProtoVector::blobs() const { + // @@protoc_insertion_point(field_list:ditcaffe.BlobProtoVector.blobs) + return blobs_; +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >* +BlobProtoVector::mutable_blobs() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.BlobProtoVector.blobs) + return &blobs_; +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.Datum.channels) + return channels_; +} +inline void Datum::set_channels(::google::protobuf::int32 value) { + set_has_channels(); + channels_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.Datum.height) + return height_; +} +inline void Datum::set_height(::google::protobuf::int32 value) { + set_has_height(); + height_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.Datum.width) + return width_; +} +inline void Datum::set_width(::google::protobuf::int32 value) { + set_has_width(); + width_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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() { + if (data_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + data_->clear(); + } + clear_has_data(); +} +inline const ::std::string& Datum::data() const { + // @@protoc_insertion_point(field_get:ditcaffe.Datum.data) + return *data_; +} +inline void Datum::set_data(const ::std::string& value) { + set_has_data(); + if (data_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + data_ = new ::std::string; + } + data_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.Datum.data) +} +inline void Datum::set_data(const char* value) { + set_has_data(); + if (data_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + data_ = new ::std::string; + } + data_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.Datum.data) +} +inline void Datum::set_data(const void* value, size_t size) { + set_has_data(); + if (data_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + data_ = new ::std::string; + } + data_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.Datum.data) +} +inline ::std::string* Datum::mutable_data() { + set_has_data(); + if (data_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + data_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.Datum.data) + return data_; +} +inline ::std::string* Datum::release_data() { + clear_has_data(); + if (data_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = data_; + data_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void Datum::set_allocated_data(::std::string* data) { + if (data_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete data_; + } + if (data) { + set_has_data(); + data_ = data; + } else { + clear_has_data(); + data_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.Datum.label) + return label_; +} +inline void Datum::set_label(::google::protobuf::int32 value) { + set_has_label(); + label_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.Datum.float_data) +} +inline void Datum::add_float_data(float value) { + float_data_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.Datum.float_data) +} +inline const ::google::protobuf::RepeatedField< float >& +Datum::float_data() const { + // @@protoc_insertion_point(field_list:ditcaffe.Datum.float_data) + return float_data_; +} +inline ::google::protobuf::RepeatedField< float >* +Datum::mutable_float_data() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.Datum.encoded) + return encoded_; +} +inline void Datum::set_encoded(bool value) { + set_has_encoded(); + encoded_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.Datum.encoded) +} + +// ------------------------------------------------------------------- + +// 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() { + if (type_ != _default_type_) { + type_->assign(*_default_type_); + } + clear_has_type(); +} +inline const ::std::string& FillerParameter::type() const { + // @@protoc_insertion_point(field_get:ditcaffe.FillerParameter.type) + return *type_; +} +inline void FillerParameter::set_type(const ::std::string& value) { + set_has_type(); + if (type_ == _default_type_) { + type_ = new ::std::string; + } + type_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.FillerParameter.type) +} +inline void FillerParameter::set_type(const char* value) { + set_has_type(); + if (type_ == _default_type_) { + type_ = new ::std::string; + } + type_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.FillerParameter.type) +} +inline void FillerParameter::set_type(const char* value, size_t size) { + set_has_type(); + if (type_ == _default_type_) { + type_ = new ::std::string; + } + type_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.FillerParameter.type) +} +inline ::std::string* FillerParameter::mutable_type() { + set_has_type(); + if (type_ == _default_type_) { + type_ = new ::std::string(*_default_type_); + } + // @@protoc_insertion_point(field_mutable:ditcaffe.FillerParameter.type) + return type_; +} +inline ::std::string* FillerParameter::release_type() { + clear_has_type(); + if (type_ == _default_type_) { + return NULL; + } else { + ::std::string* temp = type_; + type_ = const_cast< ::std::string*>(_default_type_); + return temp; + } +} +inline void FillerParameter::set_allocated_type(::std::string* type) { + if (type_ != _default_type_) { + delete type_; + } + if (type) { + set_has_type(); + type_ = type; + } else { + clear_has_type(); + type_ = const_cast< ::std::string*>(_default_type_); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.FillerParameter.value) + return value_; +} +inline void FillerParameter::set_value(float value) { + set_has_value(); + value_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.FillerParameter.min) + return min_; +} +inline void FillerParameter::set_min(float value) { + set_has_min(); + min_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.FillerParameter.max) + return max_; +} +inline void FillerParameter::set_max(float value) { + set_has_max(); + max_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.FillerParameter.mean) + return mean_; +} +inline void FillerParameter::set_mean(float value) { + set_has_mean(); + mean_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.FillerParameter.std) + return std_; +} +inline void FillerParameter::set_std(float value) { + set_has_std(); + std_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.FillerParameter.sparse) + return sparse_; +} +inline void FillerParameter::set_sparse(::google::protobuf::int32 value) { + set_has_sparse(); + sparse_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.FillerParameter.sparse) +} + +// optional .ditcaffe.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 ::ditcaffe::FillerParameter_VarianceNorm FillerParameter::variance_norm() const { + // @@protoc_insertion_point(field_get:ditcaffe.FillerParameter.variance_norm) + return static_cast< ::ditcaffe::FillerParameter_VarianceNorm >(variance_norm_); +} +inline void FillerParameter::set_variance_norm(::ditcaffe::FillerParameter_VarianceNorm value) { + assert(::ditcaffe::FillerParameter_VarianceNorm_IsValid(value)); + set_has_variance_norm(); + variance_norm_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.FillerParameter.variance_norm) +} + +// ------------------------------------------------------------------- + +// 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() { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_->clear(); + } + clear_has_name(); +} +inline const ::std::string& NetParameter::name() const { + // @@protoc_insertion_point(field_get:ditcaffe.NetParameter.name) + return *name_; +} +inline void NetParameter::set_name(const ::std::string& value) { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + name_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.NetParameter.name) +} +inline void NetParameter::set_name(const char* value) { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + name_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.NetParameter.name) +} +inline void NetParameter::set_name(const char* value, size_t size) { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + name_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.NetParameter.name) +} +inline ::std::string* NetParameter::mutable_name() { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.NetParameter.name) + return name_; +} +inline ::std::string* NetParameter::release_name() { + clear_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = name_; + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void NetParameter::set_allocated_name(::std::string* name) { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete name_; + } + if (name) { + set_has_name(); + name_ = name; + } else { + clear_has_name(); + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.NetParameter.input) + return input_.Get(index); +} +inline ::std::string* NetParameter::mutable_input(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.NetParameter.input) + return input_.Mutable(index); +} +inline void NetParameter::set_input(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.NetParameter.input) +} +inline ::std::string* NetParameter::add_input() { + return input_.Add(); +} +inline void NetParameter::add_input(const ::std::string& value) { + input_.Add()->assign(value); + // @@protoc_insertion_point(field_add:ditcaffe.NetParameter.input) +} +inline void NetParameter::add_input(const char* value) { + input_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:ditcaffe.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:ditcaffe.NetParameter.input) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +NetParameter::input() const { + // @@protoc_insertion_point(field_list:ditcaffe.NetParameter.input) + return input_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +NetParameter::mutable_input() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.NetParameter.input) + return &input_; +} + +// repeated .ditcaffe.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 ::ditcaffe::BlobShape& NetParameter::input_shape(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.NetParameter.input_shape) + return input_shape_.Get(index); +} +inline ::ditcaffe::BlobShape* NetParameter::mutable_input_shape(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.NetParameter.input_shape) + return input_shape_.Mutable(index); +} +inline ::ditcaffe::BlobShape* NetParameter::add_input_shape() { + // @@protoc_insertion_point(field_add:ditcaffe.NetParameter.input_shape) + return input_shape_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobShape >& +NetParameter::input_shape() const { + // @@protoc_insertion_point(field_list:ditcaffe.NetParameter.input_shape) + return input_shape_; +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobShape >* +NetParameter::mutable_input_shape() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.NetParameter.input_dim) +} +inline void NetParameter::add_input_dim(::google::protobuf::int32 value) { + input_dim_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.NetParameter.input_dim) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +NetParameter::input_dim() const { + // @@protoc_insertion_point(field_list:ditcaffe.NetParameter.input_dim) + return input_dim_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +NetParameter::mutable_input_dim() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.NetParameter.force_backward) +} + +// optional .ditcaffe.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_->::ditcaffe::NetState::Clear(); + clear_has_state(); +} +inline const ::ditcaffe::NetState& NetParameter::state() const { + // @@protoc_insertion_point(field_get:ditcaffe.NetParameter.state) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return state_ != NULL ? *state_ : *default_instance().state_; +#else + return state_ != NULL ? *state_ : *default_instance_->state_; +#endif +} +inline ::ditcaffe::NetState* NetParameter::mutable_state() { + set_has_state(); + if (state_ == NULL) state_ = new ::ditcaffe::NetState; + // @@protoc_insertion_point(field_mutable:ditcaffe.NetParameter.state) + return state_; +} +inline ::ditcaffe::NetState* NetParameter::release_state() { + clear_has_state(); + ::ditcaffe::NetState* temp = state_; + state_ = NULL; + return temp; +} +inline void NetParameter::set_allocated_state(::ditcaffe::NetState* state) { + delete state_; + state_ = state; + if (state) { + set_has_state(); + } else { + clear_has_state(); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.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:ditcaffe.NetParameter.debug_info) +} + +// repeated .ditcaffe.LayerParameter layer = 100; +inline int NetParameter::layer_size() const { + return layer_.size(); +} +inline void NetParameter::clear_layer() { + layer_.Clear(); +} +inline const ::ditcaffe::LayerParameter& NetParameter::layer(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.NetParameter.layer) + return layer_.Get(index); +} +inline ::ditcaffe::LayerParameter* NetParameter::mutable_layer(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.NetParameter.layer) + return layer_.Mutable(index); +} +inline ::ditcaffe::LayerParameter* NetParameter::add_layer() { + // @@protoc_insertion_point(field_add:ditcaffe.NetParameter.layer) + return layer_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::LayerParameter >& +NetParameter::layer() const { + // @@protoc_insertion_point(field_list:ditcaffe.NetParameter.layer) + return layer_; +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::LayerParameter >* +NetParameter::mutable_layer() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.NetParameter.layer) + return &layer_; +} + +// repeated .ditcaffe.V1LayerParameter layers = 2; +inline int NetParameter::layers_size() const { + return layers_.size(); +} +inline void NetParameter::clear_layers() { + layers_.Clear(); +} +inline const ::ditcaffe::V1LayerParameter& NetParameter::layers(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.NetParameter.layers) + return layers_.Get(index); +} +inline ::ditcaffe::V1LayerParameter* NetParameter::mutable_layers(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.NetParameter.layers) + return layers_.Mutable(index); +} +inline ::ditcaffe::V1LayerParameter* NetParameter::add_layers() { + // @@protoc_insertion_point(field_add:ditcaffe.NetParameter.layers) + return layers_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::V1LayerParameter >& +NetParameter::layers() const { + // @@protoc_insertion_point(field_list:ditcaffe.NetParameter.layers) + return layers_; +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::V1LayerParameter >* +NetParameter::mutable_layers() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.NetParameter.layers) + return &layers_; +} + +// ------------------------------------------------------------------- + +// 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() { + if (net_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + net_->clear(); + } + clear_has_net(); +} +inline const ::std::string& SolverParameter::net() const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverParameter.net) + return *net_; +} +inline void SolverParameter::set_net(const ::std::string& value) { + set_has_net(); + if (net_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + net_ = new ::std::string; + } + net_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.SolverParameter.net) +} +inline void SolverParameter::set_net(const char* value) { + set_has_net(); + if (net_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + net_ = new ::std::string; + } + net_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.SolverParameter.net) +} +inline void SolverParameter::set_net(const char* value, size_t size) { + set_has_net(); + if (net_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + net_ = new ::std::string; + } + net_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.SolverParameter.net) +} +inline ::std::string* SolverParameter::mutable_net() { + set_has_net(); + if (net_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + net_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.net) + return net_; +} +inline ::std::string* SolverParameter::release_net() { + clear_has_net(); + if (net_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = net_; + net_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void SolverParameter::set_allocated_net(::std::string* net) { + if (net_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete net_; + } + if (net) { + set_has_net(); + net_ = net; + } else { + clear_has_net(); + net_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.SolverParameter.net) +} + +// optional .ditcaffe.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_->::ditcaffe::NetParameter::Clear(); + clear_has_net_param(); +} +inline const ::ditcaffe::NetParameter& SolverParameter::net_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverParameter.net_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return net_param_ != NULL ? *net_param_ : *default_instance().net_param_; +#else + return net_param_ != NULL ? *net_param_ : *default_instance_->net_param_; +#endif +} +inline ::ditcaffe::NetParameter* SolverParameter::mutable_net_param() { + set_has_net_param(); + if (net_param_ == NULL) net_param_ = new ::ditcaffe::NetParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.net_param) + return net_param_; +} +inline ::ditcaffe::NetParameter* SolverParameter::release_net_param() { + clear_has_net_param(); + ::ditcaffe::NetParameter* temp = net_param_; + net_param_ = NULL; + return temp; +} +inline void SolverParameter::set_allocated_net_param(::ditcaffe::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:ditcaffe.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() { + if (train_net_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + train_net_->clear(); + } + clear_has_train_net(); +} +inline const ::std::string& SolverParameter::train_net() const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverParameter.train_net) + return *train_net_; +} +inline void SolverParameter::set_train_net(const ::std::string& value) { + set_has_train_net(); + if (train_net_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + train_net_ = new ::std::string; + } + train_net_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.SolverParameter.train_net) +} +inline void SolverParameter::set_train_net(const char* value) { + set_has_train_net(); + if (train_net_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + train_net_ = new ::std::string; + } + train_net_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.SolverParameter.train_net) +} +inline void SolverParameter::set_train_net(const char* value, size_t size) { + set_has_train_net(); + if (train_net_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + train_net_ = new ::std::string; + } + train_net_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.SolverParameter.train_net) +} +inline ::std::string* SolverParameter::mutable_train_net() { + set_has_train_net(); + if (train_net_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + train_net_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.train_net) + return train_net_; +} +inline ::std::string* SolverParameter::release_train_net() { + clear_has_train_net(); + if (train_net_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = train_net_; + train_net_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void SolverParameter::set_allocated_train_net(::std::string* train_net) { + if (train_net_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete train_net_; + } + if (train_net) { + set_has_train_net(); + train_net_ = train_net; + } else { + clear_has_train_net(); + train_net_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.SolverParameter.test_net) + return test_net_.Get(index); +} +inline ::std::string* SolverParameter::mutable_test_net(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.test_net) +} +inline ::std::string* SolverParameter::add_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:ditcaffe.SolverParameter.test_net) +} +inline void SolverParameter::add_test_net(const char* value) { + test_net_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:ditcaffe.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:ditcaffe.SolverParameter.test_net) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +SolverParameter::test_net() const { + // @@protoc_insertion_point(field_list:ditcaffe.SolverParameter.test_net) + return test_net_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +SolverParameter::mutable_test_net() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.SolverParameter.test_net) + return &test_net_; +} + +// optional .ditcaffe.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_->::ditcaffe::NetParameter::Clear(); + clear_has_train_net_param(); +} +inline const ::ditcaffe::NetParameter& SolverParameter::train_net_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverParameter.train_net_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return train_net_param_ != NULL ? *train_net_param_ : *default_instance().train_net_param_; +#else + return train_net_param_ != NULL ? *train_net_param_ : *default_instance_->train_net_param_; +#endif +} +inline ::ditcaffe::NetParameter* SolverParameter::mutable_train_net_param() { + set_has_train_net_param(); + if (train_net_param_ == NULL) train_net_param_ = new ::ditcaffe::NetParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.train_net_param) + return train_net_param_; +} +inline ::ditcaffe::NetParameter* SolverParameter::release_train_net_param() { + clear_has_train_net_param(); + ::ditcaffe::NetParameter* temp = train_net_param_; + train_net_param_ = NULL; + return temp; +} +inline void SolverParameter::set_allocated_train_net_param(::ditcaffe::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:ditcaffe.SolverParameter.train_net_param) +} + +// repeated .ditcaffe.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 ::ditcaffe::NetParameter& SolverParameter::test_net_param(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverParameter.test_net_param) + return test_net_param_.Get(index); +} +inline ::ditcaffe::NetParameter* SolverParameter::mutable_test_net_param(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.test_net_param) + return test_net_param_.Mutable(index); +} +inline ::ditcaffe::NetParameter* SolverParameter::add_test_net_param() { + // @@protoc_insertion_point(field_add:ditcaffe.SolverParameter.test_net_param) + return test_net_param_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetParameter >& +SolverParameter::test_net_param() const { + // @@protoc_insertion_point(field_list:ditcaffe.SolverParameter.test_net_param) + return test_net_param_; +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetParameter >* +SolverParameter::mutable_test_net_param() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.SolverParameter.test_net_param) + return &test_net_param_; +} + +// optional .ditcaffe.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_->::ditcaffe::NetState::Clear(); + clear_has_train_state(); +} +inline const ::ditcaffe::NetState& SolverParameter::train_state() const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverParameter.train_state) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return train_state_ != NULL ? *train_state_ : *default_instance().train_state_; +#else + return train_state_ != NULL ? *train_state_ : *default_instance_->train_state_; +#endif +} +inline ::ditcaffe::NetState* SolverParameter::mutable_train_state() { + set_has_train_state(); + if (train_state_ == NULL) train_state_ = new ::ditcaffe::NetState; + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.train_state) + return train_state_; +} +inline ::ditcaffe::NetState* SolverParameter::release_train_state() { + clear_has_train_state(); + ::ditcaffe::NetState* temp = train_state_; + train_state_ = NULL; + return temp; +} +inline void SolverParameter::set_allocated_train_state(::ditcaffe::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:ditcaffe.SolverParameter.train_state) +} + +// repeated .ditcaffe.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 ::ditcaffe::NetState& SolverParameter::test_state(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverParameter.test_state) + return test_state_.Get(index); +} +inline ::ditcaffe::NetState* SolverParameter::mutable_test_state(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.test_state) + return test_state_.Mutable(index); +} +inline ::ditcaffe::NetState* SolverParameter::add_test_state() { + // @@protoc_insertion_point(field_add:ditcaffe.SolverParameter.test_state) + return test_state_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetState >& +SolverParameter::test_state() const { + // @@protoc_insertion_point(field_list:ditcaffe.SolverParameter.test_state) + return test_state_; +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetState >* +SolverParameter::mutable_test_state() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.test_iter) +} +inline void SolverParameter::add_test_iter(::google::protobuf::int32 value) { + test_iter_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.SolverParameter.test_iter) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +SolverParameter::test_iter() const { + // @@protoc_insertion_point(field_list:ditcaffe.SolverParameter.test_iter) + return test_iter_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +SolverParameter::mutable_test_iter() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.display) + return display_; +} +inline void SolverParameter::set_display(::google::protobuf::int32 value) { + set_has_display(); + display_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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() { + if (lr_policy_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + lr_policy_->clear(); + } + clear_has_lr_policy(); +} +inline const ::std::string& SolverParameter::lr_policy() const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverParameter.lr_policy) + return *lr_policy_; +} +inline void SolverParameter::set_lr_policy(const ::std::string& value) { + set_has_lr_policy(); + if (lr_policy_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + lr_policy_ = new ::std::string; + } + lr_policy_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.SolverParameter.lr_policy) +} +inline void SolverParameter::set_lr_policy(const char* value) { + set_has_lr_policy(); + if (lr_policy_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + lr_policy_ = new ::std::string; + } + lr_policy_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.SolverParameter.lr_policy) +} +inline void SolverParameter::set_lr_policy(const char* value, size_t size) { + set_has_lr_policy(); + if (lr_policy_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + lr_policy_ = new ::std::string; + } + lr_policy_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.SolverParameter.lr_policy) +} +inline ::std::string* SolverParameter::mutable_lr_policy() { + set_has_lr_policy(); + if (lr_policy_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + lr_policy_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.lr_policy) + return lr_policy_; +} +inline ::std::string* SolverParameter::release_lr_policy() { + clear_has_lr_policy(); + if (lr_policy_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = lr_policy_; + lr_policy_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void SolverParameter::set_allocated_lr_policy(::std::string* lr_policy) { + if (lr_policy_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete lr_policy_; + } + if (lr_policy) { + set_has_lr_policy(); + lr_policy_ = lr_policy; + } else { + clear_has_lr_policy(); + lr_policy_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.SolverParameter.gamma) + return gamma_; +} +inline void SolverParameter::set_gamma(float value) { + set_has_gamma(); + gamma_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.SolverParameter.power) + return power_; +} +inline void SolverParameter::set_power(float value) { + set_has_power(); + power_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.SolverParameter.momentum) + return momentum_; +} +inline void SolverParameter::set_momentum(float value) { + set_has_momentum(); + momentum_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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() { + if (regularization_type_ != _default_regularization_type_) { + regularization_type_->assign(*_default_regularization_type_); + } + clear_has_regularization_type(); +} +inline const ::std::string& SolverParameter::regularization_type() const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverParameter.regularization_type) + return *regularization_type_; +} +inline void SolverParameter::set_regularization_type(const ::std::string& value) { + set_has_regularization_type(); + if (regularization_type_ == _default_regularization_type_) { + regularization_type_ = new ::std::string; + } + regularization_type_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.SolverParameter.regularization_type) +} +inline void SolverParameter::set_regularization_type(const char* value) { + set_has_regularization_type(); + if (regularization_type_ == _default_regularization_type_) { + regularization_type_ = new ::std::string; + } + regularization_type_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.SolverParameter.regularization_type) +} +inline void SolverParameter::set_regularization_type(const char* value, size_t size) { + set_has_regularization_type(); + if (regularization_type_ == _default_regularization_type_) { + regularization_type_ = new ::std::string; + } + regularization_type_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.SolverParameter.regularization_type) +} +inline ::std::string* SolverParameter::mutable_regularization_type() { + set_has_regularization_type(); + if (regularization_type_ == _default_regularization_type_) { + regularization_type_ = new ::std::string(*_default_regularization_type_); + } + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.regularization_type) + return regularization_type_; +} +inline ::std::string* SolverParameter::release_regularization_type() { + clear_has_regularization_type(); + if (regularization_type_ == _default_regularization_type_) { + return NULL; + } else { + ::std::string* temp = regularization_type_; + regularization_type_ = const_cast< ::std::string*>(_default_regularization_type_); + return temp; + } +} +inline void SolverParameter::set_allocated_regularization_type(::std::string* regularization_type) { + if (regularization_type_ != _default_regularization_type_) { + delete regularization_type_; + } + if (regularization_type) { + set_has_regularization_type(); + regularization_type_ = regularization_type; + } else { + clear_has_regularization_type(); + regularization_type_ = const_cast< ::std::string*>(_default_regularization_type_); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.SolverParameter.stepsize) + return stepsize_; +} +inline void SolverParameter::set_stepsize(::google::protobuf::int32 value) { + set_has_stepsize(); + stepsize_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.stepvalue) +} +inline void SolverParameter::add_stepvalue(::google::protobuf::int32 value) { + stepvalue_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.SolverParameter.stepvalue) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +SolverParameter::stepvalue() const { + // @@protoc_insertion_point(field_list:ditcaffe.SolverParameter.stepvalue) + return stepvalue_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +SolverParameter::mutable_stepvalue() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.snapshot) + return snapshot_; +} +inline void SolverParameter::set_snapshot(::google::protobuf::int32 value) { + set_has_snapshot(); + snapshot_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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() { + if (snapshot_prefix_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + snapshot_prefix_->clear(); + } + clear_has_snapshot_prefix(); +} +inline const ::std::string& SolverParameter::snapshot_prefix() const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverParameter.snapshot_prefix) + return *snapshot_prefix_; +} +inline void SolverParameter::set_snapshot_prefix(const ::std::string& value) { + set_has_snapshot_prefix(); + if (snapshot_prefix_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + snapshot_prefix_ = new ::std::string; + } + snapshot_prefix_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.SolverParameter.snapshot_prefix) +} +inline void SolverParameter::set_snapshot_prefix(const char* value) { + set_has_snapshot_prefix(); + if (snapshot_prefix_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + snapshot_prefix_ = new ::std::string; + } + snapshot_prefix_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.SolverParameter.snapshot_prefix) +} +inline void SolverParameter::set_snapshot_prefix(const char* value, size_t size) { + set_has_snapshot_prefix(); + if (snapshot_prefix_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + snapshot_prefix_ = new ::std::string; + } + snapshot_prefix_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.SolverParameter.snapshot_prefix) +} +inline ::std::string* SolverParameter::mutable_snapshot_prefix() { + set_has_snapshot_prefix(); + if (snapshot_prefix_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + snapshot_prefix_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.snapshot_prefix) + return snapshot_prefix_; +} +inline ::std::string* SolverParameter::release_snapshot_prefix() { + clear_has_snapshot_prefix(); + if (snapshot_prefix_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = snapshot_prefix_; + snapshot_prefix_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void SolverParameter::set_allocated_snapshot_prefix(::std::string* snapshot_prefix) { + if (snapshot_prefix_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete snapshot_prefix_; + } + if (snapshot_prefix) { + set_has_snapshot_prefix(); + snapshot_prefix_ = snapshot_prefix; + } else { + clear_has_snapshot_prefix(); + snapshot_prefix_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.snapshot_diff) +} + +// optional .ditcaffe.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 ::ditcaffe::SolverParameter_SnapshotFormat SolverParameter::snapshot_format() const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverParameter.snapshot_format) + return static_cast< ::ditcaffe::SolverParameter_SnapshotFormat >(snapshot_format_); +} +inline void SolverParameter::set_snapshot_format(::ditcaffe::SolverParameter_SnapshotFormat value) { + assert(::ditcaffe::SolverParameter_SnapshotFormat_IsValid(value)); + set_has_snapshot_format(); + snapshot_format_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.SolverParameter.snapshot_format) +} + +// optional .ditcaffe.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 ::ditcaffe::SolverParameter_SolverMode SolverParameter::solver_mode() const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverParameter.solver_mode) + return static_cast< ::ditcaffe::SolverParameter_SolverMode >(solver_mode_); +} +inline void SolverParameter::set_solver_mode(::ditcaffe::SolverParameter_SolverMode value) { + assert(::ditcaffe::SolverParameter_SolverMode_IsValid(value)); + set_has_solver_mode(); + solver_mode_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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() { + if (type_ != _default_type_) { + type_->assign(*_default_type_); + } + clear_has_type(); +} +inline const ::std::string& SolverParameter::type() const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverParameter.type) + return *type_; +} +inline void SolverParameter::set_type(const ::std::string& value) { + set_has_type(); + if (type_ == _default_type_) { + type_ = new ::std::string; + } + type_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.SolverParameter.type) +} +inline void SolverParameter::set_type(const char* value) { + set_has_type(); + if (type_ == _default_type_) { + type_ = new ::std::string; + } + type_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.SolverParameter.type) +} +inline void SolverParameter::set_type(const char* value, size_t size) { + set_has_type(); + if (type_ == _default_type_) { + type_ = new ::std::string; + } + type_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.SolverParameter.type) +} +inline ::std::string* SolverParameter::mutable_type() { + set_has_type(); + if (type_ == _default_type_) { + type_ = new ::std::string(*_default_type_); + } + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.type) + return type_; +} +inline ::std::string* SolverParameter::release_type() { + clear_has_type(); + if (type_ == _default_type_) { + return NULL; + } else { + ::std::string* temp = type_; + type_ = const_cast< ::std::string*>(_default_type_); + return temp; + } +} +inline void SolverParameter::set_allocated_type(::std::string* type) { + if (type_ != _default_type_) { + delete type_; + } + if (type) { + set_has_type(); + type_ = type; + } else { + clear_has_type(); + type_ = const_cast< ::std::string*>(_default_type_); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.SolverParameter.delta) + return delta_; +} +inline void SolverParameter::set_delta(float value) { + set_has_delta(); + delta_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.SolverParameter.momentum2) + return momentum2_; +} +inline void SolverParameter::set_momentum2(float value) { + set_has_momentum2(); + momentum2_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.SolverParameter.momentum2) +} + +// optional float rms_decay = 38; +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; + clear_has_rms_decay(); +} +inline float SolverParameter::rms_decay() const { + // @@protoc_insertion_point(field_get:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.snapshot_after_train) +} + +// optional .ditcaffe.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 ::ditcaffe::SolverParameter_SolverType SolverParameter::solver_type() const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverParameter.solver_type) + return static_cast< ::ditcaffe::SolverParameter_SolverType >(solver_type_); +} +inline void SolverParameter::set_solver_type(::ditcaffe::SolverParameter_SolverType value) { + assert(::ditcaffe::SolverParameter_SolverType_IsValid(value)); + set_has_solver_type(); + solver_type_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.SolverParameter.solver_type) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.SolverState.iter) + return iter_; +} +inline void SolverState::set_iter(::google::protobuf::int32 value) { + set_has_iter(); + iter_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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() { + if (learned_net_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + learned_net_->clear(); + } + clear_has_learned_net(); +} +inline const ::std::string& SolverState::learned_net() const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverState.learned_net) + return *learned_net_; +} +inline void SolverState::set_learned_net(const ::std::string& value) { + set_has_learned_net(); + if (learned_net_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + learned_net_ = new ::std::string; + } + learned_net_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.SolverState.learned_net) +} +inline void SolverState::set_learned_net(const char* value) { + set_has_learned_net(); + if (learned_net_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + learned_net_ = new ::std::string; + } + learned_net_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.SolverState.learned_net) +} +inline void SolverState::set_learned_net(const char* value, size_t size) { + set_has_learned_net(); + if (learned_net_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + learned_net_ = new ::std::string; + } + learned_net_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.SolverState.learned_net) +} +inline ::std::string* SolverState::mutable_learned_net() { + set_has_learned_net(); + if (learned_net_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + learned_net_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverState.learned_net) + return learned_net_; +} +inline ::std::string* SolverState::release_learned_net() { + clear_has_learned_net(); + if (learned_net_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = learned_net_; + learned_net_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void SolverState::set_allocated_learned_net(::std::string* learned_net) { + if (learned_net_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete learned_net_; + } + if (learned_net) { + set_has_learned_net(); + learned_net_ = learned_net; + } else { + clear_has_learned_net(); + learned_net_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.SolverState.learned_net) +} + +// repeated .ditcaffe.BlobProto history = 3; +inline int SolverState::history_size() const { + return history_.size(); +} +inline void SolverState::clear_history() { + history_.Clear(); +} +inline const ::ditcaffe::BlobProto& SolverState::history(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverState.history) + return history_.Get(index); +} +inline ::ditcaffe::BlobProto* SolverState::mutable_history(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverState.history) + return history_.Mutable(index); +} +inline ::ditcaffe::BlobProto* SolverState::add_history() { + // @@protoc_insertion_point(field_add:ditcaffe.SolverState.history) + return history_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >& +SolverState::history() const { + // @@protoc_insertion_point(field_list:ditcaffe.SolverState.history) + return history_; +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >* +SolverState::mutable_history() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.SolverState.current_step) +} + +// ------------------------------------------------------------------- + +// NetState + +// optional .ditcaffe.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 ::ditcaffe::Phase NetState::phase() const { + // @@protoc_insertion_point(field_get:ditcaffe.NetState.phase) + return static_cast< ::ditcaffe::Phase >(phase_); +} +inline void NetState::set_phase(::ditcaffe::Phase value) { + assert(::ditcaffe::Phase_IsValid(value)); + set_has_phase(); + phase_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.NetState.level) + return level_; +} +inline void NetState::set_level(::google::protobuf::int32 value) { + set_has_level(); + level_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.NetState.stage) + return stage_.Get(index); +} +inline ::std::string* NetState::mutable_stage(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.NetState.stage) + return stage_.Mutable(index); +} +inline void NetState::set_stage(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.NetState.stage) +} +inline ::std::string* NetState::add_stage() { + return stage_.Add(); +} +inline void NetState::add_stage(const ::std::string& value) { + stage_.Add()->assign(value); + // @@protoc_insertion_point(field_add:ditcaffe.NetState.stage) +} +inline void NetState::add_stage(const char* value) { + stage_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:ditcaffe.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:ditcaffe.NetState.stage) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +NetState::stage() const { + // @@protoc_insertion_point(field_list:ditcaffe.NetState.stage) + return stage_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +NetState::mutable_stage() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.NetState.stage) + return &stage_; +} + +// ------------------------------------------------------------------- + +// NetStateRule + +// optional .ditcaffe.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 ::ditcaffe::Phase NetStateRule::phase() const { + // @@protoc_insertion_point(field_get:ditcaffe.NetStateRule.phase) + return static_cast< ::ditcaffe::Phase >(phase_); +} +inline void NetStateRule::set_phase(::ditcaffe::Phase value) { + assert(::ditcaffe::Phase_IsValid(value)); + set_has_phase(); + phase_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.NetStateRule.stage) + return stage_.Get(index); +} +inline ::std::string* NetStateRule::mutable_stage(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.NetStateRule.stage) + return stage_.Mutable(index); +} +inline void NetStateRule::set_stage(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.NetStateRule.stage) +} +inline ::std::string* NetStateRule::add_stage() { + return stage_.Add(); +} +inline void NetStateRule::add_stage(const ::std::string& value) { + stage_.Add()->assign(value); + // @@protoc_insertion_point(field_add:ditcaffe.NetStateRule.stage) +} +inline void NetStateRule::add_stage(const char* value) { + stage_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:ditcaffe.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:ditcaffe.NetStateRule.stage) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +NetStateRule::stage() const { + // @@protoc_insertion_point(field_list:ditcaffe.NetStateRule.stage) + return stage_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +NetStateRule::mutable_stage() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.NetStateRule.not_stage) + return not_stage_.Get(index); +} +inline ::std::string* NetStateRule::mutable_not_stage(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.NetStateRule.not_stage) +} +inline ::std::string* NetStateRule::add_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:ditcaffe.NetStateRule.not_stage) +} +inline void NetStateRule::add_not_stage(const char* value) { + not_stage_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:ditcaffe.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:ditcaffe.NetStateRule.not_stage) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +NetStateRule::not_stage() const { + // @@protoc_insertion_point(field_list:ditcaffe.NetStateRule.not_stage) + return not_stage_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +NetStateRule::mutable_not_stage() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.NetStateRule.not_stage) + return ¬_stage_; +} + +// ------------------------------------------------------------------- + +// 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() { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_->clear(); + } + clear_has_name(); +} +inline const ::std::string& ParamSpec::name() const { + // @@protoc_insertion_point(field_get:ditcaffe.ParamSpec.name) + return *name_; +} +inline void ParamSpec::set_name(const ::std::string& value) { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + name_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.ParamSpec.name) +} +inline void ParamSpec::set_name(const char* value) { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + name_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.ParamSpec.name) +} +inline void ParamSpec::set_name(const char* value, size_t size) { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + name_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.ParamSpec.name) +} +inline ::std::string* ParamSpec::mutable_name() { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.ParamSpec.name) + return name_; +} +inline ::std::string* ParamSpec::release_name() { + clear_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = name_; + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ParamSpec::set_allocated_name(::std::string* name) { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete name_; + } + if (name) { + set_has_name(); + name_ = name; + } else { + clear_has_name(); + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.ParamSpec.name) +} + +// optional .ditcaffe.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 ::ditcaffe::ParamSpec_DimCheckMode ParamSpec::share_mode() const { + // @@protoc_insertion_point(field_get:ditcaffe.ParamSpec.share_mode) + return static_cast< ::ditcaffe::ParamSpec_DimCheckMode >(share_mode_); +} +inline void ParamSpec::set_share_mode(::ditcaffe::ParamSpec_DimCheckMode value) { + assert(::ditcaffe::ParamSpec_DimCheckMode_IsValid(value)); + set_has_share_mode(); + share_mode_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.ParamSpec.decay_mult) +} + +// ------------------------------------------------------------------- + +// 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() { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_->clear(); + } + clear_has_name(); +} +inline const ::std::string& LayerParameter::name() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.name) + return *name_; +} +inline void LayerParameter::set_name(const ::std::string& value) { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + name_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.LayerParameter.name) +} +inline void LayerParameter::set_name(const char* value) { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + name_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.LayerParameter.name) +} +inline void LayerParameter::set_name(const char* value, size_t size) { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + name_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.LayerParameter.name) +} +inline ::std::string* LayerParameter::mutable_name() { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.name) + return name_; +} +inline ::std::string* LayerParameter::release_name() { + clear_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = name_; + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void LayerParameter::set_allocated_name(::std::string* name) { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete name_; + } + if (name) { + set_has_name(); + name_ = name; + } else { + clear_has_name(); + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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() { + if (type_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + type_->clear(); + } + clear_has_type(); +} +inline const ::std::string& LayerParameter::type() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.type) + return *type_; +} +inline void LayerParameter::set_type(const ::std::string& value) { + set_has_type(); + if (type_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + type_ = new ::std::string; + } + type_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.LayerParameter.type) +} +inline void LayerParameter::set_type(const char* value) { + set_has_type(); + if (type_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + type_ = new ::std::string; + } + type_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.LayerParameter.type) +} +inline void LayerParameter::set_type(const char* value, size_t size) { + set_has_type(); + if (type_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + type_ = new ::std::string; + } + type_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.LayerParameter.type) +} +inline ::std::string* LayerParameter::mutable_type() { + set_has_type(); + if (type_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + type_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.type) + return type_; +} +inline ::std::string* LayerParameter::release_type() { + clear_has_type(); + if (type_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = type_; + type_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void LayerParameter::set_allocated_type(::std::string* type) { + if (type_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete type_; + } + if (type) { + set_has_type(); + type_ = type; + } else { + clear_has_type(); + type_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.LayerParameter.bottom) + return bottom_.Get(index); +} +inline ::std::string* LayerParameter::mutable_bottom(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.bottom) + return bottom_.Mutable(index); +} +inline void LayerParameter::set_bottom(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.LayerParameter.bottom) +} +inline ::std::string* LayerParameter::add_bottom() { + return bottom_.Add(); +} +inline void LayerParameter::add_bottom(const ::std::string& value) { + bottom_.Add()->assign(value); + // @@protoc_insertion_point(field_add:ditcaffe.LayerParameter.bottom) +} +inline void LayerParameter::add_bottom(const char* value) { + bottom_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:ditcaffe.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:ditcaffe.LayerParameter.bottom) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +LayerParameter::bottom() const { + // @@protoc_insertion_point(field_list:ditcaffe.LayerParameter.bottom) + return bottom_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +LayerParameter::mutable_bottom() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.LayerParameter.top) + return top_.Get(index); +} +inline ::std::string* LayerParameter::mutable_top(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.top) + return top_.Mutable(index); +} +inline void LayerParameter::set_top(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.LayerParameter.top) +} +inline ::std::string* LayerParameter::add_top() { + return top_.Add(); +} +inline void LayerParameter::add_top(const ::std::string& value) { + top_.Add()->assign(value); + // @@protoc_insertion_point(field_add:ditcaffe.LayerParameter.top) +} +inline void LayerParameter::add_top(const char* value) { + top_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:ditcaffe.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:ditcaffe.LayerParameter.top) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +LayerParameter::top() const { + // @@protoc_insertion_point(field_list:ditcaffe.LayerParameter.top) + return top_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +LayerParameter::mutable_top() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.LayerParameter.top) + return &top_; +} + +// optional .ditcaffe.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 ::ditcaffe::Phase LayerParameter::phase() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.phase) + return static_cast< ::ditcaffe::Phase >(phase_); +} +inline void LayerParameter::set_phase(::ditcaffe::Phase value) { + assert(::ditcaffe::Phase_IsValid(value)); + set_has_phase(); + phase_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.LayerParameter.loss_weight) +} +inline void LayerParameter::add_loss_weight(float value) { + loss_weight_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.LayerParameter.loss_weight) +} +inline const ::google::protobuf::RepeatedField< float >& +LayerParameter::loss_weight() const { + // @@protoc_insertion_point(field_list:ditcaffe.LayerParameter.loss_weight) + return loss_weight_; +} +inline ::google::protobuf::RepeatedField< float >* +LayerParameter::mutable_loss_weight() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.LayerParameter.loss_weight) + return &loss_weight_; +} + +// repeated .ditcaffe.ParamSpec param = 6; +inline int LayerParameter::param_size() const { + return param_.size(); +} +inline void LayerParameter::clear_param() { + param_.Clear(); +} +inline const ::ditcaffe::ParamSpec& LayerParameter::param(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.param) + return param_.Get(index); +} +inline ::ditcaffe::ParamSpec* LayerParameter::mutable_param(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.param) + return param_.Mutable(index); +} +inline ::ditcaffe::ParamSpec* LayerParameter::add_param() { + // @@protoc_insertion_point(field_add:ditcaffe.LayerParameter.param) + return param_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::ParamSpec >& +LayerParameter::param() const { + // @@protoc_insertion_point(field_list:ditcaffe.LayerParameter.param) + return param_; +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::ParamSpec >* +LayerParameter::mutable_param() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.LayerParameter.param) + return ¶m_; +} + +// repeated .ditcaffe.BlobProto blobs = 7; +inline int LayerParameter::blobs_size() const { + return blobs_.size(); +} +inline void LayerParameter::clear_blobs() { + blobs_.Clear(); +} +inline const ::ditcaffe::BlobProto& LayerParameter::blobs(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.blobs) + return blobs_.Get(index); +} +inline ::ditcaffe::BlobProto* LayerParameter::mutable_blobs(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.blobs) + return blobs_.Mutable(index); +} +inline ::ditcaffe::BlobProto* LayerParameter::add_blobs() { + // @@protoc_insertion_point(field_add:ditcaffe.LayerParameter.blobs) + return blobs_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >& +LayerParameter::blobs() const { + // @@protoc_insertion_point(field_list:ditcaffe.LayerParameter.blobs) + return blobs_; +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >* +LayerParameter::mutable_blobs() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.LayerParameter.propagate_down) +} +inline void LayerParameter::add_propagate_down(bool value) { + propagate_down_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.LayerParameter.propagate_down) +} +inline const ::google::protobuf::RepeatedField< bool >& +LayerParameter::propagate_down() const { + // @@protoc_insertion_point(field_list:ditcaffe.LayerParameter.propagate_down) + return propagate_down_; +} +inline ::google::protobuf::RepeatedField< bool >* +LayerParameter::mutable_propagate_down() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.LayerParameter.propagate_down) + return &propagate_down_; +} + +// repeated .ditcaffe.NetStateRule include = 8; +inline int LayerParameter::include_size() const { + return include_.size(); +} +inline void LayerParameter::clear_include() { + include_.Clear(); +} +inline const ::ditcaffe::NetStateRule& LayerParameter::include(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.include) + return include_.Get(index); +} +inline ::ditcaffe::NetStateRule* LayerParameter::mutable_include(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.include) + return include_.Mutable(index); +} +inline ::ditcaffe::NetStateRule* LayerParameter::add_include() { + // @@protoc_insertion_point(field_add:ditcaffe.LayerParameter.include) + return include_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >& +LayerParameter::include() const { + // @@protoc_insertion_point(field_list:ditcaffe.LayerParameter.include) + return include_; +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >* +LayerParameter::mutable_include() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.LayerParameter.include) + return &include_; +} + +// repeated .ditcaffe.NetStateRule exclude = 9; +inline int LayerParameter::exclude_size() const { + return exclude_.size(); +} +inline void LayerParameter::clear_exclude() { + exclude_.Clear(); +} +inline const ::ditcaffe::NetStateRule& LayerParameter::exclude(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.exclude) + return exclude_.Get(index); +} +inline ::ditcaffe::NetStateRule* LayerParameter::mutable_exclude(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.exclude) + return exclude_.Mutable(index); +} +inline ::ditcaffe::NetStateRule* LayerParameter::add_exclude() { + // @@protoc_insertion_point(field_add:ditcaffe.LayerParameter.exclude) + return exclude_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >& +LayerParameter::exclude() const { + // @@protoc_insertion_point(field_list:ditcaffe.LayerParameter.exclude) + return exclude_; +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >* +LayerParameter::mutable_exclude() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.LayerParameter.exclude) + return &exclude_; +} + +// optional .ditcaffe.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_->::ditcaffe::TransformationParameter::Clear(); + clear_has_transform_param(); +} +inline const ::ditcaffe::TransformationParameter& LayerParameter::transform_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.transform_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return transform_param_ != NULL ? *transform_param_ : *default_instance().transform_param_; +#else + return transform_param_ != NULL ? *transform_param_ : *default_instance_->transform_param_; +#endif +} +inline ::ditcaffe::TransformationParameter* LayerParameter::mutable_transform_param() { + set_has_transform_param(); + if (transform_param_ == NULL) transform_param_ = new ::ditcaffe::TransformationParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.transform_param) + return transform_param_; +} +inline ::ditcaffe::TransformationParameter* LayerParameter::release_transform_param() { + clear_has_transform_param(); + ::ditcaffe::TransformationParameter* temp = transform_param_; + transform_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_transform_param(::ditcaffe::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:ditcaffe.LayerParameter.transform_param) +} + +// optional .ditcaffe.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_->::ditcaffe::LossParameter::Clear(); + clear_has_loss_param(); +} +inline const ::ditcaffe::LossParameter& LayerParameter::loss_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.loss_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return loss_param_ != NULL ? *loss_param_ : *default_instance().loss_param_; +#else + return loss_param_ != NULL ? *loss_param_ : *default_instance_->loss_param_; +#endif +} +inline ::ditcaffe::LossParameter* LayerParameter::mutable_loss_param() { + set_has_loss_param(); + if (loss_param_ == NULL) loss_param_ = new ::ditcaffe::LossParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.loss_param) + return loss_param_; +} +inline ::ditcaffe::LossParameter* LayerParameter::release_loss_param() { + clear_has_loss_param(); + ::ditcaffe::LossParameter* temp = loss_param_; + loss_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_loss_param(::ditcaffe::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:ditcaffe.LayerParameter.loss_param) +} + +// optional .ditcaffe.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_->::ditcaffe::AccuracyParameter::Clear(); + clear_has_accuracy_param(); +} +inline const ::ditcaffe::AccuracyParameter& LayerParameter::accuracy_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.accuracy_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return accuracy_param_ != NULL ? *accuracy_param_ : *default_instance().accuracy_param_; +#else + return accuracy_param_ != NULL ? *accuracy_param_ : *default_instance_->accuracy_param_; +#endif +} +inline ::ditcaffe::AccuracyParameter* LayerParameter::mutable_accuracy_param() { + set_has_accuracy_param(); + if (accuracy_param_ == NULL) accuracy_param_ = new ::ditcaffe::AccuracyParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.accuracy_param) + return accuracy_param_; +} +inline ::ditcaffe::AccuracyParameter* LayerParameter::release_accuracy_param() { + clear_has_accuracy_param(); + ::ditcaffe::AccuracyParameter* temp = accuracy_param_; + accuracy_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_accuracy_param(::ditcaffe::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:ditcaffe.LayerParameter.accuracy_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ArgMaxParameter::Clear(); + clear_has_argmax_param(); +} +inline const ::ditcaffe::ArgMaxParameter& LayerParameter::argmax_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.argmax_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return argmax_param_ != NULL ? *argmax_param_ : *default_instance().argmax_param_; +#else + return argmax_param_ != NULL ? *argmax_param_ : *default_instance_->argmax_param_; +#endif +} +inline ::ditcaffe::ArgMaxParameter* LayerParameter::mutable_argmax_param() { + set_has_argmax_param(); + if (argmax_param_ == NULL) argmax_param_ = new ::ditcaffe::ArgMaxParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.argmax_param) + return argmax_param_; +} +inline ::ditcaffe::ArgMaxParameter* LayerParameter::release_argmax_param() { + clear_has_argmax_param(); + ::ditcaffe::ArgMaxParameter* temp = argmax_param_; + argmax_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_argmax_param(::ditcaffe::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:ditcaffe.LayerParameter.argmax_param) +} + +// optional .ditcaffe.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_->::ditcaffe::BatchNormParameter::Clear(); + clear_has_batch_norm_param(); +} +inline const ::ditcaffe::BatchNormParameter& LayerParameter::batch_norm_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.batch_norm_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return batch_norm_param_ != NULL ? *batch_norm_param_ : *default_instance().batch_norm_param_; +#else + return batch_norm_param_ != NULL ? *batch_norm_param_ : *default_instance_->batch_norm_param_; +#endif +} +inline ::ditcaffe::BatchNormParameter* LayerParameter::mutable_batch_norm_param() { + set_has_batch_norm_param(); + if (batch_norm_param_ == NULL) batch_norm_param_ = new ::ditcaffe::BatchNormParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.batch_norm_param) + return batch_norm_param_; +} +inline ::ditcaffe::BatchNormParameter* LayerParameter::release_batch_norm_param() { + clear_has_batch_norm_param(); + ::ditcaffe::BatchNormParameter* temp = batch_norm_param_; + batch_norm_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_batch_norm_param(::ditcaffe::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:ditcaffe.LayerParameter.batch_norm_param) +} + +// optional .ditcaffe.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_->::ditcaffe::BiasParameter::Clear(); + clear_has_bias_param(); +} +inline const ::ditcaffe::BiasParameter& LayerParameter::bias_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.bias_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return bias_param_ != NULL ? *bias_param_ : *default_instance().bias_param_; +#else + return bias_param_ != NULL ? *bias_param_ : *default_instance_->bias_param_; +#endif +} +inline ::ditcaffe::BiasParameter* LayerParameter::mutable_bias_param() { + set_has_bias_param(); + if (bias_param_ == NULL) bias_param_ = new ::ditcaffe::BiasParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.bias_param) + return bias_param_; +} +inline ::ditcaffe::BiasParameter* LayerParameter::release_bias_param() { + clear_has_bias_param(); + ::ditcaffe::BiasParameter* temp = bias_param_; + bias_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_bias_param(::ditcaffe::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:ditcaffe.LayerParameter.bias_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ConcatParameter::Clear(); + clear_has_concat_param(); +} +inline const ::ditcaffe::ConcatParameter& LayerParameter::concat_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.concat_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return concat_param_ != NULL ? *concat_param_ : *default_instance().concat_param_; +#else + return concat_param_ != NULL ? *concat_param_ : *default_instance_->concat_param_; +#endif +} +inline ::ditcaffe::ConcatParameter* LayerParameter::mutable_concat_param() { + set_has_concat_param(); + if (concat_param_ == NULL) concat_param_ = new ::ditcaffe::ConcatParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.concat_param) + return concat_param_; +} +inline ::ditcaffe::ConcatParameter* LayerParameter::release_concat_param() { + clear_has_concat_param(); + ::ditcaffe::ConcatParameter* temp = concat_param_; + concat_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_concat_param(::ditcaffe::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:ditcaffe.LayerParameter.concat_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ContrastiveLossParameter::Clear(); + clear_has_contrastive_loss_param(); +} +inline const ::ditcaffe::ContrastiveLossParameter& LayerParameter::contrastive_loss_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.contrastive_loss_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return contrastive_loss_param_ != NULL ? *contrastive_loss_param_ : *default_instance().contrastive_loss_param_; +#else + return contrastive_loss_param_ != NULL ? *contrastive_loss_param_ : *default_instance_->contrastive_loss_param_; +#endif +} +inline ::ditcaffe::ContrastiveLossParameter* LayerParameter::mutable_contrastive_loss_param() { + set_has_contrastive_loss_param(); + if (contrastive_loss_param_ == NULL) contrastive_loss_param_ = new ::ditcaffe::ContrastiveLossParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.contrastive_loss_param) + return contrastive_loss_param_; +} +inline ::ditcaffe::ContrastiveLossParameter* LayerParameter::release_contrastive_loss_param() { + clear_has_contrastive_loss_param(); + ::ditcaffe::ContrastiveLossParameter* temp = contrastive_loss_param_; + contrastive_loss_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_contrastive_loss_param(::ditcaffe::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:ditcaffe.LayerParameter.contrastive_loss_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ConvolutionParameter::Clear(); + clear_has_convolution_param(); +} +inline const ::ditcaffe::ConvolutionParameter& LayerParameter::convolution_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.convolution_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return convolution_param_ != NULL ? *convolution_param_ : *default_instance().convolution_param_; +#else + return convolution_param_ != NULL ? *convolution_param_ : *default_instance_->convolution_param_; +#endif +} +inline ::ditcaffe::ConvolutionParameter* LayerParameter::mutable_convolution_param() { + set_has_convolution_param(); + if (convolution_param_ == NULL) convolution_param_ = new ::ditcaffe::ConvolutionParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.convolution_param) + return convolution_param_; +} +inline ::ditcaffe::ConvolutionParameter* LayerParameter::release_convolution_param() { + clear_has_convolution_param(); + ::ditcaffe::ConvolutionParameter* temp = convolution_param_; + convolution_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_convolution_param(::ditcaffe::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:ditcaffe.LayerParameter.convolution_param) +} + +// optional .ditcaffe.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_->::ditcaffe::CropParameter::Clear(); + clear_has_crop_param(); +} +inline const ::ditcaffe::CropParameter& LayerParameter::crop_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.crop_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return crop_param_ != NULL ? *crop_param_ : *default_instance().crop_param_; +#else + return crop_param_ != NULL ? *crop_param_ : *default_instance_->crop_param_; +#endif +} +inline ::ditcaffe::CropParameter* LayerParameter::mutable_crop_param() { + set_has_crop_param(); + if (crop_param_ == NULL) crop_param_ = new ::ditcaffe::CropParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.crop_param) + return crop_param_; +} +inline ::ditcaffe::CropParameter* LayerParameter::release_crop_param() { + clear_has_crop_param(); + ::ditcaffe::CropParameter* temp = crop_param_; + crop_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_crop_param(::ditcaffe::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:ditcaffe.LayerParameter.crop_param) +} + +// optional .ditcaffe.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_->::ditcaffe::DataParameter::Clear(); + clear_has_data_param(); +} +inline const ::ditcaffe::DataParameter& LayerParameter::data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.data_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return data_param_ != NULL ? *data_param_ : *default_instance().data_param_; +#else + return data_param_ != NULL ? *data_param_ : *default_instance_->data_param_; +#endif +} +inline ::ditcaffe::DataParameter* LayerParameter::mutable_data_param() { + set_has_data_param(); + if (data_param_ == NULL) data_param_ = new ::ditcaffe::DataParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.data_param) + return data_param_; +} +inline ::ditcaffe::DataParameter* LayerParameter::release_data_param() { + clear_has_data_param(); + ::ditcaffe::DataParameter* temp = data_param_; + data_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_data_param(::ditcaffe::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:ditcaffe.LayerParameter.data_param) +} + +// optional .ditcaffe.DropoutParameter dropout_param = 108; +inline bool LayerParameter::has_dropout_param() const { + return (_has_bits_[0] & 0x00400000u) != 0; +} +inline void LayerParameter::set_has_dropout_param() { + _has_bits_[0] |= 0x00400000u; +} +inline void LayerParameter::clear_has_dropout_param() { + _has_bits_[0] &= ~0x00400000u; +} +inline void LayerParameter::clear_dropout_param() { + if (dropout_param_ != NULL) dropout_param_->::ditcaffe::DropoutParameter::Clear(); + clear_has_dropout_param(); +} +inline const ::ditcaffe::DropoutParameter& LayerParameter::dropout_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.dropout_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return dropout_param_ != NULL ? *dropout_param_ : *default_instance().dropout_param_; +#else + return dropout_param_ != NULL ? *dropout_param_ : *default_instance_->dropout_param_; +#endif +} +inline ::ditcaffe::DropoutParameter* LayerParameter::mutable_dropout_param() { + set_has_dropout_param(); + if (dropout_param_ == NULL) dropout_param_ = new ::ditcaffe::DropoutParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.dropout_param) + return dropout_param_; +} +inline ::ditcaffe::DropoutParameter* LayerParameter::release_dropout_param() { + clear_has_dropout_param(); + ::ditcaffe::DropoutParameter* temp = dropout_param_; + dropout_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_dropout_param(::ditcaffe::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:ditcaffe.LayerParameter.dropout_param) +} + +// optional .ditcaffe.DummyDataParameter dummy_data_param = 109; +inline bool LayerParameter::has_dummy_data_param() const { + return (_has_bits_[0] & 0x00800000u) != 0; +} +inline void LayerParameter::set_has_dummy_data_param() { + _has_bits_[0] |= 0x00800000u; +} +inline void LayerParameter::clear_has_dummy_data_param() { + _has_bits_[0] &= ~0x00800000u; +} +inline void LayerParameter::clear_dummy_data_param() { + if (dummy_data_param_ != NULL) dummy_data_param_->::ditcaffe::DummyDataParameter::Clear(); + clear_has_dummy_data_param(); +} +inline const ::ditcaffe::DummyDataParameter& LayerParameter::dummy_data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.dummy_data_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return dummy_data_param_ != NULL ? *dummy_data_param_ : *default_instance().dummy_data_param_; +#else + return dummy_data_param_ != NULL ? *dummy_data_param_ : *default_instance_->dummy_data_param_; +#endif +} +inline ::ditcaffe::DummyDataParameter* LayerParameter::mutable_dummy_data_param() { + set_has_dummy_data_param(); + if (dummy_data_param_ == NULL) dummy_data_param_ = new ::ditcaffe::DummyDataParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.dummy_data_param) + return dummy_data_param_; +} +inline ::ditcaffe::DummyDataParameter* LayerParameter::release_dummy_data_param() { + clear_has_dummy_data_param(); + ::ditcaffe::DummyDataParameter* temp = dummy_data_param_; + dummy_data_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_dummy_data_param(::ditcaffe::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:ditcaffe.LayerParameter.dummy_data_param) +} + +// optional .ditcaffe.EltwiseParameter eltwise_param = 110; +inline bool LayerParameter::has_eltwise_param() const { + return (_has_bits_[0] & 0x01000000u) != 0; +} +inline void LayerParameter::set_has_eltwise_param() { + _has_bits_[0] |= 0x01000000u; +} +inline void LayerParameter::clear_has_eltwise_param() { + _has_bits_[0] &= ~0x01000000u; +} +inline void LayerParameter::clear_eltwise_param() { + if (eltwise_param_ != NULL) eltwise_param_->::ditcaffe::EltwiseParameter::Clear(); + clear_has_eltwise_param(); +} +inline const ::ditcaffe::EltwiseParameter& LayerParameter::eltwise_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.eltwise_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return eltwise_param_ != NULL ? *eltwise_param_ : *default_instance().eltwise_param_; +#else + return eltwise_param_ != NULL ? *eltwise_param_ : *default_instance_->eltwise_param_; +#endif +} +inline ::ditcaffe::EltwiseParameter* LayerParameter::mutable_eltwise_param() { + set_has_eltwise_param(); + if (eltwise_param_ == NULL) eltwise_param_ = new ::ditcaffe::EltwiseParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.eltwise_param) + return eltwise_param_; +} +inline ::ditcaffe::EltwiseParameter* LayerParameter::release_eltwise_param() { + clear_has_eltwise_param(); + ::ditcaffe::EltwiseParameter* temp = eltwise_param_; + eltwise_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_eltwise_param(::ditcaffe::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:ditcaffe.LayerParameter.eltwise_param) +} + +// optional .ditcaffe.ELUParameter elu_param = 140; +inline bool LayerParameter::has_elu_param() const { + return (_has_bits_[0] & 0x02000000u) != 0; +} +inline void LayerParameter::set_has_elu_param() { + _has_bits_[0] |= 0x02000000u; +} +inline void LayerParameter::clear_has_elu_param() { + _has_bits_[0] &= ~0x02000000u; +} +inline void LayerParameter::clear_elu_param() { + if (elu_param_ != NULL) elu_param_->::ditcaffe::ELUParameter::Clear(); + clear_has_elu_param(); +} +inline const ::ditcaffe::ELUParameter& LayerParameter::elu_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.elu_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return elu_param_ != NULL ? *elu_param_ : *default_instance().elu_param_; +#else + return elu_param_ != NULL ? *elu_param_ : *default_instance_->elu_param_; +#endif +} +inline ::ditcaffe::ELUParameter* LayerParameter::mutable_elu_param() { + set_has_elu_param(); + if (elu_param_ == NULL) elu_param_ = new ::ditcaffe::ELUParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.elu_param) + return elu_param_; +} +inline ::ditcaffe::ELUParameter* LayerParameter::release_elu_param() { + clear_has_elu_param(); + ::ditcaffe::ELUParameter* temp = elu_param_; + elu_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_elu_param(::ditcaffe::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:ditcaffe.LayerParameter.elu_param) +} + +// optional .ditcaffe.EmbedParameter embed_param = 137; +inline bool LayerParameter::has_embed_param() const { + return (_has_bits_[0] & 0x04000000u) != 0; +} +inline void LayerParameter::set_has_embed_param() { + _has_bits_[0] |= 0x04000000u; +} +inline void LayerParameter::clear_has_embed_param() { + _has_bits_[0] &= ~0x04000000u; +} +inline void LayerParameter::clear_embed_param() { + if (embed_param_ != NULL) embed_param_->::ditcaffe::EmbedParameter::Clear(); + clear_has_embed_param(); +} +inline const ::ditcaffe::EmbedParameter& LayerParameter::embed_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.embed_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return embed_param_ != NULL ? *embed_param_ : *default_instance().embed_param_; +#else + return embed_param_ != NULL ? *embed_param_ : *default_instance_->embed_param_; +#endif +} +inline ::ditcaffe::EmbedParameter* LayerParameter::mutable_embed_param() { + set_has_embed_param(); + if (embed_param_ == NULL) embed_param_ = new ::ditcaffe::EmbedParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.embed_param) + return embed_param_; +} +inline ::ditcaffe::EmbedParameter* LayerParameter::release_embed_param() { + clear_has_embed_param(); + ::ditcaffe::EmbedParameter* temp = embed_param_; + embed_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_embed_param(::ditcaffe::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:ditcaffe.LayerParameter.embed_param) +} + +// optional .ditcaffe.ExpParameter exp_param = 111; +inline bool LayerParameter::has_exp_param() const { + return (_has_bits_[0] & 0x08000000u) != 0; +} +inline void LayerParameter::set_has_exp_param() { + _has_bits_[0] |= 0x08000000u; +} +inline void LayerParameter::clear_has_exp_param() { + _has_bits_[0] &= ~0x08000000u; +} +inline void LayerParameter::clear_exp_param() { + if (exp_param_ != NULL) exp_param_->::ditcaffe::ExpParameter::Clear(); + clear_has_exp_param(); +} +inline const ::ditcaffe::ExpParameter& LayerParameter::exp_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.exp_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return exp_param_ != NULL ? *exp_param_ : *default_instance().exp_param_; +#else + return exp_param_ != NULL ? *exp_param_ : *default_instance_->exp_param_; +#endif +} +inline ::ditcaffe::ExpParameter* LayerParameter::mutable_exp_param() { + set_has_exp_param(); + if (exp_param_ == NULL) exp_param_ = new ::ditcaffe::ExpParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.exp_param) + return exp_param_; +} +inline ::ditcaffe::ExpParameter* LayerParameter::release_exp_param() { + clear_has_exp_param(); + ::ditcaffe::ExpParameter* temp = exp_param_; + exp_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_exp_param(::ditcaffe::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:ditcaffe.LayerParameter.exp_param) +} + +// optional .ditcaffe.FlattenParameter flatten_param = 135; +inline bool LayerParameter::has_flatten_param() const { + return (_has_bits_[0] & 0x10000000u) != 0; +} +inline void LayerParameter::set_has_flatten_param() { + _has_bits_[0] |= 0x10000000u; +} +inline void LayerParameter::clear_has_flatten_param() { + _has_bits_[0] &= ~0x10000000u; +} +inline void LayerParameter::clear_flatten_param() { + if (flatten_param_ != NULL) flatten_param_->::ditcaffe::FlattenParameter::Clear(); + clear_has_flatten_param(); +} +inline const ::ditcaffe::FlattenParameter& LayerParameter::flatten_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.flatten_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return flatten_param_ != NULL ? *flatten_param_ : *default_instance().flatten_param_; +#else + return flatten_param_ != NULL ? *flatten_param_ : *default_instance_->flatten_param_; +#endif +} +inline ::ditcaffe::FlattenParameter* LayerParameter::mutable_flatten_param() { + set_has_flatten_param(); + if (flatten_param_ == NULL) flatten_param_ = new ::ditcaffe::FlattenParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.flatten_param) + return flatten_param_; +} +inline ::ditcaffe::FlattenParameter* LayerParameter::release_flatten_param() { + clear_has_flatten_param(); + ::ditcaffe::FlattenParameter* temp = flatten_param_; + flatten_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_flatten_param(::ditcaffe::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:ditcaffe.LayerParameter.flatten_param) +} + +// optional .ditcaffe.HDF5DataParameter hdf5_data_param = 112; +inline bool LayerParameter::has_hdf5_data_param() const { + return (_has_bits_[0] & 0x20000000u) != 0; +} +inline void LayerParameter::set_has_hdf5_data_param() { + _has_bits_[0] |= 0x20000000u; +} +inline void LayerParameter::clear_has_hdf5_data_param() { + _has_bits_[0] &= ~0x20000000u; +} +inline void LayerParameter::clear_hdf5_data_param() { + if (hdf5_data_param_ != NULL) hdf5_data_param_->::ditcaffe::HDF5DataParameter::Clear(); + clear_has_hdf5_data_param(); +} +inline const ::ditcaffe::HDF5DataParameter& LayerParameter::hdf5_data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.hdf5_data_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return hdf5_data_param_ != NULL ? *hdf5_data_param_ : *default_instance().hdf5_data_param_; +#else + return hdf5_data_param_ != NULL ? *hdf5_data_param_ : *default_instance_->hdf5_data_param_; +#endif +} +inline ::ditcaffe::HDF5DataParameter* LayerParameter::mutable_hdf5_data_param() { + set_has_hdf5_data_param(); + if (hdf5_data_param_ == NULL) hdf5_data_param_ = new ::ditcaffe::HDF5DataParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.hdf5_data_param) + return hdf5_data_param_; +} +inline ::ditcaffe::HDF5DataParameter* LayerParameter::release_hdf5_data_param() { + clear_has_hdf5_data_param(); + ::ditcaffe::HDF5DataParameter* temp = hdf5_data_param_; + hdf5_data_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_hdf5_data_param(::ditcaffe::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:ditcaffe.LayerParameter.hdf5_data_param) +} + +// optional .ditcaffe.HDF5OutputParameter hdf5_output_param = 113; +inline bool LayerParameter::has_hdf5_output_param() const { + return (_has_bits_[0] & 0x40000000u) != 0; +} +inline void LayerParameter::set_has_hdf5_output_param() { + _has_bits_[0] |= 0x40000000u; +} +inline void LayerParameter::clear_has_hdf5_output_param() { + _has_bits_[0] &= ~0x40000000u; +} +inline void LayerParameter::clear_hdf5_output_param() { + if (hdf5_output_param_ != NULL) hdf5_output_param_->::ditcaffe::HDF5OutputParameter::Clear(); + clear_has_hdf5_output_param(); +} +inline const ::ditcaffe::HDF5OutputParameter& LayerParameter::hdf5_output_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.hdf5_output_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return hdf5_output_param_ != NULL ? *hdf5_output_param_ : *default_instance().hdf5_output_param_; +#else + return hdf5_output_param_ != NULL ? *hdf5_output_param_ : *default_instance_->hdf5_output_param_; +#endif +} +inline ::ditcaffe::HDF5OutputParameter* LayerParameter::mutable_hdf5_output_param() { + set_has_hdf5_output_param(); + if (hdf5_output_param_ == NULL) hdf5_output_param_ = new ::ditcaffe::HDF5OutputParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.hdf5_output_param) + return hdf5_output_param_; +} +inline ::ditcaffe::HDF5OutputParameter* LayerParameter::release_hdf5_output_param() { + clear_has_hdf5_output_param(); + ::ditcaffe::HDF5OutputParameter* temp = hdf5_output_param_; + hdf5_output_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_hdf5_output_param(::ditcaffe::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:ditcaffe.LayerParameter.hdf5_output_param) +} + +// optional .ditcaffe.HingeLossParameter hinge_loss_param = 114; +inline bool LayerParameter::has_hinge_loss_param() const { + return (_has_bits_[0] & 0x80000000u) != 0; +} +inline void LayerParameter::set_has_hinge_loss_param() { + _has_bits_[0] |= 0x80000000u; +} +inline void LayerParameter::clear_has_hinge_loss_param() { + _has_bits_[0] &= ~0x80000000u; +} +inline void LayerParameter::clear_hinge_loss_param() { + if (hinge_loss_param_ != NULL) hinge_loss_param_->::ditcaffe::HingeLossParameter::Clear(); + clear_has_hinge_loss_param(); +} +inline const ::ditcaffe::HingeLossParameter& LayerParameter::hinge_loss_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.hinge_loss_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return hinge_loss_param_ != NULL ? *hinge_loss_param_ : *default_instance().hinge_loss_param_; +#else + return hinge_loss_param_ != NULL ? *hinge_loss_param_ : *default_instance_->hinge_loss_param_; +#endif +} +inline ::ditcaffe::HingeLossParameter* LayerParameter::mutable_hinge_loss_param() { + set_has_hinge_loss_param(); + if (hinge_loss_param_ == NULL) hinge_loss_param_ = new ::ditcaffe::HingeLossParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.hinge_loss_param) + return hinge_loss_param_; +} +inline ::ditcaffe::HingeLossParameter* LayerParameter::release_hinge_loss_param() { + clear_has_hinge_loss_param(); + ::ditcaffe::HingeLossParameter* temp = hinge_loss_param_; + hinge_loss_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_hinge_loss_param(::ditcaffe::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:ditcaffe.LayerParameter.hinge_loss_param) +} + +// optional .ditcaffe.ImageDataParameter image_data_param = 115; +inline bool LayerParameter::has_image_data_param() const { + return (_has_bits_[1] & 0x00000001u) != 0; +} +inline void LayerParameter::set_has_image_data_param() { + _has_bits_[1] |= 0x00000001u; +} +inline void LayerParameter::clear_has_image_data_param() { + _has_bits_[1] &= ~0x00000001u; +} +inline void LayerParameter::clear_image_data_param() { + if (image_data_param_ != NULL) image_data_param_->::ditcaffe::ImageDataParameter::Clear(); + clear_has_image_data_param(); +} +inline const ::ditcaffe::ImageDataParameter& LayerParameter::image_data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.image_data_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return image_data_param_ != NULL ? *image_data_param_ : *default_instance().image_data_param_; +#else + return image_data_param_ != NULL ? *image_data_param_ : *default_instance_->image_data_param_; +#endif +} +inline ::ditcaffe::ImageDataParameter* LayerParameter::mutable_image_data_param() { + set_has_image_data_param(); + if (image_data_param_ == NULL) image_data_param_ = new ::ditcaffe::ImageDataParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.image_data_param) + return image_data_param_; +} +inline ::ditcaffe::ImageDataParameter* LayerParameter::release_image_data_param() { + clear_has_image_data_param(); + ::ditcaffe::ImageDataParameter* temp = image_data_param_; + image_data_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_image_data_param(::ditcaffe::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:ditcaffe.LayerParameter.image_data_param) +} + +// optional .ditcaffe.InfogainLossParameter infogain_loss_param = 116; +inline bool LayerParameter::has_infogain_loss_param() const { + return (_has_bits_[1] & 0x00000002u) != 0; +} +inline void LayerParameter::set_has_infogain_loss_param() { + _has_bits_[1] |= 0x00000002u; +} +inline void LayerParameter::clear_has_infogain_loss_param() { + _has_bits_[1] &= ~0x00000002u; +} +inline void LayerParameter::clear_infogain_loss_param() { + if (infogain_loss_param_ != NULL) infogain_loss_param_->::ditcaffe::InfogainLossParameter::Clear(); + clear_has_infogain_loss_param(); +} +inline const ::ditcaffe::InfogainLossParameter& LayerParameter::infogain_loss_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.infogain_loss_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return infogain_loss_param_ != NULL ? *infogain_loss_param_ : *default_instance().infogain_loss_param_; +#else + return infogain_loss_param_ != NULL ? *infogain_loss_param_ : *default_instance_->infogain_loss_param_; +#endif +} +inline ::ditcaffe::InfogainLossParameter* LayerParameter::mutable_infogain_loss_param() { + set_has_infogain_loss_param(); + if (infogain_loss_param_ == NULL) infogain_loss_param_ = new ::ditcaffe::InfogainLossParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.infogain_loss_param) + return infogain_loss_param_; +} +inline ::ditcaffe::InfogainLossParameter* LayerParameter::release_infogain_loss_param() { + clear_has_infogain_loss_param(); + ::ditcaffe::InfogainLossParameter* temp = infogain_loss_param_; + infogain_loss_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_infogain_loss_param(::ditcaffe::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:ditcaffe.LayerParameter.infogain_loss_param) +} + +// optional .ditcaffe.InnerProductParameter inner_product_param = 117; +inline bool LayerParameter::has_inner_product_param() const { + return (_has_bits_[1] & 0x00000004u) != 0; +} +inline void LayerParameter::set_has_inner_product_param() { + _has_bits_[1] |= 0x00000004u; +} +inline void LayerParameter::clear_has_inner_product_param() { + _has_bits_[1] &= ~0x00000004u; +} +inline void LayerParameter::clear_inner_product_param() { + if (inner_product_param_ != NULL) inner_product_param_->::ditcaffe::InnerProductParameter::Clear(); + clear_has_inner_product_param(); +} +inline const ::ditcaffe::InnerProductParameter& LayerParameter::inner_product_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.inner_product_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return inner_product_param_ != NULL ? *inner_product_param_ : *default_instance().inner_product_param_; +#else + return inner_product_param_ != NULL ? *inner_product_param_ : *default_instance_->inner_product_param_; +#endif +} +inline ::ditcaffe::InnerProductParameter* LayerParameter::mutable_inner_product_param() { + set_has_inner_product_param(); + if (inner_product_param_ == NULL) inner_product_param_ = new ::ditcaffe::InnerProductParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.inner_product_param) + return inner_product_param_; +} +inline ::ditcaffe::InnerProductParameter* LayerParameter::release_inner_product_param() { + clear_has_inner_product_param(); + ::ditcaffe::InnerProductParameter* temp = inner_product_param_; + inner_product_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_inner_product_param(::ditcaffe::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:ditcaffe.LayerParameter.inner_product_param) +} + +// optional .ditcaffe.InputParameter input_param = 143; +inline bool LayerParameter::has_input_param() const { + return (_has_bits_[1] & 0x00000008u) != 0; +} +inline void LayerParameter::set_has_input_param() { + _has_bits_[1] |= 0x00000008u; +} +inline void LayerParameter::clear_has_input_param() { + _has_bits_[1] &= ~0x00000008u; +} +inline void LayerParameter::clear_input_param() { + if (input_param_ != NULL) input_param_->::ditcaffe::InputParameter::Clear(); + clear_has_input_param(); +} +inline const ::ditcaffe::InputParameter& LayerParameter::input_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.input_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return input_param_ != NULL ? *input_param_ : *default_instance().input_param_; +#else + return input_param_ != NULL ? *input_param_ : *default_instance_->input_param_; +#endif +} +inline ::ditcaffe::InputParameter* LayerParameter::mutable_input_param() { + set_has_input_param(); + if (input_param_ == NULL) input_param_ = new ::ditcaffe::InputParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.input_param) + return input_param_; +} +inline ::ditcaffe::InputParameter* LayerParameter::release_input_param() { + clear_has_input_param(); + ::ditcaffe::InputParameter* temp = input_param_; + input_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_input_param(::ditcaffe::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:ditcaffe.LayerParameter.input_param) +} + +// optional .ditcaffe.LogParameter log_param = 134; +inline bool LayerParameter::has_log_param() const { + return (_has_bits_[1] & 0x00000010u) != 0; +} +inline void LayerParameter::set_has_log_param() { + _has_bits_[1] |= 0x00000010u; +} +inline void LayerParameter::clear_has_log_param() { + _has_bits_[1] &= ~0x00000010u; +} +inline void LayerParameter::clear_log_param() { + if (log_param_ != NULL) log_param_->::ditcaffe::LogParameter::Clear(); + clear_has_log_param(); +} +inline const ::ditcaffe::LogParameter& LayerParameter::log_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.log_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return log_param_ != NULL ? *log_param_ : *default_instance().log_param_; +#else + return log_param_ != NULL ? *log_param_ : *default_instance_->log_param_; +#endif +} +inline ::ditcaffe::LogParameter* LayerParameter::mutable_log_param() { + set_has_log_param(); + if (log_param_ == NULL) log_param_ = new ::ditcaffe::LogParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.log_param) + return log_param_; +} +inline ::ditcaffe::LogParameter* LayerParameter::release_log_param() { + clear_has_log_param(); + ::ditcaffe::LogParameter* temp = log_param_; + log_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_log_param(::ditcaffe::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:ditcaffe.LayerParameter.log_param) +} + +// optional .ditcaffe.LRNParameter lrn_param = 118; +inline bool LayerParameter::has_lrn_param() const { + return (_has_bits_[1] & 0x00000020u) != 0; +} +inline void LayerParameter::set_has_lrn_param() { + _has_bits_[1] |= 0x00000020u; +} +inline void LayerParameter::clear_has_lrn_param() { + _has_bits_[1] &= ~0x00000020u; +} +inline void LayerParameter::clear_lrn_param() { + if (lrn_param_ != NULL) lrn_param_->::ditcaffe::LRNParameter::Clear(); + clear_has_lrn_param(); +} +inline const ::ditcaffe::LRNParameter& LayerParameter::lrn_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.lrn_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return lrn_param_ != NULL ? *lrn_param_ : *default_instance().lrn_param_; +#else + return lrn_param_ != NULL ? *lrn_param_ : *default_instance_->lrn_param_; +#endif +} +inline ::ditcaffe::LRNParameter* LayerParameter::mutable_lrn_param() { + set_has_lrn_param(); + if (lrn_param_ == NULL) lrn_param_ = new ::ditcaffe::LRNParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.lrn_param) + return lrn_param_; +} +inline ::ditcaffe::LRNParameter* LayerParameter::release_lrn_param() { + clear_has_lrn_param(); + ::ditcaffe::LRNParameter* temp = lrn_param_; + lrn_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_lrn_param(::ditcaffe::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:ditcaffe.LayerParameter.lrn_param) +} + +// optional .ditcaffe.MemoryDataParameter memory_data_param = 119; +inline bool LayerParameter::has_memory_data_param() const { + return (_has_bits_[1] & 0x00000040u) != 0; +} +inline void LayerParameter::set_has_memory_data_param() { + _has_bits_[1] |= 0x00000040u; +} +inline void LayerParameter::clear_has_memory_data_param() { + _has_bits_[1] &= ~0x00000040u; +} +inline void LayerParameter::clear_memory_data_param() { + if (memory_data_param_ != NULL) memory_data_param_->::ditcaffe::MemoryDataParameter::Clear(); + clear_has_memory_data_param(); +} +inline const ::ditcaffe::MemoryDataParameter& LayerParameter::memory_data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.memory_data_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return memory_data_param_ != NULL ? *memory_data_param_ : *default_instance().memory_data_param_; +#else + return memory_data_param_ != NULL ? *memory_data_param_ : *default_instance_->memory_data_param_; +#endif +} +inline ::ditcaffe::MemoryDataParameter* LayerParameter::mutable_memory_data_param() { + set_has_memory_data_param(); + if (memory_data_param_ == NULL) memory_data_param_ = new ::ditcaffe::MemoryDataParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.memory_data_param) + return memory_data_param_; +} +inline ::ditcaffe::MemoryDataParameter* LayerParameter::release_memory_data_param() { + clear_has_memory_data_param(); + ::ditcaffe::MemoryDataParameter* temp = memory_data_param_; + memory_data_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_memory_data_param(::ditcaffe::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:ditcaffe.LayerParameter.memory_data_param) +} + +// optional .ditcaffe.MVNParameter mvn_param = 120; +inline bool LayerParameter::has_mvn_param() const { + return (_has_bits_[1] & 0x00000080u) != 0; +} +inline void LayerParameter::set_has_mvn_param() { + _has_bits_[1] |= 0x00000080u; +} +inline void LayerParameter::clear_has_mvn_param() { + _has_bits_[1] &= ~0x00000080u; +} +inline void LayerParameter::clear_mvn_param() { + if (mvn_param_ != NULL) mvn_param_->::ditcaffe::MVNParameter::Clear(); + clear_has_mvn_param(); +} +inline const ::ditcaffe::MVNParameter& LayerParameter::mvn_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.mvn_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return mvn_param_ != NULL ? *mvn_param_ : *default_instance().mvn_param_; +#else + return mvn_param_ != NULL ? *mvn_param_ : *default_instance_->mvn_param_; +#endif +} +inline ::ditcaffe::MVNParameter* LayerParameter::mutable_mvn_param() { + set_has_mvn_param(); + if (mvn_param_ == NULL) mvn_param_ = new ::ditcaffe::MVNParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.mvn_param) + return mvn_param_; +} +inline ::ditcaffe::MVNParameter* LayerParameter::release_mvn_param() { + clear_has_mvn_param(); + ::ditcaffe::MVNParameter* temp = mvn_param_; + mvn_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_mvn_param(::ditcaffe::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:ditcaffe.LayerParameter.mvn_param) +} + +// optional .ditcaffe.ParameterParameter parameter_param = 145; +inline bool LayerParameter::has_parameter_param() const { + return (_has_bits_[1] & 0x00000100u) != 0; +} +inline void LayerParameter::set_has_parameter_param() { + _has_bits_[1] |= 0x00000100u; +} +inline void LayerParameter::clear_has_parameter_param() { + _has_bits_[1] &= ~0x00000100u; +} +inline void LayerParameter::clear_parameter_param() { + if (parameter_param_ != NULL) parameter_param_->::ditcaffe::ParameterParameter::Clear(); + clear_has_parameter_param(); +} +inline const ::ditcaffe::ParameterParameter& LayerParameter::parameter_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.parameter_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return parameter_param_ != NULL ? *parameter_param_ : *default_instance().parameter_param_; +#else + return parameter_param_ != NULL ? *parameter_param_ : *default_instance_->parameter_param_; +#endif +} +inline ::ditcaffe::ParameterParameter* LayerParameter::mutable_parameter_param() { + set_has_parameter_param(); + if (parameter_param_ == NULL) parameter_param_ = new ::ditcaffe::ParameterParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.parameter_param) + return parameter_param_; +} +inline ::ditcaffe::ParameterParameter* LayerParameter::release_parameter_param() { + clear_has_parameter_param(); + ::ditcaffe::ParameterParameter* temp = parameter_param_; + parameter_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_parameter_param(::ditcaffe::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:ditcaffe.LayerParameter.parameter_param) +} + +// optional .ditcaffe.PoolingParameter pooling_param = 121; +inline bool LayerParameter::has_pooling_param() const { + return (_has_bits_[1] & 0x00000200u) != 0; +} +inline void LayerParameter::set_has_pooling_param() { + _has_bits_[1] |= 0x00000200u; +} +inline void LayerParameter::clear_has_pooling_param() { + _has_bits_[1] &= ~0x00000200u; +} +inline void LayerParameter::clear_pooling_param() { + if (pooling_param_ != NULL) pooling_param_->::ditcaffe::PoolingParameter::Clear(); + clear_has_pooling_param(); +} +inline const ::ditcaffe::PoolingParameter& LayerParameter::pooling_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.pooling_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return pooling_param_ != NULL ? *pooling_param_ : *default_instance().pooling_param_; +#else + return pooling_param_ != NULL ? *pooling_param_ : *default_instance_->pooling_param_; +#endif +} +inline ::ditcaffe::PoolingParameter* LayerParameter::mutable_pooling_param() { + set_has_pooling_param(); + if (pooling_param_ == NULL) pooling_param_ = new ::ditcaffe::PoolingParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.pooling_param) + return pooling_param_; +} +inline ::ditcaffe::PoolingParameter* LayerParameter::release_pooling_param() { + clear_has_pooling_param(); + ::ditcaffe::PoolingParameter* temp = pooling_param_; + pooling_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_pooling_param(::ditcaffe::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:ditcaffe.LayerParameter.pooling_param) +} + +// optional .ditcaffe.PowerParameter power_param = 122; +inline bool LayerParameter::has_power_param() const { + return (_has_bits_[1] & 0x00000400u) != 0; +} +inline void LayerParameter::set_has_power_param() { + _has_bits_[1] |= 0x00000400u; +} +inline void LayerParameter::clear_has_power_param() { + _has_bits_[1] &= ~0x00000400u; +} +inline void LayerParameter::clear_power_param() { + if (power_param_ != NULL) power_param_->::ditcaffe::PowerParameter::Clear(); + clear_has_power_param(); +} +inline const ::ditcaffe::PowerParameter& LayerParameter::power_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.power_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return power_param_ != NULL ? *power_param_ : *default_instance().power_param_; +#else + return power_param_ != NULL ? *power_param_ : *default_instance_->power_param_; +#endif +} +inline ::ditcaffe::PowerParameter* LayerParameter::mutable_power_param() { + set_has_power_param(); + if (power_param_ == NULL) power_param_ = new ::ditcaffe::PowerParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.power_param) + return power_param_; +} +inline ::ditcaffe::PowerParameter* LayerParameter::release_power_param() { + clear_has_power_param(); + ::ditcaffe::PowerParameter* temp = power_param_; + power_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_power_param(::ditcaffe::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:ditcaffe.LayerParameter.power_param) +} + +// optional .ditcaffe.PReLUParameter prelu_param = 131; +inline bool LayerParameter::has_prelu_param() const { + return (_has_bits_[1] & 0x00000800u) != 0; +} +inline void LayerParameter::set_has_prelu_param() { + _has_bits_[1] |= 0x00000800u; +} +inline void LayerParameter::clear_has_prelu_param() { + _has_bits_[1] &= ~0x00000800u; +} +inline void LayerParameter::clear_prelu_param() { + if (prelu_param_ != NULL) prelu_param_->::ditcaffe::PReLUParameter::Clear(); + clear_has_prelu_param(); +} +inline const ::ditcaffe::PReLUParameter& LayerParameter::prelu_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.prelu_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return prelu_param_ != NULL ? *prelu_param_ : *default_instance().prelu_param_; +#else + return prelu_param_ != NULL ? *prelu_param_ : *default_instance_->prelu_param_; +#endif +} +inline ::ditcaffe::PReLUParameter* LayerParameter::mutable_prelu_param() { + set_has_prelu_param(); + if (prelu_param_ == NULL) prelu_param_ = new ::ditcaffe::PReLUParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.prelu_param) + return prelu_param_; +} +inline ::ditcaffe::PReLUParameter* LayerParameter::release_prelu_param() { + clear_has_prelu_param(); + ::ditcaffe::PReLUParameter* temp = prelu_param_; + prelu_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_prelu_param(::ditcaffe::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:ditcaffe.LayerParameter.prelu_param) +} + +// optional .ditcaffe.PythonParameter python_param = 130; +inline bool LayerParameter::has_python_param() const { + return (_has_bits_[1] & 0x00001000u) != 0; +} +inline void LayerParameter::set_has_python_param() { + _has_bits_[1] |= 0x00001000u; +} +inline void LayerParameter::clear_has_python_param() { + _has_bits_[1] &= ~0x00001000u; +} +inline void LayerParameter::clear_python_param() { + if (python_param_ != NULL) python_param_->::ditcaffe::PythonParameter::Clear(); + clear_has_python_param(); +} +inline const ::ditcaffe::PythonParameter& LayerParameter::python_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.python_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return python_param_ != NULL ? *python_param_ : *default_instance().python_param_; +#else + return python_param_ != NULL ? *python_param_ : *default_instance_->python_param_; +#endif +} +inline ::ditcaffe::PythonParameter* LayerParameter::mutable_python_param() { + set_has_python_param(); + if (python_param_ == NULL) python_param_ = new ::ditcaffe::PythonParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.python_param) + return python_param_; +} +inline ::ditcaffe::PythonParameter* LayerParameter::release_python_param() { + clear_has_python_param(); + ::ditcaffe::PythonParameter* temp = python_param_; + python_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_python_param(::ditcaffe::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:ditcaffe.LayerParameter.python_param) +} + +// optional .ditcaffe.ReductionParameter reduction_param = 136; +inline bool LayerParameter::has_reduction_param() const { + return (_has_bits_[1] & 0x00002000u) != 0; +} +inline void LayerParameter::set_has_reduction_param() { + _has_bits_[1] |= 0x00002000u; +} +inline void LayerParameter::clear_has_reduction_param() { + _has_bits_[1] &= ~0x00002000u; +} +inline void LayerParameter::clear_reduction_param() { + if (reduction_param_ != NULL) reduction_param_->::ditcaffe::ReductionParameter::Clear(); + clear_has_reduction_param(); +} +inline const ::ditcaffe::ReductionParameter& LayerParameter::reduction_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.reduction_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return reduction_param_ != NULL ? *reduction_param_ : *default_instance().reduction_param_; +#else + return reduction_param_ != NULL ? *reduction_param_ : *default_instance_->reduction_param_; +#endif +} +inline ::ditcaffe::ReductionParameter* LayerParameter::mutable_reduction_param() { + set_has_reduction_param(); + if (reduction_param_ == NULL) reduction_param_ = new ::ditcaffe::ReductionParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.reduction_param) + return reduction_param_; +} +inline ::ditcaffe::ReductionParameter* LayerParameter::release_reduction_param() { + clear_has_reduction_param(); + ::ditcaffe::ReductionParameter* temp = reduction_param_; + reduction_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_reduction_param(::ditcaffe::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:ditcaffe.LayerParameter.reduction_param) +} + +// optional .ditcaffe.ReLUParameter relu_param = 123; +inline bool LayerParameter::has_relu_param() const { + return (_has_bits_[1] & 0x00004000u) != 0; +} +inline void LayerParameter::set_has_relu_param() { + _has_bits_[1] |= 0x00004000u; +} +inline void LayerParameter::clear_has_relu_param() { + _has_bits_[1] &= ~0x00004000u; +} +inline void LayerParameter::clear_relu_param() { + if (relu_param_ != NULL) relu_param_->::ditcaffe::ReLUParameter::Clear(); + clear_has_relu_param(); +} +inline const ::ditcaffe::ReLUParameter& LayerParameter::relu_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.relu_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return relu_param_ != NULL ? *relu_param_ : *default_instance().relu_param_; +#else + return relu_param_ != NULL ? *relu_param_ : *default_instance_->relu_param_; +#endif +} +inline ::ditcaffe::ReLUParameter* LayerParameter::mutable_relu_param() { + set_has_relu_param(); + if (relu_param_ == NULL) relu_param_ = new ::ditcaffe::ReLUParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.relu_param) + return relu_param_; +} +inline ::ditcaffe::ReLUParameter* LayerParameter::release_relu_param() { + clear_has_relu_param(); + ::ditcaffe::ReLUParameter* temp = relu_param_; + relu_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_relu_param(::ditcaffe::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:ditcaffe.LayerParameter.relu_param) +} + +// optional .ditcaffe.ReshapeParameter reshape_param = 133; +inline bool LayerParameter::has_reshape_param() const { + return (_has_bits_[1] & 0x00008000u) != 0; +} +inline void LayerParameter::set_has_reshape_param() { + _has_bits_[1] |= 0x00008000u; +} +inline void LayerParameter::clear_has_reshape_param() { + _has_bits_[1] &= ~0x00008000u; +} +inline void LayerParameter::clear_reshape_param() { + if (reshape_param_ != NULL) reshape_param_->::ditcaffe::ReshapeParameter::Clear(); + clear_has_reshape_param(); +} +inline const ::ditcaffe::ReshapeParameter& LayerParameter::reshape_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.reshape_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return reshape_param_ != NULL ? *reshape_param_ : *default_instance().reshape_param_; +#else + return reshape_param_ != NULL ? *reshape_param_ : *default_instance_->reshape_param_; +#endif +} +inline ::ditcaffe::ReshapeParameter* LayerParameter::mutable_reshape_param() { + set_has_reshape_param(); + if (reshape_param_ == NULL) reshape_param_ = new ::ditcaffe::ReshapeParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.reshape_param) + return reshape_param_; +} +inline ::ditcaffe::ReshapeParameter* LayerParameter::release_reshape_param() { + clear_has_reshape_param(); + ::ditcaffe::ReshapeParameter* temp = reshape_param_; + reshape_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_reshape_param(::ditcaffe::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:ditcaffe.LayerParameter.reshape_param) +} + +// optional .ditcaffe.ScaleParameter scale_param = 142; +inline bool LayerParameter::has_scale_param() const { + return (_has_bits_[1] & 0x00010000u) != 0; +} +inline void LayerParameter::set_has_scale_param() { + _has_bits_[1] |= 0x00010000u; +} +inline void LayerParameter::clear_has_scale_param() { + _has_bits_[1] &= ~0x00010000u; +} +inline void LayerParameter::clear_scale_param() { + if (scale_param_ != NULL) scale_param_->::ditcaffe::ScaleParameter::Clear(); + clear_has_scale_param(); +} +inline const ::ditcaffe::ScaleParameter& LayerParameter::scale_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.scale_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return scale_param_ != NULL ? *scale_param_ : *default_instance().scale_param_; +#else + return scale_param_ != NULL ? *scale_param_ : *default_instance_->scale_param_; +#endif +} +inline ::ditcaffe::ScaleParameter* LayerParameter::mutable_scale_param() { + set_has_scale_param(); + if (scale_param_ == NULL) scale_param_ = new ::ditcaffe::ScaleParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.scale_param) + return scale_param_; +} +inline ::ditcaffe::ScaleParameter* LayerParameter::release_scale_param() { + clear_has_scale_param(); + ::ditcaffe::ScaleParameter* temp = scale_param_; + scale_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_scale_param(::ditcaffe::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:ditcaffe.LayerParameter.scale_param) +} + +// optional .ditcaffe.SigmoidParameter sigmoid_param = 124; +inline bool LayerParameter::has_sigmoid_param() const { + return (_has_bits_[1] & 0x00020000u) != 0; +} +inline void LayerParameter::set_has_sigmoid_param() { + _has_bits_[1] |= 0x00020000u; +} +inline void LayerParameter::clear_has_sigmoid_param() { + _has_bits_[1] &= ~0x00020000u; +} +inline void LayerParameter::clear_sigmoid_param() { + if (sigmoid_param_ != NULL) sigmoid_param_->::ditcaffe::SigmoidParameter::Clear(); + clear_has_sigmoid_param(); +} +inline const ::ditcaffe::SigmoidParameter& LayerParameter::sigmoid_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.sigmoid_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return sigmoid_param_ != NULL ? *sigmoid_param_ : *default_instance().sigmoid_param_; +#else + return sigmoid_param_ != NULL ? *sigmoid_param_ : *default_instance_->sigmoid_param_; +#endif +} +inline ::ditcaffe::SigmoidParameter* LayerParameter::mutable_sigmoid_param() { + set_has_sigmoid_param(); + if (sigmoid_param_ == NULL) sigmoid_param_ = new ::ditcaffe::SigmoidParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.sigmoid_param) + return sigmoid_param_; +} +inline ::ditcaffe::SigmoidParameter* LayerParameter::release_sigmoid_param() { + clear_has_sigmoid_param(); + ::ditcaffe::SigmoidParameter* temp = sigmoid_param_; + sigmoid_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_sigmoid_param(::ditcaffe::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:ditcaffe.LayerParameter.sigmoid_param) +} + +// optional .ditcaffe.SoftmaxParameter softmax_param = 125; +inline bool LayerParameter::has_softmax_param() const { + return (_has_bits_[1] & 0x00040000u) != 0; +} +inline void LayerParameter::set_has_softmax_param() { + _has_bits_[1] |= 0x00040000u; +} +inline void LayerParameter::clear_has_softmax_param() { + _has_bits_[1] &= ~0x00040000u; +} +inline void LayerParameter::clear_softmax_param() { + if (softmax_param_ != NULL) softmax_param_->::ditcaffe::SoftmaxParameter::Clear(); + clear_has_softmax_param(); +} +inline const ::ditcaffe::SoftmaxParameter& LayerParameter::softmax_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.softmax_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return softmax_param_ != NULL ? *softmax_param_ : *default_instance().softmax_param_; +#else + return softmax_param_ != NULL ? *softmax_param_ : *default_instance_->softmax_param_; +#endif +} +inline ::ditcaffe::SoftmaxParameter* LayerParameter::mutable_softmax_param() { + set_has_softmax_param(); + if (softmax_param_ == NULL) softmax_param_ = new ::ditcaffe::SoftmaxParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.softmax_param) + return softmax_param_; +} +inline ::ditcaffe::SoftmaxParameter* LayerParameter::release_softmax_param() { + clear_has_softmax_param(); + ::ditcaffe::SoftmaxParameter* temp = softmax_param_; + softmax_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_softmax_param(::ditcaffe::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:ditcaffe.LayerParameter.softmax_param) +} + +// optional .ditcaffe.SPPParameter spp_param = 132; +inline bool LayerParameter::has_spp_param() const { + return (_has_bits_[1] & 0x00080000u) != 0; +} +inline void LayerParameter::set_has_spp_param() { + _has_bits_[1] |= 0x00080000u; +} +inline void LayerParameter::clear_has_spp_param() { + _has_bits_[1] &= ~0x00080000u; +} +inline void LayerParameter::clear_spp_param() { + if (spp_param_ != NULL) spp_param_->::ditcaffe::SPPParameter::Clear(); + clear_has_spp_param(); +} +inline const ::ditcaffe::SPPParameter& LayerParameter::spp_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.spp_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return spp_param_ != NULL ? *spp_param_ : *default_instance().spp_param_; +#else + return spp_param_ != NULL ? *spp_param_ : *default_instance_->spp_param_; +#endif +} +inline ::ditcaffe::SPPParameter* LayerParameter::mutable_spp_param() { + set_has_spp_param(); + if (spp_param_ == NULL) spp_param_ = new ::ditcaffe::SPPParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.spp_param) + return spp_param_; +} +inline ::ditcaffe::SPPParameter* LayerParameter::release_spp_param() { + clear_has_spp_param(); + ::ditcaffe::SPPParameter* temp = spp_param_; + spp_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_spp_param(::ditcaffe::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:ditcaffe.LayerParameter.spp_param) +} + +// optional .ditcaffe.SliceParameter slice_param = 126; +inline bool LayerParameter::has_slice_param() const { + return (_has_bits_[1] & 0x00100000u) != 0; +} +inline void LayerParameter::set_has_slice_param() { + _has_bits_[1] |= 0x00100000u; +} +inline void LayerParameter::clear_has_slice_param() { + _has_bits_[1] &= ~0x00100000u; +} +inline void LayerParameter::clear_slice_param() { + if (slice_param_ != NULL) slice_param_->::ditcaffe::SliceParameter::Clear(); + clear_has_slice_param(); +} +inline const ::ditcaffe::SliceParameter& LayerParameter::slice_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.slice_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return slice_param_ != NULL ? *slice_param_ : *default_instance().slice_param_; +#else + return slice_param_ != NULL ? *slice_param_ : *default_instance_->slice_param_; +#endif +} +inline ::ditcaffe::SliceParameter* LayerParameter::mutable_slice_param() { + set_has_slice_param(); + if (slice_param_ == NULL) slice_param_ = new ::ditcaffe::SliceParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.slice_param) + return slice_param_; +} +inline ::ditcaffe::SliceParameter* LayerParameter::release_slice_param() { + clear_has_slice_param(); + ::ditcaffe::SliceParameter* temp = slice_param_; + slice_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_slice_param(::ditcaffe::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:ditcaffe.LayerParameter.slice_param) +} + +// optional .ditcaffe.TanHParameter tanh_param = 127; +inline bool LayerParameter::has_tanh_param() const { + return (_has_bits_[1] & 0x00200000u) != 0; +} +inline void LayerParameter::set_has_tanh_param() { + _has_bits_[1] |= 0x00200000u; +} +inline void LayerParameter::clear_has_tanh_param() { + _has_bits_[1] &= ~0x00200000u; +} +inline void LayerParameter::clear_tanh_param() { + if (tanh_param_ != NULL) tanh_param_->::ditcaffe::TanHParameter::Clear(); + clear_has_tanh_param(); +} +inline const ::ditcaffe::TanHParameter& LayerParameter::tanh_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.tanh_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return tanh_param_ != NULL ? *tanh_param_ : *default_instance().tanh_param_; +#else + return tanh_param_ != NULL ? *tanh_param_ : *default_instance_->tanh_param_; +#endif +} +inline ::ditcaffe::TanHParameter* LayerParameter::mutable_tanh_param() { + set_has_tanh_param(); + if (tanh_param_ == NULL) tanh_param_ = new ::ditcaffe::TanHParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.tanh_param) + return tanh_param_; +} +inline ::ditcaffe::TanHParameter* LayerParameter::release_tanh_param() { + clear_has_tanh_param(); + ::ditcaffe::TanHParameter* temp = tanh_param_; + tanh_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_tanh_param(::ditcaffe::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:ditcaffe.LayerParameter.tanh_param) +} + +// optional .ditcaffe.ThresholdParameter threshold_param = 128; +inline bool LayerParameter::has_threshold_param() const { + return (_has_bits_[1] & 0x00400000u) != 0; +} +inline void LayerParameter::set_has_threshold_param() { + _has_bits_[1] |= 0x00400000u; +} +inline void LayerParameter::clear_has_threshold_param() { + _has_bits_[1] &= ~0x00400000u; +} +inline void LayerParameter::clear_threshold_param() { + if (threshold_param_ != NULL) threshold_param_->::ditcaffe::ThresholdParameter::Clear(); + clear_has_threshold_param(); +} +inline const ::ditcaffe::ThresholdParameter& LayerParameter::threshold_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.threshold_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return threshold_param_ != NULL ? *threshold_param_ : *default_instance().threshold_param_; +#else + return threshold_param_ != NULL ? *threshold_param_ : *default_instance_->threshold_param_; +#endif +} +inline ::ditcaffe::ThresholdParameter* LayerParameter::mutable_threshold_param() { + set_has_threshold_param(); + if (threshold_param_ == NULL) threshold_param_ = new ::ditcaffe::ThresholdParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.threshold_param) + return threshold_param_; +} +inline ::ditcaffe::ThresholdParameter* LayerParameter::release_threshold_param() { + clear_has_threshold_param(); + ::ditcaffe::ThresholdParameter* temp = threshold_param_; + threshold_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_threshold_param(::ditcaffe::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:ditcaffe.LayerParameter.threshold_param) +} + +// optional .ditcaffe.TileParameter tile_param = 138; +inline bool LayerParameter::has_tile_param() const { + return (_has_bits_[1] & 0x00800000u) != 0; +} +inline void LayerParameter::set_has_tile_param() { + _has_bits_[1] |= 0x00800000u; +} +inline void LayerParameter::clear_has_tile_param() { + _has_bits_[1] &= ~0x00800000u; +} +inline void LayerParameter::clear_tile_param() { + if (tile_param_ != NULL) tile_param_->::ditcaffe::TileParameter::Clear(); + clear_has_tile_param(); +} +inline const ::ditcaffe::TileParameter& LayerParameter::tile_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.tile_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return tile_param_ != NULL ? *tile_param_ : *default_instance().tile_param_; +#else + return tile_param_ != NULL ? *tile_param_ : *default_instance_->tile_param_; +#endif +} +inline ::ditcaffe::TileParameter* LayerParameter::mutable_tile_param() { + set_has_tile_param(); + if (tile_param_ == NULL) tile_param_ = new ::ditcaffe::TileParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.tile_param) + return tile_param_; +} +inline ::ditcaffe::TileParameter* LayerParameter::release_tile_param() { + clear_has_tile_param(); + ::ditcaffe::TileParameter* temp = tile_param_; + tile_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_tile_param(::ditcaffe::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:ditcaffe.LayerParameter.tile_param) +} + +// optional .ditcaffe.WindowDataParameter window_data_param = 129; +inline bool LayerParameter::has_window_data_param() const { + return (_has_bits_[1] & 0x01000000u) != 0; +} +inline void LayerParameter::set_has_window_data_param() { + _has_bits_[1] |= 0x01000000u; +} +inline void LayerParameter::clear_has_window_data_param() { + _has_bits_[1] &= ~0x01000000u; +} +inline void LayerParameter::clear_window_data_param() { + if (window_data_param_ != NULL) window_data_param_->::ditcaffe::WindowDataParameter::Clear(); + clear_has_window_data_param(); +} +inline const ::ditcaffe::WindowDataParameter& LayerParameter::window_data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.window_data_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return window_data_param_ != NULL ? *window_data_param_ : *default_instance().window_data_param_; +#else + return window_data_param_ != NULL ? *window_data_param_ : *default_instance_->window_data_param_; +#endif +} +inline ::ditcaffe::WindowDataParameter* LayerParameter::mutable_window_data_param() { + set_has_window_data_param(); + if (window_data_param_ == NULL) window_data_param_ = new ::ditcaffe::WindowDataParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.window_data_param) + return window_data_param_; +} +inline ::ditcaffe::WindowDataParameter* LayerParameter::release_window_data_param() { + clear_has_window_data_param(); + ::ditcaffe::WindowDataParameter* temp = window_data_param_; + window_data_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_window_data_param(::ditcaffe::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:ditcaffe.LayerParameter.window_data_param) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.TransformationParameter.scale) + return scale_; +} +inline void TransformationParameter::set_scale(float value) { + set_has_scale(); + scale_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.TransformationParameter.mirror) + return mirror_; +} +inline void TransformationParameter::set_mirror(bool value) { + set_has_mirror(); + mirror_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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() { + if (mean_file_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + mean_file_->clear(); + } + clear_has_mean_file(); +} +inline const ::std::string& TransformationParameter::mean_file() const { + // @@protoc_insertion_point(field_get:ditcaffe.TransformationParameter.mean_file) + return *mean_file_; +} +inline void TransformationParameter::set_mean_file(const ::std::string& value) { + set_has_mean_file(); + if (mean_file_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + mean_file_ = new ::std::string; + } + mean_file_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.TransformationParameter.mean_file) +} +inline void TransformationParameter::set_mean_file(const char* value) { + set_has_mean_file(); + if (mean_file_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + mean_file_ = new ::std::string; + } + mean_file_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.TransformationParameter.mean_file) +} +inline void TransformationParameter::set_mean_file(const char* value, size_t size) { + set_has_mean_file(); + if (mean_file_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + mean_file_ = new ::std::string; + } + mean_file_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.TransformationParameter.mean_file) +} +inline ::std::string* TransformationParameter::mutable_mean_file() { + set_has_mean_file(); + if (mean_file_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + mean_file_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.TransformationParameter.mean_file) + return mean_file_; +} +inline ::std::string* TransformationParameter::release_mean_file() { + clear_has_mean_file(); + if (mean_file_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = mean_file_; + mean_file_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void TransformationParameter::set_allocated_mean_file(::std::string* mean_file) { + if (mean_file_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete mean_file_; + } + if (mean_file) { + set_has_mean_file(); + mean_file_ = mean_file; + } else { + clear_has_mean_file(); + mean_file_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.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:ditcaffe.TransformationParameter.mean_value) +} +inline void TransformationParameter::add_mean_value(float value) { + mean_value_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.TransformationParameter.mean_value) +} +inline const ::google::protobuf::RepeatedField< float >& +TransformationParameter::mean_value() const { + // @@protoc_insertion_point(field_list:ditcaffe.TransformationParameter.mean_value) + return mean_value_; +} +inline ::google::protobuf::RepeatedField< float >* +TransformationParameter::mutable_mean_value() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.TransformationParameter.force_gray) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.LossParameter.ignore_label) +} + +// optional .ditcaffe.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 ::ditcaffe::LossParameter_NormalizationMode LossParameter::normalization() const { + // @@protoc_insertion_point(field_get:ditcaffe.LossParameter.normalization) + return static_cast< ::ditcaffe::LossParameter_NormalizationMode >(normalization_); +} +inline void LossParameter::set_normalization(::ditcaffe::LossParameter_NormalizationMode value) { + assert(::ditcaffe::LossParameter_NormalizationMode_IsValid(value)); + set_has_normalization(); + normalization_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.LossParameter.normalize) + return normalize_; +} +inline void LossParameter::set_normalize(bool value) { + set_has_normalize(); + normalize_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.LossParameter.normalize) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.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:ditcaffe.AccuracyParameter.axis) + return axis_; +} +inline void AccuracyParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.AccuracyParameter.ignore_label) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.ArgMaxParameter.axis) + return axis_; +} +inline void ArgMaxParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.ArgMaxParameter.axis) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.ConcatParameter.axis) + return axis_; +} +inline void ConcatParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.ConcatParameter.concat_dim) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.BatchNormParameter.eps) + return eps_; +} +inline void BatchNormParameter::set_eps(float value) { + set_has_eps(); + eps_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.BatchNormParameter.eps) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.BiasParameter.axis) + return axis_; +} +inline void BiasParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.BiasParameter.num_axes) +} + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_filler(); +} +inline const ::ditcaffe::FillerParameter& BiasParameter::filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.BiasParameter.filler) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return filler_ != NULL ? *filler_ : *default_instance().filler_; +#else + return filler_ != NULL ? *filler_ : *default_instance_->filler_; +#endif +} +inline ::ditcaffe::FillerParameter* BiasParameter::mutable_filler() { + set_has_filler(); + if (filler_ == NULL) filler_ = new ::ditcaffe::FillerParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.BiasParameter.filler) + return filler_; +} +inline ::ditcaffe::FillerParameter* BiasParameter::release_filler() { + clear_has_filler(); + ::ditcaffe::FillerParameter* temp = filler_; + filler_ = NULL; + return temp; +} +inline void BiasParameter::set_allocated_filler(::ditcaffe::FillerParameter* filler) { + delete filler_; + filler_ = filler; + if (filler) { + set_has_filler(); + } else { + clear_has_filler(); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.BiasParameter.filler) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.ContrastiveLossParameter.margin) + return margin_; +} +inline void ContrastiveLossParameter::set_margin(float value) { + set_has_margin(); + margin_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.ContrastiveLossParameter.legacy_version) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.ConvolutionParameter.pad) +} +inline void ConvolutionParameter::add_pad(::google::protobuf::uint32 value) { + pad_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.ConvolutionParameter.pad) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +ConvolutionParameter::pad() const { + // @@protoc_insertion_point(field_list:ditcaffe.ConvolutionParameter.pad) + return pad_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +ConvolutionParameter::mutable_pad() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.ConvolutionParameter.kernel_size) +} +inline void ConvolutionParameter::add_kernel_size(::google::protobuf::uint32 value) { + kernel_size_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.ConvolutionParameter.kernel_size) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +ConvolutionParameter::kernel_size() const { + // @@protoc_insertion_point(field_list:ditcaffe.ConvolutionParameter.kernel_size) + return kernel_size_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +ConvolutionParameter::mutable_kernel_size() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.ConvolutionParameter.stride) +} +inline void ConvolutionParameter::add_stride(::google::protobuf::uint32 value) { + stride_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.ConvolutionParameter.stride) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +ConvolutionParameter::stride() const { + // @@protoc_insertion_point(field_list:ditcaffe.ConvolutionParameter.stride) + return stride_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +ConvolutionParameter::mutable_stride() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.ConvolutionParameter.dilation) +} +inline void ConvolutionParameter::add_dilation(::google::protobuf::uint32 value) { + dilation_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.ConvolutionParameter.dilation) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +ConvolutionParameter::dilation() const { + // @@protoc_insertion_point(field_list:ditcaffe.ConvolutionParameter.dilation) + return dilation_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +ConvolutionParameter::mutable_dilation() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.ConvolutionParameter.group) + return group_; +} +inline void ConvolutionParameter::set_group(::google::protobuf::uint32 value) { + set_has_group(); + group_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.ConvolutionParameter.group) +} + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_weight_filler(); +} +inline const ::ditcaffe::FillerParameter& ConvolutionParameter::weight_filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.ConvolutionParameter.weight_filler) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return weight_filler_ != NULL ? *weight_filler_ : *default_instance().weight_filler_; +#else + return weight_filler_ != NULL ? *weight_filler_ : *default_instance_->weight_filler_; +#endif +} +inline ::ditcaffe::FillerParameter* ConvolutionParameter::mutable_weight_filler() { + set_has_weight_filler(); + if (weight_filler_ == NULL) weight_filler_ = new ::ditcaffe::FillerParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.ConvolutionParameter.weight_filler) + return weight_filler_; +} +inline ::ditcaffe::FillerParameter* ConvolutionParameter::release_weight_filler() { + clear_has_weight_filler(); + ::ditcaffe::FillerParameter* temp = weight_filler_; + weight_filler_ = NULL; + return temp; +} +inline void ConvolutionParameter::set_allocated_weight_filler(::ditcaffe::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:ditcaffe.ConvolutionParameter.weight_filler) +} + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_bias_filler(); +} +inline const ::ditcaffe::FillerParameter& ConvolutionParameter::bias_filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.ConvolutionParameter.bias_filler) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return bias_filler_ != NULL ? *bias_filler_ : *default_instance().bias_filler_; +#else + return bias_filler_ != NULL ? *bias_filler_ : *default_instance_->bias_filler_; +#endif +} +inline ::ditcaffe::FillerParameter* ConvolutionParameter::mutable_bias_filler() { + set_has_bias_filler(); + if (bias_filler_ == NULL) bias_filler_ = new ::ditcaffe::FillerParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.ConvolutionParameter.bias_filler) + return bias_filler_; +} +inline ::ditcaffe::FillerParameter* ConvolutionParameter::release_bias_filler() { + clear_has_bias_filler(); + ::ditcaffe::FillerParameter* temp = bias_filler_; + bias_filler_ = NULL; + return temp; +} +inline void ConvolutionParameter::set_allocated_bias_filler(::ditcaffe::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:ditcaffe.ConvolutionParameter.bias_filler) +} + +// optional .ditcaffe.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 ::ditcaffe::ConvolutionParameter_Engine ConvolutionParameter::engine() const { + // @@protoc_insertion_point(field_get:ditcaffe.ConvolutionParameter.engine) + return static_cast< ::ditcaffe::ConvolutionParameter_Engine >(engine_); +} +inline void ConvolutionParameter::set_engine(::ditcaffe::ConvolutionParameter_Engine value) { + assert(::ditcaffe::ConvolutionParameter_Engine_IsValid(value)); + set_has_engine(); + engine_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.ConvolutionParameter.axis) + return axis_; +} +inline void ConvolutionParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.ConvolutionParameter.force_nd_im2col) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.CropParameter.axis) + return axis_; +} +inline void CropParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.CropParameter.offset) +} +inline void CropParameter::add_offset(::google::protobuf::uint32 value) { + offset_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.CropParameter.offset) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +CropParameter::offset() const { + // @@protoc_insertion_point(field_list:ditcaffe.CropParameter.offset) + return offset_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +CropParameter::mutable_offset() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.CropParameter.offset) + return &offset_; +} + +// ------------------------------------------------------------------- + +// 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() { + if (source_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_->clear(); + } + clear_has_source(); +} +inline const ::std::string& DataParameter::source() const { + // @@protoc_insertion_point(field_get:ditcaffe.DataParameter.source) + return *source_; +} +inline void DataParameter::set_source(const ::std::string& value) { + set_has_source(); + if (source_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_ = new ::std::string; + } + source_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.DataParameter.source) +} +inline void DataParameter::set_source(const char* value) { + set_has_source(); + if (source_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_ = new ::std::string; + } + source_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.DataParameter.source) +} +inline void DataParameter::set_source(const char* value, size_t size) { + set_has_source(); + if (source_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_ = new ::std::string; + } + source_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.DataParameter.source) +} +inline ::std::string* DataParameter::mutable_source() { + set_has_source(); + if (source_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.DataParameter.source) + return source_; +} +inline ::std::string* DataParameter::release_source() { + clear_has_source(); + if (source_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = source_; + source_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void DataParameter::set_allocated_source(::std::string* source) { + if (source_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete source_; + } + if (source) { + set_has_source(); + source_ = source; + } else { + clear_has_source(); + source_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.DataParameter.rand_skip) +} + +// optional .ditcaffe.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 ::ditcaffe::DataParameter_DB DataParameter::backend() const { + // @@protoc_insertion_point(field_get:ditcaffe.DataParameter.backend) + return static_cast< ::ditcaffe::DataParameter_DB >(backend_); +} +inline void DataParameter::set_backend(::ditcaffe::DataParameter_DB value) { + assert(::ditcaffe::DataParameter_DB_IsValid(value)); + set_has_backend(); + backend_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.DataParameter.scale) + return scale_; +} +inline void DataParameter::set_scale(float value) { + set_has_scale(); + scale_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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() { + if (mean_file_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + mean_file_->clear(); + } + clear_has_mean_file(); +} +inline const ::std::string& DataParameter::mean_file() const { + // @@protoc_insertion_point(field_get:ditcaffe.DataParameter.mean_file) + return *mean_file_; +} +inline void DataParameter::set_mean_file(const ::std::string& value) { + set_has_mean_file(); + if (mean_file_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + mean_file_ = new ::std::string; + } + mean_file_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.DataParameter.mean_file) +} +inline void DataParameter::set_mean_file(const char* value) { + set_has_mean_file(); + if (mean_file_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + mean_file_ = new ::std::string; + } + mean_file_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.DataParameter.mean_file) +} +inline void DataParameter::set_mean_file(const char* value, size_t size) { + set_has_mean_file(); + if (mean_file_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + mean_file_ = new ::std::string; + } + mean_file_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.DataParameter.mean_file) +} +inline ::std::string* DataParameter::mutable_mean_file() { + set_has_mean_file(); + if (mean_file_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + mean_file_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.DataParameter.mean_file) + return mean_file_; +} +inline ::std::string* DataParameter::release_mean_file() { + clear_has_mean_file(); + if (mean_file_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = mean_file_; + mean_file_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void DataParameter::set_allocated_mean_file(::std::string* mean_file) { + if (mean_file_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete mean_file_; + } + if (mean_file) { + set_has_mean_file(); + mean_file_ = mean_file; + } else { + clear_has_mean_file(); + mean_file_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.DataParameter.mirror) + return mirror_; +} +inline void DataParameter::set_mirror(bool value) { + set_has_mirror(); + mirror_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.DataParameter.prefetch) + return prefetch_; +} +inline void DataParameter::set_prefetch(::google::protobuf::uint32 value) { + set_has_prefetch(); + prefetch_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.DataParameter.prefetch) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.DropoutParameter.dropout_ratio) +} + +// ------------------------------------------------------------------- + +// DummyDataParameter + +// repeated .ditcaffe.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 ::ditcaffe::FillerParameter& DummyDataParameter::data_filler(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.DummyDataParameter.data_filler) + return data_filler_.Get(index); +} +inline ::ditcaffe::FillerParameter* DummyDataParameter::mutable_data_filler(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.DummyDataParameter.data_filler) + return data_filler_.Mutable(index); +} +inline ::ditcaffe::FillerParameter* DummyDataParameter::add_data_filler() { + // @@protoc_insertion_point(field_add:ditcaffe.DummyDataParameter.data_filler) + return data_filler_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::FillerParameter >& +DummyDataParameter::data_filler() const { + // @@protoc_insertion_point(field_list:ditcaffe.DummyDataParameter.data_filler) + return data_filler_; +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::FillerParameter >* +DummyDataParameter::mutable_data_filler() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.DummyDataParameter.data_filler) + return &data_filler_; +} + +// repeated .ditcaffe.BlobShape shape = 6; +inline int DummyDataParameter::shape_size() const { + return shape_.size(); +} +inline void DummyDataParameter::clear_shape() { + shape_.Clear(); +} +inline const ::ditcaffe::BlobShape& DummyDataParameter::shape(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.DummyDataParameter.shape) + return shape_.Get(index); +} +inline ::ditcaffe::BlobShape* DummyDataParameter::mutable_shape(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.DummyDataParameter.shape) + return shape_.Mutable(index); +} +inline ::ditcaffe::BlobShape* DummyDataParameter::add_shape() { + // @@protoc_insertion_point(field_add:ditcaffe.DummyDataParameter.shape) + return shape_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobShape >& +DummyDataParameter::shape() const { + // @@protoc_insertion_point(field_list:ditcaffe.DummyDataParameter.shape) + return shape_; +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobShape >* +DummyDataParameter::mutable_shape() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.DummyDataParameter.num) +} +inline void DummyDataParameter::add_num(::google::protobuf::uint32 value) { + num_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.DummyDataParameter.num) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +DummyDataParameter::num() const { + // @@protoc_insertion_point(field_list:ditcaffe.DummyDataParameter.num) + return num_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +DummyDataParameter::mutable_num() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.DummyDataParameter.channels) +} +inline void DummyDataParameter::add_channels(::google::protobuf::uint32 value) { + channels_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.DummyDataParameter.channels) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +DummyDataParameter::channels() const { + // @@protoc_insertion_point(field_list:ditcaffe.DummyDataParameter.channels) + return channels_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +DummyDataParameter::mutable_channels() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.DummyDataParameter.height) +} +inline void DummyDataParameter::add_height(::google::protobuf::uint32 value) { + height_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.DummyDataParameter.height) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +DummyDataParameter::height() const { + // @@protoc_insertion_point(field_list:ditcaffe.DummyDataParameter.height) + return height_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +DummyDataParameter::mutable_height() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.DummyDataParameter.width) +} +inline void DummyDataParameter::add_width(::google::protobuf::uint32 value) { + width_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.DummyDataParameter.width) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +DummyDataParameter::width() const { + // @@protoc_insertion_point(field_list:ditcaffe.DummyDataParameter.width) + return width_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +DummyDataParameter::mutable_width() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.DummyDataParameter.width) + return &width_; +} + +// ------------------------------------------------------------------- + +// EltwiseParameter + +// optional .ditcaffe.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 ::ditcaffe::EltwiseParameter_EltwiseOp EltwiseParameter::operation() const { + // @@protoc_insertion_point(field_get:ditcaffe.EltwiseParameter.operation) + return static_cast< ::ditcaffe::EltwiseParameter_EltwiseOp >(operation_); +} +inline void EltwiseParameter::set_operation(::ditcaffe::EltwiseParameter_EltwiseOp value) { + assert(::ditcaffe::EltwiseParameter_EltwiseOp_IsValid(value)); + set_has_operation(); + operation_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.EltwiseParameter.coeff) + return coeff_.Get(index); +} +inline void EltwiseParameter::set_coeff(int index, float value) { + coeff_.Set(index, value); + // @@protoc_insertion_point(field_set:ditcaffe.EltwiseParameter.coeff) +} +inline void EltwiseParameter::add_coeff(float value) { + coeff_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.EltwiseParameter.coeff) +} +inline const ::google::protobuf::RepeatedField< float >& +EltwiseParameter::coeff() const { + // @@protoc_insertion_point(field_list:ditcaffe.EltwiseParameter.coeff) + return coeff_; +} +inline ::google::protobuf::RepeatedField< float >* +EltwiseParameter::mutable_coeff() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.EltwiseParameter.stable_prod_grad) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.ELUParameter.alpha) + return alpha_; +} +inline void ELUParameter::set_alpha(float value) { + set_has_alpha(); + alpha_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.ELUParameter.alpha) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.EmbedParameter.bias_term) +} + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_weight_filler(); +} +inline const ::ditcaffe::FillerParameter& EmbedParameter::weight_filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.EmbedParameter.weight_filler) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return weight_filler_ != NULL ? *weight_filler_ : *default_instance().weight_filler_; +#else + return weight_filler_ != NULL ? *weight_filler_ : *default_instance_->weight_filler_; +#endif +} +inline ::ditcaffe::FillerParameter* EmbedParameter::mutable_weight_filler() { + set_has_weight_filler(); + if (weight_filler_ == NULL) weight_filler_ = new ::ditcaffe::FillerParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.EmbedParameter.weight_filler) + return weight_filler_; +} +inline ::ditcaffe::FillerParameter* EmbedParameter::release_weight_filler() { + clear_has_weight_filler(); + ::ditcaffe::FillerParameter* temp = weight_filler_; + weight_filler_ = NULL; + return temp; +} +inline void EmbedParameter::set_allocated_weight_filler(::ditcaffe::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:ditcaffe.EmbedParameter.weight_filler) +} + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_bias_filler(); +} +inline const ::ditcaffe::FillerParameter& EmbedParameter::bias_filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.EmbedParameter.bias_filler) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return bias_filler_ != NULL ? *bias_filler_ : *default_instance().bias_filler_; +#else + return bias_filler_ != NULL ? *bias_filler_ : *default_instance_->bias_filler_; +#endif +} +inline ::ditcaffe::FillerParameter* EmbedParameter::mutable_bias_filler() { + set_has_bias_filler(); + if (bias_filler_ == NULL) bias_filler_ = new ::ditcaffe::FillerParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.EmbedParameter.bias_filler) + return bias_filler_; +} +inline ::ditcaffe::FillerParameter* EmbedParameter::release_bias_filler() { + clear_has_bias_filler(); + ::ditcaffe::FillerParameter* temp = bias_filler_; + bias_filler_ = NULL; + return temp; +} +inline void EmbedParameter::set_allocated_bias_filler(::ditcaffe::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:ditcaffe.EmbedParameter.bias_filler) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.ExpParameter.base) + return base_; +} +inline void ExpParameter::set_base(float value) { + set_has_base(); + base_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.ExpParameter.scale) + return scale_; +} +inline void ExpParameter::set_scale(float value) { + set_has_scale(); + scale_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.ExpParameter.shift) + return shift_; +} +inline void ExpParameter::set_shift(float value) { + set_has_shift(); + shift_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.ExpParameter.shift) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.FlattenParameter.axis) + return axis_; +} +inline void FlattenParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.FlattenParameter.end_axis) +} + +// ------------------------------------------------------------------- + +// 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() { + if (source_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_->clear(); + } + clear_has_source(); +} +inline const ::std::string& HDF5DataParameter::source() const { + // @@protoc_insertion_point(field_get:ditcaffe.HDF5DataParameter.source) + return *source_; +} +inline void HDF5DataParameter::set_source(const ::std::string& value) { + set_has_source(); + if (source_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_ = new ::std::string; + } + source_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.HDF5DataParameter.source) +} +inline void HDF5DataParameter::set_source(const char* value) { + set_has_source(); + if (source_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_ = new ::std::string; + } + source_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.HDF5DataParameter.source) +} +inline void HDF5DataParameter::set_source(const char* value, size_t size) { + set_has_source(); + if (source_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_ = new ::std::string; + } + source_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.HDF5DataParameter.source) +} +inline ::std::string* HDF5DataParameter::mutable_source() { + set_has_source(); + if (source_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.HDF5DataParameter.source) + return source_; +} +inline ::std::string* HDF5DataParameter::release_source() { + clear_has_source(); + if (source_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = source_; + source_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void HDF5DataParameter::set_allocated_source(::std::string* source) { + if (source_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete source_; + } + if (source) { + set_has_source(); + source_ = source; + } else { + clear_has_source(); + source_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.HDF5DataParameter.shuffle) + return shuffle_; +} +inline void HDF5DataParameter::set_shuffle(bool value) { + set_has_shuffle(); + shuffle_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.HDF5DataParameter.shuffle) +} + +// ------------------------------------------------------------------- + +// 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() { + if (file_name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + file_name_->clear(); + } + clear_has_file_name(); +} +inline const ::std::string& HDF5OutputParameter::file_name() const { + // @@protoc_insertion_point(field_get:ditcaffe.HDF5OutputParameter.file_name) + return *file_name_; +} +inline void HDF5OutputParameter::set_file_name(const ::std::string& value) { + set_has_file_name(); + if (file_name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + file_name_ = new ::std::string; + } + file_name_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.HDF5OutputParameter.file_name) +} +inline void HDF5OutputParameter::set_file_name(const char* value) { + set_has_file_name(); + if (file_name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + file_name_ = new ::std::string; + } + file_name_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.HDF5OutputParameter.file_name) +} +inline void HDF5OutputParameter::set_file_name(const char* value, size_t size) { + set_has_file_name(); + if (file_name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + file_name_ = new ::std::string; + } + file_name_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.HDF5OutputParameter.file_name) +} +inline ::std::string* HDF5OutputParameter::mutable_file_name() { + set_has_file_name(); + if (file_name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + file_name_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.HDF5OutputParameter.file_name) + return file_name_; +} +inline ::std::string* HDF5OutputParameter::release_file_name() { + clear_has_file_name(); + if (file_name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = file_name_; + file_name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void HDF5OutputParameter::set_allocated_file_name(::std::string* file_name) { + if (file_name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete file_name_; + } + if (file_name) { + set_has_file_name(); + file_name_ = file_name; + } else { + clear_has_file_name(); + file_name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.HDF5OutputParameter.file_name) +} + +// ------------------------------------------------------------------- + +// HingeLossParameter + +// optional .ditcaffe.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 ::ditcaffe::HingeLossParameter_Norm HingeLossParameter::norm() const { + // @@protoc_insertion_point(field_get:ditcaffe.HingeLossParameter.norm) + return static_cast< ::ditcaffe::HingeLossParameter_Norm >(norm_); +} +inline void HingeLossParameter::set_norm(::ditcaffe::HingeLossParameter_Norm value) { + assert(::ditcaffe::HingeLossParameter_Norm_IsValid(value)); + set_has_norm(); + norm_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.HingeLossParameter.norm) +} + +// ------------------------------------------------------------------- + +// 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() { + if (source_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_->clear(); + } + clear_has_source(); +} +inline const ::std::string& ImageDataParameter::source() const { + // @@protoc_insertion_point(field_get:ditcaffe.ImageDataParameter.source) + return *source_; +} +inline void ImageDataParameter::set_source(const ::std::string& value) { + set_has_source(); + if (source_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_ = new ::std::string; + } + source_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.ImageDataParameter.source) +} +inline void ImageDataParameter::set_source(const char* value) { + set_has_source(); + if (source_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_ = new ::std::string; + } + source_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.ImageDataParameter.source) +} +inline void ImageDataParameter::set_source(const char* value, size_t size) { + set_has_source(); + if (source_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_ = new ::std::string; + } + source_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.ImageDataParameter.source) +} +inline ::std::string* ImageDataParameter::mutable_source() { + set_has_source(); + if (source_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.ImageDataParameter.source) + return source_; +} +inline ::std::string* ImageDataParameter::release_source() { + clear_has_source(); + if (source_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = source_; + source_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ImageDataParameter::set_allocated_source(::std::string* source) { + if (source_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete source_; + } + if (source) { + set_has_source(); + source_ = source; + } else { + clear_has_source(); + source_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.ImageDataParameter.shuffle) + return shuffle_; +} +inline void ImageDataParameter::set_shuffle(bool value) { + set_has_shuffle(); + shuffle_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.ImageDataParameter.scale) + return scale_; +} +inline void ImageDataParameter::set_scale(float value) { + set_has_scale(); + scale_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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() { + if (mean_file_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + mean_file_->clear(); + } + clear_has_mean_file(); +} +inline const ::std::string& ImageDataParameter::mean_file() const { + // @@protoc_insertion_point(field_get:ditcaffe.ImageDataParameter.mean_file) + return *mean_file_; +} +inline void ImageDataParameter::set_mean_file(const ::std::string& value) { + set_has_mean_file(); + if (mean_file_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + mean_file_ = new ::std::string; + } + mean_file_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.ImageDataParameter.mean_file) +} +inline void ImageDataParameter::set_mean_file(const char* value) { + set_has_mean_file(); + if (mean_file_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + mean_file_ = new ::std::string; + } + mean_file_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.ImageDataParameter.mean_file) +} +inline void ImageDataParameter::set_mean_file(const char* value, size_t size) { + set_has_mean_file(); + if (mean_file_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + mean_file_ = new ::std::string; + } + mean_file_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.ImageDataParameter.mean_file) +} +inline ::std::string* ImageDataParameter::mutable_mean_file() { + set_has_mean_file(); + if (mean_file_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + mean_file_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.ImageDataParameter.mean_file) + return mean_file_; +} +inline ::std::string* ImageDataParameter::release_mean_file() { + clear_has_mean_file(); + if (mean_file_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = mean_file_; + mean_file_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ImageDataParameter::set_allocated_mean_file(::std::string* mean_file) { + if (mean_file_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete mean_file_; + } + if (mean_file) { + set_has_mean_file(); + mean_file_ = mean_file; + } else { + clear_has_mean_file(); + mean_file_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.ImageDataParameter.mirror) + return mirror_; +} +inline void ImageDataParameter::set_mirror(bool value) { + set_has_mirror(); + mirror_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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() { + if (root_folder_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + root_folder_->clear(); + } + clear_has_root_folder(); +} +inline const ::std::string& ImageDataParameter::root_folder() const { + // @@protoc_insertion_point(field_get:ditcaffe.ImageDataParameter.root_folder) + return *root_folder_; +} +inline void ImageDataParameter::set_root_folder(const ::std::string& value) { + set_has_root_folder(); + if (root_folder_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + root_folder_ = new ::std::string; + } + root_folder_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.ImageDataParameter.root_folder) +} +inline void ImageDataParameter::set_root_folder(const char* value) { + set_has_root_folder(); + if (root_folder_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + root_folder_ = new ::std::string; + } + root_folder_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.ImageDataParameter.root_folder) +} +inline void ImageDataParameter::set_root_folder(const char* value, size_t size) { + set_has_root_folder(); + if (root_folder_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + root_folder_ = new ::std::string; + } + root_folder_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.ImageDataParameter.root_folder) +} +inline ::std::string* ImageDataParameter::mutable_root_folder() { + set_has_root_folder(); + if (root_folder_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + root_folder_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.ImageDataParameter.root_folder) + return root_folder_; +} +inline ::std::string* ImageDataParameter::release_root_folder() { + clear_has_root_folder(); + if (root_folder_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = root_folder_; + root_folder_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ImageDataParameter::set_allocated_root_folder(::std::string* root_folder) { + if (root_folder_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete root_folder_; + } + if (root_folder) { + set_has_root_folder(); + root_folder_ = root_folder; + } else { + clear_has_root_folder(); + root_folder_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.ImageDataParameter.root_folder) +} + +// ------------------------------------------------------------------- + +// 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() { + if (source_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_->clear(); + } + clear_has_source(); +} +inline const ::std::string& InfogainLossParameter::source() const { + // @@protoc_insertion_point(field_get:ditcaffe.InfogainLossParameter.source) + return *source_; +} +inline void InfogainLossParameter::set_source(const ::std::string& value) { + set_has_source(); + if (source_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_ = new ::std::string; + } + source_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.InfogainLossParameter.source) +} +inline void InfogainLossParameter::set_source(const char* value) { + set_has_source(); + if (source_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_ = new ::std::string; + } + source_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.InfogainLossParameter.source) +} +inline void InfogainLossParameter::set_source(const char* value, size_t size) { + set_has_source(); + if (source_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_ = new ::std::string; + } + source_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.InfogainLossParameter.source) +} +inline ::std::string* InfogainLossParameter::mutable_source() { + set_has_source(); + if (source_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.InfogainLossParameter.source) + return source_; +} +inline ::std::string* InfogainLossParameter::release_source() { + clear_has_source(); + if (source_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = source_; + source_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void InfogainLossParameter::set_allocated_source(::std::string* source) { + if (source_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete source_; + } + if (source) { + set_has_source(); + source_ = source; + } else { + clear_has_source(); + source_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.InfogainLossParameter.source) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.InnerProductParameter.bias_term) +} + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_weight_filler(); +} +inline const ::ditcaffe::FillerParameter& InnerProductParameter::weight_filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.InnerProductParameter.weight_filler) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return weight_filler_ != NULL ? *weight_filler_ : *default_instance().weight_filler_; +#else + return weight_filler_ != NULL ? *weight_filler_ : *default_instance_->weight_filler_; +#endif +} +inline ::ditcaffe::FillerParameter* InnerProductParameter::mutable_weight_filler() { + set_has_weight_filler(); + if (weight_filler_ == NULL) weight_filler_ = new ::ditcaffe::FillerParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.InnerProductParameter.weight_filler) + return weight_filler_; +} +inline ::ditcaffe::FillerParameter* InnerProductParameter::release_weight_filler() { + clear_has_weight_filler(); + ::ditcaffe::FillerParameter* temp = weight_filler_; + weight_filler_ = NULL; + return temp; +} +inline void InnerProductParameter::set_allocated_weight_filler(::ditcaffe::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:ditcaffe.InnerProductParameter.weight_filler) +} + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_bias_filler(); +} +inline const ::ditcaffe::FillerParameter& InnerProductParameter::bias_filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.InnerProductParameter.bias_filler) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return bias_filler_ != NULL ? *bias_filler_ : *default_instance().bias_filler_; +#else + return bias_filler_ != NULL ? *bias_filler_ : *default_instance_->bias_filler_; +#endif +} +inline ::ditcaffe::FillerParameter* InnerProductParameter::mutable_bias_filler() { + set_has_bias_filler(); + if (bias_filler_ == NULL) bias_filler_ = new ::ditcaffe::FillerParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.InnerProductParameter.bias_filler) + return bias_filler_; +} +inline ::ditcaffe::FillerParameter* InnerProductParameter::release_bias_filler() { + clear_has_bias_filler(); + ::ditcaffe::FillerParameter* temp = bias_filler_; + bias_filler_ = NULL; + return temp; +} +inline void InnerProductParameter::set_allocated_bias_filler(::ditcaffe::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:ditcaffe.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:ditcaffe.InnerProductParameter.axis) + return axis_; +} +inline void InnerProductParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.InnerProductParameter.transpose) + return transpose_; +} +inline void InnerProductParameter::set_transpose(bool value) { + set_has_transpose(); + transpose_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.InnerProductParameter.transpose) +} + +// ------------------------------------------------------------------- + +// InputParameter + +// repeated .ditcaffe.BlobShape shape = 1; +inline int InputParameter::shape_size() const { + return shape_.size(); +} +inline void InputParameter::clear_shape() { + shape_.Clear(); +} +inline const ::ditcaffe::BlobShape& InputParameter::shape(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.InputParameter.shape) + return shape_.Get(index); +} +inline ::ditcaffe::BlobShape* InputParameter::mutable_shape(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.InputParameter.shape) + return shape_.Mutable(index); +} +inline ::ditcaffe::BlobShape* InputParameter::add_shape() { + // @@protoc_insertion_point(field_add:ditcaffe.InputParameter.shape) + return shape_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobShape >& +InputParameter::shape() const { + // @@protoc_insertion_point(field_list:ditcaffe.InputParameter.shape) + return shape_; +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobShape >* +InputParameter::mutable_shape() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.InputParameter.shape) + return &shape_; +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.LogParameter.base) + return base_; +} +inline void LogParameter::set_base(float value) { + set_has_base(); + base_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.LogParameter.scale) + return scale_; +} +inline void LogParameter::set_scale(float value) { + set_has_scale(); + scale_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.LogParameter.shift) + return shift_; +} +inline void LogParameter::set_shift(float value) { + set_has_shift(); + shift_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.LogParameter.shift) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.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:ditcaffe.LRNParameter.alpha) + return alpha_; +} +inline void LRNParameter::set_alpha(float value) { + set_has_alpha(); + alpha_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.LRNParameter.beta) + return beta_; +} +inline void LRNParameter::set_beta(float value) { + set_has_beta(); + beta_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.LRNParameter.beta) +} + +// optional .ditcaffe.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 ::ditcaffe::LRNParameter_NormRegion LRNParameter::norm_region() const { + // @@protoc_insertion_point(field_get:ditcaffe.LRNParameter.norm_region) + return static_cast< ::ditcaffe::LRNParameter_NormRegion >(norm_region_); +} +inline void LRNParameter::set_norm_region(::ditcaffe::LRNParameter_NormRegion value) { + assert(::ditcaffe::LRNParameter_NormRegion_IsValid(value)); + set_has_norm_region(); + norm_region_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.LRNParameter.k) + return k_; +} +inline void LRNParameter::set_k(float value) { + set_has_k(); + k_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.LRNParameter.k) +} + +// optional .ditcaffe.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 ::ditcaffe::LRNParameter_Engine LRNParameter::engine() const { + // @@protoc_insertion_point(field_get:ditcaffe.LRNParameter.engine) + return static_cast< ::ditcaffe::LRNParameter_Engine >(engine_); +} +inline void LRNParameter::set_engine(::ditcaffe::LRNParameter_Engine value) { + assert(::ditcaffe::LRNParameter_Engine_IsValid(value)); + set_has_engine(); + engine_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.LRNParameter.engine) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.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:ditcaffe.MemoryDataParameter.channels) + return channels_; +} +inline void MemoryDataParameter::set_channels(::google::protobuf::uint32 value) { + set_has_channels(); + channels_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.MemoryDataParameter.height) + return height_; +} +inline void MemoryDataParameter::set_height(::google::protobuf::uint32 value) { + set_has_height(); + height_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.MemoryDataParameter.width) + return width_; +} +inline void MemoryDataParameter::set_width(::google::protobuf::uint32 value) { + set_has_width(); + width_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.MemoryDataParameter.width) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.MVNParameter.eps) + return eps_; +} +inline void MVNParameter::set_eps(float value) { + set_has_eps(); + eps_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.MVNParameter.eps) +} + +// ------------------------------------------------------------------- + +// ParameterParameter + +// optional .ditcaffe.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_->::ditcaffe::BlobShape::Clear(); + clear_has_shape(); +} +inline const ::ditcaffe::BlobShape& ParameterParameter::shape() const { + // @@protoc_insertion_point(field_get:ditcaffe.ParameterParameter.shape) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return shape_ != NULL ? *shape_ : *default_instance().shape_; +#else + return shape_ != NULL ? *shape_ : *default_instance_->shape_; +#endif +} +inline ::ditcaffe::BlobShape* ParameterParameter::mutable_shape() { + set_has_shape(); + if (shape_ == NULL) shape_ = new ::ditcaffe::BlobShape; + // @@protoc_insertion_point(field_mutable:ditcaffe.ParameterParameter.shape) + return shape_; +} +inline ::ditcaffe::BlobShape* ParameterParameter::release_shape() { + clear_has_shape(); + ::ditcaffe::BlobShape* temp = shape_; + shape_ = NULL; + return temp; +} +inline void ParameterParameter::set_allocated_shape(::ditcaffe::BlobShape* shape) { + delete shape_; + shape_ = shape; + if (shape) { + set_has_shape(); + } else { + clear_has_shape(); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.ParameterParameter.shape) +} + +// ------------------------------------------------------------------- + +// PoolingParameter + +// optional .ditcaffe.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 ::ditcaffe::PoolingParameter_PoolMethod PoolingParameter::pool() const { + // @@protoc_insertion_point(field_get:ditcaffe.PoolingParameter.pool) + return static_cast< ::ditcaffe::PoolingParameter_PoolMethod >(pool_); +} +inline void PoolingParameter::set_pool(::ditcaffe::PoolingParameter_PoolMethod value) { + assert(::ditcaffe::PoolingParameter_PoolMethod_IsValid(value)); + set_has_pool(); + pool_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.PoolingParameter.pad) + return pad_; +} +inline void PoolingParameter::set_pad(::google::protobuf::uint32 value) { + set_has_pad(); + pad_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.PoolingParameter.stride) + return stride_; +} +inline void PoolingParameter::set_stride(::google::protobuf::uint32 value) { + set_has_stride(); + stride_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.PoolingParameter.stride_w) +} + +// optional .ditcaffe.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 ::ditcaffe::PoolingParameter_Engine PoolingParameter::engine() const { + // @@protoc_insertion_point(field_get:ditcaffe.PoolingParameter.engine) + return static_cast< ::ditcaffe::PoolingParameter_Engine >(engine_); +} +inline void PoolingParameter::set_engine(::ditcaffe::PoolingParameter_Engine value) { + assert(::ditcaffe::PoolingParameter_Engine_IsValid(value)); + set_has_engine(); + engine_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.PoolingParameter.global_pooling) +} + +// optional bool torch_pooling = 40 [default = false]; +inline bool PoolingParameter::has_torch_pooling() const { + return (_has_bits_[0] & 0x00001000u) != 0; +} +inline void PoolingParameter::set_has_torch_pooling() { + _has_bits_[0] |= 0x00001000u; +} +inline void PoolingParameter::clear_has_torch_pooling() { + _has_bits_[0] &= ~0x00001000u; +} +inline void PoolingParameter::clear_torch_pooling() { + torch_pooling_ = false; + clear_has_torch_pooling(); +} +inline bool PoolingParameter::torch_pooling() const { + // @@protoc_insertion_point(field_get:ditcaffe.PoolingParameter.torch_pooling) + return torch_pooling_; +} +inline void PoolingParameter::set_torch_pooling(bool value) { + set_has_torch_pooling(); + torch_pooling_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.PoolingParameter.torch_pooling) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.PowerParameter.power) + return power_; +} +inline void PowerParameter::set_power(float value) { + set_has_power(); + power_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.PowerParameter.scale) + return scale_; +} +inline void PowerParameter::set_scale(float value) { + set_has_scale(); + scale_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.PowerParameter.shift) + return shift_; +} +inline void PowerParameter::set_shift(float value) { + set_has_shift(); + shift_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.PowerParameter.shift) +} + +// ------------------------------------------------------------------- + +// 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() { + if (module_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + module_->clear(); + } + clear_has_module(); +} +inline const ::std::string& PythonParameter::module() const { + // @@protoc_insertion_point(field_get:ditcaffe.PythonParameter.module) + return *module_; +} +inline void PythonParameter::set_module(const ::std::string& value) { + set_has_module(); + if (module_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + module_ = new ::std::string; + } + module_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.PythonParameter.module) +} +inline void PythonParameter::set_module(const char* value) { + set_has_module(); + if (module_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + module_ = new ::std::string; + } + module_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.PythonParameter.module) +} +inline void PythonParameter::set_module(const char* value, size_t size) { + set_has_module(); + if (module_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + module_ = new ::std::string; + } + module_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.PythonParameter.module) +} +inline ::std::string* PythonParameter::mutable_module() { + set_has_module(); + if (module_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + module_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.PythonParameter.module) + return module_; +} +inline ::std::string* PythonParameter::release_module() { + clear_has_module(); + if (module_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = module_; + module_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void PythonParameter::set_allocated_module(::std::string* module) { + if (module_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete module_; + } + if (module) { + set_has_module(); + module_ = module; + } else { + clear_has_module(); + module_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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() { + if (layer_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + layer_->clear(); + } + clear_has_layer(); +} +inline const ::std::string& PythonParameter::layer() const { + // @@protoc_insertion_point(field_get:ditcaffe.PythonParameter.layer) + return *layer_; +} +inline void PythonParameter::set_layer(const ::std::string& value) { + set_has_layer(); + if (layer_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + layer_ = new ::std::string; + } + layer_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.PythonParameter.layer) +} +inline void PythonParameter::set_layer(const char* value) { + set_has_layer(); + if (layer_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + layer_ = new ::std::string; + } + layer_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.PythonParameter.layer) +} +inline void PythonParameter::set_layer(const char* value, size_t size) { + set_has_layer(); + if (layer_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + layer_ = new ::std::string; + } + layer_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.PythonParameter.layer) +} +inline ::std::string* PythonParameter::mutable_layer() { + set_has_layer(); + if (layer_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + layer_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.PythonParameter.layer) + return layer_; +} +inline ::std::string* PythonParameter::release_layer() { + clear_has_layer(); + if (layer_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = layer_; + layer_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void PythonParameter::set_allocated_layer(::std::string* layer) { + if (layer_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete layer_; + } + if (layer) { + set_has_layer(); + layer_ = layer; + } else { + clear_has_layer(); + layer_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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() { + if (param_str_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + param_str_->clear(); + } + clear_has_param_str(); +} +inline const ::std::string& PythonParameter::param_str() const { + // @@protoc_insertion_point(field_get:ditcaffe.PythonParameter.param_str) + return *param_str_; +} +inline void PythonParameter::set_param_str(const ::std::string& value) { + set_has_param_str(); + if (param_str_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + param_str_ = new ::std::string; + } + param_str_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.PythonParameter.param_str) +} +inline void PythonParameter::set_param_str(const char* value) { + set_has_param_str(); + if (param_str_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + param_str_ = new ::std::string; + } + param_str_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.PythonParameter.param_str) +} +inline void PythonParameter::set_param_str(const char* value, size_t size) { + set_has_param_str(); + if (param_str_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + param_str_ = new ::std::string; + } + param_str_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.PythonParameter.param_str) +} +inline ::std::string* PythonParameter::mutable_param_str() { + set_has_param_str(); + if (param_str_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + param_str_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.PythonParameter.param_str) + return param_str_; +} +inline ::std::string* PythonParameter::release_param_str() { + clear_has_param_str(); + if (param_str_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = param_str_; + param_str_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void PythonParameter::set_allocated_param_str(::std::string* param_str) { + if (param_str_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete param_str_; + } + if (param_str) { + set_has_param_str(); + param_str_ = param_str; + } else { + clear_has_param_str(); + param_str_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.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:ditcaffe.PythonParameter.share_in_parallel) +} + +// ------------------------------------------------------------------- + +// ReductionParameter + +// optional .ditcaffe.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 ::ditcaffe::ReductionParameter_ReductionOp ReductionParameter::operation() const { + // @@protoc_insertion_point(field_get:ditcaffe.ReductionParameter.operation) + return static_cast< ::ditcaffe::ReductionParameter_ReductionOp >(operation_); +} +inline void ReductionParameter::set_operation(::ditcaffe::ReductionParameter_ReductionOp value) { + assert(::ditcaffe::ReductionParameter_ReductionOp_IsValid(value)); + set_has_operation(); + operation_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.ReductionParameter.axis) + return axis_; +} +inline void ReductionParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.ReductionParameter.coeff) + return coeff_; +} +inline void ReductionParameter::set_coeff(float value) { + set_has_coeff(); + coeff_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.ReductionParameter.coeff) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.ReLUParameter.negative_slope) +} + +// optional .ditcaffe.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 ::ditcaffe::ReLUParameter_Engine ReLUParameter::engine() const { + // @@protoc_insertion_point(field_get:ditcaffe.ReLUParameter.engine) + return static_cast< ::ditcaffe::ReLUParameter_Engine >(engine_); +} +inline void ReLUParameter::set_engine(::ditcaffe::ReLUParameter_Engine value) { + assert(::ditcaffe::ReLUParameter_Engine_IsValid(value)); + set_has_engine(); + engine_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.ReLUParameter.engine) +} + +// ------------------------------------------------------------------- + +// ReshapeParameter + +// optional .ditcaffe.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_->::ditcaffe::BlobShape::Clear(); + clear_has_shape(); +} +inline const ::ditcaffe::BlobShape& ReshapeParameter::shape() const { + // @@protoc_insertion_point(field_get:ditcaffe.ReshapeParameter.shape) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return shape_ != NULL ? *shape_ : *default_instance().shape_; +#else + return shape_ != NULL ? *shape_ : *default_instance_->shape_; +#endif +} +inline ::ditcaffe::BlobShape* ReshapeParameter::mutable_shape() { + set_has_shape(); + if (shape_ == NULL) shape_ = new ::ditcaffe::BlobShape; + // @@protoc_insertion_point(field_mutable:ditcaffe.ReshapeParameter.shape) + return shape_; +} +inline ::ditcaffe::BlobShape* ReshapeParameter::release_shape() { + clear_has_shape(); + ::ditcaffe::BlobShape* temp = shape_; + shape_ = NULL; + return temp; +} +inline void ReshapeParameter::set_allocated_shape(::ditcaffe::BlobShape* shape) { + delete shape_; + shape_ = shape; + if (shape) { + set_has_shape(); + } else { + clear_has_shape(); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.ReshapeParameter.axis) + return axis_; +} +inline void ReshapeParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.ReshapeParameter.num_axes) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.ScaleParameter.axis) + return axis_; +} +inline void ScaleParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.ScaleParameter.num_axes) +} + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_filler(); +} +inline const ::ditcaffe::FillerParameter& ScaleParameter::filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.ScaleParameter.filler) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return filler_ != NULL ? *filler_ : *default_instance().filler_; +#else + return filler_ != NULL ? *filler_ : *default_instance_->filler_; +#endif +} +inline ::ditcaffe::FillerParameter* ScaleParameter::mutable_filler() { + set_has_filler(); + if (filler_ == NULL) filler_ = new ::ditcaffe::FillerParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.ScaleParameter.filler) + return filler_; +} +inline ::ditcaffe::FillerParameter* ScaleParameter::release_filler() { + clear_has_filler(); + ::ditcaffe::FillerParameter* temp = filler_; + filler_ = NULL; + return temp; +} +inline void ScaleParameter::set_allocated_filler(::ditcaffe::FillerParameter* filler) { + delete filler_; + filler_ = filler; + if (filler) { + set_has_filler(); + } else { + clear_has_filler(); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.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:ditcaffe.ScaleParameter.bias_term) +} + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_bias_filler(); +} +inline const ::ditcaffe::FillerParameter& ScaleParameter::bias_filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.ScaleParameter.bias_filler) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return bias_filler_ != NULL ? *bias_filler_ : *default_instance().bias_filler_; +#else + return bias_filler_ != NULL ? *bias_filler_ : *default_instance_->bias_filler_; +#endif +} +inline ::ditcaffe::FillerParameter* ScaleParameter::mutable_bias_filler() { + set_has_bias_filler(); + if (bias_filler_ == NULL) bias_filler_ = new ::ditcaffe::FillerParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.ScaleParameter.bias_filler) + return bias_filler_; +} +inline ::ditcaffe::FillerParameter* ScaleParameter::release_bias_filler() { + clear_has_bias_filler(); + ::ditcaffe::FillerParameter* temp = bias_filler_; + bias_filler_ = NULL; + return temp; +} +inline void ScaleParameter::set_allocated_bias_filler(::ditcaffe::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:ditcaffe.ScaleParameter.bias_filler) +} + +// ------------------------------------------------------------------- + +// SigmoidParameter + +// optional .ditcaffe.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 ::ditcaffe::SigmoidParameter_Engine SigmoidParameter::engine() const { + // @@protoc_insertion_point(field_get:ditcaffe.SigmoidParameter.engine) + return static_cast< ::ditcaffe::SigmoidParameter_Engine >(engine_); +} +inline void SigmoidParameter::set_engine(::ditcaffe::SigmoidParameter_Engine value) { + assert(::ditcaffe::SigmoidParameter_Engine_IsValid(value)); + set_has_engine(); + engine_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.SigmoidParameter.engine) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.SliceParameter.axis) + return axis_; +} +inline void SliceParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.SliceParameter.slice_point) +} +inline void SliceParameter::add_slice_point(::google::protobuf::uint32 value) { + slice_point_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.SliceParameter.slice_point) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +SliceParameter::slice_point() const { + // @@protoc_insertion_point(field_list:ditcaffe.SliceParameter.slice_point) + return slice_point_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +SliceParameter::mutable_slice_point() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.SliceParameter.slice_dim) +} + +// ------------------------------------------------------------------- + +// SoftmaxParameter + +// optional .ditcaffe.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 ::ditcaffe::SoftmaxParameter_Engine SoftmaxParameter::engine() const { + // @@protoc_insertion_point(field_get:ditcaffe.SoftmaxParameter.engine) + return static_cast< ::ditcaffe::SoftmaxParameter_Engine >(engine_); +} +inline void SoftmaxParameter::set_engine(::ditcaffe::SoftmaxParameter_Engine value) { + assert(::ditcaffe::SoftmaxParameter_Engine_IsValid(value)); + set_has_engine(); + engine_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.SoftmaxParameter.axis) + return axis_; +} +inline void SoftmaxParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.SoftmaxParameter.axis) +} + +// ------------------------------------------------------------------- + +// TanHParameter + +// optional .ditcaffe.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 ::ditcaffe::TanHParameter_Engine TanHParameter::engine() const { + // @@protoc_insertion_point(field_get:ditcaffe.TanHParameter.engine) + return static_cast< ::ditcaffe::TanHParameter_Engine >(engine_); +} +inline void TanHParameter::set_engine(::ditcaffe::TanHParameter_Engine value) { + assert(::ditcaffe::TanHParameter_Engine_IsValid(value)); + set_has_engine(); + engine_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.TanHParameter.engine) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.TileParameter.axis) + return axis_; +} +inline void TileParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.TileParameter.tiles) + return tiles_; +} +inline void TileParameter::set_tiles(::google::protobuf::int32 value) { + set_has_tiles(); + tiles_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.TileParameter.tiles) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.ThresholdParameter.threshold) + return threshold_; +} +inline void ThresholdParameter::set_threshold(float value) { + set_has_threshold(); + threshold_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.ThresholdParameter.threshold) +} + +// ------------------------------------------------------------------- + +// 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() { + if (source_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_->clear(); + } + clear_has_source(); +} +inline const ::std::string& WindowDataParameter::source() const { + // @@protoc_insertion_point(field_get:ditcaffe.WindowDataParameter.source) + return *source_; +} +inline void WindowDataParameter::set_source(const ::std::string& value) { + set_has_source(); + if (source_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_ = new ::std::string; + } + source_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.WindowDataParameter.source) +} +inline void WindowDataParameter::set_source(const char* value) { + set_has_source(); + if (source_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_ = new ::std::string; + } + source_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.WindowDataParameter.source) +} +inline void WindowDataParameter::set_source(const char* value, size_t size) { + set_has_source(); + if (source_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_ = new ::std::string; + } + source_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.WindowDataParameter.source) +} +inline ::std::string* WindowDataParameter::mutable_source() { + set_has_source(); + if (source_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.WindowDataParameter.source) + return source_; +} +inline ::std::string* WindowDataParameter::release_source() { + clear_has_source(); + if (source_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = source_; + source_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void WindowDataParameter::set_allocated_source(::std::string* source) { + if (source_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete source_; + } + if (source) { + set_has_source(); + source_ = source; + } else { + clear_has_source(); + source_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.WindowDataParameter.scale) + return scale_; +} +inline void WindowDataParameter::set_scale(float value) { + set_has_scale(); + scale_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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() { + if (mean_file_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + mean_file_->clear(); + } + clear_has_mean_file(); +} +inline const ::std::string& WindowDataParameter::mean_file() const { + // @@protoc_insertion_point(field_get:ditcaffe.WindowDataParameter.mean_file) + return *mean_file_; +} +inline void WindowDataParameter::set_mean_file(const ::std::string& value) { + set_has_mean_file(); + if (mean_file_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + mean_file_ = new ::std::string; + } + mean_file_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.WindowDataParameter.mean_file) +} +inline void WindowDataParameter::set_mean_file(const char* value) { + set_has_mean_file(); + if (mean_file_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + mean_file_ = new ::std::string; + } + mean_file_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.WindowDataParameter.mean_file) +} +inline void WindowDataParameter::set_mean_file(const char* value, size_t size) { + set_has_mean_file(); + if (mean_file_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + mean_file_ = new ::std::string; + } + mean_file_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.WindowDataParameter.mean_file) +} +inline ::std::string* WindowDataParameter::mutable_mean_file() { + set_has_mean_file(); + if (mean_file_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + mean_file_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.WindowDataParameter.mean_file) + return mean_file_; +} +inline ::std::string* WindowDataParameter::release_mean_file() { + clear_has_mean_file(); + if (mean_file_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = mean_file_; + mean_file_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void WindowDataParameter::set_allocated_mean_file(::std::string* mean_file) { + if (mean_file_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete mean_file_; + } + if (mean_file) { + set_has_mean_file(); + mean_file_ = mean_file; + } else { + clear_has_mean_file(); + mean_file_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.WindowDataParameter.mirror) + return mirror_; +} +inline void WindowDataParameter::set_mirror(bool value) { + set_has_mirror(); + mirror_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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() { + if (crop_mode_ != _default_crop_mode_) { + crop_mode_->assign(*_default_crop_mode_); + } + clear_has_crop_mode(); +} +inline const ::std::string& WindowDataParameter::crop_mode() const { + // @@protoc_insertion_point(field_get:ditcaffe.WindowDataParameter.crop_mode) + return *crop_mode_; +} +inline void WindowDataParameter::set_crop_mode(const ::std::string& value) { + set_has_crop_mode(); + if (crop_mode_ == _default_crop_mode_) { + crop_mode_ = new ::std::string; + } + crop_mode_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.WindowDataParameter.crop_mode) +} +inline void WindowDataParameter::set_crop_mode(const char* value) { + set_has_crop_mode(); + if (crop_mode_ == _default_crop_mode_) { + crop_mode_ = new ::std::string; + } + crop_mode_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.WindowDataParameter.crop_mode) +} +inline void WindowDataParameter::set_crop_mode(const char* value, size_t size) { + set_has_crop_mode(); + if (crop_mode_ == _default_crop_mode_) { + crop_mode_ = new ::std::string; + } + crop_mode_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.WindowDataParameter.crop_mode) +} +inline ::std::string* WindowDataParameter::mutable_crop_mode() { + set_has_crop_mode(); + if (crop_mode_ == _default_crop_mode_) { + crop_mode_ = new ::std::string(*_default_crop_mode_); + } + // @@protoc_insertion_point(field_mutable:ditcaffe.WindowDataParameter.crop_mode) + return crop_mode_; +} +inline ::std::string* WindowDataParameter::release_crop_mode() { + clear_has_crop_mode(); + if (crop_mode_ == _default_crop_mode_) { + return NULL; + } else { + ::std::string* temp = crop_mode_; + crop_mode_ = const_cast< ::std::string*>(_default_crop_mode_); + return temp; + } +} +inline void WindowDataParameter::set_allocated_crop_mode(::std::string* crop_mode) { + if (crop_mode_ != _default_crop_mode_) { + delete crop_mode_; + } + if (crop_mode) { + set_has_crop_mode(); + crop_mode_ = crop_mode; + } else { + clear_has_crop_mode(); + crop_mode_ = const_cast< ::std::string*>(_default_crop_mode_); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.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:ditcaffe.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() { + if (root_folder_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + root_folder_->clear(); + } + clear_has_root_folder(); +} +inline const ::std::string& WindowDataParameter::root_folder() const { + // @@protoc_insertion_point(field_get:ditcaffe.WindowDataParameter.root_folder) + return *root_folder_; +} +inline void WindowDataParameter::set_root_folder(const ::std::string& value) { + set_has_root_folder(); + if (root_folder_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + root_folder_ = new ::std::string; + } + root_folder_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.WindowDataParameter.root_folder) +} +inline void WindowDataParameter::set_root_folder(const char* value) { + set_has_root_folder(); + if (root_folder_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + root_folder_ = new ::std::string; + } + root_folder_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.WindowDataParameter.root_folder) +} +inline void WindowDataParameter::set_root_folder(const char* value, size_t size) { + set_has_root_folder(); + if (root_folder_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + root_folder_ = new ::std::string; + } + root_folder_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.WindowDataParameter.root_folder) +} +inline ::std::string* WindowDataParameter::mutable_root_folder() { + set_has_root_folder(); + if (root_folder_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + root_folder_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.WindowDataParameter.root_folder) + return root_folder_; +} +inline ::std::string* WindowDataParameter::release_root_folder() { + clear_has_root_folder(); + if (root_folder_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = root_folder_; + root_folder_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void WindowDataParameter::set_allocated_root_folder(::std::string* root_folder) { + if (root_folder_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete root_folder_; + } + if (root_folder) { + set_has_root_folder(); + root_folder_ = root_folder; + } else { + clear_has_root_folder(); + root_folder_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.WindowDataParameter.root_folder) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.SPPParameter.pyramid_height) +} + +// optional .ditcaffe.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 ::ditcaffe::SPPParameter_PoolMethod SPPParameter::pool() const { + // @@protoc_insertion_point(field_get:ditcaffe.SPPParameter.pool) + return static_cast< ::ditcaffe::SPPParameter_PoolMethod >(pool_); +} +inline void SPPParameter::set_pool(::ditcaffe::SPPParameter_PoolMethod value) { + assert(::ditcaffe::SPPParameter_PoolMethod_IsValid(value)); + set_has_pool(); + pool_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.SPPParameter.pool) +} + +// optional .ditcaffe.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 ::ditcaffe::SPPParameter_Engine SPPParameter::engine() const { + // @@protoc_insertion_point(field_get:ditcaffe.SPPParameter.engine) + return static_cast< ::ditcaffe::SPPParameter_Engine >(engine_); +} +inline void SPPParameter::set_engine(::ditcaffe::SPPParameter_Engine value) { + assert(::ditcaffe::SPPParameter_Engine_IsValid(value)); + set_has_engine(); + engine_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.SPPParameter.engine) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.V1LayerParameter.bottom) + return bottom_.Get(index); +} +inline ::std::string* V1LayerParameter::mutable_bottom(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.bottom) + return bottom_.Mutable(index); +} +inline void V1LayerParameter::set_bottom(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.V1LayerParameter.bottom) +} +inline ::std::string* V1LayerParameter::add_bottom() { + return bottom_.Add(); +} +inline void V1LayerParameter::add_bottom(const ::std::string& value) { + bottom_.Add()->assign(value); + // @@protoc_insertion_point(field_add:ditcaffe.V1LayerParameter.bottom) +} +inline void V1LayerParameter::add_bottom(const char* value) { + bottom_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:ditcaffe.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:ditcaffe.V1LayerParameter.bottom) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +V1LayerParameter::bottom() const { + // @@protoc_insertion_point(field_list:ditcaffe.V1LayerParameter.bottom) + return bottom_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +V1LayerParameter::mutable_bottom() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.V1LayerParameter.top) + return top_.Get(index); +} +inline ::std::string* V1LayerParameter::mutable_top(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.top) + return top_.Mutable(index); +} +inline void V1LayerParameter::set_top(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.V1LayerParameter.top) +} +inline ::std::string* V1LayerParameter::add_top() { + return top_.Add(); +} +inline void V1LayerParameter::add_top(const ::std::string& value) { + top_.Add()->assign(value); + // @@protoc_insertion_point(field_add:ditcaffe.V1LayerParameter.top) +} +inline void V1LayerParameter::add_top(const char* value) { + top_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:ditcaffe.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:ditcaffe.V1LayerParameter.top) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +V1LayerParameter::top() const { + // @@protoc_insertion_point(field_list:ditcaffe.V1LayerParameter.top) + return top_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +V1LayerParameter::mutable_top() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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() { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_->clear(); + } + clear_has_name(); +} +inline const ::std::string& V1LayerParameter::name() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.name) + return *name_; +} +inline void V1LayerParameter::set_name(const ::std::string& value) { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + name_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.V1LayerParameter.name) +} +inline void V1LayerParameter::set_name(const char* value) { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + name_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.V1LayerParameter.name) +} +inline void V1LayerParameter::set_name(const char* value, size_t size) { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + name_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.V1LayerParameter.name) +} +inline ::std::string* V1LayerParameter::mutable_name() { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.name) + return name_; +} +inline ::std::string* V1LayerParameter::release_name() { + clear_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = name_; + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void V1LayerParameter::set_allocated_name(::std::string* name) { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete name_; + } + if (name) { + set_has_name(); + name_ = name; + } else { + clear_has_name(); + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.V1LayerParameter.name) +} + +// repeated .ditcaffe.NetStateRule include = 32; +inline int V1LayerParameter::include_size() const { + return include_.size(); +} +inline void V1LayerParameter::clear_include() { + include_.Clear(); +} +inline const ::ditcaffe::NetStateRule& V1LayerParameter::include(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.include) + return include_.Get(index); +} +inline ::ditcaffe::NetStateRule* V1LayerParameter::mutable_include(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.include) + return include_.Mutable(index); +} +inline ::ditcaffe::NetStateRule* V1LayerParameter::add_include() { + // @@protoc_insertion_point(field_add:ditcaffe.V1LayerParameter.include) + return include_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >& +V1LayerParameter::include() const { + // @@protoc_insertion_point(field_list:ditcaffe.V1LayerParameter.include) + return include_; +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >* +V1LayerParameter::mutable_include() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.V1LayerParameter.include) + return &include_; +} + +// repeated .ditcaffe.NetStateRule exclude = 33; +inline int V1LayerParameter::exclude_size() const { + return exclude_.size(); +} +inline void V1LayerParameter::clear_exclude() { + exclude_.Clear(); +} +inline const ::ditcaffe::NetStateRule& V1LayerParameter::exclude(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.exclude) + return exclude_.Get(index); +} +inline ::ditcaffe::NetStateRule* V1LayerParameter::mutable_exclude(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.exclude) + return exclude_.Mutable(index); +} +inline ::ditcaffe::NetStateRule* V1LayerParameter::add_exclude() { + // @@protoc_insertion_point(field_add:ditcaffe.V1LayerParameter.exclude) + return exclude_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >& +V1LayerParameter::exclude() const { + // @@protoc_insertion_point(field_list:ditcaffe.V1LayerParameter.exclude) + return exclude_; +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >* +V1LayerParameter::mutable_exclude() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.V1LayerParameter.exclude) + return &exclude_; +} + +// optional .ditcaffe.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 ::ditcaffe::V1LayerParameter_LayerType V1LayerParameter::type() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.type) + return static_cast< ::ditcaffe::V1LayerParameter_LayerType >(type_); +} +inline void V1LayerParameter::set_type(::ditcaffe::V1LayerParameter_LayerType value) { + assert(::ditcaffe::V1LayerParameter_LayerType_IsValid(value)); + set_has_type(); + type_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.V1LayerParameter.type) +} + +// repeated .ditcaffe.BlobProto blobs = 6; +inline int V1LayerParameter::blobs_size() const { + return blobs_.size(); +} +inline void V1LayerParameter::clear_blobs() { + blobs_.Clear(); +} +inline const ::ditcaffe::BlobProto& V1LayerParameter::blobs(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.blobs) + return blobs_.Get(index); +} +inline ::ditcaffe::BlobProto* V1LayerParameter::mutable_blobs(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.blobs) + return blobs_.Mutable(index); +} +inline ::ditcaffe::BlobProto* V1LayerParameter::add_blobs() { + // @@protoc_insertion_point(field_add:ditcaffe.V1LayerParameter.blobs) + return blobs_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >& +V1LayerParameter::blobs() const { + // @@protoc_insertion_point(field_list:ditcaffe.V1LayerParameter.blobs) + return blobs_; +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >* +V1LayerParameter::mutable_blobs() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.V1LayerParameter.param) + return param_.Get(index); +} +inline ::std::string* V1LayerParameter::mutable_param(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.param) + return param_.Mutable(index); +} +inline void V1LayerParameter::set_param(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.V1LayerParameter.param) +} +inline ::std::string* V1LayerParameter::add_param() { + return param_.Add(); +} +inline void V1LayerParameter::add_param(const ::std::string& value) { + param_.Add()->assign(value); + // @@protoc_insertion_point(field_add:ditcaffe.V1LayerParameter.param) +} +inline void V1LayerParameter::add_param(const char* value) { + param_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:ditcaffe.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:ditcaffe.V1LayerParameter.param) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +V1LayerParameter::param() const { + // @@protoc_insertion_point(field_list:ditcaffe.V1LayerParameter.param) + return param_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +V1LayerParameter::mutable_param() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.V1LayerParameter.param) + return ¶m_; +} + +// repeated .ditcaffe.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 ::ditcaffe::V1LayerParameter_DimCheckMode V1LayerParameter::blob_share_mode(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.blob_share_mode) + return static_cast< ::ditcaffe::V1LayerParameter_DimCheckMode >(blob_share_mode_.Get(index)); +} +inline void V1LayerParameter::set_blob_share_mode(int index, ::ditcaffe::V1LayerParameter_DimCheckMode value) { + assert(::ditcaffe::V1LayerParameter_DimCheckMode_IsValid(value)); + blob_share_mode_.Set(index, value); + // @@protoc_insertion_point(field_set:ditcaffe.V1LayerParameter.blob_share_mode) +} +inline void V1LayerParameter::add_blob_share_mode(::ditcaffe::V1LayerParameter_DimCheckMode value) { + assert(::ditcaffe::V1LayerParameter_DimCheckMode_IsValid(value)); + blob_share_mode_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.V1LayerParameter.blob_share_mode) +} +inline const ::google::protobuf::RepeatedField& +V1LayerParameter::blob_share_mode() const { + // @@protoc_insertion_point(field_list:ditcaffe.V1LayerParameter.blob_share_mode) + return blob_share_mode_; +} +inline ::google::protobuf::RepeatedField* +V1LayerParameter::mutable_blob_share_mode() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.V1LayerParameter.blobs_lr) +} +inline void V1LayerParameter::add_blobs_lr(float value) { + blobs_lr_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.V1LayerParameter.blobs_lr) +} +inline const ::google::protobuf::RepeatedField< float >& +V1LayerParameter::blobs_lr() const { + // @@protoc_insertion_point(field_list:ditcaffe.V1LayerParameter.blobs_lr) + return blobs_lr_; +} +inline ::google::protobuf::RepeatedField< float >* +V1LayerParameter::mutable_blobs_lr() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.V1LayerParameter.weight_decay) +} +inline void V1LayerParameter::add_weight_decay(float value) { + weight_decay_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.V1LayerParameter.weight_decay) +} +inline const ::google::protobuf::RepeatedField< float >& +V1LayerParameter::weight_decay() const { + // @@protoc_insertion_point(field_list:ditcaffe.V1LayerParameter.weight_decay) + return weight_decay_; +} +inline ::google::protobuf::RepeatedField< float >* +V1LayerParameter::mutable_weight_decay() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.V1LayerParameter.loss_weight) +} +inline void V1LayerParameter::add_loss_weight(float value) { + loss_weight_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.V1LayerParameter.loss_weight) +} +inline const ::google::protobuf::RepeatedField< float >& +V1LayerParameter::loss_weight() const { + // @@protoc_insertion_point(field_list:ditcaffe.V1LayerParameter.loss_weight) + return loss_weight_; +} +inline ::google::protobuf::RepeatedField< float >* +V1LayerParameter::mutable_loss_weight() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.V1LayerParameter.loss_weight) + return &loss_weight_; +} + +// optional .ditcaffe.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_->::ditcaffe::AccuracyParameter::Clear(); + clear_has_accuracy_param(); +} +inline const ::ditcaffe::AccuracyParameter& V1LayerParameter::accuracy_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.accuracy_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return accuracy_param_ != NULL ? *accuracy_param_ : *default_instance().accuracy_param_; +#else + return accuracy_param_ != NULL ? *accuracy_param_ : *default_instance_->accuracy_param_; +#endif +} +inline ::ditcaffe::AccuracyParameter* V1LayerParameter::mutable_accuracy_param() { + set_has_accuracy_param(); + if (accuracy_param_ == NULL) accuracy_param_ = new ::ditcaffe::AccuracyParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.accuracy_param) + return accuracy_param_; +} +inline ::ditcaffe::AccuracyParameter* V1LayerParameter::release_accuracy_param() { + clear_has_accuracy_param(); + ::ditcaffe::AccuracyParameter* temp = accuracy_param_; + accuracy_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_accuracy_param(::ditcaffe::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:ditcaffe.V1LayerParameter.accuracy_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ArgMaxParameter::Clear(); + clear_has_argmax_param(); +} +inline const ::ditcaffe::ArgMaxParameter& V1LayerParameter::argmax_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.argmax_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return argmax_param_ != NULL ? *argmax_param_ : *default_instance().argmax_param_; +#else + return argmax_param_ != NULL ? *argmax_param_ : *default_instance_->argmax_param_; +#endif +} +inline ::ditcaffe::ArgMaxParameter* V1LayerParameter::mutable_argmax_param() { + set_has_argmax_param(); + if (argmax_param_ == NULL) argmax_param_ = new ::ditcaffe::ArgMaxParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.argmax_param) + return argmax_param_; +} +inline ::ditcaffe::ArgMaxParameter* V1LayerParameter::release_argmax_param() { + clear_has_argmax_param(); + ::ditcaffe::ArgMaxParameter* temp = argmax_param_; + argmax_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_argmax_param(::ditcaffe::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:ditcaffe.V1LayerParameter.argmax_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ConcatParameter::Clear(); + clear_has_concat_param(); +} +inline const ::ditcaffe::ConcatParameter& V1LayerParameter::concat_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.concat_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return concat_param_ != NULL ? *concat_param_ : *default_instance().concat_param_; +#else + return concat_param_ != NULL ? *concat_param_ : *default_instance_->concat_param_; +#endif +} +inline ::ditcaffe::ConcatParameter* V1LayerParameter::mutable_concat_param() { + set_has_concat_param(); + if (concat_param_ == NULL) concat_param_ = new ::ditcaffe::ConcatParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.concat_param) + return concat_param_; +} +inline ::ditcaffe::ConcatParameter* V1LayerParameter::release_concat_param() { + clear_has_concat_param(); + ::ditcaffe::ConcatParameter* temp = concat_param_; + concat_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_concat_param(::ditcaffe::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:ditcaffe.V1LayerParameter.concat_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ContrastiveLossParameter::Clear(); + clear_has_contrastive_loss_param(); +} +inline const ::ditcaffe::ContrastiveLossParameter& V1LayerParameter::contrastive_loss_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.contrastive_loss_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return contrastive_loss_param_ != NULL ? *contrastive_loss_param_ : *default_instance().contrastive_loss_param_; +#else + return contrastive_loss_param_ != NULL ? *contrastive_loss_param_ : *default_instance_->contrastive_loss_param_; +#endif +} +inline ::ditcaffe::ContrastiveLossParameter* V1LayerParameter::mutable_contrastive_loss_param() { + set_has_contrastive_loss_param(); + if (contrastive_loss_param_ == NULL) contrastive_loss_param_ = new ::ditcaffe::ContrastiveLossParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.contrastive_loss_param) + return contrastive_loss_param_; +} +inline ::ditcaffe::ContrastiveLossParameter* V1LayerParameter::release_contrastive_loss_param() { + clear_has_contrastive_loss_param(); + ::ditcaffe::ContrastiveLossParameter* temp = contrastive_loss_param_; + contrastive_loss_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_contrastive_loss_param(::ditcaffe::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:ditcaffe.V1LayerParameter.contrastive_loss_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ConvolutionParameter::Clear(); + clear_has_convolution_param(); +} +inline const ::ditcaffe::ConvolutionParameter& V1LayerParameter::convolution_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.convolution_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return convolution_param_ != NULL ? *convolution_param_ : *default_instance().convolution_param_; +#else + return convolution_param_ != NULL ? *convolution_param_ : *default_instance_->convolution_param_; +#endif +} +inline ::ditcaffe::ConvolutionParameter* V1LayerParameter::mutable_convolution_param() { + set_has_convolution_param(); + if (convolution_param_ == NULL) convolution_param_ = new ::ditcaffe::ConvolutionParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.convolution_param) + return convolution_param_; +} +inline ::ditcaffe::ConvolutionParameter* V1LayerParameter::release_convolution_param() { + clear_has_convolution_param(); + ::ditcaffe::ConvolutionParameter* temp = convolution_param_; + convolution_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_convolution_param(::ditcaffe::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:ditcaffe.V1LayerParameter.convolution_param) +} + +// optional .ditcaffe.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_->::ditcaffe::DataParameter::Clear(); + clear_has_data_param(); +} +inline const ::ditcaffe::DataParameter& V1LayerParameter::data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.data_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return data_param_ != NULL ? *data_param_ : *default_instance().data_param_; +#else + return data_param_ != NULL ? *data_param_ : *default_instance_->data_param_; +#endif +} +inline ::ditcaffe::DataParameter* V1LayerParameter::mutable_data_param() { + set_has_data_param(); + if (data_param_ == NULL) data_param_ = new ::ditcaffe::DataParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.data_param) + return data_param_; +} +inline ::ditcaffe::DataParameter* V1LayerParameter::release_data_param() { + clear_has_data_param(); + ::ditcaffe::DataParameter* temp = data_param_; + data_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_data_param(::ditcaffe::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:ditcaffe.V1LayerParameter.data_param) +} + +// optional .ditcaffe.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_->::ditcaffe::DropoutParameter::Clear(); + clear_has_dropout_param(); +} +inline const ::ditcaffe::DropoutParameter& V1LayerParameter::dropout_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.dropout_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return dropout_param_ != NULL ? *dropout_param_ : *default_instance().dropout_param_; +#else + return dropout_param_ != NULL ? *dropout_param_ : *default_instance_->dropout_param_; +#endif +} +inline ::ditcaffe::DropoutParameter* V1LayerParameter::mutable_dropout_param() { + set_has_dropout_param(); + if (dropout_param_ == NULL) dropout_param_ = new ::ditcaffe::DropoutParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.dropout_param) + return dropout_param_; +} +inline ::ditcaffe::DropoutParameter* V1LayerParameter::release_dropout_param() { + clear_has_dropout_param(); + ::ditcaffe::DropoutParameter* temp = dropout_param_; + dropout_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_dropout_param(::ditcaffe::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:ditcaffe.V1LayerParameter.dropout_param) +} + +// optional .ditcaffe.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_->::ditcaffe::DummyDataParameter::Clear(); + clear_has_dummy_data_param(); +} +inline const ::ditcaffe::DummyDataParameter& V1LayerParameter::dummy_data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.dummy_data_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return dummy_data_param_ != NULL ? *dummy_data_param_ : *default_instance().dummy_data_param_; +#else + return dummy_data_param_ != NULL ? *dummy_data_param_ : *default_instance_->dummy_data_param_; +#endif +} +inline ::ditcaffe::DummyDataParameter* V1LayerParameter::mutable_dummy_data_param() { + set_has_dummy_data_param(); + if (dummy_data_param_ == NULL) dummy_data_param_ = new ::ditcaffe::DummyDataParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.dummy_data_param) + return dummy_data_param_; +} +inline ::ditcaffe::DummyDataParameter* V1LayerParameter::release_dummy_data_param() { + clear_has_dummy_data_param(); + ::ditcaffe::DummyDataParameter* temp = dummy_data_param_; + dummy_data_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_dummy_data_param(::ditcaffe::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:ditcaffe.V1LayerParameter.dummy_data_param) +} + +// optional .ditcaffe.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_->::ditcaffe::EltwiseParameter::Clear(); + clear_has_eltwise_param(); +} +inline const ::ditcaffe::EltwiseParameter& V1LayerParameter::eltwise_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.eltwise_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return eltwise_param_ != NULL ? *eltwise_param_ : *default_instance().eltwise_param_; +#else + return eltwise_param_ != NULL ? *eltwise_param_ : *default_instance_->eltwise_param_; +#endif +} +inline ::ditcaffe::EltwiseParameter* V1LayerParameter::mutable_eltwise_param() { + set_has_eltwise_param(); + if (eltwise_param_ == NULL) eltwise_param_ = new ::ditcaffe::EltwiseParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.eltwise_param) + return eltwise_param_; +} +inline ::ditcaffe::EltwiseParameter* V1LayerParameter::release_eltwise_param() { + clear_has_eltwise_param(); + ::ditcaffe::EltwiseParameter* temp = eltwise_param_; + eltwise_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_eltwise_param(::ditcaffe::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:ditcaffe.V1LayerParameter.eltwise_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ExpParameter::Clear(); + clear_has_exp_param(); +} +inline const ::ditcaffe::ExpParameter& V1LayerParameter::exp_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.exp_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return exp_param_ != NULL ? *exp_param_ : *default_instance().exp_param_; +#else + return exp_param_ != NULL ? *exp_param_ : *default_instance_->exp_param_; +#endif +} +inline ::ditcaffe::ExpParameter* V1LayerParameter::mutable_exp_param() { + set_has_exp_param(); + if (exp_param_ == NULL) exp_param_ = new ::ditcaffe::ExpParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.exp_param) + return exp_param_; +} +inline ::ditcaffe::ExpParameter* V1LayerParameter::release_exp_param() { + clear_has_exp_param(); + ::ditcaffe::ExpParameter* temp = exp_param_; + exp_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_exp_param(::ditcaffe::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:ditcaffe.V1LayerParameter.exp_param) +} + +// optional .ditcaffe.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_->::ditcaffe::HDF5DataParameter::Clear(); + clear_has_hdf5_data_param(); +} +inline const ::ditcaffe::HDF5DataParameter& V1LayerParameter::hdf5_data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.hdf5_data_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return hdf5_data_param_ != NULL ? *hdf5_data_param_ : *default_instance().hdf5_data_param_; +#else + return hdf5_data_param_ != NULL ? *hdf5_data_param_ : *default_instance_->hdf5_data_param_; +#endif +} +inline ::ditcaffe::HDF5DataParameter* V1LayerParameter::mutable_hdf5_data_param() { + set_has_hdf5_data_param(); + if (hdf5_data_param_ == NULL) hdf5_data_param_ = new ::ditcaffe::HDF5DataParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.hdf5_data_param) + return hdf5_data_param_; +} +inline ::ditcaffe::HDF5DataParameter* V1LayerParameter::release_hdf5_data_param() { + clear_has_hdf5_data_param(); + ::ditcaffe::HDF5DataParameter* temp = hdf5_data_param_; + hdf5_data_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_hdf5_data_param(::ditcaffe::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:ditcaffe.V1LayerParameter.hdf5_data_param) +} + +// optional .ditcaffe.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_->::ditcaffe::HDF5OutputParameter::Clear(); + clear_has_hdf5_output_param(); +} +inline const ::ditcaffe::HDF5OutputParameter& V1LayerParameter::hdf5_output_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.hdf5_output_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return hdf5_output_param_ != NULL ? *hdf5_output_param_ : *default_instance().hdf5_output_param_; +#else + return hdf5_output_param_ != NULL ? *hdf5_output_param_ : *default_instance_->hdf5_output_param_; +#endif +} +inline ::ditcaffe::HDF5OutputParameter* V1LayerParameter::mutable_hdf5_output_param() { + set_has_hdf5_output_param(); + if (hdf5_output_param_ == NULL) hdf5_output_param_ = new ::ditcaffe::HDF5OutputParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.hdf5_output_param) + return hdf5_output_param_; +} +inline ::ditcaffe::HDF5OutputParameter* V1LayerParameter::release_hdf5_output_param() { + clear_has_hdf5_output_param(); + ::ditcaffe::HDF5OutputParameter* temp = hdf5_output_param_; + hdf5_output_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_hdf5_output_param(::ditcaffe::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:ditcaffe.V1LayerParameter.hdf5_output_param) +} + +// optional .ditcaffe.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_->::ditcaffe::HingeLossParameter::Clear(); + clear_has_hinge_loss_param(); +} +inline const ::ditcaffe::HingeLossParameter& V1LayerParameter::hinge_loss_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.hinge_loss_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return hinge_loss_param_ != NULL ? *hinge_loss_param_ : *default_instance().hinge_loss_param_; +#else + return hinge_loss_param_ != NULL ? *hinge_loss_param_ : *default_instance_->hinge_loss_param_; +#endif +} +inline ::ditcaffe::HingeLossParameter* V1LayerParameter::mutable_hinge_loss_param() { + set_has_hinge_loss_param(); + if (hinge_loss_param_ == NULL) hinge_loss_param_ = new ::ditcaffe::HingeLossParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.hinge_loss_param) + return hinge_loss_param_; +} +inline ::ditcaffe::HingeLossParameter* V1LayerParameter::release_hinge_loss_param() { + clear_has_hinge_loss_param(); + ::ditcaffe::HingeLossParameter* temp = hinge_loss_param_; + hinge_loss_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_hinge_loss_param(::ditcaffe::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:ditcaffe.V1LayerParameter.hinge_loss_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ImageDataParameter::Clear(); + clear_has_image_data_param(); +} +inline const ::ditcaffe::ImageDataParameter& V1LayerParameter::image_data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.image_data_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return image_data_param_ != NULL ? *image_data_param_ : *default_instance().image_data_param_; +#else + return image_data_param_ != NULL ? *image_data_param_ : *default_instance_->image_data_param_; +#endif +} +inline ::ditcaffe::ImageDataParameter* V1LayerParameter::mutable_image_data_param() { + set_has_image_data_param(); + if (image_data_param_ == NULL) image_data_param_ = new ::ditcaffe::ImageDataParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.image_data_param) + return image_data_param_; +} +inline ::ditcaffe::ImageDataParameter* V1LayerParameter::release_image_data_param() { + clear_has_image_data_param(); + ::ditcaffe::ImageDataParameter* temp = image_data_param_; + image_data_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_image_data_param(::ditcaffe::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:ditcaffe.V1LayerParameter.image_data_param) +} + +// optional .ditcaffe.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_->::ditcaffe::InfogainLossParameter::Clear(); + clear_has_infogain_loss_param(); +} +inline const ::ditcaffe::InfogainLossParameter& V1LayerParameter::infogain_loss_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.infogain_loss_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return infogain_loss_param_ != NULL ? *infogain_loss_param_ : *default_instance().infogain_loss_param_; +#else + return infogain_loss_param_ != NULL ? *infogain_loss_param_ : *default_instance_->infogain_loss_param_; +#endif +} +inline ::ditcaffe::InfogainLossParameter* V1LayerParameter::mutable_infogain_loss_param() { + set_has_infogain_loss_param(); + if (infogain_loss_param_ == NULL) infogain_loss_param_ = new ::ditcaffe::InfogainLossParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.infogain_loss_param) + return infogain_loss_param_; +} +inline ::ditcaffe::InfogainLossParameter* V1LayerParameter::release_infogain_loss_param() { + clear_has_infogain_loss_param(); + ::ditcaffe::InfogainLossParameter* temp = infogain_loss_param_; + infogain_loss_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_infogain_loss_param(::ditcaffe::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:ditcaffe.V1LayerParameter.infogain_loss_param) +} + +// optional .ditcaffe.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_->::ditcaffe::InnerProductParameter::Clear(); + clear_has_inner_product_param(); +} +inline const ::ditcaffe::InnerProductParameter& V1LayerParameter::inner_product_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.inner_product_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return inner_product_param_ != NULL ? *inner_product_param_ : *default_instance().inner_product_param_; +#else + return inner_product_param_ != NULL ? *inner_product_param_ : *default_instance_->inner_product_param_; +#endif +} +inline ::ditcaffe::InnerProductParameter* V1LayerParameter::mutable_inner_product_param() { + set_has_inner_product_param(); + if (inner_product_param_ == NULL) inner_product_param_ = new ::ditcaffe::InnerProductParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.inner_product_param) + return inner_product_param_; +} +inline ::ditcaffe::InnerProductParameter* V1LayerParameter::release_inner_product_param() { + clear_has_inner_product_param(); + ::ditcaffe::InnerProductParameter* temp = inner_product_param_; + inner_product_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_inner_product_param(::ditcaffe::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:ditcaffe.V1LayerParameter.inner_product_param) +} + +// optional .ditcaffe.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_->::ditcaffe::LRNParameter::Clear(); + clear_has_lrn_param(); +} +inline const ::ditcaffe::LRNParameter& V1LayerParameter::lrn_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.lrn_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return lrn_param_ != NULL ? *lrn_param_ : *default_instance().lrn_param_; +#else + return lrn_param_ != NULL ? *lrn_param_ : *default_instance_->lrn_param_; +#endif +} +inline ::ditcaffe::LRNParameter* V1LayerParameter::mutable_lrn_param() { + set_has_lrn_param(); + if (lrn_param_ == NULL) lrn_param_ = new ::ditcaffe::LRNParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.lrn_param) + return lrn_param_; +} +inline ::ditcaffe::LRNParameter* V1LayerParameter::release_lrn_param() { + clear_has_lrn_param(); + ::ditcaffe::LRNParameter* temp = lrn_param_; + lrn_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_lrn_param(::ditcaffe::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:ditcaffe.V1LayerParameter.lrn_param) +} + +// optional .ditcaffe.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_->::ditcaffe::MemoryDataParameter::Clear(); + clear_has_memory_data_param(); +} +inline const ::ditcaffe::MemoryDataParameter& V1LayerParameter::memory_data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.memory_data_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return memory_data_param_ != NULL ? *memory_data_param_ : *default_instance().memory_data_param_; +#else + return memory_data_param_ != NULL ? *memory_data_param_ : *default_instance_->memory_data_param_; +#endif +} +inline ::ditcaffe::MemoryDataParameter* V1LayerParameter::mutable_memory_data_param() { + set_has_memory_data_param(); + if (memory_data_param_ == NULL) memory_data_param_ = new ::ditcaffe::MemoryDataParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.memory_data_param) + return memory_data_param_; +} +inline ::ditcaffe::MemoryDataParameter* V1LayerParameter::release_memory_data_param() { + clear_has_memory_data_param(); + ::ditcaffe::MemoryDataParameter* temp = memory_data_param_; + memory_data_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_memory_data_param(::ditcaffe::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:ditcaffe.V1LayerParameter.memory_data_param) +} + +// optional .ditcaffe.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_->::ditcaffe::MVNParameter::Clear(); + clear_has_mvn_param(); +} +inline const ::ditcaffe::MVNParameter& V1LayerParameter::mvn_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.mvn_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return mvn_param_ != NULL ? *mvn_param_ : *default_instance().mvn_param_; +#else + return mvn_param_ != NULL ? *mvn_param_ : *default_instance_->mvn_param_; +#endif +} +inline ::ditcaffe::MVNParameter* V1LayerParameter::mutable_mvn_param() { + set_has_mvn_param(); + if (mvn_param_ == NULL) mvn_param_ = new ::ditcaffe::MVNParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.mvn_param) + return mvn_param_; +} +inline ::ditcaffe::MVNParameter* V1LayerParameter::release_mvn_param() { + clear_has_mvn_param(); + ::ditcaffe::MVNParameter* temp = mvn_param_; + mvn_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_mvn_param(::ditcaffe::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:ditcaffe.V1LayerParameter.mvn_param) +} + +// optional .ditcaffe.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_->::ditcaffe::PoolingParameter::Clear(); + clear_has_pooling_param(); +} +inline const ::ditcaffe::PoolingParameter& V1LayerParameter::pooling_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.pooling_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return pooling_param_ != NULL ? *pooling_param_ : *default_instance().pooling_param_; +#else + return pooling_param_ != NULL ? *pooling_param_ : *default_instance_->pooling_param_; +#endif +} +inline ::ditcaffe::PoolingParameter* V1LayerParameter::mutable_pooling_param() { + set_has_pooling_param(); + if (pooling_param_ == NULL) pooling_param_ = new ::ditcaffe::PoolingParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.pooling_param) + return pooling_param_; +} +inline ::ditcaffe::PoolingParameter* V1LayerParameter::release_pooling_param() { + clear_has_pooling_param(); + ::ditcaffe::PoolingParameter* temp = pooling_param_; + pooling_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_pooling_param(::ditcaffe::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:ditcaffe.V1LayerParameter.pooling_param) +} + +// optional .ditcaffe.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_->::ditcaffe::PowerParameter::Clear(); + clear_has_power_param(); +} +inline const ::ditcaffe::PowerParameter& V1LayerParameter::power_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.power_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return power_param_ != NULL ? *power_param_ : *default_instance().power_param_; +#else + return power_param_ != NULL ? *power_param_ : *default_instance_->power_param_; +#endif +} +inline ::ditcaffe::PowerParameter* V1LayerParameter::mutable_power_param() { + set_has_power_param(); + if (power_param_ == NULL) power_param_ = new ::ditcaffe::PowerParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.power_param) + return power_param_; +} +inline ::ditcaffe::PowerParameter* V1LayerParameter::release_power_param() { + clear_has_power_param(); + ::ditcaffe::PowerParameter* temp = power_param_; + power_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_power_param(::ditcaffe::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:ditcaffe.V1LayerParameter.power_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ReLUParameter::Clear(); + clear_has_relu_param(); +} +inline const ::ditcaffe::ReLUParameter& V1LayerParameter::relu_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.relu_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return relu_param_ != NULL ? *relu_param_ : *default_instance().relu_param_; +#else + return relu_param_ != NULL ? *relu_param_ : *default_instance_->relu_param_; +#endif +} +inline ::ditcaffe::ReLUParameter* V1LayerParameter::mutable_relu_param() { + set_has_relu_param(); + if (relu_param_ == NULL) relu_param_ = new ::ditcaffe::ReLUParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.relu_param) + return relu_param_; +} +inline ::ditcaffe::ReLUParameter* V1LayerParameter::release_relu_param() { + clear_has_relu_param(); + ::ditcaffe::ReLUParameter* temp = relu_param_; + relu_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_relu_param(::ditcaffe::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:ditcaffe.V1LayerParameter.relu_param) +} + +// optional .ditcaffe.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_->::ditcaffe::SigmoidParameter::Clear(); + clear_has_sigmoid_param(); +} +inline const ::ditcaffe::SigmoidParameter& V1LayerParameter::sigmoid_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.sigmoid_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return sigmoid_param_ != NULL ? *sigmoid_param_ : *default_instance().sigmoid_param_; +#else + return sigmoid_param_ != NULL ? *sigmoid_param_ : *default_instance_->sigmoid_param_; +#endif +} +inline ::ditcaffe::SigmoidParameter* V1LayerParameter::mutable_sigmoid_param() { + set_has_sigmoid_param(); + if (sigmoid_param_ == NULL) sigmoid_param_ = new ::ditcaffe::SigmoidParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.sigmoid_param) + return sigmoid_param_; +} +inline ::ditcaffe::SigmoidParameter* V1LayerParameter::release_sigmoid_param() { + clear_has_sigmoid_param(); + ::ditcaffe::SigmoidParameter* temp = sigmoid_param_; + sigmoid_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_sigmoid_param(::ditcaffe::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:ditcaffe.V1LayerParameter.sigmoid_param) +} + +// optional .ditcaffe.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_->::ditcaffe::SoftmaxParameter::Clear(); + clear_has_softmax_param(); +} +inline const ::ditcaffe::SoftmaxParameter& V1LayerParameter::softmax_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.softmax_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return softmax_param_ != NULL ? *softmax_param_ : *default_instance().softmax_param_; +#else + return softmax_param_ != NULL ? *softmax_param_ : *default_instance_->softmax_param_; +#endif +} +inline ::ditcaffe::SoftmaxParameter* V1LayerParameter::mutable_softmax_param() { + set_has_softmax_param(); + if (softmax_param_ == NULL) softmax_param_ = new ::ditcaffe::SoftmaxParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.softmax_param) + return softmax_param_; +} +inline ::ditcaffe::SoftmaxParameter* V1LayerParameter::release_softmax_param() { + clear_has_softmax_param(); + ::ditcaffe::SoftmaxParameter* temp = softmax_param_; + softmax_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_softmax_param(::ditcaffe::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:ditcaffe.V1LayerParameter.softmax_param) +} + +// optional .ditcaffe.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_->::ditcaffe::SliceParameter::Clear(); + clear_has_slice_param(); +} +inline const ::ditcaffe::SliceParameter& V1LayerParameter::slice_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.slice_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return slice_param_ != NULL ? *slice_param_ : *default_instance().slice_param_; +#else + return slice_param_ != NULL ? *slice_param_ : *default_instance_->slice_param_; +#endif +} +inline ::ditcaffe::SliceParameter* V1LayerParameter::mutable_slice_param() { + set_has_slice_param(); + if (slice_param_ == NULL) slice_param_ = new ::ditcaffe::SliceParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.slice_param) + return slice_param_; +} +inline ::ditcaffe::SliceParameter* V1LayerParameter::release_slice_param() { + clear_has_slice_param(); + ::ditcaffe::SliceParameter* temp = slice_param_; + slice_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_slice_param(::ditcaffe::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:ditcaffe.V1LayerParameter.slice_param) +} + +// optional .ditcaffe.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_->::ditcaffe::TanHParameter::Clear(); + clear_has_tanh_param(); +} +inline const ::ditcaffe::TanHParameter& V1LayerParameter::tanh_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.tanh_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return tanh_param_ != NULL ? *tanh_param_ : *default_instance().tanh_param_; +#else + return tanh_param_ != NULL ? *tanh_param_ : *default_instance_->tanh_param_; +#endif +} +inline ::ditcaffe::TanHParameter* V1LayerParameter::mutable_tanh_param() { + set_has_tanh_param(); + if (tanh_param_ == NULL) tanh_param_ = new ::ditcaffe::TanHParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.tanh_param) + return tanh_param_; +} +inline ::ditcaffe::TanHParameter* V1LayerParameter::release_tanh_param() { + clear_has_tanh_param(); + ::ditcaffe::TanHParameter* temp = tanh_param_; + tanh_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_tanh_param(::ditcaffe::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:ditcaffe.V1LayerParameter.tanh_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ThresholdParameter::Clear(); + clear_has_threshold_param(); +} +inline const ::ditcaffe::ThresholdParameter& V1LayerParameter::threshold_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.threshold_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return threshold_param_ != NULL ? *threshold_param_ : *default_instance().threshold_param_; +#else + return threshold_param_ != NULL ? *threshold_param_ : *default_instance_->threshold_param_; +#endif +} +inline ::ditcaffe::ThresholdParameter* V1LayerParameter::mutable_threshold_param() { + set_has_threshold_param(); + if (threshold_param_ == NULL) threshold_param_ = new ::ditcaffe::ThresholdParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.threshold_param) + return threshold_param_; +} +inline ::ditcaffe::ThresholdParameter* V1LayerParameter::release_threshold_param() { + clear_has_threshold_param(); + ::ditcaffe::ThresholdParameter* temp = threshold_param_; + threshold_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_threshold_param(::ditcaffe::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:ditcaffe.V1LayerParameter.threshold_param) +} + +// optional .ditcaffe.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_->::ditcaffe::WindowDataParameter::Clear(); + clear_has_window_data_param(); +} +inline const ::ditcaffe::WindowDataParameter& V1LayerParameter::window_data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.window_data_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return window_data_param_ != NULL ? *window_data_param_ : *default_instance().window_data_param_; +#else + return window_data_param_ != NULL ? *window_data_param_ : *default_instance_->window_data_param_; +#endif +} +inline ::ditcaffe::WindowDataParameter* V1LayerParameter::mutable_window_data_param() { + set_has_window_data_param(); + if (window_data_param_ == NULL) window_data_param_ = new ::ditcaffe::WindowDataParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.window_data_param) + return window_data_param_; +} +inline ::ditcaffe::WindowDataParameter* V1LayerParameter::release_window_data_param() { + clear_has_window_data_param(); + ::ditcaffe::WindowDataParameter* temp = window_data_param_; + window_data_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_window_data_param(::ditcaffe::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:ditcaffe.V1LayerParameter.window_data_param) +} + +// optional .ditcaffe.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_->::ditcaffe::TransformationParameter::Clear(); + clear_has_transform_param(); +} +inline const ::ditcaffe::TransformationParameter& V1LayerParameter::transform_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.transform_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return transform_param_ != NULL ? *transform_param_ : *default_instance().transform_param_; +#else + return transform_param_ != NULL ? *transform_param_ : *default_instance_->transform_param_; +#endif +} +inline ::ditcaffe::TransformationParameter* V1LayerParameter::mutable_transform_param() { + set_has_transform_param(); + if (transform_param_ == NULL) transform_param_ = new ::ditcaffe::TransformationParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.transform_param) + return transform_param_; +} +inline ::ditcaffe::TransformationParameter* V1LayerParameter::release_transform_param() { + clear_has_transform_param(); + ::ditcaffe::TransformationParameter* temp = transform_param_; + transform_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_transform_param(::ditcaffe::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:ditcaffe.V1LayerParameter.transform_param) +} + +// optional .ditcaffe.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_->::ditcaffe::LossParameter::Clear(); + clear_has_loss_param(); +} +inline const ::ditcaffe::LossParameter& V1LayerParameter::loss_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.loss_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return loss_param_ != NULL ? *loss_param_ : *default_instance().loss_param_; +#else + return loss_param_ != NULL ? *loss_param_ : *default_instance_->loss_param_; +#endif +} +inline ::ditcaffe::LossParameter* V1LayerParameter::mutable_loss_param() { + set_has_loss_param(); + if (loss_param_ == NULL) loss_param_ = new ::ditcaffe::LossParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.loss_param) + return loss_param_; +} +inline ::ditcaffe::LossParameter* V1LayerParameter::release_loss_param() { + clear_has_loss_param(); + ::ditcaffe::LossParameter* temp = loss_param_; + loss_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_loss_param(::ditcaffe::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:ditcaffe.V1LayerParameter.loss_param) +} + +// optional .ditcaffe.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_->::ditcaffe::V0LayerParameter::Clear(); + clear_has_layer(); +} +inline const ::ditcaffe::V0LayerParameter& V1LayerParameter::layer() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.layer) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return layer_ != NULL ? *layer_ : *default_instance().layer_; +#else + return layer_ != NULL ? *layer_ : *default_instance_->layer_; +#endif +} +inline ::ditcaffe::V0LayerParameter* V1LayerParameter::mutable_layer() { + set_has_layer(); + if (layer_ == NULL) layer_ = new ::ditcaffe::V0LayerParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.layer) + return layer_; +} +inline ::ditcaffe::V0LayerParameter* V1LayerParameter::release_layer() { + clear_has_layer(); + ::ditcaffe::V0LayerParameter* temp = layer_; + layer_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_layer(::ditcaffe::V0LayerParameter* layer) { + delete layer_; + layer_ = layer; + if (layer) { + set_has_layer(); + } else { + clear_has_layer(); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.V1LayerParameter.layer) +} + +// ------------------------------------------------------------------- + +// 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() { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_->clear(); + } + clear_has_name(); +} +inline const ::std::string& V0LayerParameter::name() const { + // @@protoc_insertion_point(field_get:ditcaffe.V0LayerParameter.name) + return *name_; +} +inline void V0LayerParameter::set_name(const ::std::string& value) { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + name_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.V0LayerParameter.name) +} +inline void V0LayerParameter::set_name(const char* value) { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + name_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.V0LayerParameter.name) +} +inline void V0LayerParameter::set_name(const char* value, size_t size) { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + name_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.V0LayerParameter.name) +} +inline ::std::string* V0LayerParameter::mutable_name() { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V0LayerParameter.name) + return name_; +} +inline ::std::string* V0LayerParameter::release_name() { + clear_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = name_; + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void V0LayerParameter::set_allocated_name(::std::string* name) { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete name_; + } + if (name) { + set_has_name(); + name_ = name; + } else { + clear_has_name(); + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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() { + if (type_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + type_->clear(); + } + clear_has_type(); +} +inline const ::std::string& V0LayerParameter::type() const { + // @@protoc_insertion_point(field_get:ditcaffe.V0LayerParameter.type) + return *type_; +} +inline void V0LayerParameter::set_type(const ::std::string& value) { + set_has_type(); + if (type_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + type_ = new ::std::string; + } + type_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.V0LayerParameter.type) +} +inline void V0LayerParameter::set_type(const char* value) { + set_has_type(); + if (type_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + type_ = new ::std::string; + } + type_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.V0LayerParameter.type) +} +inline void V0LayerParameter::set_type(const char* value, size_t size) { + set_has_type(); + if (type_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + type_ = new ::std::string; + } + type_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.V0LayerParameter.type) +} +inline ::std::string* V0LayerParameter::mutable_type() { + set_has_type(); + if (type_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + type_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V0LayerParameter.type) + return type_; +} +inline ::std::string* V0LayerParameter::release_type() { + clear_has_type(); + if (type_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = type_; + type_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void V0LayerParameter::set_allocated_type(::std::string* type) { + if (type_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete type_; + } + if (type) { + set_has_type(); + type_ = type; + } else { + clear_has_type(); + type_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.V0LayerParameter.biasterm) + return biasterm_; +} +inline void V0LayerParameter::set_biasterm(bool value) { + set_has_biasterm(); + biasterm_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.V0LayerParameter.biasterm) +} + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_weight_filler(); +} +inline const ::ditcaffe::FillerParameter& V0LayerParameter::weight_filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.V0LayerParameter.weight_filler) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return weight_filler_ != NULL ? *weight_filler_ : *default_instance().weight_filler_; +#else + return weight_filler_ != NULL ? *weight_filler_ : *default_instance_->weight_filler_; +#endif +} +inline ::ditcaffe::FillerParameter* V0LayerParameter::mutable_weight_filler() { + set_has_weight_filler(); + if (weight_filler_ == NULL) weight_filler_ = new ::ditcaffe::FillerParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V0LayerParameter.weight_filler) + return weight_filler_; +} +inline ::ditcaffe::FillerParameter* V0LayerParameter::release_weight_filler() { + clear_has_weight_filler(); + ::ditcaffe::FillerParameter* temp = weight_filler_; + weight_filler_ = NULL; + return temp; +} +inline void V0LayerParameter::set_allocated_weight_filler(::ditcaffe::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:ditcaffe.V0LayerParameter.weight_filler) +} + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_bias_filler(); +} +inline const ::ditcaffe::FillerParameter& V0LayerParameter::bias_filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.V0LayerParameter.bias_filler) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return bias_filler_ != NULL ? *bias_filler_ : *default_instance().bias_filler_; +#else + return bias_filler_ != NULL ? *bias_filler_ : *default_instance_->bias_filler_; +#endif +} +inline ::ditcaffe::FillerParameter* V0LayerParameter::mutable_bias_filler() { + set_has_bias_filler(); + if (bias_filler_ == NULL) bias_filler_ = new ::ditcaffe::FillerParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V0LayerParameter.bias_filler) + return bias_filler_; +} +inline ::ditcaffe::FillerParameter* V0LayerParameter::release_bias_filler() { + clear_has_bias_filler(); + ::ditcaffe::FillerParameter* temp = bias_filler_; + bias_filler_ = NULL; + return temp; +} +inline void V0LayerParameter::set_allocated_bias_filler(::ditcaffe::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:ditcaffe.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:ditcaffe.V0LayerParameter.pad) + return pad_; +} +inline void V0LayerParameter::set_pad(::google::protobuf::uint32 value) { + set_has_pad(); + pad_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.V0LayerParameter.kernelsize) + return kernelsize_; +} +inline void V0LayerParameter::set_kernelsize(::google::protobuf::uint32 value) { + set_has_kernelsize(); + kernelsize_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.V0LayerParameter.group) + return group_; +} +inline void V0LayerParameter::set_group(::google::protobuf::uint32 value) { + set_has_group(); + group_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.V0LayerParameter.stride) + return stride_; +} +inline void V0LayerParameter::set_stride(::google::protobuf::uint32 value) { + set_has_stride(); + stride_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.V0LayerParameter.stride) +} + +// optional .ditcaffe.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 ::ditcaffe::V0LayerParameter_PoolMethod V0LayerParameter::pool() const { + // @@protoc_insertion_point(field_get:ditcaffe.V0LayerParameter.pool) + return static_cast< ::ditcaffe::V0LayerParameter_PoolMethod >(pool_); +} +inline void V0LayerParameter::set_pool(::ditcaffe::V0LayerParameter_PoolMethod value) { + assert(::ditcaffe::V0LayerParameter_PoolMethod_IsValid(value)); + set_has_pool(); + pool_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.V0LayerParameter.alpha) + return alpha_; +} +inline void V0LayerParameter::set_alpha(float value) { + set_has_alpha(); + alpha_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.V0LayerParameter.beta) + return beta_; +} +inline void V0LayerParameter::set_beta(float value) { + set_has_beta(); + beta_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.V0LayerParameter.k) + return k_; +} +inline void V0LayerParameter::set_k(float value) { + set_has_k(); + k_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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() { + if (source_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_->clear(); + } + clear_has_source(); +} +inline const ::std::string& V0LayerParameter::source() const { + // @@protoc_insertion_point(field_get:ditcaffe.V0LayerParameter.source) + return *source_; +} +inline void V0LayerParameter::set_source(const ::std::string& value) { + set_has_source(); + if (source_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_ = new ::std::string; + } + source_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.V0LayerParameter.source) +} +inline void V0LayerParameter::set_source(const char* value) { + set_has_source(); + if (source_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_ = new ::std::string; + } + source_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.V0LayerParameter.source) +} +inline void V0LayerParameter::set_source(const char* value, size_t size) { + set_has_source(); + if (source_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_ = new ::std::string; + } + source_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.V0LayerParameter.source) +} +inline ::std::string* V0LayerParameter::mutable_source() { + set_has_source(); + if (source_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + source_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V0LayerParameter.source) + return source_; +} +inline ::std::string* V0LayerParameter::release_source() { + clear_has_source(); + if (source_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = source_; + source_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void V0LayerParameter::set_allocated_source(::std::string* source) { + if (source_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete source_; + } + if (source) { + set_has_source(); + source_ = source; + } else { + clear_has_source(); + source_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.V0LayerParameter.scale) + return scale_; +} +inline void V0LayerParameter::set_scale(float value) { + set_has_scale(); + scale_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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() { + if (meanfile_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + meanfile_->clear(); + } + clear_has_meanfile(); +} +inline const ::std::string& V0LayerParameter::meanfile() const { + // @@protoc_insertion_point(field_get:ditcaffe.V0LayerParameter.meanfile) + return *meanfile_; +} +inline void V0LayerParameter::set_meanfile(const ::std::string& value) { + set_has_meanfile(); + if (meanfile_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + meanfile_ = new ::std::string; + } + meanfile_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.V0LayerParameter.meanfile) +} +inline void V0LayerParameter::set_meanfile(const char* value) { + set_has_meanfile(); + if (meanfile_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + meanfile_ = new ::std::string; + } + meanfile_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.V0LayerParameter.meanfile) +} +inline void V0LayerParameter::set_meanfile(const char* value, size_t size) { + set_has_meanfile(); + if (meanfile_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + meanfile_ = new ::std::string; + } + meanfile_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.V0LayerParameter.meanfile) +} +inline ::std::string* V0LayerParameter::mutable_meanfile() { + set_has_meanfile(); + if (meanfile_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + meanfile_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V0LayerParameter.meanfile) + return meanfile_; +} +inline ::std::string* V0LayerParameter::release_meanfile() { + clear_has_meanfile(); + if (meanfile_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = meanfile_; + meanfile_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void V0LayerParameter::set_allocated_meanfile(::std::string* meanfile) { + if (meanfile_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete meanfile_; + } + if (meanfile) { + set_has_meanfile(); + meanfile_ = meanfile; + } else { + clear_has_meanfile(); + meanfile_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.V0LayerParameter.batchsize) + return batchsize_; +} +inline void V0LayerParameter::set_batchsize(::google::protobuf::uint32 value) { + set_has_batchsize(); + batchsize_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.V0LayerParameter.cropsize) + return cropsize_; +} +inline void V0LayerParameter::set_cropsize(::google::protobuf::uint32 value) { + set_has_cropsize(); + cropsize_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.V0LayerParameter.mirror) + return mirror_; +} +inline void V0LayerParameter::set_mirror(bool value) { + set_has_mirror(); + mirror_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.V0LayerParameter.mirror) +} + +// repeated .ditcaffe.BlobProto blobs = 50; +inline int V0LayerParameter::blobs_size() const { + return blobs_.size(); +} +inline void V0LayerParameter::clear_blobs() { + blobs_.Clear(); +} +inline const ::ditcaffe::BlobProto& V0LayerParameter::blobs(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.V0LayerParameter.blobs) + return blobs_.Get(index); +} +inline ::ditcaffe::BlobProto* V0LayerParameter::mutable_blobs(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.V0LayerParameter.blobs) + return blobs_.Mutable(index); +} +inline ::ditcaffe::BlobProto* V0LayerParameter::add_blobs() { + // @@protoc_insertion_point(field_add:ditcaffe.V0LayerParameter.blobs) + return blobs_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >& +V0LayerParameter::blobs() const { + // @@protoc_insertion_point(field_list:ditcaffe.V0LayerParameter.blobs) + return blobs_; +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >* +V0LayerParameter::mutable_blobs() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.V0LayerParameter.blobs_lr) +} +inline void V0LayerParameter::add_blobs_lr(float value) { + blobs_lr_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.V0LayerParameter.blobs_lr) +} +inline const ::google::protobuf::RepeatedField< float >& +V0LayerParameter::blobs_lr() const { + // @@protoc_insertion_point(field_list:ditcaffe.V0LayerParameter.blobs_lr) + return blobs_lr_; +} +inline ::google::protobuf::RepeatedField< float >* +V0LayerParameter::mutable_blobs_lr() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.V0LayerParameter.weight_decay) +} +inline void V0LayerParameter::add_weight_decay(float value) { + weight_decay_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.V0LayerParameter.weight_decay) +} +inline const ::google::protobuf::RepeatedField< float >& +V0LayerParameter::weight_decay() const { + // @@protoc_insertion_point(field_list:ditcaffe.V0LayerParameter.weight_decay) + return weight_decay_; +} +inline ::google::protobuf::RepeatedField< float >* +V0LayerParameter::mutable_weight_decay() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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() { + if (det_crop_mode_ != _default_det_crop_mode_) { + det_crop_mode_->assign(*_default_det_crop_mode_); + } + clear_has_det_crop_mode(); +} +inline const ::std::string& V0LayerParameter::det_crop_mode() const { + // @@protoc_insertion_point(field_get:ditcaffe.V0LayerParameter.det_crop_mode) + return *det_crop_mode_; +} +inline void V0LayerParameter::set_det_crop_mode(const ::std::string& value) { + set_has_det_crop_mode(); + if (det_crop_mode_ == _default_det_crop_mode_) { + det_crop_mode_ = new ::std::string; + } + det_crop_mode_->assign(value); + // @@protoc_insertion_point(field_set:ditcaffe.V0LayerParameter.det_crop_mode) +} +inline void V0LayerParameter::set_det_crop_mode(const char* value) { + set_has_det_crop_mode(); + if (det_crop_mode_ == _default_det_crop_mode_) { + det_crop_mode_ = new ::std::string; + } + det_crop_mode_->assign(value); + // @@protoc_insertion_point(field_set_char:ditcaffe.V0LayerParameter.det_crop_mode) +} +inline void V0LayerParameter::set_det_crop_mode(const char* value, size_t size) { + set_has_det_crop_mode(); + if (det_crop_mode_ == _default_det_crop_mode_) { + det_crop_mode_ = new ::std::string; + } + det_crop_mode_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:ditcaffe.V0LayerParameter.det_crop_mode) +} +inline ::std::string* V0LayerParameter::mutable_det_crop_mode() { + set_has_det_crop_mode(); + if (det_crop_mode_ == _default_det_crop_mode_) { + det_crop_mode_ = new ::std::string(*_default_det_crop_mode_); + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V0LayerParameter.det_crop_mode) + return det_crop_mode_; +} +inline ::std::string* V0LayerParameter::release_det_crop_mode() { + clear_has_det_crop_mode(); + if (det_crop_mode_ == _default_det_crop_mode_) { + return NULL; + } else { + ::std::string* temp = det_crop_mode_; + det_crop_mode_ = const_cast< ::std::string*>(_default_det_crop_mode_); + return temp; + } +} +inline void V0LayerParameter::set_allocated_det_crop_mode(::std::string* det_crop_mode) { + if (det_crop_mode_ != _default_det_crop_mode_) { + delete det_crop_mode_; + } + if (det_crop_mode) { + set_has_det_crop_mode(); + det_crop_mode_ = det_crop_mode; + } else { + clear_has_det_crop_mode(); + det_crop_mode_ = const_cast< ::std::string*>(_default_det_crop_mode_); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.V0LayerParameter.concat_dim) +} + +// optional .ditcaffe.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_->::ditcaffe::HDF5OutputParameter::Clear(); + clear_has_hdf5_output_param(); +} +inline const ::ditcaffe::HDF5OutputParameter& V0LayerParameter::hdf5_output_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V0LayerParameter.hdf5_output_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return hdf5_output_param_ != NULL ? *hdf5_output_param_ : *default_instance().hdf5_output_param_; +#else + return hdf5_output_param_ != NULL ? *hdf5_output_param_ : *default_instance_->hdf5_output_param_; +#endif +} +inline ::ditcaffe::HDF5OutputParameter* V0LayerParameter::mutable_hdf5_output_param() { + set_has_hdf5_output_param(); + if (hdf5_output_param_ == NULL) hdf5_output_param_ = new ::ditcaffe::HDF5OutputParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.V0LayerParameter.hdf5_output_param) + return hdf5_output_param_; +} +inline ::ditcaffe::HDF5OutputParameter* V0LayerParameter::release_hdf5_output_param() { + clear_has_hdf5_output_param(); + ::ditcaffe::HDF5OutputParameter* temp = hdf5_output_param_; + hdf5_output_param_ = NULL; + return temp; +} +inline void V0LayerParameter::set_allocated_hdf5_output_param(::ditcaffe::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:ditcaffe.V0LayerParameter.hdf5_output_param) +} + +// ------------------------------------------------------------------- + +// PReLUParameter + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_filler(); +} +inline const ::ditcaffe::FillerParameter& PReLUParameter::filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.PReLUParameter.filler) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return filler_ != NULL ? *filler_ : *default_instance().filler_; +#else + return filler_ != NULL ? *filler_ : *default_instance_->filler_; +#endif +} +inline ::ditcaffe::FillerParameter* PReLUParameter::mutable_filler() { + set_has_filler(); + if (filler_ == NULL) filler_ = new ::ditcaffe::FillerParameter; + // @@protoc_insertion_point(field_mutable:ditcaffe.PReLUParameter.filler) + return filler_; +} +inline ::ditcaffe::FillerParameter* PReLUParameter::release_filler() { + clear_has_filler(); + ::ditcaffe::FillerParameter* temp = filler_; + filler_ = NULL; + return temp; +} +inline void PReLUParameter::set_allocated_filler(::ditcaffe::FillerParameter* filler) { + delete filler_; + filler_ = filler; + if (filler) { + set_has_filler(); + } else { + clear_has_filler(); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.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:ditcaffe.PReLUParameter.channel_shared) +} + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace ditcaffe + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_ditcaffe_2eopt_2dfor_2dlite_2eproto__INCLUDED diff --git a/umd/core/src/compiler/caffe/ditcaffe/protobuf-lite-3.0.0/ditcaffe.opt-for-lite.pb.cpp b/umd/core/src/compiler/caffe/ditcaffe/protobuf-lite-3.0.0/ditcaffe.opt-for-lite.pb.cpp new file mode 100644 index 00000000..bfd1372b --- /dev/null +++ b/umd/core/src/compiler/caffe/ditcaffe/protobuf-lite-3.0.0/ditcaffe.opt-for-lite.pb.cpp @@ -0,0 +1,41384 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: ditcaffe.opt-for-lite.proto + +#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION +#include "ditcaffe.opt-for-lite.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +// @@protoc_insertion_point(includes) + +namespace ditcaffe { + +void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto() { + delete BlobShape::default_instance_; + delete BlobProto::default_instance_; + delete BlobProtoVector::default_instance_; + delete Datum::default_instance_; + delete FillerParameter::default_instance_; + delete FillerParameter::_default_type_; + delete NetParameter::default_instance_; + delete SolverParameter::default_instance_; + delete SolverParameter::_default_regularization_type_; + delete SolverParameter::_default_type_; + delete SolverState::default_instance_; + delete NetState::default_instance_; + delete NetStateRule::default_instance_; + delete ParamSpec::default_instance_; + delete LayerParameter::default_instance_; + delete TransformationParameter::default_instance_; + delete LossParameter::default_instance_; + delete AccuracyParameter::default_instance_; + delete ArgMaxParameter::default_instance_; + delete ConcatParameter::default_instance_; + delete BatchNormParameter::default_instance_; + delete BiasParameter::default_instance_; + delete ContrastiveLossParameter::default_instance_; + delete ConvolutionParameter::default_instance_; + delete CropParameter::default_instance_; + delete DataParameter::default_instance_; + delete DropoutParameter::default_instance_; + delete DummyDataParameter::default_instance_; + delete EltwiseParameter::default_instance_; + delete ELUParameter::default_instance_; + delete EmbedParameter::default_instance_; + delete ExpParameter::default_instance_; + delete FlattenParameter::default_instance_; + delete HDF5DataParameter::default_instance_; + delete HDF5OutputParameter::default_instance_; + delete HingeLossParameter::default_instance_; + delete ImageDataParameter::default_instance_; + delete InfogainLossParameter::default_instance_; + delete InnerProductParameter::default_instance_; + delete InputParameter::default_instance_; + delete LogParameter::default_instance_; + delete LRNParameter::default_instance_; + delete MemoryDataParameter::default_instance_; + delete MVNParameter::default_instance_; + delete ParameterParameter::default_instance_; + delete PoolingParameter::default_instance_; + delete PowerParameter::default_instance_; + delete PythonParameter::default_instance_; + delete ReductionParameter::default_instance_; + delete ReLUParameter::default_instance_; + delete ReshapeParameter::default_instance_; + delete ScaleParameter::default_instance_; + delete SigmoidParameter::default_instance_; + delete SliceParameter::default_instance_; + delete SoftmaxParameter::default_instance_; + delete TanHParameter::default_instance_; + delete TileParameter::default_instance_; + delete ThresholdParameter::default_instance_; + delete WindowDataParameter::default_instance_; + delete WindowDataParameter::_default_crop_mode_; + delete SPPParameter::default_instance_; + delete V1LayerParameter::default_instance_; + delete V0LayerParameter::default_instance_; + delete V0LayerParameter::_default_det_crop_mode_; + delete PReLUParameter::default_instance_; +} + +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER +void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + +#else +void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto() { + static bool already_here = false; + if (already_here) return; + already_here = true; + GOOGLE_PROTOBUF_VERIFY_VERSION; + +#endif + BlobShape::default_instance_ = new BlobShape(); + BlobProto::default_instance_ = new BlobProto(); + BlobProtoVector::default_instance_ = new BlobProtoVector(); + Datum::default_instance_ = new Datum(); + FillerParameter::_default_type_ = + new ::std::string("constant", 8); + FillerParameter::default_instance_ = new FillerParameter(); + NetParameter::default_instance_ = new NetParameter(); + SolverParameter::_default_regularization_type_ = + new ::std::string("L2", 2); + SolverParameter::_default_type_ = + new ::std::string("SGD", 3); + SolverParameter::default_instance_ = new SolverParameter(); + SolverState::default_instance_ = new SolverState(); + NetState::default_instance_ = new NetState(); + NetStateRule::default_instance_ = new NetStateRule(); + ParamSpec::default_instance_ = new ParamSpec(); + LayerParameter::default_instance_ = new LayerParameter(); + TransformationParameter::default_instance_ = new TransformationParameter(); + LossParameter::default_instance_ = new LossParameter(); + AccuracyParameter::default_instance_ = new AccuracyParameter(); + ArgMaxParameter::default_instance_ = new ArgMaxParameter(); + ConcatParameter::default_instance_ = new ConcatParameter(); + BatchNormParameter::default_instance_ = new BatchNormParameter(); + BiasParameter::default_instance_ = new BiasParameter(); + ContrastiveLossParameter::default_instance_ = new ContrastiveLossParameter(); + ConvolutionParameter::default_instance_ = new ConvolutionParameter(); + CropParameter::default_instance_ = new CropParameter(); + DataParameter::default_instance_ = new DataParameter(); + DropoutParameter::default_instance_ = new DropoutParameter(); + DummyDataParameter::default_instance_ = new DummyDataParameter(); + EltwiseParameter::default_instance_ = new EltwiseParameter(); + ELUParameter::default_instance_ = new ELUParameter(); + EmbedParameter::default_instance_ = new EmbedParameter(); + ExpParameter::default_instance_ = new ExpParameter(); + FlattenParameter::default_instance_ = new FlattenParameter(); + HDF5DataParameter::default_instance_ = new HDF5DataParameter(); + HDF5OutputParameter::default_instance_ = new HDF5OutputParameter(); + HingeLossParameter::default_instance_ = new HingeLossParameter(); + ImageDataParameter::default_instance_ = new ImageDataParameter(); + InfogainLossParameter::default_instance_ = new InfogainLossParameter(); + InnerProductParameter::default_instance_ = new InnerProductParameter(); + InputParameter::default_instance_ = new InputParameter(); + LogParameter::default_instance_ = new LogParameter(); + LRNParameter::default_instance_ = new LRNParameter(); + MemoryDataParameter::default_instance_ = new MemoryDataParameter(); + MVNParameter::default_instance_ = new MVNParameter(); + ParameterParameter::default_instance_ = new ParameterParameter(); + PoolingParameter::default_instance_ = new PoolingParameter(); + PowerParameter::default_instance_ = new PowerParameter(); + PythonParameter::default_instance_ = new PythonParameter(); + ReductionParameter::default_instance_ = new ReductionParameter(); + ReLUParameter::default_instance_ = new ReLUParameter(); + ReshapeParameter::default_instance_ = new ReshapeParameter(); + ScaleParameter::default_instance_ = new ScaleParameter(); + SigmoidParameter::default_instance_ = new SigmoidParameter(); + SliceParameter::default_instance_ = new SliceParameter(); + SoftmaxParameter::default_instance_ = new SoftmaxParameter(); + TanHParameter::default_instance_ = new TanHParameter(); + TileParameter::default_instance_ = new TileParameter(); + ThresholdParameter::default_instance_ = new ThresholdParameter(); + WindowDataParameter::_default_crop_mode_ = + new ::std::string("warp", 4); + WindowDataParameter::default_instance_ = new WindowDataParameter(); + SPPParameter::default_instance_ = new SPPParameter(); + V1LayerParameter::default_instance_ = new V1LayerParameter(); + V0LayerParameter::_default_det_crop_mode_ = + new ::std::string("warp", 4); + V0LayerParameter::default_instance_ = new V0LayerParameter(); + PReLUParameter::default_instance_ = new PReLUParameter(); + BlobShape::default_instance_->InitAsDefaultInstance(); + BlobProto::default_instance_->InitAsDefaultInstance(); + BlobProtoVector::default_instance_->InitAsDefaultInstance(); + Datum::default_instance_->InitAsDefaultInstance(); + FillerParameter::default_instance_->InitAsDefaultInstance(); + NetParameter::default_instance_->InitAsDefaultInstance(); + SolverParameter::default_instance_->InitAsDefaultInstance(); + SolverState::default_instance_->InitAsDefaultInstance(); + NetState::default_instance_->InitAsDefaultInstance(); + NetStateRule::default_instance_->InitAsDefaultInstance(); + ParamSpec::default_instance_->InitAsDefaultInstance(); + LayerParameter::default_instance_->InitAsDefaultInstance(); + TransformationParameter::default_instance_->InitAsDefaultInstance(); + LossParameter::default_instance_->InitAsDefaultInstance(); + AccuracyParameter::default_instance_->InitAsDefaultInstance(); + ArgMaxParameter::default_instance_->InitAsDefaultInstance(); + ConcatParameter::default_instance_->InitAsDefaultInstance(); + BatchNormParameter::default_instance_->InitAsDefaultInstance(); + BiasParameter::default_instance_->InitAsDefaultInstance(); + ContrastiveLossParameter::default_instance_->InitAsDefaultInstance(); + ConvolutionParameter::default_instance_->InitAsDefaultInstance(); + CropParameter::default_instance_->InitAsDefaultInstance(); + DataParameter::default_instance_->InitAsDefaultInstance(); + DropoutParameter::default_instance_->InitAsDefaultInstance(); + DummyDataParameter::default_instance_->InitAsDefaultInstance(); + EltwiseParameter::default_instance_->InitAsDefaultInstance(); + ELUParameter::default_instance_->InitAsDefaultInstance(); + EmbedParameter::default_instance_->InitAsDefaultInstance(); + ExpParameter::default_instance_->InitAsDefaultInstance(); + FlattenParameter::default_instance_->InitAsDefaultInstance(); + HDF5DataParameter::default_instance_->InitAsDefaultInstance(); + HDF5OutputParameter::default_instance_->InitAsDefaultInstance(); + HingeLossParameter::default_instance_->InitAsDefaultInstance(); + ImageDataParameter::default_instance_->InitAsDefaultInstance(); + InfogainLossParameter::default_instance_->InitAsDefaultInstance(); + InnerProductParameter::default_instance_->InitAsDefaultInstance(); + InputParameter::default_instance_->InitAsDefaultInstance(); + LogParameter::default_instance_->InitAsDefaultInstance(); + LRNParameter::default_instance_->InitAsDefaultInstance(); + MemoryDataParameter::default_instance_->InitAsDefaultInstance(); + MVNParameter::default_instance_->InitAsDefaultInstance(); + ParameterParameter::default_instance_->InitAsDefaultInstance(); + PoolingParameter::default_instance_->InitAsDefaultInstance(); + PowerParameter::default_instance_->InitAsDefaultInstance(); + PythonParameter::default_instance_->InitAsDefaultInstance(); + ReductionParameter::default_instance_->InitAsDefaultInstance(); + ReLUParameter::default_instance_->InitAsDefaultInstance(); + ReshapeParameter::default_instance_->InitAsDefaultInstance(); + ScaleParameter::default_instance_->InitAsDefaultInstance(); + SigmoidParameter::default_instance_->InitAsDefaultInstance(); + SliceParameter::default_instance_->InitAsDefaultInstance(); + SoftmaxParameter::default_instance_->InitAsDefaultInstance(); + TanHParameter::default_instance_->InitAsDefaultInstance(); + TileParameter::default_instance_->InitAsDefaultInstance(); + ThresholdParameter::default_instance_->InitAsDefaultInstance(); + WindowDataParameter::default_instance_->InitAsDefaultInstance(); + SPPParameter::default_instance_->InitAsDefaultInstance(); + V1LayerParameter::default_instance_->InitAsDefaultInstance(); + V0LayerParameter::default_instance_->InitAsDefaultInstance(); + PReLUParameter::default_instance_->InitAsDefaultInstance(); + ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto); +} + +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER +GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_once_); +void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto() { + ::google::protobuf::GoogleOnceInit(&protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_once_, + &protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl); +} +#else +// Force AddDescriptors() to be called at static initialization time. +struct StaticDescriptorInitializer_ditcaffe_2eopt_2dfor_2dlite_2eproto { + StaticDescriptorInitializer_ditcaffe_2eopt_2dfor_2dlite_2eproto() { + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + } +} static_descriptor_initializer_ditcaffe_2eopt_2dfor_2dlite_2eproto_; +#endif +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; +static void MergeFromFail(int line) { + GOOGLE_CHECK(false) << __FILE__ << ":" << line; +} + +} // namespace + + +// =================================================================== + +static ::std::string* MutableUnknownFieldsForBlobShape( + BlobShape* ptr) { + return ptr->mutable_unknown_fields(); +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int BlobShape::kDimFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +BlobShape::BlobShape() + : ::google::protobuf::MessageLite(), _arena_ptr_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.BlobShape) +} + +void BlobShape::InitAsDefaultInstance() { +} + +BlobShape::BlobShape(const BlobShape& from) + : ::google::protobuf::MessageLite(), + _arena_ptr_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.BlobShape) +} + +void BlobShape::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + _unknown_fields_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +BlobShape::~BlobShape() { + // @@protoc_insertion_point(destructor:ditcaffe.BlobShape) + SharedDtor(); +} + +void BlobShape::SharedDtor() { + _unknown_fields_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void BlobShape::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const BlobShape& BlobShape::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +BlobShape* BlobShape::default_instance_ = NULL; + +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:ditcaffe.BlobShape) + dim_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + _unknown_fields_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +bool BlobShape::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::internal::NewPermanentCallback( + &MutableUnknownFieldsForBlobShape, this)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:ditcaffe.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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.BlobShape) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.BlobShape) + return false; +#undef DO_ +} + +void BlobShape::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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); + } + + output->WriteRaw(unknown_fields().data(), + static_cast(unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:ditcaffe.BlobShape) +} + +int BlobShape::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.BlobShape) + int total_size = 0; + + // repeated int64 dim = 1 [packed = true]; + { + int data_size = 0; + for (int i = 0; i < this->dim_size(); 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); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _dim_cached_byte_size_ = data_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void BlobShape::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void BlobShape::MergeFrom(const BlobShape& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.BlobShape) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + dim_.MergeFrom(from.dim_); + if (!from.unknown_fields().empty()) { + mutable_unknown_fields()->append(from.unknown_fields()); + } +} + +void BlobShape::CopyFrom(const BlobShape& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.BlobShape) + if (&from == this) return; + Clear(); + MergeFrom(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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); +} + +::std::string BlobShape::GetTypeName() const { + return "ditcaffe.BlobShape"; +} + +#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:ditcaffe.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:ditcaffe.BlobShape.dim) +} + void BlobShape::add_dim(::google::protobuf::int64 value) { + dim_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.BlobShape.dim) +} + const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +BlobShape::dim() const { + // @@protoc_insertion_point(field_list:ditcaffe.BlobShape.dim) + return dim_; +} + ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +BlobShape::mutable_dim() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.BlobShape.dim) + return &dim_; +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +static ::std::string* MutableUnknownFieldsForBlobProto( + BlobProto* ptr) { + return ptr->mutable_unknown_fields(); +} + +#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::kHalfDataFieldNumber; +const int BlobProto::kHalfDiffFieldNumber; +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::MessageLite(), _arena_ptr_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.BlobProto) +} + +void BlobProto::InitAsDefaultInstance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + shape_ = const_cast< ::ditcaffe::BlobShape*>( + ::ditcaffe::BlobShape::internal_default_instance()); +#else + shape_ = const_cast< ::ditcaffe::BlobShape*>(&::ditcaffe::BlobShape::default_instance()); +#endif +} + +BlobProto::BlobProto(const BlobProto& from) + : ::google::protobuf::MessageLite(), + _arena_ptr_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.BlobProto) +} + +void BlobProto::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + _unknown_fields_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + shape_ = NULL; + num_ = 0; + channels_ = 0; + height_ = 0; + width_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +BlobProto::~BlobProto() { + // @@protoc_insertion_point(destructor:ditcaffe.BlobProto) + SharedDtor(); +} + +void BlobProto::SharedDtor() { + _unknown_fields_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + delete shape_; + } +} + +void BlobProto::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const BlobProto& BlobProto::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +BlobProto* BlobProto::default_instance_ = NULL; + +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:ditcaffe.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] & 129u) { + if (has_shape()) { + if (shape_ != NULL) shape_->::ditcaffe::BlobShape::Clear(); + } + num_ = 0; + } + ZR_(channels_, width_); + +#undef ZR_HELPER_ +#undef ZR_ + + data_.Clear(); + diff_.Clear(); + double_data_.Clear(); + double_diff_.Clear(); + half_data_.Clear(); + half_diff_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + _unknown_fields_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +bool BlobProto::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::internal::NewPermanentCallback( + &MutableUnknownFieldsForBlobProto, this)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &num_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &channels_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &height_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &width_))); + set_has_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 .ditcaffe.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->ExpectTag(82)) goto parse_half_data; + break; + } + + // repeated uint32 half_data = 10 [packed = true]; + case 10: { + if (tag == 82) { + parse_half_data: + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, this->mutable_half_data()))); + } else if (tag == 80) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + 1, 82, input, this->mutable_half_data()))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(90)) goto parse_half_diff; + break; + } + + // repeated uint32 half_diff = 11 [packed = true]; + case 11: { + if (tag == 90) { + parse_half_diff: + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, this->mutable_half_diff()))); + } else if (tag == 88) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + 1, 90, input, this->mutable_half_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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.BlobProto) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.BlobProto) + return false; +#undef DO_ +} + +void BlobProto::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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 .ditcaffe.BlobShape shape = 7; + if (has_shape()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 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); + } + + // repeated uint32 half_data = 10 [packed = true]; + if (this->half_data_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(10, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(_half_data_cached_byte_size_); + } + for (int i = 0; i < this->half_data_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32NoTag( + this->half_data(i), output); + } + + // repeated uint32 half_diff = 11 [packed = true]; + if (this->half_diff_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(11, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(_half_diff_cached_byte_size_); + } + for (int i = 0; i < this->half_diff_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32NoTag( + this->half_diff(i), output); + } + + output->WriteRaw(unknown_fields().data(), + static_cast(unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:ditcaffe.BlobProto) +} + +int BlobProto::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.BlobProto) + int total_size = 0; + + if (_has_bits_[0 / 32] & 129u) { + // optional .ditcaffe.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()); + } + + } + if (_has_bits_[8 / 32] & 1792u) { + // 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]; + { + int data_size = 0; + data_size = 4 * this->data_size(); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _data_cached_byte_size_ = data_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated float diff = 6 [packed = true]; + { + int data_size = 0; + data_size = 4 * this->diff_size(); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _diff_cached_byte_size_ = data_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated double double_data = 8 [packed = true]; + { + int data_size = 0; + data_size = 8 * this->double_data_size(); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _double_data_cached_byte_size_ = data_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated double double_diff = 9 [packed = true]; + { + int data_size = 0; + data_size = 8 * this->double_diff_size(); + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _double_diff_cached_byte_size_ = data_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated uint32 half_data = 10 [packed = true]; + { + int data_size = 0; + for (int i = 0; i < this->half_data_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->half_data(i)); + } + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _half_data_cached_byte_size_ = data_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated uint32 half_diff = 11 [packed = true]; + { + int data_size = 0; + for (int i = 0; i < this->half_diff_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->half_diff(i)); + } + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _half_diff_cached_byte_size_ = data_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void BlobProto::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void BlobProto::MergeFrom(const BlobProto& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.BlobProto) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + data_.MergeFrom(from.data_); + diff_.MergeFrom(from.diff_); + double_data_.MergeFrom(from.double_data_); + double_diff_.MergeFrom(from.double_diff_); + half_data_.MergeFrom(from.half_data_); + half_diff_.MergeFrom(from.half_diff_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_shape()) { + mutable_shape()->::ditcaffe::BlobShape::MergeFrom(from.shape()); + } + if (from.has_num()) { + set_num(from.num()); + } + } + if (from._has_bits_[8 / 32] & (0xffu << (8 % 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.unknown_fields().empty()) { + mutable_unknown_fields()->append(from.unknown_fields()); + } +} + +void BlobProto::CopyFrom(const BlobProto& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.BlobProto) + if (&from == this) return; + Clear(); + MergeFrom(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_); + half_data_.UnsafeArenaSwap(&other->half_data_); + half_diff_.UnsafeArenaSwap(&other->half_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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); +} + +::std::string BlobProto::GetTypeName() const { + return "ditcaffe.BlobProto"; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// BlobProto + +// optional .ditcaffe.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_->::ditcaffe::BlobShape::Clear(); + clear_has_shape(); +} +const ::ditcaffe::BlobShape& BlobProto::shape() const { + // @@protoc_insertion_point(field_get:ditcaffe.BlobProto.shape) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return shape_ != NULL ? *shape_ : *default_instance().shape_; +#else + return shape_ != NULL ? *shape_ : *default_instance_->shape_; +#endif +} +::ditcaffe::BlobShape* BlobProto::mutable_shape() { + set_has_shape(); + if (shape_ == NULL) { + shape_ = new ::ditcaffe::BlobShape; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.BlobProto.shape) + return shape_; +} +::ditcaffe::BlobShape* BlobProto::release_shape() { + // @@protoc_insertion_point(field_release:ditcaffe.BlobProto.shape) + clear_has_shape(); + ::ditcaffe::BlobShape* temp = shape_; + shape_ = NULL; + return temp; +} +void BlobProto::set_allocated_shape(::ditcaffe::BlobShape* shape) { + delete shape_; + shape_ = shape; + if (shape) { + set_has_shape(); + } else { + clear_has_shape(); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.BlobProto.data) + return data_.Get(index); +} + void BlobProto::set_data(int index, float value) { + data_.Set(index, value); + // @@protoc_insertion_point(field_set:ditcaffe.BlobProto.data) +} + void BlobProto::add_data(float value) { + data_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.BlobProto.data) +} + const ::google::protobuf::RepeatedField< float >& +BlobProto::data() const { + // @@protoc_insertion_point(field_list:ditcaffe.BlobProto.data) + return data_; +} + ::google::protobuf::RepeatedField< float >* +BlobProto::mutable_data() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.BlobProto.diff) + return diff_.Get(index); +} + void BlobProto::set_diff(int index, float value) { + diff_.Set(index, value); + // @@protoc_insertion_point(field_set:ditcaffe.BlobProto.diff) +} + void BlobProto::add_diff(float value) { + diff_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.BlobProto.diff) +} + const ::google::protobuf::RepeatedField< float >& +BlobProto::diff() const { + // @@protoc_insertion_point(field_list:ditcaffe.BlobProto.diff) + return diff_; +} + ::google::protobuf::RepeatedField< float >* +BlobProto::mutable_diff() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.BlobProto.double_data) +} + void BlobProto::add_double_data(double value) { + double_data_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.BlobProto.double_data) +} + const ::google::protobuf::RepeatedField< double >& +BlobProto::double_data() const { + // @@protoc_insertion_point(field_list:ditcaffe.BlobProto.double_data) + return double_data_; +} + ::google::protobuf::RepeatedField< double >* +BlobProto::mutable_double_data() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.BlobProto.double_diff) +} + void BlobProto::add_double_diff(double value) { + double_diff_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.BlobProto.double_diff) +} + const ::google::protobuf::RepeatedField< double >& +BlobProto::double_diff() const { + // @@protoc_insertion_point(field_list:ditcaffe.BlobProto.double_diff) + return double_diff_; +} + ::google::protobuf::RepeatedField< double >* +BlobProto::mutable_double_diff() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.BlobProto.double_diff) + return &double_diff_; +} + +// repeated uint32 half_data = 10 [packed = true]; +int BlobProto::half_data_size() const { + return half_data_.size(); +} +void BlobProto::clear_half_data() { + half_data_.Clear(); +} + ::google::protobuf::uint32 BlobProto::half_data(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.BlobProto.half_data) + return half_data_.Get(index); +} + void BlobProto::set_half_data(int index, ::google::protobuf::uint32 value) { + half_data_.Set(index, value); + // @@protoc_insertion_point(field_set:ditcaffe.BlobProto.half_data) +} + void BlobProto::add_half_data(::google::protobuf::uint32 value) { + half_data_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.BlobProto.half_data) +} + const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +BlobProto::half_data() const { + // @@protoc_insertion_point(field_list:ditcaffe.BlobProto.half_data) + return half_data_; +} + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +BlobProto::mutable_half_data() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.BlobProto.half_data) + return &half_data_; +} + +// repeated uint32 half_diff = 11 [packed = true]; +int BlobProto::half_diff_size() const { + return half_diff_.size(); +} +void BlobProto::clear_half_diff() { + half_diff_.Clear(); +} + ::google::protobuf::uint32 BlobProto::half_diff(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.BlobProto.half_diff) + return half_diff_.Get(index); +} + void BlobProto::set_half_diff(int index, ::google::protobuf::uint32 value) { + half_diff_.Set(index, value); + // @@protoc_insertion_point(field_set:ditcaffe.BlobProto.half_diff) +} + void BlobProto::add_half_diff(::google::protobuf::uint32 value) { + half_diff_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.BlobProto.half_diff) +} + const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +BlobProto::half_diff() const { + // @@protoc_insertion_point(field_list:ditcaffe.BlobProto.half_diff) + return half_diff_; +} + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +BlobProto::mutable_half_diff() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.BlobProto.half_diff) + return &half_diff_; +} + +// optional int32 num = 1 [default = 0]; +bool BlobProto::has_num() const { + return (_has_bits_[0] & 0x00000080u) != 0; +} +void BlobProto::set_has_num() { + _has_bits_[0] |= 0x00000080u; +} +void BlobProto::clear_has_num() { + _has_bits_[0] &= ~0x00000080u; +} +void BlobProto::clear_num() { + num_ = 0; + clear_has_num(); +} + ::google::protobuf::int32 BlobProto::num() const { + // @@protoc_insertion_point(field_get:ditcaffe.BlobProto.num) + return num_; +} + void BlobProto::set_num(::google::protobuf::int32 value) { + set_has_num(); + num_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.BlobProto.num) +} + +// optional int32 channels = 2 [default = 0]; +bool BlobProto::has_channels() const { + return (_has_bits_[0] & 0x00000100u) != 0; +} +void BlobProto::set_has_channels() { + _has_bits_[0] |= 0x00000100u; +} +void BlobProto::clear_has_channels() { + _has_bits_[0] &= ~0x00000100u; +} +void BlobProto::clear_channels() { + channels_ = 0; + clear_has_channels(); +} + ::google::protobuf::int32 BlobProto::channels() const { + // @@protoc_insertion_point(field_get:ditcaffe.BlobProto.channels) + return channels_; +} + void BlobProto::set_channels(::google::protobuf::int32 value) { + set_has_channels(); + channels_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.BlobProto.channels) +} + +// optional int32 height = 3 [default = 0]; +bool BlobProto::has_height() const { + return (_has_bits_[0] & 0x00000200u) != 0; +} +void BlobProto::set_has_height() { + _has_bits_[0] |= 0x00000200u; +} +void BlobProto::clear_has_height() { + _has_bits_[0] &= ~0x00000200u; +} +void BlobProto::clear_height() { + height_ = 0; + clear_has_height(); +} + ::google::protobuf::int32 BlobProto::height() const { + // @@protoc_insertion_point(field_get:ditcaffe.BlobProto.height) + return height_; +} + void BlobProto::set_height(::google::protobuf::int32 value) { + set_has_height(); + height_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.BlobProto.height) +} + +// optional int32 width = 4 [default = 0]; +bool BlobProto::has_width() const { + return (_has_bits_[0] & 0x00000400u) != 0; +} +void BlobProto::set_has_width() { + _has_bits_[0] |= 0x00000400u; +} +void BlobProto::clear_has_width() { + _has_bits_[0] &= ~0x00000400u; +} +void BlobProto::clear_width() { + width_ = 0; + clear_has_width(); +} + ::google::protobuf::int32 BlobProto::width() const { + // @@protoc_insertion_point(field_get:ditcaffe.BlobProto.width) + return width_; +} + void BlobProto::set_width(::google::protobuf::int32 value) { + set_has_width(); + width_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.BlobProto.width) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +static ::std::string* MutableUnknownFieldsForBlobProtoVector( + BlobProtoVector* ptr) { + return ptr->mutable_unknown_fields(); +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int BlobProtoVector::kBlobsFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +BlobProtoVector::BlobProtoVector() + : ::google::protobuf::MessageLite(), _arena_ptr_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.BlobProtoVector) +} + +void BlobProtoVector::InitAsDefaultInstance() { +} + +BlobProtoVector::BlobProtoVector(const BlobProtoVector& from) + : ::google::protobuf::MessageLite(), + _arena_ptr_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.BlobProtoVector) +} + +void BlobProtoVector::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + _unknown_fields_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +BlobProtoVector::~BlobProtoVector() { + // @@protoc_insertion_point(destructor:ditcaffe.BlobProtoVector) + SharedDtor(); +} + +void BlobProtoVector::SharedDtor() { + _unknown_fields_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void BlobProtoVector::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const BlobProtoVector& BlobProtoVector::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +BlobProtoVector* BlobProtoVector::default_instance_ = NULL; + +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:ditcaffe.BlobProtoVector) + blobs_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + _unknown_fields_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +bool BlobProtoVector::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::internal::NewPermanentCallback( + &MutableUnknownFieldsForBlobProtoVector, this)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:ditcaffe.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 .ditcaffe.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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.BlobProtoVector) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.BlobProtoVector) + return false; +#undef DO_ +} + +void BlobProtoVector::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.BlobProtoVector) + // repeated .ditcaffe.BlobProto blobs = 1; + for (unsigned int i = 0, n = this->blobs_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 1, this->blobs(i), output); + } + + output->WriteRaw(unknown_fields().data(), + static_cast(unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:ditcaffe.BlobProtoVector) +} + +int BlobProtoVector::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.BlobProtoVector) + int total_size = 0; + + // repeated .ditcaffe.BlobProto blobs = 1; + total_size += 1 * this->blobs_size(); + for (int i = 0; i < this->blobs_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->blobs(i)); + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void BlobProtoVector::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void BlobProtoVector::MergeFrom(const BlobProtoVector& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.BlobProtoVector) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + blobs_.MergeFrom(from.blobs_); + if (!from.unknown_fields().empty()) { + mutable_unknown_fields()->append(from.unknown_fields()); + } +} + +void BlobProtoVector::CopyFrom(const BlobProtoVector& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.BlobProtoVector) + if (&from == this) return; + Clear(); + MergeFrom(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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); +} + +::std::string BlobProtoVector::GetTypeName() const { + return "ditcaffe.BlobProtoVector"; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// BlobProtoVector + +// repeated .ditcaffe.BlobProto blobs = 1; +int BlobProtoVector::blobs_size() const { + return blobs_.size(); +} +void BlobProtoVector::clear_blobs() { + blobs_.Clear(); +} +const ::ditcaffe::BlobProto& BlobProtoVector::blobs(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.BlobProtoVector.blobs) + return blobs_.Get(index); +} +::ditcaffe::BlobProto* BlobProtoVector::mutable_blobs(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.BlobProtoVector.blobs) + return blobs_.Mutable(index); +} +::ditcaffe::BlobProto* BlobProtoVector::add_blobs() { + // @@protoc_insertion_point(field_add:ditcaffe.BlobProtoVector.blobs) + return blobs_.Add(); +} +::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >* +BlobProtoVector::mutable_blobs() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.BlobProtoVector.blobs) + return &blobs_; +} +const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >& +BlobProtoVector::blobs() const { + // @@protoc_insertion_point(field_list:ditcaffe.BlobProtoVector.blobs) + return blobs_; +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +static ::std::string* MutableUnknownFieldsForDatum( + Datum* ptr) { + return ptr->mutable_unknown_fields(); +} + +#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::MessageLite(), _arena_ptr_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.Datum) +} + +void Datum::InitAsDefaultInstance() { +} + +Datum::Datum(const Datum& from) + : ::google::protobuf::MessageLite(), + _arena_ptr_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.Datum) +} + +void Datum::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + _unknown_fields_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + channels_ = 0; + height_ = 0; + width_ = 0; + data_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + label_ = 0; + encoded_ = false; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +Datum::~Datum() { + // @@protoc_insertion_point(destructor:ditcaffe.Datum) + SharedDtor(); +} + +void Datum::SharedDtor() { + _unknown_fields_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + data_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void Datum::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const Datum& Datum::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +Datum* Datum::default_instance_ = NULL; + +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:ditcaffe.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_, height_); + ZR_(width_, label_); + if (has_data()) { + data_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + encoded_ = false; + } + +#undef ZR_HELPER_ +#undef ZR_ + + float_data_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + _unknown_fields_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +bool Datum::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::internal::NewPermanentCallback( + &MutableUnknownFieldsForDatum, this)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &channels_))); + set_has_channels(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_height; + break; + } + + // optional int32 height = 2; + case 2: { + if (tag == 16) { + parse_height: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &height_))); + set_has_height(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(24)) goto parse_width; + break; + } + + // optional int32 width = 3; + case 3: { + if (tag == 24) { + parse_width: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &width_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &label_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &encoded_))); + set_has_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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.Datum) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.Datum) + return false; +#undef DO_ +} + +void Datum::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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); + } + + output->WriteRaw(unknown_fields().data(), + static_cast(unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:ditcaffe.Datum) +} + +int Datum::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.Datum) + int 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; + { + int data_size = 0; + data_size = 4 * this->float_data_size(); + total_size += 1 * this->float_data_size() + data_size; + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void Datum::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void Datum::MergeFrom(const Datum& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.Datum) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + float_data_.MergeFrom(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.unknown_fields().empty()) { + mutable_unknown_fields()->append(from.unknown_fields()); + } +} + +void Datum::CopyFrom(const Datum& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.Datum) + if (&from == this) return; + Clear(); + MergeFrom(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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); +} + +::std::string Datum::GetTypeName() const { + return "ditcaffe.Datum"; +} + +#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:ditcaffe.Datum.channels) + return channels_; +} + void Datum::set_channels(::google::protobuf::int32 value) { + set_has_channels(); + channels_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.Datum.height) + return height_; +} + void Datum::set_height(::google::protobuf::int32 value) { + set_has_height(); + height_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.Datum.width) + return width_; +} + void Datum::set_width(::google::protobuf::int32 value) { + set_has_width(); + width_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.Datum.data) +} + ::std::string* Datum::mutable_data() { + set_has_data(); + // @@protoc_insertion_point(field_mutable:ditcaffe.Datum.data) + return data_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* Datum::release_data() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.Datum.label) + return label_; +} + void Datum::set_label(::google::protobuf::int32 value) { + set_has_label(); + label_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.Datum.float_data) +} + void Datum::add_float_data(float value) { + float_data_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.Datum.float_data) +} + const ::google::protobuf::RepeatedField< float >& +Datum::float_data() const { + // @@protoc_insertion_point(field_list:ditcaffe.Datum.float_data) + return float_data_; +} + ::google::protobuf::RepeatedField< float >* +Datum::mutable_float_data() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.Datum.encoded) + return encoded_; +} + void Datum::set_encoded(bool value) { + set_has_encoded(); + encoded_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.Datum.encoded) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +static ::std::string* MutableUnknownFieldsForFillerParameter( + FillerParameter* ptr) { + return ptr->mutable_unknown_fields(); +} + +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::MessageLite(), _arena_ptr_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.FillerParameter) +} + +void FillerParameter::InitAsDefaultInstance() { +} + +FillerParameter::FillerParameter(const FillerParameter& from) + : ::google::protobuf::MessageLite(), + _arena_ptr_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.FillerParameter) +} + +void FillerParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + _unknown_fields_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + type_.UnsafeSetDefault(_default_type_); + value_ = 0; + min_ = 0; + max_ = 1; + mean_ = 0; + std_ = 1; + sparse_ = -1; + variance_norm_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +FillerParameter::~FillerParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.FillerParameter) + SharedDtor(); +} + +void FillerParameter::SharedDtor() { + _unknown_fields_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + type_.DestroyNoArena(_default_type_); + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void FillerParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const FillerParameter& FillerParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +FillerParameter* FillerParameter::default_instance_ = NULL; + +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:ditcaffe.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_, min_); + if (has_type()) { + type_.ClearToDefaultNoArena(_default_type_); + } + max_ = 1; + mean_ = 0; + std_ = 1; + sparse_ = -1; + variance_norm_ = 0; + } + +#undef ZR_HELPER_ +#undef ZR_ + + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + _unknown_fields_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +bool FillerParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::internal::NewPermanentCallback( + &MutableUnknownFieldsForFillerParameter, this)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:ditcaffe.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())); + } 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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &value_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &min_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &max_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &mean_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &std_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &sparse_))); + set_has_sparse(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(64)) goto parse_variance_norm; + break; + } + + // optional .ditcaffe.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 (::ditcaffe::FillerParameter_VarianceNorm_IsValid(value)) { + set_variance_norm(static_cast< ::ditcaffe::FillerParameter_VarianceNorm >(value)); + } else { + unknown_fields_stream.WriteVarint32(64); + unknown_fields_stream.WriteVarint32(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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.FillerParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.FillerParameter) + return false; +#undef DO_ +} + +void FillerParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.FillerParameter) + // optional string type = 1 [default = "constant"]; + if (has_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 .ditcaffe.FillerParameter.VarianceNorm variance_norm = 8 [default = FAN_IN]; + if (has_variance_norm()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 8, this->variance_norm(), output); + } + + output->WriteRaw(unknown_fields().data(), + static_cast(unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:ditcaffe.FillerParameter) +} + +int FillerParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.FillerParameter) + int 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 .ditcaffe.FillerParameter.VarianceNorm variance_norm = 8 [default = FAN_IN]; + if (has_variance_norm()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->variance_norm()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void FillerParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void FillerParameter::MergeFrom(const FillerParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.FillerParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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.unknown_fields().empty()) { + mutable_unknown_fields()->append(from.unknown_fields()); + } +} + +void FillerParameter::CopyFrom(const FillerParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.FillerParameter) + if (&from == this) return; + Clear(); + MergeFrom(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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); +} + +::std::string FillerParameter::GetTypeName() const { + return "ditcaffe.FillerParameter"; +} + +#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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.FillerParameter.type) +} + ::std::string* FillerParameter::mutable_type() { + set_has_type(); + // @@protoc_insertion_point(field_mutable:ditcaffe.FillerParameter.type) + return type_.MutableNoArena(_default_type_); +} + ::std::string* FillerParameter::release_type() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.FillerParameter.value) + return value_; +} + void FillerParameter::set_value(float value) { + set_has_value(); + value_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.FillerParameter.min) + return min_; +} + void FillerParameter::set_min(float value) { + set_has_min(); + min_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.FillerParameter.max) + return max_; +} + void FillerParameter::set_max(float value) { + set_has_max(); + max_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.FillerParameter.mean) + return mean_; +} + void FillerParameter::set_mean(float value) { + set_has_mean(); + mean_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.FillerParameter.std) + return std_; +} + void FillerParameter::set_std(float value) { + set_has_std(); + std_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.FillerParameter.sparse) + return sparse_; +} + void FillerParameter::set_sparse(::google::protobuf::int32 value) { + set_has_sparse(); + sparse_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.FillerParameter.sparse) +} + +// optional .ditcaffe.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(); +} + ::ditcaffe::FillerParameter_VarianceNorm FillerParameter::variance_norm() const { + // @@protoc_insertion_point(field_get:ditcaffe.FillerParameter.variance_norm) + return static_cast< ::ditcaffe::FillerParameter_VarianceNorm >(variance_norm_); +} + void FillerParameter::set_variance_norm(::ditcaffe::FillerParameter_VarianceNorm value) { + assert(::ditcaffe::FillerParameter_VarianceNorm_IsValid(value)); + set_has_variance_norm(); + variance_norm_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.FillerParameter.variance_norm) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +static ::std::string* MutableUnknownFieldsForNetParameter( + NetParameter* ptr) { + return ptr->mutable_unknown_fields(); +} + +#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::MessageLite(), _arena_ptr_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.NetParameter) +} + +void NetParameter::InitAsDefaultInstance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + state_ = const_cast< ::ditcaffe::NetState*>( + ::ditcaffe::NetState::internal_default_instance()); +#else + state_ = const_cast< ::ditcaffe::NetState*>(&::ditcaffe::NetState::default_instance()); +#endif +} + +NetParameter::NetParameter(const NetParameter& from) + : ::google::protobuf::MessageLite(), + _arena_ptr_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.NetParameter) +} + +void NetParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + _unknown_fields_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + force_backward_ = false; + state_ = NULL; + debug_info_ = false; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +NetParameter::~NetParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.NetParameter) + SharedDtor(); +} + +void NetParameter::SharedDtor() { + _unknown_fields_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + delete state_; + } +} + +void NetParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const NetParameter& NetParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +NetParameter* NetParameter::default_instance_ = NULL; + +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:ditcaffe.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_->::ditcaffe::NetState::Clear(); + } + } + +#undef ZR_HELPER_ +#undef ZR_ + + input_.Clear(); + input_shape_.Clear(); + input_dim_.Clear(); + layer_.Clear(); + layers_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + _unknown_fields_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +bool NetParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::internal::NewPermanentCallback( + &MutableUnknownFieldsForNetParameter, this)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:ditcaffe.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())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_layers; + break; + } + + // repeated .ditcaffe.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())); + } 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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &force_backward_))); + set_has_force_backward(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(50)) goto parse_state; + break; + } + + // optional .ditcaffe.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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &debug_info_))); + set_has_debug_info(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(66)) goto parse_input_shape; + break; + } + + // repeated .ditcaffe.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 .ditcaffe.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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.NetParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.NetParameter) + return false; +#undef DO_ +} + +void NetParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.NetParameter) + // optional string name = 1; + if (has_name()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // repeated .ditcaffe.V1LayerParameter layers = 2; + for (unsigned int i = 0, n = this->layers_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 2, this->layers(i), output); + } + + // repeated string input = 3; + for (int i = 0; i < this->input_size(); i++) { + ::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 .ditcaffe.NetState state = 6; + if (has_state()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 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 .ditcaffe.BlobShape input_shape = 8; + for (unsigned int i = 0, n = this->input_shape_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 8, this->input_shape(i), output); + } + + // repeated .ditcaffe.LayerParameter layer = 100; + for (unsigned int i = 0, n = this->layer_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 100, this->layer(i), output); + } + + output->WriteRaw(unknown_fields().data(), + static_cast(unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:ditcaffe.NetParameter) +} + +int NetParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.NetParameter) + int 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 .ditcaffe.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 * this->input_size(); + for (int i = 0; i < this->input_size(); i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->input(i)); + } + + // repeated .ditcaffe.BlobShape input_shape = 8; + total_size += 1 * this->input_shape_size(); + for (int i = 0; i < this->input_shape_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->input_shape(i)); + } + + // repeated int32 input_dim = 4; + { + int data_size = 0; + for (int i = 0; i < this->input_dim_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + Int32Size(this->input_dim(i)); + } + total_size += 1 * this->input_dim_size() + data_size; + } + + // repeated .ditcaffe.LayerParameter layer = 100; + total_size += 2 * this->layer_size(); + for (int i = 0; i < this->layer_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->layer(i)); + } + + // repeated .ditcaffe.V1LayerParameter layers = 2; + total_size += 1 * this->layers_size(); + for (int i = 0; i < this->layers_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->layers(i)); + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void NetParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void NetParameter::MergeFrom(const NetParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.NetParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + input_.MergeFrom(from.input_); + input_shape_.MergeFrom(from.input_shape_); + input_dim_.MergeFrom(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()->::ditcaffe::NetState::MergeFrom(from.state()); + } + if (from.has_debug_info()) { + set_debug_info(from.debug_info()); + } + } + if (!from.unknown_fields().empty()) { + mutable_unknown_fields()->append(from.unknown_fields()); + } +} + +void NetParameter::CopyFrom(const NetParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.NetParameter) + if (&from == this) return; + Clear(); + MergeFrom(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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); +} + +::std::string NetParameter::GetTypeName() const { + return "ditcaffe.NetParameter"; +} + +#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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.NetParameter.name) +} + ::std::string* NetParameter::mutable_name() { + set_has_name(); + // @@protoc_insertion_point(field_mutable:ditcaffe.NetParameter.name) + return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* NetParameter::release_name() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.NetParameter.input) + return input_.Get(index); +} + ::std::string* NetParameter::mutable_input(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.NetParameter.input) + return input_.Mutable(index); +} + void NetParameter::set_input(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.NetParameter.input) +} + ::std::string* NetParameter::add_input() { + // @@protoc_insertion_point(field_add_mutable:ditcaffe.NetParameter.input) + return input_.Add(); +} + void NetParameter::add_input(const ::std::string& value) { + input_.Add()->assign(value); + // @@protoc_insertion_point(field_add:ditcaffe.NetParameter.input) +} + void NetParameter::add_input(const char* value) { + input_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:ditcaffe.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:ditcaffe.NetParameter.input) +} + const ::google::protobuf::RepeatedPtrField< ::std::string>& +NetParameter::input() const { + // @@protoc_insertion_point(field_list:ditcaffe.NetParameter.input) + return input_; +} + ::google::protobuf::RepeatedPtrField< ::std::string>* +NetParameter::mutable_input() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.NetParameter.input) + return &input_; +} + +// repeated .ditcaffe.BlobShape input_shape = 8; +int NetParameter::input_shape_size() const { + return input_shape_.size(); +} +void NetParameter::clear_input_shape() { + input_shape_.Clear(); +} +const ::ditcaffe::BlobShape& NetParameter::input_shape(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.NetParameter.input_shape) + return input_shape_.Get(index); +} +::ditcaffe::BlobShape* NetParameter::mutable_input_shape(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.NetParameter.input_shape) + return input_shape_.Mutable(index); +} +::ditcaffe::BlobShape* NetParameter::add_input_shape() { + // @@protoc_insertion_point(field_add:ditcaffe.NetParameter.input_shape) + return input_shape_.Add(); +} +::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobShape >* +NetParameter::mutable_input_shape() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.NetParameter.input_shape) + return &input_shape_; +} +const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobShape >& +NetParameter::input_shape() const { + // @@protoc_insertion_point(field_list:ditcaffe.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:ditcaffe.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:ditcaffe.NetParameter.input_dim) +} + void NetParameter::add_input_dim(::google::protobuf::int32 value) { + input_dim_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.NetParameter.input_dim) +} + const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +NetParameter::input_dim() const { + // @@protoc_insertion_point(field_list:ditcaffe.NetParameter.input_dim) + return input_dim_; +} + ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +NetParameter::mutable_input_dim() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.NetParameter.force_backward) +} + +// optional .ditcaffe.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_->::ditcaffe::NetState::Clear(); + clear_has_state(); +} +const ::ditcaffe::NetState& NetParameter::state() const { + // @@protoc_insertion_point(field_get:ditcaffe.NetParameter.state) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return state_ != NULL ? *state_ : *default_instance().state_; +#else + return state_ != NULL ? *state_ : *default_instance_->state_; +#endif +} +::ditcaffe::NetState* NetParameter::mutable_state() { + set_has_state(); + if (state_ == NULL) { + state_ = new ::ditcaffe::NetState; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.NetParameter.state) + return state_; +} +::ditcaffe::NetState* NetParameter::release_state() { + // @@protoc_insertion_point(field_release:ditcaffe.NetParameter.state) + clear_has_state(); + ::ditcaffe::NetState* temp = state_; + state_ = NULL; + return temp; +} +void NetParameter::set_allocated_state(::ditcaffe::NetState* state) { + delete state_; + state_ = state; + if (state) { + set_has_state(); + } else { + clear_has_state(); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.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:ditcaffe.NetParameter.debug_info) +} + +// repeated .ditcaffe.LayerParameter layer = 100; +int NetParameter::layer_size() const { + return layer_.size(); +} +void NetParameter::clear_layer() { + layer_.Clear(); +} +const ::ditcaffe::LayerParameter& NetParameter::layer(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.NetParameter.layer) + return layer_.Get(index); +} +::ditcaffe::LayerParameter* NetParameter::mutable_layer(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.NetParameter.layer) + return layer_.Mutable(index); +} +::ditcaffe::LayerParameter* NetParameter::add_layer() { + // @@protoc_insertion_point(field_add:ditcaffe.NetParameter.layer) + return layer_.Add(); +} +::google::protobuf::RepeatedPtrField< ::ditcaffe::LayerParameter >* +NetParameter::mutable_layer() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.NetParameter.layer) + return &layer_; +} +const ::google::protobuf::RepeatedPtrField< ::ditcaffe::LayerParameter >& +NetParameter::layer() const { + // @@protoc_insertion_point(field_list:ditcaffe.NetParameter.layer) + return layer_; +} + +// repeated .ditcaffe.V1LayerParameter layers = 2; +int NetParameter::layers_size() const { + return layers_.size(); +} +void NetParameter::clear_layers() { + layers_.Clear(); +} +const ::ditcaffe::V1LayerParameter& NetParameter::layers(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.NetParameter.layers) + return layers_.Get(index); +} +::ditcaffe::V1LayerParameter* NetParameter::mutable_layers(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.NetParameter.layers) + return layers_.Mutable(index); +} +::ditcaffe::V1LayerParameter* NetParameter::add_layers() { + // @@protoc_insertion_point(field_add:ditcaffe.NetParameter.layers) + return layers_.Add(); +} +::google::protobuf::RepeatedPtrField< ::ditcaffe::V1LayerParameter >* +NetParameter::mutable_layers() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.NetParameter.layers) + return &layers_; +} +const ::google::protobuf::RepeatedPtrField< ::ditcaffe::V1LayerParameter >& +NetParameter::layers() const { + // @@protoc_insertion_point(field_list:ditcaffe.NetParameter.layers) + return layers_; +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +static ::std::string* MutableUnknownFieldsForSolverParameter( + SolverParameter* ptr) { + return ptr->mutable_unknown_fields(); +} + +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 +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 +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::MessageLite(), _arena_ptr_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.SolverParameter) +} + +void SolverParameter::InitAsDefaultInstance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + net_param_ = const_cast< ::ditcaffe::NetParameter*>( + ::ditcaffe::NetParameter::internal_default_instance()); +#else + net_param_ = const_cast< ::ditcaffe::NetParameter*>(&::ditcaffe::NetParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + train_net_param_ = const_cast< ::ditcaffe::NetParameter*>( + ::ditcaffe::NetParameter::internal_default_instance()); +#else + train_net_param_ = const_cast< ::ditcaffe::NetParameter*>(&::ditcaffe::NetParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + train_state_ = const_cast< ::ditcaffe::NetState*>( + ::ditcaffe::NetState::internal_default_instance()); +#else + train_state_ = const_cast< ::ditcaffe::NetState*>(&::ditcaffe::NetState::default_instance()); +#endif +} + +SolverParameter::SolverParameter(const SolverParameter& from) + : ::google::protobuf::MessageLite(), + _arena_ptr_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.SolverParameter) +} + +void SolverParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + _unknown_fields_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + net_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + net_param_ = NULL; + train_net_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + train_net_param_ = NULL; + train_state_ = NULL; + test_interval_ = 0; + test_compute_loss_ = false; + test_initialization_ = true; + base_lr_ = 0; + display_ = 0; + average_loss_ = 1; + max_iter_ = 0; + iter_size_ = 1; + lr_policy_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + gamma_ = 0; + power_ = 0; + momentum_ = 0; + weight_decay_ = 0; + regularization_type_.UnsafeSetDefault(_default_regularization_type_); + stepsize_ = 0; + clip_gradients_ = -1; + snapshot_ = 0; + snapshot_prefix_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + snapshot_diff_ = false; + snapshot_format_ = 1; + solver_mode_ = 1; + device_id_ = 0; + random_seed_ = GOOGLE_LONGLONG(-1); + type_.UnsafeSetDefault(_default_type_); + delta_ = 1e-08f; + momentum2_ = 0.999f; + rms_decay_ = 0; + debug_info_ = false; + snapshot_after_train_ = true; + solver_type_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +SolverParameter::~SolverParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.SolverParameter) + SharedDtor(); +} + +void SolverParameter::SharedDtor() { + _unknown_fields_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + 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_); + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + 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 SolverParameter& SolverParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +SolverParameter* SolverParameter::default_instance_ = NULL; + +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:ditcaffe.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_->::ditcaffe::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_->::ditcaffe::NetParameter::Clear(); + } + if (has_train_state()) { + if (train_state_ != NULL) train_state_->::ditcaffe::NetState::Clear(); + } + } + if (_has_bits_[8 / 32] & 65024u) { + ZR_(test_interval_, display_); + test_compute_loss_ = false; + test_initialization_ = true; + average_loss_ = 1; + max_iter_ = 0; + } + if (_has_bits_[16 / 32] & 16711680u) { + ZR_(gamma_, weight_decay_); + iter_size_ = 1; + if (has_lr_policy()) { + lr_policy_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + if (has_regularization_type()) { + regularization_type_.ClearToDefaultNoArena(_default_regularization_type_); + } + stepsize_ = 0; + } + if (_has_bits_[24 / 32] & 4261412864u) { + clip_gradients_ = -1; + snapshot_ = 0; + if (has_snapshot_prefix()) { + snapshot_prefix_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + snapshot_diff_ = false; + snapshot_format_ = 1; + solver_mode_ = 1; + device_id_ = 0; + } + 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; + 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(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + _unknown_fields_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +bool SolverParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::internal::NewPermanentCallback( + &MutableUnknownFieldsForSolverParameter, this)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:ditcaffe.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())); + } 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())); + } 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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &test_interval_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &base_lr_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &display_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &max_iter_))); + set_has_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())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(77)) goto parse_gamma; + break; + } + + // optional float gamma = 9; + case 9: { + if (tag == 77) { + parse_gamma: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &gamma_))); + set_has_gamma(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(85)) goto parse_power; + break; + } + + // optional float power = 10; + case 10: { + if (tag == 85) { + parse_power: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &power_))); + set_has_power(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(93)) goto parse_momentum; + break; + } + + // optional float momentum = 11; + case 11: { + if (tag == 93) { + parse_momentum: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &momentum_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &weight_decay_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &stepsize_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &snapshot_))); + set_has_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())); + } 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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &snapshot_diff_))); + set_has_snapshot_diff(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(136)) goto parse_solver_mode; + break; + } + + // optional .ditcaffe.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 (::ditcaffe::SolverParameter_SolverMode_IsValid(value)) { + set_solver_mode(static_cast< ::ditcaffe::SolverParameter_SolverMode >(value)); + } else { + unknown_fields_stream.WriteVarint32(136); + unknown_fields_stream.WriteVarint32(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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &device_id_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &test_compute_loss_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &random_seed_))); + set_has_random_seed(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(170)) goto parse_train_net_param; + break; + } + + // optional .ditcaffe.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 .ditcaffe.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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &debug_info_))); + set_has_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())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(202)) goto parse_net_param; + break; + } + + // optional .ditcaffe.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 .ditcaffe.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 .ditcaffe.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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &snapshot_after_train_))); + set_has_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())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(240)) goto parse_solver_type; + break; + } + + // optional .ditcaffe.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 (::ditcaffe::SolverParameter_SolverType_IsValid(value)) { + set_solver_type(static_cast< ::ditcaffe::SolverParameter_SolverType >(value)); + } else { + unknown_fields_stream.WriteVarint32(240); + unknown_fields_stream.WriteVarint32(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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &delta_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &test_initialization_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &average_loss_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &clip_gradients_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &iter_size_))); + set_has_iter_size(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(296)) goto parse_snapshot_format; + break; + } + + // optional .ditcaffe.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 (::ditcaffe::SolverParameter_SnapshotFormat_IsValid(value)) { + set_snapshot_format(static_cast< ::ditcaffe::SolverParameter_SnapshotFormat >(value)); + } else { + unknown_fields_stream.WriteVarint32(296); + unknown_fields_stream.WriteVarint32(value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(309)) goto parse_rms_decay; + break; + } + + // optional float rms_decay = 38; + case 38: { + if (tag == 309) { + parse_rms_decay: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &rms_decay_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &momentum2_))); + set_has_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())); + } 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, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.SolverParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.SolverParameter) + return false; +#undef DO_ +} + +void SolverParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.SolverParameter) + // optional string train_net = 1; + if (has_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::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::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::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 .ditcaffe.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 .ditcaffe.NetParameter train_net_param = 21; + if (has_train_net_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 21, *this->train_net_param_, output); + } + + // repeated .ditcaffe.NetParameter test_net_param = 22; + for (unsigned int i = 0, n = this->test_net_param_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 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::WireFormatLite::WriteStringMaybeAliased( + 24, this->net(), output); + } + + // optional .ditcaffe.NetParameter net_param = 25; + if (has_net_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 25, *this->net_param_, output); + } + + // optional .ditcaffe.NetState train_state = 26; + if (has_train_state()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 26, *this->train_state_, output); + } + + // repeated .ditcaffe.NetState test_state = 27; + for (unsigned int i = 0, n = this->test_state_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 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::WireFormatLite::WriteStringMaybeAliased( + 29, this->regularization_type(), output); + } + + // optional .ditcaffe.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 .ditcaffe.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; + 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::WireFormatLite::WriteStringMaybeAliased( + 40, this->type(), output); + } + + output->WriteRaw(unknown_fields().data(), + static_cast(unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:ditcaffe.SolverParameter) +} + +int SolverParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.SolverParameter) + int 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 .ditcaffe.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 .ditcaffe.NetParameter train_net_param = 21; + if (has_train_net_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->train_net_param_); + } + + // optional .ditcaffe.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 .ditcaffe.SolverParameter.SnapshotFormat snapshot_format = 37 [default = BINARYPROTO]; + if (has_snapshot_format()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->snapshot_format()); + } + + // optional .ditcaffe.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; + 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 .ditcaffe.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 * 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 .ditcaffe.NetParameter test_net_param = 22; + total_size += 2 * this->test_net_param_size(); + for (int i = 0; i < this->test_net_param_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->test_net_param(i)); + } + + // repeated .ditcaffe.NetState test_state = 27; + total_size += 2 * this->test_state_size(); + for (int i = 0; i < this->test_state_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->test_state(i)); + } + + // repeated int32 test_iter = 3; + { + int data_size = 0; + for (int i = 0; i < this->test_iter_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + Int32Size(this->test_iter(i)); + } + total_size += 1 * this->test_iter_size() + data_size; + } + + // repeated int32 stepvalue = 34; + { + int data_size = 0; + for (int i = 0; i < this->stepvalue_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + Int32Size(this->stepvalue(i)); + } + total_size += 2 * this->stepvalue_size() + data_size; + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void SolverParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void SolverParameter::MergeFrom(const SolverParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.SolverParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + test_net_.MergeFrom(from.test_net_); + test_net_param_.MergeFrom(from.test_net_param_); + test_state_.MergeFrom(from.test_state_); + test_iter_.MergeFrom(from.test_iter_); + stepvalue_.MergeFrom(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()->::ditcaffe::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()->::ditcaffe::NetParameter::MergeFrom(from.train_net_param()); + } + if (from.has_train_state()) { + mutable_train_state()->::ditcaffe::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.unknown_fields().empty()) { + mutable_unknown_fields()->append(from.unknown_fields()); + } +} + +void SolverParameter::CopyFrom(const SolverParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.SolverParameter) + if (&from == this) return; + Clear(); + MergeFrom(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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); +} + +::std::string SolverParameter::GetTypeName() const { + return "ditcaffe.SolverParameter"; +} + +#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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.net) +} + ::std::string* SolverParameter::mutable_net() { + set_has_net(); + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.net) + return net_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* SolverParameter::release_net() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.SolverParameter.net) +} + +// optional .ditcaffe.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_->::ditcaffe::NetParameter::Clear(); + clear_has_net_param(); +} +const ::ditcaffe::NetParameter& SolverParameter::net_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverParameter.net_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return net_param_ != NULL ? *net_param_ : *default_instance().net_param_; +#else + return net_param_ != NULL ? *net_param_ : *default_instance_->net_param_; +#endif +} +::ditcaffe::NetParameter* SolverParameter::mutable_net_param() { + set_has_net_param(); + if (net_param_ == NULL) { + net_param_ = new ::ditcaffe::NetParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.net_param) + return net_param_; +} +::ditcaffe::NetParameter* SolverParameter::release_net_param() { + // @@protoc_insertion_point(field_release:ditcaffe.SolverParameter.net_param) + clear_has_net_param(); + ::ditcaffe::NetParameter* temp = net_param_; + net_param_ = NULL; + return temp; +} +void SolverParameter::set_allocated_net_param(::ditcaffe::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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.train_net) +} + ::std::string* SolverParameter::mutable_train_net() { + set_has_train_net(); + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.train_net) + return train_net_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* SolverParameter::release_train_net() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.test_net) + return test_net_.Get(index); +} + ::std::string* SolverParameter::mutable_test_net(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.test_net) + return test_net_.Mutable(index); +} + void SolverParameter::set_test_net(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.test_net) +} + ::std::string* SolverParameter::add_test_net() { + // @@protoc_insertion_point(field_add_mutable:ditcaffe.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:ditcaffe.SolverParameter.test_net) +} + void SolverParameter::add_test_net(const char* value) { + test_net_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:ditcaffe.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:ditcaffe.SolverParameter.test_net) +} + const ::google::protobuf::RepeatedPtrField< ::std::string>& +SolverParameter::test_net() const { + // @@protoc_insertion_point(field_list:ditcaffe.SolverParameter.test_net) + return test_net_; +} + ::google::protobuf::RepeatedPtrField< ::std::string>* +SolverParameter::mutable_test_net() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.SolverParameter.test_net) + return &test_net_; +} + +// optional .ditcaffe.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_->::ditcaffe::NetParameter::Clear(); + clear_has_train_net_param(); +} +const ::ditcaffe::NetParameter& SolverParameter::train_net_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverParameter.train_net_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return train_net_param_ != NULL ? *train_net_param_ : *default_instance().train_net_param_; +#else + return train_net_param_ != NULL ? *train_net_param_ : *default_instance_->train_net_param_; +#endif +} +::ditcaffe::NetParameter* SolverParameter::mutable_train_net_param() { + set_has_train_net_param(); + if (train_net_param_ == NULL) { + train_net_param_ = new ::ditcaffe::NetParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.train_net_param) + return train_net_param_; +} +::ditcaffe::NetParameter* SolverParameter::release_train_net_param() { + // @@protoc_insertion_point(field_release:ditcaffe.SolverParameter.train_net_param) + clear_has_train_net_param(); + ::ditcaffe::NetParameter* temp = train_net_param_; + train_net_param_ = NULL; + return temp; +} +void SolverParameter::set_allocated_train_net_param(::ditcaffe::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:ditcaffe.SolverParameter.train_net_param) +} + +// repeated .ditcaffe.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 ::ditcaffe::NetParameter& SolverParameter::test_net_param(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverParameter.test_net_param) + return test_net_param_.Get(index); +} +::ditcaffe::NetParameter* SolverParameter::mutable_test_net_param(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.test_net_param) + return test_net_param_.Mutable(index); +} +::ditcaffe::NetParameter* SolverParameter::add_test_net_param() { + // @@protoc_insertion_point(field_add:ditcaffe.SolverParameter.test_net_param) + return test_net_param_.Add(); +} +::google::protobuf::RepeatedPtrField< ::ditcaffe::NetParameter >* +SolverParameter::mutable_test_net_param() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.SolverParameter.test_net_param) + return &test_net_param_; +} +const ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetParameter >& +SolverParameter::test_net_param() const { + // @@protoc_insertion_point(field_list:ditcaffe.SolverParameter.test_net_param) + return test_net_param_; +} + +// optional .ditcaffe.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_->::ditcaffe::NetState::Clear(); + clear_has_train_state(); +} +const ::ditcaffe::NetState& SolverParameter::train_state() const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverParameter.train_state) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return train_state_ != NULL ? *train_state_ : *default_instance().train_state_; +#else + return train_state_ != NULL ? *train_state_ : *default_instance_->train_state_; +#endif +} +::ditcaffe::NetState* SolverParameter::mutable_train_state() { + set_has_train_state(); + if (train_state_ == NULL) { + train_state_ = new ::ditcaffe::NetState; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.train_state) + return train_state_; +} +::ditcaffe::NetState* SolverParameter::release_train_state() { + // @@protoc_insertion_point(field_release:ditcaffe.SolverParameter.train_state) + clear_has_train_state(); + ::ditcaffe::NetState* temp = train_state_; + train_state_ = NULL; + return temp; +} +void SolverParameter::set_allocated_train_state(::ditcaffe::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:ditcaffe.SolverParameter.train_state) +} + +// repeated .ditcaffe.NetState test_state = 27; +int SolverParameter::test_state_size() const { + return test_state_.size(); +} +void SolverParameter::clear_test_state() { + test_state_.Clear(); +} +const ::ditcaffe::NetState& SolverParameter::test_state(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverParameter.test_state) + return test_state_.Get(index); +} +::ditcaffe::NetState* SolverParameter::mutable_test_state(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.test_state) + return test_state_.Mutable(index); +} +::ditcaffe::NetState* SolverParameter::add_test_state() { + // @@protoc_insertion_point(field_add:ditcaffe.SolverParameter.test_state) + return test_state_.Add(); +} +::google::protobuf::RepeatedPtrField< ::ditcaffe::NetState >* +SolverParameter::mutable_test_state() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.SolverParameter.test_state) + return &test_state_; +} +const ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetState >& +SolverParameter::test_state() const { + // @@protoc_insertion_point(field_list:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.test_iter) +} + void SolverParameter::add_test_iter(::google::protobuf::int32 value) { + test_iter_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.SolverParameter.test_iter) +} + const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +SolverParameter::test_iter() const { + // @@protoc_insertion_point(field_list:ditcaffe.SolverParameter.test_iter) + return test_iter_; +} + ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +SolverParameter::mutable_test_iter() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.display) + return display_; +} + void SolverParameter::set_display(::google::protobuf::int32 value) { + set_has_display(); + display_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.lr_policy) +} + ::std::string* SolverParameter::mutable_lr_policy() { + set_has_lr_policy(); + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.lr_policy) + return lr_policy_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* SolverParameter::release_lr_policy() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.gamma) + return gamma_; +} + void SolverParameter::set_gamma(float value) { + set_has_gamma(); + gamma_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.SolverParameter.power) + return power_; +} + void SolverParameter::set_power(float value) { + set_has_power(); + power_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.SolverParameter.momentum) + return momentum_; +} + void SolverParameter::set_momentum(float value) { + set_has_momentum(); + momentum_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.regularization_type) +} + ::std::string* SolverParameter::mutable_regularization_type() { + set_has_regularization_type(); + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.regularization_type) + return regularization_type_.MutableNoArena(_default_regularization_type_); +} + ::std::string* SolverParameter::release_regularization_type() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.stepsize) + return stepsize_; +} + void SolverParameter::set_stepsize(::google::protobuf::int32 value) { + set_has_stepsize(); + stepsize_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.stepvalue) +} + void SolverParameter::add_stepvalue(::google::protobuf::int32 value) { + stepvalue_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.SolverParameter.stepvalue) +} + const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +SolverParameter::stepvalue() const { + // @@protoc_insertion_point(field_list:ditcaffe.SolverParameter.stepvalue) + return stepvalue_; +} + ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +SolverParameter::mutable_stepvalue() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.snapshot) + return snapshot_; +} + void SolverParameter::set_snapshot(::google::protobuf::int32 value) { + set_has_snapshot(); + snapshot_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.snapshot_prefix) +} + ::std::string* SolverParameter::mutable_snapshot_prefix() { + set_has_snapshot_prefix(); + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.snapshot_prefix) + return snapshot_prefix_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* SolverParameter::release_snapshot_prefix() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.snapshot_diff) +} + +// optional .ditcaffe.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(); +} + ::ditcaffe::SolverParameter_SnapshotFormat SolverParameter::snapshot_format() const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverParameter.snapshot_format) + return static_cast< ::ditcaffe::SolverParameter_SnapshotFormat >(snapshot_format_); +} + void SolverParameter::set_snapshot_format(::ditcaffe::SolverParameter_SnapshotFormat value) { + assert(::ditcaffe::SolverParameter_SnapshotFormat_IsValid(value)); + set_has_snapshot_format(); + snapshot_format_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.SolverParameter.snapshot_format) +} + +// optional .ditcaffe.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(); +} + ::ditcaffe::SolverParameter_SolverMode SolverParameter::solver_mode() const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverParameter.solver_mode) + return static_cast< ::ditcaffe::SolverParameter_SolverMode >(solver_mode_); +} + void SolverParameter::set_solver_mode(::ditcaffe::SolverParameter_SolverMode value) { + assert(::ditcaffe::SolverParameter_SolverMode_IsValid(value)); + set_has_solver_mode(); + solver_mode_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.type) +} + ::std::string* SolverParameter::mutable_type() { + set_has_type(); + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.type) + return type_.MutableNoArena(_default_type_); +} + ::std::string* SolverParameter::release_type() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.delta) + return delta_; +} + void SolverParameter::set_delta(float value) { + set_has_delta(); + delta_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.SolverParameter.momentum2) + return momentum2_; +} + void SolverParameter::set_momentum2(float value) { + set_has_momentum2(); + momentum2_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.SolverParameter.momentum2) +} + +// optional float rms_decay = 38; +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; + clear_has_rms_decay(); +} + float SolverParameter::rms_decay() const { + // @@protoc_insertion_point(field_get:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.snapshot_after_train) +} + +// optional .ditcaffe.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(); +} + ::ditcaffe::SolverParameter_SolverType SolverParameter::solver_type() const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverParameter.solver_type) + return static_cast< ::ditcaffe::SolverParameter_SolverType >(solver_type_); +} + void SolverParameter::set_solver_type(::ditcaffe::SolverParameter_SolverType value) { + assert(::ditcaffe::SolverParameter_SolverType_IsValid(value)); + set_has_solver_type(); + solver_type_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.SolverParameter.solver_type) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +static ::std::string* MutableUnknownFieldsForSolverState( + SolverState* ptr) { + return ptr->mutable_unknown_fields(); +} + +#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::MessageLite(), _arena_ptr_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.SolverState) +} + +void SolverState::InitAsDefaultInstance() { +} + +SolverState::SolverState(const SolverState& from) + : ::google::protobuf::MessageLite(), + _arena_ptr_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.SolverState) +} + +void SolverState::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + _unknown_fields_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + iter_ = 0; + learned_net_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + current_step_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +SolverState::~SolverState() { + // @@protoc_insertion_point(destructor:ditcaffe.SolverState) + SharedDtor(); +} + +void SolverState::SharedDtor() { + _unknown_fields_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + learned_net_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void SolverState::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const SolverState& SolverState::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +SolverState* SolverState::default_instance_ = NULL; + +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:ditcaffe.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(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + _unknown_fields_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +bool SolverState::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::internal::NewPermanentCallback( + &MutableUnknownFieldsForSolverState, this)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &iter_))); + set_has_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())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_history; + break; + } + + // repeated .ditcaffe.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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, ¤t_step_))); + set_has_current_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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.SolverState) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.SolverState) + return false; +#undef DO_ +} + +void SolverState::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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::WireFormatLite::WriteStringMaybeAliased( + 2, this->learned_net(), output); + } + + // repeated .ditcaffe.BlobProto history = 3; + for (unsigned int i = 0, n = this->history_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 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); + } + + output->WriteRaw(unknown_fields().data(), + static_cast(unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:ditcaffe.SolverState) +} + +int SolverState::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.SolverState) + int 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 .ditcaffe.BlobProto history = 3; + total_size += 1 * this->history_size(); + for (int i = 0; i < this->history_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->history(i)); + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void SolverState::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void SolverState::MergeFrom(const SolverState& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.SolverState) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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.unknown_fields().empty()) { + mutable_unknown_fields()->append(from.unknown_fields()); + } +} + +void SolverState::CopyFrom(const SolverState& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.SolverState) + if (&from == this) return; + Clear(); + MergeFrom(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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); +} + +::std::string SolverState::GetTypeName() const { + return "ditcaffe.SolverState"; +} + +#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:ditcaffe.SolverState.iter) + return iter_; +} + void SolverState::set_iter(::google::protobuf::int32 value) { + set_has_iter(); + iter_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.SolverState.learned_net) +} + ::std::string* SolverState::mutable_learned_net() { + set_has_learned_net(); + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverState.learned_net) + return learned_net_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* SolverState::release_learned_net() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.SolverState.learned_net) +} + +// repeated .ditcaffe.BlobProto history = 3; +int SolverState::history_size() const { + return history_.size(); +} +void SolverState::clear_history() { + history_.Clear(); +} +const ::ditcaffe::BlobProto& SolverState::history(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverState.history) + return history_.Get(index); +} +::ditcaffe::BlobProto* SolverState::mutable_history(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverState.history) + return history_.Mutable(index); +} +::ditcaffe::BlobProto* SolverState::add_history() { + // @@protoc_insertion_point(field_add:ditcaffe.SolverState.history) + return history_.Add(); +} +::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >* +SolverState::mutable_history() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.SolverState.history) + return &history_; +} +const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >& +SolverState::history() const { + // @@protoc_insertion_point(field_list:ditcaffe.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:ditcaffe.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:ditcaffe.SolverState.current_step) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +static ::std::string* MutableUnknownFieldsForNetState( + NetState* ptr) { + return ptr->mutable_unknown_fields(); +} + +#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::MessageLite(), _arena_ptr_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.NetState) +} + +void NetState::InitAsDefaultInstance() { +} + +NetState::NetState(const NetState& from) + : ::google::protobuf::MessageLite(), + _arena_ptr_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.NetState) +} + +void NetState::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + _unknown_fields_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + phase_ = 1; + level_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +NetState::~NetState() { + // @@protoc_insertion_point(destructor:ditcaffe.NetState) + SharedDtor(); +} + +void NetState::SharedDtor() { + _unknown_fields_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void NetState::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const NetState& NetState::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +NetState* NetState::default_instance_ = NULL; + +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:ditcaffe.NetState) + if (_has_bits_[0 / 32] & 3u) { + phase_ = 1; + level_ = 0; + } + stage_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + _unknown_fields_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +bool NetState::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::internal::NewPermanentCallback( + &MutableUnknownFieldsForNetState, this)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:ditcaffe.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 .ditcaffe.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 (::ditcaffe::Phase_IsValid(value)) { + set_phase(static_cast< ::ditcaffe::Phase >(value)); + } else { + unknown_fields_stream.WriteVarint32(8); + unknown_fields_stream.WriteVarint32(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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &level_))); + set_has_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())); + } 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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.NetState) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.NetState) + return false; +#undef DO_ +} + +void NetState::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.NetState) + // optional .ditcaffe.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::WireFormatLite::WriteString( + 3, this->stage(i), output); + } + + output->WriteRaw(unknown_fields().data(), + static_cast(unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:ditcaffe.NetState) +} + +int NetState::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.NetState) + int total_size = 0; + + if (_has_bits_[0 / 32] & 3u) { + // optional .ditcaffe.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 * this->stage_size(); + for (int i = 0; i < this->stage_size(); i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->stage(i)); + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void NetState::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void NetState::MergeFrom(const NetState& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.NetState) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + stage_.MergeFrom(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.unknown_fields().empty()) { + mutable_unknown_fields()->append(from.unknown_fields()); + } +} + +void NetState::CopyFrom(const NetState& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.NetState) + if (&from == this) return; + Clear(); + MergeFrom(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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); +} + +::std::string NetState::GetTypeName() const { + return "ditcaffe.NetState"; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// NetState + +// optional .ditcaffe.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(); +} + ::ditcaffe::Phase NetState::phase() const { + // @@protoc_insertion_point(field_get:ditcaffe.NetState.phase) + return static_cast< ::ditcaffe::Phase >(phase_); +} + void NetState::set_phase(::ditcaffe::Phase value) { + assert(::ditcaffe::Phase_IsValid(value)); + set_has_phase(); + phase_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.NetState.level) + return level_; +} + void NetState::set_level(::google::protobuf::int32 value) { + set_has_level(); + level_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.NetState.stage) + return stage_.Get(index); +} + ::std::string* NetState::mutable_stage(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.NetState.stage) + return stage_.Mutable(index); +} + void NetState::set_stage(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.NetState.stage) +} + ::std::string* NetState::add_stage() { + // @@protoc_insertion_point(field_add_mutable:ditcaffe.NetState.stage) + return stage_.Add(); +} + void NetState::add_stage(const ::std::string& value) { + stage_.Add()->assign(value); + // @@protoc_insertion_point(field_add:ditcaffe.NetState.stage) +} + void NetState::add_stage(const char* value) { + stage_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:ditcaffe.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:ditcaffe.NetState.stage) +} + const ::google::protobuf::RepeatedPtrField< ::std::string>& +NetState::stage() const { + // @@protoc_insertion_point(field_list:ditcaffe.NetState.stage) + return stage_; +} + ::google::protobuf::RepeatedPtrField< ::std::string>* +NetState::mutable_stage() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.NetState.stage) + return &stage_; +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +static ::std::string* MutableUnknownFieldsForNetStateRule( + NetStateRule* ptr) { + return ptr->mutable_unknown_fields(); +} + +#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::MessageLite(), _arena_ptr_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.NetStateRule) +} + +void NetStateRule::InitAsDefaultInstance() { +} + +NetStateRule::NetStateRule(const NetStateRule& from) + : ::google::protobuf::MessageLite(), + _arena_ptr_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.NetStateRule) +} + +void NetStateRule::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + _unknown_fields_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + phase_ = 0; + min_level_ = 0; + max_level_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +NetStateRule::~NetStateRule() { + // @@protoc_insertion_point(destructor:ditcaffe.NetStateRule) + SharedDtor(); +} + +void NetStateRule::SharedDtor() { + _unknown_fields_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void NetStateRule::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const NetStateRule& NetStateRule::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +NetStateRule* NetStateRule::default_instance_ = NULL; + +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:ditcaffe.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) + + if (_has_bits_[0 / 32] & 7u) { + ZR_(phase_, min_level_); + max_level_ = 0; + } + +#undef ZR_HELPER_ +#undef ZR_ + + stage_.Clear(); + not_stage_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + _unknown_fields_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +bool NetStateRule::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::internal::NewPermanentCallback( + &MutableUnknownFieldsForNetStateRule, this)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:ditcaffe.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 .ditcaffe.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 (::ditcaffe::Phase_IsValid(value)) { + set_phase(static_cast< ::ditcaffe::Phase >(value)); + } else { + unknown_fields_stream.WriteVarint32(8); + unknown_fields_stream.WriteVarint32(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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &min_level_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &max_level_))); + set_has_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())); + } 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())); + } 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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.NetStateRule) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.NetStateRule) + return false; +#undef DO_ +} + +void NetStateRule::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.NetStateRule) + // optional .ditcaffe.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::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::WireFormatLite::WriteString( + 5, this->not_stage(i), output); + } + + output->WriteRaw(unknown_fields().data(), + static_cast(unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:ditcaffe.NetStateRule) +} + +int NetStateRule::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.NetStateRule) + int total_size = 0; + + if (_has_bits_[0 / 32] & 7u) { + // optional .ditcaffe.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 * 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 * 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)); + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void NetStateRule::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void NetStateRule::MergeFrom(const NetStateRule& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.NetStateRule) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + stage_.MergeFrom(from.stage_); + not_stage_.MergeFrom(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.unknown_fields().empty()) { + mutable_unknown_fields()->append(from.unknown_fields()); + } +} + +void NetStateRule::CopyFrom(const NetStateRule& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.NetStateRule) + if (&from == this) return; + Clear(); + MergeFrom(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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); +} + +::std::string NetStateRule::GetTypeName() const { + return "ditcaffe.NetStateRule"; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// NetStateRule + +// optional .ditcaffe.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(); +} + ::ditcaffe::Phase NetStateRule::phase() const { + // @@protoc_insertion_point(field_get:ditcaffe.NetStateRule.phase) + return static_cast< ::ditcaffe::Phase >(phase_); +} + void NetStateRule::set_phase(::ditcaffe::Phase value) { + assert(::ditcaffe::Phase_IsValid(value)); + set_has_phase(); + phase_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.NetStateRule.stage) + return stage_.Get(index); +} + ::std::string* NetStateRule::mutable_stage(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.NetStateRule.stage) + return stage_.Mutable(index); +} + void NetStateRule::set_stage(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.NetStateRule.stage) +} + ::std::string* NetStateRule::add_stage() { + // @@protoc_insertion_point(field_add_mutable:ditcaffe.NetStateRule.stage) + return stage_.Add(); +} + void NetStateRule::add_stage(const ::std::string& value) { + stage_.Add()->assign(value); + // @@protoc_insertion_point(field_add:ditcaffe.NetStateRule.stage) +} + void NetStateRule::add_stage(const char* value) { + stage_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:ditcaffe.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:ditcaffe.NetStateRule.stage) +} + const ::google::protobuf::RepeatedPtrField< ::std::string>& +NetStateRule::stage() const { + // @@protoc_insertion_point(field_list:ditcaffe.NetStateRule.stage) + return stage_; +} + ::google::protobuf::RepeatedPtrField< ::std::string>* +NetStateRule::mutable_stage() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.NetStateRule.not_stage) + return not_stage_.Get(index); +} + ::std::string* NetStateRule::mutable_not_stage(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.NetStateRule.not_stage) + return not_stage_.Mutable(index); +} + void NetStateRule::set_not_stage(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.NetStateRule.not_stage) +} + ::std::string* NetStateRule::add_not_stage() { + // @@protoc_insertion_point(field_add_mutable:ditcaffe.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:ditcaffe.NetStateRule.not_stage) +} + void NetStateRule::add_not_stage(const char* value) { + not_stage_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:ditcaffe.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:ditcaffe.NetStateRule.not_stage) +} + const ::google::protobuf::RepeatedPtrField< ::std::string>& +NetStateRule::not_stage() const { + // @@protoc_insertion_point(field_list:ditcaffe.NetStateRule.not_stage) + return not_stage_; +} + ::google::protobuf::RepeatedPtrField< ::std::string>* +NetStateRule::mutable_not_stage() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.NetStateRule.not_stage) + return ¬_stage_; +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +static ::std::string* MutableUnknownFieldsForParamSpec( + ParamSpec* ptr) { + return ptr->mutable_unknown_fields(); +} + +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::MessageLite(), _arena_ptr_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.ParamSpec) +} + +void ParamSpec::InitAsDefaultInstance() { +} + +ParamSpec::ParamSpec(const ParamSpec& from) + : ::google::protobuf::MessageLite(), + _arena_ptr_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.ParamSpec) +} + +void ParamSpec::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + _unknown_fields_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + share_mode_ = 0; + lr_mult_ = 1; + decay_mult_ = 1; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ParamSpec::~ParamSpec() { + // @@protoc_insertion_point(destructor:ditcaffe.ParamSpec) + SharedDtor(); +} + +void ParamSpec::SharedDtor() { + _unknown_fields_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void ParamSpec::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ParamSpec& ParamSpec::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +ParamSpec* ParamSpec::default_instance_ = NULL; + +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:ditcaffe.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; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + _unknown_fields_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +bool ParamSpec::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::internal::NewPermanentCallback( + &MutableUnknownFieldsForParamSpec, this)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:ditcaffe.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())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_share_mode; + break; + } + + // optional .ditcaffe.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 (::ditcaffe::ParamSpec_DimCheckMode_IsValid(value)) { + set_share_mode(static_cast< ::ditcaffe::ParamSpec_DimCheckMode >(value)); + } else { + unknown_fields_stream.WriteVarint32(16); + unknown_fields_stream.WriteVarint32(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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &lr_mult_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &decay_mult_))); + set_has_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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.ParamSpec) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.ParamSpec) + return false; +#undef DO_ +} + +void ParamSpec::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.ParamSpec) + // optional string name = 1; + if (has_name()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // optional .ditcaffe.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); + } + + output->WriteRaw(unknown_fields().data(), + static_cast(unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:ditcaffe.ParamSpec) +} + +int ParamSpec::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.ParamSpec) + int 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 .ditcaffe.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; + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ParamSpec::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void ParamSpec::MergeFrom(const ParamSpec& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.ParamSpec) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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.unknown_fields().empty()) { + mutable_unknown_fields()->append(from.unknown_fields()); + } +} + +void ParamSpec::CopyFrom(const ParamSpec& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.ParamSpec) + if (&from == this) return; + Clear(); + MergeFrom(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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); +} + +::std::string ParamSpec::GetTypeName() const { + return "ditcaffe.ParamSpec"; +} + +#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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.ParamSpec.name) +} + ::std::string* ParamSpec::mutable_name() { + set_has_name(); + // @@protoc_insertion_point(field_mutable:ditcaffe.ParamSpec.name) + return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* ParamSpec::release_name() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.ParamSpec.name) +} + +// optional .ditcaffe.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(); +} + ::ditcaffe::ParamSpec_DimCheckMode ParamSpec::share_mode() const { + // @@protoc_insertion_point(field_get:ditcaffe.ParamSpec.share_mode) + return static_cast< ::ditcaffe::ParamSpec_DimCheckMode >(share_mode_); +} + void ParamSpec::set_share_mode(::ditcaffe::ParamSpec_DimCheckMode value) { + assert(::ditcaffe::ParamSpec_DimCheckMode_IsValid(value)); + set_has_share_mode(); + share_mode_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.ParamSpec.decay_mult) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +static ::std::string* MutableUnknownFieldsForLayerParameter( + LayerParameter* ptr) { + return ptr->mutable_unknown_fields(); +} + +#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::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::kParameterParamFieldNumber; +const int LayerParameter::kPoolingParamFieldNumber; +const int LayerParameter::kPowerParamFieldNumber; +const int LayerParameter::kPreluParamFieldNumber; +const int LayerParameter::kPythonParamFieldNumber; +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::MessageLite(), _arena_ptr_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.LayerParameter) +} + +void LayerParameter::InitAsDefaultInstance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + transform_param_ = const_cast< ::ditcaffe::TransformationParameter*>( + ::ditcaffe::TransformationParameter::internal_default_instance()); +#else + transform_param_ = const_cast< ::ditcaffe::TransformationParameter*>(&::ditcaffe::TransformationParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + loss_param_ = const_cast< ::ditcaffe::LossParameter*>( + ::ditcaffe::LossParameter::internal_default_instance()); +#else + loss_param_ = const_cast< ::ditcaffe::LossParameter*>(&::ditcaffe::LossParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + accuracy_param_ = const_cast< ::ditcaffe::AccuracyParameter*>( + ::ditcaffe::AccuracyParameter::internal_default_instance()); +#else + accuracy_param_ = const_cast< ::ditcaffe::AccuracyParameter*>(&::ditcaffe::AccuracyParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + argmax_param_ = const_cast< ::ditcaffe::ArgMaxParameter*>( + ::ditcaffe::ArgMaxParameter::internal_default_instance()); +#else + argmax_param_ = const_cast< ::ditcaffe::ArgMaxParameter*>(&::ditcaffe::ArgMaxParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + batch_norm_param_ = const_cast< ::ditcaffe::BatchNormParameter*>( + ::ditcaffe::BatchNormParameter::internal_default_instance()); +#else + batch_norm_param_ = const_cast< ::ditcaffe::BatchNormParameter*>(&::ditcaffe::BatchNormParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + bias_param_ = const_cast< ::ditcaffe::BiasParameter*>( + ::ditcaffe::BiasParameter::internal_default_instance()); +#else + bias_param_ = const_cast< ::ditcaffe::BiasParameter*>(&::ditcaffe::BiasParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + concat_param_ = const_cast< ::ditcaffe::ConcatParameter*>( + ::ditcaffe::ConcatParameter::internal_default_instance()); +#else + concat_param_ = const_cast< ::ditcaffe::ConcatParameter*>(&::ditcaffe::ConcatParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + contrastive_loss_param_ = const_cast< ::ditcaffe::ContrastiveLossParameter*>( + ::ditcaffe::ContrastiveLossParameter::internal_default_instance()); +#else + contrastive_loss_param_ = const_cast< ::ditcaffe::ContrastiveLossParameter*>(&::ditcaffe::ContrastiveLossParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + convolution_param_ = const_cast< ::ditcaffe::ConvolutionParameter*>( + ::ditcaffe::ConvolutionParameter::internal_default_instance()); +#else + convolution_param_ = const_cast< ::ditcaffe::ConvolutionParameter*>(&::ditcaffe::ConvolutionParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + crop_param_ = const_cast< ::ditcaffe::CropParameter*>( + ::ditcaffe::CropParameter::internal_default_instance()); +#else + crop_param_ = const_cast< ::ditcaffe::CropParameter*>(&::ditcaffe::CropParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + data_param_ = const_cast< ::ditcaffe::DataParameter*>( + ::ditcaffe::DataParameter::internal_default_instance()); +#else + data_param_ = const_cast< ::ditcaffe::DataParameter*>(&::ditcaffe::DataParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + dropout_param_ = const_cast< ::ditcaffe::DropoutParameter*>( + ::ditcaffe::DropoutParameter::internal_default_instance()); +#else + dropout_param_ = const_cast< ::ditcaffe::DropoutParameter*>(&::ditcaffe::DropoutParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + dummy_data_param_ = const_cast< ::ditcaffe::DummyDataParameter*>( + ::ditcaffe::DummyDataParameter::internal_default_instance()); +#else + dummy_data_param_ = const_cast< ::ditcaffe::DummyDataParameter*>(&::ditcaffe::DummyDataParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + eltwise_param_ = const_cast< ::ditcaffe::EltwiseParameter*>( + ::ditcaffe::EltwiseParameter::internal_default_instance()); +#else + eltwise_param_ = const_cast< ::ditcaffe::EltwiseParameter*>(&::ditcaffe::EltwiseParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + elu_param_ = const_cast< ::ditcaffe::ELUParameter*>( + ::ditcaffe::ELUParameter::internal_default_instance()); +#else + elu_param_ = const_cast< ::ditcaffe::ELUParameter*>(&::ditcaffe::ELUParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + embed_param_ = const_cast< ::ditcaffe::EmbedParameter*>( + ::ditcaffe::EmbedParameter::internal_default_instance()); +#else + embed_param_ = const_cast< ::ditcaffe::EmbedParameter*>(&::ditcaffe::EmbedParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + exp_param_ = const_cast< ::ditcaffe::ExpParameter*>( + ::ditcaffe::ExpParameter::internal_default_instance()); +#else + exp_param_ = const_cast< ::ditcaffe::ExpParameter*>(&::ditcaffe::ExpParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + flatten_param_ = const_cast< ::ditcaffe::FlattenParameter*>( + ::ditcaffe::FlattenParameter::internal_default_instance()); +#else + flatten_param_ = const_cast< ::ditcaffe::FlattenParameter*>(&::ditcaffe::FlattenParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + hdf5_data_param_ = const_cast< ::ditcaffe::HDF5DataParameter*>( + ::ditcaffe::HDF5DataParameter::internal_default_instance()); +#else + hdf5_data_param_ = const_cast< ::ditcaffe::HDF5DataParameter*>(&::ditcaffe::HDF5DataParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + hdf5_output_param_ = const_cast< ::ditcaffe::HDF5OutputParameter*>( + ::ditcaffe::HDF5OutputParameter::internal_default_instance()); +#else + hdf5_output_param_ = const_cast< ::ditcaffe::HDF5OutputParameter*>(&::ditcaffe::HDF5OutputParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + hinge_loss_param_ = const_cast< ::ditcaffe::HingeLossParameter*>( + ::ditcaffe::HingeLossParameter::internal_default_instance()); +#else + hinge_loss_param_ = const_cast< ::ditcaffe::HingeLossParameter*>(&::ditcaffe::HingeLossParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + image_data_param_ = const_cast< ::ditcaffe::ImageDataParameter*>( + ::ditcaffe::ImageDataParameter::internal_default_instance()); +#else + image_data_param_ = const_cast< ::ditcaffe::ImageDataParameter*>(&::ditcaffe::ImageDataParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + infogain_loss_param_ = const_cast< ::ditcaffe::InfogainLossParameter*>( + ::ditcaffe::InfogainLossParameter::internal_default_instance()); +#else + infogain_loss_param_ = const_cast< ::ditcaffe::InfogainLossParameter*>(&::ditcaffe::InfogainLossParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + inner_product_param_ = const_cast< ::ditcaffe::InnerProductParameter*>( + ::ditcaffe::InnerProductParameter::internal_default_instance()); +#else + inner_product_param_ = const_cast< ::ditcaffe::InnerProductParameter*>(&::ditcaffe::InnerProductParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + input_param_ = const_cast< ::ditcaffe::InputParameter*>( + ::ditcaffe::InputParameter::internal_default_instance()); +#else + input_param_ = const_cast< ::ditcaffe::InputParameter*>(&::ditcaffe::InputParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + log_param_ = const_cast< ::ditcaffe::LogParameter*>( + ::ditcaffe::LogParameter::internal_default_instance()); +#else + log_param_ = const_cast< ::ditcaffe::LogParameter*>(&::ditcaffe::LogParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + lrn_param_ = const_cast< ::ditcaffe::LRNParameter*>( + ::ditcaffe::LRNParameter::internal_default_instance()); +#else + lrn_param_ = const_cast< ::ditcaffe::LRNParameter*>(&::ditcaffe::LRNParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + memory_data_param_ = const_cast< ::ditcaffe::MemoryDataParameter*>( + ::ditcaffe::MemoryDataParameter::internal_default_instance()); +#else + memory_data_param_ = const_cast< ::ditcaffe::MemoryDataParameter*>(&::ditcaffe::MemoryDataParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + mvn_param_ = const_cast< ::ditcaffe::MVNParameter*>( + ::ditcaffe::MVNParameter::internal_default_instance()); +#else + mvn_param_ = const_cast< ::ditcaffe::MVNParameter*>(&::ditcaffe::MVNParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + parameter_param_ = const_cast< ::ditcaffe::ParameterParameter*>( + ::ditcaffe::ParameterParameter::internal_default_instance()); +#else + parameter_param_ = const_cast< ::ditcaffe::ParameterParameter*>(&::ditcaffe::ParameterParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + pooling_param_ = const_cast< ::ditcaffe::PoolingParameter*>( + ::ditcaffe::PoolingParameter::internal_default_instance()); +#else + pooling_param_ = const_cast< ::ditcaffe::PoolingParameter*>(&::ditcaffe::PoolingParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + power_param_ = const_cast< ::ditcaffe::PowerParameter*>( + ::ditcaffe::PowerParameter::internal_default_instance()); +#else + power_param_ = const_cast< ::ditcaffe::PowerParameter*>(&::ditcaffe::PowerParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + prelu_param_ = const_cast< ::ditcaffe::PReLUParameter*>( + ::ditcaffe::PReLUParameter::internal_default_instance()); +#else + prelu_param_ = const_cast< ::ditcaffe::PReLUParameter*>(&::ditcaffe::PReLUParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + python_param_ = const_cast< ::ditcaffe::PythonParameter*>( + ::ditcaffe::PythonParameter::internal_default_instance()); +#else + python_param_ = const_cast< ::ditcaffe::PythonParameter*>(&::ditcaffe::PythonParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + reduction_param_ = const_cast< ::ditcaffe::ReductionParameter*>( + ::ditcaffe::ReductionParameter::internal_default_instance()); +#else + reduction_param_ = const_cast< ::ditcaffe::ReductionParameter*>(&::ditcaffe::ReductionParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + relu_param_ = const_cast< ::ditcaffe::ReLUParameter*>( + ::ditcaffe::ReLUParameter::internal_default_instance()); +#else + relu_param_ = const_cast< ::ditcaffe::ReLUParameter*>(&::ditcaffe::ReLUParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + reshape_param_ = const_cast< ::ditcaffe::ReshapeParameter*>( + ::ditcaffe::ReshapeParameter::internal_default_instance()); +#else + reshape_param_ = const_cast< ::ditcaffe::ReshapeParameter*>(&::ditcaffe::ReshapeParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + scale_param_ = const_cast< ::ditcaffe::ScaleParameter*>( + ::ditcaffe::ScaleParameter::internal_default_instance()); +#else + scale_param_ = const_cast< ::ditcaffe::ScaleParameter*>(&::ditcaffe::ScaleParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + sigmoid_param_ = const_cast< ::ditcaffe::SigmoidParameter*>( + ::ditcaffe::SigmoidParameter::internal_default_instance()); +#else + sigmoid_param_ = const_cast< ::ditcaffe::SigmoidParameter*>(&::ditcaffe::SigmoidParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + softmax_param_ = const_cast< ::ditcaffe::SoftmaxParameter*>( + ::ditcaffe::SoftmaxParameter::internal_default_instance()); +#else + softmax_param_ = const_cast< ::ditcaffe::SoftmaxParameter*>(&::ditcaffe::SoftmaxParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + spp_param_ = const_cast< ::ditcaffe::SPPParameter*>( + ::ditcaffe::SPPParameter::internal_default_instance()); +#else + spp_param_ = const_cast< ::ditcaffe::SPPParameter*>(&::ditcaffe::SPPParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + slice_param_ = const_cast< ::ditcaffe::SliceParameter*>( + ::ditcaffe::SliceParameter::internal_default_instance()); +#else + slice_param_ = const_cast< ::ditcaffe::SliceParameter*>(&::ditcaffe::SliceParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + tanh_param_ = const_cast< ::ditcaffe::TanHParameter*>( + ::ditcaffe::TanHParameter::internal_default_instance()); +#else + tanh_param_ = const_cast< ::ditcaffe::TanHParameter*>(&::ditcaffe::TanHParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + threshold_param_ = const_cast< ::ditcaffe::ThresholdParameter*>( + ::ditcaffe::ThresholdParameter::internal_default_instance()); +#else + threshold_param_ = const_cast< ::ditcaffe::ThresholdParameter*>(&::ditcaffe::ThresholdParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + tile_param_ = const_cast< ::ditcaffe::TileParameter*>( + ::ditcaffe::TileParameter::internal_default_instance()); +#else + tile_param_ = const_cast< ::ditcaffe::TileParameter*>(&::ditcaffe::TileParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + window_data_param_ = const_cast< ::ditcaffe::WindowDataParameter*>( + ::ditcaffe::WindowDataParameter::internal_default_instance()); +#else + window_data_param_ = const_cast< ::ditcaffe::WindowDataParameter*>(&::ditcaffe::WindowDataParameter::default_instance()); +#endif +} + +LayerParameter::LayerParameter(const LayerParameter& from) + : ::google::protobuf::MessageLite(), + _arena_ptr_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.LayerParameter) +} + +void LayerParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + _unknown_fields_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + type_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + phase_ = 0; + 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; + 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; + parameter_param_ = NULL; + pooling_param_ = NULL; + power_param_ = NULL; + prelu_param_ = NULL; + python_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; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +LayerParameter::~LayerParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.LayerParameter) + SharedDtor(); +} + +void LayerParameter::SharedDtor() { + _unknown_fields_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + type_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + 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 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 parameter_param_; + delete pooling_param_; + delete power_param_; + delete prelu_param_; + delete python_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 LayerParameter& LayerParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +LayerParameter* LayerParameter::default_instance_ = NULL; + +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:ditcaffe.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_->::ditcaffe::TransformationParameter::Clear(); + } + if (has_loss_param()) { + if (loss_param_ != NULL) loss_param_->::ditcaffe::LossParameter::Clear(); + } + if (has_accuracy_param()) { + if (accuracy_param_ != NULL) accuracy_param_->::ditcaffe::AccuracyParameter::Clear(); + } + if (has_argmax_param()) { + if (argmax_param_ != NULL) argmax_param_->::ditcaffe::ArgMaxParameter::Clear(); + } + if (has_batch_norm_param()) { + if (batch_norm_param_ != NULL) batch_norm_param_->::ditcaffe::BatchNormParameter::Clear(); + } + } + if (_has_bits_[16 / 32] & 16711680u) { + if (has_bias_param()) { + if (bias_param_ != NULL) bias_param_->::ditcaffe::BiasParameter::Clear(); + } + if (has_concat_param()) { + if (concat_param_ != NULL) concat_param_->::ditcaffe::ConcatParameter::Clear(); + } + if (has_contrastive_loss_param()) { + if (contrastive_loss_param_ != NULL) contrastive_loss_param_->::ditcaffe::ContrastiveLossParameter::Clear(); + } + if (has_convolution_param()) { + if (convolution_param_ != NULL) convolution_param_->::ditcaffe::ConvolutionParameter::Clear(); + } + if (has_crop_param()) { + if (crop_param_ != NULL) crop_param_->::ditcaffe::CropParameter::Clear(); + } + if (has_data_param()) { + if (data_param_ != NULL) data_param_->::ditcaffe::DataParameter::Clear(); + } + if (has_dropout_param()) { + if (dropout_param_ != NULL) dropout_param_->::ditcaffe::DropoutParameter::Clear(); + } + if (has_dummy_data_param()) { + if (dummy_data_param_ != NULL) dummy_data_param_->::ditcaffe::DummyDataParameter::Clear(); + } + } + if (_has_bits_[24 / 32] & 4278190080u) { + if (has_eltwise_param()) { + if (eltwise_param_ != NULL) eltwise_param_->::ditcaffe::EltwiseParameter::Clear(); + } + if (has_elu_param()) { + if (elu_param_ != NULL) elu_param_->::ditcaffe::ELUParameter::Clear(); + } + if (has_embed_param()) { + if (embed_param_ != NULL) embed_param_->::ditcaffe::EmbedParameter::Clear(); + } + if (has_exp_param()) { + if (exp_param_ != NULL) exp_param_->::ditcaffe::ExpParameter::Clear(); + } + if (has_flatten_param()) { + if (flatten_param_ != NULL) flatten_param_->::ditcaffe::FlattenParameter::Clear(); + } + if (has_hdf5_data_param()) { + if (hdf5_data_param_ != NULL) hdf5_data_param_->::ditcaffe::HDF5DataParameter::Clear(); + } + if (has_hdf5_output_param()) { + if (hdf5_output_param_ != NULL) hdf5_output_param_->::ditcaffe::HDF5OutputParameter::Clear(); + } + if (has_hinge_loss_param()) { + if (hinge_loss_param_ != NULL) hinge_loss_param_->::ditcaffe::HingeLossParameter::Clear(); + } + } + if (_has_bits_[32 / 32] & 255u) { + if (has_image_data_param()) { + if (image_data_param_ != NULL) image_data_param_->::ditcaffe::ImageDataParameter::Clear(); + } + if (has_infogain_loss_param()) { + if (infogain_loss_param_ != NULL) infogain_loss_param_->::ditcaffe::InfogainLossParameter::Clear(); + } + if (has_inner_product_param()) { + if (inner_product_param_ != NULL) inner_product_param_->::ditcaffe::InnerProductParameter::Clear(); + } + if (has_input_param()) { + if (input_param_ != NULL) input_param_->::ditcaffe::InputParameter::Clear(); + } + if (has_log_param()) { + if (log_param_ != NULL) log_param_->::ditcaffe::LogParameter::Clear(); + } + if (has_lrn_param()) { + if (lrn_param_ != NULL) lrn_param_->::ditcaffe::LRNParameter::Clear(); + } + if (has_memory_data_param()) { + if (memory_data_param_ != NULL) memory_data_param_->::ditcaffe::MemoryDataParameter::Clear(); + } + if (has_mvn_param()) { + if (mvn_param_ != NULL) mvn_param_->::ditcaffe::MVNParameter::Clear(); + } + } + if (_has_bits_[40 / 32] & 65280u) { + if (has_parameter_param()) { + if (parameter_param_ != NULL) parameter_param_->::ditcaffe::ParameterParameter::Clear(); + } + if (has_pooling_param()) { + if (pooling_param_ != NULL) pooling_param_->::ditcaffe::PoolingParameter::Clear(); + } + if (has_power_param()) { + if (power_param_ != NULL) power_param_->::ditcaffe::PowerParameter::Clear(); + } + if (has_prelu_param()) { + if (prelu_param_ != NULL) prelu_param_->::ditcaffe::PReLUParameter::Clear(); + } + if (has_python_param()) { + if (python_param_ != NULL) python_param_->::ditcaffe::PythonParameter::Clear(); + } + if (has_reduction_param()) { + if (reduction_param_ != NULL) reduction_param_->::ditcaffe::ReductionParameter::Clear(); + } + if (has_relu_param()) { + if (relu_param_ != NULL) relu_param_->::ditcaffe::ReLUParameter::Clear(); + } + if (has_reshape_param()) { + if (reshape_param_ != NULL) reshape_param_->::ditcaffe::ReshapeParameter::Clear(); + } + } + if (_has_bits_[48 / 32] & 16711680u) { + if (has_scale_param()) { + if (scale_param_ != NULL) scale_param_->::ditcaffe::ScaleParameter::Clear(); + } + if (has_sigmoid_param()) { + if (sigmoid_param_ != NULL) sigmoid_param_->::ditcaffe::SigmoidParameter::Clear(); + } + if (has_softmax_param()) { + if (softmax_param_ != NULL) softmax_param_->::ditcaffe::SoftmaxParameter::Clear(); + } + if (has_spp_param()) { + if (spp_param_ != NULL) spp_param_->::ditcaffe::SPPParameter::Clear(); + } + if (has_slice_param()) { + if (slice_param_ != NULL) slice_param_->::ditcaffe::SliceParameter::Clear(); + } + if (has_tanh_param()) { + if (tanh_param_ != NULL) tanh_param_->::ditcaffe::TanHParameter::Clear(); + } + if (has_threshold_param()) { + if (threshold_param_ != NULL) threshold_param_->::ditcaffe::ThresholdParameter::Clear(); + } + if (has_tile_param()) { + if (tile_param_ != NULL) tile_param_->::ditcaffe::TileParameter::Clear(); + } + } + if (has_window_data_param()) { + if (window_data_param_ != NULL) window_data_param_->::ditcaffe::WindowDataParameter::Clear(); + } + bottom_.Clear(); + top_.Clear(); + loss_weight_.Clear(); + param_.Clear(); + blobs_.Clear(); + propagate_down_.Clear(); + include_.Clear(); + exclude_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + _unknown_fields_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +bool LayerParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::internal::NewPermanentCallback( + &MutableUnknownFieldsForLayerParameter, this)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:ditcaffe.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())); + } 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())); + } 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())); + } 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())); + } 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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 (::ditcaffe::Phase_IsValid(value)) { + set_phase(static_cast< ::ditcaffe::Phase >(value)); + } else { + unknown_fields_stream.WriteVarint32(80); + unknown_fields_stream.WriteVarint32(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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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->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, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.LayerParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.LayerParameter) + return false; +#undef DO_ +} + +void LayerParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.LayerParameter) + // optional string name = 1; + if (has_name()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // optional string type = 2; + if (has_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::WireFormatLite::WriteString( + 3, this->bottom(i), output); + } + + // repeated string top = 4; + for (int i = 0; i < this->top_size(); i++) { + ::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 .ditcaffe.ParamSpec param = 6; + for (unsigned int i = 0, n = this->param_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 6, this->param(i), output); + } + + // repeated .ditcaffe.BlobProto blobs = 7; + for (unsigned int i = 0, n = this->blobs_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 7, this->blobs(i), output); + } + + // repeated .ditcaffe.NetStateRule include = 8; + for (unsigned int i = 0, n = this->include_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 8, this->include(i), output); + } + + // repeated .ditcaffe.NetStateRule exclude = 9; + for (unsigned int i = 0, n = this->exclude_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 9, this->exclude(i), output); + } + + // optional .ditcaffe.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 .ditcaffe.TransformationParameter transform_param = 100; + if (has_transform_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 100, *this->transform_param_, output); + } + + // optional .ditcaffe.LossParameter loss_param = 101; + if (has_loss_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 101, *this->loss_param_, output); + } + + // optional .ditcaffe.AccuracyParameter accuracy_param = 102; + if (has_accuracy_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 102, *this->accuracy_param_, output); + } + + // optional .ditcaffe.ArgMaxParameter argmax_param = 103; + if (has_argmax_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 103, *this->argmax_param_, output); + } + + // optional .ditcaffe.ConcatParameter concat_param = 104; + if (has_concat_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 104, *this->concat_param_, output); + } + + // optional .ditcaffe.ContrastiveLossParameter contrastive_loss_param = 105; + if (has_contrastive_loss_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 105, *this->contrastive_loss_param_, output); + } + + // optional .ditcaffe.ConvolutionParameter convolution_param = 106; + if (has_convolution_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 106, *this->convolution_param_, output); + } + + // optional .ditcaffe.DataParameter data_param = 107; + if (has_data_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 107, *this->data_param_, output); + } + + // optional .ditcaffe.DropoutParameter dropout_param = 108; + if (has_dropout_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 108, *this->dropout_param_, output); + } + + // optional .ditcaffe.DummyDataParameter dummy_data_param = 109; + if (has_dummy_data_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 109, *this->dummy_data_param_, output); + } + + // optional .ditcaffe.EltwiseParameter eltwise_param = 110; + if (has_eltwise_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 110, *this->eltwise_param_, output); + } + + // optional .ditcaffe.ExpParameter exp_param = 111; + if (has_exp_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 111, *this->exp_param_, output); + } + + // optional .ditcaffe.HDF5DataParameter hdf5_data_param = 112; + if (has_hdf5_data_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 112, *this->hdf5_data_param_, output); + } + + // optional .ditcaffe.HDF5OutputParameter hdf5_output_param = 113; + if (has_hdf5_output_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 113, *this->hdf5_output_param_, output); + } + + // optional .ditcaffe.HingeLossParameter hinge_loss_param = 114; + if (has_hinge_loss_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 114, *this->hinge_loss_param_, output); + } + + // optional .ditcaffe.ImageDataParameter image_data_param = 115; + if (has_image_data_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 115, *this->image_data_param_, output); + } + + // optional .ditcaffe.InfogainLossParameter infogain_loss_param = 116; + if (has_infogain_loss_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 116, *this->infogain_loss_param_, output); + } + + // optional .ditcaffe.InnerProductParameter inner_product_param = 117; + if (has_inner_product_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 117, *this->inner_product_param_, output); + } + + // optional .ditcaffe.LRNParameter lrn_param = 118; + if (has_lrn_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 118, *this->lrn_param_, output); + } + + // optional .ditcaffe.MemoryDataParameter memory_data_param = 119; + if (has_memory_data_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 119, *this->memory_data_param_, output); + } + + // optional .ditcaffe.MVNParameter mvn_param = 120; + if (has_mvn_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 120, *this->mvn_param_, output); + } + + // optional .ditcaffe.PoolingParameter pooling_param = 121; + if (has_pooling_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 121, *this->pooling_param_, output); + } + + // optional .ditcaffe.PowerParameter power_param = 122; + if (has_power_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 122, *this->power_param_, output); + } + + // optional .ditcaffe.ReLUParameter relu_param = 123; + if (has_relu_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 123, *this->relu_param_, output); + } + + // optional .ditcaffe.SigmoidParameter sigmoid_param = 124; + if (has_sigmoid_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 124, *this->sigmoid_param_, output); + } + + // optional .ditcaffe.SoftmaxParameter softmax_param = 125; + if (has_softmax_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 125, *this->softmax_param_, output); + } + + // optional .ditcaffe.SliceParameter slice_param = 126; + if (has_slice_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 126, *this->slice_param_, output); + } + + // optional .ditcaffe.TanHParameter tanh_param = 127; + if (has_tanh_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 127, *this->tanh_param_, output); + } + + // optional .ditcaffe.ThresholdParameter threshold_param = 128; + if (has_threshold_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 128, *this->threshold_param_, output); + } + + // optional .ditcaffe.WindowDataParameter window_data_param = 129; + if (has_window_data_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 129, *this->window_data_param_, output); + } + + // optional .ditcaffe.PythonParameter python_param = 130; + if (has_python_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 130, *this->python_param_, output); + } + + // optional .ditcaffe.PReLUParameter prelu_param = 131; + if (has_prelu_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 131, *this->prelu_param_, output); + } + + // optional .ditcaffe.SPPParameter spp_param = 132; + if (has_spp_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 132, *this->spp_param_, output); + } + + // optional .ditcaffe.ReshapeParameter reshape_param = 133; + if (has_reshape_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 133, *this->reshape_param_, output); + } + + // optional .ditcaffe.LogParameter log_param = 134; + if (has_log_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 134, *this->log_param_, output); + } + + // optional .ditcaffe.FlattenParameter flatten_param = 135; + if (has_flatten_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 135, *this->flatten_param_, output); + } + + // optional .ditcaffe.ReductionParameter reduction_param = 136; + if (has_reduction_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 136, *this->reduction_param_, output); + } + + // optional .ditcaffe.EmbedParameter embed_param = 137; + if (has_embed_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 137, *this->embed_param_, output); + } + + // optional .ditcaffe.TileParameter tile_param = 138; + if (has_tile_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 138, *this->tile_param_, output); + } + + // optional .ditcaffe.BatchNormParameter batch_norm_param = 139; + if (has_batch_norm_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 139, *this->batch_norm_param_, output); + } + + // optional .ditcaffe.ELUParameter elu_param = 140; + if (has_elu_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 140, *this->elu_param_, output); + } + + // optional .ditcaffe.BiasParameter bias_param = 141; + if (has_bias_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 141, *this->bias_param_, output); + } + + // optional .ditcaffe.ScaleParameter scale_param = 142; + if (has_scale_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 142, *this->scale_param_, output); + } + + // optional .ditcaffe.InputParameter input_param = 143; + if (has_input_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 143, *this->input_param_, output); + } + + // optional .ditcaffe.CropParameter crop_param = 144; + if (has_crop_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 144, *this->crop_param_, output); + } + + // optional .ditcaffe.ParameterParameter parameter_param = 145; + if (has_parameter_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 145, *this->parameter_param_, output); + } + + output->WriteRaw(unknown_fields().data(), + static_cast(unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:ditcaffe.LayerParameter) +} + +int LayerParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.LayerParameter) + int 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 .ditcaffe.Phase phase = 10; + if (has_phase()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->phase()); + } + + } + if (_has_bits_[11 / 32] & 63488u) { + // optional .ditcaffe.TransformationParameter transform_param = 100; + if (has_transform_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->transform_param_); + } + + // optional .ditcaffe.LossParameter loss_param = 101; + if (has_loss_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->loss_param_); + } + + // optional .ditcaffe.AccuracyParameter accuracy_param = 102; + if (has_accuracy_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->accuracy_param_); + } + + // optional .ditcaffe.ArgMaxParameter argmax_param = 103; + if (has_argmax_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->argmax_param_); + } + + // optional .ditcaffe.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 .ditcaffe.BiasParameter bias_param = 141; + if (has_bias_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->bias_param_); + } + + // optional .ditcaffe.ConcatParameter concat_param = 104; + if (has_concat_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->concat_param_); + } + + // optional .ditcaffe.ContrastiveLossParameter contrastive_loss_param = 105; + if (has_contrastive_loss_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->contrastive_loss_param_); + } + + // optional .ditcaffe.ConvolutionParameter convolution_param = 106; + if (has_convolution_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->convolution_param_); + } + + // optional .ditcaffe.CropParameter crop_param = 144; + if (has_crop_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->crop_param_); + } + + // optional .ditcaffe.DataParameter data_param = 107; + if (has_data_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->data_param_); + } + + // optional .ditcaffe.DropoutParameter dropout_param = 108; + if (has_dropout_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->dropout_param_); + } + + // optional .ditcaffe.DummyDataParameter dummy_data_param = 109; + if (has_dummy_data_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->dummy_data_param_); + } + + } + if (_has_bits_[24 / 32] & 4278190080u) { + // optional .ditcaffe.EltwiseParameter eltwise_param = 110; + if (has_eltwise_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->eltwise_param_); + } + + // optional .ditcaffe.ELUParameter elu_param = 140; + if (has_elu_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->elu_param_); + } + + // optional .ditcaffe.EmbedParameter embed_param = 137; + if (has_embed_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->embed_param_); + } + + // optional .ditcaffe.ExpParameter exp_param = 111; + if (has_exp_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->exp_param_); + } + + // optional .ditcaffe.FlattenParameter flatten_param = 135; + if (has_flatten_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->flatten_param_); + } + + // optional .ditcaffe.HDF5DataParameter hdf5_data_param = 112; + if (has_hdf5_data_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->hdf5_data_param_); + } + + // optional .ditcaffe.HDF5OutputParameter hdf5_output_param = 113; + if (has_hdf5_output_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->hdf5_output_param_); + } + + // optional .ditcaffe.HingeLossParameter hinge_loss_param = 114; + if (has_hinge_loss_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->hinge_loss_param_); + } + + } + if (_has_bits_[32 / 32] & 255u) { + // optional .ditcaffe.ImageDataParameter image_data_param = 115; + if (has_image_data_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->image_data_param_); + } + + // optional .ditcaffe.InfogainLossParameter infogain_loss_param = 116; + if (has_infogain_loss_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->infogain_loss_param_); + } + + // optional .ditcaffe.InnerProductParameter inner_product_param = 117; + if (has_inner_product_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->inner_product_param_); + } + + // optional .ditcaffe.InputParameter input_param = 143; + if (has_input_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->input_param_); + } + + // optional .ditcaffe.LogParameter log_param = 134; + if (has_log_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->log_param_); + } + + // optional .ditcaffe.LRNParameter lrn_param = 118; + if (has_lrn_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->lrn_param_); + } + + // optional .ditcaffe.MemoryDataParameter memory_data_param = 119; + if (has_memory_data_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->memory_data_param_); + } + + // optional .ditcaffe.MVNParameter mvn_param = 120; + if (has_mvn_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->mvn_param_); + } + + } + if (_has_bits_[40 / 32] & 65280u) { + // optional .ditcaffe.ParameterParameter parameter_param = 145; + if (has_parameter_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->parameter_param_); + } + + // optional .ditcaffe.PoolingParameter pooling_param = 121; + if (has_pooling_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->pooling_param_); + } + + // optional .ditcaffe.PowerParameter power_param = 122; + if (has_power_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->power_param_); + } + + // optional .ditcaffe.PReLUParameter prelu_param = 131; + if (has_prelu_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->prelu_param_); + } + + // optional .ditcaffe.PythonParameter python_param = 130; + if (has_python_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->python_param_); + } + + // optional .ditcaffe.ReductionParameter reduction_param = 136; + if (has_reduction_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->reduction_param_); + } + + // optional .ditcaffe.ReLUParameter relu_param = 123; + if (has_relu_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->relu_param_); + } + + // optional .ditcaffe.ReshapeParameter reshape_param = 133; + if (has_reshape_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->reshape_param_); + } + + } + if (_has_bits_[48 / 32] & 16711680u) { + // optional .ditcaffe.ScaleParameter scale_param = 142; + if (has_scale_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->scale_param_); + } + + // optional .ditcaffe.SigmoidParameter sigmoid_param = 124; + if (has_sigmoid_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->sigmoid_param_); + } + + // optional .ditcaffe.SoftmaxParameter softmax_param = 125; + if (has_softmax_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->softmax_param_); + } + + // optional .ditcaffe.SPPParameter spp_param = 132; + if (has_spp_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->spp_param_); + } + + // optional .ditcaffe.SliceParameter slice_param = 126; + if (has_slice_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->slice_param_); + } + + // optional .ditcaffe.TanHParameter tanh_param = 127; + if (has_tanh_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->tanh_param_); + } + + // optional .ditcaffe.ThresholdParameter threshold_param = 128; + if (has_threshold_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->threshold_param_); + } + + // optional .ditcaffe.TileParameter tile_param = 138; + if (has_tile_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->tile_param_); + } + + } + // optional .ditcaffe.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 * 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 * 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; + { + int data_size = 0; + data_size = 4 * this->loss_weight_size(); + total_size += 1 * this->loss_weight_size() + data_size; + } + + // repeated .ditcaffe.ParamSpec param = 6; + total_size += 1 * this->param_size(); + for (int i = 0; i < this->param_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->param(i)); + } + + // repeated .ditcaffe.BlobProto blobs = 7; + total_size += 1 * this->blobs_size(); + for (int i = 0; i < this->blobs_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->blobs(i)); + } + + // repeated bool propagate_down = 11; + { + int data_size = 0; + data_size = 1 * this->propagate_down_size(); + total_size += 1 * this->propagate_down_size() + data_size; + } + + // repeated .ditcaffe.NetStateRule include = 8; + total_size += 1 * this->include_size(); + for (int i = 0; i < this->include_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->include(i)); + } + + // repeated .ditcaffe.NetStateRule exclude = 9; + total_size += 1 * this->exclude_size(); + for (int i = 0; i < this->exclude_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->exclude(i)); + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void LayerParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void LayerParameter::MergeFrom(const LayerParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.LayerParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + bottom_.MergeFrom(from.bottom_); + top_.MergeFrom(from.top_); + loss_weight_.MergeFrom(from.loss_weight_); + param_.MergeFrom(from.param_); + blobs_.MergeFrom(from.blobs_); + propagate_down_.MergeFrom(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()->::ditcaffe::TransformationParameter::MergeFrom(from.transform_param()); + } + if (from.has_loss_param()) { + mutable_loss_param()->::ditcaffe::LossParameter::MergeFrom(from.loss_param()); + } + if (from.has_accuracy_param()) { + mutable_accuracy_param()->::ditcaffe::AccuracyParameter::MergeFrom(from.accuracy_param()); + } + if (from.has_argmax_param()) { + mutable_argmax_param()->::ditcaffe::ArgMaxParameter::MergeFrom(from.argmax_param()); + } + if (from.has_batch_norm_param()) { + mutable_batch_norm_param()->::ditcaffe::BatchNormParameter::MergeFrom(from.batch_norm_param()); + } + } + if (from._has_bits_[16 / 32] & (0xffu << (16 % 32))) { + if (from.has_bias_param()) { + mutable_bias_param()->::ditcaffe::BiasParameter::MergeFrom(from.bias_param()); + } + if (from.has_concat_param()) { + mutable_concat_param()->::ditcaffe::ConcatParameter::MergeFrom(from.concat_param()); + } + if (from.has_contrastive_loss_param()) { + mutable_contrastive_loss_param()->::ditcaffe::ContrastiveLossParameter::MergeFrom(from.contrastive_loss_param()); + } + if (from.has_convolution_param()) { + mutable_convolution_param()->::ditcaffe::ConvolutionParameter::MergeFrom(from.convolution_param()); + } + if (from.has_crop_param()) { + mutable_crop_param()->::ditcaffe::CropParameter::MergeFrom(from.crop_param()); + } + if (from.has_data_param()) { + mutable_data_param()->::ditcaffe::DataParameter::MergeFrom(from.data_param()); + } + if (from.has_dropout_param()) { + mutable_dropout_param()->::ditcaffe::DropoutParameter::MergeFrom(from.dropout_param()); + } + if (from.has_dummy_data_param()) { + mutable_dummy_data_param()->::ditcaffe::DummyDataParameter::MergeFrom(from.dummy_data_param()); + } + } + if (from._has_bits_[24 / 32] & (0xffu << (24 % 32))) { + if (from.has_eltwise_param()) { + mutable_eltwise_param()->::ditcaffe::EltwiseParameter::MergeFrom(from.eltwise_param()); + } + if (from.has_elu_param()) { + mutable_elu_param()->::ditcaffe::ELUParameter::MergeFrom(from.elu_param()); + } + if (from.has_embed_param()) { + mutable_embed_param()->::ditcaffe::EmbedParameter::MergeFrom(from.embed_param()); + } + if (from.has_exp_param()) { + mutable_exp_param()->::ditcaffe::ExpParameter::MergeFrom(from.exp_param()); + } + if (from.has_flatten_param()) { + mutable_flatten_param()->::ditcaffe::FlattenParameter::MergeFrom(from.flatten_param()); + } + if (from.has_hdf5_data_param()) { + mutable_hdf5_data_param()->::ditcaffe::HDF5DataParameter::MergeFrom(from.hdf5_data_param()); + } + if (from.has_hdf5_output_param()) { + mutable_hdf5_output_param()->::ditcaffe::HDF5OutputParameter::MergeFrom(from.hdf5_output_param()); + } + if (from.has_hinge_loss_param()) { + mutable_hinge_loss_param()->::ditcaffe::HingeLossParameter::MergeFrom(from.hinge_loss_param()); + } + } + if (from._has_bits_[32 / 32] & (0xffu << (32 % 32))) { + if (from.has_image_data_param()) { + mutable_image_data_param()->::ditcaffe::ImageDataParameter::MergeFrom(from.image_data_param()); + } + if (from.has_infogain_loss_param()) { + mutable_infogain_loss_param()->::ditcaffe::InfogainLossParameter::MergeFrom(from.infogain_loss_param()); + } + if (from.has_inner_product_param()) { + mutable_inner_product_param()->::ditcaffe::InnerProductParameter::MergeFrom(from.inner_product_param()); + } + if (from.has_input_param()) { + mutable_input_param()->::ditcaffe::InputParameter::MergeFrom(from.input_param()); + } + if (from.has_log_param()) { + mutable_log_param()->::ditcaffe::LogParameter::MergeFrom(from.log_param()); + } + if (from.has_lrn_param()) { + mutable_lrn_param()->::ditcaffe::LRNParameter::MergeFrom(from.lrn_param()); + } + if (from.has_memory_data_param()) { + mutable_memory_data_param()->::ditcaffe::MemoryDataParameter::MergeFrom(from.memory_data_param()); + } + if (from.has_mvn_param()) { + mutable_mvn_param()->::ditcaffe::MVNParameter::MergeFrom(from.mvn_param()); + } + } + if (from._has_bits_[40 / 32] & (0xffu << (40 % 32))) { + if (from.has_parameter_param()) { + mutable_parameter_param()->::ditcaffe::ParameterParameter::MergeFrom(from.parameter_param()); + } + if (from.has_pooling_param()) { + mutable_pooling_param()->::ditcaffe::PoolingParameter::MergeFrom(from.pooling_param()); + } + if (from.has_power_param()) { + mutable_power_param()->::ditcaffe::PowerParameter::MergeFrom(from.power_param()); + } + if (from.has_prelu_param()) { + mutable_prelu_param()->::ditcaffe::PReLUParameter::MergeFrom(from.prelu_param()); + } + if (from.has_python_param()) { + mutable_python_param()->::ditcaffe::PythonParameter::MergeFrom(from.python_param()); + } + if (from.has_reduction_param()) { + mutable_reduction_param()->::ditcaffe::ReductionParameter::MergeFrom(from.reduction_param()); + } + if (from.has_relu_param()) { + mutable_relu_param()->::ditcaffe::ReLUParameter::MergeFrom(from.relu_param()); + } + if (from.has_reshape_param()) { + mutable_reshape_param()->::ditcaffe::ReshapeParameter::MergeFrom(from.reshape_param()); + } + } + if (from._has_bits_[48 / 32] & (0xffu << (48 % 32))) { + if (from.has_scale_param()) { + mutable_scale_param()->::ditcaffe::ScaleParameter::MergeFrom(from.scale_param()); + } + if (from.has_sigmoid_param()) { + mutable_sigmoid_param()->::ditcaffe::SigmoidParameter::MergeFrom(from.sigmoid_param()); + } + if (from.has_softmax_param()) { + mutable_softmax_param()->::ditcaffe::SoftmaxParameter::MergeFrom(from.softmax_param()); + } + if (from.has_spp_param()) { + mutable_spp_param()->::ditcaffe::SPPParameter::MergeFrom(from.spp_param()); + } + if (from.has_slice_param()) { + mutable_slice_param()->::ditcaffe::SliceParameter::MergeFrom(from.slice_param()); + } + if (from.has_tanh_param()) { + mutable_tanh_param()->::ditcaffe::TanHParameter::MergeFrom(from.tanh_param()); + } + if (from.has_threshold_param()) { + mutable_threshold_param()->::ditcaffe::ThresholdParameter::MergeFrom(from.threshold_param()); + } + if (from.has_tile_param()) { + mutable_tile_param()->::ditcaffe::TileParameter::MergeFrom(from.tile_param()); + } + } + if (from._has_bits_[56 / 32] & (0xffu << (56 % 32))) { + if (from.has_window_data_param()) { + mutable_window_data_param()->::ditcaffe::WindowDataParameter::MergeFrom(from.window_data_param()); + } + } + if (!from.unknown_fields().empty()) { + mutable_unknown_fields()->append(from.unknown_fields()); + } +} + +void LayerParameter::CopyFrom(const LayerParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.LayerParameter) + if (&from == this) return; + Clear(); + MergeFrom(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(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(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(python_param_, other->python_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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); +} + +::std::string LayerParameter::GetTypeName() const { + return "ditcaffe.LayerParameter"; +} + +#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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.LayerParameter.name) +} + ::std::string* LayerParameter::mutable_name() { + set_has_name(); + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.name) + return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* LayerParameter::release_name() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.LayerParameter.type) +} + ::std::string* LayerParameter::mutable_type() { + set_has_type(); + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.type) + return type_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* LayerParameter::release_type() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.LayerParameter.bottom) + return bottom_.Get(index); +} + ::std::string* LayerParameter::mutable_bottom(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.bottom) + return bottom_.Mutable(index); +} + void LayerParameter::set_bottom(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.LayerParameter.bottom) +} + ::std::string* LayerParameter::add_bottom() { + // @@protoc_insertion_point(field_add_mutable:ditcaffe.LayerParameter.bottom) + return bottom_.Add(); +} + void LayerParameter::add_bottom(const ::std::string& value) { + bottom_.Add()->assign(value); + // @@protoc_insertion_point(field_add:ditcaffe.LayerParameter.bottom) +} + void LayerParameter::add_bottom(const char* value) { + bottom_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:ditcaffe.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:ditcaffe.LayerParameter.bottom) +} + const ::google::protobuf::RepeatedPtrField< ::std::string>& +LayerParameter::bottom() const { + // @@protoc_insertion_point(field_list:ditcaffe.LayerParameter.bottom) + return bottom_; +} + ::google::protobuf::RepeatedPtrField< ::std::string>* +LayerParameter::mutable_bottom() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.LayerParameter.top) + return top_.Get(index); +} + ::std::string* LayerParameter::mutable_top(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.top) + return top_.Mutable(index); +} + void LayerParameter::set_top(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.LayerParameter.top) +} + ::std::string* LayerParameter::add_top() { + // @@protoc_insertion_point(field_add_mutable:ditcaffe.LayerParameter.top) + return top_.Add(); +} + void LayerParameter::add_top(const ::std::string& value) { + top_.Add()->assign(value); + // @@protoc_insertion_point(field_add:ditcaffe.LayerParameter.top) +} + void LayerParameter::add_top(const char* value) { + top_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:ditcaffe.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:ditcaffe.LayerParameter.top) +} + const ::google::protobuf::RepeatedPtrField< ::std::string>& +LayerParameter::top() const { + // @@protoc_insertion_point(field_list:ditcaffe.LayerParameter.top) + return top_; +} + ::google::protobuf::RepeatedPtrField< ::std::string>* +LayerParameter::mutable_top() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.LayerParameter.top) + return &top_; +} + +// optional .ditcaffe.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(); +} + ::ditcaffe::Phase LayerParameter::phase() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.phase) + return static_cast< ::ditcaffe::Phase >(phase_); +} + void LayerParameter::set_phase(::ditcaffe::Phase value) { + assert(::ditcaffe::Phase_IsValid(value)); + set_has_phase(); + phase_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.LayerParameter.loss_weight) +} + void LayerParameter::add_loss_weight(float value) { + loss_weight_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.LayerParameter.loss_weight) +} + const ::google::protobuf::RepeatedField< float >& +LayerParameter::loss_weight() const { + // @@protoc_insertion_point(field_list:ditcaffe.LayerParameter.loss_weight) + return loss_weight_; +} + ::google::protobuf::RepeatedField< float >* +LayerParameter::mutable_loss_weight() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.LayerParameter.loss_weight) + return &loss_weight_; +} + +// repeated .ditcaffe.ParamSpec param = 6; +int LayerParameter::param_size() const { + return param_.size(); +} +void LayerParameter::clear_param() { + param_.Clear(); +} +const ::ditcaffe::ParamSpec& LayerParameter::param(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.param) + return param_.Get(index); +} +::ditcaffe::ParamSpec* LayerParameter::mutable_param(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.param) + return param_.Mutable(index); +} +::ditcaffe::ParamSpec* LayerParameter::add_param() { + // @@protoc_insertion_point(field_add:ditcaffe.LayerParameter.param) + return param_.Add(); +} +::google::protobuf::RepeatedPtrField< ::ditcaffe::ParamSpec >* +LayerParameter::mutable_param() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.LayerParameter.param) + return ¶m_; +} +const ::google::protobuf::RepeatedPtrField< ::ditcaffe::ParamSpec >& +LayerParameter::param() const { + // @@protoc_insertion_point(field_list:ditcaffe.LayerParameter.param) + return param_; +} + +// repeated .ditcaffe.BlobProto blobs = 7; +int LayerParameter::blobs_size() const { + return blobs_.size(); +} +void LayerParameter::clear_blobs() { + blobs_.Clear(); +} +const ::ditcaffe::BlobProto& LayerParameter::blobs(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.blobs) + return blobs_.Get(index); +} +::ditcaffe::BlobProto* LayerParameter::mutable_blobs(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.blobs) + return blobs_.Mutable(index); +} +::ditcaffe::BlobProto* LayerParameter::add_blobs() { + // @@protoc_insertion_point(field_add:ditcaffe.LayerParameter.blobs) + return blobs_.Add(); +} +::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >* +LayerParameter::mutable_blobs() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.LayerParameter.blobs) + return &blobs_; +} +const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >& +LayerParameter::blobs() const { + // @@protoc_insertion_point(field_list:ditcaffe.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:ditcaffe.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:ditcaffe.LayerParameter.propagate_down) +} + void LayerParameter::add_propagate_down(bool value) { + propagate_down_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.LayerParameter.propagate_down) +} + const ::google::protobuf::RepeatedField< bool >& +LayerParameter::propagate_down() const { + // @@protoc_insertion_point(field_list:ditcaffe.LayerParameter.propagate_down) + return propagate_down_; +} + ::google::protobuf::RepeatedField< bool >* +LayerParameter::mutable_propagate_down() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.LayerParameter.propagate_down) + return &propagate_down_; +} + +// repeated .ditcaffe.NetStateRule include = 8; +int LayerParameter::include_size() const { + return include_.size(); +} +void LayerParameter::clear_include() { + include_.Clear(); +} +const ::ditcaffe::NetStateRule& LayerParameter::include(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.include) + return include_.Get(index); +} +::ditcaffe::NetStateRule* LayerParameter::mutable_include(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.include) + return include_.Mutable(index); +} +::ditcaffe::NetStateRule* LayerParameter::add_include() { + // @@protoc_insertion_point(field_add:ditcaffe.LayerParameter.include) + return include_.Add(); +} +::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >* +LayerParameter::mutable_include() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.LayerParameter.include) + return &include_; +} +const ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >& +LayerParameter::include() const { + // @@protoc_insertion_point(field_list:ditcaffe.LayerParameter.include) + return include_; +} + +// repeated .ditcaffe.NetStateRule exclude = 9; +int LayerParameter::exclude_size() const { + return exclude_.size(); +} +void LayerParameter::clear_exclude() { + exclude_.Clear(); +} +const ::ditcaffe::NetStateRule& LayerParameter::exclude(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.exclude) + return exclude_.Get(index); +} +::ditcaffe::NetStateRule* LayerParameter::mutable_exclude(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.exclude) + return exclude_.Mutable(index); +} +::ditcaffe::NetStateRule* LayerParameter::add_exclude() { + // @@protoc_insertion_point(field_add:ditcaffe.LayerParameter.exclude) + return exclude_.Add(); +} +::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >* +LayerParameter::mutable_exclude() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.LayerParameter.exclude) + return &exclude_; +} +const ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >& +LayerParameter::exclude() const { + // @@protoc_insertion_point(field_list:ditcaffe.LayerParameter.exclude) + return exclude_; +} + +// optional .ditcaffe.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_->::ditcaffe::TransformationParameter::Clear(); + clear_has_transform_param(); +} +const ::ditcaffe::TransformationParameter& LayerParameter::transform_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.transform_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return transform_param_ != NULL ? *transform_param_ : *default_instance().transform_param_; +#else + return transform_param_ != NULL ? *transform_param_ : *default_instance_->transform_param_; +#endif +} +::ditcaffe::TransformationParameter* LayerParameter::mutable_transform_param() { + set_has_transform_param(); + if (transform_param_ == NULL) { + transform_param_ = new ::ditcaffe::TransformationParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.transform_param) + return transform_param_; +} +::ditcaffe::TransformationParameter* LayerParameter::release_transform_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.transform_param) + clear_has_transform_param(); + ::ditcaffe::TransformationParameter* temp = transform_param_; + transform_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_transform_param(::ditcaffe::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:ditcaffe.LayerParameter.transform_param) +} + +// optional .ditcaffe.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_->::ditcaffe::LossParameter::Clear(); + clear_has_loss_param(); +} +const ::ditcaffe::LossParameter& LayerParameter::loss_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.loss_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return loss_param_ != NULL ? *loss_param_ : *default_instance().loss_param_; +#else + return loss_param_ != NULL ? *loss_param_ : *default_instance_->loss_param_; +#endif +} +::ditcaffe::LossParameter* LayerParameter::mutable_loss_param() { + set_has_loss_param(); + if (loss_param_ == NULL) { + loss_param_ = new ::ditcaffe::LossParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.loss_param) + return loss_param_; +} +::ditcaffe::LossParameter* LayerParameter::release_loss_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.loss_param) + clear_has_loss_param(); + ::ditcaffe::LossParameter* temp = loss_param_; + loss_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_loss_param(::ditcaffe::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:ditcaffe.LayerParameter.loss_param) +} + +// optional .ditcaffe.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_->::ditcaffe::AccuracyParameter::Clear(); + clear_has_accuracy_param(); +} +const ::ditcaffe::AccuracyParameter& LayerParameter::accuracy_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.accuracy_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return accuracy_param_ != NULL ? *accuracy_param_ : *default_instance().accuracy_param_; +#else + return accuracy_param_ != NULL ? *accuracy_param_ : *default_instance_->accuracy_param_; +#endif +} +::ditcaffe::AccuracyParameter* LayerParameter::mutable_accuracy_param() { + set_has_accuracy_param(); + if (accuracy_param_ == NULL) { + accuracy_param_ = new ::ditcaffe::AccuracyParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.accuracy_param) + return accuracy_param_; +} +::ditcaffe::AccuracyParameter* LayerParameter::release_accuracy_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.accuracy_param) + clear_has_accuracy_param(); + ::ditcaffe::AccuracyParameter* temp = accuracy_param_; + accuracy_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_accuracy_param(::ditcaffe::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:ditcaffe.LayerParameter.accuracy_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ArgMaxParameter::Clear(); + clear_has_argmax_param(); +} +const ::ditcaffe::ArgMaxParameter& LayerParameter::argmax_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.argmax_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return argmax_param_ != NULL ? *argmax_param_ : *default_instance().argmax_param_; +#else + return argmax_param_ != NULL ? *argmax_param_ : *default_instance_->argmax_param_; +#endif +} +::ditcaffe::ArgMaxParameter* LayerParameter::mutable_argmax_param() { + set_has_argmax_param(); + if (argmax_param_ == NULL) { + argmax_param_ = new ::ditcaffe::ArgMaxParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.argmax_param) + return argmax_param_; +} +::ditcaffe::ArgMaxParameter* LayerParameter::release_argmax_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.argmax_param) + clear_has_argmax_param(); + ::ditcaffe::ArgMaxParameter* temp = argmax_param_; + argmax_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_argmax_param(::ditcaffe::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:ditcaffe.LayerParameter.argmax_param) +} + +// optional .ditcaffe.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_->::ditcaffe::BatchNormParameter::Clear(); + clear_has_batch_norm_param(); +} +const ::ditcaffe::BatchNormParameter& LayerParameter::batch_norm_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.batch_norm_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return batch_norm_param_ != NULL ? *batch_norm_param_ : *default_instance().batch_norm_param_; +#else + return batch_norm_param_ != NULL ? *batch_norm_param_ : *default_instance_->batch_norm_param_; +#endif +} +::ditcaffe::BatchNormParameter* LayerParameter::mutable_batch_norm_param() { + set_has_batch_norm_param(); + if (batch_norm_param_ == NULL) { + batch_norm_param_ = new ::ditcaffe::BatchNormParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.batch_norm_param) + return batch_norm_param_; +} +::ditcaffe::BatchNormParameter* LayerParameter::release_batch_norm_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.batch_norm_param) + clear_has_batch_norm_param(); + ::ditcaffe::BatchNormParameter* temp = batch_norm_param_; + batch_norm_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_batch_norm_param(::ditcaffe::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:ditcaffe.LayerParameter.batch_norm_param) +} + +// optional .ditcaffe.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_->::ditcaffe::BiasParameter::Clear(); + clear_has_bias_param(); +} +const ::ditcaffe::BiasParameter& LayerParameter::bias_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.bias_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return bias_param_ != NULL ? *bias_param_ : *default_instance().bias_param_; +#else + return bias_param_ != NULL ? *bias_param_ : *default_instance_->bias_param_; +#endif +} +::ditcaffe::BiasParameter* LayerParameter::mutable_bias_param() { + set_has_bias_param(); + if (bias_param_ == NULL) { + bias_param_ = new ::ditcaffe::BiasParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.bias_param) + return bias_param_; +} +::ditcaffe::BiasParameter* LayerParameter::release_bias_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.bias_param) + clear_has_bias_param(); + ::ditcaffe::BiasParameter* temp = bias_param_; + bias_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_bias_param(::ditcaffe::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:ditcaffe.LayerParameter.bias_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ConcatParameter::Clear(); + clear_has_concat_param(); +} +const ::ditcaffe::ConcatParameter& LayerParameter::concat_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.concat_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return concat_param_ != NULL ? *concat_param_ : *default_instance().concat_param_; +#else + return concat_param_ != NULL ? *concat_param_ : *default_instance_->concat_param_; +#endif +} +::ditcaffe::ConcatParameter* LayerParameter::mutable_concat_param() { + set_has_concat_param(); + if (concat_param_ == NULL) { + concat_param_ = new ::ditcaffe::ConcatParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.concat_param) + return concat_param_; +} +::ditcaffe::ConcatParameter* LayerParameter::release_concat_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.concat_param) + clear_has_concat_param(); + ::ditcaffe::ConcatParameter* temp = concat_param_; + concat_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_concat_param(::ditcaffe::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:ditcaffe.LayerParameter.concat_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ContrastiveLossParameter::Clear(); + clear_has_contrastive_loss_param(); +} +const ::ditcaffe::ContrastiveLossParameter& LayerParameter::contrastive_loss_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.contrastive_loss_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return contrastive_loss_param_ != NULL ? *contrastive_loss_param_ : *default_instance().contrastive_loss_param_; +#else + return contrastive_loss_param_ != NULL ? *contrastive_loss_param_ : *default_instance_->contrastive_loss_param_; +#endif +} +::ditcaffe::ContrastiveLossParameter* LayerParameter::mutable_contrastive_loss_param() { + set_has_contrastive_loss_param(); + if (contrastive_loss_param_ == NULL) { + contrastive_loss_param_ = new ::ditcaffe::ContrastiveLossParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.contrastive_loss_param) + return contrastive_loss_param_; +} +::ditcaffe::ContrastiveLossParameter* LayerParameter::release_contrastive_loss_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.contrastive_loss_param) + clear_has_contrastive_loss_param(); + ::ditcaffe::ContrastiveLossParameter* temp = contrastive_loss_param_; + contrastive_loss_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_contrastive_loss_param(::ditcaffe::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:ditcaffe.LayerParameter.contrastive_loss_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ConvolutionParameter::Clear(); + clear_has_convolution_param(); +} +const ::ditcaffe::ConvolutionParameter& LayerParameter::convolution_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.convolution_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return convolution_param_ != NULL ? *convolution_param_ : *default_instance().convolution_param_; +#else + return convolution_param_ != NULL ? *convolution_param_ : *default_instance_->convolution_param_; +#endif +} +::ditcaffe::ConvolutionParameter* LayerParameter::mutable_convolution_param() { + set_has_convolution_param(); + if (convolution_param_ == NULL) { + convolution_param_ = new ::ditcaffe::ConvolutionParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.convolution_param) + return convolution_param_; +} +::ditcaffe::ConvolutionParameter* LayerParameter::release_convolution_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.convolution_param) + clear_has_convolution_param(); + ::ditcaffe::ConvolutionParameter* temp = convolution_param_; + convolution_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_convolution_param(::ditcaffe::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:ditcaffe.LayerParameter.convolution_param) +} + +// optional .ditcaffe.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_->::ditcaffe::CropParameter::Clear(); + clear_has_crop_param(); +} +const ::ditcaffe::CropParameter& LayerParameter::crop_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.crop_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return crop_param_ != NULL ? *crop_param_ : *default_instance().crop_param_; +#else + return crop_param_ != NULL ? *crop_param_ : *default_instance_->crop_param_; +#endif +} +::ditcaffe::CropParameter* LayerParameter::mutable_crop_param() { + set_has_crop_param(); + if (crop_param_ == NULL) { + crop_param_ = new ::ditcaffe::CropParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.crop_param) + return crop_param_; +} +::ditcaffe::CropParameter* LayerParameter::release_crop_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.crop_param) + clear_has_crop_param(); + ::ditcaffe::CropParameter* temp = crop_param_; + crop_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_crop_param(::ditcaffe::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:ditcaffe.LayerParameter.crop_param) +} + +// optional .ditcaffe.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_->::ditcaffe::DataParameter::Clear(); + clear_has_data_param(); +} +const ::ditcaffe::DataParameter& LayerParameter::data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.data_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return data_param_ != NULL ? *data_param_ : *default_instance().data_param_; +#else + return data_param_ != NULL ? *data_param_ : *default_instance_->data_param_; +#endif +} +::ditcaffe::DataParameter* LayerParameter::mutable_data_param() { + set_has_data_param(); + if (data_param_ == NULL) { + data_param_ = new ::ditcaffe::DataParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.data_param) + return data_param_; +} +::ditcaffe::DataParameter* LayerParameter::release_data_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.data_param) + clear_has_data_param(); + ::ditcaffe::DataParameter* temp = data_param_; + data_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_data_param(::ditcaffe::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:ditcaffe.LayerParameter.data_param) +} + +// optional .ditcaffe.DropoutParameter dropout_param = 108; +bool LayerParameter::has_dropout_param() const { + return (_has_bits_[0] & 0x00400000u) != 0; +} +void LayerParameter::set_has_dropout_param() { + _has_bits_[0] |= 0x00400000u; +} +void LayerParameter::clear_has_dropout_param() { + _has_bits_[0] &= ~0x00400000u; +} +void LayerParameter::clear_dropout_param() { + if (dropout_param_ != NULL) dropout_param_->::ditcaffe::DropoutParameter::Clear(); + clear_has_dropout_param(); +} +const ::ditcaffe::DropoutParameter& LayerParameter::dropout_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.dropout_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return dropout_param_ != NULL ? *dropout_param_ : *default_instance().dropout_param_; +#else + return dropout_param_ != NULL ? *dropout_param_ : *default_instance_->dropout_param_; +#endif +} +::ditcaffe::DropoutParameter* LayerParameter::mutable_dropout_param() { + set_has_dropout_param(); + if (dropout_param_ == NULL) { + dropout_param_ = new ::ditcaffe::DropoutParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.dropout_param) + return dropout_param_; +} +::ditcaffe::DropoutParameter* LayerParameter::release_dropout_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.dropout_param) + clear_has_dropout_param(); + ::ditcaffe::DropoutParameter* temp = dropout_param_; + dropout_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_dropout_param(::ditcaffe::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:ditcaffe.LayerParameter.dropout_param) +} + +// optional .ditcaffe.DummyDataParameter dummy_data_param = 109; +bool LayerParameter::has_dummy_data_param() const { + return (_has_bits_[0] & 0x00800000u) != 0; +} +void LayerParameter::set_has_dummy_data_param() { + _has_bits_[0] |= 0x00800000u; +} +void LayerParameter::clear_has_dummy_data_param() { + _has_bits_[0] &= ~0x00800000u; +} +void LayerParameter::clear_dummy_data_param() { + if (dummy_data_param_ != NULL) dummy_data_param_->::ditcaffe::DummyDataParameter::Clear(); + clear_has_dummy_data_param(); +} +const ::ditcaffe::DummyDataParameter& LayerParameter::dummy_data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.dummy_data_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return dummy_data_param_ != NULL ? *dummy_data_param_ : *default_instance().dummy_data_param_; +#else + return dummy_data_param_ != NULL ? *dummy_data_param_ : *default_instance_->dummy_data_param_; +#endif +} +::ditcaffe::DummyDataParameter* LayerParameter::mutable_dummy_data_param() { + set_has_dummy_data_param(); + if (dummy_data_param_ == NULL) { + dummy_data_param_ = new ::ditcaffe::DummyDataParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.dummy_data_param) + return dummy_data_param_; +} +::ditcaffe::DummyDataParameter* LayerParameter::release_dummy_data_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.dummy_data_param) + clear_has_dummy_data_param(); + ::ditcaffe::DummyDataParameter* temp = dummy_data_param_; + dummy_data_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_dummy_data_param(::ditcaffe::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:ditcaffe.LayerParameter.dummy_data_param) +} + +// optional .ditcaffe.EltwiseParameter eltwise_param = 110; +bool LayerParameter::has_eltwise_param() const { + return (_has_bits_[0] & 0x01000000u) != 0; +} +void LayerParameter::set_has_eltwise_param() { + _has_bits_[0] |= 0x01000000u; +} +void LayerParameter::clear_has_eltwise_param() { + _has_bits_[0] &= ~0x01000000u; +} +void LayerParameter::clear_eltwise_param() { + if (eltwise_param_ != NULL) eltwise_param_->::ditcaffe::EltwiseParameter::Clear(); + clear_has_eltwise_param(); +} +const ::ditcaffe::EltwiseParameter& LayerParameter::eltwise_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.eltwise_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return eltwise_param_ != NULL ? *eltwise_param_ : *default_instance().eltwise_param_; +#else + return eltwise_param_ != NULL ? *eltwise_param_ : *default_instance_->eltwise_param_; +#endif +} +::ditcaffe::EltwiseParameter* LayerParameter::mutable_eltwise_param() { + set_has_eltwise_param(); + if (eltwise_param_ == NULL) { + eltwise_param_ = new ::ditcaffe::EltwiseParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.eltwise_param) + return eltwise_param_; +} +::ditcaffe::EltwiseParameter* LayerParameter::release_eltwise_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.eltwise_param) + clear_has_eltwise_param(); + ::ditcaffe::EltwiseParameter* temp = eltwise_param_; + eltwise_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_eltwise_param(::ditcaffe::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:ditcaffe.LayerParameter.eltwise_param) +} + +// optional .ditcaffe.ELUParameter elu_param = 140; +bool LayerParameter::has_elu_param() const { + return (_has_bits_[0] & 0x02000000u) != 0; +} +void LayerParameter::set_has_elu_param() { + _has_bits_[0] |= 0x02000000u; +} +void LayerParameter::clear_has_elu_param() { + _has_bits_[0] &= ~0x02000000u; +} +void LayerParameter::clear_elu_param() { + if (elu_param_ != NULL) elu_param_->::ditcaffe::ELUParameter::Clear(); + clear_has_elu_param(); +} +const ::ditcaffe::ELUParameter& LayerParameter::elu_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.elu_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return elu_param_ != NULL ? *elu_param_ : *default_instance().elu_param_; +#else + return elu_param_ != NULL ? *elu_param_ : *default_instance_->elu_param_; +#endif +} +::ditcaffe::ELUParameter* LayerParameter::mutable_elu_param() { + set_has_elu_param(); + if (elu_param_ == NULL) { + elu_param_ = new ::ditcaffe::ELUParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.elu_param) + return elu_param_; +} +::ditcaffe::ELUParameter* LayerParameter::release_elu_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.elu_param) + clear_has_elu_param(); + ::ditcaffe::ELUParameter* temp = elu_param_; + elu_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_elu_param(::ditcaffe::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:ditcaffe.LayerParameter.elu_param) +} + +// optional .ditcaffe.EmbedParameter embed_param = 137; +bool LayerParameter::has_embed_param() const { + return (_has_bits_[0] & 0x04000000u) != 0; +} +void LayerParameter::set_has_embed_param() { + _has_bits_[0] |= 0x04000000u; +} +void LayerParameter::clear_has_embed_param() { + _has_bits_[0] &= ~0x04000000u; +} +void LayerParameter::clear_embed_param() { + if (embed_param_ != NULL) embed_param_->::ditcaffe::EmbedParameter::Clear(); + clear_has_embed_param(); +} +const ::ditcaffe::EmbedParameter& LayerParameter::embed_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.embed_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return embed_param_ != NULL ? *embed_param_ : *default_instance().embed_param_; +#else + return embed_param_ != NULL ? *embed_param_ : *default_instance_->embed_param_; +#endif +} +::ditcaffe::EmbedParameter* LayerParameter::mutable_embed_param() { + set_has_embed_param(); + if (embed_param_ == NULL) { + embed_param_ = new ::ditcaffe::EmbedParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.embed_param) + return embed_param_; +} +::ditcaffe::EmbedParameter* LayerParameter::release_embed_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.embed_param) + clear_has_embed_param(); + ::ditcaffe::EmbedParameter* temp = embed_param_; + embed_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_embed_param(::ditcaffe::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:ditcaffe.LayerParameter.embed_param) +} + +// optional .ditcaffe.ExpParameter exp_param = 111; +bool LayerParameter::has_exp_param() const { + return (_has_bits_[0] & 0x08000000u) != 0; +} +void LayerParameter::set_has_exp_param() { + _has_bits_[0] |= 0x08000000u; +} +void LayerParameter::clear_has_exp_param() { + _has_bits_[0] &= ~0x08000000u; +} +void LayerParameter::clear_exp_param() { + if (exp_param_ != NULL) exp_param_->::ditcaffe::ExpParameter::Clear(); + clear_has_exp_param(); +} +const ::ditcaffe::ExpParameter& LayerParameter::exp_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.exp_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return exp_param_ != NULL ? *exp_param_ : *default_instance().exp_param_; +#else + return exp_param_ != NULL ? *exp_param_ : *default_instance_->exp_param_; +#endif +} +::ditcaffe::ExpParameter* LayerParameter::mutable_exp_param() { + set_has_exp_param(); + if (exp_param_ == NULL) { + exp_param_ = new ::ditcaffe::ExpParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.exp_param) + return exp_param_; +} +::ditcaffe::ExpParameter* LayerParameter::release_exp_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.exp_param) + clear_has_exp_param(); + ::ditcaffe::ExpParameter* temp = exp_param_; + exp_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_exp_param(::ditcaffe::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:ditcaffe.LayerParameter.exp_param) +} + +// optional .ditcaffe.FlattenParameter flatten_param = 135; +bool LayerParameter::has_flatten_param() const { + return (_has_bits_[0] & 0x10000000u) != 0; +} +void LayerParameter::set_has_flatten_param() { + _has_bits_[0] |= 0x10000000u; +} +void LayerParameter::clear_has_flatten_param() { + _has_bits_[0] &= ~0x10000000u; +} +void LayerParameter::clear_flatten_param() { + if (flatten_param_ != NULL) flatten_param_->::ditcaffe::FlattenParameter::Clear(); + clear_has_flatten_param(); +} +const ::ditcaffe::FlattenParameter& LayerParameter::flatten_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.flatten_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return flatten_param_ != NULL ? *flatten_param_ : *default_instance().flatten_param_; +#else + return flatten_param_ != NULL ? *flatten_param_ : *default_instance_->flatten_param_; +#endif +} +::ditcaffe::FlattenParameter* LayerParameter::mutable_flatten_param() { + set_has_flatten_param(); + if (flatten_param_ == NULL) { + flatten_param_ = new ::ditcaffe::FlattenParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.flatten_param) + return flatten_param_; +} +::ditcaffe::FlattenParameter* LayerParameter::release_flatten_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.flatten_param) + clear_has_flatten_param(); + ::ditcaffe::FlattenParameter* temp = flatten_param_; + flatten_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_flatten_param(::ditcaffe::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:ditcaffe.LayerParameter.flatten_param) +} + +// optional .ditcaffe.HDF5DataParameter hdf5_data_param = 112; +bool LayerParameter::has_hdf5_data_param() const { + return (_has_bits_[0] & 0x20000000u) != 0; +} +void LayerParameter::set_has_hdf5_data_param() { + _has_bits_[0] |= 0x20000000u; +} +void LayerParameter::clear_has_hdf5_data_param() { + _has_bits_[0] &= ~0x20000000u; +} +void LayerParameter::clear_hdf5_data_param() { + if (hdf5_data_param_ != NULL) hdf5_data_param_->::ditcaffe::HDF5DataParameter::Clear(); + clear_has_hdf5_data_param(); +} +const ::ditcaffe::HDF5DataParameter& LayerParameter::hdf5_data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.hdf5_data_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return hdf5_data_param_ != NULL ? *hdf5_data_param_ : *default_instance().hdf5_data_param_; +#else + return hdf5_data_param_ != NULL ? *hdf5_data_param_ : *default_instance_->hdf5_data_param_; +#endif +} +::ditcaffe::HDF5DataParameter* LayerParameter::mutable_hdf5_data_param() { + set_has_hdf5_data_param(); + if (hdf5_data_param_ == NULL) { + hdf5_data_param_ = new ::ditcaffe::HDF5DataParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.hdf5_data_param) + return hdf5_data_param_; +} +::ditcaffe::HDF5DataParameter* LayerParameter::release_hdf5_data_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.hdf5_data_param) + clear_has_hdf5_data_param(); + ::ditcaffe::HDF5DataParameter* temp = hdf5_data_param_; + hdf5_data_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_hdf5_data_param(::ditcaffe::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:ditcaffe.LayerParameter.hdf5_data_param) +} + +// optional .ditcaffe.HDF5OutputParameter hdf5_output_param = 113; +bool LayerParameter::has_hdf5_output_param() const { + return (_has_bits_[0] & 0x40000000u) != 0; +} +void LayerParameter::set_has_hdf5_output_param() { + _has_bits_[0] |= 0x40000000u; +} +void LayerParameter::clear_has_hdf5_output_param() { + _has_bits_[0] &= ~0x40000000u; +} +void LayerParameter::clear_hdf5_output_param() { + if (hdf5_output_param_ != NULL) hdf5_output_param_->::ditcaffe::HDF5OutputParameter::Clear(); + clear_has_hdf5_output_param(); +} +const ::ditcaffe::HDF5OutputParameter& LayerParameter::hdf5_output_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.hdf5_output_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return hdf5_output_param_ != NULL ? *hdf5_output_param_ : *default_instance().hdf5_output_param_; +#else + return hdf5_output_param_ != NULL ? *hdf5_output_param_ : *default_instance_->hdf5_output_param_; +#endif +} +::ditcaffe::HDF5OutputParameter* LayerParameter::mutable_hdf5_output_param() { + set_has_hdf5_output_param(); + if (hdf5_output_param_ == NULL) { + hdf5_output_param_ = new ::ditcaffe::HDF5OutputParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.hdf5_output_param) + return hdf5_output_param_; +} +::ditcaffe::HDF5OutputParameter* LayerParameter::release_hdf5_output_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.hdf5_output_param) + clear_has_hdf5_output_param(); + ::ditcaffe::HDF5OutputParameter* temp = hdf5_output_param_; + hdf5_output_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_hdf5_output_param(::ditcaffe::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:ditcaffe.LayerParameter.hdf5_output_param) +} + +// optional .ditcaffe.HingeLossParameter hinge_loss_param = 114; +bool LayerParameter::has_hinge_loss_param() const { + return (_has_bits_[0] & 0x80000000u) != 0; +} +void LayerParameter::set_has_hinge_loss_param() { + _has_bits_[0] |= 0x80000000u; +} +void LayerParameter::clear_has_hinge_loss_param() { + _has_bits_[0] &= ~0x80000000u; +} +void LayerParameter::clear_hinge_loss_param() { + if (hinge_loss_param_ != NULL) hinge_loss_param_->::ditcaffe::HingeLossParameter::Clear(); + clear_has_hinge_loss_param(); +} +const ::ditcaffe::HingeLossParameter& LayerParameter::hinge_loss_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.hinge_loss_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return hinge_loss_param_ != NULL ? *hinge_loss_param_ : *default_instance().hinge_loss_param_; +#else + return hinge_loss_param_ != NULL ? *hinge_loss_param_ : *default_instance_->hinge_loss_param_; +#endif +} +::ditcaffe::HingeLossParameter* LayerParameter::mutable_hinge_loss_param() { + set_has_hinge_loss_param(); + if (hinge_loss_param_ == NULL) { + hinge_loss_param_ = new ::ditcaffe::HingeLossParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.hinge_loss_param) + return hinge_loss_param_; +} +::ditcaffe::HingeLossParameter* LayerParameter::release_hinge_loss_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.hinge_loss_param) + clear_has_hinge_loss_param(); + ::ditcaffe::HingeLossParameter* temp = hinge_loss_param_; + hinge_loss_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_hinge_loss_param(::ditcaffe::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:ditcaffe.LayerParameter.hinge_loss_param) +} + +// optional .ditcaffe.ImageDataParameter image_data_param = 115; +bool LayerParameter::has_image_data_param() const { + return (_has_bits_[1] & 0x00000001u) != 0; +} +void LayerParameter::set_has_image_data_param() { + _has_bits_[1] |= 0x00000001u; +} +void LayerParameter::clear_has_image_data_param() { + _has_bits_[1] &= ~0x00000001u; +} +void LayerParameter::clear_image_data_param() { + if (image_data_param_ != NULL) image_data_param_->::ditcaffe::ImageDataParameter::Clear(); + clear_has_image_data_param(); +} +const ::ditcaffe::ImageDataParameter& LayerParameter::image_data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.image_data_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return image_data_param_ != NULL ? *image_data_param_ : *default_instance().image_data_param_; +#else + return image_data_param_ != NULL ? *image_data_param_ : *default_instance_->image_data_param_; +#endif +} +::ditcaffe::ImageDataParameter* LayerParameter::mutable_image_data_param() { + set_has_image_data_param(); + if (image_data_param_ == NULL) { + image_data_param_ = new ::ditcaffe::ImageDataParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.image_data_param) + return image_data_param_; +} +::ditcaffe::ImageDataParameter* LayerParameter::release_image_data_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.image_data_param) + clear_has_image_data_param(); + ::ditcaffe::ImageDataParameter* temp = image_data_param_; + image_data_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_image_data_param(::ditcaffe::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:ditcaffe.LayerParameter.image_data_param) +} + +// optional .ditcaffe.InfogainLossParameter infogain_loss_param = 116; +bool LayerParameter::has_infogain_loss_param() const { + return (_has_bits_[1] & 0x00000002u) != 0; +} +void LayerParameter::set_has_infogain_loss_param() { + _has_bits_[1] |= 0x00000002u; +} +void LayerParameter::clear_has_infogain_loss_param() { + _has_bits_[1] &= ~0x00000002u; +} +void LayerParameter::clear_infogain_loss_param() { + if (infogain_loss_param_ != NULL) infogain_loss_param_->::ditcaffe::InfogainLossParameter::Clear(); + clear_has_infogain_loss_param(); +} +const ::ditcaffe::InfogainLossParameter& LayerParameter::infogain_loss_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.infogain_loss_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return infogain_loss_param_ != NULL ? *infogain_loss_param_ : *default_instance().infogain_loss_param_; +#else + return infogain_loss_param_ != NULL ? *infogain_loss_param_ : *default_instance_->infogain_loss_param_; +#endif +} +::ditcaffe::InfogainLossParameter* LayerParameter::mutable_infogain_loss_param() { + set_has_infogain_loss_param(); + if (infogain_loss_param_ == NULL) { + infogain_loss_param_ = new ::ditcaffe::InfogainLossParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.infogain_loss_param) + return infogain_loss_param_; +} +::ditcaffe::InfogainLossParameter* LayerParameter::release_infogain_loss_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.infogain_loss_param) + clear_has_infogain_loss_param(); + ::ditcaffe::InfogainLossParameter* temp = infogain_loss_param_; + infogain_loss_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_infogain_loss_param(::ditcaffe::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:ditcaffe.LayerParameter.infogain_loss_param) +} + +// optional .ditcaffe.InnerProductParameter inner_product_param = 117; +bool LayerParameter::has_inner_product_param() const { + return (_has_bits_[1] & 0x00000004u) != 0; +} +void LayerParameter::set_has_inner_product_param() { + _has_bits_[1] |= 0x00000004u; +} +void LayerParameter::clear_has_inner_product_param() { + _has_bits_[1] &= ~0x00000004u; +} +void LayerParameter::clear_inner_product_param() { + if (inner_product_param_ != NULL) inner_product_param_->::ditcaffe::InnerProductParameter::Clear(); + clear_has_inner_product_param(); +} +const ::ditcaffe::InnerProductParameter& LayerParameter::inner_product_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.inner_product_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return inner_product_param_ != NULL ? *inner_product_param_ : *default_instance().inner_product_param_; +#else + return inner_product_param_ != NULL ? *inner_product_param_ : *default_instance_->inner_product_param_; +#endif +} +::ditcaffe::InnerProductParameter* LayerParameter::mutable_inner_product_param() { + set_has_inner_product_param(); + if (inner_product_param_ == NULL) { + inner_product_param_ = new ::ditcaffe::InnerProductParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.inner_product_param) + return inner_product_param_; +} +::ditcaffe::InnerProductParameter* LayerParameter::release_inner_product_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.inner_product_param) + clear_has_inner_product_param(); + ::ditcaffe::InnerProductParameter* temp = inner_product_param_; + inner_product_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_inner_product_param(::ditcaffe::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:ditcaffe.LayerParameter.inner_product_param) +} + +// optional .ditcaffe.InputParameter input_param = 143; +bool LayerParameter::has_input_param() const { + return (_has_bits_[1] & 0x00000008u) != 0; +} +void LayerParameter::set_has_input_param() { + _has_bits_[1] |= 0x00000008u; +} +void LayerParameter::clear_has_input_param() { + _has_bits_[1] &= ~0x00000008u; +} +void LayerParameter::clear_input_param() { + if (input_param_ != NULL) input_param_->::ditcaffe::InputParameter::Clear(); + clear_has_input_param(); +} +const ::ditcaffe::InputParameter& LayerParameter::input_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.input_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return input_param_ != NULL ? *input_param_ : *default_instance().input_param_; +#else + return input_param_ != NULL ? *input_param_ : *default_instance_->input_param_; +#endif +} +::ditcaffe::InputParameter* LayerParameter::mutable_input_param() { + set_has_input_param(); + if (input_param_ == NULL) { + input_param_ = new ::ditcaffe::InputParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.input_param) + return input_param_; +} +::ditcaffe::InputParameter* LayerParameter::release_input_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.input_param) + clear_has_input_param(); + ::ditcaffe::InputParameter* temp = input_param_; + input_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_input_param(::ditcaffe::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:ditcaffe.LayerParameter.input_param) +} + +// optional .ditcaffe.LogParameter log_param = 134; +bool LayerParameter::has_log_param() const { + return (_has_bits_[1] & 0x00000010u) != 0; +} +void LayerParameter::set_has_log_param() { + _has_bits_[1] |= 0x00000010u; +} +void LayerParameter::clear_has_log_param() { + _has_bits_[1] &= ~0x00000010u; +} +void LayerParameter::clear_log_param() { + if (log_param_ != NULL) log_param_->::ditcaffe::LogParameter::Clear(); + clear_has_log_param(); +} +const ::ditcaffe::LogParameter& LayerParameter::log_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.log_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return log_param_ != NULL ? *log_param_ : *default_instance().log_param_; +#else + return log_param_ != NULL ? *log_param_ : *default_instance_->log_param_; +#endif +} +::ditcaffe::LogParameter* LayerParameter::mutable_log_param() { + set_has_log_param(); + if (log_param_ == NULL) { + log_param_ = new ::ditcaffe::LogParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.log_param) + return log_param_; +} +::ditcaffe::LogParameter* LayerParameter::release_log_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.log_param) + clear_has_log_param(); + ::ditcaffe::LogParameter* temp = log_param_; + log_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_log_param(::ditcaffe::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:ditcaffe.LayerParameter.log_param) +} + +// optional .ditcaffe.LRNParameter lrn_param = 118; +bool LayerParameter::has_lrn_param() const { + return (_has_bits_[1] & 0x00000020u) != 0; +} +void LayerParameter::set_has_lrn_param() { + _has_bits_[1] |= 0x00000020u; +} +void LayerParameter::clear_has_lrn_param() { + _has_bits_[1] &= ~0x00000020u; +} +void LayerParameter::clear_lrn_param() { + if (lrn_param_ != NULL) lrn_param_->::ditcaffe::LRNParameter::Clear(); + clear_has_lrn_param(); +} +const ::ditcaffe::LRNParameter& LayerParameter::lrn_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.lrn_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return lrn_param_ != NULL ? *lrn_param_ : *default_instance().lrn_param_; +#else + return lrn_param_ != NULL ? *lrn_param_ : *default_instance_->lrn_param_; +#endif +} +::ditcaffe::LRNParameter* LayerParameter::mutable_lrn_param() { + set_has_lrn_param(); + if (lrn_param_ == NULL) { + lrn_param_ = new ::ditcaffe::LRNParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.lrn_param) + return lrn_param_; +} +::ditcaffe::LRNParameter* LayerParameter::release_lrn_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.lrn_param) + clear_has_lrn_param(); + ::ditcaffe::LRNParameter* temp = lrn_param_; + lrn_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_lrn_param(::ditcaffe::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:ditcaffe.LayerParameter.lrn_param) +} + +// optional .ditcaffe.MemoryDataParameter memory_data_param = 119; +bool LayerParameter::has_memory_data_param() const { + return (_has_bits_[1] & 0x00000040u) != 0; +} +void LayerParameter::set_has_memory_data_param() { + _has_bits_[1] |= 0x00000040u; +} +void LayerParameter::clear_has_memory_data_param() { + _has_bits_[1] &= ~0x00000040u; +} +void LayerParameter::clear_memory_data_param() { + if (memory_data_param_ != NULL) memory_data_param_->::ditcaffe::MemoryDataParameter::Clear(); + clear_has_memory_data_param(); +} +const ::ditcaffe::MemoryDataParameter& LayerParameter::memory_data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.memory_data_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return memory_data_param_ != NULL ? *memory_data_param_ : *default_instance().memory_data_param_; +#else + return memory_data_param_ != NULL ? *memory_data_param_ : *default_instance_->memory_data_param_; +#endif +} +::ditcaffe::MemoryDataParameter* LayerParameter::mutable_memory_data_param() { + set_has_memory_data_param(); + if (memory_data_param_ == NULL) { + memory_data_param_ = new ::ditcaffe::MemoryDataParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.memory_data_param) + return memory_data_param_; +} +::ditcaffe::MemoryDataParameter* LayerParameter::release_memory_data_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.memory_data_param) + clear_has_memory_data_param(); + ::ditcaffe::MemoryDataParameter* temp = memory_data_param_; + memory_data_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_memory_data_param(::ditcaffe::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:ditcaffe.LayerParameter.memory_data_param) +} + +// optional .ditcaffe.MVNParameter mvn_param = 120; +bool LayerParameter::has_mvn_param() const { + return (_has_bits_[1] & 0x00000080u) != 0; +} +void LayerParameter::set_has_mvn_param() { + _has_bits_[1] |= 0x00000080u; +} +void LayerParameter::clear_has_mvn_param() { + _has_bits_[1] &= ~0x00000080u; +} +void LayerParameter::clear_mvn_param() { + if (mvn_param_ != NULL) mvn_param_->::ditcaffe::MVNParameter::Clear(); + clear_has_mvn_param(); +} +const ::ditcaffe::MVNParameter& LayerParameter::mvn_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.mvn_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return mvn_param_ != NULL ? *mvn_param_ : *default_instance().mvn_param_; +#else + return mvn_param_ != NULL ? *mvn_param_ : *default_instance_->mvn_param_; +#endif +} +::ditcaffe::MVNParameter* LayerParameter::mutable_mvn_param() { + set_has_mvn_param(); + if (mvn_param_ == NULL) { + mvn_param_ = new ::ditcaffe::MVNParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.mvn_param) + return mvn_param_; +} +::ditcaffe::MVNParameter* LayerParameter::release_mvn_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.mvn_param) + clear_has_mvn_param(); + ::ditcaffe::MVNParameter* temp = mvn_param_; + mvn_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_mvn_param(::ditcaffe::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:ditcaffe.LayerParameter.mvn_param) +} + +// optional .ditcaffe.ParameterParameter parameter_param = 145; +bool LayerParameter::has_parameter_param() const { + return (_has_bits_[1] & 0x00000100u) != 0; +} +void LayerParameter::set_has_parameter_param() { + _has_bits_[1] |= 0x00000100u; +} +void LayerParameter::clear_has_parameter_param() { + _has_bits_[1] &= ~0x00000100u; +} +void LayerParameter::clear_parameter_param() { + if (parameter_param_ != NULL) parameter_param_->::ditcaffe::ParameterParameter::Clear(); + clear_has_parameter_param(); +} +const ::ditcaffe::ParameterParameter& LayerParameter::parameter_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.parameter_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return parameter_param_ != NULL ? *parameter_param_ : *default_instance().parameter_param_; +#else + return parameter_param_ != NULL ? *parameter_param_ : *default_instance_->parameter_param_; +#endif +} +::ditcaffe::ParameterParameter* LayerParameter::mutable_parameter_param() { + set_has_parameter_param(); + if (parameter_param_ == NULL) { + parameter_param_ = new ::ditcaffe::ParameterParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.parameter_param) + return parameter_param_; +} +::ditcaffe::ParameterParameter* LayerParameter::release_parameter_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.parameter_param) + clear_has_parameter_param(); + ::ditcaffe::ParameterParameter* temp = parameter_param_; + parameter_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_parameter_param(::ditcaffe::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:ditcaffe.LayerParameter.parameter_param) +} + +// optional .ditcaffe.PoolingParameter pooling_param = 121; +bool LayerParameter::has_pooling_param() const { + return (_has_bits_[1] & 0x00000200u) != 0; +} +void LayerParameter::set_has_pooling_param() { + _has_bits_[1] |= 0x00000200u; +} +void LayerParameter::clear_has_pooling_param() { + _has_bits_[1] &= ~0x00000200u; +} +void LayerParameter::clear_pooling_param() { + if (pooling_param_ != NULL) pooling_param_->::ditcaffe::PoolingParameter::Clear(); + clear_has_pooling_param(); +} +const ::ditcaffe::PoolingParameter& LayerParameter::pooling_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.pooling_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return pooling_param_ != NULL ? *pooling_param_ : *default_instance().pooling_param_; +#else + return pooling_param_ != NULL ? *pooling_param_ : *default_instance_->pooling_param_; +#endif +} +::ditcaffe::PoolingParameter* LayerParameter::mutable_pooling_param() { + set_has_pooling_param(); + if (pooling_param_ == NULL) { + pooling_param_ = new ::ditcaffe::PoolingParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.pooling_param) + return pooling_param_; +} +::ditcaffe::PoolingParameter* LayerParameter::release_pooling_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.pooling_param) + clear_has_pooling_param(); + ::ditcaffe::PoolingParameter* temp = pooling_param_; + pooling_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_pooling_param(::ditcaffe::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:ditcaffe.LayerParameter.pooling_param) +} + +// optional .ditcaffe.PowerParameter power_param = 122; +bool LayerParameter::has_power_param() const { + return (_has_bits_[1] & 0x00000400u) != 0; +} +void LayerParameter::set_has_power_param() { + _has_bits_[1] |= 0x00000400u; +} +void LayerParameter::clear_has_power_param() { + _has_bits_[1] &= ~0x00000400u; +} +void LayerParameter::clear_power_param() { + if (power_param_ != NULL) power_param_->::ditcaffe::PowerParameter::Clear(); + clear_has_power_param(); +} +const ::ditcaffe::PowerParameter& LayerParameter::power_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.power_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return power_param_ != NULL ? *power_param_ : *default_instance().power_param_; +#else + return power_param_ != NULL ? *power_param_ : *default_instance_->power_param_; +#endif +} +::ditcaffe::PowerParameter* LayerParameter::mutable_power_param() { + set_has_power_param(); + if (power_param_ == NULL) { + power_param_ = new ::ditcaffe::PowerParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.power_param) + return power_param_; +} +::ditcaffe::PowerParameter* LayerParameter::release_power_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.power_param) + clear_has_power_param(); + ::ditcaffe::PowerParameter* temp = power_param_; + power_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_power_param(::ditcaffe::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:ditcaffe.LayerParameter.power_param) +} + +// optional .ditcaffe.PReLUParameter prelu_param = 131; +bool LayerParameter::has_prelu_param() const { + return (_has_bits_[1] & 0x00000800u) != 0; +} +void LayerParameter::set_has_prelu_param() { + _has_bits_[1] |= 0x00000800u; +} +void LayerParameter::clear_has_prelu_param() { + _has_bits_[1] &= ~0x00000800u; +} +void LayerParameter::clear_prelu_param() { + if (prelu_param_ != NULL) prelu_param_->::ditcaffe::PReLUParameter::Clear(); + clear_has_prelu_param(); +} +const ::ditcaffe::PReLUParameter& LayerParameter::prelu_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.prelu_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return prelu_param_ != NULL ? *prelu_param_ : *default_instance().prelu_param_; +#else + return prelu_param_ != NULL ? *prelu_param_ : *default_instance_->prelu_param_; +#endif +} +::ditcaffe::PReLUParameter* LayerParameter::mutable_prelu_param() { + set_has_prelu_param(); + if (prelu_param_ == NULL) { + prelu_param_ = new ::ditcaffe::PReLUParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.prelu_param) + return prelu_param_; +} +::ditcaffe::PReLUParameter* LayerParameter::release_prelu_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.prelu_param) + clear_has_prelu_param(); + ::ditcaffe::PReLUParameter* temp = prelu_param_; + prelu_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_prelu_param(::ditcaffe::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:ditcaffe.LayerParameter.prelu_param) +} + +// optional .ditcaffe.PythonParameter python_param = 130; +bool LayerParameter::has_python_param() const { + return (_has_bits_[1] & 0x00001000u) != 0; +} +void LayerParameter::set_has_python_param() { + _has_bits_[1] |= 0x00001000u; +} +void LayerParameter::clear_has_python_param() { + _has_bits_[1] &= ~0x00001000u; +} +void LayerParameter::clear_python_param() { + if (python_param_ != NULL) python_param_->::ditcaffe::PythonParameter::Clear(); + clear_has_python_param(); +} +const ::ditcaffe::PythonParameter& LayerParameter::python_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.python_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return python_param_ != NULL ? *python_param_ : *default_instance().python_param_; +#else + return python_param_ != NULL ? *python_param_ : *default_instance_->python_param_; +#endif +} +::ditcaffe::PythonParameter* LayerParameter::mutable_python_param() { + set_has_python_param(); + if (python_param_ == NULL) { + python_param_ = new ::ditcaffe::PythonParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.python_param) + return python_param_; +} +::ditcaffe::PythonParameter* LayerParameter::release_python_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.python_param) + clear_has_python_param(); + ::ditcaffe::PythonParameter* temp = python_param_; + python_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_python_param(::ditcaffe::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:ditcaffe.LayerParameter.python_param) +} + +// optional .ditcaffe.ReductionParameter reduction_param = 136; +bool LayerParameter::has_reduction_param() const { + return (_has_bits_[1] & 0x00002000u) != 0; +} +void LayerParameter::set_has_reduction_param() { + _has_bits_[1] |= 0x00002000u; +} +void LayerParameter::clear_has_reduction_param() { + _has_bits_[1] &= ~0x00002000u; +} +void LayerParameter::clear_reduction_param() { + if (reduction_param_ != NULL) reduction_param_->::ditcaffe::ReductionParameter::Clear(); + clear_has_reduction_param(); +} +const ::ditcaffe::ReductionParameter& LayerParameter::reduction_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.reduction_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return reduction_param_ != NULL ? *reduction_param_ : *default_instance().reduction_param_; +#else + return reduction_param_ != NULL ? *reduction_param_ : *default_instance_->reduction_param_; +#endif +} +::ditcaffe::ReductionParameter* LayerParameter::mutable_reduction_param() { + set_has_reduction_param(); + if (reduction_param_ == NULL) { + reduction_param_ = new ::ditcaffe::ReductionParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.reduction_param) + return reduction_param_; +} +::ditcaffe::ReductionParameter* LayerParameter::release_reduction_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.reduction_param) + clear_has_reduction_param(); + ::ditcaffe::ReductionParameter* temp = reduction_param_; + reduction_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_reduction_param(::ditcaffe::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:ditcaffe.LayerParameter.reduction_param) +} + +// optional .ditcaffe.ReLUParameter relu_param = 123; +bool LayerParameter::has_relu_param() const { + return (_has_bits_[1] & 0x00004000u) != 0; +} +void LayerParameter::set_has_relu_param() { + _has_bits_[1] |= 0x00004000u; +} +void LayerParameter::clear_has_relu_param() { + _has_bits_[1] &= ~0x00004000u; +} +void LayerParameter::clear_relu_param() { + if (relu_param_ != NULL) relu_param_->::ditcaffe::ReLUParameter::Clear(); + clear_has_relu_param(); +} +const ::ditcaffe::ReLUParameter& LayerParameter::relu_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.relu_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return relu_param_ != NULL ? *relu_param_ : *default_instance().relu_param_; +#else + return relu_param_ != NULL ? *relu_param_ : *default_instance_->relu_param_; +#endif +} +::ditcaffe::ReLUParameter* LayerParameter::mutable_relu_param() { + set_has_relu_param(); + if (relu_param_ == NULL) { + relu_param_ = new ::ditcaffe::ReLUParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.relu_param) + return relu_param_; +} +::ditcaffe::ReLUParameter* LayerParameter::release_relu_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.relu_param) + clear_has_relu_param(); + ::ditcaffe::ReLUParameter* temp = relu_param_; + relu_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_relu_param(::ditcaffe::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:ditcaffe.LayerParameter.relu_param) +} + +// optional .ditcaffe.ReshapeParameter reshape_param = 133; +bool LayerParameter::has_reshape_param() const { + return (_has_bits_[1] & 0x00008000u) != 0; +} +void LayerParameter::set_has_reshape_param() { + _has_bits_[1] |= 0x00008000u; +} +void LayerParameter::clear_has_reshape_param() { + _has_bits_[1] &= ~0x00008000u; +} +void LayerParameter::clear_reshape_param() { + if (reshape_param_ != NULL) reshape_param_->::ditcaffe::ReshapeParameter::Clear(); + clear_has_reshape_param(); +} +const ::ditcaffe::ReshapeParameter& LayerParameter::reshape_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.reshape_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return reshape_param_ != NULL ? *reshape_param_ : *default_instance().reshape_param_; +#else + return reshape_param_ != NULL ? *reshape_param_ : *default_instance_->reshape_param_; +#endif +} +::ditcaffe::ReshapeParameter* LayerParameter::mutable_reshape_param() { + set_has_reshape_param(); + if (reshape_param_ == NULL) { + reshape_param_ = new ::ditcaffe::ReshapeParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.reshape_param) + return reshape_param_; +} +::ditcaffe::ReshapeParameter* LayerParameter::release_reshape_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.reshape_param) + clear_has_reshape_param(); + ::ditcaffe::ReshapeParameter* temp = reshape_param_; + reshape_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_reshape_param(::ditcaffe::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:ditcaffe.LayerParameter.reshape_param) +} + +// optional .ditcaffe.ScaleParameter scale_param = 142; +bool LayerParameter::has_scale_param() const { + return (_has_bits_[1] & 0x00010000u) != 0; +} +void LayerParameter::set_has_scale_param() { + _has_bits_[1] |= 0x00010000u; +} +void LayerParameter::clear_has_scale_param() { + _has_bits_[1] &= ~0x00010000u; +} +void LayerParameter::clear_scale_param() { + if (scale_param_ != NULL) scale_param_->::ditcaffe::ScaleParameter::Clear(); + clear_has_scale_param(); +} +const ::ditcaffe::ScaleParameter& LayerParameter::scale_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.scale_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return scale_param_ != NULL ? *scale_param_ : *default_instance().scale_param_; +#else + return scale_param_ != NULL ? *scale_param_ : *default_instance_->scale_param_; +#endif +} +::ditcaffe::ScaleParameter* LayerParameter::mutable_scale_param() { + set_has_scale_param(); + if (scale_param_ == NULL) { + scale_param_ = new ::ditcaffe::ScaleParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.scale_param) + return scale_param_; +} +::ditcaffe::ScaleParameter* LayerParameter::release_scale_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.scale_param) + clear_has_scale_param(); + ::ditcaffe::ScaleParameter* temp = scale_param_; + scale_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_scale_param(::ditcaffe::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:ditcaffe.LayerParameter.scale_param) +} + +// optional .ditcaffe.SigmoidParameter sigmoid_param = 124; +bool LayerParameter::has_sigmoid_param() const { + return (_has_bits_[1] & 0x00020000u) != 0; +} +void LayerParameter::set_has_sigmoid_param() { + _has_bits_[1] |= 0x00020000u; +} +void LayerParameter::clear_has_sigmoid_param() { + _has_bits_[1] &= ~0x00020000u; +} +void LayerParameter::clear_sigmoid_param() { + if (sigmoid_param_ != NULL) sigmoid_param_->::ditcaffe::SigmoidParameter::Clear(); + clear_has_sigmoid_param(); +} +const ::ditcaffe::SigmoidParameter& LayerParameter::sigmoid_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.sigmoid_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return sigmoid_param_ != NULL ? *sigmoid_param_ : *default_instance().sigmoid_param_; +#else + return sigmoid_param_ != NULL ? *sigmoid_param_ : *default_instance_->sigmoid_param_; +#endif +} +::ditcaffe::SigmoidParameter* LayerParameter::mutable_sigmoid_param() { + set_has_sigmoid_param(); + if (sigmoid_param_ == NULL) { + sigmoid_param_ = new ::ditcaffe::SigmoidParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.sigmoid_param) + return sigmoid_param_; +} +::ditcaffe::SigmoidParameter* LayerParameter::release_sigmoid_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.sigmoid_param) + clear_has_sigmoid_param(); + ::ditcaffe::SigmoidParameter* temp = sigmoid_param_; + sigmoid_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_sigmoid_param(::ditcaffe::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:ditcaffe.LayerParameter.sigmoid_param) +} + +// optional .ditcaffe.SoftmaxParameter softmax_param = 125; +bool LayerParameter::has_softmax_param() const { + return (_has_bits_[1] & 0x00040000u) != 0; +} +void LayerParameter::set_has_softmax_param() { + _has_bits_[1] |= 0x00040000u; +} +void LayerParameter::clear_has_softmax_param() { + _has_bits_[1] &= ~0x00040000u; +} +void LayerParameter::clear_softmax_param() { + if (softmax_param_ != NULL) softmax_param_->::ditcaffe::SoftmaxParameter::Clear(); + clear_has_softmax_param(); +} +const ::ditcaffe::SoftmaxParameter& LayerParameter::softmax_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.softmax_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return softmax_param_ != NULL ? *softmax_param_ : *default_instance().softmax_param_; +#else + return softmax_param_ != NULL ? *softmax_param_ : *default_instance_->softmax_param_; +#endif +} +::ditcaffe::SoftmaxParameter* LayerParameter::mutable_softmax_param() { + set_has_softmax_param(); + if (softmax_param_ == NULL) { + softmax_param_ = new ::ditcaffe::SoftmaxParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.softmax_param) + return softmax_param_; +} +::ditcaffe::SoftmaxParameter* LayerParameter::release_softmax_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.softmax_param) + clear_has_softmax_param(); + ::ditcaffe::SoftmaxParameter* temp = softmax_param_; + softmax_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_softmax_param(::ditcaffe::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:ditcaffe.LayerParameter.softmax_param) +} + +// optional .ditcaffe.SPPParameter spp_param = 132; +bool LayerParameter::has_spp_param() const { + return (_has_bits_[1] & 0x00080000u) != 0; +} +void LayerParameter::set_has_spp_param() { + _has_bits_[1] |= 0x00080000u; +} +void LayerParameter::clear_has_spp_param() { + _has_bits_[1] &= ~0x00080000u; +} +void LayerParameter::clear_spp_param() { + if (spp_param_ != NULL) spp_param_->::ditcaffe::SPPParameter::Clear(); + clear_has_spp_param(); +} +const ::ditcaffe::SPPParameter& LayerParameter::spp_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.spp_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return spp_param_ != NULL ? *spp_param_ : *default_instance().spp_param_; +#else + return spp_param_ != NULL ? *spp_param_ : *default_instance_->spp_param_; +#endif +} +::ditcaffe::SPPParameter* LayerParameter::mutable_spp_param() { + set_has_spp_param(); + if (spp_param_ == NULL) { + spp_param_ = new ::ditcaffe::SPPParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.spp_param) + return spp_param_; +} +::ditcaffe::SPPParameter* LayerParameter::release_spp_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.spp_param) + clear_has_spp_param(); + ::ditcaffe::SPPParameter* temp = spp_param_; + spp_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_spp_param(::ditcaffe::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:ditcaffe.LayerParameter.spp_param) +} + +// optional .ditcaffe.SliceParameter slice_param = 126; +bool LayerParameter::has_slice_param() const { + return (_has_bits_[1] & 0x00100000u) != 0; +} +void LayerParameter::set_has_slice_param() { + _has_bits_[1] |= 0x00100000u; +} +void LayerParameter::clear_has_slice_param() { + _has_bits_[1] &= ~0x00100000u; +} +void LayerParameter::clear_slice_param() { + if (slice_param_ != NULL) slice_param_->::ditcaffe::SliceParameter::Clear(); + clear_has_slice_param(); +} +const ::ditcaffe::SliceParameter& LayerParameter::slice_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.slice_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return slice_param_ != NULL ? *slice_param_ : *default_instance().slice_param_; +#else + return slice_param_ != NULL ? *slice_param_ : *default_instance_->slice_param_; +#endif +} +::ditcaffe::SliceParameter* LayerParameter::mutable_slice_param() { + set_has_slice_param(); + if (slice_param_ == NULL) { + slice_param_ = new ::ditcaffe::SliceParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.slice_param) + return slice_param_; +} +::ditcaffe::SliceParameter* LayerParameter::release_slice_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.slice_param) + clear_has_slice_param(); + ::ditcaffe::SliceParameter* temp = slice_param_; + slice_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_slice_param(::ditcaffe::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:ditcaffe.LayerParameter.slice_param) +} + +// optional .ditcaffe.TanHParameter tanh_param = 127; +bool LayerParameter::has_tanh_param() const { + return (_has_bits_[1] & 0x00200000u) != 0; +} +void LayerParameter::set_has_tanh_param() { + _has_bits_[1] |= 0x00200000u; +} +void LayerParameter::clear_has_tanh_param() { + _has_bits_[1] &= ~0x00200000u; +} +void LayerParameter::clear_tanh_param() { + if (tanh_param_ != NULL) tanh_param_->::ditcaffe::TanHParameter::Clear(); + clear_has_tanh_param(); +} +const ::ditcaffe::TanHParameter& LayerParameter::tanh_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.tanh_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return tanh_param_ != NULL ? *tanh_param_ : *default_instance().tanh_param_; +#else + return tanh_param_ != NULL ? *tanh_param_ : *default_instance_->tanh_param_; +#endif +} +::ditcaffe::TanHParameter* LayerParameter::mutable_tanh_param() { + set_has_tanh_param(); + if (tanh_param_ == NULL) { + tanh_param_ = new ::ditcaffe::TanHParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.tanh_param) + return tanh_param_; +} +::ditcaffe::TanHParameter* LayerParameter::release_tanh_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.tanh_param) + clear_has_tanh_param(); + ::ditcaffe::TanHParameter* temp = tanh_param_; + tanh_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_tanh_param(::ditcaffe::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:ditcaffe.LayerParameter.tanh_param) +} + +// optional .ditcaffe.ThresholdParameter threshold_param = 128; +bool LayerParameter::has_threshold_param() const { + return (_has_bits_[1] & 0x00400000u) != 0; +} +void LayerParameter::set_has_threshold_param() { + _has_bits_[1] |= 0x00400000u; +} +void LayerParameter::clear_has_threshold_param() { + _has_bits_[1] &= ~0x00400000u; +} +void LayerParameter::clear_threshold_param() { + if (threshold_param_ != NULL) threshold_param_->::ditcaffe::ThresholdParameter::Clear(); + clear_has_threshold_param(); +} +const ::ditcaffe::ThresholdParameter& LayerParameter::threshold_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.threshold_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return threshold_param_ != NULL ? *threshold_param_ : *default_instance().threshold_param_; +#else + return threshold_param_ != NULL ? *threshold_param_ : *default_instance_->threshold_param_; +#endif +} +::ditcaffe::ThresholdParameter* LayerParameter::mutable_threshold_param() { + set_has_threshold_param(); + if (threshold_param_ == NULL) { + threshold_param_ = new ::ditcaffe::ThresholdParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.threshold_param) + return threshold_param_; +} +::ditcaffe::ThresholdParameter* LayerParameter::release_threshold_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.threshold_param) + clear_has_threshold_param(); + ::ditcaffe::ThresholdParameter* temp = threshold_param_; + threshold_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_threshold_param(::ditcaffe::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:ditcaffe.LayerParameter.threshold_param) +} + +// optional .ditcaffe.TileParameter tile_param = 138; +bool LayerParameter::has_tile_param() const { + return (_has_bits_[1] & 0x00800000u) != 0; +} +void LayerParameter::set_has_tile_param() { + _has_bits_[1] |= 0x00800000u; +} +void LayerParameter::clear_has_tile_param() { + _has_bits_[1] &= ~0x00800000u; +} +void LayerParameter::clear_tile_param() { + if (tile_param_ != NULL) tile_param_->::ditcaffe::TileParameter::Clear(); + clear_has_tile_param(); +} +const ::ditcaffe::TileParameter& LayerParameter::tile_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.tile_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return tile_param_ != NULL ? *tile_param_ : *default_instance().tile_param_; +#else + return tile_param_ != NULL ? *tile_param_ : *default_instance_->tile_param_; +#endif +} +::ditcaffe::TileParameter* LayerParameter::mutable_tile_param() { + set_has_tile_param(); + if (tile_param_ == NULL) { + tile_param_ = new ::ditcaffe::TileParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.tile_param) + return tile_param_; +} +::ditcaffe::TileParameter* LayerParameter::release_tile_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.tile_param) + clear_has_tile_param(); + ::ditcaffe::TileParameter* temp = tile_param_; + tile_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_tile_param(::ditcaffe::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:ditcaffe.LayerParameter.tile_param) +} + +// optional .ditcaffe.WindowDataParameter window_data_param = 129; +bool LayerParameter::has_window_data_param() const { + return (_has_bits_[1] & 0x01000000u) != 0; +} +void LayerParameter::set_has_window_data_param() { + _has_bits_[1] |= 0x01000000u; +} +void LayerParameter::clear_has_window_data_param() { + _has_bits_[1] &= ~0x01000000u; +} +void LayerParameter::clear_window_data_param() { + if (window_data_param_ != NULL) window_data_param_->::ditcaffe::WindowDataParameter::Clear(); + clear_has_window_data_param(); +} +const ::ditcaffe::WindowDataParameter& LayerParameter::window_data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.window_data_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return window_data_param_ != NULL ? *window_data_param_ : *default_instance().window_data_param_; +#else + return window_data_param_ != NULL ? *window_data_param_ : *default_instance_->window_data_param_; +#endif +} +::ditcaffe::WindowDataParameter* LayerParameter::mutable_window_data_param() { + set_has_window_data_param(); + if (window_data_param_ == NULL) { + window_data_param_ = new ::ditcaffe::WindowDataParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.window_data_param) + return window_data_param_; +} +::ditcaffe::WindowDataParameter* LayerParameter::release_window_data_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.window_data_param) + clear_has_window_data_param(); + ::ditcaffe::WindowDataParameter* temp = window_data_param_; + window_data_param_ = NULL; + return temp; +} +void LayerParameter::set_allocated_window_data_param(::ditcaffe::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:ditcaffe.LayerParameter.window_data_param) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +static ::std::string* MutableUnknownFieldsForTransformationParameter( + TransformationParameter* ptr) { + return ptr->mutable_unknown_fields(); +} + +#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::MessageLite(), _arena_ptr_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.TransformationParameter) +} + +void TransformationParameter::InitAsDefaultInstance() { +} + +TransformationParameter::TransformationParameter(const TransformationParameter& from) + : ::google::protobuf::MessageLite(), + _arena_ptr_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.TransformationParameter) +} + +void TransformationParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + _unknown_fields_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + scale_ = 1; + mirror_ = false; + crop_size_ = 0u; + mean_file_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + force_color_ = false; + force_gray_ = false; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +TransformationParameter::~TransformationParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.TransformationParameter) + SharedDtor(); +} + +void TransformationParameter::SharedDtor() { + _unknown_fields_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + mean_file_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void TransformationParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const TransformationParameter& TransformationParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +TransformationParameter* TransformationParameter::default_instance_ = NULL; + +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:ditcaffe.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_(mirror_, force_gray_); + scale_ = 1; + crop_size_ = 0u; + if (has_mean_file()) { + mean_file_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + } + +#undef ZR_HELPER_ +#undef ZR_ + + mean_value_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + _unknown_fields_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +bool TransformationParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::internal::NewPermanentCallback( + &MutableUnknownFieldsForTransformationParameter, this)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &scale_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &mirror_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &crop_size_))); + set_has_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())); + } 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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &force_color_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &force_gray_))); + set_has_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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.TransformationParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.TransformationParameter) + return false; +#undef DO_ +} + +void TransformationParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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::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); + } + + output->WriteRaw(unknown_fields().data(), + static_cast(unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:ditcaffe.TransformationParameter) +} + +int TransformationParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.TransformationParameter) + int 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; + { + int data_size = 0; + data_size = 4 * this->mean_value_size(); + total_size += 1 * this->mean_value_size() + data_size; + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void TransformationParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void TransformationParameter::MergeFrom(const TransformationParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.TransformationParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + mean_value_.MergeFrom(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.unknown_fields().empty()) { + mutable_unknown_fields()->append(from.unknown_fields()); + } +} + +void TransformationParameter::CopyFrom(const TransformationParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.TransformationParameter) + if (&from == this) return; + Clear(); + MergeFrom(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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); +} + +::std::string TransformationParameter::GetTypeName() const { + return "ditcaffe.TransformationParameter"; +} + +#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:ditcaffe.TransformationParameter.scale) + return scale_; +} + void TransformationParameter::set_scale(float value) { + set_has_scale(); + scale_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.TransformationParameter.mirror) + return mirror_; +} + void TransformationParameter::set_mirror(bool value) { + set_has_mirror(); + mirror_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.TransformationParameter.mean_file) +} + ::std::string* TransformationParameter::mutable_mean_file() { + set_has_mean_file(); + // @@protoc_insertion_point(field_mutable:ditcaffe.TransformationParameter.mean_file) + return mean_file_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* TransformationParameter::release_mean_file() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.TransformationParameter.mean_value) +} + void TransformationParameter::add_mean_value(float value) { + mean_value_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.TransformationParameter.mean_value) +} + const ::google::protobuf::RepeatedField< float >& +TransformationParameter::mean_value() const { + // @@protoc_insertion_point(field_list:ditcaffe.TransformationParameter.mean_value) + return mean_value_; +} + ::google::protobuf::RepeatedField< float >* +TransformationParameter::mutable_mean_value() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.TransformationParameter.force_gray) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +static ::std::string* MutableUnknownFieldsForLossParameter( + LossParameter* ptr) { + return ptr->mutable_unknown_fields(); +} + +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::MessageLite(), _arena_ptr_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.LossParameter) +} + +void LossParameter::InitAsDefaultInstance() { +} + +LossParameter::LossParameter(const LossParameter& from) + : ::google::protobuf::MessageLite(), + _arena_ptr_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.LossParameter) +} + +void LossParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + _unknown_fields_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ignore_label_ = 0; + normalization_ = 1; + normalize_ = false; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +LossParameter::~LossParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.LossParameter) + SharedDtor(); +} + +void LossParameter::SharedDtor() { + _unknown_fields_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void LossParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const LossParameter& LossParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +LossParameter* LossParameter::default_instance_ = NULL; + +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:ditcaffe.LossParameter) + if (_has_bits_[0 / 32] & 7u) { + ignore_label_ = 0; + normalization_ = 1; + normalize_ = false; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + _unknown_fields_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +bool LossParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::internal::NewPermanentCallback( + &MutableUnknownFieldsForLossParameter, this)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &ignore_label_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &normalize_))); + set_has_normalize(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(24)) goto parse_normalization; + break; + } + + // optional .ditcaffe.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 (::ditcaffe::LossParameter_NormalizationMode_IsValid(value)) { + set_normalization(static_cast< ::ditcaffe::LossParameter_NormalizationMode >(value)); + } else { + unknown_fields_stream.WriteVarint32(24); + unknown_fields_stream.WriteVarint32(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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.LossParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.LossParameter) + return false; +#undef DO_ +} + +void LossParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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 .ditcaffe.LossParameter.NormalizationMode normalization = 3 [default = VALID]; + if (has_normalization()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 3, this->normalization(), output); + } + + output->WriteRaw(unknown_fields().data(), + static_cast(unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:ditcaffe.LossParameter) +} + +int LossParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.LossParameter) + int 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 .ditcaffe.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; + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void LossParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void LossParameter::MergeFrom(const LossParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.LossParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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.unknown_fields().empty()) { + mutable_unknown_fields()->append(from.unknown_fields()); + } +} + +void LossParameter::CopyFrom(const LossParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.LossParameter) + if (&from == this) return; + Clear(); + MergeFrom(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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); +} + +::std::string LossParameter::GetTypeName() const { + return "ditcaffe.LossParameter"; +} + +#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:ditcaffe.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:ditcaffe.LossParameter.ignore_label) +} + +// optional .ditcaffe.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(); +} + ::ditcaffe::LossParameter_NormalizationMode LossParameter::normalization() const { + // @@protoc_insertion_point(field_get:ditcaffe.LossParameter.normalization) + return static_cast< ::ditcaffe::LossParameter_NormalizationMode >(normalization_); +} + void LossParameter::set_normalization(::ditcaffe::LossParameter_NormalizationMode value) { + assert(::ditcaffe::LossParameter_NormalizationMode_IsValid(value)); + set_has_normalization(); + normalization_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.LossParameter.normalize) + return normalize_; +} + void LossParameter::set_normalize(bool value) { + set_has_normalize(); + normalize_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.LossParameter.normalize) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +static ::std::string* MutableUnknownFieldsForAccuracyParameter( + AccuracyParameter* ptr) { + return ptr->mutable_unknown_fields(); +} + +#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::MessageLite(), _arena_ptr_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.AccuracyParameter) +} + +void AccuracyParameter::InitAsDefaultInstance() { +} + +AccuracyParameter::AccuracyParameter(const AccuracyParameter& from) + : ::google::protobuf::MessageLite(), + _arena_ptr_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.AccuracyParameter) +} + +void AccuracyParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + _unknown_fields_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + top_k_ = 1u; + axis_ = 1; + ignore_label_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +AccuracyParameter::~AccuracyParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.AccuracyParameter) + SharedDtor(); +} + +void AccuracyParameter::SharedDtor() { + _unknown_fields_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void AccuracyParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const AccuracyParameter& AccuracyParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +AccuracyParameter* AccuracyParameter::default_instance_ = NULL; + +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:ditcaffe.AccuracyParameter) + if (_has_bits_[0 / 32] & 7u) { + top_k_ = 1u; + axis_ = 1; + ignore_label_ = 0; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + _unknown_fields_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +bool AccuracyParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::internal::NewPermanentCallback( + &MutableUnknownFieldsForAccuracyParameter, this)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &top_k_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &ignore_label_))); + set_has_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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.AccuracyParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.AccuracyParameter) + return false; +#undef DO_ +} + +void AccuracyParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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); + } + + output->WriteRaw(unknown_fields().data(), + static_cast(unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:ditcaffe.AccuracyParameter) +} + +int AccuracyParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.AccuracyParameter) + int 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()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void AccuracyParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void AccuracyParameter::MergeFrom(const AccuracyParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.AccuracyParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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.unknown_fields().empty()) { + mutable_unknown_fields()->append(from.unknown_fields()); + } +} + +void AccuracyParameter::CopyFrom(const AccuracyParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.AccuracyParameter) + if (&from == this) return; + Clear(); + MergeFrom(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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); +} + +::std::string AccuracyParameter::GetTypeName() const { + return "ditcaffe.AccuracyParameter"; +} + +#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:ditcaffe.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:ditcaffe.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:ditcaffe.AccuracyParameter.axis) + return axis_; +} + void AccuracyParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.AccuracyParameter.ignore_label) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +static ::std::string* MutableUnknownFieldsForArgMaxParameter( + ArgMaxParameter* ptr) { + return ptr->mutable_unknown_fields(); +} + +#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::MessageLite(), _arena_ptr_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.ArgMaxParameter) +} + +void ArgMaxParameter::InitAsDefaultInstance() { +} + +ArgMaxParameter::ArgMaxParameter(const ArgMaxParameter& from) + : ::google::protobuf::MessageLite(), + _arena_ptr_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.ArgMaxParameter) +} + +void ArgMaxParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + _unknown_fields_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + out_max_val_ = false; + top_k_ = 1u; + axis_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ArgMaxParameter::~ArgMaxParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.ArgMaxParameter) + SharedDtor(); +} + +void ArgMaxParameter::SharedDtor() { + _unknown_fields_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void ArgMaxParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ArgMaxParameter& ArgMaxParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +ArgMaxParameter* ArgMaxParameter::default_instance_ = NULL; + +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:ditcaffe.ArgMaxParameter) + if (_has_bits_[0 / 32] & 7u) { + out_max_val_ = false; + top_k_ = 1u; + axis_ = 0; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + _unknown_fields_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +bool ArgMaxParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::internal::NewPermanentCallback( + &MutableUnknownFieldsForArgMaxParameter, this)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &out_max_val_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &top_k_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + set_has_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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.ArgMaxParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.ArgMaxParameter) + return false; +#undef DO_ +} + +void ArgMaxParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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); + } + + output->WriteRaw(unknown_fields().data(), + static_cast(unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:ditcaffe.ArgMaxParameter) +} + +int ArgMaxParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.ArgMaxParameter) + int 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()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ArgMaxParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void ArgMaxParameter::MergeFrom(const ArgMaxParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.ArgMaxParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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.unknown_fields().empty()) { + mutable_unknown_fields()->append(from.unknown_fields()); + } +} + +void ArgMaxParameter::CopyFrom(const ArgMaxParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.ArgMaxParameter) + if (&from == this) return; + Clear(); + MergeFrom(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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); +} + +::std::string ArgMaxParameter::GetTypeName() const { + return "ditcaffe.ArgMaxParameter"; +} + +#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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.ArgMaxParameter.axis) + return axis_; +} + void ArgMaxParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.ArgMaxParameter.axis) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +static ::std::string* MutableUnknownFieldsForConcatParameter( + ConcatParameter* ptr) { + return ptr->mutable_unknown_fields(); +} + +#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::MessageLite(), _arena_ptr_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.ConcatParameter) +} + +void ConcatParameter::InitAsDefaultInstance() { +} + +ConcatParameter::ConcatParameter(const ConcatParameter& from) + : ::google::protobuf::MessageLite(), + _arena_ptr_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.ConcatParameter) +} + +void ConcatParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + _unknown_fields_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + axis_ = 1; + concat_dim_ = 1u; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ConcatParameter::~ConcatParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.ConcatParameter) + SharedDtor(); +} + +void ConcatParameter::SharedDtor() { + _unknown_fields_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void ConcatParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ConcatParameter& ConcatParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +ConcatParameter* ConcatParameter::default_instance_ = NULL; + +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:ditcaffe.ConcatParameter) + if (_has_bits_[0 / 32] & 3u) { + axis_ = 1; + concat_dim_ = 1u; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + _unknown_fields_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +bool ConcatParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::internal::NewPermanentCallback( + &MutableUnknownFieldsForConcatParameter, this)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &concat_dim_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + set_has_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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.ConcatParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.ConcatParameter) + return false; +#undef DO_ +} + +void ConcatParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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); + } + + output->WriteRaw(unknown_fields().data(), + static_cast(unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:ditcaffe.ConcatParameter) +} + +int ConcatParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.ConcatParameter) + int 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()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ConcatParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void ConcatParameter::MergeFrom(const ConcatParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.ConcatParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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.unknown_fields().empty()) { + mutable_unknown_fields()->append(from.unknown_fields()); + } +} + +void ConcatParameter::CopyFrom(const ConcatParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.ConcatParameter) + if (&from == this) return; + Clear(); + MergeFrom(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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); +} + +::std::string ConcatParameter::GetTypeName() const { + return "ditcaffe.ConcatParameter"; +} + +#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:ditcaffe.ConcatParameter.axis) + return axis_; +} + void ConcatParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.ConcatParameter.concat_dim) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +static ::std::string* MutableUnknownFieldsForBatchNormParameter( + BatchNormParameter* ptr) { + return ptr->mutable_unknown_fields(); +} + +#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::MessageLite(), _arena_ptr_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.BatchNormParameter) +} + +void BatchNormParameter::InitAsDefaultInstance() { +} + +BatchNormParameter::BatchNormParameter(const BatchNormParameter& from) + : ::google::protobuf::MessageLite(), + _arena_ptr_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.BatchNormParameter) +} + +void BatchNormParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + _unknown_fields_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + use_global_stats_ = false; + moving_average_fraction_ = 0.999f; + eps_ = 1e-05f; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +BatchNormParameter::~BatchNormParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.BatchNormParameter) + SharedDtor(); +} + +void BatchNormParameter::SharedDtor() { + _unknown_fields_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void BatchNormParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const BatchNormParameter& BatchNormParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +BatchNormParameter* BatchNormParameter::default_instance_ = NULL; + +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:ditcaffe.BatchNormParameter) + if (_has_bits_[0 / 32] & 7u) { + use_global_stats_ = false; + moving_average_fraction_ = 0.999f; + eps_ = 1e-05f; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + _unknown_fields_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +bool BatchNormParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::internal::NewPermanentCallback( + &MutableUnknownFieldsForBatchNormParameter, this)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &use_global_stats_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &moving_average_fraction_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &eps_))); + set_has_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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.BatchNormParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.BatchNormParameter) + return false; +#undef DO_ +} + +void BatchNormParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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); + } + + output->WriteRaw(unknown_fields().data(), + static_cast(unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:ditcaffe.BatchNormParameter) +} + +int BatchNormParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.BatchNormParameter) + int 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; + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void BatchNormParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void BatchNormParameter::MergeFrom(const BatchNormParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.BatchNormParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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.unknown_fields().empty()) { + mutable_unknown_fields()->append(from.unknown_fields()); + } +} + +void BatchNormParameter::CopyFrom(const BatchNormParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.BatchNormParameter) + if (&from == this) return; + Clear(); + MergeFrom(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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); +} + +::std::string BatchNormParameter::GetTypeName() const { + return "ditcaffe.BatchNormParameter"; +} + +#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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.BatchNormParameter.eps) + return eps_; +} + void BatchNormParameter::set_eps(float value) { + set_has_eps(); + eps_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.BatchNormParameter.eps) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +static ::std::string* MutableUnknownFieldsForBiasParameter( + BiasParameter* ptr) { + return ptr->mutable_unknown_fields(); +} + +#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::MessageLite(), _arena_ptr_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.BiasParameter) +} + +void BiasParameter::InitAsDefaultInstance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + filler_ = const_cast< ::ditcaffe::FillerParameter*>( + ::ditcaffe::FillerParameter::internal_default_instance()); +#else + filler_ = const_cast< ::ditcaffe::FillerParameter*>(&::ditcaffe::FillerParameter::default_instance()); +#endif +} + +BiasParameter::BiasParameter(const BiasParameter& from) + : ::google::protobuf::MessageLite(), + _arena_ptr_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.BiasParameter) +} + +void BiasParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + _unknown_fields_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + axis_ = 1; + num_axes_ = 1; + filler_ = NULL; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +BiasParameter::~BiasParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.BiasParameter) + SharedDtor(); +} + +void BiasParameter::SharedDtor() { + _unknown_fields_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + delete filler_; + } +} + +void BiasParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const BiasParameter& BiasParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +BiasParameter* BiasParameter::default_instance_ = NULL; + +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:ditcaffe.BiasParameter) + if (_has_bits_[0 / 32] & 7u) { + axis_ = 1; + num_axes_ = 1; + if (has_filler()) { + if (filler_ != NULL) filler_->::ditcaffe::FillerParameter::Clear(); + } + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + _unknown_fields_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +bool BiasParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::internal::NewPermanentCallback( + &MutableUnknownFieldsForBiasParameter, this)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &num_axes_))); + set_has_num_axes(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_filler; + break; + } + + // optional .ditcaffe.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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.BiasParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.BiasParameter) + return false; +#undef DO_ +} + +void BiasParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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 .ditcaffe.FillerParameter filler = 3; + if (has_filler()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 3, *this->filler_, output); + } + + output->WriteRaw(unknown_fields().data(), + static_cast(unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:ditcaffe.BiasParameter) +} + +int BiasParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.BiasParameter) + int 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 .ditcaffe.FillerParameter filler = 3; + if (has_filler()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->filler_); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void BiasParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void BiasParameter::MergeFrom(const BiasParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.BiasParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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()->::ditcaffe::FillerParameter::MergeFrom(from.filler()); + } + } + if (!from.unknown_fields().empty()) { + mutable_unknown_fields()->append(from.unknown_fields()); + } +} + +void BiasParameter::CopyFrom(const BiasParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.BiasParameter) + if (&from == this) return; + Clear(); + MergeFrom(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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); +} + +::std::string BiasParameter::GetTypeName() const { + return "ditcaffe.BiasParameter"; +} + +#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:ditcaffe.BiasParameter.axis) + return axis_; +} + void BiasParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.BiasParameter.num_axes) +} + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_filler(); +} +const ::ditcaffe::FillerParameter& BiasParameter::filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.BiasParameter.filler) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return filler_ != NULL ? *filler_ : *default_instance().filler_; +#else + return filler_ != NULL ? *filler_ : *default_instance_->filler_; +#endif +} +::ditcaffe::FillerParameter* BiasParameter::mutable_filler() { + set_has_filler(); + if (filler_ == NULL) { + filler_ = new ::ditcaffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.BiasParameter.filler) + return filler_; +} +::ditcaffe::FillerParameter* BiasParameter::release_filler() { + // @@protoc_insertion_point(field_release:ditcaffe.BiasParameter.filler) + clear_has_filler(); + ::ditcaffe::FillerParameter* temp = filler_; + filler_ = NULL; + return temp; +} +void BiasParameter::set_allocated_filler(::ditcaffe::FillerParameter* filler) { + delete filler_; + filler_ = filler; + if (filler) { + set_has_filler(); + } else { + clear_has_filler(); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.BiasParameter.filler) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +static ::std::string* MutableUnknownFieldsForContrastiveLossParameter( + ContrastiveLossParameter* ptr) { + return ptr->mutable_unknown_fields(); +} + +#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::MessageLite(), _arena_ptr_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.ContrastiveLossParameter) +} + +void ContrastiveLossParameter::InitAsDefaultInstance() { +} + +ContrastiveLossParameter::ContrastiveLossParameter(const ContrastiveLossParameter& from) + : ::google::protobuf::MessageLite(), + _arena_ptr_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.ContrastiveLossParameter) +} + +void ContrastiveLossParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + _unknown_fields_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + margin_ = 1; + legacy_version_ = false; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ContrastiveLossParameter::~ContrastiveLossParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.ContrastiveLossParameter) + SharedDtor(); +} + +void ContrastiveLossParameter::SharedDtor() { + _unknown_fields_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void ContrastiveLossParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ContrastiveLossParameter& ContrastiveLossParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +ContrastiveLossParameter* ContrastiveLossParameter::default_instance_ = NULL; + +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:ditcaffe.ContrastiveLossParameter) + if (_has_bits_[0 / 32] & 3u) { + margin_ = 1; + legacy_version_ = false; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + _unknown_fields_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +bool ContrastiveLossParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::internal::NewPermanentCallback( + &MutableUnknownFieldsForContrastiveLossParameter, this)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &margin_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &legacy_version_))); + set_has_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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.ContrastiveLossParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.ContrastiveLossParameter) + return false; +#undef DO_ +} + +void ContrastiveLossParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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); + } + + output->WriteRaw(unknown_fields().data(), + static_cast(unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:ditcaffe.ContrastiveLossParameter) +} + +int ContrastiveLossParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.ContrastiveLossParameter) + int 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; + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ContrastiveLossParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void ContrastiveLossParameter::MergeFrom(const ContrastiveLossParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.ContrastiveLossParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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.unknown_fields().empty()) { + mutable_unknown_fields()->append(from.unknown_fields()); + } +} + +void ContrastiveLossParameter::CopyFrom(const ContrastiveLossParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.ContrastiveLossParameter) + if (&from == this) return; + Clear(); + MergeFrom(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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); +} + +::std::string ContrastiveLossParameter::GetTypeName() const { + return "ditcaffe.ContrastiveLossParameter"; +} + +#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:ditcaffe.ContrastiveLossParameter.margin) + return margin_; +} + void ContrastiveLossParameter::set_margin(float value) { + set_has_margin(); + margin_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.ContrastiveLossParameter.legacy_version) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +static ::std::string* MutableUnknownFieldsForConvolutionParameter( + ConvolutionParameter* ptr) { + return ptr->mutable_unknown_fields(); +} + +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::MessageLite(), _arena_ptr_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.ConvolutionParameter) +} + +void ConvolutionParameter::InitAsDefaultInstance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + weight_filler_ = const_cast< ::ditcaffe::FillerParameter*>( + ::ditcaffe::FillerParameter::internal_default_instance()); +#else + weight_filler_ = const_cast< ::ditcaffe::FillerParameter*>(&::ditcaffe::FillerParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + bias_filler_ = const_cast< ::ditcaffe::FillerParameter*>( + ::ditcaffe::FillerParameter::internal_default_instance()); +#else + bias_filler_ = const_cast< ::ditcaffe::FillerParameter*>(&::ditcaffe::FillerParameter::default_instance()); +#endif +} + +ConvolutionParameter::ConvolutionParameter(const ConvolutionParameter& from) + : ::google::protobuf::MessageLite(), + _arena_ptr_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.ConvolutionParameter) +} + +void ConvolutionParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + _unknown_fields_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + num_output_ = 0u; + bias_term_ = true; + pad_h_ = 0u; + pad_w_ = 0u; + kernel_h_ = 0u; + kernel_w_ = 0u; + stride_h_ = 0u; + stride_w_ = 0u; + group_ = 1u; + weight_filler_ = NULL; + bias_filler_ = NULL; + engine_ = 0; + axis_ = 1; + force_nd_im2col_ = false; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ConvolutionParameter::~ConvolutionParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.ConvolutionParameter) + SharedDtor(); +} + +void ConvolutionParameter::SharedDtor() { + _unknown_fields_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + 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 ConvolutionParameter& ConvolutionParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +ConvolutionParameter* ConvolutionParameter::default_instance_ = NULL; + +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:ditcaffe.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_h_); + bias_term_ = true; + pad_w_ = 0u; + } + if (_has_bits_[8 / 32] & 65280u) { + ZR_(kernel_h_, kernel_w_); + ZR_(stride_h_, stride_w_); + group_ = 1u; + if (has_weight_filler()) { + if (weight_filler_ != NULL) weight_filler_->::ditcaffe::FillerParameter::Clear(); + } + if (has_bias_filler()) { + if (bias_filler_ != NULL) bias_filler_->::ditcaffe::FillerParameter::Clear(); + } + engine_ = 0; + } + 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(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + _unknown_fields_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +bool ConvolutionParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::internal::NewPermanentCallback( + &MutableUnknownFieldsForConvolutionParameter, this)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &num_output_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &bias_term_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &group_))); + set_has_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 .ditcaffe.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 .ditcaffe.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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &pad_h_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &pad_w_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &kernel_h_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &kernel_w_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &stride_h_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &stride_w_))); + set_has_stride_w(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(120)) goto parse_engine; + break; + } + + // optional .ditcaffe.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 (::ditcaffe::ConvolutionParameter_Engine_IsValid(value)) { + set_engine(static_cast< ::ditcaffe::ConvolutionParameter_Engine >(value)); + } else { + unknown_fields_stream.WriteVarint32(120); + unknown_fields_stream.WriteVarint32(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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &force_nd_im2col_))); + set_has_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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.ConvolutionParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.ConvolutionParameter) + return false; +#undef DO_ +} + +void ConvolutionParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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 .ditcaffe.FillerParameter weight_filler = 7; + if (has_weight_filler()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 7, *this->weight_filler_, output); + } + + // optional .ditcaffe.FillerParameter bias_filler = 8; + if (has_bias_filler()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 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 .ditcaffe.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); + } + + output->WriteRaw(unknown_fields().data(), + static_cast(unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:ditcaffe.ConvolutionParameter) +} + +int ConvolutionParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.ConvolutionParameter) + int 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 .ditcaffe.FillerParameter weight_filler = 7; + if (has_weight_filler()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->weight_filler_); + } + + // optional .ditcaffe.FillerParameter bias_filler = 8; + if (has_bias_filler()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->bias_filler_); + } + + // optional .ditcaffe.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; + { + int data_size = 0; + for (int i = 0; i < this->pad_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->pad(i)); + } + total_size += 1 * this->pad_size() + data_size; + } + + // repeated uint32 kernel_size = 4; + { + int data_size = 0; + for (int i = 0; i < this->kernel_size_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->kernel_size(i)); + } + total_size += 1 * this->kernel_size_size() + data_size; + } + + // repeated uint32 stride = 6; + { + int data_size = 0; + for (int i = 0; i < this->stride_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->stride(i)); + } + total_size += 1 * this->stride_size() + data_size; + } + + // repeated uint32 dilation = 18; + { + int data_size = 0; + for (int i = 0; i < this->dilation_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->dilation(i)); + } + total_size += 2 * this->dilation_size() + data_size; + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ConvolutionParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void ConvolutionParameter::MergeFrom(const ConvolutionParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.ConvolutionParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + pad_.MergeFrom(from.pad_); + kernel_size_.MergeFrom(from.kernel_size_); + stride_.MergeFrom(from.stride_); + dilation_.MergeFrom(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()->::ditcaffe::FillerParameter::MergeFrom(from.weight_filler()); + } + if (from.has_bias_filler()) { + mutable_bias_filler()->::ditcaffe::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.unknown_fields().empty()) { + mutable_unknown_fields()->append(from.unknown_fields()); + } +} + +void ConvolutionParameter::CopyFrom(const ConvolutionParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.ConvolutionParameter) + if (&from == this) return; + Clear(); + MergeFrom(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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); +} + +::std::string ConvolutionParameter::GetTypeName() const { + return "ditcaffe.ConvolutionParameter"; +} + +#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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.ConvolutionParameter.pad) +} + void ConvolutionParameter::add_pad(::google::protobuf::uint32 value) { + pad_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.ConvolutionParameter.pad) +} + const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +ConvolutionParameter::pad() const { + // @@protoc_insertion_point(field_list:ditcaffe.ConvolutionParameter.pad) + return pad_; +} + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +ConvolutionParameter::mutable_pad() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.ConvolutionParameter.kernel_size) +} + void ConvolutionParameter::add_kernel_size(::google::protobuf::uint32 value) { + kernel_size_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.ConvolutionParameter.kernel_size) +} + const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +ConvolutionParameter::kernel_size() const { + // @@protoc_insertion_point(field_list:ditcaffe.ConvolutionParameter.kernel_size) + return kernel_size_; +} + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +ConvolutionParameter::mutable_kernel_size() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.ConvolutionParameter.stride) +} + void ConvolutionParameter::add_stride(::google::protobuf::uint32 value) { + stride_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.ConvolutionParameter.stride) +} + const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +ConvolutionParameter::stride() const { + // @@protoc_insertion_point(field_list:ditcaffe.ConvolutionParameter.stride) + return stride_; +} + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +ConvolutionParameter::mutable_stride() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.ConvolutionParameter.dilation) +} + void ConvolutionParameter::add_dilation(::google::protobuf::uint32 value) { + dilation_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.ConvolutionParameter.dilation) +} + const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +ConvolutionParameter::dilation() const { + // @@protoc_insertion_point(field_list:ditcaffe.ConvolutionParameter.dilation) + return dilation_; +} + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +ConvolutionParameter::mutable_dilation() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.ConvolutionParameter.group) + return group_; +} + void ConvolutionParameter::set_group(::google::protobuf::uint32 value) { + set_has_group(); + group_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.ConvolutionParameter.group) +} + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_weight_filler(); +} +const ::ditcaffe::FillerParameter& ConvolutionParameter::weight_filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.ConvolutionParameter.weight_filler) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return weight_filler_ != NULL ? *weight_filler_ : *default_instance().weight_filler_; +#else + return weight_filler_ != NULL ? *weight_filler_ : *default_instance_->weight_filler_; +#endif +} +::ditcaffe::FillerParameter* ConvolutionParameter::mutable_weight_filler() { + set_has_weight_filler(); + if (weight_filler_ == NULL) { + weight_filler_ = new ::ditcaffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.ConvolutionParameter.weight_filler) + return weight_filler_; +} +::ditcaffe::FillerParameter* ConvolutionParameter::release_weight_filler() { + // @@protoc_insertion_point(field_release:ditcaffe.ConvolutionParameter.weight_filler) + clear_has_weight_filler(); + ::ditcaffe::FillerParameter* temp = weight_filler_; + weight_filler_ = NULL; + return temp; +} +void ConvolutionParameter::set_allocated_weight_filler(::ditcaffe::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:ditcaffe.ConvolutionParameter.weight_filler) +} + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_bias_filler(); +} +const ::ditcaffe::FillerParameter& ConvolutionParameter::bias_filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.ConvolutionParameter.bias_filler) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return bias_filler_ != NULL ? *bias_filler_ : *default_instance().bias_filler_; +#else + return bias_filler_ != NULL ? *bias_filler_ : *default_instance_->bias_filler_; +#endif +} +::ditcaffe::FillerParameter* ConvolutionParameter::mutable_bias_filler() { + set_has_bias_filler(); + if (bias_filler_ == NULL) { + bias_filler_ = new ::ditcaffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.ConvolutionParameter.bias_filler) + return bias_filler_; +} +::ditcaffe::FillerParameter* ConvolutionParameter::release_bias_filler() { + // @@protoc_insertion_point(field_release:ditcaffe.ConvolutionParameter.bias_filler) + clear_has_bias_filler(); + ::ditcaffe::FillerParameter* temp = bias_filler_; + bias_filler_ = NULL; + return temp; +} +void ConvolutionParameter::set_allocated_bias_filler(::ditcaffe::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:ditcaffe.ConvolutionParameter.bias_filler) +} + +// optional .ditcaffe.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(); +} + ::ditcaffe::ConvolutionParameter_Engine ConvolutionParameter::engine() const { + // @@protoc_insertion_point(field_get:ditcaffe.ConvolutionParameter.engine) + return static_cast< ::ditcaffe::ConvolutionParameter_Engine >(engine_); +} + void ConvolutionParameter::set_engine(::ditcaffe::ConvolutionParameter_Engine value) { + assert(::ditcaffe::ConvolutionParameter_Engine_IsValid(value)); + set_has_engine(); + engine_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.ConvolutionParameter.axis) + return axis_; +} + void ConvolutionParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.ConvolutionParameter.force_nd_im2col) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +static ::std::string* MutableUnknownFieldsForCropParameter( + CropParameter* ptr) { + return ptr->mutable_unknown_fields(); +} + +#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::MessageLite(), _arena_ptr_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.CropParameter) +} + +void CropParameter::InitAsDefaultInstance() { +} + +CropParameter::CropParameter(const CropParameter& from) + : ::google::protobuf::MessageLite(), + _arena_ptr_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.CropParameter) +} + +void CropParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + _unknown_fields_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + axis_ = 2; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +CropParameter::~CropParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.CropParameter) + SharedDtor(); +} + +void CropParameter::SharedDtor() { + _unknown_fields_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void CropParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const CropParameter& CropParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +CropParameter* CropParameter::default_instance_ = NULL; + +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:ditcaffe.CropParameter) + axis_ = 2; + offset_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + _unknown_fields_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +bool CropParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::internal::NewPermanentCallback( + &MutableUnknownFieldsForCropParameter, this)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + set_has_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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.CropParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.CropParameter) + return false; +#undef DO_ +} + +void CropParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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); + } + + output->WriteRaw(unknown_fields().data(), + static_cast(unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:ditcaffe.CropParameter) +} + +int CropParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.CropParameter) + int 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; + { + int data_size = 0; + for (int i = 0; i < this->offset_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->offset(i)); + } + total_size += 1 * this->offset_size() + data_size; + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void CropParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void CropParameter::MergeFrom(const CropParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.CropParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + offset_.MergeFrom(from.offset_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_axis()) { + set_axis(from.axis()); + } + } + if (!from.unknown_fields().empty()) { + mutable_unknown_fields()->append(from.unknown_fields()); + } +} + +void CropParameter::CopyFrom(const CropParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.CropParameter) + if (&from == this) return; + Clear(); + MergeFrom(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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); +} + +::std::string CropParameter::GetTypeName() const { + return "ditcaffe.CropParameter"; +} + +#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:ditcaffe.CropParameter.axis) + return axis_; +} + void CropParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.CropParameter.offset) +} + void CropParameter::add_offset(::google::protobuf::uint32 value) { + offset_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.CropParameter.offset) +} + const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +CropParameter::offset() const { + // @@protoc_insertion_point(field_list:ditcaffe.CropParameter.offset) + return offset_; +} + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +CropParameter::mutable_offset() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.CropParameter.offset) + return &offset_; +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +static ::std::string* MutableUnknownFieldsForDataParameter( + DataParameter* ptr) { + return ptr->mutable_unknown_fields(); +} + +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::MessageLite(), _arena_ptr_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.DataParameter) +} + +void DataParameter::InitAsDefaultInstance() { +} + +DataParameter::DataParameter(const DataParameter& from) + : ::google::protobuf::MessageLite(), + _arena_ptr_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.DataParameter) +} + +void DataParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + _unknown_fields_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + source_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + batch_size_ = 0u; + rand_skip_ = 0u; + backend_ = 0; + scale_ = 1; + mean_file_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + crop_size_ = 0u; + mirror_ = false; + force_encoded_color_ = false; + prefetch_ = 4u; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +DataParameter::~DataParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.DataParameter) + SharedDtor(); +} + +void DataParameter::SharedDtor() { + _unknown_fields_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + source_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + mean_file_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void DataParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const DataParameter& DataParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +DataParameter* DataParameter::default_instance_ = NULL; + +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:ditcaffe.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_, backend_); + ZR_(crop_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_ + + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + _unknown_fields_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +bool DataParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::internal::NewPermanentCallback( + &MutableUnknownFieldsForDataParameter, this)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:ditcaffe.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())); + } 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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &scale_))); + set_has_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())); + } 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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &batch_size_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &crop_size_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &mirror_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &rand_skip_))); + set_has_rand_skip(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(64)) goto parse_backend; + break; + } + + // optional .ditcaffe.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 (::ditcaffe::DataParameter_DB_IsValid(value)) { + set_backend(static_cast< ::ditcaffe::DataParameter_DB >(value)); + } else { + unknown_fields_stream.WriteVarint32(64); + unknown_fields_stream.WriteVarint32(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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &force_encoded_color_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &prefetch_))); + set_has_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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.DataParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.DataParameter) + return false; +#undef DO_ +} + +void DataParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.DataParameter) + // optional string source = 1; + if (has_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::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 .ditcaffe.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); + } + + output->WriteRaw(unknown_fields().data(), + static_cast(unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:ditcaffe.DataParameter) +} + +int DataParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.DataParameter) + int 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 .ditcaffe.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()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void DataParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void DataParameter::MergeFrom(const DataParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.DataParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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.unknown_fields().empty()) { + mutable_unknown_fields()->append(from.unknown_fields()); + } +} + +void DataParameter::CopyFrom(const DataParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.DataParameter) + if (&from == this) return; + Clear(); + MergeFrom(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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); +} + +::std::string DataParameter::GetTypeName() const { + return "ditcaffe.DataParameter"; +} + +#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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.DataParameter.source) +} + ::std::string* DataParameter::mutable_source() { + set_has_source(); + // @@protoc_insertion_point(field_mutable:ditcaffe.DataParameter.source) + return source_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* DataParameter::release_source() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.DataParameter.rand_skip) +} + +// optional .ditcaffe.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(); +} + ::ditcaffe::DataParameter_DB DataParameter::backend() const { + // @@protoc_insertion_point(field_get:ditcaffe.DataParameter.backend) + return static_cast< ::ditcaffe::DataParameter_DB >(backend_); +} + void DataParameter::set_backend(::ditcaffe::DataParameter_DB value) { + assert(::ditcaffe::DataParameter_DB_IsValid(value)); + set_has_backend(); + backend_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.DataParameter.scale) + return scale_; +} + void DataParameter::set_scale(float value) { + set_has_scale(); + scale_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.DataParameter.mean_file) +} + ::std::string* DataParameter::mutable_mean_file() { + set_has_mean_file(); + // @@protoc_insertion_point(field_mutable:ditcaffe.DataParameter.mean_file) + return mean_file_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* DataParameter::release_mean_file() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.DataParameter.mirror) + return mirror_; +} + void DataParameter::set_mirror(bool value) { + set_has_mirror(); + mirror_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.DataParameter.prefetch) + return prefetch_; +} + void DataParameter::set_prefetch(::google::protobuf::uint32 value) { + set_has_prefetch(); + prefetch_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.DataParameter.prefetch) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +static ::std::string* MutableUnknownFieldsForDropoutParameter( + DropoutParameter* ptr) { + return ptr->mutable_unknown_fields(); +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int DropoutParameter::kDropoutRatioFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +DropoutParameter::DropoutParameter() + : ::google::protobuf::MessageLite(), _arena_ptr_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.DropoutParameter) +} + +void DropoutParameter::InitAsDefaultInstance() { +} + +DropoutParameter::DropoutParameter(const DropoutParameter& from) + : ::google::protobuf::MessageLite(), + _arena_ptr_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.DropoutParameter) +} + +void DropoutParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + _unknown_fields_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + dropout_ratio_ = 0.5f; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +DropoutParameter::~DropoutParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.DropoutParameter) + SharedDtor(); +} + +void DropoutParameter::SharedDtor() { + _unknown_fields_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void DropoutParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const DropoutParameter& DropoutParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +DropoutParameter* DropoutParameter::default_instance_ = NULL; + +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:ditcaffe.DropoutParameter) + dropout_ratio_ = 0.5f; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + _unknown_fields_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +bool DropoutParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::internal::NewPermanentCallback( + &MutableUnknownFieldsForDropoutParameter, this)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &dropout_ratio_))); + set_has_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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.DropoutParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.DropoutParameter) + return false; +#undef DO_ +} + +void DropoutParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.DropoutParameter) + // optional float dropout_ratio = 1 [default = 0.5]; + if (has_dropout_ratio()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->dropout_ratio(), output); + } + + output->WriteRaw(unknown_fields().data(), + static_cast(unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:ditcaffe.DropoutParameter) +} + +int DropoutParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.DropoutParameter) + int total_size = 0; + + // optional float dropout_ratio = 1 [default = 0.5]; + if (has_dropout_ratio()) { + total_size += 1 + 4; + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void DropoutParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void DropoutParameter::MergeFrom(const DropoutParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.DropoutParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_dropout_ratio()) { + set_dropout_ratio(from.dropout_ratio()); + } + } + if (!from.unknown_fields().empty()) { + mutable_unknown_fields()->append(from.unknown_fields()); + } +} + +void DropoutParameter::CopyFrom(const DropoutParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.DropoutParameter) + if (&from == this) return; + Clear(); + MergeFrom(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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); +} + +::std::string DropoutParameter::GetTypeName() const { + return "ditcaffe.DropoutParameter"; +} + +#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:ditcaffe.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:ditcaffe.DropoutParameter.dropout_ratio) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +static ::std::string* MutableUnknownFieldsForDummyDataParameter( + DummyDataParameter* ptr) { + return ptr->mutable_unknown_fields(); +} + +#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::MessageLite(), _arena_ptr_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.DummyDataParameter) +} + +void DummyDataParameter::InitAsDefaultInstance() { +} + +DummyDataParameter::DummyDataParameter(const DummyDataParameter& from) + : ::google::protobuf::MessageLite(), + _arena_ptr_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.DummyDataParameter) +} + +void DummyDataParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + _unknown_fields_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +DummyDataParameter::~DummyDataParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.DummyDataParameter) + SharedDtor(); +} + +void DummyDataParameter::SharedDtor() { + _unknown_fields_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void DummyDataParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const DummyDataParameter& DummyDataParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +DummyDataParameter* DummyDataParameter::default_instance_ = NULL; + +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:ditcaffe.DummyDataParameter) + data_filler_.Clear(); + shape_.Clear(); + num_.Clear(); + channels_.Clear(); + height_.Clear(); + width_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + _unknown_fields_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +bool DummyDataParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::internal::NewPermanentCallback( + &MutableUnknownFieldsForDummyDataParameter, this)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:ditcaffe.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 .ditcaffe.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 .ditcaffe.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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.DummyDataParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.DummyDataParameter) + return false; +#undef DO_ +} + +void DummyDataParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.DummyDataParameter) + // repeated .ditcaffe.FillerParameter data_filler = 1; + for (unsigned int i = 0, n = this->data_filler_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 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 .ditcaffe.BlobShape shape = 6; + for (unsigned int i = 0, n = this->shape_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 6, this->shape(i), output); + } + + output->WriteRaw(unknown_fields().data(), + static_cast(unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:ditcaffe.DummyDataParameter) +} + +int DummyDataParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.DummyDataParameter) + int total_size = 0; + + // repeated .ditcaffe.FillerParameter data_filler = 1; + total_size += 1 * this->data_filler_size(); + for (int i = 0; i < this->data_filler_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->data_filler(i)); + } + + // repeated .ditcaffe.BlobShape shape = 6; + total_size += 1 * this->shape_size(); + for (int i = 0; i < this->shape_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->shape(i)); + } + + // repeated uint32 num = 2; + { + int data_size = 0; + for (int i = 0; i < this->num_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->num(i)); + } + total_size += 1 * this->num_size() + data_size; + } + + // repeated uint32 channels = 3; + { + int data_size = 0; + for (int i = 0; i < this->channels_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->channels(i)); + } + total_size += 1 * this->channels_size() + data_size; + } + + // repeated uint32 height = 4; + { + int data_size = 0; + for (int i = 0; i < this->height_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->height(i)); + } + total_size += 1 * this->height_size() + data_size; + } + + // repeated uint32 width = 5; + { + int data_size = 0; + for (int i = 0; i < this->width_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->width(i)); + } + total_size += 1 * this->width_size() + data_size; + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void DummyDataParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void DummyDataParameter::MergeFrom(const DummyDataParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.DummyDataParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + data_filler_.MergeFrom(from.data_filler_); + shape_.MergeFrom(from.shape_); + num_.MergeFrom(from.num_); + channels_.MergeFrom(from.channels_); + height_.MergeFrom(from.height_); + width_.MergeFrom(from.width_); + if (!from.unknown_fields().empty()) { + mutable_unknown_fields()->append(from.unknown_fields()); + } +} + +void DummyDataParameter::CopyFrom(const DummyDataParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.DummyDataParameter) + if (&from == this) return; + Clear(); + MergeFrom(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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); +} + +::std::string DummyDataParameter::GetTypeName() const { + return "ditcaffe.DummyDataParameter"; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// DummyDataParameter + +// repeated .ditcaffe.FillerParameter data_filler = 1; +int DummyDataParameter::data_filler_size() const { + return data_filler_.size(); +} +void DummyDataParameter::clear_data_filler() { + data_filler_.Clear(); +} +const ::ditcaffe::FillerParameter& DummyDataParameter::data_filler(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.DummyDataParameter.data_filler) + return data_filler_.Get(index); +} +::ditcaffe::FillerParameter* DummyDataParameter::mutable_data_filler(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.DummyDataParameter.data_filler) + return data_filler_.Mutable(index); +} +::ditcaffe::FillerParameter* DummyDataParameter::add_data_filler() { + // @@protoc_insertion_point(field_add:ditcaffe.DummyDataParameter.data_filler) + return data_filler_.Add(); +} +::google::protobuf::RepeatedPtrField< ::ditcaffe::FillerParameter >* +DummyDataParameter::mutable_data_filler() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.DummyDataParameter.data_filler) + return &data_filler_; +} +const ::google::protobuf::RepeatedPtrField< ::ditcaffe::FillerParameter >& +DummyDataParameter::data_filler() const { + // @@protoc_insertion_point(field_list:ditcaffe.DummyDataParameter.data_filler) + return data_filler_; +} + +// repeated .ditcaffe.BlobShape shape = 6; +int DummyDataParameter::shape_size() const { + return shape_.size(); +} +void DummyDataParameter::clear_shape() { + shape_.Clear(); +} +const ::ditcaffe::BlobShape& DummyDataParameter::shape(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.DummyDataParameter.shape) + return shape_.Get(index); +} +::ditcaffe::BlobShape* DummyDataParameter::mutable_shape(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.DummyDataParameter.shape) + return shape_.Mutable(index); +} +::ditcaffe::BlobShape* DummyDataParameter::add_shape() { + // @@protoc_insertion_point(field_add:ditcaffe.DummyDataParameter.shape) + return shape_.Add(); +} +::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobShape >* +DummyDataParameter::mutable_shape() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.DummyDataParameter.shape) + return &shape_; +} +const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobShape >& +DummyDataParameter::shape() const { + // @@protoc_insertion_point(field_list:ditcaffe.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:ditcaffe.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:ditcaffe.DummyDataParameter.num) +} + void DummyDataParameter::add_num(::google::protobuf::uint32 value) { + num_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.DummyDataParameter.num) +} + const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +DummyDataParameter::num() const { + // @@protoc_insertion_point(field_list:ditcaffe.DummyDataParameter.num) + return num_; +} + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +DummyDataParameter::mutable_num() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.DummyDataParameter.channels) +} + void DummyDataParameter::add_channels(::google::protobuf::uint32 value) { + channels_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.DummyDataParameter.channels) +} + const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +DummyDataParameter::channels() const { + // @@protoc_insertion_point(field_list:ditcaffe.DummyDataParameter.channels) + return channels_; +} + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +DummyDataParameter::mutable_channels() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.DummyDataParameter.height) +} + void DummyDataParameter::add_height(::google::protobuf::uint32 value) { + height_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.DummyDataParameter.height) +} + const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +DummyDataParameter::height() const { + // @@protoc_insertion_point(field_list:ditcaffe.DummyDataParameter.height) + return height_; +} + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +DummyDataParameter::mutable_height() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.DummyDataParameter.width) +} + void DummyDataParameter::add_width(::google::protobuf::uint32 value) { + width_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.DummyDataParameter.width) +} + const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +DummyDataParameter::width() const { + // @@protoc_insertion_point(field_list:ditcaffe.DummyDataParameter.width) + return width_; +} + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +DummyDataParameter::mutable_width() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.DummyDataParameter.width) + return &width_; +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +static ::std::string* MutableUnknownFieldsForEltwiseParameter( + EltwiseParameter* ptr) { + return ptr->mutable_unknown_fields(); +} + +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::MessageLite(), _arena_ptr_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.EltwiseParameter) +} + +void EltwiseParameter::InitAsDefaultInstance() { +} + +EltwiseParameter::EltwiseParameter(const EltwiseParameter& from) + : ::google::protobuf::MessageLite(), + _arena_ptr_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.EltwiseParameter) +} + +void EltwiseParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + _unknown_fields_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + operation_ = 1; + stable_prod_grad_ = true; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +EltwiseParameter::~EltwiseParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.EltwiseParameter) + SharedDtor(); +} + +void EltwiseParameter::SharedDtor() { + _unknown_fields_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void EltwiseParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const EltwiseParameter& EltwiseParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +EltwiseParameter* EltwiseParameter::default_instance_ = NULL; + +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:ditcaffe.EltwiseParameter) + if (_has_bits_[0 / 32] & 5u) { + operation_ = 1; + stable_prod_grad_ = true; + } + coeff_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + _unknown_fields_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +bool EltwiseParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::internal::NewPermanentCallback( + &MutableUnknownFieldsForEltwiseParameter, this)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:ditcaffe.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 .ditcaffe.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 (::ditcaffe::EltwiseParameter_EltwiseOp_IsValid(value)) { + set_operation(static_cast< ::ditcaffe::EltwiseParameter_EltwiseOp >(value)); + } else { + unknown_fields_stream.WriteVarint32(8); + unknown_fields_stream.WriteVarint32(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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &stable_prod_grad_))); + set_has_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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.EltwiseParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.EltwiseParameter) + return false; +#undef DO_ +} + +void EltwiseParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.EltwiseParameter) + // optional .ditcaffe.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); + } + + output->WriteRaw(unknown_fields().data(), + static_cast(unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:ditcaffe.EltwiseParameter) +} + +int EltwiseParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.EltwiseParameter) + int total_size = 0; + + if (_has_bits_[0 / 32] & 5u) { + // optional .ditcaffe.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; + { + int data_size = 0; + data_size = 4 * this->coeff_size(); + total_size += 1 * this->coeff_size() + data_size; + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void EltwiseParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void EltwiseParameter::MergeFrom(const EltwiseParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.EltwiseParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + coeff_.MergeFrom(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.unknown_fields().empty()) { + mutable_unknown_fields()->append(from.unknown_fields()); + } +} + +void EltwiseParameter::CopyFrom(const EltwiseParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.EltwiseParameter) + if (&from == this) return; + Clear(); + MergeFrom(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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); +} + +::std::string EltwiseParameter::GetTypeName() const { + return "ditcaffe.EltwiseParameter"; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// EltwiseParameter + +// optional .ditcaffe.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(); +} + ::ditcaffe::EltwiseParameter_EltwiseOp EltwiseParameter::operation() const { + // @@protoc_insertion_point(field_get:ditcaffe.EltwiseParameter.operation) + return static_cast< ::ditcaffe::EltwiseParameter_EltwiseOp >(operation_); +} + void EltwiseParameter::set_operation(::ditcaffe::EltwiseParameter_EltwiseOp value) { + assert(::ditcaffe::EltwiseParameter_EltwiseOp_IsValid(value)); + set_has_operation(); + operation_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.EltwiseParameter.coeff) + return coeff_.Get(index); +} + void EltwiseParameter::set_coeff(int index, float value) { + coeff_.Set(index, value); + // @@protoc_insertion_point(field_set:ditcaffe.EltwiseParameter.coeff) +} + void EltwiseParameter::add_coeff(float value) { + coeff_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.EltwiseParameter.coeff) +} + const ::google::protobuf::RepeatedField< float >& +EltwiseParameter::coeff() const { + // @@protoc_insertion_point(field_list:ditcaffe.EltwiseParameter.coeff) + return coeff_; +} + ::google::protobuf::RepeatedField< float >* +EltwiseParameter::mutable_coeff() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.EltwiseParameter.stable_prod_grad) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +static ::std::string* MutableUnknownFieldsForELUParameter( + ELUParameter* ptr) { + return ptr->mutable_unknown_fields(); +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ELUParameter::kAlphaFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ELUParameter::ELUParameter() + : ::google::protobuf::MessageLite(), _arena_ptr_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.ELUParameter) +} + +void ELUParameter::InitAsDefaultInstance() { +} + +ELUParameter::ELUParameter(const ELUParameter& from) + : ::google::protobuf::MessageLite(), + _arena_ptr_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.ELUParameter) +} + +void ELUParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + _unknown_fields_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + alpha_ = 1; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ELUParameter::~ELUParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.ELUParameter) + SharedDtor(); +} + +void ELUParameter::SharedDtor() { + _unknown_fields_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void ELUParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ELUParameter& ELUParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +ELUParameter* ELUParameter::default_instance_ = NULL; + +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:ditcaffe.ELUParameter) + alpha_ = 1; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + _unknown_fields_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +bool ELUParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::internal::NewPermanentCallback( + &MutableUnknownFieldsForELUParameter, this)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &alpha_))); + set_has_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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.ELUParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.ELUParameter) + return false; +#undef DO_ +} + +void ELUParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.ELUParameter) + // optional float alpha = 1 [default = 1]; + if (has_alpha()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->alpha(), output); + } + + output->WriteRaw(unknown_fields().data(), + static_cast(unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:ditcaffe.ELUParameter) +} + +int ELUParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.ELUParameter) + int total_size = 0; + + // optional float alpha = 1 [default = 1]; + if (has_alpha()) { + total_size += 1 + 4; + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ELUParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void ELUParameter::MergeFrom(const ELUParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.ELUParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_alpha()) { + set_alpha(from.alpha()); + } + } + if (!from.unknown_fields().empty()) { + mutable_unknown_fields()->append(from.unknown_fields()); + } +} + +void ELUParameter::CopyFrom(const ELUParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.ELUParameter) + if (&from == this) return; + Clear(); + MergeFrom(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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); +} + +::std::string ELUParameter::GetTypeName() const { + return "ditcaffe.ELUParameter"; +} + +#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:ditcaffe.ELUParameter.alpha) + return alpha_; +} + void ELUParameter::set_alpha(float value) { + set_has_alpha(); + alpha_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.ELUParameter.alpha) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +static ::std::string* MutableUnknownFieldsForEmbedParameter( + EmbedParameter* ptr) { + return ptr->mutable_unknown_fields(); +} + +#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::MessageLite(), _arena_ptr_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.EmbedParameter) +} + +void EmbedParameter::InitAsDefaultInstance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + weight_filler_ = const_cast< ::ditcaffe::FillerParameter*>( + ::ditcaffe::FillerParameter::internal_default_instance()); +#else + weight_filler_ = const_cast< ::ditcaffe::FillerParameter*>(&::ditcaffe::FillerParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + bias_filler_ = const_cast< ::ditcaffe::FillerParameter*>( + ::ditcaffe::FillerParameter::internal_default_instance()); +#else + bias_filler_ = const_cast< ::ditcaffe::FillerParameter*>(&::ditcaffe::FillerParameter::default_instance()); +#endif +} + +EmbedParameter::EmbedParameter(const EmbedParameter& from) + : ::google::protobuf::MessageLite(), + _arena_ptr_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.EmbedParameter) +} + +void EmbedParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + _unknown_fields_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + num_output_ = 0u; + input_dim_ = 0u; + bias_term_ = true; + weight_filler_ = NULL; + bias_filler_ = NULL; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +EmbedParameter::~EmbedParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.EmbedParameter) + SharedDtor(); +} + +void EmbedParameter::SharedDtor() { + _unknown_fields_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + 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 EmbedParameter& EmbedParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +EmbedParameter* EmbedParameter::default_instance_ = NULL; + +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:ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + } + if (has_bias_filler()) { + if (bias_filler_ != NULL) bias_filler_->::ditcaffe::FillerParameter::Clear(); + } + } + +#undef ZR_HELPER_ +#undef ZR_ + + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + _unknown_fields_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +bool EmbedParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::internal::NewPermanentCallback( + &MutableUnknownFieldsForEmbedParameter, this)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &num_output_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &input_dim_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &bias_term_))); + set_has_bias_term(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(34)) goto parse_weight_filler; + break; + } + + // optional .ditcaffe.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 .ditcaffe.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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.EmbedParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.EmbedParameter) + return false; +#undef DO_ +} + +void EmbedParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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 .ditcaffe.FillerParameter weight_filler = 4; + if (has_weight_filler()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 4, *this->weight_filler_, output); + } + + // optional .ditcaffe.FillerParameter bias_filler = 5; + if (has_bias_filler()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 5, *this->bias_filler_, output); + } + + output->WriteRaw(unknown_fields().data(), + static_cast(unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:ditcaffe.EmbedParameter) +} + +int EmbedParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.EmbedParameter) + int 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 .ditcaffe.FillerParameter weight_filler = 4; + if (has_weight_filler()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->weight_filler_); + } + + // optional .ditcaffe.FillerParameter bias_filler = 5; + if (has_bias_filler()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->bias_filler_); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void EmbedParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void EmbedParameter::MergeFrom(const EmbedParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.EmbedParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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()->::ditcaffe::FillerParameter::MergeFrom(from.weight_filler()); + } + if (from.has_bias_filler()) { + mutable_bias_filler()->::ditcaffe::FillerParameter::MergeFrom(from.bias_filler()); + } + } + if (!from.unknown_fields().empty()) { + mutable_unknown_fields()->append(from.unknown_fields()); + } +} + +void EmbedParameter::CopyFrom(const EmbedParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.EmbedParameter) + if (&from == this) return; + Clear(); + MergeFrom(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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); +} + +::std::string EmbedParameter::GetTypeName() const { + return "ditcaffe.EmbedParameter"; +} + +#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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.EmbedParameter.bias_term) +} + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_weight_filler(); +} +const ::ditcaffe::FillerParameter& EmbedParameter::weight_filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.EmbedParameter.weight_filler) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return weight_filler_ != NULL ? *weight_filler_ : *default_instance().weight_filler_; +#else + return weight_filler_ != NULL ? *weight_filler_ : *default_instance_->weight_filler_; +#endif +} +::ditcaffe::FillerParameter* EmbedParameter::mutable_weight_filler() { + set_has_weight_filler(); + if (weight_filler_ == NULL) { + weight_filler_ = new ::ditcaffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.EmbedParameter.weight_filler) + return weight_filler_; +} +::ditcaffe::FillerParameter* EmbedParameter::release_weight_filler() { + // @@protoc_insertion_point(field_release:ditcaffe.EmbedParameter.weight_filler) + clear_has_weight_filler(); + ::ditcaffe::FillerParameter* temp = weight_filler_; + weight_filler_ = NULL; + return temp; +} +void EmbedParameter::set_allocated_weight_filler(::ditcaffe::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:ditcaffe.EmbedParameter.weight_filler) +} + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_bias_filler(); +} +const ::ditcaffe::FillerParameter& EmbedParameter::bias_filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.EmbedParameter.bias_filler) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return bias_filler_ != NULL ? *bias_filler_ : *default_instance().bias_filler_; +#else + return bias_filler_ != NULL ? *bias_filler_ : *default_instance_->bias_filler_; +#endif +} +::ditcaffe::FillerParameter* EmbedParameter::mutable_bias_filler() { + set_has_bias_filler(); + if (bias_filler_ == NULL) { + bias_filler_ = new ::ditcaffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.EmbedParameter.bias_filler) + return bias_filler_; +} +::ditcaffe::FillerParameter* EmbedParameter::release_bias_filler() { + // @@protoc_insertion_point(field_release:ditcaffe.EmbedParameter.bias_filler) + clear_has_bias_filler(); + ::ditcaffe::FillerParameter* temp = bias_filler_; + bias_filler_ = NULL; + return temp; +} +void EmbedParameter::set_allocated_bias_filler(::ditcaffe::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:ditcaffe.EmbedParameter.bias_filler) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +static ::std::string* MutableUnknownFieldsForExpParameter( + ExpParameter* ptr) { + return ptr->mutable_unknown_fields(); +} + +#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::MessageLite(), _arena_ptr_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.ExpParameter) +} + +void ExpParameter::InitAsDefaultInstance() { +} + +ExpParameter::ExpParameter(const ExpParameter& from) + : ::google::protobuf::MessageLite(), + _arena_ptr_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.ExpParameter) +} + +void ExpParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + _unknown_fields_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + base_ = -1; + scale_ = 1; + shift_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ExpParameter::~ExpParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.ExpParameter) + SharedDtor(); +} + +void ExpParameter::SharedDtor() { + _unknown_fields_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void ExpParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ExpParameter& ExpParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +ExpParameter* ExpParameter::default_instance_ = NULL; + +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:ditcaffe.ExpParameter) + if (_has_bits_[0 / 32] & 7u) { + base_ = -1; + scale_ = 1; + shift_ = 0; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + _unknown_fields_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +bool ExpParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::internal::NewPermanentCallback( + &MutableUnknownFieldsForExpParameter, this)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &base_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &scale_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &shift_))); + set_has_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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.ExpParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.ExpParameter) + return false; +#undef DO_ +} + +void ExpParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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); + } + + output->WriteRaw(unknown_fields().data(), + static_cast(unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:ditcaffe.ExpParameter) +} + +int ExpParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.ExpParameter) + int 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; + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ExpParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void ExpParameter::MergeFrom(const ExpParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.ExpParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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.unknown_fields().empty()) { + mutable_unknown_fields()->append(from.unknown_fields()); + } +} + +void ExpParameter::CopyFrom(const ExpParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.ExpParameter) + if (&from == this) return; + Clear(); + MergeFrom(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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); +} + +::std::string ExpParameter::GetTypeName() const { + return "ditcaffe.ExpParameter"; +} + +#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:ditcaffe.ExpParameter.base) + return base_; +} + void ExpParameter::set_base(float value) { + set_has_base(); + base_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.ExpParameter.scale) + return scale_; +} + void ExpParameter::set_scale(float value) { + set_has_scale(); + scale_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.ExpParameter.shift) + return shift_; +} + void ExpParameter::set_shift(float value) { + set_has_shift(); + shift_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.ExpParameter.shift) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +static ::std::string* MutableUnknownFieldsForFlattenParameter( + FlattenParameter* ptr) { + return ptr->mutable_unknown_fields(); +} + +#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::MessageLite(), _arena_ptr_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.FlattenParameter) +} + +void FlattenParameter::InitAsDefaultInstance() { +} + +FlattenParameter::FlattenParameter(const FlattenParameter& from) + : ::google::protobuf::MessageLite(), + _arena_ptr_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.FlattenParameter) +} + +void FlattenParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + _unknown_fields_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + axis_ = 1; + end_axis_ = -1; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +FlattenParameter::~FlattenParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.FlattenParameter) + SharedDtor(); +} + +void FlattenParameter::SharedDtor() { + _unknown_fields_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void FlattenParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const FlattenParameter& FlattenParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +FlattenParameter* FlattenParameter::default_instance_ = NULL; + +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:ditcaffe.FlattenParameter) + if (_has_bits_[0 / 32] & 3u) { + axis_ = 1; + end_axis_ = -1; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + _unknown_fields_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +bool FlattenParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::internal::NewPermanentCallback( + &MutableUnknownFieldsForFlattenParameter, this)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &end_axis_))); + set_has_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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.FlattenParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.FlattenParameter) + return false; +#undef DO_ +} + +void FlattenParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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); + } + + output->WriteRaw(unknown_fields().data(), + static_cast(unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:ditcaffe.FlattenParameter) +} + +int FlattenParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.FlattenParameter) + int 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()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void FlattenParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void FlattenParameter::MergeFrom(const FlattenParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.FlattenParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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.unknown_fields().empty()) { + mutable_unknown_fields()->append(from.unknown_fields()); + } +} + +void FlattenParameter::CopyFrom(const FlattenParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.FlattenParameter) + if (&from == this) return; + Clear(); + MergeFrom(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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); +} + +::std::string FlattenParameter::GetTypeName() const { + return "ditcaffe.FlattenParameter"; +} + +#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:ditcaffe.FlattenParameter.axis) + return axis_; +} + void FlattenParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.FlattenParameter.end_axis) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +static ::std::string* MutableUnknownFieldsForHDF5DataParameter( + HDF5DataParameter* ptr) { + return ptr->mutable_unknown_fields(); +} + +#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::MessageLite(), _arena_ptr_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.HDF5DataParameter) +} + +void HDF5DataParameter::InitAsDefaultInstance() { +} + +HDF5DataParameter::HDF5DataParameter(const HDF5DataParameter& from) + : ::google::protobuf::MessageLite(), + _arena_ptr_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.HDF5DataParameter) +} + +void HDF5DataParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + _unknown_fields_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + source_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + batch_size_ = 0u; + shuffle_ = false; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +HDF5DataParameter::~HDF5DataParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.HDF5DataParameter) + SharedDtor(); +} + +void HDF5DataParameter::SharedDtor() { + _unknown_fields_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + source_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void HDF5DataParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const HDF5DataParameter& HDF5DataParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +HDF5DataParameter* HDF5DataParameter::default_instance_ = NULL; + +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:ditcaffe.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_ + + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + _unknown_fields_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +bool HDF5DataParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::internal::NewPermanentCallback( + &MutableUnknownFieldsForHDF5DataParameter, this)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:ditcaffe.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())); + } 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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &batch_size_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &shuffle_))); + set_has_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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.HDF5DataParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.HDF5DataParameter) + return false; +#undef DO_ +} + +void HDF5DataParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.HDF5DataParameter) + // optional string source = 1; + if (has_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); + } + + output->WriteRaw(unknown_fields().data(), + static_cast(unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:ditcaffe.HDF5DataParameter) +} + +int HDF5DataParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.HDF5DataParameter) + int 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; + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void HDF5DataParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void HDF5DataParameter::MergeFrom(const HDF5DataParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.HDF5DataParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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.unknown_fields().empty()) { + mutable_unknown_fields()->append(from.unknown_fields()); + } +} + +void HDF5DataParameter::CopyFrom(const HDF5DataParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.HDF5DataParameter) + if (&from == this) return; + Clear(); + MergeFrom(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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); +} + +::std::string HDF5DataParameter::GetTypeName() const { + return "ditcaffe.HDF5DataParameter"; +} + +#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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.HDF5DataParameter.source) +} + ::std::string* HDF5DataParameter::mutable_source() { + set_has_source(); + // @@protoc_insertion_point(field_mutable:ditcaffe.HDF5DataParameter.source) + return source_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* HDF5DataParameter::release_source() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.HDF5DataParameter.shuffle) + return shuffle_; +} + void HDF5DataParameter::set_shuffle(bool value) { + set_has_shuffle(); + shuffle_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.HDF5DataParameter.shuffle) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +static ::std::string* MutableUnknownFieldsForHDF5OutputParameter( + HDF5OutputParameter* ptr) { + return ptr->mutable_unknown_fields(); +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int HDF5OutputParameter::kFileNameFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +HDF5OutputParameter::HDF5OutputParameter() + : ::google::protobuf::MessageLite(), _arena_ptr_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.HDF5OutputParameter) +} + +void HDF5OutputParameter::InitAsDefaultInstance() { +} + +HDF5OutputParameter::HDF5OutputParameter(const HDF5OutputParameter& from) + : ::google::protobuf::MessageLite(), + _arena_ptr_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.HDF5OutputParameter) +} + +void HDF5OutputParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + _unknown_fields_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + file_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +HDF5OutputParameter::~HDF5OutputParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.HDF5OutputParameter) + SharedDtor(); +} + +void HDF5OutputParameter::SharedDtor() { + _unknown_fields_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + file_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void HDF5OutputParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const HDF5OutputParameter& HDF5OutputParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +HDF5OutputParameter* HDF5OutputParameter::default_instance_ = NULL; + +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:ditcaffe.HDF5OutputParameter) + if (has_file_name()) { + file_name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + _unknown_fields_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +bool HDF5OutputParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::internal::NewPermanentCallback( + &MutableUnknownFieldsForHDF5OutputParameter, this)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:ditcaffe.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())); + } 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, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.HDF5OutputParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.HDF5OutputParameter) + return false; +#undef DO_ +} + +void HDF5OutputParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.HDF5OutputParameter) + // optional string file_name = 1; + if (has_file_name()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->file_name(), output); + } + + output->WriteRaw(unknown_fields().data(), + static_cast(unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:ditcaffe.HDF5OutputParameter) +} + +int HDF5OutputParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.HDF5OutputParameter) + int total_size = 0; + + // optional string file_name = 1; + if (has_file_name()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->file_name()); + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void HDF5OutputParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void HDF5OutputParameter::MergeFrom(const HDF5OutputParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.HDF5OutputParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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.unknown_fields().empty()) { + mutable_unknown_fields()->append(from.unknown_fields()); + } +} + +void HDF5OutputParameter::CopyFrom(const HDF5OutputParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.HDF5OutputParameter) + if (&from == this) return; + Clear(); + MergeFrom(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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); +} + +::std::string HDF5OutputParameter::GetTypeName() const { + return "ditcaffe.HDF5OutputParameter"; +} + +#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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.HDF5OutputParameter.file_name) +} + ::std::string* HDF5OutputParameter::mutable_file_name() { + set_has_file_name(); + // @@protoc_insertion_point(field_mutable:ditcaffe.HDF5OutputParameter.file_name) + return file_name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* HDF5OutputParameter::release_file_name() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.HDF5OutputParameter.file_name) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +static ::std::string* MutableUnknownFieldsForHingeLossParameter( + HingeLossParameter* ptr) { + return ptr->mutable_unknown_fields(); +} + +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::MessageLite(), _arena_ptr_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.HingeLossParameter) +} + +void HingeLossParameter::InitAsDefaultInstance() { +} + +HingeLossParameter::HingeLossParameter(const HingeLossParameter& from) + : ::google::protobuf::MessageLite(), + _arena_ptr_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.HingeLossParameter) +} + +void HingeLossParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + _unknown_fields_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + norm_ = 1; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +HingeLossParameter::~HingeLossParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.HingeLossParameter) + SharedDtor(); +} + +void HingeLossParameter::SharedDtor() { + _unknown_fields_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void HingeLossParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const HingeLossParameter& HingeLossParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +HingeLossParameter* HingeLossParameter::default_instance_ = NULL; + +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:ditcaffe.HingeLossParameter) + norm_ = 1; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + _unknown_fields_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +bool HingeLossParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::internal::NewPermanentCallback( + &MutableUnknownFieldsForHingeLossParameter, this)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:ditcaffe.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 .ditcaffe.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 (::ditcaffe::HingeLossParameter_Norm_IsValid(value)) { + set_norm(static_cast< ::ditcaffe::HingeLossParameter_Norm >(value)); + } else { + unknown_fields_stream.WriteVarint32(8); + unknown_fields_stream.WriteVarint32(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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.HingeLossParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.HingeLossParameter) + return false; +#undef DO_ +} + +void HingeLossParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.HingeLossParameter) + // optional .ditcaffe.HingeLossParameter.Norm norm = 1 [default = L1]; + if (has_norm()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 1, this->norm(), output); + } + + output->WriteRaw(unknown_fields().data(), + static_cast(unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:ditcaffe.HingeLossParameter) +} + +int HingeLossParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.HingeLossParameter) + int total_size = 0; + + // optional .ditcaffe.HingeLossParameter.Norm norm = 1 [default = L1]; + if (has_norm()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->norm()); + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void HingeLossParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void HingeLossParameter::MergeFrom(const HingeLossParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.HingeLossParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_norm()) { + set_norm(from.norm()); + } + } + if (!from.unknown_fields().empty()) { + mutable_unknown_fields()->append(from.unknown_fields()); + } +} + +void HingeLossParameter::CopyFrom(const HingeLossParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.HingeLossParameter) + if (&from == this) return; + Clear(); + MergeFrom(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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); +} + +::std::string HingeLossParameter::GetTypeName() const { + return "ditcaffe.HingeLossParameter"; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// HingeLossParameter + +// optional .ditcaffe.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(); +} + ::ditcaffe::HingeLossParameter_Norm HingeLossParameter::norm() const { + // @@protoc_insertion_point(field_get:ditcaffe.HingeLossParameter.norm) + return static_cast< ::ditcaffe::HingeLossParameter_Norm >(norm_); +} + void HingeLossParameter::set_norm(::ditcaffe::HingeLossParameter_Norm value) { + assert(::ditcaffe::HingeLossParameter_Norm_IsValid(value)); + set_has_norm(); + norm_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.HingeLossParameter.norm) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +static ::std::string* MutableUnknownFieldsForImageDataParameter( + ImageDataParameter* ptr) { + return ptr->mutable_unknown_fields(); +} + +#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::MessageLite(), _arena_ptr_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.ImageDataParameter) +} + +void ImageDataParameter::InitAsDefaultInstance() { +} + +ImageDataParameter::ImageDataParameter(const ImageDataParameter& from) + : ::google::protobuf::MessageLite(), + _arena_ptr_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.ImageDataParameter) +} + +void ImageDataParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + _unknown_fields_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + source_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + batch_size_ = 1u; + rand_skip_ = 0u; + shuffle_ = false; + new_height_ = 0u; + new_width_ = 0u; + is_color_ = true; + scale_ = 1; + mean_file_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + crop_size_ = 0u; + mirror_ = false; + root_folder_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ImageDataParameter::~ImageDataParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.ImageDataParameter) + SharedDtor(); +} + +void ImageDataParameter::SharedDtor() { + _unknown_fields_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + source_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + mean_file_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + root_folder_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void ImageDataParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ImageDataParameter& ImageDataParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +ImageDataParameter* ImageDataParameter::default_instance_ = NULL; + +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:ditcaffe.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) { + if (has_mean_file()) { + mean_file_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + crop_size_ = 0u; + mirror_ = false; + if (has_root_folder()) { + root_folder_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + } + +#undef ZR_HELPER_ +#undef ZR_ + + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + _unknown_fields_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +bool ImageDataParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::internal::NewPermanentCallback( + &MutableUnknownFieldsForImageDataParameter, this)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:ditcaffe.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())); + } 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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &scale_))); + set_has_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())); + } 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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &batch_size_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &crop_size_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &mirror_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &rand_skip_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &shuffle_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &new_height_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &new_width_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &is_color_))); + set_has_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())); + } 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, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.ImageDataParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.ImageDataParameter) + return false; +#undef DO_ +} + +void ImageDataParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.ImageDataParameter) + // optional string source = 1; + if (has_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::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::WireFormatLite::WriteStringMaybeAliased( + 12, this->root_folder(), output); + } + + output->WriteRaw(unknown_fields().data(), + static_cast(unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:ditcaffe.ImageDataParameter) +} + +int ImageDataParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.ImageDataParameter) + int 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()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ImageDataParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void ImageDataParameter::MergeFrom(const ImageDataParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.ImageDataParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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.unknown_fields().empty()) { + mutable_unknown_fields()->append(from.unknown_fields()); + } +} + +void ImageDataParameter::CopyFrom(const ImageDataParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.ImageDataParameter) + if (&from == this) return; + Clear(); + MergeFrom(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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); +} + +::std::string ImageDataParameter::GetTypeName() const { + return "ditcaffe.ImageDataParameter"; +} + +#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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.ImageDataParameter.source) +} + ::std::string* ImageDataParameter::mutable_source() { + set_has_source(); + // @@protoc_insertion_point(field_mutable:ditcaffe.ImageDataParameter.source) + return source_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* ImageDataParameter::release_source() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.ImageDataParameter.shuffle) + return shuffle_; +} + void ImageDataParameter::set_shuffle(bool value) { + set_has_shuffle(); + shuffle_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.ImageDataParameter.scale) + return scale_; +} + void ImageDataParameter::set_scale(float value) { + set_has_scale(); + scale_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.ImageDataParameter.mean_file) +} + ::std::string* ImageDataParameter::mutable_mean_file() { + set_has_mean_file(); + // @@protoc_insertion_point(field_mutable:ditcaffe.ImageDataParameter.mean_file) + return mean_file_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* ImageDataParameter::release_mean_file() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.ImageDataParameter.mirror) + return mirror_; +} + void ImageDataParameter::set_mirror(bool value) { + set_has_mirror(); + mirror_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.ImageDataParameter.root_folder) +} + ::std::string* ImageDataParameter::mutable_root_folder() { + set_has_root_folder(); + // @@protoc_insertion_point(field_mutable:ditcaffe.ImageDataParameter.root_folder) + return root_folder_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* ImageDataParameter::release_root_folder() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.ImageDataParameter.root_folder) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +static ::std::string* MutableUnknownFieldsForInfogainLossParameter( + InfogainLossParameter* ptr) { + return ptr->mutable_unknown_fields(); +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int InfogainLossParameter::kSourceFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +InfogainLossParameter::InfogainLossParameter() + : ::google::protobuf::MessageLite(), _arena_ptr_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.InfogainLossParameter) +} + +void InfogainLossParameter::InitAsDefaultInstance() { +} + +InfogainLossParameter::InfogainLossParameter(const InfogainLossParameter& from) + : ::google::protobuf::MessageLite(), + _arena_ptr_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.InfogainLossParameter) +} + +void InfogainLossParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + _unknown_fields_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + source_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +InfogainLossParameter::~InfogainLossParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.InfogainLossParameter) + SharedDtor(); +} + +void InfogainLossParameter::SharedDtor() { + _unknown_fields_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + source_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void InfogainLossParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const InfogainLossParameter& InfogainLossParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +InfogainLossParameter* InfogainLossParameter::default_instance_ = NULL; + +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:ditcaffe.InfogainLossParameter) + if (has_source()) { + source_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + _unknown_fields_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +bool InfogainLossParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::internal::NewPermanentCallback( + &MutableUnknownFieldsForInfogainLossParameter, this)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:ditcaffe.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())); + } 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, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.InfogainLossParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.InfogainLossParameter) + return false; +#undef DO_ +} + +void InfogainLossParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.InfogainLossParameter) + // optional string source = 1; + if (has_source()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->source(), output); + } + + output->WriteRaw(unknown_fields().data(), + static_cast(unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:ditcaffe.InfogainLossParameter) +} + +int InfogainLossParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.InfogainLossParameter) + int total_size = 0; + + // optional string source = 1; + if (has_source()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->source()); + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void InfogainLossParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void InfogainLossParameter::MergeFrom(const InfogainLossParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.InfogainLossParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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.unknown_fields().empty()) { + mutable_unknown_fields()->append(from.unknown_fields()); + } +} + +void InfogainLossParameter::CopyFrom(const InfogainLossParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.InfogainLossParameter) + if (&from == this) return; + Clear(); + MergeFrom(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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); +} + +::std::string InfogainLossParameter::GetTypeName() const { + return "ditcaffe.InfogainLossParameter"; +} + +#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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.InfogainLossParameter.source) +} + ::std::string* InfogainLossParameter::mutable_source() { + set_has_source(); + // @@protoc_insertion_point(field_mutable:ditcaffe.InfogainLossParameter.source) + return source_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* InfogainLossParameter::release_source() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.InfogainLossParameter.source) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +static ::std::string* MutableUnknownFieldsForInnerProductParameter( + InnerProductParameter* ptr) { + return ptr->mutable_unknown_fields(); +} + +#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::MessageLite(), _arena_ptr_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.InnerProductParameter) +} + +void InnerProductParameter::InitAsDefaultInstance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + weight_filler_ = const_cast< ::ditcaffe::FillerParameter*>( + ::ditcaffe::FillerParameter::internal_default_instance()); +#else + weight_filler_ = const_cast< ::ditcaffe::FillerParameter*>(&::ditcaffe::FillerParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + bias_filler_ = const_cast< ::ditcaffe::FillerParameter*>( + ::ditcaffe::FillerParameter::internal_default_instance()); +#else + bias_filler_ = const_cast< ::ditcaffe::FillerParameter*>(&::ditcaffe::FillerParameter::default_instance()); +#endif +} + +InnerProductParameter::InnerProductParameter(const InnerProductParameter& from) + : ::google::protobuf::MessageLite(), + _arena_ptr_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.InnerProductParameter) +} + +void InnerProductParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + _unknown_fields_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + num_output_ = 0u; + bias_term_ = true; + weight_filler_ = NULL; + bias_filler_ = NULL; + axis_ = 1; + transpose_ = false; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +InnerProductParameter::~InnerProductParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.InnerProductParameter) + SharedDtor(); +} + +void InnerProductParameter::SharedDtor() { + _unknown_fields_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + 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 InnerProductParameter& InnerProductParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +InnerProductParameter* InnerProductParameter::default_instance_ = NULL; + +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:ditcaffe.InnerProductParameter) + if (_has_bits_[0 / 32] & 63u) { + num_output_ = 0u; + bias_term_ = true; + if (has_weight_filler()) { + if (weight_filler_ != NULL) weight_filler_->::ditcaffe::FillerParameter::Clear(); + } + if (has_bias_filler()) { + if (bias_filler_ != NULL) bias_filler_->::ditcaffe::FillerParameter::Clear(); + } + axis_ = 1; + transpose_ = false; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + _unknown_fields_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +bool InnerProductParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::internal::NewPermanentCallback( + &MutableUnknownFieldsForInnerProductParameter, this)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &num_output_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &bias_term_))); + set_has_bias_term(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_weight_filler; + break; + } + + // optional .ditcaffe.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 .ditcaffe.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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &transpose_))); + set_has_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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.InnerProductParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.InnerProductParameter) + return false; +#undef DO_ +} + +void InnerProductParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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 .ditcaffe.FillerParameter weight_filler = 3; + if (has_weight_filler()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 3, *this->weight_filler_, output); + } + + // optional .ditcaffe.FillerParameter bias_filler = 4; + if (has_bias_filler()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 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); + } + + output->WriteRaw(unknown_fields().data(), + static_cast(unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:ditcaffe.InnerProductParameter) +} + +int InnerProductParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.InnerProductParameter) + int 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 .ditcaffe.FillerParameter weight_filler = 3; + if (has_weight_filler()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->weight_filler_); + } + + // optional .ditcaffe.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; + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void InnerProductParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void InnerProductParameter::MergeFrom(const InnerProductParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.InnerProductParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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()->::ditcaffe::FillerParameter::MergeFrom(from.weight_filler()); + } + if (from.has_bias_filler()) { + mutable_bias_filler()->::ditcaffe::FillerParameter::MergeFrom(from.bias_filler()); + } + if (from.has_axis()) { + set_axis(from.axis()); + } + if (from.has_transpose()) { + set_transpose(from.transpose()); + } + } + if (!from.unknown_fields().empty()) { + mutable_unknown_fields()->append(from.unknown_fields()); + } +} + +void InnerProductParameter::CopyFrom(const InnerProductParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.InnerProductParameter) + if (&from == this) return; + Clear(); + MergeFrom(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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); +} + +::std::string InnerProductParameter::GetTypeName() const { + return "ditcaffe.InnerProductParameter"; +} + +#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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.InnerProductParameter.bias_term) +} + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_weight_filler(); +} +const ::ditcaffe::FillerParameter& InnerProductParameter::weight_filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.InnerProductParameter.weight_filler) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return weight_filler_ != NULL ? *weight_filler_ : *default_instance().weight_filler_; +#else + return weight_filler_ != NULL ? *weight_filler_ : *default_instance_->weight_filler_; +#endif +} +::ditcaffe::FillerParameter* InnerProductParameter::mutable_weight_filler() { + set_has_weight_filler(); + if (weight_filler_ == NULL) { + weight_filler_ = new ::ditcaffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.InnerProductParameter.weight_filler) + return weight_filler_; +} +::ditcaffe::FillerParameter* InnerProductParameter::release_weight_filler() { + // @@protoc_insertion_point(field_release:ditcaffe.InnerProductParameter.weight_filler) + clear_has_weight_filler(); + ::ditcaffe::FillerParameter* temp = weight_filler_; + weight_filler_ = NULL; + return temp; +} +void InnerProductParameter::set_allocated_weight_filler(::ditcaffe::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:ditcaffe.InnerProductParameter.weight_filler) +} + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_bias_filler(); +} +const ::ditcaffe::FillerParameter& InnerProductParameter::bias_filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.InnerProductParameter.bias_filler) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return bias_filler_ != NULL ? *bias_filler_ : *default_instance().bias_filler_; +#else + return bias_filler_ != NULL ? *bias_filler_ : *default_instance_->bias_filler_; +#endif +} +::ditcaffe::FillerParameter* InnerProductParameter::mutable_bias_filler() { + set_has_bias_filler(); + if (bias_filler_ == NULL) { + bias_filler_ = new ::ditcaffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.InnerProductParameter.bias_filler) + return bias_filler_; +} +::ditcaffe::FillerParameter* InnerProductParameter::release_bias_filler() { + // @@protoc_insertion_point(field_release:ditcaffe.InnerProductParameter.bias_filler) + clear_has_bias_filler(); + ::ditcaffe::FillerParameter* temp = bias_filler_; + bias_filler_ = NULL; + return temp; +} +void InnerProductParameter::set_allocated_bias_filler(::ditcaffe::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:ditcaffe.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:ditcaffe.InnerProductParameter.axis) + return axis_; +} + void InnerProductParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.InnerProductParameter.transpose) + return transpose_; +} + void InnerProductParameter::set_transpose(bool value) { + set_has_transpose(); + transpose_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.InnerProductParameter.transpose) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +static ::std::string* MutableUnknownFieldsForInputParameter( + InputParameter* ptr) { + return ptr->mutable_unknown_fields(); +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int InputParameter::kShapeFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +InputParameter::InputParameter() + : ::google::protobuf::MessageLite(), _arena_ptr_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.InputParameter) +} + +void InputParameter::InitAsDefaultInstance() { +} + +InputParameter::InputParameter(const InputParameter& from) + : ::google::protobuf::MessageLite(), + _arena_ptr_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.InputParameter) +} + +void InputParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + _unknown_fields_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +InputParameter::~InputParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.InputParameter) + SharedDtor(); +} + +void InputParameter::SharedDtor() { + _unknown_fields_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void InputParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const InputParameter& InputParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +InputParameter* InputParameter::default_instance_ = NULL; + +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:ditcaffe.InputParameter) + shape_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + _unknown_fields_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +bool InputParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::internal::NewPermanentCallback( + &MutableUnknownFieldsForInputParameter, this)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:ditcaffe.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 .ditcaffe.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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.InputParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.InputParameter) + return false; +#undef DO_ +} + +void InputParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.InputParameter) + // repeated .ditcaffe.BlobShape shape = 1; + for (unsigned int i = 0, n = this->shape_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 1, this->shape(i), output); + } + + output->WriteRaw(unknown_fields().data(), + static_cast(unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:ditcaffe.InputParameter) +} + +int InputParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.InputParameter) + int total_size = 0; + + // repeated .ditcaffe.BlobShape shape = 1; + total_size += 1 * this->shape_size(); + for (int i = 0; i < this->shape_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->shape(i)); + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void InputParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void InputParameter::MergeFrom(const InputParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.InputParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + shape_.MergeFrom(from.shape_); + if (!from.unknown_fields().empty()) { + mutable_unknown_fields()->append(from.unknown_fields()); + } +} + +void InputParameter::CopyFrom(const InputParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.InputParameter) + if (&from == this) return; + Clear(); + MergeFrom(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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); +} + +::std::string InputParameter::GetTypeName() const { + return "ditcaffe.InputParameter"; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// InputParameter + +// repeated .ditcaffe.BlobShape shape = 1; +int InputParameter::shape_size() const { + return shape_.size(); +} +void InputParameter::clear_shape() { + shape_.Clear(); +} +const ::ditcaffe::BlobShape& InputParameter::shape(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.InputParameter.shape) + return shape_.Get(index); +} +::ditcaffe::BlobShape* InputParameter::mutable_shape(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.InputParameter.shape) + return shape_.Mutable(index); +} +::ditcaffe::BlobShape* InputParameter::add_shape() { + // @@protoc_insertion_point(field_add:ditcaffe.InputParameter.shape) + return shape_.Add(); +} +::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobShape >* +InputParameter::mutable_shape() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.InputParameter.shape) + return &shape_; +} +const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobShape >& +InputParameter::shape() const { + // @@protoc_insertion_point(field_list:ditcaffe.InputParameter.shape) + return shape_; +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +static ::std::string* MutableUnknownFieldsForLogParameter( + LogParameter* ptr) { + return ptr->mutable_unknown_fields(); +} + +#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::MessageLite(), _arena_ptr_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.LogParameter) +} + +void LogParameter::InitAsDefaultInstance() { +} + +LogParameter::LogParameter(const LogParameter& from) + : ::google::protobuf::MessageLite(), + _arena_ptr_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.LogParameter) +} + +void LogParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + _unknown_fields_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + base_ = -1; + scale_ = 1; + shift_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +LogParameter::~LogParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.LogParameter) + SharedDtor(); +} + +void LogParameter::SharedDtor() { + _unknown_fields_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void LogParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const LogParameter& LogParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +LogParameter* LogParameter::default_instance_ = NULL; + +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:ditcaffe.LogParameter) + if (_has_bits_[0 / 32] & 7u) { + base_ = -1; + scale_ = 1; + shift_ = 0; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + _unknown_fields_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +bool LogParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::internal::NewPermanentCallback( + &MutableUnknownFieldsForLogParameter, this)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &base_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &scale_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &shift_))); + set_has_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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.LogParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.LogParameter) + return false; +#undef DO_ +} + +void LogParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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); + } + + output->WriteRaw(unknown_fields().data(), + static_cast(unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:ditcaffe.LogParameter) +} + +int LogParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.LogParameter) + int 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; + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void LogParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void LogParameter::MergeFrom(const LogParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.LogParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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.unknown_fields().empty()) { + mutable_unknown_fields()->append(from.unknown_fields()); + } +} + +void LogParameter::CopyFrom(const LogParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.LogParameter) + if (&from == this) return; + Clear(); + MergeFrom(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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); +} + +::std::string LogParameter::GetTypeName() const { + return "ditcaffe.LogParameter"; +} + +#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:ditcaffe.LogParameter.base) + return base_; +} + void LogParameter::set_base(float value) { + set_has_base(); + base_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.LogParameter.scale) + return scale_; +} + void LogParameter::set_scale(float value) { + set_has_scale(); + scale_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.LogParameter.shift) + return shift_; +} + void LogParameter::set_shift(float value) { + set_has_shift(); + shift_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.LogParameter.shift) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +static ::std::string* MutableUnknownFieldsForLRNParameter( + LRNParameter* ptr) { + return ptr->mutable_unknown_fields(); +} + +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 +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::MessageLite(), _arena_ptr_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.LRNParameter) +} + +void LRNParameter::InitAsDefaultInstance() { +} + +LRNParameter::LRNParameter(const LRNParameter& from) + : ::google::protobuf::MessageLite(), + _arena_ptr_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.LRNParameter) +} + +void LRNParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + _unknown_fields_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + local_size_ = 5u; + alpha_ = 1; + beta_ = 0.75f; + norm_region_ = 0; + k_ = 1; + engine_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +LRNParameter::~LRNParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.LRNParameter) + SharedDtor(); +} + +void LRNParameter::SharedDtor() { + _unknown_fields_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void LRNParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const LRNParameter& LRNParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +LRNParameter* LRNParameter::default_instance_ = NULL; + +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:ditcaffe.LRNParameter) + if (_has_bits_[0 / 32] & 63u) { + local_size_ = 5u; + alpha_ = 1; + beta_ = 0.75f; + norm_region_ = 0; + k_ = 1; + engine_ = 0; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + _unknown_fields_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +bool LRNParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::internal::NewPermanentCallback( + &MutableUnknownFieldsForLRNParameter, this)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &local_size_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &alpha_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &beta_))); + set_has_beta(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(32)) goto parse_norm_region; + break; + } + + // optional .ditcaffe.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 (::ditcaffe::LRNParameter_NormRegion_IsValid(value)) { + set_norm_region(static_cast< ::ditcaffe::LRNParameter_NormRegion >(value)); + } else { + unknown_fields_stream.WriteVarint32(32); + unknown_fields_stream.WriteVarint32(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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &k_))); + set_has_k(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(48)) goto parse_engine; + break; + } + + // optional .ditcaffe.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 (::ditcaffe::LRNParameter_Engine_IsValid(value)) { + set_engine(static_cast< ::ditcaffe::LRNParameter_Engine >(value)); + } else { + unknown_fields_stream.WriteVarint32(48); + unknown_fields_stream.WriteVarint32(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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.LRNParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.LRNParameter) + return false; +#undef DO_ +} + +void LRNParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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 .ditcaffe.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 .ditcaffe.LRNParameter.Engine engine = 6 [default = DEFAULT]; + if (has_engine()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 6, this->engine(), output); + } + + output->WriteRaw(unknown_fields().data(), + static_cast(unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:ditcaffe.LRNParameter) +} + +int LRNParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.LRNParameter) + int 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 .ditcaffe.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 .ditcaffe.LRNParameter.Engine engine = 6 [default = DEFAULT]; + if (has_engine()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->engine()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void LRNParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void LRNParameter::MergeFrom(const LRNParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.LRNParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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.unknown_fields().empty()) { + mutable_unknown_fields()->append(from.unknown_fields()); + } +} + +void LRNParameter::CopyFrom(const LRNParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.LRNParameter) + if (&from == this) return; + Clear(); + MergeFrom(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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); +} + +::std::string LRNParameter::GetTypeName() const { + return "ditcaffe.LRNParameter"; +} + +#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:ditcaffe.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:ditcaffe.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:ditcaffe.LRNParameter.alpha) + return alpha_; +} + void LRNParameter::set_alpha(float value) { + set_has_alpha(); + alpha_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.LRNParameter.beta) + return beta_; +} + void LRNParameter::set_beta(float value) { + set_has_beta(); + beta_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.LRNParameter.beta) +} + +// optional .ditcaffe.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(); +} + ::ditcaffe::LRNParameter_NormRegion LRNParameter::norm_region() const { + // @@protoc_insertion_point(field_get:ditcaffe.LRNParameter.norm_region) + return static_cast< ::ditcaffe::LRNParameter_NormRegion >(norm_region_); +} + void LRNParameter::set_norm_region(::ditcaffe::LRNParameter_NormRegion value) { + assert(::ditcaffe::LRNParameter_NormRegion_IsValid(value)); + set_has_norm_region(); + norm_region_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.LRNParameter.k) + return k_; +} + void LRNParameter::set_k(float value) { + set_has_k(); + k_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.LRNParameter.k) +} + +// optional .ditcaffe.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(); +} + ::ditcaffe::LRNParameter_Engine LRNParameter::engine() const { + // @@protoc_insertion_point(field_get:ditcaffe.LRNParameter.engine) + return static_cast< ::ditcaffe::LRNParameter_Engine >(engine_); +} + void LRNParameter::set_engine(::ditcaffe::LRNParameter_Engine value) { + assert(::ditcaffe::LRNParameter_Engine_IsValid(value)); + set_has_engine(); + engine_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.LRNParameter.engine) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +static ::std::string* MutableUnknownFieldsForMemoryDataParameter( + MemoryDataParameter* ptr) { + return ptr->mutable_unknown_fields(); +} + +#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::MessageLite(), _arena_ptr_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.MemoryDataParameter) +} + +void MemoryDataParameter::InitAsDefaultInstance() { +} + +MemoryDataParameter::MemoryDataParameter(const MemoryDataParameter& from) + : ::google::protobuf::MessageLite(), + _arena_ptr_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.MemoryDataParameter) +} + +void MemoryDataParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + _unknown_fields_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + batch_size_ = 0u; + channels_ = 0u; + height_ = 0u; + width_ = 0u; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +MemoryDataParameter::~MemoryDataParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.MemoryDataParameter) + SharedDtor(); +} + +void MemoryDataParameter::SharedDtor() { + _unknown_fields_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void MemoryDataParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const MemoryDataParameter& MemoryDataParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +MemoryDataParameter* MemoryDataParameter::default_instance_ = NULL; + +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:ditcaffe.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_ + + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + _unknown_fields_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +bool MemoryDataParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::internal::NewPermanentCallback( + &MutableUnknownFieldsForMemoryDataParameter, this)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &batch_size_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &channels_))); + set_has_channels(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(24)) goto parse_height; + break; + } + + // optional uint32 height = 3; + case 3: { + if (tag == 24) { + parse_height: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &height_))); + set_has_height(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(32)) goto parse_width; + break; + } + + // optional uint32 width = 4; + case 4: { + if (tag == 32) { + parse_width: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &width_))); + set_has_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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.MemoryDataParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.MemoryDataParameter) + return false; +#undef DO_ +} + +void MemoryDataParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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); + } + + output->WriteRaw(unknown_fields().data(), + static_cast(unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:ditcaffe.MemoryDataParameter) +} + +int MemoryDataParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.MemoryDataParameter) + int 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()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void MemoryDataParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void MemoryDataParameter::MergeFrom(const MemoryDataParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.MemoryDataParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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.unknown_fields().empty()) { + mutable_unknown_fields()->append(from.unknown_fields()); + } +} + +void MemoryDataParameter::CopyFrom(const MemoryDataParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.MemoryDataParameter) + if (&from == this) return; + Clear(); + MergeFrom(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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); +} + +::std::string MemoryDataParameter::GetTypeName() const { + return "ditcaffe.MemoryDataParameter"; +} + +#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:ditcaffe.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:ditcaffe.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:ditcaffe.MemoryDataParameter.channels) + return channels_; +} + void MemoryDataParameter::set_channels(::google::protobuf::uint32 value) { + set_has_channels(); + channels_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.MemoryDataParameter.height) + return height_; +} + void MemoryDataParameter::set_height(::google::protobuf::uint32 value) { + set_has_height(); + height_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.MemoryDataParameter.width) + return width_; +} + void MemoryDataParameter::set_width(::google::protobuf::uint32 value) { + set_has_width(); + width_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.MemoryDataParameter.width) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +static ::std::string* MutableUnknownFieldsForMVNParameter( + MVNParameter* ptr) { + return ptr->mutable_unknown_fields(); +} + +#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::MessageLite(), _arena_ptr_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.MVNParameter) +} + +void MVNParameter::InitAsDefaultInstance() { +} + +MVNParameter::MVNParameter(const MVNParameter& from) + : ::google::protobuf::MessageLite(), + _arena_ptr_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.MVNParameter) +} + +void MVNParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + _unknown_fields_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + normalize_variance_ = true; + across_channels_ = false; + eps_ = 1e-09f; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +MVNParameter::~MVNParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.MVNParameter) + SharedDtor(); +} + +void MVNParameter::SharedDtor() { + _unknown_fields_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void MVNParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const MVNParameter& MVNParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +MVNParameter* MVNParameter::default_instance_ = NULL; + +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:ditcaffe.MVNParameter) + if (_has_bits_[0 / 32] & 7u) { + normalize_variance_ = true; + across_channels_ = false; + eps_ = 1e-09f; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + _unknown_fields_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +bool MVNParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::internal::NewPermanentCallback( + &MutableUnknownFieldsForMVNParameter, this)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &normalize_variance_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &across_channels_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &eps_))); + set_has_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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.MVNParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.MVNParameter) + return false; +#undef DO_ +} + +void MVNParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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); + } + + output->WriteRaw(unknown_fields().data(), + static_cast(unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:ditcaffe.MVNParameter) +} + +int MVNParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.MVNParameter) + int 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; + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void MVNParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void MVNParameter::MergeFrom(const MVNParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.MVNParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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.unknown_fields().empty()) { + mutable_unknown_fields()->append(from.unknown_fields()); + } +} + +void MVNParameter::CopyFrom(const MVNParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.MVNParameter) + if (&from == this) return; + Clear(); + MergeFrom(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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); +} + +::std::string MVNParameter::GetTypeName() const { + return "ditcaffe.MVNParameter"; +} + +#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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.MVNParameter.eps) + return eps_; +} + void MVNParameter::set_eps(float value) { + set_has_eps(); + eps_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.MVNParameter.eps) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +static ::std::string* MutableUnknownFieldsForParameterParameter( + ParameterParameter* ptr) { + return ptr->mutable_unknown_fields(); +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ParameterParameter::kShapeFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ParameterParameter::ParameterParameter() + : ::google::protobuf::MessageLite(), _arena_ptr_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.ParameterParameter) +} + +void ParameterParameter::InitAsDefaultInstance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + shape_ = const_cast< ::ditcaffe::BlobShape*>( + ::ditcaffe::BlobShape::internal_default_instance()); +#else + shape_ = const_cast< ::ditcaffe::BlobShape*>(&::ditcaffe::BlobShape::default_instance()); +#endif +} + +ParameterParameter::ParameterParameter(const ParameterParameter& from) + : ::google::protobuf::MessageLite(), + _arena_ptr_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.ParameterParameter) +} + +void ParameterParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + _unknown_fields_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + shape_ = NULL; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ParameterParameter::~ParameterParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.ParameterParameter) + SharedDtor(); +} + +void ParameterParameter::SharedDtor() { + _unknown_fields_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + delete shape_; + } +} + +void ParameterParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ParameterParameter& ParameterParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +ParameterParameter* ParameterParameter::default_instance_ = NULL; + +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:ditcaffe.ParameterParameter) + if (has_shape()) { + if (shape_ != NULL) shape_->::ditcaffe::BlobShape::Clear(); + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + _unknown_fields_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +bool ParameterParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::internal::NewPermanentCallback( + &MutableUnknownFieldsForParameterParameter, this)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:ditcaffe.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 .ditcaffe.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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.ParameterParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.ParameterParameter) + return false; +#undef DO_ +} + +void ParameterParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.ParameterParameter) + // optional .ditcaffe.BlobShape shape = 1; + if (has_shape()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 1, *this->shape_, output); + } + + output->WriteRaw(unknown_fields().data(), + static_cast(unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:ditcaffe.ParameterParameter) +} + +int ParameterParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.ParameterParameter) + int total_size = 0; + + // optional .ditcaffe.BlobShape shape = 1; + if (has_shape()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->shape_); + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ParameterParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void ParameterParameter::MergeFrom(const ParameterParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.ParameterParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_shape()) { + mutable_shape()->::ditcaffe::BlobShape::MergeFrom(from.shape()); + } + } + if (!from.unknown_fields().empty()) { + mutable_unknown_fields()->append(from.unknown_fields()); + } +} + +void ParameterParameter::CopyFrom(const ParameterParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.ParameterParameter) + if (&from == this) return; + Clear(); + MergeFrom(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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); +} + +::std::string ParameterParameter::GetTypeName() const { + return "ditcaffe.ParameterParameter"; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// ParameterParameter + +// optional .ditcaffe.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_->::ditcaffe::BlobShape::Clear(); + clear_has_shape(); +} +const ::ditcaffe::BlobShape& ParameterParameter::shape() const { + // @@protoc_insertion_point(field_get:ditcaffe.ParameterParameter.shape) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return shape_ != NULL ? *shape_ : *default_instance().shape_; +#else + return shape_ != NULL ? *shape_ : *default_instance_->shape_; +#endif +} +::ditcaffe::BlobShape* ParameterParameter::mutable_shape() { + set_has_shape(); + if (shape_ == NULL) { + shape_ = new ::ditcaffe::BlobShape; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.ParameterParameter.shape) + return shape_; +} +::ditcaffe::BlobShape* ParameterParameter::release_shape() { + // @@protoc_insertion_point(field_release:ditcaffe.ParameterParameter.shape) + clear_has_shape(); + ::ditcaffe::BlobShape* temp = shape_; + shape_ = NULL; + return temp; +} +void ParameterParameter::set_allocated_shape(::ditcaffe::BlobShape* shape) { + delete shape_; + shape_ = shape; + if (shape) { + set_has_shape(); + } else { + clear_has_shape(); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.ParameterParameter.shape) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +static ::std::string* MutableUnknownFieldsForPoolingParameter( + PoolingParameter* ptr) { + return ptr->mutable_unknown_fields(); +} + +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 +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; +const int PoolingParameter::kTorchPoolingFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +PoolingParameter::PoolingParameter() + : ::google::protobuf::MessageLite(), _arena_ptr_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.PoolingParameter) +} + +void PoolingParameter::InitAsDefaultInstance() { +} + +PoolingParameter::PoolingParameter(const PoolingParameter& from) + : ::google::protobuf::MessageLite(), + _arena_ptr_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.PoolingParameter) +} + +void PoolingParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + _unknown_fields_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + pool_ = 0; + pad_ = 0u; + pad_h_ = 0u; + pad_w_ = 0u; + kernel_size_ = 0u; + kernel_h_ = 0u; + kernel_w_ = 0u; + stride_ = 1u; + stride_h_ = 0u; + stride_w_ = 0u; + engine_ = 0; + global_pooling_ = false; + torch_pooling_ = false; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +PoolingParameter::~PoolingParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.PoolingParameter) + SharedDtor(); +} + +void PoolingParameter::SharedDtor() { + _unknown_fields_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void PoolingParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const PoolingParameter& PoolingParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +PoolingParameter* PoolingParameter::default_instance_ = NULL; + +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:ditcaffe.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; + } + if (_has_bits_[8 / 32] & 7936u) { + ZR_(stride_h_, torch_pooling_); + } + +#undef ZR_HELPER_ +#undef ZR_ + + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + _unknown_fields_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +bool PoolingParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::internal::NewPermanentCallback( + &MutableUnknownFieldsForPoolingParameter, this)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:ditcaffe.PoolingParameter) + 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 .ditcaffe.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 (::ditcaffe::PoolingParameter_PoolMethod_IsValid(value)) { + set_pool(static_cast< ::ditcaffe::PoolingParameter_PoolMethod >(value)); + } else { + unknown_fields_stream.WriteVarint32(8); + unknown_fields_stream.WriteVarint32(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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &kernel_size_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &stride_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &pad_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &kernel_h_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &kernel_w_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &stride_h_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &stride_w_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &pad_h_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &pad_w_))); + set_has_pad_w(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(88)) goto parse_engine; + break; + } + + // optional .ditcaffe.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 (::ditcaffe::PoolingParameter_Engine_IsValid(value)) { + set_engine(static_cast< ::ditcaffe::PoolingParameter_Engine >(value)); + } else { + unknown_fields_stream.WriteVarint32(88); + unknown_fields_stream.WriteVarint32(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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &global_pooling_))); + set_has_global_pooling(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(320)) goto parse_torch_pooling; + break; + } + + // optional bool torch_pooling = 40 [default = false]; + case 40: { + if (tag == 320) { + parse_torch_pooling: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &torch_pooling_))); + set_has_torch_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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.PoolingParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.PoolingParameter) + return false; +#undef DO_ +} + +void PoolingParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.PoolingParameter) + // optional .ditcaffe.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 .ditcaffe.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); + } + + // optional bool torch_pooling = 40 [default = false]; + if (has_torch_pooling()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(40, this->torch_pooling(), output); + } + + output->WriteRaw(unknown_fields().data(), + static_cast(unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:ditcaffe.PoolingParameter) +} + +int PoolingParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.PoolingParameter) + int total_size = 0; + + if (_has_bits_[0 / 32] & 255u) { + // optional .ditcaffe.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] & 7936u) { + // 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 .ditcaffe.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; + } + + // optional bool torch_pooling = 40 [default = false]; + if (has_torch_pooling()) { + total_size += 2 + 1; + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void PoolingParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void PoolingParameter::MergeFrom(const PoolingParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.PoolingParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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.has_torch_pooling()) { + set_torch_pooling(from.torch_pooling()); + } + } + if (!from.unknown_fields().empty()) { + mutable_unknown_fields()->append(from.unknown_fields()); + } +} + +void PoolingParameter::CopyFrom(const PoolingParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.PoolingParameter) + if (&from == this) return; + Clear(); + MergeFrom(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(torch_pooling_, other->torch_pooling_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); +} + +::std::string PoolingParameter::GetTypeName() const { + return "ditcaffe.PoolingParameter"; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// PoolingParameter + +// optional .ditcaffe.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(); +} + ::ditcaffe::PoolingParameter_PoolMethod PoolingParameter::pool() const { + // @@protoc_insertion_point(field_get:ditcaffe.PoolingParameter.pool) + return static_cast< ::ditcaffe::PoolingParameter_PoolMethod >(pool_); +} + void PoolingParameter::set_pool(::ditcaffe::PoolingParameter_PoolMethod value) { + assert(::ditcaffe::PoolingParameter_PoolMethod_IsValid(value)); + set_has_pool(); + pool_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.PoolingParameter.pad) + return pad_; +} + void PoolingParameter::set_pad(::google::protobuf::uint32 value) { + set_has_pad(); + pad_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.PoolingParameter.stride) + return stride_; +} + void PoolingParameter::set_stride(::google::protobuf::uint32 value) { + set_has_stride(); + stride_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.PoolingParameter.stride_w) +} + +// optional .ditcaffe.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(); +} + ::ditcaffe::PoolingParameter_Engine PoolingParameter::engine() const { + // @@protoc_insertion_point(field_get:ditcaffe.PoolingParameter.engine) + return static_cast< ::ditcaffe::PoolingParameter_Engine >(engine_); +} + void PoolingParameter::set_engine(::ditcaffe::PoolingParameter_Engine value) { + assert(::ditcaffe::PoolingParameter_Engine_IsValid(value)); + set_has_engine(); + engine_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.PoolingParameter.global_pooling) +} + +// optional bool torch_pooling = 40 [default = false]; +bool PoolingParameter::has_torch_pooling() const { + return (_has_bits_[0] & 0x00001000u) != 0; +} +void PoolingParameter::set_has_torch_pooling() { + _has_bits_[0] |= 0x00001000u; +} +void PoolingParameter::clear_has_torch_pooling() { + _has_bits_[0] &= ~0x00001000u; +} +void PoolingParameter::clear_torch_pooling() { + torch_pooling_ = false; + clear_has_torch_pooling(); +} + bool PoolingParameter::torch_pooling() const { + // @@protoc_insertion_point(field_get:ditcaffe.PoolingParameter.torch_pooling) + return torch_pooling_; +} + void PoolingParameter::set_torch_pooling(bool value) { + set_has_torch_pooling(); + torch_pooling_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.PoolingParameter.torch_pooling) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +static ::std::string* MutableUnknownFieldsForPowerParameter( + PowerParameter* ptr) { + return ptr->mutable_unknown_fields(); +} + +#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::MessageLite(), _arena_ptr_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.PowerParameter) +} + +void PowerParameter::InitAsDefaultInstance() { +} + +PowerParameter::PowerParameter(const PowerParameter& from) + : ::google::protobuf::MessageLite(), + _arena_ptr_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.PowerParameter) +} + +void PowerParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + _unknown_fields_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + power_ = 1; + scale_ = 1; + shift_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +PowerParameter::~PowerParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.PowerParameter) + SharedDtor(); +} + +void PowerParameter::SharedDtor() { + _unknown_fields_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void PowerParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const PowerParameter& PowerParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +PowerParameter* PowerParameter::default_instance_ = NULL; + +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:ditcaffe.PowerParameter) + if (_has_bits_[0 / 32] & 7u) { + power_ = 1; + scale_ = 1; + shift_ = 0; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + _unknown_fields_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +bool PowerParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::internal::NewPermanentCallback( + &MutableUnknownFieldsForPowerParameter, this)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &power_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &scale_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &shift_))); + set_has_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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.PowerParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.PowerParameter) + return false; +#undef DO_ +} + +void PowerParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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); + } + + output->WriteRaw(unknown_fields().data(), + static_cast(unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:ditcaffe.PowerParameter) +} + +int PowerParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.PowerParameter) + int 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; + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void PowerParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void PowerParameter::MergeFrom(const PowerParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.PowerParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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.unknown_fields().empty()) { + mutable_unknown_fields()->append(from.unknown_fields()); + } +} + +void PowerParameter::CopyFrom(const PowerParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.PowerParameter) + if (&from == this) return; + Clear(); + MergeFrom(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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); +} + +::std::string PowerParameter::GetTypeName() const { + return "ditcaffe.PowerParameter"; +} + +#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:ditcaffe.PowerParameter.power) + return power_; +} + void PowerParameter::set_power(float value) { + set_has_power(); + power_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.PowerParameter.scale) + return scale_; +} + void PowerParameter::set_scale(float value) { + set_has_scale(); + scale_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.PowerParameter.shift) + return shift_; +} + void PowerParameter::set_shift(float value) { + set_has_shift(); + shift_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.PowerParameter.shift) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +static ::std::string* MutableUnknownFieldsForPythonParameter( + PythonParameter* ptr) { + return ptr->mutable_unknown_fields(); +} + +#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::MessageLite(), _arena_ptr_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.PythonParameter) +} + +void PythonParameter::InitAsDefaultInstance() { +} + +PythonParameter::PythonParameter(const PythonParameter& from) + : ::google::protobuf::MessageLite(), + _arena_ptr_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.PythonParameter) +} + +void PythonParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + _unknown_fields_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + module_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + layer_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + param_str_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + share_in_parallel_ = false; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +PythonParameter::~PythonParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.PythonParameter) + SharedDtor(); +} + +void PythonParameter::SharedDtor() { + _unknown_fields_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + module_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + layer_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + param_str_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void PythonParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const PythonParameter& PythonParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +PythonParameter* PythonParameter::default_instance_ = NULL; + +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:ditcaffe.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; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + _unknown_fields_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +bool PythonParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::internal::NewPermanentCallback( + &MutableUnknownFieldsForPythonParameter, this)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:ditcaffe.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())); + } 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())); + } 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())); + } 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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &share_in_parallel_))); + set_has_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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.PythonParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.PythonParameter) + return false; +#undef DO_ +} + +void PythonParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.PythonParameter) + // optional string module = 1; + if (has_module()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->module(), output); + } + + // optional string layer = 2; + if (has_layer()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->layer(), output); + } + + // optional string param_str = 3 [default = ""]; + if (has_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); + } + + output->WriteRaw(unknown_fields().data(), + static_cast(unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:ditcaffe.PythonParameter) +} + +int PythonParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.PythonParameter) + int 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; + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void PythonParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void PythonParameter::MergeFrom(const PythonParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.PythonParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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.unknown_fields().empty()) { + mutable_unknown_fields()->append(from.unknown_fields()); + } +} + +void PythonParameter::CopyFrom(const PythonParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.PythonParameter) + if (&from == this) return; + Clear(); + MergeFrom(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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); +} + +::std::string PythonParameter::GetTypeName() const { + return "ditcaffe.PythonParameter"; +} + +#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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.PythonParameter.module) +} + ::std::string* PythonParameter::mutable_module() { + set_has_module(); + // @@protoc_insertion_point(field_mutable:ditcaffe.PythonParameter.module) + return module_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* PythonParameter::release_module() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.PythonParameter.layer) +} + ::std::string* PythonParameter::mutable_layer() { + set_has_layer(); + // @@protoc_insertion_point(field_mutable:ditcaffe.PythonParameter.layer) + return layer_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* PythonParameter::release_layer() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.PythonParameter.param_str) +} + ::std::string* PythonParameter::mutable_param_str() { + set_has_param_str(); + // @@protoc_insertion_point(field_mutable:ditcaffe.PythonParameter.param_str) + return param_str_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* PythonParameter::release_param_str() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.PythonParameter.share_in_parallel) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +static ::std::string* MutableUnknownFieldsForReductionParameter( + ReductionParameter* ptr) { + return ptr->mutable_unknown_fields(); +} + +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::MessageLite(), _arena_ptr_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.ReductionParameter) +} + +void ReductionParameter::InitAsDefaultInstance() { +} + +ReductionParameter::ReductionParameter(const ReductionParameter& from) + : ::google::protobuf::MessageLite(), + _arena_ptr_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.ReductionParameter) +} + +void ReductionParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + _unknown_fields_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + operation_ = 1; + axis_ = 0; + coeff_ = 1; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ReductionParameter::~ReductionParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.ReductionParameter) + SharedDtor(); +} + +void ReductionParameter::SharedDtor() { + _unknown_fields_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void ReductionParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ReductionParameter& ReductionParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +ReductionParameter* ReductionParameter::default_instance_ = NULL; + +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:ditcaffe.ReductionParameter) + if (_has_bits_[0 / 32] & 7u) { + operation_ = 1; + axis_ = 0; + coeff_ = 1; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + _unknown_fields_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +bool ReductionParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::internal::NewPermanentCallback( + &MutableUnknownFieldsForReductionParameter, this)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:ditcaffe.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 .ditcaffe.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 (::ditcaffe::ReductionParameter_ReductionOp_IsValid(value)) { + set_operation(static_cast< ::ditcaffe::ReductionParameter_ReductionOp >(value)); + } else { + unknown_fields_stream.WriteVarint32(8); + unknown_fields_stream.WriteVarint32(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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &coeff_))); + set_has_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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.ReductionParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.ReductionParameter) + return false; +#undef DO_ +} + +void ReductionParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.ReductionParameter) + // optional .ditcaffe.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); + } + + output->WriteRaw(unknown_fields().data(), + static_cast(unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:ditcaffe.ReductionParameter) +} + +int ReductionParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.ReductionParameter) + int total_size = 0; + + if (_has_bits_[0 / 32] & 7u) { + // optional .ditcaffe.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; + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ReductionParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void ReductionParameter::MergeFrom(const ReductionParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.ReductionParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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.unknown_fields().empty()) { + mutable_unknown_fields()->append(from.unknown_fields()); + } +} + +void ReductionParameter::CopyFrom(const ReductionParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.ReductionParameter) + if (&from == this) return; + Clear(); + MergeFrom(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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); +} + +::std::string ReductionParameter::GetTypeName() const { + return "ditcaffe.ReductionParameter"; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// ReductionParameter + +// optional .ditcaffe.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(); +} + ::ditcaffe::ReductionParameter_ReductionOp ReductionParameter::operation() const { + // @@protoc_insertion_point(field_get:ditcaffe.ReductionParameter.operation) + return static_cast< ::ditcaffe::ReductionParameter_ReductionOp >(operation_); +} + void ReductionParameter::set_operation(::ditcaffe::ReductionParameter_ReductionOp value) { + assert(::ditcaffe::ReductionParameter_ReductionOp_IsValid(value)); + set_has_operation(); + operation_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.ReductionParameter.axis) + return axis_; +} + void ReductionParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.ReductionParameter.coeff) + return coeff_; +} + void ReductionParameter::set_coeff(float value) { + set_has_coeff(); + coeff_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.ReductionParameter.coeff) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +static ::std::string* MutableUnknownFieldsForReLUParameter( + ReLUParameter* ptr) { + return ptr->mutable_unknown_fields(); +} + +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::MessageLite(), _arena_ptr_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.ReLUParameter) +} + +void ReLUParameter::InitAsDefaultInstance() { +} + +ReLUParameter::ReLUParameter(const ReLUParameter& from) + : ::google::protobuf::MessageLite(), + _arena_ptr_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.ReLUParameter) +} + +void ReLUParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + _unknown_fields_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + negative_slope_ = 0; + engine_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ReLUParameter::~ReLUParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.ReLUParameter) + SharedDtor(); +} + +void ReLUParameter::SharedDtor() { + _unknown_fields_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void ReLUParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ReLUParameter& ReLUParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +ReLUParameter* ReLUParameter::default_instance_ = NULL; + +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:ditcaffe.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_ + + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + _unknown_fields_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +bool ReLUParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::internal::NewPermanentCallback( + &MutableUnknownFieldsForReLUParameter, this)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &negative_slope_))); + set_has_negative_slope(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_engine; + break; + } + + // optional .ditcaffe.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 (::ditcaffe::ReLUParameter_Engine_IsValid(value)) { + set_engine(static_cast< ::ditcaffe::ReLUParameter_Engine >(value)); + } else { + unknown_fields_stream.WriteVarint32(16); + unknown_fields_stream.WriteVarint32(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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.ReLUParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.ReLUParameter) + return false; +#undef DO_ +} + +void ReLUParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.ReLUParameter) + // optional float negative_slope = 1 [default = 0]; + if (has_negative_slope()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->negative_slope(), output); + } + + // optional .ditcaffe.ReLUParameter.Engine engine = 2 [default = DEFAULT]; + if (has_engine()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 2, this->engine(), output); + } + + output->WriteRaw(unknown_fields().data(), + static_cast(unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:ditcaffe.ReLUParameter) +} + +int ReLUParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.ReLUParameter) + int 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 .ditcaffe.ReLUParameter.Engine engine = 2 [default = DEFAULT]; + if (has_engine()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->engine()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ReLUParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void ReLUParameter::MergeFrom(const ReLUParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.ReLUParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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.unknown_fields().empty()) { + mutable_unknown_fields()->append(from.unknown_fields()); + } +} + +void ReLUParameter::CopyFrom(const ReLUParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.ReLUParameter) + if (&from == this) return; + Clear(); + MergeFrom(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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); +} + +::std::string ReLUParameter::GetTypeName() const { + return "ditcaffe.ReLUParameter"; +} + +#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:ditcaffe.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:ditcaffe.ReLUParameter.negative_slope) +} + +// optional .ditcaffe.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(); +} + ::ditcaffe::ReLUParameter_Engine ReLUParameter::engine() const { + // @@protoc_insertion_point(field_get:ditcaffe.ReLUParameter.engine) + return static_cast< ::ditcaffe::ReLUParameter_Engine >(engine_); +} + void ReLUParameter::set_engine(::ditcaffe::ReLUParameter_Engine value) { + assert(::ditcaffe::ReLUParameter_Engine_IsValid(value)); + set_has_engine(); + engine_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.ReLUParameter.engine) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +static ::std::string* MutableUnknownFieldsForReshapeParameter( + ReshapeParameter* ptr) { + return ptr->mutable_unknown_fields(); +} + +#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::MessageLite(), _arena_ptr_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.ReshapeParameter) +} + +void ReshapeParameter::InitAsDefaultInstance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + shape_ = const_cast< ::ditcaffe::BlobShape*>( + ::ditcaffe::BlobShape::internal_default_instance()); +#else + shape_ = const_cast< ::ditcaffe::BlobShape*>(&::ditcaffe::BlobShape::default_instance()); +#endif +} + +ReshapeParameter::ReshapeParameter(const ReshapeParameter& from) + : ::google::protobuf::MessageLite(), + _arena_ptr_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.ReshapeParameter) +} + +void ReshapeParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + _unknown_fields_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + shape_ = NULL; + axis_ = 0; + num_axes_ = -1; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ReshapeParameter::~ReshapeParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.ReshapeParameter) + SharedDtor(); +} + +void ReshapeParameter::SharedDtor() { + _unknown_fields_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + delete shape_; + } +} + +void ReshapeParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ReshapeParameter& ReshapeParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +ReshapeParameter* ReshapeParameter::default_instance_ = NULL; + +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:ditcaffe.ReshapeParameter) + if (_has_bits_[0 / 32] & 7u) { + if (has_shape()) { + if (shape_ != NULL) shape_->::ditcaffe::BlobShape::Clear(); + } + axis_ = 0; + num_axes_ = -1; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + _unknown_fields_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +bool ReshapeParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::internal::NewPermanentCallback( + &MutableUnknownFieldsForReshapeParameter, this)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:ditcaffe.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 .ditcaffe.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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &num_axes_))); + set_has_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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.ReshapeParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.ReshapeParameter) + return false; +#undef DO_ +} + +void ReshapeParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.ReshapeParameter) + // optional .ditcaffe.BlobShape shape = 1; + if (has_shape()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 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); + } + + output->WriteRaw(unknown_fields().data(), + static_cast(unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:ditcaffe.ReshapeParameter) +} + +int ReshapeParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.ReshapeParameter) + int total_size = 0; + + if (_has_bits_[0 / 32] & 7u) { + // optional .ditcaffe.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()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ReshapeParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void ReshapeParameter::MergeFrom(const ReshapeParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.ReshapeParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_shape()) { + mutable_shape()->::ditcaffe::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.unknown_fields().empty()) { + mutable_unknown_fields()->append(from.unknown_fields()); + } +} + +void ReshapeParameter::CopyFrom(const ReshapeParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.ReshapeParameter) + if (&from == this) return; + Clear(); + MergeFrom(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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); +} + +::std::string ReshapeParameter::GetTypeName() const { + return "ditcaffe.ReshapeParameter"; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// ReshapeParameter + +// optional .ditcaffe.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_->::ditcaffe::BlobShape::Clear(); + clear_has_shape(); +} +const ::ditcaffe::BlobShape& ReshapeParameter::shape() const { + // @@protoc_insertion_point(field_get:ditcaffe.ReshapeParameter.shape) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return shape_ != NULL ? *shape_ : *default_instance().shape_; +#else + return shape_ != NULL ? *shape_ : *default_instance_->shape_; +#endif +} +::ditcaffe::BlobShape* ReshapeParameter::mutable_shape() { + set_has_shape(); + if (shape_ == NULL) { + shape_ = new ::ditcaffe::BlobShape; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.ReshapeParameter.shape) + return shape_; +} +::ditcaffe::BlobShape* ReshapeParameter::release_shape() { + // @@protoc_insertion_point(field_release:ditcaffe.ReshapeParameter.shape) + clear_has_shape(); + ::ditcaffe::BlobShape* temp = shape_; + shape_ = NULL; + return temp; +} +void ReshapeParameter::set_allocated_shape(::ditcaffe::BlobShape* shape) { + delete shape_; + shape_ = shape; + if (shape) { + set_has_shape(); + } else { + clear_has_shape(); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.ReshapeParameter.axis) + return axis_; +} + void ReshapeParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.ReshapeParameter.num_axes) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +static ::std::string* MutableUnknownFieldsForScaleParameter( + ScaleParameter* ptr) { + return ptr->mutable_unknown_fields(); +} + +#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::MessageLite(), _arena_ptr_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.ScaleParameter) +} + +void ScaleParameter::InitAsDefaultInstance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + filler_ = const_cast< ::ditcaffe::FillerParameter*>( + ::ditcaffe::FillerParameter::internal_default_instance()); +#else + filler_ = const_cast< ::ditcaffe::FillerParameter*>(&::ditcaffe::FillerParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + bias_filler_ = const_cast< ::ditcaffe::FillerParameter*>( + ::ditcaffe::FillerParameter::internal_default_instance()); +#else + bias_filler_ = const_cast< ::ditcaffe::FillerParameter*>(&::ditcaffe::FillerParameter::default_instance()); +#endif +} + +ScaleParameter::ScaleParameter(const ScaleParameter& from) + : ::google::protobuf::MessageLite(), + _arena_ptr_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.ScaleParameter) +} + +void ScaleParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + _unknown_fields_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + axis_ = 1; + num_axes_ = 1; + filler_ = NULL; + bias_term_ = false; + bias_filler_ = NULL; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ScaleParameter::~ScaleParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.ScaleParameter) + SharedDtor(); +} + +void ScaleParameter::SharedDtor() { + _unknown_fields_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + 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 ScaleParameter& ScaleParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +ScaleParameter* ScaleParameter::default_instance_ = NULL; + +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:ditcaffe.ScaleParameter) + if (_has_bits_[0 / 32] & 31u) { + axis_ = 1; + num_axes_ = 1; + if (has_filler()) { + if (filler_ != NULL) filler_->::ditcaffe::FillerParameter::Clear(); + } + bias_term_ = false; + if (has_bias_filler()) { + if (bias_filler_ != NULL) bias_filler_->::ditcaffe::FillerParameter::Clear(); + } + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + _unknown_fields_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +bool ScaleParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::internal::NewPermanentCallback( + &MutableUnknownFieldsForScaleParameter, this)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &num_axes_))); + set_has_num_axes(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_filler; + break; + } + + // optional .ditcaffe.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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &bias_term_))); + set_has_bias_term(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(42)) goto parse_bias_filler; + break; + } + + // optional .ditcaffe.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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.ScaleParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.ScaleParameter) + return false; +#undef DO_ +} + +void ScaleParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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 .ditcaffe.FillerParameter filler = 3; + if (has_filler()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 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 .ditcaffe.FillerParameter bias_filler = 5; + if (has_bias_filler()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 5, *this->bias_filler_, output); + } + + output->WriteRaw(unknown_fields().data(), + static_cast(unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:ditcaffe.ScaleParameter) +} + +int ScaleParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.ScaleParameter) + int 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 .ditcaffe.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 .ditcaffe.FillerParameter bias_filler = 5; + if (has_bias_filler()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->bias_filler_); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ScaleParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void ScaleParameter::MergeFrom(const ScaleParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.ScaleParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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()->::ditcaffe::FillerParameter::MergeFrom(from.filler()); + } + if (from.has_bias_term()) { + set_bias_term(from.bias_term()); + } + if (from.has_bias_filler()) { + mutable_bias_filler()->::ditcaffe::FillerParameter::MergeFrom(from.bias_filler()); + } + } + if (!from.unknown_fields().empty()) { + mutable_unknown_fields()->append(from.unknown_fields()); + } +} + +void ScaleParameter::CopyFrom(const ScaleParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.ScaleParameter) + if (&from == this) return; + Clear(); + MergeFrom(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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); +} + +::std::string ScaleParameter::GetTypeName() const { + return "ditcaffe.ScaleParameter"; +} + +#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:ditcaffe.ScaleParameter.axis) + return axis_; +} + void ScaleParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.ScaleParameter.num_axes) +} + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_filler(); +} +const ::ditcaffe::FillerParameter& ScaleParameter::filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.ScaleParameter.filler) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return filler_ != NULL ? *filler_ : *default_instance().filler_; +#else + return filler_ != NULL ? *filler_ : *default_instance_->filler_; +#endif +} +::ditcaffe::FillerParameter* ScaleParameter::mutable_filler() { + set_has_filler(); + if (filler_ == NULL) { + filler_ = new ::ditcaffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.ScaleParameter.filler) + return filler_; +} +::ditcaffe::FillerParameter* ScaleParameter::release_filler() { + // @@protoc_insertion_point(field_release:ditcaffe.ScaleParameter.filler) + clear_has_filler(); + ::ditcaffe::FillerParameter* temp = filler_; + filler_ = NULL; + return temp; +} +void ScaleParameter::set_allocated_filler(::ditcaffe::FillerParameter* filler) { + delete filler_; + filler_ = filler; + if (filler) { + set_has_filler(); + } else { + clear_has_filler(); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.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:ditcaffe.ScaleParameter.bias_term) +} + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_bias_filler(); +} +const ::ditcaffe::FillerParameter& ScaleParameter::bias_filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.ScaleParameter.bias_filler) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return bias_filler_ != NULL ? *bias_filler_ : *default_instance().bias_filler_; +#else + return bias_filler_ != NULL ? *bias_filler_ : *default_instance_->bias_filler_; +#endif +} +::ditcaffe::FillerParameter* ScaleParameter::mutable_bias_filler() { + set_has_bias_filler(); + if (bias_filler_ == NULL) { + bias_filler_ = new ::ditcaffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.ScaleParameter.bias_filler) + return bias_filler_; +} +::ditcaffe::FillerParameter* ScaleParameter::release_bias_filler() { + // @@protoc_insertion_point(field_release:ditcaffe.ScaleParameter.bias_filler) + clear_has_bias_filler(); + ::ditcaffe::FillerParameter* temp = bias_filler_; + bias_filler_ = NULL; + return temp; +} +void ScaleParameter::set_allocated_bias_filler(::ditcaffe::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:ditcaffe.ScaleParameter.bias_filler) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +static ::std::string* MutableUnknownFieldsForSigmoidParameter( + SigmoidParameter* ptr) { + return ptr->mutable_unknown_fields(); +} + +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::MessageLite(), _arena_ptr_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.SigmoidParameter) +} + +void SigmoidParameter::InitAsDefaultInstance() { +} + +SigmoidParameter::SigmoidParameter(const SigmoidParameter& from) + : ::google::protobuf::MessageLite(), + _arena_ptr_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.SigmoidParameter) +} + +void SigmoidParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + _unknown_fields_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + engine_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +SigmoidParameter::~SigmoidParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.SigmoidParameter) + SharedDtor(); +} + +void SigmoidParameter::SharedDtor() { + _unknown_fields_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void SigmoidParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const SigmoidParameter& SigmoidParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +SigmoidParameter* SigmoidParameter::default_instance_ = NULL; + +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:ditcaffe.SigmoidParameter) + engine_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + _unknown_fields_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +bool SigmoidParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::internal::NewPermanentCallback( + &MutableUnknownFieldsForSigmoidParameter, this)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:ditcaffe.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 .ditcaffe.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 (::ditcaffe::SigmoidParameter_Engine_IsValid(value)) { + set_engine(static_cast< ::ditcaffe::SigmoidParameter_Engine >(value)); + } else { + unknown_fields_stream.WriteVarint32(8); + unknown_fields_stream.WriteVarint32(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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.SigmoidParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.SigmoidParameter) + return false; +#undef DO_ +} + +void SigmoidParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.SigmoidParameter) + // optional .ditcaffe.SigmoidParameter.Engine engine = 1 [default = DEFAULT]; + if (has_engine()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 1, this->engine(), output); + } + + output->WriteRaw(unknown_fields().data(), + static_cast(unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:ditcaffe.SigmoidParameter) +} + +int SigmoidParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.SigmoidParameter) + int total_size = 0; + + // optional .ditcaffe.SigmoidParameter.Engine engine = 1 [default = DEFAULT]; + if (has_engine()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->engine()); + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void SigmoidParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void SigmoidParameter::MergeFrom(const SigmoidParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.SigmoidParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_engine()) { + set_engine(from.engine()); + } + } + if (!from.unknown_fields().empty()) { + mutable_unknown_fields()->append(from.unknown_fields()); + } +} + +void SigmoidParameter::CopyFrom(const SigmoidParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.SigmoidParameter) + if (&from == this) return; + Clear(); + MergeFrom(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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); +} + +::std::string SigmoidParameter::GetTypeName() const { + return "ditcaffe.SigmoidParameter"; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// SigmoidParameter + +// optional .ditcaffe.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(); +} + ::ditcaffe::SigmoidParameter_Engine SigmoidParameter::engine() const { + // @@protoc_insertion_point(field_get:ditcaffe.SigmoidParameter.engine) + return static_cast< ::ditcaffe::SigmoidParameter_Engine >(engine_); +} + void SigmoidParameter::set_engine(::ditcaffe::SigmoidParameter_Engine value) { + assert(::ditcaffe::SigmoidParameter_Engine_IsValid(value)); + set_has_engine(); + engine_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.SigmoidParameter.engine) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +static ::std::string* MutableUnknownFieldsForSliceParameter( + SliceParameter* ptr) { + return ptr->mutable_unknown_fields(); +} + +#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::MessageLite(), _arena_ptr_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.SliceParameter) +} + +void SliceParameter::InitAsDefaultInstance() { +} + +SliceParameter::SliceParameter(const SliceParameter& from) + : ::google::protobuf::MessageLite(), + _arena_ptr_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.SliceParameter) +} + +void SliceParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + _unknown_fields_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + axis_ = 1; + slice_dim_ = 1u; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +SliceParameter::~SliceParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.SliceParameter) + SharedDtor(); +} + +void SliceParameter::SharedDtor() { + _unknown_fields_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void SliceParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const SliceParameter& SliceParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +SliceParameter* SliceParameter::default_instance_ = NULL; + +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:ditcaffe.SliceParameter) + if (_has_bits_[0 / 32] & 5u) { + axis_ = 1; + slice_dim_ = 1u; + } + slice_point_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + _unknown_fields_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +bool SliceParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::internal::NewPermanentCallback( + &MutableUnknownFieldsForSliceParameter, this)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &slice_dim_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + set_has_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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.SliceParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.SliceParameter) + return false; +#undef DO_ +} + +void SliceParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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); + } + + output->WriteRaw(unknown_fields().data(), + static_cast(unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:ditcaffe.SliceParameter) +} + +int SliceParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.SliceParameter) + int 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; + { + int data_size = 0; + for (int i = 0; i < this->slice_point_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->slice_point(i)); + } + total_size += 1 * this->slice_point_size() + data_size; + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void SliceParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void SliceParameter::MergeFrom(const SliceParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.SliceParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + slice_point_.MergeFrom(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.unknown_fields().empty()) { + mutable_unknown_fields()->append(from.unknown_fields()); + } +} + +void SliceParameter::CopyFrom(const SliceParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.SliceParameter) + if (&from == this) return; + Clear(); + MergeFrom(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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); +} + +::std::string SliceParameter::GetTypeName() const { + return "ditcaffe.SliceParameter"; +} + +#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:ditcaffe.SliceParameter.axis) + return axis_; +} + void SliceParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.SliceParameter.slice_point) +} + void SliceParameter::add_slice_point(::google::protobuf::uint32 value) { + slice_point_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.SliceParameter.slice_point) +} + const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +SliceParameter::slice_point() const { + // @@protoc_insertion_point(field_list:ditcaffe.SliceParameter.slice_point) + return slice_point_; +} + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +SliceParameter::mutable_slice_point() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.SliceParameter.slice_dim) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +static ::std::string* MutableUnknownFieldsForSoftmaxParameter( + SoftmaxParameter* ptr) { + return ptr->mutable_unknown_fields(); +} + +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::MessageLite(), _arena_ptr_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.SoftmaxParameter) +} + +void SoftmaxParameter::InitAsDefaultInstance() { +} + +SoftmaxParameter::SoftmaxParameter(const SoftmaxParameter& from) + : ::google::protobuf::MessageLite(), + _arena_ptr_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.SoftmaxParameter) +} + +void SoftmaxParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + _unknown_fields_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + engine_ = 0; + axis_ = 1; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +SoftmaxParameter::~SoftmaxParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.SoftmaxParameter) + SharedDtor(); +} + +void SoftmaxParameter::SharedDtor() { + _unknown_fields_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void SoftmaxParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const SoftmaxParameter& SoftmaxParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +SoftmaxParameter* SoftmaxParameter::default_instance_ = NULL; + +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:ditcaffe.SoftmaxParameter) + if (_has_bits_[0 / 32] & 3u) { + engine_ = 0; + axis_ = 1; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + _unknown_fields_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +bool SoftmaxParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::internal::NewPermanentCallback( + &MutableUnknownFieldsForSoftmaxParameter, this)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:ditcaffe.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 .ditcaffe.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 (::ditcaffe::SoftmaxParameter_Engine_IsValid(value)) { + set_engine(static_cast< ::ditcaffe::SoftmaxParameter_Engine >(value)); + } else { + unknown_fields_stream.WriteVarint32(8); + unknown_fields_stream.WriteVarint32(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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + set_has_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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.SoftmaxParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.SoftmaxParameter) + return false; +#undef DO_ +} + +void SoftmaxParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.SoftmaxParameter) + // optional .ditcaffe.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); + } + + output->WriteRaw(unknown_fields().data(), + static_cast(unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:ditcaffe.SoftmaxParameter) +} + +int SoftmaxParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.SoftmaxParameter) + int total_size = 0; + + if (_has_bits_[0 / 32] & 3u) { + // optional .ditcaffe.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()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void SoftmaxParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void SoftmaxParameter::MergeFrom(const SoftmaxParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.SoftmaxParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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.unknown_fields().empty()) { + mutable_unknown_fields()->append(from.unknown_fields()); + } +} + +void SoftmaxParameter::CopyFrom(const SoftmaxParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.SoftmaxParameter) + if (&from == this) return; + Clear(); + MergeFrom(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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); +} + +::std::string SoftmaxParameter::GetTypeName() const { + return "ditcaffe.SoftmaxParameter"; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// SoftmaxParameter + +// optional .ditcaffe.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(); +} + ::ditcaffe::SoftmaxParameter_Engine SoftmaxParameter::engine() const { + // @@protoc_insertion_point(field_get:ditcaffe.SoftmaxParameter.engine) + return static_cast< ::ditcaffe::SoftmaxParameter_Engine >(engine_); +} + void SoftmaxParameter::set_engine(::ditcaffe::SoftmaxParameter_Engine value) { + assert(::ditcaffe::SoftmaxParameter_Engine_IsValid(value)); + set_has_engine(); + engine_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.SoftmaxParameter.axis) + return axis_; +} + void SoftmaxParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.SoftmaxParameter.axis) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +static ::std::string* MutableUnknownFieldsForTanHParameter( + TanHParameter* ptr) { + return ptr->mutable_unknown_fields(); +} + +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::MessageLite(), _arena_ptr_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.TanHParameter) +} + +void TanHParameter::InitAsDefaultInstance() { +} + +TanHParameter::TanHParameter(const TanHParameter& from) + : ::google::protobuf::MessageLite(), + _arena_ptr_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.TanHParameter) +} + +void TanHParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + _unknown_fields_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + engine_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +TanHParameter::~TanHParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.TanHParameter) + SharedDtor(); +} + +void TanHParameter::SharedDtor() { + _unknown_fields_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void TanHParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const TanHParameter& TanHParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +TanHParameter* TanHParameter::default_instance_ = NULL; + +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:ditcaffe.TanHParameter) + engine_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + _unknown_fields_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +bool TanHParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::internal::NewPermanentCallback( + &MutableUnknownFieldsForTanHParameter, this)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:ditcaffe.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 .ditcaffe.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 (::ditcaffe::TanHParameter_Engine_IsValid(value)) { + set_engine(static_cast< ::ditcaffe::TanHParameter_Engine >(value)); + } else { + unknown_fields_stream.WriteVarint32(8); + unknown_fields_stream.WriteVarint32(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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.TanHParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.TanHParameter) + return false; +#undef DO_ +} + +void TanHParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.TanHParameter) + // optional .ditcaffe.TanHParameter.Engine engine = 1 [default = DEFAULT]; + if (has_engine()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 1, this->engine(), output); + } + + output->WriteRaw(unknown_fields().data(), + static_cast(unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:ditcaffe.TanHParameter) +} + +int TanHParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.TanHParameter) + int total_size = 0; + + // optional .ditcaffe.TanHParameter.Engine engine = 1 [default = DEFAULT]; + if (has_engine()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->engine()); + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void TanHParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void TanHParameter::MergeFrom(const TanHParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.TanHParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_engine()) { + set_engine(from.engine()); + } + } + if (!from.unknown_fields().empty()) { + mutable_unknown_fields()->append(from.unknown_fields()); + } +} + +void TanHParameter::CopyFrom(const TanHParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.TanHParameter) + if (&from == this) return; + Clear(); + MergeFrom(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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); +} + +::std::string TanHParameter::GetTypeName() const { + return "ditcaffe.TanHParameter"; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// TanHParameter + +// optional .ditcaffe.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(); +} + ::ditcaffe::TanHParameter_Engine TanHParameter::engine() const { + // @@protoc_insertion_point(field_get:ditcaffe.TanHParameter.engine) + return static_cast< ::ditcaffe::TanHParameter_Engine >(engine_); +} + void TanHParameter::set_engine(::ditcaffe::TanHParameter_Engine value) { + assert(::ditcaffe::TanHParameter_Engine_IsValid(value)); + set_has_engine(); + engine_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.TanHParameter.engine) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +static ::std::string* MutableUnknownFieldsForTileParameter( + TileParameter* ptr) { + return ptr->mutable_unknown_fields(); +} + +#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::MessageLite(), _arena_ptr_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.TileParameter) +} + +void TileParameter::InitAsDefaultInstance() { +} + +TileParameter::TileParameter(const TileParameter& from) + : ::google::protobuf::MessageLite(), + _arena_ptr_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.TileParameter) +} + +void TileParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + _unknown_fields_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + axis_ = 1; + tiles_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +TileParameter::~TileParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.TileParameter) + SharedDtor(); +} + +void TileParameter::SharedDtor() { + _unknown_fields_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void TileParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const TileParameter& TileParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +TileParameter* TileParameter::default_instance_ = NULL; + +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:ditcaffe.TileParameter) + if (_has_bits_[0 / 32] & 3u) { + axis_ = 1; + tiles_ = 0; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + _unknown_fields_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +bool TileParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::internal::NewPermanentCallback( + &MutableUnknownFieldsForTileParameter, this)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &axis_))); + set_has_axis(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_tiles; + break; + } + + // optional int32 tiles = 2; + case 2: { + if (tag == 16) { + parse_tiles: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &tiles_))); + set_has_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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.TileParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.TileParameter) + return false; +#undef DO_ +} + +void TileParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.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); + } + + output->WriteRaw(unknown_fields().data(), + static_cast(unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:ditcaffe.TileParameter) +} + +int TileParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.TileParameter) + int 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()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void TileParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void TileParameter::MergeFrom(const TileParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.TileParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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.unknown_fields().empty()) { + mutable_unknown_fields()->append(from.unknown_fields()); + } +} + +void TileParameter::CopyFrom(const TileParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.TileParameter) + if (&from == this) return; + Clear(); + MergeFrom(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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); +} + +::std::string TileParameter::GetTypeName() const { + return "ditcaffe.TileParameter"; +} + +#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:ditcaffe.TileParameter.axis) + return axis_; +} + void TileParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.TileParameter.tiles) + return tiles_; +} + void TileParameter::set_tiles(::google::protobuf::int32 value) { + set_has_tiles(); + tiles_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.TileParameter.tiles) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +static ::std::string* MutableUnknownFieldsForThresholdParameter( + ThresholdParameter* ptr) { + return ptr->mutable_unknown_fields(); +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ThresholdParameter::kThresholdFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ThresholdParameter::ThresholdParameter() + : ::google::protobuf::MessageLite(), _arena_ptr_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.ThresholdParameter) +} + +void ThresholdParameter::InitAsDefaultInstance() { +} + +ThresholdParameter::ThresholdParameter(const ThresholdParameter& from) + : ::google::protobuf::MessageLite(), + _arena_ptr_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.ThresholdParameter) +} + +void ThresholdParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + _unknown_fields_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + threshold_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ThresholdParameter::~ThresholdParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.ThresholdParameter) + SharedDtor(); +} + +void ThresholdParameter::SharedDtor() { + _unknown_fields_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void ThresholdParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ThresholdParameter& ThresholdParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +ThresholdParameter* ThresholdParameter::default_instance_ = NULL; + +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:ditcaffe.ThresholdParameter) + threshold_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + _unknown_fields_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +bool ThresholdParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::internal::NewPermanentCallback( + &MutableUnknownFieldsForThresholdParameter, this)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &threshold_))); + set_has_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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.ThresholdParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.ThresholdParameter) + return false; +#undef DO_ +} + +void ThresholdParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.ThresholdParameter) + // optional float threshold = 1 [default = 0]; + if (has_threshold()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->threshold(), output); + } + + output->WriteRaw(unknown_fields().data(), + static_cast(unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:ditcaffe.ThresholdParameter) +} + +int ThresholdParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.ThresholdParameter) + int total_size = 0; + + // optional float threshold = 1 [default = 0]; + if (has_threshold()) { + total_size += 1 + 4; + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ThresholdParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void ThresholdParameter::MergeFrom(const ThresholdParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.ThresholdParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_threshold()) { + set_threshold(from.threshold()); + } + } + if (!from.unknown_fields().empty()) { + mutable_unknown_fields()->append(from.unknown_fields()); + } +} + +void ThresholdParameter::CopyFrom(const ThresholdParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.ThresholdParameter) + if (&from == this) return; + Clear(); + MergeFrom(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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); +} + +::std::string ThresholdParameter::GetTypeName() const { + return "ditcaffe.ThresholdParameter"; +} + +#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:ditcaffe.ThresholdParameter.threshold) + return threshold_; +} + void ThresholdParameter::set_threshold(float value) { + set_has_threshold(); + threshold_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.ThresholdParameter.threshold) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +static ::std::string* MutableUnknownFieldsForWindowDataParameter( + WindowDataParameter* ptr) { + return ptr->mutable_unknown_fields(); +} + +::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::MessageLite(), _arena_ptr_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.WindowDataParameter) +} + +void WindowDataParameter::InitAsDefaultInstance() { +} + +WindowDataParameter::WindowDataParameter(const WindowDataParameter& from) + : ::google::protobuf::MessageLite(), + _arena_ptr_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.WindowDataParameter) +} + +void WindowDataParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + _unknown_fields_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + source_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + scale_ = 1; + mean_file_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + batch_size_ = 0u; + crop_size_ = 0u; + mirror_ = false; + fg_threshold_ = 0.5f; + bg_threshold_ = 0.5f; + fg_fraction_ = 0.25f; + context_pad_ = 0u; + crop_mode_.UnsafeSetDefault(_default_crop_mode_); + cache_images_ = false; + root_folder_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +WindowDataParameter::~WindowDataParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.WindowDataParameter) + SharedDtor(); +} + +void WindowDataParameter::SharedDtor() { + _unknown_fields_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + 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()); + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void WindowDataParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const WindowDataParameter& WindowDataParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +WindowDataParameter* WindowDataParameter::default_instance_ = NULL; + +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:ditcaffe.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_, crop_size_); + if (has_source()) { + source_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + scale_ = 1; + if (has_mean_file()) { + mean_file_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + mirror_ = false; + 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_ + + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + _unknown_fields_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +bool WindowDataParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::internal::NewPermanentCallback( + &MutableUnknownFieldsForWindowDataParameter, this)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:ditcaffe.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())); + } 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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &scale_))); + set_has_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())); + } 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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &batch_size_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &crop_size_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &mirror_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &fg_threshold_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &bg_threshold_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &fg_fraction_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &context_pad_))); + set_has_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())); + } 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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &cache_images_))); + set_has_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())); + } 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, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.WindowDataParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.WindowDataParameter) + return false; +#undef DO_ +} + +void WindowDataParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.WindowDataParameter) + // optional string source = 1; + if (has_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::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::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::WireFormatLite::WriteStringMaybeAliased( + 13, this->root_folder(), output); + } + + output->WriteRaw(unknown_fields().data(), + static_cast(unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:ditcaffe.WindowDataParameter) +} + +int WindowDataParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.WindowDataParameter) + int 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()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void WindowDataParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void WindowDataParameter::MergeFrom(const WindowDataParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.WindowDataParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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.unknown_fields().empty()) { + mutable_unknown_fields()->append(from.unknown_fields()); + } +} + +void WindowDataParameter::CopyFrom(const WindowDataParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.WindowDataParameter) + if (&from == this) return; + Clear(); + MergeFrom(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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); +} + +::std::string WindowDataParameter::GetTypeName() const { + return "ditcaffe.WindowDataParameter"; +} + +#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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.WindowDataParameter.source) +} + ::std::string* WindowDataParameter::mutable_source() { + set_has_source(); + // @@protoc_insertion_point(field_mutable:ditcaffe.WindowDataParameter.source) + return source_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* WindowDataParameter::release_source() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.WindowDataParameter.scale) + return scale_; +} + void WindowDataParameter::set_scale(float value) { + set_has_scale(); + scale_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.WindowDataParameter.mean_file) +} + ::std::string* WindowDataParameter::mutable_mean_file() { + set_has_mean_file(); + // @@protoc_insertion_point(field_mutable:ditcaffe.WindowDataParameter.mean_file) + return mean_file_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* WindowDataParameter::release_mean_file() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.WindowDataParameter.mirror) + return mirror_; +} + void WindowDataParameter::set_mirror(bool value) { + set_has_mirror(); + mirror_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.WindowDataParameter.crop_mode) +} + ::std::string* WindowDataParameter::mutable_crop_mode() { + set_has_crop_mode(); + // @@protoc_insertion_point(field_mutable:ditcaffe.WindowDataParameter.crop_mode) + return crop_mode_.MutableNoArena(_default_crop_mode_); +} + ::std::string* WindowDataParameter::release_crop_mode() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.WindowDataParameter.root_folder) +} + ::std::string* WindowDataParameter::mutable_root_folder() { + set_has_root_folder(); + // @@protoc_insertion_point(field_mutable:ditcaffe.WindowDataParameter.root_folder) + return root_folder_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* WindowDataParameter::release_root_folder() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.WindowDataParameter.root_folder) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +static ::std::string* MutableUnknownFieldsForSPPParameter( + SPPParameter* ptr) { + return ptr->mutable_unknown_fields(); +} + +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 +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::MessageLite(), _arena_ptr_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.SPPParameter) +} + +void SPPParameter::InitAsDefaultInstance() { +} + +SPPParameter::SPPParameter(const SPPParameter& from) + : ::google::protobuf::MessageLite(), + _arena_ptr_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.SPPParameter) +} + +void SPPParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + _unknown_fields_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + pyramid_height_ = 0u; + pool_ = 0; + engine_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +SPPParameter::~SPPParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.SPPParameter) + SharedDtor(); +} + +void SPPParameter::SharedDtor() { + _unknown_fields_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void SPPParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const SPPParameter& SPPParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +SPPParameter* SPPParameter::default_instance_ = NULL; + +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:ditcaffe.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_ + + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + _unknown_fields_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +bool SPPParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::internal::NewPermanentCallback( + &MutableUnknownFieldsForSPPParameter, this)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:ditcaffe.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) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &pyramid_height_))); + set_has_pyramid_height(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_pool; + break; + } + + // optional .ditcaffe.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 (::ditcaffe::SPPParameter_PoolMethod_IsValid(value)) { + set_pool(static_cast< ::ditcaffe::SPPParameter_PoolMethod >(value)); + } else { + unknown_fields_stream.WriteVarint32(16); + unknown_fields_stream.WriteVarint32(value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(48)) goto parse_engine; + break; + } + + // optional .ditcaffe.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 (::ditcaffe::SPPParameter_Engine_IsValid(value)) { + set_engine(static_cast< ::ditcaffe::SPPParameter_Engine >(value)); + } else { + unknown_fields_stream.WriteVarint32(48); + unknown_fields_stream.WriteVarint32(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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.SPPParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.SPPParameter) + return false; +#undef DO_ +} + +void SPPParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.SPPParameter) + // optional uint32 pyramid_height = 1; + if (has_pyramid_height()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->pyramid_height(), output); + } + + // optional .ditcaffe.SPPParameter.PoolMethod pool = 2 [default = MAX]; + if (has_pool()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 2, this->pool(), output); + } + + // optional .ditcaffe.SPPParameter.Engine engine = 6 [default = DEFAULT]; + if (has_engine()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 6, this->engine(), output); + } + + output->WriteRaw(unknown_fields().data(), + static_cast(unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:ditcaffe.SPPParameter) +} + +int SPPParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.SPPParameter) + int 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 .ditcaffe.SPPParameter.PoolMethod pool = 2 [default = MAX]; + if (has_pool()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->pool()); + } + + // optional .ditcaffe.SPPParameter.Engine engine = 6 [default = DEFAULT]; + if (has_engine()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->engine()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void SPPParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void SPPParameter::MergeFrom(const SPPParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.SPPParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + 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.unknown_fields().empty()) { + mutable_unknown_fields()->append(from.unknown_fields()); + } +} + +void SPPParameter::CopyFrom(const SPPParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.SPPParameter) + if (&from == this) return; + Clear(); + MergeFrom(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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); +} + +::std::string SPPParameter::GetTypeName() const { + return "ditcaffe.SPPParameter"; +} + +#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:ditcaffe.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:ditcaffe.SPPParameter.pyramid_height) +} + +// optional .ditcaffe.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(); +} + ::ditcaffe::SPPParameter_PoolMethod SPPParameter::pool() const { + // @@protoc_insertion_point(field_get:ditcaffe.SPPParameter.pool) + return static_cast< ::ditcaffe::SPPParameter_PoolMethod >(pool_); +} + void SPPParameter::set_pool(::ditcaffe::SPPParameter_PoolMethod value) { + assert(::ditcaffe::SPPParameter_PoolMethod_IsValid(value)); + set_has_pool(); + pool_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.SPPParameter.pool) +} + +// optional .ditcaffe.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(); +} + ::ditcaffe::SPPParameter_Engine SPPParameter::engine() const { + // @@protoc_insertion_point(field_get:ditcaffe.SPPParameter.engine) + return static_cast< ::ditcaffe::SPPParameter_Engine >(engine_); +} + void SPPParameter::set_engine(::ditcaffe::SPPParameter_Engine value) { + assert(::ditcaffe::SPPParameter_Engine_IsValid(value)); + set_has_engine(); + engine_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.SPPParameter.engine) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +static ::std::string* MutableUnknownFieldsForV1LayerParameter( + V1LayerParameter* ptr) { + return ptr->mutable_unknown_fields(); +} + +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 +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::MessageLite(), _arena_ptr_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.V1LayerParameter) +} + +void V1LayerParameter::InitAsDefaultInstance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + accuracy_param_ = const_cast< ::ditcaffe::AccuracyParameter*>( + ::ditcaffe::AccuracyParameter::internal_default_instance()); +#else + accuracy_param_ = const_cast< ::ditcaffe::AccuracyParameter*>(&::ditcaffe::AccuracyParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + argmax_param_ = const_cast< ::ditcaffe::ArgMaxParameter*>( + ::ditcaffe::ArgMaxParameter::internal_default_instance()); +#else + argmax_param_ = const_cast< ::ditcaffe::ArgMaxParameter*>(&::ditcaffe::ArgMaxParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + concat_param_ = const_cast< ::ditcaffe::ConcatParameter*>( + ::ditcaffe::ConcatParameter::internal_default_instance()); +#else + concat_param_ = const_cast< ::ditcaffe::ConcatParameter*>(&::ditcaffe::ConcatParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + contrastive_loss_param_ = const_cast< ::ditcaffe::ContrastiveLossParameter*>( + ::ditcaffe::ContrastiveLossParameter::internal_default_instance()); +#else + contrastive_loss_param_ = const_cast< ::ditcaffe::ContrastiveLossParameter*>(&::ditcaffe::ContrastiveLossParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + convolution_param_ = const_cast< ::ditcaffe::ConvolutionParameter*>( + ::ditcaffe::ConvolutionParameter::internal_default_instance()); +#else + convolution_param_ = const_cast< ::ditcaffe::ConvolutionParameter*>(&::ditcaffe::ConvolutionParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + data_param_ = const_cast< ::ditcaffe::DataParameter*>( + ::ditcaffe::DataParameter::internal_default_instance()); +#else + data_param_ = const_cast< ::ditcaffe::DataParameter*>(&::ditcaffe::DataParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + dropout_param_ = const_cast< ::ditcaffe::DropoutParameter*>( + ::ditcaffe::DropoutParameter::internal_default_instance()); +#else + dropout_param_ = const_cast< ::ditcaffe::DropoutParameter*>(&::ditcaffe::DropoutParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + dummy_data_param_ = const_cast< ::ditcaffe::DummyDataParameter*>( + ::ditcaffe::DummyDataParameter::internal_default_instance()); +#else + dummy_data_param_ = const_cast< ::ditcaffe::DummyDataParameter*>(&::ditcaffe::DummyDataParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + eltwise_param_ = const_cast< ::ditcaffe::EltwiseParameter*>( + ::ditcaffe::EltwiseParameter::internal_default_instance()); +#else + eltwise_param_ = const_cast< ::ditcaffe::EltwiseParameter*>(&::ditcaffe::EltwiseParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + exp_param_ = const_cast< ::ditcaffe::ExpParameter*>( + ::ditcaffe::ExpParameter::internal_default_instance()); +#else + exp_param_ = const_cast< ::ditcaffe::ExpParameter*>(&::ditcaffe::ExpParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + hdf5_data_param_ = const_cast< ::ditcaffe::HDF5DataParameter*>( + ::ditcaffe::HDF5DataParameter::internal_default_instance()); +#else + hdf5_data_param_ = const_cast< ::ditcaffe::HDF5DataParameter*>(&::ditcaffe::HDF5DataParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + hdf5_output_param_ = const_cast< ::ditcaffe::HDF5OutputParameter*>( + ::ditcaffe::HDF5OutputParameter::internal_default_instance()); +#else + hdf5_output_param_ = const_cast< ::ditcaffe::HDF5OutputParameter*>(&::ditcaffe::HDF5OutputParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + hinge_loss_param_ = const_cast< ::ditcaffe::HingeLossParameter*>( + ::ditcaffe::HingeLossParameter::internal_default_instance()); +#else + hinge_loss_param_ = const_cast< ::ditcaffe::HingeLossParameter*>(&::ditcaffe::HingeLossParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + image_data_param_ = const_cast< ::ditcaffe::ImageDataParameter*>( + ::ditcaffe::ImageDataParameter::internal_default_instance()); +#else + image_data_param_ = const_cast< ::ditcaffe::ImageDataParameter*>(&::ditcaffe::ImageDataParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + infogain_loss_param_ = const_cast< ::ditcaffe::InfogainLossParameter*>( + ::ditcaffe::InfogainLossParameter::internal_default_instance()); +#else + infogain_loss_param_ = const_cast< ::ditcaffe::InfogainLossParameter*>(&::ditcaffe::InfogainLossParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + inner_product_param_ = const_cast< ::ditcaffe::InnerProductParameter*>( + ::ditcaffe::InnerProductParameter::internal_default_instance()); +#else + inner_product_param_ = const_cast< ::ditcaffe::InnerProductParameter*>(&::ditcaffe::InnerProductParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + lrn_param_ = const_cast< ::ditcaffe::LRNParameter*>( + ::ditcaffe::LRNParameter::internal_default_instance()); +#else + lrn_param_ = const_cast< ::ditcaffe::LRNParameter*>(&::ditcaffe::LRNParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + memory_data_param_ = const_cast< ::ditcaffe::MemoryDataParameter*>( + ::ditcaffe::MemoryDataParameter::internal_default_instance()); +#else + memory_data_param_ = const_cast< ::ditcaffe::MemoryDataParameter*>(&::ditcaffe::MemoryDataParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + mvn_param_ = const_cast< ::ditcaffe::MVNParameter*>( + ::ditcaffe::MVNParameter::internal_default_instance()); +#else + mvn_param_ = const_cast< ::ditcaffe::MVNParameter*>(&::ditcaffe::MVNParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + pooling_param_ = const_cast< ::ditcaffe::PoolingParameter*>( + ::ditcaffe::PoolingParameter::internal_default_instance()); +#else + pooling_param_ = const_cast< ::ditcaffe::PoolingParameter*>(&::ditcaffe::PoolingParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + power_param_ = const_cast< ::ditcaffe::PowerParameter*>( + ::ditcaffe::PowerParameter::internal_default_instance()); +#else + power_param_ = const_cast< ::ditcaffe::PowerParameter*>(&::ditcaffe::PowerParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + relu_param_ = const_cast< ::ditcaffe::ReLUParameter*>( + ::ditcaffe::ReLUParameter::internal_default_instance()); +#else + relu_param_ = const_cast< ::ditcaffe::ReLUParameter*>(&::ditcaffe::ReLUParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + sigmoid_param_ = const_cast< ::ditcaffe::SigmoidParameter*>( + ::ditcaffe::SigmoidParameter::internal_default_instance()); +#else + sigmoid_param_ = const_cast< ::ditcaffe::SigmoidParameter*>(&::ditcaffe::SigmoidParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + softmax_param_ = const_cast< ::ditcaffe::SoftmaxParameter*>( + ::ditcaffe::SoftmaxParameter::internal_default_instance()); +#else + softmax_param_ = const_cast< ::ditcaffe::SoftmaxParameter*>(&::ditcaffe::SoftmaxParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + slice_param_ = const_cast< ::ditcaffe::SliceParameter*>( + ::ditcaffe::SliceParameter::internal_default_instance()); +#else + slice_param_ = const_cast< ::ditcaffe::SliceParameter*>(&::ditcaffe::SliceParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + tanh_param_ = const_cast< ::ditcaffe::TanHParameter*>( + ::ditcaffe::TanHParameter::internal_default_instance()); +#else + tanh_param_ = const_cast< ::ditcaffe::TanHParameter*>(&::ditcaffe::TanHParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + threshold_param_ = const_cast< ::ditcaffe::ThresholdParameter*>( + ::ditcaffe::ThresholdParameter::internal_default_instance()); +#else + threshold_param_ = const_cast< ::ditcaffe::ThresholdParameter*>(&::ditcaffe::ThresholdParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + window_data_param_ = const_cast< ::ditcaffe::WindowDataParameter*>( + ::ditcaffe::WindowDataParameter::internal_default_instance()); +#else + window_data_param_ = const_cast< ::ditcaffe::WindowDataParameter*>(&::ditcaffe::WindowDataParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + transform_param_ = const_cast< ::ditcaffe::TransformationParameter*>( + ::ditcaffe::TransformationParameter::internal_default_instance()); +#else + transform_param_ = const_cast< ::ditcaffe::TransformationParameter*>(&::ditcaffe::TransformationParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + loss_param_ = const_cast< ::ditcaffe::LossParameter*>( + ::ditcaffe::LossParameter::internal_default_instance()); +#else + loss_param_ = const_cast< ::ditcaffe::LossParameter*>(&::ditcaffe::LossParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + layer_ = const_cast< ::ditcaffe::V0LayerParameter*>( + ::ditcaffe::V0LayerParameter::internal_default_instance()); +#else + layer_ = const_cast< ::ditcaffe::V0LayerParameter*>(&::ditcaffe::V0LayerParameter::default_instance()); +#endif +} + +V1LayerParameter::V1LayerParameter(const V1LayerParameter& from) + : ::google::protobuf::MessageLite(), + _arena_ptr_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.V1LayerParameter) +} + +void V1LayerParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + _unknown_fields_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + type_ = 0; + 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; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +V1LayerParameter::~V1LayerParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.V1LayerParameter) + SharedDtor(); +} + +void V1LayerParameter::SharedDtor() { + _unknown_fields_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + 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 V1LayerParameter& V1LayerParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +V1LayerParameter* V1LayerParameter::default_instance_ = NULL; + +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:ditcaffe.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_->::ditcaffe::AccuracyParameter::Clear(); + } + if (has_argmax_param()) { + if (argmax_param_ != NULL) argmax_param_->::ditcaffe::ArgMaxParameter::Clear(); + } + if (has_concat_param()) { + if (concat_param_ != NULL) concat_param_->::ditcaffe::ConcatParameter::Clear(); + } + if (has_contrastive_loss_param()) { + if (contrastive_loss_param_ != NULL) contrastive_loss_param_->::ditcaffe::ContrastiveLossParameter::Clear(); + } + } + if (_has_bits_[16 / 32] & 16711680u) { + if (has_convolution_param()) { + if (convolution_param_ != NULL) convolution_param_->::ditcaffe::ConvolutionParameter::Clear(); + } + if (has_data_param()) { + if (data_param_ != NULL) data_param_->::ditcaffe::DataParameter::Clear(); + } + if (has_dropout_param()) { + if (dropout_param_ != NULL) dropout_param_->::ditcaffe::DropoutParameter::Clear(); + } + if (has_dummy_data_param()) { + if (dummy_data_param_ != NULL) dummy_data_param_->::ditcaffe::DummyDataParameter::Clear(); + } + if (has_eltwise_param()) { + if (eltwise_param_ != NULL) eltwise_param_->::ditcaffe::EltwiseParameter::Clear(); + } + if (has_exp_param()) { + if (exp_param_ != NULL) exp_param_->::ditcaffe::ExpParameter::Clear(); + } + if (has_hdf5_data_param()) { + if (hdf5_data_param_ != NULL) hdf5_data_param_->::ditcaffe::HDF5DataParameter::Clear(); + } + if (has_hdf5_output_param()) { + if (hdf5_output_param_ != NULL) hdf5_output_param_->::ditcaffe::HDF5OutputParameter::Clear(); + } + } + if (_has_bits_[24 / 32] & 4278190080u) { + if (has_hinge_loss_param()) { + if (hinge_loss_param_ != NULL) hinge_loss_param_->::ditcaffe::HingeLossParameter::Clear(); + } + if (has_image_data_param()) { + if (image_data_param_ != NULL) image_data_param_->::ditcaffe::ImageDataParameter::Clear(); + } + if (has_infogain_loss_param()) { + if (infogain_loss_param_ != NULL) infogain_loss_param_->::ditcaffe::InfogainLossParameter::Clear(); + } + if (has_inner_product_param()) { + if (inner_product_param_ != NULL) inner_product_param_->::ditcaffe::InnerProductParameter::Clear(); + } + if (has_lrn_param()) { + if (lrn_param_ != NULL) lrn_param_->::ditcaffe::LRNParameter::Clear(); + } + if (has_memory_data_param()) { + if (memory_data_param_ != NULL) memory_data_param_->::ditcaffe::MemoryDataParameter::Clear(); + } + if (has_mvn_param()) { + if (mvn_param_ != NULL) mvn_param_->::ditcaffe::MVNParameter::Clear(); + } + if (has_pooling_param()) { + if (pooling_param_ != NULL) pooling_param_->::ditcaffe::PoolingParameter::Clear(); + } + } + if (_has_bits_[32 / 32] & 255u) { + if (has_power_param()) { + if (power_param_ != NULL) power_param_->::ditcaffe::PowerParameter::Clear(); + } + if (has_relu_param()) { + if (relu_param_ != NULL) relu_param_->::ditcaffe::ReLUParameter::Clear(); + } + if (has_sigmoid_param()) { + if (sigmoid_param_ != NULL) sigmoid_param_->::ditcaffe::SigmoidParameter::Clear(); + } + if (has_softmax_param()) { + if (softmax_param_ != NULL) softmax_param_->::ditcaffe::SoftmaxParameter::Clear(); + } + if (has_slice_param()) { + if (slice_param_ != NULL) slice_param_->::ditcaffe::SliceParameter::Clear(); + } + if (has_tanh_param()) { + if (tanh_param_ != NULL) tanh_param_->::ditcaffe::TanHParameter::Clear(); + } + if (has_threshold_param()) { + if (threshold_param_ != NULL) threshold_param_->::ditcaffe::ThresholdParameter::Clear(); + } + if (has_window_data_param()) { + if (window_data_param_ != NULL) window_data_param_->::ditcaffe::WindowDataParameter::Clear(); + } + } + if (_has_bits_[40 / 32] & 1792u) { + if (has_transform_param()) { + if (transform_param_ != NULL) transform_param_->::ditcaffe::TransformationParameter::Clear(); + } + if (has_loss_param()) { + if (loss_param_ != NULL) loss_param_->::ditcaffe::LossParameter::Clear(); + } + if (has_layer()) { + if (layer_ != NULL) layer_->::ditcaffe::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(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + _unknown_fields_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +bool V1LayerParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::internal::NewPermanentCallback( + &MutableUnknownFieldsForV1LayerParameter, this)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:ditcaffe.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 .ditcaffe.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())); + } 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())); + } 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())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(40)) goto parse_type; + break; + } + + // optional .ditcaffe.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 (::ditcaffe::V1LayerParameter_LayerType_IsValid(value)) { + set_type(static_cast< ::ditcaffe::V1LayerParameter_LayerType >(value)); + } else { + unknown_fields_stream.WriteVarint32(40); + unknown_fields_stream.WriteVarint32(value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(50)) goto parse_blobs; + break; + } + + // repeated .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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 .ditcaffe.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())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(8010)) goto parse_param; + if (input->ExpectTag(8016)) goto parse_blob_share_mode; + break; + } + + // repeated .ditcaffe.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 (::ditcaffe::V1LayerParameter_DimCheckMode_IsValid(value)) { + add_blob_share_mode(static_cast< ::ditcaffe::V1LayerParameter_DimCheckMode >(value)); + } else { + unknown_fields_stream.WriteVarint32(tag); + unknown_fields_stream.WriteVarint32(value); + } + } else if (tag == 8018) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedEnumPreserveUnknowns( + input, + 1002, + ::ditcaffe::V1LayerParameter_DimCheckMode_IsValid, + &unknown_fields_stream, + 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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.V1LayerParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.V1LayerParameter) + return false; +#undef DO_ +} + +void V1LayerParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.V1LayerParameter) + // optional .ditcaffe.V0LayerParameter layer = 1; + if (has_layer()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 1, *this->layer_, output); + } + + // repeated string bottom = 2; + for (int i = 0; i < this->bottom_size(); i++) { + ::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::WireFormatLite::WriteString( + 3, this->top(i), output); + } + + // optional string name = 4; + if (has_name()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 4, this->name(), output); + } + + // optional .ditcaffe.V1LayerParameter.LayerType type = 5; + if (has_type()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 5, this->type(), output); + } + + // repeated .ditcaffe.BlobProto blobs = 6; + for (unsigned int i = 0, n = this->blobs_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 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 .ditcaffe.ConcatParameter concat_param = 9; + if (has_concat_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 9, *this->concat_param_, output); + } + + // optional .ditcaffe.ConvolutionParameter convolution_param = 10; + if (has_convolution_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 10, *this->convolution_param_, output); + } + + // optional .ditcaffe.DataParameter data_param = 11; + if (has_data_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 11, *this->data_param_, output); + } + + // optional .ditcaffe.DropoutParameter dropout_param = 12; + if (has_dropout_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 12, *this->dropout_param_, output); + } + + // optional .ditcaffe.HDF5DataParameter hdf5_data_param = 13; + if (has_hdf5_data_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 13, *this->hdf5_data_param_, output); + } + + // optional .ditcaffe.HDF5OutputParameter hdf5_output_param = 14; + if (has_hdf5_output_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 14, *this->hdf5_output_param_, output); + } + + // optional .ditcaffe.ImageDataParameter image_data_param = 15; + if (has_image_data_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 15, *this->image_data_param_, output); + } + + // optional .ditcaffe.InfogainLossParameter infogain_loss_param = 16; + if (has_infogain_loss_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 16, *this->infogain_loss_param_, output); + } + + // optional .ditcaffe.InnerProductParameter inner_product_param = 17; + if (has_inner_product_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 17, *this->inner_product_param_, output); + } + + // optional .ditcaffe.LRNParameter lrn_param = 18; + if (has_lrn_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 18, *this->lrn_param_, output); + } + + // optional .ditcaffe.PoolingParameter pooling_param = 19; + if (has_pooling_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 19, *this->pooling_param_, output); + } + + // optional .ditcaffe.WindowDataParameter window_data_param = 20; + if (has_window_data_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 20, *this->window_data_param_, output); + } + + // optional .ditcaffe.PowerParameter power_param = 21; + if (has_power_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 21, *this->power_param_, output); + } + + // optional .ditcaffe.MemoryDataParameter memory_data_param = 22; + if (has_memory_data_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 22, *this->memory_data_param_, output); + } + + // optional .ditcaffe.ArgMaxParameter argmax_param = 23; + if (has_argmax_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 23, *this->argmax_param_, output); + } + + // optional .ditcaffe.EltwiseParameter eltwise_param = 24; + if (has_eltwise_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 24, *this->eltwise_param_, output); + } + + // optional .ditcaffe.ThresholdParameter threshold_param = 25; + if (has_threshold_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 25, *this->threshold_param_, output); + } + + // optional .ditcaffe.DummyDataParameter dummy_data_param = 26; + if (has_dummy_data_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 26, *this->dummy_data_param_, output); + } + + // optional .ditcaffe.AccuracyParameter accuracy_param = 27; + if (has_accuracy_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 27, *this->accuracy_param_, output); + } + + // optional .ditcaffe.HingeLossParameter hinge_loss_param = 29; + if (has_hinge_loss_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 29, *this->hinge_loss_param_, output); + } + + // optional .ditcaffe.ReLUParameter relu_param = 30; + if (has_relu_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 30, *this->relu_param_, output); + } + + // optional .ditcaffe.SliceParameter slice_param = 31; + if (has_slice_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 31, *this->slice_param_, output); + } + + // repeated .ditcaffe.NetStateRule include = 32; + for (unsigned int i = 0, n = this->include_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 32, this->include(i), output); + } + + // repeated .ditcaffe.NetStateRule exclude = 33; + for (unsigned int i = 0, n = this->exclude_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 33, this->exclude(i), output); + } + + // optional .ditcaffe.MVNParameter mvn_param = 34; + if (has_mvn_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 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 .ditcaffe.TransformationParameter transform_param = 36; + if (has_transform_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 36, *this->transform_param_, output); + } + + // optional .ditcaffe.TanHParameter tanh_param = 37; + if (has_tanh_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 37, *this->tanh_param_, output); + } + + // optional .ditcaffe.SigmoidParameter sigmoid_param = 38; + if (has_sigmoid_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 38, *this->sigmoid_param_, output); + } + + // optional .ditcaffe.SoftmaxParameter softmax_param = 39; + if (has_softmax_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 39, *this->softmax_param_, output); + } + + // optional .ditcaffe.ContrastiveLossParameter contrastive_loss_param = 40; + if (has_contrastive_loss_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 40, *this->contrastive_loss_param_, output); + } + + // optional .ditcaffe.ExpParameter exp_param = 41; + if (has_exp_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 41, *this->exp_param_, output); + } + + // optional .ditcaffe.LossParameter loss_param = 42; + if (has_loss_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 42, *this->loss_param_, output); + } + + // repeated string param = 1001; + for (int i = 0; i < this->param_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteString( + 1001, this->param(i), output); + } + + // repeated .ditcaffe.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); + } + + output->WriteRaw(unknown_fields().data(), + static_cast(unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:ditcaffe.V1LayerParameter) +} + +int V1LayerParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.V1LayerParameter) + int 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 .ditcaffe.V1LayerParameter.LayerType type = 5; + if (has_type()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->type()); + } + + } + if (_has_bits_[12 / 32] & 61440u) { + // optional .ditcaffe.AccuracyParameter accuracy_param = 27; + if (has_accuracy_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->accuracy_param_); + } + + // optional .ditcaffe.ArgMaxParameter argmax_param = 23; + if (has_argmax_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->argmax_param_); + } + + // optional .ditcaffe.ConcatParameter concat_param = 9; + if (has_concat_param()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->concat_param_); + } + + // optional .ditcaffe.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 .ditcaffe.ConvolutionParameter convolution_param = 10; + if (has_convolution_param()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->convolution_param_); + } + + // optional .ditcaffe.DataParameter data_param = 11; + if (has_data_param()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->data_param_); + } + + // optional .ditcaffe.DropoutParameter dropout_param = 12; + if (has_dropout_param()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->dropout_param_); + } + + // optional .ditcaffe.DummyDataParameter dummy_data_param = 26; + if (has_dummy_data_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->dummy_data_param_); + } + + // optional .ditcaffe.EltwiseParameter eltwise_param = 24; + if (has_eltwise_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->eltwise_param_); + } + + // optional .ditcaffe.ExpParameter exp_param = 41; + if (has_exp_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->exp_param_); + } + + // optional .ditcaffe.HDF5DataParameter hdf5_data_param = 13; + if (has_hdf5_data_param()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->hdf5_data_param_); + } + + // optional .ditcaffe.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 .ditcaffe.HingeLossParameter hinge_loss_param = 29; + if (has_hinge_loss_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->hinge_loss_param_); + } + + // optional .ditcaffe.ImageDataParameter image_data_param = 15; + if (has_image_data_param()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->image_data_param_); + } + + // optional .ditcaffe.InfogainLossParameter infogain_loss_param = 16; + if (has_infogain_loss_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->infogain_loss_param_); + } + + // optional .ditcaffe.InnerProductParameter inner_product_param = 17; + if (has_inner_product_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->inner_product_param_); + } + + // optional .ditcaffe.LRNParameter lrn_param = 18; + if (has_lrn_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->lrn_param_); + } + + // optional .ditcaffe.MemoryDataParameter memory_data_param = 22; + if (has_memory_data_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->memory_data_param_); + } + + // optional .ditcaffe.MVNParameter mvn_param = 34; + if (has_mvn_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->mvn_param_); + } + + // optional .ditcaffe.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 .ditcaffe.PowerParameter power_param = 21; + if (has_power_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->power_param_); + } + + // optional .ditcaffe.ReLUParameter relu_param = 30; + if (has_relu_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->relu_param_); + } + + // optional .ditcaffe.SigmoidParameter sigmoid_param = 38; + if (has_sigmoid_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->sigmoid_param_); + } + + // optional .ditcaffe.SoftmaxParameter softmax_param = 39; + if (has_softmax_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->softmax_param_); + } + + // optional .ditcaffe.SliceParameter slice_param = 31; + if (has_slice_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->slice_param_); + } + + // optional .ditcaffe.TanHParameter tanh_param = 37; + if (has_tanh_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->tanh_param_); + } + + // optional .ditcaffe.ThresholdParameter threshold_param = 25; + if (has_threshold_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->threshold_param_); + } + + // optional .ditcaffe.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 .ditcaffe.TransformationParameter transform_param = 36; + if (has_transform_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->transform_param_); + } + + // optional .ditcaffe.LossParameter loss_param = 42; + if (has_loss_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->loss_param_); + } + + // optional .ditcaffe.V0LayerParameter layer = 1; + if (has_layer()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->layer_); + } + + } + // repeated string bottom = 2; + total_size += 1 * 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 * this->top_size(); + for (int i = 0; i < this->top_size(); i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->top(i)); + } + + // repeated .ditcaffe.NetStateRule include = 32; + total_size += 2 * this->include_size(); + for (int i = 0; i < this->include_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->include(i)); + } + + // repeated .ditcaffe.NetStateRule exclude = 33; + total_size += 2 * this->exclude_size(); + for (int i = 0; i < this->exclude_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->exclude(i)); + } + + // repeated .ditcaffe.BlobProto blobs = 6; + total_size += 1 * this->blobs_size(); + for (int i = 0; i < this->blobs_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->blobs(i)); + } + + // repeated string param = 1001; + total_size += 2 * this->param_size(); + for (int i = 0; i < this->param_size(); i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->param(i)); + } + + // repeated .ditcaffe.V1LayerParameter.DimCheckMode blob_share_mode = 1002; + { + int data_size = 0; + for (int i = 0; i < this->blob_share_mode_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite::EnumSize( + this->blob_share_mode(i)); + } + total_size += 2 * this->blob_share_mode_size() + data_size; + } + + // repeated float blobs_lr = 7; + { + int data_size = 0; + data_size = 4 * this->blobs_lr_size(); + total_size += 1 * this->blobs_lr_size() + data_size; + } + + // repeated float weight_decay = 8; + { + int data_size = 0; + data_size = 4 * this->weight_decay_size(); + total_size += 1 * this->weight_decay_size() + data_size; + } + + // repeated float loss_weight = 35; + { + int data_size = 0; + data_size = 4 * this->loss_weight_size(); + total_size += 2 * this->loss_weight_size() + data_size; + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void V1LayerParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void V1LayerParameter::MergeFrom(const V1LayerParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.V1LayerParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + bottom_.MergeFrom(from.bottom_); + top_.MergeFrom(from.top_); + include_.MergeFrom(from.include_); + exclude_.MergeFrom(from.exclude_); + blobs_.MergeFrom(from.blobs_); + param_.MergeFrom(from.param_); + blob_share_mode_.MergeFrom(from.blob_share_mode_); + blobs_lr_.MergeFrom(from.blobs_lr_); + weight_decay_.MergeFrom(from.weight_decay_); + loss_weight_.MergeFrom(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()->::ditcaffe::AccuracyParameter::MergeFrom(from.accuracy_param()); + } + if (from.has_argmax_param()) { + mutable_argmax_param()->::ditcaffe::ArgMaxParameter::MergeFrom(from.argmax_param()); + } + if (from.has_concat_param()) { + mutable_concat_param()->::ditcaffe::ConcatParameter::MergeFrom(from.concat_param()); + } + if (from.has_contrastive_loss_param()) { + mutable_contrastive_loss_param()->::ditcaffe::ContrastiveLossParameter::MergeFrom(from.contrastive_loss_param()); + } + } + if (from._has_bits_[16 / 32] & (0xffu << (16 % 32))) { + if (from.has_convolution_param()) { + mutable_convolution_param()->::ditcaffe::ConvolutionParameter::MergeFrom(from.convolution_param()); + } + if (from.has_data_param()) { + mutable_data_param()->::ditcaffe::DataParameter::MergeFrom(from.data_param()); + } + if (from.has_dropout_param()) { + mutable_dropout_param()->::ditcaffe::DropoutParameter::MergeFrom(from.dropout_param()); + } + if (from.has_dummy_data_param()) { + mutable_dummy_data_param()->::ditcaffe::DummyDataParameter::MergeFrom(from.dummy_data_param()); + } + if (from.has_eltwise_param()) { + mutable_eltwise_param()->::ditcaffe::EltwiseParameter::MergeFrom(from.eltwise_param()); + } + if (from.has_exp_param()) { + mutable_exp_param()->::ditcaffe::ExpParameter::MergeFrom(from.exp_param()); + } + if (from.has_hdf5_data_param()) { + mutable_hdf5_data_param()->::ditcaffe::HDF5DataParameter::MergeFrom(from.hdf5_data_param()); + } + if (from.has_hdf5_output_param()) { + mutable_hdf5_output_param()->::ditcaffe::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()->::ditcaffe::HingeLossParameter::MergeFrom(from.hinge_loss_param()); + } + if (from.has_image_data_param()) { + mutable_image_data_param()->::ditcaffe::ImageDataParameter::MergeFrom(from.image_data_param()); + } + if (from.has_infogain_loss_param()) { + mutable_infogain_loss_param()->::ditcaffe::InfogainLossParameter::MergeFrom(from.infogain_loss_param()); + } + if (from.has_inner_product_param()) { + mutable_inner_product_param()->::ditcaffe::InnerProductParameter::MergeFrom(from.inner_product_param()); + } + if (from.has_lrn_param()) { + mutable_lrn_param()->::ditcaffe::LRNParameter::MergeFrom(from.lrn_param()); + } + if (from.has_memory_data_param()) { + mutable_memory_data_param()->::ditcaffe::MemoryDataParameter::MergeFrom(from.memory_data_param()); + } + if (from.has_mvn_param()) { + mutable_mvn_param()->::ditcaffe::MVNParameter::MergeFrom(from.mvn_param()); + } + if (from.has_pooling_param()) { + mutable_pooling_param()->::ditcaffe::PoolingParameter::MergeFrom(from.pooling_param()); + } + } + if (from._has_bits_[32 / 32] & (0xffu << (32 % 32))) { + if (from.has_power_param()) { + mutable_power_param()->::ditcaffe::PowerParameter::MergeFrom(from.power_param()); + } + if (from.has_relu_param()) { + mutable_relu_param()->::ditcaffe::ReLUParameter::MergeFrom(from.relu_param()); + } + if (from.has_sigmoid_param()) { + mutable_sigmoid_param()->::ditcaffe::SigmoidParameter::MergeFrom(from.sigmoid_param()); + } + if (from.has_softmax_param()) { + mutable_softmax_param()->::ditcaffe::SoftmaxParameter::MergeFrom(from.softmax_param()); + } + if (from.has_slice_param()) { + mutable_slice_param()->::ditcaffe::SliceParameter::MergeFrom(from.slice_param()); + } + if (from.has_tanh_param()) { + mutable_tanh_param()->::ditcaffe::TanHParameter::MergeFrom(from.tanh_param()); + } + if (from.has_threshold_param()) { + mutable_threshold_param()->::ditcaffe::ThresholdParameter::MergeFrom(from.threshold_param()); + } + if (from.has_window_data_param()) { + mutable_window_data_param()->::ditcaffe::WindowDataParameter::MergeFrom(from.window_data_param()); + } + } + if (from._has_bits_[40 / 32] & (0xffu << (40 % 32))) { + if (from.has_transform_param()) { + mutable_transform_param()->::ditcaffe::TransformationParameter::MergeFrom(from.transform_param()); + } + if (from.has_loss_param()) { + mutable_loss_param()->::ditcaffe::LossParameter::MergeFrom(from.loss_param()); + } + if (from.has_layer()) { + mutable_layer()->::ditcaffe::V0LayerParameter::MergeFrom(from.layer()); + } + } + if (!from.unknown_fields().empty()) { + mutable_unknown_fields()->append(from.unknown_fields()); + } +} + +void V1LayerParameter::CopyFrom(const V1LayerParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.V1LayerParameter) + if (&from == this) return; + Clear(); + MergeFrom(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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); +} + +::std::string V1LayerParameter::GetTypeName() const { + return "ditcaffe.V1LayerParameter"; +} + +#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:ditcaffe.V1LayerParameter.bottom) + return bottom_.Get(index); +} + ::std::string* V1LayerParameter::mutable_bottom(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.bottom) + return bottom_.Mutable(index); +} + void V1LayerParameter::set_bottom(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.V1LayerParameter.bottom) +} + ::std::string* V1LayerParameter::add_bottom() { + // @@protoc_insertion_point(field_add_mutable:ditcaffe.V1LayerParameter.bottom) + return bottom_.Add(); +} + void V1LayerParameter::add_bottom(const ::std::string& value) { + bottom_.Add()->assign(value); + // @@protoc_insertion_point(field_add:ditcaffe.V1LayerParameter.bottom) +} + void V1LayerParameter::add_bottom(const char* value) { + bottom_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:ditcaffe.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:ditcaffe.V1LayerParameter.bottom) +} + const ::google::protobuf::RepeatedPtrField< ::std::string>& +V1LayerParameter::bottom() const { + // @@protoc_insertion_point(field_list:ditcaffe.V1LayerParameter.bottom) + return bottom_; +} + ::google::protobuf::RepeatedPtrField< ::std::string>* +V1LayerParameter::mutable_bottom() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.V1LayerParameter.top) + return top_.Get(index); +} + ::std::string* V1LayerParameter::mutable_top(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.top) + return top_.Mutable(index); +} + void V1LayerParameter::set_top(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.V1LayerParameter.top) +} + ::std::string* V1LayerParameter::add_top() { + // @@protoc_insertion_point(field_add_mutable:ditcaffe.V1LayerParameter.top) + return top_.Add(); +} + void V1LayerParameter::add_top(const ::std::string& value) { + top_.Add()->assign(value); + // @@protoc_insertion_point(field_add:ditcaffe.V1LayerParameter.top) +} + void V1LayerParameter::add_top(const char* value) { + top_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:ditcaffe.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:ditcaffe.V1LayerParameter.top) +} + const ::google::protobuf::RepeatedPtrField< ::std::string>& +V1LayerParameter::top() const { + // @@protoc_insertion_point(field_list:ditcaffe.V1LayerParameter.top) + return top_; +} + ::google::protobuf::RepeatedPtrField< ::std::string>* +V1LayerParameter::mutable_top() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.V1LayerParameter.name) +} + ::std::string* V1LayerParameter::mutable_name() { + set_has_name(); + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.name) + return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* V1LayerParameter::release_name() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.V1LayerParameter.name) +} + +// repeated .ditcaffe.NetStateRule include = 32; +int V1LayerParameter::include_size() const { + return include_.size(); +} +void V1LayerParameter::clear_include() { + include_.Clear(); +} +const ::ditcaffe::NetStateRule& V1LayerParameter::include(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.include) + return include_.Get(index); +} +::ditcaffe::NetStateRule* V1LayerParameter::mutable_include(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.include) + return include_.Mutable(index); +} +::ditcaffe::NetStateRule* V1LayerParameter::add_include() { + // @@protoc_insertion_point(field_add:ditcaffe.V1LayerParameter.include) + return include_.Add(); +} +::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >* +V1LayerParameter::mutable_include() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.V1LayerParameter.include) + return &include_; +} +const ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >& +V1LayerParameter::include() const { + // @@protoc_insertion_point(field_list:ditcaffe.V1LayerParameter.include) + return include_; +} + +// repeated .ditcaffe.NetStateRule exclude = 33; +int V1LayerParameter::exclude_size() const { + return exclude_.size(); +} +void V1LayerParameter::clear_exclude() { + exclude_.Clear(); +} +const ::ditcaffe::NetStateRule& V1LayerParameter::exclude(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.exclude) + return exclude_.Get(index); +} +::ditcaffe::NetStateRule* V1LayerParameter::mutable_exclude(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.exclude) + return exclude_.Mutable(index); +} +::ditcaffe::NetStateRule* V1LayerParameter::add_exclude() { + // @@protoc_insertion_point(field_add:ditcaffe.V1LayerParameter.exclude) + return exclude_.Add(); +} +::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >* +V1LayerParameter::mutable_exclude() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.V1LayerParameter.exclude) + return &exclude_; +} +const ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >& +V1LayerParameter::exclude() const { + // @@protoc_insertion_point(field_list:ditcaffe.V1LayerParameter.exclude) + return exclude_; +} + +// optional .ditcaffe.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(); +} + ::ditcaffe::V1LayerParameter_LayerType V1LayerParameter::type() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.type) + return static_cast< ::ditcaffe::V1LayerParameter_LayerType >(type_); +} + void V1LayerParameter::set_type(::ditcaffe::V1LayerParameter_LayerType value) { + assert(::ditcaffe::V1LayerParameter_LayerType_IsValid(value)); + set_has_type(); + type_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.V1LayerParameter.type) +} + +// repeated .ditcaffe.BlobProto blobs = 6; +int V1LayerParameter::blobs_size() const { + return blobs_.size(); +} +void V1LayerParameter::clear_blobs() { + blobs_.Clear(); +} +const ::ditcaffe::BlobProto& V1LayerParameter::blobs(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.blobs) + return blobs_.Get(index); +} +::ditcaffe::BlobProto* V1LayerParameter::mutable_blobs(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.blobs) + return blobs_.Mutable(index); +} +::ditcaffe::BlobProto* V1LayerParameter::add_blobs() { + // @@protoc_insertion_point(field_add:ditcaffe.V1LayerParameter.blobs) + return blobs_.Add(); +} +::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >* +V1LayerParameter::mutable_blobs() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.V1LayerParameter.blobs) + return &blobs_; +} +const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >& +V1LayerParameter::blobs() const { + // @@protoc_insertion_point(field_list:ditcaffe.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:ditcaffe.V1LayerParameter.param) + return param_.Get(index); +} + ::std::string* V1LayerParameter::mutable_param(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.param) + return param_.Mutable(index); +} + void V1LayerParameter::set_param(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.V1LayerParameter.param) +} + ::std::string* V1LayerParameter::add_param() { + // @@protoc_insertion_point(field_add_mutable:ditcaffe.V1LayerParameter.param) + return param_.Add(); +} + void V1LayerParameter::add_param(const ::std::string& value) { + param_.Add()->assign(value); + // @@protoc_insertion_point(field_add:ditcaffe.V1LayerParameter.param) +} + void V1LayerParameter::add_param(const char* value) { + param_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:ditcaffe.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:ditcaffe.V1LayerParameter.param) +} + const ::google::protobuf::RepeatedPtrField< ::std::string>& +V1LayerParameter::param() const { + // @@protoc_insertion_point(field_list:ditcaffe.V1LayerParameter.param) + return param_; +} + ::google::protobuf::RepeatedPtrField< ::std::string>* +V1LayerParameter::mutable_param() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.V1LayerParameter.param) + return ¶m_; +} + +// repeated .ditcaffe.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(); +} + ::ditcaffe::V1LayerParameter_DimCheckMode V1LayerParameter::blob_share_mode(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.blob_share_mode) + return static_cast< ::ditcaffe::V1LayerParameter_DimCheckMode >(blob_share_mode_.Get(index)); +} + void V1LayerParameter::set_blob_share_mode(int index, ::ditcaffe::V1LayerParameter_DimCheckMode value) { + assert(::ditcaffe::V1LayerParameter_DimCheckMode_IsValid(value)); + blob_share_mode_.Set(index, value); + // @@protoc_insertion_point(field_set:ditcaffe.V1LayerParameter.blob_share_mode) +} + void V1LayerParameter::add_blob_share_mode(::ditcaffe::V1LayerParameter_DimCheckMode value) { + assert(::ditcaffe::V1LayerParameter_DimCheckMode_IsValid(value)); + blob_share_mode_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.V1LayerParameter.blob_share_mode) +} + const ::google::protobuf::RepeatedField& +V1LayerParameter::blob_share_mode() const { + // @@protoc_insertion_point(field_list:ditcaffe.V1LayerParameter.blob_share_mode) + return blob_share_mode_; +} + ::google::protobuf::RepeatedField* +V1LayerParameter::mutable_blob_share_mode() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.V1LayerParameter.blobs_lr) +} + void V1LayerParameter::add_blobs_lr(float value) { + blobs_lr_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.V1LayerParameter.blobs_lr) +} + const ::google::protobuf::RepeatedField< float >& +V1LayerParameter::blobs_lr() const { + // @@protoc_insertion_point(field_list:ditcaffe.V1LayerParameter.blobs_lr) + return blobs_lr_; +} + ::google::protobuf::RepeatedField< float >* +V1LayerParameter::mutable_blobs_lr() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.V1LayerParameter.weight_decay) +} + void V1LayerParameter::add_weight_decay(float value) { + weight_decay_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.V1LayerParameter.weight_decay) +} + const ::google::protobuf::RepeatedField< float >& +V1LayerParameter::weight_decay() const { + // @@protoc_insertion_point(field_list:ditcaffe.V1LayerParameter.weight_decay) + return weight_decay_; +} + ::google::protobuf::RepeatedField< float >* +V1LayerParameter::mutable_weight_decay() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.V1LayerParameter.loss_weight) +} + void V1LayerParameter::add_loss_weight(float value) { + loss_weight_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.V1LayerParameter.loss_weight) +} + const ::google::protobuf::RepeatedField< float >& +V1LayerParameter::loss_weight() const { + // @@protoc_insertion_point(field_list:ditcaffe.V1LayerParameter.loss_weight) + return loss_weight_; +} + ::google::protobuf::RepeatedField< float >* +V1LayerParameter::mutable_loss_weight() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.V1LayerParameter.loss_weight) + return &loss_weight_; +} + +// optional .ditcaffe.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_->::ditcaffe::AccuracyParameter::Clear(); + clear_has_accuracy_param(); +} +const ::ditcaffe::AccuracyParameter& V1LayerParameter::accuracy_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.accuracy_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return accuracy_param_ != NULL ? *accuracy_param_ : *default_instance().accuracy_param_; +#else + return accuracy_param_ != NULL ? *accuracy_param_ : *default_instance_->accuracy_param_; +#endif +} +::ditcaffe::AccuracyParameter* V1LayerParameter::mutable_accuracy_param() { + set_has_accuracy_param(); + if (accuracy_param_ == NULL) { + accuracy_param_ = new ::ditcaffe::AccuracyParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.accuracy_param) + return accuracy_param_; +} +::ditcaffe::AccuracyParameter* V1LayerParameter::release_accuracy_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.accuracy_param) + clear_has_accuracy_param(); + ::ditcaffe::AccuracyParameter* temp = accuracy_param_; + accuracy_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_accuracy_param(::ditcaffe::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:ditcaffe.V1LayerParameter.accuracy_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ArgMaxParameter::Clear(); + clear_has_argmax_param(); +} +const ::ditcaffe::ArgMaxParameter& V1LayerParameter::argmax_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.argmax_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return argmax_param_ != NULL ? *argmax_param_ : *default_instance().argmax_param_; +#else + return argmax_param_ != NULL ? *argmax_param_ : *default_instance_->argmax_param_; +#endif +} +::ditcaffe::ArgMaxParameter* V1LayerParameter::mutable_argmax_param() { + set_has_argmax_param(); + if (argmax_param_ == NULL) { + argmax_param_ = new ::ditcaffe::ArgMaxParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.argmax_param) + return argmax_param_; +} +::ditcaffe::ArgMaxParameter* V1LayerParameter::release_argmax_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.argmax_param) + clear_has_argmax_param(); + ::ditcaffe::ArgMaxParameter* temp = argmax_param_; + argmax_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_argmax_param(::ditcaffe::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:ditcaffe.V1LayerParameter.argmax_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ConcatParameter::Clear(); + clear_has_concat_param(); +} +const ::ditcaffe::ConcatParameter& V1LayerParameter::concat_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.concat_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return concat_param_ != NULL ? *concat_param_ : *default_instance().concat_param_; +#else + return concat_param_ != NULL ? *concat_param_ : *default_instance_->concat_param_; +#endif +} +::ditcaffe::ConcatParameter* V1LayerParameter::mutable_concat_param() { + set_has_concat_param(); + if (concat_param_ == NULL) { + concat_param_ = new ::ditcaffe::ConcatParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.concat_param) + return concat_param_; +} +::ditcaffe::ConcatParameter* V1LayerParameter::release_concat_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.concat_param) + clear_has_concat_param(); + ::ditcaffe::ConcatParameter* temp = concat_param_; + concat_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_concat_param(::ditcaffe::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:ditcaffe.V1LayerParameter.concat_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ContrastiveLossParameter::Clear(); + clear_has_contrastive_loss_param(); +} +const ::ditcaffe::ContrastiveLossParameter& V1LayerParameter::contrastive_loss_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.contrastive_loss_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return contrastive_loss_param_ != NULL ? *contrastive_loss_param_ : *default_instance().contrastive_loss_param_; +#else + return contrastive_loss_param_ != NULL ? *contrastive_loss_param_ : *default_instance_->contrastive_loss_param_; +#endif +} +::ditcaffe::ContrastiveLossParameter* V1LayerParameter::mutable_contrastive_loss_param() { + set_has_contrastive_loss_param(); + if (contrastive_loss_param_ == NULL) { + contrastive_loss_param_ = new ::ditcaffe::ContrastiveLossParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.contrastive_loss_param) + return contrastive_loss_param_; +} +::ditcaffe::ContrastiveLossParameter* V1LayerParameter::release_contrastive_loss_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.contrastive_loss_param) + clear_has_contrastive_loss_param(); + ::ditcaffe::ContrastiveLossParameter* temp = contrastive_loss_param_; + contrastive_loss_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_contrastive_loss_param(::ditcaffe::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:ditcaffe.V1LayerParameter.contrastive_loss_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ConvolutionParameter::Clear(); + clear_has_convolution_param(); +} +const ::ditcaffe::ConvolutionParameter& V1LayerParameter::convolution_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.convolution_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return convolution_param_ != NULL ? *convolution_param_ : *default_instance().convolution_param_; +#else + return convolution_param_ != NULL ? *convolution_param_ : *default_instance_->convolution_param_; +#endif +} +::ditcaffe::ConvolutionParameter* V1LayerParameter::mutable_convolution_param() { + set_has_convolution_param(); + if (convolution_param_ == NULL) { + convolution_param_ = new ::ditcaffe::ConvolutionParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.convolution_param) + return convolution_param_; +} +::ditcaffe::ConvolutionParameter* V1LayerParameter::release_convolution_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.convolution_param) + clear_has_convolution_param(); + ::ditcaffe::ConvolutionParameter* temp = convolution_param_; + convolution_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_convolution_param(::ditcaffe::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:ditcaffe.V1LayerParameter.convolution_param) +} + +// optional .ditcaffe.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_->::ditcaffe::DataParameter::Clear(); + clear_has_data_param(); +} +const ::ditcaffe::DataParameter& V1LayerParameter::data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.data_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return data_param_ != NULL ? *data_param_ : *default_instance().data_param_; +#else + return data_param_ != NULL ? *data_param_ : *default_instance_->data_param_; +#endif +} +::ditcaffe::DataParameter* V1LayerParameter::mutable_data_param() { + set_has_data_param(); + if (data_param_ == NULL) { + data_param_ = new ::ditcaffe::DataParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.data_param) + return data_param_; +} +::ditcaffe::DataParameter* V1LayerParameter::release_data_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.data_param) + clear_has_data_param(); + ::ditcaffe::DataParameter* temp = data_param_; + data_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_data_param(::ditcaffe::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:ditcaffe.V1LayerParameter.data_param) +} + +// optional .ditcaffe.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_->::ditcaffe::DropoutParameter::Clear(); + clear_has_dropout_param(); +} +const ::ditcaffe::DropoutParameter& V1LayerParameter::dropout_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.dropout_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return dropout_param_ != NULL ? *dropout_param_ : *default_instance().dropout_param_; +#else + return dropout_param_ != NULL ? *dropout_param_ : *default_instance_->dropout_param_; +#endif +} +::ditcaffe::DropoutParameter* V1LayerParameter::mutable_dropout_param() { + set_has_dropout_param(); + if (dropout_param_ == NULL) { + dropout_param_ = new ::ditcaffe::DropoutParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.dropout_param) + return dropout_param_; +} +::ditcaffe::DropoutParameter* V1LayerParameter::release_dropout_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.dropout_param) + clear_has_dropout_param(); + ::ditcaffe::DropoutParameter* temp = dropout_param_; + dropout_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_dropout_param(::ditcaffe::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:ditcaffe.V1LayerParameter.dropout_param) +} + +// optional .ditcaffe.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_->::ditcaffe::DummyDataParameter::Clear(); + clear_has_dummy_data_param(); +} +const ::ditcaffe::DummyDataParameter& V1LayerParameter::dummy_data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.dummy_data_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return dummy_data_param_ != NULL ? *dummy_data_param_ : *default_instance().dummy_data_param_; +#else + return dummy_data_param_ != NULL ? *dummy_data_param_ : *default_instance_->dummy_data_param_; +#endif +} +::ditcaffe::DummyDataParameter* V1LayerParameter::mutable_dummy_data_param() { + set_has_dummy_data_param(); + if (dummy_data_param_ == NULL) { + dummy_data_param_ = new ::ditcaffe::DummyDataParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.dummy_data_param) + return dummy_data_param_; +} +::ditcaffe::DummyDataParameter* V1LayerParameter::release_dummy_data_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.dummy_data_param) + clear_has_dummy_data_param(); + ::ditcaffe::DummyDataParameter* temp = dummy_data_param_; + dummy_data_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_dummy_data_param(::ditcaffe::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:ditcaffe.V1LayerParameter.dummy_data_param) +} + +// optional .ditcaffe.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_->::ditcaffe::EltwiseParameter::Clear(); + clear_has_eltwise_param(); +} +const ::ditcaffe::EltwiseParameter& V1LayerParameter::eltwise_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.eltwise_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return eltwise_param_ != NULL ? *eltwise_param_ : *default_instance().eltwise_param_; +#else + return eltwise_param_ != NULL ? *eltwise_param_ : *default_instance_->eltwise_param_; +#endif +} +::ditcaffe::EltwiseParameter* V1LayerParameter::mutable_eltwise_param() { + set_has_eltwise_param(); + if (eltwise_param_ == NULL) { + eltwise_param_ = new ::ditcaffe::EltwiseParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.eltwise_param) + return eltwise_param_; +} +::ditcaffe::EltwiseParameter* V1LayerParameter::release_eltwise_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.eltwise_param) + clear_has_eltwise_param(); + ::ditcaffe::EltwiseParameter* temp = eltwise_param_; + eltwise_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_eltwise_param(::ditcaffe::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:ditcaffe.V1LayerParameter.eltwise_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ExpParameter::Clear(); + clear_has_exp_param(); +} +const ::ditcaffe::ExpParameter& V1LayerParameter::exp_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.exp_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return exp_param_ != NULL ? *exp_param_ : *default_instance().exp_param_; +#else + return exp_param_ != NULL ? *exp_param_ : *default_instance_->exp_param_; +#endif +} +::ditcaffe::ExpParameter* V1LayerParameter::mutable_exp_param() { + set_has_exp_param(); + if (exp_param_ == NULL) { + exp_param_ = new ::ditcaffe::ExpParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.exp_param) + return exp_param_; +} +::ditcaffe::ExpParameter* V1LayerParameter::release_exp_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.exp_param) + clear_has_exp_param(); + ::ditcaffe::ExpParameter* temp = exp_param_; + exp_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_exp_param(::ditcaffe::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:ditcaffe.V1LayerParameter.exp_param) +} + +// optional .ditcaffe.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_->::ditcaffe::HDF5DataParameter::Clear(); + clear_has_hdf5_data_param(); +} +const ::ditcaffe::HDF5DataParameter& V1LayerParameter::hdf5_data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.hdf5_data_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return hdf5_data_param_ != NULL ? *hdf5_data_param_ : *default_instance().hdf5_data_param_; +#else + return hdf5_data_param_ != NULL ? *hdf5_data_param_ : *default_instance_->hdf5_data_param_; +#endif +} +::ditcaffe::HDF5DataParameter* V1LayerParameter::mutable_hdf5_data_param() { + set_has_hdf5_data_param(); + if (hdf5_data_param_ == NULL) { + hdf5_data_param_ = new ::ditcaffe::HDF5DataParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.hdf5_data_param) + return hdf5_data_param_; +} +::ditcaffe::HDF5DataParameter* V1LayerParameter::release_hdf5_data_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.hdf5_data_param) + clear_has_hdf5_data_param(); + ::ditcaffe::HDF5DataParameter* temp = hdf5_data_param_; + hdf5_data_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_hdf5_data_param(::ditcaffe::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:ditcaffe.V1LayerParameter.hdf5_data_param) +} + +// optional .ditcaffe.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_->::ditcaffe::HDF5OutputParameter::Clear(); + clear_has_hdf5_output_param(); +} +const ::ditcaffe::HDF5OutputParameter& V1LayerParameter::hdf5_output_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.hdf5_output_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return hdf5_output_param_ != NULL ? *hdf5_output_param_ : *default_instance().hdf5_output_param_; +#else + return hdf5_output_param_ != NULL ? *hdf5_output_param_ : *default_instance_->hdf5_output_param_; +#endif +} +::ditcaffe::HDF5OutputParameter* V1LayerParameter::mutable_hdf5_output_param() { + set_has_hdf5_output_param(); + if (hdf5_output_param_ == NULL) { + hdf5_output_param_ = new ::ditcaffe::HDF5OutputParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.hdf5_output_param) + return hdf5_output_param_; +} +::ditcaffe::HDF5OutputParameter* V1LayerParameter::release_hdf5_output_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.hdf5_output_param) + clear_has_hdf5_output_param(); + ::ditcaffe::HDF5OutputParameter* temp = hdf5_output_param_; + hdf5_output_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_hdf5_output_param(::ditcaffe::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:ditcaffe.V1LayerParameter.hdf5_output_param) +} + +// optional .ditcaffe.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_->::ditcaffe::HingeLossParameter::Clear(); + clear_has_hinge_loss_param(); +} +const ::ditcaffe::HingeLossParameter& V1LayerParameter::hinge_loss_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.hinge_loss_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return hinge_loss_param_ != NULL ? *hinge_loss_param_ : *default_instance().hinge_loss_param_; +#else + return hinge_loss_param_ != NULL ? *hinge_loss_param_ : *default_instance_->hinge_loss_param_; +#endif +} +::ditcaffe::HingeLossParameter* V1LayerParameter::mutable_hinge_loss_param() { + set_has_hinge_loss_param(); + if (hinge_loss_param_ == NULL) { + hinge_loss_param_ = new ::ditcaffe::HingeLossParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.hinge_loss_param) + return hinge_loss_param_; +} +::ditcaffe::HingeLossParameter* V1LayerParameter::release_hinge_loss_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.hinge_loss_param) + clear_has_hinge_loss_param(); + ::ditcaffe::HingeLossParameter* temp = hinge_loss_param_; + hinge_loss_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_hinge_loss_param(::ditcaffe::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:ditcaffe.V1LayerParameter.hinge_loss_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ImageDataParameter::Clear(); + clear_has_image_data_param(); +} +const ::ditcaffe::ImageDataParameter& V1LayerParameter::image_data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.image_data_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return image_data_param_ != NULL ? *image_data_param_ : *default_instance().image_data_param_; +#else + return image_data_param_ != NULL ? *image_data_param_ : *default_instance_->image_data_param_; +#endif +} +::ditcaffe::ImageDataParameter* V1LayerParameter::mutable_image_data_param() { + set_has_image_data_param(); + if (image_data_param_ == NULL) { + image_data_param_ = new ::ditcaffe::ImageDataParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.image_data_param) + return image_data_param_; +} +::ditcaffe::ImageDataParameter* V1LayerParameter::release_image_data_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.image_data_param) + clear_has_image_data_param(); + ::ditcaffe::ImageDataParameter* temp = image_data_param_; + image_data_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_image_data_param(::ditcaffe::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:ditcaffe.V1LayerParameter.image_data_param) +} + +// optional .ditcaffe.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_->::ditcaffe::InfogainLossParameter::Clear(); + clear_has_infogain_loss_param(); +} +const ::ditcaffe::InfogainLossParameter& V1LayerParameter::infogain_loss_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.infogain_loss_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return infogain_loss_param_ != NULL ? *infogain_loss_param_ : *default_instance().infogain_loss_param_; +#else + return infogain_loss_param_ != NULL ? *infogain_loss_param_ : *default_instance_->infogain_loss_param_; +#endif +} +::ditcaffe::InfogainLossParameter* V1LayerParameter::mutable_infogain_loss_param() { + set_has_infogain_loss_param(); + if (infogain_loss_param_ == NULL) { + infogain_loss_param_ = new ::ditcaffe::InfogainLossParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.infogain_loss_param) + return infogain_loss_param_; +} +::ditcaffe::InfogainLossParameter* V1LayerParameter::release_infogain_loss_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.infogain_loss_param) + clear_has_infogain_loss_param(); + ::ditcaffe::InfogainLossParameter* temp = infogain_loss_param_; + infogain_loss_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_infogain_loss_param(::ditcaffe::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:ditcaffe.V1LayerParameter.infogain_loss_param) +} + +// optional .ditcaffe.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_->::ditcaffe::InnerProductParameter::Clear(); + clear_has_inner_product_param(); +} +const ::ditcaffe::InnerProductParameter& V1LayerParameter::inner_product_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.inner_product_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return inner_product_param_ != NULL ? *inner_product_param_ : *default_instance().inner_product_param_; +#else + return inner_product_param_ != NULL ? *inner_product_param_ : *default_instance_->inner_product_param_; +#endif +} +::ditcaffe::InnerProductParameter* V1LayerParameter::mutable_inner_product_param() { + set_has_inner_product_param(); + if (inner_product_param_ == NULL) { + inner_product_param_ = new ::ditcaffe::InnerProductParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.inner_product_param) + return inner_product_param_; +} +::ditcaffe::InnerProductParameter* V1LayerParameter::release_inner_product_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.inner_product_param) + clear_has_inner_product_param(); + ::ditcaffe::InnerProductParameter* temp = inner_product_param_; + inner_product_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_inner_product_param(::ditcaffe::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:ditcaffe.V1LayerParameter.inner_product_param) +} + +// optional .ditcaffe.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_->::ditcaffe::LRNParameter::Clear(); + clear_has_lrn_param(); +} +const ::ditcaffe::LRNParameter& V1LayerParameter::lrn_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.lrn_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return lrn_param_ != NULL ? *lrn_param_ : *default_instance().lrn_param_; +#else + return lrn_param_ != NULL ? *lrn_param_ : *default_instance_->lrn_param_; +#endif +} +::ditcaffe::LRNParameter* V1LayerParameter::mutable_lrn_param() { + set_has_lrn_param(); + if (lrn_param_ == NULL) { + lrn_param_ = new ::ditcaffe::LRNParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.lrn_param) + return lrn_param_; +} +::ditcaffe::LRNParameter* V1LayerParameter::release_lrn_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.lrn_param) + clear_has_lrn_param(); + ::ditcaffe::LRNParameter* temp = lrn_param_; + lrn_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_lrn_param(::ditcaffe::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:ditcaffe.V1LayerParameter.lrn_param) +} + +// optional .ditcaffe.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_->::ditcaffe::MemoryDataParameter::Clear(); + clear_has_memory_data_param(); +} +const ::ditcaffe::MemoryDataParameter& V1LayerParameter::memory_data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.memory_data_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return memory_data_param_ != NULL ? *memory_data_param_ : *default_instance().memory_data_param_; +#else + return memory_data_param_ != NULL ? *memory_data_param_ : *default_instance_->memory_data_param_; +#endif +} +::ditcaffe::MemoryDataParameter* V1LayerParameter::mutable_memory_data_param() { + set_has_memory_data_param(); + if (memory_data_param_ == NULL) { + memory_data_param_ = new ::ditcaffe::MemoryDataParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.memory_data_param) + return memory_data_param_; +} +::ditcaffe::MemoryDataParameter* V1LayerParameter::release_memory_data_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.memory_data_param) + clear_has_memory_data_param(); + ::ditcaffe::MemoryDataParameter* temp = memory_data_param_; + memory_data_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_memory_data_param(::ditcaffe::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:ditcaffe.V1LayerParameter.memory_data_param) +} + +// optional .ditcaffe.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_->::ditcaffe::MVNParameter::Clear(); + clear_has_mvn_param(); +} +const ::ditcaffe::MVNParameter& V1LayerParameter::mvn_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.mvn_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return mvn_param_ != NULL ? *mvn_param_ : *default_instance().mvn_param_; +#else + return mvn_param_ != NULL ? *mvn_param_ : *default_instance_->mvn_param_; +#endif +} +::ditcaffe::MVNParameter* V1LayerParameter::mutable_mvn_param() { + set_has_mvn_param(); + if (mvn_param_ == NULL) { + mvn_param_ = new ::ditcaffe::MVNParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.mvn_param) + return mvn_param_; +} +::ditcaffe::MVNParameter* V1LayerParameter::release_mvn_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.mvn_param) + clear_has_mvn_param(); + ::ditcaffe::MVNParameter* temp = mvn_param_; + mvn_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_mvn_param(::ditcaffe::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:ditcaffe.V1LayerParameter.mvn_param) +} + +// optional .ditcaffe.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_->::ditcaffe::PoolingParameter::Clear(); + clear_has_pooling_param(); +} +const ::ditcaffe::PoolingParameter& V1LayerParameter::pooling_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.pooling_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return pooling_param_ != NULL ? *pooling_param_ : *default_instance().pooling_param_; +#else + return pooling_param_ != NULL ? *pooling_param_ : *default_instance_->pooling_param_; +#endif +} +::ditcaffe::PoolingParameter* V1LayerParameter::mutable_pooling_param() { + set_has_pooling_param(); + if (pooling_param_ == NULL) { + pooling_param_ = new ::ditcaffe::PoolingParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.pooling_param) + return pooling_param_; +} +::ditcaffe::PoolingParameter* V1LayerParameter::release_pooling_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.pooling_param) + clear_has_pooling_param(); + ::ditcaffe::PoolingParameter* temp = pooling_param_; + pooling_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_pooling_param(::ditcaffe::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:ditcaffe.V1LayerParameter.pooling_param) +} + +// optional .ditcaffe.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_->::ditcaffe::PowerParameter::Clear(); + clear_has_power_param(); +} +const ::ditcaffe::PowerParameter& V1LayerParameter::power_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.power_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return power_param_ != NULL ? *power_param_ : *default_instance().power_param_; +#else + return power_param_ != NULL ? *power_param_ : *default_instance_->power_param_; +#endif +} +::ditcaffe::PowerParameter* V1LayerParameter::mutable_power_param() { + set_has_power_param(); + if (power_param_ == NULL) { + power_param_ = new ::ditcaffe::PowerParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.power_param) + return power_param_; +} +::ditcaffe::PowerParameter* V1LayerParameter::release_power_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.power_param) + clear_has_power_param(); + ::ditcaffe::PowerParameter* temp = power_param_; + power_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_power_param(::ditcaffe::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:ditcaffe.V1LayerParameter.power_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ReLUParameter::Clear(); + clear_has_relu_param(); +} +const ::ditcaffe::ReLUParameter& V1LayerParameter::relu_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.relu_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return relu_param_ != NULL ? *relu_param_ : *default_instance().relu_param_; +#else + return relu_param_ != NULL ? *relu_param_ : *default_instance_->relu_param_; +#endif +} +::ditcaffe::ReLUParameter* V1LayerParameter::mutable_relu_param() { + set_has_relu_param(); + if (relu_param_ == NULL) { + relu_param_ = new ::ditcaffe::ReLUParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.relu_param) + return relu_param_; +} +::ditcaffe::ReLUParameter* V1LayerParameter::release_relu_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.relu_param) + clear_has_relu_param(); + ::ditcaffe::ReLUParameter* temp = relu_param_; + relu_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_relu_param(::ditcaffe::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:ditcaffe.V1LayerParameter.relu_param) +} + +// optional .ditcaffe.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_->::ditcaffe::SigmoidParameter::Clear(); + clear_has_sigmoid_param(); +} +const ::ditcaffe::SigmoidParameter& V1LayerParameter::sigmoid_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.sigmoid_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return sigmoid_param_ != NULL ? *sigmoid_param_ : *default_instance().sigmoid_param_; +#else + return sigmoid_param_ != NULL ? *sigmoid_param_ : *default_instance_->sigmoid_param_; +#endif +} +::ditcaffe::SigmoidParameter* V1LayerParameter::mutable_sigmoid_param() { + set_has_sigmoid_param(); + if (sigmoid_param_ == NULL) { + sigmoid_param_ = new ::ditcaffe::SigmoidParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.sigmoid_param) + return sigmoid_param_; +} +::ditcaffe::SigmoidParameter* V1LayerParameter::release_sigmoid_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.sigmoid_param) + clear_has_sigmoid_param(); + ::ditcaffe::SigmoidParameter* temp = sigmoid_param_; + sigmoid_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_sigmoid_param(::ditcaffe::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:ditcaffe.V1LayerParameter.sigmoid_param) +} + +// optional .ditcaffe.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_->::ditcaffe::SoftmaxParameter::Clear(); + clear_has_softmax_param(); +} +const ::ditcaffe::SoftmaxParameter& V1LayerParameter::softmax_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.softmax_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return softmax_param_ != NULL ? *softmax_param_ : *default_instance().softmax_param_; +#else + return softmax_param_ != NULL ? *softmax_param_ : *default_instance_->softmax_param_; +#endif +} +::ditcaffe::SoftmaxParameter* V1LayerParameter::mutable_softmax_param() { + set_has_softmax_param(); + if (softmax_param_ == NULL) { + softmax_param_ = new ::ditcaffe::SoftmaxParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.softmax_param) + return softmax_param_; +} +::ditcaffe::SoftmaxParameter* V1LayerParameter::release_softmax_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.softmax_param) + clear_has_softmax_param(); + ::ditcaffe::SoftmaxParameter* temp = softmax_param_; + softmax_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_softmax_param(::ditcaffe::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:ditcaffe.V1LayerParameter.softmax_param) +} + +// optional .ditcaffe.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_->::ditcaffe::SliceParameter::Clear(); + clear_has_slice_param(); +} +const ::ditcaffe::SliceParameter& V1LayerParameter::slice_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.slice_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return slice_param_ != NULL ? *slice_param_ : *default_instance().slice_param_; +#else + return slice_param_ != NULL ? *slice_param_ : *default_instance_->slice_param_; +#endif +} +::ditcaffe::SliceParameter* V1LayerParameter::mutable_slice_param() { + set_has_slice_param(); + if (slice_param_ == NULL) { + slice_param_ = new ::ditcaffe::SliceParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.slice_param) + return slice_param_; +} +::ditcaffe::SliceParameter* V1LayerParameter::release_slice_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.slice_param) + clear_has_slice_param(); + ::ditcaffe::SliceParameter* temp = slice_param_; + slice_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_slice_param(::ditcaffe::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:ditcaffe.V1LayerParameter.slice_param) +} + +// optional .ditcaffe.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_->::ditcaffe::TanHParameter::Clear(); + clear_has_tanh_param(); +} +const ::ditcaffe::TanHParameter& V1LayerParameter::tanh_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.tanh_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return tanh_param_ != NULL ? *tanh_param_ : *default_instance().tanh_param_; +#else + return tanh_param_ != NULL ? *tanh_param_ : *default_instance_->tanh_param_; +#endif +} +::ditcaffe::TanHParameter* V1LayerParameter::mutable_tanh_param() { + set_has_tanh_param(); + if (tanh_param_ == NULL) { + tanh_param_ = new ::ditcaffe::TanHParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.tanh_param) + return tanh_param_; +} +::ditcaffe::TanHParameter* V1LayerParameter::release_tanh_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.tanh_param) + clear_has_tanh_param(); + ::ditcaffe::TanHParameter* temp = tanh_param_; + tanh_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_tanh_param(::ditcaffe::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:ditcaffe.V1LayerParameter.tanh_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ThresholdParameter::Clear(); + clear_has_threshold_param(); +} +const ::ditcaffe::ThresholdParameter& V1LayerParameter::threshold_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.threshold_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return threshold_param_ != NULL ? *threshold_param_ : *default_instance().threshold_param_; +#else + return threshold_param_ != NULL ? *threshold_param_ : *default_instance_->threshold_param_; +#endif +} +::ditcaffe::ThresholdParameter* V1LayerParameter::mutable_threshold_param() { + set_has_threshold_param(); + if (threshold_param_ == NULL) { + threshold_param_ = new ::ditcaffe::ThresholdParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.threshold_param) + return threshold_param_; +} +::ditcaffe::ThresholdParameter* V1LayerParameter::release_threshold_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.threshold_param) + clear_has_threshold_param(); + ::ditcaffe::ThresholdParameter* temp = threshold_param_; + threshold_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_threshold_param(::ditcaffe::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:ditcaffe.V1LayerParameter.threshold_param) +} + +// optional .ditcaffe.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_->::ditcaffe::WindowDataParameter::Clear(); + clear_has_window_data_param(); +} +const ::ditcaffe::WindowDataParameter& V1LayerParameter::window_data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.window_data_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return window_data_param_ != NULL ? *window_data_param_ : *default_instance().window_data_param_; +#else + return window_data_param_ != NULL ? *window_data_param_ : *default_instance_->window_data_param_; +#endif +} +::ditcaffe::WindowDataParameter* V1LayerParameter::mutable_window_data_param() { + set_has_window_data_param(); + if (window_data_param_ == NULL) { + window_data_param_ = new ::ditcaffe::WindowDataParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.window_data_param) + return window_data_param_; +} +::ditcaffe::WindowDataParameter* V1LayerParameter::release_window_data_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.window_data_param) + clear_has_window_data_param(); + ::ditcaffe::WindowDataParameter* temp = window_data_param_; + window_data_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_window_data_param(::ditcaffe::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:ditcaffe.V1LayerParameter.window_data_param) +} + +// optional .ditcaffe.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_->::ditcaffe::TransformationParameter::Clear(); + clear_has_transform_param(); +} +const ::ditcaffe::TransformationParameter& V1LayerParameter::transform_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.transform_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return transform_param_ != NULL ? *transform_param_ : *default_instance().transform_param_; +#else + return transform_param_ != NULL ? *transform_param_ : *default_instance_->transform_param_; +#endif +} +::ditcaffe::TransformationParameter* V1LayerParameter::mutable_transform_param() { + set_has_transform_param(); + if (transform_param_ == NULL) { + transform_param_ = new ::ditcaffe::TransformationParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.transform_param) + return transform_param_; +} +::ditcaffe::TransformationParameter* V1LayerParameter::release_transform_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.transform_param) + clear_has_transform_param(); + ::ditcaffe::TransformationParameter* temp = transform_param_; + transform_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_transform_param(::ditcaffe::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:ditcaffe.V1LayerParameter.transform_param) +} + +// optional .ditcaffe.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_->::ditcaffe::LossParameter::Clear(); + clear_has_loss_param(); +} +const ::ditcaffe::LossParameter& V1LayerParameter::loss_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.loss_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return loss_param_ != NULL ? *loss_param_ : *default_instance().loss_param_; +#else + return loss_param_ != NULL ? *loss_param_ : *default_instance_->loss_param_; +#endif +} +::ditcaffe::LossParameter* V1LayerParameter::mutable_loss_param() { + set_has_loss_param(); + if (loss_param_ == NULL) { + loss_param_ = new ::ditcaffe::LossParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.loss_param) + return loss_param_; +} +::ditcaffe::LossParameter* V1LayerParameter::release_loss_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.loss_param) + clear_has_loss_param(); + ::ditcaffe::LossParameter* temp = loss_param_; + loss_param_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_loss_param(::ditcaffe::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:ditcaffe.V1LayerParameter.loss_param) +} + +// optional .ditcaffe.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_->::ditcaffe::V0LayerParameter::Clear(); + clear_has_layer(); +} +const ::ditcaffe::V0LayerParameter& V1LayerParameter::layer() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.layer) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return layer_ != NULL ? *layer_ : *default_instance().layer_; +#else + return layer_ != NULL ? *layer_ : *default_instance_->layer_; +#endif +} +::ditcaffe::V0LayerParameter* V1LayerParameter::mutable_layer() { + set_has_layer(); + if (layer_ == NULL) { + layer_ = new ::ditcaffe::V0LayerParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.layer) + return layer_; +} +::ditcaffe::V0LayerParameter* V1LayerParameter::release_layer() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.layer) + clear_has_layer(); + ::ditcaffe::V0LayerParameter* temp = layer_; + layer_ = NULL; + return temp; +} +void V1LayerParameter::set_allocated_layer(::ditcaffe::V0LayerParameter* layer) { + delete layer_; + layer_ = layer; + if (layer) { + set_has_layer(); + } else { + clear_has_layer(); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.V1LayerParameter.layer) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +static ::std::string* MutableUnknownFieldsForV0LayerParameter( + V0LayerParameter* ptr) { + return ptr->mutable_unknown_fields(); +} + +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::MessageLite(), _arena_ptr_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.V0LayerParameter) +} + +void V0LayerParameter::InitAsDefaultInstance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + weight_filler_ = const_cast< ::ditcaffe::FillerParameter*>( + ::ditcaffe::FillerParameter::internal_default_instance()); +#else + weight_filler_ = const_cast< ::ditcaffe::FillerParameter*>(&::ditcaffe::FillerParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + bias_filler_ = const_cast< ::ditcaffe::FillerParameter*>( + ::ditcaffe::FillerParameter::internal_default_instance()); +#else + bias_filler_ = const_cast< ::ditcaffe::FillerParameter*>(&::ditcaffe::FillerParameter::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + hdf5_output_param_ = const_cast< ::ditcaffe::HDF5OutputParameter*>( + ::ditcaffe::HDF5OutputParameter::internal_default_instance()); +#else + hdf5_output_param_ = const_cast< ::ditcaffe::HDF5OutputParameter*>(&::ditcaffe::HDF5OutputParameter::default_instance()); +#endif +} + +V0LayerParameter::V0LayerParameter(const V0LayerParameter& from) + : ::google::protobuf::MessageLite(), + _arena_ptr_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.V0LayerParameter) +} + +void V0LayerParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + _unknown_fields_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + type_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + num_output_ = 0u; + biasterm_ = true; + weight_filler_ = NULL; + bias_filler_ = NULL; + pad_ = 0u; + kernelsize_ = 0u; + group_ = 1u; + stride_ = 1u; + pool_ = 0; + dropout_ratio_ = 0.5f; + local_size_ = 5u; + alpha_ = 1; + beta_ = 0.75f; + k_ = 1; + source_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + scale_ = 1; + meanfile_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + batchsize_ = 0u; + cropsize_ = 0u; + mirror_ = false; + rand_skip_ = 0u; + det_fg_threshold_ = 0.5f; + det_bg_threshold_ = 0.5f; + det_fg_fraction_ = 0.25f; + det_context_pad_ = 0u; + det_crop_mode_.UnsafeSetDefault(_default_det_crop_mode_); + new_num_ = 0; + new_channels_ = 0; + new_height_ = 0; + new_width_ = 0; + shuffle_images_ = false; + concat_dim_ = 1u; + hdf5_output_param_ = NULL; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +V0LayerParameter::~V0LayerParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.V0LayerParameter) + SharedDtor(); +} + +void V0LayerParameter::SharedDtor() { + _unknown_fields_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + 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_); + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + 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 V0LayerParameter& V0LayerParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +V0LayerParameter* V0LayerParameter::default_instance_ = NULL; + +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:ditcaffe.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_, pad_); + 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_->::ditcaffe::FillerParameter::Clear(); + } + if (has_bias_filler()) { + if (bias_filler_ != NULL) bias_filler_->::ditcaffe::FillerParameter::Clear(); + } + kernelsize_ = 0u; + } + 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) { + if (has_source()) { + source_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + scale_ = 1; + if (has_meanfile()) { + meanfile_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + batchsize_ = 0u; + cropsize_ = 0u; + mirror_ = false; + } + if (_has_bits_[24 / 32] & 4261412864u) { + rand_skip_ = 0u; + det_fg_threshold_ = 0.5f; + det_bg_threshold_ = 0.5f; + det_fg_fraction_ = 0.25f; + det_context_pad_ = 0u; + if (has_det_crop_mode()) { + det_crop_mode_.ClearToDefaultNoArena(_default_det_crop_mode_); + } + new_num_ = 0; + } + 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_->::ditcaffe::HDF5OutputParameter::Clear(); + } + } + +#undef ZR_HELPER_ +#undef ZR_ + + blobs_.Clear(); + blobs_lr_.Clear(); + weight_decay_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + _unknown_fields_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +bool V0LayerParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::internal::NewPermanentCallback( + &MutableUnknownFieldsForV0LayerParameter, this)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:ditcaffe.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())); + } 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())); + } 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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &num_output_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &biasterm_))); + set_has_biasterm(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(42)) goto parse_weight_filler; + break; + } + + // optional .ditcaffe.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 .ditcaffe.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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &pad_))); + set_has_pad(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(64)) goto parse_kernelsize; + break; + } + + // optional uint32 kernelsize = 8; + case 8: { + if (tag == 64) { + parse_kernelsize: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &kernelsize_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &group_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &stride_))); + set_has_stride(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(88)) goto parse_pool; + break; + } + + // optional .ditcaffe.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 (::ditcaffe::V0LayerParameter_PoolMethod_IsValid(value)) { + set_pool(static_cast< ::ditcaffe::V0LayerParameter_PoolMethod >(value)); + } else { + unknown_fields_stream.WriteVarint32(88); + unknown_fields_stream.WriteVarint32(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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &dropout_ratio_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &local_size_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &alpha_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &beta_))); + set_has_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())); + } 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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &scale_))); + set_has_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())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(152)) goto parse_batchsize; + break; + } + + // optional uint32 batchsize = 19; + case 19: { + if (tag == 152) { + parse_batchsize: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &batchsize_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &cropsize_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &mirror_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &k_))); + set_has_k(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(402)) goto parse_blobs; + break; + } + + // repeated .ditcaffe.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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &rand_skip_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &det_fg_threshold_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &det_bg_threshold_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &det_fg_fraction_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &det_context_pad_))); + set_has_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())); + } 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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &new_num_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &new_channels_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &new_height_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &new_width_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &shuffle_images_))); + set_has_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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &concat_dim_))); + set_has_concat_dim(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(8010)) goto parse_hdf5_output_param; + break; + } + + // optional .ditcaffe.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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.V0LayerParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.V0LayerParameter) + return false; +#undef DO_ +} + +void V0LayerParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.V0LayerParameter) + // optional string name = 1; + if (has_name()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // optional string type = 2; + if (has_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 .ditcaffe.FillerParameter weight_filler = 5; + if (has_weight_filler()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 5, *this->weight_filler_, output); + } + + // optional .ditcaffe.FillerParameter bias_filler = 6; + if (has_bias_filler()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 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 .ditcaffe.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::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::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 .ditcaffe.BlobProto blobs = 50; + for (unsigned int i = 0, n = this->blobs_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 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::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 .ditcaffe.HDF5OutputParameter hdf5_output_param = 1001; + if (has_hdf5_output_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 1001, *this->hdf5_output_param_, output); + } + + output->WriteRaw(unknown_fields().data(), + static_cast(unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:ditcaffe.V0LayerParameter) +} + +int V0LayerParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.V0LayerParameter) + int 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 .ditcaffe.FillerParameter weight_filler = 5; + if (has_weight_filler()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->weight_filler_); + } + + // optional .ditcaffe.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 .ditcaffe.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 .ditcaffe.HDF5OutputParameter hdf5_output_param = 1001; + if (has_hdf5_output_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->hdf5_output_param_); + } + + } + // repeated .ditcaffe.BlobProto blobs = 50; + total_size += 2 * this->blobs_size(); + for (int i = 0; i < this->blobs_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->blobs(i)); + } + + // repeated float blobs_lr = 51; + { + int data_size = 0; + data_size = 4 * this->blobs_lr_size(); + total_size += 2 * this->blobs_lr_size() + data_size; + } + + // repeated float weight_decay = 52; + { + int data_size = 0; + data_size = 4 * this->weight_decay_size(); + total_size += 2 * this->weight_decay_size() + data_size; + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void V0LayerParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void V0LayerParameter::MergeFrom(const V0LayerParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.V0LayerParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + blobs_.MergeFrom(from.blobs_); + blobs_lr_.MergeFrom(from.blobs_lr_); + weight_decay_.MergeFrom(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()->::ditcaffe::FillerParameter::MergeFrom(from.weight_filler()); + } + if (from.has_bias_filler()) { + mutable_bias_filler()->::ditcaffe::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()->::ditcaffe::HDF5OutputParameter::MergeFrom(from.hdf5_output_param()); + } + } + if (!from.unknown_fields().empty()) { + mutable_unknown_fields()->append(from.unknown_fields()); + } +} + +void V0LayerParameter::CopyFrom(const V0LayerParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.V0LayerParameter) + if (&from == this) return; + Clear(); + MergeFrom(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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); +} + +::std::string V0LayerParameter::GetTypeName() const { + return "ditcaffe.V0LayerParameter"; +} + +#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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.V0LayerParameter.name) +} + ::std::string* V0LayerParameter::mutable_name() { + set_has_name(); + // @@protoc_insertion_point(field_mutable:ditcaffe.V0LayerParameter.name) + return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* V0LayerParameter::release_name() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.V0LayerParameter.type) +} + ::std::string* V0LayerParameter::mutable_type() { + set_has_type(); + // @@protoc_insertion_point(field_mutable:ditcaffe.V0LayerParameter.type) + return type_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* V0LayerParameter::release_type() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.V0LayerParameter.biasterm) + return biasterm_; +} + void V0LayerParameter::set_biasterm(bool value) { + set_has_biasterm(); + biasterm_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.V0LayerParameter.biasterm) +} + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_weight_filler(); +} +const ::ditcaffe::FillerParameter& V0LayerParameter::weight_filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.V0LayerParameter.weight_filler) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return weight_filler_ != NULL ? *weight_filler_ : *default_instance().weight_filler_; +#else + return weight_filler_ != NULL ? *weight_filler_ : *default_instance_->weight_filler_; +#endif +} +::ditcaffe::FillerParameter* V0LayerParameter::mutable_weight_filler() { + set_has_weight_filler(); + if (weight_filler_ == NULL) { + weight_filler_ = new ::ditcaffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V0LayerParameter.weight_filler) + return weight_filler_; +} +::ditcaffe::FillerParameter* V0LayerParameter::release_weight_filler() { + // @@protoc_insertion_point(field_release:ditcaffe.V0LayerParameter.weight_filler) + clear_has_weight_filler(); + ::ditcaffe::FillerParameter* temp = weight_filler_; + weight_filler_ = NULL; + return temp; +} +void V0LayerParameter::set_allocated_weight_filler(::ditcaffe::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:ditcaffe.V0LayerParameter.weight_filler) +} + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_bias_filler(); +} +const ::ditcaffe::FillerParameter& V0LayerParameter::bias_filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.V0LayerParameter.bias_filler) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return bias_filler_ != NULL ? *bias_filler_ : *default_instance().bias_filler_; +#else + return bias_filler_ != NULL ? *bias_filler_ : *default_instance_->bias_filler_; +#endif +} +::ditcaffe::FillerParameter* V0LayerParameter::mutable_bias_filler() { + set_has_bias_filler(); + if (bias_filler_ == NULL) { + bias_filler_ = new ::ditcaffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V0LayerParameter.bias_filler) + return bias_filler_; +} +::ditcaffe::FillerParameter* V0LayerParameter::release_bias_filler() { + // @@protoc_insertion_point(field_release:ditcaffe.V0LayerParameter.bias_filler) + clear_has_bias_filler(); + ::ditcaffe::FillerParameter* temp = bias_filler_; + bias_filler_ = NULL; + return temp; +} +void V0LayerParameter::set_allocated_bias_filler(::ditcaffe::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:ditcaffe.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:ditcaffe.V0LayerParameter.pad) + return pad_; +} + void V0LayerParameter::set_pad(::google::protobuf::uint32 value) { + set_has_pad(); + pad_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.V0LayerParameter.kernelsize) + return kernelsize_; +} + void V0LayerParameter::set_kernelsize(::google::protobuf::uint32 value) { + set_has_kernelsize(); + kernelsize_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.V0LayerParameter.group) + return group_; +} + void V0LayerParameter::set_group(::google::protobuf::uint32 value) { + set_has_group(); + group_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.V0LayerParameter.stride) + return stride_; +} + void V0LayerParameter::set_stride(::google::protobuf::uint32 value) { + set_has_stride(); + stride_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.V0LayerParameter.stride) +} + +// optional .ditcaffe.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(); +} + ::ditcaffe::V0LayerParameter_PoolMethod V0LayerParameter::pool() const { + // @@protoc_insertion_point(field_get:ditcaffe.V0LayerParameter.pool) + return static_cast< ::ditcaffe::V0LayerParameter_PoolMethod >(pool_); +} + void V0LayerParameter::set_pool(::ditcaffe::V0LayerParameter_PoolMethod value) { + assert(::ditcaffe::V0LayerParameter_PoolMethod_IsValid(value)); + set_has_pool(); + pool_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.V0LayerParameter.alpha) + return alpha_; +} + void V0LayerParameter::set_alpha(float value) { + set_has_alpha(); + alpha_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.V0LayerParameter.beta) + return beta_; +} + void V0LayerParameter::set_beta(float value) { + set_has_beta(); + beta_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.V0LayerParameter.k) + return k_; +} + void V0LayerParameter::set_k(float value) { + set_has_k(); + k_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.V0LayerParameter.source) +} + ::std::string* V0LayerParameter::mutable_source() { + set_has_source(); + // @@protoc_insertion_point(field_mutable:ditcaffe.V0LayerParameter.source) + return source_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* V0LayerParameter::release_source() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.V0LayerParameter.scale) + return scale_; +} + void V0LayerParameter::set_scale(float value) { + set_has_scale(); + scale_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.V0LayerParameter.meanfile) +} + ::std::string* V0LayerParameter::mutable_meanfile() { + set_has_meanfile(); + // @@protoc_insertion_point(field_mutable:ditcaffe.V0LayerParameter.meanfile) + return meanfile_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* V0LayerParameter::release_meanfile() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.V0LayerParameter.batchsize) + return batchsize_; +} + void V0LayerParameter::set_batchsize(::google::protobuf::uint32 value) { + set_has_batchsize(); + batchsize_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.V0LayerParameter.cropsize) + return cropsize_; +} + void V0LayerParameter::set_cropsize(::google::protobuf::uint32 value) { + set_has_cropsize(); + cropsize_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.V0LayerParameter.mirror) + return mirror_; +} + void V0LayerParameter::set_mirror(bool value) { + set_has_mirror(); + mirror_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.V0LayerParameter.mirror) +} + +// repeated .ditcaffe.BlobProto blobs = 50; +int V0LayerParameter::blobs_size() const { + return blobs_.size(); +} +void V0LayerParameter::clear_blobs() { + blobs_.Clear(); +} +const ::ditcaffe::BlobProto& V0LayerParameter::blobs(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.V0LayerParameter.blobs) + return blobs_.Get(index); +} +::ditcaffe::BlobProto* V0LayerParameter::mutable_blobs(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.V0LayerParameter.blobs) + return blobs_.Mutable(index); +} +::ditcaffe::BlobProto* V0LayerParameter::add_blobs() { + // @@protoc_insertion_point(field_add:ditcaffe.V0LayerParameter.blobs) + return blobs_.Add(); +} +::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >* +V0LayerParameter::mutable_blobs() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.V0LayerParameter.blobs) + return &blobs_; +} +const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >& +V0LayerParameter::blobs() const { + // @@protoc_insertion_point(field_list:ditcaffe.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:ditcaffe.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:ditcaffe.V0LayerParameter.blobs_lr) +} + void V0LayerParameter::add_blobs_lr(float value) { + blobs_lr_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.V0LayerParameter.blobs_lr) +} + const ::google::protobuf::RepeatedField< float >& +V0LayerParameter::blobs_lr() const { + // @@protoc_insertion_point(field_list:ditcaffe.V0LayerParameter.blobs_lr) + return blobs_lr_; +} + ::google::protobuf::RepeatedField< float >* +V0LayerParameter::mutable_blobs_lr() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.V0LayerParameter.weight_decay) +} + void V0LayerParameter::add_weight_decay(float value) { + weight_decay_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.V0LayerParameter.weight_decay) +} + const ::google::protobuf::RepeatedField< float >& +V0LayerParameter::weight_decay() const { + // @@protoc_insertion_point(field_list:ditcaffe.V0LayerParameter.weight_decay) + return weight_decay_; +} + ::google::protobuf::RepeatedField< float >* +V0LayerParameter::mutable_weight_decay() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.V0LayerParameter.det_crop_mode) +} + ::std::string* V0LayerParameter::mutable_det_crop_mode() { + set_has_det_crop_mode(); + // @@protoc_insertion_point(field_mutable:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.V0LayerParameter.concat_dim) +} + +// optional .ditcaffe.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_->::ditcaffe::HDF5OutputParameter::Clear(); + clear_has_hdf5_output_param(); +} +const ::ditcaffe::HDF5OutputParameter& V0LayerParameter::hdf5_output_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V0LayerParameter.hdf5_output_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return hdf5_output_param_ != NULL ? *hdf5_output_param_ : *default_instance().hdf5_output_param_; +#else + return hdf5_output_param_ != NULL ? *hdf5_output_param_ : *default_instance_->hdf5_output_param_; +#endif +} +::ditcaffe::HDF5OutputParameter* V0LayerParameter::mutable_hdf5_output_param() { + set_has_hdf5_output_param(); + if (hdf5_output_param_ == NULL) { + hdf5_output_param_ = new ::ditcaffe::HDF5OutputParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V0LayerParameter.hdf5_output_param) + return hdf5_output_param_; +} +::ditcaffe::HDF5OutputParameter* V0LayerParameter::release_hdf5_output_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V0LayerParameter.hdf5_output_param) + clear_has_hdf5_output_param(); + ::ditcaffe::HDF5OutputParameter* temp = hdf5_output_param_; + hdf5_output_param_ = NULL; + return temp; +} +void V0LayerParameter::set_allocated_hdf5_output_param(::ditcaffe::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:ditcaffe.V0LayerParameter.hdf5_output_param) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +static ::std::string* MutableUnknownFieldsForPReLUParameter( + PReLUParameter* ptr) { + return ptr->mutable_unknown_fields(); +} + +#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::MessageLite(), _arena_ptr_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:ditcaffe.PReLUParameter) +} + +void PReLUParameter::InitAsDefaultInstance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + filler_ = const_cast< ::ditcaffe::FillerParameter*>( + ::ditcaffe::FillerParameter::internal_default_instance()); +#else + filler_ = const_cast< ::ditcaffe::FillerParameter*>(&::ditcaffe::FillerParameter::default_instance()); +#endif +} + +PReLUParameter::PReLUParameter(const PReLUParameter& from) + : ::google::protobuf::MessageLite(), + _arena_ptr_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:ditcaffe.PReLUParameter) +} + +void PReLUParameter::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + _unknown_fields_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + filler_ = NULL; + channel_shared_ = false; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +PReLUParameter::~PReLUParameter() { + // @@protoc_insertion_point(destructor:ditcaffe.PReLUParameter) + SharedDtor(); +} + +void PReLUParameter::SharedDtor() { + _unknown_fields_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + delete filler_; + } +} + +void PReLUParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const PReLUParameter& PReLUParameter::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +#endif + return *default_instance_; +} + +PReLUParameter* PReLUParameter::default_instance_ = NULL; + +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:ditcaffe.PReLUParameter) + if (_has_bits_[0 / 32] & 3u) { + if (has_filler()) { + if (filler_ != NULL) filler_->::ditcaffe::FillerParameter::Clear(); + } + channel_shared_ = false; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + _unknown_fields_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +bool PReLUParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::internal::NewPermanentCallback( + &MutableUnknownFieldsForPReLUParameter, this)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:ditcaffe.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 .ditcaffe.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: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &channel_shared_))); + set_has_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::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:ditcaffe.PReLUParameter) + return true; +failure: + // @@protoc_insertion_point(parse_failure:ditcaffe.PReLUParameter) + return false; +#undef DO_ +} + +void PReLUParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:ditcaffe.PReLUParameter) + // optional .ditcaffe.FillerParameter filler = 1; + if (has_filler()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 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); + } + + output->WriteRaw(unknown_fields().data(), + static_cast(unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:ditcaffe.PReLUParameter) +} + +int PReLUParameter::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:ditcaffe.PReLUParameter) + int total_size = 0; + + if (_has_bits_[0 / 32] & 3u) { + // optional .ditcaffe.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; + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void PReLUParameter::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} + +void PReLUParameter::MergeFrom(const PReLUParameter& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:ditcaffe.PReLUParameter) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_filler()) { + mutable_filler()->::ditcaffe::FillerParameter::MergeFrom(from.filler()); + } + if (from.has_channel_shared()) { + set_channel_shared(from.channel_shared()); + } + } + if (!from.unknown_fields().empty()) { + mutable_unknown_fields()->append(from.unknown_fields()); + } +} + +void PReLUParameter::CopyFrom(const PReLUParameter& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ditcaffe.PReLUParameter) + if (&from == this) return; + Clear(); + MergeFrom(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]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); +} + +::std::string PReLUParameter::GetTypeName() const { + return "ditcaffe.PReLUParameter"; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// PReLUParameter + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_filler(); +} +const ::ditcaffe::FillerParameter& PReLUParameter::filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.PReLUParameter.filler) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return filler_ != NULL ? *filler_ : *default_instance().filler_; +#else + return filler_ != NULL ? *filler_ : *default_instance_->filler_; +#endif +} +::ditcaffe::FillerParameter* PReLUParameter::mutable_filler() { + set_has_filler(); + if (filler_ == NULL) { + filler_ = new ::ditcaffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.PReLUParameter.filler) + return filler_; +} +::ditcaffe::FillerParameter* PReLUParameter::release_filler() { + // @@protoc_insertion_point(field_release:ditcaffe.PReLUParameter.filler) + clear_has_filler(); + ::ditcaffe::FillerParameter* temp = filler_; + filler_ = NULL; + return temp; +} +void PReLUParameter::set_allocated_filler(::ditcaffe::FillerParameter* filler) { + delete filler_; + filler_ = filler; + if (filler) { + set_has_filler(); + } else { + clear_has_filler(); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.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:ditcaffe.PReLUParameter.channel_shared) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// @@protoc_insertion_point(namespace_scope) + +} // namespace ditcaffe + +// @@protoc_insertion_point(global_scope) diff --git a/umd/core/src/compiler/caffe/ditcaffe/protobuf-lite-3.0.0/ditcaffe.opt-for-lite.pb.h b/umd/core/src/compiler/caffe/ditcaffe/protobuf-lite-3.0.0/ditcaffe.opt-for-lite.pb.h new file mode 100644 index 00000000..17e0d14c --- /dev/null +++ b/umd/core/src/compiler/caffe/ditcaffe/protobuf-lite-3.0.0/ditcaffe.opt-for-lite.pb.h @@ -0,0 +1,25545 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: ditcaffe.opt-for-lite.proto + +#ifndef PROTOBUF_ditcaffe_2eopt_2dfor_2dlite_2eproto__INCLUDED +#define PROTOBUF_ditcaffe_2eopt_2dfor_2dlite_2eproto__INCLUDED + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3000000 +#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 3000000 < 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 ditcaffe { + +// Internal implementation detail -- do not call these. +void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); +void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_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 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 PReLUParameter; +class ParamSpec; +class ParameterParameter; +class PoolingParameter; +class PowerParameter; +class PythonParameter; +class ReLUParameter; +class ReductionParameter; +class ReshapeParameter; +class SPPParameter; +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 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; + +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; + +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; + +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; + +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; + +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; + +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; + +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; + +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; + +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; + +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; + +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; + +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; + +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; + +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; + +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; + +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; + +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; + +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; + +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; + +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; + +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; + +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; + +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; + +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; + +// =================================================================== + +class BlobShape : public ::google::protobuf::MessageLite { + public: + BlobShape(); + virtual ~BlobShape(); + + BlobShape(const BlobShape& from); + + inline BlobShape& operator=(const BlobShape& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_.GetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + inline ::std::string* mutable_unknown_fields() { + return _unknown_fields_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + static const BlobShape& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const BlobShape* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(BlobShape* other); + + // implements Message ---------------------------------------------- + + inline BlobShape* New() const { return New(NULL); } + + BlobShape* New(::google::protobuf::Arena* arena) const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const BlobShape& from); + void MergeFrom(const BlobShape& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(BlobShape* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _arena_ptr_; + } + inline ::google::protobuf::Arena* MaybeArenaPtr() const { + return _arena_ptr_; + } + public: + + ::std::string GetTypeName() 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:ditcaffe.BlobShape) + private: + + ::google::protobuf::internal::ArenaStringPtr _unknown_fields_; + ::google::protobuf::Arena* _arena_ptr_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 > dim_; + mutable int _dim_cached_byte_size_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static BlobShape* default_instance_; +}; +// ------------------------------------------------------------------- + +class BlobProto : public ::google::protobuf::MessageLite { + public: + BlobProto(); + virtual ~BlobProto(); + + BlobProto(const BlobProto& from); + + inline BlobProto& operator=(const BlobProto& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_.GetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + inline ::std::string* mutable_unknown_fields() { + return _unknown_fields_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + static const BlobProto& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const BlobProto* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(BlobProto* other); + + // implements Message ---------------------------------------------- + + inline BlobProto* New() const { return New(NULL); } + + BlobProto* New(::google::protobuf::Arena* arena) const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const BlobProto& from); + void MergeFrom(const BlobProto& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(BlobProto* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _arena_ptr_; + } + inline ::google::protobuf::Arena* MaybeArenaPtr() const { + return _arena_ptr_; + } + public: + + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional .ditcaffe.BlobShape shape = 7; + bool has_shape() const; + void clear_shape(); + static const int kShapeFieldNumber = 7; + const ::ditcaffe::BlobShape& shape() const; + ::ditcaffe::BlobShape* mutable_shape(); + ::ditcaffe::BlobShape* release_shape(); + void set_allocated_shape(::ditcaffe::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(); + + // repeated uint32 half_data = 10 [packed = true]; + int half_data_size() const; + void clear_half_data(); + static const int kHalfDataFieldNumber = 10; + ::google::protobuf::uint32 half_data(int index) const; + void set_half_data(int index, ::google::protobuf::uint32 value); + void add_half_data(::google::protobuf::uint32 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& + half_data() const; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* + mutable_half_data(); + + // repeated uint32 half_diff = 11 [packed = true]; + int half_diff_size() const; + void clear_half_diff(); + static const int kHalfDiffFieldNumber = 11; + ::google::protobuf::uint32 half_diff(int index) const; + void set_half_diff(int index, ::google::protobuf::uint32 value); + void add_half_diff(::google::protobuf::uint32 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& + half_diff() const; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* + mutable_half_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:ditcaffe.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::ArenaStringPtr _unknown_fields_; + ::google::protobuf::Arena* _arena_ptr_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::ditcaffe::BlobShape* shape_; + ::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_; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > half_data_; + mutable int _half_data_cached_byte_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > half_diff_; + mutable int _half_diff_cached_byte_size_; + ::google::protobuf::int32 num_; + ::google::protobuf::int32 channels_; + ::google::protobuf::int32 height_; + ::google::protobuf::int32 width_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static BlobProto* default_instance_; +}; +// ------------------------------------------------------------------- + +class BlobProtoVector : public ::google::protobuf::MessageLite { + public: + BlobProtoVector(); + virtual ~BlobProtoVector(); + + BlobProtoVector(const BlobProtoVector& from); + + inline BlobProtoVector& operator=(const BlobProtoVector& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_.GetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + inline ::std::string* mutable_unknown_fields() { + return _unknown_fields_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + static const BlobProtoVector& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const BlobProtoVector* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(BlobProtoVector* other); + + // implements Message ---------------------------------------------- + + inline BlobProtoVector* New() const { return New(NULL); } + + BlobProtoVector* New(::google::protobuf::Arena* arena) const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const BlobProtoVector& from); + void MergeFrom(const BlobProtoVector& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(BlobProtoVector* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _arena_ptr_; + } + inline ::google::protobuf::Arena* MaybeArenaPtr() const { + return _arena_ptr_; + } + public: + + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .ditcaffe.BlobProto blobs = 1; + int blobs_size() const; + void clear_blobs(); + static const int kBlobsFieldNumber = 1; + const ::ditcaffe::BlobProto& blobs(int index) const; + ::ditcaffe::BlobProto* mutable_blobs(int index); + ::ditcaffe::BlobProto* add_blobs(); + ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >* + mutable_blobs(); + const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >& + blobs() const; + + // @@protoc_insertion_point(class_scope:ditcaffe.BlobProtoVector) + private: + + ::google::protobuf::internal::ArenaStringPtr _unknown_fields_; + ::google::protobuf::Arena* _arena_ptr_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto > blobs_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static BlobProtoVector* default_instance_; +}; +// ------------------------------------------------------------------- + +class Datum : public ::google::protobuf::MessageLite { + public: + Datum(); + virtual ~Datum(); + + Datum(const Datum& from); + + inline Datum& operator=(const Datum& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_.GetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + inline ::std::string* mutable_unknown_fields() { + return _unknown_fields_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + static const Datum& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const Datum* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(Datum* other); + + // implements Message ---------------------------------------------- + + inline Datum* New() const { return New(NULL); } + + Datum* New(::google::protobuf::Arena* arena) const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const Datum& from); + void MergeFrom(const Datum& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(Datum* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _arena_ptr_; + } + inline ::google::protobuf::Arena* MaybeArenaPtr() const { + return _arena_ptr_; + } + public: + + ::std::string GetTypeName() 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:ditcaffe.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::ArenaStringPtr _unknown_fields_; + ::google::protobuf::Arena* _arena_ptr_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::int32 channels_; + ::google::protobuf::int32 height_; + ::google::protobuf::internal::ArenaStringPtr data_; + ::google::protobuf::int32 width_; + ::google::protobuf::int32 label_; + ::google::protobuf::RepeatedField< float > float_data_; + bool encoded_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static Datum* default_instance_; +}; +// ------------------------------------------------------------------- + +class FillerParameter : public ::google::protobuf::MessageLite { + public: + FillerParameter(); + virtual ~FillerParameter(); + + FillerParameter(const FillerParameter& from); + + inline FillerParameter& operator=(const FillerParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_.GetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + inline ::std::string* mutable_unknown_fields() { + return _unknown_fields_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + static const FillerParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const FillerParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(FillerParameter* other); + + // implements Message ---------------------------------------------- + + inline FillerParameter* New() const { return New(NULL); } + + FillerParameter* New(::google::protobuf::Arena* arena) const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const FillerParameter& from); + void MergeFrom(const FillerParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(FillerParameter* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _arena_ptr_; + } + inline ::google::protobuf::Arena* MaybeArenaPtr() const { + return _arena_ptr_; + } + public: + + ::std::string GetTypeName() 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; + + // 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 .ditcaffe.FillerParameter.VarianceNorm variance_norm = 8 [default = FAN_IN]; + bool has_variance_norm() const; + void clear_variance_norm(); + static const int kVarianceNormFieldNumber = 8; + ::ditcaffe::FillerParameter_VarianceNorm variance_norm() const; + void set_variance_norm(::ditcaffe::FillerParameter_VarianceNorm value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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::ArenaStringPtr _unknown_fields_; + ::google::protobuf::Arena* _arena_ptr_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + static ::std::string* _default_type_; + ::google::protobuf::internal::ArenaStringPtr type_; + float value_; + float min_; + float max_; + float mean_; + float std_; + ::google::protobuf::int32 sparse_; + int variance_norm_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static FillerParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class NetParameter : public ::google::protobuf::MessageLite { + public: + NetParameter(); + virtual ~NetParameter(); + + NetParameter(const NetParameter& from); + + inline NetParameter& operator=(const NetParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_.GetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + inline ::std::string* mutable_unknown_fields() { + return _unknown_fields_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + static const NetParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const NetParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(NetParameter* other); + + // implements Message ---------------------------------------------- + + inline NetParameter* New() const { return New(NULL); } + + NetParameter* New(::google::protobuf::Arena* arena) const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const NetParameter& from); + void MergeFrom(const NetParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(NetParameter* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _arena_ptr_; + } + inline ::google::protobuf::Arena* MaybeArenaPtr() const { + return _arena_ptr_; + } + public: + + ::std::string GetTypeName() 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 .ditcaffe.BlobShape input_shape = 8; + int input_shape_size() const; + void clear_input_shape(); + static const int kInputShapeFieldNumber = 8; + const ::ditcaffe::BlobShape& input_shape(int index) const; + ::ditcaffe::BlobShape* mutable_input_shape(int index); + ::ditcaffe::BlobShape* add_input_shape(); + ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobShape >* + mutable_input_shape(); + const ::google::protobuf::RepeatedPtrField< ::ditcaffe::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 .ditcaffe.NetState state = 6; + bool has_state() const; + void clear_state(); + static const int kStateFieldNumber = 6; + const ::ditcaffe::NetState& state() const; + ::ditcaffe::NetState* mutable_state(); + ::ditcaffe::NetState* release_state(); + void set_allocated_state(::ditcaffe::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 .ditcaffe.LayerParameter layer = 100; + int layer_size() const; + void clear_layer(); + static const int kLayerFieldNumber = 100; + const ::ditcaffe::LayerParameter& layer(int index) const; + ::ditcaffe::LayerParameter* mutable_layer(int index); + ::ditcaffe::LayerParameter* add_layer(); + ::google::protobuf::RepeatedPtrField< ::ditcaffe::LayerParameter >* + mutable_layer(); + const ::google::protobuf::RepeatedPtrField< ::ditcaffe::LayerParameter >& + layer() const; + + // repeated .ditcaffe.V1LayerParameter layers = 2; + int layers_size() const; + void clear_layers(); + static const int kLayersFieldNumber = 2; + const ::ditcaffe::V1LayerParameter& layers(int index) const; + ::ditcaffe::V1LayerParameter* mutable_layers(int index); + ::ditcaffe::V1LayerParameter* add_layers(); + ::google::protobuf::RepeatedPtrField< ::ditcaffe::V1LayerParameter >* + mutable_layers(); + const ::google::protobuf::RepeatedPtrField< ::ditcaffe::V1LayerParameter >& + layers() const; + + // @@protoc_insertion_point(class_scope:ditcaffe.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::ArenaStringPtr _unknown_fields_; + ::google::protobuf::Arena* _arena_ptr_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::internal::ArenaStringPtr name_; + ::google::protobuf::RepeatedPtrField< ::std::string> input_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobShape > input_shape_; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 > input_dim_; + ::ditcaffe::NetState* state_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::LayerParameter > layer_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::V1LayerParameter > layers_; + bool force_backward_; + bool debug_info_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static NetParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class SolverParameter : public ::google::protobuf::MessageLite { + public: + SolverParameter(); + virtual ~SolverParameter(); + + SolverParameter(const SolverParameter& from); + + inline SolverParameter& operator=(const SolverParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_.GetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + inline ::std::string* mutable_unknown_fields() { + return _unknown_fields_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + static const SolverParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const SolverParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(SolverParameter* other); + + // implements Message ---------------------------------------------- + + inline SolverParameter* New() const { return New(NULL); } + + SolverParameter* New(::google::protobuf::Arena* arena) const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const SolverParameter& from); + void MergeFrom(const SolverParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(SolverParameter* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _arena_ptr_; + } + inline ::google::protobuf::Arena* MaybeArenaPtr() const { + return _arena_ptr_; + } + public: + + ::std::string GetTypeName() 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; + + 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; + + 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; + + // 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 .ditcaffe.NetParameter net_param = 25; + bool has_net_param() const; + void clear_net_param(); + static const int kNetParamFieldNumber = 25; + const ::ditcaffe::NetParameter& net_param() const; + ::ditcaffe::NetParameter* mutable_net_param(); + ::ditcaffe::NetParameter* release_net_param(); + void set_allocated_net_param(::ditcaffe::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 .ditcaffe.NetParameter train_net_param = 21; + bool has_train_net_param() const; + void clear_train_net_param(); + static const int kTrainNetParamFieldNumber = 21; + const ::ditcaffe::NetParameter& train_net_param() const; + ::ditcaffe::NetParameter* mutable_train_net_param(); + ::ditcaffe::NetParameter* release_train_net_param(); + void set_allocated_train_net_param(::ditcaffe::NetParameter* train_net_param); + + // repeated .ditcaffe.NetParameter test_net_param = 22; + int test_net_param_size() const; + void clear_test_net_param(); + static const int kTestNetParamFieldNumber = 22; + const ::ditcaffe::NetParameter& test_net_param(int index) const; + ::ditcaffe::NetParameter* mutable_test_net_param(int index); + ::ditcaffe::NetParameter* add_test_net_param(); + ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetParameter >* + mutable_test_net_param(); + const ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetParameter >& + test_net_param() const; + + // optional .ditcaffe.NetState train_state = 26; + bool has_train_state() const; + void clear_train_state(); + static const int kTrainStateFieldNumber = 26; + const ::ditcaffe::NetState& train_state() const; + ::ditcaffe::NetState* mutable_train_state(); + ::ditcaffe::NetState* release_train_state(); + void set_allocated_train_state(::ditcaffe::NetState* train_state); + + // repeated .ditcaffe.NetState test_state = 27; + int test_state_size() const; + void clear_test_state(); + static const int kTestStateFieldNumber = 27; + const ::ditcaffe::NetState& test_state(int index) const; + ::ditcaffe::NetState* mutable_test_state(int index); + ::ditcaffe::NetState* add_test_state(); + ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetState >* + mutable_test_state(); + const ::google::protobuf::RepeatedPtrField< ::ditcaffe::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 .ditcaffe.SolverParameter.SnapshotFormat snapshot_format = 37 [default = BINARYPROTO]; + bool has_snapshot_format() const; + void clear_snapshot_format(); + static const int kSnapshotFormatFieldNumber = 37; + ::ditcaffe::SolverParameter_SnapshotFormat snapshot_format() const; + void set_snapshot_format(::ditcaffe::SolverParameter_SnapshotFormat value); + + // optional .ditcaffe.SolverParameter.SolverMode solver_mode = 17 [default = GPU]; + bool has_solver_mode() const; + void clear_solver_mode(); + static const int kSolverModeFieldNumber = 17; + ::ditcaffe::SolverParameter_SolverMode solver_mode() const; + void set_solver_mode(::ditcaffe::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; + 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 .ditcaffe.SolverParameter.SolverType solver_type = 30 [default = SGD]; + bool has_solver_type() const; + void clear_solver_type(); + static const int kSolverTypeFieldNumber = 30; + ::ditcaffe::SolverParameter_SolverType solver_type() const; + void set_solver_type(::ditcaffe::SolverParameter_SolverType value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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::ArenaStringPtr _unknown_fields_; + ::google::protobuf::Arena* _arena_ptr_; + + ::google::protobuf::uint32 _has_bits_[2]; + ::google::protobuf::internal::ArenaStringPtr net_; + ::ditcaffe::NetParameter* net_param_; + ::google::protobuf::internal::ArenaStringPtr train_net_; + ::google::protobuf::RepeatedPtrField< ::std::string> test_net_; + ::ditcaffe::NetParameter* train_net_param_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetParameter > test_net_param_; + ::ditcaffe::NetState* train_state_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetState > test_state_; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 > test_iter_; + ::google::protobuf::int32 test_interval_; + float base_lr_; + ::google::protobuf::int32 display_; + ::google::protobuf::int32 average_loss_; + ::google::protobuf::int32 max_iter_; + ::google::protobuf::int32 iter_size_; + ::google::protobuf::internal::ArenaStringPtr lr_policy_; + float gamma_; + float power_; + float momentum_; + float weight_decay_; + bool test_compute_loss_; + bool test_initialization_; + bool snapshot_diff_; + bool debug_info_; + ::google::protobuf::int32 stepsize_; + static ::std::string* _default_regularization_type_; + ::google::protobuf::internal::ArenaStringPtr regularization_type_; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 > stepvalue_; + float clip_gradients_; + ::google::protobuf::int32 snapshot_; + ::google::protobuf::internal::ArenaStringPtr snapshot_prefix_; + int snapshot_format_; + int solver_mode_; + ::google::protobuf::int64 random_seed_; + ::google::protobuf::int32 device_id_; + float delta_; + static ::std::string* _default_type_; + ::google::protobuf::internal::ArenaStringPtr type_; + float momentum2_; + float rms_decay_; + bool snapshot_after_train_; + int solver_type_; + mutable int _cached_size_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static SolverParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class SolverState : public ::google::protobuf::MessageLite { + public: + SolverState(); + virtual ~SolverState(); + + SolverState(const SolverState& from); + + inline SolverState& operator=(const SolverState& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_.GetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + inline ::std::string* mutable_unknown_fields() { + return _unknown_fields_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + static const SolverState& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const SolverState* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(SolverState* other); + + // implements Message ---------------------------------------------- + + inline SolverState* New() const { return New(NULL); } + + SolverState* New(::google::protobuf::Arena* arena) const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const SolverState& from); + void MergeFrom(const SolverState& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(SolverState* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _arena_ptr_; + } + inline ::google::protobuf::Arena* MaybeArenaPtr() const { + return _arena_ptr_; + } + public: + + ::std::string GetTypeName() 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 .ditcaffe.BlobProto history = 3; + int history_size() const; + void clear_history(); + static const int kHistoryFieldNumber = 3; + const ::ditcaffe::BlobProto& history(int index) const; + ::ditcaffe::BlobProto* mutable_history(int index); + ::ditcaffe::BlobProto* add_history(); + ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >* + mutable_history(); + const ::google::protobuf::RepeatedPtrField< ::ditcaffe::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:ditcaffe.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::ArenaStringPtr _unknown_fields_; + ::google::protobuf::Arena* _arena_ptr_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::internal::ArenaStringPtr learned_net_; + ::google::protobuf::int32 iter_; + ::google::protobuf::int32 current_step_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto > history_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static SolverState* default_instance_; +}; +// ------------------------------------------------------------------- + +class NetState : public ::google::protobuf::MessageLite { + public: + NetState(); + virtual ~NetState(); + + NetState(const NetState& from); + + inline NetState& operator=(const NetState& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_.GetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + inline ::std::string* mutable_unknown_fields() { + return _unknown_fields_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + static const NetState& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const NetState* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(NetState* other); + + // implements Message ---------------------------------------------- + + inline NetState* New() const { return New(NULL); } + + NetState* New(::google::protobuf::Arena* arena) const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const NetState& from); + void MergeFrom(const NetState& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(NetState* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _arena_ptr_; + } + inline ::google::protobuf::Arena* MaybeArenaPtr() const { + return _arena_ptr_; + } + public: + + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional .ditcaffe.Phase phase = 1 [default = TEST]; + bool has_phase() const; + void clear_phase(); + static const int kPhaseFieldNumber = 1; + ::ditcaffe::Phase phase() const; + void set_phase(::ditcaffe::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:ditcaffe.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::ArenaStringPtr _unknown_fields_; + ::google::protobuf::Arena* _arena_ptr_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + int phase_; + ::google::protobuf::int32 level_; + ::google::protobuf::RepeatedPtrField< ::std::string> stage_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static NetState* default_instance_; +}; +// ------------------------------------------------------------------- + +class NetStateRule : public ::google::protobuf::MessageLite { + public: + NetStateRule(); + virtual ~NetStateRule(); + + NetStateRule(const NetStateRule& from); + + inline NetStateRule& operator=(const NetStateRule& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_.GetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + inline ::std::string* mutable_unknown_fields() { + return _unknown_fields_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + static const NetStateRule& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const NetStateRule* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(NetStateRule* other); + + // implements Message ---------------------------------------------- + + inline NetStateRule* New() const { return New(NULL); } + + NetStateRule* New(::google::protobuf::Arena* arena) const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const NetStateRule& from); + void MergeFrom(const NetStateRule& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(NetStateRule* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _arena_ptr_; + } + inline ::google::protobuf::Arena* MaybeArenaPtr() const { + return _arena_ptr_; + } + public: + + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional .ditcaffe.Phase phase = 1; + bool has_phase() const; + void clear_phase(); + static const int kPhaseFieldNumber = 1; + ::ditcaffe::Phase phase() const; + void set_phase(::ditcaffe::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:ditcaffe.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::ArenaStringPtr _unknown_fields_; + ::google::protobuf::Arena* _arena_ptr_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + int phase_; + ::google::protobuf::int32 min_level_; + ::google::protobuf::RepeatedPtrField< ::std::string> stage_; + ::google::protobuf::RepeatedPtrField< ::std::string> not_stage_; + ::google::protobuf::int32 max_level_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static NetStateRule* default_instance_; +}; +// ------------------------------------------------------------------- + +class ParamSpec : public ::google::protobuf::MessageLite { + public: + ParamSpec(); + virtual ~ParamSpec(); + + ParamSpec(const ParamSpec& from); + + inline ParamSpec& operator=(const ParamSpec& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_.GetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + inline ::std::string* mutable_unknown_fields() { + return _unknown_fields_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + static const ParamSpec& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ParamSpec* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ParamSpec* other); + + // implements Message ---------------------------------------------- + + inline ParamSpec* New() const { return New(NULL); } + + ParamSpec* New(::google::protobuf::Arena* arena) const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ParamSpec& from); + void MergeFrom(const ParamSpec& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(ParamSpec* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _arena_ptr_; + } + inline ::google::protobuf::Arena* MaybeArenaPtr() const { + return _arena_ptr_; + } + public: + + ::std::string GetTypeName() 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; + + // 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 .ditcaffe.ParamSpec.DimCheckMode share_mode = 2; + bool has_share_mode() const; + void clear_share_mode(); + static const int kShareModeFieldNumber = 2; + ::ditcaffe::ParamSpec_DimCheckMode share_mode() const; + void set_share_mode(::ditcaffe::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:ditcaffe.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::ArenaStringPtr _unknown_fields_; + ::google::protobuf::Arena* _arena_ptr_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::internal::ArenaStringPtr name_; + int share_mode_; + float lr_mult_; + float decay_mult_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static ParamSpec* default_instance_; +}; +// ------------------------------------------------------------------- + +class LayerParameter : public ::google::protobuf::MessageLite { + public: + LayerParameter(); + virtual ~LayerParameter(); + + LayerParameter(const LayerParameter& from); + + inline LayerParameter& operator=(const LayerParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_.GetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + inline ::std::string* mutable_unknown_fields() { + return _unknown_fields_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + static const LayerParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const LayerParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(LayerParameter* other); + + // implements Message ---------------------------------------------- + + inline LayerParameter* New() const { return New(NULL); } + + LayerParameter* New(::google::protobuf::Arena* arena) const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const LayerParameter& from); + void MergeFrom(const LayerParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(LayerParameter* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _arena_ptr_; + } + inline ::google::protobuf::Arena* MaybeArenaPtr() const { + return _arena_ptr_; + } + public: + + ::std::string GetTypeName() 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 .ditcaffe.Phase phase = 10; + bool has_phase() const; + void clear_phase(); + static const int kPhaseFieldNumber = 10; + ::ditcaffe::Phase phase() const; + void set_phase(::ditcaffe::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 .ditcaffe.ParamSpec param = 6; + int param_size() const; + void clear_param(); + static const int kParamFieldNumber = 6; + const ::ditcaffe::ParamSpec& param(int index) const; + ::ditcaffe::ParamSpec* mutable_param(int index); + ::ditcaffe::ParamSpec* add_param(); + ::google::protobuf::RepeatedPtrField< ::ditcaffe::ParamSpec >* + mutable_param(); + const ::google::protobuf::RepeatedPtrField< ::ditcaffe::ParamSpec >& + param() const; + + // repeated .ditcaffe.BlobProto blobs = 7; + int blobs_size() const; + void clear_blobs(); + static const int kBlobsFieldNumber = 7; + const ::ditcaffe::BlobProto& blobs(int index) const; + ::ditcaffe::BlobProto* mutable_blobs(int index); + ::ditcaffe::BlobProto* add_blobs(); + ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >* + mutable_blobs(); + const ::google::protobuf::RepeatedPtrField< ::ditcaffe::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 .ditcaffe.NetStateRule include = 8; + int include_size() const; + void clear_include(); + static const int kIncludeFieldNumber = 8; + const ::ditcaffe::NetStateRule& include(int index) const; + ::ditcaffe::NetStateRule* mutable_include(int index); + ::ditcaffe::NetStateRule* add_include(); + ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >* + mutable_include(); + const ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >& + include() const; + + // repeated .ditcaffe.NetStateRule exclude = 9; + int exclude_size() const; + void clear_exclude(); + static const int kExcludeFieldNumber = 9; + const ::ditcaffe::NetStateRule& exclude(int index) const; + ::ditcaffe::NetStateRule* mutable_exclude(int index); + ::ditcaffe::NetStateRule* add_exclude(); + ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >* + mutable_exclude(); + const ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >& + exclude() const; + + // optional .ditcaffe.TransformationParameter transform_param = 100; + bool has_transform_param() const; + void clear_transform_param(); + static const int kTransformParamFieldNumber = 100; + const ::ditcaffe::TransformationParameter& transform_param() const; + ::ditcaffe::TransformationParameter* mutable_transform_param(); + ::ditcaffe::TransformationParameter* release_transform_param(); + void set_allocated_transform_param(::ditcaffe::TransformationParameter* transform_param); + + // optional .ditcaffe.LossParameter loss_param = 101; + bool has_loss_param() const; + void clear_loss_param(); + static const int kLossParamFieldNumber = 101; + const ::ditcaffe::LossParameter& loss_param() const; + ::ditcaffe::LossParameter* mutable_loss_param(); + ::ditcaffe::LossParameter* release_loss_param(); + void set_allocated_loss_param(::ditcaffe::LossParameter* loss_param); + + // optional .ditcaffe.AccuracyParameter accuracy_param = 102; + bool has_accuracy_param() const; + void clear_accuracy_param(); + static const int kAccuracyParamFieldNumber = 102; + const ::ditcaffe::AccuracyParameter& accuracy_param() const; + ::ditcaffe::AccuracyParameter* mutable_accuracy_param(); + ::ditcaffe::AccuracyParameter* release_accuracy_param(); + void set_allocated_accuracy_param(::ditcaffe::AccuracyParameter* accuracy_param); + + // optional .ditcaffe.ArgMaxParameter argmax_param = 103; + bool has_argmax_param() const; + void clear_argmax_param(); + static const int kArgmaxParamFieldNumber = 103; + const ::ditcaffe::ArgMaxParameter& argmax_param() const; + ::ditcaffe::ArgMaxParameter* mutable_argmax_param(); + ::ditcaffe::ArgMaxParameter* release_argmax_param(); + void set_allocated_argmax_param(::ditcaffe::ArgMaxParameter* argmax_param); + + // optional .ditcaffe.BatchNormParameter batch_norm_param = 139; + bool has_batch_norm_param() const; + void clear_batch_norm_param(); + static const int kBatchNormParamFieldNumber = 139; + const ::ditcaffe::BatchNormParameter& batch_norm_param() const; + ::ditcaffe::BatchNormParameter* mutable_batch_norm_param(); + ::ditcaffe::BatchNormParameter* release_batch_norm_param(); + void set_allocated_batch_norm_param(::ditcaffe::BatchNormParameter* batch_norm_param); + + // optional .ditcaffe.BiasParameter bias_param = 141; + bool has_bias_param() const; + void clear_bias_param(); + static const int kBiasParamFieldNumber = 141; + const ::ditcaffe::BiasParameter& bias_param() const; + ::ditcaffe::BiasParameter* mutable_bias_param(); + ::ditcaffe::BiasParameter* release_bias_param(); + void set_allocated_bias_param(::ditcaffe::BiasParameter* bias_param); + + // optional .ditcaffe.ConcatParameter concat_param = 104; + bool has_concat_param() const; + void clear_concat_param(); + static const int kConcatParamFieldNumber = 104; + const ::ditcaffe::ConcatParameter& concat_param() const; + ::ditcaffe::ConcatParameter* mutable_concat_param(); + ::ditcaffe::ConcatParameter* release_concat_param(); + void set_allocated_concat_param(::ditcaffe::ConcatParameter* concat_param); + + // optional .ditcaffe.ContrastiveLossParameter contrastive_loss_param = 105; + bool has_contrastive_loss_param() const; + void clear_contrastive_loss_param(); + static const int kContrastiveLossParamFieldNumber = 105; + const ::ditcaffe::ContrastiveLossParameter& contrastive_loss_param() const; + ::ditcaffe::ContrastiveLossParameter* mutable_contrastive_loss_param(); + ::ditcaffe::ContrastiveLossParameter* release_contrastive_loss_param(); + void set_allocated_contrastive_loss_param(::ditcaffe::ContrastiveLossParameter* contrastive_loss_param); + + // optional .ditcaffe.ConvolutionParameter convolution_param = 106; + bool has_convolution_param() const; + void clear_convolution_param(); + static const int kConvolutionParamFieldNumber = 106; + const ::ditcaffe::ConvolutionParameter& convolution_param() const; + ::ditcaffe::ConvolutionParameter* mutable_convolution_param(); + ::ditcaffe::ConvolutionParameter* release_convolution_param(); + void set_allocated_convolution_param(::ditcaffe::ConvolutionParameter* convolution_param); + + // optional .ditcaffe.CropParameter crop_param = 144; + bool has_crop_param() const; + void clear_crop_param(); + static const int kCropParamFieldNumber = 144; + const ::ditcaffe::CropParameter& crop_param() const; + ::ditcaffe::CropParameter* mutable_crop_param(); + ::ditcaffe::CropParameter* release_crop_param(); + void set_allocated_crop_param(::ditcaffe::CropParameter* crop_param); + + // optional .ditcaffe.DataParameter data_param = 107; + bool has_data_param() const; + void clear_data_param(); + static const int kDataParamFieldNumber = 107; + const ::ditcaffe::DataParameter& data_param() const; + ::ditcaffe::DataParameter* mutable_data_param(); + ::ditcaffe::DataParameter* release_data_param(); + void set_allocated_data_param(::ditcaffe::DataParameter* data_param); + + // optional .ditcaffe.DropoutParameter dropout_param = 108; + bool has_dropout_param() const; + void clear_dropout_param(); + static const int kDropoutParamFieldNumber = 108; + const ::ditcaffe::DropoutParameter& dropout_param() const; + ::ditcaffe::DropoutParameter* mutable_dropout_param(); + ::ditcaffe::DropoutParameter* release_dropout_param(); + void set_allocated_dropout_param(::ditcaffe::DropoutParameter* dropout_param); + + // optional .ditcaffe.DummyDataParameter dummy_data_param = 109; + bool has_dummy_data_param() const; + void clear_dummy_data_param(); + static const int kDummyDataParamFieldNumber = 109; + const ::ditcaffe::DummyDataParameter& dummy_data_param() const; + ::ditcaffe::DummyDataParameter* mutable_dummy_data_param(); + ::ditcaffe::DummyDataParameter* release_dummy_data_param(); + void set_allocated_dummy_data_param(::ditcaffe::DummyDataParameter* dummy_data_param); + + // optional .ditcaffe.EltwiseParameter eltwise_param = 110; + bool has_eltwise_param() const; + void clear_eltwise_param(); + static const int kEltwiseParamFieldNumber = 110; + const ::ditcaffe::EltwiseParameter& eltwise_param() const; + ::ditcaffe::EltwiseParameter* mutable_eltwise_param(); + ::ditcaffe::EltwiseParameter* release_eltwise_param(); + void set_allocated_eltwise_param(::ditcaffe::EltwiseParameter* eltwise_param); + + // optional .ditcaffe.ELUParameter elu_param = 140; + bool has_elu_param() const; + void clear_elu_param(); + static const int kEluParamFieldNumber = 140; + const ::ditcaffe::ELUParameter& elu_param() const; + ::ditcaffe::ELUParameter* mutable_elu_param(); + ::ditcaffe::ELUParameter* release_elu_param(); + void set_allocated_elu_param(::ditcaffe::ELUParameter* elu_param); + + // optional .ditcaffe.EmbedParameter embed_param = 137; + bool has_embed_param() const; + void clear_embed_param(); + static const int kEmbedParamFieldNumber = 137; + const ::ditcaffe::EmbedParameter& embed_param() const; + ::ditcaffe::EmbedParameter* mutable_embed_param(); + ::ditcaffe::EmbedParameter* release_embed_param(); + void set_allocated_embed_param(::ditcaffe::EmbedParameter* embed_param); + + // optional .ditcaffe.ExpParameter exp_param = 111; + bool has_exp_param() const; + void clear_exp_param(); + static const int kExpParamFieldNumber = 111; + const ::ditcaffe::ExpParameter& exp_param() const; + ::ditcaffe::ExpParameter* mutable_exp_param(); + ::ditcaffe::ExpParameter* release_exp_param(); + void set_allocated_exp_param(::ditcaffe::ExpParameter* exp_param); + + // optional .ditcaffe.FlattenParameter flatten_param = 135; + bool has_flatten_param() const; + void clear_flatten_param(); + static const int kFlattenParamFieldNumber = 135; + const ::ditcaffe::FlattenParameter& flatten_param() const; + ::ditcaffe::FlattenParameter* mutable_flatten_param(); + ::ditcaffe::FlattenParameter* release_flatten_param(); + void set_allocated_flatten_param(::ditcaffe::FlattenParameter* flatten_param); + + // optional .ditcaffe.HDF5DataParameter hdf5_data_param = 112; + bool has_hdf5_data_param() const; + void clear_hdf5_data_param(); + static const int kHdf5DataParamFieldNumber = 112; + const ::ditcaffe::HDF5DataParameter& hdf5_data_param() const; + ::ditcaffe::HDF5DataParameter* mutable_hdf5_data_param(); + ::ditcaffe::HDF5DataParameter* release_hdf5_data_param(); + void set_allocated_hdf5_data_param(::ditcaffe::HDF5DataParameter* hdf5_data_param); + + // optional .ditcaffe.HDF5OutputParameter hdf5_output_param = 113; + bool has_hdf5_output_param() const; + void clear_hdf5_output_param(); + static const int kHdf5OutputParamFieldNumber = 113; + const ::ditcaffe::HDF5OutputParameter& hdf5_output_param() const; + ::ditcaffe::HDF5OutputParameter* mutable_hdf5_output_param(); + ::ditcaffe::HDF5OutputParameter* release_hdf5_output_param(); + void set_allocated_hdf5_output_param(::ditcaffe::HDF5OutputParameter* hdf5_output_param); + + // optional .ditcaffe.HingeLossParameter hinge_loss_param = 114; + bool has_hinge_loss_param() const; + void clear_hinge_loss_param(); + static const int kHingeLossParamFieldNumber = 114; + const ::ditcaffe::HingeLossParameter& hinge_loss_param() const; + ::ditcaffe::HingeLossParameter* mutable_hinge_loss_param(); + ::ditcaffe::HingeLossParameter* release_hinge_loss_param(); + void set_allocated_hinge_loss_param(::ditcaffe::HingeLossParameter* hinge_loss_param); + + // optional .ditcaffe.ImageDataParameter image_data_param = 115; + bool has_image_data_param() const; + void clear_image_data_param(); + static const int kImageDataParamFieldNumber = 115; + const ::ditcaffe::ImageDataParameter& image_data_param() const; + ::ditcaffe::ImageDataParameter* mutable_image_data_param(); + ::ditcaffe::ImageDataParameter* release_image_data_param(); + void set_allocated_image_data_param(::ditcaffe::ImageDataParameter* image_data_param); + + // optional .ditcaffe.InfogainLossParameter infogain_loss_param = 116; + bool has_infogain_loss_param() const; + void clear_infogain_loss_param(); + static const int kInfogainLossParamFieldNumber = 116; + const ::ditcaffe::InfogainLossParameter& infogain_loss_param() const; + ::ditcaffe::InfogainLossParameter* mutable_infogain_loss_param(); + ::ditcaffe::InfogainLossParameter* release_infogain_loss_param(); + void set_allocated_infogain_loss_param(::ditcaffe::InfogainLossParameter* infogain_loss_param); + + // optional .ditcaffe.InnerProductParameter inner_product_param = 117; + bool has_inner_product_param() const; + void clear_inner_product_param(); + static const int kInnerProductParamFieldNumber = 117; + const ::ditcaffe::InnerProductParameter& inner_product_param() const; + ::ditcaffe::InnerProductParameter* mutable_inner_product_param(); + ::ditcaffe::InnerProductParameter* release_inner_product_param(); + void set_allocated_inner_product_param(::ditcaffe::InnerProductParameter* inner_product_param); + + // optional .ditcaffe.InputParameter input_param = 143; + bool has_input_param() const; + void clear_input_param(); + static const int kInputParamFieldNumber = 143; + const ::ditcaffe::InputParameter& input_param() const; + ::ditcaffe::InputParameter* mutable_input_param(); + ::ditcaffe::InputParameter* release_input_param(); + void set_allocated_input_param(::ditcaffe::InputParameter* input_param); + + // optional .ditcaffe.LogParameter log_param = 134; + bool has_log_param() const; + void clear_log_param(); + static const int kLogParamFieldNumber = 134; + const ::ditcaffe::LogParameter& log_param() const; + ::ditcaffe::LogParameter* mutable_log_param(); + ::ditcaffe::LogParameter* release_log_param(); + void set_allocated_log_param(::ditcaffe::LogParameter* log_param); + + // optional .ditcaffe.LRNParameter lrn_param = 118; + bool has_lrn_param() const; + void clear_lrn_param(); + static const int kLrnParamFieldNumber = 118; + const ::ditcaffe::LRNParameter& lrn_param() const; + ::ditcaffe::LRNParameter* mutable_lrn_param(); + ::ditcaffe::LRNParameter* release_lrn_param(); + void set_allocated_lrn_param(::ditcaffe::LRNParameter* lrn_param); + + // optional .ditcaffe.MemoryDataParameter memory_data_param = 119; + bool has_memory_data_param() const; + void clear_memory_data_param(); + static const int kMemoryDataParamFieldNumber = 119; + const ::ditcaffe::MemoryDataParameter& memory_data_param() const; + ::ditcaffe::MemoryDataParameter* mutable_memory_data_param(); + ::ditcaffe::MemoryDataParameter* release_memory_data_param(); + void set_allocated_memory_data_param(::ditcaffe::MemoryDataParameter* memory_data_param); + + // optional .ditcaffe.MVNParameter mvn_param = 120; + bool has_mvn_param() const; + void clear_mvn_param(); + static const int kMvnParamFieldNumber = 120; + const ::ditcaffe::MVNParameter& mvn_param() const; + ::ditcaffe::MVNParameter* mutable_mvn_param(); + ::ditcaffe::MVNParameter* release_mvn_param(); + void set_allocated_mvn_param(::ditcaffe::MVNParameter* mvn_param); + + // optional .ditcaffe.ParameterParameter parameter_param = 145; + bool has_parameter_param() const; + void clear_parameter_param(); + static const int kParameterParamFieldNumber = 145; + const ::ditcaffe::ParameterParameter& parameter_param() const; + ::ditcaffe::ParameterParameter* mutable_parameter_param(); + ::ditcaffe::ParameterParameter* release_parameter_param(); + void set_allocated_parameter_param(::ditcaffe::ParameterParameter* parameter_param); + + // optional .ditcaffe.PoolingParameter pooling_param = 121; + bool has_pooling_param() const; + void clear_pooling_param(); + static const int kPoolingParamFieldNumber = 121; + const ::ditcaffe::PoolingParameter& pooling_param() const; + ::ditcaffe::PoolingParameter* mutable_pooling_param(); + ::ditcaffe::PoolingParameter* release_pooling_param(); + void set_allocated_pooling_param(::ditcaffe::PoolingParameter* pooling_param); + + // optional .ditcaffe.PowerParameter power_param = 122; + bool has_power_param() const; + void clear_power_param(); + static const int kPowerParamFieldNumber = 122; + const ::ditcaffe::PowerParameter& power_param() const; + ::ditcaffe::PowerParameter* mutable_power_param(); + ::ditcaffe::PowerParameter* release_power_param(); + void set_allocated_power_param(::ditcaffe::PowerParameter* power_param); + + // optional .ditcaffe.PReLUParameter prelu_param = 131; + bool has_prelu_param() const; + void clear_prelu_param(); + static const int kPreluParamFieldNumber = 131; + const ::ditcaffe::PReLUParameter& prelu_param() const; + ::ditcaffe::PReLUParameter* mutable_prelu_param(); + ::ditcaffe::PReLUParameter* release_prelu_param(); + void set_allocated_prelu_param(::ditcaffe::PReLUParameter* prelu_param); + + // optional .ditcaffe.PythonParameter python_param = 130; + bool has_python_param() const; + void clear_python_param(); + static const int kPythonParamFieldNumber = 130; + const ::ditcaffe::PythonParameter& python_param() const; + ::ditcaffe::PythonParameter* mutable_python_param(); + ::ditcaffe::PythonParameter* release_python_param(); + void set_allocated_python_param(::ditcaffe::PythonParameter* python_param); + + // optional .ditcaffe.ReductionParameter reduction_param = 136; + bool has_reduction_param() const; + void clear_reduction_param(); + static const int kReductionParamFieldNumber = 136; + const ::ditcaffe::ReductionParameter& reduction_param() const; + ::ditcaffe::ReductionParameter* mutable_reduction_param(); + ::ditcaffe::ReductionParameter* release_reduction_param(); + void set_allocated_reduction_param(::ditcaffe::ReductionParameter* reduction_param); + + // optional .ditcaffe.ReLUParameter relu_param = 123; + bool has_relu_param() const; + void clear_relu_param(); + static const int kReluParamFieldNumber = 123; + const ::ditcaffe::ReLUParameter& relu_param() const; + ::ditcaffe::ReLUParameter* mutable_relu_param(); + ::ditcaffe::ReLUParameter* release_relu_param(); + void set_allocated_relu_param(::ditcaffe::ReLUParameter* relu_param); + + // optional .ditcaffe.ReshapeParameter reshape_param = 133; + bool has_reshape_param() const; + void clear_reshape_param(); + static const int kReshapeParamFieldNumber = 133; + const ::ditcaffe::ReshapeParameter& reshape_param() const; + ::ditcaffe::ReshapeParameter* mutable_reshape_param(); + ::ditcaffe::ReshapeParameter* release_reshape_param(); + void set_allocated_reshape_param(::ditcaffe::ReshapeParameter* reshape_param); + + // optional .ditcaffe.ScaleParameter scale_param = 142; + bool has_scale_param() const; + void clear_scale_param(); + static const int kScaleParamFieldNumber = 142; + const ::ditcaffe::ScaleParameter& scale_param() const; + ::ditcaffe::ScaleParameter* mutable_scale_param(); + ::ditcaffe::ScaleParameter* release_scale_param(); + void set_allocated_scale_param(::ditcaffe::ScaleParameter* scale_param); + + // optional .ditcaffe.SigmoidParameter sigmoid_param = 124; + bool has_sigmoid_param() const; + void clear_sigmoid_param(); + static const int kSigmoidParamFieldNumber = 124; + const ::ditcaffe::SigmoidParameter& sigmoid_param() const; + ::ditcaffe::SigmoidParameter* mutable_sigmoid_param(); + ::ditcaffe::SigmoidParameter* release_sigmoid_param(); + void set_allocated_sigmoid_param(::ditcaffe::SigmoidParameter* sigmoid_param); + + // optional .ditcaffe.SoftmaxParameter softmax_param = 125; + bool has_softmax_param() const; + void clear_softmax_param(); + static const int kSoftmaxParamFieldNumber = 125; + const ::ditcaffe::SoftmaxParameter& softmax_param() const; + ::ditcaffe::SoftmaxParameter* mutable_softmax_param(); + ::ditcaffe::SoftmaxParameter* release_softmax_param(); + void set_allocated_softmax_param(::ditcaffe::SoftmaxParameter* softmax_param); + + // optional .ditcaffe.SPPParameter spp_param = 132; + bool has_spp_param() const; + void clear_spp_param(); + static const int kSppParamFieldNumber = 132; + const ::ditcaffe::SPPParameter& spp_param() const; + ::ditcaffe::SPPParameter* mutable_spp_param(); + ::ditcaffe::SPPParameter* release_spp_param(); + void set_allocated_spp_param(::ditcaffe::SPPParameter* spp_param); + + // optional .ditcaffe.SliceParameter slice_param = 126; + bool has_slice_param() const; + void clear_slice_param(); + static const int kSliceParamFieldNumber = 126; + const ::ditcaffe::SliceParameter& slice_param() const; + ::ditcaffe::SliceParameter* mutable_slice_param(); + ::ditcaffe::SliceParameter* release_slice_param(); + void set_allocated_slice_param(::ditcaffe::SliceParameter* slice_param); + + // optional .ditcaffe.TanHParameter tanh_param = 127; + bool has_tanh_param() const; + void clear_tanh_param(); + static const int kTanhParamFieldNumber = 127; + const ::ditcaffe::TanHParameter& tanh_param() const; + ::ditcaffe::TanHParameter* mutable_tanh_param(); + ::ditcaffe::TanHParameter* release_tanh_param(); + void set_allocated_tanh_param(::ditcaffe::TanHParameter* tanh_param); + + // optional .ditcaffe.ThresholdParameter threshold_param = 128; + bool has_threshold_param() const; + void clear_threshold_param(); + static const int kThresholdParamFieldNumber = 128; + const ::ditcaffe::ThresholdParameter& threshold_param() const; + ::ditcaffe::ThresholdParameter* mutable_threshold_param(); + ::ditcaffe::ThresholdParameter* release_threshold_param(); + void set_allocated_threshold_param(::ditcaffe::ThresholdParameter* threshold_param); + + // optional .ditcaffe.TileParameter tile_param = 138; + bool has_tile_param() const; + void clear_tile_param(); + static const int kTileParamFieldNumber = 138; + const ::ditcaffe::TileParameter& tile_param() const; + ::ditcaffe::TileParameter* mutable_tile_param(); + ::ditcaffe::TileParameter* release_tile_param(); + void set_allocated_tile_param(::ditcaffe::TileParameter* tile_param); + + // optional .ditcaffe.WindowDataParameter window_data_param = 129; + bool has_window_data_param() const; + void clear_window_data_param(); + static const int kWindowDataParamFieldNumber = 129; + const ::ditcaffe::WindowDataParameter& window_data_param() const; + ::ditcaffe::WindowDataParameter* mutable_window_data_param(); + ::ditcaffe::WindowDataParameter* release_window_data_param(); + void set_allocated_window_data_param(::ditcaffe::WindowDataParameter* window_data_param); + + // @@protoc_insertion_point(class_scope:ditcaffe.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_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_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_python_param(); + inline void clear_has_python_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::ArenaStringPtr _unknown_fields_; + ::google::protobuf::Arena* _arena_ptr_; + + ::google::protobuf::uint32 _has_bits_[2]; + ::google::protobuf::internal::ArenaStringPtr name_; + ::google::protobuf::internal::ArenaStringPtr type_; + ::google::protobuf::RepeatedPtrField< ::std::string> bottom_; + ::google::protobuf::RepeatedPtrField< ::std::string> top_; + ::google::protobuf::RepeatedField< float > loss_weight_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::ParamSpec > param_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto > blobs_; + ::google::protobuf::RepeatedField< bool > propagate_down_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule > include_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule > exclude_; + ::ditcaffe::TransformationParameter* transform_param_; + ::ditcaffe::LossParameter* loss_param_; + ::ditcaffe::AccuracyParameter* accuracy_param_; + ::ditcaffe::ArgMaxParameter* argmax_param_; + ::ditcaffe::BatchNormParameter* batch_norm_param_; + ::ditcaffe::BiasParameter* bias_param_; + ::ditcaffe::ConcatParameter* concat_param_; + ::ditcaffe::ContrastiveLossParameter* contrastive_loss_param_; + ::ditcaffe::ConvolutionParameter* convolution_param_; + ::ditcaffe::CropParameter* crop_param_; + ::ditcaffe::DataParameter* data_param_; + ::ditcaffe::DropoutParameter* dropout_param_; + ::ditcaffe::DummyDataParameter* dummy_data_param_; + ::ditcaffe::EltwiseParameter* eltwise_param_; + ::ditcaffe::ELUParameter* elu_param_; + ::ditcaffe::EmbedParameter* embed_param_; + ::ditcaffe::ExpParameter* exp_param_; + ::ditcaffe::FlattenParameter* flatten_param_; + ::ditcaffe::HDF5DataParameter* hdf5_data_param_; + ::ditcaffe::HDF5OutputParameter* hdf5_output_param_; + ::ditcaffe::HingeLossParameter* hinge_loss_param_; + ::ditcaffe::ImageDataParameter* image_data_param_; + ::ditcaffe::InfogainLossParameter* infogain_loss_param_; + ::ditcaffe::InnerProductParameter* inner_product_param_; + ::ditcaffe::InputParameter* input_param_; + ::ditcaffe::LogParameter* log_param_; + ::ditcaffe::LRNParameter* lrn_param_; + ::ditcaffe::MemoryDataParameter* memory_data_param_; + ::ditcaffe::MVNParameter* mvn_param_; + ::ditcaffe::ParameterParameter* parameter_param_; + ::ditcaffe::PoolingParameter* pooling_param_; + ::ditcaffe::PowerParameter* power_param_; + ::ditcaffe::PReLUParameter* prelu_param_; + ::ditcaffe::PythonParameter* python_param_; + ::ditcaffe::ReductionParameter* reduction_param_; + ::ditcaffe::ReLUParameter* relu_param_; + ::ditcaffe::ReshapeParameter* reshape_param_; + ::ditcaffe::ScaleParameter* scale_param_; + ::ditcaffe::SigmoidParameter* sigmoid_param_; + ::ditcaffe::SoftmaxParameter* softmax_param_; + ::ditcaffe::SPPParameter* spp_param_; + ::ditcaffe::SliceParameter* slice_param_; + ::ditcaffe::TanHParameter* tanh_param_; + ::ditcaffe::ThresholdParameter* threshold_param_; + ::ditcaffe::TileParameter* tile_param_; + ::ditcaffe::WindowDataParameter* window_data_param_; + int phase_; + mutable int _cached_size_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static LayerParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class TransformationParameter : public ::google::protobuf::MessageLite { + public: + TransformationParameter(); + virtual ~TransformationParameter(); + + TransformationParameter(const TransformationParameter& from); + + inline TransformationParameter& operator=(const TransformationParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_.GetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + inline ::std::string* mutable_unknown_fields() { + return _unknown_fields_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + static const TransformationParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const TransformationParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(TransformationParameter* other); + + // implements Message ---------------------------------------------- + + inline TransformationParameter* New() const { return New(NULL); } + + TransformationParameter* New(::google::protobuf::Arena* arena) const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const TransformationParameter& from); + void MergeFrom(const TransformationParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(TransformationParameter* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _arena_ptr_; + } + inline ::google::protobuf::Arena* MaybeArenaPtr() const { + return _arena_ptr_; + } + public: + + ::std::string GetTypeName() 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:ditcaffe.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::ArenaStringPtr _unknown_fields_; + ::google::protobuf::Arena* _arena_ptr_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + float scale_; + ::google::protobuf::uint32 crop_size_; + ::google::protobuf::internal::ArenaStringPtr mean_file_; + ::google::protobuf::RepeatedField< float > mean_value_; + bool mirror_; + bool force_color_; + bool force_gray_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static TransformationParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class LossParameter : public ::google::protobuf::MessageLite { + public: + LossParameter(); + virtual ~LossParameter(); + + LossParameter(const LossParameter& from); + + inline LossParameter& operator=(const LossParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_.GetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + inline ::std::string* mutable_unknown_fields() { + return _unknown_fields_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + static const LossParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const LossParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(LossParameter* other); + + // implements Message ---------------------------------------------- + + inline LossParameter* New() const { return New(NULL); } + + LossParameter* New(::google::protobuf::Arena* arena) const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const LossParameter& from); + void MergeFrom(const LossParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(LossParameter* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _arena_ptr_; + } + inline ::google::protobuf::Arena* MaybeArenaPtr() const { + return _arena_ptr_; + } + public: + + ::std::string GetTypeName() 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; + + // 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 .ditcaffe.LossParameter.NormalizationMode normalization = 3 [default = VALID]; + bool has_normalization() const; + void clear_normalization(); + static const int kNormalizationFieldNumber = 3; + ::ditcaffe::LossParameter_NormalizationMode normalization() const; + void set_normalization(::ditcaffe::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:ditcaffe.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::ArenaStringPtr _unknown_fields_; + ::google::protobuf::Arena* _arena_ptr_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::int32 ignore_label_; + int normalization_; + bool normalize_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static LossParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class AccuracyParameter : public ::google::protobuf::MessageLite { + public: + AccuracyParameter(); + virtual ~AccuracyParameter(); + + AccuracyParameter(const AccuracyParameter& from); + + inline AccuracyParameter& operator=(const AccuracyParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_.GetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + inline ::std::string* mutable_unknown_fields() { + return _unknown_fields_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + static const AccuracyParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const AccuracyParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(AccuracyParameter* other); + + // implements Message ---------------------------------------------- + + inline AccuracyParameter* New() const { return New(NULL); } + + AccuracyParameter* New(::google::protobuf::Arena* arena) const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const AccuracyParameter& from); + void MergeFrom(const AccuracyParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(AccuracyParameter* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _arena_ptr_; + } + inline ::google::protobuf::Arena* MaybeArenaPtr() const { + return _arena_ptr_; + } + public: + + ::std::string GetTypeName() 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:ditcaffe.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::ArenaStringPtr _unknown_fields_; + ::google::protobuf::Arena* _arena_ptr_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::uint32 top_k_; + ::google::protobuf::int32 axis_; + ::google::protobuf::int32 ignore_label_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static AccuracyParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class ArgMaxParameter : public ::google::protobuf::MessageLite { + public: + ArgMaxParameter(); + virtual ~ArgMaxParameter(); + + ArgMaxParameter(const ArgMaxParameter& from); + + inline ArgMaxParameter& operator=(const ArgMaxParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_.GetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + inline ::std::string* mutable_unknown_fields() { + return _unknown_fields_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + static const ArgMaxParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ArgMaxParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ArgMaxParameter* other); + + // implements Message ---------------------------------------------- + + inline ArgMaxParameter* New() const { return New(NULL); } + + ArgMaxParameter* New(::google::protobuf::Arena* arena) const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ArgMaxParameter& from); + void MergeFrom(const ArgMaxParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(ArgMaxParameter* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _arena_ptr_; + } + inline ::google::protobuf::Arena* MaybeArenaPtr() const { + return _arena_ptr_; + } + public: + + ::std::string GetTypeName() 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:ditcaffe.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::ArenaStringPtr _unknown_fields_; + ::google::protobuf::Arena* _arena_ptr_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + bool out_max_val_; + ::google::protobuf::uint32 top_k_; + ::google::protobuf::int32 axis_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static ArgMaxParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class ConcatParameter : public ::google::protobuf::MessageLite { + public: + ConcatParameter(); + virtual ~ConcatParameter(); + + ConcatParameter(const ConcatParameter& from); + + inline ConcatParameter& operator=(const ConcatParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_.GetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + inline ::std::string* mutable_unknown_fields() { + return _unknown_fields_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + static const ConcatParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ConcatParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ConcatParameter* other); + + // implements Message ---------------------------------------------- + + inline ConcatParameter* New() const { return New(NULL); } + + ConcatParameter* New(::google::protobuf::Arena* arena) const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ConcatParameter& from); + void MergeFrom(const ConcatParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(ConcatParameter* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _arena_ptr_; + } + inline ::google::protobuf::Arena* MaybeArenaPtr() const { + return _arena_ptr_; + } + public: + + ::std::string GetTypeName() 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:ditcaffe.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::ArenaStringPtr _unknown_fields_; + ::google::protobuf::Arena* _arena_ptr_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::int32 axis_; + ::google::protobuf::uint32 concat_dim_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static ConcatParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class BatchNormParameter : public ::google::protobuf::MessageLite { + public: + BatchNormParameter(); + virtual ~BatchNormParameter(); + + BatchNormParameter(const BatchNormParameter& from); + + inline BatchNormParameter& operator=(const BatchNormParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_.GetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + inline ::std::string* mutable_unknown_fields() { + return _unknown_fields_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + static const BatchNormParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const BatchNormParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(BatchNormParameter* other); + + // implements Message ---------------------------------------------- + + inline BatchNormParameter* New() const { return New(NULL); } + + BatchNormParameter* New(::google::protobuf::Arena* arena) const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const BatchNormParameter& from); + void MergeFrom(const BatchNormParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(BatchNormParameter* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _arena_ptr_; + } + inline ::google::protobuf::Arena* MaybeArenaPtr() const { + return _arena_ptr_; + } + public: + + ::std::string GetTypeName() 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:ditcaffe.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::ArenaStringPtr _unknown_fields_; + ::google::protobuf::Arena* _arena_ptr_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + bool use_global_stats_; + float moving_average_fraction_; + float eps_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static BatchNormParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class BiasParameter : public ::google::protobuf::MessageLite { + public: + BiasParameter(); + virtual ~BiasParameter(); + + BiasParameter(const BiasParameter& from); + + inline BiasParameter& operator=(const BiasParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_.GetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + inline ::std::string* mutable_unknown_fields() { + return _unknown_fields_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + static const BiasParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const BiasParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(BiasParameter* other); + + // implements Message ---------------------------------------------- + + inline BiasParameter* New() const { return New(NULL); } + + BiasParameter* New(::google::protobuf::Arena* arena) const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const BiasParameter& from); + void MergeFrom(const BiasParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(BiasParameter* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _arena_ptr_; + } + inline ::google::protobuf::Arena* MaybeArenaPtr() const { + return _arena_ptr_; + } + public: + + ::std::string GetTypeName() 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 .ditcaffe.FillerParameter filler = 3; + bool has_filler() const; + void clear_filler(); + static const int kFillerFieldNumber = 3; + const ::ditcaffe::FillerParameter& filler() const; + ::ditcaffe::FillerParameter* mutable_filler(); + ::ditcaffe::FillerParameter* release_filler(); + void set_allocated_filler(::ditcaffe::FillerParameter* filler); + + // @@protoc_insertion_point(class_scope:ditcaffe.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::ArenaStringPtr _unknown_fields_; + ::google::protobuf::Arena* _arena_ptr_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::int32 axis_; + ::google::protobuf::int32 num_axes_; + ::ditcaffe::FillerParameter* filler_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static BiasParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class ContrastiveLossParameter : public ::google::protobuf::MessageLite { + public: + ContrastiveLossParameter(); + virtual ~ContrastiveLossParameter(); + + ContrastiveLossParameter(const ContrastiveLossParameter& from); + + inline ContrastiveLossParameter& operator=(const ContrastiveLossParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_.GetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + inline ::std::string* mutable_unknown_fields() { + return _unknown_fields_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + static const ContrastiveLossParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ContrastiveLossParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ContrastiveLossParameter* other); + + // implements Message ---------------------------------------------- + + inline ContrastiveLossParameter* New() const { return New(NULL); } + + ContrastiveLossParameter* New(::google::protobuf::Arena* arena) const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ContrastiveLossParameter& from); + void MergeFrom(const ContrastiveLossParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(ContrastiveLossParameter* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _arena_ptr_; + } + inline ::google::protobuf::Arena* MaybeArenaPtr() const { + return _arena_ptr_; + } + public: + + ::std::string GetTypeName() 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:ditcaffe.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::ArenaStringPtr _unknown_fields_; + ::google::protobuf::Arena* _arena_ptr_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + float margin_; + bool legacy_version_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static ContrastiveLossParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class ConvolutionParameter : public ::google::protobuf::MessageLite { + public: + ConvolutionParameter(); + virtual ~ConvolutionParameter(); + + ConvolutionParameter(const ConvolutionParameter& from); + + inline ConvolutionParameter& operator=(const ConvolutionParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_.GetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + inline ::std::string* mutable_unknown_fields() { + return _unknown_fields_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + static const ConvolutionParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ConvolutionParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ConvolutionParameter* other); + + // implements Message ---------------------------------------------- + + inline ConvolutionParameter* New() const { return New(NULL); } + + ConvolutionParameter* New(::google::protobuf::Arena* arena) const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ConvolutionParameter& from); + void MergeFrom(const ConvolutionParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(ConvolutionParameter* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _arena_ptr_; + } + inline ::google::protobuf::Arena* MaybeArenaPtr() const { + return _arena_ptr_; + } + public: + + ::std::string GetTypeName() 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; + + // 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 .ditcaffe.FillerParameter weight_filler = 7; + bool has_weight_filler() const; + void clear_weight_filler(); + static const int kWeightFillerFieldNumber = 7; + const ::ditcaffe::FillerParameter& weight_filler() const; + ::ditcaffe::FillerParameter* mutable_weight_filler(); + ::ditcaffe::FillerParameter* release_weight_filler(); + void set_allocated_weight_filler(::ditcaffe::FillerParameter* weight_filler); + + // optional .ditcaffe.FillerParameter bias_filler = 8; + bool has_bias_filler() const; + void clear_bias_filler(); + static const int kBiasFillerFieldNumber = 8; + const ::ditcaffe::FillerParameter& bias_filler() const; + ::ditcaffe::FillerParameter* mutable_bias_filler(); + ::ditcaffe::FillerParameter* release_bias_filler(); + void set_allocated_bias_filler(::ditcaffe::FillerParameter* bias_filler); + + // optional .ditcaffe.ConvolutionParameter.Engine engine = 15 [default = DEFAULT]; + bool has_engine() const; + void clear_engine(); + static const int kEngineFieldNumber = 15; + ::ditcaffe::ConvolutionParameter_Engine engine() const; + void set_engine(::ditcaffe::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:ditcaffe.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::ArenaStringPtr _unknown_fields_; + ::google::protobuf::Arena* _arena_ptr_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > pad_; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > kernel_size_; + ::google::protobuf::uint32 num_output_; + ::google::protobuf::uint32 pad_h_; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > stride_; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > dilation_; + ::google::protobuf::uint32 pad_w_; + ::google::protobuf::uint32 kernel_h_; + ::google::protobuf::uint32 kernel_w_; + bool bias_term_; + bool force_nd_im2col_; + ::google::protobuf::uint32 stride_h_; + ::google::protobuf::uint32 stride_w_; + ::ditcaffe::FillerParameter* weight_filler_; + ::google::protobuf::uint32 group_; + int engine_; + ::ditcaffe::FillerParameter* bias_filler_; + ::google::protobuf::int32 axis_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static ConvolutionParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class CropParameter : public ::google::protobuf::MessageLite { + public: + CropParameter(); + virtual ~CropParameter(); + + CropParameter(const CropParameter& from); + + inline CropParameter& operator=(const CropParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_.GetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + inline ::std::string* mutable_unknown_fields() { + return _unknown_fields_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + static const CropParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const CropParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(CropParameter* other); + + // implements Message ---------------------------------------------- + + inline CropParameter* New() const { return New(NULL); } + + CropParameter* New(::google::protobuf::Arena* arena) const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const CropParameter& from); + void MergeFrom(const CropParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(CropParameter* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _arena_ptr_; + } + inline ::google::protobuf::Arena* MaybeArenaPtr() const { + return _arena_ptr_; + } + public: + + ::std::string GetTypeName() 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:ditcaffe.CropParameter) + private: + inline void set_has_axis(); + inline void clear_has_axis(); + + ::google::protobuf::internal::ArenaStringPtr _unknown_fields_; + ::google::protobuf::Arena* _arena_ptr_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > offset_; + ::google::protobuf::int32 axis_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static CropParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class DataParameter : public ::google::protobuf::MessageLite { + public: + DataParameter(); + virtual ~DataParameter(); + + DataParameter(const DataParameter& from); + + inline DataParameter& operator=(const DataParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_.GetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + inline ::std::string* mutable_unknown_fields() { + return _unknown_fields_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + static const DataParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const DataParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(DataParameter* other); + + // implements Message ---------------------------------------------- + + inline DataParameter* New() const { return New(NULL); } + + DataParameter* New(::google::protobuf::Arena* arena) const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const DataParameter& from); + void MergeFrom(const DataParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(DataParameter* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _arena_ptr_; + } + inline ::google::protobuf::Arena* MaybeArenaPtr() const { + return _arena_ptr_; + } + public: + + ::std::string GetTypeName() 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; + + // 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 .ditcaffe.DataParameter.DB backend = 8 [default = LEVELDB]; + bool has_backend() const; + void clear_backend(); + static const int kBackendFieldNumber = 8; + ::ditcaffe::DataParameter_DB backend() const; + void set_backend(::ditcaffe::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:ditcaffe.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::ArenaStringPtr _unknown_fields_; + ::google::protobuf::Arena* _arena_ptr_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::internal::ArenaStringPtr source_; + ::google::protobuf::uint32 batch_size_; + ::google::protobuf::uint32 rand_skip_; + int backend_; + float scale_; + ::google::protobuf::internal::ArenaStringPtr mean_file_; + ::google::protobuf::uint32 crop_size_; + bool mirror_; + bool force_encoded_color_; + ::google::protobuf::uint32 prefetch_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static DataParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class DropoutParameter : public ::google::protobuf::MessageLite { + public: + DropoutParameter(); + virtual ~DropoutParameter(); + + DropoutParameter(const DropoutParameter& from); + + inline DropoutParameter& operator=(const DropoutParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_.GetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + inline ::std::string* mutable_unknown_fields() { + return _unknown_fields_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + static const DropoutParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const DropoutParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(DropoutParameter* other); + + // implements Message ---------------------------------------------- + + inline DropoutParameter* New() const { return New(NULL); } + + DropoutParameter* New(::google::protobuf::Arena* arena) const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const DropoutParameter& from); + void MergeFrom(const DropoutParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(DropoutParameter* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _arena_ptr_; + } + inline ::google::protobuf::Arena* MaybeArenaPtr() const { + return _arena_ptr_; + } + public: + + ::std::string GetTypeName() 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:ditcaffe.DropoutParameter) + private: + inline void set_has_dropout_ratio(); + inline void clear_has_dropout_ratio(); + + ::google::protobuf::internal::ArenaStringPtr _unknown_fields_; + ::google::protobuf::Arena* _arena_ptr_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + float dropout_ratio_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static DropoutParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class DummyDataParameter : public ::google::protobuf::MessageLite { + public: + DummyDataParameter(); + virtual ~DummyDataParameter(); + + DummyDataParameter(const DummyDataParameter& from); + + inline DummyDataParameter& operator=(const DummyDataParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_.GetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + inline ::std::string* mutable_unknown_fields() { + return _unknown_fields_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + static const DummyDataParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const DummyDataParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(DummyDataParameter* other); + + // implements Message ---------------------------------------------- + + inline DummyDataParameter* New() const { return New(NULL); } + + DummyDataParameter* New(::google::protobuf::Arena* arena) const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const DummyDataParameter& from); + void MergeFrom(const DummyDataParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(DummyDataParameter* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _arena_ptr_; + } + inline ::google::protobuf::Arena* MaybeArenaPtr() const { + return _arena_ptr_; + } + public: + + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .ditcaffe.FillerParameter data_filler = 1; + int data_filler_size() const; + void clear_data_filler(); + static const int kDataFillerFieldNumber = 1; + const ::ditcaffe::FillerParameter& data_filler(int index) const; + ::ditcaffe::FillerParameter* mutable_data_filler(int index); + ::ditcaffe::FillerParameter* add_data_filler(); + ::google::protobuf::RepeatedPtrField< ::ditcaffe::FillerParameter >* + mutable_data_filler(); + const ::google::protobuf::RepeatedPtrField< ::ditcaffe::FillerParameter >& + data_filler() const; + + // repeated .ditcaffe.BlobShape shape = 6; + int shape_size() const; + void clear_shape(); + static const int kShapeFieldNumber = 6; + const ::ditcaffe::BlobShape& shape(int index) const; + ::ditcaffe::BlobShape* mutable_shape(int index); + ::ditcaffe::BlobShape* add_shape(); + ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobShape >* + mutable_shape(); + const ::google::protobuf::RepeatedPtrField< ::ditcaffe::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:ditcaffe.DummyDataParameter) + private: + + ::google::protobuf::internal::ArenaStringPtr _unknown_fields_; + ::google::protobuf::Arena* _arena_ptr_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::FillerParameter > data_filler_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::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_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static DummyDataParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class EltwiseParameter : public ::google::protobuf::MessageLite { + public: + EltwiseParameter(); + virtual ~EltwiseParameter(); + + EltwiseParameter(const EltwiseParameter& from); + + inline EltwiseParameter& operator=(const EltwiseParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_.GetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + inline ::std::string* mutable_unknown_fields() { + return _unknown_fields_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + static const EltwiseParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const EltwiseParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(EltwiseParameter* other); + + // implements Message ---------------------------------------------- + + inline EltwiseParameter* New() const { return New(NULL); } + + EltwiseParameter* New(::google::protobuf::Arena* arena) const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const EltwiseParameter& from); + void MergeFrom(const EltwiseParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(EltwiseParameter* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _arena_ptr_; + } + inline ::google::protobuf::Arena* MaybeArenaPtr() const { + return _arena_ptr_; + } + public: + + ::std::string GetTypeName() 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; + + // accessors ------------------------------------------------------- + + // optional .ditcaffe.EltwiseParameter.EltwiseOp operation = 1 [default = SUM]; + bool has_operation() const; + void clear_operation(); + static const int kOperationFieldNumber = 1; + ::ditcaffe::EltwiseParameter_EltwiseOp operation() const; + void set_operation(::ditcaffe::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:ditcaffe.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::ArenaStringPtr _unknown_fields_; + ::google::protobuf::Arena* _arena_ptr_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::RepeatedField< float > coeff_; + int operation_; + bool stable_prod_grad_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static EltwiseParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class ELUParameter : public ::google::protobuf::MessageLite { + public: + ELUParameter(); + virtual ~ELUParameter(); + + ELUParameter(const ELUParameter& from); + + inline ELUParameter& operator=(const ELUParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_.GetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + inline ::std::string* mutable_unknown_fields() { + return _unknown_fields_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + static const ELUParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ELUParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ELUParameter* other); + + // implements Message ---------------------------------------------- + + inline ELUParameter* New() const { return New(NULL); } + + ELUParameter* New(::google::protobuf::Arena* arena) const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ELUParameter& from); + void MergeFrom(const ELUParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(ELUParameter* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _arena_ptr_; + } + inline ::google::protobuf::Arena* MaybeArenaPtr() const { + return _arena_ptr_; + } + public: + + ::std::string GetTypeName() 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:ditcaffe.ELUParameter) + private: + inline void set_has_alpha(); + inline void clear_has_alpha(); + + ::google::protobuf::internal::ArenaStringPtr _unknown_fields_; + ::google::protobuf::Arena* _arena_ptr_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + float alpha_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static ELUParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class EmbedParameter : public ::google::protobuf::MessageLite { + public: + EmbedParameter(); + virtual ~EmbedParameter(); + + EmbedParameter(const EmbedParameter& from); + + inline EmbedParameter& operator=(const EmbedParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_.GetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + inline ::std::string* mutable_unknown_fields() { + return _unknown_fields_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + static const EmbedParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const EmbedParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(EmbedParameter* other); + + // implements Message ---------------------------------------------- + + inline EmbedParameter* New() const { return New(NULL); } + + EmbedParameter* New(::google::protobuf::Arena* arena) const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const EmbedParameter& from); + void MergeFrom(const EmbedParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(EmbedParameter* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _arena_ptr_; + } + inline ::google::protobuf::Arena* MaybeArenaPtr() const { + return _arena_ptr_; + } + public: + + ::std::string GetTypeName() 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 .ditcaffe.FillerParameter weight_filler = 4; + bool has_weight_filler() const; + void clear_weight_filler(); + static const int kWeightFillerFieldNumber = 4; + const ::ditcaffe::FillerParameter& weight_filler() const; + ::ditcaffe::FillerParameter* mutable_weight_filler(); + ::ditcaffe::FillerParameter* release_weight_filler(); + void set_allocated_weight_filler(::ditcaffe::FillerParameter* weight_filler); + + // optional .ditcaffe.FillerParameter bias_filler = 5; + bool has_bias_filler() const; + void clear_bias_filler(); + static const int kBiasFillerFieldNumber = 5; + const ::ditcaffe::FillerParameter& bias_filler() const; + ::ditcaffe::FillerParameter* mutable_bias_filler(); + ::ditcaffe::FillerParameter* release_bias_filler(); + void set_allocated_bias_filler(::ditcaffe::FillerParameter* bias_filler); + + // @@protoc_insertion_point(class_scope:ditcaffe.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::ArenaStringPtr _unknown_fields_; + ::google::protobuf::Arena* _arena_ptr_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::uint32 num_output_; + ::google::protobuf::uint32 input_dim_; + ::ditcaffe::FillerParameter* weight_filler_; + ::ditcaffe::FillerParameter* bias_filler_; + bool bias_term_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static EmbedParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class ExpParameter : public ::google::protobuf::MessageLite { + public: + ExpParameter(); + virtual ~ExpParameter(); + + ExpParameter(const ExpParameter& from); + + inline ExpParameter& operator=(const ExpParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_.GetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + inline ::std::string* mutable_unknown_fields() { + return _unknown_fields_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + static const ExpParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ExpParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ExpParameter* other); + + // implements Message ---------------------------------------------- + + inline ExpParameter* New() const { return New(NULL); } + + ExpParameter* New(::google::protobuf::Arena* arena) const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ExpParameter& from); + void MergeFrom(const ExpParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(ExpParameter* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _arena_ptr_; + } + inline ::google::protobuf::Arena* MaybeArenaPtr() const { + return _arena_ptr_; + } + public: + + ::std::string GetTypeName() 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:ditcaffe.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::ArenaStringPtr _unknown_fields_; + ::google::protobuf::Arena* _arena_ptr_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + float base_; + float scale_; + float shift_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static ExpParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class FlattenParameter : public ::google::protobuf::MessageLite { + public: + FlattenParameter(); + virtual ~FlattenParameter(); + + FlattenParameter(const FlattenParameter& from); + + inline FlattenParameter& operator=(const FlattenParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_.GetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + inline ::std::string* mutable_unknown_fields() { + return _unknown_fields_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + static const FlattenParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const FlattenParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(FlattenParameter* other); + + // implements Message ---------------------------------------------- + + inline FlattenParameter* New() const { return New(NULL); } + + FlattenParameter* New(::google::protobuf::Arena* arena) const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const FlattenParameter& from); + void MergeFrom(const FlattenParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(FlattenParameter* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _arena_ptr_; + } + inline ::google::protobuf::Arena* MaybeArenaPtr() const { + return _arena_ptr_; + } + public: + + ::std::string GetTypeName() 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:ditcaffe.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::ArenaStringPtr _unknown_fields_; + ::google::protobuf::Arena* _arena_ptr_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::int32 axis_; + ::google::protobuf::int32 end_axis_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static FlattenParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class HDF5DataParameter : public ::google::protobuf::MessageLite { + public: + HDF5DataParameter(); + virtual ~HDF5DataParameter(); + + HDF5DataParameter(const HDF5DataParameter& from); + + inline HDF5DataParameter& operator=(const HDF5DataParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_.GetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + inline ::std::string* mutable_unknown_fields() { + return _unknown_fields_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + static const HDF5DataParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const HDF5DataParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(HDF5DataParameter* other); + + // implements Message ---------------------------------------------- + + inline HDF5DataParameter* New() const { return New(NULL); } + + HDF5DataParameter* New(::google::protobuf::Arena* arena) const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const HDF5DataParameter& from); + void MergeFrom(const HDF5DataParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(HDF5DataParameter* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _arena_ptr_; + } + inline ::google::protobuf::Arena* MaybeArenaPtr() const { + return _arena_ptr_; + } + public: + + ::std::string GetTypeName() 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:ditcaffe.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::ArenaStringPtr _unknown_fields_; + ::google::protobuf::Arena* _arena_ptr_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::internal::ArenaStringPtr source_; + ::google::protobuf::uint32 batch_size_; + bool shuffle_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static HDF5DataParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class HDF5OutputParameter : public ::google::protobuf::MessageLite { + public: + HDF5OutputParameter(); + virtual ~HDF5OutputParameter(); + + HDF5OutputParameter(const HDF5OutputParameter& from); + + inline HDF5OutputParameter& operator=(const HDF5OutputParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_.GetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + inline ::std::string* mutable_unknown_fields() { + return _unknown_fields_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + static const HDF5OutputParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const HDF5OutputParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(HDF5OutputParameter* other); + + // implements Message ---------------------------------------------- + + inline HDF5OutputParameter* New() const { return New(NULL); } + + HDF5OutputParameter* New(::google::protobuf::Arena* arena) const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const HDF5OutputParameter& from); + void MergeFrom(const HDF5OutputParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(HDF5OutputParameter* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _arena_ptr_; + } + inline ::google::protobuf::Arena* MaybeArenaPtr() const { + return _arena_ptr_; + } + public: + + ::std::string GetTypeName() 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:ditcaffe.HDF5OutputParameter) + private: + inline void set_has_file_name(); + inline void clear_has_file_name(); + + ::google::protobuf::internal::ArenaStringPtr _unknown_fields_; + ::google::protobuf::Arena* _arena_ptr_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::internal::ArenaStringPtr file_name_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static HDF5OutputParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class HingeLossParameter : public ::google::protobuf::MessageLite { + public: + HingeLossParameter(); + virtual ~HingeLossParameter(); + + HingeLossParameter(const HingeLossParameter& from); + + inline HingeLossParameter& operator=(const HingeLossParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_.GetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + inline ::std::string* mutable_unknown_fields() { + return _unknown_fields_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + static const HingeLossParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const HingeLossParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(HingeLossParameter* other); + + // implements Message ---------------------------------------------- + + inline HingeLossParameter* New() const { return New(NULL); } + + HingeLossParameter* New(::google::protobuf::Arena* arena) const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const HingeLossParameter& from); + void MergeFrom(const HingeLossParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(HingeLossParameter* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _arena_ptr_; + } + inline ::google::protobuf::Arena* MaybeArenaPtr() const { + return _arena_ptr_; + } + public: + + ::std::string GetTypeName() 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; + + // accessors ------------------------------------------------------- + + // optional .ditcaffe.HingeLossParameter.Norm norm = 1 [default = L1]; + bool has_norm() const; + void clear_norm(); + static const int kNormFieldNumber = 1; + ::ditcaffe::HingeLossParameter_Norm norm() const; + void set_norm(::ditcaffe::HingeLossParameter_Norm value); + + // @@protoc_insertion_point(class_scope:ditcaffe.HingeLossParameter) + private: + inline void set_has_norm(); + inline void clear_has_norm(); + + ::google::protobuf::internal::ArenaStringPtr _unknown_fields_; + ::google::protobuf::Arena* _arena_ptr_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + int norm_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static HingeLossParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class ImageDataParameter : public ::google::protobuf::MessageLite { + public: + ImageDataParameter(); + virtual ~ImageDataParameter(); + + ImageDataParameter(const ImageDataParameter& from); + + inline ImageDataParameter& operator=(const ImageDataParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_.GetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + inline ::std::string* mutable_unknown_fields() { + return _unknown_fields_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + static const ImageDataParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ImageDataParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ImageDataParameter* other); + + // implements Message ---------------------------------------------- + + inline ImageDataParameter* New() const { return New(NULL); } + + ImageDataParameter* New(::google::protobuf::Arena* arena) const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ImageDataParameter& from); + void MergeFrom(const ImageDataParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(ImageDataParameter* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _arena_ptr_; + } + inline ::google::protobuf::Arena* MaybeArenaPtr() const { + return _arena_ptr_; + } + public: + + ::std::string GetTypeName() 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:ditcaffe.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::ArenaStringPtr _unknown_fields_; + ::google::protobuf::Arena* _arena_ptr_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::internal::ArenaStringPtr source_; + ::google::protobuf::uint32 batch_size_; + ::google::protobuf::uint32 rand_skip_; + ::google::protobuf::uint32 new_height_; + ::google::protobuf::uint32 new_width_; + bool shuffle_; + bool is_color_; + bool mirror_; + float scale_; + ::google::protobuf::internal::ArenaStringPtr mean_file_; + ::google::protobuf::internal::ArenaStringPtr root_folder_; + ::google::protobuf::uint32 crop_size_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static ImageDataParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class InfogainLossParameter : public ::google::protobuf::MessageLite { + public: + InfogainLossParameter(); + virtual ~InfogainLossParameter(); + + InfogainLossParameter(const InfogainLossParameter& from); + + inline InfogainLossParameter& operator=(const InfogainLossParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_.GetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + inline ::std::string* mutable_unknown_fields() { + return _unknown_fields_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + static const InfogainLossParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const InfogainLossParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(InfogainLossParameter* other); + + // implements Message ---------------------------------------------- + + inline InfogainLossParameter* New() const { return New(NULL); } + + InfogainLossParameter* New(::google::protobuf::Arena* arena) const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const InfogainLossParameter& from); + void MergeFrom(const InfogainLossParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(InfogainLossParameter* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _arena_ptr_; + } + inline ::google::protobuf::Arena* MaybeArenaPtr() const { + return _arena_ptr_; + } + public: + + ::std::string GetTypeName() 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:ditcaffe.InfogainLossParameter) + private: + inline void set_has_source(); + inline void clear_has_source(); + + ::google::protobuf::internal::ArenaStringPtr _unknown_fields_; + ::google::protobuf::Arena* _arena_ptr_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::internal::ArenaStringPtr source_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static InfogainLossParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class InnerProductParameter : public ::google::protobuf::MessageLite { + public: + InnerProductParameter(); + virtual ~InnerProductParameter(); + + InnerProductParameter(const InnerProductParameter& from); + + inline InnerProductParameter& operator=(const InnerProductParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_.GetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + inline ::std::string* mutable_unknown_fields() { + return _unknown_fields_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + static const InnerProductParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const InnerProductParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(InnerProductParameter* other); + + // implements Message ---------------------------------------------- + + inline InnerProductParameter* New() const { return New(NULL); } + + InnerProductParameter* New(::google::protobuf::Arena* arena) const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const InnerProductParameter& from); + void MergeFrom(const InnerProductParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(InnerProductParameter* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _arena_ptr_; + } + inline ::google::protobuf::Arena* MaybeArenaPtr() const { + return _arena_ptr_; + } + public: + + ::std::string GetTypeName() 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 .ditcaffe.FillerParameter weight_filler = 3; + bool has_weight_filler() const; + void clear_weight_filler(); + static const int kWeightFillerFieldNumber = 3; + const ::ditcaffe::FillerParameter& weight_filler() const; + ::ditcaffe::FillerParameter* mutable_weight_filler(); + ::ditcaffe::FillerParameter* release_weight_filler(); + void set_allocated_weight_filler(::ditcaffe::FillerParameter* weight_filler); + + // optional .ditcaffe.FillerParameter bias_filler = 4; + bool has_bias_filler() const; + void clear_bias_filler(); + static const int kBiasFillerFieldNumber = 4; + const ::ditcaffe::FillerParameter& bias_filler() const; + ::ditcaffe::FillerParameter* mutable_bias_filler(); + ::ditcaffe::FillerParameter* release_bias_filler(); + void set_allocated_bias_filler(::ditcaffe::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:ditcaffe.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::ArenaStringPtr _unknown_fields_; + ::google::protobuf::Arena* _arena_ptr_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::ditcaffe::FillerParameter* weight_filler_; + ::google::protobuf::uint32 num_output_; + bool bias_term_; + bool transpose_; + ::ditcaffe::FillerParameter* bias_filler_; + ::google::protobuf::int32 axis_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static InnerProductParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class InputParameter : public ::google::protobuf::MessageLite { + public: + InputParameter(); + virtual ~InputParameter(); + + InputParameter(const InputParameter& from); + + inline InputParameter& operator=(const InputParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_.GetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + inline ::std::string* mutable_unknown_fields() { + return _unknown_fields_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + static const InputParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const InputParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(InputParameter* other); + + // implements Message ---------------------------------------------- + + inline InputParameter* New() const { return New(NULL); } + + InputParameter* New(::google::protobuf::Arena* arena) const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const InputParameter& from); + void MergeFrom(const InputParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(InputParameter* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _arena_ptr_; + } + inline ::google::protobuf::Arena* MaybeArenaPtr() const { + return _arena_ptr_; + } + public: + + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .ditcaffe.BlobShape shape = 1; + int shape_size() const; + void clear_shape(); + static const int kShapeFieldNumber = 1; + const ::ditcaffe::BlobShape& shape(int index) const; + ::ditcaffe::BlobShape* mutable_shape(int index); + ::ditcaffe::BlobShape* add_shape(); + ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobShape >* + mutable_shape(); + const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobShape >& + shape() const; + + // @@protoc_insertion_point(class_scope:ditcaffe.InputParameter) + private: + + ::google::protobuf::internal::ArenaStringPtr _unknown_fields_; + ::google::protobuf::Arena* _arena_ptr_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobShape > shape_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static InputParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class LogParameter : public ::google::protobuf::MessageLite { + public: + LogParameter(); + virtual ~LogParameter(); + + LogParameter(const LogParameter& from); + + inline LogParameter& operator=(const LogParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_.GetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + inline ::std::string* mutable_unknown_fields() { + return _unknown_fields_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + static const LogParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const LogParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(LogParameter* other); + + // implements Message ---------------------------------------------- + + inline LogParameter* New() const { return New(NULL); } + + LogParameter* New(::google::protobuf::Arena* arena) const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const LogParameter& from); + void MergeFrom(const LogParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(LogParameter* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _arena_ptr_; + } + inline ::google::protobuf::Arena* MaybeArenaPtr() const { + return _arena_ptr_; + } + public: + + ::std::string GetTypeName() 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:ditcaffe.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::ArenaStringPtr _unknown_fields_; + ::google::protobuf::Arena* _arena_ptr_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + float base_; + float scale_; + float shift_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static LogParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class LRNParameter : public ::google::protobuf::MessageLite { + public: + LRNParameter(); + virtual ~LRNParameter(); + + LRNParameter(const LRNParameter& from); + + inline LRNParameter& operator=(const LRNParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_.GetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + inline ::std::string* mutable_unknown_fields() { + return _unknown_fields_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + static const LRNParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const LRNParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(LRNParameter* other); + + // implements Message ---------------------------------------------- + + inline LRNParameter* New() const { return New(NULL); } + + LRNParameter* New(::google::protobuf::Arena* arena) const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const LRNParameter& from); + void MergeFrom(const LRNParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(LRNParameter* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _arena_ptr_; + } + inline ::google::protobuf::Arena* MaybeArenaPtr() const { + return _arena_ptr_; + } + public: + + ::std::string GetTypeName() 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; + + 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; + + // 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 .ditcaffe.LRNParameter.NormRegion norm_region = 4 [default = ACROSS_CHANNELS]; + bool has_norm_region() const; + void clear_norm_region(); + static const int kNormRegionFieldNumber = 4; + ::ditcaffe::LRNParameter_NormRegion norm_region() const; + void set_norm_region(::ditcaffe::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 .ditcaffe.LRNParameter.Engine engine = 6 [default = DEFAULT]; + bool has_engine() const; + void clear_engine(); + static const int kEngineFieldNumber = 6; + ::ditcaffe::LRNParameter_Engine engine() const; + void set_engine(::ditcaffe::LRNParameter_Engine value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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::ArenaStringPtr _unknown_fields_; + ::google::protobuf::Arena* _arena_ptr_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::uint32 local_size_; + float alpha_; + float beta_; + int norm_region_; + float k_; + int engine_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static LRNParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class MemoryDataParameter : public ::google::protobuf::MessageLite { + public: + MemoryDataParameter(); + virtual ~MemoryDataParameter(); + + MemoryDataParameter(const MemoryDataParameter& from); + + inline MemoryDataParameter& operator=(const MemoryDataParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_.GetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + inline ::std::string* mutable_unknown_fields() { + return _unknown_fields_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + static const MemoryDataParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const MemoryDataParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(MemoryDataParameter* other); + + // implements Message ---------------------------------------------- + + inline MemoryDataParameter* New() const { return New(NULL); } + + MemoryDataParameter* New(::google::protobuf::Arena* arena) const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const MemoryDataParameter& from); + void MergeFrom(const MemoryDataParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(MemoryDataParameter* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _arena_ptr_; + } + inline ::google::protobuf::Arena* MaybeArenaPtr() const { + return _arena_ptr_; + } + public: + + ::std::string GetTypeName() 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:ditcaffe.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::ArenaStringPtr _unknown_fields_; + ::google::protobuf::Arena* _arena_ptr_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::uint32 batch_size_; + ::google::protobuf::uint32 channels_; + ::google::protobuf::uint32 height_; + ::google::protobuf::uint32 width_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static MemoryDataParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class MVNParameter : public ::google::protobuf::MessageLite { + public: + MVNParameter(); + virtual ~MVNParameter(); + + MVNParameter(const MVNParameter& from); + + inline MVNParameter& operator=(const MVNParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_.GetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + inline ::std::string* mutable_unknown_fields() { + return _unknown_fields_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + static const MVNParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const MVNParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(MVNParameter* other); + + // implements Message ---------------------------------------------- + + inline MVNParameter* New() const { return New(NULL); } + + MVNParameter* New(::google::protobuf::Arena* arena) const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const MVNParameter& from); + void MergeFrom(const MVNParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(MVNParameter* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _arena_ptr_; + } + inline ::google::protobuf::Arena* MaybeArenaPtr() const { + return _arena_ptr_; + } + public: + + ::std::string GetTypeName() 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:ditcaffe.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::ArenaStringPtr _unknown_fields_; + ::google::protobuf::Arena* _arena_ptr_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + bool normalize_variance_; + bool across_channels_; + float eps_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static MVNParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class ParameterParameter : public ::google::protobuf::MessageLite { + public: + ParameterParameter(); + virtual ~ParameterParameter(); + + ParameterParameter(const ParameterParameter& from); + + inline ParameterParameter& operator=(const ParameterParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_.GetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + inline ::std::string* mutable_unknown_fields() { + return _unknown_fields_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + static const ParameterParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ParameterParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ParameterParameter* other); + + // implements Message ---------------------------------------------- + + inline ParameterParameter* New() const { return New(NULL); } + + ParameterParameter* New(::google::protobuf::Arena* arena) const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ParameterParameter& from); + void MergeFrom(const ParameterParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(ParameterParameter* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _arena_ptr_; + } + inline ::google::protobuf::Arena* MaybeArenaPtr() const { + return _arena_ptr_; + } + public: + + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional .ditcaffe.BlobShape shape = 1; + bool has_shape() const; + void clear_shape(); + static const int kShapeFieldNumber = 1; + const ::ditcaffe::BlobShape& shape() const; + ::ditcaffe::BlobShape* mutable_shape(); + ::ditcaffe::BlobShape* release_shape(); + void set_allocated_shape(::ditcaffe::BlobShape* shape); + + // @@protoc_insertion_point(class_scope:ditcaffe.ParameterParameter) + private: + inline void set_has_shape(); + inline void clear_has_shape(); + + ::google::protobuf::internal::ArenaStringPtr _unknown_fields_; + ::google::protobuf::Arena* _arena_ptr_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::ditcaffe::BlobShape* shape_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static ParameterParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class PoolingParameter : public ::google::protobuf::MessageLite { + public: + PoolingParameter(); + virtual ~PoolingParameter(); + + PoolingParameter(const PoolingParameter& from); + + inline PoolingParameter& operator=(const PoolingParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_.GetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + inline ::std::string* mutable_unknown_fields() { + return _unknown_fields_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + static const PoolingParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const PoolingParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(PoolingParameter* other); + + // implements Message ---------------------------------------------- + + inline PoolingParameter* New() const { return New(NULL); } + + PoolingParameter* New(::google::protobuf::Arena* arena) const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const PoolingParameter& from); + void MergeFrom(const PoolingParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(PoolingParameter* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _arena_ptr_; + } + inline ::google::protobuf::Arena* MaybeArenaPtr() const { + return _arena_ptr_; + } + public: + + ::std::string GetTypeName() 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; + + 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; + + // accessors ------------------------------------------------------- + + // optional .ditcaffe.PoolingParameter.PoolMethod pool = 1 [default = MAX]; + bool has_pool() const; + void clear_pool(); + static const int kPoolFieldNumber = 1; + ::ditcaffe::PoolingParameter_PoolMethod pool() const; + void set_pool(::ditcaffe::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 .ditcaffe.PoolingParameter.Engine engine = 11 [default = DEFAULT]; + bool has_engine() const; + void clear_engine(); + static const int kEngineFieldNumber = 11; + ::ditcaffe::PoolingParameter_Engine engine() const; + void set_engine(::ditcaffe::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); + + // optional bool torch_pooling = 40 [default = false]; + bool has_torch_pooling() const; + void clear_torch_pooling(); + static const int kTorchPoolingFieldNumber = 40; + bool torch_pooling() const; + void set_torch_pooling(bool value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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(); + inline void set_has_torch_pooling(); + inline void clear_has_torch_pooling(); + + ::google::protobuf::internal::ArenaStringPtr _unknown_fields_; + ::google::protobuf::Arena* _arena_ptr_; + + ::google::protobuf::uint32 _has_bits_[1]; + 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_; + ::google::protobuf::uint32 stride_h_; + ::google::protobuf::uint32 stride_w_; + int engine_; + bool global_pooling_; + bool torch_pooling_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static PoolingParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class PowerParameter : public ::google::protobuf::MessageLite { + public: + PowerParameter(); + virtual ~PowerParameter(); + + PowerParameter(const PowerParameter& from); + + inline PowerParameter& operator=(const PowerParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_.GetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + inline ::std::string* mutable_unknown_fields() { + return _unknown_fields_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + static const PowerParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const PowerParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(PowerParameter* other); + + // implements Message ---------------------------------------------- + + inline PowerParameter* New() const { return New(NULL); } + + PowerParameter* New(::google::protobuf::Arena* arena) const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const PowerParameter& from); + void MergeFrom(const PowerParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(PowerParameter* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _arena_ptr_; + } + inline ::google::protobuf::Arena* MaybeArenaPtr() const { + return _arena_ptr_; + } + public: + + ::std::string GetTypeName() 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:ditcaffe.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::ArenaStringPtr _unknown_fields_; + ::google::protobuf::Arena* _arena_ptr_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + float power_; + float scale_; + float shift_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static PowerParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class PythonParameter : public ::google::protobuf::MessageLite { + public: + PythonParameter(); + virtual ~PythonParameter(); + + PythonParameter(const PythonParameter& from); + + inline PythonParameter& operator=(const PythonParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_.GetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + inline ::std::string* mutable_unknown_fields() { + return _unknown_fields_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + static const PythonParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const PythonParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(PythonParameter* other); + + // implements Message ---------------------------------------------- + + inline PythonParameter* New() const { return New(NULL); } + + PythonParameter* New(::google::protobuf::Arena* arena) const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const PythonParameter& from); + void MergeFrom(const PythonParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(PythonParameter* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _arena_ptr_; + } + inline ::google::protobuf::Arena* MaybeArenaPtr() const { + return _arena_ptr_; + } + public: + + ::std::string GetTypeName() 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:ditcaffe.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::ArenaStringPtr _unknown_fields_; + ::google::protobuf::Arena* _arena_ptr_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::internal::ArenaStringPtr module_; + ::google::protobuf::internal::ArenaStringPtr layer_; + ::google::protobuf::internal::ArenaStringPtr param_str_; + bool share_in_parallel_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static PythonParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class ReductionParameter : public ::google::protobuf::MessageLite { + public: + ReductionParameter(); + virtual ~ReductionParameter(); + + ReductionParameter(const ReductionParameter& from); + + inline ReductionParameter& operator=(const ReductionParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_.GetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + inline ::std::string* mutable_unknown_fields() { + return _unknown_fields_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + static const ReductionParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ReductionParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ReductionParameter* other); + + // implements Message ---------------------------------------------- + + inline ReductionParameter* New() const { return New(NULL); } + + ReductionParameter* New(::google::protobuf::Arena* arena) const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ReductionParameter& from); + void MergeFrom(const ReductionParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(ReductionParameter* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _arena_ptr_; + } + inline ::google::protobuf::Arena* MaybeArenaPtr() const { + return _arena_ptr_; + } + public: + + ::std::string GetTypeName() 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; + + // accessors ------------------------------------------------------- + + // optional .ditcaffe.ReductionParameter.ReductionOp operation = 1 [default = SUM]; + bool has_operation() const; + void clear_operation(); + static const int kOperationFieldNumber = 1; + ::ditcaffe::ReductionParameter_ReductionOp operation() const; + void set_operation(::ditcaffe::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:ditcaffe.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::ArenaStringPtr _unknown_fields_; + ::google::protobuf::Arena* _arena_ptr_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + int operation_; + ::google::protobuf::int32 axis_; + float coeff_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static ReductionParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class ReLUParameter : public ::google::protobuf::MessageLite { + public: + ReLUParameter(); + virtual ~ReLUParameter(); + + ReLUParameter(const ReLUParameter& from); + + inline ReLUParameter& operator=(const ReLUParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_.GetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + inline ::std::string* mutable_unknown_fields() { + return _unknown_fields_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + static const ReLUParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ReLUParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ReLUParameter* other); + + // implements Message ---------------------------------------------- + + inline ReLUParameter* New() const { return New(NULL); } + + ReLUParameter* New(::google::protobuf::Arena* arena) const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ReLUParameter& from); + void MergeFrom(const ReLUParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(ReLUParameter* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _arena_ptr_; + } + inline ::google::protobuf::Arena* MaybeArenaPtr() const { + return _arena_ptr_; + } + public: + + ::std::string GetTypeName() 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; + + // 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 .ditcaffe.ReLUParameter.Engine engine = 2 [default = DEFAULT]; + bool has_engine() const; + void clear_engine(); + static const int kEngineFieldNumber = 2; + ::ditcaffe::ReLUParameter_Engine engine() const; + void set_engine(::ditcaffe::ReLUParameter_Engine value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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::ArenaStringPtr _unknown_fields_; + ::google::protobuf::Arena* _arena_ptr_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + float negative_slope_; + int engine_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static ReLUParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class ReshapeParameter : public ::google::protobuf::MessageLite { + public: + ReshapeParameter(); + virtual ~ReshapeParameter(); + + ReshapeParameter(const ReshapeParameter& from); + + inline ReshapeParameter& operator=(const ReshapeParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_.GetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + inline ::std::string* mutable_unknown_fields() { + return _unknown_fields_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + static const ReshapeParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ReshapeParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ReshapeParameter* other); + + // implements Message ---------------------------------------------- + + inline ReshapeParameter* New() const { return New(NULL); } + + ReshapeParameter* New(::google::protobuf::Arena* arena) const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ReshapeParameter& from); + void MergeFrom(const ReshapeParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(ReshapeParameter* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _arena_ptr_; + } + inline ::google::protobuf::Arena* MaybeArenaPtr() const { + return _arena_ptr_; + } + public: + + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional .ditcaffe.BlobShape shape = 1; + bool has_shape() const; + void clear_shape(); + static const int kShapeFieldNumber = 1; + const ::ditcaffe::BlobShape& shape() const; + ::ditcaffe::BlobShape* mutable_shape(); + ::ditcaffe::BlobShape* release_shape(); + void set_allocated_shape(::ditcaffe::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:ditcaffe.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::ArenaStringPtr _unknown_fields_; + ::google::protobuf::Arena* _arena_ptr_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::ditcaffe::BlobShape* shape_; + ::google::protobuf::int32 axis_; + ::google::protobuf::int32 num_axes_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static ReshapeParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class ScaleParameter : public ::google::protobuf::MessageLite { + public: + ScaleParameter(); + virtual ~ScaleParameter(); + + ScaleParameter(const ScaleParameter& from); + + inline ScaleParameter& operator=(const ScaleParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_.GetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + inline ::std::string* mutable_unknown_fields() { + return _unknown_fields_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + static const ScaleParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ScaleParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ScaleParameter* other); + + // implements Message ---------------------------------------------- + + inline ScaleParameter* New() const { return New(NULL); } + + ScaleParameter* New(::google::protobuf::Arena* arena) const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ScaleParameter& from); + void MergeFrom(const ScaleParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(ScaleParameter* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _arena_ptr_; + } + inline ::google::protobuf::Arena* MaybeArenaPtr() const { + return _arena_ptr_; + } + public: + + ::std::string GetTypeName() 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 .ditcaffe.FillerParameter filler = 3; + bool has_filler() const; + void clear_filler(); + static const int kFillerFieldNumber = 3; + const ::ditcaffe::FillerParameter& filler() const; + ::ditcaffe::FillerParameter* mutable_filler(); + ::ditcaffe::FillerParameter* release_filler(); + void set_allocated_filler(::ditcaffe::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 .ditcaffe.FillerParameter bias_filler = 5; + bool has_bias_filler() const; + void clear_bias_filler(); + static const int kBiasFillerFieldNumber = 5; + const ::ditcaffe::FillerParameter& bias_filler() const; + ::ditcaffe::FillerParameter* mutable_bias_filler(); + ::ditcaffe::FillerParameter* release_bias_filler(); + void set_allocated_bias_filler(::ditcaffe::FillerParameter* bias_filler); + + // @@protoc_insertion_point(class_scope:ditcaffe.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::ArenaStringPtr _unknown_fields_; + ::google::protobuf::Arena* _arena_ptr_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::int32 axis_; + ::google::protobuf::int32 num_axes_; + ::ditcaffe::FillerParameter* filler_; + ::ditcaffe::FillerParameter* bias_filler_; + bool bias_term_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static ScaleParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class SigmoidParameter : public ::google::protobuf::MessageLite { + public: + SigmoidParameter(); + virtual ~SigmoidParameter(); + + SigmoidParameter(const SigmoidParameter& from); + + inline SigmoidParameter& operator=(const SigmoidParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_.GetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + inline ::std::string* mutable_unknown_fields() { + return _unknown_fields_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + static const SigmoidParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const SigmoidParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(SigmoidParameter* other); + + // implements Message ---------------------------------------------- + + inline SigmoidParameter* New() const { return New(NULL); } + + SigmoidParameter* New(::google::protobuf::Arena* arena) const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const SigmoidParameter& from); + void MergeFrom(const SigmoidParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(SigmoidParameter* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _arena_ptr_; + } + inline ::google::protobuf::Arena* MaybeArenaPtr() const { + return _arena_ptr_; + } + public: + + ::std::string GetTypeName() 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; + + // accessors ------------------------------------------------------- + + // optional .ditcaffe.SigmoidParameter.Engine engine = 1 [default = DEFAULT]; + bool has_engine() const; + void clear_engine(); + static const int kEngineFieldNumber = 1; + ::ditcaffe::SigmoidParameter_Engine engine() const; + void set_engine(::ditcaffe::SigmoidParameter_Engine value); + + // @@protoc_insertion_point(class_scope:ditcaffe.SigmoidParameter) + private: + inline void set_has_engine(); + inline void clear_has_engine(); + + ::google::protobuf::internal::ArenaStringPtr _unknown_fields_; + ::google::protobuf::Arena* _arena_ptr_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + int engine_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static SigmoidParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class SliceParameter : public ::google::protobuf::MessageLite { + public: + SliceParameter(); + virtual ~SliceParameter(); + + SliceParameter(const SliceParameter& from); + + inline SliceParameter& operator=(const SliceParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_.GetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + inline ::std::string* mutable_unknown_fields() { + return _unknown_fields_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + static const SliceParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const SliceParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(SliceParameter* other); + + // implements Message ---------------------------------------------- + + inline SliceParameter* New() const { return New(NULL); } + + SliceParameter* New(::google::protobuf::Arena* arena) const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const SliceParameter& from); + void MergeFrom(const SliceParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(SliceParameter* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _arena_ptr_; + } + inline ::google::protobuf::Arena* MaybeArenaPtr() const { + return _arena_ptr_; + } + public: + + ::std::string GetTypeName() 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:ditcaffe.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::ArenaStringPtr _unknown_fields_; + ::google::protobuf::Arena* _arena_ptr_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > slice_point_; + ::google::protobuf::int32 axis_; + ::google::protobuf::uint32 slice_dim_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static SliceParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class SoftmaxParameter : public ::google::protobuf::MessageLite { + public: + SoftmaxParameter(); + virtual ~SoftmaxParameter(); + + SoftmaxParameter(const SoftmaxParameter& from); + + inline SoftmaxParameter& operator=(const SoftmaxParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_.GetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + inline ::std::string* mutable_unknown_fields() { + return _unknown_fields_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + static const SoftmaxParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const SoftmaxParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(SoftmaxParameter* other); + + // implements Message ---------------------------------------------- + + inline SoftmaxParameter* New() const { return New(NULL); } + + SoftmaxParameter* New(::google::protobuf::Arena* arena) const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const SoftmaxParameter& from); + void MergeFrom(const SoftmaxParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(SoftmaxParameter* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _arena_ptr_; + } + inline ::google::protobuf::Arena* MaybeArenaPtr() const { + return _arena_ptr_; + } + public: + + ::std::string GetTypeName() 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; + + // accessors ------------------------------------------------------- + + // optional .ditcaffe.SoftmaxParameter.Engine engine = 1 [default = DEFAULT]; + bool has_engine() const; + void clear_engine(); + static const int kEngineFieldNumber = 1; + ::ditcaffe::SoftmaxParameter_Engine engine() const; + void set_engine(::ditcaffe::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:ditcaffe.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::ArenaStringPtr _unknown_fields_; + ::google::protobuf::Arena* _arena_ptr_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + int engine_; + ::google::protobuf::int32 axis_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static SoftmaxParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class TanHParameter : public ::google::protobuf::MessageLite { + public: + TanHParameter(); + virtual ~TanHParameter(); + + TanHParameter(const TanHParameter& from); + + inline TanHParameter& operator=(const TanHParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_.GetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + inline ::std::string* mutable_unknown_fields() { + return _unknown_fields_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + static const TanHParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const TanHParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(TanHParameter* other); + + // implements Message ---------------------------------------------- + + inline TanHParameter* New() const { return New(NULL); } + + TanHParameter* New(::google::protobuf::Arena* arena) const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const TanHParameter& from); + void MergeFrom(const TanHParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(TanHParameter* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _arena_ptr_; + } + inline ::google::protobuf::Arena* MaybeArenaPtr() const { + return _arena_ptr_; + } + public: + + ::std::string GetTypeName() 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; + + // accessors ------------------------------------------------------- + + // optional .ditcaffe.TanHParameter.Engine engine = 1 [default = DEFAULT]; + bool has_engine() const; + void clear_engine(); + static const int kEngineFieldNumber = 1; + ::ditcaffe::TanHParameter_Engine engine() const; + void set_engine(::ditcaffe::TanHParameter_Engine value); + + // @@protoc_insertion_point(class_scope:ditcaffe.TanHParameter) + private: + inline void set_has_engine(); + inline void clear_has_engine(); + + ::google::protobuf::internal::ArenaStringPtr _unknown_fields_; + ::google::protobuf::Arena* _arena_ptr_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + int engine_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static TanHParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class TileParameter : public ::google::protobuf::MessageLite { + public: + TileParameter(); + virtual ~TileParameter(); + + TileParameter(const TileParameter& from); + + inline TileParameter& operator=(const TileParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_.GetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + inline ::std::string* mutable_unknown_fields() { + return _unknown_fields_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + static const TileParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const TileParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(TileParameter* other); + + // implements Message ---------------------------------------------- + + inline TileParameter* New() const { return New(NULL); } + + TileParameter* New(::google::protobuf::Arena* arena) const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const TileParameter& from); + void MergeFrom(const TileParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(TileParameter* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _arena_ptr_; + } + inline ::google::protobuf::Arena* MaybeArenaPtr() const { + return _arena_ptr_; + } + public: + + ::std::string GetTypeName() 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:ditcaffe.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::ArenaStringPtr _unknown_fields_; + ::google::protobuf::Arena* _arena_ptr_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::int32 axis_; + ::google::protobuf::int32 tiles_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static TileParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class ThresholdParameter : public ::google::protobuf::MessageLite { + public: + ThresholdParameter(); + virtual ~ThresholdParameter(); + + ThresholdParameter(const ThresholdParameter& from); + + inline ThresholdParameter& operator=(const ThresholdParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_.GetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + inline ::std::string* mutable_unknown_fields() { + return _unknown_fields_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + static const ThresholdParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ThresholdParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ThresholdParameter* other); + + // implements Message ---------------------------------------------- + + inline ThresholdParameter* New() const { return New(NULL); } + + ThresholdParameter* New(::google::protobuf::Arena* arena) const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ThresholdParameter& from); + void MergeFrom(const ThresholdParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(ThresholdParameter* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _arena_ptr_; + } + inline ::google::protobuf::Arena* MaybeArenaPtr() const { + return _arena_ptr_; + } + public: + + ::std::string GetTypeName() 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:ditcaffe.ThresholdParameter) + private: + inline void set_has_threshold(); + inline void clear_has_threshold(); + + ::google::protobuf::internal::ArenaStringPtr _unknown_fields_; + ::google::protobuf::Arena* _arena_ptr_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + float threshold_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static ThresholdParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class WindowDataParameter : public ::google::protobuf::MessageLite { + public: + WindowDataParameter(); + virtual ~WindowDataParameter(); + + WindowDataParameter(const WindowDataParameter& from); + + inline WindowDataParameter& operator=(const WindowDataParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_.GetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + inline ::std::string* mutable_unknown_fields() { + return _unknown_fields_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + static const WindowDataParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const WindowDataParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(WindowDataParameter* other); + + // implements Message ---------------------------------------------- + + inline WindowDataParameter* New() const { return New(NULL); } + + WindowDataParameter* New(::google::protobuf::Arena* arena) const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const WindowDataParameter& from); + void MergeFrom(const WindowDataParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(WindowDataParameter* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _arena_ptr_; + } + inline ::google::protobuf::Arena* MaybeArenaPtr() const { + return _arena_ptr_; + } + public: + + ::std::string GetTypeName() 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:ditcaffe.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::ArenaStringPtr _unknown_fields_; + ::google::protobuf::Arena* _arena_ptr_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::internal::ArenaStringPtr source_; + ::google::protobuf::internal::ArenaStringPtr mean_file_; + float scale_; + ::google::protobuf::uint32 batch_size_; + ::google::protobuf::uint32 crop_size_; + float fg_threshold_; + float bg_threshold_; + float fg_fraction_; + bool mirror_; + bool cache_images_; + ::google::protobuf::uint32 context_pad_; + static ::std::string* _default_crop_mode_; + ::google::protobuf::internal::ArenaStringPtr crop_mode_; + ::google::protobuf::internal::ArenaStringPtr root_folder_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static WindowDataParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class SPPParameter : public ::google::protobuf::MessageLite { + public: + SPPParameter(); + virtual ~SPPParameter(); + + SPPParameter(const SPPParameter& from); + + inline SPPParameter& operator=(const SPPParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_.GetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + inline ::std::string* mutable_unknown_fields() { + return _unknown_fields_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + static const SPPParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const SPPParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(SPPParameter* other); + + // implements Message ---------------------------------------------- + + inline SPPParameter* New() const { return New(NULL); } + + SPPParameter* New(::google::protobuf::Arena* arena) const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const SPPParameter& from); + void MergeFrom(const SPPParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(SPPParameter* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _arena_ptr_; + } + inline ::google::protobuf::Arena* MaybeArenaPtr() const { + return _arena_ptr_; + } + public: + + ::std::string GetTypeName() 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; + + 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; + + // 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 .ditcaffe.SPPParameter.PoolMethod pool = 2 [default = MAX]; + bool has_pool() const; + void clear_pool(); + static const int kPoolFieldNumber = 2; + ::ditcaffe::SPPParameter_PoolMethod pool() const; + void set_pool(::ditcaffe::SPPParameter_PoolMethod value); + + // optional .ditcaffe.SPPParameter.Engine engine = 6 [default = DEFAULT]; + bool has_engine() const; + void clear_engine(); + static const int kEngineFieldNumber = 6; + ::ditcaffe::SPPParameter_Engine engine() const; + void set_engine(::ditcaffe::SPPParameter_Engine value); + + // @@protoc_insertion_point(class_scope:ditcaffe.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::ArenaStringPtr _unknown_fields_; + ::google::protobuf::Arena* _arena_ptr_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::uint32 pyramid_height_; + int pool_; + int engine_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static SPPParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class V1LayerParameter : public ::google::protobuf::MessageLite { + public: + V1LayerParameter(); + virtual ~V1LayerParameter(); + + V1LayerParameter(const V1LayerParameter& from); + + inline V1LayerParameter& operator=(const V1LayerParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_.GetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + inline ::std::string* mutable_unknown_fields() { + return _unknown_fields_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + static const V1LayerParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const V1LayerParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(V1LayerParameter* other); + + // implements Message ---------------------------------------------- + + inline V1LayerParameter* New() const { return New(NULL); } + + V1LayerParameter* New(::google::protobuf::Arena* arena) const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const V1LayerParameter& from); + void MergeFrom(const V1LayerParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(V1LayerParameter* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _arena_ptr_; + } + inline ::google::protobuf::Arena* MaybeArenaPtr() const { + return _arena_ptr_; + } + public: + + ::std::string GetTypeName() 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; + + 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; + + // 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 .ditcaffe.NetStateRule include = 32; + int include_size() const; + void clear_include(); + static const int kIncludeFieldNumber = 32; + const ::ditcaffe::NetStateRule& include(int index) const; + ::ditcaffe::NetStateRule* mutable_include(int index); + ::ditcaffe::NetStateRule* add_include(); + ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >* + mutable_include(); + const ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >& + include() const; + + // repeated .ditcaffe.NetStateRule exclude = 33; + int exclude_size() const; + void clear_exclude(); + static const int kExcludeFieldNumber = 33; + const ::ditcaffe::NetStateRule& exclude(int index) const; + ::ditcaffe::NetStateRule* mutable_exclude(int index); + ::ditcaffe::NetStateRule* add_exclude(); + ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >* + mutable_exclude(); + const ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >& + exclude() const; + + // optional .ditcaffe.V1LayerParameter.LayerType type = 5; + bool has_type() const; + void clear_type(); + static const int kTypeFieldNumber = 5; + ::ditcaffe::V1LayerParameter_LayerType type() const; + void set_type(::ditcaffe::V1LayerParameter_LayerType value); + + // repeated .ditcaffe.BlobProto blobs = 6; + int blobs_size() const; + void clear_blobs(); + static const int kBlobsFieldNumber = 6; + const ::ditcaffe::BlobProto& blobs(int index) const; + ::ditcaffe::BlobProto* mutable_blobs(int index); + ::ditcaffe::BlobProto* add_blobs(); + ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >* + mutable_blobs(); + const ::google::protobuf::RepeatedPtrField< ::ditcaffe::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 .ditcaffe.V1LayerParameter.DimCheckMode blob_share_mode = 1002; + int blob_share_mode_size() const; + void clear_blob_share_mode(); + static const int kBlobShareModeFieldNumber = 1002; + ::ditcaffe::V1LayerParameter_DimCheckMode blob_share_mode(int index) const; + void set_blob_share_mode(int index, ::ditcaffe::V1LayerParameter_DimCheckMode value); + void add_blob_share_mode(::ditcaffe::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 .ditcaffe.AccuracyParameter accuracy_param = 27; + bool has_accuracy_param() const; + void clear_accuracy_param(); + static const int kAccuracyParamFieldNumber = 27; + const ::ditcaffe::AccuracyParameter& accuracy_param() const; + ::ditcaffe::AccuracyParameter* mutable_accuracy_param(); + ::ditcaffe::AccuracyParameter* release_accuracy_param(); + void set_allocated_accuracy_param(::ditcaffe::AccuracyParameter* accuracy_param); + + // optional .ditcaffe.ArgMaxParameter argmax_param = 23; + bool has_argmax_param() const; + void clear_argmax_param(); + static const int kArgmaxParamFieldNumber = 23; + const ::ditcaffe::ArgMaxParameter& argmax_param() const; + ::ditcaffe::ArgMaxParameter* mutable_argmax_param(); + ::ditcaffe::ArgMaxParameter* release_argmax_param(); + void set_allocated_argmax_param(::ditcaffe::ArgMaxParameter* argmax_param); + + // optional .ditcaffe.ConcatParameter concat_param = 9; + bool has_concat_param() const; + void clear_concat_param(); + static const int kConcatParamFieldNumber = 9; + const ::ditcaffe::ConcatParameter& concat_param() const; + ::ditcaffe::ConcatParameter* mutable_concat_param(); + ::ditcaffe::ConcatParameter* release_concat_param(); + void set_allocated_concat_param(::ditcaffe::ConcatParameter* concat_param); + + // optional .ditcaffe.ContrastiveLossParameter contrastive_loss_param = 40; + bool has_contrastive_loss_param() const; + void clear_contrastive_loss_param(); + static const int kContrastiveLossParamFieldNumber = 40; + const ::ditcaffe::ContrastiveLossParameter& contrastive_loss_param() const; + ::ditcaffe::ContrastiveLossParameter* mutable_contrastive_loss_param(); + ::ditcaffe::ContrastiveLossParameter* release_contrastive_loss_param(); + void set_allocated_contrastive_loss_param(::ditcaffe::ContrastiveLossParameter* contrastive_loss_param); + + // optional .ditcaffe.ConvolutionParameter convolution_param = 10; + bool has_convolution_param() const; + void clear_convolution_param(); + static const int kConvolutionParamFieldNumber = 10; + const ::ditcaffe::ConvolutionParameter& convolution_param() const; + ::ditcaffe::ConvolutionParameter* mutable_convolution_param(); + ::ditcaffe::ConvolutionParameter* release_convolution_param(); + void set_allocated_convolution_param(::ditcaffe::ConvolutionParameter* convolution_param); + + // optional .ditcaffe.DataParameter data_param = 11; + bool has_data_param() const; + void clear_data_param(); + static const int kDataParamFieldNumber = 11; + const ::ditcaffe::DataParameter& data_param() const; + ::ditcaffe::DataParameter* mutable_data_param(); + ::ditcaffe::DataParameter* release_data_param(); + void set_allocated_data_param(::ditcaffe::DataParameter* data_param); + + // optional .ditcaffe.DropoutParameter dropout_param = 12; + bool has_dropout_param() const; + void clear_dropout_param(); + static const int kDropoutParamFieldNumber = 12; + const ::ditcaffe::DropoutParameter& dropout_param() const; + ::ditcaffe::DropoutParameter* mutable_dropout_param(); + ::ditcaffe::DropoutParameter* release_dropout_param(); + void set_allocated_dropout_param(::ditcaffe::DropoutParameter* dropout_param); + + // optional .ditcaffe.DummyDataParameter dummy_data_param = 26; + bool has_dummy_data_param() const; + void clear_dummy_data_param(); + static const int kDummyDataParamFieldNumber = 26; + const ::ditcaffe::DummyDataParameter& dummy_data_param() const; + ::ditcaffe::DummyDataParameter* mutable_dummy_data_param(); + ::ditcaffe::DummyDataParameter* release_dummy_data_param(); + void set_allocated_dummy_data_param(::ditcaffe::DummyDataParameter* dummy_data_param); + + // optional .ditcaffe.EltwiseParameter eltwise_param = 24; + bool has_eltwise_param() const; + void clear_eltwise_param(); + static const int kEltwiseParamFieldNumber = 24; + const ::ditcaffe::EltwiseParameter& eltwise_param() const; + ::ditcaffe::EltwiseParameter* mutable_eltwise_param(); + ::ditcaffe::EltwiseParameter* release_eltwise_param(); + void set_allocated_eltwise_param(::ditcaffe::EltwiseParameter* eltwise_param); + + // optional .ditcaffe.ExpParameter exp_param = 41; + bool has_exp_param() const; + void clear_exp_param(); + static const int kExpParamFieldNumber = 41; + const ::ditcaffe::ExpParameter& exp_param() const; + ::ditcaffe::ExpParameter* mutable_exp_param(); + ::ditcaffe::ExpParameter* release_exp_param(); + void set_allocated_exp_param(::ditcaffe::ExpParameter* exp_param); + + // optional .ditcaffe.HDF5DataParameter hdf5_data_param = 13; + bool has_hdf5_data_param() const; + void clear_hdf5_data_param(); + static const int kHdf5DataParamFieldNumber = 13; + const ::ditcaffe::HDF5DataParameter& hdf5_data_param() const; + ::ditcaffe::HDF5DataParameter* mutable_hdf5_data_param(); + ::ditcaffe::HDF5DataParameter* release_hdf5_data_param(); + void set_allocated_hdf5_data_param(::ditcaffe::HDF5DataParameter* hdf5_data_param); + + // optional .ditcaffe.HDF5OutputParameter hdf5_output_param = 14; + bool has_hdf5_output_param() const; + void clear_hdf5_output_param(); + static const int kHdf5OutputParamFieldNumber = 14; + const ::ditcaffe::HDF5OutputParameter& hdf5_output_param() const; + ::ditcaffe::HDF5OutputParameter* mutable_hdf5_output_param(); + ::ditcaffe::HDF5OutputParameter* release_hdf5_output_param(); + void set_allocated_hdf5_output_param(::ditcaffe::HDF5OutputParameter* hdf5_output_param); + + // optional .ditcaffe.HingeLossParameter hinge_loss_param = 29; + bool has_hinge_loss_param() const; + void clear_hinge_loss_param(); + static const int kHingeLossParamFieldNumber = 29; + const ::ditcaffe::HingeLossParameter& hinge_loss_param() const; + ::ditcaffe::HingeLossParameter* mutable_hinge_loss_param(); + ::ditcaffe::HingeLossParameter* release_hinge_loss_param(); + void set_allocated_hinge_loss_param(::ditcaffe::HingeLossParameter* hinge_loss_param); + + // optional .ditcaffe.ImageDataParameter image_data_param = 15; + bool has_image_data_param() const; + void clear_image_data_param(); + static const int kImageDataParamFieldNumber = 15; + const ::ditcaffe::ImageDataParameter& image_data_param() const; + ::ditcaffe::ImageDataParameter* mutable_image_data_param(); + ::ditcaffe::ImageDataParameter* release_image_data_param(); + void set_allocated_image_data_param(::ditcaffe::ImageDataParameter* image_data_param); + + // optional .ditcaffe.InfogainLossParameter infogain_loss_param = 16; + bool has_infogain_loss_param() const; + void clear_infogain_loss_param(); + static const int kInfogainLossParamFieldNumber = 16; + const ::ditcaffe::InfogainLossParameter& infogain_loss_param() const; + ::ditcaffe::InfogainLossParameter* mutable_infogain_loss_param(); + ::ditcaffe::InfogainLossParameter* release_infogain_loss_param(); + void set_allocated_infogain_loss_param(::ditcaffe::InfogainLossParameter* infogain_loss_param); + + // optional .ditcaffe.InnerProductParameter inner_product_param = 17; + bool has_inner_product_param() const; + void clear_inner_product_param(); + static const int kInnerProductParamFieldNumber = 17; + const ::ditcaffe::InnerProductParameter& inner_product_param() const; + ::ditcaffe::InnerProductParameter* mutable_inner_product_param(); + ::ditcaffe::InnerProductParameter* release_inner_product_param(); + void set_allocated_inner_product_param(::ditcaffe::InnerProductParameter* inner_product_param); + + // optional .ditcaffe.LRNParameter lrn_param = 18; + bool has_lrn_param() const; + void clear_lrn_param(); + static const int kLrnParamFieldNumber = 18; + const ::ditcaffe::LRNParameter& lrn_param() const; + ::ditcaffe::LRNParameter* mutable_lrn_param(); + ::ditcaffe::LRNParameter* release_lrn_param(); + void set_allocated_lrn_param(::ditcaffe::LRNParameter* lrn_param); + + // optional .ditcaffe.MemoryDataParameter memory_data_param = 22; + bool has_memory_data_param() const; + void clear_memory_data_param(); + static const int kMemoryDataParamFieldNumber = 22; + const ::ditcaffe::MemoryDataParameter& memory_data_param() const; + ::ditcaffe::MemoryDataParameter* mutable_memory_data_param(); + ::ditcaffe::MemoryDataParameter* release_memory_data_param(); + void set_allocated_memory_data_param(::ditcaffe::MemoryDataParameter* memory_data_param); + + // optional .ditcaffe.MVNParameter mvn_param = 34; + bool has_mvn_param() const; + void clear_mvn_param(); + static const int kMvnParamFieldNumber = 34; + const ::ditcaffe::MVNParameter& mvn_param() const; + ::ditcaffe::MVNParameter* mutable_mvn_param(); + ::ditcaffe::MVNParameter* release_mvn_param(); + void set_allocated_mvn_param(::ditcaffe::MVNParameter* mvn_param); + + // optional .ditcaffe.PoolingParameter pooling_param = 19; + bool has_pooling_param() const; + void clear_pooling_param(); + static const int kPoolingParamFieldNumber = 19; + const ::ditcaffe::PoolingParameter& pooling_param() const; + ::ditcaffe::PoolingParameter* mutable_pooling_param(); + ::ditcaffe::PoolingParameter* release_pooling_param(); + void set_allocated_pooling_param(::ditcaffe::PoolingParameter* pooling_param); + + // optional .ditcaffe.PowerParameter power_param = 21; + bool has_power_param() const; + void clear_power_param(); + static const int kPowerParamFieldNumber = 21; + const ::ditcaffe::PowerParameter& power_param() const; + ::ditcaffe::PowerParameter* mutable_power_param(); + ::ditcaffe::PowerParameter* release_power_param(); + void set_allocated_power_param(::ditcaffe::PowerParameter* power_param); + + // optional .ditcaffe.ReLUParameter relu_param = 30; + bool has_relu_param() const; + void clear_relu_param(); + static const int kReluParamFieldNumber = 30; + const ::ditcaffe::ReLUParameter& relu_param() const; + ::ditcaffe::ReLUParameter* mutable_relu_param(); + ::ditcaffe::ReLUParameter* release_relu_param(); + void set_allocated_relu_param(::ditcaffe::ReLUParameter* relu_param); + + // optional .ditcaffe.SigmoidParameter sigmoid_param = 38; + bool has_sigmoid_param() const; + void clear_sigmoid_param(); + static const int kSigmoidParamFieldNumber = 38; + const ::ditcaffe::SigmoidParameter& sigmoid_param() const; + ::ditcaffe::SigmoidParameter* mutable_sigmoid_param(); + ::ditcaffe::SigmoidParameter* release_sigmoid_param(); + void set_allocated_sigmoid_param(::ditcaffe::SigmoidParameter* sigmoid_param); + + // optional .ditcaffe.SoftmaxParameter softmax_param = 39; + bool has_softmax_param() const; + void clear_softmax_param(); + static const int kSoftmaxParamFieldNumber = 39; + const ::ditcaffe::SoftmaxParameter& softmax_param() const; + ::ditcaffe::SoftmaxParameter* mutable_softmax_param(); + ::ditcaffe::SoftmaxParameter* release_softmax_param(); + void set_allocated_softmax_param(::ditcaffe::SoftmaxParameter* softmax_param); + + // optional .ditcaffe.SliceParameter slice_param = 31; + bool has_slice_param() const; + void clear_slice_param(); + static const int kSliceParamFieldNumber = 31; + const ::ditcaffe::SliceParameter& slice_param() const; + ::ditcaffe::SliceParameter* mutable_slice_param(); + ::ditcaffe::SliceParameter* release_slice_param(); + void set_allocated_slice_param(::ditcaffe::SliceParameter* slice_param); + + // optional .ditcaffe.TanHParameter tanh_param = 37; + bool has_tanh_param() const; + void clear_tanh_param(); + static const int kTanhParamFieldNumber = 37; + const ::ditcaffe::TanHParameter& tanh_param() const; + ::ditcaffe::TanHParameter* mutable_tanh_param(); + ::ditcaffe::TanHParameter* release_tanh_param(); + void set_allocated_tanh_param(::ditcaffe::TanHParameter* tanh_param); + + // optional .ditcaffe.ThresholdParameter threshold_param = 25; + bool has_threshold_param() const; + void clear_threshold_param(); + static const int kThresholdParamFieldNumber = 25; + const ::ditcaffe::ThresholdParameter& threshold_param() const; + ::ditcaffe::ThresholdParameter* mutable_threshold_param(); + ::ditcaffe::ThresholdParameter* release_threshold_param(); + void set_allocated_threshold_param(::ditcaffe::ThresholdParameter* threshold_param); + + // optional .ditcaffe.WindowDataParameter window_data_param = 20; + bool has_window_data_param() const; + void clear_window_data_param(); + static const int kWindowDataParamFieldNumber = 20; + const ::ditcaffe::WindowDataParameter& window_data_param() const; + ::ditcaffe::WindowDataParameter* mutable_window_data_param(); + ::ditcaffe::WindowDataParameter* release_window_data_param(); + void set_allocated_window_data_param(::ditcaffe::WindowDataParameter* window_data_param); + + // optional .ditcaffe.TransformationParameter transform_param = 36; + bool has_transform_param() const; + void clear_transform_param(); + static const int kTransformParamFieldNumber = 36; + const ::ditcaffe::TransformationParameter& transform_param() const; + ::ditcaffe::TransformationParameter* mutable_transform_param(); + ::ditcaffe::TransformationParameter* release_transform_param(); + void set_allocated_transform_param(::ditcaffe::TransformationParameter* transform_param); + + // optional .ditcaffe.LossParameter loss_param = 42; + bool has_loss_param() const; + void clear_loss_param(); + static const int kLossParamFieldNumber = 42; + const ::ditcaffe::LossParameter& loss_param() const; + ::ditcaffe::LossParameter* mutable_loss_param(); + ::ditcaffe::LossParameter* release_loss_param(); + void set_allocated_loss_param(::ditcaffe::LossParameter* loss_param); + + // optional .ditcaffe.V0LayerParameter layer = 1; + bool has_layer() const; + void clear_layer(); + static const int kLayerFieldNumber = 1; + const ::ditcaffe::V0LayerParameter& layer() const; + ::ditcaffe::V0LayerParameter* mutable_layer(); + ::ditcaffe::V0LayerParameter* release_layer(); + void set_allocated_layer(::ditcaffe::V0LayerParameter* layer); + + // @@protoc_insertion_point(class_scope:ditcaffe.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::ArenaStringPtr _unknown_fields_; + ::google::protobuf::Arena* _arena_ptr_; + + ::google::protobuf::uint32 _has_bits_[2]; + ::google::protobuf::RepeatedPtrField< ::std::string> bottom_; + ::google::protobuf::RepeatedPtrField< ::std::string> top_; + ::google::protobuf::internal::ArenaStringPtr name_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule > include_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule > exclude_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::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_; + ::ditcaffe::AccuracyParameter* accuracy_param_; + ::ditcaffe::ArgMaxParameter* argmax_param_; + ::ditcaffe::ConcatParameter* concat_param_; + ::ditcaffe::ContrastiveLossParameter* contrastive_loss_param_; + ::ditcaffe::ConvolutionParameter* convolution_param_; + ::ditcaffe::DataParameter* data_param_; + ::ditcaffe::DropoutParameter* dropout_param_; + ::ditcaffe::DummyDataParameter* dummy_data_param_; + ::ditcaffe::EltwiseParameter* eltwise_param_; + ::ditcaffe::ExpParameter* exp_param_; + ::ditcaffe::HDF5DataParameter* hdf5_data_param_; + ::ditcaffe::HDF5OutputParameter* hdf5_output_param_; + ::ditcaffe::HingeLossParameter* hinge_loss_param_; + ::ditcaffe::ImageDataParameter* image_data_param_; + ::ditcaffe::InfogainLossParameter* infogain_loss_param_; + ::ditcaffe::InnerProductParameter* inner_product_param_; + ::ditcaffe::LRNParameter* lrn_param_; + ::ditcaffe::MemoryDataParameter* memory_data_param_; + ::ditcaffe::MVNParameter* mvn_param_; + ::ditcaffe::PoolingParameter* pooling_param_; + ::ditcaffe::PowerParameter* power_param_; + ::ditcaffe::ReLUParameter* relu_param_; + ::ditcaffe::SigmoidParameter* sigmoid_param_; + ::ditcaffe::SoftmaxParameter* softmax_param_; + ::ditcaffe::SliceParameter* slice_param_; + ::ditcaffe::TanHParameter* tanh_param_; + ::ditcaffe::ThresholdParameter* threshold_param_; + ::ditcaffe::WindowDataParameter* window_data_param_; + ::ditcaffe::TransformationParameter* transform_param_; + ::ditcaffe::LossParameter* loss_param_; + ::ditcaffe::V0LayerParameter* layer_; + int type_; + mutable int _cached_size_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static V1LayerParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class V0LayerParameter : public ::google::protobuf::MessageLite { + public: + V0LayerParameter(); + virtual ~V0LayerParameter(); + + V0LayerParameter(const V0LayerParameter& from); + + inline V0LayerParameter& operator=(const V0LayerParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_.GetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + inline ::std::string* mutable_unknown_fields() { + return _unknown_fields_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + static const V0LayerParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const V0LayerParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(V0LayerParameter* other); + + // implements Message ---------------------------------------------- + + inline V0LayerParameter* New() const { return New(NULL); } + + V0LayerParameter* New(::google::protobuf::Arena* arena) const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const V0LayerParameter& from); + void MergeFrom(const V0LayerParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(V0LayerParameter* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _arena_ptr_; + } + inline ::google::protobuf::Arena* MaybeArenaPtr() const { + return _arena_ptr_; + } + public: + + ::std::string GetTypeName() 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; + + // 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 .ditcaffe.FillerParameter weight_filler = 5; + bool has_weight_filler() const; + void clear_weight_filler(); + static const int kWeightFillerFieldNumber = 5; + const ::ditcaffe::FillerParameter& weight_filler() const; + ::ditcaffe::FillerParameter* mutable_weight_filler(); + ::ditcaffe::FillerParameter* release_weight_filler(); + void set_allocated_weight_filler(::ditcaffe::FillerParameter* weight_filler); + + // optional .ditcaffe.FillerParameter bias_filler = 6; + bool has_bias_filler() const; + void clear_bias_filler(); + static const int kBiasFillerFieldNumber = 6; + const ::ditcaffe::FillerParameter& bias_filler() const; + ::ditcaffe::FillerParameter* mutable_bias_filler(); + ::ditcaffe::FillerParameter* release_bias_filler(); + void set_allocated_bias_filler(::ditcaffe::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 .ditcaffe.V0LayerParameter.PoolMethod pool = 11 [default = MAX]; + bool has_pool() const; + void clear_pool(); + static const int kPoolFieldNumber = 11; + ::ditcaffe::V0LayerParameter_PoolMethod pool() const; + void set_pool(::ditcaffe::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 .ditcaffe.BlobProto blobs = 50; + int blobs_size() const; + void clear_blobs(); + static const int kBlobsFieldNumber = 50; + const ::ditcaffe::BlobProto& blobs(int index) const; + ::ditcaffe::BlobProto* mutable_blobs(int index); + ::ditcaffe::BlobProto* add_blobs(); + ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >* + mutable_blobs(); + const ::google::protobuf::RepeatedPtrField< ::ditcaffe::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 .ditcaffe.HDF5OutputParameter hdf5_output_param = 1001; + bool has_hdf5_output_param() const; + void clear_hdf5_output_param(); + static const int kHdf5OutputParamFieldNumber = 1001; + const ::ditcaffe::HDF5OutputParameter& hdf5_output_param() const; + ::ditcaffe::HDF5OutputParameter* mutable_hdf5_output_param(); + ::ditcaffe::HDF5OutputParameter* release_hdf5_output_param(); + void set_allocated_hdf5_output_param(::ditcaffe::HDF5OutputParameter* hdf5_output_param); + + // @@protoc_insertion_point(class_scope:ditcaffe.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::ArenaStringPtr _unknown_fields_; + ::google::protobuf::Arena* _arena_ptr_; + + ::google::protobuf::uint32 _has_bits_[2]; + ::google::protobuf::internal::ArenaStringPtr name_; + ::google::protobuf::internal::ArenaStringPtr type_; + ::ditcaffe::FillerParameter* weight_filler_; + ::google::protobuf::uint32 num_output_; + ::google::protobuf::uint32 pad_; + ::ditcaffe::FillerParameter* bias_filler_; + ::google::protobuf::uint32 kernelsize_; + ::google::protobuf::uint32 group_; + ::google::protobuf::uint32 stride_; + int pool_; + float dropout_ratio_; + ::google::protobuf::uint32 local_size_; + float alpha_; + float beta_; + ::google::protobuf::internal::ArenaStringPtr source_; + float k_; + float scale_; + ::google::protobuf::internal::ArenaStringPtr meanfile_; + ::google::protobuf::uint32 batchsize_; + bool biasterm_; + bool mirror_; + bool shuffle_images_; + ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto > blobs_; + ::google::protobuf::uint32 cropsize_; + ::google::protobuf::uint32 rand_skip_; + ::google::protobuf::RepeatedField< float > blobs_lr_; + ::google::protobuf::RepeatedField< float > weight_decay_; + float det_fg_threshold_; + float det_bg_threshold_; + float det_fg_fraction_; + ::google::protobuf::uint32 det_context_pad_; + static ::std::string* _default_det_crop_mode_; + ::google::protobuf::internal::ArenaStringPtr det_crop_mode_; + ::google::protobuf::int32 new_num_; + ::google::protobuf::int32 new_channels_; + ::google::protobuf::int32 new_height_; + ::google::protobuf::int32 new_width_; + ::ditcaffe::HDF5OutputParameter* hdf5_output_param_; + ::google::protobuf::uint32 concat_dim_; + mutable int _cached_size_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static V0LayerParameter* default_instance_; +}; +// ------------------------------------------------------------------- + +class PReLUParameter : public ::google::protobuf::MessageLite { + public: + PReLUParameter(); + virtual ~PReLUParameter(); + + PReLUParameter(const PReLUParameter& from); + + inline PReLUParameter& operator=(const PReLUParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_.GetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + inline ::std::string* mutable_unknown_fields() { + return _unknown_fields_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + + static const PReLUParameter& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const PReLUParameter* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(PReLUParameter* other); + + // implements Message ---------------------------------------------- + + inline PReLUParameter* New() const { return New(NULL); } + + PReLUParameter* New(::google::protobuf::Arena* arena) const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const PReLUParameter& from); + void MergeFrom(const PReLUParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(PReLUParameter* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _arena_ptr_; + } + inline ::google::protobuf::Arena* MaybeArenaPtr() const { + return _arena_ptr_; + } + public: + + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional .ditcaffe.FillerParameter filler = 1; + bool has_filler() const; + void clear_filler(); + static const int kFillerFieldNumber = 1; + const ::ditcaffe::FillerParameter& filler() const; + ::ditcaffe::FillerParameter* mutable_filler(); + ::ditcaffe::FillerParameter* release_filler(); + void set_allocated_filler(::ditcaffe::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:ditcaffe.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::ArenaStringPtr _unknown_fields_; + ::google::protobuf::Arena* _arena_ptr_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::ditcaffe::FillerParameter* filler_; + bool channel_shared_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto_impl(); + #else + friend void protobuf_AddDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + #endif + friend void protobuf_AssignDesc_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + friend void protobuf_ShutdownFile_ditcaffe_2eopt_2dfor_2dlite_2eproto(); + + void InitAsDefaultInstance(); + static PReLUParameter* 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:ditcaffe.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:ditcaffe.BlobShape.dim) +} +inline void BlobShape::add_dim(::google::protobuf::int64 value) { + dim_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.BlobShape.dim) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +BlobShape::dim() const { + // @@protoc_insertion_point(field_list:ditcaffe.BlobShape.dim) + return dim_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +BlobShape::mutable_dim() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.BlobShape.dim) + return &dim_; +} + +// ------------------------------------------------------------------- + +// BlobProto + +// optional .ditcaffe.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_->::ditcaffe::BlobShape::Clear(); + clear_has_shape(); +} +inline const ::ditcaffe::BlobShape& BlobProto::shape() const { + // @@protoc_insertion_point(field_get:ditcaffe.BlobProto.shape) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return shape_ != NULL ? *shape_ : *default_instance().shape_; +#else + return shape_ != NULL ? *shape_ : *default_instance_->shape_; +#endif +} +inline ::ditcaffe::BlobShape* BlobProto::mutable_shape() { + set_has_shape(); + if (shape_ == NULL) { + shape_ = new ::ditcaffe::BlobShape; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.BlobProto.shape) + return shape_; +} +inline ::ditcaffe::BlobShape* BlobProto::release_shape() { + // @@protoc_insertion_point(field_release:ditcaffe.BlobProto.shape) + clear_has_shape(); + ::ditcaffe::BlobShape* temp = shape_; + shape_ = NULL; + return temp; +} +inline void BlobProto::set_allocated_shape(::ditcaffe::BlobShape* shape) { + delete shape_; + shape_ = shape; + if (shape) { + set_has_shape(); + } else { + clear_has_shape(); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.BlobProto.data) + return data_.Get(index); +} +inline void BlobProto::set_data(int index, float value) { + data_.Set(index, value); + // @@protoc_insertion_point(field_set:ditcaffe.BlobProto.data) +} +inline void BlobProto::add_data(float value) { + data_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.BlobProto.data) +} +inline const ::google::protobuf::RepeatedField< float >& +BlobProto::data() const { + // @@protoc_insertion_point(field_list:ditcaffe.BlobProto.data) + return data_; +} +inline ::google::protobuf::RepeatedField< float >* +BlobProto::mutable_data() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.BlobProto.diff) + return diff_.Get(index); +} +inline void BlobProto::set_diff(int index, float value) { + diff_.Set(index, value); + // @@protoc_insertion_point(field_set:ditcaffe.BlobProto.diff) +} +inline void BlobProto::add_diff(float value) { + diff_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.BlobProto.diff) +} +inline const ::google::protobuf::RepeatedField< float >& +BlobProto::diff() const { + // @@protoc_insertion_point(field_list:ditcaffe.BlobProto.diff) + return diff_; +} +inline ::google::protobuf::RepeatedField< float >* +BlobProto::mutable_diff() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.BlobProto.double_data) +} +inline void BlobProto::add_double_data(double value) { + double_data_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.BlobProto.double_data) +} +inline const ::google::protobuf::RepeatedField< double >& +BlobProto::double_data() const { + // @@protoc_insertion_point(field_list:ditcaffe.BlobProto.double_data) + return double_data_; +} +inline ::google::protobuf::RepeatedField< double >* +BlobProto::mutable_double_data() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.BlobProto.double_diff) +} +inline void BlobProto::add_double_diff(double value) { + double_diff_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.BlobProto.double_diff) +} +inline const ::google::protobuf::RepeatedField< double >& +BlobProto::double_diff() const { + // @@protoc_insertion_point(field_list:ditcaffe.BlobProto.double_diff) + return double_diff_; +} +inline ::google::protobuf::RepeatedField< double >* +BlobProto::mutable_double_diff() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.BlobProto.double_diff) + return &double_diff_; +} + +// repeated uint32 half_data = 10 [packed = true]; +inline int BlobProto::half_data_size() const { + return half_data_.size(); +} +inline void BlobProto::clear_half_data() { + half_data_.Clear(); +} +inline ::google::protobuf::uint32 BlobProto::half_data(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.BlobProto.half_data) + return half_data_.Get(index); +} +inline void BlobProto::set_half_data(int index, ::google::protobuf::uint32 value) { + half_data_.Set(index, value); + // @@protoc_insertion_point(field_set:ditcaffe.BlobProto.half_data) +} +inline void BlobProto::add_half_data(::google::protobuf::uint32 value) { + half_data_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.BlobProto.half_data) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +BlobProto::half_data() const { + // @@protoc_insertion_point(field_list:ditcaffe.BlobProto.half_data) + return half_data_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +BlobProto::mutable_half_data() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.BlobProto.half_data) + return &half_data_; +} + +// repeated uint32 half_diff = 11 [packed = true]; +inline int BlobProto::half_diff_size() const { + return half_diff_.size(); +} +inline void BlobProto::clear_half_diff() { + half_diff_.Clear(); +} +inline ::google::protobuf::uint32 BlobProto::half_diff(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.BlobProto.half_diff) + return half_diff_.Get(index); +} +inline void BlobProto::set_half_diff(int index, ::google::protobuf::uint32 value) { + half_diff_.Set(index, value); + // @@protoc_insertion_point(field_set:ditcaffe.BlobProto.half_diff) +} +inline void BlobProto::add_half_diff(::google::protobuf::uint32 value) { + half_diff_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.BlobProto.half_diff) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +BlobProto::half_diff() const { + // @@protoc_insertion_point(field_list:ditcaffe.BlobProto.half_diff) + return half_diff_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +BlobProto::mutable_half_diff() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.BlobProto.half_diff) + return &half_diff_; +} + +// optional int32 num = 1 [default = 0]; +inline bool BlobProto::has_num() const { + return (_has_bits_[0] & 0x00000080u) != 0; +} +inline void BlobProto::set_has_num() { + _has_bits_[0] |= 0x00000080u; +} +inline void BlobProto::clear_has_num() { + _has_bits_[0] &= ~0x00000080u; +} +inline void BlobProto::clear_num() { + num_ = 0; + clear_has_num(); +} +inline ::google::protobuf::int32 BlobProto::num() const { + // @@protoc_insertion_point(field_get:ditcaffe.BlobProto.num) + return num_; +} +inline void BlobProto::set_num(::google::protobuf::int32 value) { + set_has_num(); + num_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.BlobProto.num) +} + +// optional int32 channels = 2 [default = 0]; +inline bool BlobProto::has_channels() const { + return (_has_bits_[0] & 0x00000100u) != 0; +} +inline void BlobProto::set_has_channels() { + _has_bits_[0] |= 0x00000100u; +} +inline void BlobProto::clear_has_channels() { + _has_bits_[0] &= ~0x00000100u; +} +inline void BlobProto::clear_channels() { + channels_ = 0; + clear_has_channels(); +} +inline ::google::protobuf::int32 BlobProto::channels() const { + // @@protoc_insertion_point(field_get:ditcaffe.BlobProto.channels) + return channels_; +} +inline void BlobProto::set_channels(::google::protobuf::int32 value) { + set_has_channels(); + channels_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.BlobProto.channels) +} + +// optional int32 height = 3 [default = 0]; +inline bool BlobProto::has_height() const { + return (_has_bits_[0] & 0x00000200u) != 0; +} +inline void BlobProto::set_has_height() { + _has_bits_[0] |= 0x00000200u; +} +inline void BlobProto::clear_has_height() { + _has_bits_[0] &= ~0x00000200u; +} +inline void BlobProto::clear_height() { + height_ = 0; + clear_has_height(); +} +inline ::google::protobuf::int32 BlobProto::height() const { + // @@protoc_insertion_point(field_get:ditcaffe.BlobProto.height) + return height_; +} +inline void BlobProto::set_height(::google::protobuf::int32 value) { + set_has_height(); + height_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.BlobProto.height) +} + +// optional int32 width = 4 [default = 0]; +inline bool BlobProto::has_width() const { + return (_has_bits_[0] & 0x00000400u) != 0; +} +inline void BlobProto::set_has_width() { + _has_bits_[0] |= 0x00000400u; +} +inline void BlobProto::clear_has_width() { + _has_bits_[0] &= ~0x00000400u; +} +inline void BlobProto::clear_width() { + width_ = 0; + clear_has_width(); +} +inline ::google::protobuf::int32 BlobProto::width() const { + // @@protoc_insertion_point(field_get:ditcaffe.BlobProto.width) + return width_; +} +inline void BlobProto::set_width(::google::protobuf::int32 value) { + set_has_width(); + width_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.BlobProto.width) +} + +// ------------------------------------------------------------------- + +// BlobProtoVector + +// repeated .ditcaffe.BlobProto blobs = 1; +inline int BlobProtoVector::blobs_size() const { + return blobs_.size(); +} +inline void BlobProtoVector::clear_blobs() { + blobs_.Clear(); +} +inline const ::ditcaffe::BlobProto& BlobProtoVector::blobs(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.BlobProtoVector.blobs) + return blobs_.Get(index); +} +inline ::ditcaffe::BlobProto* BlobProtoVector::mutable_blobs(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.BlobProtoVector.blobs) + return blobs_.Mutable(index); +} +inline ::ditcaffe::BlobProto* BlobProtoVector::add_blobs() { + // @@protoc_insertion_point(field_add:ditcaffe.BlobProtoVector.blobs) + return blobs_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >* +BlobProtoVector::mutable_blobs() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.BlobProtoVector.blobs) + return &blobs_; +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >& +BlobProtoVector::blobs() const { + // @@protoc_insertion_point(field_list:ditcaffe.BlobProtoVector.blobs) + return blobs_; +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.Datum.channels) + return channels_; +} +inline void Datum::set_channels(::google::protobuf::int32 value) { + set_has_channels(); + channels_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.Datum.height) + return height_; +} +inline void Datum::set_height(::google::protobuf::int32 value) { + set_has_height(); + height_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.Datum.width) + return width_; +} +inline void Datum::set_width(::google::protobuf::int32 value) { + set_has_width(); + width_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.Datum.data) +} +inline ::std::string* Datum::mutable_data() { + set_has_data(); + // @@protoc_insertion_point(field_mutable:ditcaffe.Datum.data) + return data_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* Datum::release_data() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.Datum.label) + return label_; +} +inline void Datum::set_label(::google::protobuf::int32 value) { + set_has_label(); + label_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.Datum.float_data) +} +inline void Datum::add_float_data(float value) { + float_data_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.Datum.float_data) +} +inline const ::google::protobuf::RepeatedField< float >& +Datum::float_data() const { + // @@protoc_insertion_point(field_list:ditcaffe.Datum.float_data) + return float_data_; +} +inline ::google::protobuf::RepeatedField< float >* +Datum::mutable_float_data() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.Datum.encoded) + return encoded_; +} +inline void Datum::set_encoded(bool value) { + set_has_encoded(); + encoded_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.Datum.encoded) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.FillerParameter.type) +} +inline ::std::string* FillerParameter::mutable_type() { + set_has_type(); + // @@protoc_insertion_point(field_mutable:ditcaffe.FillerParameter.type) + return type_.MutableNoArena(_default_type_); +} +inline ::std::string* FillerParameter::release_type() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.FillerParameter.value) + return value_; +} +inline void FillerParameter::set_value(float value) { + set_has_value(); + value_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.FillerParameter.min) + return min_; +} +inline void FillerParameter::set_min(float value) { + set_has_min(); + min_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.FillerParameter.max) + return max_; +} +inline void FillerParameter::set_max(float value) { + set_has_max(); + max_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.FillerParameter.mean) + return mean_; +} +inline void FillerParameter::set_mean(float value) { + set_has_mean(); + mean_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.FillerParameter.std) + return std_; +} +inline void FillerParameter::set_std(float value) { + set_has_std(); + std_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.FillerParameter.sparse) + return sparse_; +} +inline void FillerParameter::set_sparse(::google::protobuf::int32 value) { + set_has_sparse(); + sparse_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.FillerParameter.sparse) +} + +// optional .ditcaffe.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 ::ditcaffe::FillerParameter_VarianceNorm FillerParameter::variance_norm() const { + // @@protoc_insertion_point(field_get:ditcaffe.FillerParameter.variance_norm) + return static_cast< ::ditcaffe::FillerParameter_VarianceNorm >(variance_norm_); +} +inline void FillerParameter::set_variance_norm(::ditcaffe::FillerParameter_VarianceNorm value) { + assert(::ditcaffe::FillerParameter_VarianceNorm_IsValid(value)); + set_has_variance_norm(); + variance_norm_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.FillerParameter.variance_norm) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.NetParameter.name) +} +inline ::std::string* NetParameter::mutable_name() { + set_has_name(); + // @@protoc_insertion_point(field_mutable:ditcaffe.NetParameter.name) + return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* NetParameter::release_name() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.NetParameter.input) + return input_.Get(index); +} +inline ::std::string* NetParameter::mutable_input(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.NetParameter.input) + return input_.Mutable(index); +} +inline void NetParameter::set_input(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.NetParameter.input) +} +inline ::std::string* NetParameter::add_input() { + // @@protoc_insertion_point(field_add_mutable:ditcaffe.NetParameter.input) + return input_.Add(); +} +inline void NetParameter::add_input(const ::std::string& value) { + input_.Add()->assign(value); + // @@protoc_insertion_point(field_add:ditcaffe.NetParameter.input) +} +inline void NetParameter::add_input(const char* value) { + input_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:ditcaffe.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:ditcaffe.NetParameter.input) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +NetParameter::input() const { + // @@protoc_insertion_point(field_list:ditcaffe.NetParameter.input) + return input_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +NetParameter::mutable_input() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.NetParameter.input) + return &input_; +} + +// repeated .ditcaffe.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 ::ditcaffe::BlobShape& NetParameter::input_shape(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.NetParameter.input_shape) + return input_shape_.Get(index); +} +inline ::ditcaffe::BlobShape* NetParameter::mutable_input_shape(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.NetParameter.input_shape) + return input_shape_.Mutable(index); +} +inline ::ditcaffe::BlobShape* NetParameter::add_input_shape() { + // @@protoc_insertion_point(field_add:ditcaffe.NetParameter.input_shape) + return input_shape_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobShape >* +NetParameter::mutable_input_shape() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.NetParameter.input_shape) + return &input_shape_; +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobShape >& +NetParameter::input_shape() const { + // @@protoc_insertion_point(field_list:ditcaffe.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:ditcaffe.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:ditcaffe.NetParameter.input_dim) +} +inline void NetParameter::add_input_dim(::google::protobuf::int32 value) { + input_dim_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.NetParameter.input_dim) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +NetParameter::input_dim() const { + // @@protoc_insertion_point(field_list:ditcaffe.NetParameter.input_dim) + return input_dim_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +NetParameter::mutable_input_dim() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.NetParameter.force_backward) +} + +// optional .ditcaffe.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_->::ditcaffe::NetState::Clear(); + clear_has_state(); +} +inline const ::ditcaffe::NetState& NetParameter::state() const { + // @@protoc_insertion_point(field_get:ditcaffe.NetParameter.state) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return state_ != NULL ? *state_ : *default_instance().state_; +#else + return state_ != NULL ? *state_ : *default_instance_->state_; +#endif +} +inline ::ditcaffe::NetState* NetParameter::mutable_state() { + set_has_state(); + if (state_ == NULL) { + state_ = new ::ditcaffe::NetState; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.NetParameter.state) + return state_; +} +inline ::ditcaffe::NetState* NetParameter::release_state() { + // @@protoc_insertion_point(field_release:ditcaffe.NetParameter.state) + clear_has_state(); + ::ditcaffe::NetState* temp = state_; + state_ = NULL; + return temp; +} +inline void NetParameter::set_allocated_state(::ditcaffe::NetState* state) { + delete state_; + state_ = state; + if (state) { + set_has_state(); + } else { + clear_has_state(); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.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:ditcaffe.NetParameter.debug_info) +} + +// repeated .ditcaffe.LayerParameter layer = 100; +inline int NetParameter::layer_size() const { + return layer_.size(); +} +inline void NetParameter::clear_layer() { + layer_.Clear(); +} +inline const ::ditcaffe::LayerParameter& NetParameter::layer(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.NetParameter.layer) + return layer_.Get(index); +} +inline ::ditcaffe::LayerParameter* NetParameter::mutable_layer(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.NetParameter.layer) + return layer_.Mutable(index); +} +inline ::ditcaffe::LayerParameter* NetParameter::add_layer() { + // @@protoc_insertion_point(field_add:ditcaffe.NetParameter.layer) + return layer_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::LayerParameter >* +NetParameter::mutable_layer() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.NetParameter.layer) + return &layer_; +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::LayerParameter >& +NetParameter::layer() const { + // @@protoc_insertion_point(field_list:ditcaffe.NetParameter.layer) + return layer_; +} + +// repeated .ditcaffe.V1LayerParameter layers = 2; +inline int NetParameter::layers_size() const { + return layers_.size(); +} +inline void NetParameter::clear_layers() { + layers_.Clear(); +} +inline const ::ditcaffe::V1LayerParameter& NetParameter::layers(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.NetParameter.layers) + return layers_.Get(index); +} +inline ::ditcaffe::V1LayerParameter* NetParameter::mutable_layers(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.NetParameter.layers) + return layers_.Mutable(index); +} +inline ::ditcaffe::V1LayerParameter* NetParameter::add_layers() { + // @@protoc_insertion_point(field_add:ditcaffe.NetParameter.layers) + return layers_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::V1LayerParameter >* +NetParameter::mutable_layers() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.NetParameter.layers) + return &layers_; +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::V1LayerParameter >& +NetParameter::layers() const { + // @@protoc_insertion_point(field_list:ditcaffe.NetParameter.layers) + return layers_; +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.net) +} +inline ::std::string* SolverParameter::mutable_net() { + set_has_net(); + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.net) + return net_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* SolverParameter::release_net() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.SolverParameter.net) +} + +// optional .ditcaffe.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_->::ditcaffe::NetParameter::Clear(); + clear_has_net_param(); +} +inline const ::ditcaffe::NetParameter& SolverParameter::net_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverParameter.net_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return net_param_ != NULL ? *net_param_ : *default_instance().net_param_; +#else + return net_param_ != NULL ? *net_param_ : *default_instance_->net_param_; +#endif +} +inline ::ditcaffe::NetParameter* SolverParameter::mutable_net_param() { + set_has_net_param(); + if (net_param_ == NULL) { + net_param_ = new ::ditcaffe::NetParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.net_param) + return net_param_; +} +inline ::ditcaffe::NetParameter* SolverParameter::release_net_param() { + // @@protoc_insertion_point(field_release:ditcaffe.SolverParameter.net_param) + clear_has_net_param(); + ::ditcaffe::NetParameter* temp = net_param_; + net_param_ = NULL; + return temp; +} +inline void SolverParameter::set_allocated_net_param(::ditcaffe::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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.train_net) +} +inline ::std::string* SolverParameter::mutable_train_net() { + set_has_train_net(); + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.train_net) + return train_net_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* SolverParameter::release_train_net() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.test_net) + return test_net_.Get(index); +} +inline ::std::string* SolverParameter::mutable_test_net(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.test_net) +} +inline ::std::string* SolverParameter::add_test_net() { + // @@protoc_insertion_point(field_add_mutable:ditcaffe.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:ditcaffe.SolverParameter.test_net) +} +inline void SolverParameter::add_test_net(const char* value) { + test_net_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:ditcaffe.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:ditcaffe.SolverParameter.test_net) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +SolverParameter::test_net() const { + // @@protoc_insertion_point(field_list:ditcaffe.SolverParameter.test_net) + return test_net_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +SolverParameter::mutable_test_net() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.SolverParameter.test_net) + return &test_net_; +} + +// optional .ditcaffe.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_->::ditcaffe::NetParameter::Clear(); + clear_has_train_net_param(); +} +inline const ::ditcaffe::NetParameter& SolverParameter::train_net_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverParameter.train_net_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return train_net_param_ != NULL ? *train_net_param_ : *default_instance().train_net_param_; +#else + return train_net_param_ != NULL ? *train_net_param_ : *default_instance_->train_net_param_; +#endif +} +inline ::ditcaffe::NetParameter* SolverParameter::mutable_train_net_param() { + set_has_train_net_param(); + if (train_net_param_ == NULL) { + train_net_param_ = new ::ditcaffe::NetParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.train_net_param) + return train_net_param_; +} +inline ::ditcaffe::NetParameter* SolverParameter::release_train_net_param() { + // @@protoc_insertion_point(field_release:ditcaffe.SolverParameter.train_net_param) + clear_has_train_net_param(); + ::ditcaffe::NetParameter* temp = train_net_param_; + train_net_param_ = NULL; + return temp; +} +inline void SolverParameter::set_allocated_train_net_param(::ditcaffe::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:ditcaffe.SolverParameter.train_net_param) +} + +// repeated .ditcaffe.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 ::ditcaffe::NetParameter& SolverParameter::test_net_param(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverParameter.test_net_param) + return test_net_param_.Get(index); +} +inline ::ditcaffe::NetParameter* SolverParameter::mutable_test_net_param(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.test_net_param) + return test_net_param_.Mutable(index); +} +inline ::ditcaffe::NetParameter* SolverParameter::add_test_net_param() { + // @@protoc_insertion_point(field_add:ditcaffe.SolverParameter.test_net_param) + return test_net_param_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetParameter >* +SolverParameter::mutable_test_net_param() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.SolverParameter.test_net_param) + return &test_net_param_; +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetParameter >& +SolverParameter::test_net_param() const { + // @@protoc_insertion_point(field_list:ditcaffe.SolverParameter.test_net_param) + return test_net_param_; +} + +// optional .ditcaffe.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_->::ditcaffe::NetState::Clear(); + clear_has_train_state(); +} +inline const ::ditcaffe::NetState& SolverParameter::train_state() const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverParameter.train_state) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return train_state_ != NULL ? *train_state_ : *default_instance().train_state_; +#else + return train_state_ != NULL ? *train_state_ : *default_instance_->train_state_; +#endif +} +inline ::ditcaffe::NetState* SolverParameter::mutable_train_state() { + set_has_train_state(); + if (train_state_ == NULL) { + train_state_ = new ::ditcaffe::NetState; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.train_state) + return train_state_; +} +inline ::ditcaffe::NetState* SolverParameter::release_train_state() { + // @@protoc_insertion_point(field_release:ditcaffe.SolverParameter.train_state) + clear_has_train_state(); + ::ditcaffe::NetState* temp = train_state_; + train_state_ = NULL; + return temp; +} +inline void SolverParameter::set_allocated_train_state(::ditcaffe::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:ditcaffe.SolverParameter.train_state) +} + +// repeated .ditcaffe.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 ::ditcaffe::NetState& SolverParameter::test_state(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverParameter.test_state) + return test_state_.Get(index); +} +inline ::ditcaffe::NetState* SolverParameter::mutable_test_state(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.test_state) + return test_state_.Mutable(index); +} +inline ::ditcaffe::NetState* SolverParameter::add_test_state() { + // @@protoc_insertion_point(field_add:ditcaffe.SolverParameter.test_state) + return test_state_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetState >* +SolverParameter::mutable_test_state() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.SolverParameter.test_state) + return &test_state_; +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetState >& +SolverParameter::test_state() const { + // @@protoc_insertion_point(field_list:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.test_iter) +} +inline void SolverParameter::add_test_iter(::google::protobuf::int32 value) { + test_iter_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.SolverParameter.test_iter) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +SolverParameter::test_iter() const { + // @@protoc_insertion_point(field_list:ditcaffe.SolverParameter.test_iter) + return test_iter_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +SolverParameter::mutable_test_iter() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.display) + return display_; +} +inline void SolverParameter::set_display(::google::protobuf::int32 value) { + set_has_display(); + display_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.lr_policy) +} +inline ::std::string* SolverParameter::mutable_lr_policy() { + set_has_lr_policy(); + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.lr_policy) + return lr_policy_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* SolverParameter::release_lr_policy() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.gamma) + return gamma_; +} +inline void SolverParameter::set_gamma(float value) { + set_has_gamma(); + gamma_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.SolverParameter.power) + return power_; +} +inline void SolverParameter::set_power(float value) { + set_has_power(); + power_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.SolverParameter.momentum) + return momentum_; +} +inline void SolverParameter::set_momentum(float value) { + set_has_momentum(); + momentum_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.regularization_type) +} +inline ::std::string* SolverParameter::mutable_regularization_type() { + set_has_regularization_type(); + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.regularization_type) + return regularization_type_.MutableNoArena(_default_regularization_type_); +} +inline ::std::string* SolverParameter::release_regularization_type() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.stepsize) + return stepsize_; +} +inline void SolverParameter::set_stepsize(::google::protobuf::int32 value) { + set_has_stepsize(); + stepsize_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.stepvalue) +} +inline void SolverParameter::add_stepvalue(::google::protobuf::int32 value) { + stepvalue_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.SolverParameter.stepvalue) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +SolverParameter::stepvalue() const { + // @@protoc_insertion_point(field_list:ditcaffe.SolverParameter.stepvalue) + return stepvalue_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +SolverParameter::mutable_stepvalue() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.snapshot) + return snapshot_; +} +inline void SolverParameter::set_snapshot(::google::protobuf::int32 value) { + set_has_snapshot(); + snapshot_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.snapshot_prefix) +} +inline ::std::string* SolverParameter::mutable_snapshot_prefix() { + set_has_snapshot_prefix(); + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.snapshot_prefix) + return snapshot_prefix_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* SolverParameter::release_snapshot_prefix() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.snapshot_diff) +} + +// optional .ditcaffe.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 ::ditcaffe::SolverParameter_SnapshotFormat SolverParameter::snapshot_format() const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverParameter.snapshot_format) + return static_cast< ::ditcaffe::SolverParameter_SnapshotFormat >(snapshot_format_); +} +inline void SolverParameter::set_snapshot_format(::ditcaffe::SolverParameter_SnapshotFormat value) { + assert(::ditcaffe::SolverParameter_SnapshotFormat_IsValid(value)); + set_has_snapshot_format(); + snapshot_format_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.SolverParameter.snapshot_format) +} + +// optional .ditcaffe.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 ::ditcaffe::SolverParameter_SolverMode SolverParameter::solver_mode() const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverParameter.solver_mode) + return static_cast< ::ditcaffe::SolverParameter_SolverMode >(solver_mode_); +} +inline void SolverParameter::set_solver_mode(::ditcaffe::SolverParameter_SolverMode value) { + assert(::ditcaffe::SolverParameter_SolverMode_IsValid(value)); + set_has_solver_mode(); + solver_mode_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.type) +} +inline ::std::string* SolverParameter::mutable_type() { + set_has_type(); + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverParameter.type) + return type_.MutableNoArena(_default_type_); +} +inline ::std::string* SolverParameter::release_type() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.delta) + return delta_; +} +inline void SolverParameter::set_delta(float value) { + set_has_delta(); + delta_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.SolverParameter.momentum2) + return momentum2_; +} +inline void SolverParameter::set_momentum2(float value) { + set_has_momentum2(); + momentum2_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.SolverParameter.momentum2) +} + +// optional float rms_decay = 38; +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; + clear_has_rms_decay(); +} +inline float SolverParameter::rms_decay() const { + // @@protoc_insertion_point(field_get:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.SolverParameter.snapshot_after_train) +} + +// optional .ditcaffe.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 ::ditcaffe::SolverParameter_SolverType SolverParameter::solver_type() const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverParameter.solver_type) + return static_cast< ::ditcaffe::SolverParameter_SolverType >(solver_type_); +} +inline void SolverParameter::set_solver_type(::ditcaffe::SolverParameter_SolverType value) { + assert(::ditcaffe::SolverParameter_SolverType_IsValid(value)); + set_has_solver_type(); + solver_type_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.SolverParameter.solver_type) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.SolverState.iter) + return iter_; +} +inline void SolverState::set_iter(::google::protobuf::int32 value) { + set_has_iter(); + iter_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.SolverState.learned_net) +} +inline ::std::string* SolverState::mutable_learned_net() { + set_has_learned_net(); + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverState.learned_net) + return learned_net_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* SolverState::release_learned_net() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.SolverState.learned_net) +} + +// repeated .ditcaffe.BlobProto history = 3; +inline int SolverState::history_size() const { + return history_.size(); +} +inline void SolverState::clear_history() { + history_.Clear(); +} +inline const ::ditcaffe::BlobProto& SolverState::history(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.SolverState.history) + return history_.Get(index); +} +inline ::ditcaffe::BlobProto* SolverState::mutable_history(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.SolverState.history) + return history_.Mutable(index); +} +inline ::ditcaffe::BlobProto* SolverState::add_history() { + // @@protoc_insertion_point(field_add:ditcaffe.SolverState.history) + return history_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >* +SolverState::mutable_history() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.SolverState.history) + return &history_; +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >& +SolverState::history() const { + // @@protoc_insertion_point(field_list:ditcaffe.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:ditcaffe.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:ditcaffe.SolverState.current_step) +} + +// ------------------------------------------------------------------- + +// NetState + +// optional .ditcaffe.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 ::ditcaffe::Phase NetState::phase() const { + // @@protoc_insertion_point(field_get:ditcaffe.NetState.phase) + return static_cast< ::ditcaffe::Phase >(phase_); +} +inline void NetState::set_phase(::ditcaffe::Phase value) { + assert(::ditcaffe::Phase_IsValid(value)); + set_has_phase(); + phase_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.NetState.level) + return level_; +} +inline void NetState::set_level(::google::protobuf::int32 value) { + set_has_level(); + level_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.NetState.stage) + return stage_.Get(index); +} +inline ::std::string* NetState::mutable_stage(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.NetState.stage) + return stage_.Mutable(index); +} +inline void NetState::set_stage(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.NetState.stage) +} +inline ::std::string* NetState::add_stage() { + // @@protoc_insertion_point(field_add_mutable:ditcaffe.NetState.stage) + return stage_.Add(); +} +inline void NetState::add_stage(const ::std::string& value) { + stage_.Add()->assign(value); + // @@protoc_insertion_point(field_add:ditcaffe.NetState.stage) +} +inline void NetState::add_stage(const char* value) { + stage_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:ditcaffe.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:ditcaffe.NetState.stage) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +NetState::stage() const { + // @@protoc_insertion_point(field_list:ditcaffe.NetState.stage) + return stage_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +NetState::mutable_stage() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.NetState.stage) + return &stage_; +} + +// ------------------------------------------------------------------- + +// NetStateRule + +// optional .ditcaffe.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 ::ditcaffe::Phase NetStateRule::phase() const { + // @@protoc_insertion_point(field_get:ditcaffe.NetStateRule.phase) + return static_cast< ::ditcaffe::Phase >(phase_); +} +inline void NetStateRule::set_phase(::ditcaffe::Phase value) { + assert(::ditcaffe::Phase_IsValid(value)); + set_has_phase(); + phase_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.NetStateRule.stage) + return stage_.Get(index); +} +inline ::std::string* NetStateRule::mutable_stage(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.NetStateRule.stage) + return stage_.Mutable(index); +} +inline void NetStateRule::set_stage(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.NetStateRule.stage) +} +inline ::std::string* NetStateRule::add_stage() { + // @@protoc_insertion_point(field_add_mutable:ditcaffe.NetStateRule.stage) + return stage_.Add(); +} +inline void NetStateRule::add_stage(const ::std::string& value) { + stage_.Add()->assign(value); + // @@protoc_insertion_point(field_add:ditcaffe.NetStateRule.stage) +} +inline void NetStateRule::add_stage(const char* value) { + stage_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:ditcaffe.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:ditcaffe.NetStateRule.stage) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +NetStateRule::stage() const { + // @@protoc_insertion_point(field_list:ditcaffe.NetStateRule.stage) + return stage_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +NetStateRule::mutable_stage() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.NetStateRule.not_stage) + return not_stage_.Get(index); +} +inline ::std::string* NetStateRule::mutable_not_stage(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.NetStateRule.not_stage) +} +inline ::std::string* NetStateRule::add_not_stage() { + // @@protoc_insertion_point(field_add_mutable:ditcaffe.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:ditcaffe.NetStateRule.not_stage) +} +inline void NetStateRule::add_not_stage(const char* value) { + not_stage_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:ditcaffe.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:ditcaffe.NetStateRule.not_stage) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +NetStateRule::not_stage() const { + // @@protoc_insertion_point(field_list:ditcaffe.NetStateRule.not_stage) + return not_stage_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +NetStateRule::mutable_not_stage() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.NetStateRule.not_stage) + return ¬_stage_; +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.ParamSpec.name) +} +inline ::std::string* ParamSpec::mutable_name() { + set_has_name(); + // @@protoc_insertion_point(field_mutable:ditcaffe.ParamSpec.name) + return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* ParamSpec::release_name() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.ParamSpec.name) +} + +// optional .ditcaffe.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 ::ditcaffe::ParamSpec_DimCheckMode ParamSpec::share_mode() const { + // @@protoc_insertion_point(field_get:ditcaffe.ParamSpec.share_mode) + return static_cast< ::ditcaffe::ParamSpec_DimCheckMode >(share_mode_); +} +inline void ParamSpec::set_share_mode(::ditcaffe::ParamSpec_DimCheckMode value) { + assert(::ditcaffe::ParamSpec_DimCheckMode_IsValid(value)); + set_has_share_mode(); + share_mode_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.ParamSpec.decay_mult) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.LayerParameter.name) +} +inline ::std::string* LayerParameter::mutable_name() { + set_has_name(); + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.name) + return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* LayerParameter::release_name() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.LayerParameter.type) +} +inline ::std::string* LayerParameter::mutable_type() { + set_has_type(); + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.type) + return type_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* LayerParameter::release_type() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.LayerParameter.bottom) + return bottom_.Get(index); +} +inline ::std::string* LayerParameter::mutable_bottom(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.bottom) + return bottom_.Mutable(index); +} +inline void LayerParameter::set_bottom(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.LayerParameter.bottom) +} +inline ::std::string* LayerParameter::add_bottom() { + // @@protoc_insertion_point(field_add_mutable:ditcaffe.LayerParameter.bottom) + return bottom_.Add(); +} +inline void LayerParameter::add_bottom(const ::std::string& value) { + bottom_.Add()->assign(value); + // @@protoc_insertion_point(field_add:ditcaffe.LayerParameter.bottom) +} +inline void LayerParameter::add_bottom(const char* value) { + bottom_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:ditcaffe.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:ditcaffe.LayerParameter.bottom) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +LayerParameter::bottom() const { + // @@protoc_insertion_point(field_list:ditcaffe.LayerParameter.bottom) + return bottom_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +LayerParameter::mutable_bottom() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.LayerParameter.top) + return top_.Get(index); +} +inline ::std::string* LayerParameter::mutable_top(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.top) + return top_.Mutable(index); +} +inline void LayerParameter::set_top(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.LayerParameter.top) +} +inline ::std::string* LayerParameter::add_top() { + // @@protoc_insertion_point(field_add_mutable:ditcaffe.LayerParameter.top) + return top_.Add(); +} +inline void LayerParameter::add_top(const ::std::string& value) { + top_.Add()->assign(value); + // @@protoc_insertion_point(field_add:ditcaffe.LayerParameter.top) +} +inline void LayerParameter::add_top(const char* value) { + top_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:ditcaffe.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:ditcaffe.LayerParameter.top) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +LayerParameter::top() const { + // @@protoc_insertion_point(field_list:ditcaffe.LayerParameter.top) + return top_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +LayerParameter::mutable_top() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.LayerParameter.top) + return &top_; +} + +// optional .ditcaffe.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 ::ditcaffe::Phase LayerParameter::phase() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.phase) + return static_cast< ::ditcaffe::Phase >(phase_); +} +inline void LayerParameter::set_phase(::ditcaffe::Phase value) { + assert(::ditcaffe::Phase_IsValid(value)); + set_has_phase(); + phase_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.LayerParameter.loss_weight) +} +inline void LayerParameter::add_loss_weight(float value) { + loss_weight_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.LayerParameter.loss_weight) +} +inline const ::google::protobuf::RepeatedField< float >& +LayerParameter::loss_weight() const { + // @@protoc_insertion_point(field_list:ditcaffe.LayerParameter.loss_weight) + return loss_weight_; +} +inline ::google::protobuf::RepeatedField< float >* +LayerParameter::mutable_loss_weight() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.LayerParameter.loss_weight) + return &loss_weight_; +} + +// repeated .ditcaffe.ParamSpec param = 6; +inline int LayerParameter::param_size() const { + return param_.size(); +} +inline void LayerParameter::clear_param() { + param_.Clear(); +} +inline const ::ditcaffe::ParamSpec& LayerParameter::param(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.param) + return param_.Get(index); +} +inline ::ditcaffe::ParamSpec* LayerParameter::mutable_param(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.param) + return param_.Mutable(index); +} +inline ::ditcaffe::ParamSpec* LayerParameter::add_param() { + // @@protoc_insertion_point(field_add:ditcaffe.LayerParameter.param) + return param_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::ParamSpec >* +LayerParameter::mutable_param() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.LayerParameter.param) + return ¶m_; +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::ParamSpec >& +LayerParameter::param() const { + // @@protoc_insertion_point(field_list:ditcaffe.LayerParameter.param) + return param_; +} + +// repeated .ditcaffe.BlobProto blobs = 7; +inline int LayerParameter::blobs_size() const { + return blobs_.size(); +} +inline void LayerParameter::clear_blobs() { + blobs_.Clear(); +} +inline const ::ditcaffe::BlobProto& LayerParameter::blobs(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.blobs) + return blobs_.Get(index); +} +inline ::ditcaffe::BlobProto* LayerParameter::mutable_blobs(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.blobs) + return blobs_.Mutable(index); +} +inline ::ditcaffe::BlobProto* LayerParameter::add_blobs() { + // @@protoc_insertion_point(field_add:ditcaffe.LayerParameter.blobs) + return blobs_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >* +LayerParameter::mutable_blobs() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.LayerParameter.blobs) + return &blobs_; +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >& +LayerParameter::blobs() const { + // @@protoc_insertion_point(field_list:ditcaffe.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:ditcaffe.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:ditcaffe.LayerParameter.propagate_down) +} +inline void LayerParameter::add_propagate_down(bool value) { + propagate_down_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.LayerParameter.propagate_down) +} +inline const ::google::protobuf::RepeatedField< bool >& +LayerParameter::propagate_down() const { + // @@protoc_insertion_point(field_list:ditcaffe.LayerParameter.propagate_down) + return propagate_down_; +} +inline ::google::protobuf::RepeatedField< bool >* +LayerParameter::mutable_propagate_down() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.LayerParameter.propagate_down) + return &propagate_down_; +} + +// repeated .ditcaffe.NetStateRule include = 8; +inline int LayerParameter::include_size() const { + return include_.size(); +} +inline void LayerParameter::clear_include() { + include_.Clear(); +} +inline const ::ditcaffe::NetStateRule& LayerParameter::include(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.include) + return include_.Get(index); +} +inline ::ditcaffe::NetStateRule* LayerParameter::mutable_include(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.include) + return include_.Mutable(index); +} +inline ::ditcaffe::NetStateRule* LayerParameter::add_include() { + // @@protoc_insertion_point(field_add:ditcaffe.LayerParameter.include) + return include_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >* +LayerParameter::mutable_include() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.LayerParameter.include) + return &include_; +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >& +LayerParameter::include() const { + // @@protoc_insertion_point(field_list:ditcaffe.LayerParameter.include) + return include_; +} + +// repeated .ditcaffe.NetStateRule exclude = 9; +inline int LayerParameter::exclude_size() const { + return exclude_.size(); +} +inline void LayerParameter::clear_exclude() { + exclude_.Clear(); +} +inline const ::ditcaffe::NetStateRule& LayerParameter::exclude(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.exclude) + return exclude_.Get(index); +} +inline ::ditcaffe::NetStateRule* LayerParameter::mutable_exclude(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.exclude) + return exclude_.Mutable(index); +} +inline ::ditcaffe::NetStateRule* LayerParameter::add_exclude() { + // @@protoc_insertion_point(field_add:ditcaffe.LayerParameter.exclude) + return exclude_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >* +LayerParameter::mutable_exclude() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.LayerParameter.exclude) + return &exclude_; +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >& +LayerParameter::exclude() const { + // @@protoc_insertion_point(field_list:ditcaffe.LayerParameter.exclude) + return exclude_; +} + +// optional .ditcaffe.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_->::ditcaffe::TransformationParameter::Clear(); + clear_has_transform_param(); +} +inline const ::ditcaffe::TransformationParameter& LayerParameter::transform_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.transform_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return transform_param_ != NULL ? *transform_param_ : *default_instance().transform_param_; +#else + return transform_param_ != NULL ? *transform_param_ : *default_instance_->transform_param_; +#endif +} +inline ::ditcaffe::TransformationParameter* LayerParameter::mutable_transform_param() { + set_has_transform_param(); + if (transform_param_ == NULL) { + transform_param_ = new ::ditcaffe::TransformationParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.transform_param) + return transform_param_; +} +inline ::ditcaffe::TransformationParameter* LayerParameter::release_transform_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.transform_param) + clear_has_transform_param(); + ::ditcaffe::TransformationParameter* temp = transform_param_; + transform_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_transform_param(::ditcaffe::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:ditcaffe.LayerParameter.transform_param) +} + +// optional .ditcaffe.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_->::ditcaffe::LossParameter::Clear(); + clear_has_loss_param(); +} +inline const ::ditcaffe::LossParameter& LayerParameter::loss_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.loss_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return loss_param_ != NULL ? *loss_param_ : *default_instance().loss_param_; +#else + return loss_param_ != NULL ? *loss_param_ : *default_instance_->loss_param_; +#endif +} +inline ::ditcaffe::LossParameter* LayerParameter::mutable_loss_param() { + set_has_loss_param(); + if (loss_param_ == NULL) { + loss_param_ = new ::ditcaffe::LossParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.loss_param) + return loss_param_; +} +inline ::ditcaffe::LossParameter* LayerParameter::release_loss_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.loss_param) + clear_has_loss_param(); + ::ditcaffe::LossParameter* temp = loss_param_; + loss_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_loss_param(::ditcaffe::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:ditcaffe.LayerParameter.loss_param) +} + +// optional .ditcaffe.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_->::ditcaffe::AccuracyParameter::Clear(); + clear_has_accuracy_param(); +} +inline const ::ditcaffe::AccuracyParameter& LayerParameter::accuracy_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.accuracy_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return accuracy_param_ != NULL ? *accuracy_param_ : *default_instance().accuracy_param_; +#else + return accuracy_param_ != NULL ? *accuracy_param_ : *default_instance_->accuracy_param_; +#endif +} +inline ::ditcaffe::AccuracyParameter* LayerParameter::mutable_accuracy_param() { + set_has_accuracy_param(); + if (accuracy_param_ == NULL) { + accuracy_param_ = new ::ditcaffe::AccuracyParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.accuracy_param) + return accuracy_param_; +} +inline ::ditcaffe::AccuracyParameter* LayerParameter::release_accuracy_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.accuracy_param) + clear_has_accuracy_param(); + ::ditcaffe::AccuracyParameter* temp = accuracy_param_; + accuracy_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_accuracy_param(::ditcaffe::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:ditcaffe.LayerParameter.accuracy_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ArgMaxParameter::Clear(); + clear_has_argmax_param(); +} +inline const ::ditcaffe::ArgMaxParameter& LayerParameter::argmax_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.argmax_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return argmax_param_ != NULL ? *argmax_param_ : *default_instance().argmax_param_; +#else + return argmax_param_ != NULL ? *argmax_param_ : *default_instance_->argmax_param_; +#endif +} +inline ::ditcaffe::ArgMaxParameter* LayerParameter::mutable_argmax_param() { + set_has_argmax_param(); + if (argmax_param_ == NULL) { + argmax_param_ = new ::ditcaffe::ArgMaxParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.argmax_param) + return argmax_param_; +} +inline ::ditcaffe::ArgMaxParameter* LayerParameter::release_argmax_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.argmax_param) + clear_has_argmax_param(); + ::ditcaffe::ArgMaxParameter* temp = argmax_param_; + argmax_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_argmax_param(::ditcaffe::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:ditcaffe.LayerParameter.argmax_param) +} + +// optional .ditcaffe.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_->::ditcaffe::BatchNormParameter::Clear(); + clear_has_batch_norm_param(); +} +inline const ::ditcaffe::BatchNormParameter& LayerParameter::batch_norm_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.batch_norm_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return batch_norm_param_ != NULL ? *batch_norm_param_ : *default_instance().batch_norm_param_; +#else + return batch_norm_param_ != NULL ? *batch_norm_param_ : *default_instance_->batch_norm_param_; +#endif +} +inline ::ditcaffe::BatchNormParameter* LayerParameter::mutable_batch_norm_param() { + set_has_batch_norm_param(); + if (batch_norm_param_ == NULL) { + batch_norm_param_ = new ::ditcaffe::BatchNormParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.batch_norm_param) + return batch_norm_param_; +} +inline ::ditcaffe::BatchNormParameter* LayerParameter::release_batch_norm_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.batch_norm_param) + clear_has_batch_norm_param(); + ::ditcaffe::BatchNormParameter* temp = batch_norm_param_; + batch_norm_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_batch_norm_param(::ditcaffe::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:ditcaffe.LayerParameter.batch_norm_param) +} + +// optional .ditcaffe.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_->::ditcaffe::BiasParameter::Clear(); + clear_has_bias_param(); +} +inline const ::ditcaffe::BiasParameter& LayerParameter::bias_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.bias_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return bias_param_ != NULL ? *bias_param_ : *default_instance().bias_param_; +#else + return bias_param_ != NULL ? *bias_param_ : *default_instance_->bias_param_; +#endif +} +inline ::ditcaffe::BiasParameter* LayerParameter::mutable_bias_param() { + set_has_bias_param(); + if (bias_param_ == NULL) { + bias_param_ = new ::ditcaffe::BiasParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.bias_param) + return bias_param_; +} +inline ::ditcaffe::BiasParameter* LayerParameter::release_bias_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.bias_param) + clear_has_bias_param(); + ::ditcaffe::BiasParameter* temp = bias_param_; + bias_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_bias_param(::ditcaffe::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:ditcaffe.LayerParameter.bias_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ConcatParameter::Clear(); + clear_has_concat_param(); +} +inline const ::ditcaffe::ConcatParameter& LayerParameter::concat_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.concat_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return concat_param_ != NULL ? *concat_param_ : *default_instance().concat_param_; +#else + return concat_param_ != NULL ? *concat_param_ : *default_instance_->concat_param_; +#endif +} +inline ::ditcaffe::ConcatParameter* LayerParameter::mutable_concat_param() { + set_has_concat_param(); + if (concat_param_ == NULL) { + concat_param_ = new ::ditcaffe::ConcatParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.concat_param) + return concat_param_; +} +inline ::ditcaffe::ConcatParameter* LayerParameter::release_concat_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.concat_param) + clear_has_concat_param(); + ::ditcaffe::ConcatParameter* temp = concat_param_; + concat_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_concat_param(::ditcaffe::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:ditcaffe.LayerParameter.concat_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ContrastiveLossParameter::Clear(); + clear_has_contrastive_loss_param(); +} +inline const ::ditcaffe::ContrastiveLossParameter& LayerParameter::contrastive_loss_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.contrastive_loss_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return contrastive_loss_param_ != NULL ? *contrastive_loss_param_ : *default_instance().contrastive_loss_param_; +#else + return contrastive_loss_param_ != NULL ? *contrastive_loss_param_ : *default_instance_->contrastive_loss_param_; +#endif +} +inline ::ditcaffe::ContrastiveLossParameter* LayerParameter::mutable_contrastive_loss_param() { + set_has_contrastive_loss_param(); + if (contrastive_loss_param_ == NULL) { + contrastive_loss_param_ = new ::ditcaffe::ContrastiveLossParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.contrastive_loss_param) + return contrastive_loss_param_; +} +inline ::ditcaffe::ContrastiveLossParameter* LayerParameter::release_contrastive_loss_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.contrastive_loss_param) + clear_has_contrastive_loss_param(); + ::ditcaffe::ContrastiveLossParameter* temp = contrastive_loss_param_; + contrastive_loss_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_contrastive_loss_param(::ditcaffe::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:ditcaffe.LayerParameter.contrastive_loss_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ConvolutionParameter::Clear(); + clear_has_convolution_param(); +} +inline const ::ditcaffe::ConvolutionParameter& LayerParameter::convolution_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.convolution_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return convolution_param_ != NULL ? *convolution_param_ : *default_instance().convolution_param_; +#else + return convolution_param_ != NULL ? *convolution_param_ : *default_instance_->convolution_param_; +#endif +} +inline ::ditcaffe::ConvolutionParameter* LayerParameter::mutable_convolution_param() { + set_has_convolution_param(); + if (convolution_param_ == NULL) { + convolution_param_ = new ::ditcaffe::ConvolutionParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.convolution_param) + return convolution_param_; +} +inline ::ditcaffe::ConvolutionParameter* LayerParameter::release_convolution_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.convolution_param) + clear_has_convolution_param(); + ::ditcaffe::ConvolutionParameter* temp = convolution_param_; + convolution_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_convolution_param(::ditcaffe::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:ditcaffe.LayerParameter.convolution_param) +} + +// optional .ditcaffe.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_->::ditcaffe::CropParameter::Clear(); + clear_has_crop_param(); +} +inline const ::ditcaffe::CropParameter& LayerParameter::crop_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.crop_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return crop_param_ != NULL ? *crop_param_ : *default_instance().crop_param_; +#else + return crop_param_ != NULL ? *crop_param_ : *default_instance_->crop_param_; +#endif +} +inline ::ditcaffe::CropParameter* LayerParameter::mutable_crop_param() { + set_has_crop_param(); + if (crop_param_ == NULL) { + crop_param_ = new ::ditcaffe::CropParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.crop_param) + return crop_param_; +} +inline ::ditcaffe::CropParameter* LayerParameter::release_crop_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.crop_param) + clear_has_crop_param(); + ::ditcaffe::CropParameter* temp = crop_param_; + crop_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_crop_param(::ditcaffe::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:ditcaffe.LayerParameter.crop_param) +} + +// optional .ditcaffe.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_->::ditcaffe::DataParameter::Clear(); + clear_has_data_param(); +} +inline const ::ditcaffe::DataParameter& LayerParameter::data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.data_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return data_param_ != NULL ? *data_param_ : *default_instance().data_param_; +#else + return data_param_ != NULL ? *data_param_ : *default_instance_->data_param_; +#endif +} +inline ::ditcaffe::DataParameter* LayerParameter::mutable_data_param() { + set_has_data_param(); + if (data_param_ == NULL) { + data_param_ = new ::ditcaffe::DataParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.data_param) + return data_param_; +} +inline ::ditcaffe::DataParameter* LayerParameter::release_data_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.data_param) + clear_has_data_param(); + ::ditcaffe::DataParameter* temp = data_param_; + data_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_data_param(::ditcaffe::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:ditcaffe.LayerParameter.data_param) +} + +// optional .ditcaffe.DropoutParameter dropout_param = 108; +inline bool LayerParameter::has_dropout_param() const { + return (_has_bits_[0] & 0x00400000u) != 0; +} +inline void LayerParameter::set_has_dropout_param() { + _has_bits_[0] |= 0x00400000u; +} +inline void LayerParameter::clear_has_dropout_param() { + _has_bits_[0] &= ~0x00400000u; +} +inline void LayerParameter::clear_dropout_param() { + if (dropout_param_ != NULL) dropout_param_->::ditcaffe::DropoutParameter::Clear(); + clear_has_dropout_param(); +} +inline const ::ditcaffe::DropoutParameter& LayerParameter::dropout_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.dropout_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return dropout_param_ != NULL ? *dropout_param_ : *default_instance().dropout_param_; +#else + return dropout_param_ != NULL ? *dropout_param_ : *default_instance_->dropout_param_; +#endif +} +inline ::ditcaffe::DropoutParameter* LayerParameter::mutable_dropout_param() { + set_has_dropout_param(); + if (dropout_param_ == NULL) { + dropout_param_ = new ::ditcaffe::DropoutParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.dropout_param) + return dropout_param_; +} +inline ::ditcaffe::DropoutParameter* LayerParameter::release_dropout_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.dropout_param) + clear_has_dropout_param(); + ::ditcaffe::DropoutParameter* temp = dropout_param_; + dropout_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_dropout_param(::ditcaffe::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:ditcaffe.LayerParameter.dropout_param) +} + +// optional .ditcaffe.DummyDataParameter dummy_data_param = 109; +inline bool LayerParameter::has_dummy_data_param() const { + return (_has_bits_[0] & 0x00800000u) != 0; +} +inline void LayerParameter::set_has_dummy_data_param() { + _has_bits_[0] |= 0x00800000u; +} +inline void LayerParameter::clear_has_dummy_data_param() { + _has_bits_[0] &= ~0x00800000u; +} +inline void LayerParameter::clear_dummy_data_param() { + if (dummy_data_param_ != NULL) dummy_data_param_->::ditcaffe::DummyDataParameter::Clear(); + clear_has_dummy_data_param(); +} +inline const ::ditcaffe::DummyDataParameter& LayerParameter::dummy_data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.dummy_data_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return dummy_data_param_ != NULL ? *dummy_data_param_ : *default_instance().dummy_data_param_; +#else + return dummy_data_param_ != NULL ? *dummy_data_param_ : *default_instance_->dummy_data_param_; +#endif +} +inline ::ditcaffe::DummyDataParameter* LayerParameter::mutable_dummy_data_param() { + set_has_dummy_data_param(); + if (dummy_data_param_ == NULL) { + dummy_data_param_ = new ::ditcaffe::DummyDataParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.dummy_data_param) + return dummy_data_param_; +} +inline ::ditcaffe::DummyDataParameter* LayerParameter::release_dummy_data_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.dummy_data_param) + clear_has_dummy_data_param(); + ::ditcaffe::DummyDataParameter* temp = dummy_data_param_; + dummy_data_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_dummy_data_param(::ditcaffe::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:ditcaffe.LayerParameter.dummy_data_param) +} + +// optional .ditcaffe.EltwiseParameter eltwise_param = 110; +inline bool LayerParameter::has_eltwise_param() const { + return (_has_bits_[0] & 0x01000000u) != 0; +} +inline void LayerParameter::set_has_eltwise_param() { + _has_bits_[0] |= 0x01000000u; +} +inline void LayerParameter::clear_has_eltwise_param() { + _has_bits_[0] &= ~0x01000000u; +} +inline void LayerParameter::clear_eltwise_param() { + if (eltwise_param_ != NULL) eltwise_param_->::ditcaffe::EltwiseParameter::Clear(); + clear_has_eltwise_param(); +} +inline const ::ditcaffe::EltwiseParameter& LayerParameter::eltwise_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.eltwise_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return eltwise_param_ != NULL ? *eltwise_param_ : *default_instance().eltwise_param_; +#else + return eltwise_param_ != NULL ? *eltwise_param_ : *default_instance_->eltwise_param_; +#endif +} +inline ::ditcaffe::EltwiseParameter* LayerParameter::mutable_eltwise_param() { + set_has_eltwise_param(); + if (eltwise_param_ == NULL) { + eltwise_param_ = new ::ditcaffe::EltwiseParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.eltwise_param) + return eltwise_param_; +} +inline ::ditcaffe::EltwiseParameter* LayerParameter::release_eltwise_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.eltwise_param) + clear_has_eltwise_param(); + ::ditcaffe::EltwiseParameter* temp = eltwise_param_; + eltwise_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_eltwise_param(::ditcaffe::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:ditcaffe.LayerParameter.eltwise_param) +} + +// optional .ditcaffe.ELUParameter elu_param = 140; +inline bool LayerParameter::has_elu_param() const { + return (_has_bits_[0] & 0x02000000u) != 0; +} +inline void LayerParameter::set_has_elu_param() { + _has_bits_[0] |= 0x02000000u; +} +inline void LayerParameter::clear_has_elu_param() { + _has_bits_[0] &= ~0x02000000u; +} +inline void LayerParameter::clear_elu_param() { + if (elu_param_ != NULL) elu_param_->::ditcaffe::ELUParameter::Clear(); + clear_has_elu_param(); +} +inline const ::ditcaffe::ELUParameter& LayerParameter::elu_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.elu_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return elu_param_ != NULL ? *elu_param_ : *default_instance().elu_param_; +#else + return elu_param_ != NULL ? *elu_param_ : *default_instance_->elu_param_; +#endif +} +inline ::ditcaffe::ELUParameter* LayerParameter::mutable_elu_param() { + set_has_elu_param(); + if (elu_param_ == NULL) { + elu_param_ = new ::ditcaffe::ELUParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.elu_param) + return elu_param_; +} +inline ::ditcaffe::ELUParameter* LayerParameter::release_elu_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.elu_param) + clear_has_elu_param(); + ::ditcaffe::ELUParameter* temp = elu_param_; + elu_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_elu_param(::ditcaffe::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:ditcaffe.LayerParameter.elu_param) +} + +// optional .ditcaffe.EmbedParameter embed_param = 137; +inline bool LayerParameter::has_embed_param() const { + return (_has_bits_[0] & 0x04000000u) != 0; +} +inline void LayerParameter::set_has_embed_param() { + _has_bits_[0] |= 0x04000000u; +} +inline void LayerParameter::clear_has_embed_param() { + _has_bits_[0] &= ~0x04000000u; +} +inline void LayerParameter::clear_embed_param() { + if (embed_param_ != NULL) embed_param_->::ditcaffe::EmbedParameter::Clear(); + clear_has_embed_param(); +} +inline const ::ditcaffe::EmbedParameter& LayerParameter::embed_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.embed_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return embed_param_ != NULL ? *embed_param_ : *default_instance().embed_param_; +#else + return embed_param_ != NULL ? *embed_param_ : *default_instance_->embed_param_; +#endif +} +inline ::ditcaffe::EmbedParameter* LayerParameter::mutable_embed_param() { + set_has_embed_param(); + if (embed_param_ == NULL) { + embed_param_ = new ::ditcaffe::EmbedParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.embed_param) + return embed_param_; +} +inline ::ditcaffe::EmbedParameter* LayerParameter::release_embed_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.embed_param) + clear_has_embed_param(); + ::ditcaffe::EmbedParameter* temp = embed_param_; + embed_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_embed_param(::ditcaffe::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:ditcaffe.LayerParameter.embed_param) +} + +// optional .ditcaffe.ExpParameter exp_param = 111; +inline bool LayerParameter::has_exp_param() const { + return (_has_bits_[0] & 0x08000000u) != 0; +} +inline void LayerParameter::set_has_exp_param() { + _has_bits_[0] |= 0x08000000u; +} +inline void LayerParameter::clear_has_exp_param() { + _has_bits_[0] &= ~0x08000000u; +} +inline void LayerParameter::clear_exp_param() { + if (exp_param_ != NULL) exp_param_->::ditcaffe::ExpParameter::Clear(); + clear_has_exp_param(); +} +inline const ::ditcaffe::ExpParameter& LayerParameter::exp_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.exp_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return exp_param_ != NULL ? *exp_param_ : *default_instance().exp_param_; +#else + return exp_param_ != NULL ? *exp_param_ : *default_instance_->exp_param_; +#endif +} +inline ::ditcaffe::ExpParameter* LayerParameter::mutable_exp_param() { + set_has_exp_param(); + if (exp_param_ == NULL) { + exp_param_ = new ::ditcaffe::ExpParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.exp_param) + return exp_param_; +} +inline ::ditcaffe::ExpParameter* LayerParameter::release_exp_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.exp_param) + clear_has_exp_param(); + ::ditcaffe::ExpParameter* temp = exp_param_; + exp_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_exp_param(::ditcaffe::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:ditcaffe.LayerParameter.exp_param) +} + +// optional .ditcaffe.FlattenParameter flatten_param = 135; +inline bool LayerParameter::has_flatten_param() const { + return (_has_bits_[0] & 0x10000000u) != 0; +} +inline void LayerParameter::set_has_flatten_param() { + _has_bits_[0] |= 0x10000000u; +} +inline void LayerParameter::clear_has_flatten_param() { + _has_bits_[0] &= ~0x10000000u; +} +inline void LayerParameter::clear_flatten_param() { + if (flatten_param_ != NULL) flatten_param_->::ditcaffe::FlattenParameter::Clear(); + clear_has_flatten_param(); +} +inline const ::ditcaffe::FlattenParameter& LayerParameter::flatten_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.flatten_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return flatten_param_ != NULL ? *flatten_param_ : *default_instance().flatten_param_; +#else + return flatten_param_ != NULL ? *flatten_param_ : *default_instance_->flatten_param_; +#endif +} +inline ::ditcaffe::FlattenParameter* LayerParameter::mutable_flatten_param() { + set_has_flatten_param(); + if (flatten_param_ == NULL) { + flatten_param_ = new ::ditcaffe::FlattenParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.flatten_param) + return flatten_param_; +} +inline ::ditcaffe::FlattenParameter* LayerParameter::release_flatten_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.flatten_param) + clear_has_flatten_param(); + ::ditcaffe::FlattenParameter* temp = flatten_param_; + flatten_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_flatten_param(::ditcaffe::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:ditcaffe.LayerParameter.flatten_param) +} + +// optional .ditcaffe.HDF5DataParameter hdf5_data_param = 112; +inline bool LayerParameter::has_hdf5_data_param() const { + return (_has_bits_[0] & 0x20000000u) != 0; +} +inline void LayerParameter::set_has_hdf5_data_param() { + _has_bits_[0] |= 0x20000000u; +} +inline void LayerParameter::clear_has_hdf5_data_param() { + _has_bits_[0] &= ~0x20000000u; +} +inline void LayerParameter::clear_hdf5_data_param() { + if (hdf5_data_param_ != NULL) hdf5_data_param_->::ditcaffe::HDF5DataParameter::Clear(); + clear_has_hdf5_data_param(); +} +inline const ::ditcaffe::HDF5DataParameter& LayerParameter::hdf5_data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.hdf5_data_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return hdf5_data_param_ != NULL ? *hdf5_data_param_ : *default_instance().hdf5_data_param_; +#else + return hdf5_data_param_ != NULL ? *hdf5_data_param_ : *default_instance_->hdf5_data_param_; +#endif +} +inline ::ditcaffe::HDF5DataParameter* LayerParameter::mutable_hdf5_data_param() { + set_has_hdf5_data_param(); + if (hdf5_data_param_ == NULL) { + hdf5_data_param_ = new ::ditcaffe::HDF5DataParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.hdf5_data_param) + return hdf5_data_param_; +} +inline ::ditcaffe::HDF5DataParameter* LayerParameter::release_hdf5_data_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.hdf5_data_param) + clear_has_hdf5_data_param(); + ::ditcaffe::HDF5DataParameter* temp = hdf5_data_param_; + hdf5_data_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_hdf5_data_param(::ditcaffe::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:ditcaffe.LayerParameter.hdf5_data_param) +} + +// optional .ditcaffe.HDF5OutputParameter hdf5_output_param = 113; +inline bool LayerParameter::has_hdf5_output_param() const { + return (_has_bits_[0] & 0x40000000u) != 0; +} +inline void LayerParameter::set_has_hdf5_output_param() { + _has_bits_[0] |= 0x40000000u; +} +inline void LayerParameter::clear_has_hdf5_output_param() { + _has_bits_[0] &= ~0x40000000u; +} +inline void LayerParameter::clear_hdf5_output_param() { + if (hdf5_output_param_ != NULL) hdf5_output_param_->::ditcaffe::HDF5OutputParameter::Clear(); + clear_has_hdf5_output_param(); +} +inline const ::ditcaffe::HDF5OutputParameter& LayerParameter::hdf5_output_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.hdf5_output_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return hdf5_output_param_ != NULL ? *hdf5_output_param_ : *default_instance().hdf5_output_param_; +#else + return hdf5_output_param_ != NULL ? *hdf5_output_param_ : *default_instance_->hdf5_output_param_; +#endif +} +inline ::ditcaffe::HDF5OutputParameter* LayerParameter::mutable_hdf5_output_param() { + set_has_hdf5_output_param(); + if (hdf5_output_param_ == NULL) { + hdf5_output_param_ = new ::ditcaffe::HDF5OutputParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.hdf5_output_param) + return hdf5_output_param_; +} +inline ::ditcaffe::HDF5OutputParameter* LayerParameter::release_hdf5_output_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.hdf5_output_param) + clear_has_hdf5_output_param(); + ::ditcaffe::HDF5OutputParameter* temp = hdf5_output_param_; + hdf5_output_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_hdf5_output_param(::ditcaffe::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:ditcaffe.LayerParameter.hdf5_output_param) +} + +// optional .ditcaffe.HingeLossParameter hinge_loss_param = 114; +inline bool LayerParameter::has_hinge_loss_param() const { + return (_has_bits_[0] & 0x80000000u) != 0; +} +inline void LayerParameter::set_has_hinge_loss_param() { + _has_bits_[0] |= 0x80000000u; +} +inline void LayerParameter::clear_has_hinge_loss_param() { + _has_bits_[0] &= ~0x80000000u; +} +inline void LayerParameter::clear_hinge_loss_param() { + if (hinge_loss_param_ != NULL) hinge_loss_param_->::ditcaffe::HingeLossParameter::Clear(); + clear_has_hinge_loss_param(); +} +inline const ::ditcaffe::HingeLossParameter& LayerParameter::hinge_loss_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.hinge_loss_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return hinge_loss_param_ != NULL ? *hinge_loss_param_ : *default_instance().hinge_loss_param_; +#else + return hinge_loss_param_ != NULL ? *hinge_loss_param_ : *default_instance_->hinge_loss_param_; +#endif +} +inline ::ditcaffe::HingeLossParameter* LayerParameter::mutable_hinge_loss_param() { + set_has_hinge_loss_param(); + if (hinge_loss_param_ == NULL) { + hinge_loss_param_ = new ::ditcaffe::HingeLossParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.hinge_loss_param) + return hinge_loss_param_; +} +inline ::ditcaffe::HingeLossParameter* LayerParameter::release_hinge_loss_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.hinge_loss_param) + clear_has_hinge_loss_param(); + ::ditcaffe::HingeLossParameter* temp = hinge_loss_param_; + hinge_loss_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_hinge_loss_param(::ditcaffe::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:ditcaffe.LayerParameter.hinge_loss_param) +} + +// optional .ditcaffe.ImageDataParameter image_data_param = 115; +inline bool LayerParameter::has_image_data_param() const { + return (_has_bits_[1] & 0x00000001u) != 0; +} +inline void LayerParameter::set_has_image_data_param() { + _has_bits_[1] |= 0x00000001u; +} +inline void LayerParameter::clear_has_image_data_param() { + _has_bits_[1] &= ~0x00000001u; +} +inline void LayerParameter::clear_image_data_param() { + if (image_data_param_ != NULL) image_data_param_->::ditcaffe::ImageDataParameter::Clear(); + clear_has_image_data_param(); +} +inline const ::ditcaffe::ImageDataParameter& LayerParameter::image_data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.image_data_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return image_data_param_ != NULL ? *image_data_param_ : *default_instance().image_data_param_; +#else + return image_data_param_ != NULL ? *image_data_param_ : *default_instance_->image_data_param_; +#endif +} +inline ::ditcaffe::ImageDataParameter* LayerParameter::mutable_image_data_param() { + set_has_image_data_param(); + if (image_data_param_ == NULL) { + image_data_param_ = new ::ditcaffe::ImageDataParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.image_data_param) + return image_data_param_; +} +inline ::ditcaffe::ImageDataParameter* LayerParameter::release_image_data_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.image_data_param) + clear_has_image_data_param(); + ::ditcaffe::ImageDataParameter* temp = image_data_param_; + image_data_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_image_data_param(::ditcaffe::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:ditcaffe.LayerParameter.image_data_param) +} + +// optional .ditcaffe.InfogainLossParameter infogain_loss_param = 116; +inline bool LayerParameter::has_infogain_loss_param() const { + return (_has_bits_[1] & 0x00000002u) != 0; +} +inline void LayerParameter::set_has_infogain_loss_param() { + _has_bits_[1] |= 0x00000002u; +} +inline void LayerParameter::clear_has_infogain_loss_param() { + _has_bits_[1] &= ~0x00000002u; +} +inline void LayerParameter::clear_infogain_loss_param() { + if (infogain_loss_param_ != NULL) infogain_loss_param_->::ditcaffe::InfogainLossParameter::Clear(); + clear_has_infogain_loss_param(); +} +inline const ::ditcaffe::InfogainLossParameter& LayerParameter::infogain_loss_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.infogain_loss_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return infogain_loss_param_ != NULL ? *infogain_loss_param_ : *default_instance().infogain_loss_param_; +#else + return infogain_loss_param_ != NULL ? *infogain_loss_param_ : *default_instance_->infogain_loss_param_; +#endif +} +inline ::ditcaffe::InfogainLossParameter* LayerParameter::mutable_infogain_loss_param() { + set_has_infogain_loss_param(); + if (infogain_loss_param_ == NULL) { + infogain_loss_param_ = new ::ditcaffe::InfogainLossParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.infogain_loss_param) + return infogain_loss_param_; +} +inline ::ditcaffe::InfogainLossParameter* LayerParameter::release_infogain_loss_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.infogain_loss_param) + clear_has_infogain_loss_param(); + ::ditcaffe::InfogainLossParameter* temp = infogain_loss_param_; + infogain_loss_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_infogain_loss_param(::ditcaffe::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:ditcaffe.LayerParameter.infogain_loss_param) +} + +// optional .ditcaffe.InnerProductParameter inner_product_param = 117; +inline bool LayerParameter::has_inner_product_param() const { + return (_has_bits_[1] & 0x00000004u) != 0; +} +inline void LayerParameter::set_has_inner_product_param() { + _has_bits_[1] |= 0x00000004u; +} +inline void LayerParameter::clear_has_inner_product_param() { + _has_bits_[1] &= ~0x00000004u; +} +inline void LayerParameter::clear_inner_product_param() { + if (inner_product_param_ != NULL) inner_product_param_->::ditcaffe::InnerProductParameter::Clear(); + clear_has_inner_product_param(); +} +inline const ::ditcaffe::InnerProductParameter& LayerParameter::inner_product_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.inner_product_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return inner_product_param_ != NULL ? *inner_product_param_ : *default_instance().inner_product_param_; +#else + return inner_product_param_ != NULL ? *inner_product_param_ : *default_instance_->inner_product_param_; +#endif +} +inline ::ditcaffe::InnerProductParameter* LayerParameter::mutable_inner_product_param() { + set_has_inner_product_param(); + if (inner_product_param_ == NULL) { + inner_product_param_ = new ::ditcaffe::InnerProductParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.inner_product_param) + return inner_product_param_; +} +inline ::ditcaffe::InnerProductParameter* LayerParameter::release_inner_product_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.inner_product_param) + clear_has_inner_product_param(); + ::ditcaffe::InnerProductParameter* temp = inner_product_param_; + inner_product_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_inner_product_param(::ditcaffe::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:ditcaffe.LayerParameter.inner_product_param) +} + +// optional .ditcaffe.InputParameter input_param = 143; +inline bool LayerParameter::has_input_param() const { + return (_has_bits_[1] & 0x00000008u) != 0; +} +inline void LayerParameter::set_has_input_param() { + _has_bits_[1] |= 0x00000008u; +} +inline void LayerParameter::clear_has_input_param() { + _has_bits_[1] &= ~0x00000008u; +} +inline void LayerParameter::clear_input_param() { + if (input_param_ != NULL) input_param_->::ditcaffe::InputParameter::Clear(); + clear_has_input_param(); +} +inline const ::ditcaffe::InputParameter& LayerParameter::input_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.input_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return input_param_ != NULL ? *input_param_ : *default_instance().input_param_; +#else + return input_param_ != NULL ? *input_param_ : *default_instance_->input_param_; +#endif +} +inline ::ditcaffe::InputParameter* LayerParameter::mutable_input_param() { + set_has_input_param(); + if (input_param_ == NULL) { + input_param_ = new ::ditcaffe::InputParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.input_param) + return input_param_; +} +inline ::ditcaffe::InputParameter* LayerParameter::release_input_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.input_param) + clear_has_input_param(); + ::ditcaffe::InputParameter* temp = input_param_; + input_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_input_param(::ditcaffe::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:ditcaffe.LayerParameter.input_param) +} + +// optional .ditcaffe.LogParameter log_param = 134; +inline bool LayerParameter::has_log_param() const { + return (_has_bits_[1] & 0x00000010u) != 0; +} +inline void LayerParameter::set_has_log_param() { + _has_bits_[1] |= 0x00000010u; +} +inline void LayerParameter::clear_has_log_param() { + _has_bits_[1] &= ~0x00000010u; +} +inline void LayerParameter::clear_log_param() { + if (log_param_ != NULL) log_param_->::ditcaffe::LogParameter::Clear(); + clear_has_log_param(); +} +inline const ::ditcaffe::LogParameter& LayerParameter::log_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.log_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return log_param_ != NULL ? *log_param_ : *default_instance().log_param_; +#else + return log_param_ != NULL ? *log_param_ : *default_instance_->log_param_; +#endif +} +inline ::ditcaffe::LogParameter* LayerParameter::mutable_log_param() { + set_has_log_param(); + if (log_param_ == NULL) { + log_param_ = new ::ditcaffe::LogParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.log_param) + return log_param_; +} +inline ::ditcaffe::LogParameter* LayerParameter::release_log_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.log_param) + clear_has_log_param(); + ::ditcaffe::LogParameter* temp = log_param_; + log_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_log_param(::ditcaffe::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:ditcaffe.LayerParameter.log_param) +} + +// optional .ditcaffe.LRNParameter lrn_param = 118; +inline bool LayerParameter::has_lrn_param() const { + return (_has_bits_[1] & 0x00000020u) != 0; +} +inline void LayerParameter::set_has_lrn_param() { + _has_bits_[1] |= 0x00000020u; +} +inline void LayerParameter::clear_has_lrn_param() { + _has_bits_[1] &= ~0x00000020u; +} +inline void LayerParameter::clear_lrn_param() { + if (lrn_param_ != NULL) lrn_param_->::ditcaffe::LRNParameter::Clear(); + clear_has_lrn_param(); +} +inline const ::ditcaffe::LRNParameter& LayerParameter::lrn_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.lrn_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return lrn_param_ != NULL ? *lrn_param_ : *default_instance().lrn_param_; +#else + return lrn_param_ != NULL ? *lrn_param_ : *default_instance_->lrn_param_; +#endif +} +inline ::ditcaffe::LRNParameter* LayerParameter::mutable_lrn_param() { + set_has_lrn_param(); + if (lrn_param_ == NULL) { + lrn_param_ = new ::ditcaffe::LRNParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.lrn_param) + return lrn_param_; +} +inline ::ditcaffe::LRNParameter* LayerParameter::release_lrn_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.lrn_param) + clear_has_lrn_param(); + ::ditcaffe::LRNParameter* temp = lrn_param_; + lrn_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_lrn_param(::ditcaffe::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:ditcaffe.LayerParameter.lrn_param) +} + +// optional .ditcaffe.MemoryDataParameter memory_data_param = 119; +inline bool LayerParameter::has_memory_data_param() const { + return (_has_bits_[1] & 0x00000040u) != 0; +} +inline void LayerParameter::set_has_memory_data_param() { + _has_bits_[1] |= 0x00000040u; +} +inline void LayerParameter::clear_has_memory_data_param() { + _has_bits_[1] &= ~0x00000040u; +} +inline void LayerParameter::clear_memory_data_param() { + if (memory_data_param_ != NULL) memory_data_param_->::ditcaffe::MemoryDataParameter::Clear(); + clear_has_memory_data_param(); +} +inline const ::ditcaffe::MemoryDataParameter& LayerParameter::memory_data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.memory_data_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return memory_data_param_ != NULL ? *memory_data_param_ : *default_instance().memory_data_param_; +#else + return memory_data_param_ != NULL ? *memory_data_param_ : *default_instance_->memory_data_param_; +#endif +} +inline ::ditcaffe::MemoryDataParameter* LayerParameter::mutable_memory_data_param() { + set_has_memory_data_param(); + if (memory_data_param_ == NULL) { + memory_data_param_ = new ::ditcaffe::MemoryDataParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.memory_data_param) + return memory_data_param_; +} +inline ::ditcaffe::MemoryDataParameter* LayerParameter::release_memory_data_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.memory_data_param) + clear_has_memory_data_param(); + ::ditcaffe::MemoryDataParameter* temp = memory_data_param_; + memory_data_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_memory_data_param(::ditcaffe::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:ditcaffe.LayerParameter.memory_data_param) +} + +// optional .ditcaffe.MVNParameter mvn_param = 120; +inline bool LayerParameter::has_mvn_param() const { + return (_has_bits_[1] & 0x00000080u) != 0; +} +inline void LayerParameter::set_has_mvn_param() { + _has_bits_[1] |= 0x00000080u; +} +inline void LayerParameter::clear_has_mvn_param() { + _has_bits_[1] &= ~0x00000080u; +} +inline void LayerParameter::clear_mvn_param() { + if (mvn_param_ != NULL) mvn_param_->::ditcaffe::MVNParameter::Clear(); + clear_has_mvn_param(); +} +inline const ::ditcaffe::MVNParameter& LayerParameter::mvn_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.mvn_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return mvn_param_ != NULL ? *mvn_param_ : *default_instance().mvn_param_; +#else + return mvn_param_ != NULL ? *mvn_param_ : *default_instance_->mvn_param_; +#endif +} +inline ::ditcaffe::MVNParameter* LayerParameter::mutable_mvn_param() { + set_has_mvn_param(); + if (mvn_param_ == NULL) { + mvn_param_ = new ::ditcaffe::MVNParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.mvn_param) + return mvn_param_; +} +inline ::ditcaffe::MVNParameter* LayerParameter::release_mvn_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.mvn_param) + clear_has_mvn_param(); + ::ditcaffe::MVNParameter* temp = mvn_param_; + mvn_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_mvn_param(::ditcaffe::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:ditcaffe.LayerParameter.mvn_param) +} + +// optional .ditcaffe.ParameterParameter parameter_param = 145; +inline bool LayerParameter::has_parameter_param() const { + return (_has_bits_[1] & 0x00000100u) != 0; +} +inline void LayerParameter::set_has_parameter_param() { + _has_bits_[1] |= 0x00000100u; +} +inline void LayerParameter::clear_has_parameter_param() { + _has_bits_[1] &= ~0x00000100u; +} +inline void LayerParameter::clear_parameter_param() { + if (parameter_param_ != NULL) parameter_param_->::ditcaffe::ParameterParameter::Clear(); + clear_has_parameter_param(); +} +inline const ::ditcaffe::ParameterParameter& LayerParameter::parameter_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.parameter_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return parameter_param_ != NULL ? *parameter_param_ : *default_instance().parameter_param_; +#else + return parameter_param_ != NULL ? *parameter_param_ : *default_instance_->parameter_param_; +#endif +} +inline ::ditcaffe::ParameterParameter* LayerParameter::mutable_parameter_param() { + set_has_parameter_param(); + if (parameter_param_ == NULL) { + parameter_param_ = new ::ditcaffe::ParameterParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.parameter_param) + return parameter_param_; +} +inline ::ditcaffe::ParameterParameter* LayerParameter::release_parameter_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.parameter_param) + clear_has_parameter_param(); + ::ditcaffe::ParameterParameter* temp = parameter_param_; + parameter_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_parameter_param(::ditcaffe::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:ditcaffe.LayerParameter.parameter_param) +} + +// optional .ditcaffe.PoolingParameter pooling_param = 121; +inline bool LayerParameter::has_pooling_param() const { + return (_has_bits_[1] & 0x00000200u) != 0; +} +inline void LayerParameter::set_has_pooling_param() { + _has_bits_[1] |= 0x00000200u; +} +inline void LayerParameter::clear_has_pooling_param() { + _has_bits_[1] &= ~0x00000200u; +} +inline void LayerParameter::clear_pooling_param() { + if (pooling_param_ != NULL) pooling_param_->::ditcaffe::PoolingParameter::Clear(); + clear_has_pooling_param(); +} +inline const ::ditcaffe::PoolingParameter& LayerParameter::pooling_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.pooling_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return pooling_param_ != NULL ? *pooling_param_ : *default_instance().pooling_param_; +#else + return pooling_param_ != NULL ? *pooling_param_ : *default_instance_->pooling_param_; +#endif +} +inline ::ditcaffe::PoolingParameter* LayerParameter::mutable_pooling_param() { + set_has_pooling_param(); + if (pooling_param_ == NULL) { + pooling_param_ = new ::ditcaffe::PoolingParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.pooling_param) + return pooling_param_; +} +inline ::ditcaffe::PoolingParameter* LayerParameter::release_pooling_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.pooling_param) + clear_has_pooling_param(); + ::ditcaffe::PoolingParameter* temp = pooling_param_; + pooling_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_pooling_param(::ditcaffe::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:ditcaffe.LayerParameter.pooling_param) +} + +// optional .ditcaffe.PowerParameter power_param = 122; +inline bool LayerParameter::has_power_param() const { + return (_has_bits_[1] & 0x00000400u) != 0; +} +inline void LayerParameter::set_has_power_param() { + _has_bits_[1] |= 0x00000400u; +} +inline void LayerParameter::clear_has_power_param() { + _has_bits_[1] &= ~0x00000400u; +} +inline void LayerParameter::clear_power_param() { + if (power_param_ != NULL) power_param_->::ditcaffe::PowerParameter::Clear(); + clear_has_power_param(); +} +inline const ::ditcaffe::PowerParameter& LayerParameter::power_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.power_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return power_param_ != NULL ? *power_param_ : *default_instance().power_param_; +#else + return power_param_ != NULL ? *power_param_ : *default_instance_->power_param_; +#endif +} +inline ::ditcaffe::PowerParameter* LayerParameter::mutable_power_param() { + set_has_power_param(); + if (power_param_ == NULL) { + power_param_ = new ::ditcaffe::PowerParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.power_param) + return power_param_; +} +inline ::ditcaffe::PowerParameter* LayerParameter::release_power_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.power_param) + clear_has_power_param(); + ::ditcaffe::PowerParameter* temp = power_param_; + power_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_power_param(::ditcaffe::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:ditcaffe.LayerParameter.power_param) +} + +// optional .ditcaffe.PReLUParameter prelu_param = 131; +inline bool LayerParameter::has_prelu_param() const { + return (_has_bits_[1] & 0x00000800u) != 0; +} +inline void LayerParameter::set_has_prelu_param() { + _has_bits_[1] |= 0x00000800u; +} +inline void LayerParameter::clear_has_prelu_param() { + _has_bits_[1] &= ~0x00000800u; +} +inline void LayerParameter::clear_prelu_param() { + if (prelu_param_ != NULL) prelu_param_->::ditcaffe::PReLUParameter::Clear(); + clear_has_prelu_param(); +} +inline const ::ditcaffe::PReLUParameter& LayerParameter::prelu_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.prelu_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return prelu_param_ != NULL ? *prelu_param_ : *default_instance().prelu_param_; +#else + return prelu_param_ != NULL ? *prelu_param_ : *default_instance_->prelu_param_; +#endif +} +inline ::ditcaffe::PReLUParameter* LayerParameter::mutable_prelu_param() { + set_has_prelu_param(); + if (prelu_param_ == NULL) { + prelu_param_ = new ::ditcaffe::PReLUParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.prelu_param) + return prelu_param_; +} +inline ::ditcaffe::PReLUParameter* LayerParameter::release_prelu_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.prelu_param) + clear_has_prelu_param(); + ::ditcaffe::PReLUParameter* temp = prelu_param_; + prelu_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_prelu_param(::ditcaffe::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:ditcaffe.LayerParameter.prelu_param) +} + +// optional .ditcaffe.PythonParameter python_param = 130; +inline bool LayerParameter::has_python_param() const { + return (_has_bits_[1] & 0x00001000u) != 0; +} +inline void LayerParameter::set_has_python_param() { + _has_bits_[1] |= 0x00001000u; +} +inline void LayerParameter::clear_has_python_param() { + _has_bits_[1] &= ~0x00001000u; +} +inline void LayerParameter::clear_python_param() { + if (python_param_ != NULL) python_param_->::ditcaffe::PythonParameter::Clear(); + clear_has_python_param(); +} +inline const ::ditcaffe::PythonParameter& LayerParameter::python_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.python_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return python_param_ != NULL ? *python_param_ : *default_instance().python_param_; +#else + return python_param_ != NULL ? *python_param_ : *default_instance_->python_param_; +#endif +} +inline ::ditcaffe::PythonParameter* LayerParameter::mutable_python_param() { + set_has_python_param(); + if (python_param_ == NULL) { + python_param_ = new ::ditcaffe::PythonParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.python_param) + return python_param_; +} +inline ::ditcaffe::PythonParameter* LayerParameter::release_python_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.python_param) + clear_has_python_param(); + ::ditcaffe::PythonParameter* temp = python_param_; + python_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_python_param(::ditcaffe::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:ditcaffe.LayerParameter.python_param) +} + +// optional .ditcaffe.ReductionParameter reduction_param = 136; +inline bool LayerParameter::has_reduction_param() const { + return (_has_bits_[1] & 0x00002000u) != 0; +} +inline void LayerParameter::set_has_reduction_param() { + _has_bits_[1] |= 0x00002000u; +} +inline void LayerParameter::clear_has_reduction_param() { + _has_bits_[1] &= ~0x00002000u; +} +inline void LayerParameter::clear_reduction_param() { + if (reduction_param_ != NULL) reduction_param_->::ditcaffe::ReductionParameter::Clear(); + clear_has_reduction_param(); +} +inline const ::ditcaffe::ReductionParameter& LayerParameter::reduction_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.reduction_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return reduction_param_ != NULL ? *reduction_param_ : *default_instance().reduction_param_; +#else + return reduction_param_ != NULL ? *reduction_param_ : *default_instance_->reduction_param_; +#endif +} +inline ::ditcaffe::ReductionParameter* LayerParameter::mutable_reduction_param() { + set_has_reduction_param(); + if (reduction_param_ == NULL) { + reduction_param_ = new ::ditcaffe::ReductionParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.reduction_param) + return reduction_param_; +} +inline ::ditcaffe::ReductionParameter* LayerParameter::release_reduction_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.reduction_param) + clear_has_reduction_param(); + ::ditcaffe::ReductionParameter* temp = reduction_param_; + reduction_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_reduction_param(::ditcaffe::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:ditcaffe.LayerParameter.reduction_param) +} + +// optional .ditcaffe.ReLUParameter relu_param = 123; +inline bool LayerParameter::has_relu_param() const { + return (_has_bits_[1] & 0x00004000u) != 0; +} +inline void LayerParameter::set_has_relu_param() { + _has_bits_[1] |= 0x00004000u; +} +inline void LayerParameter::clear_has_relu_param() { + _has_bits_[1] &= ~0x00004000u; +} +inline void LayerParameter::clear_relu_param() { + if (relu_param_ != NULL) relu_param_->::ditcaffe::ReLUParameter::Clear(); + clear_has_relu_param(); +} +inline const ::ditcaffe::ReLUParameter& LayerParameter::relu_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.relu_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return relu_param_ != NULL ? *relu_param_ : *default_instance().relu_param_; +#else + return relu_param_ != NULL ? *relu_param_ : *default_instance_->relu_param_; +#endif +} +inline ::ditcaffe::ReLUParameter* LayerParameter::mutable_relu_param() { + set_has_relu_param(); + if (relu_param_ == NULL) { + relu_param_ = new ::ditcaffe::ReLUParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.relu_param) + return relu_param_; +} +inline ::ditcaffe::ReLUParameter* LayerParameter::release_relu_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.relu_param) + clear_has_relu_param(); + ::ditcaffe::ReLUParameter* temp = relu_param_; + relu_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_relu_param(::ditcaffe::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:ditcaffe.LayerParameter.relu_param) +} + +// optional .ditcaffe.ReshapeParameter reshape_param = 133; +inline bool LayerParameter::has_reshape_param() const { + return (_has_bits_[1] & 0x00008000u) != 0; +} +inline void LayerParameter::set_has_reshape_param() { + _has_bits_[1] |= 0x00008000u; +} +inline void LayerParameter::clear_has_reshape_param() { + _has_bits_[1] &= ~0x00008000u; +} +inline void LayerParameter::clear_reshape_param() { + if (reshape_param_ != NULL) reshape_param_->::ditcaffe::ReshapeParameter::Clear(); + clear_has_reshape_param(); +} +inline const ::ditcaffe::ReshapeParameter& LayerParameter::reshape_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.reshape_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return reshape_param_ != NULL ? *reshape_param_ : *default_instance().reshape_param_; +#else + return reshape_param_ != NULL ? *reshape_param_ : *default_instance_->reshape_param_; +#endif +} +inline ::ditcaffe::ReshapeParameter* LayerParameter::mutable_reshape_param() { + set_has_reshape_param(); + if (reshape_param_ == NULL) { + reshape_param_ = new ::ditcaffe::ReshapeParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.reshape_param) + return reshape_param_; +} +inline ::ditcaffe::ReshapeParameter* LayerParameter::release_reshape_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.reshape_param) + clear_has_reshape_param(); + ::ditcaffe::ReshapeParameter* temp = reshape_param_; + reshape_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_reshape_param(::ditcaffe::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:ditcaffe.LayerParameter.reshape_param) +} + +// optional .ditcaffe.ScaleParameter scale_param = 142; +inline bool LayerParameter::has_scale_param() const { + return (_has_bits_[1] & 0x00010000u) != 0; +} +inline void LayerParameter::set_has_scale_param() { + _has_bits_[1] |= 0x00010000u; +} +inline void LayerParameter::clear_has_scale_param() { + _has_bits_[1] &= ~0x00010000u; +} +inline void LayerParameter::clear_scale_param() { + if (scale_param_ != NULL) scale_param_->::ditcaffe::ScaleParameter::Clear(); + clear_has_scale_param(); +} +inline const ::ditcaffe::ScaleParameter& LayerParameter::scale_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.scale_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return scale_param_ != NULL ? *scale_param_ : *default_instance().scale_param_; +#else + return scale_param_ != NULL ? *scale_param_ : *default_instance_->scale_param_; +#endif +} +inline ::ditcaffe::ScaleParameter* LayerParameter::mutable_scale_param() { + set_has_scale_param(); + if (scale_param_ == NULL) { + scale_param_ = new ::ditcaffe::ScaleParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.scale_param) + return scale_param_; +} +inline ::ditcaffe::ScaleParameter* LayerParameter::release_scale_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.scale_param) + clear_has_scale_param(); + ::ditcaffe::ScaleParameter* temp = scale_param_; + scale_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_scale_param(::ditcaffe::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:ditcaffe.LayerParameter.scale_param) +} + +// optional .ditcaffe.SigmoidParameter sigmoid_param = 124; +inline bool LayerParameter::has_sigmoid_param() const { + return (_has_bits_[1] & 0x00020000u) != 0; +} +inline void LayerParameter::set_has_sigmoid_param() { + _has_bits_[1] |= 0x00020000u; +} +inline void LayerParameter::clear_has_sigmoid_param() { + _has_bits_[1] &= ~0x00020000u; +} +inline void LayerParameter::clear_sigmoid_param() { + if (sigmoid_param_ != NULL) sigmoid_param_->::ditcaffe::SigmoidParameter::Clear(); + clear_has_sigmoid_param(); +} +inline const ::ditcaffe::SigmoidParameter& LayerParameter::sigmoid_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.sigmoid_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return sigmoid_param_ != NULL ? *sigmoid_param_ : *default_instance().sigmoid_param_; +#else + return sigmoid_param_ != NULL ? *sigmoid_param_ : *default_instance_->sigmoid_param_; +#endif +} +inline ::ditcaffe::SigmoidParameter* LayerParameter::mutable_sigmoid_param() { + set_has_sigmoid_param(); + if (sigmoid_param_ == NULL) { + sigmoid_param_ = new ::ditcaffe::SigmoidParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.sigmoid_param) + return sigmoid_param_; +} +inline ::ditcaffe::SigmoidParameter* LayerParameter::release_sigmoid_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.sigmoid_param) + clear_has_sigmoid_param(); + ::ditcaffe::SigmoidParameter* temp = sigmoid_param_; + sigmoid_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_sigmoid_param(::ditcaffe::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:ditcaffe.LayerParameter.sigmoid_param) +} + +// optional .ditcaffe.SoftmaxParameter softmax_param = 125; +inline bool LayerParameter::has_softmax_param() const { + return (_has_bits_[1] & 0x00040000u) != 0; +} +inline void LayerParameter::set_has_softmax_param() { + _has_bits_[1] |= 0x00040000u; +} +inline void LayerParameter::clear_has_softmax_param() { + _has_bits_[1] &= ~0x00040000u; +} +inline void LayerParameter::clear_softmax_param() { + if (softmax_param_ != NULL) softmax_param_->::ditcaffe::SoftmaxParameter::Clear(); + clear_has_softmax_param(); +} +inline const ::ditcaffe::SoftmaxParameter& LayerParameter::softmax_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.softmax_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return softmax_param_ != NULL ? *softmax_param_ : *default_instance().softmax_param_; +#else + return softmax_param_ != NULL ? *softmax_param_ : *default_instance_->softmax_param_; +#endif +} +inline ::ditcaffe::SoftmaxParameter* LayerParameter::mutable_softmax_param() { + set_has_softmax_param(); + if (softmax_param_ == NULL) { + softmax_param_ = new ::ditcaffe::SoftmaxParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.softmax_param) + return softmax_param_; +} +inline ::ditcaffe::SoftmaxParameter* LayerParameter::release_softmax_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.softmax_param) + clear_has_softmax_param(); + ::ditcaffe::SoftmaxParameter* temp = softmax_param_; + softmax_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_softmax_param(::ditcaffe::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:ditcaffe.LayerParameter.softmax_param) +} + +// optional .ditcaffe.SPPParameter spp_param = 132; +inline bool LayerParameter::has_spp_param() const { + return (_has_bits_[1] & 0x00080000u) != 0; +} +inline void LayerParameter::set_has_spp_param() { + _has_bits_[1] |= 0x00080000u; +} +inline void LayerParameter::clear_has_spp_param() { + _has_bits_[1] &= ~0x00080000u; +} +inline void LayerParameter::clear_spp_param() { + if (spp_param_ != NULL) spp_param_->::ditcaffe::SPPParameter::Clear(); + clear_has_spp_param(); +} +inline const ::ditcaffe::SPPParameter& LayerParameter::spp_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.spp_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return spp_param_ != NULL ? *spp_param_ : *default_instance().spp_param_; +#else + return spp_param_ != NULL ? *spp_param_ : *default_instance_->spp_param_; +#endif +} +inline ::ditcaffe::SPPParameter* LayerParameter::mutable_spp_param() { + set_has_spp_param(); + if (spp_param_ == NULL) { + spp_param_ = new ::ditcaffe::SPPParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.spp_param) + return spp_param_; +} +inline ::ditcaffe::SPPParameter* LayerParameter::release_spp_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.spp_param) + clear_has_spp_param(); + ::ditcaffe::SPPParameter* temp = spp_param_; + spp_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_spp_param(::ditcaffe::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:ditcaffe.LayerParameter.spp_param) +} + +// optional .ditcaffe.SliceParameter slice_param = 126; +inline bool LayerParameter::has_slice_param() const { + return (_has_bits_[1] & 0x00100000u) != 0; +} +inline void LayerParameter::set_has_slice_param() { + _has_bits_[1] |= 0x00100000u; +} +inline void LayerParameter::clear_has_slice_param() { + _has_bits_[1] &= ~0x00100000u; +} +inline void LayerParameter::clear_slice_param() { + if (slice_param_ != NULL) slice_param_->::ditcaffe::SliceParameter::Clear(); + clear_has_slice_param(); +} +inline const ::ditcaffe::SliceParameter& LayerParameter::slice_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.slice_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return slice_param_ != NULL ? *slice_param_ : *default_instance().slice_param_; +#else + return slice_param_ != NULL ? *slice_param_ : *default_instance_->slice_param_; +#endif +} +inline ::ditcaffe::SliceParameter* LayerParameter::mutable_slice_param() { + set_has_slice_param(); + if (slice_param_ == NULL) { + slice_param_ = new ::ditcaffe::SliceParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.slice_param) + return slice_param_; +} +inline ::ditcaffe::SliceParameter* LayerParameter::release_slice_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.slice_param) + clear_has_slice_param(); + ::ditcaffe::SliceParameter* temp = slice_param_; + slice_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_slice_param(::ditcaffe::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:ditcaffe.LayerParameter.slice_param) +} + +// optional .ditcaffe.TanHParameter tanh_param = 127; +inline bool LayerParameter::has_tanh_param() const { + return (_has_bits_[1] & 0x00200000u) != 0; +} +inline void LayerParameter::set_has_tanh_param() { + _has_bits_[1] |= 0x00200000u; +} +inline void LayerParameter::clear_has_tanh_param() { + _has_bits_[1] &= ~0x00200000u; +} +inline void LayerParameter::clear_tanh_param() { + if (tanh_param_ != NULL) tanh_param_->::ditcaffe::TanHParameter::Clear(); + clear_has_tanh_param(); +} +inline const ::ditcaffe::TanHParameter& LayerParameter::tanh_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.tanh_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return tanh_param_ != NULL ? *tanh_param_ : *default_instance().tanh_param_; +#else + return tanh_param_ != NULL ? *tanh_param_ : *default_instance_->tanh_param_; +#endif +} +inline ::ditcaffe::TanHParameter* LayerParameter::mutable_tanh_param() { + set_has_tanh_param(); + if (tanh_param_ == NULL) { + tanh_param_ = new ::ditcaffe::TanHParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.tanh_param) + return tanh_param_; +} +inline ::ditcaffe::TanHParameter* LayerParameter::release_tanh_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.tanh_param) + clear_has_tanh_param(); + ::ditcaffe::TanHParameter* temp = tanh_param_; + tanh_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_tanh_param(::ditcaffe::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:ditcaffe.LayerParameter.tanh_param) +} + +// optional .ditcaffe.ThresholdParameter threshold_param = 128; +inline bool LayerParameter::has_threshold_param() const { + return (_has_bits_[1] & 0x00400000u) != 0; +} +inline void LayerParameter::set_has_threshold_param() { + _has_bits_[1] |= 0x00400000u; +} +inline void LayerParameter::clear_has_threshold_param() { + _has_bits_[1] &= ~0x00400000u; +} +inline void LayerParameter::clear_threshold_param() { + if (threshold_param_ != NULL) threshold_param_->::ditcaffe::ThresholdParameter::Clear(); + clear_has_threshold_param(); +} +inline const ::ditcaffe::ThresholdParameter& LayerParameter::threshold_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.threshold_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return threshold_param_ != NULL ? *threshold_param_ : *default_instance().threshold_param_; +#else + return threshold_param_ != NULL ? *threshold_param_ : *default_instance_->threshold_param_; +#endif +} +inline ::ditcaffe::ThresholdParameter* LayerParameter::mutable_threshold_param() { + set_has_threshold_param(); + if (threshold_param_ == NULL) { + threshold_param_ = new ::ditcaffe::ThresholdParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.threshold_param) + return threshold_param_; +} +inline ::ditcaffe::ThresholdParameter* LayerParameter::release_threshold_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.threshold_param) + clear_has_threshold_param(); + ::ditcaffe::ThresholdParameter* temp = threshold_param_; + threshold_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_threshold_param(::ditcaffe::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:ditcaffe.LayerParameter.threshold_param) +} + +// optional .ditcaffe.TileParameter tile_param = 138; +inline bool LayerParameter::has_tile_param() const { + return (_has_bits_[1] & 0x00800000u) != 0; +} +inline void LayerParameter::set_has_tile_param() { + _has_bits_[1] |= 0x00800000u; +} +inline void LayerParameter::clear_has_tile_param() { + _has_bits_[1] &= ~0x00800000u; +} +inline void LayerParameter::clear_tile_param() { + if (tile_param_ != NULL) tile_param_->::ditcaffe::TileParameter::Clear(); + clear_has_tile_param(); +} +inline const ::ditcaffe::TileParameter& LayerParameter::tile_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.tile_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return tile_param_ != NULL ? *tile_param_ : *default_instance().tile_param_; +#else + return tile_param_ != NULL ? *tile_param_ : *default_instance_->tile_param_; +#endif +} +inline ::ditcaffe::TileParameter* LayerParameter::mutable_tile_param() { + set_has_tile_param(); + if (tile_param_ == NULL) { + tile_param_ = new ::ditcaffe::TileParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.tile_param) + return tile_param_; +} +inline ::ditcaffe::TileParameter* LayerParameter::release_tile_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.tile_param) + clear_has_tile_param(); + ::ditcaffe::TileParameter* temp = tile_param_; + tile_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_tile_param(::ditcaffe::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:ditcaffe.LayerParameter.tile_param) +} + +// optional .ditcaffe.WindowDataParameter window_data_param = 129; +inline bool LayerParameter::has_window_data_param() const { + return (_has_bits_[1] & 0x01000000u) != 0; +} +inline void LayerParameter::set_has_window_data_param() { + _has_bits_[1] |= 0x01000000u; +} +inline void LayerParameter::clear_has_window_data_param() { + _has_bits_[1] &= ~0x01000000u; +} +inline void LayerParameter::clear_window_data_param() { + if (window_data_param_ != NULL) window_data_param_->::ditcaffe::WindowDataParameter::Clear(); + clear_has_window_data_param(); +} +inline const ::ditcaffe::WindowDataParameter& LayerParameter::window_data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.LayerParameter.window_data_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return window_data_param_ != NULL ? *window_data_param_ : *default_instance().window_data_param_; +#else + return window_data_param_ != NULL ? *window_data_param_ : *default_instance_->window_data_param_; +#endif +} +inline ::ditcaffe::WindowDataParameter* LayerParameter::mutable_window_data_param() { + set_has_window_data_param(); + if (window_data_param_ == NULL) { + window_data_param_ = new ::ditcaffe::WindowDataParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.LayerParameter.window_data_param) + return window_data_param_; +} +inline ::ditcaffe::WindowDataParameter* LayerParameter::release_window_data_param() { + // @@protoc_insertion_point(field_release:ditcaffe.LayerParameter.window_data_param) + clear_has_window_data_param(); + ::ditcaffe::WindowDataParameter* temp = window_data_param_; + window_data_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_window_data_param(::ditcaffe::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:ditcaffe.LayerParameter.window_data_param) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.TransformationParameter.scale) + return scale_; +} +inline void TransformationParameter::set_scale(float value) { + set_has_scale(); + scale_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.TransformationParameter.mirror) + return mirror_; +} +inline void TransformationParameter::set_mirror(bool value) { + set_has_mirror(); + mirror_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.TransformationParameter.mean_file) +} +inline ::std::string* TransformationParameter::mutable_mean_file() { + set_has_mean_file(); + // @@protoc_insertion_point(field_mutable:ditcaffe.TransformationParameter.mean_file) + return mean_file_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* TransformationParameter::release_mean_file() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.TransformationParameter.mean_value) +} +inline void TransformationParameter::add_mean_value(float value) { + mean_value_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.TransformationParameter.mean_value) +} +inline const ::google::protobuf::RepeatedField< float >& +TransformationParameter::mean_value() const { + // @@protoc_insertion_point(field_list:ditcaffe.TransformationParameter.mean_value) + return mean_value_; +} +inline ::google::protobuf::RepeatedField< float >* +TransformationParameter::mutable_mean_value() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.TransformationParameter.force_gray) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.LossParameter.ignore_label) +} + +// optional .ditcaffe.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 ::ditcaffe::LossParameter_NormalizationMode LossParameter::normalization() const { + // @@protoc_insertion_point(field_get:ditcaffe.LossParameter.normalization) + return static_cast< ::ditcaffe::LossParameter_NormalizationMode >(normalization_); +} +inline void LossParameter::set_normalization(::ditcaffe::LossParameter_NormalizationMode value) { + assert(::ditcaffe::LossParameter_NormalizationMode_IsValid(value)); + set_has_normalization(); + normalization_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.LossParameter.normalize) + return normalize_; +} +inline void LossParameter::set_normalize(bool value) { + set_has_normalize(); + normalize_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.LossParameter.normalize) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.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:ditcaffe.AccuracyParameter.axis) + return axis_; +} +inline void AccuracyParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.AccuracyParameter.ignore_label) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.ArgMaxParameter.axis) + return axis_; +} +inline void ArgMaxParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.ArgMaxParameter.axis) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.ConcatParameter.axis) + return axis_; +} +inline void ConcatParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.ConcatParameter.concat_dim) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.BatchNormParameter.eps) + return eps_; +} +inline void BatchNormParameter::set_eps(float value) { + set_has_eps(); + eps_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.BatchNormParameter.eps) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.BiasParameter.axis) + return axis_; +} +inline void BiasParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.BiasParameter.num_axes) +} + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_filler(); +} +inline const ::ditcaffe::FillerParameter& BiasParameter::filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.BiasParameter.filler) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return filler_ != NULL ? *filler_ : *default_instance().filler_; +#else + return filler_ != NULL ? *filler_ : *default_instance_->filler_; +#endif +} +inline ::ditcaffe::FillerParameter* BiasParameter::mutable_filler() { + set_has_filler(); + if (filler_ == NULL) { + filler_ = new ::ditcaffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.BiasParameter.filler) + return filler_; +} +inline ::ditcaffe::FillerParameter* BiasParameter::release_filler() { + // @@protoc_insertion_point(field_release:ditcaffe.BiasParameter.filler) + clear_has_filler(); + ::ditcaffe::FillerParameter* temp = filler_; + filler_ = NULL; + return temp; +} +inline void BiasParameter::set_allocated_filler(::ditcaffe::FillerParameter* filler) { + delete filler_; + filler_ = filler; + if (filler) { + set_has_filler(); + } else { + clear_has_filler(); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.BiasParameter.filler) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.ContrastiveLossParameter.margin) + return margin_; +} +inline void ContrastiveLossParameter::set_margin(float value) { + set_has_margin(); + margin_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.ContrastiveLossParameter.legacy_version) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.ConvolutionParameter.pad) +} +inline void ConvolutionParameter::add_pad(::google::protobuf::uint32 value) { + pad_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.ConvolutionParameter.pad) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +ConvolutionParameter::pad() const { + // @@protoc_insertion_point(field_list:ditcaffe.ConvolutionParameter.pad) + return pad_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +ConvolutionParameter::mutable_pad() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.ConvolutionParameter.kernel_size) +} +inline void ConvolutionParameter::add_kernel_size(::google::protobuf::uint32 value) { + kernel_size_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.ConvolutionParameter.kernel_size) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +ConvolutionParameter::kernel_size() const { + // @@protoc_insertion_point(field_list:ditcaffe.ConvolutionParameter.kernel_size) + return kernel_size_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +ConvolutionParameter::mutable_kernel_size() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.ConvolutionParameter.stride) +} +inline void ConvolutionParameter::add_stride(::google::protobuf::uint32 value) { + stride_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.ConvolutionParameter.stride) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +ConvolutionParameter::stride() const { + // @@protoc_insertion_point(field_list:ditcaffe.ConvolutionParameter.stride) + return stride_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +ConvolutionParameter::mutable_stride() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.ConvolutionParameter.dilation) +} +inline void ConvolutionParameter::add_dilation(::google::protobuf::uint32 value) { + dilation_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.ConvolutionParameter.dilation) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +ConvolutionParameter::dilation() const { + // @@protoc_insertion_point(field_list:ditcaffe.ConvolutionParameter.dilation) + return dilation_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +ConvolutionParameter::mutable_dilation() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.ConvolutionParameter.group) + return group_; +} +inline void ConvolutionParameter::set_group(::google::protobuf::uint32 value) { + set_has_group(); + group_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.ConvolutionParameter.group) +} + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_weight_filler(); +} +inline const ::ditcaffe::FillerParameter& ConvolutionParameter::weight_filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.ConvolutionParameter.weight_filler) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return weight_filler_ != NULL ? *weight_filler_ : *default_instance().weight_filler_; +#else + return weight_filler_ != NULL ? *weight_filler_ : *default_instance_->weight_filler_; +#endif +} +inline ::ditcaffe::FillerParameter* ConvolutionParameter::mutable_weight_filler() { + set_has_weight_filler(); + if (weight_filler_ == NULL) { + weight_filler_ = new ::ditcaffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.ConvolutionParameter.weight_filler) + return weight_filler_; +} +inline ::ditcaffe::FillerParameter* ConvolutionParameter::release_weight_filler() { + // @@protoc_insertion_point(field_release:ditcaffe.ConvolutionParameter.weight_filler) + clear_has_weight_filler(); + ::ditcaffe::FillerParameter* temp = weight_filler_; + weight_filler_ = NULL; + return temp; +} +inline void ConvolutionParameter::set_allocated_weight_filler(::ditcaffe::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:ditcaffe.ConvolutionParameter.weight_filler) +} + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_bias_filler(); +} +inline const ::ditcaffe::FillerParameter& ConvolutionParameter::bias_filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.ConvolutionParameter.bias_filler) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return bias_filler_ != NULL ? *bias_filler_ : *default_instance().bias_filler_; +#else + return bias_filler_ != NULL ? *bias_filler_ : *default_instance_->bias_filler_; +#endif +} +inline ::ditcaffe::FillerParameter* ConvolutionParameter::mutable_bias_filler() { + set_has_bias_filler(); + if (bias_filler_ == NULL) { + bias_filler_ = new ::ditcaffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.ConvolutionParameter.bias_filler) + return bias_filler_; +} +inline ::ditcaffe::FillerParameter* ConvolutionParameter::release_bias_filler() { + // @@protoc_insertion_point(field_release:ditcaffe.ConvolutionParameter.bias_filler) + clear_has_bias_filler(); + ::ditcaffe::FillerParameter* temp = bias_filler_; + bias_filler_ = NULL; + return temp; +} +inline void ConvolutionParameter::set_allocated_bias_filler(::ditcaffe::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:ditcaffe.ConvolutionParameter.bias_filler) +} + +// optional .ditcaffe.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 ::ditcaffe::ConvolutionParameter_Engine ConvolutionParameter::engine() const { + // @@protoc_insertion_point(field_get:ditcaffe.ConvolutionParameter.engine) + return static_cast< ::ditcaffe::ConvolutionParameter_Engine >(engine_); +} +inline void ConvolutionParameter::set_engine(::ditcaffe::ConvolutionParameter_Engine value) { + assert(::ditcaffe::ConvolutionParameter_Engine_IsValid(value)); + set_has_engine(); + engine_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.ConvolutionParameter.axis) + return axis_; +} +inline void ConvolutionParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.ConvolutionParameter.force_nd_im2col) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.CropParameter.axis) + return axis_; +} +inline void CropParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.CropParameter.offset) +} +inline void CropParameter::add_offset(::google::protobuf::uint32 value) { + offset_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.CropParameter.offset) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +CropParameter::offset() const { + // @@protoc_insertion_point(field_list:ditcaffe.CropParameter.offset) + return offset_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +CropParameter::mutable_offset() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.CropParameter.offset) + return &offset_; +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.DataParameter.source) +} +inline ::std::string* DataParameter::mutable_source() { + set_has_source(); + // @@protoc_insertion_point(field_mutable:ditcaffe.DataParameter.source) + return source_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* DataParameter::release_source() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.DataParameter.rand_skip) +} + +// optional .ditcaffe.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 ::ditcaffe::DataParameter_DB DataParameter::backend() const { + // @@protoc_insertion_point(field_get:ditcaffe.DataParameter.backend) + return static_cast< ::ditcaffe::DataParameter_DB >(backend_); +} +inline void DataParameter::set_backend(::ditcaffe::DataParameter_DB value) { + assert(::ditcaffe::DataParameter_DB_IsValid(value)); + set_has_backend(); + backend_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.DataParameter.scale) + return scale_; +} +inline void DataParameter::set_scale(float value) { + set_has_scale(); + scale_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.DataParameter.mean_file) +} +inline ::std::string* DataParameter::mutable_mean_file() { + set_has_mean_file(); + // @@protoc_insertion_point(field_mutable:ditcaffe.DataParameter.mean_file) + return mean_file_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* DataParameter::release_mean_file() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.DataParameter.mirror) + return mirror_; +} +inline void DataParameter::set_mirror(bool value) { + set_has_mirror(); + mirror_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.DataParameter.prefetch) + return prefetch_; +} +inline void DataParameter::set_prefetch(::google::protobuf::uint32 value) { + set_has_prefetch(); + prefetch_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.DataParameter.prefetch) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.DropoutParameter.dropout_ratio) +} + +// ------------------------------------------------------------------- + +// DummyDataParameter + +// repeated .ditcaffe.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 ::ditcaffe::FillerParameter& DummyDataParameter::data_filler(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.DummyDataParameter.data_filler) + return data_filler_.Get(index); +} +inline ::ditcaffe::FillerParameter* DummyDataParameter::mutable_data_filler(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.DummyDataParameter.data_filler) + return data_filler_.Mutable(index); +} +inline ::ditcaffe::FillerParameter* DummyDataParameter::add_data_filler() { + // @@protoc_insertion_point(field_add:ditcaffe.DummyDataParameter.data_filler) + return data_filler_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::FillerParameter >* +DummyDataParameter::mutable_data_filler() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.DummyDataParameter.data_filler) + return &data_filler_; +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::FillerParameter >& +DummyDataParameter::data_filler() const { + // @@protoc_insertion_point(field_list:ditcaffe.DummyDataParameter.data_filler) + return data_filler_; +} + +// repeated .ditcaffe.BlobShape shape = 6; +inline int DummyDataParameter::shape_size() const { + return shape_.size(); +} +inline void DummyDataParameter::clear_shape() { + shape_.Clear(); +} +inline const ::ditcaffe::BlobShape& DummyDataParameter::shape(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.DummyDataParameter.shape) + return shape_.Get(index); +} +inline ::ditcaffe::BlobShape* DummyDataParameter::mutable_shape(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.DummyDataParameter.shape) + return shape_.Mutable(index); +} +inline ::ditcaffe::BlobShape* DummyDataParameter::add_shape() { + // @@protoc_insertion_point(field_add:ditcaffe.DummyDataParameter.shape) + return shape_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobShape >* +DummyDataParameter::mutable_shape() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.DummyDataParameter.shape) + return &shape_; +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobShape >& +DummyDataParameter::shape() const { + // @@protoc_insertion_point(field_list:ditcaffe.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:ditcaffe.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:ditcaffe.DummyDataParameter.num) +} +inline void DummyDataParameter::add_num(::google::protobuf::uint32 value) { + num_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.DummyDataParameter.num) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +DummyDataParameter::num() const { + // @@protoc_insertion_point(field_list:ditcaffe.DummyDataParameter.num) + return num_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +DummyDataParameter::mutable_num() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.DummyDataParameter.channels) +} +inline void DummyDataParameter::add_channels(::google::protobuf::uint32 value) { + channels_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.DummyDataParameter.channels) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +DummyDataParameter::channels() const { + // @@protoc_insertion_point(field_list:ditcaffe.DummyDataParameter.channels) + return channels_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +DummyDataParameter::mutable_channels() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.DummyDataParameter.height) +} +inline void DummyDataParameter::add_height(::google::protobuf::uint32 value) { + height_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.DummyDataParameter.height) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +DummyDataParameter::height() const { + // @@protoc_insertion_point(field_list:ditcaffe.DummyDataParameter.height) + return height_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +DummyDataParameter::mutable_height() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.DummyDataParameter.width) +} +inline void DummyDataParameter::add_width(::google::protobuf::uint32 value) { + width_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.DummyDataParameter.width) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +DummyDataParameter::width() const { + // @@protoc_insertion_point(field_list:ditcaffe.DummyDataParameter.width) + return width_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +DummyDataParameter::mutable_width() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.DummyDataParameter.width) + return &width_; +} + +// ------------------------------------------------------------------- + +// EltwiseParameter + +// optional .ditcaffe.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 ::ditcaffe::EltwiseParameter_EltwiseOp EltwiseParameter::operation() const { + // @@protoc_insertion_point(field_get:ditcaffe.EltwiseParameter.operation) + return static_cast< ::ditcaffe::EltwiseParameter_EltwiseOp >(operation_); +} +inline void EltwiseParameter::set_operation(::ditcaffe::EltwiseParameter_EltwiseOp value) { + assert(::ditcaffe::EltwiseParameter_EltwiseOp_IsValid(value)); + set_has_operation(); + operation_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.EltwiseParameter.coeff) + return coeff_.Get(index); +} +inline void EltwiseParameter::set_coeff(int index, float value) { + coeff_.Set(index, value); + // @@protoc_insertion_point(field_set:ditcaffe.EltwiseParameter.coeff) +} +inline void EltwiseParameter::add_coeff(float value) { + coeff_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.EltwiseParameter.coeff) +} +inline const ::google::protobuf::RepeatedField< float >& +EltwiseParameter::coeff() const { + // @@protoc_insertion_point(field_list:ditcaffe.EltwiseParameter.coeff) + return coeff_; +} +inline ::google::protobuf::RepeatedField< float >* +EltwiseParameter::mutable_coeff() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.EltwiseParameter.stable_prod_grad) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.ELUParameter.alpha) + return alpha_; +} +inline void ELUParameter::set_alpha(float value) { + set_has_alpha(); + alpha_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.ELUParameter.alpha) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.EmbedParameter.bias_term) +} + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_weight_filler(); +} +inline const ::ditcaffe::FillerParameter& EmbedParameter::weight_filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.EmbedParameter.weight_filler) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return weight_filler_ != NULL ? *weight_filler_ : *default_instance().weight_filler_; +#else + return weight_filler_ != NULL ? *weight_filler_ : *default_instance_->weight_filler_; +#endif +} +inline ::ditcaffe::FillerParameter* EmbedParameter::mutable_weight_filler() { + set_has_weight_filler(); + if (weight_filler_ == NULL) { + weight_filler_ = new ::ditcaffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.EmbedParameter.weight_filler) + return weight_filler_; +} +inline ::ditcaffe::FillerParameter* EmbedParameter::release_weight_filler() { + // @@protoc_insertion_point(field_release:ditcaffe.EmbedParameter.weight_filler) + clear_has_weight_filler(); + ::ditcaffe::FillerParameter* temp = weight_filler_; + weight_filler_ = NULL; + return temp; +} +inline void EmbedParameter::set_allocated_weight_filler(::ditcaffe::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:ditcaffe.EmbedParameter.weight_filler) +} + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_bias_filler(); +} +inline const ::ditcaffe::FillerParameter& EmbedParameter::bias_filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.EmbedParameter.bias_filler) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return bias_filler_ != NULL ? *bias_filler_ : *default_instance().bias_filler_; +#else + return bias_filler_ != NULL ? *bias_filler_ : *default_instance_->bias_filler_; +#endif +} +inline ::ditcaffe::FillerParameter* EmbedParameter::mutable_bias_filler() { + set_has_bias_filler(); + if (bias_filler_ == NULL) { + bias_filler_ = new ::ditcaffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.EmbedParameter.bias_filler) + return bias_filler_; +} +inline ::ditcaffe::FillerParameter* EmbedParameter::release_bias_filler() { + // @@protoc_insertion_point(field_release:ditcaffe.EmbedParameter.bias_filler) + clear_has_bias_filler(); + ::ditcaffe::FillerParameter* temp = bias_filler_; + bias_filler_ = NULL; + return temp; +} +inline void EmbedParameter::set_allocated_bias_filler(::ditcaffe::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:ditcaffe.EmbedParameter.bias_filler) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.ExpParameter.base) + return base_; +} +inline void ExpParameter::set_base(float value) { + set_has_base(); + base_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.ExpParameter.scale) + return scale_; +} +inline void ExpParameter::set_scale(float value) { + set_has_scale(); + scale_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.ExpParameter.shift) + return shift_; +} +inline void ExpParameter::set_shift(float value) { + set_has_shift(); + shift_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.ExpParameter.shift) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.FlattenParameter.axis) + return axis_; +} +inline void FlattenParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.FlattenParameter.end_axis) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.HDF5DataParameter.source) +} +inline ::std::string* HDF5DataParameter::mutable_source() { + set_has_source(); + // @@protoc_insertion_point(field_mutable:ditcaffe.HDF5DataParameter.source) + return source_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* HDF5DataParameter::release_source() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.HDF5DataParameter.shuffle) + return shuffle_; +} +inline void HDF5DataParameter::set_shuffle(bool value) { + set_has_shuffle(); + shuffle_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.HDF5DataParameter.shuffle) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.HDF5OutputParameter.file_name) +} +inline ::std::string* HDF5OutputParameter::mutable_file_name() { + set_has_file_name(); + // @@protoc_insertion_point(field_mutable:ditcaffe.HDF5OutputParameter.file_name) + return file_name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* HDF5OutputParameter::release_file_name() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.HDF5OutputParameter.file_name) +} + +// ------------------------------------------------------------------- + +// HingeLossParameter + +// optional .ditcaffe.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 ::ditcaffe::HingeLossParameter_Norm HingeLossParameter::norm() const { + // @@protoc_insertion_point(field_get:ditcaffe.HingeLossParameter.norm) + return static_cast< ::ditcaffe::HingeLossParameter_Norm >(norm_); +} +inline void HingeLossParameter::set_norm(::ditcaffe::HingeLossParameter_Norm value) { + assert(::ditcaffe::HingeLossParameter_Norm_IsValid(value)); + set_has_norm(); + norm_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.HingeLossParameter.norm) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.ImageDataParameter.source) +} +inline ::std::string* ImageDataParameter::mutable_source() { + set_has_source(); + // @@protoc_insertion_point(field_mutable:ditcaffe.ImageDataParameter.source) + return source_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* ImageDataParameter::release_source() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.ImageDataParameter.shuffle) + return shuffle_; +} +inline void ImageDataParameter::set_shuffle(bool value) { + set_has_shuffle(); + shuffle_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.ImageDataParameter.scale) + return scale_; +} +inline void ImageDataParameter::set_scale(float value) { + set_has_scale(); + scale_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.ImageDataParameter.mean_file) +} +inline ::std::string* ImageDataParameter::mutable_mean_file() { + set_has_mean_file(); + // @@protoc_insertion_point(field_mutable:ditcaffe.ImageDataParameter.mean_file) + return mean_file_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* ImageDataParameter::release_mean_file() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.ImageDataParameter.mirror) + return mirror_; +} +inline void ImageDataParameter::set_mirror(bool value) { + set_has_mirror(); + mirror_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.ImageDataParameter.root_folder) +} +inline ::std::string* ImageDataParameter::mutable_root_folder() { + set_has_root_folder(); + // @@protoc_insertion_point(field_mutable:ditcaffe.ImageDataParameter.root_folder) + return root_folder_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* ImageDataParameter::release_root_folder() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.ImageDataParameter.root_folder) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.InfogainLossParameter.source) +} +inline ::std::string* InfogainLossParameter::mutable_source() { + set_has_source(); + // @@protoc_insertion_point(field_mutable:ditcaffe.InfogainLossParameter.source) + return source_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* InfogainLossParameter::release_source() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.InfogainLossParameter.source) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.InnerProductParameter.bias_term) +} + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_weight_filler(); +} +inline const ::ditcaffe::FillerParameter& InnerProductParameter::weight_filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.InnerProductParameter.weight_filler) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return weight_filler_ != NULL ? *weight_filler_ : *default_instance().weight_filler_; +#else + return weight_filler_ != NULL ? *weight_filler_ : *default_instance_->weight_filler_; +#endif +} +inline ::ditcaffe::FillerParameter* InnerProductParameter::mutable_weight_filler() { + set_has_weight_filler(); + if (weight_filler_ == NULL) { + weight_filler_ = new ::ditcaffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.InnerProductParameter.weight_filler) + return weight_filler_; +} +inline ::ditcaffe::FillerParameter* InnerProductParameter::release_weight_filler() { + // @@protoc_insertion_point(field_release:ditcaffe.InnerProductParameter.weight_filler) + clear_has_weight_filler(); + ::ditcaffe::FillerParameter* temp = weight_filler_; + weight_filler_ = NULL; + return temp; +} +inline void InnerProductParameter::set_allocated_weight_filler(::ditcaffe::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:ditcaffe.InnerProductParameter.weight_filler) +} + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_bias_filler(); +} +inline const ::ditcaffe::FillerParameter& InnerProductParameter::bias_filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.InnerProductParameter.bias_filler) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return bias_filler_ != NULL ? *bias_filler_ : *default_instance().bias_filler_; +#else + return bias_filler_ != NULL ? *bias_filler_ : *default_instance_->bias_filler_; +#endif +} +inline ::ditcaffe::FillerParameter* InnerProductParameter::mutable_bias_filler() { + set_has_bias_filler(); + if (bias_filler_ == NULL) { + bias_filler_ = new ::ditcaffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.InnerProductParameter.bias_filler) + return bias_filler_; +} +inline ::ditcaffe::FillerParameter* InnerProductParameter::release_bias_filler() { + // @@protoc_insertion_point(field_release:ditcaffe.InnerProductParameter.bias_filler) + clear_has_bias_filler(); + ::ditcaffe::FillerParameter* temp = bias_filler_; + bias_filler_ = NULL; + return temp; +} +inline void InnerProductParameter::set_allocated_bias_filler(::ditcaffe::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:ditcaffe.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:ditcaffe.InnerProductParameter.axis) + return axis_; +} +inline void InnerProductParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.InnerProductParameter.transpose) + return transpose_; +} +inline void InnerProductParameter::set_transpose(bool value) { + set_has_transpose(); + transpose_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.InnerProductParameter.transpose) +} + +// ------------------------------------------------------------------- + +// InputParameter + +// repeated .ditcaffe.BlobShape shape = 1; +inline int InputParameter::shape_size() const { + return shape_.size(); +} +inline void InputParameter::clear_shape() { + shape_.Clear(); +} +inline const ::ditcaffe::BlobShape& InputParameter::shape(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.InputParameter.shape) + return shape_.Get(index); +} +inline ::ditcaffe::BlobShape* InputParameter::mutable_shape(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.InputParameter.shape) + return shape_.Mutable(index); +} +inline ::ditcaffe::BlobShape* InputParameter::add_shape() { + // @@protoc_insertion_point(field_add:ditcaffe.InputParameter.shape) + return shape_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobShape >* +InputParameter::mutable_shape() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.InputParameter.shape) + return &shape_; +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobShape >& +InputParameter::shape() const { + // @@protoc_insertion_point(field_list:ditcaffe.InputParameter.shape) + return shape_; +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.LogParameter.base) + return base_; +} +inline void LogParameter::set_base(float value) { + set_has_base(); + base_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.LogParameter.scale) + return scale_; +} +inline void LogParameter::set_scale(float value) { + set_has_scale(); + scale_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.LogParameter.shift) + return shift_; +} +inline void LogParameter::set_shift(float value) { + set_has_shift(); + shift_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.LogParameter.shift) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.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:ditcaffe.LRNParameter.alpha) + return alpha_; +} +inline void LRNParameter::set_alpha(float value) { + set_has_alpha(); + alpha_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.LRNParameter.beta) + return beta_; +} +inline void LRNParameter::set_beta(float value) { + set_has_beta(); + beta_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.LRNParameter.beta) +} + +// optional .ditcaffe.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 ::ditcaffe::LRNParameter_NormRegion LRNParameter::norm_region() const { + // @@protoc_insertion_point(field_get:ditcaffe.LRNParameter.norm_region) + return static_cast< ::ditcaffe::LRNParameter_NormRegion >(norm_region_); +} +inline void LRNParameter::set_norm_region(::ditcaffe::LRNParameter_NormRegion value) { + assert(::ditcaffe::LRNParameter_NormRegion_IsValid(value)); + set_has_norm_region(); + norm_region_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.LRNParameter.k) + return k_; +} +inline void LRNParameter::set_k(float value) { + set_has_k(); + k_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.LRNParameter.k) +} + +// optional .ditcaffe.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 ::ditcaffe::LRNParameter_Engine LRNParameter::engine() const { + // @@protoc_insertion_point(field_get:ditcaffe.LRNParameter.engine) + return static_cast< ::ditcaffe::LRNParameter_Engine >(engine_); +} +inline void LRNParameter::set_engine(::ditcaffe::LRNParameter_Engine value) { + assert(::ditcaffe::LRNParameter_Engine_IsValid(value)); + set_has_engine(); + engine_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.LRNParameter.engine) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.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:ditcaffe.MemoryDataParameter.channels) + return channels_; +} +inline void MemoryDataParameter::set_channels(::google::protobuf::uint32 value) { + set_has_channels(); + channels_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.MemoryDataParameter.height) + return height_; +} +inline void MemoryDataParameter::set_height(::google::protobuf::uint32 value) { + set_has_height(); + height_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.MemoryDataParameter.width) + return width_; +} +inline void MemoryDataParameter::set_width(::google::protobuf::uint32 value) { + set_has_width(); + width_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.MemoryDataParameter.width) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.MVNParameter.eps) + return eps_; +} +inline void MVNParameter::set_eps(float value) { + set_has_eps(); + eps_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.MVNParameter.eps) +} + +// ------------------------------------------------------------------- + +// ParameterParameter + +// optional .ditcaffe.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_->::ditcaffe::BlobShape::Clear(); + clear_has_shape(); +} +inline const ::ditcaffe::BlobShape& ParameterParameter::shape() const { + // @@protoc_insertion_point(field_get:ditcaffe.ParameterParameter.shape) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return shape_ != NULL ? *shape_ : *default_instance().shape_; +#else + return shape_ != NULL ? *shape_ : *default_instance_->shape_; +#endif +} +inline ::ditcaffe::BlobShape* ParameterParameter::mutable_shape() { + set_has_shape(); + if (shape_ == NULL) { + shape_ = new ::ditcaffe::BlobShape; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.ParameterParameter.shape) + return shape_; +} +inline ::ditcaffe::BlobShape* ParameterParameter::release_shape() { + // @@protoc_insertion_point(field_release:ditcaffe.ParameterParameter.shape) + clear_has_shape(); + ::ditcaffe::BlobShape* temp = shape_; + shape_ = NULL; + return temp; +} +inline void ParameterParameter::set_allocated_shape(::ditcaffe::BlobShape* shape) { + delete shape_; + shape_ = shape; + if (shape) { + set_has_shape(); + } else { + clear_has_shape(); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.ParameterParameter.shape) +} + +// ------------------------------------------------------------------- + +// PoolingParameter + +// optional .ditcaffe.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 ::ditcaffe::PoolingParameter_PoolMethod PoolingParameter::pool() const { + // @@protoc_insertion_point(field_get:ditcaffe.PoolingParameter.pool) + return static_cast< ::ditcaffe::PoolingParameter_PoolMethod >(pool_); +} +inline void PoolingParameter::set_pool(::ditcaffe::PoolingParameter_PoolMethod value) { + assert(::ditcaffe::PoolingParameter_PoolMethod_IsValid(value)); + set_has_pool(); + pool_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.PoolingParameter.pad) + return pad_; +} +inline void PoolingParameter::set_pad(::google::protobuf::uint32 value) { + set_has_pad(); + pad_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.PoolingParameter.stride) + return stride_; +} +inline void PoolingParameter::set_stride(::google::protobuf::uint32 value) { + set_has_stride(); + stride_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.PoolingParameter.stride_w) +} + +// optional .ditcaffe.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 ::ditcaffe::PoolingParameter_Engine PoolingParameter::engine() const { + // @@protoc_insertion_point(field_get:ditcaffe.PoolingParameter.engine) + return static_cast< ::ditcaffe::PoolingParameter_Engine >(engine_); +} +inline void PoolingParameter::set_engine(::ditcaffe::PoolingParameter_Engine value) { + assert(::ditcaffe::PoolingParameter_Engine_IsValid(value)); + set_has_engine(); + engine_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.PoolingParameter.global_pooling) +} + +// optional bool torch_pooling = 40 [default = false]; +inline bool PoolingParameter::has_torch_pooling() const { + return (_has_bits_[0] & 0x00001000u) != 0; +} +inline void PoolingParameter::set_has_torch_pooling() { + _has_bits_[0] |= 0x00001000u; +} +inline void PoolingParameter::clear_has_torch_pooling() { + _has_bits_[0] &= ~0x00001000u; +} +inline void PoolingParameter::clear_torch_pooling() { + torch_pooling_ = false; + clear_has_torch_pooling(); +} +inline bool PoolingParameter::torch_pooling() const { + // @@protoc_insertion_point(field_get:ditcaffe.PoolingParameter.torch_pooling) + return torch_pooling_; +} +inline void PoolingParameter::set_torch_pooling(bool value) { + set_has_torch_pooling(); + torch_pooling_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.PoolingParameter.torch_pooling) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.PowerParameter.power) + return power_; +} +inline void PowerParameter::set_power(float value) { + set_has_power(); + power_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.PowerParameter.scale) + return scale_; +} +inline void PowerParameter::set_scale(float value) { + set_has_scale(); + scale_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.PowerParameter.shift) + return shift_; +} +inline void PowerParameter::set_shift(float value) { + set_has_shift(); + shift_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.PowerParameter.shift) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.PythonParameter.module) +} +inline ::std::string* PythonParameter::mutable_module() { + set_has_module(); + // @@protoc_insertion_point(field_mutable:ditcaffe.PythonParameter.module) + return module_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* PythonParameter::release_module() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.PythonParameter.layer) +} +inline ::std::string* PythonParameter::mutable_layer() { + set_has_layer(); + // @@protoc_insertion_point(field_mutable:ditcaffe.PythonParameter.layer) + return layer_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* PythonParameter::release_layer() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.PythonParameter.param_str) +} +inline ::std::string* PythonParameter::mutable_param_str() { + set_has_param_str(); + // @@protoc_insertion_point(field_mutable:ditcaffe.PythonParameter.param_str) + return param_str_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* PythonParameter::release_param_str() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.PythonParameter.share_in_parallel) +} + +// ------------------------------------------------------------------- + +// ReductionParameter + +// optional .ditcaffe.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 ::ditcaffe::ReductionParameter_ReductionOp ReductionParameter::operation() const { + // @@protoc_insertion_point(field_get:ditcaffe.ReductionParameter.operation) + return static_cast< ::ditcaffe::ReductionParameter_ReductionOp >(operation_); +} +inline void ReductionParameter::set_operation(::ditcaffe::ReductionParameter_ReductionOp value) { + assert(::ditcaffe::ReductionParameter_ReductionOp_IsValid(value)); + set_has_operation(); + operation_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.ReductionParameter.axis) + return axis_; +} +inline void ReductionParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.ReductionParameter.coeff) + return coeff_; +} +inline void ReductionParameter::set_coeff(float value) { + set_has_coeff(); + coeff_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.ReductionParameter.coeff) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.ReLUParameter.negative_slope) +} + +// optional .ditcaffe.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 ::ditcaffe::ReLUParameter_Engine ReLUParameter::engine() const { + // @@protoc_insertion_point(field_get:ditcaffe.ReLUParameter.engine) + return static_cast< ::ditcaffe::ReLUParameter_Engine >(engine_); +} +inline void ReLUParameter::set_engine(::ditcaffe::ReLUParameter_Engine value) { + assert(::ditcaffe::ReLUParameter_Engine_IsValid(value)); + set_has_engine(); + engine_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.ReLUParameter.engine) +} + +// ------------------------------------------------------------------- + +// ReshapeParameter + +// optional .ditcaffe.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_->::ditcaffe::BlobShape::Clear(); + clear_has_shape(); +} +inline const ::ditcaffe::BlobShape& ReshapeParameter::shape() const { + // @@protoc_insertion_point(field_get:ditcaffe.ReshapeParameter.shape) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return shape_ != NULL ? *shape_ : *default_instance().shape_; +#else + return shape_ != NULL ? *shape_ : *default_instance_->shape_; +#endif +} +inline ::ditcaffe::BlobShape* ReshapeParameter::mutable_shape() { + set_has_shape(); + if (shape_ == NULL) { + shape_ = new ::ditcaffe::BlobShape; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.ReshapeParameter.shape) + return shape_; +} +inline ::ditcaffe::BlobShape* ReshapeParameter::release_shape() { + // @@protoc_insertion_point(field_release:ditcaffe.ReshapeParameter.shape) + clear_has_shape(); + ::ditcaffe::BlobShape* temp = shape_; + shape_ = NULL; + return temp; +} +inline void ReshapeParameter::set_allocated_shape(::ditcaffe::BlobShape* shape) { + delete shape_; + shape_ = shape; + if (shape) { + set_has_shape(); + } else { + clear_has_shape(); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.ReshapeParameter.axis) + return axis_; +} +inline void ReshapeParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.ReshapeParameter.num_axes) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.ScaleParameter.axis) + return axis_; +} +inline void ScaleParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.ScaleParameter.num_axes) +} + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_filler(); +} +inline const ::ditcaffe::FillerParameter& ScaleParameter::filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.ScaleParameter.filler) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return filler_ != NULL ? *filler_ : *default_instance().filler_; +#else + return filler_ != NULL ? *filler_ : *default_instance_->filler_; +#endif +} +inline ::ditcaffe::FillerParameter* ScaleParameter::mutable_filler() { + set_has_filler(); + if (filler_ == NULL) { + filler_ = new ::ditcaffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.ScaleParameter.filler) + return filler_; +} +inline ::ditcaffe::FillerParameter* ScaleParameter::release_filler() { + // @@protoc_insertion_point(field_release:ditcaffe.ScaleParameter.filler) + clear_has_filler(); + ::ditcaffe::FillerParameter* temp = filler_; + filler_ = NULL; + return temp; +} +inline void ScaleParameter::set_allocated_filler(::ditcaffe::FillerParameter* filler) { + delete filler_; + filler_ = filler; + if (filler) { + set_has_filler(); + } else { + clear_has_filler(); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.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:ditcaffe.ScaleParameter.bias_term) +} + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_bias_filler(); +} +inline const ::ditcaffe::FillerParameter& ScaleParameter::bias_filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.ScaleParameter.bias_filler) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return bias_filler_ != NULL ? *bias_filler_ : *default_instance().bias_filler_; +#else + return bias_filler_ != NULL ? *bias_filler_ : *default_instance_->bias_filler_; +#endif +} +inline ::ditcaffe::FillerParameter* ScaleParameter::mutable_bias_filler() { + set_has_bias_filler(); + if (bias_filler_ == NULL) { + bias_filler_ = new ::ditcaffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.ScaleParameter.bias_filler) + return bias_filler_; +} +inline ::ditcaffe::FillerParameter* ScaleParameter::release_bias_filler() { + // @@protoc_insertion_point(field_release:ditcaffe.ScaleParameter.bias_filler) + clear_has_bias_filler(); + ::ditcaffe::FillerParameter* temp = bias_filler_; + bias_filler_ = NULL; + return temp; +} +inline void ScaleParameter::set_allocated_bias_filler(::ditcaffe::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:ditcaffe.ScaleParameter.bias_filler) +} + +// ------------------------------------------------------------------- + +// SigmoidParameter + +// optional .ditcaffe.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 ::ditcaffe::SigmoidParameter_Engine SigmoidParameter::engine() const { + // @@protoc_insertion_point(field_get:ditcaffe.SigmoidParameter.engine) + return static_cast< ::ditcaffe::SigmoidParameter_Engine >(engine_); +} +inline void SigmoidParameter::set_engine(::ditcaffe::SigmoidParameter_Engine value) { + assert(::ditcaffe::SigmoidParameter_Engine_IsValid(value)); + set_has_engine(); + engine_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.SigmoidParameter.engine) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.SliceParameter.axis) + return axis_; +} +inline void SliceParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.SliceParameter.slice_point) +} +inline void SliceParameter::add_slice_point(::google::protobuf::uint32 value) { + slice_point_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.SliceParameter.slice_point) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +SliceParameter::slice_point() const { + // @@protoc_insertion_point(field_list:ditcaffe.SliceParameter.slice_point) + return slice_point_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +SliceParameter::mutable_slice_point() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.SliceParameter.slice_dim) +} + +// ------------------------------------------------------------------- + +// SoftmaxParameter + +// optional .ditcaffe.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 ::ditcaffe::SoftmaxParameter_Engine SoftmaxParameter::engine() const { + // @@protoc_insertion_point(field_get:ditcaffe.SoftmaxParameter.engine) + return static_cast< ::ditcaffe::SoftmaxParameter_Engine >(engine_); +} +inline void SoftmaxParameter::set_engine(::ditcaffe::SoftmaxParameter_Engine value) { + assert(::ditcaffe::SoftmaxParameter_Engine_IsValid(value)); + set_has_engine(); + engine_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.SoftmaxParameter.axis) + return axis_; +} +inline void SoftmaxParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.SoftmaxParameter.axis) +} + +// ------------------------------------------------------------------- + +// TanHParameter + +// optional .ditcaffe.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 ::ditcaffe::TanHParameter_Engine TanHParameter::engine() const { + // @@protoc_insertion_point(field_get:ditcaffe.TanHParameter.engine) + return static_cast< ::ditcaffe::TanHParameter_Engine >(engine_); +} +inline void TanHParameter::set_engine(::ditcaffe::TanHParameter_Engine value) { + assert(::ditcaffe::TanHParameter_Engine_IsValid(value)); + set_has_engine(); + engine_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.TanHParameter.engine) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.TileParameter.axis) + return axis_; +} +inline void TileParameter::set_axis(::google::protobuf::int32 value) { + set_has_axis(); + axis_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.TileParameter.tiles) + return tiles_; +} +inline void TileParameter::set_tiles(::google::protobuf::int32 value) { + set_has_tiles(); + tiles_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.TileParameter.tiles) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.ThresholdParameter.threshold) + return threshold_; +} +inline void ThresholdParameter::set_threshold(float value) { + set_has_threshold(); + threshold_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.ThresholdParameter.threshold) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.WindowDataParameter.source) +} +inline ::std::string* WindowDataParameter::mutable_source() { + set_has_source(); + // @@protoc_insertion_point(field_mutable:ditcaffe.WindowDataParameter.source) + return source_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* WindowDataParameter::release_source() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.WindowDataParameter.scale) + return scale_; +} +inline void WindowDataParameter::set_scale(float value) { + set_has_scale(); + scale_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.WindowDataParameter.mean_file) +} +inline ::std::string* WindowDataParameter::mutable_mean_file() { + set_has_mean_file(); + // @@protoc_insertion_point(field_mutable:ditcaffe.WindowDataParameter.mean_file) + return mean_file_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* WindowDataParameter::release_mean_file() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.WindowDataParameter.mirror) + return mirror_; +} +inline void WindowDataParameter::set_mirror(bool value) { + set_has_mirror(); + mirror_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.WindowDataParameter.crop_mode) +} +inline ::std::string* WindowDataParameter::mutable_crop_mode() { + set_has_crop_mode(); + // @@protoc_insertion_point(field_mutable:ditcaffe.WindowDataParameter.crop_mode) + return crop_mode_.MutableNoArena(_default_crop_mode_); +} +inline ::std::string* WindowDataParameter::release_crop_mode() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.WindowDataParameter.root_folder) +} +inline ::std::string* WindowDataParameter::mutable_root_folder() { + set_has_root_folder(); + // @@protoc_insertion_point(field_mutable:ditcaffe.WindowDataParameter.root_folder) + return root_folder_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* WindowDataParameter::release_root_folder() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.WindowDataParameter.root_folder) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.SPPParameter.pyramid_height) +} + +// optional .ditcaffe.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 ::ditcaffe::SPPParameter_PoolMethod SPPParameter::pool() const { + // @@protoc_insertion_point(field_get:ditcaffe.SPPParameter.pool) + return static_cast< ::ditcaffe::SPPParameter_PoolMethod >(pool_); +} +inline void SPPParameter::set_pool(::ditcaffe::SPPParameter_PoolMethod value) { + assert(::ditcaffe::SPPParameter_PoolMethod_IsValid(value)); + set_has_pool(); + pool_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.SPPParameter.pool) +} + +// optional .ditcaffe.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 ::ditcaffe::SPPParameter_Engine SPPParameter::engine() const { + // @@protoc_insertion_point(field_get:ditcaffe.SPPParameter.engine) + return static_cast< ::ditcaffe::SPPParameter_Engine >(engine_); +} +inline void SPPParameter::set_engine(::ditcaffe::SPPParameter_Engine value) { + assert(::ditcaffe::SPPParameter_Engine_IsValid(value)); + set_has_engine(); + engine_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.SPPParameter.engine) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.V1LayerParameter.bottom) + return bottom_.Get(index); +} +inline ::std::string* V1LayerParameter::mutable_bottom(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.bottom) + return bottom_.Mutable(index); +} +inline void V1LayerParameter::set_bottom(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.V1LayerParameter.bottom) +} +inline ::std::string* V1LayerParameter::add_bottom() { + // @@protoc_insertion_point(field_add_mutable:ditcaffe.V1LayerParameter.bottom) + return bottom_.Add(); +} +inline void V1LayerParameter::add_bottom(const ::std::string& value) { + bottom_.Add()->assign(value); + // @@protoc_insertion_point(field_add:ditcaffe.V1LayerParameter.bottom) +} +inline void V1LayerParameter::add_bottom(const char* value) { + bottom_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:ditcaffe.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:ditcaffe.V1LayerParameter.bottom) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +V1LayerParameter::bottom() const { + // @@protoc_insertion_point(field_list:ditcaffe.V1LayerParameter.bottom) + return bottom_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +V1LayerParameter::mutable_bottom() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.V1LayerParameter.top) + return top_.Get(index); +} +inline ::std::string* V1LayerParameter::mutable_top(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.top) + return top_.Mutable(index); +} +inline void V1LayerParameter::set_top(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.V1LayerParameter.top) +} +inline ::std::string* V1LayerParameter::add_top() { + // @@protoc_insertion_point(field_add_mutable:ditcaffe.V1LayerParameter.top) + return top_.Add(); +} +inline void V1LayerParameter::add_top(const ::std::string& value) { + top_.Add()->assign(value); + // @@protoc_insertion_point(field_add:ditcaffe.V1LayerParameter.top) +} +inline void V1LayerParameter::add_top(const char* value) { + top_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:ditcaffe.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:ditcaffe.V1LayerParameter.top) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +V1LayerParameter::top() const { + // @@protoc_insertion_point(field_list:ditcaffe.V1LayerParameter.top) + return top_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +V1LayerParameter::mutable_top() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.V1LayerParameter.name) +} +inline ::std::string* V1LayerParameter::mutable_name() { + set_has_name(); + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.name) + return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* V1LayerParameter::release_name() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.V1LayerParameter.name) +} + +// repeated .ditcaffe.NetStateRule include = 32; +inline int V1LayerParameter::include_size() const { + return include_.size(); +} +inline void V1LayerParameter::clear_include() { + include_.Clear(); +} +inline const ::ditcaffe::NetStateRule& V1LayerParameter::include(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.include) + return include_.Get(index); +} +inline ::ditcaffe::NetStateRule* V1LayerParameter::mutable_include(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.include) + return include_.Mutable(index); +} +inline ::ditcaffe::NetStateRule* V1LayerParameter::add_include() { + // @@protoc_insertion_point(field_add:ditcaffe.V1LayerParameter.include) + return include_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >* +V1LayerParameter::mutable_include() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.V1LayerParameter.include) + return &include_; +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >& +V1LayerParameter::include() const { + // @@protoc_insertion_point(field_list:ditcaffe.V1LayerParameter.include) + return include_; +} + +// repeated .ditcaffe.NetStateRule exclude = 33; +inline int V1LayerParameter::exclude_size() const { + return exclude_.size(); +} +inline void V1LayerParameter::clear_exclude() { + exclude_.Clear(); +} +inline const ::ditcaffe::NetStateRule& V1LayerParameter::exclude(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.exclude) + return exclude_.Get(index); +} +inline ::ditcaffe::NetStateRule* V1LayerParameter::mutable_exclude(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.exclude) + return exclude_.Mutable(index); +} +inline ::ditcaffe::NetStateRule* V1LayerParameter::add_exclude() { + // @@protoc_insertion_point(field_add:ditcaffe.V1LayerParameter.exclude) + return exclude_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >* +V1LayerParameter::mutable_exclude() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.V1LayerParameter.exclude) + return &exclude_; +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::NetStateRule >& +V1LayerParameter::exclude() const { + // @@protoc_insertion_point(field_list:ditcaffe.V1LayerParameter.exclude) + return exclude_; +} + +// optional .ditcaffe.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 ::ditcaffe::V1LayerParameter_LayerType V1LayerParameter::type() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.type) + return static_cast< ::ditcaffe::V1LayerParameter_LayerType >(type_); +} +inline void V1LayerParameter::set_type(::ditcaffe::V1LayerParameter_LayerType value) { + assert(::ditcaffe::V1LayerParameter_LayerType_IsValid(value)); + set_has_type(); + type_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.V1LayerParameter.type) +} + +// repeated .ditcaffe.BlobProto blobs = 6; +inline int V1LayerParameter::blobs_size() const { + return blobs_.size(); +} +inline void V1LayerParameter::clear_blobs() { + blobs_.Clear(); +} +inline const ::ditcaffe::BlobProto& V1LayerParameter::blobs(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.blobs) + return blobs_.Get(index); +} +inline ::ditcaffe::BlobProto* V1LayerParameter::mutable_blobs(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.blobs) + return blobs_.Mutable(index); +} +inline ::ditcaffe::BlobProto* V1LayerParameter::add_blobs() { + // @@protoc_insertion_point(field_add:ditcaffe.V1LayerParameter.blobs) + return blobs_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >* +V1LayerParameter::mutable_blobs() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.V1LayerParameter.blobs) + return &blobs_; +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >& +V1LayerParameter::blobs() const { + // @@protoc_insertion_point(field_list:ditcaffe.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:ditcaffe.V1LayerParameter.param) + return param_.Get(index); +} +inline ::std::string* V1LayerParameter::mutable_param(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.param) + return param_.Mutable(index); +} +inline void V1LayerParameter::set_param(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.V1LayerParameter.param) +} +inline ::std::string* V1LayerParameter::add_param() { + // @@protoc_insertion_point(field_add_mutable:ditcaffe.V1LayerParameter.param) + return param_.Add(); +} +inline void V1LayerParameter::add_param(const ::std::string& value) { + param_.Add()->assign(value); + // @@protoc_insertion_point(field_add:ditcaffe.V1LayerParameter.param) +} +inline void V1LayerParameter::add_param(const char* value) { + param_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:ditcaffe.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:ditcaffe.V1LayerParameter.param) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +V1LayerParameter::param() const { + // @@protoc_insertion_point(field_list:ditcaffe.V1LayerParameter.param) + return param_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +V1LayerParameter::mutable_param() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.V1LayerParameter.param) + return ¶m_; +} + +// repeated .ditcaffe.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 ::ditcaffe::V1LayerParameter_DimCheckMode V1LayerParameter::blob_share_mode(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.blob_share_mode) + return static_cast< ::ditcaffe::V1LayerParameter_DimCheckMode >(blob_share_mode_.Get(index)); +} +inline void V1LayerParameter::set_blob_share_mode(int index, ::ditcaffe::V1LayerParameter_DimCheckMode value) { + assert(::ditcaffe::V1LayerParameter_DimCheckMode_IsValid(value)); + blob_share_mode_.Set(index, value); + // @@protoc_insertion_point(field_set:ditcaffe.V1LayerParameter.blob_share_mode) +} +inline void V1LayerParameter::add_blob_share_mode(::ditcaffe::V1LayerParameter_DimCheckMode value) { + assert(::ditcaffe::V1LayerParameter_DimCheckMode_IsValid(value)); + blob_share_mode_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.V1LayerParameter.blob_share_mode) +} +inline const ::google::protobuf::RepeatedField& +V1LayerParameter::blob_share_mode() const { + // @@protoc_insertion_point(field_list:ditcaffe.V1LayerParameter.blob_share_mode) + return blob_share_mode_; +} +inline ::google::protobuf::RepeatedField* +V1LayerParameter::mutable_blob_share_mode() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.V1LayerParameter.blobs_lr) +} +inline void V1LayerParameter::add_blobs_lr(float value) { + blobs_lr_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.V1LayerParameter.blobs_lr) +} +inline const ::google::protobuf::RepeatedField< float >& +V1LayerParameter::blobs_lr() const { + // @@protoc_insertion_point(field_list:ditcaffe.V1LayerParameter.blobs_lr) + return blobs_lr_; +} +inline ::google::protobuf::RepeatedField< float >* +V1LayerParameter::mutable_blobs_lr() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.V1LayerParameter.weight_decay) +} +inline void V1LayerParameter::add_weight_decay(float value) { + weight_decay_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.V1LayerParameter.weight_decay) +} +inline const ::google::protobuf::RepeatedField< float >& +V1LayerParameter::weight_decay() const { + // @@protoc_insertion_point(field_list:ditcaffe.V1LayerParameter.weight_decay) + return weight_decay_; +} +inline ::google::protobuf::RepeatedField< float >* +V1LayerParameter::mutable_weight_decay() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.V1LayerParameter.loss_weight) +} +inline void V1LayerParameter::add_loss_weight(float value) { + loss_weight_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.V1LayerParameter.loss_weight) +} +inline const ::google::protobuf::RepeatedField< float >& +V1LayerParameter::loss_weight() const { + // @@protoc_insertion_point(field_list:ditcaffe.V1LayerParameter.loss_weight) + return loss_weight_; +} +inline ::google::protobuf::RepeatedField< float >* +V1LayerParameter::mutable_loss_weight() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.V1LayerParameter.loss_weight) + return &loss_weight_; +} + +// optional .ditcaffe.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_->::ditcaffe::AccuracyParameter::Clear(); + clear_has_accuracy_param(); +} +inline const ::ditcaffe::AccuracyParameter& V1LayerParameter::accuracy_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.accuracy_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return accuracy_param_ != NULL ? *accuracy_param_ : *default_instance().accuracy_param_; +#else + return accuracy_param_ != NULL ? *accuracy_param_ : *default_instance_->accuracy_param_; +#endif +} +inline ::ditcaffe::AccuracyParameter* V1LayerParameter::mutable_accuracy_param() { + set_has_accuracy_param(); + if (accuracy_param_ == NULL) { + accuracy_param_ = new ::ditcaffe::AccuracyParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.accuracy_param) + return accuracy_param_; +} +inline ::ditcaffe::AccuracyParameter* V1LayerParameter::release_accuracy_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.accuracy_param) + clear_has_accuracy_param(); + ::ditcaffe::AccuracyParameter* temp = accuracy_param_; + accuracy_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_accuracy_param(::ditcaffe::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:ditcaffe.V1LayerParameter.accuracy_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ArgMaxParameter::Clear(); + clear_has_argmax_param(); +} +inline const ::ditcaffe::ArgMaxParameter& V1LayerParameter::argmax_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.argmax_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return argmax_param_ != NULL ? *argmax_param_ : *default_instance().argmax_param_; +#else + return argmax_param_ != NULL ? *argmax_param_ : *default_instance_->argmax_param_; +#endif +} +inline ::ditcaffe::ArgMaxParameter* V1LayerParameter::mutable_argmax_param() { + set_has_argmax_param(); + if (argmax_param_ == NULL) { + argmax_param_ = new ::ditcaffe::ArgMaxParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.argmax_param) + return argmax_param_; +} +inline ::ditcaffe::ArgMaxParameter* V1LayerParameter::release_argmax_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.argmax_param) + clear_has_argmax_param(); + ::ditcaffe::ArgMaxParameter* temp = argmax_param_; + argmax_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_argmax_param(::ditcaffe::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:ditcaffe.V1LayerParameter.argmax_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ConcatParameter::Clear(); + clear_has_concat_param(); +} +inline const ::ditcaffe::ConcatParameter& V1LayerParameter::concat_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.concat_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return concat_param_ != NULL ? *concat_param_ : *default_instance().concat_param_; +#else + return concat_param_ != NULL ? *concat_param_ : *default_instance_->concat_param_; +#endif +} +inline ::ditcaffe::ConcatParameter* V1LayerParameter::mutable_concat_param() { + set_has_concat_param(); + if (concat_param_ == NULL) { + concat_param_ = new ::ditcaffe::ConcatParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.concat_param) + return concat_param_; +} +inline ::ditcaffe::ConcatParameter* V1LayerParameter::release_concat_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.concat_param) + clear_has_concat_param(); + ::ditcaffe::ConcatParameter* temp = concat_param_; + concat_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_concat_param(::ditcaffe::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:ditcaffe.V1LayerParameter.concat_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ContrastiveLossParameter::Clear(); + clear_has_contrastive_loss_param(); +} +inline const ::ditcaffe::ContrastiveLossParameter& V1LayerParameter::contrastive_loss_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.contrastive_loss_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return contrastive_loss_param_ != NULL ? *contrastive_loss_param_ : *default_instance().contrastive_loss_param_; +#else + return contrastive_loss_param_ != NULL ? *contrastive_loss_param_ : *default_instance_->contrastive_loss_param_; +#endif +} +inline ::ditcaffe::ContrastiveLossParameter* V1LayerParameter::mutable_contrastive_loss_param() { + set_has_contrastive_loss_param(); + if (contrastive_loss_param_ == NULL) { + contrastive_loss_param_ = new ::ditcaffe::ContrastiveLossParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.contrastive_loss_param) + return contrastive_loss_param_; +} +inline ::ditcaffe::ContrastiveLossParameter* V1LayerParameter::release_contrastive_loss_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.contrastive_loss_param) + clear_has_contrastive_loss_param(); + ::ditcaffe::ContrastiveLossParameter* temp = contrastive_loss_param_; + contrastive_loss_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_contrastive_loss_param(::ditcaffe::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:ditcaffe.V1LayerParameter.contrastive_loss_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ConvolutionParameter::Clear(); + clear_has_convolution_param(); +} +inline const ::ditcaffe::ConvolutionParameter& V1LayerParameter::convolution_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.convolution_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return convolution_param_ != NULL ? *convolution_param_ : *default_instance().convolution_param_; +#else + return convolution_param_ != NULL ? *convolution_param_ : *default_instance_->convolution_param_; +#endif +} +inline ::ditcaffe::ConvolutionParameter* V1LayerParameter::mutable_convolution_param() { + set_has_convolution_param(); + if (convolution_param_ == NULL) { + convolution_param_ = new ::ditcaffe::ConvolutionParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.convolution_param) + return convolution_param_; +} +inline ::ditcaffe::ConvolutionParameter* V1LayerParameter::release_convolution_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.convolution_param) + clear_has_convolution_param(); + ::ditcaffe::ConvolutionParameter* temp = convolution_param_; + convolution_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_convolution_param(::ditcaffe::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:ditcaffe.V1LayerParameter.convolution_param) +} + +// optional .ditcaffe.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_->::ditcaffe::DataParameter::Clear(); + clear_has_data_param(); +} +inline const ::ditcaffe::DataParameter& V1LayerParameter::data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.data_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return data_param_ != NULL ? *data_param_ : *default_instance().data_param_; +#else + return data_param_ != NULL ? *data_param_ : *default_instance_->data_param_; +#endif +} +inline ::ditcaffe::DataParameter* V1LayerParameter::mutable_data_param() { + set_has_data_param(); + if (data_param_ == NULL) { + data_param_ = new ::ditcaffe::DataParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.data_param) + return data_param_; +} +inline ::ditcaffe::DataParameter* V1LayerParameter::release_data_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.data_param) + clear_has_data_param(); + ::ditcaffe::DataParameter* temp = data_param_; + data_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_data_param(::ditcaffe::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:ditcaffe.V1LayerParameter.data_param) +} + +// optional .ditcaffe.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_->::ditcaffe::DropoutParameter::Clear(); + clear_has_dropout_param(); +} +inline const ::ditcaffe::DropoutParameter& V1LayerParameter::dropout_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.dropout_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return dropout_param_ != NULL ? *dropout_param_ : *default_instance().dropout_param_; +#else + return dropout_param_ != NULL ? *dropout_param_ : *default_instance_->dropout_param_; +#endif +} +inline ::ditcaffe::DropoutParameter* V1LayerParameter::mutable_dropout_param() { + set_has_dropout_param(); + if (dropout_param_ == NULL) { + dropout_param_ = new ::ditcaffe::DropoutParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.dropout_param) + return dropout_param_; +} +inline ::ditcaffe::DropoutParameter* V1LayerParameter::release_dropout_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.dropout_param) + clear_has_dropout_param(); + ::ditcaffe::DropoutParameter* temp = dropout_param_; + dropout_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_dropout_param(::ditcaffe::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:ditcaffe.V1LayerParameter.dropout_param) +} + +// optional .ditcaffe.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_->::ditcaffe::DummyDataParameter::Clear(); + clear_has_dummy_data_param(); +} +inline const ::ditcaffe::DummyDataParameter& V1LayerParameter::dummy_data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.dummy_data_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return dummy_data_param_ != NULL ? *dummy_data_param_ : *default_instance().dummy_data_param_; +#else + return dummy_data_param_ != NULL ? *dummy_data_param_ : *default_instance_->dummy_data_param_; +#endif +} +inline ::ditcaffe::DummyDataParameter* V1LayerParameter::mutable_dummy_data_param() { + set_has_dummy_data_param(); + if (dummy_data_param_ == NULL) { + dummy_data_param_ = new ::ditcaffe::DummyDataParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.dummy_data_param) + return dummy_data_param_; +} +inline ::ditcaffe::DummyDataParameter* V1LayerParameter::release_dummy_data_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.dummy_data_param) + clear_has_dummy_data_param(); + ::ditcaffe::DummyDataParameter* temp = dummy_data_param_; + dummy_data_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_dummy_data_param(::ditcaffe::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:ditcaffe.V1LayerParameter.dummy_data_param) +} + +// optional .ditcaffe.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_->::ditcaffe::EltwiseParameter::Clear(); + clear_has_eltwise_param(); +} +inline const ::ditcaffe::EltwiseParameter& V1LayerParameter::eltwise_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.eltwise_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return eltwise_param_ != NULL ? *eltwise_param_ : *default_instance().eltwise_param_; +#else + return eltwise_param_ != NULL ? *eltwise_param_ : *default_instance_->eltwise_param_; +#endif +} +inline ::ditcaffe::EltwiseParameter* V1LayerParameter::mutable_eltwise_param() { + set_has_eltwise_param(); + if (eltwise_param_ == NULL) { + eltwise_param_ = new ::ditcaffe::EltwiseParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.eltwise_param) + return eltwise_param_; +} +inline ::ditcaffe::EltwiseParameter* V1LayerParameter::release_eltwise_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.eltwise_param) + clear_has_eltwise_param(); + ::ditcaffe::EltwiseParameter* temp = eltwise_param_; + eltwise_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_eltwise_param(::ditcaffe::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:ditcaffe.V1LayerParameter.eltwise_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ExpParameter::Clear(); + clear_has_exp_param(); +} +inline const ::ditcaffe::ExpParameter& V1LayerParameter::exp_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.exp_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return exp_param_ != NULL ? *exp_param_ : *default_instance().exp_param_; +#else + return exp_param_ != NULL ? *exp_param_ : *default_instance_->exp_param_; +#endif +} +inline ::ditcaffe::ExpParameter* V1LayerParameter::mutable_exp_param() { + set_has_exp_param(); + if (exp_param_ == NULL) { + exp_param_ = new ::ditcaffe::ExpParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.exp_param) + return exp_param_; +} +inline ::ditcaffe::ExpParameter* V1LayerParameter::release_exp_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.exp_param) + clear_has_exp_param(); + ::ditcaffe::ExpParameter* temp = exp_param_; + exp_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_exp_param(::ditcaffe::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:ditcaffe.V1LayerParameter.exp_param) +} + +// optional .ditcaffe.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_->::ditcaffe::HDF5DataParameter::Clear(); + clear_has_hdf5_data_param(); +} +inline const ::ditcaffe::HDF5DataParameter& V1LayerParameter::hdf5_data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.hdf5_data_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return hdf5_data_param_ != NULL ? *hdf5_data_param_ : *default_instance().hdf5_data_param_; +#else + return hdf5_data_param_ != NULL ? *hdf5_data_param_ : *default_instance_->hdf5_data_param_; +#endif +} +inline ::ditcaffe::HDF5DataParameter* V1LayerParameter::mutable_hdf5_data_param() { + set_has_hdf5_data_param(); + if (hdf5_data_param_ == NULL) { + hdf5_data_param_ = new ::ditcaffe::HDF5DataParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.hdf5_data_param) + return hdf5_data_param_; +} +inline ::ditcaffe::HDF5DataParameter* V1LayerParameter::release_hdf5_data_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.hdf5_data_param) + clear_has_hdf5_data_param(); + ::ditcaffe::HDF5DataParameter* temp = hdf5_data_param_; + hdf5_data_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_hdf5_data_param(::ditcaffe::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:ditcaffe.V1LayerParameter.hdf5_data_param) +} + +// optional .ditcaffe.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_->::ditcaffe::HDF5OutputParameter::Clear(); + clear_has_hdf5_output_param(); +} +inline const ::ditcaffe::HDF5OutputParameter& V1LayerParameter::hdf5_output_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.hdf5_output_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return hdf5_output_param_ != NULL ? *hdf5_output_param_ : *default_instance().hdf5_output_param_; +#else + return hdf5_output_param_ != NULL ? *hdf5_output_param_ : *default_instance_->hdf5_output_param_; +#endif +} +inline ::ditcaffe::HDF5OutputParameter* V1LayerParameter::mutable_hdf5_output_param() { + set_has_hdf5_output_param(); + if (hdf5_output_param_ == NULL) { + hdf5_output_param_ = new ::ditcaffe::HDF5OutputParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.hdf5_output_param) + return hdf5_output_param_; +} +inline ::ditcaffe::HDF5OutputParameter* V1LayerParameter::release_hdf5_output_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.hdf5_output_param) + clear_has_hdf5_output_param(); + ::ditcaffe::HDF5OutputParameter* temp = hdf5_output_param_; + hdf5_output_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_hdf5_output_param(::ditcaffe::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:ditcaffe.V1LayerParameter.hdf5_output_param) +} + +// optional .ditcaffe.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_->::ditcaffe::HingeLossParameter::Clear(); + clear_has_hinge_loss_param(); +} +inline const ::ditcaffe::HingeLossParameter& V1LayerParameter::hinge_loss_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.hinge_loss_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return hinge_loss_param_ != NULL ? *hinge_loss_param_ : *default_instance().hinge_loss_param_; +#else + return hinge_loss_param_ != NULL ? *hinge_loss_param_ : *default_instance_->hinge_loss_param_; +#endif +} +inline ::ditcaffe::HingeLossParameter* V1LayerParameter::mutable_hinge_loss_param() { + set_has_hinge_loss_param(); + if (hinge_loss_param_ == NULL) { + hinge_loss_param_ = new ::ditcaffe::HingeLossParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.hinge_loss_param) + return hinge_loss_param_; +} +inline ::ditcaffe::HingeLossParameter* V1LayerParameter::release_hinge_loss_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.hinge_loss_param) + clear_has_hinge_loss_param(); + ::ditcaffe::HingeLossParameter* temp = hinge_loss_param_; + hinge_loss_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_hinge_loss_param(::ditcaffe::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:ditcaffe.V1LayerParameter.hinge_loss_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ImageDataParameter::Clear(); + clear_has_image_data_param(); +} +inline const ::ditcaffe::ImageDataParameter& V1LayerParameter::image_data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.image_data_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return image_data_param_ != NULL ? *image_data_param_ : *default_instance().image_data_param_; +#else + return image_data_param_ != NULL ? *image_data_param_ : *default_instance_->image_data_param_; +#endif +} +inline ::ditcaffe::ImageDataParameter* V1LayerParameter::mutable_image_data_param() { + set_has_image_data_param(); + if (image_data_param_ == NULL) { + image_data_param_ = new ::ditcaffe::ImageDataParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.image_data_param) + return image_data_param_; +} +inline ::ditcaffe::ImageDataParameter* V1LayerParameter::release_image_data_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.image_data_param) + clear_has_image_data_param(); + ::ditcaffe::ImageDataParameter* temp = image_data_param_; + image_data_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_image_data_param(::ditcaffe::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:ditcaffe.V1LayerParameter.image_data_param) +} + +// optional .ditcaffe.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_->::ditcaffe::InfogainLossParameter::Clear(); + clear_has_infogain_loss_param(); +} +inline const ::ditcaffe::InfogainLossParameter& V1LayerParameter::infogain_loss_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.infogain_loss_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return infogain_loss_param_ != NULL ? *infogain_loss_param_ : *default_instance().infogain_loss_param_; +#else + return infogain_loss_param_ != NULL ? *infogain_loss_param_ : *default_instance_->infogain_loss_param_; +#endif +} +inline ::ditcaffe::InfogainLossParameter* V1LayerParameter::mutable_infogain_loss_param() { + set_has_infogain_loss_param(); + if (infogain_loss_param_ == NULL) { + infogain_loss_param_ = new ::ditcaffe::InfogainLossParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.infogain_loss_param) + return infogain_loss_param_; +} +inline ::ditcaffe::InfogainLossParameter* V1LayerParameter::release_infogain_loss_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.infogain_loss_param) + clear_has_infogain_loss_param(); + ::ditcaffe::InfogainLossParameter* temp = infogain_loss_param_; + infogain_loss_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_infogain_loss_param(::ditcaffe::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:ditcaffe.V1LayerParameter.infogain_loss_param) +} + +// optional .ditcaffe.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_->::ditcaffe::InnerProductParameter::Clear(); + clear_has_inner_product_param(); +} +inline const ::ditcaffe::InnerProductParameter& V1LayerParameter::inner_product_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.inner_product_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return inner_product_param_ != NULL ? *inner_product_param_ : *default_instance().inner_product_param_; +#else + return inner_product_param_ != NULL ? *inner_product_param_ : *default_instance_->inner_product_param_; +#endif +} +inline ::ditcaffe::InnerProductParameter* V1LayerParameter::mutable_inner_product_param() { + set_has_inner_product_param(); + if (inner_product_param_ == NULL) { + inner_product_param_ = new ::ditcaffe::InnerProductParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.inner_product_param) + return inner_product_param_; +} +inline ::ditcaffe::InnerProductParameter* V1LayerParameter::release_inner_product_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.inner_product_param) + clear_has_inner_product_param(); + ::ditcaffe::InnerProductParameter* temp = inner_product_param_; + inner_product_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_inner_product_param(::ditcaffe::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:ditcaffe.V1LayerParameter.inner_product_param) +} + +// optional .ditcaffe.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_->::ditcaffe::LRNParameter::Clear(); + clear_has_lrn_param(); +} +inline const ::ditcaffe::LRNParameter& V1LayerParameter::lrn_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.lrn_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return lrn_param_ != NULL ? *lrn_param_ : *default_instance().lrn_param_; +#else + return lrn_param_ != NULL ? *lrn_param_ : *default_instance_->lrn_param_; +#endif +} +inline ::ditcaffe::LRNParameter* V1LayerParameter::mutable_lrn_param() { + set_has_lrn_param(); + if (lrn_param_ == NULL) { + lrn_param_ = new ::ditcaffe::LRNParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.lrn_param) + return lrn_param_; +} +inline ::ditcaffe::LRNParameter* V1LayerParameter::release_lrn_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.lrn_param) + clear_has_lrn_param(); + ::ditcaffe::LRNParameter* temp = lrn_param_; + lrn_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_lrn_param(::ditcaffe::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:ditcaffe.V1LayerParameter.lrn_param) +} + +// optional .ditcaffe.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_->::ditcaffe::MemoryDataParameter::Clear(); + clear_has_memory_data_param(); +} +inline const ::ditcaffe::MemoryDataParameter& V1LayerParameter::memory_data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.memory_data_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return memory_data_param_ != NULL ? *memory_data_param_ : *default_instance().memory_data_param_; +#else + return memory_data_param_ != NULL ? *memory_data_param_ : *default_instance_->memory_data_param_; +#endif +} +inline ::ditcaffe::MemoryDataParameter* V1LayerParameter::mutable_memory_data_param() { + set_has_memory_data_param(); + if (memory_data_param_ == NULL) { + memory_data_param_ = new ::ditcaffe::MemoryDataParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.memory_data_param) + return memory_data_param_; +} +inline ::ditcaffe::MemoryDataParameter* V1LayerParameter::release_memory_data_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.memory_data_param) + clear_has_memory_data_param(); + ::ditcaffe::MemoryDataParameter* temp = memory_data_param_; + memory_data_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_memory_data_param(::ditcaffe::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:ditcaffe.V1LayerParameter.memory_data_param) +} + +// optional .ditcaffe.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_->::ditcaffe::MVNParameter::Clear(); + clear_has_mvn_param(); +} +inline const ::ditcaffe::MVNParameter& V1LayerParameter::mvn_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.mvn_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return mvn_param_ != NULL ? *mvn_param_ : *default_instance().mvn_param_; +#else + return mvn_param_ != NULL ? *mvn_param_ : *default_instance_->mvn_param_; +#endif +} +inline ::ditcaffe::MVNParameter* V1LayerParameter::mutable_mvn_param() { + set_has_mvn_param(); + if (mvn_param_ == NULL) { + mvn_param_ = new ::ditcaffe::MVNParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.mvn_param) + return mvn_param_; +} +inline ::ditcaffe::MVNParameter* V1LayerParameter::release_mvn_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.mvn_param) + clear_has_mvn_param(); + ::ditcaffe::MVNParameter* temp = mvn_param_; + mvn_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_mvn_param(::ditcaffe::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:ditcaffe.V1LayerParameter.mvn_param) +} + +// optional .ditcaffe.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_->::ditcaffe::PoolingParameter::Clear(); + clear_has_pooling_param(); +} +inline const ::ditcaffe::PoolingParameter& V1LayerParameter::pooling_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.pooling_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return pooling_param_ != NULL ? *pooling_param_ : *default_instance().pooling_param_; +#else + return pooling_param_ != NULL ? *pooling_param_ : *default_instance_->pooling_param_; +#endif +} +inline ::ditcaffe::PoolingParameter* V1LayerParameter::mutable_pooling_param() { + set_has_pooling_param(); + if (pooling_param_ == NULL) { + pooling_param_ = new ::ditcaffe::PoolingParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.pooling_param) + return pooling_param_; +} +inline ::ditcaffe::PoolingParameter* V1LayerParameter::release_pooling_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.pooling_param) + clear_has_pooling_param(); + ::ditcaffe::PoolingParameter* temp = pooling_param_; + pooling_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_pooling_param(::ditcaffe::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:ditcaffe.V1LayerParameter.pooling_param) +} + +// optional .ditcaffe.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_->::ditcaffe::PowerParameter::Clear(); + clear_has_power_param(); +} +inline const ::ditcaffe::PowerParameter& V1LayerParameter::power_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.power_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return power_param_ != NULL ? *power_param_ : *default_instance().power_param_; +#else + return power_param_ != NULL ? *power_param_ : *default_instance_->power_param_; +#endif +} +inline ::ditcaffe::PowerParameter* V1LayerParameter::mutable_power_param() { + set_has_power_param(); + if (power_param_ == NULL) { + power_param_ = new ::ditcaffe::PowerParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.power_param) + return power_param_; +} +inline ::ditcaffe::PowerParameter* V1LayerParameter::release_power_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.power_param) + clear_has_power_param(); + ::ditcaffe::PowerParameter* temp = power_param_; + power_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_power_param(::ditcaffe::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:ditcaffe.V1LayerParameter.power_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ReLUParameter::Clear(); + clear_has_relu_param(); +} +inline const ::ditcaffe::ReLUParameter& V1LayerParameter::relu_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.relu_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return relu_param_ != NULL ? *relu_param_ : *default_instance().relu_param_; +#else + return relu_param_ != NULL ? *relu_param_ : *default_instance_->relu_param_; +#endif +} +inline ::ditcaffe::ReLUParameter* V1LayerParameter::mutable_relu_param() { + set_has_relu_param(); + if (relu_param_ == NULL) { + relu_param_ = new ::ditcaffe::ReLUParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.relu_param) + return relu_param_; +} +inline ::ditcaffe::ReLUParameter* V1LayerParameter::release_relu_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.relu_param) + clear_has_relu_param(); + ::ditcaffe::ReLUParameter* temp = relu_param_; + relu_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_relu_param(::ditcaffe::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:ditcaffe.V1LayerParameter.relu_param) +} + +// optional .ditcaffe.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_->::ditcaffe::SigmoidParameter::Clear(); + clear_has_sigmoid_param(); +} +inline const ::ditcaffe::SigmoidParameter& V1LayerParameter::sigmoid_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.sigmoid_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return sigmoid_param_ != NULL ? *sigmoid_param_ : *default_instance().sigmoid_param_; +#else + return sigmoid_param_ != NULL ? *sigmoid_param_ : *default_instance_->sigmoid_param_; +#endif +} +inline ::ditcaffe::SigmoidParameter* V1LayerParameter::mutable_sigmoid_param() { + set_has_sigmoid_param(); + if (sigmoid_param_ == NULL) { + sigmoid_param_ = new ::ditcaffe::SigmoidParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.sigmoid_param) + return sigmoid_param_; +} +inline ::ditcaffe::SigmoidParameter* V1LayerParameter::release_sigmoid_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.sigmoid_param) + clear_has_sigmoid_param(); + ::ditcaffe::SigmoidParameter* temp = sigmoid_param_; + sigmoid_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_sigmoid_param(::ditcaffe::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:ditcaffe.V1LayerParameter.sigmoid_param) +} + +// optional .ditcaffe.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_->::ditcaffe::SoftmaxParameter::Clear(); + clear_has_softmax_param(); +} +inline const ::ditcaffe::SoftmaxParameter& V1LayerParameter::softmax_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.softmax_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return softmax_param_ != NULL ? *softmax_param_ : *default_instance().softmax_param_; +#else + return softmax_param_ != NULL ? *softmax_param_ : *default_instance_->softmax_param_; +#endif +} +inline ::ditcaffe::SoftmaxParameter* V1LayerParameter::mutable_softmax_param() { + set_has_softmax_param(); + if (softmax_param_ == NULL) { + softmax_param_ = new ::ditcaffe::SoftmaxParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.softmax_param) + return softmax_param_; +} +inline ::ditcaffe::SoftmaxParameter* V1LayerParameter::release_softmax_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.softmax_param) + clear_has_softmax_param(); + ::ditcaffe::SoftmaxParameter* temp = softmax_param_; + softmax_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_softmax_param(::ditcaffe::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:ditcaffe.V1LayerParameter.softmax_param) +} + +// optional .ditcaffe.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_->::ditcaffe::SliceParameter::Clear(); + clear_has_slice_param(); +} +inline const ::ditcaffe::SliceParameter& V1LayerParameter::slice_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.slice_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return slice_param_ != NULL ? *slice_param_ : *default_instance().slice_param_; +#else + return slice_param_ != NULL ? *slice_param_ : *default_instance_->slice_param_; +#endif +} +inline ::ditcaffe::SliceParameter* V1LayerParameter::mutable_slice_param() { + set_has_slice_param(); + if (slice_param_ == NULL) { + slice_param_ = new ::ditcaffe::SliceParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.slice_param) + return slice_param_; +} +inline ::ditcaffe::SliceParameter* V1LayerParameter::release_slice_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.slice_param) + clear_has_slice_param(); + ::ditcaffe::SliceParameter* temp = slice_param_; + slice_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_slice_param(::ditcaffe::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:ditcaffe.V1LayerParameter.slice_param) +} + +// optional .ditcaffe.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_->::ditcaffe::TanHParameter::Clear(); + clear_has_tanh_param(); +} +inline const ::ditcaffe::TanHParameter& V1LayerParameter::tanh_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.tanh_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return tanh_param_ != NULL ? *tanh_param_ : *default_instance().tanh_param_; +#else + return tanh_param_ != NULL ? *tanh_param_ : *default_instance_->tanh_param_; +#endif +} +inline ::ditcaffe::TanHParameter* V1LayerParameter::mutable_tanh_param() { + set_has_tanh_param(); + if (tanh_param_ == NULL) { + tanh_param_ = new ::ditcaffe::TanHParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.tanh_param) + return tanh_param_; +} +inline ::ditcaffe::TanHParameter* V1LayerParameter::release_tanh_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.tanh_param) + clear_has_tanh_param(); + ::ditcaffe::TanHParameter* temp = tanh_param_; + tanh_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_tanh_param(::ditcaffe::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:ditcaffe.V1LayerParameter.tanh_param) +} + +// optional .ditcaffe.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_->::ditcaffe::ThresholdParameter::Clear(); + clear_has_threshold_param(); +} +inline const ::ditcaffe::ThresholdParameter& V1LayerParameter::threshold_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.threshold_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return threshold_param_ != NULL ? *threshold_param_ : *default_instance().threshold_param_; +#else + return threshold_param_ != NULL ? *threshold_param_ : *default_instance_->threshold_param_; +#endif +} +inline ::ditcaffe::ThresholdParameter* V1LayerParameter::mutable_threshold_param() { + set_has_threshold_param(); + if (threshold_param_ == NULL) { + threshold_param_ = new ::ditcaffe::ThresholdParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.threshold_param) + return threshold_param_; +} +inline ::ditcaffe::ThresholdParameter* V1LayerParameter::release_threshold_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.threshold_param) + clear_has_threshold_param(); + ::ditcaffe::ThresholdParameter* temp = threshold_param_; + threshold_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_threshold_param(::ditcaffe::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:ditcaffe.V1LayerParameter.threshold_param) +} + +// optional .ditcaffe.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_->::ditcaffe::WindowDataParameter::Clear(); + clear_has_window_data_param(); +} +inline const ::ditcaffe::WindowDataParameter& V1LayerParameter::window_data_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.window_data_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return window_data_param_ != NULL ? *window_data_param_ : *default_instance().window_data_param_; +#else + return window_data_param_ != NULL ? *window_data_param_ : *default_instance_->window_data_param_; +#endif +} +inline ::ditcaffe::WindowDataParameter* V1LayerParameter::mutable_window_data_param() { + set_has_window_data_param(); + if (window_data_param_ == NULL) { + window_data_param_ = new ::ditcaffe::WindowDataParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.window_data_param) + return window_data_param_; +} +inline ::ditcaffe::WindowDataParameter* V1LayerParameter::release_window_data_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.window_data_param) + clear_has_window_data_param(); + ::ditcaffe::WindowDataParameter* temp = window_data_param_; + window_data_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_window_data_param(::ditcaffe::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:ditcaffe.V1LayerParameter.window_data_param) +} + +// optional .ditcaffe.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_->::ditcaffe::TransformationParameter::Clear(); + clear_has_transform_param(); +} +inline const ::ditcaffe::TransformationParameter& V1LayerParameter::transform_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.transform_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return transform_param_ != NULL ? *transform_param_ : *default_instance().transform_param_; +#else + return transform_param_ != NULL ? *transform_param_ : *default_instance_->transform_param_; +#endif +} +inline ::ditcaffe::TransformationParameter* V1LayerParameter::mutable_transform_param() { + set_has_transform_param(); + if (transform_param_ == NULL) { + transform_param_ = new ::ditcaffe::TransformationParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.transform_param) + return transform_param_; +} +inline ::ditcaffe::TransformationParameter* V1LayerParameter::release_transform_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.transform_param) + clear_has_transform_param(); + ::ditcaffe::TransformationParameter* temp = transform_param_; + transform_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_transform_param(::ditcaffe::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:ditcaffe.V1LayerParameter.transform_param) +} + +// optional .ditcaffe.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_->::ditcaffe::LossParameter::Clear(); + clear_has_loss_param(); +} +inline const ::ditcaffe::LossParameter& V1LayerParameter::loss_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.loss_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return loss_param_ != NULL ? *loss_param_ : *default_instance().loss_param_; +#else + return loss_param_ != NULL ? *loss_param_ : *default_instance_->loss_param_; +#endif +} +inline ::ditcaffe::LossParameter* V1LayerParameter::mutable_loss_param() { + set_has_loss_param(); + if (loss_param_ == NULL) { + loss_param_ = new ::ditcaffe::LossParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.loss_param) + return loss_param_; +} +inline ::ditcaffe::LossParameter* V1LayerParameter::release_loss_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.loss_param) + clear_has_loss_param(); + ::ditcaffe::LossParameter* temp = loss_param_; + loss_param_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_loss_param(::ditcaffe::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:ditcaffe.V1LayerParameter.loss_param) +} + +// optional .ditcaffe.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_->::ditcaffe::V0LayerParameter::Clear(); + clear_has_layer(); +} +inline const ::ditcaffe::V0LayerParameter& V1LayerParameter::layer() const { + // @@protoc_insertion_point(field_get:ditcaffe.V1LayerParameter.layer) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return layer_ != NULL ? *layer_ : *default_instance().layer_; +#else + return layer_ != NULL ? *layer_ : *default_instance_->layer_; +#endif +} +inline ::ditcaffe::V0LayerParameter* V1LayerParameter::mutable_layer() { + set_has_layer(); + if (layer_ == NULL) { + layer_ = new ::ditcaffe::V0LayerParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V1LayerParameter.layer) + return layer_; +} +inline ::ditcaffe::V0LayerParameter* V1LayerParameter::release_layer() { + // @@protoc_insertion_point(field_release:ditcaffe.V1LayerParameter.layer) + clear_has_layer(); + ::ditcaffe::V0LayerParameter* temp = layer_; + layer_ = NULL; + return temp; +} +inline void V1LayerParameter::set_allocated_layer(::ditcaffe::V0LayerParameter* layer) { + delete layer_; + layer_ = layer; + if (layer) { + set_has_layer(); + } else { + clear_has_layer(); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.V1LayerParameter.layer) +} + +// ------------------------------------------------------------------- + +// 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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.V0LayerParameter.name) +} +inline ::std::string* V0LayerParameter::mutable_name() { + set_has_name(); + // @@protoc_insertion_point(field_mutable:ditcaffe.V0LayerParameter.name) + return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* V0LayerParameter::release_name() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.V0LayerParameter.type) +} +inline ::std::string* V0LayerParameter::mutable_type() { + set_has_type(); + // @@protoc_insertion_point(field_mutable:ditcaffe.V0LayerParameter.type) + return type_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* V0LayerParameter::release_type() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.V0LayerParameter.biasterm) + return biasterm_; +} +inline void V0LayerParameter::set_biasterm(bool value) { + set_has_biasterm(); + biasterm_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.V0LayerParameter.biasterm) +} + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_weight_filler(); +} +inline const ::ditcaffe::FillerParameter& V0LayerParameter::weight_filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.V0LayerParameter.weight_filler) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return weight_filler_ != NULL ? *weight_filler_ : *default_instance().weight_filler_; +#else + return weight_filler_ != NULL ? *weight_filler_ : *default_instance_->weight_filler_; +#endif +} +inline ::ditcaffe::FillerParameter* V0LayerParameter::mutable_weight_filler() { + set_has_weight_filler(); + if (weight_filler_ == NULL) { + weight_filler_ = new ::ditcaffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V0LayerParameter.weight_filler) + return weight_filler_; +} +inline ::ditcaffe::FillerParameter* V0LayerParameter::release_weight_filler() { + // @@protoc_insertion_point(field_release:ditcaffe.V0LayerParameter.weight_filler) + clear_has_weight_filler(); + ::ditcaffe::FillerParameter* temp = weight_filler_; + weight_filler_ = NULL; + return temp; +} +inline void V0LayerParameter::set_allocated_weight_filler(::ditcaffe::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:ditcaffe.V0LayerParameter.weight_filler) +} + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_bias_filler(); +} +inline const ::ditcaffe::FillerParameter& V0LayerParameter::bias_filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.V0LayerParameter.bias_filler) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return bias_filler_ != NULL ? *bias_filler_ : *default_instance().bias_filler_; +#else + return bias_filler_ != NULL ? *bias_filler_ : *default_instance_->bias_filler_; +#endif +} +inline ::ditcaffe::FillerParameter* V0LayerParameter::mutable_bias_filler() { + set_has_bias_filler(); + if (bias_filler_ == NULL) { + bias_filler_ = new ::ditcaffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V0LayerParameter.bias_filler) + return bias_filler_; +} +inline ::ditcaffe::FillerParameter* V0LayerParameter::release_bias_filler() { + // @@protoc_insertion_point(field_release:ditcaffe.V0LayerParameter.bias_filler) + clear_has_bias_filler(); + ::ditcaffe::FillerParameter* temp = bias_filler_; + bias_filler_ = NULL; + return temp; +} +inline void V0LayerParameter::set_allocated_bias_filler(::ditcaffe::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:ditcaffe.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:ditcaffe.V0LayerParameter.pad) + return pad_; +} +inline void V0LayerParameter::set_pad(::google::protobuf::uint32 value) { + set_has_pad(); + pad_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.V0LayerParameter.kernelsize) + return kernelsize_; +} +inline void V0LayerParameter::set_kernelsize(::google::protobuf::uint32 value) { + set_has_kernelsize(); + kernelsize_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.V0LayerParameter.group) + return group_; +} +inline void V0LayerParameter::set_group(::google::protobuf::uint32 value) { + set_has_group(); + group_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.V0LayerParameter.stride) + return stride_; +} +inline void V0LayerParameter::set_stride(::google::protobuf::uint32 value) { + set_has_stride(); + stride_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.V0LayerParameter.stride) +} + +// optional .ditcaffe.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 ::ditcaffe::V0LayerParameter_PoolMethod V0LayerParameter::pool() const { + // @@protoc_insertion_point(field_get:ditcaffe.V0LayerParameter.pool) + return static_cast< ::ditcaffe::V0LayerParameter_PoolMethod >(pool_); +} +inline void V0LayerParameter::set_pool(::ditcaffe::V0LayerParameter_PoolMethod value) { + assert(::ditcaffe::V0LayerParameter_PoolMethod_IsValid(value)); + set_has_pool(); + pool_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.V0LayerParameter.alpha) + return alpha_; +} +inline void V0LayerParameter::set_alpha(float value) { + set_has_alpha(); + alpha_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.V0LayerParameter.beta) + return beta_; +} +inline void V0LayerParameter::set_beta(float value) { + set_has_beta(); + beta_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.V0LayerParameter.k) + return k_; +} +inline void V0LayerParameter::set_k(float value) { + set_has_k(); + k_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.V0LayerParameter.source) +} +inline ::std::string* V0LayerParameter::mutable_source() { + set_has_source(); + // @@protoc_insertion_point(field_mutable:ditcaffe.V0LayerParameter.source) + return source_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* V0LayerParameter::release_source() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.V0LayerParameter.scale) + return scale_; +} +inline void V0LayerParameter::set_scale(float value) { + set_has_scale(); + scale_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.V0LayerParameter.meanfile) +} +inline ::std::string* V0LayerParameter::mutable_meanfile() { + set_has_meanfile(); + // @@protoc_insertion_point(field_mutable:ditcaffe.V0LayerParameter.meanfile) + return meanfile_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* V0LayerParameter::release_meanfile() { + // @@protoc_insertion_point(field_release:ditcaffe.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:ditcaffe.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:ditcaffe.V0LayerParameter.batchsize) + return batchsize_; +} +inline void V0LayerParameter::set_batchsize(::google::protobuf::uint32 value) { + set_has_batchsize(); + batchsize_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.V0LayerParameter.cropsize) + return cropsize_; +} +inline void V0LayerParameter::set_cropsize(::google::protobuf::uint32 value) { + set_has_cropsize(); + cropsize_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.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:ditcaffe.V0LayerParameter.mirror) + return mirror_; +} +inline void V0LayerParameter::set_mirror(bool value) { + set_has_mirror(); + mirror_ = value; + // @@protoc_insertion_point(field_set:ditcaffe.V0LayerParameter.mirror) +} + +// repeated .ditcaffe.BlobProto blobs = 50; +inline int V0LayerParameter::blobs_size() const { + return blobs_.size(); +} +inline void V0LayerParameter::clear_blobs() { + blobs_.Clear(); +} +inline const ::ditcaffe::BlobProto& V0LayerParameter::blobs(int index) const { + // @@protoc_insertion_point(field_get:ditcaffe.V0LayerParameter.blobs) + return blobs_.Get(index); +} +inline ::ditcaffe::BlobProto* V0LayerParameter::mutable_blobs(int index) { + // @@protoc_insertion_point(field_mutable:ditcaffe.V0LayerParameter.blobs) + return blobs_.Mutable(index); +} +inline ::ditcaffe::BlobProto* V0LayerParameter::add_blobs() { + // @@protoc_insertion_point(field_add:ditcaffe.V0LayerParameter.blobs) + return blobs_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >* +V0LayerParameter::mutable_blobs() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.V0LayerParameter.blobs) + return &blobs_; +} +inline const ::google::protobuf::RepeatedPtrField< ::ditcaffe::BlobProto >& +V0LayerParameter::blobs() const { + // @@protoc_insertion_point(field_list:ditcaffe.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:ditcaffe.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:ditcaffe.V0LayerParameter.blobs_lr) +} +inline void V0LayerParameter::add_blobs_lr(float value) { + blobs_lr_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.V0LayerParameter.blobs_lr) +} +inline const ::google::protobuf::RepeatedField< float >& +V0LayerParameter::blobs_lr() const { + // @@protoc_insertion_point(field_list:ditcaffe.V0LayerParameter.blobs_lr) + return blobs_lr_; +} +inline ::google::protobuf::RepeatedField< float >* +V0LayerParameter::mutable_blobs_lr() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.V0LayerParameter.weight_decay) +} +inline void V0LayerParameter::add_weight_decay(float value) { + weight_decay_.Add(value); + // @@protoc_insertion_point(field_add:ditcaffe.V0LayerParameter.weight_decay) +} +inline const ::google::protobuf::RepeatedField< float >& +V0LayerParameter::weight_decay() const { + // @@protoc_insertion_point(field_list:ditcaffe.V0LayerParameter.weight_decay) + return weight_decay_; +} +inline ::google::protobuf::RepeatedField< float >* +V0LayerParameter::mutable_weight_decay() { + // @@protoc_insertion_point(field_mutable_list:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.V0LayerParameter.det_crop_mode) +} +inline ::std::string* V0LayerParameter::mutable_det_crop_mode() { + set_has_det_crop_mode(); + // @@protoc_insertion_point(field_mutable:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.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:ditcaffe.V0LayerParameter.concat_dim) +} + +// optional .ditcaffe.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_->::ditcaffe::HDF5OutputParameter::Clear(); + clear_has_hdf5_output_param(); +} +inline const ::ditcaffe::HDF5OutputParameter& V0LayerParameter::hdf5_output_param() const { + // @@protoc_insertion_point(field_get:ditcaffe.V0LayerParameter.hdf5_output_param) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return hdf5_output_param_ != NULL ? *hdf5_output_param_ : *default_instance().hdf5_output_param_; +#else + return hdf5_output_param_ != NULL ? *hdf5_output_param_ : *default_instance_->hdf5_output_param_; +#endif +} +inline ::ditcaffe::HDF5OutputParameter* V0LayerParameter::mutable_hdf5_output_param() { + set_has_hdf5_output_param(); + if (hdf5_output_param_ == NULL) { + hdf5_output_param_ = new ::ditcaffe::HDF5OutputParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.V0LayerParameter.hdf5_output_param) + return hdf5_output_param_; +} +inline ::ditcaffe::HDF5OutputParameter* V0LayerParameter::release_hdf5_output_param() { + // @@protoc_insertion_point(field_release:ditcaffe.V0LayerParameter.hdf5_output_param) + clear_has_hdf5_output_param(); + ::ditcaffe::HDF5OutputParameter* temp = hdf5_output_param_; + hdf5_output_param_ = NULL; + return temp; +} +inline void V0LayerParameter::set_allocated_hdf5_output_param(::ditcaffe::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:ditcaffe.V0LayerParameter.hdf5_output_param) +} + +// ------------------------------------------------------------------- + +// PReLUParameter + +// optional .ditcaffe.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_->::ditcaffe::FillerParameter::Clear(); + clear_has_filler(); +} +inline const ::ditcaffe::FillerParameter& PReLUParameter::filler() const { + // @@protoc_insertion_point(field_get:ditcaffe.PReLUParameter.filler) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return filler_ != NULL ? *filler_ : *default_instance().filler_; +#else + return filler_ != NULL ? *filler_ : *default_instance_->filler_; +#endif +} +inline ::ditcaffe::FillerParameter* PReLUParameter::mutable_filler() { + set_has_filler(); + if (filler_ == NULL) { + filler_ = new ::ditcaffe::FillerParameter; + } + // @@protoc_insertion_point(field_mutable:ditcaffe.PReLUParameter.filler) + return filler_; +} +inline ::ditcaffe::FillerParameter* PReLUParameter::release_filler() { + // @@protoc_insertion_point(field_release:ditcaffe.PReLUParameter.filler) + clear_has_filler(); + ::ditcaffe::FillerParameter* temp = filler_; + filler_ = NULL; + return temp; +} +inline void PReLUParameter::set_allocated_filler(::ditcaffe::FillerParameter* filler) { + delete filler_; + filler_ = filler; + if (filler) { + set_has_filler(); + } else { + clear_has_filler(); + } + // @@protoc_insertion_point(field_set_allocated:ditcaffe.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:ditcaffe.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:ditcaffe.PReLUParameter.channel_shared) +} + +#endif // !PROTOBUF_INLINE_NOT_IN_HEADERS +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace ditcaffe + +#ifndef SWIG +namespace google { +namespace protobuf { + +template <> struct is_proto_enum< ::ditcaffe::FillerParameter_VarianceNorm> : ::google::protobuf::internal::true_type {}; +template <> struct is_proto_enum< ::ditcaffe::SolverParameter_SnapshotFormat> : ::google::protobuf::internal::true_type {}; +template <> struct is_proto_enum< ::ditcaffe::SolverParameter_SolverMode> : ::google::protobuf::internal::true_type {}; +template <> struct is_proto_enum< ::ditcaffe::SolverParameter_SolverType> : ::google::protobuf::internal::true_type {}; +template <> struct is_proto_enum< ::ditcaffe::ParamSpec_DimCheckMode> : ::google::protobuf::internal::true_type {}; +template <> struct is_proto_enum< ::ditcaffe::LossParameter_NormalizationMode> : ::google::protobuf::internal::true_type {}; +template <> struct is_proto_enum< ::ditcaffe::ConvolutionParameter_Engine> : ::google::protobuf::internal::true_type {}; +template <> struct is_proto_enum< ::ditcaffe::DataParameter_DB> : ::google::protobuf::internal::true_type {}; +template <> struct is_proto_enum< ::ditcaffe::EltwiseParameter_EltwiseOp> : ::google::protobuf::internal::true_type {}; +template <> struct is_proto_enum< ::ditcaffe::HingeLossParameter_Norm> : ::google::protobuf::internal::true_type {}; +template <> struct is_proto_enum< ::ditcaffe::LRNParameter_NormRegion> : ::google::protobuf::internal::true_type {}; +template <> struct is_proto_enum< ::ditcaffe::LRNParameter_Engine> : ::google::protobuf::internal::true_type {}; +template <> struct is_proto_enum< ::ditcaffe::PoolingParameter_PoolMethod> : ::google::protobuf::internal::true_type {}; +template <> struct is_proto_enum< ::ditcaffe::PoolingParameter_Engine> : ::google::protobuf::internal::true_type {}; +template <> struct is_proto_enum< ::ditcaffe::ReductionParameter_ReductionOp> : ::google::protobuf::internal::true_type {}; +template <> struct is_proto_enum< ::ditcaffe::ReLUParameter_Engine> : ::google::protobuf::internal::true_type {}; +template <> struct is_proto_enum< ::ditcaffe::SigmoidParameter_Engine> : ::google::protobuf::internal::true_type {}; +template <> struct is_proto_enum< ::ditcaffe::SoftmaxParameter_Engine> : ::google::protobuf::internal::true_type {}; +template <> struct is_proto_enum< ::ditcaffe::TanHParameter_Engine> : ::google::protobuf::internal::true_type {}; +template <> struct is_proto_enum< ::ditcaffe::SPPParameter_PoolMethod> : ::google::protobuf::internal::true_type {}; +template <> struct is_proto_enum< ::ditcaffe::SPPParameter_Engine> : ::google::protobuf::internal::true_type {}; +template <> struct is_proto_enum< ::ditcaffe::V1LayerParameter_LayerType> : ::google::protobuf::internal::true_type {}; +template <> struct is_proto_enum< ::ditcaffe::V1LayerParameter_DimCheckMode> : ::google::protobuf::internal::true_type {}; +template <> struct is_proto_enum< ::ditcaffe::V0LayerParameter_PoolMethod> : ::google::protobuf::internal::true_type {}; +template <> struct is_proto_enum< ::ditcaffe::Phase> : ::google::protobuf::internal::true_type {}; + +} // namespace protobuf +} // namespace google +#endif // SWIG + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_ditcaffe_2eopt_2dfor_2dlite_2eproto__INCLUDED diff --git a/umd/core/src/compiler/engine-ast/ActivationOp.cpp b/umd/core/src/compiler/engine-ast/ActivationOp.cpp new file mode 100644 index 00000000..c2674988 --- /dev/null +++ b/umd/core/src/compiler/engine-ast/ActivationOp.cpp @@ -0,0 +1,523 @@ +/* + * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#include + +#include "priv/EngineAST.h" +#include "priv/Profile.h" +#include "priv/Tensor.h" +#include "priv/TargetConfig.h" + +#include "ErrorMacros.h" + +using std::endl; + +namespace nvdla +{ +namespace priv +{ +namespace engine_ast +{ + +void SDPActivationOpNode::captureCanonicalParams() +{ + NvDlaError e = NvDlaSuccess; + + switch(canonicalNode()->params().activationType()) + { + case ActivationType::kRELU: + params().x1Params().setEnabled(true); + params().x1Params().setActType(SDPActTypeEnum::SDP_ACT_TYPE_RELU); + break; + case ActivationType::kSIGMOID: + if ( !graph()->target_config()->isSDPLutCapable() ) + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Activation type not supported: %d", canonicalNode()->params().activationType()); + + params().yParams().setEnabled(true); + params().yParams().setActType(SDPActTypeEnum::SDP_ACT_TYPE_SIGMOID); + + // Register sigmoid lut with the LutManager + PROPAGATE_ERROR_FAIL(graph()->lutManager()->registerSigmoid(graph()->profile()->computePrecision().e(), &m_hLut)); + break; + case ActivationType::kTANH: + if ( !graph()->target_config()->isSDPLutCapable() ) + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Activation type not supported: %d", canonicalNode()->params().activationType()); + + params().yParams().setEnabled(true); + params().yParams().setActType(SDPActTypeEnum::SDP_ACT_TYPE_TANH); + + // Register tanh lut with the LutManager + PROPAGATE_ERROR_FAIL(graph()->lutManager()->registerTanh(graph()->profile()->computePrecision().e(), &m_hLut)); + break; + default: + params().x1Params().setActType(SDPActTypeEnum::SDP_ACT_TYPE_UNKNOWN); + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unknown activation type: %d", canonicalNode()->params().activationType()); + } + +fail: + return; +} + +void engine_ast::SDPActivationOpNode::inheritParams(Node* otherNode) +{ + // inherit the parameters that make sense (keep adding later) + SDPActivationOpNode* otherAct = NodeFactory::nodeCast(otherNode); + m_hLut = otherAct->m_hLut; + + SDPNode* asSdpNode = NodeFactory::nodeCast(this); + SDPNode* otherActAsSdpNode = NodeFactory::nodeCast(otherNode); + asSdpNode->params().setConvMode(otherActAsSdpNode->params().convMode()); + asSdpNode->params().setWinogradParams(otherActAsSdpNode->params().winogradParams()); + asSdpNode->params().setNumGroups(otherActAsSdpNode->params().numGroups()); + + params().setOutCVT(otherAct->params().outCVT()); + params().setX1Params(otherAct->params().x1Params()); +} + +NvDlaError SDPActivationOpNode::emitReLU(DLASDPOpDescAccessor sdp_op) +{ + NvDlaError e = NvDlaSuccess; + + DLASDPOpAccessor x1_op_acc = sdp_op.x1OpAccessor(); + + *x1_op_acc.enable() = 1; + *x1_op_acc.ALUType() = x1_op_acc.ALUType_Sum(); + *x1_op_acc.type() = x1_op_acc.type_None(); + *x1_op_acc.mode() = x1_op_acc.mode_PerLayer(); + *x1_op_acc.act() = x1_op_acc.act_RelU(); + *x1_op_acc.shiftValue() = 0; + *x1_op_acc.ALUOperand() = 0; + *x1_op_acc.MulOperand() = 1; + *x1_op_acc.truncate() = 0; + *x1_op_acc.precision() = *sdp_op.srcPrecision(); // precision of engine = precision of its input tensor + + return e; +} + +NvDlaError SDPActivationOpNode::emitLut(DLASDPOpDescAccessor sdp_op) +{ + NvDlaError e = NvDlaSuccess; + + DLASDPOpAccessor y_op_acc = sdp_op.yOpAccessor(); + + *sdp_op.LUTIndex() = graph()->lutManager()->getIndex(m_hLut); + + *y_op_acc.enable() = 1; + *y_op_acc.ALUType() = y_op_acc.ALUType_Sum(); + *y_op_acc.type() = y_op_acc.type_None(); + *y_op_acc.mode() = y_op_acc.mode_PerLayer(); + *y_op_acc.act() = y_op_acc.act_LUT(); + *y_op_acc.shiftValue() = 0; + *y_op_acc.ALUOperand() = 0; + *y_op_acc.MulOperand() = 1; + *y_op_acc.truncate() = 0; + *y_op_acc.precision() = *sdp_op.srcPrecision(); // precision of engine = precision of its input tensor + + return e; +} + +NvDlaError SDPActivationOpNode::emitOp(Graph *g, + DLAInterface *target_dla, + NvU32 op_slot, NvU32 batch_id, + DLACommonOpDescAccessor dep, + DLAOperationContainerAccessor op, + DLASurfaceContainerAccessor surf) +{ + NvDlaError e = NvDlaSuccess; + + DLASDPOpDescAccessor sdp_op = op.sdpOpDescAccessor(0); + DLACVTParamAccessor out_cvt_acc = sdp_op.outCVTAccessor(); + DLASDPOpAccessor x1_op_acc = sdp_op.x1OpAccessor(); + DLASDPOpAccessor x2_op_acc = sdp_op.x2OpAccessor(); + DLASDPOpAccessor y_op_acc = sdp_op.yOpAccessor(); + DLASDPSurfaceDescAccessor surf_acc = surf.sdpSurfaceDescAccessor(0); + DLADataCubeAccessor src_data_acc = surf_acc.srcDataAccessor(); + DLADataCubeAccessor dst_data_acc = surf_acc.dstDataAccessor(); + DLAConsumerAccessor fused_acc = dep.fusedParentAccessor(); + NVDLA_UNUSED(fused_acc); + + surface::TensorSurfaceDesc *src_tsd = g->nodeInputTensorSurface(this, 0, supportedInSurfCategories()); + surface::TensorSurfaceDesc *dst_tsd = g->nodeOutputTensorSurface(this, 0, supportedOutSurfCategories()); + + *sdp_op.srcPrecision() = ASTToDLAInterface::getSDPPrecision(target_dla, src_tsd->surfaceFormat().precision()); + *sdp_op.dstPrecision() = ASTToDLAInterface::getSDPPrecision(target_dla, dst_tsd->surfaceFormat().precision()); + *sdp_op.LUTIndex() = -1; + *sdp_op.batchNum() = 1; + *sdp_op.batchStride() = 0; + + *out_cvt_acc.scale() = params().outCVT().scale(); + *out_cvt_acc.truncate() = params().outCVT().truncate(); + *out_cvt_acc.offset() = params().outCVT().offset(); + *out_cvt_acc.enable() = static_cast(params().outCVT().isEnable()); + + *x1_op_acc.enable() = 0; + *x2_op_acc.enable() = 0; + *y_op_acc.enable() = 0; + + if (params(batch_id).x1Params().enabled()) + { + switch(params(batch_id).x1Params().actType().v()) + { + case SDPActTypeEnum::SDP_ACT_TYPE_RELU: + PROPAGATE_ERROR_FAIL(emitReLU(sdp_op)); + break; + default: + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unknown activation type: %d", params(batch_id).x1Params().actType().v()); + } + } + + if (params(batch_id).yParams().enabled()) + { + switch(params(batch_id).yParams().actType().v()) + { + case SDPActTypeEnum::SDP_ACT_TYPE_SIGMOID: + case SDPActTypeEnum::SDP_ACT_TYPE_TANH: + PROPAGATE_ERROR_FAIL(emitLut(sdp_op)); + break; + default: + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unknown activation type: %d", params(batch_id).yParams().actType().v()); + } + } + + emitDependencyParams(target_dla, dep, batch_id); + setDataCubeAccessor(src_data_acc, src_tsd, IODirectionEnum::INPUT, batch_id); + setDataCubeAccessor(dst_data_acc, dst_tsd, IODirectionEnum::OUTPUT, batch_id); + + if ( params(batch_id).convMode().v() == ConvolutionModeEnum::CONV_WINOGRAD ) + { + *sdp_op.convMode() = sdp_op.convMode_Winograd(); + + *src_data_acc.width() = params().winogradParams().ioDims.w; + *src_data_acc.height() = params().winogradParams().ioDims.h; + + *dst_data_acc.width() = params().winogradParams().ioDims.w; + *dst_data_acc.height() = params().winogradParams().ioDims.h; + } + else if ( params(batch_id).convMode().v() == ConvolutionModeEnum::CONV_DIRECT ) + { + *sdp_op.convMode() = sdp_op.convMode_Direct(); + } + else + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unsupported Conv mode for %s", name().c_str()); + } + + if ( g->debugOps() ) + { + gLogInfo << "SDP activation node @ op_slot = " << op_slot << " batch_id = " << batch_id << endl; + gLogInfo << "\tsrc precision " << (int)*sdp_op.srcPrecision() << endl; + gLogInfo << "\tdst precision " << (int)*sdp_op.dstPrecision() << endl; + gLogInfo << "\tx1 enable " << (int)*x1_op_acc.enable() << endl; + if (*x1_op_acc.enable()) + { + gLogInfo << "\tx1 precision " << (int)*x1_op_acc.precision() << endl; + gLogInfo << "\tx1 aluType " << (int)*x1_op_acc.ALUType() << endl; + gLogInfo << "\tx1 type " << (int)*x1_op_acc.type() << endl; + gLogInfo << "\tx1 mode " << (int)*x1_op_acc.mode() << endl; + gLogInfo << "\tx1 act " << (int)*x1_op_acc.act() << endl; + gLogInfo << "\tx1 shiftValue " << (int)*x1_op_acc.shiftValue() << endl; + gLogInfo << "\tx1 aluOperand " << (int)*x1_op_acc.ALUOperand() << endl; + gLogInfo << "\tx1 mulOperand " << (int)*x1_op_acc.MulOperand() << endl; + gLogInfo << "\tx1 truncate " << (int)*x1_op_acc.truncate() << endl; + } + gLogInfo << "\tx2 enable " << (int)*x2_op_acc.enable() << endl; + if (*x2_op_acc.enable()) + { + gLogInfo << "\tx2 precision " << (int)*x2_op_acc.precision() << endl; + gLogInfo << "\tx2 aluType " << (int)*x2_op_acc.ALUType() << endl; + gLogInfo << "\tx2 type " << (int)*x2_op_acc.type() << endl; + gLogInfo << "\tx2 mode " << (int)*x2_op_acc.mode() << endl; + gLogInfo << "\tx2 act " << (int)*x2_op_acc.act() << endl; + gLogInfo << "\tx2 shiftValue " << (int)*x2_op_acc.shiftValue() << endl; + gLogInfo << "\tx2 aluOperand " << (int)*x2_op_acc.ALUOperand() << endl; + gLogInfo << "\tx2 mulOperand " << (int)*x2_op_acc.MulOperand() << endl; + gLogInfo << "\tx2 truncate " << (int)*x2_op_acc.truncate() << endl; + } + gLogInfo << "\ty enable " << (int)*y_op_acc.enable() << endl; + if (*y_op_acc.enable()) + { + gLogInfo << "\ty precision " << (int)*y_op_acc.precision() << endl; + gLogInfo << "\ty aluType " << (int)*y_op_acc.ALUType() << endl; + gLogInfo << "\ty type " << (int)*y_op_acc.type() << endl; + gLogInfo << "\ty mode " << (int)*y_op_acc.mode() << endl; + gLogInfo << "\ty act " << (int)*y_op_acc.act() << endl; + gLogInfo << "\ty shiftValue " << (int)*y_op_acc.shiftValue() << endl; + gLogInfo << "\ty aluOperand " << (int)*y_op_acc.ALUOperand() << endl; + gLogInfo << "\ty mulOperand " << (int)*y_op_acc.MulOperand() << endl; + gLogInfo << "\ty truncate " << (int)*y_op_acc.truncate() << endl; + } + gLogInfo << "\tsrc tsd:" << src_tsd->id() << endl; + gLogInfo << "\tdst tsd:" << dst_tsd->id() << endl; + gLogInfo << "\tdependencyCount" << (int)*dep.dependencyCount() << endl; + gLogInfo << "\tsrc addr=" << *src_data_acc.address() << endl; + gLogInfo << "\tsrc type=" << (int)*src_data_acc.type() << endl; + gLogInfo << "\tconv_mode " << (int)*sdp_op.convMode() << endl; + gLogInfo << "\tsrc size " << *src_data_acc.size() << endl; + gLogInfo << "\tsrc width " << *src_data_acc.width() << endl; + gLogInfo << "\tsrc height " << *src_data_acc.height() << endl; + gLogInfo << "\tsrc channel " << *src_data_acc.channel() << endl; + gLogInfo << "\tsrc linestride " << *src_data_acc.lineStride() << endl; + gLogInfo << "\tsrc surfstride " << *src_data_acc.surfStride() << endl; + gLogInfo << "\tdst addr=" << *dst_data_acc.address() << endl; + gLogInfo << "\tdst type=" << (int)*dst_data_acc.type() << endl; + gLogInfo << "\tdst size " << *dst_data_acc.size() << endl; + gLogInfo << "\tdst width " << *dst_data_acc.width() << endl; + gLogInfo << "\tdst height " << *dst_data_acc.height() << endl; + gLogInfo << "\tdst channel " << *dst_data_acc.channel() << endl; + gLogInfo << "\tdst linestride " << *dst_data_acc.lineStride() << endl; + gLogInfo << "\tdst surfstride " << *dst_data_acc.surfStride() << endl; + gLogInfo << "\tout_cvt enable " << (int)*out_cvt_acc.enable() << endl; + gLogInfo << "\tout_cvt scale " << (int)*out_cvt_acc.scale() << endl; + gLogInfo << "\tout_cvt offset " << (int)*out_cvt_acc.offset() << endl; + gLogInfo << "\tout_cvt truncate " << (int)*out_cvt_acc.truncate() << endl; + } + +fail: + return e; +} + +#ifdef NVDLA_COMPILER_OUTPUT_FOR_PROTOTEST +NvDlaError engine_ast::SDPActivationOpNode::emitOp(NvU32 op_slot, NvU32 batch_id, + DLAInterface* target_dla, + DLACommonOpDescAccessor& dep, + DLAOperationContainerAccessor& op, + DLASurfaceContainerAccessor& surf, + nvdla_prototest_interface::Layer* protoLayer) +{ + NvDlaError e = NvDlaSuccess; + NvU8 numConsumers = 0; + + DLASDPOpDescAccessor sdp_op = op.sdpOpDescAccessor(0); + DLACVTParamAccessor out_cvt_acc = sdp_op.outCVTAccessor(); + DLASDPOpAccessor x1_op_acc = sdp_op.x1OpAccessor(); + DLASDPOpAccessor x2_op_acc = sdp_op.x2OpAccessor(); + DLASDPOpAccessor y_op_acc = sdp_op.yOpAccessor(); + DLASDPSurfaceDescAccessor surf_acc = surf.sdpSurfaceDescAccessor(0); + DLADataCubeAccessor src_data_acc = surf_acc.srcDataAccessor(); + DLADataCubeAccessor dst_data_acc = surf_acc.dstDataAccessor(); + DLADataCubeAccessor x1_data_acc = surf_acc.x1DataAccessor(); + DLADataCubeAccessor x2_data_acc = surf_acc.x2DataAccessor(); + DLADataCubeAccessor y_data_acc = surf_acc.yDataAccessor(); + DLAConsumerAccessor fused_acc = dep.fusedParentAccessor(); + NVDLA_UNUSED(out_cvt_acc); + NVDLA_UNUSED(x1_data_acc); + NVDLA_UNUSED(x2_data_acc); + NVDLA_UNUSED(y_data_acc); + NVDLA_UNUSED(batch_id); + + surface::TensorSurfaceDesc *src_tsd = graph()->nodeInputTensorSurface(this, 0, supportedInSurfCategories()); + surface::TensorSurfaceDesc *dst_tsd = graph()->nodeOutputTensorSurface(this, 0, supportedOutSurfCategories()); + + nvdla_prototest_interface::SDPOpDesc* protoSDPOpDesc = protoLayer->mutable_op_config()->mutable_sdp_op(); + nvdla_prototest_interface::SDPSurfaceDesc* protoSDPSurfDesc = protoLayer->mutable_surface()->mutable_sdp_surface(); + nvdla_prototest_interface::SDPOp* protoSDPX1OpDesc = protoSDPOpDesc->mutable_x1_op(); + nvdla_prototest_interface::SDPOp* protoSDPX2OpDesc = protoSDPOpDesc->mutable_x2_op(); + nvdla_prototest_interface::SDPOp* protoSDPYOpDesc = protoSDPOpDesc->mutable_y_op(); + nvdla_prototest_interface::DataCube* protoSrcDataCube = protoSDPSurfDesc->mutable_src_data(); + nvdla_prototest_interface::DataCube* protoDstDataCube = protoSDPSurfDesc->mutable_dst_data(); + nvdla_prototest_interface::DataPrecision protoSrcPrec, protoDstPrec; + + protoLayer->set_index(op_slot); + protoLayer->set_roi_index(0); + protoLayer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_SDP); + protoLayer->set_dependency_count(*dep.dependencyCount()); + + /* consumers */ + for (size_t c = 0; c < EngineType::num_elements(); c++) + { + NvS8 fw_op_index = ASTToDLAInterface::getEngineType(target_dla, c); + if ( fw_op_index < 0 ) + { + continue; + } + + DLAConsumerAccessor cons_acc = dep.consumerAccessor(fw_op_index); + if (*cons_acc.index() != -1) { + numConsumers++; + nvdla_prototest_interface::Consumer* protoConsumer = protoLayer->add_bottom(); + protoConsumer->set_index(*cons_acc.index()); + switch(c) { + case EngineTypeEnum::BDMA : protoConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_BDMA); break; + case EngineTypeEnum::CONVOLUTION : protoConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_CONV); break; + case EngineTypeEnum::SDP : protoConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_SDP); break; + case EngineTypeEnum::PDP : protoConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_PDP); break; + case EngineTypeEnum::CDP : protoConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_CDP); break; + case EngineTypeEnum::RUBIK: protoConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_RUBIK); break; + default: ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unrecognized consumer"); + } + switch(dependencyParams().consumer(c).opEvent().v()) { + case OperationEventTypeEnum::OP_CDMA_WEIGHT_DONE : protoConsumer->set_event(nvdla_prototest_interface::Consumer_EventType::Consumer_EventType_CDMA_WT_DONE); break; + case OperationEventTypeEnum::OP_CDMA_DATA_DONE : protoConsumer->set_event(nvdla_prototest_interface::Consumer_EventType::Consumer_EventType_CDMA_DT_DONE); break; + case OperationEventTypeEnum::OP_COMPLETED : protoConsumer->set_event(nvdla_prototest_interface::Consumer_EventType::Consumer_EventType_OP_COMPLETED); break; + case OperationEventTypeEnum::OP_ENABLED : protoConsumer->set_event(nvdla_prototest_interface::Consumer_EventType::Consumer_EventType_OP_ENABLED); break; + case OperationEventTypeEnum::OP_PROGRAMMED : protoConsumer->set_event(nvdla_prototest_interface::Consumer_EventType::Consumer_EventType_OP_PROGRAMMED); break; + default: ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unrecognized consumer event"); + } + } + } + + /* fused node */ + if (dependencyParams().fusedNode(engine_ast::IODirectionEnum::INPUT)) + { + nvdla_prototest_interface::Consumer* protoFusedConsumer = protoLayer->mutable_fused(); + protoFusedConsumer->set_index(*fused_acc.index()); + protoFusedConsumer->set_event(nvdla_prototest_interface::Consumer_EventType::Consumer_EventType_OP_ENABLED); + switch(dependencyParams().fusedNode(engine_ast::IODirectionEnum::INPUT)->engineType().v()) { + case EngineTypeEnum::CONVOLUTION: protoFusedConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_CONV); break; + default: ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "SDP can have only Conv op as its fused partner on input side"); + } + } + + switch(src_tsd->surfaceFormat().precision().v()) { + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_FP16 : protoSrcPrec = nvdla_prototest_interface::DataPrecision::PRECISION_FP16; break; + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16 : protoSrcPrec = nvdla_prototest_interface::DataPrecision::PRECISION_INT16; break; + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8 : protoSrcPrec = nvdla_prototest_interface::DataPrecision::PRECISION_INT8; break; + default: ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unrecognized src precision"); + } + + switch(dst_tsd->surfaceFormat().precision().v()) { + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_FP16 : protoDstPrec = nvdla_prototest_interface::DataPrecision::PRECISION_FP16; break; + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16 : protoDstPrec = nvdla_prototest_interface::DataPrecision::PRECISION_INT16; break; + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8 : protoDstPrec = nvdla_prototest_interface::DataPrecision::PRECISION_INT8; break; + default: ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unrecognized dst precision"); + } + + protoSDPOpDesc->set_src_precision(protoSrcPrec); + protoSDPOpDesc->set_dst_precision(protoDstPrec); + protoSDPOpDesc->set_lut_index(*sdp_op.LUTIndex()); + + protoSDPOpDesc->mutable_out_cvt()->set_enable(*out_cvt_acc.enable()); + protoSDPOpDesc->mutable_out_cvt()->set_offset(*out_cvt_acc.offset()); + protoSDPOpDesc->mutable_out_cvt()->set_scale(*out_cvt_acc.scale()); + protoSDPOpDesc->mutable_out_cvt()->set_truncate(*out_cvt_acc.truncate()); + + protoSDPOpDesc->set_conv_mode(nvdla_prototest_interface::ConvMode::DIRECT); + protoSDPOpDesc->set_batch_num(1); + protoSDPOpDesc->set_batch_stride(0); + + protoSDPX1OpDesc->set_enable(*x1_op_acc.enable()); + protoSDPX1OpDesc->set_alu_type(nvdla_prototest_interface::ALUType::ALU_SUM); + protoSDPX1OpDesc->set_type(nvdla_prototest_interface::SDPOpType::SDP_OP_NONE); + protoSDPX1OpDesc->set_mode(nvdla_prototest_interface::SDPOp_SDPOpMode::SDPOp_SDPOpMode_SDP_OP_PER_LAYER); + protoSDPX1OpDesc->set_act(nvdla_prototest_interface::SDPActivation::ACT_RELU); + protoSDPX1OpDesc->set_shift_value(*x1_op_acc.shiftValue()); + protoSDPX1OpDesc->set_alu_operand(*x1_op_acc.ALUOperand()); + protoSDPX1OpDesc->set_mul_operand(*x1_op_acc.MulOperand()); + protoSDPX1OpDesc->set_truncate(*x1_op_acc.truncate()); + protoSDPX1OpDesc->set_precision(protoSrcPrec); + protoSDPX1OpDesc->mutable_cvt()->mutable_alu_cvt()->set_enable(*x1_op_acc.cvt().aluCVTAccessor().enable()); + protoSDPX1OpDesc->mutable_cvt()->mutable_alu_cvt()->set_truncate(*x1_op_acc.cvt().aluCVTAccessor().truncate()); + protoSDPX1OpDesc->mutable_cvt()->mutable_alu_cvt()->set_scale(*x1_op_acc.cvt().aluCVTAccessor().scale()); + protoSDPX1OpDesc->mutable_cvt()->mutable_alu_cvt()->set_offset(*x1_op_acc.cvt().aluCVTAccessor().offset()); + protoSDPX1OpDesc->mutable_cvt()->mutable_mul_cvt()->set_enable(*x1_op_acc.cvt().mulCVTAccessor().enable()); + protoSDPX1OpDesc->mutable_cvt()->mutable_mul_cvt()->set_truncate(*x1_op_acc.cvt().mulCVTAccessor().truncate()); + protoSDPX1OpDesc->mutable_cvt()->mutable_mul_cvt()->set_scale(*x1_op_acc.cvt().mulCVTAccessor().scale()); + protoSDPX1OpDesc->mutable_cvt()->mutable_mul_cvt()->set_offset(*x1_op_acc.cvt().mulCVTAccessor().offset()); + + protoSDPX2OpDesc->set_enable(*x2_op_acc.enable()); + protoSDPX2OpDesc->set_alu_type(nvdla_prototest_interface::ALUType::ALU_SUM); + protoSDPX2OpDesc->set_type(nvdla_prototest_interface::SDPOpType::SDP_OP_ADD); + protoSDPX2OpDesc->set_mode(nvdla_prototest_interface::SDPOp_SDPOpMode::SDPOp_SDPOpMode_SDP_OP_PER_KERNEL); + protoSDPX2OpDesc->set_act(nvdla_prototest_interface::SDPActivation::ACT_NONE); + protoSDPX2OpDesc->set_shift_value(*x2_op_acc.shiftValue()); + protoSDPX2OpDesc->set_alu_operand(*x2_op_acc.ALUOperand()); + protoSDPX2OpDesc->set_mul_operand(*x2_op_acc.MulOperand()); + protoSDPX2OpDesc->set_truncate(*x2_op_acc.truncate()); + protoSDPX2OpDesc->set_precision(protoSrcPrec); + protoSDPX2OpDesc->mutable_cvt()->mutable_alu_cvt()->set_enable(*x2_op_acc.cvt().aluCVTAccessor().enable()); + protoSDPX2OpDesc->mutable_cvt()->mutable_alu_cvt()->set_truncate(*x2_op_acc.cvt().aluCVTAccessor().truncate()); + protoSDPX2OpDesc->mutable_cvt()->mutable_alu_cvt()->set_scale(*x2_op_acc.cvt().aluCVTAccessor().scale()); + protoSDPX2OpDesc->mutable_cvt()->mutable_alu_cvt()->set_offset(*x2_op_acc.cvt().aluCVTAccessor().offset()); + protoSDPX2OpDesc->mutable_cvt()->mutable_mul_cvt()->set_enable(*x2_op_acc.cvt().mulCVTAccessor().enable()); + protoSDPX2OpDesc->mutable_cvt()->mutable_mul_cvt()->set_truncate(*x2_op_acc.cvt().mulCVTAccessor().truncate()); + protoSDPX2OpDesc->mutable_cvt()->mutable_mul_cvt()->set_scale(*x2_op_acc.cvt().mulCVTAccessor().scale()); + protoSDPX2OpDesc->mutable_cvt()->mutable_mul_cvt()->set_offset(*x2_op_acc.cvt().mulCVTAccessor().offset()); + + + protoSDPYOpDesc->set_enable(*y_op_acc.enable()); + protoSDPYOpDesc->set_alu_type(nvdla_prototest_interface::ALUType::ALU_SUM); + protoSDPYOpDesc->set_type(nvdla_prototest_interface::SDPOpType::SDP_OP_ADD); + protoSDPYOpDesc->set_mode(nvdla_prototest_interface::SDPOp_SDPOpMode::SDPOp_SDPOpMode_SDP_OP_PER_KERNEL); + protoSDPYOpDesc->set_act(nvdla_prototest_interface::SDPActivation::ACT_NONE); + protoSDPYOpDesc->set_shift_value(*y_op_acc.shiftValue()); + protoSDPYOpDesc->set_alu_operand(*y_op_acc.ALUOperand()); + protoSDPYOpDesc->set_mul_operand(*y_op_acc.MulOperand()); + protoSDPYOpDesc->set_truncate(*y_op_acc.truncate()); + protoSDPYOpDesc->set_precision(protoSrcPrec); + protoSDPYOpDesc->mutable_cvt()->mutable_alu_cvt()->set_enable(*y_op_acc.cvt().aluCVTAccessor().enable()); + protoSDPYOpDesc->mutable_cvt()->mutable_alu_cvt()->set_truncate(*y_op_acc.cvt().aluCVTAccessor().truncate()); + protoSDPYOpDesc->mutable_cvt()->mutable_alu_cvt()->set_scale(*y_op_acc.cvt().aluCVTAccessor().scale()); + protoSDPYOpDesc->mutable_cvt()->mutable_alu_cvt()->set_offset(*y_op_acc.cvt().aluCVTAccessor().offset()); + protoSDPYOpDesc->mutable_cvt()->mutable_mul_cvt()->set_enable(*y_op_acc.cvt().mulCVTAccessor().enable()); + protoSDPYOpDesc->mutable_cvt()->mutable_mul_cvt()->set_truncate(*y_op_acc.cvt().mulCVTAccessor().truncate()); + protoSDPYOpDesc->mutable_cvt()->mutable_mul_cvt()->set_scale(*y_op_acc.cvt().mulCVTAccessor().scale()); + protoSDPYOpDesc->mutable_cvt()->mutable_mul_cvt()->set_offset(*y_op_acc.cvt().mulCVTAccessor().offset()); + + + if (*fused_acc.index() != -1) { + protoSrcDataCube->set_type(nvdla_prototest_interface::MemType::DLA_MEM_HW); + } else { + protoSrcDataCube->set_type(nvdla_prototest_interface::MemType::DLA_MEM_MC); + } + protoSrcDataCube->set_address(*src_data_acc.address()); + protoSrcDataCube->set_size(src_tsd->tensorBufferDesc()->size() - src_tsd->bufferOffset()); + protoSrcDataCube->set_width(*src_data_acc.width()); + protoSrcDataCube->set_height(*src_data_acc.height()); + protoSrcDataCube->set_channel(*src_data_acc.channel()); + protoSrcDataCube->set_line_stride(*src_data_acc.lineStride()); + protoSrcDataCube->set_surf_stride(*src_data_acc.surfStride()); + protoSrcDataCube->set_plane_stride(*src_data_acc.planeStride()); + protoSrcDataCube->mutable_mem_info()->set_mem_id(src_tsd->tensorBufferDesc()->memoryId(batch_id)); + protoSrcDataCube->mutable_mem_info()->set_mem_size(src_tsd->tensorBufferDesc()->size()); + protoSrcDataCube->mutable_mem_info()->set_offset(src_tsd->bufferOffset()); + + protoDstDataCube->set_type(nvdla_prototest_interface::MemType::DLA_MEM_MC); + protoDstDataCube->set_address(*dst_data_acc.address()); + protoDstDataCube->set_size(dst_tsd->tensorBufferDesc()->size() - dst_tsd->bufferOffset()); + protoDstDataCube->set_width(*dst_data_acc.width()); + protoDstDataCube->set_height(*dst_data_acc.height()); + protoDstDataCube->set_channel(*dst_data_acc.channel()); + protoDstDataCube->set_line_stride(*dst_data_acc.lineStride()); + protoDstDataCube->set_surf_stride(*dst_data_acc.surfStride()); + protoDstDataCube->set_plane_stride(*dst_data_acc.planeStride()); + protoDstDataCube->mutable_mem_info()->set_mem_id(dst_tsd->tensorBufferDesc()->memoryId(batch_id)); + protoDstDataCube->mutable_mem_info()->set_mem_size(dst_tsd->tensorBufferDesc()->size()); + protoDstDataCube->mutable_mem_info()->set_offset(dst_tsd->bufferOffset()); + if (numConsumers == 0) { + protoDstDataCube->mutable_mem_info()->set_fill_type(nvdla_prototest_interface::FillerType::FILL_NONE); + protoDstDataCube->mutable_mem_info()->set_flag(nvdla_prototest_interface::MemFlag::DLA_MEM_OUTPUT); + protoDstDataCube->mutable_mem_info()->set_precision(protoDstPrec); + } +fail: + return e; +} +#endif + +}; // nvdla::priv::engine_ast:: +}; // nvdla::priv:: +}; // nvdla:: diff --git a/umd/core/src/compiler/engine-ast/BDMAGroupOp.cpp b/umd/core/src/compiler/engine-ast/BDMAGroupOp.cpp new file mode 100644 index 00000000..63b3e4ee --- /dev/null +++ b/umd/core/src/compiler/engine-ast/BDMAGroupOp.cpp @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#include + +#include "priv/EngineAST.h" +#include "priv/Tensor.h" +#include "ErrorMacros.h" + +using std::endl; + +namespace nvdla +{ +namespace priv +{ + + +}; // nvdla::priv:: +}; // nvdla:: diff --git a/umd/core/src/compiler/engine-ast/BDMANode.cpp b/umd/core/src/compiler/engine-ast/BDMANode.cpp new file mode 100644 index 00000000..5638286d --- /dev/null +++ b/umd/core/src/compiler/engine-ast/BDMANode.cpp @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#include +#include + +#include "priv/EngineAST.h" +#include "priv/Tensor.h" +#include "ErrorMacros.h" + +using std::endl; + +namespace nvdla +{ +namespace priv +{ + +//---------------------------------------------------------------------- +// Code Emission Utils +//---------------------------------------------------------------------- +engine_ast::BDMAEngineParams engine_ast::BDMANode::calcTransferParams +( + surface::TensorSurfaceDesc* in_tsd, + surface::TensorSurfaceDesc* out_tsd +) +{ + NvDlaError e = NvDlaError_Success; + NVDLA_UNUSED(e); + engine_ast::BDMAEngineParams transfer_params; + int bpe; + + if (in_tsd->surfaceFormat().bytesPerElement() != out_tsd->surfaceFormat().bytesPerElement()) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Input and Output surfaces have different precisions, %d and %d", + (int)in_tsd->surfaceFormat().bytesPerElement(), + (int)out_tsd->surfaceFormat().bytesPerElement()); + } + + bpe = in_tsd->surfaceFormat().bytesPerElement(); + + + if (in_tsd->dimensions().c != out_tsd->dimensions().c || + in_tsd->dimensions().h != out_tsd->dimensions().h || + in_tsd->dimensions().w != out_tsd->dimensions().w) + { + REPORT_ERROR(NvDlaError_BadParameter, "Input and Output surfaces have different dimensions:"); + REPORT_ERROR(NvDlaError_BadParameter, "Src[%d x %d x %d]", (int)in_tsd->dimensions().c, (int)in_tsd->dimensions().h, (int)in_tsd->dimensions().w); + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Dst[%d x %d x %d]", (int)out_tsd->dimensions().c, (int)out_tsd->dimensions().h, (int)out_tsd->dimensions().w); + } + + gLogInfo << "bdma xfr params bpe=" << bpe << endl; + +#if 0 + { + NvU32 line_size = in_tsd->dimensions().w * bpe; + NvU32 padded_line_size = 32 * ((line_size + 31) / 32); // tbd: get lineStride from surface + transfer_params.setLineSize( 32 * ((line_size + 31)/32)); + transfer_params.setLineRepeat( in_tsd->dimensions().h ); + transfer_params.setSrcLine( padded_line_size ); + transfer_params.setDestLine( padded_line_size ); + + if ( in_tsd->surfaceFormat().category().v() == surface::SurfaceCategoryEnum::FEATURE_DATA ) + { + transfer_params.setSrcSurface( padded_line_size * in_tsd->dimensions().h ); + transfer_params.setDestSurface( padded_line_size * out_tsd->dimensions().h ); + transfer_params.setSurfaceRepeat(in_tsd->dimensions().c); + } + else + { + ORIGINATE_ERROR_FAIL(NvDlaError_SurfaceNotSupported, "Surface Format Not Supported!!"); + } + } +#else + // hack for transfer debug. just move 32B per. + { + NvU32 line_size = in_tsd->dimensions().w * bpe; + NvU32 padded_line_size = 32 * ((line_size + 31) / 32); + NVDLA_UNUSED(padded_line_size); + transfer_params.setLineSize( 32 ); + transfer_params.setLineRepeat( 1 ); + transfer_params.setSrcLine( 32 ); + transfer_params.setDestLine( 32 ); + + if ( in_tsd->surfaceFormat().category().v() == surface::SurfaceCategoryEnum::FEATURE_DATA ) + { + transfer_params.setSrcSurface( 32 ); + transfer_params.setDestSurface( 32 ); + transfer_params.setSurfaceRepeat( 1 ); + } + else + { + ORIGINATE_ERROR_FAIL(NvDlaError_SurfaceNotSupported, "Surface Format Not Supported!!"); + } + + + } +#endif + + + + +fail: + return transfer_params; +} + +}; // nvdla::priv:: +}; // nvdla:: diff --git a/umd/core/src/compiler/engine-ast/BDMASingleOp.cpp b/umd/core/src/compiler/engine-ast/BDMASingleOp.cpp new file mode 100644 index 00000000..48ffd73d --- /dev/null +++ b/umd/core/src/compiler/engine-ast/BDMASingleOp.cpp @@ -0,0 +1,130 @@ +/* + * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#include + +#include "priv/EngineAST.h" +#include "priv/Tensor.h" +#include "priv/Compiler.h" + +#include "ErrorMacros.h" + +using std::endl; + +namespace nvdla +{ +namespace priv +{ + +//---------------------------------------------------------------------- +// Code Emission Utils +//---------------------------------------------------------------------- + + +NvDlaError engine_ast::BDMASingleDMAOpNode::emitOp(engine_ast::Graph *g, + DLAInterface *target_dla, + NvU32 op_slot, NvU32 batch_id, + DLACommonOpDescAccessor dep, + DLAOperationContainerAccessor op, + DLASurfaceContainerAccessor surf) +{ + NvDlaError e = NvDlaSuccess; + DLABDMAOpDescAccessor bdma_op = op.bdmaOpDescAccessor(0); + surface::TensorSurfaceDesc *src_tsd = g->nodeInputTensorSurface(this, 0, supportedInSurfCategories()); + surface::TensorSurfaceDesc *dst_tsd = g->nodeOutputTensorSurface(this, 0, supportedOutSurfCategories()); + + DLAConsumerAccessor fused_acc = dep.fusedParentAccessor(); + DLABDMASurfaceDescAccessor surf_acc = surf.bdmaSurfaceDescAccessor(0); + DLABDMATransferDescAccessor trns_acc = surf_acc.transferAccessor(0); // always the 1st one for single-dma-op + NVDLA_UNUSED(fused_acc); + + *bdma_op.numTransfers() = 1; + + emitDependencyParams(target_dla, dep, batch_id); + + *surf_acc.numTransfers() = getTransferParams().numTransfers(); + + switch (src_tsd->tensorBufferDesc()->memoryLoc(batch_id).e()) + { + case memory::LocationEnum::lDRAM: + *surf_acc.srcType() = surf_acc.type_MC(); + break; + + case memory::LocationEnum::lCVSRAM: + *surf_acc.srcType() = surf_acc.type_CV(); + break; + + default: + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "goofy surf acc src type=%d\n", + (int)src_tsd->tensorBufferDesc()->memoryLoc(batch_id).v()); + break; + } + + switch ( dst_tsd->tensorBufferDesc()->memoryLoc(batch_id).e() ) + { + case memory::LocationEnum::lDRAM: + *surf_acc.dstType() = surf_acc.type_MC(); + break; + case memory::LocationEnum::lCVSRAM: + *surf_acc.dstType() = surf_acc.type_CV(); + break; + default: + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "goofy surf acc dst type=%d\n", + (int)dst_tsd->tensorBufferDesc()->memoryLoc(batch_id).v()); + break; + } + + *trns_acc.srcAddress() = src_tsd->addressId(batch_id); + *trns_acc.dstAddress() = dst_tsd->addressId(batch_id); + + *trns_acc.lineSize() = getTransferParams().lineSize(); + *trns_acc.lineRepeat() = getTransferParams().lineRepeat(); + *trns_acc.srcLine() = getTransferParams().srcLine(); + *trns_acc.dstLine() = getTransferParams().destLine(); + *trns_acc.surfaceRepeat() = getTransferParams().surfaceRepeat(); + *trns_acc.srcSurface() = getTransferParams().srcSurface(); + *trns_acc.dstSurface() = getTransferParams().destSurface(); + + if ( g->debugOps() ) + { + gLogInfo << "Single BDMA node @ op_slot = " << op_slot << " batch_id = " << batch_id << endl; + gLogInfo << "\tsrc address: " << *trns_acc.srcAddress() << " type:" << (int) *surf_acc.srcType() << endl; + gLogInfo << "\tdst address: " << *trns_acc.dstAddress() << " type:" << (int) *surf_acc.dstType() << endl; + gLogInfo << "\tnum transfers: " << *surf_acc.numTransfers() << endl; + gLogInfo << "\tline size: " << *trns_acc.lineSize() << " repeat: " << *trns_acc.lineRepeat() << endl; + gLogInfo << "\tsrc line: " << *trns_acc.srcLine() << " dst line: " << *trns_acc.dstLine() << endl; + gLogInfo << "\tsrc surface: " << *trns_acc.srcSurface() << " dst surface: " << *trns_acc.dstSurface() << endl; + gLogInfo << "\tsurface repeat: " << *trns_acc.surfaceRepeat() << endl; + } + + fail: + return e; +} + +}; // nvdla::priv:: +}; // nvdla:: diff --git a/umd/core/src/compiler/engine-ast/BatchNormOp.cpp b/umd/core/src/compiler/engine-ast/BatchNormOp.cpp new file mode 100644 index 00000000..632a1980 --- /dev/null +++ b/umd/core/src/compiler/engine-ast/BatchNormOp.cpp @@ -0,0 +1,1964 @@ +/* + * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#include + +#include "priv/Type.h" +#include "priv/EngineAST.h" +#include "priv/LowPrecision.h" +#include "priv/Profile.h" +#include "priv/Tensor.h" +#include "priv/Compiler.h" +#include "priv/WeightTranslationUnit.h" + +#include "ErrorMacros.h" + +using std::endl; +using std::max; + +namespace nvdla +{ +namespace priv +{ + +NvDlaError engine_ast::SDPBatchNormOpNode::captureCanonicalBatchNormData() +{ + NvDlaError e = NvDlaError_Success; + Dims4 bnDims; + Tensor* bnDataTensor = NULL; + // engine_ast::Edge* bnDataEdge = NULL; + + if (params().meanDims() != params().varianceDims()) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Mismatching dims for mean and variance"); + } + + bnDims = params().batchNormDims(); + + bnDataTensor = graph()->addAuxTensor(graph()->newAuxTensorName(), bnDims, TensorType::kBATCH_NORM); + + /*bnDataEdge = */graph()->addDataEdge((canonical_ast::Edge*)0, (engine_ast::Node*)0, this, bnDataTensor); + +fail: + return e; +} + +void engine_ast::SDPBatchNormOpNode::captureCanonicalParams() +{ + NvDlaError e = NvDlaSuccess; + + params().x1Params().setEnabled(true); + switch(canonicalNode()->params().mode()) + { + case BatchNormMode::bnUNIFORM: params().x1Params().setMode(SDPModeEnum::SDP_MODE_PER_LAYER); break; + case BatchNormMode::bnm_CHANNEL: params().x1Params().setMode(SDPModeEnum::SDP_MODE_PER_CHANNEL); break; + default: params().x1Params().setMode(SDPModeEnum::SDP_MODE_UNKNOWN); + } + params().x1Params().setAluType(SDPALUTypeEnum::SDP_ALU_TYPE_SUM); + params().x1Params().setOpType(SDPOpTypeEnum::SDP_OP_TYPE_BOTH); + params().setEpsilon(canonicalNode()->params().epsilon()); + params().setMeanDims(canonicalNode()->params().meanDims()); + params().setVarianceDims(canonicalNode()->params().varianceDims()); + if (params().meanDims() != params().varianceDims()) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Mean dims and Variance dims don't match for %s", name().c_str()); + } + else + { + params().setBatchNormDims(params().meanDims()); + } + params().setRawMeanData(canonicalNode()->params().mean()); + params().setRawVarianceData(canonicalNode()->params().variance()); + params().setDLABatchNormData(Weights(DataType::FLOAT, NULL, 0)); + PROPAGATE_ERROR_FAIL(captureCanonicalBatchNormData()); + +fail: + return; +} + +void engine_ast::SDPBatchNormOpNode::inheritParams(Node* otherNode) +{ + // inherit the parameters that make sense (keep adding later) + SDPBatchNormOpNode* otherBN = NodeFactory::nodeCast(otherNode); + params().setX1Params(otherBN->params().x1Params()); + params().setEpsilon(otherBN->params().epsilon()); + params().setMeanDims(otherBN->params().meanDims()); + params().setVarianceDims(otherBN->params().varianceDims()); + params().setBatchNormDims(otherBN->params().batchNormDims()); + params().setRawMeanData(otherBN->params().rawMeanData()); + params().setRawVarianceData(otherBN->params().rawVarianceData()); + params().setDLABatchNormData(otherBN->params().DLABatchNormData()); + params().setOutCVT(otherBN->params().outCVT()); + + SDPNode* asSdpNode = NodeFactory::nodeCast(this); + SDPNode* otherBNAsSdpNode = NodeFactory::nodeCast(otherNode); + asSdpNode->params().setConvMode(otherBNAsSdpNode->params().convMode()); + asSdpNode->params().setWinogradParams(otherBNAsSdpNode->params().winogradParams()); + asSdpNode->params().setNumGroups(otherBNAsSdpNode->params().numGroups()); +} + +std::vector engine_ast::SDPBatchNormOpNode::suggestAuxSurfaceFormats(engine_ast::Edge* xEdge) +{ + NvDlaError e = NvDlaSuccess; + NVDLA_UNUSED(e); + std::vector supportedAuxSFs = supportedAuxSurfFormats(); + std::vector suggestedAuxSFs; + std::vector::iterator auxSFItr; + surface::SurfacePrecision compPrec = graph()->profile()->computePrecision(); + + if (supportedAuxSFs.size() == 0) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "No supported aux surface formats for %s", name().c_str()); + } + + switch(compPrec.v()) + { + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_FP16: { + surface::IsSurfacePrecisionDifferent desiredSP(surface::SurfacePrecisionEnum::NVDLA_PRECISION_FP16); + supportedAuxSFs.erase(std::remove_if(supportedAuxSFs.begin(), supportedAuxSFs.end(), desiredSP), supportedAuxSFs.end()); + } break; + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16: + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8: { + surface::IsSurfacePrecisionDifferent desiredSP(surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16); + supportedAuxSFs.erase(std::remove_if(supportedAuxSFs.begin(), supportedAuxSFs.end(), desiredSP), supportedAuxSFs.end()); + } break; + default: + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Don't support compute precision: %s for %s\n", + compPrec.c_str(), name().c_str()); + } + + suggestedAuxSFs = supportedAuxSFs; + +fail: + return suggestedAuxSFs; +} + +template +NvU32 engine_ast::SDPBatchNormOpNode::factorsPerEntity +( + MP rawValue, + AuxDataType auxType, + MP* factorizedValue +) +{ + NvU32 numFactors = 1; // default + + MP processedValue = rawValue; + MP tempFactors = rawValue; + + if (auxType == MEAN_DATA) + { + processedValue = (-1) * rawValue; + //FIXME: add logic to handle over/under-shooting mean + } + else if (auxType == VARIANCE_DATA) + { + rawValue += params().epsilon(); + processedValue = MP(1/sqrtf(rawValue)); + } + + + tempFactors = processedValue; + + // FIXME: determine strategy to find limits on negative side + if (processedValue > std::numeric_limits::max()) + { + NvF32 nthRoot = 2.0; // start with sqrt min + + do { + tempFactors = powf(processedValue, 1/nthRoot); + nthRoot++; + numFactors++; + } while(tempFactors > std::numeric_limits::max()); + + if ( debugFactorization() ) + { + gLogInfo << processedValue << " > " << float(std::numeric_limits::max()) + << " Factorized to " << float(tempFactors) << " after taking " << (nthRoot -1) << "th root!! " + << " Updating " << rawValue << " to " << tempFactors << endl; + } + } + + if (factorizedValue != NULL) + { + *factorizedValue = tempFactors; + } + + return numFactors; +} + +template +NvDlaError engine_ast::SDPBatchNormOpNode::maxFactorsPerEntity +( + Weights& auxData, + AuxDataType auxType, + NvU32* numFactors +) +{ + NvDlaError e = NvDlaSuccess; + engine_ast::Edge* auxEdge; + + MP* auxBlob = reinterpret_cast(const_cast(auxData.values)); + + PROPAGATE_ERROR_FAIL(nodeAuxEdge(&auxEdge)); + + if (params().x1Params().mode().v() == SDPModeEnum::SDP_MODE_PER_LAYER) + { + *numFactors = factorsPerEntity(auxBlob[0], auxType); + } + else if (params().x1Params().mode().v() == SDPModeEnum::SDP_MODE_PER_CHANNEL) + { + NvS32 chnls = auxEdge->tensorSurfaceDesc()->dimensions().c; + for (int cc = 0; cc < chnls; ++cc) + { + *numFactors = max(factorsPerEntity(auxBlob[cc], auxType), *numFactors); + } + } + +fail: + return e; +} + +template +NvDlaError engine_ast::SDPBatchNormOpNode::processMeanAndVar +( + Weights& rawMeanData, + Weights& processedMeanData, + Weights& rawVarData, + std::vector& processedVarData +) +{ + NvDlaError e = NvDlaSuccess; + engine_ast::Edge* auxEdge; + + MP* rawMeanBlob = reinterpret_cast(const_cast(rawMeanData.values)); + MP* rawVarBlob = reinterpret_cast(const_cast(rawVarData.values)); + MP* procMeanBlob; + MP* procVarBlob; + + PROPAGATE_ERROR_FAIL(nodeAuxEdge(&auxEdge)); + + // prepare mean and variance structs + processedMeanData.type = rawMeanData.type; + processedMeanData.count = rawMeanData.count; + procMeanBlob = (MP*)engine_ast::MemoryCollector::getInstance()->allocateMemory(rawMeanData.count * sizeof(MP)); + processedMeanData.values = procMeanBlob; + + for (size_t vv = 0; vv < processedVarData.size(); ++vv) + { + processedVarData[vv].type = rawMeanData.type; + processedVarData[vv].count = rawMeanData.count; + procVarBlob = (MP*)engine_ast::MemoryCollector::getInstance()->allocateMemory(rawVarData.count * sizeof(MP)); + processedVarData[vv].values = procVarBlob; + } + + // process mean and variance + if (params().x1Params().mode().v() == SDPModeEnum::SDP_MODE_PER_LAYER) + { + procMeanBlob[0] = (-1) * rawMeanBlob[0]; + for (size_t vv = 0; vv < processedVarData.size(); ++vv) + { + MP procVarValue; + procVarBlob = reinterpret_cast(const_cast(processedVarData[vv].values)); + + // if no need to factorize, 1st blob should contain the processed data + // and subsequent blobs should contain '1' + if (factorsPerEntity(rawVarBlob[0], VARIANCE_DATA, &procVarValue) == 1) + { + procVarBlob[0] = (vv == 0) ? procVarValue : 1; + } + } + } + else if (params().x1Params().mode().v() == SDPModeEnum::SDP_MODE_PER_CHANNEL) + { + NvS32 chnls = auxEdge->tensorSurfaceDesc()->dimensions().c; + for (int cc = 0; cc < chnls; ++cc) + { + procMeanBlob[cc] = (-1) * rawMeanBlob[cc]; + for (size_t vv = 0; vv < processedVarData.size(); ++vv) + { + MP procVarValue; + procVarBlob = reinterpret_cast(const_cast(processedVarData[vv].values)); + + // if no need to factorize, 1st blob should contain the processed data + // and subsequent blobs should contain '1' + if (factorsPerEntity(rawVarBlob[cc], VARIANCE_DATA, &procVarValue) == 1) + { + procVarBlob[cc] = (vv == 0) ? procVarValue : 1; + } + else + { + procVarBlob[cc] = procVarValue; + } + } + } + } + else + { + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Don't support SDP mode %s", params().x1Params().mode().c_str()); + } + +fail: + return e; +} + +/*---------------------Scale Mean Data to INT16------------------------------*/ +static bool absCompare(NvS32 a, NvS32 b) +{ + return (std::abs(a) < std::abs(b)); +} + +NvDlaError engine_ast::SDPBatchNormOpNode::scaleMeanToInt16 +( + ConvCoreNode* fusedConv, + std::vector& filterScales, + std::vector& inTensorScales +) +{ + NvDlaError e = NvDlaSuccess; + + NvF32 perTensorInTensorScl = inTensorScales.at(0); + bool isPerKernelQtz = graph()->profile()->quantizationMode() == nvdla::QuantizationMode::PER_KERNEL; + bool isScalingDone = false; + + NvS32 maxMean; + NvS32 numBits; + NvU32 meanShift; + std::vector< NvS32 > rescaledMean32; + + NvF32 scaledFP32Mean = 0.0f; + NvS16 int16Mean = 0; + Weights origMeanBlob = params().rawMeanData(); + Weights int16MeanBlob; + NvS16* pInt16Mean = (NvS16*)std::malloc(origMeanBlob.count * sizeof(NvS16)); + NvU32 numMeanData = origMeanBlob.count; + + if ( fusedConv ) + { + NvU32 numFilters = filterScales.size(); + ASSERT ( filterScales.size() == (size_t)auxEdges().at(0)->tensorSurfaceDesc()->dimensions().c ); + for (NvU32 ff = 0; ff < numFilters; ++ff) + { + if ( isPerKernelQtz && (filterScales[0] != filterScales[ff]) ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Filter scales should be same for %s when PER_KERNEL " + "quantization is ON", fusedConv->name().c_str()); + } + } + + ASSERT ( inTensorScales.size() == (size_t)fusedConv->inputEdges().at(0)->tensorSurfaceDesc()->dimensions().c ); + for (NvF32 its = 1; its < inTensorScales.size(); ++its) + { + if ( perTensorInTensorScl != inTensorScales[its] ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Channel scales should be same for input of %s when PER_TENSOR " + "scaling is ON", fusedConv->name().c_str()); + } + } + + ASSERT( numFilters == origMeanBlob.count ); + } + else + { + ASSERT ( inTensorScales.size() == (size_t)inputEdges().at(0)->tensorSurfaceDesc()->dimensions().c ); + for (NvF32 its = 1; its < inTensorScales.size(); ++its) + { + if ( perTensorInTensorScl != inTensorScales[its] ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Channel scales should be same for input, when PER_TENSOR scaling is ON"); + } + } + } + + for ( NvU32 bb = 0; bb < numMeanData; ++bb) + { + switch (origMeanBlob.type) + { + case nvdla::DataType::FLOAT: { + NvF32 fp32Mean = reinterpret_cast(const_cast(origMeanBlob.values))[bb]; + NvF32 meanRescaleFactor = perTensorInTensorScl; + if ( fusedConv ) + { + meanRescaleFactor = perTensorInTensorScl * filterScales[bb]; + } + scaledFP32Mean = NvF32(fp32Mean / meanRescaleFactor); + NvS32 int32Mean = std::floor(scaledFP32Mean + 0.5f); + rescaledMean32.push_back(int32Mean); + } break; + case nvdla::DataType::HALF: { + NvF32 fp16Mean = reinterpret_cast(const_cast(origMeanBlob.values))[bb]; + NvF32 meanRescaleFactor = perTensorInTensorScl; + if ( fusedConv ) + { + meanRescaleFactor = perTensorInTensorScl * filterScales[bb]; + } + scaledFP32Mean = NvF32(fp16Mean / meanRescaleFactor); + NvS32 int32Mean = std::floor(scaledFP32Mean + 0.5f); + rescaledMean32.push_back(int32Mean); + } break; + default: + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Can't scale mean data which is not FLOAT / HALF " + "precision for %s\n", name().c_str()); + } + } + + maxMean = *std::max_element(rescaledMean32.begin(), rescaledMean32.end(), absCompare); + numBits = ceil(log(abs(maxMean))/log(2)) + 1; + meanShift = std::min(SDP_LEFT_SHIFT_MAX_PLACES, std::max(0, numBits - 16)); + + do + { + isScalingDone = true; + for ( NvU32 bb = 0; bb < numMeanData; ++bb) + { + int16Mean = static_cast(rescaledMean32[bb] >> meanShift); + pInt16Mean[bb] = int16Mean; + + if ( graph()->debugQuantization() ) + { + if (fusedConv) + { + gLogInfo << "rawMean/Si*Sw " + << reinterpret_cast(const_cast(origMeanBlob.values))[bb] << " / " + << " ( " << perTensorInTensorScl << " * " << filterScales[bb] << " ) = " + << (reinterpret_cast(const_cast(origMeanBlob.values))[bb]/(perTensorInTensorScl * filterScales[bb])) + << " -> " << rescaledMean32[bb] << " -> " << (int)int16Mean << "*2^-" << meanShift << endl; + } + else + { + gLogInfo << "rawMean/Si " + << reinterpret_cast(const_cast(origMeanBlob.values))[bb] << " / " + << perTensorInTensorScl << " = " + << (reinterpret_cast(const_cast(origMeanBlob.values))[bb]/perTensorInTensorScl) + << " -> " << rescaledMean32[bb] << " -> " << (int)int16Mean << "*2^-" << meanShift << endl; + } + } + if (int16Mean == 0 && meanShift > 0) + { + meanShift--; + isScalingDone = false; + break; + } + } + } while (!isScalingDone); + + params().x1Params().setShiftValue(meanShift); + + int16MeanBlob.type = nvdla::DataType::INT16; + int16MeanBlob.values = pInt16Mean; + int16MeanBlob.count = origMeanBlob.count; + + // set scaled mean + params().setRawMeanData(int16MeanBlob); + +fail: + return e; +} + +/********************************Process Aux Data*****************************/ +/* + * BN has mean and variance data to deal with. These need pre-processing before + * going to SDP such that the mean-subtraction becomes (-mean) addition and + * variance-divison becomes (1/variance) multiplication. + * This API also pre-fetches if any of these offline math operation could + * create data that over/under shoots INT8/INT16/FP16 range. If so, it + * breaks the super-small/super-big data and delegates it to an adjunct + * scale/bias operation + */ +NvDlaError engine_ast::SDPBatchNormOpNode::preProcessAuxData() +{ + NvDlaError e = NvDlaSuccess; + + NvU32 numMeanBlobs = 0; + NvU32 numVarBlobs = 0; + Weights rawMeanData = params().rawMeanData(); + Weights rawVarData = params().rawVarianceData(); + + nvdla::DataType modelPrec = rawMeanData.type == rawVarData.type ? + rawMeanData.type : + nvdla::DataType::UNKNOWN; + surface::SurfacePrecision computePrec = graph()->profile()->computePrecision(); + + /* Batch-Norm:-> y = (x - mean) / sqrt(variance+eps) + * SDP can do ADD and MUL, not SUB and DIV + */ + + // this step calculates requirement and number of adjunct_operations + PRECISION_SWITCH(modelPrec.v(), computePrec.v(), e, maxFactorsPerEntity, rawMeanData, MEAN_DATA, &numMeanBlobs) + if (numMeanBlobs > 1) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue , "FIXME: Cannot handle Mean values beyond computePrecision limits for now"); + } + else if (e != NvDlaSuccess) + { + ORIGINATE_ERROR_FAIL(e); + } + + PRECISION_SWITCH(modelPrec.v(), computePrec.v(), e, maxFactorsPerEntity, rawVarData, VARIANCE_DATA, &numVarBlobs) + if (e != NvDlaSuccess) + { + ORIGINATE_ERROR_FAIL(e); + } + + // now process the data to convert mean to (-mean) and var to (1/sqrt(var)), meanwhile factorizing + // those processed entities which don't fit in the dynamic range of compute precision + { + Weights processedMeanBlob; + std::vector processedVarBlobs(numVarBlobs); + + PRECISION_SWITCH(modelPrec.v(), computePrec.v(), e, processMeanAndVar, rawMeanData, processedMeanBlob, + rawVarData, processedVarBlobs); + + /* Override raw data from parser to the pre-processed data. + * NOTE: that they are still don't have the suitable layout for DLA; + * so they are still 'raw' for the engine + */ + params().setRawMeanData(processedMeanBlob); + params().setRawVarianceData(processedVarBlobs[0]); + + /* If the varData (FIXME: mean) was factorized, append a scale op post this BN, + * to multiply the subsequent processed variance factors to the result of this BN + */ + if (numVarBlobs > 1) + { + Tensor* ioTensor; + engine_ast::Edge* origOutEdge; + engine_ast::Edge* ioEdge; + NVDLA_UNUSED(ioEdge); + + std::vector adjunctScaleOps = std::vector(); + std::vector::iterator scaleIter; + + PROPAGATE_ERROR_FAIL(nodeDataEdge(supportedOutSurfCategories(), ast::EdgeSideEnum::FIRST, &origOutEdge)); + + for (NvU32 vv = 1; vv < numVarBlobs; ++vv) + { + engine_ast::SDPScaleOpNode* newScaleNode = engine_ast::NodeFactory::newSDPScaleOpNode(NULL, graph()); + if ( !newScaleNode) + { + ORIGINATE_ERROR_FAIL(NvDlaError_InsufficientMemory, "Couldn't create adjunct scale op"); + } + + newScaleNode->params().x1Params().setMode(params().x1Params().mode()); + newScaleNode->params().setScaleDims(params().batchNormDims()); + newScaleNode->params().setRawScaleData(processedVarBlobs[vv]); + newScaleNode->params().setDLAScaleData(Weights(DataType::FLOAT, NULL, 0)); + PROPAGATE_ERROR_FAIL(newScaleNode->captureCanonicalScaleData()); + + adjunctScaleOps.push_back(newScaleNode); + } + //delegate the orig BN's output edge to the last of scale ops + graph()->replaceEdgeNodes(origOutEdge, ast::EdgeSideEnum::FIRST, this, adjunctScaleOps.back()); + + // connect the newly added scale nodes with edges + for(scaleIter = adjunctScaleOps.begin(); scaleIter != adjunctScaleOps.end(); ++scaleIter) + { + Tensor* origOutTensor = origOutEdge->originalTensor(); + engine_ast::SDPScaleOpNode* scaleNode = (*scaleIter); + engine_ast::Node* edgeSrcNode; + + ioTensor = origOutTensor->clone(); + ioTensor->setTensorType(TensorType::kIO); + if (scaleIter == adjunctScaleOps.begin()) + { + edgeSrcNode = this; + } + else + { + edgeSrcNode = *(scaleIter-1); + } + + ioEdge = graph()->addDataEdge((canonical_ast::Edge*)0, edgeSrcNode, scaleNode, ioTensor); + } + } + } +fail: + return e; +} + +/*--------------------Quantize Aux Data-----------------------------*/ +NvDlaError engine_ast::SDPBatchNormOpNode::quantizeAuxData() +{ + NvDlaError e = NvDlaSuccess; + + std::vector filterScales = {0.0f}; + std::vector inTensorScales; + + ConvCoreNode* fusedConv = NULL; + + PROPAGATE_ERROR_FAIL( verifyEdgePorts() ); + + if (graph()->profile()->computePrecision().v() != surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8) + { + // No need to quantize data for FP16 + goto fail; + } + + if ( graph()->profile()->tensorScalingMode().v() != nvdla::TensorScalingMode::PER_TENSOR ) + { + // don't support any other scaling mode than PER_TENSOR + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Don't support tensor scaling mode: %s\n", + graph()->profile()->tensorScalingMode().c_str()); + } + + fusedConv = NodeFactory::nodeCast(graph()->upstreamDataNodes(this).size() ? + graph()->upstreamDataNodes(this).at(0) : + NULL); + if ( fusedConv ) + { + PROPAGATE_ERROR_FAIL( fusedConv->verifyEdgePorts() ); + filterScales = fusedConv->params().filterScales(); + inTensorScales = fusedConv->inputEdges().at(0)->originalTensor()->getChannelScales(); + } + else + { + inTensorScales = inputEdges().at(0)->originalTensor()->getChannelScales(); + } + /* + * StandAlone INT8 Batch Norm op is represented as: + * + * O = (I - mean) / sigma + * QoSo = (QiSi - mean) / sigma + * Qo = (Qi - (mean/Si)) * (Si/ (So * sigma)) + * + * Do mean/Si in preprocess aux data and scale it to INT16 + * Set meanData to this new value + * + * Do (Si/ (So * sigma)) in handleLowPrecision and convert it to 2^(-m) * n equation + * where n becomes the variance data and m values does the right shift + * + * CONV + BN Unfused + * + * O = ((I * W) - mean ) / sigma + * QoSo = ((QiSi * QwSw) - mean) / sigma + * Qo = (Qi * Qw - (mean / (Si * Sw)) * ((Si * Sw) / (So * Sigma)) + * + * Do mean / (Si * Sw) in preprocess aux data and scale it to INT16 + * Set meanData to this new value + * + * Do (Si * Sw) / (So * Sigma) in handleLowPrecision and convert it to 2^(-m) * n equation + * where n becomes the variance data and m values does the right shift + */ + if ( graph()->profile()->quantizationMode() == nvdla::QuantizationMode::PER_KERNEL || + graph()->profile()->quantizationMode() == nvdla::QuantizationMode::PER_FILTER ) + { + if (auxEdges().at(0)->tensorSurfaceDesc()->surfaceFormat().f().precision().v() == + surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16) + { + PROPAGATE_ERROR_FAIL( scaleMeanToInt16(fusedConv, filterScales, inTensorScales) ); + } + else + { + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Don't support precision: %s\n", + auxEdges().at(0)->tensorSurfaceDesc()->surfaceFormat().f().precision().v()); + } + } + else + { + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Don't support quantization mode: %s\n", + graph()->profile()->quantizationMode().c_str()); + } + +fail: + return e; +} + +/*------------------Low Precision Conversions for Batch Norm--------------------------*/ +template +NvDlaError engine_ast::SDPBatchNormOpNode::performPerLayerRescaling +( + ConvCoreNode* fusedConv, + std::vector& filterScales, + Weights& rawVarData, + std::vector& inTensorScales, + std::vector& outTensorScales +) +{ + NvDlaError e = NvDlaSuccess; + + NvS16 perTensorScl = 0; + NvU8 perTensorShft = 0; + NvF32 outputRescale = 0.0f; + std::pair scaleAndShift; + + NvS16* procVarBlob; + Weights procVarData; + MP* rawVarBlob = reinterpret_cast(const_cast(rawVarData.values)); + + procVarData.type = rawVarData.type; + procVarData.count = rawVarData.count; + procVarBlob = reinterpret_cast(std::malloc(rawVarData.count * sizeof(NvS16))); + procVarData.values = procVarBlob; + + NvU32 numFilters = 0; + NvF32 perKernelScale = 0.0f; + NvF32 perTensorInTensorScl = inTensorScales.at(0); + NvF32 perTensorOutTensorScl = outTensorScales.at(0); + + if ( fusedConv ) + { + numFilters = filterScales.size(); + perKernelScale = filterScales.at(0); + ASSERT ( filterScales.size() == (size_t)outputEdges().at(0)->tensorSurfaceDesc()->dimensions().c ); + for (NvU32 ff = 1; ff < numFilters; ++ff) + { + if ( perKernelScale != filterScales[ff] ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Filter scales should be same for %s when PER_KERNEL " + "quantization is ON", fusedConv->name().c_str()); + } + } + + ASSERT ( inTensorScales.size() == (size_t)fusedConv->inputEdges().at(0)->tensorSurfaceDesc()->dimensions().c ); + for (NvF32 its = 1; its < inTensorScales.size(); ++its) + { + if ( perTensorInTensorScl != inTensorScales[its] ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Channel scales should be same for input of %s when PER_TENSOR " + "scaling is ON", fusedConv->name().c_str()); + } + } + } + else + { + ASSERT ( inTensorScales.size() == (size_t)inputEdges().at(0)->tensorSurfaceDesc()->dimensions().c ); + for (NvF32 its = 1; its < inTensorScales.size(); ++its) + { + if ( perTensorInTensorScl != inTensorScales[its] ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Channel scales should be same for input of %s when PER_TENSOR " + "scaling is ON", name().c_str()); + } + } + } + + ASSERT ( outTensorScales.size() == (size_t)outputEdges().at(0)->tensorSurfaceDesc()->dimensions().c ); + for (NvF32 ots = 1; ots < outTensorScales.size(); ++ots) + { + if ( perTensorOutTensorScl != outTensorScales[ots] ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Channel scales should be same for output of %s when PER_TENSOR " + "scaling is ON", name().c_str()); + } + } + + outputRescale = ( perTensorInTensorScl * rawVarBlob[0] ) / perTensorOutTensorScl; + if ( fusedConv ) + { + outputRescale = outputRescale * perKernelScale; + } + e = calculateScaleAndShiftFromScalar(outputRescale, &scaleAndShift); + if (e != NvDlaSuccess) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, " Couldn't converge on `2^(x) * y` which could " + "safely represent %f within acceptable tolerance for %s\n", + outputRescale, name().c_str()); + } + + perTensorScl = scaleAndShift.first; + procVarBlob[0] = perTensorScl; + perTensorShft = scaleAndShift.second; + + if (graph()->debugQuantization()) + { + gLogInfo << name() << " Si * V[i] / So = " << perTensorInTensorScl << " * " << rawVarBlob[0] << " / " << perTensorOutTensorScl + << " = " << perTensorScl << "* 2^-" << (int)perTensorShft << endl; + } + + params().x1Params().setTruncate(perTensorShft); + params().setRawVarianceData(procVarData); + +fail: + return e; +} + +template +NvDlaError engine_ast::SDPBatchNormOpNode::performPerChannelRescaling +( + ConvCoreNode* fusedConv, + std::vector& filterScales, + Weights& rawVarData, + std::vector& inTensorScales, + std::vector& outTensorScales +) +{ + NvDlaError e = NvDlaSuccess; + + NvF32 maxRescaleFactor = 0.0f; + std::vector< NvF32 > outputRescales; + std::pair< NvS16, NvU8 > maxRescaleFactorScaleAndShift; + std::vector< std::pair > scalesAndShifts; + + Weights rescaleWtsBlob; + + NvU32 numVarData; + NvF32 perTensorInTensorScl = inTensorScales.at(0); + NvF32 perTensorOutTensorScl = outTensorScales.at(0); + MP* rawVarBlob = reinterpret_cast(const_cast(rawVarData.values)); + numVarData = rawVarData.count; + + + if ( fusedConv ) + { + ASSERT ( filterScales.size() == (size_t)outputEdges().at(0)->tensorSurfaceDesc()->dimensions().c ); + ASSERT ( inTensorScales.size() == (size_t)fusedConv->inputEdges().at(0)->tensorSurfaceDesc()->dimensions().c ); + for (NvF32 its = 1; its < inTensorScales.size(); ++its) + { + if ( perTensorInTensorScl != inTensorScales[its] ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Channel scales should be same for input of %s when PER_TENSOR " + "scaling is ON", fusedConv->name().c_str()); + } + } + } + else + { + ASSERT ( inTensorScales.size() == (size_t)inputEdges().at(0)->tensorSurfaceDesc()->dimensions().c ); + for (NvF32 its = 1; its < inTensorScales.size(); ++its) + { + if ( perTensorInTensorScl != inTensorScales[its] ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Channel scales should be same for input of %s when PER_TENSOR " + "scaling is ON", name().c_str()); + } + } + } + + ASSERT ( outTensorScales.size() == (size_t)outputEdges().at(0)->tensorSurfaceDesc()->dimensions().c ); + for (NvF32 ots = 1; ots < outTensorScales.size(); ++ots) + { + if ( perTensorOutTensorScl != outTensorScales[ots] ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Channel scales should be same for output of %s when PER_TENSOR " + "scaling is ON", name().c_str()); + } + } + + for (NvU32 cc = 0; cc < numVarData; ++cc) + { + NvF32 rescaleData = ( perTensorInTensorScl * rawVarBlob[cc] ) / perTensorOutTensorScl; + if ( fusedConv ) + { + rescaleData = rescaleData * filterScales[cc]; + } + outputRescales.push_back(rescaleData); + } + + maxRescaleFactor = *std::max_element(outputRescales.begin(), outputRescales.end()); + + // find the shifter value for the max of the rescale factors, since we can use only 1 shifter + e = calculateScaleAndShiftFromScalar(maxRescaleFactor, &maxRescaleFactorScaleAndShift); + if (e != NvDlaSuccess) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, " Couldn't converge on `2^(x) * y` which could " + "safely represent %f within acceptable tolerance for %s\n", + maxRescaleFactor, name().c_str()); + } + + // pass the common shifter to determine int16 scalars for each rescale factors + e = factorizeScalars(outputRescales, &scalesAndShifts, maxRescaleFactorScaleAndShift.second); + if (e != NvDlaSuccess) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Can't factorize scalars for %s for int8 into scale+truncate pairs", + name().c_str()); + } + + { + // fixme: assert that the existing aux data is also of type INT16 + rescaleWtsBlob.type = nvdla::DataType::INT16; + rescaleWtsBlob.count = numVarData; + NvS16* pINT16Rescalars = reinterpret_cast(std::malloc(numVarData * sizeof(NvS16))); + for (NvU32 cc = 0; cc < numVarData; ++cc) + { + pINT16Rescalars[cc] = scalesAndShifts[cc].first; + if (graph()->debugQuantization()) + { + gLogInfo << name() << " Si * V[k] / So = " << perTensorInTensorScl << " * " << rawVarBlob[cc] << " / " << perTensorOutTensorScl + << " = " << scalesAndShifts[cc].first << "* 2^-" << (int)scalesAndShifts[cc].second << endl; + } + } + rescaleWtsBlob.values = pINT16Rescalars; + } + + params().x1Params().setTruncate(maxRescaleFactorScaleAndShift.second); + params().setRawVarianceData(rescaleWtsBlob); + +fail: + return e; +} + +NvDlaError engine_ast::SDPBatchNormOpNode::handleLowPrecisionConversions() +{ + NvDlaError e = NvDlaSuccess; + + ConvCoreNode* fusedConv; + + std::vector inTensorScales; + std::vector outTensorScales; + std::vector filterScales = {0.0f}; + Weights rawVarData = params().rawVarianceData(); + + nvdla::DataType modelPrec = rawVarData.type; + surface::SurfacePrecision computePrec = graph()->profile()->computePrecision(); + + PROPAGATE_ERROR_FAIL( verifyEdgePorts() ); + + if (graph()->profile()->computePrecision().v() != surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8) + { + // nop + goto fail; + } + + if ( graph()->profile()->tensorScalingMode().v() != nvdla::TensorScalingMode::PER_TENSOR ) + { + // don't support any other scaling mode than PER_TENSOR + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Don't support tensor scaling mode: %s\n", + graph()->profile()->tensorScalingMode().c_str()); + } + + fusedConv = NodeFactory::nodeCast(dependencyParams(0).fusedNode(IODirectionEnum::INPUT)); + if ( fusedConv ) + { + PROPAGATE_ERROR_FAIL( fusedConv->verifyEdgePorts() ); + filterScales = fusedConv->params().filterScales(); + inTensorScales =fusedConv->inputEdges().at(0)->originalTensor()->getChannelScales(); + } + else + { + inTensorScales = inputEdges().at(0)->originalTensor()->getChannelScales(); + } + + outTensorScales = outputEdges().at(0)->originalTensor()->getChannelScales(); + + if ( graph()->profile()->quantizationMode() == nvdla::QuantizationMode::PER_KERNEL || + graph()->profile()->quantizationMode() == nvdla::QuantizationMode::PER_FILTER ) + { + if ( params().x1Params().mode().v() == SDPModeEnum::SDP_MODE_PER_LAYER ) + { + PRECISION_SWITCH(modelPrec.v(), computePrec.v(), e, performPerLayerRescaling, + fusedConv, + filterScales, + rawVarData, + inTensorScales, + outTensorScales); + if (e != NvDlaSuccess) + { + ORIGINATE_ERROR_FAIL(e, "Could not rescale the per layer variance data"); + } + } + else if ( params().x1Params().mode().v() == SDPModeEnum::SDP_MODE_PER_CHANNEL ) + { + PRECISION_SWITCH(modelPrec.v(), computePrec.v(), e, performPerChannelRescaling, + fusedConv, + filterScales, + rawVarData, + inTensorScales, + outTensorScales); + if (e != NvDlaSuccess) + { + ORIGINATE_ERROR_FAIL(e, "Could not rescale the per channel variance data"); + } + } + else + { + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Don't support quantization mode: %s\n", + graph()->profile()->quantizationMode().c_str()); + } + } + else + { + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Don't support quantization mode: %s\n", + graph()->profile()->quantizationMode().c_str()); + } +fail: + return e; +} + +/*-------------------------Merge SDP Operations------------------------------*/ +/* + * Sometimes BN and scale ops are adjacent in the graph. It may be likely to combine + * the variance factors of the BN op with the scale factors of the adjacent scale op. + * This api attempts to combine them if the product doesn't overshoot the dynamic range + * of the prevalent compute precision + */ +engine_ast::Node* engine_ast::SDPBatchNormOpNode::mergeWithSDPOp(SDPNode* nextSDP) +{ + Node* removableNode = NULL; + + // If activation is already enabled, do not allow any math op fusions + if (params().x1Params().actType().v() != SDP_ACT_TYPE_UNKNOWN + && params().x1Params().actType().v() != SDP_ACT_TYPE_NONE) + { + if (graph()->debugMathOptz()) + { + gLogInfo << "Merge not feasible: " << this->name() << " activation: "; + gLogInfo << NvU16(params().x1Params().actType().v()) << endl; + } + goto fail; + } + + // fixme: limit the batchnorm math op fusion with only sdp-scale, sdp-bias and relu for now + if (nextSDP->engineOpType().v() == EngineOpTypeEnum::SDP_SCALE) + { + removableNode = tryToMergeWithScaleOp(nextSDP); + } + else if (nextSDP->engineOpType().v() == EngineOpTypeEnum::SDP_BIAS) + { + removableNode = tryToMergeWithBiasOpInplace(nextSDP); + if (!removableNode) + { + removableNode = tryToMergeWithBiasOp(nextSDP); + } + } + else if (nextSDP->engineOpType().v() == EngineOpTypeEnum::SDP_ACTIVATION) + { + if (NodeFactory::nodeCast(nextSDP)->params(/*batch_id*/0).x1Params().actType().v() == + SDPActTypeEnum::SDP_ACT_TYPE_RELU) + { + removableNode = tryToMergeWithActOp(nextSDP); + } + } + +fail: + return removableNode; +} + +engine_ast::Node* engine_ast::SDPBatchNormOpNode::tryToMergeWithScaleOp(SDPNode* SDPSclOp) +{ + NvDlaError e = NvDlaSuccess; + Node* removableNode = NULL; + SDPScaleOpNode* scaleOp = NodeFactory::nodeCast(SDPSclOp); + Weights rawVarData = params().rawVarianceData(); + Weights rawScaleData = scaleOp->params().rawScaleData(); + Dims4 commonDims = params().varianceDims(); + Weights combinedVarAndScaleData; + WeightTrns wtTrns; + NVDLA_UNUSED(e); + + nvdla::DataType modelPrec = rawVarData.type == rawScaleData.type ? + rawVarData.type : + nvdla::DataType::UNKNOWN; + surface::SurfacePrecision computePrec = graph()->profile()->computePrecision(); + + WeightTrns::WeightDims wtTrnsDims (rawVarData.count, commonDims.n, commonDims.c, + commonDims.w, commonDims.h, 1, 1); + + if (!graph()->profile()->canSDPMergeMathOps()) + { + goto fail; + } + + if ( params().x1Params().mode().e() != scaleOp->params().x1Params().mode().e() || + params().varianceDims() != scaleOp->params().scaleDims()) + { + if ( debugFactorization() ) + { + gLogWarning << "Can't combine Variance and Scale factors " + << "of " << name() << " and " << scaleOp->name() + << " since they operate in different modes"<< endl; + } + goto fail; + } + + PRECISION_SWITCH(modelPrec.v(), computePrec.v(), combinedVarAndScaleData, + wtTrns.combineMultiplicationFactors, + params().x1Params().mode(), + wtTrnsDims, + rawVarData, + rawScaleData); + + if (combinedVarAndScaleData.values == NULL) + { + if ( debugFactorization() ) + { + gLogWarning << "Can't successfully combine Variance and Scale factors of " + << name() << " and " << scaleOp->name() << endl; + } + goto fail; + } + + /* Override the variance data with the combined blob. + * NOTE: that it still doesn't have the suitable layout for DLA; + * so its still 'raw' variance data for the engine + */ + params().setRawVarianceData(combinedVarAndScaleData); + + // activation from next SDP node + params().x1Params().setActType(scaleOp->params().x1Params().actType()); + + /* Since Scale factors are folded into BN, we can safely remove + * the Scale Op from engine AST + */ + removableNode = SDPSclOp; + + if ( graph()->debugMathOptz() ) + { + gLogInfo << "Fuse " << name() << " and " << SDPSclOp->name() << " into " << name() << endl; + } + +fail: + return removableNode; +} + +/* + * BatchNorm preceded by a Convolution/Scale Op and followed by a Bias op is a good oppotunity + * for multi-level fusion + * + * Conv + BN + Bias : y = [((d * w) + m)*(1/v)] + b + * = d*w/v + m/v + b + * = d*w' + b' + * = Conv + Bias + * => 3 ops reduced to 2 and + * 2 SDPs combined in the process to hold up only single SDP-X sub-engine + * + * Scl + BN + Bias : y = [((x*s) + m)*(1/v)] + b + * = x*s/b + m/v + b + * = x*s' + b' + * = Scl + Bias + * => 3 ops reduced to 2 and + * further optimization can collapse (Scl + Bias) into a new BN; + * so eventually reduced to 1 op + * + * BN + Bias : y = ((x + m)*(1/v)) + b + * = x/v + m/v + b + * = x*(1/v) + b' + * = Scl + Bias + * => 2 ops trnasform into 2 different ops + * however further optimization can collapse this (Scl + Bias) into a new BN; + * so eventually reduced to 1 op + * + * From all above scenarios, its evident that whenever you encounter BN + Bias, then convert the BN into Scl + * and delegate the Variance data to it and the Mean data to the succeeding Bias + * and in future optimizations let: + * - Conv,Scl combine into Conv + * - Bias,Bias combine to Bias + * - Scl, Bias combine to BN again + */ +engine_ast::Node* engine_ast::SDPBatchNormOpNode::tryToMergeWithBiasOp(SDPNode* SDPBiasOp) +{ + NvDlaError e = NvDlaSuccess; + Node* removableNode = NULL; + SDPBiasOpNode* biasOp = NodeFactory::nodeCast(SDPBiasOp); + Weights rawMeanData = params().rawMeanData(); + Weights rawVarData = params().rawVarianceData(); + Weights rawBiasData = biasOp->params().rawBiasData(); + Dims4 bnDims = params().batchNormDims(); + Weights combinedMeanAndVarData; + Weights combinedMeanVarAndBiasData; + WeightTrns wtTrns; + NVDLA_UNUSED(e); + + nvdla::DataType modelPrec = rawVarData.type == rawMeanData.type ? + rawVarData.type : + nvdla::DataType::UNKNOWN; + surface::SurfacePrecision computePrec = graph()->profile()->computePrecision(); + WeightTrns::WeightDims wtTrnsDims (rawVarData.count, bnDims.n, bnDims.c, bnDims.w, bnDims.h, 1, 1); + + if (!graph()->profile()->canSDPMergeMathOps()) + { + goto fail; + } + + if ( params().x1Params().mode().e() != biasOp->params().x1Params().mode().e() || + params().batchNormDims() != biasOp->params().biasDims()) + { + if ( debugFactorization() ) + { + gLogWarning << "Can't combine Mean, Variance with Bias factors " + << "of " << name() << " and " << biasOp->name() + << " since they operate in different modes"<< endl; + } + goto fail; + } + + PRECISION_SWITCH(modelPrec.v(), computePrec.v(), combinedMeanAndVarData, + wtTrns.combineMultiplicationFactors, + params().x1Params().mode(), + wtTrnsDims, + rawMeanData, + rawVarData); + + if (combinedMeanAndVarData.values == NULL) + { + if ( debugFactorization() ) + { + gLogWarning << "Can't successfully combine Variance and Scale factors of " + << name() << " and " << biasOp->name() << endl; + } + goto fail; + } + + PRECISION_SWITCH(modelPrec.v(), computePrec.v(), combinedMeanVarAndBiasData, + wtTrns.combineAdditionFactors, + params().x1Params().mode(), + wtTrnsDims, + combinedMeanAndVarData, + rawBiasData); + + if (combinedMeanVarAndBiasData.values == NULL) + { + if ( debugFactorization() ) + { + gLogWarning << "Can't successfully combine Mean/Variance with Bias factors of " + << name() << " and " << biasOp->name() << endl; + } + goto fail; + } + + /* BN + Bias : y = ((x+m)*(1/v)) + b + * = x/v + m/v + b + * If each of the m/v factors and (m/v + b) factors didn't over/undershoot + * the compute precision limits, then go ahead and replace the BN node with + * a brand new Scl node - delegating the (1/v) factors of the original BN node + * to the new Scl node and delegate the (m/v + b) combined factors computed to the + * existing Bias node + */ + { + NodeSequence substituteNodes; + SDPScaleOpNode* newSclReplaceNode = NULL; + + /* Step-1: Substitute BN with Scl node */ + newSclReplaceNode = NodeFactory::newSDPScaleOpNode(NULL, graph()); + if ( !newSclReplaceNode) + { + ORIGINATE_ERROR_FAIL(NvDlaError_InsufficientMemory, "Couldn't create new Scl op for replacing %s", + name().c_str()); + } + newSclReplaceNode->params().x1Params().setMode(params().x1Params().mode()); + newSclReplaceNode->params().setScaleDims(bnDims); + newSclReplaceNode->params().setRawScaleData(rawVarData); + newSclReplaceNode->params().setDLAScaleData(Weights(DataType::FLOAT, NULL, 0)); + PROPAGATE_ERROR_FAIL(newSclReplaceNode->captureCanonicalScaleData()); + + /* Step-2: Transfer the (m/v + b) factors to the existing Bias node */ + biasOp->params().setRawBiasData(combinedMeanVarAndBiasData); + + /* Step-3: Substitute the BN node with Scl node */ + substituteNodes.push_back(newSclReplaceNode); + PROPAGATE_ERROR_FAIL(graph()->substituteNodeInAST(this, substituteNodes)); + + /* Step-4: Since Scl is replacing BN, inherit the op mode from the BN node before its removed*/ + newSclReplaceNode->params().setConvMode(params().convMode()); + newSclReplaceNode->params().setWinogradParams(params().winogradParams()); + + /* Step-5: Finally remove the BN node */ + removableNode = this; + + if ( graph()->debugMathOptz() ) + { + gLogInfo << "Replace " << name() << " with " << newSclReplaceNode->name() << endl; + } + } + +fail: + return removableNode; +} + +/* + * BatchNorm followed by a Bias op can be squashed into BatchNorm. + * + * BN + Bias : y = ((x + m)*(1/v)) + b + * = x/v + m/v + b + * = (x + (m + b*v)) * 1/v + * = (x + m') * 1/v + * Here, 2 ops fused into 1, if m' fits in the format precision range + * Generally, bias values are much higher than kernel weights, + * so batch-norm + bias -> batch-norm, optimization may perform well + * in accuracy. + * + */ +engine_ast::Node* engine_ast::SDPBatchNormOpNode::tryToMergeWithBiasOpInplace(SDPNode* SDPBiasOp) +{ + NvDlaError e = NvDlaSuccess; + Node* removableNode = NULL; + SDPBiasOpNode* biasOp = NodeFactory::nodeCast(SDPBiasOp); + Weights rawMeanData = params().rawMeanData(); + Weights rawVarData = params().rawVarianceData(); + Weights rawBiasData = biasOp->params().rawBiasData(); + Dims4 bnDims = params().batchNormDims(); + Weights invertVarData; + Weights combinedBiasAndVarData; + Weights combinedMeanVarAndBiasData; + WeightTrns wtTrns; + NVDLA_UNUSED(e); + + nvdla::DataType modelPrec = rawVarData.type == rawMeanData.type ? + rawVarData.type : + nvdla::DataType::UNKNOWN; + surface::SurfacePrecision computePrec = graph()->profile()->computePrecision(); + WeightTrns::WeightDims wtTrnsDims (rawVarData.count, bnDims.n, bnDims.c, bnDims.w, bnDims.h, 1, 1); + + if (!graph()->profile()->canSDPMergeMathOps()) + { + goto fail; + } + + if ( params().x1Params().mode().e() != biasOp->params().x1Params().mode().e() || + params().batchNormDims() != biasOp->params().biasDims()) + { + if ( debugFactorization() ) + { + gLogWarning << "Can't combine Mean, Variance with Bias factors " + << "of " << name() << " and " << biasOp->name() + << " since they operate in different modes"<< endl; + } + goto fail; + } + + /* rawVarData stores 1/variance values, + * Since we need variance, take a reciprocal. + * Since reciprocal blob is temporary, no precision switch required. + */ + PRECISION_SWITCH(modelPrec.v(), modelPrec.v(), invertVarData, + wtTrns.invertDataBlob, + params().x1Params().mode(), + wtTrnsDims, + rawVarData); + + if (invertVarData.values == NULL) + { + if ( debugFactorization() ) + { + gLogWarning << "Can't invert variance during fusing of " + << name() << " and " << biasOp->name() << endl; + } + goto fail; + } + + /* bias * variance */ + PRECISION_SWITCH(modelPrec.v(), computePrec.v(), combinedBiasAndVarData, + wtTrns.combineMultiplicationFactors, + params().x1Params().mode(), + wtTrnsDims, + rawBiasData, + invertVarData); + + if (combinedBiasAndVarData.values == NULL) + { + if ( debugFactorization() ) + { + gLogWarning << "Can't successfully combine Variance and Scale factors of " + << name() << " and " << biasOp->name() << endl; + } + goto fail; + } + + /* mean' = mean + (bias * variance) */ + PRECISION_SWITCH(modelPrec.v(), computePrec.v(), combinedMeanVarAndBiasData, + wtTrns.combineAdditionFactors, + params().x1Params().mode(), + wtTrnsDims, + combinedBiasAndVarData, + rawMeanData); + + if (combinedMeanVarAndBiasData.values == NULL) + { + if ( debugFactorization() ) + { + gLogWarning << "Can't successfully combine Mean/Variance with Bias factors of " + << name() << " and " << biasOp->name() << endl; + } + goto fail; + } + params().setRawMeanData(combinedMeanVarAndBiasData); + + // activation from next SDP node + params().x1Params().setActType(biasOp->params().x1Params().actType()); + + removableNode = SDPBiasOp; + +fail: + if (combinedBiasAndVarData.values) + { + engine_ast::MemoryCollector::getInstance()->freeMemory(const_cast(combinedBiasAndVarData.values)); + } + if (invertVarData.values) + { + engine_ast::MemoryCollector::getInstance()->freeMemory(const_cast(invertVarData.values)); + } + return removableNode; +} + +/* Configure SDP SuperOp SubEngine with BatchNorm Op */ +NvDlaError engine_ast::SDPBatchNormOpNode::configureSDPSuperOpSubEngine(SDPSuperOpNode* sdpSuperOp, SDPSubEngineType xN) +{ + NvDlaError e = NvDlaSuccess; + + if (xN == SDP_ENGINE_X1) + { + sdpSuperOp->params().setX1Params(params().x1Params()); + sdpSuperOp->params().setConvMode(params().convMode()); + sdpSuperOp->params().setWinogradParams(params().winogradParams()); + } + else + { + sdpSuperOp->params().setX2Params(params().x1Params()); + } + + sdpSuperOp->params().setAuxDataType(xN, TensorType::kBATCH_NORM); + + sdpSuperOp->params().setMultiplierDims(xN, params().varianceDims()); + sdpSuperOp->params().setAdderDims(xN, params().meanDims()); + sdpSuperOp->params().setDLADataDims(xN, params().batchNormDims()); + + sdpSuperOp->params().setRawMultiplierData(xN, params().rawVarianceData()); + sdpSuperOp->params().setRawAdderData(xN, params().rawMeanData()); + sdpSuperOp->params().setDLAData(xN, params().DLABatchNormData()); + + sdpSuperOp->params().setAuxSurfaceFormats(xN, suggestAuxSurfaceFormats()); + + if ( graph()->debugFuseSubEngineOps() ) + { + gLogInfo << "configureSDPSuperOpSubEngine: " << this->name() << " in "; + gLogInfo << sdpSuperOp->name() << " x" << (NvU16)xN.e()+1 << endl; + } + + return e; +} + +/********************************Aux Data Translation***************************/ +NvDlaError engine_ast::SDPBatchNormOpNode::translateAuxData() +{ + NvDlaError e = NvDlaSuccess; + + engine_ast::Edge* auxEdge; + + Weights trnsBNData; + surface::SurfacePrecision computePrecision; + Weights meanData = params().rawMeanData(); + Weights varData = params().rawVarianceData(); + + // find the aux data edge + PROPAGATE_ERROR_FAIL(nodeAuxEdge(&auxEdge)); + + computePrecision = auxEdge->tensorSurfaceDesc()->surfaceFormat().f().precision(); + + if ( graph()->debugWeights() ) + { + gLogInfo << "translating weights for " << name() << "bn-dims = " << + auxEdge->tensorSurfaceDesc()->dimensions().n << "," << + auxEdge->tensorSurfaceDesc()->dimensions().c << "," << + auxEdge->tensorSurfaceDesc()->dimensions().h << "," << + auxEdge->tensorSurfaceDesc()->dimensions().w << "," << + "and size= " << meanData.count << " + " << varData.count << endl; + } + + { + WeightTrns::WeightDims bnDims (meanData.count, + auxEdge->tensorSurfaceDesc()->dimensions().n, + auxEdge->tensorSurfaceDesc()->dimensions().c, + auxEdge->tensorSurfaceDesc()->dimensions().w, + auxEdge->tensorSurfaceDesc()->dimensions().h, + 1, //strides dont matter for BN + 1); + + PRECISION_SWITCH(meanData.type.v(), computePrecision.v(), trnsBNData, WeightTrns::translateDataForBatchNorm, + params().x1Params().mode(), + bnDims, + meanData, + varData); + + if (trnsBNData.values == NULL) + { + PROPAGATE_ERROR_FAIL(NvDlaError_BadValue, "BN data trnaslation failed for node '%s'", name().c_str()); + } + + params().setDLABatchNormData(trnsBNData); + + } + +fail: + return e; +} + +NvDlaError engine_ast::SDPBatchNormOpNode::emitOp(Graph *g, + DLAInterface *target_dla, + NvU32 op_slot, NvU32 batch_id, + DLACommonOpDescAccessor dep, + DLAOperationContainerAccessor op, + DLASurfaceContainerAccessor surf) +{ + NvDlaError e = NvDlaSuccess; + DLASDPOpDescAccessor sdp_op = op.sdpOpDescAccessor(0); + DLACVTParamAccessor out_cvt_acc = sdp_op.outCVTAccessor(); + DLASDPOpAccessor x1_op_acc = sdp_op.x1OpAccessor(); + DLASDPOpAccessor x2_op_acc = sdp_op.x2OpAccessor(); + DLASDPOpAccessor y_op_acc = sdp_op.yOpAccessor(); + DLASDPSurfaceDescAccessor surf_acc = surf.sdpSurfaceDescAccessor(0); + DLADataCubeAccessor src_data_acc = surf_acc.srcDataAccessor(); + DLADataCubeAccessor dst_data_acc = surf_acc.dstDataAccessor(); + DLADataCubeAccessor x1_data_acc = surf_acc.x1DataAccessor(); + DLADataCubeAccessor x2_data_acc = surf_acc.x2DataAccessor(); + DLADataCubeAccessor y_data_acc = surf_acc.yDataAccessor(); + DLAConsumerAccessor fused_acc = dep.fusedParentAccessor(); + NVDLA_UNUSED(x2_data_acc); + NVDLA_UNUSED(y_data_acc); + NVDLA_UNUSED(fused_acc); + + surface::TensorSurfaceDesc *src_tsd = g->nodeInputTensorSurface(this, 0, supportedInSurfCategories()); + surface::TensorSurfaceDesc *dst_tsd = g->nodeOutputTensorSurface(this, 0, supportedOutSurfCategories()); + surface::TensorSurfaceDesc *bn_tsd = g->nodeInputTensorSurface(this, 0, supportedAuxSurfCategories()); + + *sdp_op.srcPrecision() = ASTToDLAInterface::getSDPPrecision(target_dla, src_tsd->surfaceFormat().precision()); + *sdp_op.dstPrecision() = ASTToDLAInterface::getSDPPrecision(target_dla, dst_tsd->surfaceFormat().precision()); + *sdp_op.LUTIndex() = -1; + *sdp_op.batchNum() = 1; + *sdp_op.batchStride() = 0; + + *out_cvt_acc.scale() = 1; + *out_cvt_acc.truncate() = 0; + *out_cvt_acc.offset() = 0; + *out_cvt_acc.enable() = 1; + + *x1_op_acc.enable() = 1; + *x1_op_acc.ALUType() = x1_op_acc.ALUType_Sum(); + *x1_op_acc.type() = x1_op_acc.type_Both(); + *x1_op_acc.mode() = ASTToDLAInterface::getSDPMode(target_dla, params(batch_id).x1Params().mode()); + *x1_op_acc.act() = ASTToDLAInterface::getSDPActType(target_dla, params(batch_id).x1Params().actType()); + *x1_op_acc.shiftValue() = params(batch_id).x1Params().shiftValue();; + if (params(batch_id).x1Params().mode().e() == engine_ast::SDPModeEnum::SDP_MODE_PER_LAYER) + { + Weights bnData = params().DLABatchNormData(); + + if (bnData.count > 2) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, + "More than one data available" + "in per-layer mode(#data = %u)", + bnData.count); + } + switch (bnData.type) + { + case DataType::HALF: + case DataType::INT16: + *x1_op_acc.ALUOperand() = + reinterpret_cast(bnData.values)[SDP_ADDER_DATA_INDEX]; + *x1_op_acc.MulOperand() = + reinterpret_cast(bnData.values)[SDP_MULTIPLIER_DATA_INDEX]; + break; + case DataType::INT8: + *x1_op_acc.ALUOperand() = + reinterpret_cast(bnData.values)[SDP_ADDER_DATA_INDEX]; + *x1_op_acc.MulOperand() = + reinterpret_cast(bnData.values)[SDP_MULTIPLIER_DATA_INDEX]; + break; + default: + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, + "Unexpected data type %s", + bnData.type.c_str()); + } + } + else + { + *x1_op_acc.ALUOperand() = 0; + *x1_op_acc.MulOperand() = 1; + } + *x1_op_acc.truncate() = params(batch_id).x1Params().truncate();; + *x1_op_acc.precision() = ASTToDLAInterface::getSDPPrecision(target_dla, bn_tsd->surfaceFormat().precision()); + + *x2_op_acc.enable() = 0; + *y_op_acc.enable() = 0; + + emitDependencyParams(target_dla, dep, batch_id); + setDataCubeAccessor(src_data_acc, src_tsd, IODirectionEnum::INPUT, batch_id); + setDataCubeAccessor(dst_data_acc, dst_tsd, IODirectionEnum::OUTPUT, batch_id); + + if (params(batch_id).x1Params().mode().e() != engine_ast::SDPModeEnum::SDP_MODE_PER_LAYER) + { + setDataCubeAccessor(x1_data_acc, bn_tsd, IODirectionEnum::UNKNOWN, batch_id); + } + + if ( params(batch_id).convMode().v() == ConvolutionModeEnum::CONV_WINOGRAD ) + { + *sdp_op.convMode() = sdp_op.convMode_Winograd(); + + *src_data_acc.width() = params().winogradParams().ioDims.w; + *src_data_acc.height() = params().winogradParams().ioDims.h; + + *dst_data_acc.width() = params().winogradParams().ioDims.w; + *dst_data_acc.height() = params().winogradParams().ioDims.h; + } + else if ( params(batch_id).convMode().v() == ConvolutionModeEnum::CONV_DIRECT ) + { + *sdp_op.convMode() = sdp_op.convMode_Direct(); + } + else + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unsupported Conv mode for %s", name().c_str()); + } + + if ( g->debugOps() ) + { + gLogInfo << "SDP BatchNorm node @ op_slot = " << op_slot << " batch_id = " << batch_id << endl; + gLogInfo << "\tsrc precision " << (int)*sdp_op.srcPrecision() << endl; + gLogInfo << "\tdst precision " << (int)*sdp_op.dstPrecision() << endl; + gLogInfo << "\tx1 enable " << (int)*x1_op_acc.enable() << endl; + if (*x1_op_acc.enable()) + { + gLogInfo << "\tx1 precision " << (int)*x1_op_acc.precision() << endl; + gLogInfo << "\tx1 aluType " << (int)*x1_op_acc.ALUType() << endl; + gLogInfo << "\tx1 type " << (int)*x1_op_acc.type() << endl; + gLogInfo << "\tx1 mode " << (int)*x1_op_acc.mode() << endl; + gLogInfo << "\tx1 act " << (int)*x1_op_acc.act() << endl; + gLogInfo << "\tx1 shiftValue " << (int)*x1_op_acc.shiftValue() << endl; + gLogInfo << "\tx1 aluOperand " << (int)*x1_op_acc.ALUOperand() << endl; + gLogInfo << "\tx1 mulOperand " << (int)*x1_op_acc.MulOperand() << endl; + gLogInfo << "\tx1 truncate " << (int)*x1_op_acc.truncate() << endl; + } + gLogInfo << "\tx2 enable " << (int)*x2_op_acc.enable() << endl; + if (*x2_op_acc.enable()) + { + gLogInfo << "\tx2 precision " << (int)*x2_op_acc.precision() << endl; + gLogInfo << "\tx2 aluType " << (int)*x2_op_acc.ALUType() << endl; + gLogInfo << "\tx2 type " << (int)*x2_op_acc.type() << endl; + gLogInfo << "\tx2 mode " << (int)*x2_op_acc.mode() << endl; + gLogInfo << "\tx2 act " << (int)*x2_op_acc.act() << endl; + gLogInfo << "\tx2 shiftValue " << (int)*x2_op_acc.shiftValue() << endl; + gLogInfo << "\tx2 aluOperand " << (int)*x2_op_acc.ALUOperand() << endl; + gLogInfo << "\tx2 mulOperand " << (int)*x2_op_acc.MulOperand() << endl; + gLogInfo << "\tx2 truncate " << (int)*x2_op_acc.truncate() << endl; + } + gLogInfo << "\ty enable " << (int)*y_op_acc.enable() << endl; + if (*y_op_acc.enable()) + { + gLogInfo << "\ty precision " << (int)*y_op_acc.precision() << endl; + gLogInfo << "\ty aluType " << (int)*y_op_acc.ALUType() << endl; + gLogInfo << "\ty type " << (int)*y_op_acc.type() << endl; + gLogInfo << "\ty mode " << (int)*y_op_acc.mode() << endl; + gLogInfo << "\ty act " << (int)*y_op_acc.act() << endl; + gLogInfo << "\ty shiftValue " << (int)*y_op_acc.shiftValue() << endl; + gLogInfo << "\ty aluOperand " << (int)*y_op_acc.ALUOperand() << endl; + gLogInfo << "\ty mulOperand " << (int)*y_op_acc.MulOperand() << endl; + gLogInfo << "\ty truncate " << (int)*y_op_acc.truncate() << endl; + } + gLogInfo << "\tsrc tsd:" << src_tsd->id() << endl; + gLogInfo << "\tdst tsd:" << dst_tsd->id() << endl; + gLogInfo << "\tdependencyCount" << (int)*dep.dependencyCount() << endl; + gLogInfo << "\tconv_mode " << (int)*sdp_op.convMode() << endl; + gLogInfo << "\tsrc addr=" << *src_data_acc.address() << endl; + gLogInfo << "\tsrc type=" << (int)*src_data_acc.type() << endl; + gLogInfo << "\tsrc size " << *src_data_acc.size() << endl; + gLogInfo << "\tsrc width " << *src_data_acc.width() << endl; + gLogInfo << "\tsrc height " << *src_data_acc.height() << endl; + gLogInfo << "\tsrc channel " << *src_data_acc.channel() << endl; + gLogInfo << "\tsrc linestride " << *src_data_acc.lineStride() << endl; + gLogInfo << "\tsrc surfstride " << *src_data_acc.surfStride() << endl; + gLogInfo << "\tbn addr=" << *x1_data_acc.address() << endl; + gLogInfo << "\tbn type=" << (int)*x1_data_acc.type() << endl; + gLogInfo << "\tbn size " << *x1_data_acc.size() << endl; + gLogInfo << "\tbn width " << *x1_data_acc.width() << endl; + gLogInfo << "\tbn height " << *x1_data_acc.height() << endl; + gLogInfo << "\tbn channel " << *x1_data_acc.channel() << endl; + gLogInfo << "\tbn linestride " << *x1_data_acc.lineStride() << endl; + gLogInfo << "\tbn surfstride " << *x1_data_acc.surfStride() << endl; + gLogInfo << "\tdst addr=" << *dst_data_acc.address() << endl; + gLogInfo << "\tdst type=" << (int)*dst_data_acc.type() << endl; + gLogInfo << "\tdst size " << *dst_data_acc.size() << endl; + gLogInfo << "\tdst width " << *dst_data_acc.width() << endl; + gLogInfo << "\tdst height " << *dst_data_acc.height() << endl; + gLogInfo << "\tdst channel " << *dst_data_acc.channel() << endl; + gLogInfo << "\tdst linestride " << *dst_data_acc.lineStride() << endl; + gLogInfo << "\tdst surfstride " << *dst_data_acc.surfStride() << endl; + } + +fail: + return e; +} + +#ifdef NVDLA_COMPILER_OUTPUT_FOR_PROTOTEST +static nvdla_prototest_interface::SDPOp_SDPOpMode opMode2InfOpMode(engine_ast::SDPMode om) +{ + nvdla_prototest_interface::SDPOp_SDPOpMode iom = nvdla_prototest_interface::SDPOp_SDPOpMode::SDPOp_SDPOpMode_SDP_OP_PER_KERNEL; + switch(om.v()) + { + case engine_ast::SDPModeEnum::SDP_MODE_PER_CHANNEL: iom = + nvdla_prototest_interface::SDPOp_SDPOpMode::SDPOp_SDPOpMode_SDP_OP_PER_KERNEL; break; + case engine_ast::SDPModeEnum::SDP_MODE_PER_ELEMENT: iom = + nvdla_prototest_interface::SDPOp_SDPOpMode::SDPOp_SDPOpMode_SDP_OP_PER_POINT; break; + case engine_ast::SDPModeEnum::SDP_MODE_PER_LAYER: iom = + nvdla_prototest_interface::SDPOp_SDPOpMode::SDPOp_SDPOpMode_SDP_OP_PER_LAYER; break; + default: + REPORT_ERROR(NvDlaError_BadParameter, "Unknown op mode: %s", om.c_str()); + } + + return iom; +} + +static nvdla_prototest_interface::SDPActivation actType2InfActType(engine_ast::SDPActType at) +{ + nvdla_prototest_interface::SDPActivation iat = nvdla_prototest_interface::SDPActivation::ACT_NONE; + switch(at.v()) + { + case engine_ast::SDPActTypeEnum::SDP_ACT_TYPE_NONE: iat = + nvdla_prototest_interface::SDPActivation::ACT_NONE; break; + case engine_ast::SDPActTypeEnum::SDP_ACT_TYPE_RELU: iat = + nvdla_prototest_interface::SDPActivation::ACT_RELU; break; + case engine_ast::SDPActTypeEnum::SDP_ACT_TYPE_TANH: + case engine_ast::SDPActTypeEnum::SDP_ACT_TYPE_SIGMOID:iat = + nvdla_prototest_interface::SDPActivation::ACT_LUT; break; + default: + REPORT_ERROR(NvDlaError_BadParameter, "Unknown act type: %s", at.c_str()); + } + + return iat; +} + +NvDlaError engine_ast::SDPBatchNormOpNode::emitOp(NvU32 op_slot, NvU32 batch_id, + DLAInterface* target_dla, + DLACommonOpDescAccessor& dep, + DLAOperationContainerAccessor& op, + DLASurfaceContainerAccessor& surf, + nvdla_prototest_interface::Layer* protoLayer) +{ + NvDlaError e = NvDlaSuccess; + NvU8 numConsumers = 0; + + DLASDPOpDescAccessor sdp_op = op.sdpOpDescAccessor(0); + DLACVTParamAccessor out_cvt_acc = sdp_op.outCVTAccessor(); + DLASDPOpAccessor x1_op_acc = sdp_op.x1OpAccessor(); + DLASDPOpAccessor x2_op_acc = sdp_op.x2OpAccessor(); + DLASDPOpAccessor y_op_acc = sdp_op.yOpAccessor(); + DLASDPSurfaceDescAccessor surf_acc = surf.sdpSurfaceDescAccessor(0); + DLADataCubeAccessor src_data_acc = surf_acc.srcDataAccessor(); + DLADataCubeAccessor dst_data_acc = surf_acc.dstDataAccessor(); + DLADataCubeAccessor x1_data_acc = surf_acc.x1DataAccessor(); + DLADataCubeAccessor x2_data_acc = surf_acc.x2DataAccessor(); + DLADataCubeAccessor y_data_acc = surf_acc.yDataAccessor(); + DLAConsumerAccessor fused_acc = dep.fusedParentAccessor(); + NVDLA_UNUSED(out_cvt_acc); + NVDLA_UNUSED(x2_data_acc); + NVDLA_UNUSED(y_data_acc); + NVDLA_UNUSED(batch_id); + + surface::TensorSurfaceDesc *src_tsd = graph()->nodeInputTensorSurface(this, 0, supportedInSurfCategories()); + surface::TensorSurfaceDesc *dst_tsd = graph()->nodeOutputTensorSurface(this, 0, supportedOutSurfCategories()); + surface::TensorSurfaceDesc *scale_tsd = graph()->nodeInputTensorSurface(this, 0, supportedAuxSurfCategories()); + + + nvdla_prototest_interface::SDPOpDesc* protoSDPOpDesc = protoLayer->mutable_op_config()->mutable_sdp_op(); + nvdla_prototest_interface::SDPSurfaceDesc* protoSDPSurfDesc = protoLayer->mutable_surface()->mutable_sdp_surface(); + nvdla_prototest_interface::SDPOp* protoSDPX1OpDesc = protoSDPOpDesc->mutable_x1_op(); + nvdla_prototest_interface::SDPOp* protoSDPX2OpDesc = protoSDPOpDesc->mutable_x2_op(); + nvdla_prototest_interface::SDPOp* protoSDPYOpDesc = protoSDPOpDesc->mutable_y_op(); + nvdla_prototest_interface::DataCube* protoSrcDataCube = protoSDPSurfDesc->mutable_src_data(); + nvdla_prototest_interface::DataCube* protoDstDataCube = protoSDPSurfDesc->mutable_dst_data(); + nvdla_prototest_interface::DataCube* protoX1DataCube = protoSDPSurfDesc->mutable_x1_data(); + nvdla_prototest_interface::DataPrecision protoSrcPrec, protoDstPrec; + + protoLayer->set_index(op_slot); + protoLayer->set_roi_index(0); + protoLayer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_SDP); + protoLayer->set_dependency_count(*dep.dependencyCount()); + + /* consumers */ + for (size_t c = 0; c < EngineType::num_elements(); c++) + { + NvS8 fw_op_index = ASTToDLAInterface::getEngineType(target_dla, c); + if ( fw_op_index < 0 ) + { + continue; + } + + DLAConsumerAccessor cons_acc = dep.consumerAccessor(fw_op_index); + if (*cons_acc.index() != -1) { + numConsumers++; + nvdla_prototest_interface::Consumer* protoConsumer = protoLayer->add_bottom(); + protoConsumer->set_index(*cons_acc.index()); + switch(c) { + case EngineTypeEnum::BDMA : protoConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_BDMA); break; + case EngineTypeEnum::CONVOLUTION : protoConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_CONV); break; + case EngineTypeEnum::SDP : protoConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_SDP); break; + case EngineTypeEnum::PDP : protoConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_PDP); break; + case EngineTypeEnum::CDP : protoConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_CDP); break; + case EngineTypeEnum::RUBIK: protoConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_RUBIK); break; + default: ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unrecognized consumer"); + } + switch(dependencyParams().consumer(c).opEvent().v()) { + case OperationEventTypeEnum::OP_CDMA_WEIGHT_DONE : protoConsumer->set_event(nvdla_prototest_interface::Consumer_EventType::Consumer_EventType_CDMA_WT_DONE); break; + case OperationEventTypeEnum::OP_CDMA_DATA_DONE : protoConsumer->set_event(nvdla_prototest_interface::Consumer_EventType::Consumer_EventType_CDMA_DT_DONE); break; + case OperationEventTypeEnum::OP_COMPLETED : protoConsumer->set_event(nvdla_prototest_interface::Consumer_EventType::Consumer_EventType_OP_COMPLETED); break; + case OperationEventTypeEnum::OP_ENABLED : protoConsumer->set_event(nvdla_prototest_interface::Consumer_EventType::Consumer_EventType_OP_ENABLED); break; + case OperationEventTypeEnum::OP_PROGRAMMED : protoConsumer->set_event(nvdla_prototest_interface::Consumer_EventType::Consumer_EventType_OP_PROGRAMMED); break; + default: ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unrecognized consumer event"); + } + } + } + + /* fused node */ + if (dependencyParams().fusedNode(engine_ast::IODirectionEnum::INPUT)) + { + nvdla_prototest_interface::Consumer* protoFusedConsumer = protoLayer->mutable_fused(); + protoFusedConsumer->set_index(*fused_acc.index()); + protoFusedConsumer->set_event(nvdla_prototest_interface::Consumer_EventType::Consumer_EventType_OP_ENABLED); + switch(dependencyParams().fusedNode(engine_ast::IODirectionEnum::INPUT)->engineType().v()) { + case EngineTypeEnum::CONVOLUTION: protoFusedConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_CONV); break; + default: ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "SDP can have only Conv op as its fused partner on input side"); + } + } + + switch(src_tsd->surfaceFormat().precision().v()) { + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_FP16 : protoSrcPrec = nvdla_prototest_interface::DataPrecision::PRECISION_FP16; break; + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16 : protoSrcPrec = nvdla_prototest_interface::DataPrecision::PRECISION_INT16; break; + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8 : protoSrcPrec = nvdla_prototest_interface::DataPrecision::PRECISION_INT8; break; + default: ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unrecognized src precision"); + } + + switch(dst_tsd->surfaceFormat().precision().v()) { + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_FP16 : protoDstPrec = nvdla_prototest_interface::DataPrecision::PRECISION_FP16; break; + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16 : protoDstPrec = nvdla_prototest_interface::DataPrecision::PRECISION_INT16; break; + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8 : protoDstPrec = nvdla_prototest_interface::DataPrecision::PRECISION_INT8; break; + default: ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unrecognized dst precision"); + } + + protoSDPOpDesc->set_src_precision(protoSrcPrec); + protoSDPOpDesc->set_dst_precision(protoDstPrec); + protoSDPOpDesc->set_lut_index(-1); + + protoSDPOpDesc->mutable_out_cvt()->set_enable(1); + protoSDPOpDesc->mutable_out_cvt()->set_offset(0); + protoSDPOpDesc->mutable_out_cvt()->set_scale(1); + protoSDPOpDesc->mutable_out_cvt()->set_truncate(0); + + protoSDPOpDesc->set_conv_mode(nvdla_prototest_interface::ConvMode::DIRECT); + protoSDPOpDesc->set_batch_num(1); + protoSDPOpDesc->set_batch_stride(0); + + protoSDPX1OpDesc->set_enable(*x1_op_acc.enable()); + protoSDPX1OpDesc->set_alu_type(nvdla_prototest_interface::ALUType::ALU_SUM); + protoSDPX1OpDesc->set_type(nvdla_prototest_interface::SDPOpType::SDP_OP_BOTH); + protoSDPX1OpDesc->set_mode(opMode2InfOpMode(params().x1Params().mode())); + protoSDPX1OpDesc->set_act(actType2InfActType(params().x1Params().actType())); + protoSDPX1OpDesc->set_shift_value(*x1_op_acc.shiftValue()); + protoSDPX1OpDesc->set_alu_operand(*x1_op_acc.ALUOperand()); + protoSDPX1OpDesc->set_mul_operand(*x1_op_acc.MulOperand()); + protoSDPX1OpDesc->set_truncate(*x1_op_acc.truncate()); + protoSDPX1OpDesc->set_precision(protoSrcPrec); + protoSDPX1OpDesc->mutable_cvt()->mutable_alu_cvt()->set_enable(*x1_op_acc.cvt().aluCVTAccessor().enable()); + protoSDPX1OpDesc->mutable_cvt()->mutable_alu_cvt()->set_truncate(*x1_op_acc.cvt().aluCVTAccessor().truncate()); + protoSDPX1OpDesc->mutable_cvt()->mutable_alu_cvt()->set_scale(*x1_op_acc.cvt().aluCVTAccessor().scale()); + protoSDPX1OpDesc->mutable_cvt()->mutable_alu_cvt()->set_offset(*x1_op_acc.cvt().aluCVTAccessor().offset()); + protoSDPX1OpDesc->mutable_cvt()->mutable_mul_cvt()->set_enable(*x1_op_acc.cvt().mulCVTAccessor().enable()); + protoSDPX1OpDesc->mutable_cvt()->mutable_mul_cvt()->set_truncate(*x1_op_acc.cvt().mulCVTAccessor().truncate()); + protoSDPX1OpDesc->mutable_cvt()->mutable_mul_cvt()->set_scale(*x1_op_acc.cvt().mulCVTAccessor().scale()); + protoSDPX1OpDesc->mutable_cvt()->mutable_mul_cvt()->set_offset(*x1_op_acc.cvt().mulCVTAccessor().offset()); + + protoSDPX2OpDesc->set_enable(*x2_op_acc.enable()); + protoSDPX2OpDesc->set_alu_type(nvdla_prototest_interface::ALUType::ALU_SUM); + protoSDPX2OpDesc->set_type(nvdla_prototest_interface::SDPOpType::SDP_OP_ADD); + protoSDPX2OpDesc->set_mode(nvdla_prototest_interface::SDPOp_SDPOpMode::SDPOp_SDPOpMode_SDP_OP_PER_KERNEL); + protoSDPX2OpDesc->set_act(nvdla_prototest_interface::SDPActivation::ACT_NONE); + protoSDPX2OpDesc->set_shift_value(*x2_op_acc.shiftValue()); + protoSDPX2OpDesc->set_alu_operand(*x2_op_acc.ALUOperand()); + protoSDPX2OpDesc->set_mul_operand(*x2_op_acc.MulOperand()); + protoSDPX2OpDesc->set_truncate(*x2_op_acc.truncate()); + protoSDPX2OpDesc->set_precision(protoSrcPrec); + protoSDPX2OpDesc->mutable_cvt()->mutable_alu_cvt()->set_enable(*x2_op_acc.cvt().aluCVTAccessor().enable()); + protoSDPX2OpDesc->mutable_cvt()->mutable_alu_cvt()->set_truncate(*x2_op_acc.cvt().aluCVTAccessor().truncate()); + protoSDPX2OpDesc->mutable_cvt()->mutable_alu_cvt()->set_scale(*x2_op_acc.cvt().aluCVTAccessor().scale()); + protoSDPX2OpDesc->mutable_cvt()->mutable_alu_cvt()->set_offset(*x2_op_acc.cvt().aluCVTAccessor().offset()); + protoSDPX2OpDesc->mutable_cvt()->mutable_mul_cvt()->set_enable(*x2_op_acc.cvt().mulCVTAccessor().enable()); + protoSDPX2OpDesc->mutable_cvt()->mutable_mul_cvt()->set_truncate(*x2_op_acc.cvt().mulCVTAccessor().truncate()); + protoSDPX2OpDesc->mutable_cvt()->mutable_mul_cvt()->set_scale(*x2_op_acc.cvt().mulCVTAccessor().scale()); + protoSDPX2OpDesc->mutable_cvt()->mutable_mul_cvt()->set_offset(*x2_op_acc.cvt().mulCVTAccessor().offset()); + + + protoSDPYOpDesc->set_enable(*y_op_acc.enable()); + protoSDPYOpDesc->set_alu_type(nvdla_prototest_interface::ALUType::ALU_SUM); + protoSDPYOpDesc->set_type(nvdla_prototest_interface::SDPOpType::SDP_OP_ADD); + protoSDPYOpDesc->set_mode(nvdla_prototest_interface::SDPOp_SDPOpMode::SDPOp_SDPOpMode_SDP_OP_PER_KERNEL); + protoSDPYOpDesc->set_act(nvdla_prototest_interface::SDPActivation::ACT_NONE); + protoSDPYOpDesc->set_shift_value(*y_op_acc.shiftValue()); + protoSDPYOpDesc->set_alu_operand(*y_op_acc.ALUOperand()); + protoSDPYOpDesc->set_mul_operand(*y_op_acc.MulOperand()); + protoSDPYOpDesc->set_truncate(*y_op_acc.truncate()); + protoSDPYOpDesc->set_precision(protoSrcPrec); + protoSDPYOpDesc->mutable_cvt()->mutable_alu_cvt()->set_enable(*y_op_acc.cvt().aluCVTAccessor().enable()); + protoSDPYOpDesc->mutable_cvt()->mutable_alu_cvt()->set_truncate(*y_op_acc.cvt().aluCVTAccessor().truncate()); + protoSDPYOpDesc->mutable_cvt()->mutable_alu_cvt()->set_scale(*y_op_acc.cvt().aluCVTAccessor().scale()); + protoSDPYOpDesc->mutable_cvt()->mutable_alu_cvt()->set_offset(*y_op_acc.cvt().aluCVTAccessor().offset()); + protoSDPYOpDesc->mutable_cvt()->mutable_mul_cvt()->set_enable(*y_op_acc.cvt().mulCVTAccessor().enable()); + protoSDPYOpDesc->mutable_cvt()->mutable_mul_cvt()->set_truncate(*y_op_acc.cvt().mulCVTAccessor().truncate()); + protoSDPYOpDesc->mutable_cvt()->mutable_mul_cvt()->set_scale(*y_op_acc.cvt().mulCVTAccessor().scale()); + protoSDPYOpDesc->mutable_cvt()->mutable_mul_cvt()->set_offset(*y_op_acc.cvt().mulCVTAccessor().offset()); + + + if (*fused_acc.index() != -1) { + protoSrcDataCube->set_type(nvdla_prototest_interface::MemType::DLA_MEM_HW); + } else { + protoSrcDataCube->set_type(nvdla_prototest_interface::MemType::DLA_MEM_MC); + } + protoSrcDataCube->set_address(*src_data_acc.address()); + protoSrcDataCube->set_size(src_tsd->tensorBufferDesc()->size() - src_tsd->bufferOffset()); + protoSrcDataCube->set_width(*src_data_acc.width()); + protoSrcDataCube->set_height(*src_data_acc.height()); + protoSrcDataCube->set_channel(*src_data_acc.channel()); + protoSrcDataCube->set_line_stride(*src_data_acc.lineStride()); + protoSrcDataCube->set_surf_stride(*src_data_acc.surfStride()); + protoSrcDataCube->set_plane_stride(*src_data_acc.planeStride()); + protoSrcDataCube->mutable_mem_info()->set_mem_id(src_tsd->tensorBufferDesc()->memoryId(batch_id)); + protoSrcDataCube->mutable_mem_info()->set_mem_size(src_tsd->tensorBufferDesc()->size()); + protoSrcDataCube->mutable_mem_info()->set_offset(src_tsd->bufferOffset()); + + protoDstDataCube->set_type(nvdla_prototest_interface::MemType::DLA_MEM_MC); + protoDstDataCube->set_address(*dst_data_acc.address()); + protoDstDataCube->set_size(dst_tsd->tensorBufferDesc()->size() - dst_tsd->bufferOffset()); + protoDstDataCube->set_width(*dst_data_acc.width()); + protoDstDataCube->set_height(*dst_data_acc.height()); + protoDstDataCube->set_channel(*dst_data_acc.channel()); + protoDstDataCube->set_line_stride(*dst_data_acc.lineStride()); + protoDstDataCube->set_surf_stride(*dst_data_acc.surfStride()); + protoDstDataCube->set_plane_stride(*dst_data_acc.planeStride()); + protoDstDataCube->mutable_mem_info()->set_mem_id(dst_tsd->tensorBufferDesc()->memoryId(batch_id)); + protoDstDataCube->mutable_mem_info()->set_mem_size(dst_tsd->tensorBufferDesc()->size()); + protoDstDataCube->mutable_mem_info()->set_offset(dst_tsd->bufferOffset()); + if (numConsumers == 0) { + protoDstDataCube->mutable_mem_info()->set_fill_type(nvdla_prototest_interface::FillerType::FILL_NONE); + protoDstDataCube->mutable_mem_info()->set_flag(nvdla_prototest_interface::MemFlag::DLA_MEM_OUTPUT); + protoDstDataCube->mutable_mem_info()->set_precision(protoDstPrec); + } + + protoX1DataCube->set_type(nvdla_prototest_interface::MemType::DLA_MEM_MC); + protoX1DataCube->set_address(*x1_data_acc.address()); + protoX1DataCube->set_size(scale_tsd->tensorBufferDesc()->size()); + protoX1DataCube->set_width(*x1_data_acc.width()); + protoX1DataCube->set_height(*x1_data_acc.height()); + protoX1DataCube->set_channel(*x1_data_acc.channel()); + protoX1DataCube->set_line_stride(*x1_data_acc.lineStride()); + protoX1DataCube->set_surf_stride(*x1_data_acc.surfStride()); + protoX1DataCube->set_plane_stride(*x1_data_acc.planeStride()); + protoX1DataCube->mutable_mem_info()->set_mem_id(scale_tsd->tensorBufferDesc()->memoryId(batch_id)); + protoX1DataCube->mutable_mem_info()->set_mem_size(scale_tsd->tensorBufferDesc()->size()); + protoX1DataCube->mutable_mem_info()->set_offset(scale_tsd->bufferOffset()); +fail: + return e; +} +#endif + +}; // nvdla::priv + +}; // nvdla:: diff --git a/umd/core/src/compiler/engine-ast/BiasOp.cpp b/umd/core/src/compiler/engine-ast/BiasOp.cpp new file mode 100644 index 00000000..12cdbcad --- /dev/null +++ b/umd/core/src/compiler/engine-ast/BiasOp.cpp @@ -0,0 +1,1722 @@ +/* + * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#include + +#include "priv/EngineAST.h" +#include "priv/LowPrecision.h" +#include "priv/Profile.h" +#include "priv/Tensor.h" +#include "priv/Compiler.h" +#include "priv/WeightTranslationUnit.h" +#include "ErrorMacros.h" + +using std::endl; + +namespace nvdla +{ +namespace priv +{ + +NvDlaError engine_ast::SDPBiasOpNode::captureCanonicalBiasData() +{ + NvDlaError e = NvDlaError_Success; + Tensor* bias_data_tensor; + + bias_data_tensor = graph()->addAuxTensor(graph()->newAuxTensorName(), params().biasDims(), TensorType::kBIAS); + + graph()->addDataEdge((canonical_ast::Edge*)0, 0, this, bias_data_tensor); + + return e; +} + +void engine_ast::SDPBiasOpNode::captureCanonicalParams() +{ + NvDlaError e = NvDlaSuccess; + + params().x1Params().setEnabled(true); + switch(canonicalNode()->canonicalOpType().v()) + { + case canonical_ast::CanonicalOpTypeEnum::SCALE: { + canonical_ast::ScaleNode* canScaleNode = canonical_ast::NodeFactory::nodeCast(canonicalNode()); + params().setBiasDims(canScaleNode->params().shiftDims()); + params().setRawBiasData(canScaleNode->params().shift()); + switch(canScaleNode->params().mode()) + { + case ScaleMode::sUNIFORM: params().x1Params().setMode(SDPModeEnum::SDP_MODE_PER_LAYER); break; + case ScaleMode::sCHANNEL: params().x1Params().setMode(SDPModeEnum::SDP_MODE_PER_CHANNEL); break; + case ScaleMode::sm_ELEMENTWISE: params().x1Params().setMode(SDPModeEnum::SDP_MODE_PER_ELEMENT); break; + default: params().x1Params().setMode(SDPModeEnum::SDP_MODE_UNKNOWN); + } + } break; + case canonical_ast::CanonicalOpTypeEnum::CONVOLUTION: { + canonical_ast::ConvolutionNode* canConvNode = canonical_ast::NodeFactory::nodeCast(canonicalNode()); + params().setBiasDims(canConvNode->params().biasDims()); + params().setRawBiasData(canConvNode->params().biasData()); + params().setNumGroups(canConvNode->params().numGroups()); + switch(canConvNode->params().biasMode()) + { + case BiasMode::bUNIFORM: params().x1Params().setMode(SDPModeEnum::SDP_MODE_PER_LAYER); break; + case BiasMode::bCHANNEL: params().x1Params().setMode(SDPModeEnum::SDP_MODE_PER_CHANNEL); break; + case BiasMode::bm_ELEMENTWISE: params().x1Params().setMode(SDPModeEnum::SDP_MODE_PER_ELEMENT); break; + default: params().x1Params().setMode(SDPModeEnum::SDP_MODE_UNKNOWN); + } + } break; + case canonical_ast::CanonicalOpTypeEnum::FULLY_CONNECTED: { + canonical_ast::FullyConnectedNode* canFCNode = canonical_ast::NodeFactory::nodeCast(canonicalNode()); + params().setBiasDims(canFCNode->params().biasDims()); + params().setRawBiasData(canFCNode->params().biasData()); + switch(canFCNode->params().biasMode()) + { + case BiasMode::bUNIFORM: params().x1Params().setMode(SDPModeEnum::SDP_MODE_PER_LAYER); break; + case BiasMode::bCHANNEL: params().x1Params().setMode(SDPModeEnum::SDP_MODE_PER_CHANNEL); break; + case BiasMode::bm_ELEMENTWISE: params().x1Params().setMode(SDPModeEnum::SDP_MODE_PER_ELEMENT); break; + default: params().x1Params().setMode(SDPModeEnum::SDP_MODE_UNKNOWN); + } + } break; + case canonical_ast::CanonicalOpTypeEnum::DECONVOLUTION: { + canonical_ast::DeconvolutionNode* canDeconvNode = canonical_ast::NodeFactory::nodeCast(canonicalNode()); + params().setBiasDims(canDeconvNode->params().biasDims()); + params().setRawBiasData(canDeconvNode->params().biasData()); + params().setNumGroups(canDeconvNode->params().numGroups()); + switch(canDeconvNode->params().biasMode()) + { + case BiasMode::bUNIFORM: params().x1Params().setMode(SDPModeEnum::SDP_MODE_PER_LAYER); break; + case BiasMode::bCHANNEL: params().x1Params().setMode(SDPModeEnum::SDP_MODE_PER_CHANNEL); break; + case BiasMode::bm_ELEMENTWISE: params().x1Params().setMode(SDPModeEnum::SDP_MODE_PER_ELEMENT); break; + default: params().x1Params().setMode(SDPModeEnum::SDP_MODE_UNKNOWN); + } + } break; + default: + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unrecognized canonical op type: %s", canonicalNode()->canonicalOpType().c_str()); + } + params().x1Params().setAluType(SDPALUTypeEnum::SDP_ALU_TYPE_SUM); + params().x1Params().setOpType(SDPOpTypeEnum::SDP_OP_TYPE_ADD); + params().setDLABiasData(Weights(DataType::FLOAT, NULL, 0)); + PROPAGATE_ERROR_FAIL(captureCanonicalBiasData()); + + if ( graph()->debugWeights() ) + { + Weights rawData = params().rawBiasData(); + gLogInfo << "raw weights of " << name() << ": "; + for (ssize_t ii = 0; ii < rawData.count; ++ii) + gLogInfo << reinterpret_cast(const_cast(rawData.values))[ii] << ", "; + gLogInfo << endl; + } + +fail: + return; +} + +void engine_ast::SDPBiasOpNode::inheritParams(Node* otherNode) +{ + // inherit the parameters that make sense (keep adding later) + SDPBiasOpNode* otherBias = NodeFactory::nodeCast(otherNode); + params().setX1Params(otherBias->params().x1Params()); + params().setBiasDims(otherBias->params().biasDims()); + params().setRawBiasData(otherBias->params().rawBiasData()); + params().setDLABiasData(otherBias->params().DLABiasData()); + params().setHasBiasReduction(otherBias->params().hasBiasReduction()); + params().setAxis(otherBias->params().axis()); + params().setConvMode(otherBias->params().convMode()); + params().setWinogradParams(otherBias->params().winogradParams()); + params().setNumGroups(otherBias->params().numGroups()); + params().setOutCVT(otherBias->params().outCVT()); +} + +std::vector engine_ast::SDPBiasOpNode::suggestAuxSurfaceFormats(engine_ast::Edge* xEdge) +{ + NvDlaError e = NvDlaSuccess; + NVDLA_UNUSED(e); + std::vector supportedAuxSFs = supportedAuxSurfFormats(); + std::vector suggestedAuxSFs; + std::vector::iterator auxSFItr; + surface::SurfacePrecision compPrec = graph()->profile()->computePrecision(); + + if (supportedAuxSFs.size() == 0) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "No supported aux surface formats for %s", name().c_str()); + } + + switch(compPrec.v()) + { + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_FP16: { + surface::IsSurfacePrecisionDifferent desiredSP(surface::SurfacePrecisionEnum::NVDLA_PRECISION_FP16); + supportedAuxSFs.erase(std::remove_if(supportedAuxSFs.begin(), supportedAuxSFs.end(), desiredSP), supportedAuxSFs.end()); + } break; + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16: + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8: { + surface::IsSurfacePrecisionDifferent desiredSP(surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16); + supportedAuxSFs.erase(std::remove_if(supportedAuxSFs.begin(), supportedAuxSFs.end(), desiredSP), supportedAuxSFs.end()); + } break; + default: + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Don't support compute precision: %s for %s\n", + compPrec.c_str(), name().c_str()); + } + + suggestedAuxSFs = supportedAuxSFs; + +fail: + return suggestedAuxSFs; +} + +engine_ast::Node* engine_ast::SDPBiasOpNode::mergeWithSDPOp(SDPNode* nextSDP) +{ + Node* removableNode = NULL; + + // If activation is already enabled, do not allow any math op fusions + if (params().x1Params().actType().v() != SDP_ACT_TYPE_UNKNOWN + && params().x1Params().actType().v() != SDP_ACT_TYPE_NONE) + { + if (graph()->debugMathOptz()) + { + gLogInfo << "Merge not feasible: " << this->name() << " activation: "; + gLogInfo << NvU16(params().x1Params().actType().v()) << endl; + } + goto fail; + } + + // fixme: limit the bias math op fusion with only sdp-bias, sdp-batch-norm and relu types for now + if (nextSDP->engineOpType().v() == EngineOpTypeEnum::SDP_BIAS) + { + removableNode = tryToMergeWithBiasOp(nextSDP); + } + if (nextSDP->engineOpType().v() == EngineOpTypeEnum::SDP_SCALE) + { + removableNode = tryToMergeWithScaleOp(nextSDP); + } + else if (nextSDP->engineOpType().v() == EngineOpTypeEnum::SDP_BATCH_NORM) + { + removableNode = tryToMergeWithBatchNormOp(nextSDP); + } + else if (nextSDP->engineOpType().v() == EngineOpTypeEnum::SDP_ACTIVATION) + { + removableNode = tryToMergeWithActOp(nextSDP); + } + +fail: + return removableNode; +} + + +/* + * 2 adjacent bias ops can be combined into a single op if the combined bias factors + * don't over/undershoot the compute precision of the pipeline + */ +engine_ast::Node* engine_ast::SDPBiasOpNode::tryToMergeWithBiasOp(SDPNode* SDPBiasOp) +{ + NvDlaError e = NvDlaSuccess; + Node* removableNode = NULL; + SDPBiasOpNode* currBiasOp = this; + SDPBiasOpNode* nextBiasOp = NodeFactory::nodeCast(SDPBiasOp); + Weights rawCurrBiasData = currBiasOp->params().rawBiasData(); + Weights rawNextBiasData = nextBiasOp->params().rawBiasData(); + Dims4 biasDims = currBiasOp->params().biasDims(); + Weights combinedBiasData; + WeightTrns wtTrns; + NVDLA_UNUSED(e); + + nvdla::DataType modelPrec = rawCurrBiasData.type == rawNextBiasData.type ? + rawCurrBiasData.type : + nvdla::DataType::UNKNOWN; + surface::SurfacePrecision computePrec = graph()->profile()->computePrecision(); + + WeightTrns::WeightDims wtTrnsDims (rawCurrBiasData.count, biasDims.n, biasDims.c, + biasDims.w, biasDims.h, 1, 1); + + if (!graph()->profile()->canSDPMergeMathOps()) + { + goto fail; + } + + if ( currBiasOp->params().x1Params().mode().e() != nextBiasOp->params().x1Params().mode().e() || + currBiasOp->params().biasDims() != nextBiasOp->params().biasDims()) + { + if ( debugFactorization() ) + { + gLogWarning << "Can't combine Bias factors of " + << currBiasOp->name() << " and " << nextBiasOp->name() + << " since they operate in different modes"<< endl; + } + goto fail; + } + + PRECISION_SWITCH(modelPrec.v(), computePrec.v(), combinedBiasData, + wtTrns.combineAdditionFactors, + currBiasOp->params().x1Params().mode(), + wtTrnsDims, + rawCurrBiasData, + rawNextBiasData); + if (combinedBiasData.values == NULL) + { + if ( debugFactorization() ) + { + gLogWarning << "Can't successfully combine Bias factors of " + << currBiasOp->name() << " and " << nextBiasOp->name() << endl; + } + goto fail; + } + + /* + * Since bias factors of 2 adjacent bias ops could be combined, inherit the combined + * factors into the existing bias op and remove the next one + */ + params().setRawBiasData(combinedBiasData); + removableNode = nextBiasOp; + +fail: + return removableNode; +} + +/* + * A bias op and an adjacent scale op can be combined into a single batch-norm op + * by treating the bias data as the mean and the scale data as the variance of BN + */ +engine_ast::Node* engine_ast::SDPBiasOpNode::tryToMergeWithScaleOp(SDPNode* SDPScaleOp) +{ + NvDlaError e = NvDlaSuccess; + Node* removableNode = NULL; + SDPScaleOpNode* scaleOp = NodeFactory::nodeCast(SDPScaleOp); + Weights rawBiasData = params().rawBiasData(); + Weights rawScaleData = scaleOp->params().rawScaleData(); + Dims4 commonDims = scaleOp->params().scaleDims(); + Weights rawMeanData; + Weights rawVarianceData; + NVDLA_UNUSED(e); + + if (!graph()->profile()->canSDPMergeMathOps()) + { + goto fail; + } + + if ( params().x1Params().mode().e() != scaleOp->params().x1Params().mode().e() || + params().biasDims() != scaleOp->params().scaleDims() || + params().x1Params().mode().e() == engine_ast::SDPModeEnum::SDP_MODE_PER_ELEMENT) + { + if ( debugFactorization() ) + { + gLogWarning << "Can't combine Bias and Scale factors " + << "of " << scaleOp->name() << " and " << name() + << " which operate in different modes"<< endl; + } + goto fail; + } + + /* replace the 2 operations with a brand new BN op in the engine AST. + */ + { + /* Step-1: Substitute Bias with BN node */ + NodeSequence substituteNodes; + SDPBatchNormOpNode* newBNReplaceNode = NodeFactory::newSDPBatchNormOpNode(NULL, graph()); + if ( !newBNReplaceNode) + { + ORIGINATE_ERROR_FAIL(NvDlaError_InsufficientMemory, "Couldn't create new BN op for replacing %s and %s", + name().c_str(), name().c_str()); + } + newBNReplaceNode->params().x1Params().setMode(params().x1Params().mode()); + newBNReplaceNode->params().setEpsilon(0); + newBNReplaceNode->params().setMeanDims(commonDims); + newBNReplaceNode->params().setVarianceDims(commonDims); + newBNReplaceNode->params().setBatchNormDims(commonDims); + + // activation from next SDP node + newBNReplaceNode->params().x1Params().setActType(scaleOp->params().x1Params().actType()); + + // Orig set of operations: (bias + scale): y = (x + b) * s + // New operation: (batch-norm): y = (x + m)*v + // mean: m + // var: v + newBNReplaceNode->params().setRawMeanData(rawBiasData); + newBNReplaceNode->params().setRawVarianceData(rawScaleData); + newBNReplaceNode->params().setDLABatchNormData(Weights(DataType::FLOAT, NULL, 0)); + PROPAGATE_ERROR_FAIL(newBNReplaceNode->captureCanonicalBatchNormData()); + + substituteNodes.push_back(newBNReplaceNode); + PROPAGATE_ERROR_FAIL(graph()->substituteNodeInAST(this, substituteNodes)); + + /* Step-2: Remove the scale node by disconnecting it from the input side */ + PROPAGATE_ERROR_FAIL(graph()->removeNodeFromAST(scaleOp, IODirectionEnum::INPUT)); + + /* since BN is replacing Bias + Scl, inherit the op mode from the Bias node before its removed*/ + newBNReplaceNode->params().setConvMode(params().convMode()); + newBNReplaceNode->params().setWinogradParams(params().winogradParams()); + + /* Step-3: The compiler will eventually remove this bias node */ + removableNode = this; + } + +fail: + return removableNode; +} + +/* + * Bias followed by BN can be folded into a single BN if the bias factors of the Bias Op + * and mean factors of the BN Op can be combined into 1 without over/undershooting the + * compute precision limits + * + * Bias + BN : y = ([x + b] + m)*(1/v) + * = (x + m')*(1/v) + * = BN + * => 2 ops folded into 1 + */ +engine_ast::Node* engine_ast::SDPBiasOpNode::tryToMergeWithBatchNormOp(SDPNode* SDPBNOp) +{ + NvDlaError e = NvDlaSuccess; + + Node* removableNode = NULL; + SDPBatchNormOpNode* bnOp = NodeFactory::nodeCast(SDPBNOp); + Weights rawBiasData = params().rawBiasData(); + Weights rawMeanData = bnOp->params().rawMeanData(); + Dims4 commonDims = params().biasDims(); + Weights combinedBiasAndMeanData; + WeightTrns wtTrns; + NVDLA_UNUSED(e); + + nvdla::DataType modelPrec = rawBiasData.type == rawMeanData.type ? + rawBiasData.type : + nvdla::DataType::UNKNOWN; + surface::SurfacePrecision computePrec = graph()->profile()->computePrecision(); + + WeightTrns::WeightDims wtTrnsDims (rawBiasData.count, commonDims.n, commonDims.c, + commonDims.w, commonDims.h, 1, 1); + + if (!graph()->profile()->canSDPMergeMathOps()) + { + goto fail; + } + + if ( params().x1Params().mode().e() != bnOp->params().x1Params().mode().e() || + params().biasDims() != bnOp->params().meanDims()) + { + if ( debugFactorization() ) + { + gLogWarning << "Can't combine Bias and Mean factors of " + << name() << " and " << bnOp->name() + << " since they operate in different modes"<< endl; + } + goto fail; + } + + PRECISION_SWITCH(modelPrec.v(), computePrec.v(), combinedBiasAndMeanData, + wtTrns.combineAdditionFactors, + params().x1Params().mode(), + wtTrnsDims, + rawBiasData, + rawMeanData); + if (combinedBiasAndMeanData.values == NULL) + { + if ( debugFactorization() ) + { + gLogWarning << "Can't successfully combine Bias and Mean factors of " + << name() << " and " << bnOp->name() << endl; + } + goto fail; + } + + /* + * Since bias and mean factors of the Bias and BN ops could be combined, inherit the combined + * factors into the existing BN op and remove the bias node + */ + bnOp->params().setRawMeanData(combinedBiasAndMeanData); + removableNode = this; + +fail: + return removableNode; +} + +/* Configure SDP SuperOp SubEngine with Bios Op */ +NvDlaError engine_ast::SDPBiasOpNode::configureSDPSuperOpSubEngine(SDPSuperOpNode* sdpSuperOp, SDPSubEngineType xN) +{ + NvDlaError e = NvDlaSuccess; + + if (xN == SDP_ENGINE_X1) + { + sdpSuperOp->params().setX1Params(params().x1Params()); + sdpSuperOp->params().setConvMode(params().convMode()); + sdpSuperOp->params().setWinogradParams(params().winogradParams()); + } + else + { + sdpSuperOp->params().setX2Params(params().x1Params()); + } + + sdpSuperOp->params().setAuxDataType(xN, TensorType::kBIAS); + + sdpSuperOp->params().setAdderDims(xN, params().biasDims()); + sdpSuperOp->params().setDLADataDims(xN, params().biasDims()); + + sdpSuperOp->params().setRawAdderData(xN, params().rawBiasData()); + sdpSuperOp->params().setDLAData(xN, params().DLABiasData()); + + sdpSuperOp->params().setAuxSurfaceFormats(xN, suggestAuxSurfaceFormats()); + + if ( graph()->debugFuseSubEngineOps() ) + { + gLogInfo << "configureSDPSuperOpSubEngine: " << this->name() << " in "; + gLogInfo << sdpSuperOp->name() << " x" << (NvU16)xN.e()+1 << endl; + } + + return e; +} + +/*---------------------Quantize Bias Data------------------------------*/ +NvDlaError engine_ast::SDPBiasOpNode::quantizeBiasToInt8 +( + ConvCoreNode* fusedConv, + std::vector& filterScales, + std::vector& inTensorScales +) +{ + NvDlaError e = NvDlaSuccess; + + NvU32 numFilters = filterScales.size(); + NvF32 perTensorInTensorScl = inTensorScales.at(0); + + bool isPerKernelQtz = graph()->profile()->quantizationMode() == nvdla::QuantizationMode::PER_KERNEL; + + std::pair< NvS8, NvU8 > scaleAndShift; + Weights int8BiasBlob; + Weights origBiasBlob = params().rawBiasData(); + NvS8* pInt8Bias = (NvS8*)std::malloc(origBiasBlob.count * sizeof(NvS8)); + NvU8 commonShift = 0; + NvF32 scaledFP32Bias = 0.0f; + + ASSERT ( filterScales.size() == (size_t)auxEdges().at(0)->tensorSurfaceDesc()->dimensions().c ); + for (NvU32 ff = 0; ff < numFilters; ++ff) + { + if ( isPerKernelQtz && (filterScales[0] != filterScales[ff]) ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Filter scales should be same for %s when PER_KERNEL " + "quantization is ON", fusedConv->name().c_str()); + } + } + + ASSERT ( inTensorScales.size() == (size_t)fusedConv->inputEdges().at(0)->tensorSurfaceDesc()->dimensions().c ); + for (NvF32 its = 1; its < inTensorScales.size(); ++its) + { + if ( perTensorInTensorScl != inTensorScales[its] ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Channel scales should be same for input of %s when PER_TENSOR " + "scaling is ON", fusedConv->name().c_str()); + } + } + + ASSERT( numFilters == origBiasBlob.count ); + for ( NvU32 bb = 0; bb < numFilters; ++bb) + { + switch(origBiasBlob.type) + { + case nvdla::DataType::FLOAT: { + NvF32 fp32Bias = reinterpret_cast(const_cast(origBiasBlob.values))[bb]; + scaledFP32Bias = NvF32(fp32Bias / (filterScales[bb] * perTensorInTensorScl)); + } break; + case nvdla::DataType::HALF: { + half_float::half fp16Bias = reinterpret_cast(const_cast(origBiasBlob.values))[bb]; + scaledFP32Bias = NvF32(fp16Bias / (filterScales[bb] * perTensorInTensorScl)); + } break; + default: + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Can't quantize bias data which is not FLOAT / HALF " + "precision for %s\n", name().c_str()); + } + + e = calculateScaleAndShiftFromScalar(scaledFP32Bias, &scaleAndShift, commonShift); + if (e != NvDlaSuccess) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, " Couldn't converge on `2^(x) * y` which could " + "safely represent %f within acceptable tolerance for %s\n", + scaledFP32Bias, name().c_str()); + } + + pInt8Bias[bb] = scaleAndShift.first; + if (bb == 0) + commonShift = scaleAndShift.second; + } + + int8BiasBlob.type = nvdla::DataType::INT8; + int8BiasBlob.values = pInt8Bias; + int8BiasBlob.count = origBiasBlob.count; + + // set quantized bias and common left shifter for all biases + params().setRawBiasData(int8BiasBlob); + params().x1Params().setShiftValue(commonShift); + +fail: + return e; +} + +static bool absCompare(NvS32 a, NvS32 b) +{ + return (std::abs(a) < std::abs(b)); +} + +NvDlaError engine_ast::SDPBiasOpNode::scaleBiasToInt16 +( + ConvCoreNode* fusedConv, + std::vector& filterScales, + std::vector& inTensorScales +) +{ + NvDlaError e = NvDlaSuccess; + + NvS32 maxBias; + NvS32 numBits; + NvU32 biasShift; + std::vector< NvS32 > rescaledBias32; + + NvF32 perTensorInTensorScl = inTensorScales.at(0); + + bool isPerKernelQtz = graph()->profile()->quantizationMode() == nvdla::QuantizationMode::PER_KERNEL; + + NvF32 scaledFP32Bias = 0.0f; + NvS16 int16Bias = 0; + Weights origBiasBlob = params().rawBiasData(); + Weights int16BiasBlob; + NvS16* pInt16Bias = (NvS16*)std::malloc(origBiasBlob.count * sizeof(NvS16)); + NvU32 numBiasData = origBiasBlob.count; + + if (fusedConv) + { + NvU32 numFilters = filterScales.size(); + ASSERT ( filterScales.size() == (size_t)fusedConv->outputEdges().at(0)->tensorSurfaceDesc()->dimensions().c ); + for (NvU32 ff = 0; ff < numFilters; ++ff) + { + if ( isPerKernelQtz && (filterScales[0] != filterScales[ff]) ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Filter scales should be same for %s when PER_KERNEL " + "quantization is ON", fusedConv->name().c_str()); + } + } + + ASSERT ( inTensorScales.size() == (size_t)fusedConv->inputEdges().at(0)->tensorSurfaceDesc()->dimensions().c ); + for (NvF32 its = 1; its < inTensorScales.size(); ++its) + { + if ( perTensorInTensorScl != inTensorScales[its] ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Channel scales should be same for input of %s when PER_TENSOR " + "scaling is ON", fusedConv->name().c_str()); + } + } + } + else + { + ASSERT ( inTensorScales.size() == (size_t)inputEdges().at(0)->tensorSurfaceDesc()->dimensions().c ); + for (NvF32 its = 1; its < inTensorScales.size(); ++its) + { + if ( perTensorInTensorScl != inTensorScales[its] ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Channel scales should be same for input, when PER_TENSOR scaling is ON"); + } + } + } + + for ( NvU32 bb = 0; bb < numBiasData; ++bb) + { + switch (origBiasBlob.type) + { + case nvdla::DataType::FLOAT: { + NvF32 fp32Bias = reinterpret_cast(const_cast(origBiasBlob.values))[bb]; + NvF32 biasRescaleFactor = perTensorInTensorScl; + if ( fusedConv ) + { + biasRescaleFactor = perTensorInTensorScl * filterScales[bb]; + } + scaledFP32Bias = NvF32(fp32Bias / biasRescaleFactor); + NvS32 int32Bias = static_cast(std::floor(scaledFP32Bias + 0.5f)); + rescaledBias32.push_back(int32Bias); + } break; + case nvdla::DataType::HALF: { + NvF32 fp16Bias = reinterpret_cast(const_cast(origBiasBlob.values))[bb]; + NvF32 biasRescaleFactor = perTensorInTensorScl; + if ( fusedConv ) + { + biasRescaleFactor = perTensorInTensorScl * filterScales[bb]; + } + scaledFP32Bias = NvF32(fp16Bias / biasRescaleFactor); + NvS32 int32Bias = static_cast(std::floor(scaledFP32Bias + 0.5f)); + rescaledBias32.push_back(int32Bias); + } break; + default: + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Can't scale bias data which is not FLOAT / HALF " + "precision for %s\n", name().c_str()); + } + } + + maxBias = *std::max_element(rescaledBias32.begin(), rescaledBias32.end(), absCompare); + numBits = ceil(log(abs(maxBias))/log(2)) + 1; + biasShift = std::min(SDP_LEFT_SHIFT_MAX_PLACES, std::max(0, numBits - 16)); + + params().x1Params().setShiftValue(biasShift); + + for ( NvU32 bb = 0; bb < numBiasData; ++bb) + { + int16Bias = static_cast(rescaledBias32[bb] >> biasShift); + pInt16Bias[bb] = int16Bias; + + if ( graph()->debugQuantization() ) + { + if (fusedConv) + { + gLogInfo << "rawBias/Si*Sw " + << reinterpret_cast(const_cast(origBiasBlob.values))[bb] << " / " + << " ( " << perTensorInTensorScl << " * " << filterScales[bb] << " ) = " + << (reinterpret_cast(const_cast(origBiasBlob.values))[bb]/(perTensorInTensorScl * filterScales[bb])) + << " -> " << rescaledBias32[bb] << " -> " << (int)int16Bias << "*2^-" << biasShift << endl; + } + else + { + gLogInfo << "rawBias/Si " + << reinterpret_cast(const_cast(origBiasBlob.values))[bb] << " / " + << perTensorInTensorScl << " = " + << (reinterpret_cast(const_cast(origBiasBlob.values))[bb]/perTensorInTensorScl) + << " -> " << rescaledBias32[bb] << " -> " << (int)int16Bias << "*2^-" << biasShift << endl; + } + } + } + + int16BiasBlob.type = nvdla::DataType::INT16; + int16BiasBlob.values = pInt16Bias; + int16BiasBlob.count = origBiasBlob.count; + + // set scaled bias + params().setRawBiasData(int16BiasBlob); + +fail: + return e; +} + +/*--------------------Quantize Aux Data-----------------------------*/ +NvDlaError engine_ast::SDPBiasOpNode::quantizeAuxData() +{ + NvDlaError e = NvDlaSuccess; + + std::vector filterScales; + std::vector inTensorScales; + + ConvCoreNode* fusedConv = NULL; + + PROPAGATE_ERROR_FAIL( verifyEdgePorts() ); + + if (graph()->profile()->computePrecision().v() != surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8) + { + // nop + goto fail; + } + + if ( graph()->profile()->tensorScalingMode().v() != nvdla::TensorScalingMode::PER_TENSOR ) + { + // don't support any other scaling mode than PER_TENSOR + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Don't support tensor scaling mode: %s\n", + graph()->profile()->tensorScalingMode().c_str()); + } + + fusedConv = NodeFactory::nodeCast(graph()->upstreamDataNodes(this).size() ? + graph()->upstreamDataNodes(this).at(0) : + NULL); + if ( fusedConv ) + { + PROPAGATE_ERROR_FAIL( fusedConv->verifyEdgePorts() ); + filterScales = fusedConv->params().filterScales(); + inTensorScales = fusedConv->inputEdges().at(0)->originalTensor()->getChannelScales(); + } + else + { + inTensorScales = inputEdges().at(0)->originalTensor()->getChannelScales(); + } + + /* + * Convolution with bias op is represented as: + * + * O = I * W + b + * QoSo = QiSi * QwSw + b + * Qo = (Qi * Qw + b/Si*Sw) * (Si*Sw/So) + * + * Per-kernel equation looks like: + * Qo = (Qi * Qw + b[k]/Si*Sw) * (Si*Sw/So) + * where-as per-filter equation looks like: + * Qo = (Qi * Qw + b[k]/Si*Sw[k]) * (Si*Sw[k]/So) + * + * For per-kernel scaled bias addition: (pure int8 path) + * - find per-output channel, scale and shift combination which approximately represents (b[k]/Si*Sw) + * - represented as scaled bias: `2^(ls) * m[k]` + * - where m[k] : per-filter quantized bias + * - ls : common left shift for scaling all (just quantized) biases + * + * For per-kernel scaled bias addition: (int16 path) + * - represent (b[k]/Si*Sw) as a int16 number + * + * Again per-filter equation looks like: + * Qo = (Qi * Qw + b[k]/Si*Sw[k]) * (Si*Sw[k]/So) + * + * For per-filter scaled bias addition: (pure int8 path) + * - find per-output channel, scale and shift combination which approximately represents (b[k]/Si*Sw[k]) + * - represented as scaled bias: `2^(ls) * m[k]` + * - where m[k] : per-filter quantized bias + * - ls : common left shift for scaling all (just quantified) biases + * + * For per-filter scaled bias addition: (int16 path) + * - find per-output channel, scaled bias which represents fp32(b[k]/Si*Sw[k]) as a i16 value + * - scaled bias represented as : b'[k] in i16 + * - feed the scaled bias b'[k] to the ALU unit of SDP-X + */ + if ( graph()->profile()->quantizationMode() == nvdla::QuantizationMode::PER_KERNEL || + graph()->profile()->quantizationMode() == nvdla::QuantizationMode::PER_FILTER ) + { + if (auxEdges().at(0)->tensorSurfaceDesc()->surfaceFormat().f().precision().v() == + surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8) + { + PROPAGATE_ERROR_FAIL( quantizeBiasToInt8(fusedConv, filterScales, inTensorScales) ); + } + else if (auxEdges().at(0)->tensorSurfaceDesc()->surfaceFormat().f().precision().v() == + surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16) + { + PROPAGATE_ERROR_FAIL( scaleBiasToInt16(fusedConv, filterScales, inTensorScales) ); + } + } + else + { + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Don't support quantization mode: %s\n", + graph()->profile()->quantizationMode().c_str()); + } + +fail: + return e; +} + +/*------------------Low Precision Conversions--------------------------*/ +NvDlaError engine_ast::SDPBiasOpNode::performPerKernelRescaling +( + ConvCoreNode* fusedConv, + std::vector& filterScales, + std::vector& inTensorScales, + std::vector& outTensorScales, + PrecisionCVTParams& outCvt +) +{ + NvDlaError e = NvDlaSuccess; + + NvS16 perTensorScl = 0; + NvU8 perTensorShft = 0; + NvF32 outputRescale = 0.0f; + std::pair scaleAndShift; + + NvU32 numFilters = 0; + NvF32 perKernelScale = 0.0f; + NvF32 perTensorInTensorScl = inTensorScales.at(0); + NvF32 perTensorOutTensorScl = outTensorScales.at(0); + + if ( fusedConv ) + { + numFilters = filterScales.size(); + perKernelScale = filterScales.at(0); + ASSERT ( filterScales.size() == (size_t)outputEdges().at(0)->tensorSurfaceDesc()->dimensions().c ); + for (NvU32 ff = 1; ff < numFilters; ++ff) + { + if ( perKernelScale != filterScales[ff] ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Filter scales should be same for %s when PER_KERNEL " + "quantization is ON", fusedConv->name().c_str()); + } + } + + ASSERT ( inTensorScales.size() == (size_t)fusedConv->inputEdges().at(0)->tensorSurfaceDesc()->dimensions().c ); + for (NvF32 its = 1; its < inTensorScales.size(); ++its) + { + if ( perTensorInTensorScl != inTensorScales[its] ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Channel scales should be same for input of %s when PER_TENSOR " + "scaling is ON", fusedConv->name().c_str()); + } + } + } + else + { + ASSERT ( inTensorScales.size() == (size_t)inputEdges().at(0)->tensorSurfaceDesc()->dimensions().c ); + for (NvF32 its = 1; its < inTensorScales.size(); ++its) + { + if ( perTensorInTensorScl != inTensorScales[its] ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Channel scales should be same for input of %s when PER_TENSOR " + "scaling is ON", name().c_str()); + } + } + } + + ASSERT ( outTensorScales.size() == (size_t)outputEdges().at(0)->tensorSurfaceDesc()->dimensions().c ); + for (NvF32 ots = 1; ots < outTensorScales.size(); ++ots) + { + if ( perTensorOutTensorScl != outTensorScales[ots] ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Channel scales should be same for output of %s when PER_TENSOR " + "scaling is ON", name().c_str()); + } + } + + outputRescale = perTensorInTensorScl / perTensorOutTensorScl; + if ( fusedConv ) + { + outputRescale = outputRescale * perKernelScale; + } + + e = calculateScaleAndShiftFromScalar(outputRescale, &scaleAndShift); + if (e != NvDlaSuccess) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, " Couldn't converge on `2^(x) * y` which could " + "safely represent %f within acceptable tolerance for %s\n", + outputRescale, name().c_str()); + } + + perTensorScl = scaleAndShift.first; + perTensorShft = scaleAndShift.second; + + if (graph()->debugQuantization()) + { + if (fusedConv) + { + gLogInfo << name() << " Si * Sw / So = " << perTensorInTensorScl << " * " << perKernelScale << " / " << perTensorOutTensorScl + << " = " << perTensorScl << "* 2^-" << (int)perTensorShft << endl; + } + else + { + gLogInfo << name() << " Si / So = " << perTensorInTensorScl << " / " << perTensorOutTensorScl + << " = " << perTensorScl << "* 2^-" << (int)perTensorShft << endl; + } + } + + outCvt.setEnable(1); + outCvt.setOffset(0); + outCvt.setScale(perTensorScl); + outCvt.setTruncate(perTensorShft); + +fail: + return e; +} + +NvDlaError engine_ast::SDPBiasOpNode::performPerChannelRescaling +( + ConvCoreNode* fusedConv, + std::vector& filterScales, + std::vector& inTensorScales, + std::vector& outTensorScales, + PrecisionCVTParams& outCvt +) +{ + NvDlaError e = NvDlaSuccess; + + NvF32 maxRescaleFactor = 0.0f; + std::vector< NvF32 > outputRescales; + std::pair< NvS16, NvU8 > maxRescaleFactorScaleAndShift; + std::vector< std::pair > scalesAndShifts; + + Weights rescaleWtsBlob; + + Weights rawBiasData = params().rawBiasData(); + NvU32 numBiasData = rawBiasData.count; + NvF32 perTensorInTensorScl = inTensorScales.at(0); + NvF32 perTensorOutTensorScl = outTensorScales.at(0); + + if ( fusedConv ) + { + ASSERT ( filterScales.size() == (size_t)outputEdges().at(0)->tensorSurfaceDesc()->dimensions().c ); + ASSERT ( inTensorScales.size() == (size_t)fusedConv->inputEdges().at(0)->tensorSurfaceDesc()->dimensions().c ); + for (NvF32 its = 1; its < inTensorScales.size(); ++its) + { + if ( perTensorInTensorScl != inTensorScales[its] ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Channel scales should be same for input of %s when PER_TENSOR " + "scaling is ON", fusedConv->name().c_str()); + } + } + } + else + { + ASSERT ( inTensorScales.size() == (size_t)inputEdges().at(0)->tensorSurfaceDesc()->dimensions().c ); + for (NvF32 its = 1; its < inTensorScales.size(); ++its) + { + if ( perTensorInTensorScl != inTensorScales[its] ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Channel scales should be same for input of %s when PER_TENSOR " + "scaling is ON", name().c_str()); + } + } + } + + ASSERT ( outTensorScales.size() == (size_t)outputEdges().at(0)->tensorSurfaceDesc()->dimensions().c ); + for (NvF32 ots = 1; ots < outTensorScales.size(); ++ots) + { + if ( perTensorOutTensorScl != outTensorScales[ots] ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Channel scales should be same for output of %s when PER_TENSOR " + "scaling is ON", name().c_str()); + } + } + + for (NvU32 cc = 0; cc < numBiasData; ++cc) + { + NvF32 rescaleData = perTensorInTensorScl / perTensorOutTensorScl; + if ( fusedConv ) + { + rescaleData = rescaleData * filterScales[cc]; + } + outputRescales.push_back(rescaleData); + } + + maxRescaleFactor = *std::max_element(outputRescales.begin(), outputRescales.end()); + + // find the shifter value for the max of the rescale factors, since we can use only 1 shifter + e = calculateScaleAndShiftFromScalar(maxRescaleFactor, &maxRescaleFactorScaleAndShift); + if (e != NvDlaSuccess) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, " Couldn't converge on `2^(x) * y` which could " + "safely represent %f within acceptable tolerance for %s\n", + maxRescaleFactor, name().c_str()); + } + + // pass the common shifter to determine int16 scalars for each rescale factors + e = factorizeScalars(outputRescales, &scalesAndShifts, maxRescaleFactorScaleAndShift.second); + if (e != NvDlaSuccess) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Can't factorize scalars for %s for int8 into scale+truncate pairs", + name().c_str()); + } + + { + // fixme: assert that the existing aux data is also of type INT16 + rescaleWtsBlob.type = nvdla::DataType::INT16; + rescaleWtsBlob.count = numBiasData; + NvS16* pINT16Rescalars = reinterpret_cast(std::malloc(numBiasData * sizeof(NvS16))); + for (NvU32 cc = 0; cc < numBiasData; ++cc) + { + pINT16Rescalars[cc] = scalesAndShifts[cc].first; + if (graph()->debugQuantization()) + { + if (fusedConv) + { + gLogInfo << name() << " Si * Sw[k] / So = " << perTensorInTensorScl << " * " << filterScales[cc] << " / " << perTensorOutTensorScl + << " = " << scalesAndShifts[cc].first << "* 2^-" << (int)maxRescaleFactorScaleAndShift.second << endl; + } + else + { + gLogInfo << name() << " Si / So = " << perTensorInTensorScl << " / " << perTensorOutTensorScl + << " = " << scalesAndShifts[cc].first << "* 2^-" << (int)maxRescaleFactorScaleAndShift.second << endl; + } + } + } + rescaleWtsBlob.values = pINT16Rescalars; + setRescaleData(rescaleWtsBlob); + params().x1Params().setINT8Rescaling(true); + params().x1Params().setOpType(SDPOpTypeEnum::SDP_OP_TYPE_BOTH); + } + + + outCvt.setEnable(1); + outCvt.setOffset(0); + outCvt.setScale(1); + outCvt.setTruncate(0); + + // fixme: move the m_truncate to sdpengine params + switch(engineOpType().v()) + { + case EngineOpTypeEnum::SDP_BIAS: + NodeFactory::nodeCast(this)->params().x1Params().setTruncate(maxRescaleFactorScaleAndShift.second); + break; + default: + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Don't yet support per-channel scaling in conjunction with %s\n", name().c_str()); + } + +fail: + return e; +} + +NvDlaError engine_ast::SDPBiasOpNode::handleLowPrecisionConversions() +{ + NvDlaError e = NvDlaSuccess; + + PrecisionCVTParams outCvt; + ConvCoreNode* fusedConv; + + std::vector inTensorScales; + std::vector outTensorScales; + std::vector filterScales; + + PROPAGATE_ERROR_FAIL( verifyEdgePorts() ); + + if (graph()->profile()->computePrecision().v() != surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8) + { + // nop + goto fail; + } + + if ( graph()->profile()->tensorScalingMode().v() != nvdla::TensorScalingMode::PER_TENSOR ) + { + // don't support any other scaling mode than PER_TENSOR + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Don't support tensor scaling mode: %s\n", + graph()->profile()->tensorScalingMode().c_str()); + } + + fusedConv = NodeFactory::nodeCast(dependencyParams(0).fusedNode(IODirectionEnum::INPUT)); + if ( fusedConv ) + { + PROPAGATE_ERROR_FAIL( fusedConv->verifyEdgePorts() ); + filterScales = fusedConv->params().filterScales(); + inTensorScales = fusedConv->inputEdges().at(0)->originalTensor()->getChannelScales(); + } + else + { + inTensorScales = inputEdges().at(0)->originalTensor()->getChannelScales(); + } + + outTensorScales = outputEdges().at(0)->originalTensor()->getChannelScales(); + + /* + * Convolution with bias op is represented as: + * + * O = I * W + b + * QoSo = QiSi * QwSw + b + * Qo = (Qi * Qw + b/Si*Sw) * (Si*Sw/So) + * + * Per-kernel equation looks like: + * Qo = (Qi * Qw + b[k]/Si*Sw) * (Si*Sw/So) + * wehre-as per-filter equation looks like: + * Qo = (Qi * Qw + b[k]/Si*Sw[k]) * (Si*Sw[k]/So) + * + * For per-kernel rescaling: + * - find a scale and truncate combination which approximately represents (Si*Sw/So) + * - represented as `2^(-t) * s` + * - program this in the output CVT of SDP + */ + if ( graph()->profile()->quantizationMode().v() == nvdla::QuantizationMode::PER_KERNEL ) + { + PROPAGATE_ERROR_FAIL( performPerKernelRescaling(fusedConv, + filterScales, + inTensorScales, + outTensorScales, + outCvt) ); + } + /* + * Again per-filter equation looks like: + * Qo = (Qi * Qw + b[k]/Si*Sw[k]) * (Si*Sw[k]/So) + * + * For per-filter rescaling: + * - find per-output channel, scale and truncate combinations which approximately represent (Si*Sw[k]/So) + * - represented as `2^(-t) * s[k]` + * - where s[k] : per-channel scale represented as i16 + * - t : common truncate that can safely represent all per-channel rescale factors + * - feed s[k] to the MUL unit of SDP-X and program 't' in the truncate operand + */ + else if ( graph()->profile()->quantizationMode().v() == nvdla::QuantizationMode::PER_FILTER ) + { + PROPAGATE_ERROR_FAIL( performPerChannelRescaling(fusedConv, + filterScales, + inTensorScales, + outTensorScales, + outCvt) ); + } + else + { + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Don't support quantization mode: %s\n", + graph()->profile()->quantizationMode().c_str()); + } + + params().setOutCVT(outCvt); + +fail: + return e; +} + +/*----------------------Weight Translation ----------------------------*/ +NvDlaError engine_ast::SDPBiasOpNode::translateAuxData() +{ + NvDlaError e = NvDlaError_Success; + engine_ast::Edge* auxEdge; + surface::SurfacePrecision computePrecision; + surface::SurfacePrecision srcPrecision; + NvU32 channelsPerGroup = 0; + + PROPAGATE_ERROR_FAIL( verifyEdgePorts() ); + + auxEdge = auxEdges()[0]; + computePrecision = auxEdge->tensorSurfaceDesc()->surfaceFormat().f().precision(); + srcPrecision = inputEdges()[0]->tensorSurfaceDesc()->surfaceFormat().f().precision(); + + { + Weights trnsBiasData; + Weights translateBiasData; + Weights translateScaleData; + Weights rawBiasData = params().rawBiasData(); + + if (srcPrecision == surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8) + { + channelsPerGroup = graph()->target_config()->atomicKSize(); + } + + if ( graph()->debugWeights() ) + { + gLogInfo << "translating weights for " << this->id() << " bias-dims kcrs = " << + auxEdge->tensorSurfaceDesc()->dimensions().n << "," << + auxEdge->tensorSurfaceDesc()->dimensions().c << "," << + auxEdge->tensorSurfaceDesc()->dimensions().h << "," << + auxEdge->tensorSurfaceDesc()->dimensions().w << "" << + " and size= " << rawBiasData.count << endl; + } + + WeightTrns::WeightDims biasDims (rawBiasData.count, + auxEdge->tensorSurfaceDesc()->dimensions().n, + auxEdge->tensorSurfaceDesc()->dimensions().c, + auxEdge->tensorSurfaceDesc()->dimensions().w, + auxEdge->tensorSurfaceDesc()->dimensions().h, + 1, //FIXME: grab correct strides + 1); + + if (rawBiasData.count != auxEdge->tensorSurfaceDesc()->dimensions().n * + auxEdge->tensorSurfaceDesc()->dimensions().c * + auxEdge->tensorSurfaceDesc()->dimensions().h * + auxEdge->tensorSurfaceDesc()->dimensions().w) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "bias dims dont match bias size"); + } + + if (params().x1Params().isINT8Rescaling()) + { + // interlay bias data with rescale factors + Weights rawRescaleData = rescaleData(); + ASSERT(rawBiasData.type == rawRescaleData.type); + + auxEdge->tensorSurfaceDesc()->setAlignLineStride(true); + + PRECISION_SWITCH(rawBiasData.type.v(), computePrecision.v(), translateBiasData, WeightTrns::translateDataForBias, + params().x1Params().mode(), + biasDims, + rawBiasData, + channelsPerGroup); + + PRECISION_SWITCH(rawRescaleData.type.v(), computePrecision.v(), translateScaleData, WeightTrns::translateDataForScale, + params().x1Params().mode(), + biasDims, + rawRescaleData, + channelsPerGroup); + + PRECISION_SWITCH(rawBiasData.type.v(), computePrecision.v(), trnsBiasData, WeightTrns::interlayDataBlobs, + translateBiasData, + translateScaleData); + } + else + { + // only translate bias data to dla friendly layout + PRECISION_SWITCH(rawBiasData.type.v(), computePrecision.v(), trnsBiasData, WeightTrns::translateDataForBias, + params().x1Params().mode(), + biasDims, + rawBiasData, + channelsPerGroup); + } + + if (trnsBiasData.values == NULL) + { + PROPAGATE_ERROR_FAIL(NvDlaError_BadValue, "Bias Wt trnaslation failed for node '%s'", name().c_str()); + } + + params().setDLABiasData(trnsBiasData); + } + +fail: + return e; +} + +NvDlaError engine_ast::SDPBiasOpNode::emitOp(Graph *g, + DLAInterface *target_dla, + NvU32 op_slot, NvU32 batch_id, + DLACommonOpDescAccessor dep, + DLAOperationContainerAccessor op, + DLASurfaceContainerAccessor surf) +{ + NvDlaError e = NvDlaSuccess; + DLASDPOpDescAccessor sdp_op = op.sdpOpDescAccessor(0); + DLACVTParamAccessor out_cvt_acc = sdp_op.outCVTAccessor(); + DLASDPOpAccessor x1_op_acc = sdp_op.x1OpAccessor(); + DLASDPOpAccessor x2_op_acc = sdp_op.x2OpAccessor(); + DLASDPOpAccessor y_op_acc = sdp_op.yOpAccessor(); + DLASDPSurfaceDescAccessor surf_acc = surf.sdpSurfaceDescAccessor(0); + DLADataCubeAccessor src_data_acc = surf_acc.srcDataAccessor(); + DLADataCubeAccessor dst_data_acc = surf_acc.dstDataAccessor(); + DLADataCubeAccessor x1_data_acc = surf_acc.x1DataAccessor(); + DLADataCubeAccessor x2_data_acc = surf_acc.x2DataAccessor(); + DLADataCubeAccessor y_data_acc = surf_acc.yDataAccessor(); + DLAConsumerAccessor fused_acc = dep.fusedParentAccessor(); + NVDLA_UNUSED(x2_data_acc); + NVDLA_UNUSED(y_data_acc); + NVDLA_UNUSED(fused_acc); + + surface::TensorSurfaceDesc *src_tsd = g->nodeInputTensorSurface(this, 0, supportedInSurfCategories()); + surface::TensorSurfaceDesc *dst_tsd = g->nodeOutputTensorSurface(this, 0, supportedOutSurfCategories()); + surface::TensorSurfaceDesc *bias_tsd = g->nodeInputTensorSurface(this, 0, supportedAuxSurfCategories()); + + *sdp_op.srcPrecision() = ASTToDLAInterface::getSDPPrecision(target_dla, src_tsd->surfaceFormat().precision()); + *sdp_op.dstPrecision() = ASTToDLAInterface::getSDPPrecision(target_dla, dst_tsd->surfaceFormat().precision()); + *sdp_op.LUTIndex() = -1; + *sdp_op.batchNum() = 1; + *sdp_op.batchStride() = 0; + + *out_cvt_acc.scale() = params().outCVT().scale(); + *out_cvt_acc.truncate() = params().outCVT().truncate(); + *out_cvt_acc.offset() = params().outCVT().offset(); + *out_cvt_acc.enable() = static_cast(params().outCVT().isEnable()); + + *x1_op_acc.enable() = 1; + *x1_op_acc.ALUType() = x1_op_acc.ALUType_Sum(); + *x1_op_acc.type() = ASTToDLAInterface::getSDPOpType(target_dla, params(batch_id).x1Params().opType()); + *x1_op_acc.mode() = ASTToDLAInterface::getSDPMode(target_dla, params(batch_id).x1Params().mode()); + *x1_op_acc.act() = ASTToDLAInterface::getSDPActType(target_dla, params(batch_id).x1Params().actType()); + *x1_op_acc.shiftValue() = params().x1Params().shiftValue(); + *x1_op_acc.truncate() = params().x1Params().truncate(); + + if (params(batch_id).x1Params().mode().e() == engine_ast::SDPModeEnum::SDP_MODE_PER_LAYER) + { + Weights biasData = params().DLABiasData(); + + if (biasData.count > 1) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, + "More than one data available" + "in per-layer mode(#data = %u)", + biasData.count); + } + switch (biasData.type) + { + case DataType::HALF: + case DataType::INT16: + *x1_op_acc.ALUOperand() = + reinterpret_cast(biasData.values)[SDP_ADDER_DATA_INDEX]; + *x1_op_acc.MulOperand() = params().x1Params().isINT8Rescaling() ? + reinterpret_cast(biasData.values)[SDP_MULTIPLIER_DATA_INDEX] : + 1; + break; + case DataType::INT8: + *x1_op_acc.ALUOperand() = + reinterpret_cast(biasData.values)[SDP_ADDER_DATA_INDEX]; + *x1_op_acc.MulOperand() = params().x1Params().isINT8Rescaling() ? + reinterpret_cast(biasData.values)[SDP_MULTIPLIER_DATA_INDEX] : + 1; + break; + default: + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, + "Unexpected data type %s", + biasData.type.c_str()); + } + } + else + { + *x1_op_acc.ALUOperand() = 0; + *x1_op_acc.MulOperand() = 1; + } + *x1_op_acc.precision() = *sdp_op.srcPrecision(); // precision of engine = precision of its input tensor + *x1_op_acc.precision() = ASTToDLAInterface::getSDPPrecision(target_dla, bias_tsd->surfaceFormat().precision()); + + *x2_op_acc.enable() = 0; + *y_op_acc.enable() = 0; + + emitDependencyParams(target_dla, dep, batch_id); + setDataCubeAccessor(src_data_acc, src_tsd, IODirectionEnum::INPUT, batch_id); + setDataCubeAccessor(dst_data_acc, dst_tsd, IODirectionEnum::OUTPUT, batch_id); + if (params(batch_id).x1Params().mode().e() != engine_ast::SDPModeEnum::SDP_MODE_PER_LAYER) + { + setDataCubeAccessor(x1_data_acc, bias_tsd, IODirectionEnum::UNKNOWN, batch_id); + } + + if ( params(batch_id).convMode().v() == ConvolutionModeEnum::CONV_WINOGRAD ) + { + *sdp_op.convMode() = sdp_op.convMode_Winograd(); + + *src_data_acc.width() = params().winogradParams().ioDims.w; + *src_data_acc.height() = params().winogradParams().ioDims.h; + + *dst_data_acc.width() = params().winogradParams().ioDims.w; + *dst_data_acc.height() = params().winogradParams().ioDims.h; + } + else if ( params(batch_id).convMode().v() == ConvolutionModeEnum::CONV_DIRECT ) + { + *sdp_op.convMode() = sdp_op.convMode_Direct(); + } + else + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unsupported Conv mode for %s", name().c_str()); + } + + if ( g->debugOps() ) + { + gLogInfo << "SDP bias node @ op_slot = " << op_slot << " batch_id = " << batch_id << endl; + gLogInfo << "\tsrc precision " << (int)*sdp_op.srcPrecision() << endl; + gLogInfo << "\tdst precision " << (int)*sdp_op.dstPrecision() << endl; + gLogInfo << "\tx1 enable " << (int)*x1_op_acc.enable() << endl; + if (*x1_op_acc.enable()) + { + gLogInfo << "\tx1 precision " << (int)*x1_op_acc.precision() << endl; + gLogInfo << "\tx1 aluType " << (int)*x1_op_acc.ALUType() << endl; + gLogInfo << "\tx1 type " << (int)*x1_op_acc.type() << endl; + gLogInfo << "\tx1 mode " << (int)*x1_op_acc.mode() << endl; + gLogInfo << "\tx1 act " << (int)*x1_op_acc.act() << endl; + gLogInfo << "\tx1 shiftValue " << (int)*x1_op_acc.shiftValue() << endl; + gLogInfo << "\tx1 aluOperand " << (int)*x1_op_acc.ALUOperand() << endl; + gLogInfo << "\tx1 mulOperand " << (int)*x1_op_acc.MulOperand() << endl; + gLogInfo << "\tx1 truncate " << (int)*x1_op_acc.truncate() << endl; + } + gLogInfo << "\tx2 enable " << (int)*x2_op_acc.enable() << endl; + if (*x2_op_acc.enable()) + { + gLogInfo << "\tx2 precision " << (int)*x2_op_acc.precision() << endl; + gLogInfo << "\tx2 aluType " << (int)*x2_op_acc.ALUType() << endl; + gLogInfo << "\tx2 type " << (int)*x2_op_acc.type() << endl; + gLogInfo << "\tx2 mode " << (int)*x2_op_acc.mode() << endl; + gLogInfo << "\tx2 act " << (int)*x2_op_acc.act() << endl; + gLogInfo << "\tx2 shiftValue " << (int)*x2_op_acc.shiftValue() << endl; + gLogInfo << "\tx2 aluOperand " << (int)*x2_op_acc.ALUOperand() << endl; + gLogInfo << "\tx2 mulOperand " << (int)*x2_op_acc.MulOperand() << endl; + gLogInfo << "\tx2 truncate " << (int)*x2_op_acc.truncate() << endl; + } + gLogInfo << "\ty enable " << (int)*y_op_acc.enable() << endl; + if (*y_op_acc.enable()) + { + gLogInfo << "\ty precision " << (int)*y_op_acc.precision() << endl; + gLogInfo << "\ty aluType " << (int)*y_op_acc.ALUType() << endl; + gLogInfo << "\ty type " << (int)*y_op_acc.type() << endl; + gLogInfo << "\ty mode " << (int)*y_op_acc.mode() << endl; + gLogInfo << "\ty act " << (int)*y_op_acc.act() << endl; + gLogInfo << "\ty shiftValue " << (int)*y_op_acc.shiftValue() << endl; + gLogInfo << "\ty aluOperand " << (int)*y_op_acc.ALUOperand() << endl; + gLogInfo << "\ty mulOperand " << (int)*y_op_acc.MulOperand() << endl; + gLogInfo << "\ty truncate " << (int)*y_op_acc.truncate() << endl; + } + gLogInfo << "\tsrc tsd:" << src_tsd->id() << endl; + gLogInfo << "\tdst tsd:" << dst_tsd->id() << "/" << dst_tsd->tensorBufferDesc()->id() + << ":off= " << dst_tsd->bufferOffset() << endl; + gLogInfo << "\tbias tsd:" << bias_tsd->id() << endl; + gLogInfo << "\tdependencyCount" << (int)*dep.dependencyCount() << endl; + gLogInfo << "\tconv_mode " << (int)*sdp_op.convMode() << endl; + gLogInfo << "\tsrc addr=" << *src_data_acc.address() << endl; + gLogInfo << "\tsrc type=" << (int)*src_data_acc.type() << endl; + gLogInfo << "\tsrc size " << *src_data_acc.size() << endl; + gLogInfo << "\tsrc width " << *src_data_acc.width() << endl; + gLogInfo << "\tsrc height " << *src_data_acc.height() << endl; + gLogInfo << "\tsrc channel " << *src_data_acc.channel() << endl; + gLogInfo << "\tsrc linestride " << *src_data_acc.lineStride() << endl; + gLogInfo << "\tsrc surfstride " << *src_data_acc.surfStride() << endl; + gLogInfo << "\tbias addr=" << *x1_data_acc.address() <nodeInputTensorSurface(this, 0, supportedInSurfCategories()); + surface::TensorSurfaceDesc *dst_tsd = graph()->nodeOutputTensorSurface(this, 0, supportedOutSurfCategories()); + surface::TensorSurfaceDesc *bias_tsd = graph()->nodeInputTensorSurface(this, 0, supportedAuxSurfCategories()); + + + nvdla_prototest_interface::SDPOpDesc* protoSDPOpDesc = protoLayer->mutable_op_config()->mutable_sdp_op(); + nvdla_prototest_interface::SDPSurfaceDesc* protoSDPSurfDesc = protoLayer->mutable_surface()->mutable_sdp_surface(); + nvdla_prototest_interface::SDPOp* protoSDPX1OpDesc = protoSDPOpDesc->mutable_x1_op(); + nvdla_prototest_interface::SDPOp* protoSDPX2OpDesc = protoSDPOpDesc->mutable_x2_op(); + nvdla_prototest_interface::SDPOp* protoSDPYOpDesc = protoSDPOpDesc->mutable_y_op(); + nvdla_prototest_interface::DataCube* protoSrcDataCube = protoSDPSurfDesc->mutable_src_data(); + nvdla_prototest_interface::DataCube* protoDstDataCube = protoSDPSurfDesc->mutable_dst_data(); + nvdla_prototest_interface::DataCube* protoX1DataCube = protoSDPSurfDesc->mutable_x1_data(); + nvdla_prototest_interface::DataPrecision protoSrcPrec, protoDstPrec; + + protoLayer->set_index(op_slot); + protoLayer->set_roi_index(0); + protoLayer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_SDP); + protoLayer->set_dependency_count(*dep.dependencyCount()); + + /* consumers */ + for (size_t c = 0; c < EngineType::num_elements(); c++) + { + NvS8 fw_op_index = ASTToDLAInterface::getEngineType(target_dla, c); + if ( fw_op_index < 0 ) + { + continue; + } + + DLAConsumerAccessor cons_acc = dep.consumerAccessor(fw_op_index); + if (*cons_acc.index() != -1) { + numConsumers++; + nvdla_prototest_interface::Consumer* protoConsumer = protoLayer->add_bottom(); + protoConsumer->set_index(*cons_acc.index()); + switch(c) { + case EngineTypeEnum::BDMA : protoConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_BDMA); break; + case EngineTypeEnum::CONVOLUTION : protoConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_CONV); break; + case EngineTypeEnum::SDP : protoConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_SDP); break; + case EngineTypeEnum::PDP : protoConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_PDP); break; + case EngineTypeEnum::CDP : protoConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_CDP); break; + case EngineTypeEnum::RUBIK: protoConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_RUBIK); break; + default: ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unrecognized consumer"); + } + switch(dependencyParams().consumer(c).opEvent().v()) { + case OperationEventTypeEnum::OP_CDMA_WEIGHT_DONE : protoConsumer->set_event(nvdla_prototest_interface::Consumer_EventType::Consumer_EventType_CDMA_WT_DONE); break; + case OperationEventTypeEnum::OP_CDMA_DATA_DONE : protoConsumer->set_event(nvdla_prototest_interface::Consumer_EventType::Consumer_EventType_CDMA_DT_DONE); break; + case OperationEventTypeEnum::OP_COMPLETED : protoConsumer->set_event(nvdla_prototest_interface::Consumer_EventType::Consumer_EventType_OP_COMPLETED); break; + case OperationEventTypeEnum::OP_ENABLED : protoConsumer->set_event(nvdla_prototest_interface::Consumer_EventType::Consumer_EventType_OP_ENABLED); break; + case OperationEventTypeEnum::OP_PROGRAMMED : protoConsumer->set_event(nvdla_prototest_interface::Consumer_EventType::Consumer_EventType_OP_PROGRAMMED); break; + default: ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unrecognized consumer event"); + } + } + } + + /* fused node */ + if (dependencyParams().fusedNode(engine_ast::IODirectionEnum::INPUT)) + { + nvdla_prototest_interface::Consumer* protoFusedConsumer = protoLayer->mutable_fused(); + protoFusedConsumer->set_index(*fused_acc.index()); + protoFusedConsumer->set_event(nvdla_prototest_interface::Consumer_EventType::Consumer_EventType_OP_ENABLED); + switch(dependencyParams().fusedNode(engine_ast::IODirectionEnum::INPUT)->engineType().v()) { + case EngineTypeEnum::CONVOLUTION: protoFusedConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_CONV); break; + default: ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "SDP can have only Conv op as its fused partner on input side"); + } + } + + switch(src_tsd->surfaceFormat().precision().v()) { + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_FP16 : protoSrcPrec = nvdla_prototest_interface::DataPrecision::PRECISION_FP16; break; + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16 : protoSrcPrec = nvdla_prototest_interface::DataPrecision::PRECISION_INT16; break; + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8 : protoSrcPrec = nvdla_prototest_interface::DataPrecision::PRECISION_INT8; break; + default: ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unrecognized src precision"); + } + + switch(dst_tsd->surfaceFormat().precision().v()) { + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_FP16 : protoDstPrec = nvdla_prototest_interface::DataPrecision::PRECISION_FP16; break; + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16 : protoDstPrec = nvdla_prototest_interface::DataPrecision::PRECISION_INT16; break; + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8 : protoDstPrec = nvdla_prototest_interface::DataPrecision::PRECISION_INT8; break; + default: ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unrecognized dst precision"); + } + + protoSDPOpDesc->set_src_precision(protoSrcPrec); + protoSDPOpDesc->set_dst_precision(protoDstPrec); + protoSDPOpDesc->set_lut_index(-1); + + protoSDPOpDesc->mutable_out_cvt()->set_enable(*out_cvt_acc.enable()); + protoSDPOpDesc->mutable_out_cvt()->set_offset(*out_cvt_acc.offset()); + protoSDPOpDesc->mutable_out_cvt()->set_scale(*out_cvt_acc.scale()); + protoSDPOpDesc->mutable_out_cvt()->set_truncate(*out_cvt_acc.truncate()); + + protoSDPOpDesc->set_conv_mode(nvdla_prototest_interface::ConvMode::DIRECT); + protoSDPOpDesc->set_batch_num(1); + protoSDPOpDesc->set_batch_stride(0); + + protoSDPX1OpDesc->set_enable(*x1_op_acc.enable()); + protoSDPX1OpDesc->set_alu_type(nvdla_prototest_interface::ALUType::ALU_SUM); + protoSDPX1OpDesc->set_type(nvdla_prototest_interface::SDPOpType::SDP_OP_ADD); + protoSDPX1OpDesc->set_mode(opMode2InfOpMode(params().x1Params().mode())); + protoSDPX1OpDesc->set_act(actType2InfActType(params().x1Params().actType())); + protoSDPX1OpDesc->set_shift_value(*x1_op_acc.shiftValue()); + protoSDPX1OpDesc->set_alu_operand(*x1_op_acc.ALUOperand()); + protoSDPX1OpDesc->set_mul_operand(*x1_op_acc.MulOperand()); + protoSDPX1OpDesc->set_truncate(*x1_op_acc.truncate()); + protoSDPX1OpDesc->set_precision(protoSrcPrec); + protoSDPX1OpDesc->mutable_cvt()->mutable_alu_cvt()->set_enable(*x1_op_acc.cvt().aluCVTAccessor().enable()); + protoSDPX1OpDesc->mutable_cvt()->mutable_alu_cvt()->set_truncate(*x1_op_acc.cvt().aluCVTAccessor().truncate()); + protoSDPX1OpDesc->mutable_cvt()->mutable_alu_cvt()->set_scale(*x1_op_acc.cvt().aluCVTAccessor().scale()); + protoSDPX1OpDesc->mutable_cvt()->mutable_alu_cvt()->set_offset(*x1_op_acc.cvt().aluCVTAccessor().offset()); + protoSDPX1OpDesc->mutable_cvt()->mutable_mul_cvt()->set_enable(*x1_op_acc.cvt().mulCVTAccessor().enable()); + protoSDPX1OpDesc->mutable_cvt()->mutable_mul_cvt()->set_truncate(*x1_op_acc.cvt().mulCVTAccessor().truncate()); + protoSDPX1OpDesc->mutable_cvt()->mutable_mul_cvt()->set_scale(*x1_op_acc.cvt().mulCVTAccessor().scale()); + protoSDPX1OpDesc->mutable_cvt()->mutable_mul_cvt()->set_offset(*x1_op_acc.cvt().mulCVTAccessor().offset()); + + protoSDPX2OpDesc->set_enable(*x2_op_acc.enable()); + protoSDPX2OpDesc->set_alu_type(nvdla_prototest_interface::ALUType::ALU_SUM); + protoSDPX2OpDesc->set_type(nvdla_prototest_interface::SDPOpType::SDP_OP_ADD); + protoSDPX2OpDesc->set_mode(nvdla_prototest_interface::SDPOp_SDPOpMode::SDPOp_SDPOpMode_SDP_OP_PER_KERNEL); + protoSDPX2OpDesc->set_act(nvdla_prototest_interface::SDPActivation::ACT_NONE); + protoSDPX2OpDesc->set_shift_value(*x2_op_acc.shiftValue()); + protoSDPX2OpDesc->set_alu_operand(*x2_op_acc.ALUOperand()); + protoSDPX2OpDesc->set_mul_operand(*x2_op_acc.MulOperand()); + protoSDPX2OpDesc->set_truncate(*x2_op_acc.truncate()); + protoSDPX2OpDesc->set_precision(protoSrcPrec); + protoSDPX2OpDesc->mutable_cvt()->mutable_alu_cvt()->set_enable(*x2_op_acc.cvt().aluCVTAccessor().enable()); + protoSDPX2OpDesc->mutable_cvt()->mutable_alu_cvt()->set_truncate(*x2_op_acc.cvt().aluCVTAccessor().truncate()); + protoSDPX2OpDesc->mutable_cvt()->mutable_alu_cvt()->set_scale(*x2_op_acc.cvt().aluCVTAccessor().scale()); + protoSDPX2OpDesc->mutable_cvt()->mutable_alu_cvt()->set_offset(*x2_op_acc.cvt().aluCVTAccessor().offset()); + protoSDPX2OpDesc->mutable_cvt()->mutable_mul_cvt()->set_enable(*x2_op_acc.cvt().mulCVTAccessor().enable()); + protoSDPX2OpDesc->mutable_cvt()->mutable_mul_cvt()->set_truncate(*x2_op_acc.cvt().mulCVTAccessor().truncate()); + protoSDPX2OpDesc->mutable_cvt()->mutable_mul_cvt()->set_scale(*x2_op_acc.cvt().mulCVTAccessor().scale()); + protoSDPX2OpDesc->mutable_cvt()->mutable_mul_cvt()->set_offset(*x2_op_acc.cvt().mulCVTAccessor().offset()); + + + protoSDPYOpDesc->set_enable(*y_op_acc.enable()); + protoSDPYOpDesc->set_alu_type(nvdla_prototest_interface::ALUType::ALU_SUM); + protoSDPYOpDesc->set_type(nvdla_prototest_interface::SDPOpType::SDP_OP_ADD); + protoSDPYOpDesc->set_mode(nvdla_prototest_interface::SDPOp_SDPOpMode::SDPOp_SDPOpMode_SDP_OP_PER_KERNEL); + protoSDPYOpDesc->set_act(nvdla_prototest_interface::SDPActivation::ACT_NONE); + protoSDPYOpDesc->set_shift_value(*y_op_acc.shiftValue()); + protoSDPYOpDesc->set_alu_operand(*y_op_acc.ALUOperand()); + protoSDPYOpDesc->set_mul_operand(*y_op_acc.MulOperand()); + protoSDPYOpDesc->set_truncate(*y_op_acc.truncate()); + protoSDPYOpDesc->set_precision(protoSrcPrec); + protoSDPYOpDesc->mutable_cvt()->mutable_alu_cvt()->set_enable(*y_op_acc.cvt().aluCVTAccessor().enable()); + protoSDPYOpDesc->mutable_cvt()->mutable_alu_cvt()->set_truncate(*y_op_acc.cvt().aluCVTAccessor().truncate()); + protoSDPYOpDesc->mutable_cvt()->mutable_alu_cvt()->set_scale(*y_op_acc.cvt().aluCVTAccessor().scale()); + protoSDPYOpDesc->mutable_cvt()->mutable_alu_cvt()->set_offset(*y_op_acc.cvt().aluCVTAccessor().offset()); + protoSDPYOpDesc->mutable_cvt()->mutable_mul_cvt()->set_enable(*y_op_acc.cvt().mulCVTAccessor().enable()); + protoSDPYOpDesc->mutable_cvt()->mutable_mul_cvt()->set_truncate(*y_op_acc.cvt().mulCVTAccessor().truncate()); + protoSDPYOpDesc->mutable_cvt()->mutable_mul_cvt()->set_scale(*y_op_acc.cvt().mulCVTAccessor().scale()); + protoSDPYOpDesc->mutable_cvt()->mutable_mul_cvt()->set_offset(*y_op_acc.cvt().mulCVTAccessor().offset()); + + + if (*fused_acc.index() != -1) { + protoSrcDataCube->set_type(nvdla_prototest_interface::MemType::DLA_MEM_HW); + } else { + protoSrcDataCube->set_type(nvdla_prototest_interface::MemType::DLA_MEM_MC); + } + protoSrcDataCube->set_address(*src_data_acc.address()); + protoSrcDataCube->set_size(src_tsd->tensorBufferDesc()->size() - src_tsd->bufferOffset()); + protoSrcDataCube->set_width(*src_data_acc.width()); + protoSrcDataCube->set_height(*src_data_acc.height()); + protoSrcDataCube->set_channel(*src_data_acc.channel()); + protoSrcDataCube->set_line_stride(*src_data_acc.lineStride()); + protoSrcDataCube->set_surf_stride(*src_data_acc.surfStride()); + protoSrcDataCube->set_plane_stride(*src_data_acc.planeStride()); + protoSrcDataCube->mutable_mem_info()->set_mem_id(src_tsd->tensorBufferDesc()->memoryId(batch_id)); + protoSrcDataCube->mutable_mem_info()->set_mem_size(src_tsd->tensorBufferDesc()->size()); + protoSrcDataCube->mutable_mem_info()->set_offset(src_tsd->bufferOffset()); + + protoDstDataCube->set_type(nvdla_prototest_interface::MemType::DLA_MEM_MC); + protoDstDataCube->set_address(*dst_data_acc.address()); + protoDstDataCube->set_size(dst_tsd->tensorBufferDesc()->size() - dst_tsd->bufferOffset()); + protoDstDataCube->set_width(*dst_data_acc.width()); + protoDstDataCube->set_height(*dst_data_acc.height()); + protoDstDataCube->set_channel(*dst_data_acc.channel()); + protoDstDataCube->set_line_stride(*dst_data_acc.lineStride()); + protoDstDataCube->set_surf_stride(*dst_data_acc.surfStride()); + protoDstDataCube->set_plane_stride(*dst_data_acc.planeStride()); + protoDstDataCube->mutable_mem_info()->set_mem_id(dst_tsd->tensorBufferDesc()->memoryId(batch_id)); + protoDstDataCube->mutable_mem_info()->set_mem_size(dst_tsd->tensorBufferDesc()->size()); + protoDstDataCube->mutable_mem_info()->set_offset(dst_tsd->bufferOffset()); + if (numConsumers == 0) { + protoDstDataCube->mutable_mem_info()->set_fill_type(nvdla_prototest_interface::FillerType::FILL_NONE); + protoDstDataCube->mutable_mem_info()->set_flag(nvdla_prototest_interface::MemFlag::DLA_MEM_OUTPUT); + protoDstDataCube->mutable_mem_info()->set_precision(protoDstPrec); + } + + protoX1DataCube->set_type(nvdla_prototest_interface::MemType::DLA_MEM_MC); + protoX1DataCube->set_address(*x1_data_acc.address()); + protoX1DataCube->set_size(bias_tsd->tensorBufferDesc()->size()); + protoX1DataCube->set_width(*x1_data_acc.width()); + protoX1DataCube->set_height(*x1_data_acc.height()); + protoX1DataCube->set_channel(*x1_data_acc.channel()); + protoX1DataCube->set_line_stride(*x1_data_acc.lineStride()); + protoX1DataCube->set_surf_stride(*x1_data_acc.surfStride()); + protoX1DataCube->set_plane_stride(*x1_data_acc.planeStride()); + protoX1DataCube->mutable_mem_info()->set_mem_id(bias_tsd->tensorBufferDesc()->memoryId(batch_id)); + protoX1DataCube->mutable_mem_info()->set_mem_size(bias_tsd->tensorBufferDesc()->size()); + protoX1DataCube->mutable_mem_info()->set_offset(bias_tsd->bufferOffset()); +fail: + return e; +} +#endif + +}; // nvdla::priv:: +}; // nvdla:: diff --git a/umd/core/src/compiler/engine-ast/CDPLRNOp.cpp b/umd/core/src/compiler/engine-ast/CDPLRNOp.cpp new file mode 100644 index 00000000..19c2fcaf --- /dev/null +++ b/umd/core/src/compiler/engine-ast/CDPLRNOp.cpp @@ -0,0 +1,277 @@ +/* + * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#include + +#include "priv/EngineAST.h" +#include "priv/Profile.h" +#include "priv/Tensor.h" +#include "priv/Compiler.h" +#include "ErrorMacros.h" + +using std::endl; + +namespace nvdla +{ +namespace priv +{ +namespace engine_ast +{ + +void CDPLRNOpNode::captureCanonicalParams() +{ + NvDlaError e = NvDlaSuccess; + + params().setLocalSize(canonicalNode()->params().localSize()); + params().setAlpha(canonicalNode()->params().alpha()); + params().setBeta(canonicalNode()->params().beta()); + params().setK(canonicalNode()->params().k()); + + // Register the LRN lut with the LutManager + PROPAGATE_ERROR_FAIL(graph()->lutManager()->registerLRN(graph()->profile()->computePrecision().e(), + params().localSize(), params().alpha(), params().beta(), params().k(), &m_hLut)); + + +fail: + return; +} + +NvDlaError engine_ast::CDPLRNOpNode::emitOp(Graph *g, + DLAInterface *target_dla, + NvU32 op_slot, NvU32 batch_id, + DLACommonOpDescAccessor dep, + DLAOperationContainerAccessor op, + DLASurfaceContainerAccessor surf) +{ + NvDlaError e = NvDlaSuccess; + + + DLACDPOpDescAccessor cdp_op = op.cdpOpDescAccessor(0); + DLACVTParamAccessor in_cvt_acc = cdp_op.inCVTAccessor(); + DLACVTParamAccessor out_cvt_acc = cdp_op.outCVTAccessor(); + + DLACDPSurfaceDescAccessor cdp_surf = surf.cdpSurfaceDescAccessor(0); + + DLADataCubeAccessor src_data_acc = cdp_surf.srcDataAccessor(); + DLADataCubeAccessor dst_data_acc = cdp_surf.dstDataAccessor(); + DLAConsumerAccessor fused_acc = dep.fusedParentAccessor(); + NVDLA_UNUSED(fused_acc); + + surface::TensorSurfaceDesc *src_tsd = g->nodeInputTensorSurface(this, 0, supportedInSurfCategories()); + surface::TensorSurfaceDesc *dst_tsd = g->nodeOutputTensorSurface(this, 0, supportedOutSurfCategories()); + + *cdp_op.inPrecision() = ASTToDLAInterface::getCDPPrecision(target_dla, src_tsd->surfaceFormat().precision()); + *cdp_op.outPrecision() = ASTToDLAInterface::getCDPPrecision(target_dla, dst_tsd->surfaceFormat().precision()); + *cdp_op.LUTIndex() = graph()->lutManager()->getIndex(m_hLut); + + *in_cvt_acc.scale() = 1; + *in_cvt_acc.truncate() = 0; + *in_cvt_acc.offset() = 0; + *in_cvt_acc.enable() = 1; + + *out_cvt_acc.scale() = 1; + *out_cvt_acc.truncate() = 0; + *out_cvt_acc.offset() = 0; + *out_cvt_acc.enable() = 1; + + *cdp_op.localSize() = params(batch_id).localSize(); + *cdp_op.bypassSquareSum() = 0; + *cdp_op.bypassOutMul() = 0; + + emitDependencyParams(target_dla, dep, batch_id); + setDataCubeAccessor(src_data_acc, src_tsd, IODirectionEnum::INPUT, batch_id); + setDataCubeAccessor(dst_data_acc, dst_tsd, IODirectionEnum::UNKNOWN, batch_id); + + if ( g->debugOps() ) + { + gLogInfo << "CDP activation node @ op_slot = " << op_slot << " batch_id = " << batch_id << endl; + gLogInfo << "\tin precision " << (int)*cdp_op.inPrecision() << endl; + gLogInfo << "\tout precision " << (int)*cdp_op.outPrecision() << endl; + gLogInfo << "\tsrc tsd:" << src_tsd->id() << endl; + gLogInfo << "\tdst tsd:" << dst_tsd->id() << endl; + gLogInfo << "\tsrc addr=" << *src_data_acc.address() << endl; + gLogInfo << "\tsrc type=" << (int)*src_data_acc.type() << endl; + gLogInfo << "\tdependencyCount" << (int)*dep.dependencyCount() << endl; + gLogInfo << "\tsrc size " << *src_data_acc.size() << endl; + gLogInfo << "\tsrc width " << *src_data_acc.width() << endl; + gLogInfo << "\tsrc height " << *src_data_acc.height() << endl; + gLogInfo << "\tsrc channel " << *src_data_acc.channel() << endl; + gLogInfo << "\tsrc linestride " << *src_data_acc.lineStride() << endl; + gLogInfo << "\tsrc surfstride " << *src_data_acc.surfStride() << endl; + gLogInfo << "\tdst addr=" << *dst_data_acc.address() << endl; + gLogInfo << "\tdst type=" << (int)*dst_data_acc.type() << endl; + gLogInfo << "\tdst size " << *dst_data_acc.size() << endl; + gLogInfo << "\tdst width " << *dst_data_acc.width() << endl; + gLogInfo << "\tdst height " << *dst_data_acc.height() << endl; + gLogInfo << "\tdst channel " << *dst_data_acc.channel() << endl; + gLogInfo << "\tdst linestride " << *dst_data_acc.lineStride() << endl; + gLogInfo << "\tdst surfstride " << *dst_data_acc.surfStride() << endl; + } + + return e; +} + +#ifdef NVDLA_COMPILER_OUTPUT_FOR_PROTOTEST +NvDlaError engine_ast::CDPLRNOpNode::emitOp(NvU32 op_slot, NvU32 batch_id, + DLAInterface* target_dla, + DLACommonOpDescAccessor& dep, + DLAOperationContainerAccessor& op, + DLASurfaceContainerAccessor& surf, + nvdla_prototest_interface::Layer* protoLayer) +{ + NvDlaError e = NvDlaSuccess; + NvU8 numConsumers = 0; + + DLACDPOpDescAccessor cdp_op = op.cdpOpDescAccessor(0); + DLACVTParamAccessor in_cvt_acc = cdp_op.inCVTAccessor(); + DLACVTParamAccessor out_cvt_acc = cdp_op.outCVTAccessor(); + + DLACDPSurfaceDescAccessor cdp_surf = surf.cdpSurfaceDescAccessor(0); + + DLADataCubeAccessor src_data_acc = cdp_surf.srcDataAccessor(); + DLADataCubeAccessor dst_data_acc = cdp_surf.dstDataAccessor(); + DLAConsumerAccessor fused_acc = dep.fusedParentAccessor(); + NVDLA_UNUSED(fused_acc); + + surface::TensorSurfaceDesc *src_tsd = graph()->nodeInputTensorSurface(this, 0, supportedInSurfCategories()); + surface::TensorSurfaceDesc *dst_tsd = graph()->nodeOutputTensorSurface(this, 0, supportedOutSurfCategories()); + + nvdla_prototest_interface::CDPOpDesc* protoCDPOpDesc = protoLayer->mutable_op_config()->mutable_cdp_op(); + nvdla_prototest_interface::CDPSurfaceDesc* protoCDPSurfDesc = protoLayer->mutable_surface()->mutable_cdp_surface(); + nvdla_prototest_interface::DataCube* protoSrcDataCube = protoCDPSurfDesc->mutable_src_data(); + nvdla_prototest_interface::DataCube* protoDstDataCube = protoCDPSurfDesc->mutable_dst_data(); + nvdla_prototest_interface::DataPrecision protoSrcPrec, protoDstPrec; + + protoLayer->set_index(op_slot); + protoLayer->set_roi_index(0); + protoLayer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_CDP); + protoLayer->set_dependency_count(*dep.dependencyCount()); + + /* consumers */ + for (size_t c = 0; c < EngineType::num_elements(); c++) + { + NvS8 fw_op_index = ASTToDLAInterface::getEngineType(target_dla, c); + if ( fw_op_index < 0 ) + { + continue; + } + + DLAConsumerAccessor cons_acc = dep.consumerAccessor(fw_op_index); + if (*cons_acc.index() != -1) { + numConsumers++; + nvdla_prototest_interface::Consumer* protoConsumer = protoLayer->add_bottom(); + protoConsumer->set_index(*cons_acc.index()); + switch(c) { + case EngineTypeEnum::BDMA : protoConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_BDMA); break; + case EngineTypeEnum::CONVOLUTION : protoConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_CONV); break; + case EngineTypeEnum::SDP : protoConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_SDP); break; + case EngineTypeEnum::PDP : protoConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_PDP); break; + case EngineTypeEnum::CDP : protoConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_CDP); break; + case EngineTypeEnum::RUBIK: protoConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_RUBIK); break; + default: ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unrecognized consumer"); + } + switch(dependencyParams().consumer(c).opEvent().v()) { + case OperationEventTypeEnum::OP_CDMA_WEIGHT_DONE : protoConsumer->set_event(nvdla_prototest_interface::Consumer_EventType::Consumer_EventType_CDMA_WT_DONE); break; + case OperationEventTypeEnum::OP_CDMA_DATA_DONE : protoConsumer->set_event(nvdla_prototest_interface::Consumer_EventType::Consumer_EventType_CDMA_DT_DONE); break; + case OperationEventTypeEnum::OP_COMPLETED : protoConsumer->set_event(nvdla_prototest_interface::Consumer_EventType::Consumer_EventType_OP_COMPLETED); break; + case OperationEventTypeEnum::OP_ENABLED : protoConsumer->set_event(nvdla_prototest_interface::Consumer_EventType::Consumer_EventType_OP_ENABLED); break; + case OperationEventTypeEnum::OP_PROGRAMMED : protoConsumer->set_event(nvdla_prototest_interface::Consumer_EventType::Consumer_EventType_OP_PROGRAMMED); break; + default: ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unrecognized consumer event"); + } + } + } + + switch(src_tsd->surfaceFormat().precision().v()) { + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_FP16 : protoSrcPrec = nvdla_prototest_interface::DataPrecision::PRECISION_FP16; break; + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16 : protoSrcPrec = nvdla_prototest_interface::DataPrecision::PRECISION_INT16; break; + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8 : protoSrcPrec = nvdla_prototest_interface::DataPrecision::PRECISION_INT8; break; + default: ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unrecognized src precision"); + } + + switch(dst_tsd->surfaceFormat().precision().v()) { + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_FP16 : protoDstPrec = nvdla_prototest_interface::DataPrecision::PRECISION_FP16; break; + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16 : protoDstPrec = nvdla_prototest_interface::DataPrecision::PRECISION_INT16; break; + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8 : protoDstPrec = nvdla_prototest_interface::DataPrecision::PRECISION_INT8; break; + default: ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unrecognized dst precision"); + } + + protoCDPOpDesc->set_in_precision(protoSrcPrec); + protoCDPOpDesc->set_out_precision(protoDstPrec); + protoCDPOpDesc->set_lut_index(*cdp_op.LUTIndex()); + protoCDPOpDesc->set_local_size(*cdp_op.localSize()); + protoCDPOpDesc->set_bypass_sqsum(*cdp_op.bypassSquareSum()); + protoCDPOpDesc->set_bypass_out_mul(*cdp_op.bypassOutMul()); + + protoCDPOpDesc->mutable_in_cvt()->set_enable(*in_cvt_acc.enable()); + protoCDPOpDesc->mutable_in_cvt()->set_offset(*in_cvt_acc.offset()); + protoCDPOpDesc->mutable_in_cvt()->set_scale(*in_cvt_acc.scale()); + protoCDPOpDesc->mutable_in_cvt()->set_truncate(*in_cvt_acc.truncate()); + + protoCDPOpDesc->mutable_out_cvt()->set_enable(*out_cvt_acc.enable()); + protoCDPOpDesc->mutable_out_cvt()->set_offset(*out_cvt_acc.offset()); + protoCDPOpDesc->mutable_out_cvt()->set_scale(*out_cvt_acc.scale()); + protoCDPOpDesc->mutable_out_cvt()->set_truncate(*out_cvt_acc.truncate()); + + protoSrcDataCube->set_type(nvdla_prototest_interface::MemType::DLA_MEM_MC); + protoSrcDataCube->set_address(*src_data_acc.address()); + protoSrcDataCube->set_size(src_tsd->tensorBufferDesc()->size() - src_tsd->bufferOffset()); + protoSrcDataCube->set_width(*src_data_acc.width()); + protoSrcDataCube->set_height(*src_data_acc.height()); + protoSrcDataCube->set_channel(*src_data_acc.channel()); + protoSrcDataCube->set_line_stride(*src_data_acc.lineStride()); + protoSrcDataCube->set_surf_stride(*src_data_acc.surfStride()); + protoSrcDataCube->set_plane_stride(*src_data_acc.planeStride()); + protoSrcDataCube->mutable_mem_info()->set_mem_id(src_tsd->tensorBufferDesc()->memoryId(batch_id)); + protoSrcDataCube->mutable_mem_info()->set_mem_size(src_tsd->tensorBufferDesc()->size()); + protoSrcDataCube->mutable_mem_info()->set_offset(src_tsd->bufferOffset()); + + protoDstDataCube->set_type(nvdla_prototest_interface::MemType::DLA_MEM_MC); + protoDstDataCube->set_address(*dst_data_acc.address()); + protoDstDataCube->set_size(dst_tsd->tensorBufferDesc()->size() - dst_tsd->bufferOffset()); + protoDstDataCube->set_width(*dst_data_acc.width()); + protoDstDataCube->set_height(*dst_data_acc.height()); + protoDstDataCube->set_channel(*dst_data_acc.channel()); + protoDstDataCube->set_line_stride(*dst_data_acc.lineStride()); + protoDstDataCube->set_surf_stride(*dst_data_acc.surfStride()); + protoDstDataCube->set_plane_stride(*dst_data_acc.planeStride()); + protoDstDataCube->mutable_mem_info()->set_mem_id(dst_tsd->tensorBufferDesc()->memoryId(batch_id)); + protoDstDataCube->mutable_mem_info()->set_mem_size(dst_tsd->tensorBufferDesc()->size()); + protoDstDataCube->mutable_mem_info()->set_offset(dst_tsd->bufferOffset()); + if (numConsumers == 0) { + protoDstDataCube->mutable_mem_info()->set_fill_type(nvdla_prototest_interface::FillerType::FILL_NONE); + protoDstDataCube->mutable_mem_info()->set_flag(nvdla_prototest_interface::MemFlag::DLA_MEM_OUTPUT); + protoDstDataCube->mutable_mem_info()->set_precision(protoDstPrec); + } +fail: + return e; +} +#endif + +}; // nvdla::priv::engine_ast:: +}; // nvdla::priv:: +}; // nvdla:: diff --git a/umd/core/src/compiler/engine-ast/CDPNode.cpp b/umd/core/src/compiler/engine-ast/CDPNode.cpp new file mode 100644 index 00000000..a5b5dcd0 --- /dev/null +++ b/umd/core/src/compiler/engine-ast/CDPNode.cpp @@ -0,0 +1,97 @@ +/* + * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#include + +#include "priv/EngineAST.h" +#include "priv/Profile.h" +#include "priv/Tensor.h" +#include "ErrorMacros.h" + +using std::endl; + +namespace nvdla +{ +namespace priv +{ + + +void engine_ast::CDPNode::captureCanonicalParams() +{ + +} + +NvDlaError engine_ast::CDPNode::verifySurfaceDims(surface::TensorSurfaceDesc* tsd) +{ + NvDlaError e = NvDlaSuccess; + + bool isSrcTSD = false; + bool isDstTSD = false; + surface::TensorSurfaceDesc* srcTSD = NULL; + surface::TensorSurfaceDesc* dstTSD = NULL; + + PROPAGATE_ERROR_FAIL(verifyEdgePorts()); + + isSrcTSD = inputEdges()[0]->tensorSurfaceDesc() == tsd; + isDstTSD = outputEdges()[0]->tensorSurfaceDesc() == tsd; + + if (!isSrcTSD && !isDstTSD) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "TSD %s doesn't belong to %s", tsd->id().c_str(), name().c_str()); + } + + srcTSD = isSrcTSD ? tsd : inputEdges()[0]->tensorSurfaceDesc(); + dstTSD = isDstTSD ? tsd : outputEdges()[0]->tensorSurfaceDesc(); + + if (srcTSD->dimensions() != dstTSD->dimensions()) + { + PROPAGATE_ERROR_FAIL(NvDlaError_BadValue, "(%s) Input and Output tensors should have the same dimensions", + name().c_str()); + } + +fail: + return e; +} + +/*------------------------------Handle Multi-Batch---------------------*/ +NvDlaError engine_ast::CDPNode::handleMultiBatch() +{ + NvDlaError e = NvDlaSuccess; + + //Handle operation parameters for the multi-batch operations + NvU32 numBatches = graph()->profile()->multiBatchSize(); + for (NvU32 nn = 1; nn < numBatches; ++nn) + { + params(nn) = params(0); + } + + return e; +} + +}; // nvdla::priv:: +}; // nvdla:: diff --git a/umd/core/src/compiler/engine-ast/CPUNode.cpp b/umd/core/src/compiler/engine-ast/CPUNode.cpp new file mode 100644 index 00000000..2c4fb4fb --- /dev/null +++ b/umd/core/src/compiler/engine-ast/CPUNode.cpp @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#include + +#include "priv/EngineAST.h" +#include "priv/Tensor.h" +#include "ErrorMacros.h" + +using std::endl; + +namespace nvdla +{ +namespace priv +{ + + /* Add cpu specific apis here */ + +}; // nvdla::priv:: +}; // nvdla:: diff --git a/umd/core/src/compiler/engine-ast/ConcatOp.cpp b/umd/core/src/compiler/engine-ast/ConcatOp.cpp new file mode 100644 index 00000000..b63faae0 --- /dev/null +++ b/umd/core/src/compiler/engine-ast/ConcatOp.cpp @@ -0,0 +1,887 @@ +/* + * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#include +#include + +#include "priv/EngineAST.h" +#include "priv/Profile.h" +#include "priv/Tensor.h" +#include "ErrorMacros.h" + +using std::endl; + +namespace nvdla +{ +namespace priv +{ + +void engine_ast::ConcatenationNode::captureCanonicalParams() +{ + // default to concat along Channel direction. + // TODO: For other modes, add support in network/layer and canonical ast too + params().setConcatAxis(ConcatAxisEnum::CONCAT_ALONG_C); +} + +// not idempotent since relies on some details canonical details +NvDlaError engine_ast::ConcatenationNode::populateEdgePorts() +{ + NvDlaError e = NvDlaSuccess; + + typedef engine_ast::Graph::EdgeSequence EngineEdges; + typedef engine_ast::Graph::EdgeSequenceIterator EngineEdgeIterator; + + typedef canonical_ast::Graph::EdgeSequence CanonicalEdges; + typedef canonical_ast::Graph::EdgeSequenceIterator CanonicalEdgeIterator; + + EngineEdges engInEdges = graph()->upstreamDataEdges(this); + EngineEdges engOutEdges = graph()->downstreamDataEdges(this); + + // if canonical equivalent exists, use order of i/o edge insertions in canonical land to establish strict order + if (canonicalNode()) + { + CanonicalEdges canInEdges = canonicalNode()->inputEdges(); + for (CanonicalEdgeIterator cei = canInEdges.begin(); cei != canInEdges.end(); ++cei) + { + IsSameCanonicalEdge match_can_edge(*cei); + EngineEdgeIterator eei = std::find_if(engInEdges.begin(), engInEdges.end(), match_can_edge); + if (eei == engInEdges.end()) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "%s is not an input edge to %s", (*eei)->id().c_str(), name().c_str()); + } + markInputEdge(*eei); + } + } + // else simply mark input edges in order of appearance + else + { + for (EngineEdgeIterator eei = engInEdges.begin(); eei != engInEdges.end(); ++eei) + { + markInputEdge(*eei); + } + } + + if (engOutEdges.size() > 1) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "%s has > 1 output edges", name().c_str()); + } + else + { + markOutputEdge(engOutEdges[0]); + } + + PROPAGATE_ERROR_FAIL(verifyEdgePorts()); + +fail: + return e; +} + +Dims4 engine_ast::ConcatenationNode::suggestSurfaceDims(surface::TensorSurfaceDesc* tsd) +{ + NvDlaError e = NvDlaSuccess; + + EdgeSequence inDataEdges; + bool isDstTSD = false; + bool isSrcTSD = false; + Edge* inputEdge = NULL; + Dims4 suggestedDims(-1,-1,-1,-1); + + PROPAGATE_ERROR_FAIL(verifyEdgePorts()); + + inDataEdges = inputEdges(); + + for (EdgeSequenceIterator iei = inDataEdges.begin(); iei != inDataEdges.end(); ++iei) + { + if ((*iei)->tensorSurfaceDesc() == tsd) + { + isSrcTSD = true; + inputEdge = *iei; + break; + } + } + isDstTSD = outputEdges()[0]->tensorSurfaceDesc() == tsd; + + if (!isSrcTSD && !isDstTSD) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "TSD %s doesn't belong to %s", tsd->id().c_str(), name().c_str()); + } + + // concat node doesn't affect any tensor dimensions, + // except just aggregating them from the upstream nodes. + // as a result, respect the suggested dims from upstream node if any + if (isSrcTSD) + { + suggestedDims = graph()->upstreamNodes(inputEdge)[0]->suggestSurfaceDims(tsd); + } + else + { + NvS32 sumConcatInHeight = 0; + NvS32 sumConcatInChannel = 0; + Dims4 inSurfDims; + Dims4 outSurfDims; + for (EdgeSequenceIterator iei = inDataEdges.begin(); iei != inDataEdges.end(); ++iei) + { + Node* srcNode = graph()->upstreamNodes(*iei).size() ? graph()->upstreamNodes(*iei)[0] : NULL; + if (srcNode) + { + inSurfDims = srcNode->suggestSurfaceDims((*iei)->tensorSurfaceDesc()); + } + else + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "No upstream node for input edge %s to node %s", + (*iei)->id().c_str(), name().c_str()); + } + + switch(params().concatAxis().v()) + { + case ConcatAxisEnum::CONCAT_ALONG_W: + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Don't yet support concat along Width direction for %s", + name().c_str()); + break; + case ConcatAxisEnum::CONCAT_ALONG_H: + sumConcatInHeight += inSurfDims.h; + outSurfDims.w = std::max(outSurfDims.w, inSurfDims.w); + outSurfDims.h = std::max(outSurfDims.h, sumConcatInHeight); + outSurfDims.c = std::max(outSurfDims.c, inSurfDims.c); + break; + case ConcatAxisEnum::CONCAT_ALONG_C: + sumConcatInChannel += inSurfDims.c; + outSurfDims.w = std::max(outSurfDims.w, inSurfDims.w); + outSurfDims.h = std::max(outSurfDims.h, inSurfDims.h); + outSurfDims.c = std::max(outSurfDims.c, sumConcatInChannel); + break; + default: + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Unknown concat mode %s", params().concatAxis().c_str()); + } + } + suggestedDims = outSurfDims; + } + +fail: + return suggestedDims; +} + +NvU32 engine_ast::ConcatenationNode::suggestLineStride(surface::TensorSurfaceDesc* tsd) +{ + NvDlaError e = NvDlaSuccess; + + NvU32 lineStride = 0; + EdgeSequence inDataEdges; + bool isDstTSD = false; + bool isSrcTSD = false; + surface::TensorSurfaceDesc* dstTSD = NULL; + ConcatenationNode* sinkConcat = NULL; + surface::TensorSurfaceDesc* currConcatOutTSD = NULL; + bool isConcatChain = false; + + PROPAGATE_ERROR_FAIL( verifyEdgePorts() ); + + if (m_nodeTSDLineStride.find(tsd) != m_nodeTSDLineStride.end()) + { + lineStride = m_nodeTSDLineStride[tsd]; + goto fail; + } + + isConcatChain = graph()->downstreamDataNodes(this).size() ? + graph()->downstreamDataNodes(this)[0]->engineType().v() == EngineTypeEnum::CONCATENATION : + false; + if (isConcatChain) + { + sinkConcat = NodeFactory::nodeCast(graph()->downstreamDataNodes(this)[0]); + currConcatOutTSD = outputEdges()[0]->tensorSurfaceDesc(); + lineStride = sinkConcat->suggestLineStride(currConcatOutTSD); + m_nodeTSDLineStride[tsd] = lineStride; + goto fail; + } + + inDataEdges = inputEdges(); + + for (EdgeSequenceIterator iei = inDataEdges.begin(); iei != inDataEdges.end(); ++iei) + { + if ((*iei)->tensorSurfaceDesc() == tsd) + { + isSrcTSD = true; + break; + } + } + isDstTSD = outputEdges()[0]->tensorSurfaceDesc() == tsd; + + if (!isSrcTSD && !isDstTSD) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "TSD %s doesn't belong to %s", tsd->id().c_str(), name().c_str()); + } + + dstTSD = isDstTSD ? tsd : outputEdges()[0]->tensorSurfaceDesc(); + + /* In DLA, a small cube can be read from/written to a larger cube + * provided the strides are programmed correctly. Concat is one such + * operation, where multiple smaller cubes can written into single + * larger output cube provided the strides of the larger cube are + * programmed into each of them. + */ + { + NvS32 sumConcatInWidth = 0; + NvS32 sumConcatInHeight = 0; + NvS32 sumConcatInChannel = 0; + Dims4 largeSurfDims; + surface::TensorSurfaceDesc tempConcatLargeSurface = *dstTSD; + for (EdgeSequenceIterator iei = inDataEdges.begin(); iei != inDataEdges.end(); ++iei) + { + Dims4 inSurfDims; + Node* srcNode = graph()->upstreamNodes(*iei).size() ? graph()->upstreamNodes(*iei)[0] : NULL; + if (srcNode) + { + inSurfDims = srcNode->suggestSurfaceDims((*iei)->tensorSurfaceDesc()); + } + else + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "No upstream node for input edge %s to node %s", + (*iei)->id().c_str(), name().c_str()); + } + + switch(params().concatAxis().v()) + { + case ConcatAxisEnum::CONCAT_ALONG_W: + sumConcatInWidth += inSurfDims.w; + largeSurfDims.w = std::max(largeSurfDims.w, sumConcatInWidth); + largeSurfDims.h = std::max(largeSurfDims.h, inSurfDims.h); + largeSurfDims.c = std::max(largeSurfDims.c, inSurfDims.c); + break; + case ConcatAxisEnum::CONCAT_ALONG_H: + sumConcatInHeight += inSurfDims.h; + largeSurfDims.w = std::max(largeSurfDims.w, inSurfDims.w); + largeSurfDims.h = std::max(largeSurfDims.h, sumConcatInHeight); + largeSurfDims.c = std::max(largeSurfDims.c, inSurfDims.c); + break; + case ConcatAxisEnum::CONCAT_ALONG_C: + sumConcatInChannel += inSurfDims.c; + largeSurfDims.w = std::max(largeSurfDims.w, inSurfDims.w); + largeSurfDims.h = std::max(largeSurfDims.h, inSurfDims.h); + largeSurfDims.c = std::max(largeSurfDims.c, sumConcatInChannel); + break; + default: + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Unknown concat mode %s", params().concatAxis().c_str()); + } + } + + tempConcatLargeSurface.setDimensions(largeSurfDims); + tempConcatLargeSurface.resetLineStride(); + lineStride = tempConcatLargeSurface.lineStride(); + } + + m_nodeTSDLineStride[tsd] = lineStride; + +fail: + return lineStride; +} + +NvU32 engine_ast::ConcatenationNode::suggestSurfaceStride(surface::TensorSurfaceDesc* tsd) +{ + NvDlaError e = NvDlaSuccess; + + NvU32 surfaceStride = 0; + EdgeSequence inDataEdges; + bool isDstTSD = false; + bool isSrcTSD = false; + bool isConcatChain = false; + ConcatenationNode* sinkConcat = NULL; + surface::TensorSurfaceDesc* currConcatOutTSD = NULL; + surface::TensorSurfaceDesc* dstTSD = NULL; + + PROPAGATE_ERROR_FAIL(verifyEdgePorts()); + + if (m_nodeTSDSurfaceStride.find(tsd) != m_nodeTSDSurfaceStride.end()) + { + surfaceStride = m_nodeTSDSurfaceStride[tsd]; + goto fail; + } + + isConcatChain = graph()->downstreamDataNodes(this).size() ? + graph()->downstreamDataNodes(this)[0]->engineType().v() == EngineTypeEnum::CONCATENATION : + false; + if (isConcatChain) + { + sinkConcat = NodeFactory::nodeCast(graph()->downstreamDataNodes(this)[0]); + currConcatOutTSD = outputEdges()[0]->tensorSurfaceDesc(); + surfaceStride = sinkConcat->suggestSurfaceStride(currConcatOutTSD); + m_nodeTSDSurfaceStride[tsd] = surfaceStride; + goto fail; + } + + inDataEdges = inputEdges(); + + for (EdgeSequenceIterator iei = inDataEdges.begin(); iei != inDataEdges.end(); ++iei) + { + if ((*iei)->tensorSurfaceDesc() == tsd) + { + isSrcTSD = true; + break; + } + } + isDstTSD = outputEdges()[0]->tensorSurfaceDesc() == tsd; + + if (!isSrcTSD && !isDstTSD) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "TSD %s doesn't belong to %s", tsd->id().c_str(), name().c_str()); + } + + dstTSD = isDstTSD ? tsd : outputEdges()[0]->tensorSurfaceDesc(); + + /* In DLA, a small cube can be read from/written to a larger cube + * provided the strides are programmed correctly. Concat is one such + * operation, where multiple smaller cubes can written into single + * larger output cube provided the strides of the larger cube are + * programmed into each of them. + */ + { + NvS32 sumConcatInWidth = 0; + NvS32 sumConcatInHeight = 0; + NvS32 sumConcatInChannel = 0; + Dims4 largeSurfDims; + surface::TensorSurfaceDesc tempConcatLargeSurface = *dstTSD; + for (EdgeSequenceIterator iei = inDataEdges.begin(); iei != inDataEdges.end(); ++iei) + { + Dims4 inSurfDims; + Node* srcNode = graph()->upstreamNodes(*iei).size() ? graph()->upstreamNodes(*iei)[0] : NULL; + if (srcNode) + { + inSurfDims = srcNode->suggestSurfaceDims((*iei)->tensorSurfaceDesc()); + } + else + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "No upstream node for input edge %s to node %s", + (*iei)->id().c_str(), name().c_str()); + } + + switch(params().concatAxis().v()) + { + case ConcatAxisEnum::CONCAT_ALONG_W: + sumConcatInWidth += inSurfDims.w; + largeSurfDims.w = std::max(largeSurfDims.w, sumConcatInWidth); + largeSurfDims.h = std::max(largeSurfDims.h, inSurfDims.h); + largeSurfDims.c = std::max(largeSurfDims.c, inSurfDims.c); + break; + case ConcatAxisEnum::CONCAT_ALONG_H: + sumConcatInHeight += inSurfDims.h; + largeSurfDims.w = std::max(largeSurfDims.w, inSurfDims.w); + largeSurfDims.h = std::max(largeSurfDims.h, sumConcatInHeight); + largeSurfDims.c = std::max(largeSurfDims.c, inSurfDims.c); + break; + case ConcatAxisEnum::CONCAT_ALONG_C: + sumConcatInChannel += inSurfDims.c; + largeSurfDims.w = std::max(largeSurfDims.w, inSurfDims.w); + largeSurfDims.h = std::max(largeSurfDims.h, inSurfDims.h); + largeSurfDims.c = std::max(largeSurfDims.c, sumConcatInChannel); + break; + default: + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Unknown concat mode %s", params().concatAxis().c_str()); + } + } + + tempConcatLargeSurface.setDimensions(largeSurfDims); + tempConcatLargeSurface.resetSurfaceStride(); + surfaceStride = tempConcatLargeSurface.surfaceStride(); + } + + m_nodeTSDSurfaceStride[tsd] = surfaceStride; + +fail: + return surfaceStride; +} + +NvU64 engine_ast::ConcatenationNode::suggestSurfaceSize(surface::TensorSurfaceDesc* tsd) +{ + NvDlaError e = NvDlaSuccess; + + NvU64 size = 0; + EdgeSequence inDataEdges; + bool isDstTSD = false; + bool isSrcTSD = false; + surface::TensorSurfaceDesc* dstTSD = NULL; + + PROPAGATE_ERROR_FAIL(verifyEdgePorts()); + + if (m_nodeTSDSurfaceSize.find(tsd) != m_nodeTSDSurfaceSize.end()) + { + size = m_nodeTSDSurfaceSize[tsd]; + goto fail; + } + + inDataEdges = inputEdges(); + + for (EdgeSequenceIterator iei = inDataEdges.begin(); iei != inDataEdges.end(); ++iei) + { + if ((*iei)->tensorSurfaceDesc() == tsd) + { + isSrcTSD = true; + break; + } + } + isDstTSD = outputEdges()[0]->tensorSurfaceDesc() == tsd; + + if (!isSrcTSD && !isDstTSD) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "TSD %s doesn't belong to %s", tsd->id().c_str(), name().c_str()); + } + + dstTSD = isDstTSD ? tsd : outputEdges()[0]->tensorSurfaceDesc(); + + { + NvS32 sumConcatInWidth = 0; + NvS32 sumConcatInHeight = 0; + NvS32 sumConcatInChannel = 0; + Dims4 largeSurfDims; + NvS32 requestedEdgeWidth = 0; + NvS32 requestedEdgeHeight = 0; + NvS32 requestedEdgeChnls = 0; + surface::TensorSurfaceDesc tempConcatLargeSurface = *dstTSD; + for (EdgeSequenceIterator iei = inDataEdges.begin(); iei != inDataEdges.end(); ++iei) + { + Dims4 inSurfDims; + Node* srcNode = graph()->upstreamNodes(*iei).size() ? graph()->upstreamNodes(*iei)[0] : NULL; + if (srcNode) + { + inSurfDims = srcNode->suggestSurfaceDims((*iei)->tensorSurfaceDesc()); + } + else + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "No upstream node for input edge %s to node %s", + (*iei)->id().c_str(), name().c_str()); + } + + switch(params().concatAxis().v()) + { + case ConcatAxisEnum::CONCAT_ALONG_W: + sumConcatInWidth += inSurfDims.w; + largeSurfDims.w = std::max(largeSurfDims.w, sumConcatInWidth); + largeSurfDims.h = std::max(largeSurfDims.h, inSurfDims.h); + largeSurfDims.c = std::max(largeSurfDims.c, inSurfDims.c); + if ((*iei)->tensorSurfaceDesc() == tsd) + { + requestedEdgeWidth = inSurfDims.w; + } + break; + case ConcatAxisEnum::CONCAT_ALONG_H: + sumConcatInHeight += inSurfDims.h; + largeSurfDims.w = std::max(largeSurfDims.w, inSurfDims.w); + largeSurfDims.h = std::max(largeSurfDims.h, sumConcatInHeight); + largeSurfDims.c = std::max(largeSurfDims.c, inSurfDims.c); + if ((*iei)->tensorSurfaceDesc() == tsd) + { + requestedEdgeHeight = inSurfDims.h; + } + break; + case ConcatAxisEnum::CONCAT_ALONG_C: + sumConcatInChannel += inSurfDims.c; + largeSurfDims.w = std::max(largeSurfDims.w, inSurfDims.w); + largeSurfDims.h = std::max(largeSurfDims.h, inSurfDims.h); + largeSurfDims.c = std::max(largeSurfDims.c, sumConcatInChannel); + if ((*iei)->tensorSurfaceDesc() == tsd) + { + requestedEdgeChnls = inSurfDims.c; + } + break; + default: + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Unknown concat mode %s", params().concatAxis().c_str()); + } + } + + // if size for an individual smaller input edge is requested, then ensure to use + // the #chnls/width/height represented by just that edge + if (isSrcTSD) + { + switch(params().concatAxis().v()) + { + case ConcatAxisEnum::CONCAT_ALONG_W: largeSurfDims.w = requestedEdgeWidth; break; + case ConcatAxisEnum::CONCAT_ALONG_H: largeSurfDims.h = requestedEdgeHeight; break; + case ConcatAxisEnum::CONCAT_ALONG_C: largeSurfDims.c = requestedEdgeChnls; break; + } + } + + tempConcatLargeSurface.setDimensions(largeSurfDims); + tempConcatLargeSurface.resetSize(); + size = tempConcatLargeSurface.size(); + } + + m_nodeTSDSurfaceSize[tsd] = size; + +fail: + return size; +} + +NvU64 engine_ast::ConcatenationNode::suggestOffsetInConcatChain(surface::TensorSurfaceDesc* inTSD) +{ + NvDlaError e = NvDlaSuccess; + NVDLA_UNUSED(e); + NvU64 offsetInCommonBuff = 0; + bool isConcatChain = graph()->downstreamDataNodes(this).size() ? + graph()->downstreamDataNodes(this)[0]->engineType().v() == EngineTypeEnum::CONCATENATION : + false; + if (isConcatChain) + { + ConcatenationNode* sinkConcat = NodeFactory::nodeCast(graph()->downstreamDataNodes(this)[0]); + surface::TensorSurfaceDesc* currConcatOutTSD = outputEdges()[0]->tensorSurfaceDesc(); + offsetInCommonBuff += sinkConcat->suggestOffsetInConcatChain(currConcatOutTSD); + } + else + { + EdgeSequence inEdges = inputEdges(); + for (EdgeSequenceIterator iei = inEdges.begin(); iei != inEdges.end(); ++iei) + { + if ((*iei)->tensorSurfaceDesc() == inTSD) + { + break; + } + else + { + Dims4 inSurfDims; + Node* srcNode = graph()->upstreamNodes(*iei).size() ? graph()->upstreamNodes(*iei)[0] : NULL; + if (srcNode) + { + inSurfDims = srcNode->suggestSurfaceDims((*iei)->tensorSurfaceDesc()); + } + else + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "No upstream node for input edge %s to node %s", + (*iei)->id().c_str(), name().c_str()); + } + + switch (params().concatAxis().v()) + { + case ConcatAxisEnum::CONCAT_ALONG_W: + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Don't support concat along W dimension yet for %s", name().c_str()); + break; + case ConcatAxisEnum::CONCAT_ALONG_H: + offsetInCommonBuff += (*iei)->tensorSurfaceDesc()->lineStride() * inSurfDims.h; + break; + case ConcatAxisEnum::CONCAT_ALONG_C: + offsetInCommonBuff += (*iei)->tensorSurfaceDesc()->size(); + break; + default: + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Unknown concat mode for %s", name().c_str()); + } + } + } + } + +fail: + return offsetInCommonBuff; +} + +NvU64 engine_ast::ConcatenationNode::suggestSurfaceOffsetInBuffer(surface::TensorSurfaceDesc* tsd) +{ + NvDlaError e = NvDlaSuccess; + + NvU64 offsetInCommonBuff = 0; + bool isDstTSD = false; + bool isSrcTSD = false; + EdgeSequence outEdges; + EdgeSequence inEdges; + + PROPAGATE_ERROR_FAIL(verifyEdgePorts()); + + if (m_nodeTSDSurfaceOffsetInBuffer.find(tsd) != m_nodeTSDSurfaceOffsetInBuffer.end()) + { + offsetInCommonBuff = m_nodeTSDSurfaceOffsetInBuffer[tsd]; + goto fail; + } + + outEdges = outputEdges(); + inEdges = inputEdges(); + + for (EdgeSequenceIterator iei = inEdges.begin(); iei != inEdges.end(); ++iei) + { + if ((*iei)->tensorSurfaceDesc() == tsd) + { + isSrcTSD = true; + break; + } + } + isDstTSD = outputEdges()[0]->tensorSurfaceDesc() == tsd; + + if (!isSrcTSD && !isDstTSD) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "TSD %s doesn't belong to %s", tsd->id().c_str(), name().c_str()); + } + + if (isSrcTSD) + { + EdgeSequenceIterator iei; + for (iei = inEdges.begin(); iei != inEdges.end(); ++iei) + { + if ((*iei)->tensorSurfaceDesc() == tsd) + { + break; + } + else + { + Dims4 inSurfDims; + Node* srcNode = graph()->upstreamNodes(*iei).size() ? graph()->upstreamNodes(*iei)[0] : NULL; + if (srcNode) + { + inSurfDims = srcNode->suggestSurfaceDims((*iei)->tensorSurfaceDesc()); + } + else + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "No upstream node for input edge %s to node %s", + (*iei)->id().c_str(), name().c_str()); + } + + switch (params().concatAxis().v()) + { + case ConcatAxisEnum::CONCAT_ALONG_W: + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Don't support concat along W dimension yet for %s", name().c_str()); + break; + case ConcatAxisEnum::CONCAT_ALONG_H: + offsetInCommonBuff += (suggestLineStride((*iei)->tensorSurfaceDesc()) * inSurfDims.h); + break; + case ConcatAxisEnum::CONCAT_ALONG_C: + offsetInCommonBuff += suggestSurfaceSize((*iei)->tensorSurfaceDesc()); + break; + default: + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Unknown concat mode for %s", name().c_str()); + } + } + } + // add to the calculated offset, the offset of the output edge since it could be part of a larger buffer + offsetInCommonBuff += suggestSurfaceOffsetInBuffer(outputEdges()[0]->tensorSurfaceDesc()); + + if ( debugConcat() ) + { + gLogInfo << "(" << name() << ") input edge " << (*iei)->id() + << "(" << tsd->dimensions().c << "x" << tsd->dimensions().h << "x" << tsd->dimensions().w << ")" + << " is at offset " << offsetInCommonBuff + << " in its buffer: " << (tsd->tensorBufferDesc() ? tsd->tensorBufferDesc()->id() : "TBR") << endl; + } + } + else if (isDstTSD) + { + offsetInCommonBuff = 0; + // if output of concat is part of a downstream concat, it may be at a non-0 offset in the + // revalent buffer; return presiding buffer offset in that case + bool isConcatChain = graph()->downstreamDataNodes(this).size() ? + graph()->downstreamDataNodes(this)[0]->engineType().v() == EngineTypeEnum::CONCATENATION : + false; + if (isConcatChain) + { + ConcatenationNode* sinkConcat = NodeFactory::nodeCast(graph()->downstreamDataNodes(this)[0]); + surface::TensorSurfaceDesc* currConcatDstTSD = tsd; + offsetInCommonBuff = sinkConcat->suggestOffsetInConcatChain(currConcatDstTSD); + } + else + { + offsetInCommonBuff = 0; + } + + if ( debugConcat() ) + { + gLogInfo << "(" << name() << ") output edge " << outputEdges().at(0)->id() + << "(" << tsd->dimensions().c << "x" << tsd->dimensions().h << "x" << tsd->dimensions().w << ")" + << " is at offset " << offsetInCommonBuff + << " in its buffer: " << (tsd->tensorBufferDesc() ? tsd->tensorBufferDesc()->id() : "TBR") << endl; + } + } + + m_nodeTSDSurfaceOffsetInBuffer[tsd] = offsetInCommonBuff; + +fail: + return offsetInCommonBuff; +} + +memory::TensorBufferDesc* engine_ast::ConcatenationNode::suggestBuffer(surface::TensorSurfaceDesc* tsd) +{ + NvDlaError e = NvDlaSuccess; + memory::TensorBufferDesc* commonTBD = NULL; + bool isDstTSD = false; + bool isSrcTSD = false; + EdgeSequence outEdges; + EdgeSequence inEdges; + NvU16 numBatches = graph()->profile()->multiBatchSize(); + + PROPAGATE_ERROR_FAIL(verifyEdgePorts()); + + outEdges = outputEdges(); + inEdges = inputEdges(); + + for (EdgeSequenceIterator iei = inEdges.begin(); iei != inEdges.end(); ++iei) + { + if ((*iei)->tensorSurfaceDesc() == tsd) + { + isSrcTSD = true; + break; + } + } + isDstTSD = outputEdges()[0]->tensorSurfaceDesc() == tsd; + + if (!isSrcTSD && !isDstTSD) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "TSD %s doesn't belong to %s", tsd->id().c_str(), name().c_str()); + } + else if ( tsd->tensorCategory().v() == memory::TensorCategoryEnum::UNKNOWN_TENSOR ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Edge %s has 'unknown' tensor category", + tsd->id().c_str()); + } + + // hunt across all edges to find a common TBD if any was registered before + commonTBD = isDstTSD ? tsd->tensorBufferDesc() : outputEdges()[0]->tensorBufferDesc(); + if ( !commonTBD ) + { + for (EdgeSequenceIterator iei = inEdges.begin(); iei != inEdges.end(); ++iei) + { + if ((*iei)->tensorBufferDesc()) + { + commonTBD = (*iei)->tensorBufferDesc(); + break; + } + } + } + + if ( !commonTBD ) + { + commonTBD = graph()->resourceMgr()->regTensorBufferDesc(numBatches); + } + +fail: + return commonTBD; +} + +/* A concat-node could be receiving inputs from operations following different + * limitations (For eg: some of the upstream ops could be winograd and some not). + * Hence accomodate the worst case scenarios to perform this check + */ +NvDlaError engine_ast::ConcatenationNode::verifySurfaceIsPartOfConcat +( + surface::TensorSurfaceDesc* srcTSD, + surface::TensorSurfaceDesc* dstTSD, + engine_ast::ConcatAxis axis +) +{ + NvDlaError e = NvDlaSuccess; + Dims4 srcDims = suggestSurfaceDims(srcTSD); + Dims4 dstDims = suggestSurfaceDims(dstTSD); + + if (axis.v() == engine_ast::ConcatAxisEnum::CONCAT_ALONG_C) + { + /* some of the src tensors could be smaller in WxH than the dst + * if at least one of the concat participants is Winogradable + */ + if (srcDims.w > dstDims.w || srcDims.h > dstDims.h) + { + gLogError << "In-" << srcTSD->id() << " WxH : " + << srcDims.w << "x" << srcDims.h << endl; + gLogError << "Out-" << dstTSD->id() << " WxH : " + << dstDims.w << "x" << dstDims.h << endl; + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "(%s) Concat along C should have " + "WxH of all input edges <= that of the output tensor", name().c_str()); + } + } + else if (axis.v() == engine_ast::ConcatAxisEnum::CONCAT_ALONG_H) + { + if (srcDims.w != dstDims.w || srcDims.c != dstDims.c) + { + gLogError << "In-" << srcTSD->id() << " WxC : " + << srcDims.w << "x" << srcDims.c << endl; + gLogError << "Out-" << dstTSD->id() << " WxC : " + << dstDims.w << "x" << dstDims.c << endl; + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "(%s) Concat along H should have " + "all edges of the same WxC", name().c_str()); + } + } + else if (axis.v() == engine_ast::ConcatAxisEnum::CONCAT_ALONG_W) + { + if (srcDims.h != dstDims.h || srcDims.c != dstDims.c) + { + gLogError << "In-" << srcTSD->id() << " HxC : " + << srcDims.h << "x" << srcDims.c << endl; + gLogError << "Out-" << dstTSD->id() << " HxC : " + << dstDims.h << "x" << dstDims.c << endl; + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "(%s) Concat along W should have " + "all edges of the same HXC", name().c_str()); + } + } + else + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Unknown concat axis: %s", axis.c_str()); + } + +fail: + return e; +} + +NvDlaError engine_ast::ConcatenationNode::verifySurfaceDims(surface::TensorSurfaceDesc* tsd) +{ + NvDlaError e = NvDlaSuccess; + + EdgeSequence inDataEdges; + bool isSrcTSD = false; + bool isDstTSD = false; + surface::TensorSurfaceDesc* srcTSD = NULL; + surface::TensorSurfaceDesc* dstTSD = NULL; + + PROPAGATE_ERROR_FAIL(verifyEdgePorts()); + + inDataEdges = inputEdges(); + + for (EdgeSequenceIterator iei = inDataEdges.begin(); iei != inDataEdges.end(); ++iei) + { + if ((*iei)->tensorSurfaceDesc() == tsd) + { + isSrcTSD = true; + break; + } + } + isDstTSD = outputEdges()[0]->tensorSurfaceDesc() == tsd; + + if (!isSrcTSD && !isDstTSD) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "TSD %s doesn't belong to %s", tsd->id().c_str(), name().c_str()); + } + + srcTSD = isSrcTSD ? tsd : NULL; + dstTSD = isDstTSD ? tsd : outputEdges()[0]->tensorSurfaceDesc(); + + if (isSrcTSD) + { + PROPAGATE_ERROR_FAIL( verifySurfaceIsPartOfConcat(srcTSD, dstTSD, params().concatAxis()) ); + } + else + { + for (EdgeSequenceIterator iei = inDataEdges.begin(); iei != inDataEdges.end(); ++iei) + { + surface::TensorSurfaceDesc* srcTSD = (*iei)->tensorSurfaceDesc(); + PROPAGATE_ERROR_FAIL( verifySurfaceIsPartOfConcat(srcTSD, dstTSD, params().concatAxis()) ); + } + } + +fail: + return e; +} + +}; // nvdla::priv:: +}; // nvdla:: diff --git a/umd/core/src/compiler/engine-ast/ConvCoreNode.cpp b/umd/core/src/compiler/engine-ast/ConvCoreNode.cpp new file mode 100644 index 00000000..c804acc6 --- /dev/null +++ b/umd/core/src/compiler/engine-ast/ConvCoreNode.cpp @@ -0,0 +1,2837 @@ +/* + * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#include +#include +#include // ceilf + +#include "priv/EngineAST.h" +#include "priv/Tensor.h" +#include "priv/Profile.h" +#include "priv/TargetConfig.h" +#include "priv/WeightTranslationUnit.h" +#include "ErrorMacros.h" + +using std::endl; +using std::min; +using std::vector; + +namespace nvdla +{ +namespace priv +{ + +engine_ast::SDPNode* engine_ast::ConvCoreNode::addSDPJointOpNode +( + canonical_ast::Node* origCanNode +) +{ + NvDlaError e = NvDlaSuccess; + Tensor* streamTensor; + engine_ast::SDPNode* sdpJointNode = NULL; + canonical_ast::Graph* canGraph = origCanNode->graph(); + + if (origCanNode->params().hasBiasTerm()) + { + sdpJointNode = engine_ast::NodeFactory::newSDPBiasOpNode(origCanNode, graph()); + engine_ast::NodeFactory::nodeCast(sdpJointNode)->params().setHasBiasReduction(false); + } + else if (graph()->profile()->computePrecision().v() == surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8) + { + Dims4 scaleDims(1,1,1,1); + NvF32* procScaleBlob; + Weights rawScaleData; + SDPMode scaleMode; + + if ( graph()->profile()->quantizationMode().v() == nvdla::QuantizationMode::PER_KERNEL ) + { + rawScaleData.count = 1; + scaleMode = engine_ast::SDPModeEnum::SDP_MODE_PER_LAYER; + } + else if ( graph()->profile()->quantizationMode() == nvdla::QuantizationMode::PER_FILTER ) + { + Tensor* inTensor = NULL; + inTensor = origCanNode->outputEdges().at(0)->originalTensor(); + scaleDims.c = inTensor->getDimensions().c; + rawScaleData.count = inTensor->getDimensions().c; + scaleMode = engine_ast::SDPModeEnum::SDP_MODE_PER_CHANNEL; + } + else + { + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Don't support quantization mode: %s\n", + graph()->profile()->quantizationMode().c_str()); + } + + procScaleBlob = (NvF32*)engine_ast::MemoryCollector::getInstance()->allocateMemory(rawScaleData.count * sizeof(NvF32)); + memset(procScaleBlob, 0.0, rawScaleData.count * sizeof(NvF32)); + rawScaleData.values = procScaleBlob; + rawScaleData.type = nvdla::DataType::FLOAT; + + for (int i = 0; i < rawScaleData.count; i++) + { + procScaleBlob[i] = 1.0f; + } + + // no canonical scale ancestor + sdpJointNode = engine_ast::NodeFactory::newSDPScaleOpNode(NULL, graph()); + + engine_ast::NodeFactory::nodeCast(sdpJointNode)->params().x1Params().setMode(scaleMode); + engine_ast::NodeFactory::nodeCast(sdpJointNode)->params().setScaleDims(scaleDims); + engine_ast::NodeFactory::nodeCast(sdpJointNode)->params().setRawScaleData(rawScaleData); + engine_ast::NodeFactory::nodeCast(sdpJointNode)->params().setDLAScaleData(Weights(DataType::FLOAT, NULL, 0)); + + PROPAGATE_ERROR_FAIL(engine_ast::NodeFactory::nodeCast(sdpJointNode)->captureCanonicalScaleData()); + } + else + { + sdpJointNode = engine_ast::NodeFactory::newSDPNOPNode(origCanNode, graph()); + } + + if ( !sdpJointNode ) + { + goto fail; + } + + // cache the dimensions of output tensor of parent node + streamTensor = canGraph->downstreamEdges(origCanNode).at(0)->originalTensor()->clone(); + streamTensor->setTensorType(TensorType::kSTREAM); + + // connect either of the sdp nodes to the conv node, using an edge which + // represents a tensor on wire, we call it a stream tensor, whose dims are same as + // the orig o/p tensor of parent conv node, although no buffers would be reserved + // for it during runtime + graph()->addDataEdge((canonical_ast::Edge*)0, this, sdpJointNode, streamTensor); + +fail: + return sdpJointNode; +} + +engine_ast::SDPNode* engine_ast::ConvCoreNode::addSDPJointOpNode +( + SDPNode* copyFromSDP +) +{ + NvDlaError e = NvDlaSuccess; + Edge* sdpInEdge; + Tensor *streamTensor; + engine_ast::SDPNode* sdpJointNode = NULL; + NVDLA_UNUSED(e); + + switch(copyFromSDP->engineOpType().v()) + { + case EngineOpTypeEnum::SDP_ACTIVATION: + sdpJointNode = NodeFactory::newSDPActivationOpNode( + canonical_ast::NodeFactory::nodeCast(copyFromSDP->canonicalNode()), + copyFromSDP->graph()); + NodeFactory::nodeCast(sdpJointNode)->inheritParams(copyFromSDP); + break; + case EngineOpTypeEnum::SDP_BATCH_NORM: + sdpJointNode = NodeFactory::newSDPBatchNormOpNode( + canonical_ast::NodeFactory::nodeCast(copyFromSDP->canonicalNode()), + copyFromSDP->graph()); + NodeFactory::nodeCast(sdpJointNode)->inheritParams(copyFromSDP); + break; + case EngineOpTypeEnum::SDP_BIAS: + sdpJointNode = NodeFactory::newSDPBiasOpNode(copyFromSDP->canonicalNode(), copyFromSDP->graph()); + NodeFactory::nodeCast(sdpJointNode)->inheritParams(copyFromSDP); + break; + case EngineOpTypeEnum::SDP_NOP: + sdpJointNode = NodeFactory::newSDPNOPNode(copyFromSDP->canonicalNode(), copyFromSDP->graph()); + NodeFactory::nodeCast(sdpJointNode)->inheritParams(copyFromSDP); + break; + case EngineOpTypeEnum::SDP_SCALE: + sdpJointNode = NodeFactory::newSDPScaleOpNode( + canonical_ast::NodeFactory::nodeCast(copyFromSDP->canonicalNode()), + copyFromSDP->graph()); + NodeFactory::nodeCast(sdpJointNode)->inheritParams(copyFromSDP); + break; + case EngineOpTypeEnum::SDP_SUPER: + //FIXME + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Don't support SDP node type %s as joint op of CONV %s", + copyFromSDP->engineOpType().c_str(), name().c_str()); + //engine_ast::Graph::printGraph(graph(), true, "addSDPJointOpNode"); + //sdpJointNode = NodeFactory::newSDPSuperOpNode(copyFromSDP->canonicalNode(), copyFromSDP->graph()); + //NodeFactory::nodeCast(sdpJointNode)->inheritParams(copyFromSDP); + break; + default: + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Don't support SDP node type %s as joint op of CONV %s", + copyFromSDP->engineOpType().c_str(), name().c_str()); + } + + if ( !sdpJointNode ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_InsufficientMemory); + } + + copyFromSDP->nodeDataEdge(TensorType::kSTREAM, ast::EdgeSideEnum::SECOND, &sdpInEdge); + streamTensor = sdpInEdge->originalTensor()->clone(); + streamTensor->setTensorType(TensorType::kSTREAM); + + graph()->addDataEdge((canonical_ast::Edge*)0, this, sdpJointNode, streamTensor); + +fail: + return sdpJointNode; +} + + +NvDlaError engine_ast::ConvCoreNode::nodeAuxEdge(engine_ast::Edge **ret_edge) +{ + NvDlaError e = NvDlaSuccess; + + PROPAGATE_ERROR_FAIL(nodeDataEdge(TensorType::kWEIGHT, ast::EdgeSideEnum::SECOND, ret_edge)); + +fail: + return e; +} + +std::vector engine_ast::ConvCoreNode::suggestAuxSurfaceFormats(engine_ast::Edge* auxEdge) +{ + NvDlaError e = NvDlaSuccess; + NVDLA_UNUSED(e); + // dumb suggestion logic for now + surface::SurfaceFormat inputSF; + surface::SurfaceCategory inputCategory; + surface::SurfacePrecision compPrec = graph()->profile()->computePrecision(); + std::vector supportedAuxSFs = supportedAuxSurfFormats(); + std::vector suggestedAuxSFs; + std::vector::iterator auxSFIter; + + /* if input surface format is not yet registered, chose a default */ + inputSF = inputEdges()[0]->tensorSurfaceDesc() ? + inputEdges()[0]->tensorSurfaceDesc()->surfaceFormat() : + surface::SurfaceFormatEnum::NVDLA_UNKNOWN_FORMAT; + inputCategory = inputSF.v() != surface::SurfaceFormatEnum::NVDLA_UNKNOWN_FORMAT ? + inputSF.category() : + surface::SurfaceCategoryEnum::FEATURE_DATA; + + if (supportedAuxSFs.size() == 0) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "No supported aux surface formats for %s", name().c_str()); + } + else if (supportedAuxSFs.size() == 1) + { + suggestedAuxSFs = supportedAuxSFs; + goto fail; + } + + for (auxSFIter = supportedAuxSFs.begin(); auxSFIter != supportedAuxSFs.end(); ++auxSFIter) + { + if ((*auxSFIter).precision().v() != compPrec.v()) + { + continue; + } + + if (params().convMode().v() == ConvolutionModeEnum::CONV_WINOGRAD) + { + if (std::string((*auxSFIter).c_str()).find("WG") == std::string::npos) + { + continue; + } + else + { + suggestedAuxSFs.push_back(*auxSFIter); + } + } + else + { + if (inputCategory.v() == surface::SurfaceCategoryEnum::IMG && + std::string((*auxSFIter).c_str()).find("IMG") == std::string::npos) + { + continue; + } + else if (inputCategory.v() == surface::SurfaceCategoryEnum::FEATURE_DATA && + std::string((*auxSFIter).c_str()).find("DC") == std::string::npos) + { + continue; + } + else + { + suggestedAuxSFs.push_back(*auxSFIter); + } + } + } + + + if (suggestedAuxSFs.size() == 0) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "No suggested aux surface formats for node:%s", name().c_str()); + } + +fail: + return suggestedAuxSFs; +} + +/*------------------Suggest Dims/Strides/Size/Buffer-Offset------------------*/ +/* + * DLA-CONV engine works on IMG and FEATURE_DATA input in either + * DC or Winograd mode; whereas DC has no special stride/size alignment + * requirements, Winograd mode needs perfect x(4x4) input and output + * surfaces. This means tweaking input/output surface dims whenever + * we want to chose WG. + * But, code emission layer finally takes care of adjusting dims, the compiler + * here should only accommodate for the larger stride/size requirements. + */ +Dims4 engine_ast::ConvCoreNode::suggestSurfaceDims(surface::TensorSurfaceDesc* tsd) +{ + NvDlaError e = NvDlaSuccess; + bool isSrcTSD = false; + bool isAuxTSD = false; + bool isDstTSD = false; + Dims4 suggestedDims(-1,-1,-1,-1); + + PROPAGATE_ERROR_FAIL( verifyEdgePorts() ); + + isSrcTSD = inputEdges()[0]->tensorSurfaceDesc() == tsd; + isAuxTSD = auxEdges()[0]->tensorSurfaceDesc() == tsd; + isDstTSD = outputEdges()[0]->tensorSurfaceDesc() == tsd; + + if (!isSrcTSD && !isAuxTSD && !isDstTSD) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "TSD %s doesn't belong to %s", tsd->id().c_str(), name().c_str()); + } + + if (isSrcTSD) + { + // src tensor for dc/wg has no special requirements; + // inherit the suggested dims from upstream node if any + Node* srcNode = graph()->upstreamNodes(inputEdges()[0]).size() ? + graph()->upstreamNodes(inputEdges()[0])[0] : NULL; + if (srcNode) + { + suggestedDims = srcNode->suggestSurfaceDims(inputEdges()[0]->tensorSurfaceDesc()); + } + else + { + suggestedDims = tsd->dimensions(); + } + } + else + { + if (params().convMode().v() == ConvolutionModeEnum::CONV_WINOGRAD) + { + if (isAuxTSD) + { + // aux tensor for wg has special requirements + suggestedDims = params().winogradParams().auxDims; + } + else if (isDstTSD) + { + // dst tensor for wg has special requirements + suggestedDims = params().winogradParams().outDims; + } + } + else if (params().convMode().v() == ConvolutionModeEnum::CONV_DIRECT) + { + suggestedDims = tsd->dimensions(); + } + else + { + REPORT_ERROR(NvDlaError_BadValue, "Unknown conv mode for %s", name().c_str()); + } + } + +fail: + return suggestedDims; +} + +NvU32 engine_ast::ConvCoreNode::suggestLineStride(surface::TensorSurfaceDesc* tsd) +{ + NvDlaError e = NvDlaSuccess; + NvU32 lineStride = 0; + + PROPAGATE_ERROR_FAIL( verifyEdgePorts() ); + + if (m_nodeTSDLineStride.find(tsd) != m_nodeTSDLineStride.end()) + { + lineStride = m_nodeTSDLineStride[tsd]; + goto fail; + } + + { + surface::TensorSurfaceDesc probeTSD = *tsd; + Dims4 surfDims = suggestSurfaceDims(tsd); + probeTSD.setDimensions(surfDims); + probeTSD.resetLineStride(); + lineStride = probeTSD.lineStride(); + } + + m_nodeTSDLineStride[tsd] = lineStride; + +fail: + return lineStride; +} + +NvU32 engine_ast::ConvCoreNode::suggestSurfaceStride(surface::TensorSurfaceDesc* tsd) +{ + NvDlaError e = NvDlaSuccess; + NvU32 surfaceStride = 0; + + PROPAGATE_ERROR_FAIL( verifyEdgePorts() ); + + if (m_nodeTSDSurfaceStride.find(tsd) != m_nodeTSDSurfaceStride.end()) + { + surfaceStride = m_nodeTSDSurfaceStride[tsd]; + goto fail; + } + + { + surface::TensorSurfaceDesc probeTSD = *tsd; + Dims4 surfDims = suggestSurfaceDims(tsd); + probeTSD.setDimensions(surfDims); + probeTSD.resetSurfaceStride(); + surfaceStride = probeTSD.surfaceStride(); + } + + m_nodeTSDSurfaceStride[tsd] = surfaceStride; + +fail: + return surfaceStride; +} + +NvU64 engine_ast::ConvCoreNode::suggestSurfaceSize(surface::TensorSurfaceDesc* tsd) +{ + NvDlaError e = NvDlaSuccess; + NvU64 size = 0; + + PROPAGATE_ERROR_FAIL( verifyEdgePorts() ); + + if (m_nodeTSDSurfaceSize.find(tsd) != m_nodeTSDSurfaceSize.end()) + { + size = m_nodeTSDSurfaceSize[tsd]; + goto fail; + } + + { + surface::TensorSurfaceDesc probeTSD = *tsd; + Dims4 surfDims = suggestSurfaceDims(tsd); + probeTSD.setDimensions(surfDims); + probeTSD.resetSize(); + size = probeTSD.size(); + } + + m_nodeTSDSurfaceSize[tsd] = size; + +fail: + return size; +} + +NvU64 engine_ast::ConvCoreNode::suggestSurfaceOffsetInBuffer(surface::TensorSurfaceDesc* tsd) +{ + NvDlaError e = NvDlaSuccess; + NvU64 offset = 0; + bool isSrcTSD = false; + bool isDstTSD = false; + bool isAuxTSD = false; + Node* srcNode = NULL; + + PROPAGATE_ERROR_FAIL( verifyEdgePorts() ); + + if (m_nodeTSDSurfaceOffsetInBuffer.find(tsd) != m_nodeTSDSurfaceOffsetInBuffer.end()) + { + offset = m_nodeTSDSurfaceOffsetInBuffer[tsd]; + goto fail; + } + + isSrcTSD = inputEdges()[0]->tensorSurfaceDesc() == tsd; + isDstTSD = outputEdges()[0]->tensorSurfaceDesc() == tsd; + isAuxTSD = auxEdges()[0]->tensorSurfaceDesc() == tsd; + + if (!isSrcTSD && !isAuxTSD && !isDstTSD) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "TSD %s doesn't belong to %s", tsd->id().c_str(), name().c_str()); + } + + if (isAuxTSD) + { + offset = 0; + } + else if (isSrcTSD) + { + srcNode = graph()->upstreamDataNodes(this).size() ? graph()->upstreamDataNodes(this)[0] : NULL; + if (srcNode && srcNode->engineType().v() == EngineTypeEnum::SPLIT) + { + SplitNode* splitNode = NodeFactory::nodeCast(srcNode); + // fixme: this kind of diving catches can be avoided if slice Ids are maintained inside tsd + switch(splitNode->params().splitAxis().v()) + { + case SplitAxisEnum::SPLIT_ALONG_W: + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Don't yet support conv split-w mode for %s", + name().c_str()); + break; + case SplitAxisEnum::SPLIT_ALONG_H: + // in case of split along Height direction, use the calculated info + offset = splitDataInfo().inputBufferOffset; + break; + case SplitAxisEnum::SPLIT_ALONG_C: + // in case of split along Chnl direction, let the split node decide suitable surface offset + offset = splitNode->suggestSurfaceOffsetInBuffer(tsd); + break; + case SplitAxisEnum::SPLIT_ALONG_NONE: + // split-along-none is a pass through + offset = 0; + break; + default: + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Unknown split type for %s", + splitNode->name().c_str()); + } + } + else + { + offset = 0; + } + } + else if (isDstTSD) + { + offset = splitDataInfo().outputBufferOffset; + } + + m_nodeTSDSurfaceOffsetInBuffer[tsd] = offset; + +fail: + return offset; +} + +NvDlaError engine_ast::ConvCoreNode::verifySurfaceDims(surface::TensorSurfaceDesc* tsd) +{ + NvDlaError e = NvDlaSuccess; + + NvU16 bpe; + Dims4 auxDims; + bool isSrcTSD = false; + bool isDstTSD = false; + bool isAuxTSD = false; + surface::TensorSurfaceDesc* srcTSD = NULL; + surface::TensorSurfaceDesc* auxTSD = NULL; + surface::TensorSurfaceDesc* dstTSD = NULL; + + PROPAGATE_ERROR_FAIL(verifyEdgePorts()); + + isSrcTSD = inputEdges()[0]->tensorSurfaceDesc() == tsd; + isDstTSD = outputEdges()[0]->tensorSurfaceDesc() == tsd; + isAuxTSD = auxEdges()[0]->tensorSurfaceDesc() == tsd; + + if (!isSrcTSD && !isAuxTSD && !isDstTSD) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "TSD %s doesn't belong to %s", tsd->id().c_str(), name().c_str()); + } + + bpe = tsd->surfaceFormat().bytesPerElement(); + srcTSD = isSrcTSD ? tsd : inputEdges()[0]->tensorSurfaceDesc(); + auxTSD = isAuxTSD ? tsd : auxEdges()[0]->tensorSurfaceDesc(); + dstTSD = isDstTSD ? tsd : outputEdges()[0]->tensorSurfaceDesc(); + + auxDims = suggestSurfaceDims(auxTSD); + + if (isSrcTSD || isAuxTSD) + { + if (params().convMode().v() == ConvolutionModeEnum::CONV_WINOGRAD) + { + NvU32 wtCForWG = auxDims.c; + if (((auxDims.c * bpe) % 32) != 0 ) + { + wtCForWG = auxDims.c + (32 - ((auxDims.c * bpe) % 32))/bpe; + } + + if (wtCForWG != (NvU32)params().winogradParams().auxDims.c) + { + PROPAGATE_ERROR_FAIL(NvDlaError_BadValue, "(%s) #Channels determind is wrong: %d != %d", + name().c_str(), + wtCForWG, + params().winogradParams().auxDims.c); + } + else if (wtCForWG != (NvU32)params().winogradParams().inDims.c) + { + PROPAGATE_ERROR_FAIL(NvDlaError_BadValue, "(%s) Aux and Input tensors should have the same number of channels: %d != %d", + name().c_str(), + wtCForWG, + params().winogradParams().inDims.c); + } + } + else if (params().convMode().v() == ConvolutionModeEnum::CONV_DIRECT) + { + if (srcTSD->surfaceFormat().category().v() == surface::SurfaceCategoryEnum::FEATURE_DATA) + { + NvS32 auxChnls = params().numGroups() * auxTSD->dimensions().c; + NvS32 dataChnls = srcTSD->dimensions().c; + if (auxChnls != dataChnls) + { + PROPAGATE_ERROR_FAIL(NvDlaError_BadValue, "(%s) Aux and Input tensors should have the same number of channels: %d != %d", + name().c_str(), + auxChnls, + dataChnls); + } + } + /* Note that: + * for IMG input, aux_data is re-arranged with mandatory pre-chnl-extension so that + * (C_ext = C_orig * W_orig) and (W_ext = 1) + * ...there's no way to get back C_orig from C_ext since W and H can be different (rectangular kernels) + */ + } + else + { + PROPAGATE_ERROR_FAIL(NvDlaError_BadValue, "Unknown conv mode for %s", name().c_str()); + } + } + else + { + if (auxTSD->dimensions().n != dstTSD->dimensions().c) { + PROPAGATE_ERROR_FAIL(NvDlaError_BadValue, "(%s) Aux and Output tensors should have the same number of kernels: %d != %d", + name().c_str(), + auxTSD->dimensions().n, + dstTSD->dimensions().c); + } + } + +fail: + return e; +} + +// uncomment for debugging +#if 0 +static bool printKCRS(Weights kernel, Dims4 kernelDims, NvS32 kernelIdx) +{ + bool printAll = kernelIdx == -1; + + for (unsigned kk = (printAll ? 0 : kernelIdx); kk <= (unsigned)(printAll ? kernelDims.n - 1 : kernelIdx); ++kk) + { + for (unsigned cc = 0; cc < (unsigned)kernelDims.c; ++cc) + { + NvDlaDebugPrintf("[%d, %d]:\n",kk, cc); + for (unsigned rr = 0; rr < (unsigned)kernelDims.h; ++rr) + { + for (unsigned ss = 0; ss < (unsigned)kernelDims.w; ++ss) + { + if (kernel.type == nvdla::DataType::FLOAT) + { + float* pWts = reinterpret_cast(const_cast(kernel.values)); + float val = pWts[ss + + kernelDims.w*(rr + + kernelDims.h*(cc + + kernelDims.c*(kk)))]; + NvDlaDebugPrintf("%.4f, ", val); + } + else if (kernel.type == nvdla::DataType::INT8) + { + NvS8* pWts = reinterpret_cast(const_cast(kernel.values)); + NvS8 val = pWts[ss + + kernelDims.w*(rr + + kernelDims.h*(cc + + kernelDims.c*(kk)))]; + NvDlaDebugPrintf("%4d, ", val); + } + else + { + NvDlaDebugPrintf("FIXME: add support to print %d\n", (int)kernel.type); + } + } + NvDlaDebugPrintf("\n"); + } + } + } + return true; +} +#endif + +NvDlaError engine_ast::ConvCoreNode::quantizeAuxData() +{ + NvDlaError e = NvDlaSuccess; + + Edge* auxEdge = NULL; + surface::SurfacePrecision computePrecision = graph()->profile()->computePrecision(); + Weights origWtsBlob = params().rawWeights(); + Weights quantizedWtsBlob; + NvS8* quantizedWts = NULL; + std::vector filterScales; + + NvU32 G = params().numGroups(); + NvU32 K = params().weightDims().n / G; + NvU32 C = params().weightDims().c / G; + NvU32 RS = params().weightDims().h * params().weightDims().w; // per-group values + NvU32 kStride = C * RS; + NvU32 cStride = RS; + + PROPAGATE_ERROR_FAIL( verifyEdgePorts() ); + + auxEdge = auxEdges().at(0); + + // quantize weights iff computing in low precision + if (computePrecision.v() != surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8) + { + // nop + goto fail; + } + // if caffe weights are already int8, then there's no need for quantization + else if (params().rawWeights().type == nvdla::DataType::INT8) + { + // nop + goto fail; + } + // if surface precision for aux edge is not int8, then there's no need for quantization + else if (auxEdge->tensorSurfaceDesc()->surfaceFormat().f().precision().v() != + surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8) + { + goto fail; + } + // if already quantized, return + else if ( params().filterScales().size() ) + { + // might be already quantized and rearranged with pre/post Chnl Ext for IMG Conv, + // no more quantization needed + goto fail; + } + + // not yet support weight quantization for group convolutions + if (params().numGroups() != 1) + { + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Don't support weight quantization for group convolutions yet for %s\n", + name().c_str()); + } + + quantizedWts = reinterpret_cast(std::malloc(origWtsBlob.count * sizeof(NvS8))); + + if (graph()->profile()->quantizationMode() == nvdla::QuantizationMode::PER_KERNEL) + { + PRECISION_SWITCH(origWtsBlob.type.v(), computePrecision.v(), filterScales, WeightTrns::perKernelQuantizeWts, + origWtsBlob, + G, K, C, RS, kStride, cStride, + quantizedWts); + if ( filterScales.size() ) + { + params().setFilterScales(filterScales); + } + else + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Something went wrong with wt quantization for %s\n", + name().c_str()); + } + } + else if (graph()->profile()->quantizationMode() == nvdla::QuantizationMode::PER_FILTER) + { + PRECISION_SWITCH(origWtsBlob.type.v(), computePrecision.v(), filterScales, WeightTrns::perFilterQuantizeWts, + origWtsBlob, + G, K, C, RS, kStride, cStride, + quantizedWts); + if ( filterScales.size() ) + { + params().setFilterScales(filterScales); + } + else + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Something went wrong with wt quantization for %s\n", + name().c_str()); + } + } + else + { + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Quantization mode %s not supported", + graph()->profile()->quantizationMode().c_str()); + } + + quantizedWtsBlob.type = DataType::INT8; + quantizedWtsBlob.values = quantizedWts; + quantizedWtsBlob.count = origWtsBlob.count; + + params().setRawWeights(quantizedWtsBlob); + +fail: + return e; +} + +/* + * Mandatory pre-channel extension for IMG Convolution + */ +NvDlaError engine_ast::ConvCoreNode::mandatoryChnlExtForIMG() +{ + NvDlaError e = NvDlaSuccess; + + Edge* auxEdge = NULL; + Edge* dataInputEdge = NULL; + + Dims4 rawWtDims; + Dims4 preChnlExtDims; + Dims4 zeroPadDims; + Dims4 dataInputDims; + Weights rawWts; + Weights zeroPadWts; + Weights preChnlExtWts; + WeightTrns::WeightDims rawWtTrnsDims; + WeightTrns::WeightDims zeroPadWtTrnsDims; + WeightTrns::WeightDims preChnlExtWtTrnsDims; + + surface::SurfacePrecision computePrecision = graph()->profile()->computePrecision(); + + PROPAGATE_ERROR_FAIL( verifyEdgePorts() ); + + dataInputEdge = inputEdges().at(0); + auxEdge = auxEdges().at(0); + + rawWts = params().rawWeights(); + dataInputDims = dataInputEdge->tensorSurfaceDesc()->dimensions(); + rawWtDims = auxEdge->tensorSurfaceDesc()->dimensions(); + rawWtTrnsDims = WeightTrns::WeightDims(rawWts.count, + rawWtDims.n, rawWtDims.c, rawWtDims.w, rawWtDims.h, + (int)params().stride().w, (int)params().stride().h); + + // default initialization so that it doesn't fail in Chnl Extn stage if Zero-padding was not required + zeroPadWts = rawWts; + zeroPadDims = rawWtDims; + zeroPadWtTrnsDims = rawWtTrnsDims; + + /* Step-1: Zero padding */ + if (rawWtDims.c != dataInputDims.c) + { + zeroPadWtTrnsDims = WeightTrns::WeightDims(rawWts.count * dataInputDims.c / rawWtDims.c, + rawWtDims.n, dataInputDims.c, rawWtDims.w, rawWtDims.h, + (int)params().stride().w, (int)params().stride().h); + PRECISION_SWITCH(rawWts.type.v(), computePrecision.v(), zeroPadWts, WeightTrns::zeroPadWtsForIMG, + rawWtTrnsDims, + zeroPadWtTrnsDims, + rawWts); + if (zeroPadWts.values == NULL) + { + PROPAGATE_ERROR_FAIL(NvDlaError_BadValue, "Zero padding failed for weights of node '%s'", name().c_str()); + } + zeroPadDims = Dims4(zeroPadWtTrnsDims.numKernels, zeroPadWtTrnsDims.numChannels, + zeroPadWtTrnsDims.height, zeroPadWtTrnsDims.width); + auxEdge->tensorSurfaceDesc()->setDimensions(zeroPadDims); + + // update raw weights to the zero padded weights + params().setRawWeights(zeroPadWts); + } + + /* Step-2: Mandatory pre-channel extension */ + preChnlExtWtTrnsDims = WeightTrns::WeightDims(zeroPadWts.count, + zeroPadDims.n, (zeroPadDims.c * zeroPadDims.w), 1, zeroPadDims.h, + (int)params().stride().w, (int)params().stride().h); + PRECISION_SWITCH(rawWts.type.v(), computePrecision.v(), preChnlExtWts, WeightTrns::preChnlExtWtsForIMG, + zeroPadWtTrnsDims, + preChnlExtWtTrnsDims, + zeroPadWts); + + if (preChnlExtWts.values == NULL) + { + PROPAGATE_ERROR_FAIL(NvDlaError_BadValue, "IMG channel pre-extension failed for weights of node '%s'", name().c_str()); + } + + preChnlExtDims = Dims4(preChnlExtWtTrnsDims.numKernels, preChnlExtWtTrnsDims.numChannels, + preChnlExtWtTrnsDims.height, preChnlExtWtTrnsDims.width); + auxEdge->tensorSurfaceDesc()->setDimensions(preChnlExtDims); + + // update raw weights to the pre-channel-extended weights + params().setRawWeights(preChnlExtWts); + +fail: + return e; +} + +/* + * Optional post-channel extension for IMG convolution for higher MAC utilization + */ +NvDlaError engine_ast::ConvCoreNode::optionalChnlExtForIMG() +{ + NvDlaError e = NvDlaSuccess; + + Edge* auxEdge = NULL; + Edge* dataInputEdge = NULL; + Dims4 preChnlExtDims; + Dims4 dataInputDims; + + NvU32 postExtFactor = 0; + NvU32 preChnlExtWtChnls = 0; + NvU32 zeroPaddedWtChnls = 0; + NvU32 origWtWidth = params().weightDims().w; + NvU32 convXStride = params().stride().w; + + Weights preChnlExtWts = params().rawWeights(); + Weights postChnlExtWts; + + WeightTrns::WeightDims preChnlExtWtTrnsDims; + surface::SurfacePrecision computePrecision = graph()->profile()->computePrecision(); + ConvCoreConvolutionOpNode* imgConvNode = NodeFactory::nodeCast(this); + NvU32 atomicCSize = graph()->target_config()->atomicCSize(); + NvU32 atomicKSize = graph()->target_config()->atomicKSize(); + NvU32 cbufWidth = graph()->target_config()->bufEntryWidth(); + + PROPAGATE_ERROR_FAIL( verifyEdgePorts() ); + + dataInputEdge = inputEdges().at(0); + auxEdge = auxEdges().at(0); + + dataInputDims = dataInputEdge->tensorSurfaceDesc()->dimensions(); + preChnlExtDims = auxEdge->tensorSurfaceDesc()->dimensions(); + + preChnlExtWtChnls = preChnlExtDims.c; + zeroPaddedWtChnls = dataInputDims.c; // after pre-chnl extension, wts are padded with extra chnls to match data-in chnls + + if ( convXStride > origWtWidth ) + { + gLogWarning << "Weight Post-Chnl Extension not possible when conv_x_stride (" << convXStride + << ") > orig_kernel_width (" << origWtWidth << ")" << endl; + imgConvNode->params().setPostExtension(0); + goto fail; + } + + if ( (zeroPaddedWtChnls * convXStride * 3 + preChnlExtWtChnls) <= atomicCSize && + preChnlExtWtChnls <= atomicCSize/4 ) + { + postExtFactor = 4; + } + else if ( (zeroPaddedWtChnls * convXStride + preChnlExtWtChnls) <= atomicCSize && + preChnlExtWtChnls <= atomicCSize/2 ) + { + postExtFactor = 2; + } + else + { + postExtFactor = 0; + } + + if ( postExtFactor != 0 ) + { + bool postChnlExtWtsSuccess = false; + preChnlExtWtTrnsDims = WeightTrns::WeightDims(preChnlExtWts.count, + preChnlExtDims.n, + preChnlExtDims.c, + 1, + preChnlExtDims.h, + (int)params().stride().w, (int)params().stride().h); + PRECISION_SWITCH(preChnlExtWts.type.v(), computePrecision.v(), postChnlExtWts, WeightTrns::postChnlExtWtsForIMG, + preChnlExtWtTrnsDims, + preChnlExtWts, + postExtFactor, + postChnlExtWtsSuccess, + atomicKSize, + atomicCSize, + cbufWidth); + if (!postChnlExtWtsSuccess) + { + gLogWarning << "Unable to do IMG channel post-extension for weights of node '" + << name() << "', proceed without channel post-extension" << endl; + } + else + { + // update DLA weights to the post-channel-extended weights; no more remapping needed + params().setDLAWeights(postChnlExtWts); + imgConvNode->params().setPostExtension(postExtFactor); + } + } + +fail: + return e; +} + +NvDlaError engine_ast::ConvCoreNode::processWtsForIMG() +{ + NvDlaError e = NvDlaSuccess; + + PROPAGATE_ERROR_FAIL( mandatoryChnlExtForIMG() ); + + if ( graph()->profile()->canIMGPostChnlExtend() ) + { + PROPAGATE_ERROR_FAIL( optionalChnlExtForIMG() ); + } + +fail: + return e; +} + +NvDlaError engine_ast::ConvCoreNode::squashWeightGroups() +{ + NvDlaError e = NvDlaSuccess; + + // group conv is implemented by splitting kernel groups into separate kernels + // change kernel channel size to input data channel size + // change num of kernels to num of groups + NvU32 numGroups = params().numGroups(); + + bool isIMGConv = false; + Edge* dataInputEdge = NULL; + Edge* auxEdge = NULL; + + Weights origWts; + Weights groupedWts; + WeightTrns::WeightDims origWtTrnsDims; + WeightTrns::WeightDims groupedWtDims; + + Dims4 origWtDims; + Dims4 groupedDims; + Dims4 dataInputDims; + + surface::SurfacePrecision computePrecision = graph()->profile()->computePrecision(); + + PROPAGATE_ERROR_FAIL( verifyEdgePorts() ); + + dataInputEdge = inputEdges()[0]; + auxEdge = auxEdges()[0]; + dataInputDims = dataInputEdge->tensorSurfaceDesc()->dimensions(); + isIMGConv = dataInputEdge->tensorSurfaceDesc()->surfaceFormat().category() == surface::SurfaceCategoryEnum::IMG; + + origWts = params().rawWeights(); + origWtDims = auxEdge->tensorSurfaceDesc()->dimensions(); + origWtTrnsDims = WeightTrns::WeightDims(origWts.count, origWtDims.n, origWtDims.c, origWtDims.w, origWtDims.h, + (int)params().stride().w, (int)params().stride().h); + + if (isIMGConv) + { + /* + * For image convolution, DLA supports channel size of 3 or 4, if actual + * input channel size is 2 or 3 then application will pad 0s to make + * channel size as 4. But number of groups are not updated, it requires + * updating number of groups too. + * + * 1. num channels 1, remains channel 1, not group conv NA + * 2. num channels 2, extended to channels 4 + * - case 1 : num channels for weight = 1, no issue here + * - case 2 : num channels for weight = 2, not group conv, NA + * 3. num channels 3, extended to channels 4 + * - case 1 : num channels for weight = 1, no issue here + * - case 2 : num channels for weight = 2, invalid case, neither group conv + * - case 3 : num channels for weight = 3, not group conv, NA + * 4. num channels 4, no extension + * - case 1 : num channels for weight = 1, no issue here + * - case 2 : num channels for weight = 2, no issue here + * - case 3 : num channels for weight = 3, invalid case, neither group conv + * - case 4 : num channels for weight = 4, not group conv, NA + */ + if ((dataInputDims.c % origWtDims.c) != 0) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Input channel size is not divisible by kernel channel size"); + } + numGroups = dataInputDims.c / origWtDims.c; + } + + groupedWtDims = WeightTrns::WeightDims(origWts.count * numGroups, + origWtDims.n, dataInputDims.c, origWtDims.w, origWtDims.h, + (int)params().stride().w, (int)params().stride().h); + + PRECISION_SWITCH(origWts.type.v(), computePrecision.v(), groupedWts, WeightTrns::padGroupWeights, + origWtTrnsDims, + groupedWtDims, + origWts, + params().numGroups()); + + if (groupedWts.values == NULL) + { + PROPAGATE_ERROR_FAIL(NvDlaError_BadValue, "Splitting weights failed for weights of node '%s'", name().c_str()); + } + + groupedDims = Dims4(groupedWtDims.numKernels, groupedWtDims.numChannels, + groupedWtDims.height, groupedWtDims.width); + auxEdge->tensorSurfaceDesc()->setDimensions(groupedDims); + + params().setRawWeights(groupedWts); + params().setNumGroups(1); + +fail: + return e; +} + +/*--------------------Pre-process Weight Data--------------------------*/ +/* Weight data for IMG convolution needs mandatory channel pre-extension + * and optional channel post-extension. + */ +NvDlaError engine_ast::ConvCoreNode::preProcessAuxData() +{ + NvDlaError e = NvDlaSuccess; + + bool isIMGConv = false; + Edge* dataInputEdge = NULL; + + PROPAGATE_ERROR_FAIL( verifyEdgePorts() ); + + dataInputEdge = inputEdges()[0]; + isIMGConv = dataInputEdge->tensorSurfaceDesc()->surfaceFormat().category() == surface::SurfaceCategoryEnum::IMG; + + // dilation is not possible with IMG convolution + if (isIMGConv && (params().dilation().h > 1 || params().dilation().w > 1)) + { + PROPAGATE_ERROR_FAIL(NvDlaError_NotSupported, "Dilation with image convolution is not supported\n"); + } + + // quantize weights if img Conv, since int8 weights have to undergo + // pre and/or post Chnl Ext for IMG Conv + if (isIMGConv) + { + PROPAGATE_ERROR_FAIL( quantizeAuxData() ); + } + + // pre-process weights for grouped DC/WG/Deconv convolutions + if (params().numGroups() != 1) + { + PROPAGATE_ERROR_FAIL( squashWeightGroups() ); + + } + + // pre-process weights for IMG convolution + if (isIMGConv) + { + PROPAGATE_ERROR_FAIL( processWtsForIMG() ); + } + + +fail: + return e; +} + +/*----------------------Combine Similar Math Ops-----------------------*/ +engine_ast::Node* engine_ast::ConvCoreNode::mergeWithSDPOp(SDPNode* nextSDP) +{ + Node* removableNode = NULL; + + if (nextSDP->engineOpType().v() == EngineOpTypeEnum::SDP_SCALE) + { + removableNode = tryToMergeWithScaleOp(nextSDP); + } + else if (nextSDP->engineOpType().v() == EngineOpTypeEnum::SDP_BATCH_NORM) + { + removableNode = tryToMergeWithBatchNormOp(nextSDP); + } + + return removableNode; +} + +engine_ast::Node* engine_ast::ConvCoreNode::tryToMergeWithScaleOp(SDPNode* SDPSclOp) +{ + Node* removableNode = NULL; + SDPScaleOpNode* scaleOp = NodeFactory::nodeCast(SDPSclOp); + Weights rawKrnlWts = params().rawWeights(); + Weights rawSclData = scaleOp->params().rawScaleData(); + Dims4 krnlWtDims = params().weightDims(); + Dims4 sclDims = scaleOp->params().scaleDims(); + SDPMode sclMode = scaleOp->params().x1Params().mode(); + Weights combinedWtsAndScaleData; + WeightTrns wtTrns; + + nvdla::DataType modelPrec = rawKrnlWts.type == rawSclData.type ? + rawKrnlWts.type : + nvdla::DataType::UNKNOWN; + surface::SurfacePrecision computePrec = graph()->profile()->computePrecision(); + + NodeSequence scaleOpDownNodes; + NodeSequenceIterator dni; + NodeWithSameEngineType match_eng_type(EngineTypeEnum::SDP); + + if (!graph()->profile()->canSDPMergeMathOps()) + { + goto fail; + } + + // if there's no more SDP operations following the Scale Op, avoid the fusion since + // the Conv Op will need an SDP write out proxy + scaleOpDownNodes = graph()->downstreamDataNodes(scaleOp); + dni = std::find_if(scaleOpDownNodes.begin(), scaleOpDownNodes.end(), match_eng_type); + if (dni == scaleOpDownNodes.end()) + { + goto fail; + } + // if there's a ReLU op after the scale, don't allow the conv+scale fusion since + // the scale is a proxy node to perform the int8 rescaling before the relu op + else if (graph()->profile()->computePrecision() == surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8 && + scaleOpDownNodes.size() && + scaleOpDownNodes.at(0)->engineOpType() == engine_ast::EngineOpTypeEnum::SDP_ACTIVATION) + { + goto fail; + } + // if there's a ELTwise op after the scale, don't allow the conv+scale fusion since + // the scale is a proxy node to perform the int8 rescaling before the EW op. since + // the thread with which EW x2 fusion might happen is unknown, avoid the conv+scale fusion on all threads + else if (graph()->profile()->computePrecision() == surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8 && + scaleOpDownNodes.size() && + scaleOpDownNodes.at(0)->engineOpType() == engine_ast::EngineOpTypeEnum::SDP_ELEMENTWISE) + { + goto fail; + } + + // xxx: skip if the dla weights are already arranged. plugging scale factors will be difficult now + if ( params().DLAWeights().values != NULL ) + { + goto fail; + } + + PRECISION_SWITCH(modelPrec.v(), computePrec.v(), combinedWtsAndScaleData, + wtTrns.combineKernelWeightsAndScaleData, + sclMode, + krnlWtDims, + sclDims, + rawKrnlWts, + rawSclData); + if (combinedWtsAndScaleData.values == NULL) + { + if ( debugFactorization() ) + { + gLogWarning << "Can't successfully combine Kernel weights and Scale factors of " + << name() << " and " << scaleOp->name() << endl; + } + goto fail; + } + + params().setRawWeights(combinedWtsAndScaleData); + removableNode = scaleOp; + +fail: + return removableNode; +} + +engine_ast::Node* engine_ast::ConvCoreNode::tryToMergeWithBatchNormOp(SDPNode* SDPBnOp) +{ + NvDlaError e = NvDlaSuccess; + Node* removableNode = NULL; + SDPBatchNormOpNode* bnOp = NodeFactory::nodeCast(SDPBnOp); + Weights rawKrnlWts = params().rawWeights(); + Dims4 krnlWtDims = params().weightDims(); + Weights rawMeanData = bnOp->params().rawMeanData(); + Weights rawVarData = bnOp->params().rawVarianceData(); + Dims4 bnDims = bnOp->params().batchNormDims(); + SDPMode bnMode = bnOp->params().x1Params().mode(); + SDPActType bnAct = bnOp->params().x1Params().actType(); + Weights combinedWtsAndVarianceData; + Weights combinedMeanAndVarData; + WeightTrns wtTrns; + NVDLA_UNUSED(e); + + nvdla::DataType modelPrec = rawKrnlWts.type == rawVarData.type ? + rawKrnlWts.type : + nvdla::DataType::UNKNOWN; + surface::SurfacePrecision computePrec = graph()->profile()->computePrecision(); + WeightTrns::WeightDims wtTrnsDims (rawVarData.count, bnDims.n, bnDims.c, bnDims.w, bnDims.h, 1, 1); + + if (!graph()->profile()->canSDPMergeMathOps()) + { + goto fail; + } + + // xxx: skip if the dla weights are already arranged. plugging BN factors will be difficult now + if ( params().DLAWeights().values != NULL ) + { + goto fail; + } + + PRECISION_SWITCH(modelPrec.v(), computePrec.v(), combinedWtsAndVarianceData, + wtTrns.combineKernelWeightsAndScaleData, + bnMode, + krnlWtDims, + bnDims, + rawKrnlWts, + rawVarData); + if (combinedWtsAndVarianceData.values == NULL) + { + if ( debugFactorization() ) + { + gLogWarning << "Can't successfully combine Kernel weights and Scale factors of " + << name() << " and " << bnOp->name() << endl; + } + goto fail; + } + + PRECISION_SWITCH(modelPrec.v(), computePrec.v(), combinedMeanAndVarData, + wtTrns.combineMultiplicationFactors, + bnMode, + wtTrnsDims, + rawMeanData, + rawVarData); + + if (combinedMeanAndVarData.values == NULL) + { + if ( debugFactorization() ) + { + gLogWarning << "Can't successfully combine Variance and Scale factors of " + << name() << " and " << bnOp->name() << endl; + } + goto fail; + } + + { + NodeSequence substituteNodes; + SDPBiasOpNode* newBiasReplaceNode = NULL; + + /* Step-1: Substitute BN with Bias node */ + newBiasReplaceNode = NodeFactory::newSDPBiasOpNode(NULL, graph()); + if ( !newBiasReplaceNode) + { + ORIGINATE_ERROR_FAIL(NvDlaError_InsufficientMemory, "Couldn't create new Bias op for replacing %s", + bnOp->name().c_str()); + } + newBiasReplaceNode->params().x1Params().setMode(bnMode); + newBiasReplaceNode->params().x1Params().setActType(bnAct); + newBiasReplaceNode->params().setBiasDims(bnDims); + newBiasReplaceNode->params().setRawBiasData(combinedMeanAndVarData); + newBiasReplaceNode->params().setDLABiasData(Weights(DataType::FLOAT, NULL, 0)); + PROPAGATE_ERROR_FAIL(newBiasReplaceNode->captureCanonicalBiasData()); + + /* Step-2: Transfer the (w/v) factors to the existing Conv node */ + params().setRawWeights(combinedWtsAndVarianceData); + + /* Step-3: Substitute the BN node with Bias node */ + substituteNodes.push_back(newBiasReplaceNode); + PROPAGATE_ERROR_FAIL(graph()->substituteNodeInAST(bnOp, substituteNodes)); + + /* Step-4: Since Bias is replacing BN, inherit the op mode from the BN node before its removed*/ + newBiasReplaceNode->params().setConvMode(bnOp->params().convMode()); + newBiasReplaceNode->params().setWinogradParams(bnOp->params().winogradParams()); + + /* Step-5: Finally remove the BN node */ + removableNode = bnOp; + + if ( graph()->debugMathOptz() ) + { + gLogInfo << "Replace " << bnOp->name() << " with " << newBiasReplaceNode->name() << endl; + } + } + +fail: + return removableNode; +} + +/*------------------Low Precision Conversions--------------------------*/ +NvDlaError engine_ast::ConvCoreNode::handleLowPrecisionConversions() +{ + NvDlaError e = NvDlaSuccess; + ConvCoreCVTParams convCvt; + PrecisionCVTParams inCvt; + + if ( graph()->profile()->computePrecision().v() != surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8 ) + { + // nop + goto fail; + } + else if ( graph()->profile()->tensorScalingMode().v() != nvdla::TensorScalingMode::PER_TENSOR ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Don't support tensor scaling mode: %s\n", + graph()->profile()->tensorScalingMode().c_str()); + } + else if ( graph()->profile()->quantizationMode().v() != nvdla::QuantizationMode::PER_KERNEL && + graph()->profile()->quantizationMode().v() != nvdla::QuantizationMode::PER_FILTER ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Don't support quantization mode: %s\n", + graph()->profile()->quantizationMode().c_str()); + } + + inCvt.setEnable(1); + inCvt.setScale(1); + inCvt.setOffset(0); + inCvt.setTruncate(0); + + convCvt.setInputCVT(inCvt); + convCvt.setOutTruncate(0); + convCvt.setPraTruncate(0); + + params().setConvCoreCVT(convCvt); + +fail: + return e; +} + +/*----------------------Weight Translation ----------------------------*/ +NvDlaError engine_ast::ConvCoreNode::translateAuxData() +{ + NvDlaError e = NvDlaSuccess; + + bool isIMGConv = false; + Edge* dataInputEdge = NULL; + Edge* auxEdge = NULL; + surface::SurfacePrecision computePrecision; + NvU32 atomicCSize = 0; + NvU32 atomicKSize = 0; + NvU32 cbufWidth = 0; + + PROPAGATE_ERROR_FAIL( verifyEdgePorts() ); + + computePrecision = graph()->profile()->computePrecision(); + atomicCSize = graph()->target_config()->atomicCSize(); + atomicKSize = graph()->target_config()->atomicKSize(); + cbufWidth = graph()->target_config()->bufEntryWidth(); + + dataInputEdge = inputEdges()[0]; + auxEdge = auxEdges()[0]; + + isIMGConv = dataInputEdge->tensorSurfaceDesc()->surfaceFormat().category() == surface::SurfaceCategoryEnum::IMG; + if (isIMGConv && NodeFactory::nodeCast(this)->params().postExtension() > 0) + { + // when post chnl extension is done for IMG conv, weights are already remapped. No need to remap them again + ASSERT(params().DLAWeights().values != NULL); + goto fail; + } + + { + Weights trnsKrnlWts; + Weights rawKrnlWts = params().rawWeights(); + + if ( graph()->debugWeights() ) + { + gLogInfo << "translating weights for " << id() << " kernel-dims kcrs = " << + auxEdge->tensorSurfaceDesc()->dimensions().n << "," << + auxEdge->tensorSurfaceDesc()->dimensions().c << "," << + auxEdge->tensorSurfaceDesc()->dimensions().h << "," << + auxEdge->tensorSurfaceDesc()->dimensions().w << "" << + " and size= " << rawKrnlWts.count << endl; + } + + + WeightTrns::WeightDims kernelDims (rawKrnlWts.count, + auxEdge->tensorSurfaceDesc()->dimensions().n, + auxEdge->tensorSurfaceDesc()->dimensions().c, + auxEdge->tensorSurfaceDesc()->dimensions().w, + auxEdge->tensorSurfaceDesc()->dimensions().h, + (int)params().stride().w, + (int)params().stride().h); + if (rawKrnlWts.count != (auxEdge->tensorSurfaceDesc()->dimensions().n * + auxEdge->tensorSurfaceDesc()->dimensions().c * + auxEdge->tensorSurfaceDesc()->dimensions().h * + auxEdge->tensorSurfaceDesc()->dimensions().w)) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "kernel dims dont match kernel size "); + } + + if ( params().convMode().v() == ConvolutionModeEnum::CONV_WINOGRAD ) + { + PRECISION_SWITCH(rawKrnlWts.type.v(), computePrecision.v(), trnsKrnlWts, WeightTrns::translateWtsForWG, + kernelDims, + rawKrnlWts); + } + else if ( params().convMode().v() == ConvolutionModeEnum::CONV_DIRECT ) + { + PRECISION_SWITCH(rawKrnlWts.type.v(), computePrecision.v(), trnsKrnlWts, WeightTrns::translateWtsForDC, + kernelDims, + rawKrnlWts, + atomicKSize, + atomicCSize, + cbufWidth); + } + else + { + PROPAGATE_ERROR_FAIL(NvDlaError_BadValue, "Unknown Conv mode : %s for %s", + params().convMode().c_str(), name().c_str()); + } + + if (trnsKrnlWts.values == NULL) + { + PROPAGATE_ERROR_FAIL(NvDlaError_BadValue, "Kernel Wt trnaslation failed for node '%s'", name().c_str()); + } + + params().setDLAWeights(trnsKrnlWts); + } + + +fail: + return e; +} + +/*--------------------------------Fuse Nodes---------------------------*/ +/* + * Conv node doesn't have output port, it must have an sdp node downstream, + * else something went wrong in previous steps + */ +NvDlaError engine_ast::ConvCoreNode::fuseOnTheFlyNodes() +{ + NvDlaError e = NvDlaSuccess; + + engine_ast::Graph::NodeSequence consumer_nodes; + EdgeSequence output_edges = graph()->downstreamEdges(this); + for (EdgeSequenceIterator oei = output_edges.begin(); oei != output_edges.end(); ++oei) + { + consumer_nodes = graph()->downstreamNodes(*oei); + for (NodeSequence::const_iterator cni = consumer_nodes.begin(); cni != consumer_nodes.end(); ++cni) + { + if ((*cni)->engineType().v() == EngineTypeEnum::SDP) + { + dependencyParams().setFusedNode(IODirectionEnum::OUTPUT, *cni); + (*cni)->dependencyParams().setFusedNode(IODirectionEnum::INPUT, this); + } + } + } + if (dependencyParams().fusedNode(IODirectionEnum::OUTPUT) == NULL) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Conv node didn't find a fusable downstream SDP node"); + } +fail: + return e; +} + +/* FIXME: this API currently supports only partial-H split of data cube. + * partial-W and partial-C split would follow in future + */ +NvDlaError engine_ast::ConvCoreNode::determineSplitDataRatios(NvU16& avlbDataBanks, std::vector& splitChunks) +{ + NvDlaError e = NvDlaSuccess; + surface::TensorSurfaceDesc *srcTSD = graph()->nodeInputTensorSurface(this, 0, supportedInSurfCategories()); + surface::TensorSurfaceDesc *weightTSD = graph()->nodeInputTensorSurface(this, 0, supportedAuxSurfCategories()); + surface::TensorSurfaceDesc *dstTSD = graph()->nodeOutputTensorSurface(this, 0, supportedOutSurfCategories()); + + Dims4 weightDims = weightTSD->dimensions(); + Dims4 srcDims = srcTSD->dimensions(); + Dims4 dstDims = dstTSD->dimensions(); + + bool isWinograd = false; + bool isIMGConv = false; + const NvU8 FIRST_PARTIAL_H_SEG = 0; + const NvU8 INTERMEDIATE_PARTIAL_H_SEG = 1; + const NvU8 LAST_PARTIAL_H_SEG = 2; + + NvU32 entriesPerSlice = 0; + NvU32 srcSlicesInCBuff = 0; + NvU32 totalCBuffEntriesAvlb = 0; + NvS32 dilatedWeightH = 0; + NvS32 dilatedWeightW = 0; + NvU32 srcHeights[3] = {0}; + NvU32 avlbCBuffEntries[3] = {0}; + NvU32 outputHeightProcessed = 0; + NvU32 wtBanksReserved = graph()->target_config()->bufBankAllotted() - avlbDataBanks; + surface::SurfaceCategory srcSC = srcTSD->surfaceFormat().category(); + + entriesPerSlice = calculateEPS(srcTSD); + + totalCBuffEntriesAvlb = avlbDataBanks * (graph()->target_config()->bufEntriesPerBank()); + isIMGConv = srcSC.v() == surface::SurfaceCategoryEnum::IMG; + + if (srcSC.v() == surface::SurfaceCategoryEnum::IMG || + (srcSC.v() == surface::SurfaceCategoryEnum::FEATURE_DATA && params().convMode().v() == ConvolutionModeEnum::CONV_DIRECT)) + { + isWinograd = false; + } + else if (params().convMode().v() == ConvolutionModeEnum::CONV_WINOGRAD) + { + isWinograd = true; + } + else + { + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Cant recognize conv mode %s", params().convMode().c_str()); + } + + if (isWinograd) + { + /* WG conv stores TP and BP padding values in CBUFF, + * so avlb CBuff entries for data is lesser + */ + srcSlicesInCBuff = srcDims.h + params().topLeftPadding().h + params().bottomRightPadding().h; + } + else + { + /* IMG and DC conv with feature data input dont store TP and BP padding values in CBUFF, + * so all avlb CBuff entries are for data only + */ + srcSlicesInCBuff = srcDims.h; + } + std::fill_n(avlbCBuffEntries, 3, totalCBuffEntriesAvlb); + + if (isWinograd) + { + bool isMinInPHSatisfied = false; + do { + totalCBuffEntriesAvlb = avlbDataBanks * (graph()->target_config()->bufEntriesPerBank()); + std::fill_n(avlbCBuffEntries, 3, totalCBuffEntriesAvlb); + srcHeights[FIRST_PARTIAL_H_SEG] = ROUNDDOWN_AND_ALIGN(avlbCBuffEntries[FIRST_PARTIAL_H_SEG] / entriesPerSlice, 4); + srcHeights[INTERMEDIATE_PARTIAL_H_SEG] = ROUNDDOWN_AND_ALIGN(avlbCBuffEntries[INTERMEDIATE_PARTIAL_H_SEG] / entriesPerSlice, 4); + srcHeights[LAST_PARTIAL_H_SEG] = ROUNDDOWN_AND_ALIGN(avlbCBuffEntries[LAST_PARTIAL_H_SEG] / entriesPerSlice, 4); + + if (srcHeights[FIRST_PARTIAL_H_SEG] <= 4 || + srcHeights[INTERMEDIATE_PARTIAL_H_SEG] <= 4 || + srcHeights[LAST_PARTIAL_H_SEG] <= 4) + { + gLogWarning << "Input partial-H for WG should be atleast >4 for " << name() << endl; + NvU32 minWtBanksNeeded = calculateMinBanksForWeight(weightTSD); + if (2*minWtBanksNeeded < wtBanksReserved) + { + gLogWarning << "Downsizing weight banks from " << wtBanksReserved << " to " << (2*minWtBanksNeeded) + << " such that wts use PING-PONG mode" << endl; + wtBanksReserved = 2*minWtBanksNeeded; + avlbDataBanks = graph()->target_config()->bufBankAllotted() - wtBanksReserved; + } + else if (minWtBanksNeeded < wtBanksReserved) + { + gLogWarning << "Downsizing weight banks from " << wtBanksReserved << " to " << minWtBanksNeeded + << " such that wts use single-KG mode" << endl; + wtBanksReserved = minWtBanksNeeded; + avlbDataBanks = graph()->target_config()->bufBankAllotted() - wtBanksReserved; + } + else + { + ORIGINATE_ERROR_FAIL(NvDlaError_InsufficientMemory, "Can't use Winograd mode for %s since insufficient banks for data. " + "Recompile with WG turned off", name().c_str()); + } + isMinInPHSatisfied = false; + params().setAllottedWeightBanks(wtBanksReserved); + } + else + { + isMinInPHSatisfied = true; + } + } while (!isMinInPHSatisfied); + } + else + { + srcHeights[FIRST_PARTIAL_H_SEG] = (NvU32)floor(avlbCBuffEntries[FIRST_PARTIAL_H_SEG] / entriesPerSlice); + srcHeights[INTERMEDIATE_PARTIAL_H_SEG] = (NvU32)floor(avlbCBuffEntries[INTERMEDIATE_PARTIAL_H_SEG] / entriesPerSlice); + srcHeights[LAST_PARTIAL_H_SEG] = (NvU32)floor(avlbCBuffEntries[LAST_PARTIAL_H_SEG] / entriesPerSlice); // not used anywhere + } + + if (isIMGConv) + { + NvS32 unswizzledWeightW = params().weightDims().w; + NvS32 unswizzledWeightH = params().weightDims().h; + + dilatedWeightH = (unswizzledWeightH - 1)*params().dilation().h + 1; + dilatedWeightW = (unswizzledWeightW - 1)*params().dilation().w + 1; + } + else + { + dilatedWeightH = (weightDims.h - 1)*params().dilation().h + 1; + dilatedWeightW = (weightDims.w - 1)*params().dilation().w + 1; + } + + if ( debugSplits() ) + { + gLogInfo << "eps " << entriesPerSlice << endl; + gLogInfo << "total srcSlices needed In CBuff " << srcSlicesInCBuff << endl; + gLogInfo << "total CBuffEntries Avlb " << totalCBuffEntriesAvlb << endl; + gLogInfo << "SRC dims: nchw " << srcDims.n << ", " << srcDims.c << ", " + << srcDims.h << ", " << srcDims.w << endl; + gLogInfo << "orig DST dims: nchw " << dstDims.n << ", " << dstDims.c << ", " + << dstDims.h << ", " << dstDims.w << endl; + } + + if (isWinograd) + { + /* + * In WG, there are strict limitations on input and output dimensions x(4x4) + * As a result, unlike DC, we cannot make maximum utilization of available CBUFF entries + */ + NvU32 opSlider = 0; + ConvCoreNode::SplitDataInfo firstPH; + firstPH.topSliceID = 0; + firstPH.bottomSliceID = srcHeights[FIRST_PARTIAL_H_SEG] - params().topLeftPadding().h - 1; + firstPH.numOverlapSlices = 0; + firstPH.numRetainSlices = 0; + firstPH.topPadding = params().topLeftPadding().h; + firstPH.bottomPadding = 0; + firstPH.leftPadding = params().topLeftPadding().w; + firstPH.rightPadding = params().bottomRightPadding().w; + opSlider = 4 - params().topLeftPadding().h - 1; + + if (firstPH.bottomSliceID >= (srcDims.h - 1)) + { + firstPH.bottomPadding = firstPH.bottomSliceID - (srcDims.h - 1); + firstPH.bottomSliceID = srcDims.h - 1; + opSlider = firstPH.bottomSliceID; + } + splitChunks.push_back(firstPH); + + while (opSlider < srcSlicesInCBuff) + { + ConvCoreNode::SplitDataInfo newPH; + newPH.topSliceID = (splitChunks.size() * (srcHeights[INTERMEDIATE_PARTIAL_H_SEG] - 4) * params().stride().h) - params().topLeftPadding().h; + newPH.bottomSliceID = newPH.topSliceID + srcHeights[INTERMEDIATE_PARTIAL_H_SEG] - 1; + newPH.topPadding = 0; + newPH.leftPadding = params().topLeftPadding().w; + newPH.rightPadding = params().bottomRightPadding().w; + newPH.numOverlapSlices = 0; + newPH.numRetainSlices = 0; + + // check if current pH is pHL + if (newPH.bottomSliceID >= (srcDims.h + params().bottomRightPadding().h - 1)) + { + newPH.bottomSliceID = srcDims.h - 1; + newPH.bottomPadding = params().bottomRightPadding().h; + ASSERT((newPH.bottomSliceID + newPH.bottomPadding - newPH.topSliceID + 1 ) % 4 == 0); + splitChunks.push_back(newPH); + break; + } + else if (newPH.bottomSliceID >= (srcDims.h - 1)) + { + newPH.bottomPadding = newPH.bottomSliceID - (srcDims.h - 1); + newPH.bottomSliceID = srcDims.h - 1; + opSlider = newPH.bottomSliceID; + splitChunks.push_back(newPH); + } + else + { + opSlider = newPH.bottomSliceID; + newPH.bottomPadding = 0; + splitChunks.push_back(newPH); + } + } + } + else + { + NvU32 opSlider = 0; + ConvCoreNode::SplitDataInfo firstPH; + firstPH.topSliceID = 0; + firstPH.bottomSliceID = srcHeights[FIRST_PARTIAL_H_SEG] - 1; + firstPH.numOverlapSlices = 0; + firstPH.numRetainSlices = 0; + firstPH.topPadding = params().topLeftPadding().h; + firstPH.bottomPadding = 0; + firstPH.leftPadding = params().topLeftPadding().w; + firstPH.rightPadding = params().bottomRightPadding().w; + splitChunks.push_back(firstPH); + //opSlider = isWinograd ? dilatedWeightH - params().topLeftPadding().h - 1 : dilatedWeightH - 1; + opSlider = dilatedWeightH - params().topLeftPadding().h - 1; + + if ((dilatedWeightH - 1) > splitChunks.back().bottomSliceID) + { + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Kernel height greater than single split possible"); + } + + while (opSlider < srcSlicesInCBuff) + { + while (opSlider <= (NvU32)splitChunks.back().bottomSliceID) + { + opSlider += params().stride().h; + } + // if opSlider overshoots bottomSliceID, roll it back to second-last valid op in lastPH chunk + if (opSlider > (NvU32)splitChunks.back().bottomSliceID) + { + opSlider -= params().stride().h; + } + + ConvCoreNode::SplitDataInfo newPH; + newPH.topSliceID = min(opSlider, (NvU32)splitChunks.back().bottomSliceID) - (dilatedWeightH - 1) + params().stride().h; + newPH.bottomSliceID = newPH.topSliceID + srcHeights[INTERMEDIATE_PARTIAL_H_SEG] - 1; + newPH.topPadding = 0; + newPH.leftPadding = params().topLeftPadding().w; + newPH.rightPadding = params().bottomRightPadding().w; + newPH.numOverlapSlices = 0; + newPH.numRetainSlices = 0; + + // check if current pH is pHL + if (newPH.bottomSliceID >= srcDims.h - 1) + { + newPH.bottomSliceID = srcDims.h - 1; + newPH.bottomPadding = params().bottomRightPadding().h; + splitChunks.push_back(newPH); + break; + } + + opSlider = newPH.topSliceID + dilatedWeightH - 1; + newPH.bottomPadding = 0; + splitChunks.push_back(newPH); + } + } + + // check if the last partial-H chunk overshoots bottom of the input, if so - trim it + if (splitChunks.back().topSliceID >= srcDims.h || + splitChunks.back().bottomSliceID >= (srcDims.h + params().bottomRightPadding().h)) + { + splitChunks.pop_back(); + } + + // determine overlap slices between 2 split chunks + for (std::vector::iterator itr = splitChunks.begin() + 1, pastItr = itr -1; + itr != splitChunks.end(); ++itr, ++pastItr) + { + if ((*pastItr).bottomSliceID >= (*itr).topSliceID) + { + (*itr).numOverlapSlices = (*pastItr).bottomSliceID - (*itr).topSliceID + 1; + (*pastItr).numRetainSlices = (*itr).numOverlapSlices; + } + else + { + (*itr).numOverlapSlices = 0; + (*pastItr).numRetainSlices = 0; + } + } + + + for (std::vector::iterator itr = splitChunks.begin(); + itr != splitChunks.end(); ++itr) + { + NvU32 convSlider = 0; + NvU32 convCounter = 0; + if (isWinograd) + { + convSlider = (*itr).topSliceID + (4 - 1) - (*itr).topPadding; + } + else + { + convSlider = (*itr).topSliceID + dilatedWeightH -1 - (*itr).topPadding; + } + + while(convSlider <= (NvU32)((*itr).bottomSliceID + (*itr).bottomPadding)) + { + convSlider += params().stride().h; + convCounter++; + } + (*itr).numConvs = convCounter; + if ((*itr).bottomSliceID > srcDims.h - 1) + { + (*itr).bottomSliceID = srcDims.h - 1; + } + + (*itr).inDims.n = srcDims.n; + (*itr).inDims.c = srcDims.c; + (*itr).inDims.h = (*itr).bottomSliceID - (*itr).topSliceID + 1; + (*itr).inDims.w = srcDims.w; + + (*itr).outDims.n = dstDims.n; + (*itr).outDims.c = dstDims.c; + + if (isWinograd) + { + (*itr).outDims.h = (*itr).inDims.h + (*itr).topPadding + (*itr).bottomPadding - 4; + (*itr).outDims.w = (*itr).inDims.w + (*itr).leftPadding + (*itr).rightPadding - 4; + } + else + { + (*itr).outDims.h = (((*itr).inDims.h + (*itr).topPadding + (*itr).bottomPadding - dilatedWeightH) / params().stride().h) + 1; + (*itr).outDims.w = (((*itr).inDims.w + (*itr).leftPadding + (*itr).rightPadding - dilatedWeightW) / params().stride().w) + 1; + } + + (*itr).inputBufferOffset = suggestLineStride(srcTSD) * (*itr).topSliceID; + (*itr).outputBufferOffset = suggestLineStride(dstTSD) * outputHeightProcessed; + + outputHeightProcessed += (*itr).outDims.h; + + (*itr).wtBanks = wtBanksReserved; + (*itr).dataBanks = avlbDataBanks; + } + + PROPAGATE_ERROR_FAIL(verifyPartialHInfo(splitChunks, isWinograd)); + +fail: + return e; +} + +NvDlaError engine_ast::ConvCoreNode::splitData(NvU16 avlbDataBanks) +{ + NvDlaError e = NvDlaSuccess; + int counter = 0; + + std::vector splitChunks = std::vector(); + std::vector::iterator splitItr; + engine_ast::ConvCoreNode* newSplitConvNode = NULL; + engine_ast::SDPNode* newSplitSDPNode = NULL; + engine_ast::SplitNode* swSplitNode = NULL; + engine_ast::ConcatenationNode* swConcatNode = NULL; + surface::TensorSurfaceDesc* weightTSD = NULL; + + Dims4 newSplitSrcDims {0,0,0,0}; // unique dims for input to each splitOp combo + Dims4 newSplitStreamDims {0,0,0,0}; // unique dims for stream tensor between a split conv+sdp + Dims4 newSplitDstDims {0,0,0,0}; // unique dims for each splitOp combo's output + + + engine_ast::Edge* origInputEdge = NULL; + engine_ast::Edge* origStreamEdge = NULL; + engine_ast::Edge* origOutputEdge = NULL; + engine_ast::Edge* origConvAuxEdge = NULL; + engine_ast::Edge* origSDPAuxEdge = NULL; + engine_ast::Edge* origConvComputeOutEdge = NULL; // compute edge going out from existing conv node + engine_ast::Edge* origSDPComputeOutEdge = NULL; // compute edge going out from existing fused-sdp node + + + engine_ast::Edge* newSplitSrcDataEdge = NULL; // new data edge carrying unique src tensor SD from sw-split to conv node + engine_ast::Edge* newSplitStreamDataEdge = NULL; // new data edge carrying unique dst tensor SD from a split conv node + engine_ast::Edge* newSplitDstDataEdge = NULL; // new data edge carrying unique dst tensor SD from a split sdp to sw-concat node + engine_ast::Edge* newSplitConvCompEdge = NULL; // new compute edge connecting a splitOp with its sibling + engine_ast::Edge* newSplitSDPCompEdge = NULL; // new compute edge connecting a splitOp with its sibling + engine_ast::Edge* newSplitConvRedundantAuxDataEdge = NULL; // in partial-H, all split conv's share original wt edge + engine_ast::Edge* newSplitSDPRedundantAuxDataEdge = NULL; // in partial-H, all split sdp's share original aux data edge + + Tensor* newSplitSrcTensor = NULL; // new tensor holding the src data chunk details to a splitOp combo + Tensor* newSplitDstTensor = NULL; // new tensor detailing the chunk of output specific to a splitOp combo + + NVDLA_UNUSED(newSplitConvCompEdge); + NVDLA_UNUSED(newSplitSDPCompEdge); + NVDLA_UNUSED(newSplitSrcDataEdge); + NVDLA_UNUSED(newSplitDstDataEdge); + + bool isWinograd = params().convMode().v() == ConvolutionModeEnum::CONV_WINOGRAD; + + // list of split siblings + vector splitConvNodes = std::vector(); + vector splitSDPNodes = std::vector(); + + + engine_ast::ConvCoreNode* origConvNode = this; + engine_ast::SDPNode* origFusedSDPNode = engine_ast::NodeFactory::nodeCast(dependencyParams().fusedNode(engine_ast::IODirectionEnum::OUTPUT)); + bool fusedSDPHasAuxData = false; + + if (!origFusedSDPNode || + (origFusedSDPNode->engineType().v() != engine_ast::EngineTypeEnum::SDP)) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "ConvCore op %s doesn't have any fused SDP partner." + "Can't split the node without a memory-write capable fused partner", name().c_str()); + } + + origInputEdge = origConvNode->inputEdges()[0]; + origConvAuxEdge = origConvNode->auxEdges()[0]; + origStreamEdge = origConvNode->outputEdges()[0]; + origOutputEdge = origFusedSDPNode->outputEdges()[0]; + weightTSD = origConvAuxEdge->tensorSurfaceDesc(); + origConvComputeOutEdge = graph()->downstreamComputeEdges(this).size() ? + graph()->downstreamComputeEdges(this)[0] : NULL; + origSDPComputeOutEdge = graph()->downstreamComputeEdges(origFusedSDPNode).size() ? + graph()->downstreamComputeEdges(origFusedSDPNode)[0] : NULL; + + PROPAGATE_ERROR_FAIL(origFusedSDPNode->nodeAuxEdge(&origSDPAuxEdge)); + + fusedSDPHasAuxData = origSDPAuxEdge ? true : false; + + PROPAGATE_ERROR_FAIL( determineSplitDataRatios(avlbDataBanks, splitChunks) ); + + if ( debugSplits() ) + { + gLogInfo << "orig input edge=" << origInputEdge->id() + << " orig aux edge=" << origConvAuxEdge->id() + << " orig output edge=" << origOutputEdge->id() << endl; + + for (splitItr = splitChunks.begin(); splitItr != splitChunks.end(); ++splitItr, ++counter) + { + gLogInfo << "ph " << counter << endl; + gLogInfo << "\tstart " << (*splitItr).topSliceID << endl; + gLogInfo << "\tend " << (*splitItr).bottomSliceID << endl; + gLogInfo << "\ttoppadding " << (*splitItr).topPadding << endl; + gLogInfo << "\tbottompadding " << (*splitItr).bottomPadding << endl; + gLogInfo << "\tleftpadding " << (*splitItr).leftPadding << endl; + gLogInfo << "\trightpadding " << (*splitItr).rightPadding << endl; + gLogInfo << "\tnumConvs " << (*splitItr).numConvs << endl; + gLogInfo << "\tretainSlices " << (*splitItr).numRetainSlices << endl; + gLogInfo << "\tnumOverlapSlices " << (*splitItr).numOverlapSlices << endl; + gLogInfo << "\tinputBufferOffset " << (*splitItr).inputBufferOffset << endl; + gLogInfo << "\toutputBufferOffset " << (*splitItr).outputBufferOffset << endl; + gLogInfo << "\tinDims: nchw " << (*splitItr).inDims.n << ", " << (*splitItr).inDims.c << ", " << (*splitItr).inDims.h << ", " << (*splitItr).inDims.w << endl; + gLogInfo << "\toutDims: nchw " << (*splitItr).outDims.n << ", " << (*splitItr).outDims.c << ", " << (*splitItr).outDims.h << ", " << (*splitItr).outDims.w << endl; + } + gLogInfo << "numPartialHs " << splitChunks.size() << endl; + } + + if (splitChunks.size() <= 1) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Num of partial-H ops: %d. This function shouldn't have been invoked for %s", splitChunks.size(), + name().c_str()); + } + /* + * (node-x) + * | + * (weight) | (orig input-surface: 1 edge : 1 TSD : 1 TBD) + * |\ \ | + * (orig wt-surf: | \ \ (split)___________ + * n 2nd-nodes: | \ \ / \ \ + * 1 edge: | \ \ / \ \ (input-surfaces: n edges : n TSDs : 1TBD) + * 1 TSD : | \ \/_______\__________ \ + * 1 TBD) | \_/_________\ \ \ + * | / \\ \ \ + * ----(C0)=========(C1)=-=-=-=-(Cn) + * | | | (stream-surfaces: n edges : n TSDs : no TBD) + * -----(S0)=========(S1)=-=-=-=-(Sn) + * | ___\_________/ / / / + * | / __\_________/_________/ / (output-surfaces: n edges : n TSDs : 1 TBD) + * | / / \ / / + * (orig bias-surf: |/ / \ / / + * n 2nd-nodes: (bias-data) (concat)- - - - - + * 1 edge: | + * 1 TSD : | (orig output-surf: 1 edge : 1 TSD : 1 TBD) + * 1 TBD) | + * (node-x+1) + */ + + /* software split and concat nodes which appear in the graph but + * do not get annotated in the firmware's action list + */ + swSplitNode = engine_ast::NodeFactory::newSplitNode(NULL, graph()); + swSplitNode->params().setSplitAxis(SplitAxisEnum::SPLIT_ALONG_H); + swConcatNode = engine_ast::NodeFactory::newConcatNode(NULL, graph()); + swConcatNode->params().setConcatAxis(ConcatAxisEnum::CONCAT_ALONG_H); + + /* delegate orig input edge to conv node and reattach to swSplit node and + * delegate orig output edge from SDP node and reattach to swConcat node + */ + graph()->replaceEdgeNodes(origInputEdge, ast::EdgeSideEnum::SECOND, origConvNode, swSplitNode); + graph()->replaceEdgeNodes(origOutputEdge, ast::EdgeSideEnum::FIRST, origFusedSDPNode, swConcatNode); + + splitConvNodes.push_back(origConvNode); + splitSDPNodes.push_back(origFusedSDPNode); + + origConvNode->params().setTopLeftPadding(Dims2(splitChunks[0].topPadding, splitChunks[0].leftPadding)); + origConvNode->params().setBottomRightPadding(Dims2(splitChunks[0].bottomPadding, splitChunks[0].rightPadding)); + + /********************* Handle 1st split op node ****************************/ + /* Step-1: Handle edges */ + // Handle split input edge + newSplitSrcDims.n = 1; //FIXME: conv doesnt support HW multi-batch yet + newSplitSrcDims.c = splitChunks[0].inDims.c; + newSplitSrcDims.w = splitChunks[0].inDims.w; + newSplitSrcDims.h = splitChunks[0].inDims.h; + newSplitSrcTensor = origInputEdge->originalTensor()->clone(); + newSplitSrcTensor->setTensorType(TensorType::kIO); + newSplitSrcTensor->setDimensions(newSplitSrcDims); + + // Handle split stream edge + newSplitStreamDims.n = 1; //FIXME: conv doesnt support HW multi-batch yet + newSplitStreamDims.c = splitChunks[0].outDims.c; + newSplitStreamDims.h = splitChunks[0].outDims.h; + newSplitStreamDims.w = splitChunks[0].outDims.w; + origStreamEdge->originalTensor()->setDimensions(newSplitStreamDims); + origStreamEdge->tensorSurfaceDesc()->setDimensions(newSplitStreamDims); + + // Handle split output edge + newSplitDstDims = newSplitStreamDims; + newSplitDstTensor = origOutputEdge->originalTensor()->clone(); + newSplitDstTensor->setTensorType(TensorType::kIO); + newSplitDstTensor->setDimensions(newSplitDstDims); + + newSplitSrcDataEdge = graph()->addDataEdge(origInputEdge->canonicalEdge(), swSplitNode, origConvNode, newSplitSrcTensor); + newSplitDstDataEdge = graph()->addDataEdge(origOutputEdge->canonicalEdge(), origFusedSDPNode, swConcatNode, newSplitDstTensor); + + if (isWinograd) + { + PROPAGATE_ERROR_FAIL(origConvNode->determineWinogradParams()); + PROPAGATE_ERROR_FAIL(origFusedSDPNode->determineWinogradParams(origConvNode)); + } + + origConvNode->setSplitDataInfo(splitChunks[0]); + origConvNode->params().setRetainSlices(splitChunks[0].numRetainSlices); + + ASSERT(origConvNode->params().weightBanksAllotted() == splitChunks[0].wtBanks); + ASSERT(splitChunks[0].dataBanks == avlbDataBanks); + + origConvNode->params().setAllottedDataBanks(splitChunks[0].dataBanks); + + /*******************************Handle remaining split ops ***************/ + for (splitItr = splitChunks.begin() + 1; splitItr != splitChunks.end(); ++splitItr) + { + /* Step-1: Add new splitOp node */ + switch(origConvNode->engineOpType().v()) + { + case EngineOpTypeEnum::CONVOLUTION_CONV: { + canonical_ast::ConvolutionNode* origCanNode = + canonical_ast::NodeFactory::nodeCast(canonicalNode()); + newSplitConvNode = engine_ast::NodeFactory::newConvCoreConvolutionOpNode(origCanNode, graph()); + if (!isWinograd && (newSplitConvNode->params().convMode().v() == ConvolutionModeEnum::CONV_WINOGRAD)) + { + newSplitConvNode->params().setConvMode(ConvolutionModeEnum::CONV_DIRECT); + newSplitConvNode->setName("dc-conv-" + newSplitConvNode->name().substr(newSplitConvNode->name().find("wg-conv-") + 8)); + } + newSplitSDPNode = newSplitConvNode->addSDPJointOpNode(origFusedSDPNode); + NodeFactory::nodeCast(newSplitConvNode)->inheritParams(origConvNode); + }; break; + case EngineOpTypeEnum::CONVOLUTION_FC: { + canonical_ast::FullyConnectedNode* origCanNode = + canonical_ast::NodeFactory::nodeCast(canonicalNode()); + newSplitConvNode = engine_ast::NodeFactory::newConvCoreFullyConnectedOpNode(origCanNode, graph()); + newSplitSDPNode = newSplitConvNode->addSDPJointOpNode(origCanNode); + }; break; + case EngineOpTypeEnum::CONVOLUTION_DECONV: { + canonical_ast::DeconvolutionNode* origCanNode = + canonical_ast::NodeFactory::nodeCast(canonicalNode()); + newSplitConvNode = engine_ast::NodeFactory::newConvCoreDeconvolutionOpNode(origCanNode, graph()); + newSplitSDPNode = newSplitConvNode->addSDPJointOpNode(origFusedSDPNode); + NodeFactory::nodeCast(newSplitConvNode)->inheritParams(origConvNode); + }; break; + default: + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Invalid engine type for splitting weights: %s", + engineOpType().c_str()); + } + + newSplitConvNode->params().setTopLeftPadding(Dims2((*splitItr).topPadding, (*splitItr).leftPadding)); + newSplitConvNode->params().setBottomRightPadding(Dims2((*splitItr).bottomPadding, (*splitItr).rightPadding)); + + /* Trim the extra aux edges attached to the nodes above. All the split conv's + * are going to share weights and the split sdp's are going to share data (if any) + */ + PROPAGATE_ERROR_FAIL(newSplitConvNode->nodeDataEdge(TensorType::kWEIGHT, ast::EdgeSideEnum::SECOND, &newSplitConvRedundantAuxDataEdge)); + newSplitConvNode->graph()->removeEdgeFromNode(newSplitConvRedundantAuxDataEdge, ast::EdgeSideEnum::SECOND, newSplitConvNode); + newSplitConvNode->graph()->removeNodeFromEdge(newSplitConvRedundantAuxDataEdge, ast::EdgeSideEnum::SECOND, newSplitConvNode); + newSplitConvNode->graph()->appendNodeToEdge(origConvAuxEdge, ast::EdgeSideEnum::SECOND, newSplitConvNode); + newSplitConvNode->graph()->removeEdge(newSplitConvRedundantAuxDataEdge); + + if (fusedSDPHasAuxData) + { + PROPAGATE_ERROR_FAIL(newSplitSDPNode->nodeAuxEdge(&newSplitSDPRedundantAuxDataEdge)); + newSplitSDPNode->graph()->removeEdgeFromNode(newSplitSDPRedundantAuxDataEdge, ast::EdgeSideEnum::SECOND, newSplitSDPNode); + newSplitSDPNode->graph()->removeNodeFromEdge(newSplitSDPRedundantAuxDataEdge, ast::EdgeSideEnum::SECOND, newSplitSDPNode); + newSplitSDPNode->graph()->appendNodeToEdge(origSDPAuxEdge, ast::EdgeSideEnum::SECOND, newSplitSDPNode); + newSplitSDPNode->graph()->removeEdge(newSplitSDPRedundantAuxDataEdge); + } + + + /* Step-1: Handle edges */ + // Handle split input edge + newSplitSrcDims.n = 1; //FIXME: conv doesnt support HW multi-batch yet + newSplitSrcDims.c = (*splitItr).inDims.c; + newSplitSrcDims.h = (*splitItr).inDims.h; + newSplitSrcDims.w = (*splitItr).inDims.w; + newSplitSrcTensor = origInputEdge->originalTensor()->clone(); + newSplitSrcTensor->setTensorType(TensorType::kIO); + newSplitSrcTensor->setDimensions(newSplitSrcDims); + + + // Handle split stream edge + PROPAGATE_ERROR_FAIL(newSplitConvNode->nodeDataEdge(TensorType::kSTREAM, ast::EdgeSideEnum::FIRST, &newSplitStreamDataEdge)); + newSplitStreamDims.n = 1; //FIXME: conv doesnt support HW multi-batch yet + newSplitStreamDims.c = (*splitItr).outDims.c; + newSplitStreamDims.h = (*splitItr).outDims.h; + newSplitStreamDims.w = (*splitItr).outDims.w; + newSplitStreamDataEdge->originalTensor()->setDimensions(newSplitStreamDims); + + // Handle split dst edge + newSplitDstDims = newSplitStreamDims; + newSplitDstTensor = origOutputEdge->originalTensor()->clone(); + newSplitDstTensor->setTensorType(TensorType::kIO); + newSplitDstTensor->setDimensions(newSplitDstDims); + + newSplitSrcDataEdge = graph()->addDataEdge(origInputEdge->canonicalEdge(), swSplitNode, newSplitConvNode, newSplitSrcTensor); + newSplitDstDataEdge = graph()->addDataEdge(origOutputEdge->canonicalEdge(), newSplitSDPNode, swConcatNode, newSplitDstTensor); + + if (isWinograd) + { + PROPAGATE_ERROR_FAIL(newSplitConvNode->determineWinogradParams()); + PROPAGATE_ERROR_FAIL(newSplitSDPNode->determineWinogradParams(newSplitConvNode)); + } + + /* Step-4: Connect the newly added splitOp to the last one using compute edge */ + newSplitConvCompEdge = graph()->addComputeEdge(splitConvNodes.back(), newSplitConvNode); + newSplitSDPCompEdge = graph()->addComputeEdge(splitSDPNodes.back(), newSplitSDPNode); + + newSplitConvNode->setSplitDataInfo((*splitItr)); + splitConvNodes.push_back(newSplitConvNode); + splitSDPNodes.push_back(newSplitSDPNode); + PROPAGATE_ERROR_FAIL(newSplitConvNode->fuseOnTheFlyNodes()); + + // Retain overlapping slices between adjacent conv ops + newSplitConvNode->params().setRetainSlices((*splitItr).numRetainSlices); + + ASSERT(origConvNode->params().weightBanksAllotted() == (*splitItr).wtBanks); + ASSERT((*splitItr).dataBanks == avlbDataBanks); + + newSplitConvNode->params().setAllottedWeightBanks((*splitItr).wtBanks); + newSplitConvNode->params().setAllottedDataBanks((*splitItr).dataBanks); + } + + // Delegate compute edge going out from existing conv and sdp to the last of the respective split siblings + if (origConvComputeOutEdge) + { + graph()->replaceEdgeNodes(origConvComputeOutEdge, ast::EdgeSideEnum::FIRST, origConvNode, splitConvNodes.back()); + } + if (origSDPComputeOutEdge) + { + graph()->replaceEdgeNodes(origSDPComputeOutEdge, ast::EdgeSideEnum::FIRST, origFusedSDPNode, splitSDPNodes.back()); + } + + // Reuse weights for each split conv iff all of the weight data can fit in the avlb wt banks + if (params().weightBanksAllotted() == calculateTotalBanksForWeight(weightTSD)) + { + ConvCoreNode* firstSplitConv = splitConvNodes[0]; + ConvCoreNode* lastSplitConv = splitConvNodes.back(); + firstSplitConv->params().setReleaseWeights(false); + for (std::vector::iterator ni = splitConvNodes.begin() + 1; ni != splitConvNodes.end(); ++ni) + { + (*ni)->params().setReuseWeights(true); + (*ni)->params().setReleaseWeights(false); + } + // Release weights after last split op + lastSplitConv->params().setReleaseWeights(true); + } + +fail: + return e; +} + +NvDlaError engine_ast::ConvCoreNode::splitWeightsAndData(NvU16 /*avlbWtBanks*/, NvU16 /*avlbDataBanks*/) +{ + NvDlaError e = NvDlaSuccess; + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "%s is not yet supported", __func__); +fail: + return e; +} + +/*--------------------------------Split Nodes---------------------------*/ +NvDlaError engine_ast::ConvCoreNode::splitNodes() +{ + NvDlaError e = NvDlaSuccess; + + if ( params().convMode().v() == ConvolutionModeEnum::CONV_DIRECT ) + { + PROPAGATE_ERROR_FAIL( splitNodesInternal() ); + } + else if ( params().convMode().v() == ConvolutionModeEnum::CONV_WINOGRAD ) + { + ConvCoreConvolutionOpNode* convOp = NULL; + ASSERT( engineOpType().v() == EngineOpTypeEnum::CONVOLUTION_CONV ); + convOp = NodeFactory::nodeCast(this); + + e = splitNodesInternal(); + // if compilation failed underneath due to any WG limitations, fallback to DC and retry + // for any other failure flavors, actually fail + if (e == NvDlaError_InsufficientMemory) + { + PROPAGATE_ERROR_FAIL( convOp->fallbackWGConvToDC() ); + PROPAGATE_ERROR_FAIL( splitNodesInternal() ); + } + } + +fail: + return e; +} + +NvDlaError engine_ast::ConvCoreNode::splitNodesInternal() +{ + NvDlaError e = NvDlaSuccess; + + NvU32 totalDataBanksNeeded = 0; + NvU32 totalWtBanksNeeded = 0; + NvU32 minWtBanksNeeded = 0; + NvU32 compWtReservedBank = 0; + NvU32 spareBanks = 0; + + surface::TensorSurfaceDesc *srcTSD = graph()->nodeInputTensorSurface(this, 0, supportedInSurfCategories()); + surface::TensorSurfaceDesc *weightTSD = graph()->nodeInputTensorSurface(this, 0, supportedAuxSurfCategories()); + + bool weight_compression = graph()->profile()->canCompressWeights() && graph()->target_config()->isCompressWeightsCapable(); + NvU32 totalCbuffBanks = graph()->target_config()->bufBankAllotted(); + + totalDataBanksNeeded = calculateTotalBanksForData(srcTSD); + totalWtBanksNeeded = calculateTotalBanksForWeight(weightTSD); + minWtBanksNeeded = calculateMinBanksForWeight(weightTSD); + // If weights are compressed, WMB surface needs 1 bank (Bank-15) + compWtReservedBank = weight_compression ? 1 : 0; + + if ( debugSplits() ) + { + gLogInfo << "(" << name() << ") " << params().convMode().c_str() << endl; + gLogInfo << "\ttotal b4d needed " << totalDataBanksNeeded << endl; + gLogInfo << "\ttotal b4w needed " << totalWtBanksNeeded << endl; + gLogInfo << "\tmin b4w needed " << minWtBanksNeeded << endl; + gLogInfo << "\treserved WMB bank " << compWtReservedBank << endl; + gLogInfo << "(" << name() << ") "; + } + + /* FIXME: For now, follow the following order of preference + * 1. Full input and Full weight (no split needed) + * 2.a Full input and Partial weight (split-k mode) + * 2.b Partial input and Full weight (partial-H mode) + * 3 Partial input and Partial weight (split-k and partial-H) + */ + //HW-powered: FI + FW + if (totalWtBanksNeeded + totalDataBanksNeeded + compWtReservedBank <= totalCbuffBanks) + { + // nothing to split + if ( debugSplits() ) + { + gLogInfo << "FI + FW mode. Nothing to split" << endl; + } + params().setAllottedDataBanks(totalDataBanksNeeded); + params().setAllottedWeightBanks(totalWtBanksNeeded); + goto fail; + } + + //HW-powered: FI + ping-pong Wts + if ((2*minWtBanksNeeded) + totalDataBanksNeeded + compWtReservedBank <= totalCbuffBanks) + { + if ( debugSplits() ) + { + gLogInfo << "FI + ping-pong mode on weights" << endl; + } + params().setAllottedDataBanks(totalDataBanksNeeded); + params().setAllottedWeightBanks(2*minWtBanksNeeded); + goto fail; + } + //HW-powered: FI + 1KG wts + else if (minWtBanksNeeded + totalDataBanksNeeded + compWtReservedBank <= totalCbuffBanks) + { + if ( debugSplits() ) + { + gLogInfo << "FI + 1KG of weights. Suboptimal but hw automated" << endl; + } + params().setAllottedDataBanks(totalDataBanksNeeded); + params().setAllottedWeightBanks(minWtBanksNeeded); + goto fail; + } + + /* If control reaches here, then either the data is massive and/or single KG is massive, + * software splits are unavoidable. Everything that follows is profile governed i.e. + * we will split nodes if the profile forces us to. A better profile later will + * eventually emerge a better KPI. However, we do attempt to determine if any scope of + * hw automation is still left. + */ + + /* FI within (profile) alloted banks:- + * FI + (hw-split-k(Ping-Pong) / hw-split-k(single KG)) + */ + if (totalDataBanksNeeded < graph()->profile()->dataBanksAlloted()) + { + if ( debugSplits() ) + { + gLogInfo << "FI + "; + } + params().setAllottedDataBanks(totalDataBanksNeeded); + + // hw-split-k (Ping-Pong) + if ((2*minWtBanksNeeded) + compWtReservedBank < graph()->profile()->weightBanksAlloted()) + { + if ( debugSplits() ) + { + gLogInfo << "HW split-K with Ping-pong mode on weights" << endl; + } + params().setAllottedWeightBanks(2*minWtBanksNeeded); + goto fail; + } + // hw-split-k (single KG) + else if (minWtBanksNeeded + compWtReservedBank < graph()->profile()->weightBanksAlloted()) + { + if ( debugSplits() ) + { + gLogInfo << "HW split-K with single KG" << endl; + } + params().setAllottedWeightBanks(minWtBanksNeeded); + goto fail; + } + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Not enough banks to hold weight data. No software split supported"); + } + + /* Split-Input within (profile) alloted banks:- + * SW-partial-h + (FW (all KGs) / hw-split-k(Ping-Pong) / hw-split-k(single KG) / sw-split-k) + */ + else + { + if (totalWtBanksNeeded + compWtReservedBank <= graph()->profile()->weightBanksAlloted()) + { + if ( debugSplits() ) + { + gLogInfo << "sw-Partial-H + FW" << endl; + } + params().setAllottedWeightBanks(totalWtBanksNeeded); + spareBanks = totalCbuffBanks - totalWtBanksNeeded - compWtReservedBank; + PROPAGATE_ERROR_FAIL(splitData(spareBanks)); + } + // hw-split-k(Ping-Pong) + else if ((2*minWtBanksNeeded) + compWtReservedBank <= graph()->profile()->weightBanksAlloted()) + { + if ( debugSplits() ) + { + gLogInfo << "sw-Partial-H + hw-split-K (ping-pong mode)" << endl; + } + params().setAllottedWeightBanks(2*minWtBanksNeeded); + spareBanks = totalCbuffBanks - (2*minWtBanksNeeded) - compWtReservedBank; + PROPAGATE_ERROR_FAIL(splitData(spareBanks)); + } + // hw-split-k(single KG) + else if (minWtBanksNeeded + compWtReservedBank <= graph()->profile()->weightBanksAlloted()) + { + if ( debugSplits() ) + { + gLogInfo << "sw-Partial-H + hw-split-K (single KG mode)" << endl; + } + params().setAllottedWeightBanks(minWtBanksNeeded); + spareBanks = totalCbuffBanks - minWtBanksNeeded - compWtReservedBank; + PROPAGATE_ERROR_FAIL(splitData(spareBanks)); + } + //SW-poweredL sw-partial-h + hw-split-k + else if (minWtBanksNeeded < graph()->profile()->weightBanksAlloted()) + { + // mostly remnant code block + } + // sw-split-k + else + { + if ( debugSplits() ) + { + gLogInfo << "sw-Partial-H + sw-split-K" << endl; + } + PROPAGATE_ERROR_FAIL(splitWeightsAndData(graph()->profile()->dataBanksAlloted(), graph()->profile()->weightBanksAlloted())); + } + } + +fail: + return e; +} + +/*------------------------------Handle Multi-Batch---------------------*/ +NvDlaError engine_ast::ConvCoreNode::handleMultiBatch() +{ + NvDlaError e = NvDlaSuccess; + + NvU32 numBatches = graph()->profile()->multiBatchSize(); + NvU32 firstBatch = 0; + NvU32 lastBatch = numBatches - 1; + surface::TensorSurfaceDesc *weightTSD = NULL; + + for (NvU32 nn = 1; nn < numBatches; ++nn) + { + params(nn) = params(0); + switch(engineOpType().v()) { + case EngineOpTypeEnum::CONVOLUTION_CONV: + NodeFactory::nodeCast(this)->params(nn) = + NodeFactory::nodeCast(this)->params(0); + break; + case EngineOpTypeEnum::CONVOLUTION_FC: + NodeFactory::nodeCast(this)->params(nn) = + NodeFactory::nodeCast(this)->params(0); + break; + case EngineOpTypeEnum::CONVOLUTION_DECONV: + NodeFactory::nodeCast(this)->params(nn) = + NodeFactory::nodeCast(this)->params(0); + break; + default: + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Unsupported CONV Engine Op type: %s", engineOpType().c_str()); + } + } + + /* Convolution ops can have weight reuse scenarios, handle them carefully among batches + * + * Whenever the entire weights for the conv - op can be fit in the conv_buff banks, + * subsequent batches can reuse those weights. + * + * Whenever, there is hardware automated split-K selected (ping-pong mode(2KG) OR 1KG), + * weight reuse among batches is not possible. So the weights have to be re-fetched + * separately for each batch. + */ + weightTSD = graph()->nodeInputTensorSurface(this, 0, supportedAuxSurfCategories()); + if (params(firstBatch).weightBanksAllotted() == calculateTotalBanksForWeight(weightTSD)) + { + bool isSingleBatchWtRls = params(firstBatch).isReleaseWeights(); + for (NvU32 nn = firstBatch; nn < lastBatch; ++nn) + { + NvU32 currBatch = nn; + NvU32 nextBatch = nn + 1; + params(nextBatch).setReuseWeights(true); + params(currBatch).setReleaseWeights(false); + } + params(lastBatch).setReleaseWeights(isSingleBatchWtRls); + } + +fail: + return e; +} + +/*---------------------------Resolve Data Dependencies-----------------*/ +NvDlaError engine_ast::ConvCoreNode::resolveDataDependencies(Node* next) +{ + NvDlaError e = NvDlaSuccess; + Node* downStreamSDP; + // capture all consumers as normal + PROPAGATE_ERROR_FAIL(engine_ast::Node::resolveDataDependencies(next)); + + downStreamSDP = dependencyParams().consumer(EngineTypeEnum::SDP).node(); + if (downStreamSDP == NULL) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Conv node %s doesn't have a single SDP consumer!!" + " Forgot to add even an SDP-NOP?", name().c_str()); + } + + // now retrofit the consumer array to specially handle the fused SDP op with conv + if (downStreamSDP->dependencyParams().fusedNode(IODirectionEnum::INPUT) == this) + { + dependencyParams().consumer(EngineTypeEnum::SDP).setOpEvent(OperationEventTypeEnum::OP_PROGRAMMED); + downStreamSDP->dependencyParams().producer(EngineTypeEnum::CONVOLUTION).setOpEvent(OperationEventTypeEnum::OP_PROGRAMMED); + } + else + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Conv node not fused with down stream SDP"); + //todo: probably fuse them here as a late on-fly fix?? + } + +fail: + return e; +} + +NvDlaError engine_ast::ConvCoreNode::determineWinogradParams() +{ + NvDlaError e = NvDlaSuccess; + + NvU16 bpe = 0; + Dims2 origPadTL; + NvU16 newWOut, newHOut; + NvU16 WInExt, HInExt, CInExt; + NvU16 newPadRight, newPadBottom; + Dims4 origConvInDims, origConvOutDims, origConvAuxDims; + engine_ast::ConvCoreEngineParams::WinogradParams convWGParams; + + if (params().convMode().v() != ConvolutionModeEnum::CONV_WINOGRAD) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Can't determine WG params for %s which is" + " not selected for WG mode", name().c_str()); + } + + PROPAGATE_ERROR_FAIL( repopulateEdgePorts() ); + + bpe = graph()->profile()->computePrecision() == surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8 ? 1 : 2; + origConvInDims = inputEdges()[0]->originalTensor()->getDimensions(); + origConvOutDims = outputEdges()[0]->originalTensor()->getDimensions(); + origConvAuxDims = auxEdges()[0]->originalTensor()->getDimensions(); + + convWGParams.inDims = origConvInDims; + convWGParams.outDims = origConvOutDims; + convWGParams.auxDims = origConvAuxDims; + + origPadTL = params().topLeftPadding(); + newWOut = (NvU16)((origConvOutDims.w + 3)/4) * 4; + newHOut = (NvU16)((origConvOutDims.h + 3)/4) * 4; + + if ( debugWinograd() ) + { + gLogInfo << "origconv in dims: " << origConvInDims.c << "x" + << origConvInDims.h << "x" << origConvInDims.w << endl; + gLogInfo << "origconv aux dims: " << origConvAuxDims.n << "x" + << origConvAuxDims.c << "x" << origConvAuxDims.h << "x" + << origConvAuxDims.w << endl; + gLogInfo << "origconv out dims: " << origConvOutDims.c << "x" + << origConvOutDims.h << "x" << origConvOutDims.w << endl; + } + + WInExt = newWOut + 4; + HInExt = newHOut + 4; + CInExt = origConvInDims.c; + newPadRight = WInExt - origConvInDims.w - origPadTL.w; + newPadBottom = HInExt - origConvInDims.h - origPadTL.h; + + /* Step-1: determine input side wg details */ + if ( ((CInExt * bpe) % 32) != 0 ) + { + CInExt = CInExt + (32 - ((CInExt * bpe) % 32))/bpe; + } + convWGParams.inDims.w = WInExt; + convWGParams.inDims.h = HInExt; + convWGParams.inDims.c = CInExt; + convWGParams.auxDims.w = 4; + convWGParams.auxDims.h = 4; + convWGParams.auxDims.c = CInExt; + params().setBottomRightPadding(Dims2(newPadBottom, newPadRight)); + + /* Step-2: Determine output side wg details */ + convWGParams.outDims.w = newWOut; + convWGParams.outDims.h = newHOut; + + params().setWinogradParams(convWGParams); + + if ( debugWinograd() ) + { + gLogInfo << "conv wg " << name() << " in: " + << convWGParams.inDims.n << "x" << convWGParams.inDims.c << "x" + << convWGParams.inDims.h << "x" << convWGParams.inDims.w << endl; + gLogInfo << "conv wg " << name() << " aux: " + << convWGParams.auxDims.n << "x" << convWGParams.auxDims.c << "x" + << convWGParams.auxDims.h << "x" << convWGParams.auxDims.w << endl; + gLogInfo << "conv wg " << name() << " out: " + << convWGParams.outDims.n << "x" << convWGParams.outDims.c << "x" + << convWGParams.outDims.h << "x" << convWGParams.outDims.w << endl; + gLogInfo << "conv wg " << name() << " TxL pad: " + << origPadTL.h << "x" << origPadTL.w << endl; + gLogInfo << "conv wg " << name() << " BxR pad: " + << newPadBottom << "x" << newPadRight << endl; + } + +fail: + return e; +} + +NvDlaError engine_ast::ConvCoreNode::captureCanonicalWeights() +{ + NvDlaError e = NvDlaSuccess; + + Tensor* wt_tensor; + + wt_tensor = graph()->addAuxTensor(graph()->newAuxTensorName(), params().weightDims(), TensorType::kWEIGHT); + Edge* aux = graph()->addDataEdge((canonical_ast::Edge*)0, 0, this, wt_tensor); + NVDLA_UNUSED(aux); + + return e; +} + +//---------------------------------------------------------------------- +// Formula Book +//---------------------------------------------------------------------- + +NvS16 engine_ast::ConvCoreNode::calculateEPS(surface::TensorSurfaceDesc* tsd) +{ + NvDlaError e = NvDlaSuccess; + NVDLA_UNUSED(e); + NvS16 eps = -1; + NvU8 bpe = tsd->surfaceFormat().bytesPerElement(); + NvS8 cpa = tsd->surfaceFormat().channelsPerAtom(); + Dims4 input_dims = tsd->dimensions(); + NvU32 width = input_dims.w; + NvU32 width_ext = params().topLeftPadding().w + params().bottomRightPadding().w + input_dims.w; + NvU32 chnl_ext = 0; + NvU16 stride_x = params().stride().w; + NvU16 stride_y = params().stride().h; + NvF32 memory_atomic_size = graph()->target_config()->memoryAtomicSize(); + NvF32 buf_bank_width = graph()->target_config()->bufEntryWidth(); + + surface::SurfaceCategory sc = tsd->surfaceFormat().category(); + + switch(sc.v()) + { + case surface::SurfaceCategoryEnum::IMG: { + switch(params().convMode().v()) + { + case ConvolutionModeEnum::CONV_DIRECT: + eps = (NvS16)ceil(width_ext * cpa * bpe / (NvF32)(buf_bank_width)); + break; + default: + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unsupported Conv Mode: %s for Pixel format", params().convMode().c_str()); + } + }; break; + case surface::SurfaceCategoryEnum::FEATURE_DATA: { + switch(params().convMode().v()) + { + case ConvolutionModeEnum::CONV_DIRECT: { + NvU16 total_c_atomics = (NvU16)ceil(input_dims.c * bpe / (NvF32)(memory_atomic_size)); + NvU16 last_c_atomics = total_c_atomics % (NvU16)(buf_bank_width / memory_atomic_size) ; + NvU16 int_c_entries = (total_c_atomics / (NvU16)(buf_bank_width / memory_atomic_size)) * width; + NvU16 frac_c_entries = (last_c_atomics == 3) ? width: (NvU16)ceil(last_c_atomics * width / ((NvF32)(buf_bank_width / memory_atomic_size))); + eps = int_c_entries + frac_c_entries; + }; break; + case ConvolutionModeEnum::CONV_WINOGRAD: { + width_ext = params().winogradParams().inDims.w; + chnl_ext = params().winogradParams().inDims.c; + ASSERT(width_ext % (4 * params().stride().w) == 0); + NvU16 c_atomics = (NvU16)ceil(chnl_ext * bpe / 32.0); + NvU16 c_atomics_ext = c_atomics * stride_x * stride_y; + eps = ( (width_ext/(4*stride_x)) * c_atomics_ext * 4) / 4; + }; break; + default: + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unsupported Conv Mode: %s for Feature Data format", params().convMode().c_str()); + } + }; break; + default: + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "EPS cannot be calculated for: %s surface category", sc.c_str()); + } + +fail: + return eps; +} + +NvU16 engine_ast::ConvCoreNode::calculateTotalBanksForData(surface::TensorSurfaceDesc* tsd) +{ + NvDlaError e = NvDlaSuccess; + NVDLA_UNUSED(e); + NvU16 b4d = 0; + Dims4 input_dims = tsd->dimensions(); + NvU32 height_ext = 0; + NvU32 buf_entry_per_bank = graph()->target_config()->bufEntriesPerBank(); + + surface::SurfaceCategory sc = tsd->surfaceFormat().category(); + if ( sc.v() == surface::SurfaceCategoryEnum::IMG || + (sc.v() == surface::SurfaceCategoryEnum::FEATURE_DATA && params().convMode().v() == ConvolutionModeEnum::CONV_DIRECT)) + { + b4d = (NvU16)ceil(calculateEPS(tsd) * input_dims.h / (NvF32)(buf_entry_per_bank)); + } + else if (params().convMode().v() == ConvolutionModeEnum::CONV_WINOGRAD) + { + height_ext = params().winogradParams().inDims.h; + b4d = (NvU16)ceil(calculateEPS(tsd) * height_ext / 256.0); + } + else + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Unknown CONV mode for %s", name().c_str()); + } + +fail: + return b4d; +} + +NvU16 engine_ast::ConvCoreNode::calculateMinBanksForWeight(surface::TensorSurfaceDesc* wt_tsd) +{ + NvDlaError e = NvDlaSuccess; + NVDLA_UNUSED(e); + NvU8 bpe = wt_tsd->surfaceFormat().bytesPerElement(); + NvU32 atom_k_size = graph()->target_config()->atomicKSize(); + NvU32 buf_ent_per_bank = graph()->target_config()->bufEntriesPerBank(); + NvU32 buf_entry_width = graph()->target_config()->bufEntryWidth(); + + NvU16 min_b4w = 0; + + NvU16 kpg = bpe == 1 ? atom_k_size : atom_k_size / 2; + + ASSERT(std::string(wt_tsd->surfaceFormat().c_str()).find("COMPRESSED") == std::string::npos); + + // compute how many banks are necessary to store minimum weight data (1 KG) + switch(params().convMode().v()) + { + case ConvolutionModeEnum::CONV_WINOGRAD: + { + NvU32 krnl_width_ext = (NvU32)ceil((NvF32)wt_tsd->dimensions().w/params().stride().w); + NvU32 krnl_height_ext = (NvU32)ceil((NvF32)wt_tsd->dimensions().h/params().stride().h); + NvU32 krnl_chnl = ROUNDUP_AND_ALIGN(wt_tsd->dimensions().c * bpe, 32) / bpe; + NvU32 krnl_chnl_ext = krnl_chnl * params().stride().w * params().stride().h; + + ASSERT(krnl_width_ext == 3); + ASSERT(krnl_height_ext == 3); + + // 4x4 because the pre-transformed kernel is always 4x4 + min_b4w = (NvU16)ceil(4 * 4 * krnl_chnl_ext * bpe * kpg / 128 / 256.0); + } + break; + + case ConvolutionModeEnum::CONV_DIRECT: + { + // weight_bank has the same formula for image input/DC + NvU64 kpg_bytes = ROUNDUP_AND_ALIGN(wt_tsd->dimensions().c * + wt_tsd->dimensions().h * + wt_tsd->dimensions().w * + kpg * bpe, buf_entry_width); + min_b4w = (NvU16)ceil(kpg_bytes / buf_entry_width / ((NvF32)buf_ent_per_bank)); + } + break; + + default: + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, + "Can't calculate Banks4Weight for unsupported Conv Mode: %s", + params().convMode().c_str()); + } + +fail: + return min_b4w; +} + +NvU16 engine_ast::ConvCoreNode::calculateTotalBanksForWeight(surface::TensorSurfaceDesc* wt_tsd) +{ + NvDlaError e = NvDlaSuccess; + NVDLA_UNUSED(e); + NvU8 bpe = wt_tsd->surfaceFormat().bytesPerElement(); + NvU16 needed_b4w = 0; + NvU32 buf_ent_per_bank = graph()->target_config()->bufEntriesPerBank(); + NvU32 buf_entry_width = graph()->target_config()->bufEntryWidth(); + + ASSERT(std::string(wt_tsd->surfaceFormat().c_str()).find("COMPRESSED") == std::string::npos); + + // compute how many banks are necessary to store entire weight data + switch(params().convMode().v()) + { + case ConvolutionModeEnum::CONV_WINOGRAD: { + NvU32 krnl_width_ext = (NvU32)ceil((NvF32)wt_tsd->dimensions().w/params().stride().w); + NvU32 krnl_height_ext = (NvU32)ceil((NvF32)wt_tsd->dimensions().h/params().stride().h); + NvU32 krnl_chnl = ROUNDUP_AND_ALIGN(wt_tsd->dimensions().c * bpe, 32) / bpe; + NvU32 krnl_chnl_ext = krnl_chnl * params().stride().w * params().stride().h; + + ASSERT(krnl_width_ext == 3); + ASSERT(krnl_height_ext == 3); + + // 4x4 because the pre-transformed kernel is always 4x4 + needed_b4w = (NvU16)ceil(4 * 4 * krnl_chnl_ext * bpe * wt_tsd->dimensions().n / 128 / 256.0); + }; break; + case ConvolutionModeEnum::CONV_DIRECT: { + // weight_bank has the same formula for image input/DC + NvU64 total_krnl_bytes = ROUNDUP_AND_ALIGN(wt_tsd->dimensions().n * + wt_tsd->dimensions().c * + wt_tsd->dimensions().h * + wt_tsd->dimensions().w * + bpe, buf_entry_width); + needed_b4w = (NvU16)ceil(total_krnl_bytes / buf_entry_width / (NvF32)(buf_ent_per_bank)); + }; break; + default: + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Can't calculate Banks4Weight for unsupported Conv Mode: %s", params().convMode().c_str()); + } + +fail: + return needed_b4w; +} + +NvDlaError engine_ast::ConvCoreNode::verifyPartialHInfo +( + const std::vector& splitChunks, + bool isWinograd +) +{ + NvDlaError e = NvDlaSuccess; + + surface::TensorSurfaceDesc *srcTSD = graph()->nodeInputTensorSurface(this, 0, supportedInSurfCategories()); + surface::TensorSurfaceDesc *weightTSD = graph()->nodeInputTensorSurface(this, 0, supportedAuxSurfCategories()); + + bool isIMGConv = false; + NvS32 dilatedWeightH = 0; + NvU32 unsplitNumConvs = 0; + NvU32 splitNumConvs = 0; + std::vector::const_iterator itr; + + isIMGConv = srcTSD->surfaceFormat().category().v() == surface::SurfaceCategoryEnum::IMG; + + if (isIMGConv) + { + NvS32 unswizzledWeightH = params().weightDims().h; + dilatedWeightH = (unswizzledWeightH - 1)*params().dilation().h + 1; + } + else + { + dilatedWeightH = (weightTSD->dimensions().h - 1)*params().dilation().h + 1; + } + + NvU32 unsplitConvSlider = dilatedWeightH - 1 - params().topLeftPadding().h; + while(unsplitConvSlider <= (NvU32)(srcTSD->dimensions().h + params().bottomRightPadding().h - 1)) + { + unsplitConvSlider += params().stride().h; + unsplitNumConvs++; + } + + if (isWinograd) + { + for(itr = splitChunks.begin(); itr != splitChunks.end(); ++itr) + { + NvS32 pHId = std::distance(splitChunks.begin(), itr); + NvS32 prevPHOutHt = !pHId ? 0 : (*(itr - 1)).outDims.h; + NvS32 convYStr = params().stride().h; + NvS32 topPadding = params().topLeftPadding().h; + if ((*itr).topSliceID > (*itr).bottomSliceID) + { + gLogInfo << "pH-" << std::distance(splitChunks.begin(), itr) << " has " + << "topSlice Id (" << (*itr).topSliceID << ") > " + << "bottomSlice Id (" << (*itr).bottomSliceID << ")" << endl; + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Partial-H data split logic made some mistake for %s!!!", name().c_str()); + } + + bool topSliceIdOk = !pHId ? ((*itr).topSliceID == 0) : ((*itr).topSliceID == ((pHId * prevPHOutHt * convYStr) - topPadding)); + if ( !topSliceIdOk ) + { + gLogInfo << "pH-" << pHId << " top slide-id: " << (*itr).topSliceID << " doesn't match " + "standard formula " << (!pHId ? 0 : (pHId * prevPHOutHt * convYStr - topPadding)) << endl; + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Partial-H data split logic made some mistake for %s!!!", name().c_str()); + } + + ASSERT((*itr).wtBanks + (*itr).dataBanks <= graph()->target_config()->bufBankAllotted()); + } + } + else + { + for(itr = splitChunks.begin(); itr != splitChunks.end(); ++itr) + { + if ((*itr).topSliceID > (*itr).bottomSliceID) + { + gLogInfo << "pH-" << std::distance(splitChunks.begin(), itr) << " has " + << "topSlice Id (" << (*itr).topSliceID << ") > " + << "bottomSlice Id (" << (*itr).bottomSliceID << ")" << endl; + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Partial-H data split logic made some mistake!!!"); + } + + ASSERT((*itr).wtBanks + (*itr).dataBanks <= graph()->target_config()->bufBankAllotted()); + + splitNumConvs += (*itr).numConvs; + } + + if ( splitNumConvs != unsplitNumConvs ) + { + gLogInfo << "unsplit num convs(" << unsplitNumConvs << ") != " + << "split num convs(" << splitNumConvs << ")" << endl; + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Partial-H data split logic made some mistake!!!"); + } + } + +fail: + return e; +} + +}; // nvdla::priv:: +}; // nvdla:: diff --git a/umd/core/src/compiler/engine-ast/ConvolutionOp.cpp b/umd/core/src/compiler/engine-ast/ConvolutionOp.cpp new file mode 100644 index 00000000..3bb0c39c --- /dev/null +++ b/umd/core/src/compiler/engine-ast/ConvolutionOp.cpp @@ -0,0 +1,619 @@ +/* + * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#include + +#include "priv/EngineAST.h" +#include "priv/Profile.h" +#include "priv/TargetConfig.h" +#include "priv/Tensor.h" +#include "priv/Compiler.h" +#include "priv/WeightTranslationUnit.h" +#include "ErrorMacros.h" + +using std::endl; + +namespace nvdla +{ +namespace priv +{ + +void engine_ast::ConvCoreConvolutionOpNode::captureCanonicalParams() +{ + params().setHasBiasTerm(canonicalNode()->params().hasBiasTerm() == true ? 1 : 0); + params().setWeightDims(canonicalNode()->params().weightDims()); + params().setTopLeftPadding(canonicalNode()->params().topLeftPadding()); + params().setBottomRightPadding(canonicalNode()->params().bottomRightPadding()); + params().setPaddingValue(canonicalNode()->params().paddingValue()); + params().setStride(canonicalNode()->params().stride()); + params().setDilation(canonicalNode()->params().dilation()); + params().setRawWeights(canonicalNode()->params().weights()); + params().setDLAWeights(Weights(DataType::FLOAT, NULL, 0)); + params().setNumGroups(canonicalNode()->params().numGroups()); + + captureCanonicalWeights(); +} + +void engine_ast::ConvCoreConvolutionOpNode::inheritParams(Node* otherNode) +{ + // inherit the parameters that make sense (keep adding later) + ConvCoreConvolutionOpNode* otherConv = NodeFactory::nodeCast(otherNode); + params().setPostExtension(otherConv->params().postExtension()); + params().setConvMode(otherConv->params().convMode()); + params().setWinogradParams(otherConv->params().winogradParams()); + params().setNumGroups(otherConv->params().numGroups()); +} + +NvDlaError engine_ast::ConvCoreConvolutionOpNode::fallbackWGConvToDC() +{ + NvDlaError e = NvDlaSuccess; + canonical_ast::ConvolutionNode* canConvNode = NULL; + engine_ast::SDPNode* fusedSDPNode = NULL; + surface::TensorSurfaceDesc* wtTSD = NULL; + surface::TensorSurfaceDesc* streamTSD = NULL; + surface::TensorSurfaceDesc* dstTSD = NULL; + + PROPAGATE_ERROR_FAIL( verifyEdgePorts() ); + + canConvNode = canonicalNode(); + fusedSDPNode = engine_ast::NodeFactory::nodeCast(dependencyParams().fusedNode(engine_ast::IODirectionEnum::OUTPUT)); + + wtTSD = auxEdges().at(0)->tensorSurfaceDesc(); + streamTSD = outputEdges().at(0)->tensorSurfaceDesc(); + dstTSD = fusedSDPNode->outputEdges().at(0)->tensorSurfaceDesc(); + + // Step-1: Change mode of conv and the associated SDP to DC + params().setConvMode(ConvolutionModeEnum::CONV_DIRECT); + fusedSDPNode->params().setConvMode(ConvolutionModeEnum::CONV_DIRECT); + setName("dc-conv-" + name().substr(name().find("wg-conv-") + 8)); + + // Step-2: Change the padding values of the op back to that set by network + params().setTopLeftPadding(canConvNode->params().topLeftPadding()); + params().setBottomRightPadding(canConvNode->params().bottomRightPadding()); + + // Step-3: Reset and redetermine surface and buffer details that differ between DC and WG modes + wtTSD->resetSurfaceFormat(); + wtTSD->resetSize(); + wtTSD->tensorBufferDesc()->resetSize(); + streamTSD->resetSize(); + streamTSD->tensorBufferDesc()->resetSize(); + dstTSD->resetSize(); + dstTSD->tensorBufferDesc()->resetSize(); + PROPAGATE_ERROR_FAIL( graph()->refreshGraphState() ); + + // Step-4: If weights are already rearranged assuming WG mode, then reset and rearrange them as per DC. + if ( params().DLAWeights().values != NULL ) + { + params().setDLAWeights(Weights(nvdla::DataType::FLOAT, NULL, 0)); + PROPAGATE_ERROR_FAIL( translateAuxData() ); + } + +fail: + return e; +} + +NvDlaError engine_ast::ConvCoreConvolutionOpNode::emitOp(Graph *g, + DLAInterface *target_dla, + NvU32 op_slot, NvU32 batch_id, + DLACommonOpDescAccessor dep, + DLAOperationContainerAccessor op, + DLASurfaceContainerAccessor surf) +{ + NvDlaError e = NvDlaSuccess; + + DLAConvOpDescAccessor conv_op = op.convOpDescAccessor(0); + DLACVTParamAccessor out_cvt_acc = conv_op.outCVTAccessor(); + DLACVTParamAccessor in_cvt_acc = conv_op.inCVTAccessor(); + DLAConvSurfaceDescAccessor surf_acc = surf.convSurfaceDescAccessor(0); + DLADataCubeAccessor src_data_acc = surf_acc.srcDataAccessor(); + DLADataCubeAccessor dst_data_acc = surf_acc.dstDataAccessor(); + DLADataCubeAccessor weight_data_acc = surf_acc.weightDataAccessor(); + DLADataCubeAccessor wmb_data_acc = surf_acc.wmbDataAccessor(); + DLADataCubeAccessor wgs_data_acc = surf_acc.wgsDataAccessor(); + DLAConsumerAccessor fused_acc = dep.fusedParentAccessor(); + NVDLA_UNUSED(wmb_data_acc); + NVDLA_UNUSED(wgs_data_acc); + NVDLA_UNUSED(fused_acc); + + surface::TensorSurfaceDesc *src_tsd = g->nodeInputTensorSurface(this, 0, supportedInSurfCategories()); + surface::TensorSurfaceDesc *dst_tsd = g->nodeOutputTensorSurface(this, 0, supportedOutSurfCategories()); + surface::TensorSurfaceDesc *weight_tsd = g->nodeInputTensorSurface(this, 0, supportedAuxSurfCategories()); + + *conv_op.padVal() = params(batch_id).paddingValue(); + *conv_op.skipDataRls() = !params(batch_id).isReleaseData(); + *conv_op.skipWeightRls()= !params(batch_id).isReleaseWeights(); + *conv_op.dataReuse() = params(batch_id).isReuseData(); + *conv_op.weightReuse() = params(batch_id).isReuseWeights(); + *conv_op.batch() = 1; + *conv_op.dilationX() = params(batch_id).dilation().w; + *conv_op.dilationY() = params(batch_id).dilation().h; + *conv_op.padXLeft() = params(batch_id).topLeftPadding().w; + *conv_op.padXRight() = params(batch_id).bottomRightPadding().w; + *conv_op.padYTop() = params(batch_id).topLeftPadding().h; + *conv_op.padYBottom() = params(batch_id).bottomRightPadding().h; + *conv_op.meanFormat() = conv_op.meanFormat_Disable(); + + *in_cvt_acc.scale() = params().convCoreCVT().inputCVT().scale(); + *in_cvt_acc.truncate() = params().convCoreCVT().inputCVT().truncate(); + *in_cvt_acc.enable() = (int)params().convCoreCVT().inputCVT().isEnable(); + *in_cvt_acc.offset() = params().convCoreCVT().inputCVT().offset(); + + *out_cvt_acc.scale() = 1; + *out_cvt_acc.truncate() = params().convCoreCVT().outTruncate(); + *out_cvt_acc.enable() = 1; + *out_cvt_acc.offset() = 0; + + /* Common parameters */ + *conv_op.inPrecision() = ASTToDLAInterface::getConvCorePrecision(target_dla, src_tsd->surfaceFormat().precision()); + *conv_op.outPrecision() = ASTToDLAInterface::getConvCorePrecision(target_dla, dst_tsd->surfaceFormat().precision()); + *conv_op.fetchGrain() = 1; //std::max(1, (params(batch_id).dataBanksAllotted() * 256 / calculateEPS(src_tsd)) - 1); //FIXME: its safest/minimum right now + *conv_op.dataFormat() = ASTToDLAInterface::getDataFormat(target_dla, src_tsd->surfaceFormat()); + *conv_op.pixelOverride() = target_dla->convOpDescAccessor(0).pixelOverride_INT(); + *conv_op.weightFormat() = conv_op.weightFormat_Uncompressed(); + *conv_op.convStrideX() = params(batch_id).stride().w; + *conv_op.convStrideY() = params(batch_id).stride().h; + *conv_op.inputWidthCMAC() = dst_tsd->dimensions().w; + *conv_op.inputHeightCMAC() = dst_tsd->dimensions().h; + *conv_op.bytesPerKernel() = surface::WeightDesc::bytesPerKernel(weight_tsd); + *conv_op.postExtension() = params(batch_id).postExtension() / 2; + + if ( (src_tsd->surfaceFormat().category() == surface::SurfaceCategoryEnum::FEATURE_DATA) && + (src_tsd->dimensions().c != weight_tsd->dimensions().c) ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Src channels %d != weight channels %d for %s", + src_tsd->dimensions().c, weight_tsd->dimensions().c, + name().c_str()); + } + else if ( (src_tsd->surfaceFormat().category() == surface::SurfaceCategoryEnum::IMG) && + (weight_tsd->dimensions().w != 1)) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Weight channels %d != 1 for %s", + weight_tsd->dimensions().c, + name().c_str()); + } + + if ( params(batch_id).convMode().v() == ConvolutionModeEnum::CONV_DIRECT ) + { + /* Parameters for DC Convolution */ + surface::SurfaceCategory sc = src_tsd->surfaceFormat().category(); + params(batch_id).setConvMode(ConvolutionModeEnum::CONV_DIRECT); + *conv_op.convMode() = conv_op.convMode_Direct(); + *conv_op.inputWidthCSC() = src_tsd->dimensions().w; + *conv_op.inputHeightCSC() = src_tsd->dimensions().h; + *conv_op.inputChannelCSC() = src_tsd->dimensions().c; + *conv_op.kernelHeightCSC() = weight_tsd->dimensions().h; + *conv_op.kernelWidthCSC() = weight_tsd->dimensions().w; + *conv_op.kernelChannelCSC() = weight_tsd->dimensions().c; + + switch(sc.v()) + { + case surface::SurfaceCategoryEnum::IMG: + { + surface::PixelMapping src_pm = surface::IMGDesc::pixelMapping(src_tsd); + switch(src_pm.v()) + { + case surface::PixelMappingEnum::PITCH_LINEAR: + { + *conv_op.pixelMapping() = conv_op.pixelMapping_PitchLinear(); + }; break; + default: + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, + "Unsupported pixel mapping: %s for Conv Src Tensor", + src_pm.c_str()); + } + } break; + case surface::SurfaceCategoryEnum::FEATURE_DATA: + { + *conv_op.pixelMapping() = conv_op.pixelMapping_PitchLinear(); + } break; + default: + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, + "Unsupported input surface category: %s for Conv Src Tensor", + sc.c_str()); + } + } + else if ( params(batch_id).convMode().v() == ConvolutionModeEnum::CONV_WINOGRAD ) + { + /* Parameter for WG Convolution */ + params(batch_id).setConvMode(ConvolutionModeEnum::CONV_WINOGRAD); + *conv_op.convMode() = conv_op.convMode_Winograd(); + + *conv_op.kernelHeightCSC() = 4; + *conv_op.kernelWidthCSC() = 4; + *conv_op.kernelChannelCSC() = params().winogradParams().auxDims.c; + + *conv_op.inputWidthCSC() = params().winogradParams().inDims.w; + *conv_op.inputHeightCSC() = params().winogradParams().inDims.h; + *conv_op.inputChannelCSC() = params().winogradParams().inDims.c; + + *conv_op.inputWidthCMAC() = params().winogradParams().outDims.w; + *conv_op.inputHeightCMAC() = params().winogradParams().outDims.h; + surface::TensorSurfaceDesc tempWGAuxTSD = *weight_tsd; + tempWGAuxTSD.setDimensions(params().winogradParams().auxDims); + *conv_op.bytesPerKernel() = surface::WeightDesc::bytesPerKernel(&tempWGAuxTSD); + } + else + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unsupported Conv mode for %s", name().c_str()); + } + + /* entry-per-slice & banks should be calculated after conv-mode is determined */ + *conv_op.entryPerSlice()= calculateEPS(src_tsd); + *conv_op.dataBank() = params(batch_id).dataBanksAllotted(); + *conv_op.weightBank() = params(batch_id).weightBanksAllotted(); + // FIXME: When data reuse is ON, release slices should be non-overlapping slices between 2 pH layers + *conv_op.release() = *conv_op.inputHeightCSC() /*- params(batch_id).retainSlices()*/; + + emitDependencyParams(target_dla, dep, batch_id); + setDataCubeAccessor(src_data_acc, src_tsd, IODirectionEnum::INPUT, batch_id); + setDataCubeAccessor(weight_data_acc, weight_tsd, IODirectionEnum::UNKNOWN, batch_id); + setDataCubeAccessor(dst_data_acc, dst_tsd, IODirectionEnum::OUTPUT, batch_id); + + if ( params(batch_id).convMode().v() == ConvolutionModeEnum::CONV_WINOGRAD ) + { + *dst_data_acc.width() = params().winogradParams().outDims.w; + *dst_data_acc.height() = params().winogradParams().outDims.h; + *dst_data_acc.channel() = params().winogradParams().outDims.c; + + *weight_data_acc.width() = params().winogradParams().auxDims.w; + *weight_data_acc.height() = params().winogradParams().auxDims.h; + *weight_data_acc.channel() = params().winogradParams().auxDims.c; + } + + if ( g->debugOps() ) + { + gLogInfo << "Convolution node @ op_slot = " << op_slot << " batch_id = " << batch_id << endl; + gLogInfo << "\tsrc data loc: " << (int) *src_data_acc.type() << endl; + gLogInfo << "\tdst data loc: " << (int) *dst_data_acc.type() << endl; + gLogInfo << "\tpost y extension: " << (int)*conv_op.postExtension() << endl; + gLogInfo << "\tin_precision " << (int)*conv_op.inPrecision() << endl; + gLogInfo << "\tout_precision " << (int)*conv_op.outPrecision() << endl; + gLogInfo << "\tpad_val " << (int)*conv_op.padVal() << endl; + gLogInfo << "\tconv mode " << (int)*conv_op.convMode() << endl; + gLogInfo << "\tdata_reuse " << (int)*conv_op.dataReuse() << endl; + gLogInfo << "\tweight_reuse " << (int)*conv_op.weightReuse() << endl; + gLogInfo << "\tskip_data_rls " << (int)*conv_op.skipDataRls() << endl; + gLogInfo << "\tskip_wt_rls " << (int)*conv_op.skipWeightRls() << endl; + gLogInfo << "\teps " << *conv_op.entryPerSlice() << endl; + gLogInfo << "\tfetch_grain " << (int)*conv_op.fetchGrain() << endl; + gLogInfo << "\tdata_format " << (int)*conv_op.dataFormat() << endl; + gLogInfo << "\tpixel_mapping " << (int)*conv_op.pixelMapping() << endl; + gLogInfo << "\tbatch " << (int)*conv_op.batch() << endl; + gLogInfo << "\tweight_format " << (int)*conv_op.weightFormat() << endl; + gLogInfo << "\tb4d " << (int)*conv_op.dataBank() << endl; + gLogInfo << "\tb4w " << (int)*conv_op.weightBank() << endl; + gLogInfo << "\tbatch_stride " << (int)*conv_op.batchStride() << endl; + gLogInfo << "\trelease " << (int)*conv_op.release() << endl; + gLogInfo << "\tpost_extension " << (int)*conv_op.postExtension() << endl; + gLogInfo << "\tpixel_override " << (int)*conv_op.pixelOverride() << endl; + gLogInfo << "\tmean_format " << (int)*conv_op.meanFormat() << endl; + gLogInfo << "\tstride-x " << (int)*conv_op.convStrideX() << endl; + gLogInfo << "\tstride-y " << (int)*conv_op.convStrideY() << endl; + gLogInfo << "\tpad-left " << (int)*conv_op.padXLeft() << endl; + gLogInfo << "\tpad-top " << (int)*conv_op.padYTop() << endl; + gLogInfo << "\tpad-right " << (int)*conv_op.padXRight() << endl; + gLogInfo << "\tpad-bottom " << (int)*conv_op.padYBottom() << endl; + gLogInfo << "\tdilationx-x " << (int)*conv_op.dilationX() << endl; + gLogInfo << "\tdilation-y " << (int)*conv_op.dilationY() << endl; + gLogInfo << "\tpra_truncate " << (int)*conv_op.praTruncate() << endl; + gLogInfo << "\tinputwidthcsc " << *conv_op.inputWidthCSC() << endl; + gLogInfo << "\tinputheightcsc " << *conv_op.inputHeightCSC() << endl; + gLogInfo << "\tinputchannelcsc " << *conv_op.inputChannelCSC() << endl; + gLogInfo << "\tkernelwidthcsc " << *conv_op.kernelWidthCSC() << endl; + gLogInfo << "\tkernelheightcsc " << *conv_op.kernelHeightCSC() << endl; + gLogInfo << "\tkernelchannelcsc " << *conv_op.kernelChannelCSC() << endl; + gLogInfo << "\tinputwidthcmac " << *conv_op.inputWidthCMAC() << endl; + gLogInfo << "\tinputheightcmac " << *conv_op.inputHeightCMAC() << endl; + gLogInfo << "\tbytesperkernel " << *conv_op.bytesPerKernel() << endl; + gLogInfo << "\toffsetU " << (int)*surf_acc.offsetU() << endl; + gLogInfo << "\tdependencyCount " << (int)*dep.dependencyCount() << endl; + gLogInfo << "\tsrc tsd:" << src_tsd->id() << endl; + gLogInfo << "\tsrc addr=" << *src_data_acc.address() << endl; + gLogInfo << "\tsrc size " << *src_data_acc.size() << endl; + gLogInfo << "\tsrc width " << *src_data_acc.width() << endl; + gLogInfo << "\tsrc height " << *src_data_acc.height() << endl; + gLogInfo << "\tsrc channel " << *src_data_acc.channel() << endl; + gLogInfo << "\tsrc linestride " << *src_data_acc.lineStride() << endl; + gLogInfo << "\tsrc surfstride " << *src_data_acc.surfStride() << endl; + gLogInfo << "\tdst tsd:" << dst_tsd->id() << endl; + gLogInfo << "\tdst addr=" << *dst_data_acc.address() << endl; + gLogInfo << "\tdst size " << *dst_data_acc.size() << endl; + gLogInfo << "\tdst width " << *dst_data_acc.width() << endl; + gLogInfo << "\tdst height " << *dst_data_acc.height() << endl; + gLogInfo << "\tdst channel " << *dst_data_acc.channel() << endl; + gLogInfo << "\tdst linestride " << *dst_data_acc.lineStride() << endl; + gLogInfo << "\tdst surfstride " << *dst_data_acc.surfStride() << endl; + gLogInfo << "\twt tsd:" << weight_tsd->id() << endl; + gLogInfo << "\tweight addr=" << *weight_data_acc.address() <nodeInputTensorSurface(this, 0, supportedInSurfCategories()); + surface::TensorSurfaceDesc *dst_tsd = graph()->nodeOutputTensorSurface(this, 0, supportedOutSurfCategories()); + surface::TensorSurfaceDesc *weight_tsd = graph()->nodeInputTensorSurface(this, 0, supportedAuxSurfCategories()); + + nvdla_prototest_interface::CONVOpDesc* protoConvOpDesc = protoLayer->mutable_op_config()->mutable_conv_op(); + nvdla_prototest_interface::CONVSurfaceDesc* protoConvSurfDesc = protoLayer->mutable_surface()->mutable_conv_surface(); + nvdla_prototest_interface::DataCube* protoWtDataCube = protoConvSurfDesc->mutable_weight_data(); + nvdla_prototest_interface::DataCube* protoSrcDataCube = protoConvSurfDesc->mutable_src_data(); + nvdla_prototest_interface::DataCube* protoDstDataCube = protoConvSurfDesc->mutable_dst_data(); + + nvdla_prototest_interface::DataPrecision protoInPrec, protoOutPrec; + + protoLayer->set_index(op_slot); + protoLayer->set_roi_index(0); + protoLayer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_CONV); + protoLayer->set_dependency_count(*dep.dependencyCount()); + + /* consumers */ + for (size_t c = 0; c < EngineType::num_elements(); c++) + { + NvS8 fw_op_index = ASTToDLAInterface::getEngineType(target_dla, c); + if ( fw_op_index < 0 ) + { + continue; + } + + DLAConsumerAccessor cons_acc = dep.consumerAccessor(fw_op_index); + if (*cons_acc.index() != -1) + { + nvdla_prototest_interface::Consumer* protoConsumer = protoLayer->add_bottom(); + protoConsumer->set_index(*cons_acc.index()); + switch(c) + { + case EngineTypeEnum::BDMA : protoConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_BDMA); break; + case EngineTypeEnum::CONVOLUTION : protoConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_CONV); break; + case EngineTypeEnum::SDP : protoConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_SDP); break; + case EngineTypeEnum::PDP : protoConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_PDP); break; + case EngineTypeEnum::CDP : protoConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_CDP); break; + case EngineTypeEnum::RUBIK: protoConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_RUBIK); break; + default: ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unrecognized consumer"); + } + switch(dependencyParams().consumer(c).opEvent().v()) + { + case OperationEventTypeEnum::OP_CDMA_WEIGHT_DONE : protoConsumer->set_event(nvdla_prototest_interface::Consumer_EventType::Consumer_EventType_CDMA_WT_DONE); break; + case OperationEventTypeEnum::OP_CDMA_DATA_DONE : protoConsumer->set_event(nvdla_prototest_interface::Consumer_EventType::Consumer_EventType_CDMA_DT_DONE); break; + case OperationEventTypeEnum::OP_COMPLETED : protoConsumer->set_event(nvdla_prototest_interface::Consumer_EventType::Consumer_EventType_OP_COMPLETED); break; + case OperationEventTypeEnum::OP_ENABLED : protoConsumer->set_event(nvdla_prototest_interface::Consumer_EventType::Consumer_EventType_OP_ENABLED); break; + case OperationEventTypeEnum::OP_PROGRAMMED : protoConsumer->set_event(nvdla_prototest_interface::Consumer_EventType::Consumer_EventType_OP_PROGRAMMED); break; + default: ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unrecognized consumer event"); + } + } + } + + /* Fused operation NOP */ + + switch(src_tsd->surfaceFormat().precision().v()) + { + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_FP16 : protoInPrec = nvdla_prototest_interface::DataPrecision::PRECISION_FP16; break; + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16 : protoInPrec = nvdla_prototest_interface::DataPrecision::PRECISION_INT16; break; + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8 : protoInPrec = nvdla_prototest_interface::DataPrecision::PRECISION_INT8; break; + default: ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unrecognized input precision"); + } + + switch(dst_tsd->surfaceFormat().precision().v()) + { + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_FP16 : protoOutPrec = nvdla_prototest_interface::DataPrecision::PRECISION_FP16; break; + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16 : protoOutPrec = nvdla_prototest_interface::DataPrecision::PRECISION_INT16; break; + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8 : protoOutPrec = nvdla_prototest_interface::DataPrecision::PRECISION_INT8; break; + default: ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unrecognized output precision"); + } + + protoConvOpDesc->set_in_precision(protoInPrec); + protoConvOpDesc->set_out_precision(protoOutPrec); + protoConvOpDesc->set_pad_val(*conv_op.padVal()); + + switch(params(batch_id).convMode().v()) + { + case ConvolutionModeEnum::CONV_DIRECT: protoConvOpDesc->set_conv_mode(nvdla_prototest_interface::ConvMode::DIRECT); break; + case ConvolutionModeEnum::CONV_WINOGRAD: protoConvOpDesc->set_conv_mode(nvdla_prototest_interface::ConvMode::WINOGRAD); break; + default: ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unrecognized conv mode"); + } + + protoConvOpDesc->set_data_reuse(*conv_op.dataReuse()); + protoConvOpDesc->set_weight_reuse(*conv_op.weightReuse()); + protoConvOpDesc->set_skip_data_rls(*conv_op.skipDataRls()); + protoConvOpDesc->set_skip_weight_rls(*conv_op.skipWeightRls()); + protoConvOpDesc->set_entry_per_slice(*conv_op.entryPerSlice()); + protoConvOpDesc->set_fetch_grain(*conv_op.fetchGrain()); + + switch(src_tsd->surfaceFormat().v()) + { + case surface::SurfaceFormatEnum::NVDLA_IMG_R8: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_R8); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_R10: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_R10); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_R12: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_R12); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_R16: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_R16); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_R16_I: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_R16_I); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_R16_F: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_R16_F); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_A16B16G16R16: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_A16B16G16R16); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_X16B16G16R16: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_X16B16G16R16); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_A16B16G16R16_F: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_A16B16G16R16_F); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_A16Y16U16V16: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_A16Y16U16V16); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_V16U16Y16A16: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_V16U16Y16A16); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_A16Y16U16V16_F: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_A16Y16U16V16_F); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_A8B8G8R8: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_A8B8G8R8); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_A8R8G8B8: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_A8R8G8B8); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_B8G8R8A8: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_B8G8R8A8); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_R8G8B8A8: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_R8G8B8A8); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_X8B8G8R8: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_X8B8G8R8); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_X8R8G8B8: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_X8R8G8B8); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_B8G8R8X8: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_B8G8R8X8); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_R8G8B8X8: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_R8G8B8X8); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_A2B10G10R10: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_A2B10G10R10); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_A2R10G10B10: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_A2R10G10B10); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_B10G10R10A2: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_B10G10R10A2); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_R10G10B10A2: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_R10G10B10A2); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_A2Y10U10V10: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_A2Y10U10V10); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_V10U10Y10A2: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_V10U10Y10A2); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_A8Y8U8V8: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_A8Y8U8V8); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_V8U8Y8A8: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_V8U8Y8A8); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_Y8___U8V8_N444: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_Y8___U8V8_N444); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_Y8___V8U8_N444: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_Y8___V8U8_N444); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_Y10___U10V10_N444: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_Y10___U10V10_N444); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_Y10___V10U10_N444: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_Y10___V10U10_N444); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_Y12___U12V12_N444: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_Y12___U12V12_N444); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_Y12___V12U12_N444: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_Y12___V12U12_N444); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_Y16___U16V16_N444: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_Y16___U16V16_N444); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_Y16___V16U16_N444: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_Y16___V16U16_N444); break; + case surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_INT8: + case surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_INT16: + case surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_FP16: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_FEATURE); break; + default: REPORT_ERROR(NvDlaError_BadParameter, "Unsupported surface format provided %s", src_tsd->surfaceFormat().c_str()); + } + + protoConvOpDesc->mutable_in_cvt()->set_enable(*in_cvt_acc.enable()); + protoConvOpDesc->mutable_in_cvt()->set_truncate(*in_cvt_acc.truncate()); + protoConvOpDesc->mutable_in_cvt()->set_scale(*in_cvt_acc.scale()); + protoConvOpDesc->mutable_in_cvt()->set_offset(*in_cvt_acc.offset()); + + protoConvOpDesc->mutable_out_cvt()->set_enable(*out_cvt_acc.enable()); + protoConvOpDesc->mutable_out_cvt()->set_truncate(*out_cvt_acc.truncate()); + protoConvOpDesc->mutable_out_cvt()->set_scale(*out_cvt_acc.scale()); + protoConvOpDesc->mutable_out_cvt()->set_offset(*out_cvt_acc.offset()); + + /* FIXME: dynamically figure out pitch-linear */ + protoConvOpDesc->set_pixel_mapping(nvdla_prototest_interface::ConvPixelMAP::PITCH_LINEAR); + protoConvOpDesc->set_pixel_offset_x(graph()->profile()->networkInputPixelOffX()); + protoConvOpDesc->set_pixel_offset_y(graph()->profile()->networkInputPixelOffY()); + protoConvOpDesc->set_batch(1); + protoConvOpDesc->set_weight_format(nvdla_prototest_interface::WeightFormat::UNCOMPRESSED); + protoConvOpDesc->set_weight_bank(*conv_op.weightBank()); + protoConvOpDesc->set_data_bank(*conv_op.dataBank()); + protoConvOpDesc->set_batch_stride(0); + protoConvOpDesc->set_release(*conv_op.release()); + protoConvOpDesc->set_post_extension(*conv_op.postExtension()); + protoConvOpDesc->set_pixel_override(nvdla_prototest_interface::PixelOverride::OVERRIDE_UINT); + protoConvOpDesc->set_mean_format(nvdla_prototest_interface::MeanFormat::MEAN_DISABLE); + protoConvOpDesc->set_mean_ax(0); + protoConvOpDesc->set_mean_bv(0); + protoConvOpDesc->set_mean_gu(0); + protoConvOpDesc->set_mean_ry(0); + protoConvOpDesc->set_conv_stride_x(*conv_op.convStrideX()); + protoConvOpDesc->set_conv_stride_y(*conv_op.convStrideY()); + protoConvOpDesc->set_pad_x_left(*conv_op.padXLeft()); + protoConvOpDesc->set_pad_x_right(*conv_op.padXRight()); + protoConvOpDesc->set_pad_y_bottom(*conv_op.padYBottom()); + protoConvOpDesc->set_pad_y_top(*conv_op.padYTop()); + protoConvOpDesc->set_dilation_x(*conv_op.dilationX()); + protoConvOpDesc->set_dilation_y(*conv_op.dilationY()); + protoConvOpDesc->set_pra_truncate(*conv_op.praTruncate()); + protoConvOpDesc->set_input_width_csc(*conv_op.inputWidthCSC()); + protoConvOpDesc->set_input_height_csc(*conv_op.inputHeightCSC()); + protoConvOpDesc->set_input_channel_csc(*conv_op.inputChannelCSC()); + protoConvOpDesc->set_kernel_width_csc(*conv_op.kernelWidthCSC()); + protoConvOpDesc->set_kernel_height_csc(*conv_op.kernelHeightCSC()); + protoConvOpDesc->set_kernel_channel_csc(*conv_op.kernelChannelCSC()); + protoConvOpDesc->set_input_width_cmac(*conv_op.inputWidthCMAC()); + protoConvOpDesc->set_input_height_cmac(*conv_op.inputHeightCMAC()); + protoConvOpDesc->set_bytes_per_kernel(*conv_op.bytesPerKernel()); + + protoConvSurfDesc->set_offset_u(*surf_acc.offsetU()); + + protoWtDataCube->set_type(nvdla_prototest_interface::MemType::DLA_MEM_MC); + protoWtDataCube->set_address(*weight_data_acc.address()); + protoWtDataCube->set_size(*weight_data_acc.size()); + protoWtDataCube->set_width(*weight_data_acc.width()); + protoWtDataCube->set_height(*weight_data_acc.height()); + protoWtDataCube->set_channel(*weight_data_acc.channel()); + protoWtDataCube->set_line_stride(*weight_data_acc.lineStride()); + protoWtDataCube->set_surf_stride(*weight_data_acc.surfStride()); + protoWtDataCube->set_plane_stride(*weight_data_acc.planeStride()); + protoWtDataCube->mutable_mem_info()->set_mem_id(weight_tsd->tensorBufferDesc()->memoryId(batch_id)); + protoWtDataCube->mutable_mem_info()->set_mem_size(weight_tsd->tensorBufferDesc()->size()); + protoWtDataCube->mutable_mem_info()->set_offset(0); + protoWtDataCube->mutable_mem_info()->set_fill_type(nvdla_prototest_interface::FillerType::FILL_RANDOM); + protoWtDataCube->mutable_mem_info()->set_flag(nvdla_prototest_interface::MemFlag::DLA_MEM_SET); + protoWtDataCube->mutable_mem_info()->set_precision(protoInPrec); + + protoSrcDataCube->set_type(nvdla_prototest_interface::MemType::DLA_MEM_MC); + protoSrcDataCube->set_address(*src_data_acc.address()); + protoSrcDataCube->set_size(src_tsd->tensorBufferDesc()->size() - src_tsd->bufferOffset()); + protoSrcDataCube->set_width(*src_data_acc.width()); + protoSrcDataCube->set_height(*src_data_acc.height()); + protoSrcDataCube->set_channel(*src_data_acc.channel()); + protoSrcDataCube->set_line_stride(*src_data_acc.lineStride()); + protoSrcDataCube->set_surf_stride(*src_data_acc.surfStride()); + protoSrcDataCube->set_plane_stride(*src_data_acc.planeStride()); + protoSrcDataCube->mutable_mem_info()->set_mem_id(src_tsd->tensorBufferDesc()->memoryId(batch_id)); + protoSrcDataCube->mutable_mem_info()->set_mem_size(src_tsd->tensorBufferDesc()->size()); + protoSrcDataCube->mutable_mem_info()->set_offset(src_tsd->bufferOffset()); + protoSrcDataCube->mutable_mem_info()->set_fill_type(nvdla_prototest_interface::FillerType::FILL_RANDOM); + protoSrcDataCube->mutable_mem_info()->set_flag(nvdla_prototest_interface::MemFlag::DLA_MEM_SET); + protoSrcDataCube->mutable_mem_info()->set_precision(protoInPrec); + + protoDstDataCube->set_type(nvdla_prototest_interface::MemType::DLA_MEM_HW); + protoDstDataCube->set_address(*dst_data_acc.address()); + protoDstDataCube->set_size(dst_tsd->tensorBufferDesc()->size() - dst_tsd->bufferOffset()); + protoDstDataCube->set_width(*dst_data_acc.width()); + protoDstDataCube->set_height(*dst_data_acc.height()); + protoDstDataCube->set_channel(*dst_data_acc.channel()); + protoDstDataCube->set_line_stride(*dst_data_acc.lineStride()); + protoDstDataCube->set_surf_stride(*dst_data_acc.surfStride()); + protoDstDataCube->set_plane_stride(*dst_data_acc.planeStride()); + protoDstDataCube->mutable_mem_info()->set_mem_id(dst_tsd->tensorBufferDesc()->memoryId(batch_id)); + protoDstDataCube->mutable_mem_info()->set_mem_size(dst_tsd->tensorBufferDesc()->size()); + protoDstDataCube->mutable_mem_info()->set_offset(dst_tsd->bufferOffset()); +fail: + return e; +} +#endif + +}; // nvdla::priv:: +}; // nvdla:: diff --git a/umd/core/src/compiler/engine-ast/DeconvolutionOp.cpp b/umd/core/src/compiler/engine-ast/DeconvolutionOp.cpp new file mode 100644 index 00000000..1f312321 --- /dev/null +++ b/umd/core/src/compiler/engine-ast/DeconvolutionOp.cpp @@ -0,0 +1,667 @@ +/* + * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#include + +#include "priv/EngineAST.h" +#include "priv/Profile.h" +#include "priv/Tensor.h" +#include "priv/WeightTranslationUnit.h" + +#include "ErrorMacros.h" + +using std::endl; + +namespace nvdla +{ +namespace priv +{ + +void engine_ast::ConvCoreDeconvolutionOpNode::captureCanonicalParams() +{ + params().setHasBiasTerm(canonicalNode()->params().hasBiasTerm() == true ? 1 : 0); + params().setWeightDims(canonicalNode()->params().weightDims()); + params().setTopLeftPadding(canonicalNode()->params().topLeftPadding()); + params().setBottomRightPadding(canonicalNode()->params().bottomRightPadding()); + params().setPaddingValue(canonicalNode()->params().paddingValue()); + params().setStride(canonicalNode()->params().stride()); + params().setDilation(canonicalNode()->params().dilation()); + params().setRawWeights(canonicalNode()->params().weights()); + params().setDLAWeights(Weights(DataType::FLOAT, NULL, 0)); + params().setNumGroups(canonicalNode()->params().numGroups()); + captureCanonicalWeights(); +} + +void engine_ast::ConvCoreDeconvolutionOpNode::inheritParams(Node* otherNode) +{ + // inherit the parameters that make sense (keep adding later) + ConvCoreDeconvolutionOpNode* otherDeconv = NodeFactory::nodeCast(otherNode); + params().setStride(otherDeconv->params().stride()); + params().setConvMode(otherDeconv->params().convMode()); + // WG doesn't work with deconv - following is redundant + params().setWinogradParams(otherDeconv->params().winogradParams()); + params().setNumGroups(otherDeconv->params().numGroups()); +} + +/* + * DLA-CONV engine is used to implement software based deconvolution followed + * but Rubik engine in contract mode. Rubik likes to move 32B atoms in contract mode; + * as a result conv output should be laid out in a manner such that it + * accommodates the channel padding required by Rubik. As a result conv output + * should be dumped into a chnl aligned buffer (16 for fp16/int16 or 32 for int8) + */ +Dims4 engine_ast::ConvCoreDeconvolutionOpNode::suggestSurfaceDims(surface::TensorSurfaceDesc* tsd) +{ + NvDlaError e = NvDlaSuccess; + bool isSrcTSD = false; + bool isAuxTSD = false; + bool isDstTSD = false; + Dims4 suggestedDims(-1,-1,-1,-1); + NvU32 atom_k_size = graph()->target_config()->atomicKSize(); + NvU32 chnlAlign = graph()->profile()->computePrecision() == surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8 ? atom_k_size : atom_k_size / 2; + + PROPAGATE_ERROR_FAIL( verifyEdgePorts() ); + + isSrcTSD = inputEdges()[0]->tensorSurfaceDesc() == tsd; + isAuxTSD = auxEdges()[0]->tensorSurfaceDesc() == tsd; + isDstTSD = outputEdges()[0]->tensorSurfaceDesc() == tsd; + + if (!isSrcTSD && !isAuxTSD && !isDstTSD) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "TSD %s doesn't belong to %s", tsd->id().c_str(), name().c_str()); + } + + if (isSrcTSD || isAuxTSD) + { + suggestedDims = tsd->dimensions(); + } + else if (isDstTSD) + { + Dims4 chnlAlignedSurf = tsd->dimensions(); + chnlAlignedSurf.c = ROUNDUP_AND_ALIGN(chnlAlignedSurf.c, chnlAlign); + suggestedDims = chnlAlignedSurf; + } + +fail: + return suggestedDims; +} + +/* + * Deconvolution on DLA is performed as a series of convolution ops + * whose outputs are concatenated in C direction and later transformed by + * Rubik engine to shuffle bytes such that the final output is as desired. + */ +NvDlaError engine_ast::ConvCoreDeconvolutionOpNode::preProcessAuxData() +{ + NvDlaError e = NvDlaSuccess; + Edge* deconvAuxEdge = NULL; + NvU16 numSplits = 0; + Weights rawKCRSWts; + Weights rawCKRSWts; + Weights splitWts; + Dims4 origWtDims; + Dims4 splitSetWtDims; + std::vector< Weights > splitSetWts; + + surface::SurfacePrecision computePrecision = graph()->profile()->computePrecision(); + + PROPAGATE_ERROR_FAIL( verifyEdgePorts() ); + + /* Step-1: Caffe weights for deconv are laid out in CKRS format; + * Interchange the C and K dimensions to get to KCRS format (which matches + * caffe's Conv weight layout) since DLA performs Deconv as series of Convs + * such that: + * Strns = Sorig + * Rtrns = Rorig + * Ctrns = Korig + * Ktrns = Corig + */ + deconvAuxEdge = auxEdges()[0]; + rawCKRSWts = params().rawWeights(); + + { + WeightTrns::WeightDims kernelDims (rawCKRSWts.count, + params().weightDims().n, + params().weightDims().c, + params().weightDims().w, + params().weightDims().h, + (int)params().stride().w, + (int)params().stride().h); + + PRECISION_SWITCH(rawCKRSWts.type.v(), nvdla::DataType::FLOAT, rawKCRSWts, WeightTrns::convertWtsToKCRS, + kernelDims, + rawCKRSWts); + if (rawKCRSWts.values == NULL) + { + PROPAGATE_ERROR_FAIL(NvDlaError_BadValue, "Kernel Wt trnaslation failed for node '%s'", name().c_str()); + } + + params().setRawWeights(rawKCRSWts); + } + + /* + * Quantization of weights. + * Safer to call in preprocess aux data since no sdp math fusion possible. + */ + if (computePrecision.v() == surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8) + { + SDPNode* origFusedSDPNode = NodeFactory::nodeCast(graph()->downstreamDataNodes(this)[0]); + + if (origFusedSDPNode->engineOpType().v() == EngineOpTypeEnum::SDP_NOP) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, + "Expecting node other than SDP_NOP (to handle rescaling)"); + } + ConvCoreNode::quantizeAuxData(); + rawKCRSWts = params().rawWeights(); + } + + /* Step-2: The Deconv operation in DLA is performed as a series of Conv ops where + * + * #numSplits = deconv_x_stride * deconv_y_stride + * + * Distribute the weights into #numSplits sets such that: + * Ssplit = ceil(Strns/deconv_x_stride) + * Rsplit = ceil(Rtrns/deconv_y_stride) + * Csplit = Ctrns + * Ksplit = Ktrns + */ + + numSplits = params().stride().w * params().stride().h; + origWtDims = params().weightDims(); + { + NvS32 splitSetW = (NvS32)ceilf(origWtDims.w/float(params().stride().w)); + NvS32 splitSetH = (NvS32)ceilf(origWtDims.h/float(params().stride().h)); + splitSetWtDims = Dims4(origWtDims.n, origWtDims.c, splitSetH, splitSetW); + + /* Split weights based on deconvolution strides */ + PRECISION_SWITCH(rawKCRSWts.type.v(), computePrecision.v(), splitSetWts, WeightTrns::splitWeightsForDeconv, + rawKCRSWts, + origWtDims, + params().stride(), + splitSetWtDims); + + if (splitSetWts.size() == 0) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, + "Problem in splitting the deconvolution weight data!"); + } + } + + /* Step-3: Create conv+sdp sets and distribute the weight sets to each of + * these. Enforce strict order of execution by chaining them with + * compute edges + */ + { + canonical_ast::DeconvolutionNode* canDeconvNode = canonicalNode(); + ConvCoreNode* origDeconvNode = this; + SDPNode* origFusedSDPNode = NodeFactory::nodeCast(graph()->downstreamDataNodes(this)[0]); + bool fusedSDPHasAuxData = origFusedSDPNode->auxEdges().size() > 0; + Edge* sdpAuxEdge = fusedSDPHasAuxData ? origFusedSDPNode->auxEdges()[0] : NULL; + Edge* origInputEdge = origDeconvNode->inputEdges()[0]; + Edge* origStreamEdge = origDeconvNode->outputEdges()[0]; + Edge* origOutputEdge = origFusedSDPNode->outputEdges()[0]; + Edge* splitDeconvEdge = NULL; + Dims2 origDeconvStride = origDeconvNode->params().stride(); + Dims2 splitDeconvStride = Dims2(1,1); + Dims4 origSrcDims = origInputEdge->tensorSurfaceDesc()->dimensions(); + Dims4 origDstDims = origOutputEdge->tensorSurfaceDesc()->dimensions(); + Dims4 splitSrcDims; + Dims4 splitStreamDims; + Dims4 splitDstDims; + + Tensor* newSplitSrcTensor; + Tensor* newSplitDstTensor; + Tensor* concatDstTensor; + Dims4 concatDstDims; + Dims4 rubikDstDims; + + std::vector< ConvCoreNode* > splitDeconvNodes; + std::vector< SDPNode* > splitSDPNodes; + + SplitNode* swSplitNode = engine_ast::NodeFactory::newSplitNode(NULL, graph()); + ConcatenationNode* swConcatNode = engine_ast::NodeFactory::newConcatNode(NULL, graph()); + RubikNode* rubikNode = engine_ast::NodeFactory::newRubikNode(canDeconvNode, graph()); + rubikNode->params().setMode(RubikModeEnum::RUBIK_MODE_CONTRACT); + swSplitNode->params().setSplitAxis(SplitAxisEnum::SPLIT_ALONG_NONE); + swConcatNode->params().setConcatAxis(ConcatAxisEnum::CONCAT_ALONG_C); + + origDeconvNode->params().setStride(splitDeconvStride); + rubikNode->params().setDeconvStride(Dims2(origDeconvStride.h, origDeconvStride.w)); + + origDeconvNode->params().setRawWeights(splitSetWts[0]); + origDeconvNode->params().setWeightDims(splitSetWtDims); + deconvAuxEdge->originalTensor()->setDimensions(splitSetWtDims); + deconvAuxEdge->tensorSurfaceDesc()->setDimensions(splitSetWtDims); + + concatDstDims = Dims4(origDstDims.n, + origDstDims.c * numSplits, + origDstDims.h / origDeconvStride.h, + origDstDims.w / origDeconvStride.w); + rubikDstDims = Dims4(concatDstDims.n, + concatDstDims.c / numSplits, + concatDstDims.h * origDeconvStride.h, + concatDstDims.w * origDeconvStride.w); + + ASSERT(origDstDims == rubikDstDims); + + splitSrcDims = origSrcDims; + + /** + * Currently, we don't support if padding is involved in input or output data cube. + * + * split_output_height = ((input_height + input_pad_top + input_pad_bottom - split_kernel_height) / + * stride) + 1 + * + * rubik_output_height = deconv_output_height + output_pad_top + output_pad_bottom + * + * With stride = 1 and with current assumption, input_padding and output padding are zero. + * + * split_output_height = input_height - split_kernel_height + 1 --------- [1] + * rubik_output_height = deconv_output_height --------- [2] + * + * Both ([1] * deconv_y_stride) and [2] need to be equal to continue with our assumptions. + * + * if (split_output_height * deconv_y_stride) != rubik_output_height, our assumption on padding is + * wrong and we error out as unsupported. + * + * Similar justification holds true for width computation. + **/ + splitStreamDims = Dims4(origDstDims.n, + origDstDims.c, + origSrcDims.h - splitSetWtDims.h + 1, + origSrcDims.w - splitSetWtDims.w + 1); + + if (splitStreamDims.h * origDeconvStride.h != origDstDims.h || + splitStreamDims.w * origDeconvStride.w != origDstDims.w) + { + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, + "Padding issue, dims difference: (orig - computed) (H x W) = (%d x %d)", + origDstDims.h - splitStreamDims.h * origDeconvStride.h, + origDstDims.w - splitStreamDims.w * origDeconvStride.w); + } + splitDstDims = splitStreamDims; + + newSplitSrcTensor = origInputEdge->originalTensor()->clone(); + newSplitSrcTensor->setTensorType(TensorType::kIO); + newSplitSrcTensor->setDimensions(splitSrcDims); + + splitStreamDims.n = 1; + origStreamEdge->originalTensor()->setDimensions(splitStreamDims); + origStreamEdge->tensorSurfaceDesc()->setDimensions(splitStreamDims); + + splitDstDims.n = 1; + newSplitDstTensor = origOutputEdge->originalTensor()->clone(); + newSplitDstTensor->setTensorType(TensorType::kIO); + newSplitDstTensor->setDimensions(splitDstDims); + + splitDeconvEdge = graph()->addDataEdge(origInputEdge->canonicalEdge(), swSplitNode, origDeconvNode, newSplitSrcTensor); + splitDeconvEdge->setBindId(origInputEdge->bindId(), origInputEdge->bindDomain()); + graph()->addDataEdge(origOutputEdge->canonicalEdge(), origFusedSDPNode, swConcatNode, newSplitDstTensor); + + graph()->replaceEdgeNodes(origInputEdge, ast::EdgeSideEnum::SECOND, origDeconvNode, swSplitNode); + graph()->replaceEdgeNodes(origOutputEdge, ast::EdgeSideEnum::FIRST, origFusedSDPNode, rubikNode); + + concatDstDims.n = 1; + concatDstTensor = origOutputEdge->originalTensor()->clone(); + concatDstTensor->setTensorType(TensorType::kIO); + concatDstTensor->setDimensions(concatDstDims); + + // since concat out dims is different from orig conv's output dims, + // expand the tensor scales in concat's outputs to populate the same value in the extra channels + if (graph()->profile()->computePrecision().v() == surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8) + { + std::vector deconvOutScales = concatDstTensor->getChannelScales(); + deconvOutScales.resize(concatDstDims.c, deconvOutScales.at(0)); + concatDstTensor->setChannelScales(deconvOutScales); + } + + Edge* concatRubikEdge = graph()->addDataEdge((Edge*)0, swConcatNode, rubikNode, concatDstTensor); + + if ( debugSplits() ) + { + gLogInfo << "swsplit node=" << swSplitNode->id() << " now takes orig input edge=" + << origInputEdge->id() << " in " << graph()->name() << endl; + gLogInfo << "swconcat node=" << swConcatNode->id() << " connects to rubik via =" + << concatRubikEdge->id() << " in " << graph()->name() << endl; + gLogInfo << "rubik node=" << rubikNode->id() << " now takes orig output edge=" + << origOutputEdge->id() << " in " << graph()->name() << endl; + } + + splitDeconvNodes.push_back(origDeconvNode); + splitSDPNodes.push_back(origFusedSDPNode); + + for (NvU16 n = 1; n < numSplits; ++n) + { + ConvCoreDeconvolutionOpNode* newSplitDeconvNode = NodeFactory::newConvCoreDeconvolutionOpNode(canDeconvNode, graph()); + SDPNode* newSplitSDPNode = newSplitDeconvNode->addSDPJointOpNode(origFusedSDPNode); + Edge* splitStreamEdge = NULL; + Edge* splitDeconvAuxEdge = NULL; + + newSplitDeconvNode->params().setStride(splitDeconvStride); + newSplitDeconvNode->params().setRawWeights(splitSetWts[n]); + newSplitDeconvNode->params().setWeightDims(splitSetWtDims); + // fixme: non-functional deconv: copy filter scales in all deconv split nodes; in future assign apt filter scales to each + newSplitDeconvNode->params().setFilterScales(origDeconvNode->params().filterScales()); + + PROPAGATE_ERROR_FAIL(newSplitDeconvNode->nodeDataEdge(TensorType::kWEIGHT, ast::EdgeSideEnum::SECOND, &splitDeconvAuxEdge)); + splitDeconvAuxEdge->originalTensor()->setDimensions(splitSetWtDims); + + if (fusedSDPHasAuxData) + { + Edge* newSplitSDPRedundantAuxEdge; + PROPAGATE_ERROR_FAIL(newSplitSDPNode->nodeAuxEdge(&newSplitSDPRedundantAuxEdge)); + newSplitSDPNode->graph()->removeEdgeFromNode(newSplitSDPRedundantAuxEdge, ast::EdgeSideEnum::SECOND, newSplitSDPNode); + newSplitSDPNode->graph()->removeNodeFromEdge(newSplitSDPRedundantAuxEdge, ast::EdgeSideEnum::SECOND, newSplitSDPNode); + newSplitSDPNode->graph()->appendNodeToEdge(sdpAuxEdge, ast::EdgeSideEnum::SECOND, newSplitSDPNode); + newSplitSDPNode->graph()->removeEdge(newSplitSDPRedundantAuxEdge); + } + + newSplitSrcTensor = origInputEdge->originalTensor()->clone(); + newSplitSrcTensor->setTensorType(TensorType::kIO); + newSplitSrcTensor->setDimensions(splitSrcDims); + + PROPAGATE_ERROR_FAIL(newSplitDeconvNode->nodeDataEdge(TensorType::kSTREAM, ast::EdgeSideEnum::FIRST, &splitStreamEdge)); + splitStreamEdge->originalTensor()->setDimensions(splitStreamDims); + + newSplitDstTensor = origOutputEdge->originalTensor()->clone(); + newSplitDstTensor->setTensorType(TensorType::kIO); + newSplitDstTensor->setDimensions(splitDstDims); + + splitDeconvEdge = graph()->addDataEdge(origInputEdge->canonicalEdge(), swSplitNode, newSplitDeconvNode, newSplitSrcTensor); + splitDeconvEdge->setBindId(origInputEdge->bindId(), origInputEdge->bindDomain()); + + graph()->addDataEdge(origOutputEdge->canonicalEdge(), newSplitSDPNode, swConcatNode, newSplitDstTensor); + + graph()->addComputeEdge(splitDeconvNodes.back(), newSplitDeconvNode); + graph()->addComputeEdge(splitSDPNodes.back(), newSplitSDPNode); + + splitDeconvNodes.push_back(newSplitDeconvNode); + splitSDPNodes.push_back(newSplitSDPNode); + } + + // finally determine contract op params that satisfy hardware requirements for Rubik + PROPAGATE_ERROR_FAIL( rubikNode->determineContractOpParams() ); + } + +fail: + return e; +} + +NvDlaError engine_ast::ConvCoreDeconvolutionOpNode::quantizeAuxData() +{ + NvDlaError e = NvDlaSuccess; + + surface::SurfacePrecision computePrecision = graph()->profile()->computePrecision(); + + if (computePrecision.v() == surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8) + { + Weights rawWeights = params().rawWeights(); + if (rawWeights.type != nvdla::DataType::INT8) + { + // Expected quantization to have happened during preprocess aux pass itself. + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, + "Unquantized weights found." + "Quantization expected to have happened during preprocess aux pass."); + } + } + +fail: + return e; +} + +/*----------------------Weight Translation ----------------------------*/ +NvDlaError engine_ast::ConvCoreDeconvolutionOpNode::translateAuxData() +{ + NvDlaError e = NvDlaSuccess; + + Edge* auxEdge = NULL; + surface::SurfacePrecision computePrecision; + NvU32 atomicCSize = 0; + NvU32 atomicKSize = 0; + NvU32 cbufWidth = 0; + + PROPAGATE_ERROR_FAIL( verifyEdgePorts() ); + + computePrecision = graph()->profile()->computePrecision(); + atomicCSize = graph()->target_config()->atomicCSize(); + atomicKSize = graph()->target_config()->atomicKSize(); + cbufWidth = graph()->target_config()->bufEntryWidth(); + + auxEdge = auxEdges()[0]; + + { + Weights trnsKrnlWts; + Weights rawKrnlWts = params().rawWeights(); + + if ( graph()->debugWeights() ) + { + gLogInfo << "translating weights for " << id() << " kernel-dims kcrs = " << + auxEdge->tensorSurfaceDesc()->dimensions().n << "," << + auxEdge->tensorSurfaceDesc()->dimensions().c << "," << + auxEdge->tensorSurfaceDesc()->dimensions().h << "," << + auxEdge->tensorSurfaceDesc()->dimensions().w << "" << + " and size= " << rawKrnlWts.count << endl; + } + + WeightTrns::WeightDims kernelDims (rawKrnlWts.count, + auxEdge->tensorSurfaceDesc()->dimensions().n, + auxEdge->tensorSurfaceDesc()->dimensions().c, + auxEdge->tensorSurfaceDesc()->dimensions().w, + auxEdge->tensorSurfaceDesc()->dimensions().h, + (int)params().stride().w, + (int)params().stride().h); + if (rawKrnlWts.count != (auxEdge->tensorSurfaceDesc()->dimensions().n * + auxEdge->tensorSurfaceDesc()->dimensions().c * + auxEdge->tensorSurfaceDesc()->dimensions().h * + auxEdge->tensorSurfaceDesc()->dimensions().w)) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "kernel dims dont match kernel size "); + } + + PRECISION_SWITCH(rawKrnlWts.type.v(), computePrecision.v(), trnsKrnlWts, WeightTrns::translateWtsForDeconv, + kernelDims, + rawKrnlWts, + atomicKSize, + atomicCSize, + cbufWidth); + + if (trnsKrnlWts.values == NULL) + { + PROPAGATE_ERROR_FAIL(NvDlaError_BadValue, "Kernel Wt trnaslation failed for node '%s'", name().c_str()); + } + + params().setDLAWeights(trnsKrnlWts); + } + + +fail: + return e; +} + +NvDlaError engine_ast::ConvCoreDeconvolutionOpNode::emitOp(Graph *g, + DLAInterface *target_dla, + NvU32 op_slot, NvU32 batch_id, + DLACommonOpDescAccessor dep, + DLAOperationContainerAccessor op, + DLASurfaceContainerAccessor surf) +{ + NvDlaError e = NvDlaSuccess; + + DLAConvOpDescAccessor deconvOp = op.convOpDescAccessor(0); + DLACVTParamAccessor outCVTAcc = deconvOp.outCVTAccessor(); + DLACVTParamAccessor inCVTAcc = deconvOp.inCVTAccessor(); + DLAConvSurfaceDescAccessor surfAcc = surf.convSurfaceDescAccessor(0); + DLADataCubeAccessor srcDataAcc = surfAcc.srcDataAccessor(); + DLADataCubeAccessor dstDataAcc = surfAcc.dstDataAccessor(); + DLADataCubeAccessor wtDataAcc = surfAcc.weightDataAccessor(); + + surface::TensorSurfaceDesc *srcTSD = g->nodeInputTensorSurface(this, 0, supportedInSurfCategories()); + surface::TensorSurfaceDesc *dstTSD = g->nodeOutputTensorSurface(this, 0, supportedOutSurfCategories()); + surface::TensorSurfaceDesc *wtTSD = g->nodeInputTensorSurface(this, 0, supportedAuxSurfCategories()); + + *deconvOp.padVal() = 0; // FIXME: assuming same padding on both dimensions + *deconvOp.dataReuse() = 0; + *deconvOp.weightReuse() = 0; + *deconvOp.skipDataRls() = 0; + *deconvOp.skipWeightRls()= 0; + *deconvOp.batch() = 1; + *deconvOp.batchStride() = 0; + *deconvOp.release() = srcTSD->dimensions().h; + *deconvOp.meanFormat() = deconvOp.meanFormat_Disable(); + *deconvOp.meanRY() = 0; + *deconvOp.meanGU() = 0; + *deconvOp.meanBV() = 0; + *deconvOp.padXLeft() = 0; + *deconvOp.padXRight() = 0; + *deconvOp.padYTop() = 0; + *deconvOp.padYBottom() = 0; + *deconvOp.dilationX() = 1; + *deconvOp.dilationY() = 1; + *deconvOp.pixelMapping() = deconvOp.pixelMapping_PitchLinear(); //default + + *inCVTAcc.scale() = 0; + *inCVTAcc.truncate() = 0; + *inCVTAcc.enable() = 0; + *inCVTAcc.offset() = 0; + + *outCVTAcc.scale() = 1; + *outCVTAcc.truncate() = 0; + *outCVTAcc.enable() = 1; + *outCVTAcc.offset() = 0; + + /* Common parameters */ + *deconvOp.inPrecision() = ASTToDLAInterface::getConvCorePrecision(target_dla, srcTSD->surfaceFormat().precision()); + *deconvOp.outPrecision() = ASTToDLAInterface::getConvCorePrecision(target_dla, dstTSD->surfaceFormat().precision()); + *deconvOp.fetchGrain() = 1; //FIXME: right now its max of requirements of all conv nodes in mnist + *deconvOp.dataFormat() = ASTToDLAInterface::getDataFormat(target_dla, srcTSD->surfaceFormat()); + *deconvOp.weightFormat() = deconvOp.weightFormat_Uncompressed(); + *deconvOp.convStrideX() = params(batch_id).stride().w; + *deconvOp.convStrideY() = params(batch_id).stride().h; + *deconvOp.inputWidthCMAC() = dstTSD->dimensions().w; + *deconvOp.inputHeightCMAC() = dstTSD->dimensions().h; + *deconvOp.bytesPerKernel() = surface::WeightDesc::bytesPerKernel(wtTSD); + + *deconvOp.convMode() = deconvOp.convMode_Direct(); + *deconvOp.inputWidthCSC() = srcTSD->dimensions().w; + *deconvOp.inputHeightCSC() = srcTSD->dimensions().h; + *deconvOp.inputChannelCSC() = srcTSD->dimensions().c; + *deconvOp.kernelHeightCSC() = wtTSD->dimensions().h; + *deconvOp.kernelWidthCSC() = wtTSD->dimensions().w; + *deconvOp.kernelChannelCSC() = wtTSD->dimensions().c; + + /* entry-per-slice & banks should be calculated after conv-mode is determined */ + params(batch_id).setConvMode(ConvolutionModeEnum::CONV_DIRECT); + *deconvOp.entryPerSlice()= calculateEPS(srcTSD); + *deconvOp.dataBank() = params(batch_id).dataBanksAllotted(); + *deconvOp.weightBank() = params(batch_id).weightBanksAllotted(); + + emitDependencyParams(target_dla, dep, batch_id); + setDataCubeAccessor(srcDataAcc, srcTSD, IODirectionEnum::INPUT, batch_id); + setDataCubeAccessor(wtDataAcc, wtTSD, IODirectionEnum::UNKNOWN, batch_id); + setDataCubeAccessor(dstDataAcc, dstTSD, IODirectionEnum::OUTPUT, batch_id); + + if ( g->debugOps() ) + { + gLogInfo << "Deconv node @ op_slot = " << op_slot << " batch_id = " << batch_id << endl; + gLogInfo << "\tin precision " << (int)*deconvOp.inPrecision() << endl; + gLogInfo << "\tout precision " << (int)*deconvOp.outPrecision() << endl; + gLogInfo << "\tsrc data loc: " << (int) *srcDataAcc.type() << endl; + gLogInfo << "\tdst data loc: " << (int) *dstDataAcc.type() << endl; + gLogInfo << "\tpost y extension: " << (int)*deconvOp.postExtension() << endl; + gLogInfo << "\tin_precision " << (int)*deconvOp.inPrecision() << endl; + gLogInfo << "\tout_precision " << (int)*deconvOp.outPrecision() << endl; + gLogInfo << "\tpad_val " << (int)*deconvOp.padVal() << endl; + gLogInfo << "\tconv mode " << (int)*deconvOp.convMode() << endl; + gLogInfo << "\tdata_reuse " << (int)*deconvOp.dataReuse() << endl; + gLogInfo << "\tweight_reuse " << (int)*deconvOp.weightReuse() << endl; + gLogInfo << "\tskip_data_rls " << (int)*deconvOp.skipDataRls() << endl; + gLogInfo << "\tskip_wt_rls " << (int)*deconvOp.skipWeightRls() << endl; + gLogInfo << "\teps " << *deconvOp.entryPerSlice() << endl; + gLogInfo << "\tfetch_grain " << (int)*deconvOp.fetchGrain() << endl; + gLogInfo << "\tdata_format " << (int)*deconvOp.dataFormat() << endl; + gLogInfo << "\tpixel_mapping " << (int)*deconvOp.pixelMapping() << endl; + gLogInfo << "\tbatch " << (int)*deconvOp.batch() << endl; + gLogInfo << "\tweight_format " << (int)*deconvOp.weightFormat() << endl; + gLogInfo << "\tb4d " << (int)*deconvOp.dataBank() << endl; + gLogInfo << "\tb4w " << (int)*deconvOp.weightBank() << endl; + gLogInfo << "\tbatch_stride " << (int)*deconvOp.batchStride() << endl; + gLogInfo << "\trelease " << (int)*deconvOp.release() << endl; + gLogInfo << "\tpost_extension " << (int)*deconvOp.postExtension() << endl; + gLogInfo << "\tpixel_override " << (int)*deconvOp.pixelOverride() << endl; + gLogInfo << "\tmean_format " << (int)*deconvOp.meanFormat() << endl; + gLogInfo << "\tstride-x " << (int)*deconvOp.convStrideX() << endl; + gLogInfo << "\tstride-y " << (int)*deconvOp.convStrideY() << endl; + gLogInfo << "\tpad-left " << (int)*deconvOp.padXLeft() << endl; + gLogInfo << "\tpad-top " << (int)*deconvOp.padYTop() << endl; + gLogInfo << "\tpad-right " << (int)*deconvOp.padXRight() << endl; + gLogInfo << "\tpad-bottom " << (int)*deconvOp.padYBottom() << endl; + gLogInfo << "\tdilationx-x " << (int)*deconvOp.dilationX() << endl; + gLogInfo << "\tdilation-y " << (int)*deconvOp.dilationY() << endl; + gLogInfo << "\tpra_truncate " << (int)*deconvOp.praTruncate() << endl; + gLogInfo << "\tinputwidthcsc " << *deconvOp.inputWidthCSC() << endl; + gLogInfo << "\tinputheightcsc " << *deconvOp.inputHeightCSC() << endl; + gLogInfo << "\tinputchannelcsc " << *deconvOp.inputChannelCSC() << endl; + gLogInfo << "\tkernelwidthcsc " << *deconvOp.kernelWidthCSC() << endl; + gLogInfo << "\tkernelheightcsc " << *deconvOp.kernelHeightCSC() << endl; + gLogInfo << "\tkernelchannelcsc " << *deconvOp.kernelChannelCSC() << endl; + gLogInfo << "\tinputwidthcmac " << *deconvOp.inputWidthCMAC() << endl; + gLogInfo << "\tinputheightcmac " << *deconvOp.inputHeightCMAC() << endl; + gLogInfo << "\tbytesperkernel " << *deconvOp.bytesPerKernel() << endl; + gLogInfo << "\toffsetU " << (int)*surfAcc.offsetU() << endl; + gLogInfo << "\tdependencyCount " << (int)*dep.dependencyCount() << endl; + gLogInfo << "\tsrc tsd:" << srcTSD->id() << "/" << srcTSD->tensorBufferDesc()->id() + << ":off= " << srcTSD->bufferOffset() << endl; + gLogInfo << "\tsrc addr=" << *srcDataAcc.address() << endl; + gLogInfo << "\tsrc size " << *srcDataAcc.size() << endl; + gLogInfo << "\tsrc width " << *srcDataAcc.width() << endl; + gLogInfo << "\tsrc height " << *srcDataAcc.height() << endl; + gLogInfo << "\tsrc channel " << *srcDataAcc.channel() << endl; + gLogInfo << "\tsrc linestride " << *srcDataAcc.lineStride() << endl; + gLogInfo << "\tsrc surfstride " << *srcDataAcc.surfStride() << endl; + gLogInfo << "\tdst tsd:" << dstTSD->id() << endl; + gLogInfo << "\tdst addr=" << *dstDataAcc.address() << endl; + gLogInfo << "\tdst size " << *dstDataAcc.size() << endl; + gLogInfo << "\tdst width " << *dstDataAcc.width() << endl; + gLogInfo << "\tdst height " << *dstDataAcc.height() << endl; + gLogInfo << "\tdst channel " << *dstDataAcc.channel() << endl; + gLogInfo << "\tdst linestride " << *dstDataAcc.lineStride() << endl; + gLogInfo << "\tdst surfstride " << *dstDataAcc.surfStride() << endl; + gLogInfo << "\twt tsd:" << wtTSD->id() << endl; + gLogInfo << "\tweight addr=" << *wtDataAcc.address() << endl; + gLogInfo << "\twt size " << *wtDataAcc.size() << endl; + gLogInfo << "\twt width " << *wtDataAcc.width() << endl; + gLogInfo << "\twt height " << *wtDataAcc.height() << endl; + gLogInfo << "\twt channel " << *wtDataAcc.channel() << endl; + } + + return e; +} + +}; // nvdla::priv:: +}; // nvdla:: diff --git a/umd/core/src/compiler/engine-ast/EngineAST.cpp b/umd/core/src/compiler/engine-ast/EngineAST.cpp new file mode 100644 index 00000000..ebf6970d --- /dev/null +++ b/umd/core/src/compiler/engine-ast/EngineAST.cpp @@ -0,0 +1,1477 @@ +/* + * Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#include +#include +#include +#include +#include +#include + +#include "nvdla/IType.h" + +#include "priv/Check.h" +#include "priv/EngineAST.h" +#include "priv/Layer.h" +#include "priv/Network.h" +#include "priv/Profile.h" +#include "priv/TargetConfig.h" +#include "ErrorMacros.h" + + +using std::map; +using std::vector; +using std::set; +using std::unordered_set; +using std::string; +using std::endl; +using std::ostream; +using std::stringstream; + +namespace nvdla +{ +namespace priv +{ + +ENUM_PARAMETER_STATIC(engine_ast::EngineType, ENGINE_AST_ENGINE_TYPE_ENUMS, "EngineASTEngineTypeEnum") +ENUM_PARAMETER_STATIC(engine_ast::EngineOpType, ENGINE_AST_ENGINE_OP_TYPE_ENUMS, "EngineASTEngineOpTypeEnum") +ENUM_PARAMETER_STATIC(engine_ast::EdgeType, ENGINE_AST_EDGE_TYPE_ENUMS, "EngineASTEdgeTypeEnum") +ENUM_PARAMETER_STATIC(engine_ast::IODirection, ENGINE_AST_IO_DIRECTION_ENUMS, "EngineASTIODirectionEnum") +ENUM_PARAMETER_STATIC(engine_ast::OperationEventType, ENGINE_AST_OPERATION_EVENT_TYPE_ENUMS, "EngineASTOperationEventTypeEnum") + +ENUM_PARAMETER_STATIC(engine_ast::ConcatAxis, ENGINE_AST_CONCAT_AXIS_ENUMS, "ConcatAxisEnum") +ENUM_PARAMETER_STATIC(engine_ast::SplitAxis, ENGINE_AST_SPLIT_AXIS_ENUMS, "SplitAxisEnum") +ENUM_PARAMETER_STATIC(engine_ast::ConvolutionMode, ENGINE_AST_CONVOLUTION_MODE_ENUMS, "ConvolutionModeEnum") +ENUM_PARAMETER_STATIC(engine_ast::SDPMode, ENGINE_AST_SDP_MODE_ENUMS, "SDPModeEnum") +ENUM_PARAMETER_STATIC(engine_ast::SDPOpType, ENGINE_AST_SDP_OP_TYPE_ENUMS, "SDPOpTypeEnum") +ENUM_PARAMETER_STATIC(engine_ast::SDPActType, ENGINE_AST_SDP_ACT_TYPE_ENUMS, "SDPActTypeEnum") +ENUM_PARAMETER_STATIC(engine_ast::SDPALUType, ENGINE_AST_SDP_ALU_TYPE_ENUMS, "SDPALUTypeEnum") +ENUM_PARAMETER_STATIC(engine_ast::RubikMode, ENGINE_AST_RUBIK_MODE_ENUMS, "RubikModeEnum") + +// Initialize static memory collector +engine_ast::MemoryCollector* engine_ast::MemoryCollector::collector = NULL; + +NvU32 engine_ast::Node::m_next_id = 0; +NvU32 engine_ast::Edge::m_next_id = 0; + +#if 0 +// +// though this is templated, it's harder to introduce attributes +// into the dump which aren't built into the base classes being +// used (class N, E here). e.g.: 'id' isn't required for a node or +// edge class, even though it's referenced here. the visitor +// scheme allows a more informative dump because point-of-use information +// can be added (it can call methods which are not common to the templated +// dump version). +// +template +NvDlaError Graph::dumpGraphML(string filename, string id) +{ + ofstream ofs = ofstream(filename, ofstream::out); + + ofs << "" << endl; + ofs << "" << endl; + ofs << " " << endl; + + for (NodeSetIterator it=nodes().begin(); it!=nodes().end(); it++) + { + if (*it == NULL) + continue; + + ofs << "id() << "\"/>" << endl; + } + + for (EdgeSetIterator it=edges().begin(); it!=edges().end(); it++) + { + if (*it == NULL) + continue; + + EdgeAttr* edgeAttr = lookupEdgeAttr(*it); + NodeSequence nodeSeq0 = edgeAttr->m_nodes[0]; + NodeSequence nodeSeq1 = edgeAttr->m_nodes[1]; + + for (NodeSequenceIterator it0=nodeSeq0.begin(); it0!=nodeSeq0.end(); it0++) + { + for (NodeSequenceIterator it1=nodeSeq1.begin(); it1!=nodeSeq1.end(); it1++) + { + ofs << "id() << "\" target=\"" << (*it1)->id() << "\"/>" << endl; + } + } + } + + ofs << " " << endl; + ofs << "" << endl; + + ofs.close(); + + return NvDlaSuccess; +} + +template NvDlaError Graph::dumpGraphML(string filename, string graph_id); +template NvDlaError Graph::dumpGraphML(string filename, string graph_id); +#endif + + +engine_ast::Graph::~Graph() +{ + + for ( size_t g = 0, G = m_graphlets.size(); g != G; ++g) + { + delete m_graphlets[g]; + } + // as the m_resource_mgr is a member, not a reference + // its destructor will do the following... + // vector *memPools = m_resource_mgr.memoryPools(); + // for ( size_t p = 0, P = memPools->size(); p != P; ++p) + // { + // (*memPools)[p].deallocate(); + // } + if ( m_memoryResolver ) + { + delete m_memoryResolver; + m_memoryResolver = 0; + } + + if ( m_lutManager ) + { + delete m_lutManager; + m_lutManager = 0; + } + if ( m_ordering ) + { + delete m_ordering; + } + if ( m_scored_ordering ) + { + delete m_scored_ordering; + } +} + +engine_ast::Graph *engine_ast::generateGraph(Profile *profile, TargetConfig *target_config, canonical_ast::Graph *can_graph) +{ + NvDlaError e = NvDlaSuccess; + vector input_edges; + vector output_edges; + + vector can_edge_first_nodes, can_edge_second_nodes; + map can_to_eng_sink_node_map, can_to_eng_source_node_map; + map can_to_eng_edge_map; + vector::const_iterator f, begin, end; + vector first_nodes, second_nodes; + engine_ast::Graph *eng_graph; + + if ( !profile ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "must associate profile with Engine AST generateGraph"); + } + + if ( !target_config ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "must associate target_config with Engine AST generateGraph"); + } + + if (target_config->isBatchModeCapable()) + { + NvU32 numBatches = profile->multiBatchSize(); + NvU32 maxBatches = target_config->maxBatchSize(); + + if (numBatches > maxBatches) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "numbatches is greater than allowed maxbatches (%d)", maxBatches); + } + } + + eng_graph = new engine_ast::Graph(profile, target_config); + if ( !eng_graph ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_InsufficientMemory, "Can't create a new Engine AST"); + } + + e = eng_graph->initGraphResources(); + if (e != NvDlaSuccess) + { + delete eng_graph; + eng_graph = NULL; + ORIGINATE_ERROR_FAIL(NvDlaError_InsufficientMemory, "Couldn't initialize all graph resources"); + } + + eng_graph->setScoredOrdering( new ScoredDependencyOrdering(eng_graph) ); + eng_graph->setOrdering(new DependencyOrdering(eng_graph->scoredOrdering())); + + // + // create edges to mirror the canonical edges. + // + for ( set::iterator cei = can_graph->edges().begin(), CEI = can_graph->edges().end(); + cei != CEI; ++cei ) + { + engine_ast::Edge* engine_edge = new engine_ast::Edge(*cei); + Tensor* engine_tensor = 0; + if ( !engine_edge ) + { + delete eng_graph; // blow up + eng_graph = NULL; + ORIGINATE_ERROR_FAIL(NvDlaError_InsufficientMemory, "Couldn't transform canonical edge '%s' into engine edge", (*cei)->id().c_str()); + } + + engine_tensor = (*cei)->originalTensor()->clone(); + engine_tensor->setDataFormat(nvdla::DataFormat::NCHW); // all tensors are NCHW unless otherwise specified + engine_tensor->setNetwork(NULL); // get rid of any connections back to the network builder + + engine_edge->setGraph(eng_graph); + engine_edge->setId(eng_graph->nextEdgeId()); + engine_edge->setDataEdge(); + engine_edge->setOriginalTensor(engine_tensor); + + can_to_eng_edge_map[*cei] = engine_edge; + eng_graph->insertEdge(engine_edge); + + } + + if (profile->multiBatchSize() == 0) + { + // Patch up profile->multiBatchSize() + // The compiler should be querying this information from the network instead of the profile + + // Collect the multibatch size of the network, based on the input tensor dimensions + for ( vector::const_iterator cie = can_graph->inputEdges().begin(); + cie != can_graph->inputEdges().end(); ++cie) + { + engine_ast::Edge *input_edge = can_to_eng_edge_map[*cie]; + Dims4 networkDims = input_edge->originalTensor()->getDimensions(); + + PROPAGATE_ERROR_FAIL(profile->setMultiBatchSize(networkDims.n)); + } + } + + // + // create nodes to mirror the canonical nodes + // + for ( set::iterator cni = can_graph->nodes().begin(), CNI = can_graph->nodes().end(); + cni != CNI; ++cni ) + { + engine_ast::Graph::EdgeSequence engSrcEdges; + engine_ast::Graph::EdgeSequence engSinkEdges; + engine_ast::Graph::NodeSequence engNodes; + canonical_ast::Graph::EdgeSequence canSrcEdges = can_graph->nodeEdges(*cni, ast::EdgeSideEnum::SECOND); + canonical_ast::Graph::EdgeSequence canSinkEdges = can_graph->nodeEdges(*cni, ast::EdgeSideEnum::FIRST); + canonical_ast::Graph::EdgeSequenceIterator cei; + + for (cei = canSrcEdges.begin(); cei != canSrcEdges.end(); ++cei) + { + engSrcEdges.push_back(can_to_eng_edge_map[*cei]); + } + + for (cei = canSinkEdges.begin(); cei != canSinkEdges.end(); ++cei) + { + engSinkEdges.push_back(can_to_eng_edge_map[*cei]); + } + + e = transformCanNode(eng_graph, *cni, engSrcEdges, engSinkEdges, engNodes); + if ( e != NvDlaSuccess ) + { + delete eng_graph; // blow up + eng_graph = NULL; + ORIGINATE_ERROR_FAIL(e, "Couldn't transform canonical node '%s' into engine node", (*cni)->id().c_str()); + } + + if ( eng_graph->debugGraphDump() ) + { + gLogInfo << (*cni)->id() << ":->"; + for (vector::iterator ni = engNodes.begin(); ni != engNodes.end(); ++ni) + { + gLogInfo << (*ni)->id() << ":" << (*ni)->name() << " "; + } + gLogInfo << std::endl; + } + } + + for ( vector::const_iterator cie = can_graph->inputEdges().begin(); + cie != can_graph->inputEdges().end(); ++cie) + { + engine_ast::Edge *first_edge = can_to_eng_edge_map[can_graph->inputEdges().front()]; + engine_ast::Edge *input_edge = can_to_eng_edge_map[*cie]; + input_edge->originalTensor()->setDataFormat(profile->networkInputDataFormat()); + + // Determine if multibatch parameters are consistent for all input tensors + if (first_edge->originalTensor()->getDimensions().n != input_edge->originalTensor()->getDimensions().n) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Input tensor multibatch dimensions mismatch: %d != %d", first_edge->originalTensor()->getDimensions().n, input_edge->originalTensor()->getDimensions().n); + } + + Dims4 networkDims = input_edge->originalTensor()->getDimensions(); + if ( networkDims.n != (NvS32)profile->multiBatchSize() ) + { + gLogWarning << "Overriding input multibatch size from " << networkDims.n << " to " << profile->multiBatchSize() << endl; + networkDims.n = profile->multiBatchSize(); + input_edge->originalTensor()->setDimensions(networkDims); + } + + // if it is IMG input format, ensure #chnls match between model and profile params + if ( profile->networkInputSurfaceFormat().category() == surface::SurfaceCategoryEnum::IMG && + networkDims.c != profile->networkInputSurfaceFormat().channelsPerAtom()) + { + gLogWarning << "Prototxt #chnls (C = " + << networkDims.c + << ") != Profile #chnls for input (" + << profile->networkInputSurfaceFormat().c_str() + << ": C = " + << (int)profile->networkInputSurfaceFormat().channelsPerAtom() + << "). Preferring #chnls from Profile for compiling." + << endl; + networkDims.c = profile->networkInputSurfaceFormat().channelsPerAtom(); + input_edge->originalTensor()->setDimensions(networkDims); + + // copy the tensor scales and offsets to the extra channel if any + if (input_edge->originalTensor()->getChannelScales().size()) + { + NvF32 tensorScale = input_edge->originalTensor()->getChannelScales().at(0); + std::vector channelScales; + for (NvU32 cc = 0; cc < (NvU32)networkDims.c; ++cc) + { + channelScales.push_back(tensorScale); + } + input_edge->originalTensor()->setChannelScales(channelScales); + } + + if (input_edge->originalTensor()->getChannelOffsets().size()) + { + NvF32 tensorOffset = input_edge->originalTensor()->getChannelOffsets().at(0); + std::vector channelOffsets; + for (NvU32 cc = 0; cc < (NvU32)networkDims.c; ++cc) + { + channelOffsets.push_back(tensorOffset); + } + input_edge->originalTensor()->setChannelOffsets(channelOffsets); + } + } + + input_edge->setBindId(input_edges.size(), IOD_Input); + if ( eng_graph->debugBinding() ) + { + gLogInfo << "EngineAST graph level input edge[" << input_edges.size() << "] is " << input_edge->id() << endl; + gLogInfo << "input bind id: " << input_edge->bindId() << endl; + } + + input_edges.push_back( input_edge ); + }; + + if ( input_edges.size() ) + { + eng_graph->setInputEdges(input_edges); + } + + + for ( vector::const_iterator coe = can_graph->outputEdges().begin(); + coe != can_graph->outputEdges().end(); ++coe) + { + engine_ast::Edge *output_edge = can_to_eng_edge_map[*coe]; + output_edge->originalTensor()->setDataFormat(profile->networkOutputDataFormat()); + + Dims4 networkDims = output_edge->originalTensor()->getDimensions(); + if ( networkDims.n != (NvS32)profile->multiBatchSize() ) + { + gLogWarning << "Overriding output multibatch size from " << networkDims.n << " to " << profile->multiBatchSize() << endl; + networkDims.n = profile->multiBatchSize(); + output_edge->originalTensor()->setDimensions(networkDims); + } + + output_edge->setBindId(output_edges.size(), IOD_Output); + if ( eng_graph->debugBinding() ) + { + gLogInfo << "EngineAST graph level output edge[" << output_edges.size() << "] is " << output_edge->id() << endl; + gLogInfo << "output bind id: " << output_edge->bindId() << endl; + } + + output_edges.push_back( output_edge ); + }; + + if ( output_edges.size() ) + { + eng_graph->setOutputEdges(output_edges); + } + + // cache input/output/aux edges of each node into their respective data ports + if ( eng_graph->debugGraphDump() ) + { + engine_ast::Graph::NodeSet engineNodes = eng_graph->nodes(); + engine_ast::Graph::NodeSetIterator eni = engineNodes.begin(); + for ( ; eni != engineNodes.end(); ++eni) + { + typedef std::vector::const_iterator ESI; + + std::string canNodeName; + if ((*eni)->canonicalNode() == NULL) + { + canNodeName = "(No canonical node)"; + } + else + { + canNodeName = (*eni)->canonicalNode()->name(); + } + gLogInfo << (*eni)->name() << "/" << (*eni)->id() << "/" + << canNodeName << ":" << endl; + for (ESI ii = (*eni)->inputEdges().begin(); ii != (*eni)->inputEdges().end(); ++ii) + gLogInfo << "\tin " << (*ii)->id() << endl; + for (ESI ii = (*eni)->outputEdges().begin(); ii != (*eni)->outputEdges().end(); ++ii) + gLogInfo << "\tout " << (*ii)->id() << endl; + for (ESI ii = (*eni)->auxEdges().begin(); ii != (*eni)->auxEdges().end(); ++ii) + gLogInfo << "\taux " << (*ii)->id() << endl; + } + } + + eng_graph->ordering()->generate(); + eng_graph->markClean(); + + // force N = 1 for all non-Aux tensors represented by non-bindable edges; + // until we allow contiguous non-bindable tensors for multi-batch + { + engine_ast::Graph::EdgeSequence engineEdges = eng_graph->orderedEdges(); + for (engine_ast::Graph::EdgeSequenceIterator eei = engineEdges.begin(); eei != engineEdges.end(); ++eei) + { + if (!(*eei)->bindable() && !(*eei)->isAuxEdge() && (*eei)->originalTensor()) + { + Dims4 nonBindableTensorDims = (*eei)->originalTensor()->getDimensions(); + if ( eng_graph->debugGraphDump() ) + { + if (nonBindableTensorDims.n != 1) + gLogInfo << "Forcing batch size '1' for non-bindable non-aux edge " << (*eei)->id() << endl; + } + nonBindableTensorDims.n = 1; + (*eei)->originalTensor()->setDimensions(nonBindableTensorDims); + } + } + } + return eng_graph; + +fail: + return NULL; +} + +static NvDlaError transformCanConvOp +( + engine_ast::Graph* engGraph, + canonical_ast::Node *canNode, + engine_ast::Graph::EdgeSequence engSrcEdges, + engine_ast::Graph::EdgeSequence engSinkEdges, + engine_ast::Graph::NodeSequence& transformedEngNodes +) +{ + NvDlaError e = NvDlaSuccess; + bool isWG = false; + bool isInputBindable = false; + bool isOutputBindable = false; + canonical_ast::ConvolutionNode* canConvNode = NULL; + engine_ast::ConvCoreNode* engConvNode = NULL; + engine_ast::SDPNode* adjointSDPNode = NULL; + engine_ast::Edge* engSrcEdge = NULL; + engine_ast::Edge* engSinkEdge = NULL; + engine_ast::Edge* convAuxEdge = NULL; + engine_ast::Edge* sdpAuxEdge = NULL; + canonical_ast::Graph::EdgeSequence canInputEdges = canNode->graph()->inputEdges(); + canonical_ast::Graph::EdgeSequence canOutputEdges = canNode->graph()->outputEdges(); + + if (engSrcEdges.size() != 1 || engSinkEdges.size() != 1) + { + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Don't support Conv operation with input edges (%d) != 1 or " + "output edges (%d) != 1", engSrcEdges.size(), engSinkEdges.size()); + } + + engSrcEdge = engSrcEdges[0]; + engSinkEdge = engSinkEdges[0]; + canConvNode = canonical_ast::NodeFactory::nodeCast(canNode); + engConvNode = engine_ast::NodeFactory::newConvCoreConvolutionOpNode(canConvNode, engGraph); + adjointSDPNode = engConvNode->addSDPJointOpNode(canConvNode); + adjointSDPNode->params().setConvMode(engConvNode->params().convMode()); + + ASSERT( canNode->inputEdges().size() == 1 ); + ASSERT( canNode->outputEdges().size() == 1 ); + + isInputBindable = std::find(canInputEdges.begin(), canInputEdges.end(), canNode->inputEdges().at(0)) != canInputEdges.end(); + isOutputBindable = std::find(canOutputEdges.begin(), canOutputEdges.end(), canNode->outputEdges().at(0)) != canOutputEdges.end(); + isWG = engConvNode->params().convMode() == engine_ast::ConvolutionModeEnum::CONV_WINOGRAD; + + if (isWG && (isInputBindable || isOutputBindable)) + { + gLogWarning << "Can't use WG mode with bindable surfaces. Falling back to CONV_DIRECT for " + << engConvNode->name() << endl; + isWG = false; + engConvNode->setName("dc-conv-" + engConvNode->name().substr(engConvNode->name().find("wg-conv-") + 8)); + engConvNode->params().setConvMode(engine_ast::ConvolutionModeEnum::CONV_DIRECT); + adjointSDPNode->params().setConvMode(engine_ast::ConvolutionModeEnum::CONV_DIRECT); + } + + engGraph->appendNodeToEdge(engSrcEdge, ast::EdgeSideEnum::SECOND, engConvNode); + engGraph->appendNodeToEdge(engSinkEdge, ast::EdgeSideEnum::FIRST, adjointSDPNode); + + PROPAGATE_ERROR_FAIL(engConvNode->nodeAuxEdge(&convAuxEdge)); + PROPAGATE_ERROR_FAIL(adjointSDPNode->nodeAuxEdge(&sdpAuxEdge)); + + PROPAGATE_ERROR_FAIL(engConvNode->populateEdgePorts()); + transformedEngNodes.push_back(engConvNode); + + PROPAGATE_ERROR_FAIL(adjointSDPNode->populateEdgePorts()); + transformedEngNodes.push_back(adjointSDPNode); + + if (isWG) + { + PROPAGATE_ERROR_FAIL(engConvNode->determineWinogradParams()); + PROPAGATE_ERROR_FAIL(adjointSDPNode->determineWinogradParams(engConvNode)); + } + +fail: + return e; +} + +static NvDlaError transformCanFCOp +( + engine_ast::Graph* engGraph, + canonical_ast::Node *canNode, + engine_ast::Graph::EdgeSequence engSrcEdges, + engine_ast::Graph::EdgeSequence engSinkEdges, + engine_ast::Graph::NodeSequence& transformedEngNodes +) +{ + NvDlaError e = NvDlaSuccess; + canonical_ast::FullyConnectedNode* canFCNode = NULL; + engine_ast::ConvCoreNode* engFCNode = NULL; + engine_ast::SDPNode* adjointSDPNode = NULL; + engine_ast::Edge* engSrcEdge = NULL; + engine_ast::Edge* engSinkEdge = NULL; + + if (engSrcEdges.size() != 1 || engSinkEdges.size() != 1) + { + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Don't support FC operation with input edges (%d) != 1 or " + "output edges (%d) != 1", engSrcEdges.size(), engSinkEdges.size()); + } + + engSrcEdge = engSrcEdges[0]; + engSinkEdge = engSinkEdges[0]; + canFCNode = canonical_ast::NodeFactory::nodeCast(canNode); + engFCNode = engine_ast::NodeFactory::newConvCoreFullyConnectedOpNode(canFCNode, engGraph); + adjointSDPNode = engFCNode->addSDPJointOpNode(canFCNode); + engGraph->appendNodeToEdge(engSrcEdge, ast::EdgeSideEnum::SECOND, engFCNode); + engGraph->appendNodeToEdge(engSinkEdge, ast::EdgeSideEnum::FIRST, adjointSDPNode); + + PROPAGATE_ERROR_FAIL(engFCNode->populateEdgePorts()); + transformedEngNodes.push_back(engFCNode); + + PROPAGATE_ERROR_FAIL(adjointSDPNode->populateEdgePorts()); + transformedEngNodes.push_back(adjointSDPNode); + +fail: + return e; +} + +/** + * Attaches unit scale op before given node to handle rescaling. + * + * This function is useful whenever a node doesn't want to do rescaling within itself + * (like ReLU). + * + * For instance say NodeA doesn't want to handle its rescaling (just to avoid complexity) + * input scaling factor NodeA (say ReLU) = Si + * output scaling factor NodeA (say ReLU) = So + * + * Conversion: + * ReLU = unit scale node(per-channel) + ReLU + * Where, + * input scaling factor of unit scale node = Si + * output scaling factor of unit scale node/input scaling factor of ReLU = So + * output scaling factor of ReLU = So + * + * This would introduce new unit scale node (per-channel) that handles rescaling and + * NodeA is free from doing the same. + * + * CAUTION: This function does the rescaling before the actual operation (ReLU). + * Such rescaling is fine in cases like ReLU. To be used with care. + * + **/ +static NvDlaError prependScaleOpForRescaling +( + engine_ast::Graph *engGraph, + canonical_ast::Node *canNode, + engine_ast::Graph::EdgeSequence engSrcEdges, + engine_ast::Graph::EdgeSequence engSinkEdges, + engine_ast::Graph::NodeSequence& transformedEngNodes +) +{ + NvDlaError e = NvDlaSuccess; + + engine_ast::SDPScaleOpNode* engSDPScaleNode = NULL; + surface::SurfacePrecision computePrecision = engGraph->profile()->computePrecision(); + engine_ast::Edge* engSrcEdge = NULL; + engine_ast::Edge* scaleSinkEdge = NULL; + + Tensor* inTensor = NULL; + Tensor* outTensor = NULL; + + Dims4 scaleDims; + engine_ast::SDPMode scaleMode = engine_ast::SDPModeEnum::SDP_MODE_PER_CHANNEL; // Force it to per-channel + + if (engSrcEdges.size() != 1 || engSinkEdges.size() != 1) + { + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Don't support Activation operation with input edges (%d) != 1 or " + "output edges (%d) != 1", engSrcEdges.size(), engSinkEdges.size()); + } + + if (computePrecision.v() != surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8) + { + /* Rescaling applicable for only int8 */ + goto fail; + } + + /* Create a new sdp node */ + engSDPScaleNode = engine_ast::NodeFactory::newSDPScaleOpNode(NULL, engGraph); + + /* Create an output tensor for newscale node and uses the same as that next canNode */ + outTensor = canNode->outputEdges().at(0)->originalTensor()->clone(); + outTensor->setTensorType(TensorType::kIO); + + /* Determine the scaling dimension based on scale mode */ + inTensor = canNode->inputEdges().at(0)->originalTensor(); + scaleDims.n = 1; + scaleDims.c = inTensor->getDimensions().c; + scaleDims.h = 1; + scaleDims.w = 1; + + /* Update the params of engScaleNode. */ + engSDPScaleNode->populateWithUnitScaleParams(scaleMode, scaleDims); + + /* create an new edge from output of scale to input of canNode */ + engSrcEdge = engSrcEdges[0]; + scaleSinkEdge = engGraph->addDataEdge((engine_ast::Edge*)0, + (engine_ast::Node*)0, + (engine_ast::Node*)0, + outTensor); + engGraph->appendNodeToEdge(engSrcEdge, ast::EdgeSideEnum::SECOND, engSDPScaleNode); + engGraph->appendNodeToEdge(scaleSinkEdge, ast::EdgeSideEnum::FIRST, engSDPScaleNode); + + PROPAGATE_ERROR_FAIL(engSDPScaleNode->populateEdgePorts()); + transformedEngNodes.push_back(engSDPScaleNode); +fail: + return e; +} + +static NvDlaError transformCanActOp +( + engine_ast::Graph* engGraph, + canonical_ast::Node *canNode, + engine_ast::Graph::EdgeSequence engSrcEdges, + engine_ast::Graph::EdgeSequence engSinkEdges, + engine_ast::Graph::NodeSequence& transformedEngNodes +) +{ + NvDlaError e = NvDlaSuccess; + canonical_ast::ActivationNode* canActNode = NULL; + engine_ast::SDPActivationOpNode* engActNode = NULL; + engine_ast::Edge* engSrcEdge = NULL; + engine_ast::Edge* engSinkEdge = NULL; + engine_ast::Graph::NodeSequence rescaleEngNodes; + + if (engSrcEdges.size() != 1 || engSinkEdges.size() != 1) + { + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Don't support Activation operation with input edges (%d) != 1 or " + "output edges (%d) != 1", engSrcEdges.size(), engSinkEdges.size()); + } + + engSrcEdge = engSrcEdges[0]; + engSinkEdge = engSinkEdges[0]; + + canActNode = canonical_ast::NodeFactory::nodeCast(canNode); + if (canActNode->params().activationType() == ActivationType::kRELU) + { + PROPAGATE_ERROR_FAIL(prependScaleOpForRescaling(engGraph, + canNode, + engSrcEdges, + engSinkEdges, + rescaleEngNodes)); + + if (rescaleEngNodes.size() > 0) + { + ASSERT(rescaleEngNodes.size() == 1); + for (NvU32 ii = 0; ii < rescaleEngNodes.size(); ii++) + { + transformedEngNodes.push_back(rescaleEngNodes.at(ii)); + } + + // New src edge becomes scales output edge. + engSrcEdge = engGraph->nodeEdges(rescaleEngNodes.back(), ast::EdgeSideEnum::FIRST).at(0); + } + } + + engActNode = engine_ast::NodeFactory::newSDPActivationOpNode(canActNode, engGraph); + + engGraph->appendNodeToEdge(engSrcEdge, ast::EdgeSideEnum::SECOND, engActNode); + engGraph->appendNodeToEdge(engSinkEdge, ast::EdgeSideEnum::FIRST, engActNode); + + PROPAGATE_ERROR_FAIL(engActNode->populateEdgePorts()); + transformedEngNodes.push_back(engActNode); + +fail: + return e; +} + +static NvDlaError transformCanPoolingOp +( + engine_ast::Graph* engGraph, + canonical_ast::Node *canNode, + engine_ast::Graph::EdgeSequence engSrcEdges, + engine_ast::Graph::EdgeSequence engSinkEdges, + engine_ast::Graph::NodeSequence& transformedEngNodes +) +{ + NvDlaError e = NvDlaSuccess; + canonical_ast::PoolingNode* canPoolNode = NULL; + engine_ast::PDPNode* engPDPNode = NULL; + engine_ast::Edge* engSrcEdge = NULL; + engine_ast::Edge* engSinkEdge = NULL; + + if (engSrcEdges.size() != 1 || engSinkEdges.size() != 1) + { + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Don't support Pooling operation with input edges (%d) != 1 or " + "output edges (%d) != 1", engSrcEdges.size(), engSinkEdges.size()); + } + + engSrcEdge = engSrcEdges[0]; + engSinkEdge = engSinkEdges[0]; + canPoolNode = canonical_ast::NodeFactory::nodeCast(canNode); + engPDPNode = engine_ast::NodeFactory::newPDPNode(canPoolNode, engGraph); + + engGraph->appendNodeToEdge(engSrcEdge, ast::EdgeSideEnum::SECOND, engPDPNode); + engGraph->appendNodeToEdge(engSinkEdge, ast::EdgeSideEnum::FIRST, engPDPNode); + + PROPAGATE_ERROR_FAIL(engPDPNode->populateEdgePorts()); + transformedEngNodes.push_back(engPDPNode); + +fail: + return e; +} + +static NvDlaError transformCanLRNOp +( + engine_ast::Graph* engGraph, + canonical_ast::Node *canNode, + engine_ast::Graph::EdgeSequence engSrcEdges, + engine_ast::Graph::EdgeSequence engSinkEdges, + engine_ast::Graph::NodeSequence& transformedEngNodes +) +{ + NvDlaError e = NvDlaSuccess; + canonical_ast::LRNNode* canLRNNode = NULL; + engine_ast::CDPLRNOpNode* engLRNNode = NULL; + engine_ast::Edge* engSrcEdge = NULL; + engine_ast::Edge* engSinkEdge = NULL; + + if (engSrcEdges.size() != 1 || engSinkEdges.size() != 1) + { + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Don't support LRN operation with input edges (%d) != 1 or " + "output edges (%d) != 1", engSrcEdges.size(), engSinkEdges.size()); + } + + engSrcEdge = engSrcEdges[0]; + engSinkEdge = engSinkEdges[0]; + canLRNNode = canonical_ast::NodeFactory::nodeCast(canNode); + engLRNNode = engine_ast::NodeFactory::newCDPLRNOpNode(canLRNNode, engGraph); + + engGraph->appendNodeToEdge(engSrcEdge, ast::EdgeSideEnum::SECOND, engLRNNode); + engGraph->appendNodeToEdge(engSinkEdge, ast::EdgeSideEnum::FIRST, engLRNNode); + + PROPAGATE_ERROR_FAIL(engLRNNode->populateEdgePorts()); + transformedEngNodes.push_back(engLRNNode); + +fail: + return e; +} + +static NvDlaError transformCanScaleOp +( + engine_ast::Graph* engGraph, + canonical_ast::Node *canNode, + engine_ast::Graph::EdgeSequence engSrcEdges, + engine_ast::Graph::EdgeSequence engSinkEdges, + engine_ast::Graph::NodeSequence& transformedEngNodes +) +{ + NvDlaError e = NvDlaSuccess; + bool isCPUOp = false; + bool isBiasTerm = false; + Weights power; + canonical_ast::ScaleNode* canScaleNode = NULL; + engine_ast::CPUScaleOpNode* engCPUScaleNode = NULL; + engine_ast::SDPScaleOpNode* engSDPScaleNode = NULL; + engine_ast::SDPNode* adjointEngSDPBiasNode = NULL; + engine_ast::Edge* engSrcEdge = NULL; + engine_ast::Edge* engSinkEdge = NULL; + + if (engSrcEdges.size() != 1 || engSinkEdges.size() != 1) + { + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Don't support Scale operation with input edges (%d) != 1 or " + "output edges (%d) != 1", engSrcEdges.size(), engSinkEdges.size()); + } + + engSrcEdge = engSrcEdges[0]; + engSinkEdge = engSinkEdges[0]; + + canScaleNode = canonical_ast::NodeFactory::nodeCast(canNode); + + power = canScaleNode->params().power(); + if ((power.count > 0) && (*reinterpret_cast(const_cast(power.values)) != 0.0f)) + { + engCPUScaleNode = engine_ast::NodeFactory::newCPUScaleOpNode(canScaleNode, engGraph); + engGraph->appendNodeToEdge(engSrcEdge, ast::EdgeSideEnum::SECOND, engCPUScaleNode); + engGraph->appendNodeToEdge(engSinkEdge, ast::EdgeSideEnum::FIRST, engCPUScaleNode); + isCPUOp = true; + } + else + { + engSDPScaleNode = engine_ast::NodeFactory::newSDPScaleOpNode(canScaleNode, engGraph); + engGraph->appendNodeToEdge(engSrcEdge, ast::EdgeSideEnum::SECOND, engSDPScaleNode); + if (canScaleNode->params().hasBiasTerm()) + { + adjointEngSDPBiasNode = engSDPScaleNode->addSDPBiasOpNode(canNode); + engGraph->appendNodeToEdge(engSinkEdge, ast::EdgeSideEnum::FIRST, adjointEngSDPBiasNode); + isBiasTerm = true; + } + else + { + engGraph->appendNodeToEdge(engSinkEdge, ast::EdgeSideEnum::FIRST, engSDPScaleNode); + isBiasTerm = false; + } + } + + if (isCPUOp) + { + PROPAGATE_ERROR_FAIL(engCPUScaleNode->populateEdgePorts()); + transformedEngNodes.push_back(engCPUScaleNode); + } + else + { + PROPAGATE_ERROR_FAIL(engSDPScaleNode->populateEdgePorts()); + transformedEngNodes.push_back(engSDPScaleNode); + if (isBiasTerm) + { + PROPAGATE_ERROR_FAIL(adjointEngSDPBiasNode->populateEdgePorts()); + transformedEngNodes.push_back(adjointEngSDPBiasNode); + } + } + +fail: + return e; +} + +static NvDlaError transformCanBNOp +( + engine_ast::Graph* engGraph, + canonical_ast::Node *canNode, + engine_ast::Graph::EdgeSequence engSrcEdges, + engine_ast::Graph::EdgeSequence engSinkEdges, + engine_ast::Graph::NodeSequence& transformedEngNodes +) +{ + NvDlaError e = NvDlaSuccess; + canonical_ast::BatchNormNode* canBNNode = NULL; + engine_ast::SDPBatchNormOpNode* engBNNode = NULL; + engine_ast::Edge* engSrcEdge = NULL; + engine_ast::Edge* engSinkEdge = NULL; + + if (engSrcEdges.size() != 1 || engSinkEdges.size() != 1) + { + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Don't support Batch Norm operation with input edges (%d) != 1 or " + "output edges (%d) != 1", engSrcEdges.size(), engSinkEdges.size()); + } + + engSrcEdge = engSrcEdges[0]; + engSinkEdge = engSinkEdges[0]; + canBNNode = canonical_ast::NodeFactory::nodeCast(canNode); + engBNNode = engine_ast::NodeFactory::newSDPBatchNormOpNode(canBNNode, engGraph); + + engGraph->appendNodeToEdge(engSrcEdge, ast::EdgeSideEnum::SECOND, engBNNode); + engGraph->appendNodeToEdge(engSinkEdge, ast::EdgeSideEnum::FIRST, engBNNode); + + PROPAGATE_ERROR_FAIL(engBNNode->populateEdgePorts()); + transformedEngNodes.push_back(engBNNode); + +fail: + return e; +} + +static NvDlaError transformCanSoftMaxOp +( + engine_ast::Graph* engGraph, + canonical_ast::Node *canNode, + engine_ast::Graph::EdgeSequence engSrcEdges, + engine_ast::Graph::EdgeSequence engSinkEdges, + engine_ast::Graph::NodeSequence& transformedEngNodes +) +{ + NvDlaError e = NvDlaSuccess; + canonical_ast::SoftMaxNode* canSMNode = NULL; + engine_ast::CPUSoftMaxOpNode* engSMNode = NULL; + engine_ast::Edge* engSrcEdge = NULL; + engine_ast::Edge* engSinkEdge = NULL; + + if (engSrcEdges.size() != 1 || engSinkEdges.size() != 1) + { + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Don't support Softmax operation with input edges (%d) != 1 or " + "output edges (%d) != 1", engSrcEdges.size(), engSinkEdges.size()); + } + + engSrcEdge = engSrcEdges[0]; + engSinkEdge = engSinkEdges[0]; + canSMNode = canonical_ast::NodeFactory::nodeCast(canNode); + engSMNode = engine_ast::NodeFactory::newCPUSoftMaxOpNode(canSMNode, engGraph); + + engGraph->appendNodeToEdge(engSrcEdge, ast::EdgeSideEnum::SECOND, engSMNode); + engGraph->appendNodeToEdge(engSinkEdge, ast::EdgeSideEnum::FIRST, engSMNode); + + PROPAGATE_ERROR_FAIL(engSMNode->populateEdgePorts()); + transformedEngNodes.push_back(engSMNode); + +fail: + return e; +} + +static NvDlaError transformCanDeconvOp +( + engine_ast::Graph* engGraph, + canonical_ast::Node *canNode, + engine_ast::Graph::EdgeSequence engSrcEdges, + engine_ast::Graph::EdgeSequence engSinkEdges, + engine_ast::Graph::NodeSequence& transformedEngNodes +) +{ + NvDlaError e = NvDlaSuccess; + canonical_ast::DeconvolutionNode* canDeconvNode = NULL; + engine_ast::ConvCoreNode* engDeconvNode = NULL; + engine_ast::SDPNode* adjointSDPNode = NULL; + engine_ast::Edge* engSrcEdge = NULL; + engine_ast::Edge* engSinkEdge = NULL; + + if (engSrcEdges.size() != 1 || engSinkEdges.size() != 1) + { + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Don't support Deconv operation with input edges (%d) != 1 or " + "output edges (%d) != 1", engSrcEdges.size(), engSinkEdges.size()); + } + + engSrcEdge = engSrcEdges[0]; + engSinkEdge = engSinkEdges[0]; + canDeconvNode = canonical_ast::NodeFactory::nodeCast(canNode); + engDeconvNode = engine_ast::NodeFactory::newConvCoreDeconvolutionOpNode(canDeconvNode, engGraph); + adjointSDPNode = engDeconvNode->addSDPJointOpNode(canDeconvNode); + + engGraph->appendNodeToEdge(engSrcEdge, ast::EdgeSideEnum::SECOND, engDeconvNode); + engGraph->appendNodeToEdge(engSinkEdge, ast::EdgeSideEnum::FIRST, adjointSDPNode); + + PROPAGATE_ERROR_FAIL(engDeconvNode->populateEdgePorts()); + transformedEngNodes.push_back(engDeconvNode); + + PROPAGATE_ERROR_FAIL(adjointSDPNode->populateEdgePorts()); + transformedEngNodes.push_back(adjointSDPNode); + //TODO: a deconv op may also need some of the Rubik Eng magic. Add the rubik node accordingly + +fail: + return e; +} + +static NvDlaError transformCanConcatOp +( + engine_ast::Graph* engGraph, + canonical_ast::Node *canNode, + engine_ast::Graph::EdgeSequence engSrcEdges, + engine_ast::Graph::EdgeSequence engSinkEdges, + engine_ast::Graph::NodeSequence& transformedEngNodes +) +{ + NvDlaError e = NvDlaSuccess; + canonical_ast::ConcatenationNode* canConcatNode = NULL; + engine_ast::ConcatenationNode* engConcatNode = NULL; + engine_ast::Graph::EdgeSequenceIterator eni; + + canConcatNode = canonical_ast::NodeFactory::nodeCast(canNode); + engConcatNode = engine_ast::NodeFactory::newConcatNode(canConcatNode, engGraph); + + for (eni = engSrcEdges.begin(); eni != engSrcEdges.end(); ++eni) + { + engGraph->appendNodeToEdge(*eni, ast::EdgeSideEnum::SECOND, engConcatNode); + } + + for (eni = engSinkEdges.begin(); eni != engSinkEdges.end(); ++eni) + { + engGraph->appendNodeToEdge(*eni, ast::EdgeSideEnum::FIRST, engConcatNode); + } + + PROPAGATE_ERROR_FAIL(engConcatNode->populateEdgePorts()); + transformedEngNodes.push_back(engConcatNode); + +fail: + return e; +} + +static NvDlaError transformCanEWOp +( + engine_ast::Graph* engGraph, + canonical_ast::Node *canNode, + engine_ast::Graph::EdgeSequence engSrcEdges, + engine_ast::Graph::EdgeSequence engSinkEdges, + engine_ast::Graph::NodeSequence& transformedEngNodes +) +{ + NvDlaError e = NvDlaSuccess; + canonical_ast::ElementWiseNode* canEWNode = NULL; + engine_ast::SDPElementWiseOpNode* engEWNode = NULL; + engine_ast::Edge* engSrc1Edge = NULL; + engine_ast::Edge* engSrc2Edge = NULL; + engine_ast::Edge* engSinkEdge = NULL; + + if (engSrcEdges.size() != 2 || engSinkEdges.size() != 1) + { + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Don't support EW operation with input edges (%d) != 1 or " + "output edges (%d) != 1", engSrcEdges.size(), engSinkEdges.size()); + } + + engSrc1Edge = engSrcEdges[0]; + engSrc2Edge = engSrcEdges[1]; + engSinkEdge = engSinkEdges[0]; + canEWNode = canonical_ast::NodeFactory::nodeCast(canNode); + engEWNode = engine_ast::NodeFactory::newSDPElementWiseOpNode(canEWNode, engGraph); + + engGraph->appendNodeToEdge(engSrc1Edge, ast::EdgeSideEnum::SECOND, engEWNode); + engGraph->appendNodeToEdge(engSrc2Edge, ast::EdgeSideEnum::SECOND, engEWNode); + engGraph->appendNodeToEdge(engSinkEdge, ast::EdgeSideEnum::FIRST, engEWNode); + + PROPAGATE_ERROR_FAIL(engEWNode->populateEdgePorts()); + transformedEngNodes.push_back(engEWNode); + +fail: + return e; +} + +static NvDlaError transformCanSplitOp +( + engine_ast::Graph* engGraph, + canonical_ast::Node *canNode, + engine_ast::Graph::EdgeSequence engSrcEdges, + engine_ast::Graph::EdgeSequence engSinkEdges, + engine_ast::Graph::NodeSequence& transformedEngNodes +) +{ + NvDlaError e = NvDlaSuccess; + canonical_ast::SplitNode* canSplitNode = NULL; + engine_ast::SplitNode* engSplitNode = NULL; + engine_ast::Graph::EdgeSequenceIterator eni; + + canSplitNode = canonical_ast::NodeFactory::nodeCast(canNode); + engSplitNode = engine_ast::NodeFactory::newSplitNode(canSplitNode, engGraph); + + for (eni = engSrcEdges.begin(); eni != engSrcEdges.end(); ++eni) + { + engGraph->appendNodeToEdge(*eni, ast::EdgeSideEnum::SECOND, engSplitNode); + } + + for (eni = engSinkEdges.begin(); eni != engSinkEdges.end(); ++eni) + { + engGraph->appendNodeToEdge(*eni, ast::EdgeSideEnum::FIRST, engSplitNode); + } + + PROPAGATE_ERROR_FAIL(engSplitNode->populateEdgePorts()); + transformedEngNodes.push_back(engSplitNode); + +fail: + return e; +} + +NvDlaError engine_ast::transformCanNode +( + engine_ast::Graph* engGraph, + canonical_ast::Node *canNode, + engine_ast::Graph::EdgeSequence engSrcEdges, + engine_ast::Graph::EdgeSequence engSinkEdges, + engine_ast::Graph::NodeSequence& transformedEngNodes +) +{ + NvDlaError e = NvDlaSuccess; + + switch (canNode->canonicalOpType().v()) + { + case canonical_ast::CONVOLUTION: + PROPAGATE_ERROR_FAIL(transformCanConvOp(engGraph, canNode, engSrcEdges, engSinkEdges, transformedEngNodes)); break; + case canonical_ast::FULLY_CONNECTED: + PROPAGATE_ERROR_FAIL(transformCanFCOp(engGraph, canNode, engSrcEdges, engSinkEdges, transformedEngNodes)); break; + case canonical_ast::ACTIVATION: + PROPAGATE_ERROR_FAIL(transformCanActOp(engGraph, canNode, engSrcEdges, engSinkEdges, transformedEngNodes)); break; + case canonical_ast::POOLING: + PROPAGATE_ERROR_FAIL(transformCanPoolingOp(engGraph, canNode, engSrcEdges, engSinkEdges, transformedEngNodes)); break; + case canonical_ast::LRN: + PROPAGATE_ERROR_FAIL(transformCanLRNOp(engGraph, canNode, engSrcEdges, engSinkEdges, transformedEngNodes)); break; + case canonical_ast::SCALE: + PROPAGATE_ERROR_FAIL(transformCanScaleOp(engGraph, canNode, engSrcEdges, engSinkEdges, transformedEngNodes)); break; + case canonical_ast::BATCH_NORM: + PROPAGATE_ERROR_FAIL(transformCanBNOp(engGraph, canNode, engSrcEdges, engSinkEdges, transformedEngNodes)); break; + case canonical_ast::SOFTMAX: + PROPAGATE_ERROR_FAIL(transformCanSoftMaxOp(engGraph, canNode, engSrcEdges, engSinkEdges, transformedEngNodes)); break; + case canonical_ast::DECONVOLUTION: + PROPAGATE_ERROR_FAIL(transformCanDeconvOp(engGraph, canNode, engSrcEdges, engSinkEdges, transformedEngNodes)); break; + case canonical_ast::CONCATENATION: + PROPAGATE_ERROR_FAIL(transformCanConcatOp(engGraph, canNode, engSrcEdges, engSinkEdges, transformedEngNodes)); break; + case canonical_ast::ELEMENTWISE: + PROPAGATE_ERROR_FAIL(transformCanEWOp(engGraph, canNode, engSrcEdges, engSinkEdges, transformedEngNodes)); break; + case canonical_ast::SPLIT: + PROPAGATE_ERROR_FAIL(transformCanSplitOp(engGraph, canNode, engSrcEdges, engSinkEdges, transformedEngNodes)); break; + default: + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unexpected canonical node '%s' of type '%s' ", + canNode->id().c_str(), canNode->canonicalOpType().c_str()); + } + +fail: + return e; +} + + +//---------------------------------------------------------------------- +// serialization +//---------------------------------------------------------------------- +bool engine_ast::serializeTo(WisdomContainerEntry *) +{ + // tbd + return false; +} + +bool engine_ast::deserializeFrom(WisdomContainerEntry *) +{ + // tbd + return false; +} + +ostream &engine_ast::outputJson(engine_ast::Graph *, ostream &os) +{ + // tbd + return os; +} + +ostream &engine_ast::outputJson(engine_ast::Graph *g, engine_ast::Edge *edge, ostream &os) +{ + string delim(""); + NodeSequence srcs = g->upstreamNodes(edge); + NodeSequence tgts = g->downstreamNodes(edge); + + // note: the (void*) cast hack is to be certain the ids given are unique. + // nodes already had a property like that. but edges didn't. + + os << "{\"class\":\"edge\", \"id\" : \"e-" << std::hex << (void*)edge << std::dec << + "\", \"name\":\"" << edge->id()<< + "\", \"type\":\"" << edge->edgeType().c_str() << "\", "; + + os << "\"sources\":["; + + for ( NodeSequence::const_iterator si = srcs.begin(); si != srcs.end(); ++si) + { + os << delim << "\"" << (*si)->name() << "\""; delim = ", "; + } + delim=""; + os << "], \"targets\":["; + + for ( NodeSequence::const_iterator ti = tgts.begin(); ti != tgts.end(); ++ti) + { + os << delim << "\"" << (*ti)->name() << "\""; delim = ", "; + } + os << "]}"; + return os; +} +ostream &engine_ast::outputJson(engine_ast::Graph *, engine_ast::Node *node, ostream &os) +{ + os << "{\"class\":\"node\", \"id\" : \"" << node->name() << + "\",\"name\":\"" << node->id() << + "\",\"className\":\"" << node->className() << + "\"}"; + return os; +} + +NvU16 engine_ast::ASTToEMUInterface::getDataFormat(EMUInterface* emu_if, surface::SurfaceFormat sf, NvU32 mem_atomic_size) +{ + NvU16 emu_if_df = 0xFF; + switch(sf.v()) { + case surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_INT8: + emu_if_df = emu_if->bufferDescAccessor(0).format_INT8(); + if (mem_atomic_size == 8) + emu_if_df = emu_if->bufferDescAccessor(0).format_INT8_8(); + break; + case surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_INT16: emu_if_df = emu_if->bufferDescAccessor(0).format_INT16(); break; + case surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_FP16: emu_if_df = emu_if->bufferDescAccessor(0).format_FF16(); break; + default: REPORT_ERROR(NvDlaError_BadParameter, "Wrong surface format provided %s", sf.c_str()); + } + + return emu_if_df; +} + +NvU8 engine_ast::ASTToDLAInterface::getConvCorePrecision(DLAInterface* dla_if, surface::SurfacePrecision sp) +{ + NvU8 dla_if_sp = 0xFF; + switch(sp.v()) { + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_FP16: dla_if_sp = dla_if->convOpDescAccessor(0).inPrecision_FP16(); break; + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16: dla_if_sp = dla_if->convOpDescAccessor(0).inPrecision_Int16(); break; + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8: dla_if_sp = dla_if->convOpDescAccessor(0).inPrecision_Int8(); break; + default: REPORT_ERROR(NvDlaError_BadParameter, "Wrong surface precision provided %s", sp.c_str()); + } + return dla_if_sp; +} + +NvU8 engine_ast::ASTToDLAInterface::getSDPPrecision(DLAInterface* dla_if, surface::SurfacePrecision sp) +{ + NvU8 dla_if_sp = 0xFF; + switch(sp.v()) { + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_FP16: dla_if_sp = dla_if->sdpOpDescAccessor(0).srcPrecision_FP16(); break; + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16: dla_if_sp = dla_if->sdpOpDescAccessor(0).srcPrecision_Int16(); break; + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8: dla_if_sp = dla_if->sdpOpDescAccessor(0).srcPrecision_Int8(); break; + default: REPORT_ERROR(NvDlaError_BadParameter, "Wrong surface precision provided %s", sp.c_str()); + } + return dla_if_sp; +} + +NvU8 engine_ast::ASTToDLAInterface::getSDPActType(DLAInterface* dla_if, engine_ast::SDPActType sat) +{ + NvU8 dla_if_sat = 0xFF; + switch(sat.v()) { + case engine_ast::SDPActTypeEnum::SDP_ACT_TYPE_RELU: dla_if_sat = dla_if->sdpOpAccessor(0).act_RelU(); break; + case engine_ast::SDPActTypeEnum::SDP_ACT_TYPE_SIGMOID: + case engine_ast::SDPActTypeEnum::SDP_ACT_TYPE_TANH: dla_if_sat = dla_if->sdpOpAccessor(0).act_LUT(); break; + case engine_ast::SDPActTypeEnum::SDP_ACT_TYPE_NONE: dla_if_sat = dla_if->sdpOpAccessor(0).act_None(); break; + default: REPORT_ERROR(NvDlaError_BadParameter, "Wrong SDP Activation type provided %s", sat.c_str()); + } + return dla_if_sat; +} + +NvU8 engine_ast::ASTToDLAInterface::getSDPMode(DLAInterface* dla_if, + engine_ast::SDPMode smode) +{ + NvU8 dla_if_smode = 0xFF; + switch(smode.v()) { + case engine_ast::SDPModeEnum::SDP_MODE_PER_LAYER: + dla_if_smode = dla_if->sdpOpAccessor(0).mode_PerLayer(); + break; + case engine_ast::SDPModeEnum::SDP_MODE_PER_CHANNEL: + dla_if_smode = dla_if->sdpOpAccessor(0).mode_PerKernel(); + break; + case engine_ast::SDPModeEnum::SDP_MODE_PER_ELEMENT: + dla_if_smode = dla_if->sdpOpAccessor(0).mode_PerPoint(); + break; + default: + REPORT_ERROR(NvDlaError_BadParameter, + "Wrong SDP mode provided %s", + smode.c_str()); + } + return dla_if_smode; +} + +NvU8 engine_ast::ASTToDLAInterface::getSDPEnable(DLAInterface* dla_if, bool enabled) +{ + NvU8 dla_if_enable = 0; + if (enabled) + { + dla_if_enable = 1; + } + + return dla_if_enable; +} + +NvU8 engine_ast::ASTToDLAInterface::getSDPALUType(DLAInterface* dla_if, engine_ast::SDPALUType sat) +{ + NvU8 dla_if_sat = 0xFF; + switch(sat.v()) { + case engine_ast::SDPALUTypeEnum::SDP_ALU_TYPE_MAX: dla_if_sat = dla_if->sdpOpAccessor(0).ALUType_Max(); break; + case engine_ast::SDPALUTypeEnum::SDP_ALU_TYPE_MIN: dla_if_sat = dla_if->sdpOpAccessor(0).ALUType_Min(); break; + case engine_ast::SDPALUTypeEnum::SDP_ALU_TYPE_SUM: dla_if_sat = dla_if->sdpOpAccessor(0).ALUType_Sum(); break; + case engine_ast::SDPALUTypeEnum::SDP_ALU_TYPE_EQL: dla_if_sat = dla_if->sdpOpAccessor(0).ALUType_Eql(); break; + default: REPORT_ERROR(NvDlaError_BadParameter, "Wrong SDP ALU type provided %s", sat.c_str()); + } + return dla_if_sat; +} + +NvU8 engine_ast::ASTToDLAInterface::getSDPOpType(DLAInterface* dla_if, engine_ast::SDPOpType sat) +{ + NvU8 dla_if_sat = 0xFF; + switch(sat.v()) { + case engine_ast::SDPOpTypeEnum::SDP_OP_TYPE_NONE: dla_if_sat = dla_if->sdpOpAccessor(0).type_None(); break; + case engine_ast::SDPOpTypeEnum::SDP_OP_TYPE_MUL: dla_if_sat = dla_if->sdpOpAccessor(0).type_Mul(); break; + case engine_ast::SDPOpTypeEnum::SDP_OP_TYPE_ADD: dla_if_sat = dla_if->sdpOpAccessor(0).type_Add(); break; + case engine_ast::SDPOpTypeEnum::SDP_OP_TYPE_BOTH: dla_if_sat = dla_if->sdpOpAccessor(0).type_Both(); break; + default: REPORT_ERROR(NvDlaError_BadParameter, "Wrong SDP Op type provided %s", sat.c_str()); + } + return dla_if_sat; +} + +NvU8 engine_ast::ASTToDLAInterface::getPDPPrecision(DLAInterface* dla_if, surface::SurfacePrecision sp) +{ + NvU8 dla_if_sp = 0xFF; + switch(sp.v()) { + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_FP16: dla_if_sp = dla_if->pdpOpDescAccessor(0).precision_FP16(); break; + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16: dla_if_sp = dla_if->pdpOpDescAccessor(0).precision_Int16(); break; + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8: dla_if_sp = dla_if->pdpOpDescAccessor(0).precision_Int8(); break; + default: REPORT_ERROR(NvDlaError_BadParameter, "Wrong surface precision provided %s", sp.c_str()); + } + return dla_if_sp; +} + +NvU8 engine_ast::ASTToDLAInterface::getCDPPrecision(DLAInterface* dla_if, surface::SurfacePrecision sp) +{ + NvU8 dla_if_sp = 0xFF; + switch(sp.v()) { + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_FP16: dla_if_sp = dla_if->cdpOpDescAccessor(0).inPrecision_FP16(); break; + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16: dla_if_sp = dla_if->cdpOpDescAccessor(0).inPrecision_Int8(); break; + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8: dla_if_sp = dla_if->cdpOpDescAccessor(0).inPrecision_Int8(); break; + default: REPORT_ERROR(NvDlaError_BadParameter, "Wrong surface precision provided %s", sp.c_str()); + } + return dla_if_sp; +} + +NvU8 engine_ast::ASTToDLAInterface::getPDPMode(DLAInterface* dla_if, nvdla::PoolingType pt) +{ + NvU8 dla_if_pm = 0xFF; + switch(pt.v()) { + case nvdla::PoolingType::kAVERAGE: dla_if_pm = dla_if->pdpOpDescAccessor(0).poolMode_AVG(); break; + case nvdla::PoolingType::kMAX: dla_if_pm = dla_if->pdpOpDescAccessor(0).poolMode_MAX(); break; + case nvdla::PoolingType::kMIN: dla_if_pm = dla_if->pdpOpDescAccessor(0).poolMode_MIN(); break; + default: REPORT_ERROR(NvDlaError_BadParameter, "Wrong pooling type provided %s", pt.c_str()); + } + return dla_if_pm; +} + +NvS8 engine_ast::ASTToDLAInterface::getEngineType(DLAInterface* dla_if, EngineType et) +{ + NvS8 dla_if_et = -1; + + switch (et.e()) + { + case EngineTypeEnum::BDMA: dla_if_et = dla_if->commonOpDescAccessor(0).opType_BDMA(); break; + case EngineTypeEnum::CDP: dla_if_et = dla_if->commonOpDescAccessor(0).opType_CDP(); break; + case EngineTypeEnum::SDP: dla_if_et = dla_if->commonOpDescAccessor(0).opType_SDP(); break; + case EngineTypeEnum::PDP: dla_if_et = dla_if->commonOpDescAccessor(0).opType_PDP(); break; + case EngineTypeEnum::CONVOLUTION: dla_if_et = dla_if->commonOpDescAccessor(0).opType_CONV(); break; + case EngineTypeEnum::RUBIK: dla_if_et = dla_if->commonOpDescAccessor(0).opType_RUBIK(); break; + + // these are emu/cpu/sw engine types which don't map to hardware engines + case EngineTypeEnum::SPLIT: + case EngineTypeEnum::CONCATENATION: + case EngineTypeEnum::CPU: + case EngineTypeEnum::MULTI_OPS: + return -1; + + default: REPORT_ERROR(NvDlaError_BadParameter, "Wrong EngineType provided %s", et.c_str()); + } + return dla_if_et; +} + +NvU8 engine_ast::ASTToDLAInterface::getOperationEventType(DLAInterface* dla_if, OperationEventType oet) +{ + NvU8 dla_if_cet = 0xFF; + switch (oet.e()) { + case OperationEventTypeEnum::OP_PROGRAMMED: dla_if_cet = dla_if->consumerAccessor(0).event_OpProgrammed(); break; + case OperationEventTypeEnum::OP_ENABLED: dla_if_cet = dla_if->consumerAccessor(0).event_OpEnabled(); break; + case OperationEventTypeEnum::OP_COMPLETED: dla_if_cet = dla_if->consumerAccessor(0).event_OpCompleted(); break; + case OperationEventTypeEnum::OP_CDMA_WEIGHT_DONE: dla_if_cet = dla_if->consumerAccessor(0).event_OpCDMAWeightDone(); break; + case OperationEventTypeEnum::OP_CDMA_DATA_DONE: dla_if_cet = dla_if->consumerAccessor(0).event_OpCDMADataDone(); break; + default: REPORT_ERROR(NvDlaError_BadParameter, "Wrong OperationEventType provided %d", oet.v()); + } + return dla_if_cet; +} + +NvU8 engine_ast::ASTToDLAInterface::getDataFormat(DLAInterface* dla_if, surface::SurfaceFormat sf) +{ + NvU8 dla_if_df = 0xFF; + switch (sf.v()) { + case surface::SurfaceFormatEnum::NVDLA_IMG_R8: dla_if_df = dla_if->convOpDescAccessor(0).dataFormat_T_R8(); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_R10: dla_if_df = dla_if->convOpDescAccessor(0).dataFormat_T_R10(); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_R12: dla_if_df = dla_if->convOpDescAccessor(0).dataFormat_T_R12(); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_R16: dla_if_df = dla_if->convOpDescAccessor(0).dataFormat_T_R16(); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_R16_I: dla_if_df = dla_if->convOpDescAccessor(0).dataFormat_T_R16_I(); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_R16_F: dla_if_df = dla_if->convOpDescAccessor(0).dataFormat_T_R16_F(); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_A16B16G16R16: dla_if_df = dla_if->convOpDescAccessor(0).dataFormat_T_A16B16G16R16(); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_X16B16G16R16: dla_if_df = dla_if->convOpDescAccessor(0).dataFormat_T_X16B16G16R16(); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_A16B16G16R16_F: dla_if_df = dla_if->convOpDescAccessor(0).dataFormat_T_A16B16G16R16_F(); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_A16Y16U16V16: dla_if_df = dla_if->convOpDescAccessor(0).dataFormat_T_A16Y16U16V16(); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_V16U16Y16A16: dla_if_df = dla_if->convOpDescAccessor(0).dataFormat_T_V16U16Y16A16(); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_A16Y16U16V16_F: dla_if_df = dla_if->convOpDescAccessor(0).dataFormat_T_A16Y16U16V16_F(); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_A8B8G8R8: dla_if_df = dla_if->convOpDescAccessor(0).dataFormat_T_A8B8G8R8(); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_A8R8G8B8: dla_if_df = dla_if->convOpDescAccessor(0).dataFormat_T_A8R8G8B8(); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_B8G8R8A8: dla_if_df = dla_if->convOpDescAccessor(0).dataFormat_T_B8G8R8A8(); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_R8G8B8A8: dla_if_df = dla_if->convOpDescAccessor(0).dataFormat_T_R8G8B8A8(); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_X8B8G8R8: dla_if_df = dla_if->convOpDescAccessor(0).dataFormat_T_X8B8G8R8(); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_X8R8G8B8: dla_if_df = dla_if->convOpDescAccessor(0).dataFormat_T_X8R8G8B8(); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_B8G8R8X8: dla_if_df = dla_if->convOpDescAccessor(0).dataFormat_T_B8G8R8X8(); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_R8G8B8X8: dla_if_df = dla_if->convOpDescAccessor(0).dataFormat_T_R8G8B8X8(); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_A2B10G10R10: dla_if_df = dla_if->convOpDescAccessor(0).dataFormat_T_A2B10G10R10(); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_A2R10G10B10: dla_if_df = dla_if->convOpDescAccessor(0).dataFormat_T_A2R10G10B10(); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_B10G10R10A2: dla_if_df = dla_if->convOpDescAccessor(0).dataFormat_T_B10G10R10A2(); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_R10G10B10A2: dla_if_df = dla_if->convOpDescAccessor(0).dataFormat_T_R10G10B10A2(); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_A2Y10U10V10: dla_if_df = dla_if->convOpDescAccessor(0).dataFormat_T_A2Y10U10V10(); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_V10U10Y10A2: dla_if_df = dla_if->convOpDescAccessor(0).dataFormat_T_V10U10Y10A2(); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_A8Y8U8V8: dla_if_df = dla_if->convOpDescAccessor(0).dataFormat_T_A8Y8U8V8(); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_V8U8Y8A8: dla_if_df = dla_if->convOpDescAccessor(0).dataFormat_T_V8U8Y8A8(); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_Y8___U8V8_N444: dla_if_df = dla_if->convOpDescAccessor(0).dataFormat_T_Y8___U8V8_N444(); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_Y8___V8U8_N444: dla_if_df = dla_if->convOpDescAccessor(0).dataFormat_T_Y8___V8U8_N444(); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_Y10___U10V10_N444: dla_if_df = dla_if->convOpDescAccessor(0).dataFormat_T_Y10___U10V10_N444(); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_Y10___V10U10_N444: dla_if_df = dla_if->convOpDescAccessor(0).dataFormat_T_Y10___V10U10_N444(); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_Y12___U12V12_N444: dla_if_df = dla_if->convOpDescAccessor(0).dataFormat_T_Y12___U12V12_N444(); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_Y12___V12U12_N444: dla_if_df = dla_if->convOpDescAccessor(0).dataFormat_T_Y12___V12U12_N444(); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_Y16___U16V16_N444: dla_if_df = dla_if->convOpDescAccessor(0).dataFormat_T_Y16___U16V16_N444(); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_Y16___V16U16_N444: dla_if_df = dla_if->convOpDescAccessor(0).dataFormat_T_Y16___V16U16_N444(); break; + case surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_INT8: + case surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_INT16: + case surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_FP16: dla_if_df = dla_if->convOpDescAccessor(0).dataFormat_FEATURE(); break; + default: REPORT_ERROR(NvDlaError_BadParameter, "Unsupported surface format provided %s", sf.c_str()); + } + return dla_if_df; +} + +NvU8 engine_ast::ASTToDLAInterface::getRubikPrecision(DLAInterface* dla_if, surface::SurfacePrecision sp) +{ + NvU8 dla_if_sp = 0xFF; + switch(sp.v()) { + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_FP16: dla_if_sp = dla_if->rubikOpDescAccessor(0).precision_FP16(); break; + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16: dla_if_sp = dla_if->rubikOpDescAccessor(0).precision_Int16(); break; + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8: dla_if_sp = dla_if->rubikOpDescAccessor(0).precision_Int8(); break; + default: REPORT_ERROR(NvDlaError_BadParameter, "Wrong surface precision provided %s", sp.c_str()); + } + return dla_if_sp; +} + +NvU8 engine_ast::ASTToDLAInterface::getRubikMode(DLAInterface* dla_if, RubikMode rm) +{ + NvU8 dla_if_rm = 0xFF; + switch(rm.v()) { + case RubikModeEnum::RUBIK_MODE_CONTRACT: dla_if_rm = dla_if->rubikOpDescAccessor(0).mode_Contract(); break; + case RubikModeEnum::RUBIK_MODE_SPLIT: dla_if_rm = dla_if->rubikOpDescAccessor(0).mode_Split(); break; + case RubikModeEnum::RUBIK_MODE_MERGE: dla_if_rm = dla_if->rubikOpDescAccessor(0).mode_Merge(); break; + default: REPORT_ERROR(NvDlaError_BadParameter, "Wrong rubik mode provided %s", rm.c_str()); + } + return dla_if_rm; +} +}; // nvdla::priv +}; // nvdla diff --git a/umd/core/src/compiler/engine-ast/EngineEdge.cpp b/umd/core/src/compiler/engine-ast/EngineEdge.cpp new file mode 100644 index 00000000..5ee55e5e --- /dev/null +++ b/umd/core/src/compiler/engine-ast/EngineEdge.cpp @@ -0,0 +1,1041 @@ +/* + * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#include "priv/EngineAST.h" +#include "priv/Profile.h" +#include "priv/Tensor.h" +#include "ErrorMacros.h" + +#include + +using std::map; +using std::vector; +using std::endl; + + +namespace nvdla +{ +namespace priv +{ + +//---------------------------------------------------------------------- +// Compiler Utils +//---------------------------------------------------------------------- +/*--------------------------Register Surface Desc---------------------*/ +/* idempotent */ +NvDlaError engine_ast::Edge::registerSurface() +{ + NvDlaError e = NvDlaError_Success; + + surface::TensorSurfaceDesc* tsd = NULL; + TensorType tt; + NvU16 numBatches = graph()->profile()->multiBatchSize(); + + if ( !isDataEdge() ) + { + goto fail; + } + + tt = originalTensor() ? originalTensor()->getTensorType() : TensorType::kDEBUG; + + if ( tt == TensorType::kUNKNOWN ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unidentified TensorType '%d' in edge '%s'", tt, id().c_str()); + } + + tsd = tensorSurfaceDesc(); + if ( !tsd ) + { + tsd = graph()->resourceMgr()->regTensorSurfaceDesc(tt, numBatches); + tsd->setName(std::string(originalTensor()->getName())); + tsd->setBufferOffset(0); // default offset + tsd->setDimensions(originalTensor()->getDimensions()); + tsd->setCopyOutDebugSurface(tt == TensorType::kDEBUG); + tsd->setDataFormat(originalTensor()->getDataFormat()); + tsd->setParentEdge(this); + setTensorSurfaceDesc(tsd); + + // + // is this edge related to a bindable resource? + // if so we need to maintain that connection. + // + if ( bindable() ) + { + enum IOD bindDomain; + NvS16 bid = bindId(bindDomain); + tsd->setBindId(bid, bindDomain); + if ( debugBinding() ) + { + gLogInfo << "set bind id " << bid << " for " << id() << " " << tsd->id() << endl; + } + + // tbd: theoretically could be cvsram as well? + // choosing not to support it for now. + //tsd->setMemoryLoc(memory::LocationEnum::lDRAM); + } + + if ( graph()->debugSurfaces() ) + { + gLogInfo << ((tt == TensorType::kDEBUG) ? "(debug) ":"" ) << + "edge: " << id() << " tsd: " << tsd->id() << + " registered" << endl; + } + } + +fail: + return e; +} + +/*----------------------Determine Surface Clients----------------------*/ +NvDlaError engine_ast::Edge::determineSurfaceClients() +{ + NvDlaError e = NvDlaSuccess; + Graph::NodeSequence upNodes, downNodes; + + surface::TensorSurfaceDesc* tsd = tensorSurfaceDesc(); + + if (!isDataEdge()) + { + goto fail; + } + else if (!tsd) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Surface Desc not yet registered for %s", id().c_str()); + } + + tsd->clearProducers(); + upNodes = graph()->upstreamNodes(this); + for (vector< engine_ast::Node* >::const_iterator ni = upNodes.begin(); + ni != upNodes.end(); ++ni) + { + tsd->addProducer((*ni)); + } + + tsd->clearConsumers(); + downNodes = graph()->downstreamNodes(this); + for (vector< engine_ast::Node* >::const_iterator ni = downNodes.begin(); + ni != downNodes.end(); ++ni) + { + tsd->addConsumer((*ni)); + } + +fail: + return e; +} + +/*----------------------Determine Surface Format-----------------------*/ +NvDlaError engine_ast::Edge::determineSurfaceFormat() +{ + NvDlaError e = NvDlaSuccess; + TensorType tt; + Graph::NodeUnorderedSet producers; + Graph::NodeUnorderedSet consumers; + bool isAUXSurface, isInterimSurface, isBindableSurface; + surface::TensorSurfaceDesc* tsd = tensorSurfaceDesc(); + std::set producerProposedSFs; + std::set consumerProposedSFs; + std::set proposedSFs; + std::vector suggestedSFs; + std::vector supportedSFs; + + if (!isDataEdge()) + { + goto fail; + } + + tt = originalTensor()->getTensorType(); + isAUXSurface = (tt == TensorType::kWEIGHT || tt == TensorType::kBIAS || + tt == TensorType::kBATCH_NORM || tt == TensorType::kSCALE); + isInterimSurface = (tt == TensorType::kIO || tt == TensorType::kSTREAM || + tt == TensorType::kDEBUG); + isBindableSurface = (tt == TensorType::kNW_INPUT || tt == TensorType::kNW_OUTPUT); + + if (!isAUXSurface && !isInterimSurface && !isBindableSurface) + { + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Unsupported tensor type %d", (int)tt); + } + + if (!tsd) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Surface Desc not yet registered for %s", id().c_str()); + } + else if (tsd->surfaceFormat().v() != surface::SurfaceFormatEnum::NVDLA_UNKNOWN_FORMAT) + { + if ( graph()->debugSurfaces() ) + { + gLogInfo << id() << " edge already has set surface format " << + tsd->surfaceFormat().c_str() << endl; + } + goto fail; + } + + producers = tsd->producers(); + consumers = tsd->consumers(); + + // Step-1: Capture surf formats suggested by consumer nodes + for (Graph::NodeUnorderedSetIterator ci = consumers.begin(); ci != consumers.end(); ++ci) + { + suggestedSFs.clear(); + if (isAUXSurface) + { + suggestedSFs = (*ci)->suggestAuxSurfaceFormats(this); + } + else if (isInterimSurface) + { + suggestedSFs = (*ci)->suggestInputSurfaceFormats(); + } + else if (isBindableSurface) + { + suggestedSFs = std::vector(1, graph()->suggestNwSurfaceFormat(TensorType::kNW_INPUT)); + } + std::copy(suggestedSFs.begin(), suggestedSFs.end(), std::inserter(consumerProposedSFs, consumerProposedSFs.end())); + } + + // Step-2: Capture surf formats suggested by producer nodes + for (Graph::NodeUnorderedSetIterator pi = producers.begin(); pi != producers.end(); ++pi) + { + suggestedSFs.clear(); + if (isInterimSurface) + { + suggestedSFs = (*pi)->suggestOutputSurfaceFormats(); + } + else if (isBindableSurface) + { + suggestedSFs = std::vector(1, graph()->suggestNwSurfaceFormat(TensorType::kNW_OUTPUT)); + } + std::copy(suggestedSFs.begin(), suggestedSFs.end(), std::inserter(producerProposedSFs, producerProposedSFs.end())); + } + + // Step-3: Find intersection of suggested surf formats from producers and consumers + if (isBindableSurface) + { + std::copy(producerProposedSFs.begin(), producerProposedSFs.end(), std::inserter(proposedSFs, proposedSFs.end())); + std::copy(consumerProposedSFs.begin(), consumerProposedSFs.end(), std::inserter(proposedSFs, proposedSFs.end())); + } + else if (isAUXSurface) + { + std::copy(consumerProposedSFs.begin(), consumerProposedSFs.end(), std::inserter(proposedSFs, proposedSFs.end())); + } + else if (isInterimSurface) + { + for (std::set::iterator csfi = consumerProposedSFs.begin(); csfi != consumerProposedSFs.end(); ++csfi) + { + if (producerProposedSFs.find(*csfi) != producerProposedSFs.end()) + { + proposedSFs.insert(*csfi); + } + } + for (std::set::iterator psfi = producerProposedSFs.begin(); psfi != producerProposedSFs.end(); ++psfi) + { + if (consumerProposedSFs.find(*psfi) != consumerProposedSFs.end()) + { + proposedSFs.insert(*psfi); + } + } + } + + // prune the proposed surface formats based on criteria + // Criteria-1: prune those SFs that don't fit with #chnls of the TSD + for (std::set::iterator sfi = proposedSFs.begin(); sfi != proposedSFs.end(); ) + { + // allow surface formats that work with any #channels + if ((*sfi).channelsPerAtom() == -1) + ++sfi; + else if ((*sfi).channelsPerAtom() != tsd->dimensions().c) + proposedSFs.erase(sfi++); + else + ++sfi; + } + + if (proposedSFs.size() == 0) + { + PROPAGATE_ERROR_FAIL(NvDlaError_BadValue, "Couldn't narrow down to suitable SF for %s/%s", + id().c_str(), tsd->id().c_str()); + } + else if (proposedSFs.size() > 1) + { + gLogInfo << "More than 1 proposed SFs for " << id() << "/" << tsd->id() << endl; + for (std::set::iterator sfi = proposedSFs.begin(); sfi != proposedSFs.end(); ++sfi) + gLogInfo << (*sfi).c_str() << endl; + } + + //TODO: in future, loop over all proposed sfs and fork graphs + for (Graph::NodeUnorderedSetIterator ci = consumers.begin(); ci != consumers.end(); ++ci) + { + supportedSFs.clear(); + if (isAUXSurface) + { + supportedSFs = (*ci)->supportedAuxSurfFormats(); + } + else if (isInterimSurface || isBindableSurface) + { + supportedSFs = (*ci)->supportedInSurfFormats(); + } + PROPAGATE_ERROR_FAIL((*ci)->supportsSurfaceFormat(*(proposedSFs.begin()), supportedSFs)); + } + + for (Graph::NodeUnorderedSetIterator pi = producers.begin(); pi != producers.end(); ++pi) + { + supportedSFs.clear(); + if (isInterimSurface || isBindableSurface) + { + supportedSFs = (*pi)->supportedOutSurfFormats(); + } + PROPAGATE_ERROR_FAIL((*pi)->supportsSurfaceFormat(*(proposedSFs.begin()), supportedSFs)); + } + + ASSERT(proposedSFs.size() >= 1); + + tsd->setSurfaceFormat(*(proposedSFs.begin())); + + if ( graph()->debugSurfaces() ) + { + gLogInfo << id() << " edge setting new surface format " + << tsd->surfaceFormat().c_str() << endl; + } + +fail: + return e; +} + +/*----------------------Determine Surface Strides----------------------*/ +NvDlaError engine_ast::Edge::determineSurfaceStrides() +{ + NvDlaError e = NvDlaSuccess; + + surface::TensorSurfaceDesc* tsd = tensorSurfaceDesc(); + NvU32 commonLS = 0; + NvU32 commonSS = 0; + Graph::NodeUnorderedSet producers; + Graph::NodeUnorderedSet consumers; + Graph::NodeUnorderedSet clients; + + if ( !isDataEdge() ) + { + goto fail; + } + else if (!tsd) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "TSD not yet registered for edge %s", id().c_str()); + } + + tsd->resetLineStride(); + tsd->resetSurfaceStride(); + + /* + * The readers and writers of a tensor could have differing stride alignment + * limitations. DLA supports reading/writing of smaller cubes within a larger cube + * provided the strides and dimensions are programmed correctly. + * To allow that, the strides for the surface should always represent the larger cube. + */ + producers = tsd->producers(); + consumers = tsd->consumers(); + clients.insert(producers.begin(), producers.end()); + clients.insert(consumers.begin(), consumers.end()); + + for (Graph::NodeUnorderedSetIterator cli = clients.begin(); cli != clients.end(); ++cli) + { + commonLS = std::max(commonLS, (*cli)->suggestLineStride(tsd)); + commonSS = std::max(commonSS, (*cli)->suggestSurfaceStride(tsd)); + } + + tsd->setLineStride(commonLS); + tsd->setSurfaceStride(commonSS); + +fail: + return e; +} + +NvDlaError engine_ast::Edge::determineSurfaceSize() +{ + NvDlaError e = NvDlaSuccess; + + surface::TensorSurfaceDesc* tsd = tensorSurfaceDesc(); + NvU64 commonSize = 0; + Graph::NodeUnorderedSet producers; + Graph::NodeUnorderedSet consumers; + Graph::NodeUnorderedSet clients; + + if ( !isDataEdge() ) + { + goto fail; + } + else if (!tsd) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "TSD not yet registered for edge %s", id().c_str()); + } + + tsd->resetSize(); + + /* + * The readers and writers of a tensor could have differing stride and size + * requirements. DLA supports reading/writing of smaller cubes within a larger cube. + * To allow that, the size for the surface should always represent the larger cube. + */ + producers = tsd->producers(); + consumers = tsd->consumers(); + clients.insert(producers.begin(), producers.end()); + clients.insert(consumers.begin(), consumers.end()); + + for (Graph::NodeUnorderedSetIterator cli = clients.begin(); cli != clients.end(); ++cli) + { + commonSize = std::max(commonSize, (*cli)->suggestSurfaceSize(tsd)); + } + + tsd->setSize(commonSize); + +fail: + return e; +} + +NvDlaError engine_ast::Edge::determineSurfaceOffsetInBuffer() +{ + NvDlaError e = NvDlaSuccess; + + surface::TensorSurfaceDesc* tsd = tensorSurfaceDesc(); + NvU64 bufferOffset = 0; + Graph::NodeUnorderedSet producers; + Graph::NodeUnorderedSet consumers; + Graph::NodeUnorderedSet clients; + + if ( !isDataEdge() ) + { + goto fail; + } + else if (!tsd) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "TSD not yet registered for edge %s", id().c_str()); + } + + tsd->resetBufferOffset(); + + producers = tsd->producers(); + consumers = tsd->consumers(); + clients.insert(producers.begin(), producers.end()); + clients.insert(consumers.begin(), consumers.end()); + + for (Graph::NodeUnorderedSetIterator cli = clients.begin(); cli != clients.end(); ++cli) + { + // arguably, all client nodes should report the same surface offset in buffer + bufferOffset = std::max(bufferOffset, (*cli)->suggestSurfaceOffsetInBuffer(tsd)); + } + + tsd->setBufferOffset(bufferOffset); + +fail: + return e; +} + +NvDlaError engine_ast::Edge::verifySurfaceClients() +{ + NvDlaError e = NvDlaSuccess; + Graph::NodeUnorderedSet producers; + Graph::NodeUnorderedSet consumers; + Graph::NodeSequence upNodes; + Graph::NodeSequence downNodes; + Graph::NodeUnorderedSet producerNodes; + Graph::NodeUnorderedSet consumerNodes; + + surface::TensorSurfaceDesc* tsd = tensorSurfaceDesc(); + + if ( !isDataEdge() ) + { + goto fail; + } + else if (!tsd) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "TSD not yet registered for edge %s", id().c_str()); + } + + + upNodes = graph()->upstreamNodes(this); + producers = tensorSurfaceDesc()->producers(); + for (Graph::NodeSequenceIterator uni = upNodes.begin(); uni != upNodes.end(); ++uni) + producerNodes.insert(*uni); + + downNodes = graph()->downstreamNodes(this); + consumers = tensorSurfaceDesc()->consumers(); + for (Graph::NodeSequenceIterator dni = downNodes.begin(); dni != downNodes.end(); ++dni) + consumerNodes.insert(*dni); + + if (producers != producerNodes) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Producer nodes (%d) != upstream nodes (%d) for %s", + producerNodes.size(), producers.size(), tsd->id().c_str()); + } + else if (consumers != consumerNodes) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Consumer nodes (%d) != downstream nodes (%d) for %s", + consumerNodes.size(), consumers.size(), tsd->id().c_str()); + } + +fail: + return e; +} + +NvDlaError engine_ast::Edge::verifySurfaceFormat() +{ + NvDlaError e = NvDlaSuccess; + TensorType tt; + surface::SurfaceFormat sf; + Graph::NodeUnorderedSet producers; + Graph::NodeUnorderedSet consumers; + bool isAUXSurface, isInterimSurface, isBindableSurface; + surface::TensorSurfaceDesc* tsd = tensorSurfaceDesc(); + std::vector supportedSFs; + + if ( !isDataEdge() ) + { + goto fail; + } + + tt = originalTensor()->getTensorType(); + isAUXSurface = (tt == TensorType::kWEIGHT || tt == TensorType::kBIAS || + tt == TensorType::kBATCH_NORM || tt == TensorType::kSCALE); + isInterimSurface = (tt == TensorType::kIO || tt == TensorType::kSTREAM || + tt == TensorType::kDEBUG); + isBindableSurface = (tt == TensorType::kNW_INPUT || tt == TensorType::kNW_OUTPUT); + + if (!tsd) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "TSD not yet registered for edge %s", id().c_str()); + } + + sf = tsd->surfaceFormat(); + if (sf.v() == surface::SurfaceFormatEnum::NVDLA_UNKNOWN_FORMAT) + { + PROPAGATE_ERROR_FAIL(NvDlaError_BadValue, "Surface format not yet determined for %s", + tsd->id().c_str()); + } + + producers = tsd->producers(); + consumers = tsd->consumers(); + for (Graph::NodeUnorderedSetIterator ci = consumers.begin(); ci != consumers.end(); ++ci) + { + supportedSFs.clear(); + if (isAUXSurface) + { + supportedSFs = (*ci)->supportedAuxSurfFormats(); + } + else if (isInterimSurface || isBindableSurface) + { + supportedSFs = (*ci)->supportedInSurfFormats(); + } + PROPAGATE_ERROR_FAIL((*ci)->supportsSurfaceFormat(sf, supportedSFs)); + } + + for (Graph::NodeUnorderedSetIterator pi = producers.begin(); pi != producers.end(); ++pi) + { + supportedSFs.clear(); + if (isInterimSurface || isBindableSurface) + { + supportedSFs = (*pi)->supportedOutSurfFormats(); + } + PROPAGATE_ERROR_FAIL((*pi)->supportsSurfaceFormat(sf, supportedSFs)); + } + +fail: + return e; +} + +NvDlaError engine_ast::Edge::verifySurfaceDims() +{ + NvDlaError e = NvDlaSuccess; + surface::TensorSurfaceDesc* tsd = tensorSurfaceDesc(); + Graph::NodeUnorderedSet producers; + Graph::NodeUnorderedSet consumers; + Graph::NodeUnorderedSet clients; + + if ( !isDataEdge() ) + { + goto fail; + } + else if (!tsd) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "TSD not yet registered for edge %s", id().c_str()); + } + + producers = tsd->producers(); + consumers = tsd->consumers(); + clients.insert(producers.begin(), producers.end()); + clients.insert(consumers.begin(), consumers.end()); + + for (Graph::NodeUnorderedSetIterator cli = clients.begin(); cli != clients.end(); ++cli) + { + PROPAGATE_ERROR_FAIL( (*cli)->verifySurfaceDims(tsd) ); + } + +fail: + return e; +} + +NvDlaError engine_ast::Edge::verifySurfaceStrides() +{ + NvDlaError e = NvDlaSuccess; + surface::TensorSurfaceDesc* tsd = tensorSurfaceDesc(); + Graph::NodeUnorderedSet producers; + Graph::NodeUnorderedSet consumers; + Graph::NodeUnorderedSet clients; + + if ( !isDataEdge() ) + { + goto fail; + } + else if (!tsd) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "TSD not yet registered for edge %s", id().c_str()); + } + + /* + * The readers and writers of a tensor could have differing stride alignment + * limitations. DLA supports reading/writing of smaller cubes within a larger cube + * provided the strides and dimensions are programmed correctly. + * Verify that, the strides for the surface should always represent the larger cube. + */ + producers = tsd->producers(); + consumers = tsd->consumers(); + clients.insert(producers.begin(), producers.end()); + clients.insert(consumers.begin(), consumers.end()); + + for (Graph::NodeUnorderedSetIterator cli = clients.begin(); cli != clients.end(); ++cli) + { + ASSERT(tsd->lineStride() >= (*cli)->suggestLineStride(tsd)); + ASSERT(tsd->surfaceStride() >= (*cli)->suggestSurfaceStride(tsd)); + } + +fail: + return e; +} + +NvDlaError engine_ast::Edge::verifySurfaceSize() +{ + NvDlaError e = NvDlaSuccess; + surface::TensorSurfaceDesc* tsd = tensorSurfaceDesc(); + Graph::NodeUnorderedSet producers; + Graph::NodeUnorderedSet consumers; + Graph::NodeUnorderedSet clients; + + if ( !isDataEdge() ) + { + goto fail; + } + else if (!tsd) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "TSD not yet registered for edge %s", id().c_str()); + } + + /* + * The readers and writers of a tensor could have differing stride alignment + * limitations. DLA supports reading/writing of smaller cubes within a larger cube + * provided the strides, size and dimensions are programmed correctly. + * Verify that, the size for the surface should always represent the larger cube. + */ + producers = tsd->producers(); + consumers = tsd->consumers(); + clients.insert(producers.begin(), producers.end()); + clients.insert(consumers.begin(), consumers.end()); + + for (Graph::NodeUnorderedSetIterator cli = clients.begin(); cli != clients.end(); ++cli) + { + ASSERT(tsd->size() >= (*cli)->suggestSurfaceSize(tsd)); + } + +fail: + return e; +} + +NvDlaError engine_ast::Edge::verifySurfaceOffsetInBuffer() +{ + NvDlaError e = NvDlaSuccess; + + surface::TensorSurfaceDesc* tsd = tensorSurfaceDesc(); + Graph::NodeUnorderedSet producers; + Graph::NodeUnorderedSet consumers; + Graph::NodeUnorderedSet clients; + + if ( !isDataEdge() ) + { + goto fail; + } + else if (!tsd) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "TSD not yet registered for edge %s", id().c_str()); + } + + producers = tsd->producers(); + consumers = tsd->consumers(); + clients.insert(producers.begin(), producers.end()); + clients.insert(consumers.begin(), consumers.end()); + + for (Graph::NodeUnorderedSetIterator cli = clients.begin(); cli != clients.end(); ++cli) + { + // all client nodes should report the same surface offset in buffer + ASSERT(tsd->bufferOffset() == (*cli)->suggestSurfaceOffsetInBuffer(tsd)); + } + +fail: + return e; +} + +NvDlaError engine_ast::Edge::verifySurfaceTensorScales() +{ + NvDlaError e = NvDlaSuccess; + Tensor* tensor = originalTensor(); + Dims4 tensorDims; + std::vector tensorScales; + NvF32 perTensorScale; + + if ( !isDataEdge() ) + { + goto fail; + } + else if ( isAuxEdge() ) + { + goto fail; + } + else if (graph()->profile()->computePrecision().v() != surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8) + { + goto fail; + } + else if (!tensor) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Tensor not yet registered for edge %s", id().c_str()); + } + if (graph()->profile()->tensorScalingMode().v() != nvdla::TensorScalingMode::PER_TENSOR) + { + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Don't support any tensor scaling mode other " + " than PER_TENSOR for this network\n"); + } + + tensorDims = tensor->getDimensions(); + tensorScales = tensor->getChannelScales(); + + ASSERT (tensorScales.size() == static_cast(tensorDims.c)); + + perTensorScale = tensorScales.at(0); + for (int cc = 0; cc < tensorDims.c; ++cc) + { + ASSERT (tensorScales.at(cc) != 0); + ASSERT (!std::isnan(tensorScales.at(cc))); + ASSERT (!std::isinf(tensorScales.at(cc))); + ASSERT (tensorScales.at(cc) == perTensorScale); + } + +fail: + return e; +} + +NvDlaError engine_ast::Edge::verifySurface() +{ + NvDlaError e = NvDlaSuccess; + + /* Verify that the producers and consumers of the tsd are + * the same as the physical upstream and downstream nodes + */ + PROPAGATE_ERROR_FAIL( verifySurfaceClients() ); + + /* Verify that the surface format determined for the tsd are + * compatible with all the node(s) operating on it. + */ + PROPAGATE_ERROR_FAIL( verifySurfaceFormat() ); + + /* Verify that none of the node(s) changed the dims of any tsd, + * such that the node(s) on the other end of that tsd couln't + * operate on it anymore + */ + PROPAGATE_ERROR_FAIL( verifySurfaceDims() ); + + /* Verify that the surface strides determined for the tsd are + * compatible with all the node(s) operating on it. + */ + PROPAGATE_ERROR_FAIL( verifySurfaceStrides() ); + + /* Verify that the size determined for the tsd are + * compatible with all the node(s) operating on it. + */ + PROPAGATE_ERROR_FAIL( verifySurfaceSize() ); + + /* Verify that the surface offset determined in the buffer + * for the tsd is compatible with all the node(s) operating on it. + */ + PROPAGATE_ERROR_FAIL( verifySurfaceOffsetInBuffer() ); + + /* Verify that each tensor has channel scales set and + * that they are valid + */ + PROPAGATE_ERROR_FAIL( verifySurfaceTensorScales() ); + +fail: + return e; +} + +/*----------------------I/O Buffer Descriptor Registration------------*/ +NvDlaError engine_ast::Edge::registerBuffer() +{ + NvDlaError e = NvDlaError_Success; + typedef memory::TensorBufferDesc TBD; + + surface::TensorSurfaceDesc *tsd; + Graph::NodeUnorderedSet producers; + Graph::NodeUnorderedSet consumers; + Graph::NodeUnorderedSet clients; + + TBD* currTBD = NULL; + TBD* commonTBD = NULL; + std::map clientBufferMap; + + tsd = tensorSurfaceDesc(); + + if ( !isDataEdge() ) + { + goto fail; + } + else if (!tsd) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "TSD not yet registered for edge %s", id().c_str()); + } + else if ( tsd->tensorCategory().v() == memory::TensorCategoryEnum::UNKNOWN_TENSOR ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Edge %s has 'unknown' tensor category", + tsd->id().c_str()); + } + + producers = tsd->producers(); + consumers = tsd->consumers(); + clients.insert(producers.begin(), producers.end()); + clients.insert(consumers.begin(), consumers.end()); + + commonTBD = tsd->tensorBufferDesc(); + if ( !commonTBD ) + { + Graph::NodeUnorderedSetIterator cli; + + for (cli = clients.begin(); cli != clients.end(); ++cli) + { + if ((*cli)->isSoftwareNode()) + { + commonTBD = (*cli)->suggestBuffer(tsd); + break; + } + } + + // Step-1: If there's a software client, prefer its suggested TBD + // don't bother querying the TBDs from non-software clients + if (commonTBD) + { + tsd->setTensorBufferDesc(commonTBD); + } + // Step-2: If there's no software client, assert that all clients suggested 1 common TBD + else + { + for (cli = clients.begin(); cli != clients.end(); ++cli) + { + currTBD = (*cli)->suggestBuffer(tsd); + if (cli == clients.begin()) + { + commonTBD = currTBD; + tsd->setTensorBufferDesc(commonTBD); + } + else + { + ASSERT(currTBD == commonTBD); + } + } + } + } + + PROPAGATE_ERROR_FAIL( commonTBD->addSurface(tsd) ); + if ( graph()->debugBuffers() ) + { + gLogInfo << commonTBD->id() << " for " << tsd->id() << " for " << id() << " with " << tsd->surfaceFormat().c_str() << endl; + } + +fail: + return e; +} + +NvDlaError engine_ast::Edge::verifyBuffer() +{ + NvDlaError e = NvDlaError_Success; + + surface::TensorSurfaceDesc *tsd; + Graph::NodeUnorderedSet producers; + Graph::NodeUnorderedSet consumers; + Graph::NodeUnorderedSet clients; + + tsd = tensorSurfaceDesc(); + + if ( !isDataEdge() ) + { + goto fail; + } + else if (!tsd) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "TSD not yet registered for edge %s", id().c_str()); + } + else if ( tsd->tensorCategory().v() == memory::TensorCategoryEnum::UNKNOWN_TENSOR ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Edge %s has 'unknown' tensor category", + tsd->id().c_str()); + } + + producers = tsd->producers(); + consumers = tsd->consumers(); + clients.insert(producers.begin(), producers.end()); + clients.insert(consumers.begin(), consumers.end()); + + for (Graph::NodeUnorderedSetIterator cli = clients.begin(); cli != clients.end(); ++cli) + { + // all client nodes should report the same buffer + ASSERT(tsd->tensorBufferDesc() == (*cli)->suggestBuffer(tsd)); + } + +fail: + return e; +} + +/*----------------------I/O Buffer Reservation-------------------------*/ +/* idempotent */ +NvDlaError engine_ast::Edge::reserveBuffer() +{ + NvDlaError e = NvDlaError_Success; + + NvU64 existingSize = 0; + NvU64 proposedSize = 0; + memory::TensorCategory tc; + memory::TensorBufferDesc* tbd; + surface::TensorSurfaceDesc* tsd = tensorSurfaceDesc(); + NvU16 numBatches = graph()->profile()->multiBatchSize(); + + if ( !isDataEdge() ) + { + goto fail; + } + else if (!tsd) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "TSD not yet registered for edge %s", id().c_str()); + } + else if (!tsd->size()) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "surface size == 0 for %s", tsd->id().c_str()); + } + + tbd = tsd->tensorBufferDesc(); + tc = tsd->tensorCategory(); + existingSize = tbd->size(); + proposedSize = tsd->size(); + switch(tc.v()) + { + case memory::TensorCategoryEnum::GLOBAL_TENSOR: + case memory::TensorCategoryEnum::LOCAL_TENSOR: + tbd->setSize( std::max(existingSize, proposedSize) ); + break; + case memory::TensorCategoryEnum::EXTERNAL_TENSOR: + ASSERT( bindable() ); + // adjust buffer size for multiple batches on the bindable tensor + if ( existingSize ) + { + tbd->setSize( std::max(existingSize, proposedSize * numBatches) ); + } + else + { + tbd->setSize(proposedSize * numBatches); + } + break; + case memory::TensorCategoryEnum::STREAM_TENSOR: + tbd->setMemoryLoc(memory::LocationEnum::lSTREAM); + break; + + default: + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Tensor Category:%s not recognized", tc.c_str()); + } + +fail: + return e; +} + +/*----------------------Handle Multi Batch-----------------------------*/ +NvDlaError engine_ast::Edge::handleMultiBatch() +{ + NvDlaError e = NvDlaSuccess; + + surface::TensorSurfaceDesc* mbTSD = tensorSurfaceDesc(); + NvU32 numBatches = graph()->profile()->multiBatchSize(); + + if ( !isDataEdge() ) + { + goto fail; + } + else if (!mbTSD) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "TSD not yet registered for edge %s", id().c_str()); + } + + if ( bindable() ) + { + NvU64 offsetInBindableBuffer = 0; + if ( mbTSD->dimensions().n != (NvS32)numBatches ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Nw edge %s doesn't represent a multi batch bindable tensor", id().c_str()); + } + for (NvU16 nn = 0; nn < numBatches; ++nn) + { + // for a bindable tensor surf desc, different batches scribble at different offsets in the same buffer + mbTSD->setBufferOffset(offsetInBindableBuffer, nn); + offsetInBindableBuffer += mbTSD->size(); + } + } + else + { + memory::Location firstBatchMemLoc = mbTSD->tensorBufferDesc()->memoryLoc(0); + NvU64 offsetInNonBindableBuffer = mbTSD->bufferOffset(/*batchId*/0); + + if ( !isAuxEdge() && mbTSD->dimensions().n != 1 ) + { + // FIXME: allow true NCHW contiguous multibatch for intermediate tensors as well. atleast for FC first + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Contiguous multi-batch non-bindable tensor at %s/%s is not yet supported", id().c_str(), + mbTSD->id().c_str()); + } + for ( NvU16 nn = 0; nn < numBatches; ++nn ) + { + /* For a non-bindable tensor surf desc, different batches scribble at same offset in different buffers + * If a non-bindable tensor shares the buffer with a bindable tensor, then account for the existing offsets + * of each batch in the NCHW bindable tensor. + */ + NvU64 batchOffsetInBindableBuffer = mbTSD->tensorBufferDesc()->boundSurface(0) ? + mbTSD->tensorBufferDesc()->boundSurface(0)->bufferOffset(nn) : 0; + mbTSD->setBufferOffset(batchOffsetInBindableBuffer + offsetInNonBindableBuffer, nn); + mbTSD->tensorBufferDesc()->setMemoryLoc(firstBatchMemLoc, nn); + } + } +fail: + return e; +} + +}; // nvdla::priv:: +}; // nvdla:: diff --git a/umd/core/src/compiler/engine-ast/EngineGraph.cpp b/umd/core/src/compiler/engine-ast/EngineGraph.cpp new file mode 100644 index 00000000..003475b1 --- /dev/null +++ b/umd/core/src/compiler/engine-ast/EngineGraph.cpp @@ -0,0 +1,3065 @@ +/* + * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#include +#include + +#include "priv/EngineAST.h" +#include "priv/Loadable.h" +#include "priv/Profile.h" +#include "priv/TargetConfig.h" +#include "priv/Tensor.h" + +#include "ErrorMacros.h" + +#include "math.h" // ceilf + +using std::endl; +using std::pair; +using std::map; +using std::set; +using std::string; +using std::stringstream; +using std::vector; +using std::list; + +namespace nvdla +{ +namespace priv +{ + +//---------------------------------------------------------------------- +// Constructors +//---------------------------------------------------------------------- +engine_ast::Graph::Graph(Profile *profile, TargetConfig *targetconfig) : + m_scored_ordering(0), + m_ordering(0), + m_next_node_id(0), + m_next_edge_id(0), + m_profile(profile), + m_targetconfig(targetconfig), + m_memoryResolver(0), + m_lutManager() +{ } + + + +// Graph copy constructor for clone +// XXX: this is at best mildly broken and likely worse. +engine_ast::Graph::Graph(const engine_ast::Graph &other_g) : + GraphBase(other_g), + m_next_node_id(other_g.m_next_node_id), + m_next_edge_id(other_g.m_next_edge_id), + m_graph_input_edges(vector()), + m_graph_output_edges(vector()), + m_resource_mgr(other_g.m_resource_mgr), + m_profile(other_g.m_profile), + m_targetconfig(other_g.m_targetconfig), + m_memoryResolver(other_g.m_memoryResolver), + m_lutManager(other_g.m_lutManager) +{ + NvDlaError e = NvDlaSuccess; // for throw macro + THROW_ERROR(NvDlaError_InvalidState); +} + +//---------------------------------------------------------------------- +// Generic Graph Utils +//---------------------------------------------------------------------- + +NvDlaError engine_ast::Graph::initGraphResources() +{ + NvDlaError e = NvDlaSuccess; + vector *memPools = m_resource_mgr.memoryPools(); + // Init all pools + if ( profile()->useMemPool() ) + { + PROPAGATE_ERROR_THROW( (*memPools)[memory::PoolTypeEnum::GLOBAL_DRAM_POOL]. + init(memory::PoolTypeEnum::GLOBAL_DRAM_POOL, + m_profile->globalDRAMPoolSize(), 4 * 1024) ); + + PROPAGATE_ERROR_THROW( (*memPools)[memory::PoolTypeEnum::LOCAL_DRAM_POOL]. + init(memory::PoolTypeEnum::LOCAL_DRAM_POOL, + m_profile->localDRAMPoolSize(), 4 * 1024) ); + + if( profile()->useCVSRAMAllocate() ) + { + PROPAGATE_ERROR_THROW( (*memPools)[memory::PoolTypeEnum::LOCAL_CVSRAM_POOL]. + init(memory::PoolTypeEnum::LOCAL_CVSRAM_POOL, + m_profile->localCVSRAMPoolSize(), 4 * 1024) ); + } + } + m_lutManager = new LutManager(); + + return e; +} + +vector engine_ast::Graph::upstreamDataEdges(engine_ast::Node * node) +{ + EdgeSequence r, d = upstreamEdges(node); + for (EdgeSequenceIterator di = d.begin(); di != d.end(); ++di) + { + if ( (*di)->isDataEdge() ) + { + r.push_back(*di); + } + } + return r; +} + +vector engine_ast::Graph::downstreamDataEdges(engine_ast::Node * node) +{ + EdgeSequence r, d = downstreamEdges(node); + for (EdgeSequenceIterator di = d.begin(); di != d.end(); ++di) + { + if ( (*di)->isDataEdge() ) + { + r.push_back(*di); + } + } + return r; +} + +/** + * We call two data edges to be siblings, if they share same parent/upstream node. + * returns set of edges that are siblings to given edge. + * consider below case, with edges + * e-0: node-0-->node-2 + * e-1: node-1-->node-2 + * e-2: node-1-->node-3 + * + * (node-0) (node-1) + * \ / \ + * e-0 \ / e-1 \ e-2 + * \/ \ + * (node-2) (node-3) + * + * e-1 and e-2 are siblings while e-0 is not sibling to any other edge. + **/ +vector engine_ast::Graph::siblingDataEdges(engine_ast::Edge* edge) +{ + EdgeSequence es; + NodeSequence inputNodes = upstreamNodes(edge); + + for (NodeSequenceIterator ni = inputNodes.begin(); ni != inputNodes.end(); ++ni) + { + EdgeSequence outputEdges = downstreamDataEdges(*ni); + for (EdgeSequenceIterator ei = outputEdges.begin(); ei != outputEdges.end(); ++ei) + { + if ((*ei) != edge) + { + es.push_back(*ei); + } + } + } + + return es; +} + +engine_ast::Edge* engine_ast::Graph::connectingDataEdge(engine_ast::Node* fromNode, engine_ast::Node * toNode, ast::EdgeSide fromDir) +{ + engine_ast::Edge* retEdge = NULL; + EdgeSequence fromNodeEdges; + ast::EdgeSide toDir = ast::EdgeSideEnum::SECOND; + if (fromDir == ast::EdgeSideEnum::FIRST) + { + fromNodeEdges = downstreamDataEdges(fromNode); + toDir = ast::EdgeSideEnum::SECOND; + } + else + { + fromNodeEdges = upstreamDataEdges(fromNode); + toDir = ast::EdgeSideEnum::FIRST; + } + for (EdgeSequenceIterator fi = fromNodeEdges.begin(); fi != fromNodeEdges.end(); ++fi) + { + NodeSequence nodes = edgeNodes(*fi, toDir); + for (NodeSequenceIterator ni = nodes.begin(); ni != nodes.end(); ++ni) + { + if ( (*ni) == toNode ) + { + retEdge = (*fi); + goto done; + } + } + } +done: + return retEdge; +} + +vector engine_ast::Graph::upstreamAuxEdges(engine_ast::Node * node) +{ + EdgeSequence r; + EdgeSequence d = upstreamEdges(node); + for (EdgeSequenceIterator di = d.begin(); di != d.end(); ++di) + { + if ((*di)->isAuxEdge()) + { + r.push_back(*di); + } + } + return r; +} + +engine_ast::Edge* engine_ast::Graph::getUpstreamAuxEdge(engine_ast::Node * node, NvU8 id) +{ + Edge* e = NULL; + EdgeSequence edges = upstreamAuxEdges(node); + if ( id < edges.size() ) + { + e = edges[id]; + } + return e; +} + +vector engine_ast::Graph::downstreamComputeEdges(engine_ast::Node * node) +{ + EdgeSequence r, d = downstreamEdges(node); + for (EdgeSequenceIterator di = d.begin(); di != d.end(); ++di) + { + if ( (*di)->isComputeEdge() ) + { + r.push_back(*di); + } + } + return r; +} + + +vector engine_ast::Graph::downstreamHazardEdges(engine_ast::Node * node) +{ + EdgeSequence r, d = downstreamEdges(node); + for (EdgeSequenceIterator di = d.begin(); di != d.end(); ++di) + { + if ( (*di)->isHazardEdge() ) + { + r.push_back(*di); + } + } + return r; +} + +vector engine_ast::Graph::downstreamDataNodes(engine_ast::Node* node) +{ +/* NodeSequence r, d = downstreamNodes(node); + gLogInfo << "out of " << d.size() << " consumers " << endl; + for(NodeSequenceIterator di = d.begin(); di != d.end(); ++di) + { + if ( connectedDataNodes(node, *di) && std::find(r.begin(), r.end(), *di) == r.end()) + { + gLogInfo << (*di)->name() << " is a consumer of " << node->name() << std::endl; + r.push_back(*di); + } + } + return r; + */ + NodeSequence r; + EdgeSequence d = downstreamDataEdges(node); + for ( EdgeSequenceIterator ei = d.begin(); ei != d.end(); ++ei ) + { + NodeSequence consumerNodes = downstreamNodes(*ei); + for ( NodeSequenceIterator ni = consumerNodes.begin(); ni != consumerNodes.end(); ++ni ) + { + if (std::find(r.begin(), r.end() , *ni) == r.end()) + { + r.push_back(*ni); + } + } + } + return r; +} + +vector engine_ast::Graph::downstreamComputeNodes(engine_ast::Node* node) +{ + NodeSequence r; + EdgeSequence d = downstreamComputeEdges(node); + for ( EdgeSequenceIterator ei = d.begin(); ei != d.end(); ++ei ) + { + NodeSequence consumerNodes = downstreamNodes(*ei); + for ( NodeSequenceIterator ni = consumerNodes.begin(); ni != consumerNodes.end(); ++ni ) + { + if (std::find(r.begin(), r.end() , *ni) == r.end()) + { + r.push_back(*ni); + } + } + } + return r; +} + +vector engine_ast::Graph::downstreamHazardNodes(engine_ast::Node* node) +{ + NodeSequence r; + EdgeSequence d = downstreamHazardEdges(node); + for ( EdgeSequenceIterator ei = d.begin(); ei != d.end(); ++ei ) + { + NodeSequence consumerNodes = downstreamNodes(*ei); + for ( NodeSequenceIterator ni = consumerNodes.begin(); ni != consumerNodes.end(); ++ni ) + { + if (std::find(r.begin(), r.end() , *ni) == r.end()) + { + r.push_back(*ni); + } + } + } + return r; +} + +vector engine_ast::Graph::upstreamDataNodes(engine_ast::Node* node) +{ +/* NodeSequence r, u = upstreamNodes(node); + gLogInfo << "out of " << u.size() << " producers " << endl; + for(NodeSequenceIterator ui = u.begin(); ui != u.end(); ++ui) + { + if ( connectedDataNodes(*ui, node) && std::find(r.begin(), r.end(), *ui) == r.end()) + { + gLogInfo << (*ui)->name() << " is a producer of " << node->name() << std::endl; + r.push_back(*ui); + } + } + return r; + */ + NodeSequence r; + EdgeSequence u = upstreamDataEdges(node); + for ( EdgeSequenceIterator ei = u.begin(); ei != u.end(); ++ei ) + { + NodeSequence producerNodes = upstreamNodes(*ei); + for ( NodeSequenceIterator ni = producerNodes.begin(); ni != producerNodes.end(); ++ni ) + { + if (std::find(r.begin(), r.end() , *ni) == r.end()) + { + r.push_back(*ni); + } + } + } + return r; +} + +vector engine_ast::Graph::upstreamHazardEdges(engine_ast::Node * node) +{ + EdgeSequence r, d = upstreamEdges(node); + for (EdgeSequenceIterator di = d.begin(); di != d.end(); ++di) + { + if ( (*di)->isHazardEdge() ) + { + r.push_back(*di); + } + } + return r; +} + +Tensor* engine_ast::Graph::addAuxTensor(const string &s, const Dims4 dims, TensorType tt) +{ + Tensor* at = NULL; + TensorFactory::TensorPrivPair t = TensorFactory::newTensor(); + if ( !t ) { + goto done; + } + t.i()->setName(s.c_str()); + t.i()->setDimensions(dims); + t.i()->setTensorType(tt); + m_aux_tensors.push_back(t.priv()); + at = t.priv(); +done: + return at; +} + +string engine_ast::Graph::newAuxTensorName() +{ + stringstream ss; + ss << "tensor-aux-" << m_aux_tensors.size(); + return ss.str(); +} + +// tbd: remove the recursion from this. +bool engine_ast::Graph::connectedComputeNodes(engine_ast::Node *upStream, engine_ast::Node* downStream) +{ + return downStream->dependsOn(upStream, viaCompute, allowAll); +} + +bool engine_ast::Graph::connectedDataNodes(engine_ast::Node *upStream, engine_ast::Node* downStream) +{ + return downStream->dependsOn(upStream, viaData, allowAll); +} + +void engine_ast::Graph::replaceEdgeNodes(Edge* edge, ast::EdgeSide dir, Node* oldNode, Node* newNode) +{ + removeEdgeFromNode(edge, dir, oldNode); + removeNodeFromEdge(edge, dir, oldNode); + appendNodeToEdge(edge, dir, newNode); +} + +void engine_ast::Graph::replaceNodeEdges(Node* node, ast::EdgeSide dir, Edge* oldEdge, Edge* newEdge) +{ + removeEdgeFromNode(oldEdge, dir, node); + removeNodeFromEdge(oldEdge, dir, node); + appendNodeToEdge(newEdge, dir, node); +} + +bool engine_ast::Graph::connectNodesWithEdge(Edge* e, Node* fromNode, Node* toNode) +{ + bool ok = true; + insertEdge(e); + + if ( fromNode ) + { + ok &= appendNodeToEdge(e, ast::EdgeSideEnum::FIRST, fromNode); + } + if ( toNode ) + { + ok &= appendNodeToEdge(e, ast::EdgeSideEnum::SECOND, toNode); + } + + return ok; +} + +/* Remove the given node from the AST by detaching and deleting its + * edge(s) in the specified I/O direction, aux edge (if any) and + * reconnecting the edge(s) on the other I/O side to its neighboring + * upstream or downstream node(s) accordingly + */ +NvDlaError engine_ast::Graph::removeNodeFromAST(Node* killNode, IODirection iod) +{ + NvDlaError e = NvDlaSuccess; + + NodeSequence ioSideNodes; + EdgeSequence ioSideEdges; + EdgeSequence oppSideEdges; + Edge* killNodeAuxEdge = NULL; + + if (iod.v() == IODirectionEnum::UNKNOWN) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Can't remove node unless the " + "I/O direction of edges to trim is specified: %s", iod.c_str()); + } + + ioSideNodes = iod.v() == IODirectionEnum::INPUT ? upstreamNodes(killNode) : downstreamNodes(killNode); + ioSideEdges = iod.v() == IODirectionEnum::INPUT ? upstreamEdges(killNode) : downstreamEdges(killNode); + oppSideEdges = iod.v() == IODirectionEnum::INPUT ? downstreamEdges(killNode) : upstreamEdges(killNode); + + killNode->nodeAuxEdge(&killNodeAuxEdge); + + /* Transfer that set of edge(s) of the node_to_be_removed which are going to stay in the graph - + * to the node(s) on the opposite side + */ + for (EdgeSequenceIterator oppsei = oppSideEdges.begin(); oppsei != oppSideEdges.end(); ++oppsei) + { + if ((*oppsei)->isAuxEdge()) + { + continue; + } + + for (NodeSequenceIterator iosni = ioSideNodes.begin(); iosni != ioSideNodes.end(); ++iosni) + { + if (iod.v() == IODirectionEnum::INPUT) + { + replaceEdgeNodes(*oppsei, ast::EdgeSideEnum::FIRST, killNode, *iosni); + } + else + { + replaceEdgeNodes(*oppsei, ast::EdgeSideEnum::SECOND, killNode, *iosni); + } + } + } + + /* Detach and delete the specified I/O side edge(s) from the node_to_be_removed and the + * node(s) on the other side of those edge(s) + */ + for (EdgeSequenceIterator iosei = ioSideEdges.begin(); iosei != ioSideEdges.end(); ++iosei) + { + if ((*iosei)->isAuxEdge()) + { + continue; + } + + for (NodeSequenceIterator iosni = ioSideNodes.begin(); iosni != ioSideNodes.end(); ++iosni) + { + if (iod.v() == IODirectionEnum::INPUT) + { + removeEdgeFromNode(*iosei, ast::EdgeSideEnum::FIRST, *iosni); + removeNodeFromEdge(*iosei, ast::EdgeSideEnum::FIRST, *iosni); + } + else + { + removeEdgeFromNode(*iosei, ast::EdgeSideEnum::SECOND, *iosni); + removeNodeFromEdge(*iosei, ast::EdgeSideEnum::SECOND, *iosni); + } + } + + if (iod.v() == IODirectionEnum::INPUT) + { + removeEdgeFromNode(*iosei, ast::EdgeSideEnum::SECOND, killNode); + removeNodeFromEdge(*iosei, ast::EdgeSideEnum::SECOND, killNode); + } + else + { + removeEdgeFromNode(*iosei, ast::EdgeSideEnum::FIRST, killNode); + removeNodeFromEdge(*iosei, ast::EdgeSideEnum::FIRST, killNode); + } + + resourceMgr()->unregTensorSurfaceDesc((*iosei)->tensorSurfaceDesc()); + resourceMgr()->unregTensorBufferDesc((*iosei)->tensorBufferDesc()); + removeEdge(*iosei); + } + + /* Repopulate the edge ports of the affected node(s) after this edge upheaval */ + for (NodeSequenceIterator iosni = ioSideNodes.begin(); iosni != ioSideNodes.end(); ++iosni) + { + PROPAGATE_ERROR_FAIL((*iosni)->repopulateEdgePorts()); + } + + /* Detach and delete the aux edge (if any) of the node_to_be_removed */ + if (killNodeAuxEdge) + { + removeEdgeFromNode(killNodeAuxEdge, ast::EdgeSideEnum::SECOND, killNode); + removeNodeFromEdge(killNodeAuxEdge, ast::EdgeSideEnum::SECOND, killNode); + resourceMgr()->unregTensorSurfaceDesc(killNodeAuxEdge->tensorSurfaceDesc()); + resourceMgr()->unregTensorBufferDesc(killNodeAuxEdge->tensorBufferDesc()); + removeEdge(killNodeAuxEdge); + delete killNodeAuxEdge; + } + + /* Finally remove the node */ + removeNode(killNode); + delete killNode; + killNode = NULL; + +fail: + return e; +} + +/* Substitute a node in AST with a chain of nodes by delegating all its input + * (except the aux edge since they are non-transferable) and output edge(s) + * to the substitute nodes' chain + */ +NvDlaError engine_ast::Graph::substituteNodeInAST(Node* origNode, NodeSequence subNodes) +{ + NvDlaError e = NvDlaSuccess; + + Node* headSubNode = subNodes.front(); + Node* tailSubNode = subNodes.back(); + NodeSequence origNodeSrcNodes = upstreamNodes(origNode); + EdgeSequence origNodeSrcEdges = upstreamEdges(origNode); + EdgeSequence origNodeSinkEdges = downstreamEdges(origNode); + + /* Delegate all input edge(s) to the substitute node */ + for (EdgeSequenceIterator uei = origNodeSrcEdges.begin(); uei != origNodeSrcEdges.end(); ++uei) + { + if ( (*uei)->isAuxEdge() ) + { + continue; + } + replaceEdgeNodes(*uei, ast::EdgeSideEnum::SECOND, origNode, headSubNode); + } + + /* Delegate all output edge(s) to the substitute node */ + for (EdgeSequenceIterator dei = origNodeSinkEdges.begin(); dei != origNodeSinkEdges.end(); ++dei) + { + replaceEdgeNodes(*dei, ast::EdgeSideEnum::FIRST, origNode, tailSubNode); + } + + /* Repopulate the edge ports of the substitute node after this edge upheaval */ + for (NodeSequenceIterator sni = subNodes.begin(); sni != subNodes.end(); ++sni) + { + PROPAGATE_ERROR_FAIL( (*sni)->repopulateEdgePorts() ); + } + +fail: + return e; +} + +/* Substitute an edge in AST with another by delegating its input + * and output side nodes to the substitute edge + */ +NvDlaError engine_ast::Graph::substituteEdgeInAST(Edge* origEdge, Edge* subEdge) +{ + NvDlaError e = NvDlaSuccess; + + NodeSequence origEdgeSrcNodes = upstreamNodes(origEdge); + NodeSequence origEdgeSinkNodes = downstreamNodes(origEdge); + + /* Delegate all input side nodes to the substitute edge */ + for (NodeSequenceIterator uni = origEdgeSrcNodes.begin(); uni != origEdgeSrcNodes.end(); ++uni) + { + replaceNodeEdges(*uni, ast::EdgeSideEnum::FIRST, origEdge, subEdge); + } + + /* Delegate all output side nodes to the substitute edge */ + for (NodeSequenceIterator dni = origEdgeSinkNodes.begin(); dni != origEdgeSinkNodes.end(); ++dni) + { + replaceNodeEdges(*dni, ast::EdgeSideEnum::SECOND, origEdge, subEdge); + } + + /* Repopulate the edge ports of the all the nodes after this edge upheaval */ + for (NodeSequenceIterator uni = origEdgeSrcNodes.begin(); uni != origEdgeSrcNodes.end(); ++uni) + { + PROPAGATE_ERROR_FAIL((*uni)->repopulateEdgePorts()); + } + for (NodeSequenceIterator dni = origEdgeSinkNodes.begin(); dni != origEdgeSinkNodes.end(); ++dni) + { + PROPAGATE_ERROR_FAIL((*dni)->repopulateEdgePorts()); + } + +fail: + return e; +} + +engine_ast::Edge *engine_ast::Graph::addComputeEdge(Node *fromNode, Node *toNode) +{ + NvDlaError e = NvDlaSuccess; + Edge *edge = new engine_ast::Edge((canonical_ast::Edge*)0); // no canonical + + edge->setGraph(this); + edge->setId(nextEdgeId()); + edge->setComputeEdge(); + edge->setOriginalTensor(0); // no tensor + + if ( !connectNodesWithEdge(edge, fromNode, toNode) ) + { + THROW_ERROR(NvDlaError_BadValue, "failed to insert compute edge %s between %s and %s", + edge->id().c_str(), fromNode->name().c_str(), toNode->name().c_str()); + } + + return edge; +} + +engine_ast::Edge *engine_ast::Graph::addHazardEdge(Node *fromNode, Node *toNode) +{ + NvDlaError e = NvDlaSuccess; + Edge *edge = new engine_ast::Edge((canonical_ast::Edge*)0); // no canonical + + edge->setGraph(this); + edge->setId(nextEdgeId()); + edge->setHazardEdge(); + edge->setOriginalTensor(0); // no tensor + + if ( !connectNodesWithEdge(edge, fromNode, toNode) ) + { + THROW_ERROR(NvDlaError_BadValue, "failed to insert hazard edge %s between %s and %s", + edge->id().c_str(), fromNode->name().c_str(), toNode->name().c_str()); + } + + return edge; +} + +engine_ast::Edge *engine_ast::Graph::addDataEdge(canonical_ast::Edge *canEdge, Node *fromNode, Node *toNode, Tensor *origTensor) +{ + NvDlaError e = NvDlaSuccess; + Edge *edge = new engine_ast::Edge(canEdge); // 0 is ok for canEdge + + edge->setGraph(this); + edge->setId(nextEdgeId()); + edge->setDataEdge(); + if ( origTensor) + { + edge->setOriginalTensor(origTensor); + } + + if ( !connectNodesWithEdge(edge, fromNode, toNode) ) + { + THROW_ERROR(NvDlaError_BadValue, "failed to insert edge %s between %s and %s", + edge->id().c_str(), fromNode->name().c_str(), toNode->name().c_str()); + } + + return edge; +} + +engine_ast::Edge *engine_ast::Graph::addDataEdge(engine_ast::Edge *cloneEdge, Node *fromNode, Node *toNode, Tensor *origTensor) +{ + NvDlaError e = NvDlaSuccess; + Edge *edge; + if ( cloneEdge ) + { + edge = new engine_ast::Edge(*cloneEdge); + } + else + { + edge = new engine_ast::Edge((canonical_ast::Edge*)0); + } + + edge->setGraph(this); + edge->setId(nextEdgeId()); + edge->setDataEdge(); + if ( origTensor ) + { + edge->setOriginalTensor(origTensor); + } + + if ( !connectNodesWithEdge(edge, fromNode, toNode) ) + { + THROW_ERROR(NvDlaError_BadValue, "failed to insert edge %s between %s and %s", + edge->id().c_str(), fromNode->name().c_str(), toNode->name().c_str()); + } + + return edge; +} + + +void engine_ast::Graph::checkDirty() +{ + if ( dirty() ) + { + m_ordering->generate(); + markClean(); + } +} + + +const engine_ast::Graph::NodeSequence &engine_ast::Graph::orderedNodes() { checkDirty(); return m_ordering->nodeOrder(); } +const engine_ast::Graph::EdgeSequence &engine_ast::Graph::orderedEdges() { checkDirty(); return m_ordering->edgeOrder(); } +const engine_ast::Graph::EdgeSequence &engine_ast::Graph::orderedDataEdges() { checkDirty(); return m_ordering->dataEdgeOrder(); } +const engine_ast::Graph::EdgeSequence &engine_ast::Graph::orderedComputeEdges() { checkDirty(); return m_ordering->computeEdgeOrder(); } +const engine_ast::Graph::ElemSequence &engine_ast::Graph::orderedElems() { checkDirty(); return m_ordering->elemOrder(); } + +void engine_ast::DependencyOrdering::clear() +{ + ast::GraphOrdering< engine_ast::Graph >::clear(); + + m_data_edge_order.clear(); + m_compute_edge_order.clear(); + m_hazard_edge_order.clear(); +} + +NvDlaError engine_ast::DependencyOrdering::generate() +{ + NvDlaError e = NvDlaSuccess; + + clear(); + + e = m_sdo->generate(); + + const std::vector::ElemScoresIterator> &elemScoreOrder = m_sdo->elemScoreOrder(); + for ( size_t i = 0; i < elemScoreOrder.size(); ++i ) + { + Elem elem = elemScoreOrder[i]->first; + // ast::ScoredGraphOrdering::Score s = elemScoreOrder[i]->second; + m_elem_order.push_back(elem); + + if ( !elem.first == !elem.second ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_InvalidState, "illegal element"); + } + + if ( elem.first ) + { + m_node_order.push_back(elem.first); + } + else if ( elem.second ) + { + m_edge_order.push_back(elem.second); + if ( elem.second->isDataEdge() ) + { + m_data_edge_order.push_back(elem.second); + } + else if ( elem.second->isComputeEdge() ) + { + m_compute_edge_order.push_back(elem.second); + } + else if ( elem.second->isHazardEdge() ) + { + m_hazard_edge_order.push_back(elem.second); + } + } + } + fail: + return e; +} + + +// returns the i'th surface tensor which *matches* the condition given +surface::TensorSurfaceDesc * +engine_ast::Graph::nodeTensorSurface(const engine_ast::Node *n, size_t i, + const vector &types, + ast::EdgeSideEnum dir) +{ + size_t matched = 0; + surface::TensorSurfaceDesc* matched_tsd = NULL; + vector test_edges = nodeEdges(n, dir); + for ( size_t tei = 0, TEI = test_edges.size(); tei != TEI; ++tei ) + { + if ( !test_edges[tei]->isDataEdge() ) + { + continue; + } + surface::TensorSurfaceDesc * e_tsd = test_edges[tei]->tensorSurfaceDesc(); + surface::SurfaceCategoryEnum sc = e_tsd->surfaceFormat().category().e(); + for ( size_t tt = 0, TT = types.size(); tt != TT; ++tt) + { + if ( sc == types[tt].e() ) + { + if ( matched == i ) + { + matched_tsd = e_tsd; + goto done; + } + matched++; + } + } + } + +done: + return matched_tsd; +} + +surface::TensorSurfaceDesc *engine_ast::Graph::nodeInputTensorSurface(const engine_ast::Node *n, size_t i, const vector &types) +{ + return nodeTensorSurface(n, i, types, ast::EdgeSideEnum::SECOND); +} + +surface::TensorSurfaceDesc *engine_ast::Graph::nodeOutputTensorSurface(const engine_ast::Node *n, size_t i, const vector &types) +{ + return nodeTensorSurface(n, i, types, ast::EdgeSideEnum::FIRST); +} + +surface::SurfaceFormat engine_ast::Graph::suggestNwSurfaceFormat(TensorType nst) +{ + surface::SurfaceFormat sf = surface::SurfaceFormatEnum::NVDLA_UNKNOWN_FORMAT; + if (nst == TensorType::kNW_INPUT) + { + sf = profile()->networkInputSurfaceFormat(); + } + else if (nst == TensorType::kNW_OUTPUT) + { + sf = profile()->networkOutputSurfaceFormat(); + } + else + { + REPORT_ERROR(NvDlaError_BadParameter, "Bad Network surface format:%d", (int)nst); + } + return sf; +} + +void engine_ast::Graph::printGraph(engine_ast::Graph* g, bool nested, std::string graphName) +{ + typedef engine_ast::Graph::EdgeSequence::const_iterator ESI; + gLogInfo << "printGraph: " << graphName << std::endl; + engine_ast::Graph::NodeSequence allNodes = g->orderedNodes(); + for (engine_ast::Graph::NodeSequence::const_iterator ni = allNodes.begin(); ni != allNodes.end(); ++ni) + { + gLogInfo << (nested ? "\t\t" : "\t") << (*ni)->id() << ":" << (*ni)->name() << "/" + << ((*ni)->canonicalNode() ? (*ni)->canonicalNode()->name() : "" ) << ":"; + engine_ast::Graph::EdgeSequence inputEdges = g->nodeEdges(*ni, ast::EdgeSideEnum::SECOND); + engine_ast::Graph::EdgeSequence outputEdges = g->nodeEdges(*ni, ast::EdgeSideEnum::FIRST); + for (ESI ii = inputEdges.begin(); ii != inputEdges.end(); ++ii) + { + if ((*ii)->isAuxEdge()) + gLogInfo << "\t(Aux)"; + else + gLogInfo << "\t(in)"; + gLogInfo << (*ii)->id(); + if ((*ii)->tensorSurfaceDesc()) + { + Dims4 dims = (*ii)->tensorSurfaceDesc()->dimensions(); + gLogInfo << "[" << dims.n << "x" << dims.c << "x" << dims.h << "x" << dims.w << "]"; + gLogInfo << "[" << (*ii)->tensorSurfaceDesc()->id() << "]"; + } + if ((*ii)->originalTensor()) + { + gLogInfo << "[" << "tt-" << (*ii)->originalTensor()->getTensorType() << "],"; + } + gLogInfo << " "; + } + for (ESI ii = outputEdges.begin(); ii != outputEdges.end(); ++ii) + { + gLogInfo << "\t(out)" << (*ii)->id(); + if ((*ii)->tensorSurfaceDesc()) + { + Dims4 dims = (*ii)->tensorSurfaceDesc()->dimensions(); + gLogInfo << "[" << dims.n << "x" << dims.c << "x" << dims.h << "x" << dims.w << "]"; + gLogInfo << "[" << (*ii)->tensorSurfaceDesc()->id() << "]"; + } + if ((*ii)->originalTensor()) + { + gLogInfo << "[" << "tt-" << (*ii)->originalTensor()->getTensorType() << "],"; + } + gLogInfo << " "; + } + gLogInfo << std::endl; + if ((*ni)->engineType() == engine_ast::MULTI_OPS) + { + printGraph(engine_ast::NodeFactory::nodeCast(*ni)->nestedGraph(), true); + } + } +} + +static void printDependencyGraph(engine_ast::Graph* g) +{ + using namespace engine_ast; + for (vector< Graph::Graphlet * >::iterator gli = g->graphlets().begin(); gli != g->graphlets().end(); ++gli) + { + for (Graph::NodeSequenceIterator ni = (*gli)->nodeList().begin(); ni != (*gli)->nodeList().end(); ++ni) + { + for (NvU32 nn = 0; nn < g->profile()->multiBatchSize(); ++nn) + { + gLogInfo << "annid=" << (*ni)->dependencyParams(nn).annotationId() + << " node=" << (*ni)->name() << ".B" << nn + << " deps=" << (*ni)->dependencyParams(nn).getDependencyCount() << endl; + gLogInfo << "\tproducer: ["; + for (size_t ii = 0; ii < EngineType::num_elements(); ++ii) + { + if ( (*ni)->dependencyParams(nn).producer(ii).nodeAnnId() != -1 ) + { + gLogInfo << (*ni)->dependencyParams(nn).producer(ii).node()->name() + << "(annId:" << (*ni)->dependencyParams(nn).producer(ii).nodeAnnId() << ")" + << ":" << (*ni)->dependencyParams(nn).producer(ii).opEvent().c_str() << ", "; + } + else + { + gLogInfo << ", "; + } + } + gLogInfo << "]" << endl << "\tconsumer: ["; + for (size_t ii = 0; ii < EngineType::num_elements(); ++ii) + { + if ( (*ni)->dependencyParams(nn).consumer(ii).nodeAnnId() != -1 ) + { + gLogInfo << (*ni)->dependencyParams(nn).consumer(ii).node()->name() + << "(annId:" << (*ni)->dependencyParams(nn).consumer(ii).nodeAnnId() << ")" + << ":" << (*ni)->dependencyParams(nn).consumer(ii).opEvent().c_str() << ", "; + } + else + { + gLogInfo << ", "; + } + } + gLogInfo << "]" << endl; + } + } + } +} + +/*----------------------Surface Descriptor Registration------------------*/ +NvDlaError engine_ast::Graph::registerAllSurfaces() +{ + NvDlaError e = NvDlaSuccess; + EdgeSequence allEdges = orderedEdges(); + NodeSequence allNodes = orderedNodes(); + + FOR_EACH(allNodes, NodeSequenceIterator, clearNodeTSDStateMapping); + + FOR_EACH(allEdges, EdgeSequenceIterator, registerSurface); + FOR_EACH(allEdges, EdgeSequenceIterator, determineSurfaceClients); + FOR_EACH(allEdges, EdgeSequenceIterator, determineSurfaceFormat); + FOR_EACH(allEdges, EdgeSequenceIterator, determineSurfaceStrides); + FOR_EACH(allEdges, EdgeSequenceIterator, determineSurfaceSize); + FOR_EACH(allEdges, EdgeSequenceIterator, determineSurfaceOffsetInBuffer); + + PROPAGATE_ERROR_FAIL( verifyAllSurfaces() ); + +fail: + return e; +} + +/*----------------------Verify Surface Descriptor Params---------------------*/ +NvDlaError engine_ast::Graph::verifyAllSurfaces() +{ + NvDlaError e = NvDlaSuccess; + EdgeSequence allEdges = orderedEdges(); + NodeSequence allNodes = orderedNodes(); + + FOR_EACH(allNodes, NodeSequenceIterator, clearNodeTSDStateMapping); + + /* + * A shared tensor between 2 nodes can be interpreted differently based on + * the corresponding engine's limitations/requirements. + * Since DLA can read a small cube from a larger cube, verify in this + * API that a tensor honors all requirements of all nodes it is catering to + */ + for (EdgeSequenceIterator ei = allEdges.begin(); ei != allEdges.end(); ++ei) + { + PROPAGATE_ERROR_FAIL((*ei)->verifySurface()); + } + + FOR_EACH(allNodes, NodeSequenceIterator, clearNodeTSDStateMapping); + +fail: + return e; +} + +/*----------------------Buffer Descriptor Registration------------------*/ +NvDlaError engine_ast::Graph::registerAllBuffers() +{ + NvDlaError e = NvDlaSuccess; + EdgeSequence allEdges = orderedEdges(); + + for (EdgeSequenceIterator ei = allEdges.begin(); ei != allEdges.end(); ++ei) + { + PROPAGATE_ERROR_FAIL((*ei)->registerBuffer()); + } + + PROPAGATE_ERROR_FAIL( verifyAllBuffers() ); + +fail: + return e; +} + +/*----------------------Verify Buffer Descriptor Params---------------------*/ +NvDlaError engine_ast::Graph::verifyAllBuffers() +{ + NvDlaError e = NvDlaSuccess; + EdgeSequence allEdges = orderedEdges(); + + for (EdgeSequenceIterator ei = allEdges.begin(); ei != allEdges.end(); ++ei) + { + PROPAGATE_ERROR_FAIL((*ei)->verifyBuffer()); + } + +fail: + return e; +} + +NvDlaError engine_ast::Graph::refreshGraphState() +{ + NvDlaError e = NvDlaSuccess; + NodeSequence allNodes = orderedNodes(); + EdgeSequence allEdges = orderedEdges(); + + FOR_EACH(allNodes, NodeSequenceIterator, repopulateEdgePorts); + FOR_EACH(allNodes, NodeSequenceIterator, clearNodeTSDStateMapping); + + FOR_EACH(allEdges, EdgeSequenceIterator, registerSurface); + FOR_EACH(allEdges, EdgeSequenceIterator, determineSurfaceClients); + FOR_EACH(allEdges, EdgeSequenceIterator, determineSurfaceFormat); + FOR_EACH(allEdges, EdgeSequenceIterator, determineSurfaceStrides); + FOR_EACH(allEdges, EdgeSequenceIterator, determineSurfaceSize); + FOR_EACH(allEdges, EdgeSequenceIterator, determineSurfaceOffsetInBuffer); + FOR_EACH(allEdges, EdgeSequenceIterator, registerBuffer); + FOR_EACH(allEdges, EdgeSequenceIterator, reserveBuffer); + + PROPAGATE_ERROR_FAIL( verifyAllSurfaces() ); + +fail: + return e; +} + +/*----------------------Pre-process Aux Data------------------------------*/ +NvDlaError engine_ast::Graph::preProcessAuxData() +{ + NvDlaError e = NvDlaSuccess; + NodeSequence allNodes = orderedNodes(); + + for (NodeSequence::const_iterator ni = allNodes.begin(); ni != allNodes.end(); ++ni) + { + PROPAGATE_ERROR_FAIL((*ni)->preProcessAuxData()); + } + + // check dirty and re-determine graph order + checkDirty(); + PROPAGATE_ERROR_FAIL(refreshGraphState()); + +fail: + return e; +} + +/*-----------------------Merge Unit Scale Operations-------------------------*/ +/* + * Unit scale operations are introduced for int8 scaling when there is no + * adjacent SDP operation to perform compression to int8 space. But these + * unit scale operations can be merged if another adjacent SDP is available. + * Remove such unit scale operations before start merging other SDP ops. + */ +NvDlaError engine_ast::Graph::mergeUnitScaleOperations() +{ + NvDlaError e = NvDlaSuccess; + NodeSequence allNodes = orderedNodes(); + NodeSequenceIterator ni = allNodes.begin(); + NodeSequenceIterator startNodeIter = ni; + bool maxOptimized = false; + Node* currNode = NULL; + Node* prevNode = NULL; + Node* removeNode = NULL; + + do + { + for (ni = startNodeIter; ni != allNodes.end(); ++ni) + { + if ((*ni)->engineType().v() != EngineTypeEnum::SDP) + { + continue; + } + + NodeSequence sinkNodes = downstreamDataNodes((*ni)); + /* Attempt to combine only those sdp nodes which are 1:1 connected and + * not part of a multi-way junction + */ + if ( sinkNodes.size() != 1 || upstreamDataNodes(sinkNodes[0]).size() != 1 || + sinkNodes[0]->engineType().v() != EngineTypeEnum::SDP ) + { + continue; + } + + currNode = *ni; + prevNode = ni != allNodes.begin() ? *(ni - 1) : *ni; + SDPNode* currSDP = NodeFactory::nodeCast(currNode); + SDPNode* nextSDP = NodeFactory::nodeCast(sinkNodes[0]); + if ( nextSDP->engineOpType().v() != EngineOpTypeEnum::SDP_SCALE ) + { + continue; + } + + if ( !nextSDP->isUnitScale() ) + { + continue; + } + + if ( debugMathOptz() ) + { + gLogInfo << std::endl; + gLogInfo << "Try Merging: " << currNode->name() << " & " << nextSDP->name() << std::endl; + } + + removeNode = currSDP->mergeUnitScaleOp(nextSDP); + + if ( debugMathOptz() ) + { + if (removeNode) + gLogInfo << "Merging: Sucess" << std::endl; + else + gLogInfo << "Merging: Not Feasible" << std::endl; + } + + if ( removeNode ) + { + IODirection iod = IODirectionEnum::INPUT; + + PROPAGATE_ERROR_FAIL( removeNodeFromAST(removeNode, iod) ); + break; + } + } + + // if the last pass through all nodes didn't change the AST anymore, + // that means all optimizations are applied; no more scope left + if ( ni == allNodes.end() ) + { + maxOptimized = true; + } + else + { + // rinse and repeat on newly ordered nodes; + // starting from the node prior to the recently operated one + allNodes = orderedNodes(); + startNodeIter = std::find(allNodes.begin(), allNodes.end(), prevNode); + if (startNodeIter == allNodes.end()) + { + startNodeIter = allNodes.begin(); // just in case + } + PROPAGATE_ERROR_FAIL(refreshGraphState()); + } + } while(!maxOptimized); + + + // check dirty and re-determine graph order + checkDirty(); + PROPAGATE_ERROR_FAIL(refreshGraphState()); + +fail: + return e; +} + +/*-----------------------Merge Activation Operations-------------------------*/ +NvDlaError engine_ast::Graph::mergeActivationOperations() +{ + NvDlaError e = NvDlaSuccess; + NodeSequence allNodes = orderedNodes(); + NodeSequenceIterator ni = allNodes.begin(); + NodeSequenceIterator startNodeIter = ni; + bool maxOptimized = false; + Node* currNode = NULL; + Node* prevNode = NULL; + Node* removeNode = NULL; + + if ( !profile()->canSDPMergeMathOps() && !profile()->canSDPBustNOPs() ) + { + // nothing to do + goto fail; + } + + PROPAGATE_ERROR_FAIL( mergeUnitScaleOperations() ); + + do + { + for (ni = startNodeIter; ni != allNodes.end(); ++ni) + { + /* Currently only mathematical ops executable on CONV/SDP can be combined; + * skip the rest + */ + if ((*ni)->engineType().v() != EngineTypeEnum::SDP && + (*ni)->engineType().v() != EngineTypeEnum::CONVOLUTION) + { + continue; + } + + NodeSequence sinkNodes = downstreamDataNodes((*ni)); + /* Attempt to combine only those sdp nodes which are 1:1 connected and + * not part of a multi-way junction + */ + if ( sinkNodes.size() != 1 || upstreamDataNodes(sinkNodes[0]).size() != 1 || + sinkNodes[0]->engineType().v() != EngineTypeEnum::SDP ) + { + continue; + } + + currNode = *ni; + prevNode = ni != allNodes.begin() ? *(ni - 1) : *ni; + SDPNode* nextSDP = NodeFactory::nodeCast(sinkNodes[0]); + + if ( debugMathOptz() ) + { + gLogInfo << std::endl; + gLogInfo << "Try Merging: " << currNode->name() << " & " << nextSDP->name() << std::endl; + } + + removeNode = currNode->mergeWithSDPOp(nextSDP); + + if ( debugMathOptz() ) + { + if (removeNode) + gLogInfo << "Merging: Sucess" << std::endl; + else + gLogInfo << "Merging: Not Feasible" << std::endl; + } + + if (removeNode) + { + IODirection iod; + NodeSequence gNodes = orderedNodes(); + + /* Before removing, delegate operation mode to the next op iff it exists; + * don't bother if it is already removed from graph + */ + if ((removeNode == currNode) && (std::find(gNodes.begin(), gNodes.end(), nextSDP) != gNodes.end())) + { + SDPNode* removeSDP = NULL; + ASSERT(removeNode->engineType().v() == EngineTypeEnum::SDP); + removeSDP = NodeFactory::nodeCast(removeNode); + nextSDP->params().setConvMode(removeSDP->params().convMode()); + nextSDP->params().setWinogradParams(removeSDP->params().winogradParams()); + nextSDP->params().setNumGroups(removeSDP->params().numGroups()); + } + else if (removeNode == nextSDP) + { + NodeSequence removeSDPSinkNodes = downstreamDataNodes(nextSDP); + NodeWithSameEngineType match_next_sdp(EngineTypeEnum::SDP); + NodeSequenceIterator dni = std::find_if(removeSDPSinkNodes.begin(), + removeSDPSinkNodes.end(), + match_next_sdp); + if (dni != removeSDPSinkNodes.end()) + { + SDPNode* removeSDP = NodeFactory::nodeCast(removeNode); + SDPNode* removeSDPSinkSDP = NodeFactory::nodeCast(*dni); + removeSDPSinkSDP->params().setConvMode(removeSDP->params().convMode()); + removeSDPSinkSDP->params().setWinogradParams(removeSDP->params().winogradParams()); + removeSDPSinkSDP->params().setNumGroups(removeSDP->params().numGroups()); + } + } + + /* + * If collapsing an SDP node into Conv, detach the SDP from its output side + * and retain the stream tensor from Conv + * If collapsing an SDP node into another SDP, detach the collapsing SDP from + * the side that connects to the prevailing SDP + */ + if (currNode->engineType().v() == EngineTypeEnum::CONVOLUTION) + { + iod = IODirectionEnum::OUTPUT; + } + else + { + iod = (removeNode == currNode) ? IODirectionEnum::OUTPUT : IODirectionEnum::INPUT; + } + + PROPAGATE_ERROR_FAIL( removeNodeFromAST(removeNode, iod) ); + break; + } + } + + // if the last pass through all nodes didn't change the AST anymore, + // that means all optimizations are applied; no more scope left + if ( ni == allNodes.end() ) + { + maxOptimized = true; + } + else + { + // rinse and repeat on newly ordered nodes; + // starting from the node prior to the recently operated one + allNodes = orderedNodes(); + startNodeIter = std::find(allNodes.begin(), allNodes.end(), prevNode); + if (startNodeIter == allNodes.end()) + { + startNodeIter = allNodes.begin(); // just in case + } + PROPAGATE_ERROR_FAIL(refreshGraphState()); + } + } while(!maxOptimized); + + // check dirty and re-determine graph order + checkDirty(); + PROPAGATE_ERROR_FAIL(refreshGraphState()); + +fail: + return e; +} + +/*------------------Update scaling factors for EW op--------------------*/ +NvDlaError engine_ast::Graph::updateScalingFactors() +{ + NvDlaError e = NvDlaSuccess; + NodeSequence allNodes = orderedNodes(); + + if (profile()->computePrecision().v() != surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8) + { + // nop + goto fail; + } + + if ( profile()->tensorScalingMode().v() != nvdla::TensorScalingMode::PER_TENSOR ) + { + // don't support any other scaling mode than PER_TENSOR + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Don't support tensor scaling mode: %s\n", + profile()->tensorScalingMode().c_str()); + } + + for (NodeSequence::const_iterator ni = allNodes.begin(); ni != allNodes.end(); ++ni) + { + engine_ast::Node* currNode = *ni; + + EngineOpType eng_op_type = currNode->engineOpType(); + + EdgeSequence inputEdges; + EdgeSequence siblingEdges0; + EdgeSequence siblingEdges1; + + engine_ast::Edge* inputEdge0 = NULL; + engine_ast::Edge* inputEdge1 = NULL; + engine_ast::Edge* updateEdge = NULL; + + std::vector inputTensorScales0; + std::vector inputTensorScales1; + std::vector updateTensorScales; + + if (eng_op_type.v() != EngineOpTypeEnum::SDP_ELEMENTWISE) + { + continue; + } + + inputEdges = upstreamDataEdges(currNode); + + /* element wise op should have exactly two input edges. */ + if (inputEdges.size() != 2) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Elt wise op has input edges (%d) != 2 ", inputEdges.size()); + } + + inputEdge0 = inputEdges.at(0); + inputTensorScales0 = inputEdge0->originalTensor()->getChannelScales(); + + inputEdge1 = inputEdges.at(1); + inputTensorScales1 = inputEdge1->originalTensor()->getChannelScales(); + + ASSERT (inputTensorScales0.size() == inputTensorScales1.size()) + if (inputTensorScales0.at(0) == inputTensorScales1.at(0)) + { + // Incoming scale values are same, no need for update. + continue; + } + + siblingEdges0 = siblingDataEdges(inputEdge0); + siblingEdges1 = siblingDataEdges(inputEdge1); + + /** + * Elementwise fusion has 3 possible cases + * 1. Both input nodes to elementwise layer has single output edges + * 2. One input node has multiple output edges while another has single output edge + * 3. Both input nodes to elementwise layer has multiple output edges + * + * #1, any of the input nodes can be rescaled using scaling factor of another + * node. it requires selecting correct scaling factor to use. + * #2, general policy is to rescale node with single output edge as rescaling + * node with multiple edges will cause incorrect input to another node + * #3, in such case, we need to select scaling factor from two input nodes + * and use new SDP scaling node to rescaling + * + * Current implementation support #1 and #2, but does not support scaling factor + * selection for #1. + */ + + if (siblingEdges0.size() == 0 && siblingEdges1.size() == 0) + { + /* case 1 */ + updateEdge = inputEdge0; + updateTensorScales = inputTensorScales1; + } + else if (siblingEdges0.size() == 0) + { + /** case 2: + * when no src node corresponding to first input edge exists (or) + * when src node corresponding to first input edge exists, having only + * one output edge = first input edge + * In other words, no siblings to first input edge + * Handled in similar way as that of case 1 + **/ + updateEdge = inputEdge0; + updateTensorScales = inputTensorScales1; + } + else if (siblingEdges1.size() == 0) + { + /** case 2: + * when no src node corresponding to second input edge exists (or) + * when src node corresponding to second input edge exists, having only + * one output edge = second input edge + * In other words, no siblings to second input edge + * Handled in similar way as that of case 1 + **/ + updateEdge = inputEdge1; + updateTensorScales = inputTensorScales0; + } + else + { + /* TODO: to handle case 3: when both input nodes have multiple outputs */ + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, + "Both input nodes having multiple output edges is not supported yet!"); + } + updateEdge->originalTensor()->setChannelScales(updateTensorScales); + + } + + // check dirty and re-determine graph order + checkDirty(); + PROPAGATE_ERROR_FAIL(refreshGraphState()); + +fail: + return e; +} + +/*----------------------Pre-process Aux Data------------------------------*/ +NvDlaError engine_ast::Graph::quantizeAuxData() +{ + NvDlaError e = NvDlaSuccess; + NodeSequence allNodes = orderedNodes(); + + for (NodeSequence::const_iterator ni = allNodes.begin(); ni != allNodes.end(); ++ni) + { + PROPAGATE_ERROR_FAIL((*ni)->quantizeAuxData()); + } + + // check dirty and re-determine graph order + checkDirty(); + PROPAGATE_ERROR_FAIL(refreshGraphState()); + +fail: + return e; +} + +/*------------------Low Precision Conversions--------------------------*/ +NvDlaError engine_ast::Graph::handleLowPrecisionConversions() +{ + NvDlaError e = NvDlaSuccess; + NodeSequence allNodes = orderedNodes(); + for (NodeSequence::const_iterator ni = allNodes.begin(); ni != allNodes.end(); ++ni) + { + PROPAGATE_ERROR_FAIL((*ni)->handleLowPrecisionConversions()); + } + + // check dirty and re-determine graph order + checkDirty(); + PROPAGATE_ERROR_FAIL(refreshGraphState()); + +fail: + return e; +} + +/*--------------------------------Fuse Nodes---------------------------*/ +NvDlaError engine_ast::Graph::fuseOnTheFlyNodes() +{ + NvDlaError e = NvDlaSuccess; + NodeSequence allNodes = orderedNodes(); + for (NodeSequence::const_iterator ni = allNodes.begin(); ni != allNodes.end(); ++ni) + { + PROPAGATE_ERROR_FAIL((*ni)->fuseOnTheFlyNodes()); + } + + // check dirty and re-determine graph order + checkDirty(); + PROPAGATE_ERROR_FAIL(refreshGraphState()); + +fail: + return e; +} + +/*----------------------- Fuse SDP operations into SDP subengines -------------------------*/ +NvDlaError engine_ast::Graph::fuseSDPSubEngineOps() +{ + NvDlaError e = NvDlaSuccess; + NodeSequence allNodes = orderedNodes(); + NodeSequenceIterator ni = allNodes.begin(); + NodeSequenceIterator startNodeIter = ni; + bool maxOptimized = false; + Node* currNode = NULL; + Node* prevNode = NULL; + Node* removeNode = NULL; + + if (!profile()->canSDPFuseSubEngineOps()) + { + // nothing to do + goto fail; + } + + if (debugFuseSubEngineOps()) + { + printGraph(this, true, "pree fuseSDPSubEngineOps"); + } + + do + { + for (ni = startNodeIter; ni != allNodes.end(); ++ni) + { + /* Only SDP ops can be fused. */ + if ((*ni)->engineType().v() != EngineTypeEnum::SDP) + { + continue; + } + + NodeSequence sinkNodes = downstreamDataNodes((*ni)); + /* Attempt to combine only those sdp nodes which are 1:1 connected and + * not part of a multi-way junction + */ + if ( sinkNodes.size() != 1 || upstreamDataNodes(sinkNodes[0]).size() > 2 || + sinkNodes[0]->engineType().v() != EngineTypeEnum::SDP ) + { + continue; + } + + currNode = *ni; + prevNode = ni != allNodes.begin() ? *(ni - 1) : *ni; + SDPNode* currSDP = NodeFactory::nodeCast(currNode); + SDPNode* nextSDP = NodeFactory::nodeCast(sinkNodes[0]); + + if ( debugFuseSubEngineOps() ) + { + gLogInfo << std::endl; + gLogInfo << "Try Fusing: " << currNode->name() << " & " << nextSDP->name() << std::endl; + } + + removeNode = currSDP->fuseSDPSubEngineOp(nextSDP); + + if ( debugFuseSubEngineOps() ) + { + if (removeNode) + gLogInfo << "Fusing: Sucess" << std::endl; + else + gLogInfo << "Fusing: Not Feasible" << std::endl; + } + + if (removeNode) + { + IODirection iod; + NodeSequence gNodes = orderedNodes(); + + /* Before removing, delegate operation mode to the next op iff it exists; + * don't bother if it is already removed from graph + */ + if ((removeNode == currNode) && (std::find(gNodes.begin(), gNodes.end(), nextSDP) != gNodes.end())) + { + SDPNode* removeSDP = NULL; + ASSERT(removeNode->engineType().v() == EngineTypeEnum::SDP); + removeSDP = NodeFactory::nodeCast(removeNode); + nextSDP->params().setConvMode(removeSDP->params().convMode()); + nextSDP->params().setWinogradParams(removeSDP->params().winogradParams()); + nextSDP->params().setNumGroups(removeSDP->params().numGroups()); + } + iod = (removeNode == currNode) ? IODirectionEnum::OUTPUT : IODirectionEnum::INPUT; + PROPAGATE_ERROR_FAIL( removeNodeFromAST(removeNode, iod) ); + break; + } + } + + // if the last pass through all nodes didn't change the AST anymore, + // that means all optimizations are applied; no more scope left + if ( ni == allNodes.end() ) + { + maxOptimized = true; + } + else + { + // rinse and repeat on newly ordered nodes; + // starting from the node prior to the recently operated one + allNodes = orderedNodes(); + startNodeIter = std::find(allNodes.begin(), allNodes.end(), prevNode); + if (startNodeIter == allNodes.end()) + { + startNodeIter = allNodes.begin(); // just in case + } + PROPAGATE_ERROR_FAIL(refreshGraphState()); + } + } while(!maxOptimized); + + // check dirty and re-determine graph order + checkDirty(); + PROPAGATE_ERROR_FAIL(refreshGraphState()); + + if (debugFuseSubEngineOps()) + { + printGraph(this, true, "post fuseSDPSubEngineOps"); + } + +fail: + return e; +} + +/*----------------------Weight Translation ----------------------------*/ +NvDlaError engine_ast::Graph::translateAuxData(/*some test point criterion */) +{ + NvDlaError e = NvDlaSuccess; + + NodeSequence allNodes = orderedNodes(); + + for (NodeSequence::const_iterator ni = allNodes.begin(); ni != allNodes.end(); ++ni) + { + engine_ast::Node* curr_node = *ni; + EngineOpType eng_op_type = curr_node->engineOpType(); + switch(eng_op_type.v()) + { + case EngineOpTypeEnum::CONVOLUTION_CONV: + case EngineOpTypeEnum::CONVOLUTION_FC: + case EngineOpTypeEnum::CONVOLUTION_DECONV: + case EngineOpTypeEnum::SDP_BIAS: + case EngineOpTypeEnum::SDP_BATCH_NORM: + case EngineOpTypeEnum::SDP_SCALE: + case EngineOpTypeEnum::SDP_SUPER: + { + PROPAGATE_ERROR_FAIL(curr_node->translateAuxData()); + break; + } + default: break; + } + } + + // check dirty and re-determine graph order + checkDirty(); + +fail: + return e; +} + +/*--------------------------Buffer Reservation-------------------------*/ +NvDlaError engine_ast::Graph::reserveAllBuffers() +{ + NvDlaError e = NvDlaSuccess; + EdgeSequence allEdges = orderedEdges(); + + // update the size requirements of each registered TBD + for (EdgeSequence::const_iterator ei = allEdges.begin(); ei != allEdges.end(); ++ei) + { + PROPAGATE_ERROR_FAIL((*ei)->reserveBuffer()); + } + +fail: + return e; +} + +/*-------------------------Group Atomic Operations---------------------*/ +NvDlaError engine_ast::Graph::groupAtomicOperations() +{ + NvDlaError e = NvDlaSuccess; + NodeSequence allNodes = orderedNodes(); + + for ( NodeSequence::const_iterator ni = allNodes.begin(); ni != allNodes.end(); ) + { + Node* currNode = (*ni); + NodeSequence groupableOpNodes; + do { + groupableOpNodes.push_back(currNode); + currNode = currNode->dependencyParams(/*batchId*/0).fusedNode(IODirectionEnum::OUTPUT); + } while ( currNode ); + + if (groupableOpNodes.size() > 1) + { + MultiOpsNode* multiOpsSuperNode = engine_ast::NodeFactory::newMultiOpsNode(groupableOpNodes, this); + NVDLA_UNUSED(multiOpsSuperNode); + } + ni += groupableOpNodes.size(); + } + + // check dirty and re-determine graph order + checkDirty(); + PROPAGATE_ERROR_FAIL(refreshGraphState()); + +fail: + return e; +} + +/*-------------------------------Split Nodes---------------------------*/ +NvDlaError engine_ast::Graph::splitNodes() +{ + NvDlaError e = NvDlaSuccess; + NodeSequence allNodes = orderedNodes(); + + for (NodeSequence::const_iterator ni = allNodes.begin(); ni != allNodes.end(); ++ni) { + PROPAGATE_ERROR_FAIL((*ni)->splitNodes()); + PROPAGATE_ERROR_FAIL(refreshGraphState()); + } + + // check dirty and re-determine graph order + checkDirty(); + +fail: + return e; +} + +/*----------------------------Handle Multi-Batch-----------------------*/ +NvDlaError engine_ast::Graph::handleMultiBatch() +{ + NvDlaError e = NvDlaSuccess; + NodeSequence allNodes = orderedNodes(); + EdgeSequence inEdges = inputEdges(); + EdgeSequence outEdges = outputEdges(); + EdgeSequence allEdges = orderedEdges(); + for (NodeSequenceIterator ni = allNodes.begin(); ni != allNodes.end(); ++ni) + { + PROPAGATE_ERROR_FAIL((*ni)->handleMultiBatch()); + } + + // first handle multi-batch buffer offsets for bindable tensors + for (EdgeSequenceIterator ei = inEdges.begin(); ei != inEdges.end(); ++ei) + { + PROPAGATE_ERROR_FAIL((*ei)->handleMultiBatch()); + } + for (EdgeSequenceIterator ei = outEdges.begin(); ei != outEdges.end(); ++ei) + { + PROPAGATE_ERROR_FAIL((*ei)->handleMultiBatch()); + } + + // then handle multi-batch buffer offsets for non-bindable tensors + for (EdgeSequenceIterator ei = allEdges.begin(); ei != allEdges.end(); ++ei) + { + PROPAGATE_ERROR_FAIL((*ei)->handleMultiBatch()); + } + + // check dirty and re-determine graph order + checkDirty(); + +fail: + return e; +} + +/*---------------------------------Flatten Graph-----------------------*/ +/* + * Since dependencies calculation needs to see all possible operation nodes in the flat land + * and cannot efficiently deal with hierarchical nodes, flatten all the superNodes that there + * may be by plugging in their nested graph contents into the base graph. + */ +NvDlaError engine_ast::Graph::flattenGraph() +{ + NvDlaError e = NvDlaSuccess; + NodeSequence allNodes = orderedNodes(); + for (NodeSequence::const_iterator ni = allNodes.begin(); ni != allNodes.end(); ++ni) + { + if ( (*ni)->engineType() == EngineTypeEnum::MULTI_OPS) + { + PROPAGATE_ERROR_FAIL(engine_ast::NodeFactory::nodeCast(*ni)->plugNestedGraph()); + } + } + + // check dirty and re-determine graph order + checkDirty(); + PROPAGATE_ERROR_FAIL(refreshGraphState()); + +fail: + return e; +} + +/*---------------------------------Topologically Sort-----------------------*/ +NvDlaError engine_ast::Graph::topologicalSort(NodeSequence& topological_order) +{ + /* + * Compiler needs to come up with a fixed schedule order for firmware to pick up. + * Topological order is needed when there are potential diamond/fork/inception situations. + */ + + /* This function comes up with a DF topological order. + * It pushes nodes that are reachable from the current node onto a stack, + * and goes down on every thread until it reaches a node whose parents are not all visited + * + * E.g. + * (op m) (op m) + * |___________ |___________ + * / \ \ \ + * / \ \ \ + * / \ \ \ + * / \ \ \ + * (op a) (op x) (op p) (op a) (op x) (op p) + * | | | sorted | \\ | \\ | + * | | | ----------------> | \\ | \\ | + * (op b) (op y) (op q) (op b) ==(op y) ==(op q) + * \ / \ + * \ / \ + * \ / \ + * \ / \ + * (op n) (op n) + * + * | + * | or + * \ / + * + * (op m) + * | + * / + * / + * / + * / + * (op a) (op x) (op p) + * | // | // | + * | // | // | + * (op b)== (op y) // (op q) + * / // + * / // + * / // + * / // + * (op n)===== + * + * Some edges are hidden in the above graph to show the final order, but are not removed + */ + NvDlaError e = NvDlaSuccess; + NodeUnorderedSet visitedNodes; + std::stack S; + + // Scan network input edges + const EdgeSequence& inEdges = inputEdges(); + if (inEdges.size() > 0) + { + EdgeSequence::const_iterator ei = inEdges.end(); + do { + --ei; + NodeSequence consumerNodes = downstreamNodes(*ei); + + if (consumerNodes.size() > 0) + { + NodeSequence::const_iterator ni = consumerNodes.end(); + do { + --ni; + // push the node only if its not dependent on any other nodes + const NodeSequence& ancestors = upstreamNodes(*ni); + if (ancestors.size() == 0) + { + S.push(*ni); + } + } + while (ni != consumerNodes.begin()); + } + } + while (ei != inEdges.begin()); + } + + while (!S.empty()) { + Node * currNode = S.top(); + S.pop(); + if (visitedNodes.find(currNode) == visitedNodes.end()) + { + topological_order.push_back(currNode); + visitedNodes.insert(currNode); + + /* Push downstream nodes with compute edges first because data edges take precedence + * In a convolution split diamond, + * (split) + * | + * / \ + * / \ + * / \ + * / \ + * (op C1)====>(op C2) + * | | + * | | + * (op S1)====>(op S2) + * \ / + * \ / + * \ / + * \ / + * (concat) + * We need to make sure fused nodes are stick together, + * S1 needs to be popped off stack before C2 + */ + + // push hazard edge children first, then compute edge children, then data edge children + // so stack popping order will be data > compute > hazard + NodeSequence consumerHazardNodes = downstreamHazardNodes(currNode); + if (consumerHazardNodes.size() > 0) + { + NodeSequenceIterator ni = consumerHazardNodes.end(); + do { + --ni; + // for each downstream node, check if its producer nodes are all visited + // it can't be pushed to the stack until its producers are visited + NodeSequence producerNodes = upstreamNodes(*ni); + + bool ancestorReady = true; + for (NodeSequenceIterator nj = producerNodes.begin(); nj != producerNodes.end(); ++nj) + { + if (visitedNodes.find(*nj) == visitedNodes.end()) + { + ancestorReady = false; + break; + } + } + + if (ancestorReady) + { + S.push(*ni); + } + } + while (ni != consumerHazardNodes.begin()); + } + // same logic for downstream nodes connected via compute edge + NodeSequence consumerComputeNodes = downstreamComputeNodes(currNode); + if (consumerComputeNodes.size() > 0) + { + NodeSequenceIterator ni = consumerComputeNodes.end(); + do { + --ni; + NodeSequence producerNodes = upstreamNodes(*ni); + + bool ancestorReady = true; + for (NodeSequenceIterator nj = producerNodes.begin(); nj != producerNodes.end(); ++nj) + { + if (visitedNodes.find(*nj) == visitedNodes.end()) + { + ancestorReady = false; + break; + } + } + + if (ancestorReady) + { + S.push(*ni); + } + } + while (ni != consumerComputeNodes.begin()); + } + // same logic for downstream nodes connected via data edge + NodeSequence consumerDataNodes = downstreamDataNodes(currNode); + if (consumerDataNodes.size() > 0) + { + NodeSequenceIterator ni = consumerDataNodes.end(); + do { + --ni; + NodeSequence producerNodes = upstreamNodes(*ni); + + bool ancestorReady = true; + for (NodeSequenceIterator nj = producerNodes.begin(); nj != producerNodes.end(); ++nj) + { + if (visitedNodes.find(*nj) == visitedNodes.end()) + { + ancestorReady = false; + break; + } + } + + if (ancestorReady) + { + S.push(*ni); + } + } + while (ni != consumerDataNodes.begin()); + } + } + else + { + // currNode is already visited, there is a cycle + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Can't resolve a non-acyclic graph "); + } + } +fail: + return e; +} + +/*---------------------------Resolve Data Dependencies-----------------*/ +NvDlaError engine_ast::Graph::resolveDataDependencies(const NodeSequence& allNodes) +{ + NvDlaError e = NvDlaSuccess; + + for (NodeSequence::const_iterator ni = allNodes.begin(), nj = ni+1; nj != allNodes.end(); ni = nj++) + { + PROPAGATE_ERROR_FAIL( (*ni)->resolveDataDependencies(*nj) ); + } + +fail: + return e; +} + +/*---------------------------Resolve Compute Dependencies--------------*/ +/* The current version of the firmware needs chaining of operations of the same type so + * that it can schedule them one after the other. Hence connect 2 ops of the same type in the + * causal/ordered list of nodes as a producer-consumer pair + */ +NvDlaError engine_ast::Graph::resolveComputeDependencies(const NodeSequence& allNodes) +{ + NvDlaError e = NvDlaSuccess; + for (NodeSequence::const_iterator ni = allNodes.begin(); ni != allNodes.end(); ++ni) + { + PROPAGATE_ERROR_FAIL((*ni)->resolveComputeDependencies(allNodes)); + } + +fail: + return e; +} + +/*---------------------------Resolve Software Dependencies-------------*/ +NvDlaError engine_ast::Graph::resolveSoftwareDependencies() +{ + NvDlaError e = NvDlaSuccess; + for (NodeSequence::const_iterator ni = orderedNodes().begin(); ni != orderedNodes().end(); ++ni) { + PROPAGATE_ERROR_FAIL((*ni)->resolveSoftwareDependencies()); + } + +fail: + return e; +} + +/*--------------------Regroup Atomic Operations------------------------*/ +NvDlaError engine_ast::Graph::regroupAtomicOperations() +{ + NvDlaError e = NvDlaSuccess; + + Graph::NodeSet allNodes = nodes(); + for ( Graph::NodeSetIterator ni = allNodes.begin(); ni != allNodes.end(); ++ni ) + { + if ((*ni)->engineType() == MULTI_OPS) + { + PROPAGATE_ERROR_FAIL(NodeFactory::nodeCast(*ni)->unplugNestedGraph()); + } + } + + // check dirty and re-determine graph order + checkDirty(); + PROPAGATE_ERROR_FAIL(refreshGraphState()); + +fail: + return e; +} + +/*----------------------Determine Task Boundaries----------------------*/ +NvDlaError engine_ast::Graph::determineTaskBoundaries(const NodeSequence& allNodes) +{ + NvDlaError e = NvDlaSuccess; + bool isEMU = false; + NvS16 taskId; + + Graphlet *graphlet = 0; + + graphlets().clear(); + + // + // figure out how many tasks there are going to be and which nodes are in each (sub)set. + // + // detect EMU<->DLA changes and create a new task for each. + // + + isEMU = (*allNodes.begin())->isEMUEngineType(); + graphlet = new Graphlet(); + graphlets().push_back(graphlet); + taskId = 0; + + for ( NodeSequence::const_iterator ni = allNodes.begin(); ni != allNodes.end(); ++ni ) + { + Node *node = *ni; + + if ( node->isEMUEngineType() != isEMU ) + { + graphlet = new Graphlet(); + // start of next graphlet + graphlets().push_back(graphlet); + taskId++; + } + + node->setTaskId(taskId); + if (!node->isDLAEngineType() && !node->isEMUEngineType()) + { + /* + * Don't bother to add non-DLA and non-CPU ops to any of the graphlets/tasklets + * However a multi-op destination engine(s) is still not determined; so + * keep that around in the graphlet/tasklet + */ + node->dependencyParams(/*batchId*/0).setAnnotationId(-1); + } + else + { + // Add cpu/dla/multi-ops to graphlet + graphlet->nodeList().push_back(node); + } + + isEMU = node->isEMUEngineType(); + + // capture per graphlet, the head_ops for each engine + if ( NULL == graphlet->opHeads()[node->engineType().v()] ) + { + graphlet->opHeads()[node->engineType().v()] = node; + } + } + + return e; +} + +/*----------------------------Annotate Nodes---------------------------*/ +// the order of traversal after this phase must be baked in. +// don't forget that the graph apps can force a new ordering which is the +// start point for the next... so need a way to specify what the new order +// is. +// +// when a phase re-orders things it needs to be able to hand off the new +// ordering and that should result in a new scoreboard (update) based upon +// that ordering. +// +NvDlaError engine_ast::Graph::annotateNodes(NvS16& lastUsedAnnId) +{ + NvDlaError e = NvDlaSuccess; + + bool isEMUGraphlet = false; + + vector< Graphlet* >::iterator gli; + for ( gli = graphlets().begin(); gli != graphlets().end(); ++gli ) + { + isEMUGraphlet = (*gli)->nodeList()[0]->isEMUEngineType(); + NodeSequence& graphletNodes = (*gli)->nodeList(); + for ( NodeSequenceIterator ni = graphletNodes.begin(); ni != graphletNodes.end(); ++ni ) + { + Node *node = *ni; + if (isEMUGraphlet != node->isEMUEngineType()) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "All nodes in a graphlet should be either all CPU or all DLA"); + } + + if (!node->isDLAEngineType() && !node->isEMUEngineType()) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Non-DLA and non-CPU nodes shouldn't be part of any graphlet"); + } + else + { + PROPAGATE_ERROR_FAIL(node->selfAnnotate(lastUsedAnnId)); + } + } + // reset annotation id for next graphlet/task + lastUsedAnnId = -1; + } + + /* Determine annotation node-id's of the producers/consumers for 1st batch(batch_id: 0) + * since from now on operations of all batches should possess unique annotation id's + */ + for ( gli = graphlets().begin(); gli != graphlets().end(); ++gli ) + { + NodeSequence& graphletNodes = (*gli)->nodeList(); + for ( NodeSequenceIterator ni = graphletNodes.begin(); ni != graphletNodes.end(); ++ni ) + { + Node* node = *ni; + for (size_t et = 0; et < EngineType::num_elements(); ++et) + { + NvU32 firstBatchId = 0; + Node* consumer = node->dependencyParams(firstBatchId).consumer(et).node(); + NvS16 consAnnId = node->dependencyParams(firstBatchId).consumer(et).nodeAnnId(); + /* populate iff not done before */ + if (consAnnId == -1) + { + node->dependencyParams(firstBatchId).consumer(et).setNodeAnnId(consumer ? + consumer->dependencyParams(firstBatchId).annotationId() : -1); + } + + Node* producer = node->dependencyParams(firstBatchId).producer(et).node(); + NvS16 prodAnnId = node->dependencyParams(firstBatchId).producer(et).nodeAnnId(); + /* populate iff not done before */ + if (prodAnnId == -1) + { + node->dependencyParams(firstBatchId).producer(et).setNodeAnnId(producer ? + producer->dependencyParams(firstBatchId).annotationId() : -1); + } + } + } + } + +fail: + return e; +} + +/*-------------------------Resolve Multi-Batch Dependencies------------*/ +NvDlaError engine_ast::Graph::resolveMultiBatchDependencies() +{ + NvDlaError e = NvDlaSuccess; + + NodeSequence allNodes = orderedNodes(); + for (NodeSequence::const_iterator ni = allNodes.begin(); ni != allNodes.end(); ++ni) + { + PROPAGATE_ERROR_FAIL((*ni)->resolveMultiBatchDependencies()); + } + + if (debugDepGraph()) + { + printDependencyGraph(this); + } + +fail: + return e; +} + +/*----------------------------Verify Dependency Graph------------------*/ +NvDlaError engine_ast::Graph::verifyDependencyGraph() +{ + NvDlaError e = NvDlaSuccess; + + NodeSequence allNodes = orderedNodes(); + for (NodeSequence::const_iterator ni = allNodes.begin(); ni != allNodes.end(); ++ni) + { + PROPAGATE_ERROR_FAIL((*ni)->verifyDependencyParams()); + } + +fail: + return e; +} + +// entire graph +NvDlaError engine_ast::Graph::resolveMemory(const engine_ast::NodeSequence &topological_order) +{ + NvDlaError e = NvDlaSuccess; + + if ( debugMemoryLayout() ) + { + gLogInfo << "beginning resolveMemory phase" << endl; + } + + if ( !m_memoryResolver ) + { + m_memoryResolver = new memory::MemoryResolver(); + } + PROPAGATE_ERROR_FAIL( m_memoryResolver->visitNodes(topological_order) ); + +fail: + return e; +} + + +/*----------------------------Enable BDMA Copy-Out Debug Buffers-------------*/ +NvDlaError engine_ast::AddCopyOutDebugBDMA::visitBegin(engine_ast::Graph *g) +{ + m_graph = g; + m_debugBindId = 0; + return NvDlaSuccess; +} + +NvDlaError engine_ast::AddCopyOutDebugBDMA::visitNode(engine_ast::Node *treatNode) +{ + NvDlaError e = NvDlaSuccess; + engine_ast::Edge *dbgBDMAOutEdge = 0; + engine_ast::Edge *dbgBDMACompEdge = 0; + engine_ast::Edge *nodeOutEdge = 0; + engine_ast::Node *dbgBDMANode = 0; + EdgeSequence dataOutputs; + Dims4 dbgTensorDims; + NodeSequence consumerNodes; + NvU32 numBatches = treatNode->graph()->profile()->multiBatchSize(); + + if ( treatNode->isEMUEngineType() ) + { + return NvDlaSuccess; + } + + /** + * + * fork the op output into a BDMA op that writes out to memory + * (op-n) + * / | \ + * / | \ + * / | \ + * / | \ + * /(op-n+1)==(d-bdma)----> DRAM + * / || + * (op-n+2)============'' + */ + + dataOutputs = m_graph->downstreamDataEdges(treatNode); + if ( dataOutputs.size() != 1 ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "This shouldn't happen - I am confused!!"); + } + nodeOutEdge = dataOutputs[0]; + + // stream tensors can't be captured + if ( nodeOutEdge->originalTensor()->getTensorType() == TensorType::kSTREAM ) + { + return NvDlaSuccess; + } + + if ( debugCopyOutDebug() ) + { + gLogInfo << "enable debug buffers:\n\tadd dbg dma for orig node=" << treatNode->id() << + " -> node_out_edge=" << nodeOutEdge->id() << endl; + } + + dbgTensorDims = nodeOutEdge->originalTensor()->getDimensions(); + + dbgBDMANode = engine_ast::NodeFactory::newSingleBDMANode(m_graph); + PROPAGATE_ERROR_FAIL(dbgBDMANode->populateEdgePorts()); + + dbgBDMAOutEdge = m_graph->addDataEdge((canonical_ast::Edge*)0, dbgBDMANode, 0, nodeOutEdge->originalTensor()); // dangling + + // reserve bind id for #batches + for (NvU32 nn = 0; nn < numBatches; ++nn) + { + dbgBDMAOutEdge->setBindId(m_debugBindId++, IOD_Debug); + } + // m_graph->addDebugTensor(m_graph->newDebugTensorName(), dbgTensorDims) ); + + dbgBDMACompEdge = m_graph->addComputeEdge(dbgBDMANode, NULL); // dangling here + + if ( debugCopyOutDebug() ) + { + gLogInfo << "\tbdma node=" << dbgBDMANode->id() << " -> bdma comp edge=" << dbgBDMACompEdge->id() << endl; + gLogInfo << "\tbdma node=" << dbgBDMANode->id() << "-> bdma out edge=" << dbgBDMAOutEdge->id() << endl; + } + + // compute bound each consumer of current node to the new bdma node + // so that their operation is stalled until the bdma op is finished + consumerNodes = m_graph->downstreamNodes(nodeOutEdge); + for (NodeSequence::const_iterator cni = consumerNodes.begin(); cni != consumerNodes.end(); ++cni) + { + m_graph->appendNodeToEdge(dbgBDMACompEdge, ast::EdgeSideEnum::SECOND, (*cni)); + if ( debugCopyOutDebug() ) + { + gLogInfo << "\tbdma comp edge=" << dbgBDMACompEdge->id() << " -> consumer node=" << (*cni)->id() << endl; + } + } + + // Finally add the bdma node to current node's output edge after all consumer nodes + // are bound to the bdma node with compute edges + m_graph->appendNodeToEdge(nodeOutEdge, ast::EdgeSideEnum::SECOND, dbgBDMANode); + if ( debugCopyOutDebug() ) + { + gLogInfo << "\tnode out edge=" << nodeOutEdge->id() << " -> bdma node=" << dbgBDMANode->id() << endl; + } + + + fail: + return e; +} + + + + +//---------------------------------------------------------------------- +// Code Emission Utils +//---------------------------------------------------------------------- +NvDlaError engine_ast::Graph::createTensorDescListEntry(surface::TensorSurfaceDesc *sd, ILoadable::TensorDescListEntry &t, NvU32 memAtomSize) +{ + NvDlaError e = NvDlaSuccess; + + surface::SurfaceFormat sf; + + if ( !sd ) { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter); + } + + t.name = sd->name(); + t.size = sd->tensorBufferDesc()->size(); + t.offset = 0; // XXX when appropriate, hook up with tsd+tbd not just tbd info + + sf = sd->surfaceFormat(); + + t.dims.n = sd->dimensions().n; + t.dims.c = sd->dimensions().c; + t.dims.h = sd->dimensions().h; + t.dims.w = sd->dimensions().w; + + t.dataFormat = sd->dataFormat(); + t.pixelMapping = NVDLA_PIXEL_MAPPING_PITCH_LINEAR; + + t.stride[0] = sf.bytesPerElement(); + t.stride[1] = sd->lineStride(); + t.stride[2] = sd->surfaceStride(); + t.stride[3] = sd->planeStride(); + t.stride[4] = 0; + t.stride[5] = 0; + t.stride[6] = 0; + t.stride[7] = 0; + + + switch ( sf.precision().e() ) { + case surface::NVDLA_PRECISION_INT8: + t.dataType = DataType::INT8; + break; + case surface::NVDLA_PRECISION_INT16: + t.dataType = DataType::INT16; + break; + case surface::NVDLA_PRECISION_FP16: + t.dataType = DataType::HALF; + break; + case surface::NVDLA_PRECISION_UINT8: + t.dataType = DataType::UINT8; + break; + case surface::NVDLA_PRECISION_UINT16: + t.dataType = DataType::UINT16; + break; + case surface::NVDLA_PRECISION_UNKNOWN: + default: + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter); + } + + + switch( sf.category().e() ) + { + case surface::IMG: + t.dataCategory = DataCategory::IMAGE; + switch ( sf.e() ) + { + case surface::NVDLA_IMG_R8: t.pixelFormat = PixelFormat::R8; break; + case surface::NVDLA_IMG_R10: t.pixelFormat = PixelFormat::R10; break; + case surface::NVDLA_IMG_R12: t.pixelFormat = PixelFormat::R12; break; + case surface::NVDLA_IMG_R16: t.pixelFormat = PixelFormat::R16; break; + case surface::NVDLA_IMG_R16_I: t.pixelFormat = PixelFormat::R16_I; break; + case surface::NVDLA_IMG_R16_F: t.pixelFormat = PixelFormat::R16_F; break; + case surface::NVDLA_IMG_A16B16G16R16: t.pixelFormat = PixelFormat::A16B16G16R16; break; + case surface::NVDLA_IMG_X16B16G16R16: t.pixelFormat = PixelFormat::X16B16G16R16; break; + case surface::NVDLA_IMG_A16B16G16R16_F: t.pixelFormat = PixelFormat::A16B16G16R16_F; break; + case surface::NVDLA_IMG_A16Y16U16V16: t.pixelFormat = PixelFormat::A16Y16U16V16; break; + case surface::NVDLA_IMG_V16U16Y16A16: t.pixelFormat = PixelFormat::V16U16Y16A16; break; + case surface::NVDLA_IMG_A16Y16U16V16_F: t.pixelFormat = PixelFormat::A16Y16U16V16_F; break; + case surface::NVDLA_IMG_A8B8G8R8: t.pixelFormat = PixelFormat::A8B8G8R8; break; + case surface::NVDLA_IMG_A8R8G8B8: t.pixelFormat = PixelFormat::A8R8G8B8; break; + case surface::NVDLA_IMG_B8G8R8A8: t.pixelFormat = PixelFormat::B8G8R8A8; break; + case surface::NVDLA_IMG_R8G8B8A8: t.pixelFormat = PixelFormat::R8G8B8A8; break; + case surface::NVDLA_IMG_X8B8G8R8: t.pixelFormat = PixelFormat::X8B8G8R8; break; + case surface::NVDLA_IMG_X8R8G8B8: t.pixelFormat = PixelFormat::X8R8G8B8; break; + case surface::NVDLA_IMG_B8G8R8X8: t.pixelFormat = PixelFormat::B8G8R8X8; break; + case surface::NVDLA_IMG_R8G8B8X8: t.pixelFormat = PixelFormat::R8G8B8X8; break; + case surface::NVDLA_IMG_A2B10G10R10: t.pixelFormat = PixelFormat::A2B10G10R10; break; + case surface::NVDLA_IMG_A2R10G10B10: t.pixelFormat = PixelFormat::A2R10G10B10; break; + case surface::NVDLA_IMG_B10G10R10A2: t.pixelFormat = PixelFormat::B10G10R10A2; break; + case surface::NVDLA_IMG_R10G10B10A2: t.pixelFormat = PixelFormat::R10G10B10A2; break; + case surface::NVDLA_IMG_A2Y10U10V10: t.pixelFormat = PixelFormat::A2Y10U10V10; break; + case surface::NVDLA_IMG_V10U10Y10A2: t.pixelFormat = PixelFormat::V10U10Y10A2; break; + case surface::NVDLA_IMG_A8Y8U8V8: t.pixelFormat = PixelFormat::A8Y8U8V8; break; + case surface::NVDLA_IMG_V8U8Y8A8: t.pixelFormat = PixelFormat::V8U8Y8A8; break; + case surface::NVDLA_IMG_Y8___U8V8_N444: t.pixelFormat = PixelFormat::Y8___U8V8_N444; break; + case surface::NVDLA_IMG_Y8___V8U8_N444: t.pixelFormat = PixelFormat::Y8___V8U8_N444; break; + case surface::NVDLA_IMG_Y10___U10V10_N444: t.pixelFormat = PixelFormat::Y10___U10V10_N444; break; + case surface::NVDLA_IMG_Y10___V10U10_N444: t.pixelFormat = PixelFormat::Y10___V10U10_N444; break; + case surface::NVDLA_IMG_Y12___U12V12_N444: t.pixelFormat = PixelFormat::Y12___U12V12_N444; break; + case surface::NVDLA_IMG_Y12___V12U12_N444: t.pixelFormat = PixelFormat::Y12___V12U12_N444; break; + case surface::NVDLA_IMG_Y16___U16V16_N444: t.pixelFormat = PixelFormat::Y16___U16V16_N444; break; + case surface::NVDLA_IMG_Y16___V16U16_N444: t.pixelFormat = PixelFormat::Y16___V16U16_N444; break; + + default: + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter); + } + break; + + case surface::WEIGHT: + t.dataCategory = DataCategory::WEIGHT; + switch ( sf.e() ) + { +#if 0 + case surface::NVDLA_WEIGHT_DC_INT8: t.weight_format = WeightFormat::DC_INT8; break; + case surface::NVDLA_WEIGHT_DC_INT8_COMPRESSED: t.weight_format = WeightFormat::DC_INT8_COMPRESSED; break; + case surface::NVDLA_WEIGHT_WG_INT8: t.weight_format = WeightFormat::WG_INT8; break; + case surface::NVDLA_WEIGHT_WG_INT8_COMPRESSED: t.weight_format = WeightFormat::WG_INT8_COMPRESSED; break; + case surface::NVDLA_WEIGHT_CE_INT8: t.weight_format = WeightFormat::CE_INT8; break; + case surface::NVDLA_WEIGHT_CE_INT8_COMPRESSED: t.weight_format = WeightFormat::CE_INT8_COMPRESSED; break; + case surface::NVDLA_WEIGHT_DECONV_INT8: t.weight_format = WeightFormat::DECONV_INT8; break; + case surface::NVDLA_WEIGHT_DECONV_INT8_COMPRESSED: t.weight_format = WeightFormat::DECONV_INT8_COMPRESSED; break; + case surface::NVDLA_WEIGHT_DC_INT16: t.weight_format = WeightFormat::DC_INT16; break; + case surface::NVDLA_WEIGHT_DC_INT16_COMPRESSED: t.weight_format = WeightFormat::DC_INT16_COMPRESSED; break; + case surface::NVDLA_WEIGHT_WG_INT16: t.weight_format = WeightFormat::WG_INT16; break; + case surface::NVDLA_WEIGHT_WG_INT16_COMPRESSED: t.weight_format = WeightFormat::WG_INT16_COMPRESSED; break; + case surface::NVDLA_WEIGHT_CE_INT16: t.weight_format = WeightFormat::CE_INT16; break; + case surface::NVDLA_WEIGHT_CE_INT16_COMPRESSED: t.weight_format = WeightFormat::CE_INT16_COMPRESSED; break; + case surface::NVDLA_WEIGHT_DECONV_INT16: t.weight_format = WeightFormat::DECONV_INT16; break; + case surface::NVDLA_WEIGHT_DECONV_INT16_COMPRESSED: t.weight_format = WeightFormat::DECONV_INT16_COMPRESSED; break; + case surface::NVDLA_WEIGHT_DC_FP16: t.weight_format = WeightFormat::DC_FP16; break; + case surface::NVDLA_WEIGHT_DC_FP16_COMPRESSED: t.weight_format = WeightFormat::DC_FP16_COMPRESSED; break; + case surface::NVDLA_WEIGHT_WG_FP16: t.weight_format = WeightFormat::WG_FP16; break; + case surface::NVDLA_WEIGHT_WG_FP16_COMPRESSED: t.weight_format = WeightFormat::WG_FP16_COMPRESSED; break; + case surface::NVDLA_WEIGHT_CE_FP16: t.weight_format = WeightFormat::CE_FP16; break; + case surface::NVDLA_WEIGHT_CE_FP16_COMPRESSED: t.weight_format = WeightFormat::CE_FP16_COMPRESSED; break; + case surface::NVDLA_WEIGHT_DECONV_FP16: t.weight_format = WeightFormat::DECONV_FP16; break; + case surface::NVDLA_WEIGHT_DECONV_FP16_COMPRESSED: t.weight_format = WeightFormat::DECONV_FP16_COMPRESSED; break; +#endif + default: + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter); + } + break; + + case surface::FEATURE_DATA: + t.dataCategory = DataCategory::FEATURE; + t.pixelFormat = PixelFormat::FEATURE; + if (memAtomSize == 8) + t.pixelFormat = PixelFormat::FEATURE_X8; + t.dataFormat = NVDLA_DATA_FORMAT_NCxHWx; + break; + + case surface::M_PLANAR: + t.dataCategory = DataCategory::PLANAR; + switch ( sf.e() ) + { +#if 0 + case surface::NVDLA_M_PLANAR_INT8: t.planar_format = PlanarFormat::INT8; break; + case surface::NVDLA_M_PLANAR_INT16: t.planar_format = PlanarFormat::INT16; break; + case surface::NVDLA_M_PLANAR_FP16: t.planar_format = PlanarFormat::FP16; break; +#endif + default: + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter); + } + + break; + case surface::BIAS_DATA: + t.dataCategory = DataCategory::BIAS; + switch ( sf.e() ) + { +#if 0 + case surface::NVDLA_BIAS_DATA_INT8: t.bias_format = BiasFormat::INT8; break; + case surface::NVDLA_BIAS_DATA_INT16: t.bias_format = BiasFormat::INT16; break; + case surface::NVDLA_BIAS_DATA_FP16: t.bias_format = BiasFormat::FP16; break; +#endif + default: + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter); + } + break; + default: + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter); + } + + + if ( debugSurfaces() ) + { + gLogInfo << "create tensor desc precision=" << (int)sf.precision().v() << + " category=" << (int)sf.category().v() << + " sf=" << (int)sf.v() << endl; + + gLogInfo << "\tname : " << t.name << endl; + gLogInfo << "\tn,c,h,w : " << t.dims.n << "," << t.dims.c << "," << t.dims.h << "," << t.dims.w << endl; + gLogInfo << "\tdata format : " << int(t.dataFormat) << endl; + gLogInfo << "\tdata type : " << int(t.dataType) << endl; + gLogInfo << "\tdata category: " << int(t.dataCategory) << endl; + gLogInfo << "\tpixel format : " << int(t.pixelFormat) << endl; + gLogInfo << "\tpixel mapping: " << int(t.pixelMapping) << endl; + + gLogInfo << "\tstrides : " << + t.stride[0] << " " << t.stride[1] << " " << t.stride[2] << " " << t.stride[3] << + t.stride[4] << " " << t.stride[5] << " " << t.stride[6] << " " << t.stride[7] << + endl; + } + + + fail: + return e; +} + + +static NvDlaError addMemEntriesForPools +( + engine_ast::Graph* g, + vector< Loadable::MemoryListEntry >& graphMemObjects, + NvS16& memId, + vector< Loadable::AddressListEntry>& graphAddrObjects, + NvS16& addrId +) +{ + NvDlaError e = NvDlaSuccess; + vector< memory::Pool > *memPools = g->resourceMgr()->memoryPools(); + + for ( size_t pid = 0; pid < memPools->size(); ++pid ) + { + memory::Pool &pool = (*memPools)[pid]; + + memory::LocationEnum location = pool.location().e(); + memory::PoolTypeEnum poolType = pool.type().e(); + NvU8 domain; + NVDLA_UNUSED(poolType); + + // we only care about actual memory + switch (location) + { + case memory::LocationEnum::lCVSRAM: + domain = ILoadable::MemoryDomain_SRAM; + break; + + case memory::LocationEnum::lDRAM: + domain = ILoadable::MemoryDomain_SYSMEM; + break; + + default: + continue; + } + + // don't bother if it is empty. + if ( !pool.sizeUsed() ) + { + continue; + } + + pool.setMemoryId(memId++); + pool.setAddressId(addrId++); + + Loadable::MemoryListEntry memEntry; + + memEntry.id = pool.memoryId(); + memEntry.size = NvU64(4096) * ((pool.sizeUsed() + NvU64(4095))/NvU64(4096)); + memEntry.alignment = 4096; // page size + memEntry.domain = domain; + memEntry.flags = Loadable::MemoryListEntry::flags_alloc(); + + + if ( pool.contents().begin() != pool.contents().end() ) + { + set::iterator ci; + memEntry.flags |= Loadable::MemoryListEntry::flags_set(); + + for (ci = pool.contents().begin(); ci != pool.contents().end(); ++ci ) + { + // tbd: sort these for repeatability + memory::TensorBufferDesc *tbd = (*ci)->tensorBufferDesc(); + if ( !tbd ) + { + THROW_ERROR(NvDlaError_InvalidState); + } + memEntry.contents.push_back(tbd->id()); + memEntry.offsets.push_back((*ci)->bufferOffset() + tbd->poolOffset()); + } + } + + if ( g->debugMemoryLayout() ) + { + gLogInfo << "(Pool) Memory list entry=" << memEntry.id << " size=" << memEntry.size << + " used=" << pool.sizeUsed() << " domain=" << (int)memEntry.domain << " flags=" << (int)memEntry.flags << endl; + for ( size_t ci=0; ci < memEntry.contents.size(); ++ci ) + { + gLogInfo << "\tcontent: " << memEntry.contents[ci] << " @ " << memEntry.offsets[ci] << endl; + } + gLogInfo << endl; + } + + graphMemObjects.push_back(memEntry); + { + Loadable::AddressListEntry addrEntry; + addrEntry.id = pool.addressId(); + addrEntry.mem_id = memEntry.id; + addrEntry.offset = 0; + addrEntry.size = memEntry.size; + graphAddrObjects.push_back(addrEntry); + } + } + + return e; +} + +static NvDlaError addMemEntriesForBuffers +( + engine_ast::Graph* g, + vector< Loadable::MemoryListEntry >& graphMemObjects, + vector< Loadable::TensorDescListEntry >& tensorDescEntries, + NvS16& memId +) +{ + NvDlaError e = NvDlaSuccess; + + NvU32 numBatches = g->profile()->multiBatchSize(); + NvU32 memAtomSize = g->target_config()->memoryAtomicSize(); + vector< memory::TensorBufferDesc *> allBuffers = g->resourceMgr()->getBufferDescs(); + + for ( vector< memory::TensorBufferDesc *>::iterator it = allBuffers.begin(); it != allBuffers.end(); ++it ) + { + + NvU8 domain; + memory::TensorBufferDesc *tbd = *it; + bool isAUX = tbd->content(); + bool isBindable = tbd->bindable(); + + if ( !tbd ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_InvalidState); + } + + // pooled buffers don't need individual memory entries. + // their containing pools are allocated and pinned once during runtime and that's it + if ( tbd->pool() ) + { + if ( tbd->bindable() ) + { + string delim(""); + gLogInfo << tbd->id() << " is pooled in " << tbd->pool()->name() << " but bindable? surfaces=["; + for ( set::iterator si = tbd->surfaces().begin(); + si != tbd->surfaces().end(); ++si ) + { + gLogInfo << delim << (*si)->id(); + delim = ", "; + } + gLogInfo << "]" << endl; + ORIGINATE_ERROR_FAIL(NvDlaError_InvalidState, "found bindable yet pooled buffer=%s", tbd->id().c_str()); + + } + continue; + } + + // prepare memory list entries for the buffer descs of all batches + for ( NvU32 nn = 0; nn < numBatches; ++nn ) + { + // we only care about actual memory... + switch ( tbd->memoryLoc(/*batchId*/nn).e() ) + { + case memory::LocationEnum::lCVSRAM: + domain = ILoadable::MemoryDomain_SRAM; + break; + case memory::LocationEnum::lDRAM: + domain = ILoadable::MemoryDomain_SYSMEM; + break; + case memory::LocationEnum::lSTREAM: + continue; + case memory::LocationEnum::lUNKNOWN: + if ( tbd->bindable() ) + { + // bindable memory isn't actually determined yet. + // but call it sysmem for now? + domain = ILoadable::MemoryDomain_SYSMEM; + } + else + { + ORIGINATE_ERROR_FAIL(NvDlaError_InvalidState, "discovered non-bindable %s at unknown mem domain", tbd->id().c_str()); + } + break; + default: + continue; /// !!! + } + + if ( tbd->size() == 0 ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "zero sized buffer %s", tbd->id().c_str()); + } + + // aux buffer is shared by all batches, so allow only 1 memEntry + if (isAUX && nn > 0) + { + tbd->setMemoryId(tbd->memoryId(/*batchId*/0), /*batchId*/nn); + continue; + } + + // bindable buffer is a multi-batch NCHW buffer, so allow only 1 memEntry + if (isBindable && nn > 0) + { + tbd->setMemoryId(tbd->memoryId(/*batchId*/0), /*batchId*/nn); + continue; + } + + Loadable::MemoryListEntry memEntry; + // non pooled, need to create a new memory id to match + tbd->setMemoryId(memId++, nn); + tbd->setPoolOffset(0, nn); // pool() is 0. but just in case. + + memEntry.id = tbd->memoryId(nn); + memEntry.size = tbd->size(); + memEntry.alignment = 4096; // overkill?, page size + memEntry.domain = domain; + memEntry.flags = Loadable::MemoryListEntry::flags_alloc(); + + if ( tbd->content() ) + { + memEntry.flags |= Loadable::MemoryListEntry::flags_set(); + memEntry.contents.push_back(tbd->id()); + memEntry.offsets.push_back(0); + } + + + if ( tbd->bindable() ) // note: bindable are always non-pooled! + { + ILoadable::TensorDescListEntry newTensorDesc; + NvS16 bindId; + enum IOD bindDomain; + + // this is where loadable-visible tensor desc ids get allocated. + memEntry.tensor_desc_id = tensorDescEntries.size(); + newTensorDesc.id = memEntry.tensor_desc_id; + + g->createTensorDescListEntry(tbd->boundSurface(0), newTensorDesc, memAtomSize); + newTensorDesc.memId = tbd->memoryId(/*batchId*/nn); + tensorDescEntries.push_back(newTensorDesc); + + bindId = tbd->bindId(bindDomain); + memEntry.bind_id = bindId; + switch ( bindDomain ) + { + case IOD_Input: + memEntry.flags |= Loadable::MemoryListEntry::flags_input(); + break; + case IOD_Output: + memEntry.flags |= Loadable::MemoryListEntry::flags_output(); + break; + case IOD_Debug: + memEntry.flags |= Loadable::MemoryListEntry::flags_debug(); + break; + default: + ORIGINATE_ERROR_FAIL(NvDlaError_InvalidState, "n/a bindable mem list entry %d", + memEntry.id); + } + if ( g->debugMemoryLayout() ) + { + gLogInfo << "(Bindable)"; + } + } + + + if ( g->debugMemoryLayout() ) + { + gLogInfo << "(Buffer) Memory list entry for tbd=" << tbd->id() << ":" << nn + << " : " << nn + << " size=" << memEntry.size + << " domain=" << (int)memEntry.domain + << " flags=" << (int)memEntry.flags; + for ( size_t ci=0; ci < memEntry.contents.size(); ++ci ) + { + gLogInfo << "\tcontent: " << memEntry.contents[ci] << " @ " << memEntry.offsets[ci] << endl; + } + gLogInfo << endl; + } + + graphMemObjects.push_back(memEntry); + } + } + +fail: + return e; +} + +static NvDlaError addAddrEntriesForSurfaces +( + Loadable* l, + engine_ast::Graph* g, + vector< Loadable::AddressListEntry >& graphAddrObjects, + NvS16& addrId +) +{ + NvDlaError e = NvDlaSuccess; + NvU32 numBatches = g->profile()->multiBatchSize(); + vector< surface::TensorSurfaceDesc *> allSurfaces = g->resourceMgr()->getSurfaceDescs(); + + for (vector< surface::TensorSurfaceDesc *>::iterator tsdi = allSurfaces.begin(); tsdi != allSurfaces.end(); ++tsdi) + { + + surface::TensorSurfaceDesc *tsd = *tsdi; + memory::TensorBufferDesc *tbd = tsd->tensorBufferDesc(); + bool isAUX = tsd->content(); + + if ( !tbd ) + { + gLogWarning << "no buffer for surface=" << tbd->id() << endl; + continue; + } + + if ( tbd->size() == 0 ) { + continue; + } + + // prepare address list entries for the surface descs of all batches + for (NvU32 nn = 0; nn < numBatches; ++nn) + { + // aux surface is shared by all batches, so allow only 1 addrEntry + if (isAUX && nn > 0) + { + tsd->setAddressId (tsd->addressId(0), nn); + tsd->setAddressIdOffset(tsd->addressIdOffset(0), nn); + continue; + } + + if ( !tbd->pool(nn) ) + { + Loadable::AddressListEntry addrEntry; + tsd->setAddressId (addrId++, nn); + tsd->setAddressIdOffset(0, nn); + + addrEntry.id = tsd->addressId(nn); + addrEntry.mem_id = tbd->memoryId(nn); + addrEntry.offset = tbd->poolOffset(/*batchId*/nn) + tsd->bufferOffset(/*batchId*/nn); + addrEntry.size = tbd->size(); + graphAddrObjects.push_back(addrEntry); + } + else + { + if ( tbd->pool(nn)->addressId() <= 0 ) + { + THROW_ERROR(NvDlaError_InvalidState); + } + tsd->setAddressId(tbd->pool(nn)->addressId(), nn); + tsd->setAddressIdOffset(tbd->poolOffset(nn) + tsd->bufferOffset(nn), nn); + } + + if ( tsd->content() ) + { + + ILoadable::Blob memEntryBlob; + + // within the loadable the content is associated with the buffer, not the surface. + memEntryBlob.name = tbd->id(); + memEntryBlob.size = tsd->size(); + memEntryBlob.interface = ILoadable::Interface_NONE; + memEntryBlob.version = ILoadable::Version(0, 0, 0); + + l->setSymbolContent(tbd->id(), memEntryBlob, tsd->address(nn)); + } + + if ( g->debugMemoryLayout() ) + { + gLogInfo << "(Surface) Address list entry for tsd=" << tsd->id() << "/" << tbd->id() << ":" << nn + << " -> " << tsd->addressId() + << " offset=" << tsd->addressIdOffset() + << " size=" << tbd->size() << endl; + } + + + + } + } + + return e; +} + +// +// prepares address and memory list entries +// +NvDlaError engine_ast::Graph::prepareMemoryListEntries(Loadable *l) +{ + NvDlaError e = NvDlaSuccess; + + NvS16 memId = 0; + NvS16 addrId = 0; + + vector< Loadable::MemoryListEntry > graphMemObjects; + vector< Loadable::AddressListEntry > graphAddrObjects; + vector< Loadable::TensorDescListEntry > tensorDescEntries; + + // + // now we start + // + memId = 1; + addrId = 1; + + // + // each memory pool gets an id. pools need to come before buffers + // because buffers can and will use the pools' memory ids as needed. + // + PROPAGATE_ERROR_FAIL(addMemEntriesForPools(this, graphMemObjects, memId, graphAddrObjects, addrId)); + + // + // create memory id entries for non-pooled buffers + // + PROPAGATE_ERROR_FAIL(addMemEntriesForBuffers(this, graphMemObjects, tensorDescEntries, memId)); + + // + // surfaces generate address id entries + // + PROPAGATE_ERROR_FAIL(addAddrEntriesForSurfaces(l, this, graphAddrObjects, addrId)); + + l->setMemoryListEntries(graphMemObjects); + l->setAddressListEntries(graphAddrObjects); + l->setTensorDescListEntries(tensorDescEntries); + +fail: + return e; +} + +void engine_ast::Graph::resetRelocEntries() +{ + m_relocEntries.clear(); +} + +void engine_ast::Graph::insertRelocEntry(ILoadable::RelocEntry re) +{ + m_relocEntries.push_back(re); +} + +NvDlaError engine_ast::Graph::gatherRelocEntries(NvS16 ops, NvU8 *ops_base, + NvS16 surfs, NvU8 *surfs_base, + NvS16 deps, NvU8 *deps_base) +{ + NvDlaError e = NvDlaSuccess; + + uintptr_t originalOffset; + uintptr_t useBase; + + vector::iterator ri; + + for ( ri = m_relocEntries.begin(); ri != m_relocEntries.end(); ++ri ) + { + if ( ri->writeId ) + { + continue; + } + + if ( ! ( (ri->interface == NVDLA_LOADABLE_INTERFACE_DLA1) || + (ri->interface == NVDLA_LOADABLE_INTERFACE_EMU1)) ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_InvalidState, "bogus interface"); + continue; /*NOT REACHED*/ + } + + originalOffset = ri->offset; + + if ( ri->subInterface == NVDLA_LOADABLE_SUB_INTERFACE_DLA1_OPS || + ri->subInterface == NVDLA_LOADABLE_SUB_INTERFACE_EMU1_OPS) + { + ri->writeId = ops; + useBase = uintptr_t(ops_base); + ri->offset = ri->offset - useBase; + } + else if ( ri->subInterface == NVDLA_LOADABLE_SUB_INTERFACE_DLA1_SURFS || + ri->subInterface == NVDLA_LOADABLE_SUB_INTERFACE_EMU1_SURFS ) + { + ri->writeId = surfs; + useBase = uintptr_t(surfs_base); + ri->offset = ri->offset - useBase; + } + else if ( ri->subInterface == NVDLA_LOADABLE_SUB_INTERFACE_DLA1_DEPS ) + { + ri->writeId = deps; + useBase = uintptr_t(deps_base); + ri->offset = ri->offset - useBase; + } + else + { + ORIGINATE_ERROR_FAIL(NvDlaError_InvalidState, "bogus sub interface"); + } + + if ( debugRelocs() ) { + gLogInfo << "gathered reloc entry: address id=" << ri->addressListId << + " writeId=" << ri->writeId << + " useBase=" << std::hex << useBase << + " originalOffset=" << std::hex << originalOffset << + " offset=" << std::hex << ri->offset << std::dec << + " interface=" << (int)ri->interface << + " subInterface=" << (int)ri->subInterface << + " relocType=" << (int)ri->relocType << endl; + } + } + + fail: + return e; +} + + +} // nvdla::priv +} // nvdla diff --git a/umd/core/src/compiler/engine-ast/EngineNode.cpp b/umd/core/src/compiler/engine-ast/EngineNode.cpp new file mode 100644 index 00000000..437b0ca1 --- /dev/null +++ b/umd/core/src/compiler/engine-ast/EngineNode.cpp @@ -0,0 +1,1437 @@ +/* + * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#include + +#include "half.h" +#include "priv/EngineAST.h" +#include "priv/Profile.h" +#include "priv/Tensor.h" + +#include "ErrorMacros.h" + +using half_float::half; +using std::set; +using std::map; +using std::vector; +using std::endl; +using std::list; +using std::pair; +using std::make_pair; +using std::find; +using std::string; + +namespace nvdla +{ +namespace priv +{ + +//---------------------------------------------------------------------- +// Generic Node Utils +//---------------------------------------------------------------------- +// idempotent +NvDlaError engine_ast::Node::populateEdgePorts() +{ + NvDlaError e = NvDlaSuccess; + + EdgeSequence inputEdges = graph()->upstreamDataEdges(this); + EdgeSequence outputEdges = graph()->downstreamDataEdges(this); + + /** + * should be min 1 upstream edge; + * if only 1 upstream edge, it should be the data input + * if >1 upstream edges, find input and/or aux edges + */ + if (inputEdges.size() == 0) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "%s has 0 input edges", name().c_str()); + } + else if (inputEdges.size() == 1) + { + markInputEdge(inputEdges[0]); + } + else + { + for (EdgeSequenceIterator iei = inputEdges.begin(); iei != inputEdges.end(); ++iei) + { + if ((*iei)->isAuxEdge()) + { + markAuxEdge(*iei); + } + else + { + markInputEdge(*iei); + } + } + } + + /** + * should be exactly only 1 output edge, it should be the data output, + * none of the engine nodes is capable of >1 outputs, fail if so since + * concat and split nodes are handled separately + */ + if (outputEdges.size() == 0) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "%s has 0 output edges", name().c_str()); + } + else if (outputEdges.size() == 1) + { + markOutputEdge(outputEdges[0]); + } + else + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "%s has >1 output edges", name().c_str()); + } + + PROPAGATE_ERROR_FAIL( verifyEdgePorts() ); + +fail: + return e; +} + +// get number of operations whose various events directly update the dependency count of this node +NvU16 engine_ast::DependencyParams::getDependencyCount() +{ + NvU16 num_producers = 0; + for (size_t cc = 0; cc < EngineType::num_elements(); ++cc) + { + if (cc == EngineTypeEnum::CPU || cc == EngineTypeEnum::SPLIT || cc == EngineTypeEnum::CONCATENATION) + { + // dont count cpu/emu ops as a producer of dla ops + continue; + } + + if (producer(cc).nodeAnnId() != -1) + { + num_producers++; + } + } + // if a fused downstream op exists, then the combo is enabled in the reverse order - + // thus the fused node becomes a signalling operation + num_producers += fusedNode(IODirectionEnum::OUTPUT) ? 1 : 0; + return num_producers; +} + + +void engine_ast::Node::emitDependencyParams(DLAInterface* target_dla, DLACommonOpDescAccessor dep, NvU32 batchId) +{ + DLAConsumerAccessor fused_acc = dep.fusedParentAccessor(); + Node *inputFusedNode = dependencyParams(batchId).fusedNode(engine_ast::IODirectionEnum::INPUT); + + *dep.index() = dependencyParams(batchId).annotationId(); + *dep.opType() = ASTToDLAInterface::getEngineType(target_dla, engineType()); + *dep.dependencyCount() = dependencyParams(batchId).getDependencyCount(); // number of dependent units + + for ( size_t c = 0; c < EngineType::num_elements(); ++c ) + { + NvS8 fw_op_index = ASTToDLAInterface::getEngineType(target_dla, c); + if ( fw_op_index < 0 ) + { + continue; + } + + DLAConsumerAccessor cons_acc = dep.consumerAccessor(fw_op_index); + + *cons_acc.index() = dependencyParams(batchId).consumer(c).nodeAnnId(); + *cons_acc.event() = ASTToDLAInterface::getOperationEventType(target_dla, dependencyParams(batchId).consumer(c).opEvent()); + } + + *fused_acc.index() = inputFusedNode ? inputFusedNode->dependencyParams(batchId).annotationId() : -1; + *fused_acc.event() = inputFusedNode ? fused_acc.event_OpEnabled() : fused_acc.event_OpCompleted(); +} + +void engine_ast::Node::setDataCubeAccessor(DLADataCubeAccessor acc, surface::TensorSurfaceDesc* tsd, IODirection iod, NvU32 batchId) +{ + memory::Location location = tsd->tensorBufferDesc()->memoryLoc(batchId).e(); + Node *fusedNode = dependencyParams(batchId).fusedNode(iod); + if ( fusedNode ) + { + *acc.type() = acc.type_HW(); + *acc.address() = -1; + } + else + { + *acc.type() = location.e() == memory::LocationEnum::lCVSRAM ? acc.type_CV() : acc.type_MC(); + *acc.address() = tsd->addressId(batchId); + *acc.offset() = tsd->addressIdOffset(batchId); + if ( graph()->debugOps() || graph()->debugMemoryLayout() ) + { + gLogInfo << "data cube access by tsd:batch=" << tsd->id() << ":" << batchId << " id[offs]=" << *acc.address() << endl; + } + } + + *acc.size() = tsd->size(); + *acc.width() = tsd->dimensions().w; + *acc.height() = tsd->dimensions().h; + *acc.channel() = tsd->dimensions().c; + if ( !fusedNode && tsd->bindable() ) + { + NvS16 addrId = *acc.address(); + uintptr_t lineOffs = uintptr_t(acc.lineStride()); // - uintptr_t(surf_acc.struct_base()); + uintptr_t surfOffs = uintptr_t(acc.surfStride()); // - uintptr_t(surf_acc.struct_base()); + graph()->insertRelocEntry(ILoadable::RelocEntry(addrId, + lineOffs, + NVDLA_LOADABLE_INTERFACE_DLA1, + NVDLA_LOADABLE_SUB_INTERFACE_DLA1_SURFS, + ELST_Line)); + graph()->insertRelocEntry(ILoadable::RelocEntry(addrId, + surfOffs, + NVDLA_LOADABLE_INTERFACE_DLA1, + NVDLA_LOADABLE_SUB_INTERFACE_DLA1_SURFS, + ELST_Surf)); + } + *acc.lineStride() = tsd->lineStride(); + *acc.surfStride() = tsd->surfaceStride(); + *acc.planeStride()= 0; +} + +NvDlaError engine_ast::Node::nodeDataEdge(const std::vector& types, ast::EdgeSideEnum dir, engine_ast::Edge** retEdge) +{ + NvDlaError e = NvDlaSuccess; + engine_ast::Edge* matchedEdge = NULL; + EdgeSequence allEdges = graph()->nodeEdges(this, dir); + for (EdgeSequenceIterator ei = allEdges.begin(); ei != allEdges.end(); ++ei) + { + if ( !(*ei)->isDataEdge() ) + { + continue; + } + surface::SurfaceCategory sc = (*ei)->tensorSurfaceDesc()->surfaceFormat().category(); + for (size_t sci = 0; sci < types.size(); ++sci) + { + if (sc.v() == types[sci].v()) + { + if (matchedEdge != NULL) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, ">1 data edge (%s, %s) of same type", + matchedEdge->id().c_str(), (*ei)->id().c_str()); + } + matchedEdge = *ei; + } + } + } + *retEdge = matchedEdge; +fail: + return e; +} + +NvDlaError engine_ast::Node::nodeDataEdge(TensorType raw_tt, ast::EdgeSideEnum dir, engine_ast::Edge** retEdge) +{ + NvDlaError e = NvDlaSuccess; + engine_ast::Edge* matchedEdge = NULL; + EdgeSequence allEdges = graph()->nodeEdges(this, dir); + for (EdgeSequenceIterator ei = allEdges.begin(); ei != allEdges.end(); ++ei) + { + if ( !(*ei)->isDataEdge() ) + { + continue; + } + if ( (*ei)->originalTensor() ) + { + TensorType tt = (*ei)->originalTensor()->getTensorType(); + if (tt == raw_tt) + { + if (matchedEdge != NULL) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, ">1 data edge (%s, %s) of same TensorType %d", + matchedEdge->id().c_str(), (*ei)->id().c_str(), (int)raw_tt); + } + matchedEdge = *ei; + } + } + } + *retEdge = matchedEdge; +fail: + return e; +} + +//---------------------------------------------------------------------- +// Compiler Utils +//---------------------------------------------------------------------- + +/*----------------------Surface Descriptor Registration------------------*/ +//TODO: collapse the following 3 into 1 with switch-case +const std::vector engine_ast::Node::supportedInSurfCategories() const +{ + std::vector supported_scs_v; + std::set> supported_scs; + for (size_t ss = 0; ss < supportedInSurfFormats().size(); ++ss) + { + supported_scs.insert(supportedInSurfFormats()[ss].f().category()); + } + supported_scs_v.resize(supported_scs.size()); + std::copy(supported_scs.begin(), supported_scs.end(), supported_scs_v.begin()); + return supported_scs_v; +} + +const std::vector engine_ast::Node::supportedAuxSurfCategories() const +{ + std::vector supported_scs_v; + std::set> supported_scs; + + for (size_t ss = 0; ss < supportedAuxSurfFormats().size(); ++ss) + { + supported_scs.insert(supportedAuxSurfFormats()[ss].f().category()); + } + + supported_scs_v.resize(supported_scs.size()); + std::copy(supported_scs.begin(), supported_scs.end(), supported_scs_v.begin()); + + return supported_scs_v; +} + +const std::vector engine_ast::Node::supportedOutSurfCategories() const +{ + std::vector supported_scs_v; + std::set> supported_scs; + for (size_t ss = 0; ss < supportedOutSurfFormats().size(); ++ss) + { + supported_scs.insert(supportedOutSurfFormats()[ss].f().category()); + } + supported_scs_v.resize(supported_scs.size()); + std::copy(supported_scs.begin(), supported_scs.end(), supported_scs_v.begin()); + return supported_scs_v; +} + +NvDlaError engine_ast::Node::supportsSurfaceFormat(surface::SurfaceFormat proposed_sf, + std::vector supported_sfs) +{ + NvDlaError e = NvDlaError_Success; + size_t ss = 0; + + if (proposed_sf.e() == surface::SurfaceFormatEnum::NVDLA_UNKNOWN_FORMAT) + { + PROPAGATE_ERROR_FAIL(NvDlaError_BadValue, "Unknown surface format proposed for the node:%s", name().c_str()); + } + + for (ss = 0; ss < supported_sfs.size(); ++ss) + { + if (proposed_sf.e() == supported_sfs[ss].e()) + break; + } + + if(ss == supported_sfs.size()) + { + PROPAGATE_ERROR_FAIL(NvDlaError_BadParameter, "Proposed surf format:%s is not supported by node:%s", + proposed_sf.c_str(), name().c_str()); + } + +fail: + return e; +} + +std::vector engine_ast::Node::suggestInputSurfaceFormats() +{ + NvDlaError e = NvDlaSuccess; + NVDLA_UNUSED(e); + std::vector supportedInSFs = supportedInSurfFormats(); + std::vector suggestedInSFs; + std::vector::iterator inSFItr; + surface::SurfacePrecision compPrec = graph()->profile()->computePrecision(); + + if (supportedInSFs.size() == 0) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "No supported in surface formats for %s", name().c_str()); + } + else if (supportedInSFs.size() == 1) + { + // most engines support only 1 input format + // prefer that since there's no other choice (usually, it would be FEATURE_DATA) + suggestedInSFs = supportedInSFs; + goto fail; + } + + // Weed out the suggested inSFs whose precision don't match compute precision of the model + for (inSFItr = supportedInSFs.begin(); inSFItr != supportedInSFs.end(); ++inSFItr) + { + if ((*inSFItr).precision().v() != compPrec.v()) + { + continue; + } + else + { + suggestedInSFs.push_back(*inSFItr); + } + } + + if (suggestedInSFs.size() == 0) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "No supported input surface formats for node:%s", name().c_str()); + } + +fail: + return suggestedInSFs; +} + + +std::vector engine_ast::Node::suggestAuxSurfaceFormats(engine_ast::Edge* auxEdge) +{ + NvDlaError e = NvDlaSuccess; + NVDLA_UNUSED(e); + std::vector supportedAuxSFs = supportedAuxSurfFormats(); + std::vector suggestedAuxSFs; + std::vector::iterator auxSFItr; + + if (supportedAuxSFs.size() == 0) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "No supported aux surface formats for %s", name().c_str()); + } + else if (supportedAuxSFs.size() == 1) + { + suggestedAuxSFs = supportedAuxSFs; + goto fail; + } + else + { + surface::SurfacePrecision compPrec = graph()->profile()->computePrecision(); + for (auxSFItr = supportedAuxSFs.begin(); auxSFItr != supportedAuxSFs.end(); ++auxSFItr) + { + if ((*auxSFItr).precision().v() != compPrec.v()) + { + continue; + } + else + { + suggestedAuxSFs.push_back(*auxSFItr); + } + } + } + + if (suggestedAuxSFs.size() == 0) { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "No suggested aux surface formats for node:%s", name().c_str()); + } + +fail: + return suggestedAuxSFs; +} + +std::vector engine_ast::Node::suggestOutputSurfaceFormats() +{ + NvDlaError e = NvDlaSuccess; + NVDLA_UNUSED(e); + surface::SurfaceFormat inSF; + std::vector supportedOutSFs; + std::vector suggestedOutSFs; + std::vector::iterator outSFItr; + surface::SurfacePrecision compPrec; + + PROPAGATE_ERROR_FAIL(verifyEdgePorts()); + + inSF = inputEdges()[0]->tensorSurfaceDesc()->surfaceFormat(); + supportedOutSFs = supportedOutSurfFormats(); + compPrec = graph()->profile()->computePrecision(); + + if (supportedOutSFs.size() == 0) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "No supported out surface formats for %s", name().c_str()); + } + else if (supportedOutSFs.size() == 1) + { + // most engines support only 1 output format (eventhough they may support >1 input formats (e.g., conv) + // prefer that since there's no other choice (usually, it would be FEATURE_DATA) + suggestedOutSFs = supportedOutSFs; + goto fail; + } + else + { + if (std::find_if(supportedOutSFs.begin(), supportedOutSFs.end(), surface::SurfaceFormat(inSF)) != + supportedOutSFs.end()) + { + // most engines have only 1 supported in/out surf-formats. hence their out_sf = in_sf + suggestedOutSFs.clear(); + suggestedOutSFs.push_back(inSF); + goto fail; + } + } + + // Weed out the suggested out_sfs whose precision don't match compute precision of the model + // or that of the inputSF (until we figure out the CVT business - todo) + for (outSFItr = supportedOutSFs.begin(); outSFItr != supportedOutSFs.end(); ++outSFItr) + { + if ((*outSFItr).precision().v() != compPrec.v() || + (*outSFItr).precision().v() != inSF.precision().v()) + { + continue; + } + else + { + suggestedOutSFs.push_back(*outSFItr); + } + } + + // last try, desperately attempt to find the closest possible output surface format, before giving up + if (suggestedOutSFs.size() == 0) + { + gLogInfo << "Last attempt to determine out SF for " << name() << endl; + supportedOutSFs = supportedOutSurfFormats(); + for (outSFItr = supportedOutSFs.begin(); outSFItr != supportedOutSFs.end(); ++outSFItr) + { + if ((*outSFItr).precision().v() != compPrec.v()) + { + continue; + } + else + { + gLogInfo << "last try adding " << (*outSFItr).c_str() << endl; + suggestedOutSFs.push_back(*outSFItr); + } + } + } + + if (suggestedOutSFs.size() == 0) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "No suggested output surface formats for node:%s", name().c_str()); + } + +fail: + return suggestedOutSFs; +} + +Dims4 engine_ast::Node::suggestSurfaceDims(surface::TensorSurfaceDesc* tsd) +{ + return tsd->dimensions(); +} + +NvU32 engine_ast::Node::suggestLineStride(surface::TensorSurfaceDesc* tsd) +{ + return tsd->lineStride(); +} + +NvU32 engine_ast::Node::suggestSurfaceStride(surface::TensorSurfaceDesc* tsd) +{ + return tsd->surfaceStride(); +} + +NvU64 engine_ast::Node::suggestSurfaceSize(surface::TensorSurfaceDesc* tsd) +{ + return tsd->size(); +} + +NvU64 engine_ast::Node::suggestSurfaceOffsetInBuffer(surface::TensorSurfaceDesc* tsd) +{ + return tsd->bufferOffset(); +} + +memory::TensorBufferDesc* engine_ast::Node::suggestBuffer(surface::TensorSurfaceDesc* tsd) +{ + NvDlaError e = NvDlaSuccess; + bool isDstTSD = false; + bool isSrcTSD = false; + bool isAuxTSD = false; + EdgeSequence outEdges; + EdgeSequence inEdges; + EdgeSequence auxlEdges; + memory::TensorBufferDesc* tbd = NULL; + NvU16 numBatches = graph()->profile()->multiBatchSize(); + + PROPAGATE_ERROR_FAIL(verifyEdgePorts()); + + outEdges = outputEdges(); + inEdges = inputEdges(); + auxlEdges = auxEdges(); + + for (EdgeSequenceIterator iei = inEdges.begin(); iei != inEdges.end(); ++iei) + { + if ((*iei)->tensorSurfaceDesc() == tsd) + { + isSrcTSD = true; + break; + } + } + isDstTSD = outputEdges()[0]->tensorSurfaceDesc() == tsd; + for (EdgeSequence::const_iterator iei = auxEdges().begin(); iei != auxEdges().end(); ++iei) + { + if ((*iei)->tensorSurfaceDesc() == tsd) + { + isAuxTSD = true; + break; + } + } + + if (!isSrcTSD && !isDstTSD && !isAuxTSD) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "TSD %s doesn't belong to %s", tsd->id().c_str(), name().c_str()); + } + else if ( tsd->tensorCategory().v() == memory::TensorCategoryEnum::UNKNOWN_TENSOR ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Edge %s has 'unknown' tensor category", + tsd->id().c_str()); + } + + tbd = tsd->tensorBufferDesc(); + if ( !tbd ) + { + tbd = graph()->resourceMgr()->regTensorBufferDesc(numBatches); + } + +fail: + return tbd; +} + +vector< surface::TensorSurfaceDesc *> engine_ast::Node::inputSurfaces() const +{ + vector< surface::TensorSurfaceDesc *> r; + surface::TensorSurfaceDesc* i0 = + graph()->nodeInputTensorSurface(this, 0, supportedInSurfCategories()); + if ( i0 ) + { + r.push_back(i0); + } + return r; +} + +vector< surface::TensorSurfaceDesc *> engine_ast::Node::auxSurfaces() const +{ + vector< surface::TensorSurfaceDesc *> r; + surface::TensorSurfaceDesc* a0 = NULL; + //Get surface info for all aux edges + for (size_t i=0; inodeInputTensorSurface(this, i, supportedAuxSurfCategories()); + if ( a0 ) + { + r.push_back(a0); + } + } + return r; +} + +vector< surface::TensorSurfaceDesc *> engine_ast::Node::outputSurfaces() const +{ + vector< surface::TensorSurfaceDesc *> r; + + surface::TensorSurfaceDesc *o0 = + graph()->nodeOutputTensorSurface(this, 0, supportedOutSurfCategories()); + + if ( o0 ) + { + r.push_back(o0); + } + return r; +} + +// +// 'depends' denotes an upstream search. +// +// search with respect to the edge types given in the 'via's to determine +// if this node is connected to the 'of' node. +// +// . nodes never depend upon themselves. +// +// . if requiredVia is specified (non-zero sized) then connection paths are +// valid iff at some point one of the requiredVia edge types arises. +// +// . if 'allowedVia' is specified (non-zero sized) then paths are allowed +// to also have the allowedVia edge types present. +// +// . requiredVia -> nil: && allowedVia -> nil: simple connection test. +// . requiredVia -> !nil && allowedVia -> nil: conntection test where +// all paths must consist of only requiredVia types +// +bool engine_ast::Node::dependsOn(Node *of, + const vector &requiredVia, + const vector &allowedVia) const +{ + bool done = false, depends = false; + + map< const Node *, bool> followNodes; + map< const Node *, bool> followedNodes; + + bool requires = requiredVia.size() != 0; + bool allows = allowedVia.size() != 0; + + if ( of == this ) + { + goto done; + } + + followNodes[this] = false; + + while ( followNodes.size() && !(done || depends) ) + { + + const Node *followingNode = followNodes.begin()->first; + bool followingSatisfied = followNodes.begin()->second; + EdgeSequence followingEdges; + + followNodes.erase(followingNode); + followedNodes[followingNode] = followingSatisfied; + + if ( followingNode == of ) + { + done = true; + depends = followingSatisfied; + continue; + } + + followingEdges = graph()->upstreamEdges(followingNode); + + for ( size_t fei = 0, FEI = followingEdges.size(); fei != FEI; ++fei ) + { + Edge *testEdge = followingEdges[fei]; + EdgeType testType = testEdge->edgeType(); + bool testEdgeSatisfies, satisfied; + bool follow = (!allows) || ( find(allowedVia.begin(), allowedVia.end(), testType) != allowedVia.end() ); + NodeSequence upstreamNodes; + + if ( !follow ) + { + continue; // unfollowable path (edge type not allowed) + } + + testEdgeSatisfies = (!requires) || ( find(requiredVia.begin(), requiredVia.end(), testType) != requiredVia.end() ) || + ( find(allowedVia.begin(), allowedVia.end(), testType) != allowedVia.end() ); + satisfied = followingSatisfied || testEdgeSatisfies; + + upstreamNodes = graph()->upstreamNodes(testEdge); + + for ( size_t uni = 0, UNI = upstreamNodes.size(); uni != UNI; ++uni ) + { + Node *upstreamNode = upstreamNodes[uni]; + map::iterator fun = followedNodes.find(upstreamNode); + + // if we've never encountered this node before + // then follow it. if we've seen it before only + // follow it again if it was not a satisfied path + // then, but now is. + if ( fun == followedNodes.end() ) + { + followNodes[upstreamNode] = satisfied; + } + else + { + if ( satisfied && (fun->second == false) ) + { + followNodes[upstreamNode] = true; + followedNodes[upstreamNode] = true; + } + } + } + } + } + + done: + return depends; + +} + +/*---------------------------Resolve Data Dependencies-----------------*/ +NvDlaError engine_ast::Node::resolveDataDependencies(engine_ast::Node* next) +{ + NvDlaError e = NvDlaSuccess; + NvU8 this_type; + NodeSequence consumer_nodes; + EdgeSequence output_data_edges = graph()->downstreamDataEdges(this); + EdgeSequence hazardEdges = graph()->upstreamHazardEdges(this); + NodeSequence hazardNodes, realHazardNodes; + + this_type = engineType().v(); + + if ( hazardEdges.size() ) + { + set uniqHazardNodes; + + // gLogInfo << "hazard: resolveDataDependencies sees " << output_hazard_edges.size() << " hazards" << endl; + // gLogInfo << "hazard: this depends on that: " << endl; + + for ( size_t hei = 0, HEI = hazardEdges.size(); hei != HEI; ++hei ) + { + NodeSequence edgeHazardNodes = graph()->upstreamNodes( hazardEdges[hei] ); + + for ( size_t hni=0, HNI = edgeHazardNodes.size(); hni != HNI; ++hni ) + { + if ( uniqHazardNodes.find( edgeHazardNodes[hni] ) == uniqHazardNodes.end() ) + { + hazardNodes.push_back(edgeHazardNodes[hni]); + uniqHazardNodes.insert(edgeHazardNodes[hni]); + } + } + } + } + if ( hazardNodes.size() ) + { + + // gLogInfo << "rdd hazard: found " << hazardNodes.size() << " hazard nodes downstream" << endl; + // each of these represents a memory hazard. if we happen to be on the same unit there's + // no actual problem. check that. + + for ( size_t hni=0, HNI = hazardNodes.size(); hni != HNI; ++hni ) + { + Node *otherOp = hazardNodes[hni]; + if ( otherOp->engineType().v() == this_type ) + { + continue; + } + realHazardNodes.push_back(otherOp); + } + } + if ( realHazardNodes.size() ) + { + if ( graph()->debugDepGraph() ) + { + gLogInfo << "info: node=" << id() << " found " << realHazardNodes.size() << " actionable hazard nodes." << endl; + } + } + + if (next) + { + Node * previous = this; + // 'currNode' may be connected to fusedNodes of 'previous' + Node * fusedNode = previous; + while (fusedNode) { + if (graph()->adjacentNodes(fusedNode,next) + // uncomment this line to for faster enabling same engine typed nodes from threads to threads + // when no register group race conditions + // e.g. diamonds from group convolutions + // || fusedNode->engineType() == next->engineType() + ) + { + break; + } + fusedNode = fusedNode->dependencyParams().fusedNode(IODirectionEnum::INPUT); + } + + if (!fusedNode) + { + // no fusedNodes connect to currNode + // currNode is the head of a new thread + Edge* DFSthreadsCompEdge = graph()->addComputeEdge(previous, next); + NVDLA_UNUSED(DFSthreadsCompEdge); + if ( debugResolveDependencies() ) + { + gLogInfo << "adding compute edge " << DFSthreadsCompEdge->id() + << " from " << (previous)->name() << " -> " << (next)->name() << endl; + + //printGraph(graph(), true); + } + } + else if (fusedNode->engineType() == next->engineType() && !graph()->adjacentNodes(fusedNode,next)) + { + // if fusedNode and next are non-adjacent nodes with same engine type + // we need this edge for mem resolve + Edge* DFSthreadsCompEdge = graph()->addComputeEdge(fusedNode, next); + NVDLA_UNUSED(DFSthreadsCompEdge); + if ( debugResolveDependencies() ) + { + gLogInfo << "adding compute edge " << DFSthreadsCompEdge->id() + << " from " << (fusedNode)->name() << " -> " << (next)->name() << endl; + + //printGraph(graph(), true); + } + // fusedNodes is connected to currNode + previous = fusedNode; + } + else + { + // fusedNodes is connected to currNode + previous = fusedNode; + } + + if (!fusedNode || (graph()->adjacentNodes(previous,next) && graph()->connectedDataNodes(previous, next))) + { + // if previous is connected to currNode with data edge, or + // if previous is not connected to currNode but there's no fusedNodes connection either + // then there's a computeEdge added + // need to attach OP_COMPLETED + + if (previous->isSoftwareNode()) + { + for (size_t et = 0; et < EngineType::num_elements(); ++et) + { + Node * consumer = previous->dependencyParams(0).consumer(et).node(); + NvU8 producerType = (previous)->engineType().v(); + + if (consumer) consumer->dependencyParams(0).producer(producerType).setNode(NULL); + previous->dependencyParams(0).consumer(et).setNode(NULL); + } + } + if (next->isSoftwareNode()) + { + for (size_t et = 0; et < EngineType::num_elements(); ++et) + { + Node * producer = next->dependencyParams(0).producer(et).node(); + NvU8 consumerType = (next)->engineType().v(); + + if (producer) producer->dependencyParams(0).consumer(consumerType).setNode(NULL); + next->dependencyParams(0).producer(et).setNode(NULL); + } + } + + NvU8 consumerType = (next)->engineType().v(); + NvU8 producerType = (previous)->engineType().v(); + (previous)->dependencyParams(/*batchId*/0).consumer(consumerType).setNode(next); + (previous)->dependencyParams(/*batchId*/0).consumer(consumerType).setOpEvent(OperationEventTypeEnum::OP_COMPLETED); + (next)->dependencyParams(/*batchId*/0).producer(producerType).setNode(previous); + (next)->dependencyParams(/*batchId*/0).producer(producerType).setOpEvent(OperationEventTypeEnum::OP_COMPLETED); + } + + } + + + // + // realHazardNodes ops must complete before this/ op can begin. + // so this node is a consumer of it/them. + // + for ( size_t rhi = 0, RHI = realHazardNodes.size(); rhi != RHI; ++rhi ) + { + Node *hazardProducer = realHazardNodes[rhi]; + EngineType hazardProducerEngineType = hazardProducer->engineType(); + NvU8 hazardProducerEngine = hazardProducerEngineType.v(); + Node *existingEngineProducer = dependencyParams(/*batchId*/0).producer(hazardProducerEngine).node(); + + // don't do split or concat nodes... + if ( hazardProducerEngineType == EngineTypeEnum::CONCATENATION || + hazardProducerEngineType == EngineTypeEnum::SPLIT ) + { + continue; + } + + if ( !existingEngineProducer ) + { + // the operation which needs to wait (this, the consumer) + if ( this->dependsOn(existingEngineProducer, viaComputeData, allowAll) ) + { + if ( graph()->debugDepGraph() ) + { + // no worries. the hazard will be cleared due to existing serialization. + gLogInfo <<"info: hazard cleared due to existing order on engine " << + hazardProducerEngineType.c_str() << endl; + } + } + else + { + // treat as normal producer-consumer + // update consumer of this node + dependencyParams(/*batchId*/0).producer(hazardProducerEngine).setNode(hazardProducer); + dependencyParams(/*batchId*/0).producer(hazardProducerEngine).setOpEvent(OperationEventTypeEnum::OP_COMPLETED); + + // at the same time update producer of consumer node + hazardProducer->dependencyParams(/*batchId*/0).consumer(this_type).setNode(this); + hazardProducer->dependencyParams(/*batchId*/0).consumer(this_type).setOpEvent(OperationEventTypeEnum::OP_COMPLETED); + } + } + // else + // { + // /*there's already a wait on that engine. don't need to worry about it.*/ + // } + } + + return e; +} + +/*---------------------------Resolve Compute Dependencies--------------*/ +NvDlaError engine_ast::Node::resolveComputeDependencies(const NodeSequence &ordered_nodes) +{ + NvDlaError e = NvDlaError_Success; + NodeSequence::const_iterator nin, ni; + + if ( isSoftwareNode() ) + { + goto fail; + } + + ni = std::find(ordered_nodes.begin(), ordered_nodes.end(), this); + + for (nin = (ni == ordered_nodes.end() ? ordered_nodes.end() : ni+1); nin != ordered_nodes.end(); ++nin ) + { + Node *other_node = *nin; + EngineType curr_eng_type = engineType(); + /* Treat a directly connected or distant operation of same engineType as a consumer except for the software nodes. */ + if (other_node->isEngineType(curr_eng_type)) + { + dependencyParams(/*batchId*/0).consumer( curr_eng_type.v() ).setNode(other_node); + other_node->dependencyParams(/*batchId*/0).producer( curr_eng_type.v() ).setNode(this); + + /* If 2 adjacent nodes of the same engine type relay a data tensor between them, then + * the downstream op should wait until the upstream op is completed otherwise the + * downstream op could start independently. + */ + if ( graph()->adjacentNodes(this, other_node)) + { + if ( other_node->dependsOn(this, viaCompute, allowAll) ) + { + dependencyParams(/*batchId*/0).consumer( curr_eng_type.v() ).setOpEvent(OperationEventTypeEnum::OP_PROGRAMMED); + other_node->dependencyParams(/*batchId*/0).producer( curr_eng_type.v() ).setOpEvent(OperationEventTypeEnum::OP_PROGRAMMED); + } + else + { + dependencyParams(/*batchId*/0).consumer( curr_eng_type.v() ).setOpEvent(OperationEventTypeEnum::OP_COMPLETED); + other_node->dependencyParams(/*batchId*/0).producer( curr_eng_type.v() ).setOpEvent(OperationEventTypeEnum::OP_COMPLETED); + } + } + else + { + /* However, if 2 nodes of the same engineType are distant in the graph + * OR + * 2 adjacent nodes need different sub-engines (i.e. they are fused) - + * (ONLY happens when different types of SDP use different sub-engines) + * then the consumer can be programmed ASA producer is programmed. + * But, it will be waiting on some other node to complete before executing. + */ + dependencyParams(/*batchId*/0).consumer( curr_eng_type.v() ).setOpEvent(OperationEventTypeEnum::OP_PROGRAMMED); + other_node->dependencyParams(/*batchId*/0).producer( curr_eng_type.v() ).setOpEvent(OperationEventTypeEnum::OP_PROGRAMMED); + } + break; + } + } + +fail: + return e; +} + +/*---------------------Resolve Software Dependencies-------------------*/ +NvDlaError engine_ast::Node::resolveSoftwareDependencies() +{ + NvDlaError e = NvDlaSuccess; + NodeSequence producerNodes; + NodeSequence consumerNodes; + Node* prodToSwNode = NULL; + Node* consOfSwNode = NULL; + Node* existingConsOfProd = NULL; + Node* existingProdOfCons = NULL; + EngineType prodEngType; + EngineType consEngType; + OperationEventType prodEvent; + OperationEventType consEvent; + + if (!isSoftwareNode()) + { + goto fail; + } + + for (size_t et = 0; et < EngineType::num_elements(); ++et) + { + Node* prod = dependencyParams(0).producer(et).node(); + Node* cons = dependencyParams(0).consumer(et).node(); + + if (prod) + { + producerNodes.push_back(prod); + } + if (cons) + { + consumerNodes.push_back(cons); + } + } + + if ( producerNodes.size() > 1 ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Can't handle >1 producers " + "to software node %s", name().c_str()); + } + else if ( consumerNodes.size() > 1 ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Can't handle >1 consumers " + "to software node %s", name().c_str()); + } + if ( (producerNodes.size() == 0) || (consumerNodes.size() == 0) ) + { + // no need to cross-relegate dependencies in case of a missing producer or consumer + goto fail; + } + + prodToSwNode = producerNodes.at(0); + prodEngType = prodToSwNode->engineType(); + prodEvent = dependencyParams(0).producer(prodEngType.v()).opEvent(); + + consOfSwNode = consumerNodes.at(0); + consEngType = consOfSwNode->engineType(); + consEvent = dependencyParams(0).consumer(consEngType.v()).opEvent(); + + if (prodEvent.v() != consEvent.v()) + { + gLogError << "Prod " << dependencyParams(0).producer(prodEngType.v()).node()->name() + << " event " << prodEvent.c_str() << endl; + gLogError << "Cons " << dependencyParams(0).consumer(consEngType.v()).node()->name() + << " event " << consEvent.c_str() << endl; + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Can't connect producer and consumer of " + "%s with different op events", name().c_str()); + } + + existingConsOfProd = prodToSwNode->dependencyParams(0).consumer(consEngType.v()).node(); + existingProdOfCons = consOfSwNode->dependencyParams(0).producer(prodEngType.v()).node(); + if ( existingConsOfProd && + !existingConsOfProd->isSoftwareNode() && + (existingConsOfProd != consOfSwNode) ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Can't override existing consumer (%s) of %s with %s", + existingConsOfProd->name().c_str(), prodToSwNode->name().c_str(), consOfSwNode->name().c_str()); + } + else if ( existingProdOfCons && + !existingProdOfCons->isSoftwareNode() && + (existingProdOfCons != prodToSwNode) ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Can't override existing producer (%s) of %s with %s", + existingProdOfCons->name().c_str(), consOfSwNode->name().c_str(), prodToSwNode->name().c_str()); + } + else + { + prodToSwNode->dependencyParams(0).consumer(consEngType.v()).setNode(consOfSwNode); + prodToSwNode->dependencyParams(0).consumer(consEngType.v()).setOpEvent(consEvent); + consOfSwNode->dependencyParams(0).producer(prodEngType.v()).setNode(prodToSwNode); + consOfSwNode->dependencyParams(0).producer(prodEngType.v()).setOpEvent(prodEvent); + + // at the end, remove the existing software node from the dependency graph of + // both its producer and consumer + prodToSwNode->dependencyParams(0).consumer(this->engineType().v()).setNode(NULL); + prodToSwNode->dependencyParams(0).consumer(this->engineType().v()).setOpEvent(OperationEventTypeEnum::OP_COMPLETED); + consOfSwNode->dependencyParams(0).producer(this->engineType().v()).setNode(NULL); + consOfSwNode->dependencyParams(0).producer(this->engineType().v()).setOpEvent(OperationEventTypeEnum::OP_COMPLETED); + } + +fail: + return e; +} + +/*--------------------------------Self Annotation----------------------*/ +NvDlaError engine_ast::Node::selfAnnotate(NvS16& lastUsedAnnId) +{ + NvDlaError e = NvDlaSuccess; + NvU32 numBatches = graph()->profile()->multiBatchSize(); + + for (NvU32 nn = 0; nn < numBatches; ++nn) + { + dependencyParams(nn).setAnnotationId(++lastUsedAnnId); + } + + return e; +} + +/*-------------------------Resolve Multi-Batch Dependencies------------*/ +/* + * Once the dependency graph is prepared for all the operations of a single batch, + * its time to introduce dependencies that will chain executing 'N' batches together. + * + * Remember, same operation executed for different batches never has a data dependency + * between the copies, but only compute dependency. So introduce compute dependency + * between the operations of the batches and shift the producer events calculated for + * the single batch to batch-0 and consumer events to batch-N + */ +NvDlaError engine_ast::Node::resolveMultiBatchDependencies() +{ + NvDlaError e = NvDlaSuccess; + + NvU32 numBatches = graph()->profile()->multiBatchSize(); + NvU32 firstBatch = 0; + NvU32 lastBatch = numBatches - 1; + EngineType currEngType = engineType(); + + if (numBatches == 1) + { + goto fail; + } + + //TODO Keep parallel execution disable until it is verified + if (0) + { + for (size_t et = 0; et < EngineType::num_elements(); ++et) + { + Node* skipFusedConsumer = dependencyParams(firstBatch).fusedNode(IODirectionEnum::OUTPUT); + if (skipFusedConsumer && skipFusedConsumer->engineType() == et) + { + continue; + } + + Node* consumer = dependencyParams(firstBatch).consumer(et).node(); + OperationEventType consumerEvent = dependencyParams(firstBatch).consumer(et).opEvent(); + NvS16 consumerAnnId = consumer ? consumer->dependencyParams(firstBatch).annotationId() : -1; + NvS16 lastBatchAnnId = dependencyParams(lastBatch).annotationId(); + dependencyParams(lastBatch).consumer(et).setNode(consumer); + dependencyParams(lastBatch).consumer(et).setNodeAnnId(consumerAnnId); + dependencyParams(lastBatch).consumer(et).setOpEvent(consumerEvent); + if ( consumer ) + { + consumer->dependencyParams(firstBatch).producer(currEngType.v()).setNode(this); + consumer->dependencyParams(firstBatch).producer(currEngType.v()).setNodeAnnId(lastBatchAnnId); + consumer->dependencyParams(firstBatch).producer(currEngType.v()).setOpEvent(consumerEvent); + } + + // and finally clear the dependency params of the 1st batch + dependencyParams(firstBatch).consumer(et).setNode(NULL); + dependencyParams(firstBatch).consumer(et).setNodeAnnId(-1); + dependencyParams(firstBatch).consumer(et).setOpEvent(OperationEventTypeEnum::OP_COMPLETED); + } + + + for (NvU16 iod = 0; iod < IODirection::num_elements(); ++iod) + { + Node* fusedNode = dependencyParams(firstBatch).fusedNode(iod); + if (fusedNode) + { + EngineType fusedNodeEngType = fusedNode->engineType(); + OperationEventType fusedNodeOpEvent = iod == IODirectionEnum::INPUT ? + dependencyParams(firstBatch).producer(fusedNodeEngType.e()).opEvent() : + dependencyParams(firstBatch).consumer(fusedNodeEngType.e()).opEvent(); + for (NvU32 nn = firstBatch + 1; nn < numBatches; ++nn) + { + dependencyParams(nn).setFusedNode(iod, fusedNode); + NvS16 fusedNodeAnnId = fusedNode->dependencyParams(nn).annotationId(); + if (iod == IODirectionEnum::INPUT) + { + dependencyParams(nn).producer(fusedNodeEngType.e()).setNode(fusedNode); + dependencyParams(nn).producer(fusedNodeEngType.e()).setNodeAnnId(fusedNodeAnnId); + dependencyParams(nn).producer(fusedNodeEngType.e()).setOpEvent(fusedNodeOpEvent); + } + else + { + dependencyParams(nn).consumer(fusedNodeEngType.e()).setNode(fusedNode); + dependencyParams(nn).consumer(fusedNodeEngType.e()).setNodeAnnId(fusedNodeAnnId); + dependencyParams(nn).consumer(fusedNodeEngType.e()).setOpEvent(fusedNodeOpEvent); + } + } + } + } + } + else + { + /* Inherit dependency graph from batch-0 into other batches, such that they inherit + * producer/consumer details from the operation chain of the relevant batch + */ + for (NvU32 nn = 1; nn < numBatches; ++nn) + { + for (size_t et = 0; et < EngineType::num_elements(); ++et) + { + Node* consumer = dependencyParams(0).consumer(et).node(); + OperationEventType consumerEvent = dependencyParams(0).consumer(et).opEvent(); + NvS16 consumerAnnId = consumer ? consumer->dependencyParams(nn).annotationId() : -1; + dependencyParams(nn).consumer(et).setNode(consumer); + dependencyParams(nn).consumer(et).setNodeAnnId(consumerAnnId); + dependencyParams(nn).consumer(et).setOpEvent(consumerEvent); + + Node* producer = dependencyParams(0).producer(et).node(); + OperationEventType producerEvent = dependencyParams(0).producer(et).opEvent(); + NvS16 producerAnnId = producer ? producer->dependencyParams(nn).annotationId() : -1; + dependencyParams(nn).producer(et).setNode(producer); + dependencyParams(nn).producer(et).setNodeAnnId(producerAnnId); + dependencyParams(nn).producer(et).setOpEvent(producerEvent); + } + + for (NvU16 iod = 0; iod < IODirection::num_elements(); ++iod) + { + dependencyParams(nn).setFusedNode(iod, dependencyParams(0).fusedNode(iod)); + } + } + + /* Delegate the compute consumer of the node to the dependency graph of its last Batch */ + Node* computeConsumerNode = dependencyParams(/*batchId*/0).consumer(currEngType.v()).node(); + OperationEventType computeEvent = dependencyParams(/*batchId*/0).consumer(currEngType.v()).opEvent(); + NvS16 consumerAnnId = computeConsumerNode ? computeConsumerNode->dependencyParams(/*batchId*/0).annotationId() : -1; + NvS16 lastBatchAnnId = dependencyParams(lastBatch).annotationId(); + + /* Connect the last batch of this node to the first batch of the consumer node */ + dependencyParams(/*batchId*/lastBatch).consumer(currEngType.v()).setNode(computeConsumerNode); + dependencyParams(/*batchId*/lastBatch).consumer(currEngType.v()).setNodeAnnId(consumerAnnId); + dependencyParams(/*batchId*/lastBatch).consumer(currEngType.v()).setOpEvent(computeEvent); + if ( computeConsumerNode ) + { + computeConsumerNode->dependencyParams(/*firstBatchId*/0).producer(currEngType.v()).setNode(this); + computeConsumerNode->dependencyParams(/*firstBatchId*/0).producer(currEngType.v()).setNodeAnnId(lastBatchAnnId); + computeConsumerNode->dependencyParams(/*firstBatchId*/0).producer(currEngType.v()).setOpEvent(computeEvent); + } + } + + + /* Chain the operations of the same type within the batches with soft stops */ + for (NvU32 currBatch = firstBatch; currBatch < lastBatch; ++currBatch) + { + NvU32 nextBatch = currBatch + 1; + NvS16 nextBatchAnnId = dependencyParams(nextBatch).annotationId(); + NvS16 currBatchAnnId = dependencyParams(currBatch).annotationId(); + + /* batches executing the same operation are connected by OP_COMPLETE events */ + dependencyParams(/*batchId*/currBatch).consumer(currEngType.v()).setNode(this); + dependencyParams(/*batchId*/currBatch).consumer(currEngType.v()).setNodeAnnId(nextBatchAnnId); + dependencyParams(/*batchId*/currBatch).consumer(currEngType.v()).setOpEvent(OperationEventTypeEnum::OP_PROGRAMMED); + + dependencyParams(/*batchId*/nextBatch).producer(currEngType.v()).setNode(this); + dependencyParams(/*batchId*/nextBatch).producer(currEngType.v()).setNodeAnnId(currBatchAnnId); + dependencyParams(/*batchId*/nextBatch).producer(currEngType.v()).setOpEvent(OperationEventTypeEnum::OP_PROGRAMMED); + } + +fail: + return e; +} + +/*-------------------------Verify Dependency Params--------------------*/ +NvDlaError engine_ast::Node::verifyDependencyParams() +{ + NvDlaError e = NvDlaSuccess; + + NvU32 numBatches = graph()->profile()->multiBatchSize(); + NvU32 firstBatch = 0; + NvU32 lastBatch = numBatches - 1; + EngineType currEngType = engineType(); + + if (isSoftwareNode()) + { + goto fail; + } + + for (NvU32 currBatch = firstBatch + 1; currBatch < lastBatch; ++currBatch) + { + NvU32 prevBatch = currBatch - 1; + NvU32 nextBatch = currBatch + 1; + Node* consumer = NULL; + Node* producer = NULL; + OperationEventType consOpEvent; + OperationEventType prodOpEvent; + + for(size_t et = 0; et < EngineType::num_elements(); ++et) + { + if (et == EngineTypeEnum::CONCATENATION || et == EngineTypeEnum::SPLIT) + { + continue; + } + + consumer = dependencyParams(currBatch).consumer(et).node(); + consOpEvent = dependencyParams(currBatch).consumer(et).opEvent(); + if (consumer == this) + { + if(consumer->dependencyParams(nextBatch).producer(currEngType.v()).nodeAnnId() != + dependencyParams(currBatch).annotationId()) + { + gLogInfo << "consumer id " << consumer->dependencyParams(nextBatch).producer(currEngType.v()).nodeAnnId() + << " and producer id " << dependencyParams(currBatch).annotationId() << endl; + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Consumer %s and Producer %s don't form " + "the right pair", consumer->name().c_str(), name().c_str()); + } + if(consumer->dependencyParams(nextBatch).producer(currEngType.v()).opEvent().e() != consOpEvent.e()) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Consumer %s and Producer %s don't form " + "the right pair with same op events", consumer->name().c_str(), name().c_str()); + } + } + else if (consumer != NULL) + { + if(consumer->dependencyParams(currBatch).producer(currEngType.v()).nodeAnnId() != + dependencyParams(currBatch).annotationId()) + { + gLogInfo << "consumer id " << consumer->dependencyParams(currBatch).producer(currEngType.v()).nodeAnnId() + << " and producer id " << dependencyParams(currBatch).annotationId() << endl; + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Consumer %s and Producer %s don't form " + "the right pair", consumer->name().c_str(), name().c_str()); + } + if(consumer->dependencyParams(currBatch).producer(currEngType.v()).opEvent().e() != + consOpEvent.e()) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Consumer %s and Producer %s don't form " + "the right pair with same op events", consumer->name().c_str(), name().c_str()); + } + } + producer = dependencyParams(currBatch).producer(et).node(); + prodOpEvent = dependencyParams(currBatch).producer(et).opEvent(); + if (producer == this) + { + if(producer->dependencyParams(prevBatch).consumer(currEngType.v()).nodeAnnId() != + dependencyParams(currBatch).annotationId()) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Consumer %s and Producer %s don't form " + "the right pair", name().c_str(), producer->name().c_str()); + } + if(producer->dependencyParams(prevBatch).consumer(currEngType.v()).opEvent().e() != + prodOpEvent.e()) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Consumer %s and Producer %s don't form " + "the right pair with same op events", name().c_str(), producer->name().c_str()); + } + } + else if (producer != NULL) + { + if(producer->dependencyParams(currBatch).consumer(currEngType.v()).nodeAnnId() != + dependencyParams(currBatch).annotationId()) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Consumer %s and Producer %s don't form " + "the right pair", name().c_str(), producer->name().c_str()); + } + if(producer->dependencyParams(currBatch).consumer(currEngType.v()).opEvent().e() != + prodOpEvent.e()) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Consumer %s and Producer %s don't form " + "the right pair with same op events", name().c_str(), producer->name().c_str()); + } + } + } + } + +fail: + return e; +} + +//---------------------------------------------------------------------- +// Code Emission Utils +//---------------------------------------------------------------------- +NvDlaError engine_ast::Node::emitOp(engine_ast::Graph *g, + DLAInterface *dla_if, + NvU32 op_slot, NvU32 batch_id, + DLACommonOpDescAccessor dep_acc, + DLAOperationContainerAccessor op_acc, + DLASurfaceContainerAccessor surf_acc) +{ + NvDlaError e = NvDlaSuccess; + NVDLA_UNUSED(g); + NVDLA_UNUSED(dep_acc); + NVDLA_UNUSED(dla_if); + NVDLA_UNUSED(op_slot); + NVDLA_UNUSED(batch_id); + NVDLA_UNUSED(op_acc); + NVDLA_UNUSED(surf_acc); + + // If you see this message then something is tbd or bugged. + ORIGINATE_ERROR_FAIL(NvDlaError_InvalidState, + "hit bare Node::emitOp! engine_type=%s engine_op_type=%s\n", + m_engine_type.c_str(), m_engine_op_type.c_str()); + fail: + return e; +} + +NvDlaError engine_ast::Node::emitOp(engine_ast::Graph *g, + EMUInterface *emu_if, + NvU32 op_slot, NvU32 batch_id, + EMUOperationContainerAccessor op_acc, + EMUOperationBufferContainerAccessor buf_acc) +{ + NvDlaError e = NvDlaSuccess; + NVDLA_UNUSED(g); + NVDLA_UNUSED(emu_if); + NVDLA_UNUSED(op_slot); + NVDLA_UNUSED(batch_id); + NVDLA_UNUSED(op_acc); + NVDLA_UNUSED(buf_acc); + + // If you see this message then something is tbd or bugged. + ORIGINATE_ERROR_FAIL(NvDlaError_InvalidState, + "hit bare Node::emitOp! engine_type=%s engine_op_type=%s\n", + m_engine_type.c_str(), m_engine_op_type.c_str()); + + fail: + return e; +} + + +}; // nvdla::privs:: +}; // nvdla:: diff --git a/umd/core/src/compiler/engine-ast/EngineNodeFactory.cpp b/umd/core/src/compiler/engine-ast/EngineNodeFactory.cpp new file mode 100644 index 00000000..d7540be4 --- /dev/null +++ b/umd/core/src/compiler/engine-ast/EngineNodeFactory.cpp @@ -0,0 +1,1006 @@ +/* + * Copyright (c) 2018-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#include "priv/EngineAST.h" +#include "priv/Profile.h" +#include "priv/WeightTranslationUnit.h" + +using std::map; +using std::string; +using std::endl; + +namespace nvdla +{ + +namespace priv +{ + +// explicitly instantiate the priv maps of each node type +map engine_ast::NodeFactory::s_conv_conv_priv = + map(); + +map engine_ast::NodeFactory::s_conv_fc_priv = + map(); + +map engine_ast::NodeFactory::s_conv_deconv_priv = + map(); + +map engine_ast::NodeFactory::s_sdp_scale_priv = + map(); + +map engine_ast::NodeFactory::s_sdp_bn_priv = + map(); + +map engine_ast::NodeFactory::s_sdp_act_priv = + map(); + +map engine_ast::NodeFactory::s_sdp_ew_priv = + map(); + +map engine_ast::NodeFactory::s_sdp_bias_priv = + map(); + +map engine_ast::NodeFactory::s_sdp_nop_priv = + map(); + +map engine_ast::NodeFactory::s_sdp_super_priv = + map(); + +map engine_ast::NodeFactory::s_pdp_priv = + map(); + +map engine_ast::NodeFactory::s_cdp_lrn_priv = + map(); + +map engine_ast::NodeFactory::s_cpu_scale_priv = + map(); + +map engine_ast::NodeFactory::s_cpu_sm_priv = + map(); + +map engine_ast::NodeFactory::s_rubik_priv = + map(); + +map engine_ast::NodeFactory::s_concat_priv = + map(); + +map engine_ast::NodeFactory::s_split_priv = + map(); + +map engine_ast::NodeFactory::s_single_bdma_priv = + map(); + +map engine_ast::NodeFactory::s_group_bdma_priv = + map(); + +map engine_ast::NodeFactory::s_multi_ops_priv = + map(); + +void engine_ast::NodeFactory::clearMaps(void) +{ + s_conv_conv_priv.clear(); + s_conv_fc_priv.clear(); + s_conv_deconv_priv.clear(); + s_sdp_scale_priv.clear(); + s_sdp_bn_priv.clear(); + s_sdp_act_priv.clear(); + s_sdp_ew_priv.clear(); + s_sdp_bias_priv.clear(); + s_sdp_nop_priv.clear(); + s_sdp_super_priv.clear(); + s_pdp_priv.clear(); + s_cdp_lrn_priv.clear(); + s_cpu_scale_priv.clear(); + s_cpu_sm_priv.clear(); + s_rubik_priv.clear(); + s_concat_priv.clear(); + s_split_priv.clear(); + s_single_bdma_priv.clear(); + s_group_bdma_priv.clear(); + s_multi_ops_priv.clear(); +} + +// +// All the variants of these sup-op node creators are +// needed because the s_xx_yy_priv maps to lock them into +// are different. can't templatize them +// +engine_ast::ConvCoreConvolutionOpNode* engine_ast::NodeFactory::newConvCoreConvolutionOpNode +( + canonical_ast::ConvolutionNode* origCanNode, + engine_ast::Graph* engGraph +) +{ + typedef typename engine_ast::Node* B; + typedef typename engine_ast::ConvCoreConvolutionOpNode* DD; + + B b; + DD dd; + NvU16 numBatches = engGraph->profile()->multiBatchSize(); + + b = dd = new engine_ast::ConvCoreConvolutionOpNode(origCanNode, numBatches); + dd->setId(engGraph->nextNodeId()); + dd->setGraph(engGraph); + dd->captureCanonicalParams(); + engGraph->insertNode(b); + + // determine op mode for the conv op: DC / WINOGRAD + WeightTrns::WeightDims weightDims (dd->params().rawWeights().count, + dd->params().weightDims().n, + dd->params().weightDims().c, + dd->params().weightDims().w, + dd->params().weightDims().h, + dd->params().stride().w, + dd->params().stride().h); + // fixme: disable winograd with group conv since group conv tends to bloat weight size + // by a factor of 'inputC / auxC' which can be arbitrarily large to fit in CBUFF + bool canWG = engGraph->profile()->canWinograd(); + bool isWGPossible = WeightTrns::isWGPossible(weightDims); + bool isGroupConv = dd->params().numGroups() > 1; + bool isDilation = dd->params().dilation() != Dims2(1,1); + bool isInt8 = engGraph->profile()->computePrecision().v() == + surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8; + if ( canWG && isWGPossible && !isGroupConv && !isDilation && !isInt8 ) + { + dd->setName(std::string("wg-conv-") + toString(s_conv_conv_priv.size())); + dd->params().setConvMode(engine_ast::ConvolutionModeEnum::CONV_WINOGRAD); + } + else + { + dd->setName(std::string("dc-conv-") + toString(s_conv_conv_priv.size())); + dd->params().setConvMode(engine_ast::ConvolutionModeEnum::CONV_DIRECT); + } + + s_conv_conv_priv.insert(std::pair(b, dd)); + return dd; +} + +engine_ast::ConvCoreFullyConnectedOpNode* engine_ast::NodeFactory::newConvCoreFullyConnectedOpNode +( + canonical_ast::FullyConnectedNode* origCanNode, + engine_ast::Graph* engGraph +) +{ + typedef typename engine_ast::Node* B; + typedef typename engine_ast::ConvCoreFullyConnectedOpNode* DD; + + B b; + DD dd; + NvU16 numBatches = engGraph->profile()->multiBatchSize(); + + b = dd = new engine_ast::ConvCoreFullyConnectedOpNode(origCanNode, numBatches); + dd->setName(std::string("fc-") + toString(s_conv_fc_priv.size())); + dd->setId(engGraph->nextNodeId()); + dd->setGraph(engGraph); + dd->captureCanonicalParams(); + engGraph->insertNode(b); + + dd->params().setConvMode(engine_ast::ConvolutionModeEnum::CONV_DIRECT); + + s_conv_fc_priv.insert(std::pair(b, dd)); + return dd; +} + +engine_ast::ConvCoreDeconvolutionOpNode* engine_ast::NodeFactory::newConvCoreDeconvolutionOpNode +( + canonical_ast::DeconvolutionNode* origCanNode, + engine_ast::Graph* engGraph +) +{ + typedef typename engine_ast::Node* B; + typedef typename engine_ast::ConvCoreDeconvolutionOpNode* DD; + + B b; + DD dd; + NvU16 numBatches = engGraph->profile()->multiBatchSize(); + + b = dd = new engine_ast::ConvCoreDeconvolutionOpNode(origCanNode, numBatches); + dd->setName(std::string("deconv-") + toString(s_conv_deconv_priv.size())); + dd->setId(engGraph->nextNodeId()); + dd->setGraph(engGraph); + dd->captureCanonicalParams(); + engGraph->insertNode(b); + + dd->params().setConvMode(engine_ast::ConvolutionModeEnum::CONV_DIRECT); + + s_conv_deconv_priv.insert(std::pair(b, dd)); + return dd; +} + +engine_ast::SDPActivationOpNode* engine_ast::NodeFactory::newSDPActivationOpNode +( + canonical_ast::ActivationNode* origCanNode, + engine_ast::Graph* engGraph +) +{ + typedef typename engine_ast::Node* B; + typedef typename engine_ast::SDPActivationOpNode* DD; + + B b; + DD dd; + NvU16 numBatches = engGraph->profile()->multiBatchSize(); + + b = dd = new engine_ast::SDPActivationOpNode(origCanNode, numBatches); + dd->setName(std::string("act-") + toString(s_sdp_act_priv.size())); + dd->setId(engGraph->nextNodeId()); + dd->setGraph(engGraph); + engGraph->insertNode(b); + + if (origCanNode) + { + // those SDP-Act ops added in engine-land to circumvent DLA limitations or + // to improve DLA performance may not have a canonical node equivalent + dd->captureCanonicalParams(); + } + + s_sdp_act_priv.insert(std::pair(b, dd)); + return dd; +} + +engine_ast::SDPScaleOpNode* engine_ast::NodeFactory::newSDPScaleOpNode +( + canonical_ast::ScaleNode* origCanNode, + engine_ast::Graph* engGraph +) +{ + typedef typename engine_ast::Node* B; + typedef typename engine_ast::SDPScaleOpNode* DD; + + B b; + DD dd; + NvU16 numBatches = engGraph->profile()->multiBatchSize(); + + b = dd = new engine_ast::SDPScaleOpNode(origCanNode, numBatches); + dd->setName(std::string("sdp-scale-") + toString(s_sdp_scale_priv.size())); + dd->setId(engGraph->nextNodeId()); + dd->setGraph(engGraph); + engGraph->insertNode(b); + + if (origCanNode) + { + // those SDP-SCALE ops added in engine-land to circumvent DLA limitations or + // to improve DLA performance may not have a canonical node equivalent + dd->captureCanonicalParams(); + } + + s_sdp_scale_priv.insert(std::pair(b, dd)); + return dd; +} + +engine_ast::SDPBatchNormOpNode* engine_ast::NodeFactory::newSDPBatchNormOpNode +( + canonical_ast::BatchNormNode* origCanNode, + engine_ast::Graph* engGraph +) +{ + typedef typename engine_ast::Node* B; + typedef typename engine_ast::SDPBatchNormOpNode* DD; + + B b; + DD dd; + NvU16 numBatches = engGraph->profile()->multiBatchSize(); + + b = dd = new engine_ast::SDPBatchNormOpNode(origCanNode, numBatches); + dd->setName(std::string("sdp-bn-") + toString(s_sdp_bn_priv.size())); + dd->setId(engGraph->nextNodeId()); + dd->setGraph(engGraph); + if (origCanNode) + { + // those SDP-BN ops added in engine-land to circumvent DLA limitations or + // to improve DLA performance may not have a canonical node equivalent + dd->captureCanonicalParams(); + } + engGraph->insertNode(b); + + s_sdp_bn_priv.insert(std::pair(b, dd)); + return dd; +} + +engine_ast::SDPElementWiseOpNode* engine_ast::NodeFactory::newSDPElementWiseOpNode +( + canonical_ast::ElementWiseNode* origCanNode, + engine_ast::Graph* engGraph +) +{ + typedef typename engine_ast::Node* B; + typedef typename engine_ast::SDPElementWiseOpNode* DD; + + B b; + DD dd; + NvU16 numBatches = engGraph->profile()->multiBatchSize(); + + b = dd = new engine_ast::SDPElementWiseOpNode(origCanNode, numBatches); + dd->setName(std::string("ew-") + toString(s_sdp_ew_priv.size())); + dd->setId(engGraph->nextNodeId()); + dd->setGraph(engGraph); + dd->captureCanonicalParams(); + engGraph->insertNode(b); + + s_sdp_ew_priv.insert(std::pair(b, dd)); + return dd; +} + +engine_ast::SDPBiasOpNode* engine_ast::NodeFactory::newSDPBiasOpNode +( + canonical_ast::Node* origCanNode, + engine_ast::Graph* engGraph +) +{ + typedef typename engine_ast::Node* B; + typedef typename engine_ast::SDPBiasOpNode* DD; + + B b; + DD dd; + NvU16 numBatches = engGraph->profile()->multiBatchSize(); + + + b = dd = new engine_ast::SDPBiasOpNode(origCanNode, numBatches); + dd->setName(std::string("bias-") + toString(s_sdp_bias_priv.size())); + dd->setId(engGraph->nextNodeId()); + dd->setGraph(engGraph); + engGraph->insertNode(b); + + if (origCanNode) + { + // those SDP-Bias ops added in engine-land to circumvent DLA limitations or + // to improve DLA performance may not have a canonical node equivalent + dd->captureCanonicalParams(); + } + + s_sdp_bias_priv.insert(std::pair(b, dd)); + + return dd; +} + +engine_ast::SDPNOPNode* engine_ast::NodeFactory::newSDPNOPNode +( + canonical_ast::Node* origCanNode, + engine_ast::Graph* engGraph +) +{ + typedef typename engine_ast::Node* B; + typedef typename engine_ast::SDPNOPNode* DD; + + B b; + DD dd; + NvU16 numBatches = engGraph->profile()->multiBatchSize(); + + b = dd = new engine_ast::SDPNOPNode(origCanNode, numBatches); + dd->setName(std::string("sdp-nop-") + toString(s_sdp_nop_priv.size())); + dd->setId(engGraph->nextNodeId()); + dd->setGraph(engGraph); + dd->captureCanonicalParams(); + engGraph->insertNode(b); + + if (origCanNode) + { + dd->captureCanonicalParams(); + } + + s_sdp_nop_priv.insert(std::pair(b, dd)); + + return dd; +} + +engine_ast::SDPSuperOpNode* engine_ast::NodeFactory::newSDPSuperOpNode +( + canonical_ast::Node* origCanNode, + engine_ast::Graph* engGraph +) +{ + typedef typename engine_ast::Node* B; + typedef typename engine_ast::SDPSuperOpNode* DD; + + B b; + DD dd; + NvU16 numBatches = engGraph->profile()->multiBatchSize(); + + b = dd = new engine_ast::SDPSuperOpNode(origCanNode, numBatches); + dd->setName(std::string("sdp-super-") + toString(s_sdp_super_priv.size())); + dd->setId(engGraph->nextNodeId()); + dd->setGraph(engGraph); + engGraph->insertNode(b); + + if (origCanNode) + { + // There may not be a cannonical equivalent + dd->captureCanonicalParams(); + } + + s_sdp_super_priv.insert(std::pair(b, dd)); + + return dd; +} + +engine_ast::PDPNode* engine_ast::NodeFactory::newPDPNode +( + canonical_ast::PoolingNode* origCanNode, + engine_ast::Graph* engGraph +) +{ + typedef typename engine_ast::Node* B; + typedef typename engine_ast::PDPNode* D; + + B b; + D d; + NvU16 numBatches = engGraph->profile()->multiBatchSize(); + + b = d = new engine_ast::PDPNode(origCanNode, numBatches); + d->setName(std::string("pdp-") + toString(s_pdp_priv.size())); + d->setId(engGraph->nextNodeId()); + d->setGraph(engGraph); + d->captureCanonicalParams(); + engGraph->insertNode(b); + + s_pdp_priv.insert(std::pair(b, d)); + return d; +} + +engine_ast::CDPLRNOpNode* engine_ast::NodeFactory::newCDPLRNOpNode +( + canonical_ast::LRNNode* origCanNode, + engine_ast::Graph* engGraph +) +{ + typedef typename engine_ast::Node* B; + typedef typename engine_ast::CDPLRNOpNode* D; + + B b; + D d; + NvU16 numBatches = engGraph->profile()->multiBatchSize(); + + b = d = new engine_ast::CDPLRNOpNode(origCanNode, numBatches); + d->setName(std::string("cdp-lrn-") + toString(s_cdp_lrn_priv.size())); + d->setId(engGraph->nextNodeId()); + d->setGraph(engGraph); + d->captureCanonicalParams(); + engGraph->insertNode(b); + + s_cdp_lrn_priv.insert(std::pair(b, d)); + return d; +} + +engine_ast::CPUScaleOpNode* engine_ast::NodeFactory::newCPUScaleOpNode +( + canonical_ast::ScaleNode* origCanNode, + engine_ast::Graph* engGraph +) +{ + typedef typename engine_ast::Node* B; + typedef typename engine_ast::CPUScaleOpNode* DD; + + B b; + DD dd; + NvU16 numBatches = engGraph->profile()->multiBatchSize(); + + b = dd = new engine_ast::CPUScaleOpNode(origCanNode, numBatches); + dd->setName(std::string("cpu-scale-") + toString(s_cpu_scale_priv.size())); + dd->setId(engGraph->nextNodeId()); + dd->setGraph(engGraph); + dd->captureCanonicalParams(); + engGraph->insertNode(b); + + s_cpu_scale_priv.insert(std::pair(b, dd)); + return dd; +} + +engine_ast::CPUSoftMaxOpNode* engine_ast::NodeFactory::newCPUSoftMaxOpNode +( + canonical_ast::SoftMaxNode* origCanNode, + engine_ast::Graph* engGraph +) +{ + typedef typename engine_ast::Node* B; + typedef typename engine_ast::CPUSoftMaxOpNode* DD; + + B b; + DD dd; + NvU16 numBatches = engGraph->profile()->multiBatchSize(); + + b = dd = new engine_ast::CPUSoftMaxOpNode(origCanNode, numBatches); + dd->setName(std::string("cpu-sm-") + toString(s_cpu_sm_priv.size())); + dd->setId(engGraph->nextNodeId()); + dd->setGraph(engGraph); + dd->captureCanonicalParams(); + engGraph->insertNode(b); + + s_cpu_sm_priv.insert(std::pair(b, dd)); + return dd; +} + +engine_ast::RubikNode* engine_ast::NodeFactory::newRubikNode +( + canonical_ast::DeconvolutionNode* origCanNode, + engine_ast::Graph* engGraph +) +{ + typedef typename engine_ast::Node* B; + typedef typename engine_ast::RubikNode* D; + + B b; + D d; + NvU16 numBatches = engGraph->profile()->multiBatchSize(); + + b = d = new engine_ast::RubikNode(origCanNode, numBatches); + d->setName(std::string("rubik-") + toString(s_rubik_priv.size())); + d->setId(engGraph->nextNodeId()); + d->setGraph(engGraph); + d->captureCanonicalParams(); + engGraph->insertNode(b); + + s_rubik_priv.insert(std::pair(b, d)); + return d; +} + +engine_ast::ConcatenationNode* engine_ast::NodeFactory::newConcatNode +( + canonical_ast::ConcatenationNode* origCanNode, + engine_ast::Graph* engGraph +) +{ + typedef typename engine_ast::Node* B; + typedef typename engine_ast::ConcatenationNode* D; + + B b; + D d; + NvU16 numBatches = engGraph->profile()->multiBatchSize(); + + b = d = new engine_ast::ConcatenationNode(origCanNode, numBatches); + d->setName(std::string("concat-") + toString(s_concat_priv.size())); + d->setId(engGraph->nextNodeId()); + d->setGraph(engGraph); + d->captureCanonicalParams(); + engGraph->insertNode(b); + + s_concat_priv.insert(std::pair(b, d)); + return d; +} + +engine_ast::SplitNode* engine_ast::NodeFactory::newSplitNode +( + canonical_ast::SplitNode* origCanNode, + engine_ast::Graph* engGraph +) +{ + typedef typename engine_ast::Node* B; + typedef typename engine_ast::SplitNode* D; + + B b; + D d; + NvU16 numBatches = engGraph->profile()->multiBatchSize(); + + b = d = new engine_ast::SplitNode(origCanNode, numBatches); + d->setName(std::string("split-") + toString(s_split_priv.size())); + d->setId(engGraph->nextNodeId()); + d->setGraph(engGraph); + d->captureCanonicalParams(); + engGraph->insertNode(b); + + s_split_priv.insert(std::pair(b, d)); + return d; +} + +engine_ast::BDMASingleDMAOpNode* engine_ast::NodeFactory::newSingleBDMANode +( + engine_ast::Graph* engGraph +) +{ + typedef typename engine_ast::Node* B; + typedef typename engine_ast::BDMASingleDMAOpNode* DD; + + B b ; + DD dd; + + b = dd = new engine_ast::BDMASingleDMAOpNode(); + dd->setName(std::string("single-bdma-") + toString(s_single_bdma_priv.size())); + dd->setId(engGraph->nextNodeId()); + dd->setGraph(engGraph); + engGraph->insertNode(b); + + s_single_bdma_priv.insert(std::pair(b, dd)); + return dd; +} + +engine_ast::BDMAGroupDMAOpNode* engine_ast::NodeFactory::newGroupBDMANode +( + engine_ast::Graph* engGraph +) +{ + typedef typename engine_ast::Node* B; + typedef typename engine_ast::BDMAGroupDMAOpNode* DD; + + B b ; + DD dd; + + b = dd = new engine_ast::BDMAGroupDMAOpNode(); + dd->setName(std::string("group-bdma-") + toString(s_group_bdma_priv.size())); + dd->setId(engGraph->nextNodeId()); + dd->setGraph(engGraph); + engGraph->insertNode(b); + + s_group_bdma_priv.insert(std::pair(b, dd)); + return dd; +} + +engine_ast::MultiOpsNode* engine_ast::NodeFactory::newMultiOpsNode +( + engine_ast::Graph::NodeSequence& groupedOps, + engine_ast::Graph* engGraph +) +{ + typedef typename engine_ast::Node* B; + typedef typename engine_ast::MultiOpsNode* D; + + B b; + D d; + NvU16 numBatches = engGraph->profile()->multiBatchSize(); + + b = d = new engine_ast::MultiOpsNode(numBatches); + d->setName(std::string("multi-ops-") + toString(s_multi_ops_priv.size())); + d->setId(engGraph->nextNodeId()); + d->setGraph(engGraph); + engGraph->insertNode(b); + + s_multi_ops_priv.insert(std::pair(b,d)); + + // embed nested graph inside the super node + d->setNestedGraph(new NestedGraph()); + d->nestedGraph()->setContainingSuperNode(b); + d->nestedGraph()->populateNestedGraph(groupedOps); + d->setIsOnline(true); + + // mark input/output edges of the multi-op super node + d->populateEdgePorts(); + + return d; +} + +namespace engine_ast +{ + +template <> engine_ast::ConvCoreConvolutionOpNode* NodeFactory::nodeCast(engine_ast::Node* base) +{ + engine_ast::ConvCoreConvolutionOpNode* nc = NULL; + if (!base) + return nc; + map::iterator i = s_conv_conv_priv.find(base); + if ( i == s_conv_conv_priv.end() ) + goto done; + else + nc = i->second; +done: + return nc; +} + +template <> engine_ast::ConvCoreFullyConnectedOpNode* NodeFactory::nodeCast(engine_ast::Node* base) +{ + engine_ast::ConvCoreFullyConnectedOpNode* nc = NULL; + if (!base) + return nc; + map::iterator i = s_conv_fc_priv.find(base); + if ( i == s_conv_fc_priv.end() ) + goto done; + else + nc = i->second; +done: + return nc; +} + +template <> engine_ast::ConvCoreDeconvolutionOpNode* NodeFactory::nodeCast(engine_ast::Node* base) +{ + engine_ast::ConvCoreDeconvolutionOpNode* nc = NULL; + if (!base) + return nc; + map::iterator i = s_conv_deconv_priv.find(base); + if ( i == s_conv_deconv_priv.end() ) + goto done; + else + nc = i->second; +done: + return nc; +} + + +template <> engine_ast::ConvCoreNode* NodeFactory::nodeCast(engine_ast::Node* base) +{ + engine_ast::ConvCoreNode* nc = NULL; + if (!base) + return nc; + switch(base->engineOpType().v()) { + case EngineOpTypeEnum::CONVOLUTION_CONV: nc = nodeCast(base); break; + case EngineOpTypeEnum::CONVOLUTION_DECONV: nc = nodeCast(base); break; + case EngineOpTypeEnum::CONVOLUTION_FC: nc = nodeCast(base); break; + default: goto done; + } + +done: + return nc; +} + + +template <> engine_ast::SDPActivationOpNode* NodeFactory::nodeCast(engine_ast::Node* base) +{ + engine_ast::SDPActivationOpNode* nc = NULL; + if (!base) + return nc; + map::iterator i = s_sdp_act_priv.find(base); + if ( i == s_sdp_act_priv.end() ) + goto done; + else + nc = i->second; +done: + return nc; +} + +template <> engine_ast::SDPBiasOpNode* NodeFactory::nodeCast(engine_ast::Node* base) +{ + engine_ast::SDPBiasOpNode* nc = NULL; + if (!base) + return nc; + map::iterator i = s_sdp_bias_priv.find(base); + if ( i == s_sdp_bias_priv.end() ) + goto done; + else + nc = i->second; +done: + return nc; +} + +template <> engine_ast::SDPNOPNode* NodeFactory::nodeCast(engine_ast::Node* base) +{ + engine_ast::SDPNOPNode* nc = NULL; + if (!base) + return nc; + map::iterator i = s_sdp_nop_priv.find(base); + if ( i == s_sdp_nop_priv.end() ) + goto done; + else + nc = i->second; +done: + return nc; +} + +template <> engine_ast::SDPSuperOpNode* NodeFactory::nodeCast(engine_ast::Node* base) +{ + engine_ast::SDPSuperOpNode* nc = NULL; + map::iterator i = s_sdp_super_priv.find(base); + if ( i == s_sdp_super_priv.end() ) + goto done; + else + nc = i->second; +done: + return nc; +} + +template <> engine_ast::SDPScaleOpNode* NodeFactory::nodeCast(engine_ast::Node* base) +{ + engine_ast::SDPScaleOpNode* nc = NULL; + if (!base) + return nc; + map::iterator i = s_sdp_scale_priv.find(base); + if ( i == s_sdp_scale_priv.end() ) + goto done; + else + nc = i->second; +done: + return nc; +} + +template <> engine_ast::SDPBatchNormOpNode* NodeFactory::nodeCast(engine_ast::Node* base) +{ + engine_ast::SDPBatchNormOpNode* nc = NULL; + if (!base) + return nc; + map::iterator i = s_sdp_bn_priv.find(base); + if ( i == s_sdp_bn_priv.end() ) + goto done; + else + nc = i->second; +done: + return nc; +} + +template <> engine_ast::SDPElementWiseOpNode* NodeFactory::nodeCast(engine_ast::Node* base) +{ + engine_ast::SDPElementWiseOpNode* nc = NULL; + if (!base) + return nc; + map::iterator i = s_sdp_ew_priv.find(base); + if ( i == s_sdp_ew_priv.end() ) + goto done; + else + nc = i->second; +done: + return nc; +} + + +template <> engine_ast::SDPNode* NodeFactory::nodeCast(engine_ast::Node* base) +{ + engine_ast::SDPNode* nc = NULL; + if (!base) + return nc; + switch(base->engineOpType().v()) { + case EngineOpTypeEnum::SDP_ACTIVATION: nc = nodeCast(base); break; + case EngineOpTypeEnum::SDP_BIAS: nc = nodeCast(base); break; + case EngineOpTypeEnum::SDP_ELEMENTWISE: nc = nodeCast(base); break; + case EngineOpTypeEnum::SDP_NOP: nc = nodeCast(base); break; + case EngineOpTypeEnum::SDP_SCALE: nc = nodeCast(base); break; + case EngineOpTypeEnum::SDP_BATCH_NORM: nc = nodeCast(base); break; + case EngineOpTypeEnum::SDP_SUPER: nc = nodeCast(base); break; + default: goto done; + } + +done: + return nc; +} + +template <> engine_ast::PDPNode* NodeFactory::nodeCast(engine_ast::Node* base) +{ + engine_ast::PDPNode* nc = NULL; + if (!base) + return nc; + map::iterator i = s_pdp_priv.find(base); + if ( i == s_pdp_priv.end() ) + goto done; + else + nc = i->second; +done: + return nc; +} + +template <> engine_ast::CDPLRNOpNode* NodeFactory::nodeCast(engine_ast::Node* base) +{ + engine_ast::CDPLRNOpNode* nc = NULL; + if (!base) + return nc; + map::iterator i = s_cdp_lrn_priv.find(base); + if ( i == s_cdp_lrn_priv.end() ) + goto done; + else + nc = i->second; +done: + return nc; +} + +template <> engine_ast::CPUScaleOpNode* NodeFactory::nodeCast(engine_ast::Node* base) +{ + engine_ast::CPUScaleOpNode* nc = NULL; + if (!base) + return nc; + map::iterator i = s_cpu_scale_priv.find(base); + if ( i == s_cpu_scale_priv.end() ) + goto done; + else + nc = i->second; +done: + return nc; +} + +template <> engine_ast::CPUSoftMaxOpNode* NodeFactory::nodeCast(engine_ast::Node* base) +{ + engine_ast::CPUSoftMaxOpNode* nc = NULL; + if (!base) + return nc; + map::iterator i = s_cpu_sm_priv.find(base); + if ( i == s_cpu_sm_priv.end() ) + goto done; + else + nc = i->second; +done: + return nc; +} + +template <> engine_ast::RubikNode* NodeFactory::nodeCast(engine_ast::Node* base) +{ + engine_ast::RubikNode* nc = NULL; + if (!base) + return nc; + map::iterator i = s_rubik_priv.find(base); + if ( i == s_rubik_priv.end() ) + goto done; + else + nc = i->second; +done: + return nc; +} + +template <> engine_ast::ConcatenationNode* NodeFactory::nodeCast(engine_ast::Node* base) +{ + engine_ast::ConcatenationNode* nc = NULL; + if (!base) + return nc; + map::iterator i = s_concat_priv.find(base); + if ( i == s_concat_priv.end() ) + goto done; + else + nc = i->second; +done: + return nc; +} + +template <> engine_ast::SplitNode* NodeFactory::nodeCast(engine_ast::Node* base) +{ + engine_ast::SplitNode* nc = NULL; + if (!base) + return nc; + map::iterator i = s_split_priv.find(base); + if ( i == s_split_priv.end() ) + goto done; + else + nc = i->second; +done: + return nc; +} + +template <> engine_ast::BDMASingleDMAOpNode* NodeFactory::nodeCast(engine_ast::Node* base) +{ + engine_ast::BDMASingleDMAOpNode* nc = NULL; + if (!base) + return nc; + map::iterator i = s_single_bdma_priv.find(base); + if ( i == s_single_bdma_priv.end() ) + goto done; + else + nc = i->second; +done: + return nc; +} + +template <> engine_ast::BDMAGroupDMAOpNode* NodeFactory::nodeCast(engine_ast::Node* base) +{ + engine_ast::BDMAGroupDMAOpNode* nc = NULL; + if (!base) + return nc; + map::iterator i = s_group_bdma_priv.find(base); + if ( i == s_group_bdma_priv.end() ) + goto done; + else + nc = i->second; +done: + return nc; +} + +template <> engine_ast::MultiOpsNode* NodeFactory::nodeCast(engine_ast::Node* base) +{ + engine_ast::MultiOpsNode* nc = NULL; + if (!base) + return nc; + map::iterator i = s_multi_ops_priv.find(base); + if ( i == s_multi_ops_priv.end() ) + goto done; + else + nc = i->second; +done: + return nc; +} + +}; // nvdla::priv::engine_ast + +}; // nvdla::priv +}; // nvdla:: diff --git a/umd/core/src/compiler/engine-ast/FullyConnectedOp.cpp b/umd/core/src/compiler/engine-ast/FullyConnectedOp.cpp new file mode 100644 index 00000000..7c3bda47 --- /dev/null +++ b/umd/core/src/compiler/engine-ast/FullyConnectedOp.cpp @@ -0,0 +1,477 @@ +/* + * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#include + +#include "priv/EngineAST.h" +#include "priv/Profile.h" +#include "priv/Tensor.h" +#include "priv/TargetConfig.h" +#include "ErrorMacros.h" + +using std::endl; + +namespace nvdla +{ +namespace priv +{ + +void engine_ast::ConvCoreFullyConnectedOpNode::captureCanonicalParams() +{ + params().setHasBiasTerm(canonicalNode()->params().hasBiasTerm() == true ? 1 : 0); + params().setWeightDims(canonicalNode()->params().weightDims()); + // FIXME: assuming stride for FC in both directions is 1 + params().setStride(Dims2(1, 1)); + params().setRawWeights(canonicalNode()->params().weights()); + params().setDLAWeights(Weights(DataType::FLOAT, NULL, 0)); + + captureCanonicalWeights(); +} + + +NvDlaError engine_ast::ConvCoreFullyConnectedOpNode::emitOp(Graph *g, + DLAInterface *target_dla, + NvU32 op_slot, NvU32 batch_id, + DLACommonOpDescAccessor dep, + DLAOperationContainerAccessor op, + DLASurfaceContainerAccessor surf) +{ + NvDlaError e = NvDlaSuccess; + + DLAConvOpDescAccessor conv_op = op.convOpDescAccessor(0); + DLACVTParamAccessor out_cvt_acc = conv_op.outCVTAccessor(); + DLACVTParamAccessor in_cvt_acc = conv_op.inCVTAccessor(); + DLAConvSurfaceDescAccessor surf_acc = surf.convSurfaceDescAccessor(0); + DLADataCubeAccessor src_data_acc = surf_acc.srcDataAccessor(); + DLADataCubeAccessor dst_data_acc = surf_acc.dstDataAccessor(); + DLADataCubeAccessor weight_data_acc = surf_acc.weightDataAccessor(); + DLADataCubeAccessor wmb_data_acc = surf_acc.wmbDataAccessor(); + DLADataCubeAccessor wgs_data_acc = surf_acc.wgsDataAccessor(); + DLAConsumerAccessor fused_acc = dep.fusedParentAccessor(); + NVDLA_UNUSED(wmb_data_acc); + NVDLA_UNUSED(wgs_data_acc); + NVDLA_UNUSED(fused_acc); + + surface::TensorSurfaceDesc *src_tsd = g->nodeInputTensorSurface(this, 0, supportedInSurfCategories()); + surface::TensorSurfaceDesc *dst_tsd = g->nodeOutputTensorSurface(this, 0, supportedOutSurfCategories()); + surface::TensorSurfaceDesc *weight_tsd = g->nodeInputTensorSurface(this, 0, supportedAuxSurfCategories()); + + /* Parameters we don't need/care for MNIST except their safe default values*/ + *conv_op.padVal() = 0; // FIXME: assuming same padding on both dimensions + *conv_op.dataReuse() = 0; + *conv_op.weightReuse() = 0; + *conv_op.skipDataRls() = 0; + *conv_op.skipWeightRls()= 0; + *conv_op.batch() = 1; + *conv_op.batchStride() = 0; + *conv_op.release() = src_tsd->dimensions().h; + *conv_op.meanFormat() = conv_op.meanFormat_Disable(); + *conv_op.meanRY() = 0; + *conv_op.meanGU() = 0; + *conv_op.meanBV() = 0; + *conv_op.padXLeft() = 0; + *conv_op.padXRight() = 0; + *conv_op.padYTop() = 0; + *conv_op.padYBottom() = 0; + *conv_op.dilationX() = 1; + *conv_op.dilationY() = 1; + *conv_op.pixelMapping() = conv_op.pixelMapping_PitchLinear(); //default + + *in_cvt_acc.scale() = params().convCoreCVT().inputCVT().scale(); + *in_cvt_acc.truncate() = params().convCoreCVT().inputCVT().truncate(); + *in_cvt_acc.enable() = (int)params().convCoreCVT().inputCVT().isEnable(); + *in_cvt_acc.offset() = params().convCoreCVT().inputCVT().offset(); + + *out_cvt_acc.scale() = 1; + *out_cvt_acc.truncate() = params().convCoreCVT().outTruncate(); + *out_cvt_acc.enable() = 1; + *out_cvt_acc.offset() = 0; + + /* Common parameters */ + *conv_op.inPrecision() = ASTToDLAInterface::getConvCorePrecision(target_dla, src_tsd->surfaceFormat().precision()); + *conv_op.outPrecision() = ASTToDLAInterface::getConvCorePrecision(target_dla, dst_tsd->surfaceFormat().precision()); + *conv_op.fetchGrain() = 1; //FIXME: right now its max of requirements of all conv nodes in mnist + *conv_op.dataFormat() = ASTToDLAInterface::getDataFormat(target_dla, src_tsd->surfaceFormat()); + *conv_op.weightFormat() = conv_op.weightFormat_Uncompressed(); + *conv_op.convStrideX() = params(batch_id).stride().w; + *conv_op.convStrideY() = params(batch_id).stride().h; + *conv_op.inputWidthCMAC() = dst_tsd->dimensions().w; + *conv_op.inputHeightCMAC() = dst_tsd->dimensions().h; + *conv_op.bytesPerKernel() = surface::WeightDesc::bytesPerKernel(weight_tsd); + + *conv_op.convMode() = conv_op.convMode_Direct(); + *conv_op.inputWidthCSC() = src_tsd->dimensions().w; + *conv_op.inputHeightCSC() = src_tsd->dimensions().h; + *conv_op.inputChannelCSC() = src_tsd->dimensions().c; + *conv_op.kernelHeightCSC() = weight_tsd->dimensions().h; + *conv_op.kernelWidthCSC() = weight_tsd->dimensions().w; + *conv_op.kernelChannelCSC() = weight_tsd->dimensions().c; + + /* entry-per-slice & banks should be calculated after conv-mode is determined */ + params(batch_id).setConvMode(ConvolutionModeEnum::CONV_DIRECT); + *conv_op.entryPerSlice()= calculateEPS(src_tsd); + *conv_op.dataBank() = params(batch_id).dataBanksAllotted(); + *conv_op.weightBank() = params(batch_id).weightBanksAllotted(); + + emitDependencyParams(target_dla, dep, batch_id); + setDataCubeAccessor(src_data_acc, src_tsd, IODirectionEnum::INPUT, batch_id); + setDataCubeAccessor(weight_data_acc, weight_tsd, IODirectionEnum::UNKNOWN, batch_id); + setDataCubeAccessor(dst_data_acc, dst_tsd, IODirectionEnum::OUTPUT, batch_id); + + if ( g->debugOps() ) + { + gLogInfo << "FullyConnected node @ op_slot = " << op_slot << " batch_id = " << batch_id << endl; + gLogInfo << "\tsrc data loc: " << (int) *src_data_acc.type() << endl; + gLogInfo << "\tdst data loc: " << (int) *dst_data_acc.type() << endl; + gLogInfo << "\tpost y extension: " << (int)*conv_op.postExtension() << endl; + gLogInfo << "\tin_precision " << (int)*conv_op.inPrecision() << endl; + gLogInfo << "\tout_precision " << (int)*conv_op.outPrecision() << endl; + gLogInfo << "\tpad_val " << (int)*conv_op.padVal() << endl; + gLogInfo << "\tconv mode " << (int)*conv_op.convMode() << endl; + gLogInfo << "\tdata_reuse " << (int)*conv_op.dataReuse() << endl; + gLogInfo << "\tweight_reuse " << (int)*conv_op.weightReuse() << endl; + gLogInfo << "\tskip_data_rls " << (int)*conv_op.skipDataRls() << endl; + gLogInfo << "\tskip_wt_rls " << (int)*conv_op.skipWeightRls() << endl; + gLogInfo << "\teps " << *conv_op.entryPerSlice() << endl; + gLogInfo << "\tfetch_grain " << (int)*conv_op.fetchGrain() << endl; + gLogInfo << "\tdata_format " << (int)*conv_op.dataFormat() << endl; + gLogInfo << "\tpixel_mapping " << (int)*conv_op.pixelMapping() << endl; + gLogInfo << "\tbatch " << (int)*conv_op.batch() << endl; + gLogInfo << "\tweight_format " << (int)*conv_op.weightFormat() << endl; + gLogInfo << "\tb4d " << (int)*conv_op.dataBank() << endl; + gLogInfo << "\tb4w " << (int)*conv_op.weightBank() << endl; + gLogInfo << "\tbatch_stride " << (int)*conv_op.batchStride() << endl; + gLogInfo << "\trelease " << (int)*conv_op.release() << endl; + gLogInfo << "\tpost_extension " << (int)*conv_op.postExtension() << endl; + gLogInfo << "\tpixel_override " << (int)*conv_op.pixelOverride() << endl; + gLogInfo << "\tmean_format " << (int)*conv_op.meanFormat() << endl; + gLogInfo << "\tstride-x " << (int)*conv_op.convStrideX() << endl; + gLogInfo << "\tstride-y " << (int)*conv_op.convStrideY() << endl; + gLogInfo << "\tpad-left " << (int)*conv_op.padXLeft() << endl; + gLogInfo << "\tpad-top " << (int)*conv_op.padYTop() << endl; + gLogInfo << "\tpad-right " << (int)*conv_op.padXRight() << endl; + gLogInfo << "\tpad-bottom " << (int)*conv_op.padYBottom() << endl; + gLogInfo << "\tdilationx-x " << (int)*conv_op.dilationX() << endl; + gLogInfo << "\tdilation-y " << (int)*conv_op.dilationY() << endl; + gLogInfo << "\tpra_truncate " << (int)*conv_op.praTruncate() << endl; + gLogInfo << "\tinputwidthcsc " << *conv_op.inputWidthCSC() << endl; + gLogInfo << "\tinputheightcsc " << *conv_op.inputHeightCSC() << endl; + gLogInfo << "\tinputchannelcsc " << *conv_op.inputChannelCSC() << endl; + gLogInfo << "\tkernelwidthcsc " << *conv_op.kernelWidthCSC() << endl; + gLogInfo << "\tkernelheightcsc " << *conv_op.kernelHeightCSC() << endl; + gLogInfo << "\tkernelchannelcsc " << *conv_op.kernelChannelCSC() << endl; + gLogInfo << "\tinputwidthcmac " << *conv_op.inputWidthCMAC() << endl; + gLogInfo << "\tinputheightcmac " << *conv_op.inputHeightCMAC() << endl; + gLogInfo << "\tbytesperkernel " << *conv_op.bytesPerKernel() << endl; + gLogInfo << "\toffsetU " << (int)*surf_acc.offsetU() << endl; + gLogInfo << "\tdependencyCount " << (int)*dep.dependencyCount() << endl; + gLogInfo << "\tsrc tsd:" << src_tsd->id() << endl; + gLogInfo << "\tsrc addr=" << *src_data_acc.address() << endl; + gLogInfo << "\tsrc size " << *src_data_acc.size() << endl; + gLogInfo << "\tsrc width " << *src_data_acc.width() << endl; + gLogInfo << "\tsrc height " << *src_data_acc.height() << endl; + gLogInfo << "\tsrc channel " << *src_data_acc.channel() << endl; + gLogInfo << "\tsrc linestride " << *src_data_acc.lineStride() << endl; + gLogInfo << "\tsrc surfstride " << *src_data_acc.surfStride() << endl; + gLogInfo << "\tdst tsd:" << dst_tsd->id() << endl; + gLogInfo << "\tdst addr=" << *dst_data_acc.address() << endl; + gLogInfo << "\tdst size " << *dst_data_acc.size() << endl; + gLogInfo << "\tdst width " << *dst_data_acc.width() << endl; + gLogInfo << "\tdst height " << *dst_data_acc.height() << endl; + gLogInfo << "\tdst channel " << *dst_data_acc.channel() << endl; + gLogInfo << "\tdst linestride " << *dst_data_acc.lineStride() << endl; + gLogInfo << "\tdst surfstride " << *dst_data_acc.surfStride() << endl; + gLogInfo << "\twt tsd:" << weight_tsd->id() << endl; + gLogInfo << "\tweight addr=" << *weight_data_acc.address() <nodeInputTensorSurface(this, 0, supportedInSurfCategories()); + surface::TensorSurfaceDesc *dst_tsd = graph()->nodeOutputTensorSurface(this, 0, supportedOutSurfCategories()); + surface::TensorSurfaceDesc *weight_tsd = graph()->nodeInputTensorSurface(this, 0, supportedAuxSurfCategories()); + + nvdla_prototest_interface::CONVOpDesc* protoConvOpDesc = protoLayer->mutable_op_config()->mutable_conv_op(); + nvdla_prototest_interface::CONVSurfaceDesc* protoConvSurfDesc = protoLayer->mutable_surface()->mutable_conv_surface(); + nvdla_prototest_interface::DataCube* protoWtDataCube = protoConvSurfDesc->mutable_weight_data(); + nvdla_prototest_interface::DataCube* protoSrcDataCube = protoConvSurfDesc->mutable_src_data(); + nvdla_prototest_interface::DataCube* protoDstDataCube = protoConvSurfDesc->mutable_dst_data(); + + nvdla_prototest_interface::DataPrecision protoInPrec, protoOutPrec; + + protoLayer->set_index(op_slot); + protoLayer->set_roi_index(0); + protoLayer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_CONV); + protoLayer->set_dependency_count(*dep.dependencyCount()); + + /* consumers */ + for (size_t c = 0; c < EngineType::num_elements(); c++) + { + NvS8 fw_op_index = ASTToDLAInterface::getEngineType(target_dla, c); + if ( fw_op_index < 0 ) + { + continue; + } + + DLAConsumerAccessor cons_acc = dep.consumerAccessor(fw_op_index); + if (*cons_acc.index() != -1) + { + nvdla_prototest_interface::Consumer* protoConsumer = protoLayer->add_bottom(); + protoConsumer->set_index(*cons_acc.index()); + switch(c) + { + case EngineTypeEnum::BDMA : protoConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_BDMA); break; + case EngineTypeEnum::CONVOLUTION : protoConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_CONV); break; + case EngineTypeEnum::SDP : protoConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_SDP); break; + case EngineTypeEnum::PDP : protoConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_PDP); break; + case EngineTypeEnum::CDP : protoConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_CDP); break; + case EngineTypeEnum::RUBIK: protoConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_RUBIK); break; + default: ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unrecognized consumer"); + } + switch(dependencyParams().consumer(c).opEvent().v()) + { + case OperationEventTypeEnum::OP_CDMA_WEIGHT_DONE : protoConsumer->set_event(nvdla_prototest_interface::Consumer_EventType::Consumer_EventType_CDMA_WT_DONE); break; + case OperationEventTypeEnum::OP_CDMA_DATA_DONE : protoConsumer->set_event(nvdla_prototest_interface::Consumer_EventType::Consumer_EventType_CDMA_DT_DONE); break; + case OperationEventTypeEnum::OP_COMPLETED : protoConsumer->set_event(nvdla_prototest_interface::Consumer_EventType::Consumer_EventType_OP_COMPLETED); break; + case OperationEventTypeEnum::OP_ENABLED : protoConsumer->set_event(nvdla_prototest_interface::Consumer_EventType::Consumer_EventType_OP_ENABLED); break; + case OperationEventTypeEnum::OP_PROGRAMMED : protoConsumer->set_event(nvdla_prototest_interface::Consumer_EventType::Consumer_EventType_OP_PROGRAMMED); break; + default: ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unrecognized consumer event"); + } + } + } + + /* Fused operation NOP */ + + switch(src_tsd->surfaceFormat().precision().v()) + { + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_FP16 : protoInPrec = nvdla_prototest_interface::DataPrecision::PRECISION_FP16; break; + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16 : protoInPrec = nvdla_prototest_interface::DataPrecision::PRECISION_INT16; break; + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8 : protoInPrec = nvdla_prototest_interface::DataPrecision::PRECISION_INT8; break; + default: ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unrecognized input precision"); + } + + switch(dst_tsd->surfaceFormat().precision().v()) + { + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_FP16 : protoOutPrec = nvdla_prototest_interface::DataPrecision::PRECISION_FP16; break; + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16 : protoOutPrec = nvdla_prototest_interface::DataPrecision::PRECISION_INT16; break; + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8 : protoOutPrec = nvdla_prototest_interface::DataPrecision::PRECISION_INT8; break; + default: ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unrecognized output precision"); + } + + protoConvOpDesc->set_in_precision(protoInPrec); + protoConvOpDesc->set_out_precision(protoOutPrec); + protoConvOpDesc->set_pad_val(*conv_op.padVal()); + + switch(params(batch_id).convMode().v()) + { + case ConvolutionModeEnum::CONV_DIRECT: protoConvOpDesc->set_conv_mode(nvdla_prototest_interface::ConvMode::DIRECT); break; + case ConvolutionModeEnum::CONV_WINOGRAD: protoConvOpDesc->set_conv_mode(nvdla_prototest_interface::ConvMode::WINOGRAD); break; + default: ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unrecognized conv mode"); + } + + protoConvOpDesc->set_data_reuse(*conv_op.dataReuse()); + protoConvOpDesc->set_weight_reuse(*conv_op.weightReuse()); + protoConvOpDesc->set_skip_data_rls(*conv_op.skipDataRls()); + protoConvOpDesc->set_skip_weight_rls(*conv_op.skipWeightRls()); + protoConvOpDesc->set_entry_per_slice(*conv_op.entryPerSlice()); + protoConvOpDesc->set_fetch_grain(*conv_op.fetchGrain()); + + switch(src_tsd->surfaceFormat().v()) + { + case surface::SurfaceFormatEnum::NVDLA_IMG_R8: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_R8); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_R10: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_R10); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_R12: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_R12); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_R16: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_R16); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_R16_I: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_R16_I); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_R16_F: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_R16_F); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_A16B16G16R16: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_A16B16G16R16); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_X16B16G16R16: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_X16B16G16R16); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_A16B16G16R16_F: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_A16B16G16R16_F); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_A16Y16U16V16: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_A16Y16U16V16); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_V16U16Y16A16: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_V16U16Y16A16); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_A16Y16U16V16_F: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_A16Y16U16V16_F); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_A8B8G8R8: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_A8B8G8R8); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_A8R8G8B8: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_A8R8G8B8); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_B8G8R8A8: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_B8G8R8A8); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_R8G8B8A8: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_R8G8B8A8); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_X8B8G8R8: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_X8B8G8R8); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_X8R8G8B8: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_X8R8G8B8); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_B8G8R8X8: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_B8G8R8X8); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_R8G8B8X8: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_R8G8B8X8); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_A2B10G10R10: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_A2B10G10R10); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_A2R10G10B10: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_A2R10G10B10); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_B10G10R10A2: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_B10G10R10A2); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_R10G10B10A2: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_R10G10B10A2); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_A2Y10U10V10: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_A2Y10U10V10); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_V10U10Y10A2: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_V10U10Y10A2); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_A8Y8U8V8: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_A8Y8U8V8); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_V8U8Y8A8: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_V8U8Y8A8); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_Y8___U8V8_N444: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_Y8___U8V8_N444); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_Y8___V8U8_N444: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_Y8___V8U8_N444); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_Y10___U10V10_N444: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_Y10___U10V10_N444); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_Y10___V10U10_N444: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_Y10___V10U10_N444); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_Y12___U12V12_N444: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_Y12___U12V12_N444); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_Y12___V12U12_N444: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_Y12___V12U12_N444); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_Y16___U16V16_N444: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_Y16___U16V16_N444); break; + case surface::SurfaceFormatEnum::NVDLA_IMG_Y16___V16U16_N444: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_T_Y16___V16U16_N444); break; + case surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_INT8: + case surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_INT16: + case surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_FP16: protoConvOpDesc->set_data_format(nvdla_prototest_interface::DataFormat::FORMAT_FEATURE); break; + default: REPORT_ERROR(NvDlaError_BadParameter, "Unsupported surface format provided %s", src_tsd->surfaceFormat().c_str()); + } + + protoConvOpDesc->mutable_in_cvt()->set_enable(*in_cvt_acc.enable()); + protoConvOpDesc->mutable_in_cvt()->set_truncate(*in_cvt_acc.truncate()); + protoConvOpDesc->mutable_in_cvt()->set_scale(*in_cvt_acc.scale()); + protoConvOpDesc->mutable_in_cvt()->set_offset(*in_cvt_acc.offset()); + + protoConvOpDesc->mutable_out_cvt()->set_enable(*out_cvt_acc.enable()); + protoConvOpDesc->mutable_out_cvt()->set_truncate(*out_cvt_acc.truncate()); + protoConvOpDesc->mutable_out_cvt()->set_scale(*out_cvt_acc.scale()); + protoConvOpDesc->mutable_out_cvt()->set_offset(*out_cvt_acc.offset()); + + /* FIXME: dynamically figure out pitch-linear */ + protoConvOpDesc->set_pixel_mapping(nvdla_prototest_interface::ConvPixelMAP::PITCH_LINEAR); + protoConvOpDesc->set_pixel_offset_x(graph()->profile()->networkInputPixelOffX()); + protoConvOpDesc->set_pixel_offset_y(graph()->profile()->networkInputPixelOffY()); + protoConvOpDesc->set_batch(1); + protoConvOpDesc->set_weight_format(nvdla_prototest_interface::WeightFormat::UNCOMPRESSED); + protoConvOpDesc->set_weight_bank(*conv_op.weightBank()); + protoConvOpDesc->set_data_bank(*conv_op.dataBank()); + protoConvOpDesc->set_batch_stride(0); + protoConvOpDesc->set_release(*conv_op.release()); + protoConvOpDesc->set_post_extension(*conv_op.postExtension()); + protoConvOpDesc->set_pixel_override(nvdla_prototest_interface::PixelOverride::OVERRIDE_UINT); + protoConvOpDesc->set_mean_format(nvdla_prototest_interface::MeanFormat::MEAN_DISABLE); + protoConvOpDesc->set_mean_ax(0); + protoConvOpDesc->set_mean_bv(0); + protoConvOpDesc->set_mean_gu(0); + protoConvOpDesc->set_mean_ry(0); + protoConvOpDesc->set_conv_stride_x(*conv_op.convStrideX()); + protoConvOpDesc->set_conv_stride_y(*conv_op.convStrideY()); + protoConvOpDesc->set_pad_x_left(*conv_op.padXLeft()); + protoConvOpDesc->set_pad_x_right(*conv_op.padXRight()); + protoConvOpDesc->set_pad_y_bottom(*conv_op.padYBottom()); + protoConvOpDesc->set_pad_y_top(*conv_op.padYTop()); + protoConvOpDesc->set_dilation_x(*conv_op.dilationX()); + protoConvOpDesc->set_dilation_y(*conv_op.dilationY()); + protoConvOpDesc->set_pra_truncate(*conv_op.praTruncate()); + protoConvOpDesc->set_input_width_csc(*conv_op.inputWidthCSC()); + protoConvOpDesc->set_input_height_csc(*conv_op.inputHeightCSC()); + protoConvOpDesc->set_input_channel_csc(*conv_op.inputChannelCSC()); + protoConvOpDesc->set_kernel_width_csc(*conv_op.kernelWidthCSC()); + protoConvOpDesc->set_kernel_height_csc(*conv_op.kernelHeightCSC()); + protoConvOpDesc->set_kernel_channel_csc(*conv_op.kernelChannelCSC()); + protoConvOpDesc->set_input_width_cmac(*conv_op.inputWidthCMAC()); + protoConvOpDesc->set_input_height_cmac(*conv_op.inputHeightCMAC()); + protoConvOpDesc->set_bytes_per_kernel(*conv_op.bytesPerKernel()); + + protoConvSurfDesc->set_offset_u(*surf_acc.offsetU()); + + protoWtDataCube->set_type(nvdla_prototest_interface::MemType::DLA_MEM_MC); + protoWtDataCube->set_address(*weight_data_acc.address()); + protoWtDataCube->set_size(*weight_data_acc.size()); + protoWtDataCube->set_width(*weight_data_acc.width()); + protoWtDataCube->set_height(*weight_data_acc.height()); + protoWtDataCube->set_channel(*weight_data_acc.channel()); + protoWtDataCube->set_line_stride(*weight_data_acc.lineStride()); + protoWtDataCube->set_surf_stride(*weight_data_acc.surfStride()); + protoWtDataCube->set_plane_stride(*weight_data_acc.planeStride()); + protoWtDataCube->mutable_mem_info()->set_mem_id(weight_tsd->tensorBufferDesc()->memoryId(batch_id)); + protoWtDataCube->mutable_mem_info()->set_mem_size(weight_tsd->tensorBufferDesc()->size()); + protoWtDataCube->mutable_mem_info()->set_offset(0); + protoWtDataCube->mutable_mem_info()->set_fill_type(nvdla_prototest_interface::FillerType::FILL_RANDOM); + protoWtDataCube->mutable_mem_info()->set_flag(nvdla_prototest_interface::MemFlag::DLA_MEM_SET); + protoWtDataCube->mutable_mem_info()->set_precision(protoInPrec); + + protoSrcDataCube->set_type(nvdla_prototest_interface::MemType::DLA_MEM_MC); + protoSrcDataCube->set_address(*src_data_acc.address()); + protoSrcDataCube->set_size(src_tsd->tensorBufferDesc()->size() - src_tsd->bufferOffset()); + protoSrcDataCube->set_width(*src_data_acc.width()); + protoSrcDataCube->set_height(*src_data_acc.height()); + protoSrcDataCube->set_channel(*src_data_acc.channel()); + protoSrcDataCube->set_line_stride(*src_data_acc.lineStride()); + protoSrcDataCube->set_surf_stride(*src_data_acc.surfStride()); + protoSrcDataCube->set_plane_stride(*src_data_acc.planeStride()); + protoSrcDataCube->mutable_mem_info()->set_mem_id(src_tsd->tensorBufferDesc()->memoryId(batch_id)); + protoSrcDataCube->mutable_mem_info()->set_mem_size(src_tsd->tensorBufferDesc()->size()); + protoSrcDataCube->mutable_mem_info()->set_offset(src_tsd->bufferOffset()); + protoSrcDataCube->mutable_mem_info()->set_fill_type(nvdla_prototest_interface::FillerType::FILL_RANDOM); + protoSrcDataCube->mutable_mem_info()->set_flag(nvdla_prototest_interface::MemFlag::DLA_MEM_SET); + protoSrcDataCube->mutable_mem_info()->set_precision(protoInPrec); + + protoDstDataCube->set_type(nvdla_prototest_interface::MemType::DLA_MEM_HW); + protoDstDataCube->set_address(*dst_data_acc.address()); + protoDstDataCube->set_size(dst_tsd->tensorBufferDesc()->size() - dst_tsd->bufferOffset()); + protoDstDataCube->set_width(*dst_data_acc.width()); + protoDstDataCube->set_height(*dst_data_acc.height()); + protoDstDataCube->set_channel(*dst_data_acc.channel()); + protoDstDataCube->set_line_stride(*dst_data_acc.lineStride()); + protoDstDataCube->set_surf_stride(*dst_data_acc.surfStride()); + protoDstDataCube->set_plane_stride(*dst_data_acc.planeStride()); + protoDstDataCube->mutable_mem_info()->set_mem_id(dst_tsd->tensorBufferDesc()->memoryId(batch_id)); + protoDstDataCube->mutable_mem_info()->set_mem_size(dst_tsd->tensorBufferDesc()->size()); + protoDstDataCube->mutable_mem_info()->set_offset(dst_tsd->bufferOffset()); +fail: + return e; +} +#endif + + +}; // nvdla::priv:: +}; // nvdla:: diff --git a/umd/core/src/compiler/engine-ast/MultiOpsNode.cpp b/umd/core/src/compiler/engine-ast/MultiOpsNode.cpp new file mode 100644 index 00000000..d3446ce0 --- /dev/null +++ b/umd/core/src/compiler/engine-ast/MultiOpsNode.cpp @@ -0,0 +1,470 @@ +/* + * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#include "priv/EngineAST.h" + +using std::endl; + +namespace nvdla +{ +namespace priv +{ + +//---------------------------------------------------------------------- +// Multi Ops Node Utils +//---------------------------------------------------------------------- +NvDlaError engine_ast::MultiOpsNode::plugNestedGraph() +{ + NvDlaError e = NvDlaSuccess; + + MultiOpsNode* superNode = this; + + Graph* outerGraph = superNode->graph(); + NestedGraph* nestedGraph = superNode->nestedGraph(); + EdgeSequence superNodeInEdges = outerGraph->upstreamEdges(this); + EdgeSequence superNodeOutEdges = outerGraph->downstreamEdges(this); + EdgeSequence nestedGrInEdges = nestedGraph->inputEdges(); + EdgeSequence nestedGrOutEdges = nestedGraph->outputEdges(); + NodeSequence nestedGrHeadNodes = nestedGraph->topNodes(); + NodeSequence nestedGrTailNodes = nestedGraph->bottomNodes(); + NodeSequence nestedGrAllNodes = nestedGraph->orderedNodes(); + EdgeSequence nestedGrAllEdges; + EdgeSequence treatedEdges; + Node* nestedNode = NULL; + std::unordered_map< Edge*, Edge* > extToIntEdgeMap = isomorphicEdgeMap(); + std::unordered_map< Edge*, Edge* >::iterator edgeMapItr; + + if ( nestedGrInEdges.size() != superNodeInEdges.size() || + nestedGrOutEdges.size() != superNodeOutEdges.size() ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Edge Asymmetry between inside and outside of the super node: %s", name().c_str()); + } + else if ( nestedGrInEdges.size() != nestedGrHeadNodes.size() || + nestedGrOutEdges.size() != nestedGrTailNodes.size() ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Edge-Node Asymmetry within the super node: %s", name().c_str()); + } + + /* Connect outside world of the super Node to the nested graph */ + for (EdgeSequence::const_iterator sniei = superNodeInEdges.begin(); sniei != superNodeInEdges.end(); ++sniei) + { + edgeMapItr = extToIntEdgeMap.find(*sniei); + + // if the edge is a data edge, it should always connect to the nested head node; + // for other types, the edge should connect to the prevalent sink node + if ((*sniei)->isDataEdge()) + { + nestedNode = nestedGrHeadNodes[0]; + } + else + { + if (edgeMapItr != extToIntEdgeMap.end()) + { + nestedNode = nestedGraph->downstreamNodes(edgeMapItr->second)[0]; + } + else + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Edge %s belongs to none of the nested nodes of %s", + (*sniei)->id().c_str(), name().c_str()); + } + } + + (*sniei)->graph()->replaceEdgeNodes(*sniei, ast::EdgeSideEnum::SECOND, superNode, nestedNode); + (*sniei)->graph()->replaceNodeEdges(nestedNode, ast::EdgeSideEnum::SECOND, edgeMapItr->second, *sniei); + + if ( nestedGraph->debugNestedGraph() ) + { + gLogInfo << "[PLUG/FLATTEN Nested Graph] replace " << edgeMapItr->second->id() + << "(" << edgeMapItr->second->edgeType().c_str() << ") with " + << (*sniei)->id() << "(" << (*sniei)->edgeType().c_str() << ") " + << "as input edge to " << nestedNode->name() << endl; + } + } + + for (EdgeSequence::const_iterator snoei = superNodeOutEdges.begin(); snoei != superNodeOutEdges.end(); ++snoei) + { + edgeMapItr = extToIntEdgeMap.find(*snoei); + + // if the edge is a data edge, it should always connect to the nested tail node; + // for other types, the edge should connect to the prevalent src node + if ((*snoei)->isDataEdge()) + { + nestedNode = nestedGrTailNodes[0]; + } + else + { + if (edgeMapItr != extToIntEdgeMap.end()) + { + nestedNode = nestedGraph->upstreamNodes(edgeMapItr->second)[0]; + } + else + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Edge %s belongs to none of the nested nodes of %s", + (*snoei)->id().c_str(), name().c_str()); + } + } + + (*snoei)->graph()->replaceEdgeNodes(*snoei, ast::EdgeSideEnum::FIRST, superNode, nestedNode); + (*snoei)->graph()->replaceNodeEdges(nestedNode, ast::EdgeSideEnum::FIRST, edgeMapItr->second, *snoei); + + if ( nestedGraph->debugNestedGraph() ) + { + gLogInfo << "[PLUG/FLATTEN Nested Graph] replace " << edgeMapItr->second->id() + << "(" << edgeMapItr->second->edgeType().c_str() << ") with " + << (*snoei)->id() << "(" << (*snoei)->edgeType().c_str() << ") " + << "as output edge from " << nestedNode->name() << endl; + } + } + + /* Finally let the nested nodes point to the outer graph */ + for (NodeSequence::const_iterator ni = nestedGrAllNodes.begin(); ni != nestedGrAllNodes.end(); ++ni) + { + (*ni)->setGraph(outerGraph); + } + + // at this point multi-ops node is disconnected from outer graph + superNode->setIsOnline(false); + + PROPAGATE_ERROR_FAIL( repopulateEdgePorts() ); + +fail: + return e; +} + +NvDlaError engine_ast::MultiOpsNode::unplugNestedGraph() +{ + NvDlaError e = NvDlaSuccess; + + Node* superNode = this; + Graph* outerGraph = superNode->graph(); + NodeSequence nestedGrHeadNodes = nestedGraph()->topNodes(); + NodeSequence nestedGrTailNodes = nestedGraph()->bottomNodes(); + EdgeSequence nestedGrInEdges = nestedGraph()->inputEdges(); + EdgeSequence nestedGrOutEdges = nestedGraph()->outputEdges(); + std::unordered_map< Edge*, Edge* > extToIntEdgeMap = isomorphicEdgeMap(); + std::unordered_map< Edge*, Edge* >::iterator edgeMapItr; + + std::unordered_set< Edge* > exteriorEdges; + for (EdgeSequenceIterator iei = nestedGrInEdges.begin(); iei != nestedGrInEdges.end(); ++iei) + { + exteriorEdges.insert(*iei); + } + for (EdgeSequenceIterator oei = nestedGrOutEdges.begin(); oei != nestedGrOutEdges.end(); ++oei) + { + exteriorEdges.insert(*oei); + } + + Graph::NodeSet nestedGrAllNodes = nestedGraph()->nodes(); + for (EdgeSequenceIterator iei = nestedGrInEdges.begin(); iei != nestedGrInEdges.end(); ++iei) + { + Node* nestedNode = NULL; + Edge* outerGrIsomorphicInEdge = NULL; + Edge* innerGrIsomorphicInEdge = *iei; + NodeSequence tempNodeSequence; + + outerGrIsomorphicInEdge = outerGraphIsomorphEdgeOf(innerGrIsomorphicInEdge); + + // if the edge is a data edge, it should always connect to the nested head node + // for other types, the edge should connect to the prevalent sink node + if (innerGrIsomorphicInEdge->isDataEdge()) + { + nestedNode = nestedGrHeadNodes[0]; + } + else + { + if (outerGrIsomorphicInEdge) + { + nestedNode = outerGraph->downstreamNodes(outerGrIsomorphicInEdge)[0]; + } + else + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Edge %s belongs to none of the nested nodes of %s", + (*iei)->id().c_str(), name().c_str()); + } + } + + tempNodeSequence.push_back(nestedNode); + + /* + * Transfer everything in between these 2 boundary edges to the nested graph + * and replace them with the super node + */ + outerGrIsomorphicInEdge->graph()->replaceEdgeNodes(outerGrIsomorphicInEdge, + ast::EdgeSideEnum::SECOND, + nestedNode, + superNode); + nestedGraph()->setEdgeNodes(*iei, NodeSequence(), tempNodeSequence); + + if ( nestedGraph()->debugNestedGraph() ) + { + gLogInfo << "[UNPLUG/RE-NEST Nested Graph] replace " << innerGrIsomorphicInEdge->id() << "(" + << innerGrIsomorphicInEdge->edgeType().c_str() << ") with " + << outerGrIsomorphicInEdge->id() << "(" + << outerGrIsomorphicInEdge->edgeType().c_str() << ") as input edge to " + << nestedNode->name() << endl; + } + } + + for (EdgeSequenceIterator oei = nestedGrOutEdges.begin(); oei != nestedGrOutEdges.end(); ++oei) + { + Node* nestedNode = NULL; + Edge* outerGrIsomorphicOutEdge = NULL; + Edge* innerGrIsomorphicOutEdge = *oei; + NodeSequence tempNodeSequence; + + outerGrIsomorphicOutEdge = outerGraphIsomorphEdgeOf(innerGrIsomorphicOutEdge); + + // if the edge is a data edge, it should always connect to the nested tail node + // for other types, the edge should connect to the prevalent src node + if (innerGrIsomorphicOutEdge->isDataEdge()) + { + nestedNode = nestedGrTailNodes[0]; + } + else + { + if (outerGrIsomorphicOutEdge) + { + nestedNode = outerGraph->upstreamNodes(outerGrIsomorphicOutEdge)[0]; + } + else + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Edge %s belongs to none of the nested nodes of %s", + (*oei)->id().c_str(), name().c_str()); + } + } + + tempNodeSequence.push_back(nestedNode); + + outerGrIsomorphicOutEdge->graph()->replaceEdgeNodes(outerGrIsomorphicOutEdge, + ast::EdgeSideEnum::FIRST, + nestedNode, + superNode); + nestedGraph()->setEdgeNodes(*oei, tempNodeSequence, NodeSequence()); + if (nestedGraph()->debugNestedGraph()) + { + gLogInfo << "[UNPLUG/RE-NEST Nested Graph] replace " << innerGrIsomorphicOutEdge->id() << "(" + << innerGrIsomorphicOutEdge->edgeType().c_str() << ") with " + << outerGrIsomorphicOutEdge->id() << "(" + << outerGrIsomorphicOutEdge->edgeType().c_str() << ") as output edge from " + << nestedNode->name() << endl; + } + } + + /* Finally let the siphoned-off nodes point to the nested graph */ + for (Graph::NodeSet::const_iterator ni = nestedGrAllNodes.begin(); ni != nestedGrAllNodes.end(); ++ni) + { + (*ni)->setGraph(nestedGraph()); + } + + // at this point multi-ops node is re-connected in the outer graph + setIsOnline(true); + + PROPAGATE_ERROR_FAIL( repopulateEdgePorts() ); +fail: + return e; +} + +bool engine_ast::MultiOpsNode::isEngineType(EngineType et) +{ + bool match = false; + Graph::NodeSet nestedNodes = nestedGraph()->nodes(); + + if (engineType() == et) + { + match = true; + goto done; + } + + for (Graph::NodeSetIterator ni = nestedNodes.begin(); ni != nestedNodes.end(); ++ni) + { + if ((*ni)->engineType() == et) + { + match = true; + break; + } + } + +done: + return match; +} + +engine_ast::Edge* engine_ast::MultiOpsNode::outerGraphIsomorphEdgeOf(Edge* nestedEdge) +{ + struct IsEdgeIsomorphicToOuterEdge + { + Edge* _nestedEdge; + IsEdgeIsomorphicToOuterEdge(Edge* ne) { _nestedEdge = ne; } + bool operator() (const std::pair& mapIter) { return mapIter.second == _nestedEdge; } + }; + + std::unordered_map isoEdgeMap = isomorphicEdgeMap(); + std::unordered_map::iterator oeIter = std::find_if(isoEdgeMap.begin(), isoEdgeMap.end(), IsEdgeIsomorphicToOuterEdge(nestedEdge)); + + return oeIter != isoEdgeMap.end() ? oeIter->first : 0; +} + +NvDlaError engine_ast::MultiOpsNode::populateEdgePorts() +{ + NvDlaError e = NvDlaSuccess; + + Graph::NodeSet nestedNodes = nestedGraph()->nodes(); + + if (!isOnline()) + { + goto fail; + } + + for (Graph::NodeSetIterator ni = nestedNodes.begin(); ni != nestedNodes.end(); ++ni) + { + PROPAGATE_ERROR_FAIL((*ni)->repopulateEdgePorts()); + } + + Node::unpopulateEdgePorts(); + PROPAGATE_ERROR_FAIL(Node::populateEdgePorts()); + +fail: + return e; +} + +NvDlaError engine_ast::MultiOpsNode::repopulateEdgePorts() +{ + NvDlaError e = NvDlaSuccess; + + Graph::NodeSet nestedNodes = nestedGraph()->nodes(); + + if (!isOnline()) + { + goto fail; + } + + Node::unpopulateEdgePorts(); + for (Graph::NodeSetIterator ni = nestedNodes.begin(); ni != nestedNodes.end(); ++ni) + { + (*ni)->unpopulateEdgePorts(); + } + + PROPAGATE_ERROR_FAIL(populateEdgePorts()); + +fail: + return e; +} + +NvDlaError engine_ast::MultiOpsNode::verifyEdgePorts() +{ + NvDlaError e = NvDlaSuccess; + + Graph::NodeSet nestedNodes = nestedGraph()->nodes(); + + if (!isOnline()) + { + goto fail; + } + + if (inputEdges().size() != 1 || + auxEdges().size() != 0 || + outputEdges().size() != 1) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue); + } + + for (Graph::NodeSetIterator ni = nestedNodes.begin(); ni != nestedNodes.end(); ++ni) + { + PROPAGATE_ERROR_FAIL((*ni)->verifyEdgePorts()); + } + +fail: + return e; +} + +/*-------------------------------Split Nodes---------------------------*/ +NvDlaError engine_ast::MultiOpsNode::splitNodes() +{ + NvDlaError e = NvDlaSuccess; + + PROPAGATE_ERROR_FAIL(nestedGraph()->splitNodes()); + +fail: + return e; +} + +/*-------------------------------Handle Multi Batch--------------------*/ +NvDlaError engine_ast::MultiOpsNode::handleMultiBatch() +{ + NvDlaError e = NvDlaSuccess; + + PROPAGATE_ERROR_FAIL(nestedGraph()->handleMultiBatch()); + +fail: + return e; +} + +/*--------------------------------Self Annotation----------------------*/ +NvDlaError engine_ast::MultiOpsNode::selfAnnotate(NvS16& lastUsedAnnId) +{ + NvDlaError e = NvDlaSuccess; + + /* + * Determine task boundaries within the nested graph + */ + NodeSequence topological_order; + + // multi ops node annotates are not expected. + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Do not expect MultiOpsNode annotation."); + + // But it can be handled with this code + nestedGraph()->topologicalSort(topological_order); + PROPAGATE_ERROR_FAIL(nestedGraph()->determineTaskBoundaries(topological_order)); + if (nestedGraph()->graphlets().size() > 1) + { + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Can't have more than 1 graphlet inside a super node's nested graph" + " i.e. A nested graph in a super-node cannot have hybrid engine operations DLA & EMU"); + } + + /* + * Annotate nodes within the nested graph + */ + PROPAGATE_ERROR_FAIL(nestedGraph()->annotateNodes(lastUsedAnnId)); + +fail: + return e; +} + +/*-------------------------Resolve Multi-Batch Dependencies------------*/ +NvDlaError engine_ast::MultiOpsNode::resolveMultiBatchDependencies() +{ + NvDlaError e = NvDlaSuccess; + + PROPAGATE_ERROR_FAIL(nestedGraph()->resolveMultiBatchDependencies()); + +fail: + return e; +} + +}; // nvdla::priv + +}; // nvdla:: diff --git a/umd/core/src/compiler/engine-ast/NestedGraph.cpp b/umd/core/src/compiler/engine-ast/NestedGraph.cpp new file mode 100644 index 00000000..0231bf1c --- /dev/null +++ b/umd/core/src/compiler/engine-ast/NestedGraph.cpp @@ -0,0 +1,375 @@ +/* + * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#include "priv/EngineAST.h" + +using std::endl; + +namespace nvdla +{ +namespace priv +{ + +NvDlaError engine_ast::NestedGraph::populateNestedGraph(NodeSequence& groupedOps) +{ + NvDlaError e = NvDlaSuccess; + + EdgeSequence graphDataInEdges = groupedOps.front()->inputEdges(); + EdgeSequence graphDataOutEdges= groupedOps.back()->outputEdges(); + EdgeSequence nestedGrClonedInEdges; + EdgeSequence nestedGrClonedOutEdges; + Node* nestedGrHeadNode = groupedOps.front(); + Node* nestedGrTailNode = groupedOps.back(); + EdgeSet allEdges; + std::unordered_map< Edge*, Edge* > extToIntEdgeMap; + + setScoredOrdering( new ScoredDependencyOrdering(this) ); + setOrdering(new DependencyOrdering(this->scoredOrdering())); + + engine_ast::Graph* outerGraph = containingSuperNode()->graph(); + engine_ast::Graph* innerGraph = this; + Node* superNode = containingSuperNode(); + + /* + * Step-1: Cache all edges + */ + for (NodeSequence::const_iterator ni = groupedOps.begin(); ni != groupedOps.end(); ++ni) + { + EdgeSequence nodeEdges = outerGraph->nodeEdges((*ni), ast::EdgeSideEnum::BOTH); + for (EdgeSequence::const_iterator ei = nodeEdges.begin(); ei != nodeEdges.end(); ++ei) + { + allEdges.insert(*ei); + } + } + + /* + * Step-2: Share ownership of nodes in the outer graph with the nested one + */ + for (NodeSequence::const_iterator ni = groupedOps.begin(); ni != groupedOps.end(); ++ni) + { + innerGraph->insertNode(*ni); + } + + /* + * Step-3: Disconnect graph input and output edges from inner node and connect them to super node, + * clone them and associate the clones with inner nodes, + * + * Step-3.1: Handle data input edges to the head nodes of the nested graph + */ + for (EdgeSequence::const_iterator giei = graphDataInEdges.begin(); giei != graphDataInEdges.end(); ++giei ) + { + /* + * Edges in nested graph are only for internal local connectivity; + * they must really use tensors, tsd, tbd from edges of the containing super node + */ + Edge* clonedInput = innerGraph->addDataEdge(*giei, 0, nestedGrHeadNode, (*giei)->originalTensor()); + clonedInput->setTensorSurfaceDesc((*giei)->tensorSurfaceDesc()); + (*giei)->tensorSurfaceDesc()->setParentEdge(clonedInput); + + if ( debugNestedGraph() ) + { + gLogInfo << "\tcloning input " << (*giei)->id() << " to " << clonedInput->id() + << " type " << (*giei)->edgeType().c_str() + << " tsd[" << clonedInput->tensorSurfaceDesc()->id() << "]" << endl; + } + + /* replace the old downstream node that just got nested, with the superNode */ + (*giei)->graph()->replaceEdgeNodes(*giei, ast::EdgeSideEnum::SECOND, nestedGrHeadNode, superNode); + + nestedGrClonedInEdges.push_back(clonedInput); + extToIntEdgeMap.insert(std::pair(*giei, clonedInput)); + } + + /* + * Step-3.2: Handle data output edges from the tail nodes of the nested graph + */ + for (EdgeSequence::const_iterator goei = graphDataOutEdges.begin(); goei != graphDataOutEdges.end(); ++goei ) + { + /* + * Edges in nested graph are only for internal local connectivity; + * they must really use tensors, tsd, tbd from edges of the containing super node + */ + Edge* clonedOutput = innerGraph->addDataEdge(*goei, nestedGrTailNode, 0, (*goei)->originalTensor()); + clonedOutput->setTensorSurfaceDesc((*goei)->tensorSurfaceDesc()); + (*goei)->tensorSurfaceDesc()->setParentEdge(clonedOutput); + + if ( debugNestedGraph() ) + { + gLogInfo << "\tcloning output " << (*goei)->id() << " to " << clonedOutput->id() + << " type " << (*goei)->edgeType().c_str() + << " tsd[" << clonedOutput->tensorSurfaceDesc()->id() << "]" << endl; + } + + /* replace the old upstream node that just got nested, with the superNode */ + (*goei)->graph()->replaceEdgeNodes(*goei, ast::EdgeSideEnum::FIRST, nestedGrTailNode, superNode); + + nestedGrClonedOutEdges.push_back(clonedOutput); + extToIntEdgeMap.insert(std::pair(*goei, clonedOutput)); + } + + + for (NodeSequence::const_iterator ni = groupedOps.begin(); ni != groupedOps.end(); ++ni) + { + /* + * Step-3.3: Handle all non-data input edges to all the nodes of the nested graph + */ + EdgeSequence nodeInEdges = outerGraph->upstreamEdges(*ni); + for (EdgeSequenceIterator iei = nodeInEdges.begin(); iei != nodeInEdges.end(); ++iei) + { + Edge* clonedInput = NULL; + if ((*iei)->isComputeEdge()) + { + clonedInput = innerGraph->addComputeEdge(0, *ni); + } + else if ((*iei)->isHazardEdge()) + { + clonedInput = innerGraph->addHazardEdge(0, *ni); + } + else if ((*iei)->isDataEdge()) + { + continue; + } + else + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unknown edge type %s", (*iei)->id().c_str()); + } + + if ( debugNestedGraph() ) + { + gLogInfo << "\tcloning input " << (*iei)->id() << " to " << clonedInput->id() + << " type " << (*iei)->edgeType().c_str() << endl; + } + + (*iei)->graph()->replaceEdgeNodes(*iei, ast::EdgeSideEnum::SECOND, *ni, superNode); + + nestedGrClonedInEdges.push_back(clonedInput); + extToIntEdgeMap.insert(std::pair(*iei, clonedInput)); + } + + /* + * Step-3.4: Handle all non-data output edges from all the nodes of the nested graph + */ + EdgeSequence nodeOutEdges = outerGraph->downstreamEdges(*ni); + for (EdgeSequenceIterator oei = nodeOutEdges.begin(); oei != nodeOutEdges.end(); ++oei) + { + Edge* clonedOutput = NULL; + if ((*oei)->isComputeEdge()) + { + clonedOutput = innerGraph->addComputeEdge(*ni, 0); + } + else if ((*oei)->isHazardEdge()) + { + clonedOutput = innerGraph->addHazardEdge(*ni, 0); + } + else if ((*oei)->isDataEdge()) + { + continue; + } + else + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unknown edge type %s", (*oei)->id().c_str()); + } + + if ( debugNestedGraph() ) + { + gLogInfo << "\tcloning output " << (*oei)->id() << " to " << clonedOutput->id() + << " type " << (*oei)->edgeType().c_str() << endl; + } + + (*oei)->graph()->replaceEdgeNodes(*oei, ast::EdgeSideEnum::FIRST, *ni, superNode); + + nestedGrClonedOutEdges.push_back(clonedOutput); + extToIntEdgeMap.insert(std::pair(*oei, clonedOutput)); + } + } + + /* + * Step-4: Share ownership of internal edges between grouped nodes between both outer graph and the nested one + */ + for (EdgeSetIterator ei = allEdges.begin(); ei != allEdges.end(); ++ei) + { + NodeSequence firstNodes, secondNodes; + + std::unordered_map< Edge*, Edge* >::iterator mapi = extToIntEdgeMap.find(*ei); + + if ( mapi != extToIntEdgeMap.end()) + { + firstNodes = innerGraph->edgeNodes(mapi->second, ast::EdgeSideEnum::FIRST); + secondNodes = innerGraph->edgeNodes(mapi->second, ast::EdgeSideEnum::SECOND); + innerGraph->setEdgeNodes(mapi->second, firstNodes, secondNodes); + continue; + } + + firstNodes = outerGraph->edgeNodes(*ei, ast::EdgeSideEnum::FIRST); + secondNodes = outerGraph->edgeNodes(*ei, ast::EdgeSideEnum::SECOND); + innerGraph->setEdgeNodes(*ei, firstNodes, secondNodes); + + innerGraph->insertEdge(*ei); + } + + /* + * Step-5: Now, finally let the grouped ops be point to the nested graph + */ + for (NodeSequence::const_iterator ni = groupedOps.begin(); ni != groupedOps.end(); ++ni) + { + (*ni)->setGraph(innerGraph); + } + + innerGraph->setInputEdges(nestedGrClonedInEdges); + innerGraph->setOutputEdges(nestedGrClonedOutEdges); + NodeFactory::nodeCast(superNode)->setIsomorphicEdgeMap(extToIntEdgeMap); + + ordering()->generate(); + markClean(); + + refreshGraphState(); + +fail: + return e; +} + + +void engine_ast::NestedGraph::checkDirty() +{ + if ( dirty() ) + { + m_ng_ordering->generate(); + markClean(); + } +} + +const engine_ast::Graph::NodeSequence &engine_ast::NestedGraph::orderedNodes() { checkDirty(); return m_ng_ordering->nodeOrder(); } +const engine_ast::Graph::EdgeSequence &engine_ast::NestedGraph::orderedEdges() { checkDirty(); return m_ng_ordering->edgeOrder(); } +const engine_ast::Graph::ElemSequence &engine_ast::NestedGraph::orderedElems() { checkDirty(); return m_ng_ordering->elemOrder(); } + +//---------------------------------------------------------------------- +// Nested Graph Utils +//---------------------------------------------------------------------- + +bool engine_ast::NestedGraph::connectNodesWithEdge(Edge* e, Node* fromNode, Node* toNode) +{ + bool ok = true; + + ok &= containingSuperNode()->graph()->connectNodesWithEdge(e, fromNode, toNode); + ok &= Graph::connectNodesWithEdge(e, fromNode, toNode); + + return ok; +} + +bool engine_ast::NestedGraph::insertEdge(Edge* e) +{ + bool ok = true; + + ok &= containingSuperNode()->graph()->insertEdge(e); + ok &= Graph::insertEdge(e); + + return ok; +} + +bool engine_ast::NestedGraph::insertNode(Node* n) +{ + bool ok = true; + ok &= containingSuperNode()->graph()->insertNode(n); + ok &= Graph::insertNode(n); + + return ok; +} + +bool engine_ast::NestedGraph::removeEdge(Edge* e) +{ + bool ok = true; + ok &= containingSuperNode()->graph()->removeEdge(e); + ok &= Graph::removeEdge(e); + + return ok; +} + +bool engine_ast::NestedGraph::removeNode(Node* n) +{ + bool ok = true; + ok &= containingSuperNode()->graph()->removeNode(n); + ok &= Graph::removeNode(n); + + return ok; +} + +bool engine_ast::NestedGraph::removeEdgeFromNode(Edge *edge, ast::EdgeSide side, Node *node) +{ + bool ok = true; + ok &= containingSuperNode()->graph()->removeEdgeFromNode(edge, side, node); + ok &= Graph::removeEdgeFromNode(edge, side, node); + + return ok; +} + +bool engine_ast::NestedGraph::removeNodeFromEdge(Edge *edge, ast::EdgeSide side, Node *node) +{ + bool ok = true; + ok &= containingSuperNode()->graph()->removeNodeFromEdge(edge, side, node); + ok &= Graph::removeNodeFromEdge(edge, side, node); + + return ok; +} + +bool engine_ast::NestedGraph::appendNodeToEdge(Edge *edge, ast::EdgeSide side, Node *node) +{ + bool ok = true; + ok &= containingSuperNode()->graph()->appendNodeToEdge(edge, side, node); + ok &= Graph::appendNodeToEdge(edge, side, node); + + return ok; +} + +engine_ast::Graph::NodeSequence engine_ast::NestedGraph::topNodes() +{ + NodeSequence sinkNodes; + EdgeSequence nestedGrInputEdges = inputEdges(); + for (EdgeSequence::const_iterator ei = nestedGrInputEdges.begin(); ei != nestedGrInputEdges.end(); ++ei) + { + NodeSequence dsNodes = downstreamNodes(*ei); + sinkNodes.insert(sinkNodes.end(), dsNodes.begin(), dsNodes.end()); + } + return sinkNodes; +} + +engine_ast::Graph::NodeSequence engine_ast::NestedGraph::bottomNodes() +{ + NodeSequence srcNodes; + EdgeSequence nestedGrOutputEdges = outputEdges(); + for (EdgeSequence::const_iterator ei = nestedGrOutputEdges.begin(); ei != nestedGrOutputEdges.end(); ++ei) + { + NodeSequence usNodes = upstreamNodes(*ei); + srcNodes.insert(srcNodes.end(), usNodes.begin(), usNodes.end()); + } + return srcNodes; +} + + +}; // nvdla::priv + +}; // nvdla:: diff --git a/umd/core/src/compiler/engine-ast/PDPNode.cpp b/umd/core/src/compiler/engine-ast/PDPNode.cpp new file mode 100644 index 00000000..e4f891a9 --- /dev/null +++ b/umd/core/src/compiler/engine-ast/PDPNode.cpp @@ -0,0 +1,812 @@ +/* + * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#include +#include +#include + +#include "priv/EngineAST.h" +#include "priv/Profile.h" +#include "priv/Tensor.h" +#include "ErrorMacros.h" + +using std::endl; +using std::max; + + +namespace nvdla +{ +namespace priv +{ + +/* TODO: If in future PDP engine could run >1 operation, + * strip them into separate files and just keep the common stuff here + */ + +void engine_ast::PDPNode::captureCanonicalParams() +{ + params().setPoolingType(canonicalNode()->params().poolType()); + params().setTopLeftPadding(canonicalNode()->params().topLeftPadding()); + params().setBottomRightPadding(canonicalNode()->params().bottomRightPadding()); + params().setPaddingValue(0); + params().setStride(canonicalNode()->params().stride()); + params().setPoolingWindow(canonicalNode()->params().kernelDims()); +} + +NvDlaError engine_ast::PDPNode::verifySurfaceDims(surface::TensorSurfaceDesc* tsd) +{ + NvDlaError e = NvDlaSuccess; + + bool isSrcTSD, isDstTSD; + surface::TensorSurfaceDesc* srcTSD = NULL; + surface::TensorSurfaceDesc* dstTSD = NULL; + Dims4 poolOutDimsFromNw; + + PROPAGATE_ERROR_FAIL(verifyEdgePorts()); + + isSrcTSD = inputEdges()[0]->tensorSurfaceDesc() == tsd; + isDstTSD = outputEdges()[0]->tensorSurfaceDesc() == tsd; + + if (!isSrcTSD && !isDstTSD) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "TSD %s doesn't belong to %s", tsd->id().c_str(), name().c_str()); + } + + srcTSD = isSrcTSD ? tsd : inputEdges()[0]->tensorSurfaceDesc(); + dstTSD = isDstTSD ? tsd : outputEdges()[0]->tensorSurfaceDesc(); + + poolOutDimsFromNw = outputEdges()[0]->originalTensor()->getDimensions(); + + if (!srcTSD->bindable() && !dstTSD->bindable() && (srcTSD->dimensions().n != dstTSD->dimensions().n)) + { + PROPAGATE_ERROR_FAIL(NvDlaError_BadValue, "(%s) Non-bindable Input and Output tensors should have the same " + "#batches (N)", name().c_str()); + } + else if (srcTSD->dimensions().c != dstTSD->dimensions().c) + { + PROPAGATE_ERROR_FAIL(NvDlaError_BadValue, "(%s) Input and Output tensors should have the same " + "#channels (C)", name().c_str()); + } + else if(dstTSD->dimensions().w != poolOutDimsFromNw.w || + dstTSD->dimensions().h != poolOutDimsFromNw.h) + { + gLogError << "Nw pool out dims " << poolOutDimsFromNw.w << "x" << poolOutDimsFromNw.h << endl; + gLogError << "PDP out dims " << dstTSD->dimensions().w << "x" << dstTSD->dimensions().h << endl; + PROPAGATE_ERROR_FAIL(NvDlaError_BadValue, "(%s) Out dims determined from compiler have diverged" + " from that expected by original network", name().c_str()); + } + +fail: + return e; +} + +//---------------------------------------------------------------------- +// Formula Book +//---------------------------------------------------------------------- +void engine_ast::PDPNode::adjustBRPadding() +{ + surface::TensorSurfaceDesc *srcTSD = graph()->nodeInputTensorSurface(this, 0, supportedInSurfCategories()); + surface::TensorSurfaceDesc *dstTSD = graph()->nodeOutputTensorSurface(this, 0, supportedOutSurfCategories()); + + Dims2 brPadding = params().bottomRightPadding(); + Dims2 tlPadding = params().topLeftPadding(); + NvS32 kernelW = params().poolingWindow().w; + NvS32 kernelH = params().poolingWindow().h; + NvS32 strideX = params().stride().w; + NvS32 strideY = params().stride().h; + NvS32 leftPadding = tlPadding.w; + NvS32 topPadding = tlPadding.h; + NvS32 pdpInputWidth = srcTSD->dimensions().w; + NvS32 pdpInputHeight = srcTSD->dimensions().h; + NvS32 pdpOutputWidth = dstTSD->dimensions().w; + NvS32 pdpOutputHeight = dstTSD->dimensions().h; + NvS32 newRightPadding = 0; + NvS32 newBottomPadding = 0; + + newRightPadding = ((pdpOutputWidth - 1)*strideX + kernelW) - (pdpInputWidth + leftPadding); + newBottomPadding = ((pdpOutputHeight - 1)*strideY + kernelH) - (pdpInputHeight + topPadding); + + brPadding.w = newRightPadding; + brPadding.h = newBottomPadding; + + params().setBottomRightPadding(brPadding); +} + +NvDlaError engine_ast::PDPNode::verifySplitWInfo +( + engine_ast::PDPEngineParams::hwSplitWidthInfo splitWInfo +) +{ + NvDlaError e = NvDlaSuccess; + + surface::TensorSurfaceDesc *srcTSD = graph()->nodeInputTensorSurface(this, 0, supportedInSurfCategories()); + surface::TensorSurfaceDesc *dstTSD = graph()->nodeOutputTensorSurface(this, 0, supportedOutSurfCategories()); + + Dims2 tlPadding = params().topLeftPadding(); + NvS32 kernelW = params().poolingWindow().w; + NvS32 kernelH = params().poolingWindow().h; + NvS32 strideX = params().stride().w; + NvS32 leftPadding = tlPadding.w; + NvS32 pdpInputWidth = srcTSD->dimensions().w; + NvS32 pdpOutputWidth = dstTSD->dimensions().w; + NvS32 maxFlyingWidth = calculateMaxWidth(srcTSD->surfaceFormat().precision(), + params().poolingWindow().h, + params().stride().h); + + NvS32 totalWidth = pdpInputWidth + leftPadding + splitWInfo.rightPadding; + + ASSERT(splitWInfo.firstOutWidth <= maxFlyingWidth); + ASSERT(splitWInfo.midOutWidth <= maxFlyingWidth); + ASSERT(splitWInfo.lastOutWidth <= maxFlyingWidth); + + if (splitWInfo.numSplits == 1) + { + ASSERT(splitWInfo.firstOutWidth == pdpOutputWidth); + ASSERT((splitWInfo.firstInWidth + leftPadding) == ((splitWInfo.firstOutWidth-1)*strideX + kernelW)); + } + else if (splitWInfo.numSplits == 2) + { + ASSERT((splitWInfo.firstOutWidth + splitWInfo.lastOutWidth) == pdpOutputWidth); + ASSERT((splitWInfo.firstInWidth + leftPadding) == ((splitWInfo.firstOutWidth-1)*strideX + kernelW)); + ASSERT((splitWInfo.lastInWidth + splitWInfo.rightPadding + splitWInfo.numOverlapStripes) == ((splitWInfo.lastOutWidth-1)*strideX + kernelW)); + if (kernelW >= strideX) + { + ASSERT((kernelW - strideX) <= splitWInfo.firstInWidth); + } + else + { + ASSERT((strideX - kernelW) < splitWInfo.lastInWidth); + } + } + else + { + ASSERT((splitWInfo.firstOutWidth + splitWInfo.lastOutWidth + splitWInfo.midOutWidth*(splitWInfo.numSplits-2)) == pdpOutputWidth); + ASSERT((splitWInfo.firstInWidth + leftPadding) == ((splitWInfo.firstOutWidth-1)*strideX + kernelW)); + ASSERT((splitWInfo.midInWidth + splitWInfo.numOverlapStripes) == ((splitWInfo.midOutWidth-1)*strideX + kernelW)); + ASSERT((splitWInfo.lastInWidth + splitWInfo.rightPadding + splitWInfo.numOverlapStripes) == ((splitWInfo.lastOutWidth-1)*strideX + kernelW)); + + if (kernelW >= strideX) + { + ASSERT((kernelW - strideX) <= splitWInfo.firstInWidth); + ASSERT((kernelW - strideX) <= splitWInfo.midInWidth); + } + else + { + ASSERT((strideX - kernelW) < splitWInfo.lastInWidth); + ASSERT((strideX - kernelW) < splitWInfo.midInWidth); + } + } + + ASSERT((totalWidth >= kernelW)); + ASSERT((totalWidth - kernelW + strideX) % strideX == 0); + ASSERT(leftPadding < kernelW); + ASSERT(splitWInfo.rightPadding < kernelW); + ASSERT(splitWInfo.bottomPadding < kernelH); + +fail: + return e; +} + +NvU16 engine_ast::PDPNode::calculateMaxWidth +( + surface::SurfacePrecision pdpPrecision, + NvU16 poolingKernelHeight, + NvU16 poolingStrideY +) +{ + NvU16 pdpMaxFlyingWidth = 0; + + const NvU32 PDP_BUF_SIZE = (7 * 1024); + const NvU16 rtlOverlapLines[9] = {1, 1, 2, 4, 4, 8, 8, 8, 8}; + + NvU16 logicalOverlapLines = (NvU16) ceil(float(poolingKernelHeight)/float(poolingStrideY)); + NvU32 atom_k_size = graph()->target_config()->atomicKSize(); + NvU16 kernelPerGroup = pdpPrecision.v() == surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8 ? atom_k_size : atom_k_size / 2; + NvU16 bitsPerElement = pdpPrecision.v() == surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8 ? 14 : 28; + + pdpMaxFlyingWidth = (PDP_BUF_SIZE * 8) / (rtlOverlapLines[logicalOverlapLines] * kernelPerGroup * bitsPerElement); + + return pdpMaxFlyingWidth; +} + +/*--------------------------------Fuse Nodes---------------------------*/ +NvDlaError engine_ast::PDPNode::fuseOnTheFlyNodes() +{ + NvDlaError e = NvDlaSuccess; + NvU32 pdpMaxFlyingWidth = 0; + + if ( graph()->profile()->canSDPPDPOnFly() ) + { + std::vector upstreamNodes = graph()->upstreamNodes(this); + + /* Bail out if pdp has multiple upstream nodes - albeit this should NEVER happen + * we did something wrong if it did + */ + if (upstreamNodes.size() > 1) + { + if ( debugFusion() ) + { + gLogInfo << "(" << name() << ") PDP node has multiple upstream nodes. Can't do on-fly " << endl; + } + params().setPDPFlyingMode(false); + goto fail; + } + + { + engine_ast::Node* upstreamNode = upstreamNodes.at(0); + surface::TensorSurfaceDesc *srcTSD = graph()->nodeInputTensorSurface(this, 0, supportedInSurfCategories()); + surface::TensorSurfaceDesc *dstTSD = graph()->nodeOutputTensorSurface(this, 0, supportedOutSurfCategories()); + + /* Bail out if pdp is attached to a non-sdp node above. + * If upstream is a concat node, we also effectively weed out split conv+sdp's + * above. Because pdp on-fly is not possible with split conv(+sdp) + */ + if (upstreamNode->engineType().v() != EngineTypeEnum::SDP) + { + if ( debugFusion() ) + { + gLogInfo << "(" << name() << ") Upstream node to this PDP (" << name() << ") is of type: " + << upstreamNode->engineType().c_str() << ". No scope of PDP on-fly" << endl; + } + params().setPDPFlyingMode(false); + goto fail; + } + + /* Bail out if this pdp is attached to upstream-sdp with multiple fan outs */ + if (graph()->downstreamEdges(upstreamNode).size() > 1) + { + if ( debugFusion() ) + { + gLogInfo << "(" << name() << ") Upstream SDP (" << upstreamNode->name() << ") to this PDP node (" + << name() << ") has multiple output edges. Can't fuse with such an SDP" << endl; + } + params().setPDPFlyingMode(false); + goto fail; + } + + /* Bail out if this pdp is attached to upstream-sdp with groups > 1 */ + // fixme: allow such fusion in future; by splitting pdp along C in boundGraph() + if (NodeFactory::nodeCast(upstreamNode)->params().numGroups() > 1) + { + if ( debugFusion() ) + { + gLogInfo << "(" << name() << ") Upstream SDP (" << upstreamNode->name() << ") to this PDP node (" + << name() << ") numGroups > 1. Can't fuse with such an SDP" << endl; + } + params().setPDPFlyingMode(false); + goto fail; + } + + /* Bail out if pdp line buffers can't hold overlapping lines between adjacent vertical kernels*/ + pdpMaxFlyingWidth = calculateMaxWidth(srcTSD->surfaceFormat().precision(), + params().poolingWindow().h, + params().stride().h); + if ( pdpMaxFlyingWidth < (NvU32)dstTSD->dimensions().w ) + { + if ( debugFusion() ) + { + gLogInfo << "(" << name() << ") Max flying width " << pdpMaxFlyingWidth + << " < output_width " << dstTSD->dimensions().w + << " . Can't do On-Fly mode" << endl; + } + params().setPDPFlyingMode(false); + goto fail; + } + + // After escaping all the booby-traps, finally fuse. + params().setPDPFlyingMode(true); + dependencyParams().setFusedNode(IODirectionEnum::INPUT, upstreamNode); + upstreamNode->dependencyParams().setFusedNode(IODirectionEnum::OUTPUT, this); + + if ( debugFusion() ) + { + gLogInfo << "(" << name() << ") Fusing with " << upstreamNode->name() << endl; + } + } + } + +fail: + return e; +} + +/*--------------------------------Split Nodes--------------------------*/ +NvDlaError engine_ast::PDPNode::pdpHWSplitWidth() +{ + NvDlaError e = NvDlaSuccess; + + engine_ast::PDPEngineParams::hwSplitWidthInfo splitWInfo; + + surface::TensorSurfaceDesc *srcTSD = graph()->nodeInputTensorSurface(this, 0, supportedInSurfCategories()); + surface::TensorSurfaceDesc *dstTSD = graph()->nodeOutputTensorSurface(this, 0, supportedOutSurfCategories()); + + NvS32 remainingOutWidth = 0; + Dims2 brPadding = params().bottomRightPadding(); + Dims2 tlPadding = params().topLeftPadding(); + NvS32 kernelW = params().poolingWindow().w; + NvS32 strideX = params().stride().w; + NvS32 leftPadding = tlPadding.w; + NvS32 pdpOutputWidth = dstTSD->dimensions().w; + NvS32 maxFlyingWidth = calculateMaxWidth(srcTSD->surfaceFormat().precision(), + params().poolingWindow().h, + params().stride().h); + + remainingOutWidth = pdpOutputWidth; + + while (remainingOutWidth > 0) + { + splitWInfo.numSplits++; + remainingOutWidth -= maxFlyingWidth; + } + + splitWInfo.firstOutWidth = std::min(maxFlyingWidth, pdpOutputWidth); + if (splitWInfo.numSplits == 2) + { + splitWInfo.lastOutWidth = pdpOutputWidth - splitWInfo.firstOutWidth; + } + else + { + splitWInfo.midOutWidth = maxFlyingWidth; + splitWInfo.lastOutWidth = pdpOutputWidth - (maxFlyingWidth * (splitWInfo.numSplits - 1)); + ASSERT(splitWInfo.lastOutWidth > 0); + } + + // map to input details + splitWInfo.numOverlapStripes = std::max(0, kernelW - strideX); + splitWInfo.firstInWidth = std::max(0, (splitWInfo.firstOutWidth - 1)*strideX + kernelW - leftPadding); + + // extra right, bottom padding (it might be less than left_pad/top_pad; depends on start point of the last pooling) + adjustBRPadding(); + brPadding = params().bottomRightPadding(); + splitWInfo.rightPadding = brPadding.w; + splitWInfo.bottomPadding = brPadding.h; + + if (splitWInfo.numSplits > 1) + { + // lastInWidth has to be >0, otherwise we have to adjust firstInWidth to meet this constraint + splitWInfo.lastInWidth = (splitWInfo.lastOutWidth - 1)*strideX + kernelW - + splitWInfo.rightPadding - splitWInfo.numOverlapStripes; + if ( splitWInfo.lastInWidth > 0) + { + ASSERT(std::min(splitWInfo.firstInWidth, splitWInfo.lastInWidth) > 0); + } + else + { + NvU32 firstLastTotalOut = splitWInfo.firstOutWidth + splitWInfo.lastOutWidth; + NvU32 lastInWidth = 1; + while ((lastInWidth + splitWInfo.numOverlapStripes + splitWInfo.rightPadding - kernelW)%strideX != 0) + { + lastInWidth++; + } + splitWInfo.lastInWidth = lastInWidth; + splitWInfo.lastOutWidth = (lastInWidth + splitWInfo.numOverlapStripes + splitWInfo.rightPadding - kernelW)/strideX + 1; + ASSERT(splitWInfo.lastOutWidth > 0); + + splitWInfo.firstOutWidth = firstLastTotalOut - splitWInfo.lastOutWidth; + ASSERT(splitWInfo.firstOutWidth > 0); + + splitWInfo.firstInWidth = (splitWInfo.firstOutWidth - 1)*strideX + kernelW - leftPadding; + ASSERT(splitWInfo.firstInWidth > 0); + } + } + + if (splitWInfo.numSplits > 2) + { + splitWInfo.midInWidth = std::max(0, (splitWInfo.midOutWidth-1)*strideX + kernelW - splitWInfo.numOverlapStripes); + ASSERT(std::min(splitWInfo.firstInWidth, std::min(splitWInfo.midInWidth, splitWInfo.lastInWidth)) > 0); + } + + if ( debugSplits() ) { + gLogInfo << "(" << name() << ") splitInfo: " << endl; + gLogInfo << "\tnum splits: " << splitWInfo.numSplits << endl; + gLogInfo << "\trightPadding: " << splitWInfo.rightPadding << endl; + gLogInfo << "\tbottomPadding: " << splitWInfo.bottomPadding << endl; + gLogInfo << "\tfirstInWidth: " << splitWInfo.firstInWidth << endl; + gLogInfo << "\tmidInWidth: " << splitWInfo.midInWidth << endl; + gLogInfo << "\tlastInWidth: " << splitWInfo.lastInWidth << endl; + gLogInfo << "\tnumOverlapStripes: " << splitWInfo.numOverlapStripes << endl; + gLogInfo << "\tfirstOutWidth: " << splitWInfo.firstOutWidth << endl; + gLogInfo << "\tmidOutWidth: " << splitWInfo.midOutWidth << endl; + gLogInfo << "\tlastOutWidth: " << splitWInfo.lastOutWidth << endl; + } + + PROPAGATE_ERROR_FAIL(verifySplitWInfo(splitWInfo)); + + params().setHwSplitWidthInfo(splitWInfo); + +fail: + return e; +} + +NvDlaError engine_ast::PDPNode::pdpSWSplit() +{ + NvDlaError e = NvDlaSuccess; + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "(%s) PDP software split data is not supported yet", + name().c_str()); + +fail: + return e; +} + +/*--------------------------------Split Nodes---------------------------*/ +NvDlaError engine_ast::PDPNode::splitNodes() +{ + NvDlaError e = NvDlaSuccess; + NvU32 pdpMaxFlyingWidth = 0; + surface::TensorSurfaceDesc *srcTSD = graph()->nodeInputTensorSurface(this, 0, supportedInSurfCategories()); + surface::TensorSurfaceDesc *dstTSD = graph()->nodeOutputTensorSurface(this, 0, supportedOutSurfCategories()); + + // Make sure pdp-on-fly mode is not turned ON + if ( params().isPDPOnFlying() ) + { + if ( debugFusion() ) { + gLogInfo << "(" << name() << ") PDP on-flying mode is ON. No need to split" << endl; + } + goto fail; + } + + /* PDP can end up in off-flying mode and has to read from memory: + * - when it can't be fused to split conv+sdp combo above (is_full_conv = False) OR + * - when upstream node is not SDP + * + * However, that doesn't necessarily mean that hw/sw-powered split is needed. + */ + + // Soft exit if maxFlyingWidth >= output_width + pdpMaxFlyingWidth = calculateMaxWidth(srcTSD->surfaceFormat().precision(), + params().poolingWindow().h, + params().stride().h); + + if ( debugFusion() ) + { + gLogInfo << "(" << name() << ") maxflywidth " << pdpMaxFlyingWidth << " out width " << dstTSD->dimensions().w << endl; + } + + if ( pdpMaxFlyingWidth >= (NvU32)dstTSD->dimensions().w ) + { + if ( debugFusion() ) { + gLogInfo << "(" << name() << ") maxFlyingWidth >= output_width. No need to do hw/sw PDP splits" << endl; + } + + /* Before quitting, adjust right/bottom padding if the pooling window + * is going to overshoot the input tensor boundaries + */ + adjustBRPadding(); + goto fail; + } + else + { + // HW-powered split-Width can automatically stream overlapping vertical stripes + // in a single HWL. So try that first + PROPAGATE_ERROR_FAIL(pdpHWSplitWidth()); + + /* Since PDP line buffer size is (64*112bits*8)bits, it could accommodate 2048/4096 elements + * in int16/int8 format, the maximum line buffer limited output width is 2048/16=128 or 4096/32=128. + * Since the width configuration could be 8192 max, so the max split_num could be 8192/128=64. + * + * Anything greater than that, needs software split of PDP node + */ + if (params().getHwSplitWidthInfo().numSplits > 64) + { + gLogInfo << "Can't support splits > 64 yet." << endl; + PROPAGATE_ERROR_FAIL(pdpSWSplit()); + } + } + +fail: + return e; +} + +/*------------------------------Handle Multi-Batch---------------------*/ +NvDlaError engine_ast::PDPNode::handleMultiBatch() +{ + NvDlaError e = NvDlaSuccess; + + //Handle operation parameters for the multi-batch operations + NvU32 numBatches = graph()->profile()->multiBatchSize(); + for (NvU32 nn = 1; nn < numBatches; ++nn) + { + params(nn) = params(0); + } + + return e; +} + +//---------------------------------------------------------------------- +// Code Emission +//---------------------------------------------------------------------- +NvDlaError engine_ast::PDPNode::emitOp(Graph *g, + DLAInterface *target_dla, + NvU32 op_slot, NvU32 batch_id, + DLACommonOpDescAccessor dep, + DLAOperationContainerAccessor op, + DLASurfaceContainerAccessor surf) +{ + NvDlaError e = NvDlaSuccess; + + DLAPDPOpDescAccessor pdp_op = op.pdpOpDescAccessor(0); + DLAPDPSurfaceDescAccessor surf_acc = surf.pdpSurfaceDescAccessor(0); + DLADataCubeAccessor src_data_acc = surf_acc.srcDataAccessor(); + DLADataCubeAccessor dst_data_acc = surf_acc.dstDataAccessor(); + DLAConsumerAccessor fused_acc = dep.fusedParentAccessor(); + NVDLA_UNUSED(fused_acc); + + surface::TensorSurfaceDesc *srcTSD = g->nodeInputTensorSurface(this, 0, supportedInSurfCategories()); + surface::TensorSurfaceDesc *dstTSD = g->nodeOutputTensorSurface(this, 0, supportedOutSurfCategories()); + + *pdp_op.precision() = ASTToDLAInterface::getPDPPrecision(target_dla, srcTSD->surfaceFormat().precision()); + *pdp_op.poolMode() = ASTToDLAInterface::getPDPMode(target_dla, params(batch_id).poolingType()); + *pdp_op.paddingValue(0) = params(batch_id).paddingValue(); + *pdp_op.splitNum() = max(params(batch_id).getHwSplitWidthInfo().numSplits, 1); + *pdp_op.partialInWidthFirst() = max(params(batch_id).getHwSplitWidthInfo().firstInWidth, 0); + *pdp_op.partialInWidthLast() = max(params(batch_id).getHwSplitWidthInfo().lastInWidth, 0); + *pdp_op.partialInWidthMid() = max(params(batch_id).getHwSplitWidthInfo().midInWidth, 0); + *pdp_op.partialWidthFirst() = max(params(batch_id).getHwSplitWidthInfo().firstOutWidth, 0); + *pdp_op.partialWidthLast() = max(params(batch_id).getHwSplitWidthInfo().lastOutWidth, 0); + *pdp_op.partialWidthMid() = max(params(batch_id).getHwSplitWidthInfo().midOutWidth, 0); + *pdp_op.poolHeight() = params(batch_id).poolingWindow().h - 1; // h/w friendly value + *pdp_op.poolWidth() = params(batch_id).poolingWindow().w - 1; + *pdp_op.strideX() = params(batch_id).stride().w; + *pdp_op.strideY() = params(batch_id).stride().h; + *pdp_op.padLeft() = params(batch_id).topLeftPadding().w; + *pdp_op.padRight() = params(batch_id).bottomRightPadding().w; + *pdp_op.padTop() = params(batch_id).topLeftPadding().h; + *pdp_op.padBottom() = params(batch_id).bottomRightPadding().h; + + emitDependencyParams(target_dla, dep, batch_id); + setDataCubeAccessor(src_data_acc, srcTSD, IODirectionEnum::INPUT, batch_id); + setDataCubeAccessor(dst_data_acc, dstTSD, IODirectionEnum::UNKNOWN, batch_id); + + if ( params(batch_id).bottomRightPadding().w < 0 ) { + *src_data_acc.width() += params(batch_id).bottomRightPadding().w; + *pdp_op.padRight() = 0; + } + + if ( params(batch_id).bottomRightPadding().h < 0 ) { + *src_data_acc.height() += params(batch_id).bottomRightPadding().h; + *pdp_op.padBottom() = 0; + } + + if ( g->debugOps() ) + { + gLogInfo << "PDP node @ op_slot = " << op_slot << " batch_id = " << batch_id << endl; + + gLogInfo << "\tpdp precision" << (int)*pdp_op.precision() << endl; + gLogInfo << "\tpdp pool mode" << (int)*pdp_op.poolMode() << endl; + gLogInfo << "\tsrc tsd:" << srcTSD->id() << endl; + gLogInfo << "\tdst tsd:" << dstTSD->id() << endl; + gLogInfo << "\tsrc addr=" << (int) *src_data_acc.address() << endl; + gLogInfo << "\tsrc type=" << (int) *src_data_acc.type() << endl; + gLogInfo << "\tdependencyCount" << (int)*dep.dependencyCount() << endl; + gLogInfo << "\tsplitNum " << (int)*pdp_op.splitNum() << endl; + gLogInfo << "\tpadLeft " << (int)*pdp_op.padLeft() << endl; + gLogInfo << "\tpadTop " << (int)*pdp_op.padTop() << endl; + gLogInfo << "\tpadRight " << (int)*pdp_op.padRight() << endl; + gLogInfo << "\tpadBottom " << (int)*pdp_op.padBottom() << endl; + gLogInfo << "\tpool height " << (int)*pdp_op.poolHeight() << endl; + gLogInfo << "\tpool width " << (int)*pdp_op.poolWidth() << endl; + gLogInfo << "\tstride x " << (int)*pdp_op.strideX() << endl; + gLogInfo << "\tstride y " << (int)*pdp_op.strideY() << endl; + gLogInfo << "\tsrc size " << *src_data_acc.size() << endl; + gLogInfo << "\tsrc width " << *src_data_acc.width() << endl; + gLogInfo << "\tsrc height " << *src_data_acc.height() << endl; + gLogInfo << "\tsrc channel " << *src_data_acc.channel() << endl; + gLogInfo << "\tsrc linestride " << *src_data_acc.lineStride() << endl; + gLogInfo << "\tsrc surfstride " << *src_data_acc.surfStride() << endl; + gLogInfo << "\tdst addr=" << (int) *dst_data_acc.address() << endl; + gLogInfo << "\tdst type=" << (int) *dst_data_acc.type() << endl; + gLogInfo << "\tdst size " << *dst_data_acc.size() << endl; + gLogInfo << "\tdst width " << *dst_data_acc.width() << endl; + gLogInfo << "\tdst height " << *dst_data_acc.height() << endl; + gLogInfo << "\tdst channel " << *dst_data_acc.channel() << endl; + gLogInfo << "\tdst linestride " << *dst_data_acc.lineStride() << endl; + gLogInfo << "\tdst surfstride " << *dst_data_acc.surfStride() << endl; + } + + return e; +} + +#ifdef NVDLA_COMPILER_OUTPUT_FOR_PROTOTEST +NvDlaError engine_ast::PDPNode::emitOp(NvU32 op_slot, NvU32 batch_id, + DLAInterface *target_dla, + DLACommonOpDescAccessor& dep, + DLAOperationContainerAccessor& op, + DLASurfaceContainerAccessor& surf, + nvdla_prototest_interface::Layer* protoLayer) +{ + NvDlaError e = NvDlaSuccess; + NvU32 numConsumers = 0; + + DLAPDPOpDescAccessor pdp_op = op.pdpOpDescAccessor(0); + DLAPDPSurfaceDescAccessor surf_acc = surf.pdpSurfaceDescAccessor(0); + DLADataCubeAccessor src_data_acc = surf_acc.srcDataAccessor(); + DLADataCubeAccessor dst_data_acc = surf_acc.dstDataAccessor(); + DLAConsumerAccessor fused_acc = dep.fusedParentAccessor(); + NVDLA_UNUSED(batch_id); + + surface::TensorSurfaceDesc *srcTSD = graph()->nodeInputTensorSurface(this, 0, supportedInSurfCategories()); + surface::TensorSurfaceDesc *dstTSD = graph()->nodeOutputTensorSurface(this, 0, supportedOutSurfCategories()); + + nvdla_prototest_interface::PDPOpDesc* protoPDPOpDesc = protoLayer->mutable_op_config()->mutable_pdp_op(); + nvdla_prototest_interface::PDPSurfaceDesc* protoPDPSurfDesc = protoLayer->mutable_surface()->mutable_pdp_surface(); + nvdla_prototest_interface::DataCube* protoSrcDataCube = protoPDPSurfDesc->mutable_src_data(); + nvdla_prototest_interface::DataCube* protoDstDataCube = protoPDPSurfDesc->mutable_dst_data(); + + nvdla_prototest_interface::DataPrecision pdpPrec; + + protoLayer->set_index(op_slot); + protoLayer->set_roi_index(0); + protoLayer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_PDP); + protoLayer->set_dependency_count(*dep.dependencyCount()); + + /* consumers */ + for (size_t c = 0; c < EngineType::num_elements(); c++) + { + NvS8 fw_op_index = ASTToDLAInterface::getEngineType(target_dla, c); + if ( fw_op_index < 0 ) + { + continue; + } + + DLAConsumerAccessor cons_acc = dep.consumerAccessor(fw_op_index); + if (*cons_acc.index() != -1) { + ++numConsumers; + nvdla_prototest_interface::Consumer* protoConsumer = protoLayer->add_bottom(); + protoConsumer->set_index(*cons_acc.index()); + switch(c) { + case EngineTypeEnum::BDMA : protoConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_BDMA); break; + case EngineTypeEnum::CONVOLUTION : protoConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_CONV); break; + case EngineTypeEnum::SDP : protoConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_SDP); break; + case EngineTypeEnum::PDP : protoConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_PDP); break; + case EngineTypeEnum::CDP : protoConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_CDP); break; + case EngineTypeEnum::RUBIK: protoConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_RUBIK); break; + default: ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unrecognized consumer %d", c); + } + switch(dependencyParams().consumer(c).opEvent().v()) { + case OperationEventTypeEnum::OP_CDMA_WEIGHT_DONE : protoConsumer->set_event(nvdla_prototest_interface::Consumer_EventType::Consumer_EventType_CDMA_WT_DONE); break; + case OperationEventTypeEnum::OP_CDMA_DATA_DONE : protoConsumer->set_event(nvdla_prototest_interface::Consumer_EventType::Consumer_EventType_CDMA_DT_DONE); break; + case OperationEventTypeEnum::OP_COMPLETED : protoConsumer->set_event(nvdla_prototest_interface::Consumer_EventType::Consumer_EventType_OP_COMPLETED); break; + case OperationEventTypeEnum::OP_ENABLED : protoConsumer->set_event(nvdla_prototest_interface::Consumer_EventType::Consumer_EventType_OP_ENABLED); break; + case OperationEventTypeEnum::OP_PROGRAMMED : protoConsumer->set_event(nvdla_prototest_interface::Consumer_EventType::Consumer_EventType_OP_PROGRAMMED); break; + default: ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unrecognized consumer event"); + } + } + } + + /* fused node */ + if (dependencyParams().fusedNode(engine_ast::IODirectionEnum::INPUT)) + { + nvdla_prototest_interface::Consumer* protoFusedConsumer = protoLayer->mutable_fused(); + protoFusedConsumer->set_index(*fused_acc.index()); + protoFusedConsumer->set_event(nvdla_prototest_interface::Consumer_EventType::Consumer_EventType_OP_ENABLED); + switch(dependencyParams().fusedNode(engine_ast::IODirectionEnum::INPUT)->engineType().v()) { + case EngineTypeEnum::SDP: protoFusedConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_SDP); break; + default: ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "PDP can have only SDP op as its fused partner on input side if at all possible"); + } + } + + switch(srcTSD->surfaceFormat().precision().v()) { + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_FP16 : pdpPrec = nvdla_prototest_interface::DataPrecision::PRECISION_FP16; break; + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16 : pdpPrec = nvdla_prototest_interface::DataPrecision::PRECISION_INT16; break; + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8 : pdpPrec = nvdla_prototest_interface::DataPrecision::PRECISION_INT8; break; + default: ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unrecognized input precision: %s", srcTSD->surfaceFormat().precision().c_str()); + } + + protoPDPOpDesc->set_precision(pdpPrec); + + switch(params(batch_id).poolingType().v()) { + case nvdla::PoolingType::kAVERAGE: protoPDPOpDesc->set_pool_mode(nvdla_prototest_interface::PDPOpDesc_PoolingMode_MODE_AVG); break; + case nvdla::PoolingType::kMAX: protoPDPOpDesc->set_pool_mode(nvdla_prototest_interface::PDPOpDesc_PoolingMode_MODE_MAX); break; + case nvdla::PoolingType::kMIN: protoPDPOpDesc->set_pool_mode(nvdla_prototest_interface::PDPOpDesc_PoolingMode_MODE_MIN); break; + default: ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unrecognized pool mode: %s", params(batch_id).poolingType().c_str()); + } + + protoPDPOpDesc->add_padding_value(*pdp_op.paddingValue(0)); + protoPDPOpDesc->set_split_num(*pdp_op.splitNum()); + protoPDPOpDesc->set_partial_in_width_first(*pdp_op.partialInWidthFirst()); + protoPDPOpDesc->set_partial_in_width_last(*pdp_op.partialInWidthLast()); + protoPDPOpDesc->set_partial_in_width_mid(*pdp_op.partialInWidthMid()); + protoPDPOpDesc->set_partial_width_first(*pdp_op.partialWidthFirst()); + protoPDPOpDesc->set_partial_width_last(*pdp_op.partialWidthLast()); + protoPDPOpDesc->set_partial_width_mid(*pdp_op.partialWidthMid()); + + switch(*pdp_op.poolHeight()) { + case 0: protoPDPOpDesc->set_pool_height(nvdla_prototest_interface::PoolSize::SIZE_1); break; + case 1: protoPDPOpDesc->set_pool_height(nvdla_prototest_interface::PoolSize::SIZE_2); break; + case 2: protoPDPOpDesc->set_pool_height(nvdla_prototest_interface::PoolSize::SIZE_3); break; + case 3: protoPDPOpDesc->set_pool_height(nvdla_prototest_interface::PoolSize::SIZE_4); break; + case 4: protoPDPOpDesc->set_pool_height(nvdla_prototest_interface::PoolSize::SIZE_5); break; + case 5: protoPDPOpDesc->set_pool_height(nvdla_prototest_interface::PoolSize::SIZE_6); break; + case 6: protoPDPOpDesc->set_pool_height(nvdla_prototest_interface::PoolSize::SIZE_7); break; + case 7: protoPDPOpDesc->set_pool_height(nvdla_prototest_interface::PoolSize::SIZE_8); break; + } + + switch(*pdp_op.poolWidth()) { + case 0: protoPDPOpDesc->set_pool_width(nvdla_prototest_interface::PoolSize::SIZE_1); break; + case 1: protoPDPOpDesc->set_pool_width(nvdla_prototest_interface::PoolSize::SIZE_2); break; + case 2: protoPDPOpDesc->set_pool_width(nvdla_prototest_interface::PoolSize::SIZE_3); break; + case 3: protoPDPOpDesc->set_pool_width(nvdla_prototest_interface::PoolSize::SIZE_4); break; + case 4: protoPDPOpDesc->set_pool_width(nvdla_prototest_interface::PoolSize::SIZE_5); break; + case 5: protoPDPOpDesc->set_pool_width(nvdla_prototest_interface::PoolSize::SIZE_6); break; + case 6: protoPDPOpDesc->set_pool_width(nvdla_prototest_interface::PoolSize::SIZE_7); break; + case 7: protoPDPOpDesc->set_pool_width(nvdla_prototest_interface::PoolSize::SIZE_8); break; + } + + protoPDPOpDesc->set_stride_x(*pdp_op.strideX()); + protoPDPOpDesc->set_stride_y(*pdp_op.strideY()); + protoPDPOpDesc->set_pad_left(*pdp_op.padLeft()); + protoPDPOpDesc->set_pad_right(*pdp_op.padRight()); + protoPDPOpDesc->set_pad_top(*pdp_op.padTop()); + protoPDPOpDesc->set_pad_bottom(*pdp_op.padBottom()); + + if (dependencyParams().fusedNode(engine_ast::IODirectionEnum::INPUT)) { + protoSrcDataCube->set_type(nvdla_prototest_interface::MemType::DLA_MEM_HW); + } else if (srcTSD->tensorBufferDesc()->memoryLoc(batch_id).v() == memory::LocationEnum::lCVSRAM) { + protoSrcDataCube->set_type(nvdla_prototest_interface::MemType::DLA_MEM_CV); + } else { + protoSrcDataCube->set_type(nvdla_prototest_interface::MemType::DLA_MEM_MC); + } + protoSrcDataCube->set_address(*src_data_acc.address()); + protoSrcDataCube->set_size(srcTSD->tensorBufferDesc()->size() - srcTSD->bufferOffset()); + protoSrcDataCube->set_width(*src_data_acc.width()); + protoSrcDataCube->set_height(*src_data_acc.height()); + protoSrcDataCube->set_channel(*src_data_acc.channel()); + protoSrcDataCube->set_line_stride(*src_data_acc.lineStride()); + protoSrcDataCube->set_surf_stride(*src_data_acc.surfStride()); + protoSrcDataCube->set_plane_stride(*src_data_acc.planeStride()); + protoSrcDataCube->mutable_mem_info()->set_mem_id(srcTSD->tensorBufferDesc()->memoryId(batch_id)); + protoSrcDataCube->mutable_mem_info()->set_mem_size(srcTSD->tensorBufferDesc()->size()); + protoSrcDataCube->mutable_mem_info()->set_offset(srcTSD->bufferOffset()); + protoSrcDataCube->mutable_mem_info()->set_fill_type(nvdla_prototest_interface::FillerType::FILL_RANDOM); + protoSrcDataCube->mutable_mem_info()->set_flag(nvdla_prototest_interface::MemFlag::DLA_MEM_SET); + protoSrcDataCube->mutable_mem_info()->set_precision(pdpPrec); + + protoDstDataCube->set_type(nvdla_prototest_interface::MemType::DLA_MEM_MC); + protoDstDataCube->set_address(*dst_data_acc.address()); + protoDstDataCube->set_size(dstTSD->tensorBufferDesc()->size() - dstTSD->bufferOffset()); + protoDstDataCube->set_width(*dst_data_acc.width()); + protoDstDataCube->set_height(*dst_data_acc.height()); + protoDstDataCube->set_channel(*dst_data_acc.channel()); + protoDstDataCube->set_line_stride(*dst_data_acc.lineStride()); + protoDstDataCube->set_surf_stride(*dst_data_acc.surfStride()); + protoDstDataCube->set_plane_stride(*dst_data_acc.planeStride()); + protoDstDataCube->mutable_mem_info()->set_mem_id(dstTSD->tensorBufferDesc()->memoryId(batch_id)); + protoDstDataCube->mutable_mem_info()->set_mem_size(dstTSD->tensorBufferDesc()->size()); + protoDstDataCube->mutable_mem_info()->set_offset(dstTSD->bufferOffset()); + if (numConsumers == 0) { + protoDstDataCube->mutable_mem_info()->set_fill_type(nvdla_prototest_interface::FillerType::FILL_NONE); + protoDstDataCube->mutable_mem_info()->set_flag(nvdla_prototest_interface::MemFlag::DLA_MEM_OUTPUT); + protoDstDataCube->mutable_mem_info()->set_precision(pdpPrec); + } + +fail: + return e; +} +#endif + +}; // nvdla::priv:: +}; // nvdla:: diff --git a/umd/core/src/compiler/engine-ast/RubikNode.cpp b/umd/core/src/compiler/engine-ast/RubikNode.cpp new file mode 100644 index 00000000..93fbe7aa --- /dev/null +++ b/umd/core/src/compiler/engine-ast/RubikNode.cpp @@ -0,0 +1,330 @@ +/* + * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#include + +#include "priv/EngineAST.h" +#include "priv/Profile.h" +#include "priv/Tensor.h" +#include "ErrorMacros.h" + +using std::endl; + +namespace nvdla +{ +namespace priv +{ + + +void engine_ast::RubikNode::captureCanonicalParams() +{ + +} + +/* + * Rubik engine has special requirement that its input and output channels + * should be aligned to: 16 (for fp16/int16) and 32 (for int8) + */ +Dims4 engine_ast::RubikNode::suggestSurfaceDims(surface::TensorSurfaceDesc* tsd) +{ + NvDlaError e = NvDlaSuccess; + bool isSrcTSD = false; + bool isDstTSD = false; + Dims4 suggestedDims(-1,-1,-1,-1); + + PROPAGATE_ERROR_FAIL( verifyEdgePorts() ); + + isSrcTSD = inputEdges()[0]->tensorSurfaceDesc() == tsd; + isDstTSD = outputEdges()[0]->tensorSurfaceDesc() == tsd; + + if (!isSrcTSD && !isDstTSD) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "TSD %s doesn't belong to %s", tsd->id().c_str(), name().c_str()); + } + + if (isSrcTSD) + { + Dims4 inSurfDims(-1,-1,-1,-1); + Edge* inEdge = inputEdges()[0]; + Node* srcNode = graph()->upstreamNodes(inEdge).size() ? graph()->upstreamNodes(inEdge)[0] : NULL; + if (srcNode) + { + inSurfDims = srcNode->suggestSurfaceDims(inEdge->tensorSurfaceDesc()); + } + suggestedDims.n = std::max(params().contractOpParams().inDims.n, inSurfDims.n); + suggestedDims.c = std::max(params().contractOpParams().inDims.c, inSurfDims.c); + suggestedDims.h = std::max(params().contractOpParams().inDims.h, inSurfDims.h); + suggestedDims.w = std::max(params().contractOpParams().inDims.w, inSurfDims.w); + + // use this opportunity to update the contract op params if they seem outdated + if (suggestedDims != params().contractOpParams().inDims) + { + RubikEngineParams::ContractOpParams updatedContractOps = params().contractOpParams(); + updatedContractOps.inDims = suggestedDims; + params().setContractOpParams(updatedContractOps); + } + } + else + { + suggestedDims.n = std::max(params().contractOpParams().outDims.n, tsd->dimensions().n); + suggestedDims.c = std::max(params().contractOpParams().outDims.c, tsd->dimensions().c); + suggestedDims.h = std::max(params().contractOpParams().outDims.h, tsd->dimensions().h); + suggestedDims.w = std::max(params().contractOpParams().outDims.w, tsd->dimensions().w); + + // use this opportunity to update the contract op params if they seem outdated + if (suggestedDims != params().contractOpParams().outDims) + { + RubikEngineParams::ContractOpParams updatedContractOps = params().contractOpParams(); + updatedContractOps.outDims = suggestedDims; + params().setContractOpParams(updatedContractOps); + } + } + +fail: + return suggestedDims; +} + +NvU32 engine_ast::RubikNode::suggestLineStride(surface::TensorSurfaceDesc* tsd) +{ + NvDlaError e = NvDlaSuccess; + NvU32 lineStride = 0; + + PROPAGATE_ERROR_FAIL( verifyEdgePorts() ); + + if (m_nodeTSDLineStride.find(tsd) != m_nodeTSDLineStride.end()) + { + lineStride = m_nodeTSDLineStride[tsd]; + goto fail; + } + + { + surface::TensorSurfaceDesc probeTSD = *tsd; + Dims4 surfDims = suggestSurfaceDims(tsd); + probeTSD.setDimensions(surfDims); + probeTSD.resetLineStride(); + lineStride = probeTSD.lineStride(); + } + + m_nodeTSDLineStride[tsd] = lineStride; + +fail: + return lineStride; +} + +NvU32 engine_ast::RubikNode::suggestSurfaceStride(surface::TensorSurfaceDesc* tsd) +{ + NvDlaError e = NvDlaSuccess; + NvU32 surfaceStride = 0; + + PROPAGATE_ERROR_FAIL( verifyEdgePorts() ); + + if (m_nodeTSDSurfaceStride.find(tsd) != m_nodeTSDSurfaceStride.end()) + { + surfaceStride = m_nodeTSDSurfaceStride[tsd]; + goto fail; + } + + { + surface::TensorSurfaceDesc probeTSD = *tsd; + Dims4 surfDims = suggestSurfaceDims(tsd); + probeTSD.setDimensions(surfDims); + probeTSD.resetSurfaceStride(); + surfaceStride = probeTSD.surfaceStride(); + } + + m_nodeTSDSurfaceStride[tsd] = surfaceStride; + +fail: + return surfaceStride; +} + +NvU64 engine_ast::RubikNode::suggestSurfaceSize(surface::TensorSurfaceDesc* tsd) +{ + NvDlaError e = NvDlaSuccess; + NvU64 size = 0; + + PROPAGATE_ERROR_FAIL( verifyEdgePorts() ); + + if (m_nodeTSDSurfaceSize.find(tsd) != m_nodeTSDSurfaceSize.end()) + { + size = m_nodeTSDSurfaceSize[tsd]; + goto fail; + } + + { + surface::TensorSurfaceDesc probeTSD = *tsd; + Dims4 surfDims = suggestSurfaceDims(tsd); + probeTSD.setDimensions(surfDims); + probeTSD.resetSize(); + size = probeTSD.size(); + } + + m_nodeTSDSurfaceSize[tsd] = size; + +fail: + return size; +} + +/*------------------------------Handle Multi-Batch---------------------*/ +NvDlaError engine_ast::RubikNode::handleMultiBatch() +{ + NvDlaError e = NvDlaSuccess; + + //Handle operation parameters for the multi-batch operations + NvU32 numBatches = graph()->profile()->multiBatchSize(); + for (NvU32 nn = 1; nn < numBatches; ++nn) + { + params(nn) = params(0); + } + + return e; +} + +NvDlaError engine_ast::RubikNode::determineContractOpParams() +{ + NvDlaError e = NvDlaSuccess; + + NvU16 CInExt, COutExt; + Dims4 origRubikInDims, origRubikOutDims; + engine_ast::RubikEngineParams::ContractOpParams contractOpParams; + NvU32 atom_k_size = graph()->target_config()->atomicKSize(); + NvU32 chnlAlign = graph()->profile()->computePrecision() == + surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8 ? atom_k_size : atom_k_size / 2; + + if (params().mode().v() != RubikModeEnum::RUBIK_MODE_CONTRACT) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Can't determine Contract op params for %s which is" + " not selected for Contract mode", name().c_str()); + } + + PROPAGATE_ERROR_FAIL( repopulateEdgePorts() ); + + origRubikInDims = inputEdges()[0]->originalTensor()->getDimensions(); + origRubikOutDims = outputEdges()[0]->originalTensor()->getDimensions(); + + contractOpParams.inDims = origRubikInDims; + contractOpParams.outDims = origRubikOutDims; + + if ( debugRubik() ) + { + gLogInfo << "orig rubik in dims: " << origRubikInDims.c << "x" + << origRubikInDims.h << "x" << origRubikInDims.w << endl; + gLogInfo << "orig rubik out dims: " << origRubikOutDims.c << "x" + << origRubikOutDims.h << "x" << origRubikOutDims.w << endl; + } + + /* Step-1: determine input side contract op details */ + CInExt = ROUNDUP_AND_ALIGN(origRubikInDims.c, chnlAlign); + contractOpParams.inDims.c = CInExt; + + /* Step-2: Determine output side contract op details */ + COutExt = ROUNDUP_AND_ALIGN(origRubikOutDims.c, chnlAlign); + contractOpParams.outDims.c = COutExt; + + params().setContractOpParams(contractOpParams); + + if ( debugRubik() ) + { + gLogInfo << "rubik contract op " << name() << " in: " + << contractOpParams.inDims.n << "x" << contractOpParams.inDims.c << "x" + << contractOpParams.inDims.h << "x" << contractOpParams.inDims.w << endl; + gLogInfo << "rubik contract op " << name() << " out: " + << contractOpParams.outDims.n << "x" << contractOpParams.outDims.c << "x" + << contractOpParams.outDims.h << "x" << contractOpParams.outDims.w << endl; + } + +fail: + return e; +} + +/*----------------------Code Emission-----------------------------------*/ +NvDlaError engine_ast::RubikNode::emitOp(Graph *g, + DLAInterface *target_dla, + NvU32 op_slot, NvU32 batch_id, + DLACommonOpDescAccessor dep, + DLAOperationContainerAccessor op, + DLASurfaceContainerAccessor surf) +{ + NvDlaError e = NvDlaSuccess; + + DLARubikOpDescAccessor rubikOp = op.rubikOpDescAccessor(0); + DLARubikSurfaceDescAccessor surfAcc = surf.rubikSurfaceDescAccessor(0); + DLADataCubeAccessor srcDataAcc = surfAcc.srcDataAccessor(); + DLADataCubeAccessor dstDataAcc = surfAcc.dstDataAccessor(); + + surface::TensorSurfaceDesc *srcTSD = g->nodeInputTensorSurface(this, 0, supportedInSurfCategories()); + surface::TensorSurfaceDesc *dstTSD = g->nodeOutputTensorSurface(this, 0, supportedOutSurfCategories()); + + *rubikOp.precision() = ASTToDLAInterface::getRubikPrecision(target_dla, srcTSD->surfaceFormat().precision()); + *rubikOp.mode() = ASTToDLAInterface::getRubikMode(target_dla, params(batch_id).mode()); + *rubikOp.strideX() = (int)params(batch_id).deconvStride().w; + *rubikOp.strideY() = (int)params(batch_id).deconvStride().h; + + emitDependencyParams(target_dla, dep, batch_id); + setDataCubeAccessor(srcDataAcc, srcTSD, IODirectionEnum::INPUT, batch_id); + setDataCubeAccessor(dstDataAcc, dstTSD, IODirectionEnum::UNKNOWN, batch_id); + + if (params(batch_id).mode() == RubikModeEnum::RUBIK_MODE_CONTRACT) + { + *srcDataAcc.channel() = params(batch_id).contractOpParams().inDims.c; + *dstDataAcc.channel() = params(batch_id).contractOpParams().outDims.c; + } + + if ( g->debugOps() ) + { + gLogInfo << "Rubik node @ op_slot = " << op_slot << " batch_id = " << batch_id << endl; + gLogInfo << "\trubik precision " << (int)*rubikOp.precision() << endl; + gLogInfo << "\trubik mode " << (int)*rubikOp.mode() << endl; + gLogInfo << "\tdeconv-stride-x " << (int)*rubikOp.strideX() << endl; + gLogInfo << "\tdeconv-stride-Y " << (int)*rubikOp.strideY() << endl; + gLogInfo << "\tsrc tsd:" << srcTSD->id() << endl; + gLogInfo << "\tdst tsd:" << dstTSD->id() << endl; + gLogInfo << "\tsrc addr=" << (int) *srcDataAcc.address() << endl; + gLogInfo << "\tsrc type=" << (int) *srcDataAcc.type() << endl; + gLogInfo << "\tdependencyCount" << (int)*dep.dependencyCount() << endl; + gLogInfo << "\tsrc size " << *srcDataAcc.size() << endl; + gLogInfo << "\tsrc width " << *srcDataAcc.width() << endl; + gLogInfo << "\tsrc height " << *srcDataAcc.height() << endl; + gLogInfo << "\tsrc channel " << *srcDataAcc.channel() << endl; + gLogInfo << "\tsrc linestride " << *srcDataAcc.lineStride() << endl; + gLogInfo << "\tsrc surfstride " << *srcDataAcc.surfStride() << endl; + gLogInfo << "\tdst addr=" << (int) *dstDataAcc.address() << endl; + gLogInfo << "\tdst type=" << (int) *dstDataAcc.type() << endl; + gLogInfo << "\tdst size " << *dstDataAcc.size() << endl; + gLogInfo << "\tdst width " << *dstDataAcc.width() << endl; + gLogInfo << "\tdst height " << *dstDataAcc.height() << endl; + gLogInfo << "\tdst channel " << *dstDataAcc.channel() << endl; + gLogInfo << "\tdst linestride " << *dstDataAcc.lineStride() << endl; + gLogInfo << "\tdst surfstride " << *dstDataAcc.surfStride() << endl; + } + + return e; +} + +}; // nvdla::priv:: +}; // nvdla:: diff --git a/umd/core/src/compiler/engine-ast/SDPEltWiseOp.cpp b/umd/core/src/compiler/engine-ast/SDPEltWiseOp.cpp new file mode 100644 index 00000000..2d7e0769 --- /dev/null +++ b/umd/core/src/compiler/engine-ast/SDPEltWiseOp.cpp @@ -0,0 +1,737 @@ +/* + * Copyright (c) 2018-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#include "priv/EngineAST.h" +#include "priv/LowPrecision.h" +#include "priv/Profile.h" + +#include "ErrorMacros.h" + +using std::endl; + +namespace nvdla +{ +namespace priv +{ + +void engine_ast::SDPElementWiseOpNode::captureCanonicalParams() +{ + params().x1Params().setEnabled(true); + params().x1Params().setMode(SDPModeEnum::SDP_MODE_PER_ELEMENT); + + switch(canonicalNode()->params().type()) + { + case ElementWiseOperation::kSUM: + params().x1Params().setAluType(SDPALUTypeEnum::SDP_ALU_TYPE_SUM); + params().x1Params().setOpType(SDPOpTypeEnum::SDP_OP_TYPE_ADD); + break; + case ElementWiseOperation::kPROD: + params().x1Params().setAluType(SDPALUTypeEnum::SDP_ALU_TYPE_SUM); + params().x1Params().setOpType(SDPOpTypeEnum::SDP_OP_TYPE_MUL); + break; + case ElementWiseOperation::kMIN: + params().x1Params().setAluType(SDPALUTypeEnum::SDP_ALU_TYPE_MIN); + params().x1Params().setOpType(SDPOpTypeEnum::SDP_OP_TYPE_ADD); + break; + case ElementWiseOperation::ew_kMAX: + params().x1Params().setAluType(SDPALUTypeEnum::SDP_ALU_TYPE_MAX); + params().x1Params().setOpType(SDPOpTypeEnum::SDP_OP_TYPE_ADD); + break; + default: + params().x1Params().setAluType(SDPALUTypeEnum::SDP_ALU_TYPE_UNKNOWN); + params().x1Params().setOpType(SDPOpTypeEnum::SDP_OP_TYPE_UNKNOWN); + } + + return; +} + +void engine_ast::SDPElementWiseOpNode::inheritParams(Node* otherNode) +{ + // inherit the parameters that make sense (keep adding later) + SDPElementWiseOpNode* otherEW = NodeFactory::nodeCast(otherNode); + params().setConvMode(otherEW->params().convMode()); + params().setWinogradParams(otherEW->params().winogradParams()); + params().setNumGroups(otherEW->params().numGroups()); +} + +NvDlaError engine_ast::SDPElementWiseOpNode::populateEdgePorts() +{ + NvDlaError e = NvDlaSuccess; + + EdgeSequence inputEdges = graph()->upstreamDataEdges(this); + EdgeSequence outputEdges = graph()->downstreamDataEdges(this); + + /** + * should be exactly 2 upstream edges; + */ + if (inputEdges.size() != 2) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Elt wise op has input edges (%d) != 2 ", inputEdges.size()); + } + + for (EdgeSequenceIterator iei = inputEdges.begin(); iei != inputEdges.end(); ++iei) + { + markInputEdge(*iei); + } + + /** + * should be exactly only 1 output edge, it should be the data output, + * none of the engine nodes is capable of >1 outputs, fail if so since + * concat and split nodes are handled separately + */ + if (outputEdges.size() != 1) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Elt wise op has output edges (%d) != 1 ", outputEdges.size()); + } + + markOutputEdge(outputEdges[0]); + + PROPAGATE_ERROR_FAIL(verifyEdgePorts()); + +fail: + return e; +} + +engine_ast::Node* engine_ast::SDPElementWiseOpNode::mergeWithSDPOp(SDPNode* nextSDP) +{ + Node* removableNode = NULL; + + // If activation is already enabled, do not allow any math op fusions + if (params().x1Params().actType().v() != SDP_ACT_TYPE_UNKNOWN + && params().x1Params().actType().v() != SDP_ACT_TYPE_NONE) + { + if (graph()->debugMathOptz()) + { + gLogInfo << "Merge not feasible: " << this->name() << " activation: "; + gLogInfo << NvU16(params().x1Params().actType().v()) << endl; + } + goto fail; + } + + // fixme: limit the elt math op fusion with only relu for now + if (nextSDP->engineOpType().v() == EngineOpTypeEnum::SDP_ACTIVATION) + { + removableNode = tryToMergeWithActOp(nextSDP); + } + +fail: + return removableNode; +} +/*------------------Low Precision Conversions--------------------------*/ +NvDlaError engine_ast::SDPElementWiseOpNode::performPerTensorRescaling +( + std::vector& inTensorScales, + std::vector& outTensorScales, + PrecisionCVTParams& outCvt +) +{ + NvDlaError e = NvDlaSuccess; + + NvS16 perTensorScl = 0; + NvU8 perTensorShft = 0; + NvF32 outputRescale = 0.0f; + std::pair scaleAndShift; + + NvF32 perTensorInTensorScl = inTensorScales.at(0); + NvF32 perTensorOutTensorScl = outTensorScales.at(0); + + ASSERT ( inTensorScales.size() == (size_t)inputEdges().at(0)->tensorSurfaceDesc()->dimensions().c ); + for (NvF32 its = 1; its < inTensorScales.size(); ++its) + { + if ( perTensorInTensorScl != inTensorScales[its] ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Channel scales should be same for input of %s when PER_TENSOR " + "scaling is ON", name().c_str()); + } + } + + ASSERT ( outTensorScales.size() == (size_t)outputEdges().at(0)->tensorSurfaceDesc()->dimensions().c ); + for (NvF32 ots = 1; ots < outTensorScales.size(); ++ots) + { + if ( perTensorOutTensorScl != outTensorScales[ots] ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Channel scales should be same for output of %s when PER_TENSOR " + "scaling is ON", name().c_str()); + } + } + + outputRescale = perTensorInTensorScl / perTensorOutTensorScl; + calculateScaleAndShiftFromScalar(outputRescale, &scaleAndShift); + + perTensorScl = scaleAndShift.first; + perTensorShft = scaleAndShift.second; + + if (graph()->debugQuantization()) + { + gLogInfo << "Si / So = " << perTensorInTensorScl << " / " << perTensorOutTensorScl + << " = " << perTensorScl << "* 2^-" << (int)perTensorShft << endl; + } + + outCvt.setEnable(1); + outCvt.setOffset(0); + outCvt.setScale(perTensorScl); + outCvt.setTruncate(perTensorShft); + +fail: + return e; +} + +NvDlaError engine_ast::SDPElementWiseOpNode::handleLowPrecisionConversions() +{ + NvDlaError e = NvDlaSuccess; + + PrecisionCVTParams outCvt; + + std::vector inTensorScales; + std::vector outTensorScales; + + PROPAGATE_ERROR_FAIL( verifyEdgePorts() ); + + if (graph()->profile()->computePrecision().v() != surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8) + { + // nop + goto fail; + } + + if ( graph()->profile()->tensorScalingMode().v() != nvdla::TensorScalingMode::PER_TENSOR ) + { + // don't support any other scaling mode than PER_TENSOR + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Don't support tensor scaling mode: %s\n", + graph()->profile()->tensorScalingMode().c_str()); + } + + inTensorScales = inputEdges().at(0)->originalTensor()->getChannelScales(); + outTensorScales = outputEdges().at(0)->originalTensor()->getChannelScales(); + + PROPAGATE_ERROR_FAIL( performPerTensorRescaling(inTensorScales, + outTensorScales, + outCvt) ); + + params().setOutCVT(outCvt); + +fail: + return e; +} + +/* Configure SDP SuperOp SubEngine with Eltwise Op */ +NvDlaError engine_ast::SDPElementWiseOpNode::configureSDPSuperOpSubEngine(SDPSuperOpNode* sdpSuperOp, SDPSubEngineType xN) +{ + NvDlaError e = NvDlaSuccess; + + if (xN == SDP_ENGINE_X1) + { + sdpSuperOp->params().setX1Params(params().x1Params()); + sdpSuperOp->params().setConvMode(params().convMode()); + sdpSuperOp->params().setWinogradParams(params().winogradParams()); + } + else + { + sdpSuperOp->params().setX2Params(params().x1Params()); + } + + sdpSuperOp->params().setOutCVT(params().outCVT()); + sdpSuperOp->params().setAuxDataType(xN, TensorType::kIO); + + if ( graph()->debugFuseSubEngineOps() ) + { + gLogInfo << "configureSDPSuperOpSubEngine: " << this->name() << " in "; + gLogInfo << sdpSuperOp->name() << " x" << (NvU16)xN.e()+1 << endl; + } + + return e; +} + +engine_ast::Node* engine_ast::SDPElementWiseOpNode::getPeerSource(SDPNode* currentSource) +{ + NvDlaError e = NvDlaSuccess; + engine_ast::Node* peerSource = NULL; + NodeSequence sourceNodes = graph()->upstreamDataNodes(this); + NVDLA_UNUSED(e); + + if (sourceNodes.size() != 2) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "%s doesn't have 2 source nodes\n", + name().c_str()); + } + else if (currentSource == sourceNodes[0]) + { + peerSource = sourceNodes[1]; + } + else + { + peerSource = sourceNodes[0]; + } + +fail: + return peerSource; +} + +NvDlaError engine_ast::SDPElementWiseOpNode::emitOp(Graph *g, + DLAInterface *target_dla, + NvU32 op_slot, NvU32 batch_id, + DLACommonOpDescAccessor dep, + DLAOperationContainerAccessor op, + DLASurfaceContainerAccessor surf) +{ + NvDlaError e = NvDlaSuccess; + DLASDPOpDescAccessor sdp_op = op.sdpOpDescAccessor(0); + DLACVTParamAccessor out_cvt_acc = sdp_op.outCVTAccessor(); + DLASDPOpAccessor x1_op_acc = sdp_op.x1OpAccessor(); + DLASDPOpAccessor x2_op_acc = sdp_op.x2OpAccessor(); + DLASDPOpAccessor y_op_acc = sdp_op.yOpAccessor(); + DLASDPSurfaceDescAccessor surf_acc = surf.sdpSurfaceDescAccessor(0); + DLADataCubeAccessor src_data_acc = surf_acc.srcDataAccessor(); + DLADataCubeAccessor dst_data_acc = surf_acc.dstDataAccessor(); + DLADataCubeAccessor x1_data_acc = surf_acc.x1DataAccessor(); + DLADataCubeAccessor x2_data_acc = surf_acc.x2DataAccessor(); + DLADataCubeAccessor y_data_acc = surf_acc.yDataAccessor(); + DLAConsumerAccessor fused_acc = dep.fusedParentAccessor(); + NVDLA_UNUSED(x2_data_acc); + NVDLA_UNUSED(y_data_acc); + NVDLA_UNUSED(fused_acc); + + surface::TensorSurfaceDesc *src_one_tsd = g->nodeInputTensorSurface(this, 0, supportedInSurfCategories()); + surface::TensorSurfaceDesc *src_two_tsd = g->nodeInputTensorSurface(this, 1, supportedInSurfCategories()); + surface::TensorSurfaceDesc *dst_tsd = g->nodeOutputTensorSurface(this, 0, supportedOutSurfCategories()); + + *sdp_op.srcPrecision() = ASTToDLAInterface::getSDPPrecision(target_dla, src_one_tsd->surfaceFormat().precision()); + *sdp_op.dstPrecision() = ASTToDLAInterface::getSDPPrecision(target_dla, dst_tsd->surfaceFormat().precision()); + *sdp_op.LUTIndex() = -1; + *sdp_op.batchNum() = 1; + *sdp_op.batchStride() = 0; + + *out_cvt_acc.scale() = params().outCVT().scale(); + *out_cvt_acc.truncate() = params().outCVT().truncate(); + *out_cvt_acc.offset() = params().outCVT().offset(); + *out_cvt_acc.enable() = static_cast(params().outCVT().isEnable()); + + *x1_op_acc.enable() = ASTToDLAInterface::getSDPEnable(target_dla, params(batch_id).x1Params().enabled()); + *x1_op_acc.ALUType() = ASTToDLAInterface::getSDPALUType(target_dla, params(batch_id).x1Params().aluType()); + *x1_op_acc.type() = ASTToDLAInterface::getSDPOpType(target_dla, params(batch_id).x1Params().opType()); + *x1_op_acc.mode() = ASTToDLAInterface::getSDPMode(target_dla, params(batch_id).x1Params().mode()); + *x1_op_acc.act() = ASTToDLAInterface::getSDPActType(target_dla, params(batch_id).x1Params().actType()); + *x1_op_acc.shiftValue() = 0; + *x1_op_acc.ALUOperand() = 0; + *x1_op_acc.MulOperand() = 1; + *x1_op_acc.truncate() = 0; + *x1_op_acc.precision() = *sdp_op.srcPrecision(); // precision of engine = precision of its input tensor + + *x2_op_acc.enable() = 0; + *y_op_acc.enable() = 0; + + emitDependencyParams(target_dla, dep, batch_id); + setDataCubeAccessor(src_data_acc, src_one_tsd, IODirectionEnum::INPUT, batch_id); + setDataCubeAccessor(x1_data_acc, src_two_tsd, IODirectionEnum::UNKNOWN, batch_id); + setDataCubeAccessor(dst_data_acc, dst_tsd, IODirectionEnum::OUTPUT, batch_id); + + if ( params(batch_id).convMode().v() == ConvolutionModeEnum::CONV_WINOGRAD ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unsupported WINOGRAD Conv mode for %s", name().c_str()); + } + else if ( params(batch_id).convMode().v() == ConvolutionModeEnum::CONV_DIRECT ) + { + *sdp_op.convMode() = sdp_op.convMode_Direct(); + } + else + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unsupported Conv mode for %s", name().c_str()); + } + + if ( g->debugOps() ) + { + gLogInfo << "SDP EW node @ op_slot = " << op_slot << " batch_id = " << batch_id << endl; + gLogInfo << "\tsrc precision " << (int)*sdp_op.srcPrecision() << endl; + gLogInfo << "\tdst precision " << (int)*sdp_op.dstPrecision() << endl; + gLogInfo << "\tx1 enable " << (int)*x1_op_acc.enable() << endl; + if (*x1_op_acc.enable()) + { + gLogInfo << "\tx1 precision " << (int)*x1_op_acc.precision() << endl; + gLogInfo << "\tx1 aluType " << (int)*x1_op_acc.ALUType() << endl; + gLogInfo << "\tx1 type " << (int)*x1_op_acc.type() << endl; + gLogInfo << "\tx1 mode " << (int)*x1_op_acc.mode() << endl; + gLogInfo << "\tx1 act " << (int)*x1_op_acc.act() << endl; + gLogInfo << "\tx1 shiftValue " << (int)*x1_op_acc.shiftValue() << endl; + gLogInfo << "\tx1 aluOperand " << (int)*x1_op_acc.ALUOperand() << endl; + gLogInfo << "\tx1 mulOperand " << (int)*x1_op_acc.MulOperand() << endl; + gLogInfo << "\tx1 truncate " << (int)*x1_op_acc.truncate() << endl; + } + gLogInfo << "\tx2 enable " << (int)*x2_op_acc.enable() << endl; + if (*x2_op_acc.enable()) + { + gLogInfo << "\tx2 precision " << (int)*x2_op_acc.precision() << endl; + gLogInfo << "\tx2 aluType " << (int)*x2_op_acc.ALUType() << endl; + gLogInfo << "\tx2 type " << (int)*x2_op_acc.type() << endl; + gLogInfo << "\tx2 mode " << (int)*x2_op_acc.mode() << endl; + gLogInfo << "\tx2 act " << (int)*x2_op_acc.act() << endl; + gLogInfo << "\tx2 shiftValue " << (int)*x2_op_acc.shiftValue() << endl; + gLogInfo << "\tx2 aluOperand " << (int)*x2_op_acc.ALUOperand() << endl; + gLogInfo << "\tx2 mulOperand " << (int)*x2_op_acc.MulOperand() << endl; + gLogInfo << "\tx2 truncate " << (int)*x2_op_acc.truncate() << endl; + } + gLogInfo << "\ty enable " << (int)*y_op_acc.enable() << endl; + if (*y_op_acc.enable()) + { + gLogInfo << "\ty precision " << (int)*y_op_acc.precision() << endl; + gLogInfo << "\ty aluType " << (int)*y_op_acc.ALUType() << endl; + gLogInfo << "\ty type " << (int)*y_op_acc.type() << endl; + gLogInfo << "\ty mode " << (int)*y_op_acc.mode() << endl; + gLogInfo << "\ty act " << (int)*y_op_acc.act() << endl; + gLogInfo << "\ty shiftValue " << (int)*y_op_acc.shiftValue() << endl; + gLogInfo << "\ty aluOperand " << (int)*y_op_acc.ALUOperand() << endl; + gLogInfo << "\ty mulOperand " << (int)*y_op_acc.MulOperand() << endl; + gLogInfo << "\ty truncate " << (int)*y_op_acc.truncate() << endl; + } + gLogInfo << "\tsrc1 tsd:" << src_one_tsd->id() << endl; + gLogInfo << "\tsrc2 tsd:" << src_two_tsd->id() << endl; + gLogInfo << "\tdst tsd:" << dst_tsd->id() << endl; + gLogInfo << "\tdependencyCount" << (int)*dep.dependencyCount() << endl; + gLogInfo << "\tsrc1 addr=" << *src_data_acc.address() << endl; + gLogInfo << "\tsrc1 type=" << (int)*src_data_acc.type() << endl; + gLogInfo << "\tsrc1 size " << *src_data_acc.size() << endl; + gLogInfo << "\tsrc1 width " << *src_data_acc.width() << endl; + gLogInfo << "\tsrc1 height " << *src_data_acc.height() << endl; + gLogInfo << "\tsrc1 channel " << *src_data_acc.channel() << endl; + gLogInfo << "\tsrc1 linestride " << *src_data_acc.lineStride() << endl; + gLogInfo << "\tsrc1 surfstride " << *src_data_acc.surfStride() << endl; + gLogInfo << "\tsrc2 addr=" << *x1_data_acc.address() << endl; + gLogInfo << "\tsrc2 type=" << (int)*x1_data_acc.type() << endl; + gLogInfo << "\tsrc2 size " << *x1_data_acc.size() << endl; + gLogInfo << "\tsrc2 width " << *x1_data_acc.width() << endl; + gLogInfo << "\tsrc2 height " << *x1_data_acc.height() << endl; + gLogInfo << "\tsrc2 channel " << *x1_data_acc.channel() << endl; + gLogInfo << "\tsrc2 linestride " << *x1_data_acc.lineStride() << endl; + gLogInfo << "\tsrc2 surfstride " << *x1_data_acc.surfStride() << endl; + gLogInfo << "\tdst addr=" << *dst_data_acc.address() << endl; + gLogInfo << "\tdst type=" << (int)*dst_data_acc.type() << endl; + gLogInfo << "\tdst size " << *dst_data_acc.size() << endl; + gLogInfo << "\tdst width " << *dst_data_acc.width() << endl; + gLogInfo << "\tdst height " << *dst_data_acc.height() << endl; + gLogInfo << "\tdst channel " << *dst_data_acc.channel() << endl; + gLogInfo << "\tdst linestride " << *dst_data_acc.lineStride() << endl; + gLogInfo << "\tdst surfstride " << *dst_data_acc.surfStride() << endl; + gLogInfo << "\tout_cvt enable " << (int)*out_cvt_acc.enable() << endl; + gLogInfo << "\tout_cvt scale " << (int)*out_cvt_acc.scale() << endl; + gLogInfo << "\tout_cvt offset " << (int)*out_cvt_acc.offset() << endl; + gLogInfo << "\tout_cvt truncate " << (int)*out_cvt_acc.truncate() << endl; + } + +fail: + return e; +} + +#ifdef NVDLA_COMPILER_OUTPUT_FOR_PROTOTEST +static nvdla_prototest_interface::SDPOpType opType2InfOpType(engine_ast::SDPOpType ot) +{ + nvdla_prototest_interface::SDPOpType iot = nvdla_prototest_interface::SDP_OP_ADD; + switch(ot.v()) + { + case engine_ast::SDPOpTypeEnum::SDP_OP_TYPE_ADD : iot = + nvdla_prototest_interface::SDP_OP_ADD; break; + case engine_ast::SDPOpTypeEnum::SDP_OP_TYPE_MUL: iot = + nvdla_prototest_interface::SDP_OP_MUL; break; + default: + REPORT_ERROR(NvDlaError_BadParameter, "Unknown op mode: %s", ot.c_str()); + } + + return iot; +} + +static nvdla_prototest_interface::ALUType aluType2InfAluType(engine_ast::SDPALUType at) +{ + nvdla_prototest_interface::ALUType iat = nvdla_prototest_interface::ALU_SUM; + switch(at.v()) + { + case engine_ast::SDPALUTypeEnum::SDP_ALU_TYPE_MAX : iat = + nvdla_prototest_interface::ALU_MAX; break; + case engine_ast::SDPALUTypeEnum::SDP_ALU_TYPE_MIN: iat = + nvdla_prototest_interface::ALU_MIN; break; + case engine_ast::SDPALUTypeEnum::SDP_ALU_TYPE_SUM: iat = + nvdla_prototest_interface::ALU_SUM; break; + case engine_ast::SDPALUTypeEnum::SDP_ALU_TYPE_EQL: iat = + nvdla_prototest_interface::ALU_EQL; break; + default: + REPORT_ERROR(NvDlaError_BadParameter, "Unknown op mode: %s", at.c_str()); + } + + return iat; +} + +static nvdla_prototest_interface::SDPActivation actType2InfActType(engine_ast::SDPActType at) +{ + nvdla_prototest_interface::SDPActivation iat = nvdla_prototest_interface::SDPActivation::ACT_NONE; + switch(at.v()) + { + case engine_ast::SDPActTypeEnum::SDP_ACT_TYPE_NONE: iat = + nvdla_prototest_interface::SDPActivation::ACT_NONE; break; + case engine_ast::SDPActTypeEnum::SDP_ACT_TYPE_RELU: iat = + nvdla_prototest_interface::SDPActivation::ACT_RELU; break; + case engine_ast::SDPActTypeEnum::SDP_ACT_TYPE_TANH: + case engine_ast::SDPActTypeEnum::SDP_ACT_TYPE_SIGMOID:iat = + nvdla_prototest_interface::SDPActivation::ACT_LUT; break; + default: + REPORT_ERROR(NvDlaError_BadParameter, "Unknown act type: %s", at.c_str()); + } + + return iat; +} + +NvDlaError engine_ast::SDPElementWiseOpNode::emitOp(NvU32 op_slot, NvU32 batch_id, + DLAInterface* target_dla, + DLACommonOpDescAccessor& dep, + DLAOperationContainerAccessor& op, + DLASurfaceContainerAccessor& surf, + nvdla_prototest_interface::Layer* protoLayer) +{ + NvDlaError e = NvDlaSuccess; + NvU8 numConsumers = 0; + + DLASDPOpDescAccessor sdp_op = op.sdpOpDescAccessor(0); + DLACVTParamAccessor out_cvt_acc = sdp_op.outCVTAccessor(); + DLASDPOpAccessor x1_op_acc = sdp_op.x1OpAccessor(); + DLASDPOpAccessor x2_op_acc = sdp_op.x2OpAccessor(); + DLASDPOpAccessor y_op_acc = sdp_op.yOpAccessor(); + DLASDPSurfaceDescAccessor surf_acc = surf.sdpSurfaceDescAccessor(0); + DLADataCubeAccessor src_data_acc = surf_acc.srcDataAccessor(); + DLADataCubeAccessor dst_data_acc = surf_acc.dstDataAccessor(); + DLADataCubeAccessor x1_data_acc = surf_acc.x1DataAccessor(); + DLADataCubeAccessor x2_data_acc = surf_acc.x2DataAccessor(); + DLADataCubeAccessor y_data_acc = surf_acc.yDataAccessor(); + DLAConsumerAccessor fused_acc = dep.fusedParentAccessor(); + NVDLA_UNUSED(out_cvt_acc); + NVDLA_UNUSED(x2_data_acc); + NVDLA_UNUSED(y_data_acc); + NVDLA_UNUSED(batch_id); + + surface::TensorSurfaceDesc *src1_tsd = graph()->nodeInputTensorSurface(this, 0, supportedInSurfCategories()); + surface::TensorSurfaceDesc *src2_tsd = graph()->nodeInputTensorSurface(this, 1, supportedInSurfCategories()); + surface::TensorSurfaceDesc *dst_tsd = graph()->nodeOutputTensorSurface(this, 0, supportedOutSurfCategories()); + + + + nvdla_prototest_interface::SDPOpDesc* protoSDPOpDesc = protoLayer->mutable_op_config()->mutable_sdp_op(); + nvdla_prototest_interface::SDPSurfaceDesc* protoSDPSurfDesc = protoLayer->mutable_surface()->mutable_sdp_surface(); + nvdla_prototest_interface::SDPOp* protoSDPX1OpDesc = protoSDPOpDesc->mutable_x1_op(); + nvdla_prototest_interface::SDPOp* protoSDPX2OpDesc = protoSDPOpDesc->mutable_x2_op(); + nvdla_prototest_interface::SDPOp* protoSDPYOpDesc = protoSDPOpDesc->mutable_y_op(); + nvdla_prototest_interface::DataCube* protoSrcDataCube = protoSDPSurfDesc->mutable_src_data(); + nvdla_prototest_interface::DataCube* protoDstDataCube = protoSDPSurfDesc->mutable_dst_data(); + nvdla_prototest_interface::DataCube* protoX1DataCube = protoSDPSurfDesc->mutable_x1_data(); + nvdla_prototest_interface::DataPrecision protoSrcPrec, protoDstPrec; + + protoLayer->set_index(op_slot); + protoLayer->set_roi_index(0); + protoLayer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_SDP); + protoLayer->set_dependency_count(*dep.dependencyCount()); + + /* consumers */ + for (size_t c = 0; c < EngineType::num_elements(); c++) + { + NvS8 fw_op_index = ASTToDLAInterface::getEngineType(target_dla, c); + if ( fw_op_index < 0 ) + { + continue; + } + + DLAConsumerAccessor cons_acc = dep.consumerAccessor(fw_op_index); + if (*cons_acc.index() != -1) { + numConsumers++; + nvdla_prototest_interface::Consumer* protoConsumer = protoLayer->add_bottom(); + protoConsumer->set_index(*cons_acc.index()); + switch(c) { + case EngineTypeEnum::BDMA : protoConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_BDMA); break; + case EngineTypeEnum::CONVOLUTION : protoConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_CONV); break; + case EngineTypeEnum::SDP : protoConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_SDP); break; + case EngineTypeEnum::PDP : protoConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_PDP); break; + case EngineTypeEnum::CDP : protoConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_CDP); break; + case EngineTypeEnum::RUBIK: protoConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_RUBIK); break; + default: ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unrecognized consumer"); + } + switch(dependencyParams().consumer(c).opEvent().v()) { + case OperationEventTypeEnum::OP_CDMA_WEIGHT_DONE : protoConsumer->set_event(nvdla_prototest_interface::Consumer_EventType::Consumer_EventType_CDMA_WT_DONE); break; + case OperationEventTypeEnum::OP_CDMA_DATA_DONE : protoConsumer->set_event(nvdla_prototest_interface::Consumer_EventType::Consumer_EventType_CDMA_DT_DONE); break; + case OperationEventTypeEnum::OP_COMPLETED : protoConsumer->set_event(nvdla_prototest_interface::Consumer_EventType::Consumer_EventType_OP_COMPLETED); break; + case OperationEventTypeEnum::OP_ENABLED : protoConsumer->set_event(nvdla_prototest_interface::Consumer_EventType::Consumer_EventType_OP_ENABLED); break; + case OperationEventTypeEnum::OP_PROGRAMMED : protoConsumer->set_event(nvdla_prototest_interface::Consumer_EventType::Consumer_EventType_OP_PROGRAMMED); break; + default: ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unrecognized consumer event"); + } + } + } + + /* fused node */ + if (dependencyParams().fusedNode(engine_ast::IODirectionEnum::INPUT)) + { + nvdla_prototest_interface::Consumer* protoFusedConsumer = protoLayer->mutable_fused(); + protoFusedConsumer->set_index(*fused_acc.index()); + protoFusedConsumer->set_event(nvdla_prototest_interface::Consumer_EventType::Consumer_EventType_OP_ENABLED); + switch(dependencyParams().fusedNode(engine_ast::IODirectionEnum::INPUT)->engineType().v()) { + case EngineTypeEnum::CONVOLUTION: protoFusedConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_CONV); break; + default: ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "SDP can have only Conv op as its fused partner on input side"); + } + } + + switch(src1_tsd->surfaceFormat().precision().v()) { + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_FP16 : protoSrcPrec = nvdla_prototest_interface::DataPrecision::PRECISION_FP16; break; + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16 : protoSrcPrec = nvdla_prototest_interface::DataPrecision::PRECISION_INT16; break; + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8 : protoSrcPrec = nvdla_prototest_interface::DataPrecision::PRECISION_INT8; break; + default: ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unrecognized src precision"); + } + + switch(dst_tsd->surfaceFormat().precision().v()) { + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_FP16 : protoDstPrec = nvdla_prototest_interface::DataPrecision::PRECISION_FP16; break; + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16 : protoDstPrec = nvdla_prototest_interface::DataPrecision::PRECISION_INT16; break; + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8 : protoDstPrec = nvdla_prototest_interface::DataPrecision::PRECISION_INT8; break; + default: ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unrecognized dst precision"); + } + + protoSDPOpDesc->set_src_precision(protoSrcPrec); + protoSDPOpDesc->set_dst_precision(protoDstPrec); + protoSDPOpDesc->set_lut_index(-1); + + protoSDPOpDesc->mutable_out_cvt()->set_enable(1); + protoSDPOpDesc->mutable_out_cvt()->set_offset(0); + protoSDPOpDesc->mutable_out_cvt()->set_scale(1); + protoSDPOpDesc->mutable_out_cvt()->set_truncate(0); + + protoSDPOpDesc->set_conv_mode(nvdla_prototest_interface::ConvMode::DIRECT); + protoSDPOpDesc->set_batch_num(1); + protoSDPOpDesc->set_batch_stride(0); + + protoSDPX1OpDesc->set_enable(*x1_op_acc.enable()); + protoSDPX1OpDesc->set_alu_type(aluType2InfAluType(params(batch_id).x1Params().aluType())); + protoSDPX1OpDesc->set_type(opType2InfOpType(params(batch_id).x1Params().opType())); + protoSDPX1OpDesc->set_mode(nvdla_prototest_interface::SDPOp_SDPOpMode::SDPOp_SDPOpMode_SDP_OP_PER_POINT); + protoSDPX1OpDesc->set_act(actType2InfActType(params().x1Params().actType())); + protoSDPX1OpDesc->set_shift_value(*x1_op_acc.shiftValue()); + protoSDPX1OpDesc->set_alu_operand(*x1_op_acc.ALUOperand()); + protoSDPX1OpDesc->set_mul_operand(*x1_op_acc.MulOperand()); + protoSDPX1OpDesc->set_truncate(*x1_op_acc.truncate()); + protoSDPX1OpDesc->set_precision(protoSrcPrec); + protoSDPX1OpDesc->mutable_cvt()->mutable_alu_cvt()->set_enable(*x1_op_acc.cvt().aluCVTAccessor().enable()); + protoSDPX1OpDesc->mutable_cvt()->mutable_alu_cvt()->set_truncate(*x1_op_acc.cvt().aluCVTAccessor().truncate()); + protoSDPX1OpDesc->mutable_cvt()->mutable_alu_cvt()->set_scale(*x1_op_acc.cvt().aluCVTAccessor().scale()); + protoSDPX1OpDesc->mutable_cvt()->mutable_alu_cvt()->set_offset(*x1_op_acc.cvt().aluCVTAccessor().offset()); + protoSDPX1OpDesc->mutable_cvt()->mutable_mul_cvt()->set_enable(*x1_op_acc.cvt().mulCVTAccessor().enable()); + protoSDPX1OpDesc->mutable_cvt()->mutable_mul_cvt()->set_truncate(*x1_op_acc.cvt().mulCVTAccessor().truncate()); + protoSDPX1OpDesc->mutable_cvt()->mutable_mul_cvt()->set_scale(*x1_op_acc.cvt().mulCVTAccessor().scale()); + protoSDPX1OpDesc->mutable_cvt()->mutable_mul_cvt()->set_offset(*x1_op_acc.cvt().mulCVTAccessor().offset()); + + protoSDPX2OpDesc->set_enable(*x2_op_acc.enable()); + protoSDPX2OpDesc->set_alu_type(nvdla_prototest_interface::ALUType::ALU_SUM); + protoSDPX2OpDesc->set_type(nvdla_prototest_interface::SDPOpType::SDP_OP_ADD); + protoSDPX2OpDesc->set_mode(nvdla_prototest_interface::SDPOp_SDPOpMode::SDPOp_SDPOpMode_SDP_OP_PER_KERNEL); + protoSDPX2OpDesc->set_act(nvdla_prototest_interface::SDPActivation::ACT_NONE); + protoSDPX2OpDesc->set_shift_value(*x2_op_acc.shiftValue()); + protoSDPX2OpDesc->set_alu_operand(*x2_op_acc.ALUOperand()); + protoSDPX2OpDesc->set_mul_operand(*x2_op_acc.MulOperand()); + protoSDPX2OpDesc->set_truncate(*x2_op_acc.truncate()); + protoSDPX2OpDesc->set_precision(protoSrcPrec); + protoSDPX2OpDesc->mutable_cvt()->mutable_alu_cvt()->set_enable(*x2_op_acc.cvt().aluCVTAccessor().enable()); + protoSDPX2OpDesc->mutable_cvt()->mutable_alu_cvt()->set_truncate(*x2_op_acc.cvt().aluCVTAccessor().truncate()); + protoSDPX2OpDesc->mutable_cvt()->mutable_alu_cvt()->set_scale(*x2_op_acc.cvt().aluCVTAccessor().scale()); + protoSDPX2OpDesc->mutable_cvt()->mutable_alu_cvt()->set_offset(*x2_op_acc.cvt().aluCVTAccessor().offset()); + protoSDPX2OpDesc->mutable_cvt()->mutable_mul_cvt()->set_enable(*x2_op_acc.cvt().mulCVTAccessor().enable()); + protoSDPX2OpDesc->mutable_cvt()->mutable_mul_cvt()->set_truncate(*x2_op_acc.cvt().mulCVTAccessor().truncate()); + protoSDPX2OpDesc->mutable_cvt()->mutable_mul_cvt()->set_scale(*x2_op_acc.cvt().mulCVTAccessor().scale()); + protoSDPX2OpDesc->mutable_cvt()->mutable_mul_cvt()->set_offset(*x2_op_acc.cvt().mulCVTAccessor().offset()); + + + protoSDPYOpDesc->set_enable(*y_op_acc.enable()); + protoSDPYOpDesc->set_alu_type(nvdla_prototest_interface::ALUType::ALU_SUM); + protoSDPYOpDesc->set_type(nvdla_prototest_interface::SDPOpType::SDP_OP_MUL); + protoSDPYOpDesc->set_mode(nvdla_prototest_interface::SDPOp_SDPOpMode::SDPOp_SDPOpMode_SDP_OP_PER_KERNEL); + protoSDPYOpDesc->set_act(nvdla_prototest_interface::SDPActivation::ACT_NONE); + protoSDPYOpDesc->set_shift_value(*y_op_acc.shiftValue()); + protoSDPYOpDesc->set_alu_operand(*y_op_acc.ALUOperand()); + protoSDPYOpDesc->set_mul_operand(*y_op_acc.MulOperand()); + protoSDPYOpDesc->set_truncate(*y_op_acc.truncate()); + protoSDPYOpDesc->set_precision(protoSrcPrec); + protoSDPYOpDesc->mutable_cvt()->mutable_alu_cvt()->set_enable(*y_op_acc.cvt().aluCVTAccessor().enable()); + protoSDPYOpDesc->mutable_cvt()->mutable_alu_cvt()->set_truncate(*y_op_acc.cvt().aluCVTAccessor().truncate()); + protoSDPYOpDesc->mutable_cvt()->mutable_alu_cvt()->set_scale(*y_op_acc.cvt().aluCVTAccessor().scale()); + protoSDPYOpDesc->mutable_cvt()->mutable_alu_cvt()->set_offset(*y_op_acc.cvt().aluCVTAccessor().offset()); + protoSDPYOpDesc->mutable_cvt()->mutable_mul_cvt()->set_enable(*y_op_acc.cvt().mulCVTAccessor().enable()); + protoSDPYOpDesc->mutable_cvt()->mutable_mul_cvt()->set_truncate(*y_op_acc.cvt().mulCVTAccessor().truncate()); + protoSDPYOpDesc->mutable_cvt()->mutable_mul_cvt()->set_scale(*y_op_acc.cvt().mulCVTAccessor().scale()); + protoSDPYOpDesc->mutable_cvt()->mutable_mul_cvt()->set_offset(*y_op_acc.cvt().mulCVTAccessor().offset()); + + + if (*fused_acc.index() != -1) { + protoSrcDataCube->set_type(nvdla_prototest_interface::MemType::DLA_MEM_HW); + } else { + protoSrcDataCube->set_type(nvdla_prototest_interface::MemType::DLA_MEM_MC); + } + protoSrcDataCube->set_address(*src_data_acc.address()); + protoSrcDataCube->set_size(src1_tsd->tensorBufferDesc()->size() - src1_tsd->bufferOffset()); + protoSrcDataCube->set_width(*src_data_acc.width()); + protoSrcDataCube->set_height(*src_data_acc.height()); + protoSrcDataCube->set_channel(*src_data_acc.channel()); + protoSrcDataCube->set_line_stride(*src_data_acc.lineStride()); + protoSrcDataCube->set_surf_stride(*src_data_acc.surfStride()); + protoSrcDataCube->set_plane_stride(*src_data_acc.planeStride()); + protoSrcDataCube->mutable_mem_info()->set_mem_id(src1_tsd->tensorBufferDesc()->memoryId(batch_id)); + protoSrcDataCube->mutable_mem_info()->set_mem_size(src1_tsd->tensorBufferDesc()->size()); + protoSrcDataCube->mutable_mem_info()->set_offset(src1_tsd->bufferOffset()); + + protoDstDataCube->set_type(nvdla_prototest_interface::MemType::DLA_MEM_MC); + protoDstDataCube->set_address(*dst_data_acc.address()); + protoDstDataCube->set_size(dst_tsd->tensorBufferDesc()->size() - dst_tsd->bufferOffset()); + protoDstDataCube->set_width(*dst_data_acc.width()); + protoDstDataCube->set_height(*dst_data_acc.height()); + protoDstDataCube->set_channel(*dst_data_acc.channel()); + protoDstDataCube->set_line_stride(*dst_data_acc.lineStride()); + protoDstDataCube->set_surf_stride(*dst_data_acc.surfStride()); + protoDstDataCube->set_plane_stride(*dst_data_acc.planeStride()); + protoDstDataCube->mutable_mem_info()->set_mem_id(dst_tsd->tensorBufferDesc()->memoryId(batch_id)); + protoDstDataCube->mutable_mem_info()->set_mem_size(dst_tsd->tensorBufferDesc()->size()); + protoDstDataCube->mutable_mem_info()->set_offset(dst_tsd->bufferOffset()); + if (numConsumers == 0) { + protoDstDataCube->mutable_mem_info()->set_fill_type(nvdla_prototest_interface::FillerType::FILL_NONE); + protoDstDataCube->mutable_mem_info()->set_flag(nvdla_prototest_interface::MemFlag::DLA_MEM_OUTPUT); + protoDstDataCube->mutable_mem_info()->set_precision(protoDstPrec); + } + + protoX1DataCube->set_type(nvdla_prototest_interface::MemType::DLA_MEM_MC); + protoX1DataCube->set_address(*x1_data_acc.address()); + protoX1DataCube->set_size(src2_tsd->tensorBufferDesc()->size()); + protoX1DataCube->set_width(*x1_data_acc.width()); + protoX1DataCube->set_height(*x1_data_acc.height()); + protoX1DataCube->set_channel(*x1_data_acc.channel()); + protoX1DataCube->set_line_stride(*x1_data_acc.lineStride()); + protoX1DataCube->set_surf_stride(*x1_data_acc.surfStride()); + protoX1DataCube->set_plane_stride(*x1_data_acc.planeStride()); + protoX1DataCube->mutable_mem_info()->set_mem_id(src2_tsd->tensorBufferDesc()->memoryId(batch_id)); + protoX1DataCube->mutable_mem_info()->set_mem_size(src2_tsd->tensorBufferDesc()->size()); + protoX1DataCube->mutable_mem_info()->set_offset(src2_tsd->bufferOffset()); +fail: + return e; +} +#endif + +}; // nvdla::priv + +}; // nvdla:: diff --git a/umd/core/src/compiler/engine-ast/SDPNOP.cpp b/umd/core/src/compiler/engine-ast/SDPNOP.cpp new file mode 100644 index 00000000..348e04ec --- /dev/null +++ b/umd/core/src/compiler/engine-ast/SDPNOP.cpp @@ -0,0 +1,439 @@ +/* + * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#include + +#include "priv/EngineAST.h" +#include "priv/Profile.h" + + +using std::endl; + +namespace nvdla +{ +namespace priv +{ + +void engine_ast::SDPNOPNode::captureCanonicalParams() +{ + NvDlaError e = NvDlaSuccess; + NVDLA_UNUSED(e); + switch(canonicalNode()->canonicalOpType().v()) + { + case canonical_ast::CanonicalOpTypeEnum::CONVOLUTION: { + canonical_ast::ConvolutionNode* canConvNode = canonical_ast::NodeFactory::nodeCast(canonicalNode()); + params().setNumGroups(canConvNode->params().numGroups()); + } break; + case canonical_ast::CanonicalOpTypeEnum::DECONVOLUTION: { + canonical_ast::DeconvolutionNode* canDeconvNode = canonical_ast::NodeFactory::nodeCast(canonicalNode()); + params().setNumGroups(canDeconvNode->params().numGroups()); + } break; + default: + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unrecognized canonical op type: %s", canonicalNode()->canonicalOpType().c_str()); + } + +fail: + return; +} + +void engine_ast::SDPNOPNode::inheritParams(Node* otherNode) +{ + // inherit the parameters that make sense (keep adding later) + SDPNOPNode* otherNOP = NodeFactory::nodeCast(otherNode); + params().setX1Params(otherNOP->params().x1Params()); + params().setConvMode(otherNOP->params().convMode()); + params().setWinogradParams(otherNOP->params().winogradParams()); + params().setNumGroups(otherNOP->params().numGroups()); + params().setOutCVT(otherNOP->params().outCVT()); +} + +NvDlaError engine_ast::SDPNOPNode::emitOp(Graph *g, + DLAInterface *target_dla, + NvU32 op_slot, NvU32 batch_id, + DLACommonOpDescAccessor dep, + DLAOperationContainerAccessor op, + DLASurfaceContainerAccessor surf) +{ + NvDlaError e = NvDlaSuccess; + + DLASDPOpDescAccessor sdp_op = op.sdpOpDescAccessor(0); + DLACVTParamAccessor out_cvt_acc = sdp_op.outCVTAccessor(); + DLASDPOpAccessor x1_op_acc = sdp_op.x1OpAccessor(); + DLASDPOpAccessor x2_op_acc = sdp_op.x2OpAccessor(); + DLASDPOpAccessor y_op_acc = sdp_op.yOpAccessor(); + DLASDPSurfaceDescAccessor surf_acc = surf.sdpSurfaceDescAccessor(0); + DLADataCubeAccessor src_data_acc = surf_acc.srcDataAccessor(); + DLADataCubeAccessor dst_data_acc = surf_acc.dstDataAccessor(); + DLADataCubeAccessor x1_data_acc = surf_acc.x1DataAccessor(); + DLADataCubeAccessor x2_data_acc = surf_acc.x2DataAccessor(); + DLADataCubeAccessor y_data_acc = surf_acc.yDataAccessor(); + NVDLA_UNUSED(x1_data_acc); + NVDLA_UNUSED(x2_data_acc); + NVDLA_UNUSED(y_data_acc); + + surface::TensorSurfaceDesc *src_tsd = g->nodeInputTensorSurface(this, 0, supportedInSurfCategories()); + surface::TensorSurfaceDesc *dst_tsd = g->nodeOutputTensorSurface(this, 0, supportedOutSurfCategories()); + + *sdp_op.srcPrecision() = ASTToDLAInterface::getSDPPrecision(target_dla, src_tsd->surfaceFormat().precision()); + *sdp_op.dstPrecision() = ASTToDLAInterface::getSDPPrecision(target_dla, dst_tsd->surfaceFormat().precision()); + *sdp_op.LUTIndex() = -1; + *sdp_op.batchNum() = 1; + *sdp_op.batchStride() = 0; + + *out_cvt_acc.scale() = params().outCVT().scale(); + *out_cvt_acc.truncate() = params().outCVT().truncate(); + *out_cvt_acc.offset() = params().outCVT().offset(); + *out_cvt_acc.enable() = static_cast(params().outCVT().isEnable()); + + *x1_op_acc.enable() = 0; + *x2_op_acc.enable() = 0; + *y_op_acc.enable() = 0; + + emitDependencyParams(target_dla, dep, batch_id); + setDataCubeAccessor(src_data_acc, src_tsd, IODirectionEnum::INPUT, batch_id); + setDataCubeAccessor(dst_data_acc, dst_tsd, IODirectionEnum::OUTPUT, batch_id); + + if ( params(batch_id).convMode().v() == ConvolutionModeEnum::CONV_WINOGRAD ) + { + *sdp_op.convMode() = sdp_op.convMode_Winograd(); + + *src_data_acc.width() = params().winogradParams().ioDims.w; + *src_data_acc.height() = params().winogradParams().ioDims.h; + + *dst_data_acc.width() = params().winogradParams().ioDims.w; + *dst_data_acc.height() = params().winogradParams().ioDims.h; + } + else if ( params(batch_id).convMode().v() == ConvolutionModeEnum::CONV_DIRECT ) + { + *sdp_op.convMode() = sdp_op.convMode_Direct(); + } + else + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unsupported Conv mode for %s", name().c_str()); + } + + if ( g->debugOps() ) + { + gLogInfo << "SDP NOP node @ op_slot = " << op_slot << " batch_id = " << batch_id << endl; + gLogInfo << "\tsrc precision " << (int)*sdp_op.srcPrecision() << endl; + gLogInfo << "\tdst precision " << (int)*sdp_op.dstPrecision() << endl; + gLogInfo << "\tx1 enable " << (int)*x1_op_acc.enable() << endl; + if (*x1_op_acc.enable()) + { + gLogInfo << "\tx1 precision " << (int)*x1_op_acc.precision() << endl; + gLogInfo << "\tx1 aluType " << (int)*x1_op_acc.ALUType() << endl; + gLogInfo << "\tx1 type " << (int)*x1_op_acc.type() << endl; + gLogInfo << "\tx1 mode " << (int)*x1_op_acc.mode() << endl; + gLogInfo << "\tx1 act " << (int)*x1_op_acc.act() << endl; + gLogInfo << "\tx1 shiftValue " << (int)*x1_op_acc.shiftValue() << endl; + gLogInfo << "\tx1 aluOperand " << (int)*x1_op_acc.ALUOperand() << endl; + gLogInfo << "\tx1 mulOperand " << (int)*x1_op_acc.MulOperand() << endl; + gLogInfo << "\tx1 truncate " << (int)*x1_op_acc.truncate() << endl; + } + gLogInfo << "\tx2 enable " << (int)*x2_op_acc.enable() << endl; + if (*x2_op_acc.enable()) + { + gLogInfo << "\tx2 precision " << (int)*x2_op_acc.precision() << endl; + gLogInfo << "\tx2 aluType " << (int)*x2_op_acc.ALUType() << endl; + gLogInfo << "\tx2 type " << (int)*x2_op_acc.type() << endl; + gLogInfo << "\tx2 mode " << (int)*x2_op_acc.mode() << endl; + gLogInfo << "\tx2 act " << (int)*x2_op_acc.act() << endl; + gLogInfo << "\tx2 shiftValue " << (int)*x2_op_acc.shiftValue() << endl; + gLogInfo << "\tx2 aluOperand " << (int)*x2_op_acc.ALUOperand() << endl; + gLogInfo << "\tx2 mulOperand " << (int)*x2_op_acc.MulOperand() << endl; + gLogInfo << "\tx2 truncate " << (int)*x2_op_acc.truncate() << endl; + } + gLogInfo << "\ty enable " << (int)*y_op_acc.enable() << endl; + if (*y_op_acc.enable()) + { + gLogInfo << "\ty precision " << (int)*y_op_acc.precision() << endl; + gLogInfo << "\ty aluType " << (int)*y_op_acc.ALUType() << endl; + gLogInfo << "\ty type " << (int)*y_op_acc.type() << endl; + gLogInfo << "\ty mode " << (int)*y_op_acc.mode() << endl; + gLogInfo << "\ty act " << (int)*y_op_acc.act() << endl; + gLogInfo << "\ty shiftValue " << (int)*y_op_acc.shiftValue() << endl; + gLogInfo << "\ty aluOperand " << (int)*y_op_acc.ALUOperand() << endl; + gLogInfo << "\ty mulOperand " << (int)*y_op_acc.MulOperand() << endl; + gLogInfo << "\ty truncate " << (int)*y_op_acc.truncate() << endl; + } + gLogInfo << "\tsrc tsd:" << src_tsd->id() << endl; + gLogInfo << "\tdst tsd:" << dst_tsd->id() << endl; + gLogInfo << "\tdependencyCount" << (int)*dep.dependencyCount() << endl; + gLogInfo << "\tsrc addr=" << *src_data_acc.address() << endl; + gLogInfo << "\tsrc type=" << (int)*src_data_acc.type() << endl; + gLogInfo << "\tsrc size " << *src_data_acc.size() << endl; + gLogInfo << "\tsrc width " << *src_data_acc.width() << endl; + gLogInfo << "\tsrc height " << *src_data_acc.height() << endl; + gLogInfo << "\tsrc channel " << *src_data_acc.channel() << endl; + gLogInfo << "\tsrc linestride " << *src_data_acc.lineStride() << endl; + gLogInfo << "\tsrc surfstride " << *src_data_acc.surfStride() << endl; + gLogInfo << "\tscale addr=" << *x1_data_acc.address() << endl; + gLogInfo << "\tscale type=" << (int)*x1_data_acc.type() << endl; + gLogInfo << "\tscale size " << *x1_data_acc.size() << endl; + gLogInfo << "\tscale width " << *x1_data_acc.width() << endl; + gLogInfo << "\tscale height " << *x1_data_acc.height() << endl; + gLogInfo << "\tscale channel " << *x1_data_acc.channel() << endl; + gLogInfo << "\tscale linestride " << *x1_data_acc.lineStride() << endl; + gLogInfo << "\tscale surfstride " << *x1_data_acc.surfStride() << endl; + gLogInfo << "\tdst addr=" << *dst_data_acc.address() << endl; + gLogInfo << "\tdst type=" << (int)*dst_data_acc.type() << endl; + gLogInfo << "\tdst size " << *dst_data_acc.size() << endl; + gLogInfo << "\tdst width " << *dst_data_acc.width() << endl; + gLogInfo << "\tdst height " << *dst_data_acc.height() << endl; + gLogInfo << "\tdst channel " << *dst_data_acc.channel() << endl; + gLogInfo << "\tdst linestride " << *dst_data_acc.lineStride() << endl; + gLogInfo << "\tdst surfstride " << *dst_data_acc.surfStride() << endl; + gLogInfo << "\tout_cvt enable " << (int)*out_cvt_acc.enable() << endl; + gLogInfo << "\tout_cvt scale " << (int)*out_cvt_acc.scale() << endl; + gLogInfo << "\tout_cvt offset " << (int)*out_cvt_acc.offset() << endl; + gLogInfo << "\tout_cvt truncate " << (int)*out_cvt_acc.truncate() << endl; + } + +fail: + return e; +} + +#ifdef NVDLA_COMPILER_OUTPUT_FOR_PROTOTEST +NvDlaError engine_ast::SDPNOPNode::emitOp(NvU32 op_slot, NvU32 batch_id, + DLAInterface* target_dla, + DLACommonOpDescAccessor& dep, + DLAOperationContainerAccessor& op, + DLASurfaceContainerAccessor& surf, + nvdla_prototest_interface::Layer* protoLayer) +{ + NvDlaError e = NvDlaSuccess; + NvU8 numConsumers = 0; + + DLASDPOpDescAccessor sdp_op = op.sdpOpDescAccessor(0); + DLACVTParamAccessor out_cvt_acc = sdp_op.outCVTAccessor(); + DLASDPOpAccessor x1_op_acc = sdp_op.x1OpAccessor(); + DLASDPOpAccessor x2_op_acc = sdp_op.x2OpAccessor(); + DLASDPOpAccessor y_op_acc = sdp_op.yOpAccessor(); + DLASDPSurfaceDescAccessor surf_acc = surf.sdpSurfaceDescAccessor(0); + DLADataCubeAccessor src_data_acc = surf_acc.srcDataAccessor(); + DLADataCubeAccessor dst_data_acc = surf_acc.dstDataAccessor(); + DLADataCubeAccessor x1_data_acc = surf_acc.x1DataAccessor(); + DLADataCubeAccessor x2_data_acc = surf_acc.x2DataAccessor(); + DLADataCubeAccessor y_data_acc = surf_acc.yDataAccessor(); + DLAConsumerAccessor fused_acc = dep.fusedParentAccessor(); + NVDLA_UNUSED(x1_data_acc); + NVDLA_UNUSED(x2_data_acc); + NVDLA_UNUSED(y_data_acc); + NVDLA_UNUSED(batch_id); + + surface::TensorSurfaceDesc *src_tsd = graph()->nodeInputTensorSurface(this, 0, supportedInSurfCategories()); + surface::TensorSurfaceDesc *dst_tsd = graph()->nodeOutputTensorSurface(this, 0, supportedOutSurfCategories()); + + nvdla_prototest_interface::SDPOpDesc* protoSDPOpDesc = protoLayer->mutable_op_config()->mutable_sdp_op(); + nvdla_prototest_interface::SDPSurfaceDesc* protoSDPSurfDesc = protoLayer->mutable_surface()->mutable_sdp_surface(); + nvdla_prototest_interface::SDPOp* protoSDPX1OpDesc = protoSDPOpDesc->mutable_x1_op(); + nvdla_prototest_interface::SDPOp* protoSDPX2OpDesc = protoSDPOpDesc->mutable_x2_op(); + nvdla_prototest_interface::SDPOp* protoSDPYOpDesc = protoSDPOpDesc->mutable_y_op(); + nvdla_prototest_interface::DataCube* protoSrcDataCube = protoSDPSurfDesc->mutable_src_data(); + nvdla_prototest_interface::DataCube* protoDstDataCube = protoSDPSurfDesc->mutable_dst_data(); + nvdla_prototest_interface::DataPrecision protoSrcPrec, protoDstPrec; + + protoLayer->set_index(op_slot); + protoLayer->set_roi_index(0); + protoLayer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_SDP); + protoLayer->set_dependency_count(*dep.dependencyCount()); + + /* consumers */ + for (size_t c = 0; c < EngineType::num_elements(); c++) + { + NvS8 fw_op_index = ASTToDLAInterface::getEngineType(target_dla, c); + if ( fw_op_index < 0 ) + { + continue; + } + + DLAConsumerAccessor cons_acc = dep.consumerAccessor(fw_op_index); + if (*cons_acc.index() != -1) { + numConsumers++; + nvdla_prototest_interface::Consumer* protoConsumer = protoLayer->add_bottom(); + protoConsumer->set_index(*cons_acc.index()); + switch(c) { + case EngineTypeEnum::BDMA : protoConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_BDMA); break; + case EngineTypeEnum::CONVOLUTION : protoConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_CONV); break; + case EngineTypeEnum::SDP : protoConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_SDP); break; + case EngineTypeEnum::PDP : protoConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_PDP); break; + case EngineTypeEnum::CDP : protoConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_CDP); break; + case EngineTypeEnum::RUBIK: protoConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_RUBIK); break; + default: ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unrecognized consumer"); + } + switch(dependencyParams().consumer(c).opEvent().v()) { + case OperationEventTypeEnum::OP_CDMA_WEIGHT_DONE : protoConsumer->set_event(nvdla_prototest_interface::Consumer_EventType::Consumer_EventType_CDMA_WT_DONE); break; + case OperationEventTypeEnum::OP_CDMA_DATA_DONE : protoConsumer->set_event(nvdla_prototest_interface::Consumer_EventType::Consumer_EventType_CDMA_DT_DONE); break; + case OperationEventTypeEnum::OP_COMPLETED : protoConsumer->set_event(nvdla_prototest_interface::Consumer_EventType::Consumer_EventType_OP_COMPLETED); break; + case OperationEventTypeEnum::OP_ENABLED : protoConsumer->set_event(nvdla_prototest_interface::Consumer_EventType::Consumer_EventType_OP_ENABLED); break; + case OperationEventTypeEnum::OP_PROGRAMMED : protoConsumer->set_event(nvdla_prototest_interface::Consumer_EventType::Consumer_EventType_OP_PROGRAMMED); break; + default: ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unrecognized consumer event"); + } + } + } + + /* fused node */ + if (dependencyParams().fusedNode(engine_ast::IODirectionEnum::INPUT)) + { + nvdla_prototest_interface::Consumer* protoFusedConsumer = protoLayer->mutable_fused(); + protoFusedConsumer->set_index(*fused_acc.index()); + protoFusedConsumer->set_event(nvdla_prototest_interface::Consumer_EventType::Consumer_EventType_OP_ENABLED); + switch(dependencyParams().fusedNode(engine_ast::IODirectionEnum::INPUT)->engineType().v()) { + case EngineTypeEnum::CONVOLUTION: protoFusedConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_CONV); break; + default: ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "SDP can have only Conv op as its fused partner on input side"); + } + } + + switch(src_tsd->surfaceFormat().precision().v()) { + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_FP16 : protoSrcPrec = nvdla_prototest_interface::DataPrecision::PRECISION_FP16; break; + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16 : protoSrcPrec = nvdla_prototest_interface::DataPrecision::PRECISION_INT16; break; + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8 : protoSrcPrec = nvdla_prototest_interface::DataPrecision::PRECISION_INT8; break; + default: ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unrecognized src precision"); + } + + switch(dst_tsd->surfaceFormat().precision().v()) { + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_FP16 : protoDstPrec = nvdla_prototest_interface::DataPrecision::PRECISION_FP16; break; + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16 : protoDstPrec = nvdla_prototest_interface::DataPrecision::PRECISION_INT16; break; + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8 : protoDstPrec = nvdla_prototest_interface::DataPrecision::PRECISION_INT8; break; + default: ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unrecognized dst precision"); + } + + protoSDPOpDesc->set_src_precision(protoSrcPrec); + protoSDPOpDesc->set_dst_precision(protoDstPrec); + protoSDPOpDesc->set_lut_index(-1); + + protoSDPOpDesc->mutable_out_cvt()->set_enable(*out_cvt_acc.enable()); + protoSDPOpDesc->mutable_out_cvt()->set_offset(*out_cvt_acc.offset()); + protoSDPOpDesc->mutable_out_cvt()->set_scale(*out_cvt_acc.scale()); + protoSDPOpDesc->mutable_out_cvt()->set_truncate(*out_cvt_acc.truncate()); + + protoSDPOpDesc->set_conv_mode(nvdla_prototest_interface::ConvMode::DIRECT); + protoSDPOpDesc->set_batch_num(1); + protoSDPOpDesc->set_batch_stride(0); + + protoSDPX1OpDesc->set_enable(*x1_op_acc.enable()); + protoSDPX1OpDesc->set_alu_type(nvdla_prototest_interface::ALUType::ALU_SUM); + protoSDPX1OpDesc->set_type(nvdla_prototest_interface::SDPOpType::SDP_OP_ADD); + protoSDPX1OpDesc->set_mode(nvdla_prototest_interface::SDPOp_SDPOpMode::SDPOp_SDPOpMode_SDP_OP_PER_KERNEL); + protoSDPX1OpDesc->set_act(nvdla_prototest_interface::SDPActivation::ACT_NONE); + protoSDPX1OpDesc->set_shift_value(*x1_op_acc.shiftValue()); + protoSDPX1OpDesc->set_alu_operand(*x1_op_acc.ALUOperand()); + protoSDPX1OpDesc->set_mul_operand(*x1_op_acc.MulOperand()); + protoSDPX1OpDesc->set_truncate(*x1_op_acc.truncate()); + protoSDPX1OpDesc->set_precision(protoSrcPrec); + protoSDPX1OpDesc->mutable_cvt()->mutable_alu_cvt()->set_enable(*x1_op_acc.cvt().aluCVTAccessor().enable()); + protoSDPX1OpDesc->mutable_cvt()->mutable_alu_cvt()->set_truncate(*x1_op_acc.cvt().aluCVTAccessor().truncate()); + protoSDPX1OpDesc->mutable_cvt()->mutable_alu_cvt()->set_scale(*x1_op_acc.cvt().aluCVTAccessor().scale()); + protoSDPX1OpDesc->mutable_cvt()->mutable_alu_cvt()->set_offset(*x1_op_acc.cvt().aluCVTAccessor().offset()); + protoSDPX1OpDesc->mutable_cvt()->mutable_mul_cvt()->set_enable(*x1_op_acc.cvt().mulCVTAccessor().enable()); + protoSDPX1OpDesc->mutable_cvt()->mutable_mul_cvt()->set_truncate(*x1_op_acc.cvt().mulCVTAccessor().truncate()); + protoSDPX1OpDesc->mutable_cvt()->mutable_mul_cvt()->set_scale(*x1_op_acc.cvt().mulCVTAccessor().scale()); + protoSDPX1OpDesc->mutable_cvt()->mutable_mul_cvt()->set_offset(*x1_op_acc.cvt().mulCVTAccessor().offset()); + + protoSDPX2OpDesc->set_enable(*x2_op_acc.enable()); + protoSDPX2OpDesc->set_alu_type(nvdla_prototest_interface::ALUType::ALU_SUM); + protoSDPX2OpDesc->set_type(nvdla_prototest_interface::SDPOpType::SDP_OP_ADD); + protoSDPX2OpDesc->set_mode(nvdla_prototest_interface::SDPOp_SDPOpMode::SDPOp_SDPOpMode_SDP_OP_PER_KERNEL); + protoSDPX2OpDesc->set_act(nvdla_prototest_interface::SDPActivation::ACT_NONE); + protoSDPX2OpDesc->set_shift_value(*x2_op_acc.shiftValue()); + protoSDPX2OpDesc->set_alu_operand(*x2_op_acc.ALUOperand()); + protoSDPX2OpDesc->set_mul_operand(*x2_op_acc.MulOperand()); + protoSDPX2OpDesc->set_truncate(*x2_op_acc.truncate()); + protoSDPX2OpDesc->set_precision(protoSrcPrec); + protoSDPX2OpDesc->mutable_cvt()->mutable_alu_cvt()->set_enable(*x2_op_acc.cvt().aluCVTAccessor().enable()); + protoSDPX2OpDesc->mutable_cvt()->mutable_alu_cvt()->set_truncate(*x2_op_acc.cvt().aluCVTAccessor().truncate()); + protoSDPX2OpDesc->mutable_cvt()->mutable_alu_cvt()->set_scale(*x2_op_acc.cvt().aluCVTAccessor().scale()); + protoSDPX2OpDesc->mutable_cvt()->mutable_alu_cvt()->set_offset(*x2_op_acc.cvt().aluCVTAccessor().offset()); + protoSDPX2OpDesc->mutable_cvt()->mutable_mul_cvt()->set_enable(*x2_op_acc.cvt().mulCVTAccessor().enable()); + protoSDPX2OpDesc->mutable_cvt()->mutable_mul_cvt()->set_truncate(*x2_op_acc.cvt().mulCVTAccessor().truncate()); + protoSDPX2OpDesc->mutable_cvt()->mutable_mul_cvt()->set_scale(*x2_op_acc.cvt().mulCVTAccessor().scale()); + protoSDPX2OpDesc->mutable_cvt()->mutable_mul_cvt()->set_offset(*x2_op_acc.cvt().mulCVTAccessor().offset()); + + + protoSDPYOpDesc->set_enable(*y_op_acc.enable()); + protoSDPYOpDesc->set_alu_type(nvdla_prototest_interface::ALUType::ALU_SUM); + protoSDPYOpDesc->set_type(nvdla_prototest_interface::SDPOpType::SDP_OP_ADD); + protoSDPYOpDesc->set_mode(nvdla_prototest_interface::SDPOp_SDPOpMode::SDPOp_SDPOpMode_SDP_OP_PER_KERNEL); + protoSDPYOpDesc->set_act(nvdla_prototest_interface::SDPActivation::ACT_NONE); + protoSDPYOpDesc->set_shift_value(*y_op_acc.shiftValue()); + protoSDPYOpDesc->set_alu_operand(*y_op_acc.ALUOperand()); + protoSDPYOpDesc->set_mul_operand(*y_op_acc.MulOperand()); + protoSDPYOpDesc->set_truncate(*y_op_acc.truncate()); + protoSDPYOpDesc->set_precision(protoSrcPrec); + protoSDPYOpDesc->mutable_cvt()->mutable_alu_cvt()->set_enable(*y_op_acc.cvt().aluCVTAccessor().enable()); + protoSDPYOpDesc->mutable_cvt()->mutable_alu_cvt()->set_truncate(*y_op_acc.cvt().aluCVTAccessor().truncate()); + protoSDPYOpDesc->mutable_cvt()->mutable_alu_cvt()->set_scale(*y_op_acc.cvt().aluCVTAccessor().scale()); + protoSDPYOpDesc->mutable_cvt()->mutable_alu_cvt()->set_offset(*y_op_acc.cvt().aluCVTAccessor().offset()); + protoSDPYOpDesc->mutable_cvt()->mutable_mul_cvt()->set_enable(*y_op_acc.cvt().mulCVTAccessor().enable()); + protoSDPYOpDesc->mutable_cvt()->mutable_mul_cvt()->set_truncate(*y_op_acc.cvt().mulCVTAccessor().truncate()); + protoSDPYOpDesc->mutable_cvt()->mutable_mul_cvt()->set_scale(*y_op_acc.cvt().mulCVTAccessor().scale()); + protoSDPYOpDesc->mutable_cvt()->mutable_mul_cvt()->set_offset(*y_op_acc.cvt().mulCVTAccessor().offset()); + + + if (*fused_acc.index() != -1) { + protoSrcDataCube->set_type(nvdla_prototest_interface::MemType::DLA_MEM_HW); + } else { + protoSrcDataCube->set_type(nvdla_prototest_interface::MemType::DLA_MEM_MC); + } + protoSrcDataCube->set_address(*src_data_acc.address()); + protoSrcDataCube->set_size(src_tsd->tensorBufferDesc()->size() - src_tsd->bufferOffset()); + protoSrcDataCube->set_width(*src_data_acc.width()); + protoSrcDataCube->set_height(*src_data_acc.height()); + protoSrcDataCube->set_channel(*src_data_acc.channel()); + protoSrcDataCube->set_line_stride(*src_data_acc.lineStride()); + protoSrcDataCube->set_surf_stride(*src_data_acc.surfStride()); + protoSrcDataCube->set_plane_stride(*src_data_acc.planeStride()); + protoSrcDataCube->mutable_mem_info()->set_mem_id(src_tsd->tensorBufferDesc()->memoryId(batch_id)); + protoSrcDataCube->mutable_mem_info()->set_mem_size(src_tsd->tensorBufferDesc()->size()); + protoSrcDataCube->mutable_mem_info()->set_offset(src_tsd->bufferOffset()); + + protoDstDataCube->set_type(nvdla_prototest_interface::MemType::DLA_MEM_MC); + protoDstDataCube->set_address(*dst_data_acc.address()); + protoDstDataCube->set_size(dst_tsd->tensorBufferDesc()->size() - dst_tsd->bufferOffset()); + protoDstDataCube->set_width(*dst_data_acc.width()); + protoDstDataCube->set_height(*dst_data_acc.height()); + protoDstDataCube->set_channel(*dst_data_acc.channel()); + protoDstDataCube->set_line_stride(*dst_data_acc.lineStride()); + protoDstDataCube->set_surf_stride(*dst_data_acc.surfStride()); + protoDstDataCube->set_plane_stride(*dst_data_acc.planeStride()); + protoDstDataCube->mutable_mem_info()->set_mem_id(dst_tsd->tensorBufferDesc()->memoryId(batch_id)); + protoDstDataCube->mutable_mem_info()->set_mem_size(dst_tsd->tensorBufferDesc()->size()); + protoDstDataCube->mutable_mem_info()->set_offset(dst_tsd->bufferOffset()); + if (numConsumers == 0) { + protoDstDataCube->mutable_mem_info()->set_fill_type(nvdla_prototest_interface::FillerType::FILL_NONE); + protoDstDataCube->mutable_mem_info()->set_flag(nvdla_prototest_interface::MemFlag::DLA_MEM_OUTPUT); + protoDstDataCube->mutable_mem_info()->set_precision(protoDstPrec); + } +fail: + return e; +} +#endif + +}; // nvdla::priv:: +}; // nvdla:: + diff --git a/umd/core/src/compiler/engine-ast/SDPNode.cpp b/umd/core/src/compiler/engine-ast/SDPNode.cpp new file mode 100644 index 00000000..fc230470 --- /dev/null +++ b/umd/core/src/compiler/engine-ast/SDPNode.cpp @@ -0,0 +1,1019 @@ +/* + * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#include + +#include "priv/EngineAST.h" +#include "priv/LowPrecision.h" +#include "priv/Profile.h" +#include "priv/Tensor.h" +#include "ErrorMacros.h" + +using std::endl; + +namespace nvdla +{ +namespace priv +{ +/*--------------------------------Generic functions--------------------*/ +NvDlaError engine_ast::SDPNode::nodeAuxEdge(engine_ast::Edge **ret_edge) +{ + NvDlaError e = NvDlaSuccess; + + switch(engineOpType().v()) { + case EngineOpTypeEnum::SDP_BIAS: + PROPAGATE_ERROR_FAIL(nodeDataEdge(TensorType::kBIAS, + ast::EdgeSideEnum::SECOND, ret_edge)); + break; + case EngineOpTypeEnum::SDP_BATCH_NORM: + PROPAGATE_ERROR_FAIL(nodeDataEdge(TensorType::kBATCH_NORM, + ast::EdgeSideEnum::SECOND, ret_edge)); + break; + case EngineOpTypeEnum::SDP_SCALE: + PROPAGATE_ERROR_FAIL(nodeDataEdge(TensorType::kSCALE, + ast::EdgeSideEnum::SECOND, ret_edge)); + break; + //FIXME SDP SUPER + default: + *ret_edge = NULL; + } + +fail: + return e; +} + +/*--------------Suggest Format/Dims/Strides/Size/Buffer-Offset----------------*/ +/* DLA 1.0 can do int16 activation in int8 pipeline. So using int16 for both int8 + * and int16 computation to retain bits of precision in the aux data + */ +std::vector engine_ast::SDPNode::suggestAuxSurfaceFormats(engine_ast::Edge* auxEdge) +{ + NvDlaError e = NvDlaSuccess; + NVDLA_UNUSED(e); + std::vector supportedAuxSFs = supportedAuxSurfFormats(); + std::vector suggestedAuxSFs; + std::vector::iterator auxSFItr; + surface::SurfacePrecision compPrec = graph()->profile()->computePrecision(); + + + if (supportedAuxSFs.size() == 0) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "No supported aux surface formats for %s", name().c_str()); + } + + switch(compPrec.v()) + { + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_FP16: { + surface::IsSurfacePrecisionDifferent desiredSP(surface::SurfacePrecisionEnum::NVDLA_PRECISION_FP16); + supportedAuxSFs.erase(std::remove_if(supportedAuxSFs.begin(), supportedAuxSFs.end(), desiredSP), supportedAuxSFs.end()); + } break; + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16:{ + surface::IsSurfacePrecisionDifferent desiredSP(surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16); + supportedAuxSFs.erase(std::remove_if(supportedAuxSFs.begin(), supportedAuxSFs.end(), desiredSP), supportedAuxSFs.end()); + } break; + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8: { + surface::IsSurfacePrecisionDifferent desiredSP(surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8); + supportedAuxSFs.erase(std::remove_if(supportedAuxSFs.begin(), supportedAuxSFs.end(), desiredSP), supportedAuxSFs.end()); + } break; + default: + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Don't support compute precision: %s for %s\n", + compPrec.c_str(), name().c_str()); + } + + suggestedAuxSFs = supportedAuxSFs; + +fail: + return suggestedAuxSFs; +} + +/* + * DLA-CONV engine works on IMG and FEATURE_DATA input in either + * DC or Winograd mode; whereas DC has no special stride/size alignment + * requirements, Winograd mode needs perfect x(4x4) input and output + * surfaces. This means tweaking input/output surface dims whenever + * we want to chose WG. + * But, code emission layer finally takes care of adjusting dims, the compiler + * here should only accommodate for the larger stride/size requirements. + */ +Dims4 engine_ast::SDPNode::suggestSurfaceDims(surface::TensorSurfaceDesc* tsd) +{ + NvDlaError e = NvDlaSuccess; + bool isSrcTSD = false; + bool isAuxTSD = false; + bool isDstTSD = false; + Dims4 suggestedDims(-1,-1,-1,-1); + EdgeSequence inDataEdges; + EdgeSequence auxDataEdges; + + PROPAGATE_ERROR_FAIL( verifyEdgePorts() ); + + inDataEdges = inputEdges(); + for (EdgeSequenceIterator iei = inDataEdges.begin(); iei != inDataEdges.end(); ++iei) + { + if ((*iei)->tensorSurfaceDesc() == tsd) + { + isSrcTSD = true; + break; + } + } + auxDataEdges = auxEdges(); + for (EdgeSequenceIterator iei = auxDataEdges.begin(); iei != auxDataEdges.end(); ++iei) + { + if ((*iei)->tensorSurfaceDesc() == tsd) + { + isAuxTSD = true; + break; + } + } + isDstTSD = outputEdges()[0]->tensorSurfaceDesc() == tsd; + + if (!isSrcTSD && !isAuxTSD && !isDstTSD) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "TSD %s doesn't belong to %s", tsd->id().c_str(), name().c_str()); + } + + if (params().convMode().v() == ConvolutionModeEnum::CONV_WINOGRAD) + { + if (isSrcTSD || isDstTSD) + { + suggestedDims = params().winogradParams().ioDims; + } + else if (isAuxTSD) + { + suggestedDims = Node::suggestSurfaceDims(tsd); + } + } + else if (params().convMode().v() == ConvolutionModeEnum::CONV_DIRECT) + { + if (isAuxTSD) + { + suggestedDims = tsd->dimensions(); + } + else + { + // if no src, use the prevailing dims of the surface (no choice for more arbitration) + // inherit output requirements of the source node. Required for winogradable src node + Dims4 inSurfDims(-1,-1,-1,-1); + Edge* inEdge = inputEdges()[0]; + Node* srcNode = graph()->upstreamNodes(inEdge).size() ? graph()->upstreamNodes(inEdge)[0] : NULL; + // destination TSD + // Even though unfused src is winogradable, this sdp can still remove + // winograd padding requirement for output tensor + if (srcNode && dependencyParams().fusedNode(IODirectionEnum::INPUT) != NULL) + { + inSurfDims = srcNode->suggestSurfaceDims(inEdge->tensorSurfaceDesc()); + } + suggestedDims.n = std::max(tsd->dimensions().n, inSurfDims.n); + suggestedDims.c = std::max(tsd->dimensions().c, inSurfDims.c); + suggestedDims.h = std::max(tsd->dimensions().h, inSurfDims.h); + suggestedDims.w = std::max(tsd->dimensions().w, inSurfDims.w); + } + } + else + { + REPORT_ERROR(NvDlaError_BadValue, "Unknown conv mode for %s", name().c_str()); + } + +fail: + return suggestedDims; +} + +NvU32 engine_ast::SDPNode::suggestLineStride(surface::TensorSurfaceDesc* tsd) +{ + NvDlaError e = NvDlaSuccess; + NvU32 lineStride = 0; + + PROPAGATE_ERROR_FAIL( verifyEdgePorts() ); + + if (m_nodeTSDLineStride.find(tsd) != m_nodeTSDLineStride.end()) + { + lineStride = m_nodeTSDLineStride[tsd]; + goto fail; + } + + { + surface::TensorSurfaceDesc probeTSD = *tsd; + Dims4 surfDims = suggestSurfaceDims(tsd); + probeTSD.setDimensions(surfDims); + probeTSD.resetLineStride(); + lineStride = probeTSD.lineStride(); + } + + m_nodeTSDLineStride[tsd] = lineStride; + +fail: + return lineStride; +} + +NvU32 engine_ast::SDPNode::suggestSurfaceStride(surface::TensorSurfaceDesc* tsd) +{ + NvDlaError e = NvDlaSuccess; + NvU32 surfaceStride = 0; + + PROPAGATE_ERROR_FAIL( verifyEdgePorts() ); + + if (m_nodeTSDSurfaceStride.find(tsd) != m_nodeTSDSurfaceStride.end()) + { + surfaceStride = m_nodeTSDSurfaceStride[tsd]; + goto fail; + } + + { + surface::TensorSurfaceDesc probeTSD = *tsd; + Dims4 surfDims = suggestSurfaceDims(tsd); + probeTSD.setDimensions(surfDims); + probeTSD.resetSurfaceStride(); + surfaceStride = probeTSD.surfaceStride(); + } + + m_nodeTSDSurfaceStride[tsd] = surfaceStride; + +fail: + return surfaceStride; +} + +NvU64 engine_ast::SDPNode::suggestSurfaceSize(surface::TensorSurfaceDesc* tsd) +{ + NvDlaError e = NvDlaSuccess; + NvU64 size = 0; + bool isAuxEdge = false; + + PROPAGATE_ERROR_FAIL( verifyEdgePorts() ); + + for (EdgeSequence::const_iterator iei = auxEdges().begin(); iei != auxEdges().end(); ++iei) + { + if ((*iei)->tensorSurfaceDesc() == tsd) + { + isAuxEdge = true; + break; + } + } + + if (m_nodeTSDSurfaceSize.find(tsd) != m_nodeTSDSurfaceSize.end()) + { + size = m_nodeTSDSurfaceSize[tsd]; + goto fail; + } + + { + surface::TensorSurfaceDesc probeTSD = *tsd; + Dims4 surfDims = suggestSurfaceDims(tsd); + probeTSD.setDimensions(surfDims); + probeTSD.resetSize(); + size = probeTSD.size(); + // if the op does int8 rescaling, it has both the + // aux data for the op and the rescaling factors + if (params().x1Params().isINT8Rescaling() && isAuxEdge) + { + size *= 2; + } + } + + m_nodeTSDSurfaceSize[tsd] = size; + +fail: + return size; +} + +NvU64 engine_ast::SDPNode::suggestSurfaceOffsetInBuffer(surface::TensorSurfaceDesc* tsd) +{ + NvDlaError e = NvDlaSuccess; + NvU64 offset = 0; + bool isSrcTSD = false; + bool isDstTSD = false; + bool isAuxTSD = false; + surface::TensorSurfaceDesc* srcTSD = NULL; + EdgeSequence inDataEdges; + EdgeSequence auxDataEdges; + Node* sinkNode = NULL; + + PROPAGATE_ERROR_FAIL(verifyEdgePorts()); + + if (m_nodeTSDSurfaceOffsetInBuffer.find(tsd) != m_nodeTSDSurfaceOffsetInBuffer.end()) + { + offset = m_nodeTSDSurfaceOffsetInBuffer[tsd]; + goto fail; + } + + inDataEdges = inputEdges(); + for (EdgeSequenceIterator iei = inDataEdges.begin(); iei != inDataEdges.end(); ++iei) + { + if ((*iei)->tensorSurfaceDesc() == tsd) + { + isSrcTSD = true; + break; + } + } + isDstTSD = outputEdges()[0]->tensorSurfaceDesc() == tsd; + auxDataEdges = auxEdges(); + for (EdgeSequenceIterator iei = auxDataEdges.begin(); iei != auxDataEdges.end(); ++iei) + { + if ((*iei)->tensorSurfaceDesc() == tsd) + { + isAuxTSD = true; + break; + } + } + if (!isSrcTSD && !isAuxTSD && !isDstTSD) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "TSD %s doesn't belong to %s", tsd->id().c_str(), name().c_str()); + } + + // pick any one of the src edges for consideration here + srcTSD = isSrcTSD ? tsd : inputEdges()[0]->tensorSurfaceDesc(); + + if (isAuxTSD) + { + offset = 0; + } + else if (isSrcTSD) + { + /* if input is a stream tensor, it acts as a proxy for the output tensor + * so, inherit the surface offset in buffer from the stream tensor into the output tensor; + * else, input and output tensors both are independent + */ + if (srcTSD->tensorCategory() == memory::TensorCategoryEnum::STREAM_TENSOR) + { + offset = srcTSD->bufferOffset(); + } + else + { + offset = 0; + } + } + else if (isDstTSD) + { + sinkNode = graph()->downstreamDataNodes(this).size() ? graph()->downstreamDataNodes(this)[0] : NULL; + if (sinkNode && sinkNode->engineType().v() == EngineTypeEnum::CONCATENATION) + { + ConcatenationNode* concatNode = NodeFactory::nodeCast(sinkNode); + // fixme: this kind of diving catches can be avoided if slice Ids are maintained inside tsd + switch(concatNode->params().concatAxis().v()) + { + case ConcatAxisEnum::CONCAT_ALONG_W: + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Don't yet support split-w mode for %s", + name().c_str()); + break; + case ConcatAxisEnum::CONCAT_ALONG_H: + // in case of concat along Chnl direction, let the concat node decide suitable surface offset + offset = concatNode->suggestSurfaceOffsetInBuffer(tsd); + break; + case ConcatAxisEnum::CONCAT_ALONG_C: + // in case of concat along Chnl direction, let the concat node decide suitable surface offset + offset = concatNode->suggestSurfaceOffsetInBuffer(tsd); + break; + default: + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Unknown concat type for %s", + concatNode->name().c_str()); + } + } + else + { + offset = 0; + } + } + + m_nodeTSDSurfaceOffsetInBuffer[tsd] = offset; + +fail: + return offset; +} + +NvDlaError engine_ast::SDPNode::verifySurfaceDims(surface::TensorSurfaceDesc* tsd) +{ + NvDlaError e = NvDlaSuccess; + + Dims4 auxDims; + bool isSrcTSD = false; + bool isDstTSD = false; + bool isAuxTSD = false; + bool isPerLayer = false; + surface::TensorSurfaceDesc* srcTSD = NULL; + surface::TensorSurfaceDesc* auxTSD = NULL; + surface::TensorSurfaceDesc* dstTSD = NULL; + EdgeSequence inDataEdges; + EdgeSequence auxDataEdges; + + PROPAGATE_ERROR_FAIL(verifyEdgePorts()); + + inDataEdges = inputEdges(); + for (EdgeSequenceIterator iei = inDataEdges.begin(); iei != inDataEdges.end(); ++iei) + { + if ((*iei)->tensorSurfaceDesc() == tsd) + { + isSrcTSD = true; + break; + } + } + isDstTSD = outputEdges()[0]->tensorSurfaceDesc() == tsd; + auxDataEdges = auxEdges(); + for (EdgeSequenceIterator iei = auxDataEdges.begin(); iei != auxDataEdges.end(); ++iei) + { + if ((*iei)->tensorSurfaceDesc() == tsd) + { + isAuxTSD = true; + auxTSD = tsd; + break; + } + } + if (!isSrcTSD && !isAuxTSD && !isDstTSD) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "TSD %s doesn't belong to %s", tsd->id().c_str(), name().c_str()); + } + + // pick any 1 of the src edges for consideration here + srcTSD = isSrcTSD ? tsd : inputEdges()[0]->tensorSurfaceDesc(); + dstTSD = isDstTSD ? tsd : outputEdges()[0]->tensorSurfaceDesc(); + + if (!srcTSD || !dstTSD) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Not all TSDs are registered yet for %s", name().c_str()); + } + else if (inDataEdges.size() > 1) + { + // sdp supports max 2 src edges (for EW) + ASSERT(inDataEdges.size() == 2) + surface::TensorSurfaceDesc* src1TSD = inDataEdges[0]->tensorSurfaceDesc(); + surface::TensorSurfaceDesc* src2TSD = inDataEdges[1]->tensorSurfaceDesc(); + if ( !src1TSD->isSurfaceSymmetricTo(src2TSD) ) + { + PROPAGATE_ERROR_FAIL(NvDlaError_BadValue, "(%s) All input tensors to SDP should have the same dimensions", + name().c_str()); + } + } + + if ( isAuxTSD ) + { + isPerLayer = auxTSD->dimensions().w == 1 && + auxTSD->dimensions().h == 1 && + auxTSD->dimensions().c == 1; + + if(auxTSD->dimensions().c != srcTSD->dimensions().c && !isPerLayer) + { + PROPAGATE_ERROR_FAIL(NvDlaError_BadValue, "(%s) Aux and Input tensors should have the same number of channels: %d != %d", + name().c_str(), + auxTSD->dimensions().c, + srcTSD->dimensions().c); + } + } + else + { + Dims4 srcDims = srcTSD->dimensions(); + Dims4 dstDims = dstTSD->dimensions(); + if ((srcDims.c != dstDims.c) || (srcDims.h != dstDims.h) || (srcDims.w != dstDims.w)) + { + PROPAGATE_ERROR_FAIL(NvDlaError_BadValue, "(%s) Input and Output tensors should have the same dimensions", + name().c_str()); + } + } + +fail: + return e; +} + +/*--------------------------------Fuse Nodes---------------------------*/ +NvDlaError engine_ast::SDPNode::fuseOnTheFlyNodes() +{ + NvDlaError e = NvDlaError_Success; + + if ( graph()->profile()->canSDPFuseVerticalOps() ) + { + NodeSequence consumer_nodes; + EdgeSequence output_edges = graph()->downstreamEdges(this); + for (EdgeSequenceIterator oei = output_edges.begin(); oei != output_edges.end(); ++oei) + { + consumer_nodes = graph()->downstreamNodes(*oei); + for (NodeSequence::const_iterator cni = consumer_nodes.begin(); cni != consumer_nodes.end(); ++cni) + { + // Find scope of fusing adjacent sdp nodes. + // FIXME: add logic to determine sub-engine requirements and then fuse + if ((*cni)->engineType().v() == EngineTypeEnum::SDP) + { + dependencyParams().setFusedNode(IODirectionEnum::OUTPUT, (*cni)); + (*cni)->dependencyParams().setFusedNode(IODirectionEnum::INPUT, this); + } + } + } + } + + // We will determine fusing SDP + PDP in the pdp api + + return e; +} + +/*---------------------------Merge SDP Operations----------------------------*/ +engine_ast::Node* engine_ast::SDPNode::mergeWithSDPOp(SDPNode* nextSDP) +{ + Node* removableNode = NULL; + + /* + * In DLA architecture, CONV engine doesn't have a write out pipe. So any canonical + * convolution operation when translated to the engine land needs 2 translation ops: + * (conv + sdp-nop): where conv does the math op and sdp-nop provides the SDP engine's + * write out pipe. + * However such a sdp-nop can be pruned if there's another SDP-op following it. + */ + if (engineOpType().v() == EngineOpTypeEnum::SDP_NOP) + { + /* Irrespective of whatever other type of SDP the nextSDP op is (including + * a NOP itself), always remove the current node. The next NOP will be trimmed + * in its own pass. + */ + removableNode = this; + goto fail; + } + else if (nextSDP->engineOpType().v() == EngineOpTypeEnum::SDP_ACTIVATION) + { + if (NodeFactory::nodeCast(nextSDP)->params(/*batch_id*/0).x1Params().actType().v() == + SDPActTypeEnum::SDP_ACT_TYPE_RELU) + { + removableNode = tryToMergeWithActOp(nextSDP); + } + } + +fail: + return removableNode; +} + +engine_ast::Node* engine_ast::SDPNode::mergeUnitScaleOp(SDPNode* SDPScaleOp) +{ + Node* removableNode = NULL; + SDPScaleOpNode* scaleOp = NodeFactory::nodeCast(SDPScaleOp); + + if (scaleOp->params(/*batch_id*/0).x1Params().actType().v() == SDPActTypeEnum::SDP_ACT_TYPE_RELU) + { + switch(engineOpType().v()) { + case EngineOpTypeEnum::SDP_BIAS: + NodeFactory::nodeCast(this)->params(/*batch_id*/0).x1Params().setActType( + SDPActTypeEnum::SDP_ACT_TYPE_RELU); + break; + case EngineOpTypeEnum::SDP_ELEMENTWISE: + NodeFactory::nodeCast(this)->params(/*batch_id*/0).x1Params().setActType( + SDPActTypeEnum::SDP_ACT_TYPE_RELU); + break; + case EngineOpTypeEnum::SDP_SCALE: + NodeFactory::nodeCast(this)->params(/*batch_id*/0).x1Params().setActType( + SDPActTypeEnum::SDP_ACT_TYPE_RELU); + break; + case EngineOpTypeEnum::SDP_BATCH_NORM: + NodeFactory::nodeCast(this)->params(/*batch_id*/0).x1Params().setActType( + SDPActTypeEnum::SDP_ACT_TYPE_RELU); + break; + case EngineOpTypeEnum::SDP_SUPER: + NodeFactory::nodeCast(this)->params(/*batch_id*/0).x2Params().setActType( + SDPActTypeEnum::SDP_ACT_TYPE_RELU); + break; + default: + goto fail; + } + } + removableNode = SDPScaleOp; + +fail: + return removableNode; +} + +/* + * Often many of the non-linear SDP operations are followed by a ReLU unit. + * ReLU: y = max(x, 0) + * Although, it's as simple as trimming all the negative elements in the tensor + * and can be achieved by a simple bit flip in the hardware, it is executed + * independently of the preceeding SDP op and incurs a whole memory pass. + * Try to consume the following ReLU operation into the existing sdp op-node and + * prune the redundant ReLU node from AST. + */ +engine_ast::Node* engine_ast::SDPNode::tryToMergeWithActOp(SDPNode* SDPActOp) +{ + Node* removableNode = NULL; + SDPActivationOpNode* actOp = NodeFactory::nodeCast(SDPActOp); + + // fixme: when vertical fusion is turned on, this logic to remove ReLU will move there. + // at that point, this API will cease to exist. + if (!graph()->profile()->canSDPMergeMathOps()) + { + goto fail; + } + + if (engineOpType().e() == SDPActOp->engineOpType().e()) + { + // cannot combine 2 adjacent Activation operations + goto fail; + } + else if (actOp->params(/*batch_id*/0).x1Params().actType().v() != SDPActTypeEnum::SDP_ACT_TYPE_RELU) + { + // cannot combine any other activation op than ReLU + goto fail; + } + + switch(engineOpType().v()) { + case EngineOpTypeEnum::SDP_BIAS: + NodeFactory::nodeCast(this)->params(/*batch_id*/0).x1Params().setActType( + SDPActTypeEnum::SDP_ACT_TYPE_RELU); + break; + case EngineOpTypeEnum::SDP_ELEMENTWISE: + NodeFactory::nodeCast(this)->params(/*batch_id*/0).x1Params().setActType( + SDPActTypeEnum::SDP_ACT_TYPE_RELU); + break; + case EngineOpTypeEnum::SDP_NOP: + NodeFactory::nodeCast(this)->params(/*batch_id*/0).x1Params().setActType( + SDPActTypeEnum::SDP_ACT_TYPE_RELU); + break; + case EngineOpTypeEnum::SDP_SCALE: + NodeFactory::nodeCast(this)->params(/*batch_id*/0).x1Params().setActType( + SDPActTypeEnum::SDP_ACT_TYPE_RELU); + break; + case EngineOpTypeEnum::SDP_BATCH_NORM: + NodeFactory::nodeCast(this)->params(/*batch_id*/0).x1Params().setActType( + SDPActTypeEnum::SDP_ACT_TYPE_RELU); + break; + case EngineOpTypeEnum::SDP_SUPER: + NodeFactory::nodeCast(this)->params(/*batch_id*/0).x2Params().setActType( + SDPActTypeEnum::SDP_ACT_TYPE_RELU); + break; + default: + goto fail; + } + + removableNode = SDPActOp; + +fail: + return removableNode; +} + +/* Check if nextSDP op fusion feasible in X2 */ +bool engine_ast::SDPNode::isFeasibleToFuseSDPSubEngineOp(SDPNode* nextSDP) +{ + bool retval = false; + + // check for open x2 slot + if ( params().x2Params().enabled() + || params().yParams().enabled() + || ( params().outCVT().isEnable() && params().outCVT().scale() != 1 ) + || ( params().outCVT().isEnable() && params().outCVT().truncate() != 0 ) + || nextSDP->params().x2Params().enabled() + ) + { + if ( graph()->debugFuseSubEngineOps() ) + { + gLogInfo << "SDP X2 fusion NOT feasible for " << this->name() << " & " << nextSDP->name(); + gLogInfo << ". No x2 slot available" << std::endl; + } + goto fail; + } + + // Fusing of Eltwise Op in X2, enforces additional restrictions + if (nextSDP->engineOpType().v() == EngineOpTypeEnum::SDP_ELEMENTWISE) + { + retval = isFeasibleToFuseSDPEltwiseOp(nextSDP); + } + else + { + retval = true; + } +fail: + if ( retval & graph()->debugFuseSubEngineOps() ) + { + gLogInfo << "SDP fusion feasible for " << this->name() << " & " << nextSDP->name() << std::endl; + } + return retval; +} + +/* Check if eltwise op can be fused in current SDP node */ +bool engine_ast::SDPNode::isFeasibleToFuseSDPEltwiseOp(SDPNode* nextSDP) +{ + bool retval = false; + NodeSequence sourceNodes; + engine_ast::Node* currentSource = this; + engine_ast::Node* peerSource = NULL; + bool current2peerDep = false; + bool peer2currentDep = false; + NodeSequence allNodes; + NodeSequenceIterator startNodeIter; + NodeSequenceIterator ni; + int eltNodeDistance = -1; + + SDPElementWiseOpNode* eltwiseOp = NodeFactory::nodeCast(nextSDP); + + // Allow eltwise fuse, only if it is betn two source nodes. + sourceNodes = graph()->upstreamDataNodes(eltwiseOp); + if (sourceNodes.size() != 2) + { + if ( graph()->debugFuseSubEngineOps() ) + { + gLogInfo << "Eltwise merge NOT feasible for " << this->name() << " & " << eltwiseOp->name(); + gLogInfo << ". Eltwise op has " << sourceNodes.size() << " (more than 2) source layers" << std::endl; + } + goto fail; + } + + // Determine eltwise source node dependencies on each other. + currentSource = this; + if (currentSource == sourceNodes[0]) + { + peerSource = sourceNodes[1]; + } + else + { + peerSource = sourceNodes[0]; + } + + allNodes = graph()->orderedNodes(); + startNodeIter = std::find(allNodes.begin(), allNodes.end(), this); + for (NodeSequenceIterator ni = startNodeIter; ni != allNodes.end(); ++ni) { + if (*ni == this || *ni == peerSource) + { + eltNodeDistance++; + } + else if (*ni == eltwiseOp) + { + eltNodeDistance++; + break; + } + } + if (eltNodeDistance !=1 && eltNodeDistance !=2) + { + if ( graph()->debugFuseSubEngineOps() ) + { + gLogInfo << "Eltwise merge NOT feasible for " << this->name() << " & " << eltwiseOp->name(); + gLogInfo << ". Invalid state. Eltwise node distance incorrect: " << eltNodeDistance << std::endl; + } + goto fail; + } + + // current node depends on peer sibling + current2peerDep = currentSource->dependsOn(peerSource, engine_ast::viaComputeData, engine_ast::allowAll); + // peer sibling depends on current node + peer2currentDep = peerSource->dependsOn(currentSource, engine_ast::viaComputeData, engine_ast::allowAll); + + if ( graph()->debugFuseSubEngineOps() ) + { + gLogInfo << eltwiseOp->name() << " sources: " << currentSource->name() << " & " << peerSource->name(); + gLogInfo << " eltNodeDistance: " << eltNodeDistance; + gLogInfo << " c2p: " << current2peerDep << " p2c: " << peer2currentDep << std::endl; + } + + /* + current node depends on peer -> fuse elt in current node + peer node depends on curent node -> Do not fuse elt in current node + current and peer nodes are independent of each other, then we have option of fusing it at any node. + Based on traversal, check which source node visited later i.e. elt node distance. + - if elt node distance = 1 fuse in current source node + - if elt node distance = 2, fuse in peer source. + */ + if ( current2peerDep + || ((!current2peerDep && !peer2currentDep) && (eltNodeDistance == 1)) ) + { + // Eltwise fuse in current node feasible + retval = true; + } + else + { + if ( graph()->debugFuseSubEngineOps() ) + { + gLogInfo << "Eltwise merge NOT feasible for " << currentSource->name() << " & " << eltwiseOp->name(); + gLogInfo << ". Eltwise op source nodes dependency requirements. eltNodeDistance: " << eltNodeDistance << std::endl; + } + goto fail; + } +fail: + return retval; +} + +/* Merge currentSDP and nextSDP Operation in SDP Super Op. + Creates new SDP super op with both X1 and X2 engines enabled. + currentSDP Op is configured in X1. + nextSDP Op is configured in X2. + Removes nextSDP op node. + Mark currentSDP op node for removal. +*/ +engine_ast::Node* engine_ast::SDPNode::fuseSDPSubEngineOp(SDPNode* nextSDP) +{ + NvDlaError e = NvDlaSuccess; + Node* removableNode = NULL; + + if (isFeasibleToFuseSDPSubEngineOp(nextSDP)) + { + engine_ast::Edge* edgeToMoveX1 = NULL; + engine_ast::Edge* edgeToMoveX2 = NULL; + SDPSuperOpNode* sdpSuperOp = NULL; + NodeSequence substituteNodes; + NodeSequence sourceNodes; + engine_ast::Node* eltPeerSource = NULL; + + // Create new SDP super node + sdpSuperOp = NodeFactory::newSDPSuperOpNode(NULL, graph()); + if (!sdpSuperOp) + { + ORIGINATE_ERROR_FAIL(NvDlaError_InsufficientMemory, "Couldn't create new SDP super op for replacing %s and %s", + this->name().c_str(), nextSDP->name().c_str()); + } + + // configure this SDP op in X1 engine + switch(engineOpType().v()) + { + case EngineOpTypeEnum::SDP_ELEMENTWISE: + // Do not support elt op in x1. + // Limitation is finding the aux edge of elt in x1 i.e. differentiating betn 2 inputs edges + goto fail; + default: + PROPAGATE_ERROR_FAIL(this->configureSDPSuperOpSubEngine(sdpSuperOp, SDP_ENGINE_X1)); + } + + // Find X1 Aux Edge + PROPAGATE_ERROR_FAIL(this->nodeAuxEdge(&edgeToMoveX1)); + + // configure next SDP OP in X2 engine + PROPAGATE_ERROR_FAIL(nextSDP->configureSDPSuperOpSubEngine(sdpSuperOp, SDP_ENGINE_X2)); + + // Find X2 Aux Edge + if (nextSDP->engineOpType().v() == EngineOpTypeEnum::SDP_ELEMENTWISE) + { + // Aux edge of Elementwise is connecting edge betn elt and peer source + eltPeerSource = NodeFactory::nodeCast(nextSDP)->getPeerSource(this); + edgeToMoveX2 = graph()->connectingDataEdge(nextSDP, eltPeerSource, ast::EdgeSideEnum::SECOND); + } + else + { + PROPAGATE_ERROR_FAIL(nextSDP->nodeAuxEdge(&edgeToMoveX2)); + } + + // Graph Updates + sourceNodes = graph()->upstreamDataNodes(this); + + // 1. Replace this SDP node with Super Op node in the graph + substituteNodes.push_back(sdpSuperOp); + PROPAGATE_ERROR_FAIL(graph()->substituteNodeInAST(this, substituteNodes)); + + // 2. Move X1 Aux Edge + sdpSuperOp->markSdpAuxEdge(SDP_ENGINE_X1, edgeToMoveX1); + graph()->replaceEdgeNodes(edgeToMoveX1, ast::EdgeSideEnum::SECOND, this, sdpSuperOp); + + // 3. Move X2 Aux Edge + sdpSuperOp->markSdpAuxEdge(SDP_ENGINE_X2, edgeToMoveX2); + graph()->replaceEdgeNodes(edgeToMoveX2, ast::EdgeSideEnum::SECOND, nextSDP, sdpSuperOp); + + // 4. nextSDP node should be removed manually, by disconnecting it from the input side + PROPAGATE_ERROR_FAIL(graph()->removeNodeFromAST(nextSDP, IODirectionEnum::INPUT)); + + // 5. Framework will remove this SDP node + removableNode = this; + + if (sourceNodes.size() != 0) + { + if ( graph()->debugFuseSubEngineOps() ) + { + gLogInfo << "SDP x2 fusion parent: " << sourceNodes[0]->name() << std::endl; + } + PROPAGATE_ERROR_FAIL(sourceNodes[0]->fuseOnTheFlyNodes()); + + if (eltPeerSource && dependencyParams().fusedNode(IODirectionEnum::INPUT) == sourceNodes[0]) + { + // for elt x2 fusion, add compute edge betn elt sources. + // This gurantees that SDPSuperOp fused parent will always be + // traversed last. + Edge* compEdge = graph()->addComputeEdge(eltPeerSource, sourceNodes[0]); + if ( graph()->debugFuseSubEngineOps() ) + { + gLogInfo << "elt x2 fusion compute edge " << compEdge->id(); + gLogInfo << " betn " << eltPeerSource->name(); + gLogInfo << " & " << sourceNodes[0]->name() << std::endl; + } + } + } + } +fail: + return removableNode; +} + +/*------------------------------Handle Multi-Batch---------------------*/ +NvDlaError engine_ast::SDPNode::handleMultiBatch() +{ + NvDlaError e = NvDlaSuccess; + + //Handle operation parameters for the multi-batch operations + NvU32 numBatches = graph()->profile()->multiBatchSize(); + for (NvU32 nn = 1; nn < numBatches; ++nn) + { + switch(engineOpType().v()) { + case EngineOpTypeEnum::SDP_ACTIVATION: + NodeFactory::nodeCast(this)->params(nn) = + NodeFactory::nodeCast(this)->params(0); + break; + case EngineOpTypeEnum::SDP_BIAS: + NodeFactory::nodeCast(this)->params(nn) = + NodeFactory::nodeCast(this)->params(0); + break; + case EngineOpTypeEnum::SDP_ELEMENTWISE: + NodeFactory::nodeCast(this)->params(nn) = + NodeFactory::nodeCast(this)->params(0); + break; + case EngineOpTypeEnum::SDP_NOP: + NodeFactory::nodeCast(this)->params(nn) = + NodeFactory::nodeCast(this)->params(0); + break; + case EngineOpTypeEnum::SDP_SCALE: + NodeFactory::nodeCast(this)->params(nn) = + NodeFactory::nodeCast(this)->params(0); + break; + case EngineOpTypeEnum::SDP_BATCH_NORM: + NodeFactory::nodeCast(this)->params(nn) = + NodeFactory::nodeCast(this)->params(0); + break; + case EngineOpTypeEnum::SDP_SUPER: + NodeFactory::nodeCast(this)->params(nn) = + NodeFactory::nodeCast(this)->params(0); + break; + default: + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Unsupported SDP Engine Op type: %s", engineOpType().c_str()); + } + } + +fail: + return e; +} + +/*---------------------------Resolve Data Dependencies-----------------*/ +NvDlaError engine_ast::SDPNode::resolveDataDependencies(engine_ast::Node* next) +{ + NvDlaError e = NvDlaSuccess; + Node* downStreamPDP; + + // capture all consumers as normal + PROPAGATE_ERROR_FAIL(engine_ast::Node::resolveDataDependencies(next)); + + downStreamPDP = dependencyParams().consumer(EngineTypeEnum::PDP).node(); + if (downStreamPDP == NULL) { + // no pdp consumer at all. do nothing + goto fail; + } + + // now retrofit the consumer array to specially handle the fused PDP op with SDP + if (downStreamPDP->dependencyParams().fusedNode(IODirectionEnum::INPUT) == this) { + dependencyParams().consumer(EngineTypeEnum::PDP).setOpEvent(OperationEventTypeEnum::OP_PROGRAMMED); + downStreamPDP->dependencyParams().producer(EngineTypeEnum::SDP).setOpEvent(OperationEventTypeEnum::OP_PROGRAMMED); + } + +fail: + return e; +} + +NvDlaError engine_ast::SDPNode::determineWinogradParams(ConvCoreNode* wgConvNode) +{ + NvDlaError e = NvDlaSuccess; + + Dims4 origSdpAuxDims; + engine_ast::Edge* sdpAuxEdge = NULL; + engine_ast::SDPEngineParams::WinogradParams sdpWGParams; + + if (params().convMode().v() != ConvolutionModeEnum::CONV_WINOGRAD) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Can't determine WG params for %s which is" + " not selected for WG mode", name().c_str()); + } + + PROPAGATE_ERROR_FAIL( repopulateEdgePorts() ); + PROPAGATE_ERROR_FAIL( nodeAuxEdge(&sdpAuxEdge) ); + + /* Use the input and output side wg details of associated Conv-WG node for this SDP as well*/ + sdpWGParams.ioDims = wgConvNode->params().winogradParams().outDims; + + params().setWinogradParams(sdpWGParams); + + if ( debugWinograd() ) + { + gLogInfo << "sdp wg " << name() << " io: " + << sdpWGParams.ioDims.n << "x" << sdpWGParams.ioDims.c << "x" + << sdpWGParams.ioDims.h << "x" << sdpWGParams.ioDims.w << endl; + } + +fail: + return e; +} + +}; // nvdla::priv:: +}; // nvdla:: diff --git a/umd/core/src/compiler/engine-ast/SDPSuperOp.cpp b/umd/core/src/compiler/engine-ast/SDPSuperOp.cpp new file mode 100644 index 00000000..205d0065 --- /dev/null +++ b/umd/core/src/compiler/engine-ast/SDPSuperOp.cpp @@ -0,0 +1,1138 @@ +/* + * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#include + +#include "priv/Type.h" +#include "priv/EngineAST.h" +#include "priv/Profile.h" +#include "priv/Tensor.h" +#include "priv/Compiler.h" +#include "priv/WeightTranslationUnit.h" + +#include "ErrorMacros.h" + +using std::endl; +using std::max; + +namespace nvdla +{ +namespace priv +{ + +NvDlaError engine_ast::SDPSuperOpNode::captureCanonicalData(SDPSubEngineType xN, TensorType tN) +{ + NvDlaError e = NvDlaError_Success; + Dims4 dataDims; + Tensor* dataTensor = NULL; + Edge* xEdge = NULL; + + if (tN != TensorType::kIO) + { + dataDims = params().dlaDataDims(xN); + dataTensor = graph()->addAuxTensor(graph()->newAuxTensorName(), dataDims, tN); + xEdge = graph()->addDataEdge((canonical_ast::Edge*)NULL, (engine_ast::Node*)NULL, this, dataTensor); + markSdpAuxEdge(xN, xEdge); + } + return e; +} + +void engine_ast::SDPSuperOpNode::inheritParamsForSubEngine(SDPSuperOpNode* otherSuperOp, SDPSubEngineType xN) +{ + params().setAuxDataType(xN, otherSuperOp->params().auxDataType(xN)); + params().setAuxSurfaceFormats(xN, otherSuperOp->params().auxSurfaceFormats(xN)); + + params().setMultiplierDims(xN, otherSuperOp->params().multiplierDims(xN)); + params().setAdderDims(xN, otherSuperOp->params().adderDims(xN)); + params().setDLADataDims(xN, otherSuperOp->params().dlaDataDims(xN)); + + params().setRawMultiplierData(xN, otherSuperOp->params().rawMultiplierData(xN)); + params().setRawAdderData(xN, otherSuperOp->params().rawAdderData(xN)); + params().setDLAData(xN, otherSuperOp->params().dlaData(xN)); + + engine_ast::Edge* xEdge = NULL; + otherSuperOp->auxEdgeBySubEngine(xN, &xEdge); + markSdpAuxEdge(xN, xEdge); +} + +void engine_ast::SDPSuperOpNode::inheritParams(Node* otherNode) +{ + SDPSuperOpNode* otherSuperOp = NodeFactory::nodeCast(otherNode); + params().setX1Params(otherSuperOp->params().x1Params()); + if (params().x1Params().enabled()) + { + inheritParamsForSubEngine(otherSuperOp, SDP_ENGINE_X1); + } + + params().setX2Params(otherSuperOp->params().x2Params()); + if (params().x2Params().enabled()) + { + inheritParamsForSubEngine(otherSuperOp, SDP_ENGINE_X2); + } + + // FIXME + /* + params().setYParams(otherSuperOp->params().yParams()); + if (params().yParams().enabled()) + { + inheritParamsForSubEngine(otherSuperOp, SDP_ENGINE_Y); + } + */ + + params().setConvMode(otherSuperOp->params().convMode()); + params().setWinogradParams(otherSuperOp->params().winogradParams()); + params().setNumGroups(otherSuperOp->params().numGroups()); +} + +engine_ast::SDPSubEngineParams* engine_ast::SDPSuperOpNode::subEngineParams(SDPSubEngineType xN) +{ + NvDlaError e = NvDlaSuccess; + NVDLA_UNUSED(e); + engine_ast::SDPSubEngineParams* retParams = NULL; + switch(xN.e()) + { + case SDP_ENGINE_X1: + retParams = ¶ms().x1Params(); + break; + case SDP_ENGINE_X2: + retParams = ¶ms().x2Params(); + break; + case SDP_ENGINE_Y: + retParams = ¶ms().yParams(); + break; + default: + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Invalid subEngineType"); + } +fail: + return retParams; +} + +/* Identify input, output and aux(x1,x2,y) edges for SuperOp. + Update internal map of SDPSubEngineToAuxEdge with any edge updates. +*/ +NvDlaError engine_ast::SDPSuperOpNode::populateEdgePorts() +{ + NvDlaError e = NvDlaSuccess; + + //gLogInfo << name() << " : populateEdgePorts: " << endl; + //printSdpXEdgeMap(); + + EdgeSequence inputEdges = graph()->upstreamDataEdges(this); + EdgeSequence outputEdges = graph()->downstreamDataEdges(this); + + // upstream Edges are input + aux edges + size_t upstreamEdgesExpected = 1 + m_sdpXengineToAuxEdgeMap.size(); + + /** + * should be exactly only 1 output edge, it should be the data output, + * none of the engine nodes is capable of >1 outputs, fail if so since + * concat and split nodes are handled separately + */ + if (outputEdges.size() == 0) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "%s has 0 output edges", name().c_str()); + } + else if (outputEdges.size() == 1) + { + markOutputEdge(outputEdges[0]); + } + else + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "%s has >1 output edges", name().c_str()); + } + + if (inputEdges.size() != upstreamEdgesExpected) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "%s has (%d) input+aux edges. expected (%d)", + name().c_str(), inputEdges.size(), upstreamEdgesExpected); + } + + { + NvU8 foundEdges = 0; + NvU8 foundX1Edge = 1 << 0; + NvU8 foundX2Edge = 1 << 1; + NvU8 foundInputEdge = 1 << 2; + NvU8 foundAllEdges = foundX1Edge | foundX2Edge | foundInputEdge; + + EdgeSequence newEdges; + for (EdgeSequenceIterator iei = inputEdges.begin(); iei != inputEdges.end(); ++iei) + { + SdpXengineToEdgeMapIterator xEdge = findSdpAuxEdge(*iei); + if ( xEdge != m_sdpXengineToAuxEdgeMap.end() ) + { + if (xEdge->first == SDP_ENGINE_X1) + foundEdges |= foundX1Edge; + else if (xEdge->first == SDP_ENGINE_X2) + foundEdges |= foundX2Edge; + else + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "%s Aux Edge Y %s not supported. Invalid state", + name().c_str(), engine_ast::Edge::prettyId(*iei).c_str()); + } + } + + if ( (*iei)->isAuxEdge() ) + { + // just make sure edge is already in the map + if ( xEdge == m_sdpXengineToAuxEdgeMap.end() ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "%s Aux Edge %s not in xEdge map. Invalid state", + name().c_str(), engine_ast::Edge::prettyId(*iei).c_str()); + } + markAuxEdge(*iei); + } + else if ( xEdge != m_sdpXengineToAuxEdgeMap.end() ) + { + // this is a kIO tensor dataedge linked as Aux edge + markAuxEdge(*iei); + } + else if ( (*iei) == m_InputEdge ) + { + // source input edge + markInputEdge(*iei); + foundEdges |= foundInputEdge; + } + else + { + // Its data edge, but its new one. + markInputEdge(*iei); + newEdges.push_back(*iei); + } + } + + // Did we find all expected edges? if not, update internal structures. + if ( foundEdges != foundAllEdges ) + { + if (newEdges.size() != 1) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "%s multiple new edges found. Invalid state", name().c_str()); + } + + if (!(foundEdges & foundInputEdge)) + { + m_InputEdge = newEdges[0]; + foundEdges |= foundInputEdge; + } + else if (!(foundEdges & foundX1Edge)) + { + m_sdpXengineToAuxEdgeMap[SDP_ENGINE_X1] = newEdges[0]; + foundEdges |= foundX1Edge; + } + else + { + m_sdpXengineToAuxEdgeMap[SDP_ENGINE_X2] = newEdges[0]; + foundEdges |= foundX2Edge; + } + + if (!(foundEdges & foundAllEdges)) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "%s multiple edges missing from the map. Invalid state", name().c_str()); + } + } + + PROPAGATE_ERROR_FAIL( verifyEdgePorts() ); + } + fail: + return e; +} + +NvDlaError engine_ast::SDPSuperOpNode::verifyEdgePorts() +{ + NvDlaError e = NvDlaSuccess; + + //gLogInfo << name() << " : verifyEdgePorts: " << endl; + //printSdpXEdgeMap(); + + if ( (inputEdges().size() != 1) || + (auxEdges().size() != m_sdpXengineToAuxEdgeMap.size()) || + (outputEdges().size() != 1) ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "%s: node in invalid state. edge counts invalid", + name().c_str()); + } + + // verify input source edge + if (inputEdges()[0] != m_InputEdge) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "%s: source input edge invalid", + name().c_str()); + } + + // verify expected Aux edges + for (auto it = auxEdges().begin(); it != auxEdges().end(); ++it) + { + SdpXengineToEdgeMapIterator xEdge = findSdpAuxEdge(*it); + if ( xEdge == m_sdpXengineToAuxEdgeMap.end() ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "%s: aux edge invalid.", + name().c_str()); + } + } +fail: + return e; +} + +/********** Internal xN-edge map management functions ***************/ +NvDlaError engine_ast::SDPSuperOpNode::auxEdgeBySubEngine(SDPSubEngineType xN, engine_ast::Edge **ret_edge) +{ + NvDlaError e = NvDlaSuccess; + + SdpXengineToEdgeMapIterator xEdgeElem = m_sdpXengineToAuxEdgeMap.find(xN.e()); + if (xEdgeElem == m_sdpXengineToAuxEdgeMap.end()) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, + "SDP SuperOp %s xN edge lookup failed for %d", name().c_str(), xN.e()); + + } + *ret_edge = xEdgeElem->second; + +fail: + return e; +} + +engine_ast::SDPSuperOpNode::SdpXengineToEdgeMapIterator engine_ast::SDPSuperOpNode::findSdpAuxEdge(engine_ast::Edge* edge) +{ + SdpXengineToEdgeMapIterator it; + for (it = m_sdpXengineToAuxEdgeMap.begin(); it != m_sdpXengineToAuxEdgeMap.end(); ++it) + { + if (it->second == edge) + { + break; + } + } + return it; +} + +void engine_ast::SDPSuperOpNode::printSdpXEdgeMap() +{ + SdpXengineToEdgeMapIterator it; + gLogInfo << name() << ": SdpXEdgeMap:" << endl; + if (m_InputEdge != NULL) + gLogInfo << "\tInput : " << engine_ast::Edge::prettyId(m_InputEdge) << endl; + else + gLogInfo << "\tInput : " << "null" << endl; + for (it = m_sdpXengineToAuxEdgeMap.begin(); it != m_sdpXengineToAuxEdgeMap.end(); ++it) + { + gLogInfo << "\t" << NvU16(it->first) << " : " << engine_ast::Edge::prettyId(it->second) << endl; + } + + EdgeSequence edges = inputEdges(); + for (EdgeSequenceIterator iei = edges.begin(); iei != edges.end(); ++iei) + { + gLogInfo << "\tinput : " << engine_ast::Edge::prettyId(*iei) << endl; + } + edges = outputEdges(); + for (EdgeSequenceIterator iei = edges.begin(); iei != edges.end(); ++iei) + { + gLogInfo << "\toutput : " << engine_ast::Edge::prettyId(*iei) << endl; + } + edges = auxEdges(); + for (EdgeSequenceIterator iei = edges.begin(); iei != edges.end(); ++iei) + { + gLogInfo << "\taux : " << engine_ast::Edge::prettyId(*iei) << endl; + } +} + +/* Returns pre-stored Aux Surface formats */ +std::vector engine_ast::SDPSuperOpNode::suggestAuxSurfaceFormats(engine_ast::Edge* auxEdge) +{ + NvDlaError e = NvDlaSuccess; + NVDLA_UNUSED(e); + std::vector supportedAuxSFs; + std::vector suggestedAuxSFs; + SdpXengineToEdgeMapIterator xEdge; + SDPSubEngineTypeEnum xN; + TensorType ttN; + //surface::SurfacePrecision compPrec = graph()->profile()->computePrecision(); + + // is auxEdge valid + if (auxEdge == NULL) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Invalid auxEdge for node %s, required to suggest aux surface formats", name().c_str()); + } + xEdge = findSdpAuxEdge(auxEdge); + if ( xEdge == m_sdpXengineToAuxEdgeMap.end() ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Invalid auxEdge for node %s, required to suggest aux surface formats", name().c_str()); + } + + // Get tensortype from AuxEdge subengine type + xN = SDPSubEngineTypeEnum(xEdge->first); + ttN = params().auxDataType(xN); + if ( auxEdge->originalTensor()->getTensorType() != ttN ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Invalid auxEdge for node %s, tensor types dont match", name().c_str()); + } + + // Get surface formats for the aux data on subengine + suggestedAuxSFs = params().auxSurfaceFormats(xN); + + if (suggestedAuxSFs.size() == 0) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "No supported aux surface formats for %s", name().c_str()); + } + +fail: + return suggestedAuxSFs; +} + +/* Return aux data associated with the aux edge */ +const void* engine_ast::SDPSuperOpNode::getAuxData(engine_ast::Edge* auxEdge) +{ + NvDlaError e = NvDlaSuccess; + void* data = NULL; + SdpXengineToEdgeMapIterator xEdge; + SDPSubEngineTypeEnum xN; + NVDLA_UNUSED(e); + + // is auxEdge valid + if (auxEdge == NULL) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Invalid auxEdge for node %s", name().c_str()); + } + xEdge = findSdpAuxEdge(auxEdge); + if ( xEdge == m_sdpXengineToAuxEdgeMap.end() ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Invalid auxEdge for node %s", name().c_str()); + } + xN = SDPSubEngineTypeEnum(xEdge->first); + data = const_cast(params().dlaData(xN).values); +fail: + return data; +} + +/********************************Process Aux Data*****************************/ +/* + * SDP SuperOp is created by combining other SDP ops. Hence pre processing + * of aux data should have already be handled by each indivisual SDP op and + * not really by SuperOp. + * preProcessAuxData would remain as an empty op. + */ +NvDlaError engine_ast::SDPSuperOpNode::preProcessAuxData() +{ + NvDlaError e = NvDlaSuccess; + return e; +} + +NvDlaError engine_ast::SDPSuperOpNode::translateAuxDataInternal(SDPSubEngineType xType, SDPSubEngineParams& xParams) +{ + NvDlaError e = NvDlaSuccess; + Weights trnsData; + engine_ast::Edge* auxEdge; + NvU32 channelsPerGroup = 0; + + surface::SurfacePrecision computePrecision = graph()->profile()->computePrecision(); + TensorType dt = params().auxDataType(xType); + + if (dt == TensorType::kIO) + { + // No translation required for feature data + goto fail; + } + + PROPAGATE_ERROR_FAIL(auxEdgeBySubEngine(xType, &auxEdge)); + + if (graph()->profile()->computePrecision().v() == surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8) + { + channelsPerGroup = graph()->target_config()->atomicKSize(); + } + + if ( graph()->debugWeights() ) + { + gLogInfo << "translating weights for " << name() << " data-dims = " << + auxEdge->tensorSurfaceDesc()->dimensions().n << "," << + auxEdge->tensorSurfaceDesc()->dimensions().c << "," << + auxEdge->tensorSurfaceDesc()->dimensions().h << "," << + auxEdge->tensorSurfaceDesc()->dimensions().w << endl; + } + + switch(dt) { + case TensorType::kBATCH_NORM: { + Weights meanData = params().rawAdderData(xType); + Weights varData = params().rawMultiplierData(xType); + + WeightTrns::WeightDims dims (meanData.count, + auxEdge->tensorSurfaceDesc()->dimensions().n, + auxEdge->tensorSurfaceDesc()->dimensions().c, + auxEdge->tensorSurfaceDesc()->dimensions().w, + auxEdge->tensorSurfaceDesc()->dimensions().h, + 1, //strides dont matter for BN + 1); + + PRECISION_SWITCH(meanData.type.v(), computePrecision.v(), trnsData, WeightTrns::translateDataForBatchNorm, + xParams.mode(), + dims, + meanData, + varData); + break; + } + case TensorType::kSCALE: { + Weights rawScaleData = params().rawMultiplierData(xType); + WeightTrns::WeightDims dims (rawScaleData.count, + auxEdge->tensorSurfaceDesc()->dimensions().n, + auxEdge->tensorSurfaceDesc()->dimensions().c, + auxEdge->tensorSurfaceDesc()->dimensions().w, + auxEdge->tensorSurfaceDesc()->dimensions().h, + 1, //strides dont matter for Scale + 1); + + PRECISION_SWITCH(rawScaleData.type.v(), computePrecision.v(), trnsData, WeightTrns::translateDataForScale, + xParams.mode(), + dims, + rawScaleData, + channelsPerGroup); + + + break; + } + case TensorType::kBIAS: { + Weights rawBiasData = params().rawAdderData(xType); + WeightTrns::WeightDims dims (rawBiasData.count, + auxEdge->tensorSurfaceDesc()->dimensions().n, + auxEdge->tensorSurfaceDesc()->dimensions().c, + auxEdge->tensorSurfaceDesc()->dimensions().w, + auxEdge->tensorSurfaceDesc()->dimensions().h, + 1, //strides ?? + 1); + + + PRECISION_SWITCH(rawBiasData.type.v(), computePrecision.v(), trnsData, WeightTrns::translateDataForBias, + xParams.mode(), + dims, + rawBiasData, + channelsPerGroup); + break; + } + case TensorType::kIO: + default: { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, + "SDP SuperOp data translation failed for node '%s'. Unsupported Tensor type: %d", + name().c_str(), dt); + break; + } + } + + if (trnsData.values == NULL) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, + "SDP SuperOp data translation failed for node '%s'. Unsupported Tensor type: %d", + name().c_str(), dt); + } + params().setDLAData(xType, trnsData); + +fail: + return e; +} + +NvDlaError engine_ast::SDPSuperOpNode::translateAuxData() +{ + NvDlaError e = NvDlaSuccess; + + // Translate X1 aux edge data + PROPAGATE_ERROR_FAIL(translateAuxDataInternal(SDP_ENGINE_X1, params().x1Params())); + // Translate X2 aux edge data + PROPAGATE_ERROR_FAIL(translateAuxDataInternal(SDP_ENGINE_X2, params().x2Params())); + +fail: + return e; +} + +NvU64 engine_ast::SDPSuperOpNode::suggestSurfaceSize(surface::TensorSurfaceDesc* tsd) +{ + NvDlaError e = NvDlaSuccess; + NvU64 size = 0; + bool isAuxEdge = false; + SDPSubEngineTypeEnum xN; + engine_ast::Edge* xEdge; + + PROPAGATE_ERROR_FAIL( verifyEdgePorts() ); + + if (m_nodeTSDSurfaceSize.find(tsd) != m_nodeTSDSurfaceSize.end()) + { + size = m_nodeTSDSurfaceSize[tsd]; + goto fail; + } + + for (SdpXengineToEdgeMapIterator it = m_sdpXengineToAuxEdgeMap.begin(); it != m_sdpXengineToAuxEdgeMap.end(); ++it) + { + xN = SDPSubEngineTypeEnum(it->first); + xEdge = it->second; + + // check if edge has Aux type tensor. + if (xEdge->isAuxEdge() && xEdge->tensorSurfaceDesc() == tsd) + { + isAuxEdge = true; + break; + } + } + + if (isAuxEdge) + { + surface::TensorSurfaceDesc probeTSD = *tsd; + Dims4 surfDims = suggestSurfaceDims(tsd); + probeTSD.setDimensions(surfDims); + probeTSD.resetSize(); + size = probeTSD.size(); + SDPSubEngineParams* prms = subEngineParams(xN); + + // if the op does int8 rescaling, it has both the + // aux data for the op and the rescaling factors + if (prms->isINT8Rescaling()) + { + size *= 2; + } + + m_nodeTSDSurfaceSize[tsd] = size; + } + +fail: + return size; +} + +NvDlaError engine_ast::SDPSuperOpNode::emitOp(Graph *g, + DLAInterface *target_dla, + NvU32 op_slot, NvU32 batch_id, + DLACommonOpDescAccessor dep, + DLAOperationContainerAccessor op, + DLASurfaceContainerAccessor surf) +{ + NvDlaError e = NvDlaSuccess; + DLASDPOpDescAccessor sdp_op = op.sdpOpDescAccessor(0); + DLACVTParamAccessor out_cvt_acc = sdp_op.outCVTAccessor(); + DLASDPOpAccessor x1_op_acc = sdp_op.x1OpAccessor(); + DLASDPOpAccessor x2_op_acc = sdp_op.x2OpAccessor(); + DLASDPOpAccessor y_op_acc = sdp_op.yOpAccessor(); + DLASDPSurfaceDescAccessor surf_acc = surf.sdpSurfaceDescAccessor(0); + DLADataCubeAccessor src_data_acc = surf_acc.srcDataAccessor(); + DLADataCubeAccessor dst_data_acc = surf_acc.dstDataAccessor(); + DLADataCubeAccessor x1_data_acc = surf_acc.x1DataAccessor(); + DLADataCubeAccessor x2_data_acc = surf_acc.x2DataAccessor(); + DLADataCubeAccessor y_data_acc = surf_acc.yDataAccessor(); + DLAConsumerAccessor fused_acc = dep.fusedParentAccessor(); + NVDLA_UNUSED(y_data_acc); + NVDLA_UNUSED(fused_acc); + + surface::TensorSurfaceDesc *src_tsd = m_InputEdge->tensorSurfaceDesc(); + surface::TensorSurfaceDesc *dst_tsd = g->nodeOutputTensorSurface(this, 0, supportedOutSurfCategories()); + surface::TensorSurfaceDesc *x1_tsd = NULL; + surface::TensorSurfaceDesc *x2_tsd = NULL; + engine_ast::Edge* auxEdge; + PROPAGATE_ERROR_FAIL(auxEdgeBySubEngine(SDP_ENGINE_X1, &auxEdge)); + x1_tsd = auxEdge->tensorSurfaceDesc(); + PROPAGATE_ERROR_FAIL(auxEdgeBySubEngine(SDP_ENGINE_X2, &auxEdge)); + x2_tsd = auxEdge->tensorSurfaceDesc(); + + *sdp_op.srcPrecision() = ASTToDLAInterface::getSDPPrecision(target_dla, src_tsd->surfaceFormat().precision()); + *sdp_op.dstPrecision() = ASTToDLAInterface::getSDPPrecision(target_dla, dst_tsd->surfaceFormat().precision()); + *sdp_op.LUTIndex() = -1; + *sdp_op.batchNum() = 1; + *sdp_op.batchStride() = 0; + + *out_cvt_acc.scale() = params().outCVT().scale(); + *out_cvt_acc.truncate() = params().outCVT().truncate(); + *out_cvt_acc.offset() = params().outCVT().offset(); + *out_cvt_acc.enable() = static_cast(params().outCVT().isEnable()); + + *x1_op_acc.enable() = params(batch_id).x1Params().enabled(); + *x1_op_acc.ALUType() = ASTToDLAInterface::getSDPALUType(target_dla, params(batch_id).x1Params().aluType()); + *x1_op_acc.type() = ASTToDLAInterface::getSDPOpType(target_dla, params(batch_id).x1Params().opType()); + *x1_op_acc.mode() = ASTToDLAInterface::getSDPMode(target_dla, params(batch_id).x1Params().mode()); + *x1_op_acc.act() = ASTToDLAInterface::getSDPActType(target_dla, params(batch_id).x1Params().actType()); + // FIXME + *x1_op_acc.shiftValue() = params(batch_id).x1Params().shiftValue(); + *x1_op_acc.ALUOperand() = params(batch_id).x1Params().aluOperand(); + *x1_op_acc.MulOperand() = /*params(batch_id).x1Params().mulOperand();*/ 1; + *x1_op_acc.truncate() = params(batch_id).x1Params().truncate(); + *x1_op_acc.precision() = ASTToDLAInterface::getSDPPrecision(target_dla, x1_tsd->surfaceFormat().precision()); + + *x2_op_acc.enable() = params(batch_id).x2Params().enabled(); + *x2_op_acc.ALUType() = ASTToDLAInterface::getSDPALUType(target_dla, params(batch_id).x2Params().aluType()); + *x2_op_acc.type() = ASTToDLAInterface::getSDPOpType(target_dla, params(batch_id).x2Params().opType()); + *x2_op_acc.mode() = ASTToDLAInterface::getSDPMode(target_dla, params(batch_id).x2Params().mode()); + *x2_op_acc.act() = ASTToDLAInterface::getSDPActType(target_dla, params(batch_id).x2Params().actType()); + // FIXME + *x2_op_acc.shiftValue() = params(batch_id).x2Params().shiftValue(); + *x2_op_acc.ALUOperand() = params(batch_id).x2Params().aluOperand(); + *x2_op_acc.MulOperand() = /*params(batch_id).x2Params().mulOperand();*/ 1; + *x2_op_acc.truncate() = params(batch_id).x2Params().truncate(); + *x2_op_acc.precision() = ASTToDLAInterface::getSDPPrecision(target_dla, x2_tsd->surfaceFormat().precision()); + + // FIXME + *y_op_acc.enable() = 0; + + emitDependencyParams(target_dla, dep, batch_id); + setDataCubeAccessor(src_data_acc, src_tsd, IODirectionEnum::INPUT, batch_id); + setDataCubeAccessor(dst_data_acc, dst_tsd, IODirectionEnum::OUTPUT, batch_id); + setDataCubeAccessor(x1_data_acc, x1_tsd, IODirectionEnum::UNKNOWN, batch_id); + setDataCubeAccessor(x2_data_acc, x2_tsd, IODirectionEnum::UNKNOWN, batch_id); + + if ( params(batch_id).convMode().v() == ConvolutionModeEnum::CONV_WINOGRAD ) + { + *sdp_op.convMode() = sdp_op.convMode_Winograd(); + + *src_data_acc.width() = params().winogradParams().ioDims.w; + *src_data_acc.height() = params().winogradParams().ioDims.h; + + *dst_data_acc.width() = params().winogradParams().ioDims.w; + *dst_data_acc.height() = params().winogradParams().ioDims.h; + } + else if ( params(batch_id).convMode().v() == ConvolutionModeEnum::CONV_DIRECT ) + { + *sdp_op.convMode() = sdp_op.convMode_Direct(); + } + else + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unsupported Conv mode for %s", name().c_str()); + } + + if ( g->debugOps() ) + { + gLogInfo << "SDP Super Op node @ op_slot = " << op_slot << " batch_id = " << batch_id << endl; + gLogInfo << "\tsrc precision " << (int)*sdp_op.srcPrecision() << endl; + gLogInfo << "\tdst precision " << (int)*sdp_op.dstPrecision() << endl; + gLogInfo << "\tx1 enable " << (int)*x1_op_acc.enable() << endl; + if (*x1_op_acc.enable()) + { + gLogInfo << "\tx1 precision " << (int)*x1_op_acc.precision() << endl; + gLogInfo << "\tx1 aluType " << (int)*x1_op_acc.ALUType() << endl; + gLogInfo << "\tx1 type " << (int)*x1_op_acc.type() << endl; + gLogInfo << "\tx1 mode " << (int)*x1_op_acc.mode() << endl; + gLogInfo << "\tx1 act " << (int)*x1_op_acc.act() << endl; + gLogInfo << "\tx1 shiftValue " << (int)*x1_op_acc.shiftValue() << endl; + gLogInfo << "\tx1 aluOperand " << (int)*x1_op_acc.ALUOperand() << endl; + gLogInfo << "\tx1 mulOperand " << (int)*x1_op_acc.MulOperand() << endl; + gLogInfo << "\tx1 truncate " << (int)*x1_op_acc.truncate() << endl; + } + gLogInfo << "\tx2 enable " << (int)*x2_op_acc.enable() << endl; + if (*x2_op_acc.enable()) + { + gLogInfo << "\tx2 precision " << (int)*x2_op_acc.precision() << endl; + gLogInfo << "\tx2 aluType " << (int)*x2_op_acc.ALUType() << endl; + gLogInfo << "\tx2 type " << (int)*x2_op_acc.type() << endl; + + gLogInfo << "\tx2 mode " << (int)*x2_op_acc.mode() << endl; + + gLogInfo << "\tx2 act " << (int)*x2_op_acc.act() << endl; + + gLogInfo << "\tx2 shiftValue " << (int)*x2_op_acc.shiftValue() << endl; + + gLogInfo << "\tx2 aluOperand " << (int)*x2_op_acc.ALUOperand() << endl; + gLogInfo << "\tx2 mulOperand " << (int)*x2_op_acc.MulOperand() << endl; + gLogInfo << "\tx2 truncate " << (int)*x2_op_acc.truncate() << endl; + } + gLogInfo << "\ty enable " << (int)*y_op_acc.enable() << endl; + if (*y_op_acc.enable()) + { + gLogInfo << "\ty precision " << (int)*y_op_acc.precision() << endl; + gLogInfo << "\ty aluType " << (int)*y_op_acc.ALUType() << endl; + gLogInfo << "\ty type " << (int)*y_op_acc.type() << endl; + gLogInfo << "\ty mode " << (int)*y_op_acc.mode() << endl; + gLogInfo << "\ty act " << (int)*y_op_acc.act() << endl; + gLogInfo << "\ty shiftValue " << (int)*y_op_acc.shiftValue() << endl; + gLogInfo << "\ty aluOperand " << (int)*y_op_acc.ALUOperand() << endl; + gLogInfo << "\ty mulOperand " << (int)*y_op_acc.MulOperand() << endl; + gLogInfo << "\ty truncate " << (int)*y_op_acc.truncate() << endl; + } + gLogInfo << "\tsrc tsd:" << src_tsd->id() << endl; + gLogInfo << "\tdst tsd:" << dst_tsd->id() << endl; + gLogInfo << "\tx1 tsd:" << x1_tsd->id() << endl; + gLogInfo << "\tx2 tsd:" << x2_tsd->id() << endl; + gLogInfo << "\tdependencyCount" << (int)*dep.dependencyCount() << endl; + gLogInfo << "\tconv_mode " << (int)*sdp_op.convMode() << endl; + gLogInfo << "\tsrc addr=" << *src_data_acc.address() << endl; + gLogInfo << "\tsrc type=" << (int)*src_data_acc.type() << endl; + gLogInfo << "\tsrc size " << *src_data_acc.size() << endl; + gLogInfo << "\tsrc width " << *src_data_acc.width() << endl; + gLogInfo << "\tsrc height " << *src_data_acc.height() << endl; + gLogInfo << "\tsrc channel " << *src_data_acc.channel() << endl; + gLogInfo << "\tsrc linestride " << *src_data_acc.lineStride() << endl; + gLogInfo << "\tsrc surfstride " << *src_data_acc.surfStride() << endl; + gLogInfo << "\tx1 addr=" << *x1_data_acc.address() << endl; + gLogInfo << "\tx1 type=" << (int)*x1_data_acc.type() << endl; + gLogInfo << "\tx1 size " << *x1_data_acc.size() << endl; + gLogInfo << "\tx1 width " << *x1_data_acc.width() << endl; + gLogInfo << "\tx1 height " << *x1_data_acc.height() << endl; + gLogInfo << "\tx1 channel " << *x1_data_acc.channel() << endl; + gLogInfo << "\tx1 linestride " << *x1_data_acc.lineStride() << endl; + gLogInfo << "\tx1 surfstride " << *x1_data_acc.surfStride() << endl; + gLogInfo << "\tx2 addr=" << *x2_data_acc.address() << endl; + gLogInfo << "\tx2 type=" << (int)*x2_data_acc.type() << endl; + gLogInfo << "\tx2 size " << *x2_data_acc.size() << endl; + gLogInfo << "\tx2 width " << *x2_data_acc.width() << endl; + gLogInfo << "\tx2 height " << *x2_data_acc.height() << endl; + gLogInfo << "\tx2 channel " << *x2_data_acc.channel() << endl; + gLogInfo << "\tx2 linestride " << *x2_data_acc.lineStride() << endl; + gLogInfo << "\tx2 surfstride " << *x2_data_acc.surfStride() << endl; + gLogInfo << "\tdst addr=" << *dst_data_acc.address() << endl; + gLogInfo << "\tdst type=" << (int)*dst_data_acc.type() << endl; + gLogInfo << "\tdst size " << *dst_data_acc.size() << endl; + gLogInfo << "\tdst width " << *dst_data_acc.width() << endl; + gLogInfo << "\tdst height " << *dst_data_acc.height() << endl; + gLogInfo << "\tdst channel " << *dst_data_acc.channel() << endl; + gLogInfo << "\tdst linestride " << *dst_data_acc.lineStride() << endl; + gLogInfo << "\tdst surfstride " << *dst_data_acc.surfStride() << endl; + gLogInfo << "\tout_cvt enable " << (int)*out_cvt_acc.enable() << endl; + gLogInfo << "\tout_cvt scale " << (int)*out_cvt_acc.scale() << endl; + gLogInfo << "\tout_cvt offset " << (int)*out_cvt_acc.offset() << endl; + gLogInfo << "\tout_cvt truncate " << (int)*out_cvt_acc.truncate() << endl; + } + +fail: + return e; +} + +#ifdef NVDLA_COMPILER_OUTPUT_FOR_PROTOTEST +static nvdla_prototest_interface::SDPOp_SDPOpMode opMode2InfOpMode(engine_ast::SDPMode om) +{ + nvdla_prototest_interface::SDPOp_SDPOpMode iom = nvdla_prototest_interface::SDPOp_SDPOpMode::SDPOp_SDPOpMode_SDP_OP_PER_KERNEL; + switch(om.v()) + { + case engine_ast::SDPModeEnum::SDP_MODE_PER_CHANNEL: iom = + nvdla_prototest_interface::SDPOp_SDPOpMode::SDPOp_SDPOpMode_SDP_OP_PER_KERNEL; break; + case engine_ast::SDPModeEnum::SDP_MODE_PER_ELEMENT: iom = + nvdla_prototest_interface::SDPOp_SDPOpMode::SDPOp_SDPOpMode_SDP_OP_PER_POINT; break; + case engine_ast::SDPModeEnum::SDP_MODE_PER_LAYER: iom = + nvdla_prototest_interface::SDPOp_SDPOpMode::SDPOp_SDPOpMode_SDP_OP_PER_LAYER; break; + default: + REPORT_ERROR(NvDlaError_BadParameter, "Unknown op mode: %s", om.c_str()); + } + + return iom; +} + +static nvdla_prototest_interface::SDPOpType opType2InfOpType(engine_ast::SDPOpType ot) +{ + nvdla_prototest_interface::SDPOpType iot = nvdla_prototest_interface::SDP_OP_ADD; + switch(ot.v()) + { + case engine_ast::SDPOpTypeEnum::SDP_OP_TYPE_ADD : iot = + nvdla_prototest_interface::SDP_OP_ADD; break; + case engine_ast::SDPOpTypeEnum::SDP_OP_TYPE_MUL: iot = + nvdla_prototest_interface::SDP_OP_MUL; break; + case engine_ast::SDPOpTypeEnum::SDP_OP_TYPE_BOTH: iot = + nvdla_prototest_interface::SDP_OP_BOTH; break; + default: + REPORT_ERROR(NvDlaError_BadParameter, "Unknown op mode: %s", ot.c_str()); + } + + return iot; +} + +static nvdla_prototest_interface::SDPActivation actType2InfActType(engine_ast::SDPActType at) +{ + nvdla_prototest_interface::SDPActivation iat = nvdla_prototest_interface::SDPActivation::ACT_NONE; + switch(at.v()) + { + case engine_ast::SDPActTypeEnum::SDP_ACT_TYPE_NONE: iat = + nvdla_prototest_interface::SDPActivation::ACT_NONE; break; + case engine_ast::SDPActTypeEnum::SDP_ACT_TYPE_RELU: iat = + nvdla_prototest_interface::SDPActivation::ACT_RELU; break; + case engine_ast::SDPActTypeEnum::SDP_ACT_TYPE_TANH: + case engine_ast::SDPActTypeEnum::SDP_ACT_TYPE_SIGMOID:iat = + nvdla_prototest_interface::SDPActivation::ACT_LUT; break; + default: + REPORT_ERROR(NvDlaError_BadParameter, "Unknown act type: %s", at.c_str()); + } + + return iat; +} + +static nvdla_prototest_interface::ALUType aluType2InfAluType(engine_ast::SDPALUType at) +{ + nvdla_prototest_interface::ALUType iat = nvdla_prototest_interface::ALU_SUM; + switch(at.v()) + { + case engine_ast::SDPALUTypeEnum::SDP_ALU_TYPE_MAX : iat = + nvdla_prototest_interface::ALU_MAX; break; + case engine_ast::SDPALUTypeEnum::SDP_ALU_TYPE_MIN: iat = + nvdla_prototest_interface::ALU_MIN; break; + case engine_ast::SDPALUTypeEnum::SDP_ALU_TYPE_SUM: iat = + nvdla_prototest_interface::ALU_SUM; break; + case engine_ast::SDPALUTypeEnum::SDP_ALU_TYPE_EQL: iat = + nvdla_prototest_interface::ALU_EQL; break; + default: + REPORT_ERROR(NvDlaError_BadParameter, "Unknown op mode: %s", at.c_str()); + } + + return iat; +} + +NvDlaError engine_ast::SDPSuperOpNode::emitOp(NvU32 op_slot, NvU32 batch_id, + DLAInterface* target_dla, + DLACommonOpDescAccessor& dep, + DLAOperationContainerAccessor& op, + DLASurfaceContainerAccessor& surf, + nvdla_prototest_interface::Layer* protoLayer) +{ + NvDlaError e = NvDlaSuccess; + + NvU8 numConsumers = 0; + + DLASDPOpDescAccessor sdp_op = op.sdpOpDescAccessor(0); + DLACVTParamAccessor out_cvt_acc = sdp_op.outCVTAccessor(); + DLASDPOpAccessor x1_op_acc = sdp_op.x1OpAccessor(); + DLASDPOpAccessor x2_op_acc = sdp_op.x2OpAccessor(); + DLASDPOpAccessor y_op_acc = sdp_op.yOpAccessor(); + DLASDPSurfaceDescAccessor surf_acc = surf.sdpSurfaceDescAccessor(0); + DLADataCubeAccessor src_data_acc = surf_acc.srcDataAccessor(); + DLADataCubeAccessor dst_data_acc = surf_acc.dstDataAccessor(); + DLADataCubeAccessor x1_data_acc = surf_acc.x1DataAccessor(); + DLADataCubeAccessor x2_data_acc = surf_acc.x2DataAccessor(); + DLADataCubeAccessor y_data_acc = surf_acc.yDataAccessor(); + DLAConsumerAccessor fused_acc = dep.fusedParentAccessor(); + NVDLA_UNUSED(out_cvt_acc); + NVDLA_UNUSED(y_data_acc); + NVDLA_UNUSED(batch_id); + + surface::TensorSurfaceDesc *src_tsd = graph()->nodeInputTensorSurface(this, 0, supportedInSurfCategories()); + surface::TensorSurfaceDesc *dst_tsd = graph()->nodeOutputTensorSurface(this, 0, supportedOutSurfCategories()); + surface::TensorSurfaceDesc *x1_tsd = NULL; + surface::TensorSurfaceDesc *x2_tsd = NULL; + + nvdla_prototest_interface::SDPOpDesc* protoSDPOpDesc = protoLayer->mutable_op_config()->mutable_sdp_op(); + nvdla_prototest_interface::SDPSurfaceDesc* protoSDPSurfDesc = protoLayer->mutable_surface()->mutable_sdp_surface(); + nvdla_prototest_interface::SDPOp* protoSDPX1OpDesc = protoSDPOpDesc->mutable_x1_op(); + nvdla_prototest_interface::SDPOp* protoSDPX2OpDesc = protoSDPOpDesc->mutable_x2_op(); + nvdla_prototest_interface::SDPOp* protoSDPYOpDesc = protoSDPOpDesc->mutable_y_op(); + nvdla_prototest_interface::DataCube* protoSrcDataCube = protoSDPSurfDesc->mutable_src_data(); + nvdla_prototest_interface::DataCube* protoDstDataCube = protoSDPSurfDesc->mutable_dst_data(); + nvdla_prototest_interface::DataCube* protoX1DataCube = protoSDPSurfDesc->mutable_x1_data(); + nvdla_prototest_interface::DataCube* protoX2DataCube = protoSDPSurfDesc->mutable_x2_data(); + nvdla_prototest_interface::DataPrecision protoSrcPrec, protoDstPrec; + + engine_ast::Edge* auxEdge; + PROPAGATE_ERROR_FAIL(auxEdgeBySubEngine(SDP_ENGINE_X1, &auxEdge)); + x1_tsd = auxEdge->tensorSurfaceDesc(); + PROPAGATE_ERROR_FAIL(auxEdgeBySubEngine(SDP_ENGINE_X2, &auxEdge)); + x2_tsd = auxEdge->tensorSurfaceDesc(); + + protoLayer->set_index(op_slot); + protoLayer->set_roi_index(0); + protoLayer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_SDP); + protoLayer->set_dependency_count(*dep.dependencyCount()); + + /* consumers */ + for (size_t c = 0; c < EngineType::num_elements(); c++) + { + NvS8 fw_op_index = ASTToDLAInterface::getEngineType(target_dla, c); + if ( fw_op_index < 0 ) + { + continue; + } + + DLAConsumerAccessor cons_acc = dep.consumerAccessor(fw_op_index); + if (*cons_acc.index() != -1) { + numConsumers++; + nvdla_prototest_interface::Consumer* protoConsumer = protoLayer->add_bottom(); + protoConsumer->set_index(*cons_acc.index()); + switch(c) { + case EngineTypeEnum::BDMA : protoConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_BDMA); break; + case EngineTypeEnum::CONVOLUTION : protoConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_CONV); break; + case EngineTypeEnum::SDP : protoConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_SDP); break; + case EngineTypeEnum::PDP : protoConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_PDP); break; + case EngineTypeEnum::CDP : protoConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_CDP); break; + case EngineTypeEnum::RUBIK: protoConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_RUBIK); break; + default: ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unrecognized consumer"); + } + switch(dependencyParams().consumer(c).opEvent().v()) { + case OperationEventTypeEnum::OP_CDMA_WEIGHT_DONE : protoConsumer->set_event(nvdla_prototest_interface::Consumer_EventType::Consumer_EventType_CDMA_WT_DONE); break; + case OperationEventTypeEnum::OP_CDMA_DATA_DONE : protoConsumer->set_event(nvdla_prototest_interface::Consumer_EventType::Consumer_EventType_CDMA_DT_DONE); break; + case OperationEventTypeEnum::OP_COMPLETED : protoConsumer->set_event(nvdla_prototest_interface::Consumer_EventType::Consumer_EventType_OP_COMPLETED); break; + case OperationEventTypeEnum::OP_ENABLED : protoConsumer->set_event(nvdla_prototest_interface::Consumer_EventType::Consumer_EventType_OP_ENABLED); break; + case OperationEventTypeEnum::OP_PROGRAMMED : protoConsumer->set_event(nvdla_prototest_interface::Consumer_EventType::Consumer_EventType_OP_PROGRAMMED); break; + default: ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unrecognized consumer event"); + } + } + } + + /* fused node */ + if (dependencyParams().fusedNode(engine_ast::IODirectionEnum::INPUT)) + { + nvdla_prototest_interface::Consumer* protoFusedConsumer = protoLayer->mutable_fused(); + protoFusedConsumer->set_index(*fused_acc.index()); + protoFusedConsumer->set_event(nvdla_prototest_interface::Consumer_EventType::Consumer_EventType_OP_ENABLED); + switch(dependencyParams().fusedNode(engine_ast::IODirectionEnum::INPUT)->engineType().v()) { + case EngineTypeEnum::CONVOLUTION: protoFusedConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_CONV); break; + default: ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "SDP can have only Conv op as its fused partner on input side"); + } + } + + switch(src_tsd->surfaceFormat().precision().v()) { + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_FP16 : protoSrcPrec = nvdla_prototest_interface::DataPrecision::PRECISION_FP16; break; + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16 : protoSrcPrec = nvdla_prototest_interface::DataPrecision::PRECISION_INT16; break; + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8 : protoSrcPrec = nvdla_prototest_interface::DataPrecision::PRECISION_INT8; break; + default: ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unrecognized src precision"); + } + + switch(dst_tsd->surfaceFormat().precision().v()) { + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_FP16 : protoDstPrec = nvdla_prototest_interface::DataPrecision::PRECISION_FP16; break; + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16 : protoDstPrec = nvdla_prototest_interface::DataPrecision::PRECISION_INT16; break; + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8 : protoDstPrec = nvdla_prototest_interface::DataPrecision::PRECISION_INT8; break; + default: ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unrecognized dst precision"); + } + + protoSDPOpDesc->set_src_precision(protoSrcPrec); + protoSDPOpDesc->set_dst_precision(protoDstPrec); + protoSDPOpDesc->set_lut_index(-1); + + protoSDPOpDesc->mutable_out_cvt()->set_enable(1); + protoSDPOpDesc->mutable_out_cvt()->set_offset(0); + protoSDPOpDesc->mutable_out_cvt()->set_scale(1); + protoSDPOpDesc->mutable_out_cvt()->set_truncate(0); + + protoSDPOpDesc->set_conv_mode(nvdla_prototest_interface::ConvMode::DIRECT); + protoSDPOpDesc->set_batch_num(1); + protoSDPOpDesc->set_batch_stride(0); + + protoSDPX1OpDesc->set_enable(*x1_op_acc.enable()); + protoSDPX1OpDesc->set_alu_type(aluType2InfAluType(params(batch_id).x1Params().aluType())); + protoSDPX1OpDesc->set_type(opType2InfOpType(params(batch_id).x1Params().opType())); + protoSDPX1OpDesc->set_mode(opMode2InfOpMode(params().x1Params().mode())); + protoSDPX1OpDesc->set_act(actType2InfActType(params().x1Params().actType())); + protoSDPX1OpDesc->set_shift_value(*x1_op_acc.shiftValue()); + protoSDPX1OpDesc->set_alu_operand(*x1_op_acc.ALUOperand()); + protoSDPX1OpDesc->set_mul_operand(*x1_op_acc.MulOperand()); + protoSDPX1OpDesc->set_truncate(*x1_op_acc.truncate()); + protoSDPX1OpDesc->set_precision(protoSrcPrec); + protoSDPX1OpDesc->mutable_cvt()->mutable_alu_cvt()->set_enable(*x1_op_acc.cvt().aluCVTAccessor().enable()); + protoSDPX1OpDesc->mutable_cvt()->mutable_alu_cvt()->set_truncate(*x1_op_acc.cvt().aluCVTAccessor().truncate()); + protoSDPX1OpDesc->mutable_cvt()->mutable_alu_cvt()->set_scale(*x1_op_acc.cvt().aluCVTAccessor().scale()); + protoSDPX1OpDesc->mutable_cvt()->mutable_alu_cvt()->set_offset(*x1_op_acc.cvt().aluCVTAccessor().offset()); + protoSDPX1OpDesc->mutable_cvt()->mutable_mul_cvt()->set_enable(*x1_op_acc.cvt().mulCVTAccessor().enable()); + protoSDPX1OpDesc->mutable_cvt()->mutable_mul_cvt()->set_truncate(*x1_op_acc.cvt().mulCVTAccessor().truncate()); + protoSDPX1OpDesc->mutable_cvt()->mutable_mul_cvt()->set_scale(*x1_op_acc.cvt().mulCVTAccessor().scale()); + protoSDPX1OpDesc->mutable_cvt()->mutable_mul_cvt()->set_offset(*x1_op_acc.cvt().mulCVTAccessor().offset()); + + protoSDPX2OpDesc->set_enable(*x2_op_acc.enable()); + protoSDPX2OpDesc->set_alu_type(aluType2InfAluType(params(batch_id).x2Params().aluType())); + protoSDPX2OpDesc->set_type(opType2InfOpType(params(batch_id).x2Params().opType())); + protoSDPX2OpDesc->set_mode(opMode2InfOpMode(params().x2Params().mode())); + protoSDPX2OpDesc->set_act(actType2InfActType(params().x2Params().actType())); + protoSDPX2OpDesc->set_shift_value(*x2_op_acc.shiftValue()); + protoSDPX2OpDesc->set_alu_operand(*x2_op_acc.ALUOperand()); + protoSDPX2OpDesc->set_mul_operand(*x2_op_acc.MulOperand()); + protoSDPX2OpDesc->set_truncate(*x2_op_acc.truncate()); + protoSDPX2OpDesc->set_precision(protoSrcPrec); + protoSDPX2OpDesc->mutable_cvt()->mutable_alu_cvt()->set_enable(*x2_op_acc.cvt().aluCVTAccessor().enable()); + protoSDPX2OpDesc->mutable_cvt()->mutable_alu_cvt()->set_truncate(*x2_op_acc.cvt().aluCVTAccessor().truncate()); + protoSDPX2OpDesc->mutable_cvt()->mutable_alu_cvt()->set_scale(*x2_op_acc.cvt().aluCVTAccessor().scale()); + protoSDPX2OpDesc->mutable_cvt()->mutable_alu_cvt()->set_offset(*x2_op_acc.cvt().aluCVTAccessor().offset()); + protoSDPX2OpDesc->mutable_cvt()->mutable_mul_cvt()->set_enable(*x2_op_acc.cvt().mulCVTAccessor().enable()); + protoSDPX2OpDesc->mutable_cvt()->mutable_mul_cvt()->set_truncate(*x2_op_acc.cvt().mulCVTAccessor().truncate()); + protoSDPX2OpDesc->mutable_cvt()->mutable_mul_cvt()->set_scale(*x2_op_acc.cvt().mulCVTAccessor().scale()); + protoSDPX2OpDesc->mutable_cvt()->mutable_mul_cvt()->set_offset(*x2_op_acc.cvt().mulCVTAccessor().offset()); + + + protoSDPYOpDesc->set_enable(*y_op_acc.enable()); + protoSDPYOpDesc->set_alu_type(nvdla_prototest_interface::ALUType::ALU_SUM); + protoSDPYOpDesc->set_type(nvdla_prototest_interface::SDPOpType::SDP_OP_ADD); + protoSDPYOpDesc->set_mode(nvdla_prototest_interface::SDPOp_SDPOpMode::SDPOp_SDPOpMode_SDP_OP_PER_KERNEL); + protoSDPYOpDesc->set_act(nvdla_prototest_interface::SDPActivation::ACT_NONE); + protoSDPYOpDesc->set_shift_value(*y_op_acc.shiftValue()); + protoSDPYOpDesc->set_alu_operand(*y_op_acc.ALUOperand()); + protoSDPYOpDesc->set_mul_operand(*y_op_acc.MulOperand()); + protoSDPYOpDesc->set_truncate(*y_op_acc.truncate()); + protoSDPYOpDesc->set_precision(protoSrcPrec); + protoSDPYOpDesc->mutable_cvt()->mutable_alu_cvt()->set_enable(*y_op_acc.cvt().aluCVTAccessor().enable()); + protoSDPYOpDesc->mutable_cvt()->mutable_alu_cvt()->set_truncate(*y_op_acc.cvt().aluCVTAccessor().truncate()); + protoSDPYOpDesc->mutable_cvt()->mutable_alu_cvt()->set_scale(*y_op_acc.cvt().aluCVTAccessor().scale()); + protoSDPYOpDesc->mutable_cvt()->mutable_alu_cvt()->set_offset(*y_op_acc.cvt().aluCVTAccessor().offset()); + protoSDPYOpDesc->mutable_cvt()->mutable_mul_cvt()->set_enable(*y_op_acc.cvt().mulCVTAccessor().enable()); + protoSDPYOpDesc->mutable_cvt()->mutable_mul_cvt()->set_truncate(*y_op_acc.cvt().mulCVTAccessor().truncate()); + protoSDPYOpDesc->mutable_cvt()->mutable_mul_cvt()->set_scale(*y_op_acc.cvt().mulCVTAccessor().scale()); + protoSDPYOpDesc->mutable_cvt()->mutable_mul_cvt()->set_offset(*y_op_acc.cvt().mulCVTAccessor().offset()); + + + if (*fused_acc.index() != -1) { + protoSrcDataCube->set_type(nvdla_prototest_interface::MemType::DLA_MEM_HW); + } else { + protoSrcDataCube->set_type(nvdla_prototest_interface::MemType::DLA_MEM_MC); + } + protoSrcDataCube->set_address(*src_data_acc.address()); + protoSrcDataCube->set_size(src_tsd->tensorBufferDesc()->size() - src_tsd->bufferOffset()); + protoSrcDataCube->set_width(*src_data_acc.width()); + protoSrcDataCube->set_height(*src_data_acc.height()); + protoSrcDataCube->set_channel(*src_data_acc.channel()); + protoSrcDataCube->set_line_stride(*src_data_acc.lineStride()); + protoSrcDataCube->set_surf_stride(*src_data_acc.surfStride()); + protoSrcDataCube->set_plane_stride(*src_data_acc.planeStride()); + protoSrcDataCube->mutable_mem_info()->set_mem_id(src_tsd->tensorBufferDesc()->memoryId(batch_id)); + protoSrcDataCube->mutable_mem_info()->set_mem_size(src_tsd->tensorBufferDesc()->size()); + protoSrcDataCube->mutable_mem_info()->set_offset(src_tsd->bufferOffset()); + + protoDstDataCube->set_type(nvdla_prototest_interface::MemType::DLA_MEM_MC); + protoDstDataCube->set_address(*dst_data_acc.address()); + protoDstDataCube->set_size(dst_tsd->tensorBufferDesc()->size() - dst_tsd->bufferOffset()); + protoDstDataCube->set_width(*dst_data_acc.width()); + protoDstDataCube->set_height(*dst_data_acc.height()); + protoDstDataCube->set_channel(*dst_data_acc.channel()); + protoDstDataCube->set_line_stride(*dst_data_acc.lineStride()); + protoDstDataCube->set_surf_stride(*dst_data_acc.surfStride()); + protoDstDataCube->set_plane_stride(*dst_data_acc.planeStride()); + protoDstDataCube->mutable_mem_info()->set_mem_id(dst_tsd->tensorBufferDesc()->memoryId(batch_id)); + protoDstDataCube->mutable_mem_info()->set_mem_size(dst_tsd->tensorBufferDesc()->size()); + protoDstDataCube->mutable_mem_info()->set_offset(dst_tsd->bufferOffset()); + if (numConsumers == 0) { + protoDstDataCube->mutable_mem_info()->set_fill_type(nvdla_prototest_interface::FillerType::FILL_NONE); + protoDstDataCube->mutable_mem_info()->set_flag(nvdla_prototest_interface::MemFlag::DLA_MEM_OUTPUT); + protoDstDataCube->mutable_mem_info()->set_precision(protoDstPrec); + } + + protoX1DataCube->set_type(nvdla_prototest_interface::MemType::DLA_MEM_MC); + protoX1DataCube->set_address(*x1_data_acc.address()); + protoX1DataCube->set_size(x1_tsd->tensorBufferDesc()->size()); + protoX1DataCube->set_width(*x1_data_acc.width()); + protoX1DataCube->set_height(*x1_data_acc.height()); + protoX1DataCube->set_channel(*x1_data_acc.channel()); + protoX1DataCube->set_line_stride(*x1_data_acc.lineStride()); + protoX1DataCube->set_surf_stride(*x1_data_acc.surfStride()); + protoX1DataCube->set_plane_stride(*x1_data_acc.planeStride()); + protoX1DataCube->mutable_mem_info()->set_mem_id(x1_tsd->tensorBufferDesc()->memoryId(batch_id)); + protoX1DataCube->mutable_mem_info()->set_mem_size(x1_tsd->tensorBufferDesc()->size()); + protoX1DataCube->mutable_mem_info()->set_offset(x1_tsd->bufferOffset()); + + protoX2DataCube->set_type(nvdla_prototest_interface::MemType::DLA_MEM_MC); + protoX2DataCube->set_address(*x2_data_acc.address()); + protoX2DataCube->set_size(x2_tsd->tensorBufferDesc()->size()); + protoX2DataCube->set_width(*x2_data_acc.width()); + protoX2DataCube->set_height(*x2_data_acc.height()); + protoX2DataCube->set_channel(*x2_data_acc.channel()); + protoX2DataCube->set_line_stride(*x2_data_acc.lineStride()); + protoX2DataCube->set_surf_stride(*x2_data_acc.surfStride()); + protoX2DataCube->set_plane_stride(*x2_data_acc.planeStride()); + protoX2DataCube->mutable_mem_info()->set_mem_id(x2_tsd->tensorBufferDesc()->memoryId(batch_id)); + protoX2DataCube->mutable_mem_info()->set_mem_size(x2_tsd->tensorBufferDesc()->size()); + protoX2DataCube->mutable_mem_info()->set_offset(x2_tsd->bufferOffset()); +fail: + return e; +} +#endif + +}; // nvdla::priv + +}; // nvdla:: diff --git a/umd/core/src/compiler/engine-ast/ScaleOp.cpp b/umd/core/src/compiler/engine-ast/ScaleOp.cpp new file mode 100644 index 00000000..62a3396e --- /dev/null +++ b/umd/core/src/compiler/engine-ast/ScaleOp.cpp @@ -0,0 +1,1539 @@ +/* + * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#include + +#include "priv/EngineAST.h" +#include "priv/Profile.h" +#include "priv/Tensor.h" +#include "priv/LowPrecision.h" +#include "priv/WeightTranslationUnit.h" +#include "ErrorMacros.h" + +using std::endl; + +namespace nvdla +{ +namespace priv +{ + +engine_ast::SDPNode* engine_ast::SDPScaleOpNode::addSDPBiasOpNode +( + canonical_ast::Node* orig_can_node +) +{ + Tensor* origOutputTensor; + Tensor* ioTensor = NULL; + engine_ast::Edge* ioEdge = NULL; + engine_ast::SDPBiasOpNode* biasNode = NULL; + canonical_ast::Graph* canGraph = orig_can_node->graph(); + NVDLA_UNUSED(ioEdge); + + biasNode = engine_ast::NodeFactory::newSDPBiasOpNode(orig_can_node, graph()); + biasNode->params().setHasBiasReduction(false); // if scale-op has a shift term, the shift data is 'added' to scaled data + + if ( !biasNode ) { + goto done; + } + + // cache the dimensions of output tensor of parent node + origOutputTensor = canGraph->downstreamEdges(orig_can_node).at(0)->originalTensor(); + + ioTensor = origOutputTensor->clone(); + ioTensor->setTensorType(TensorType::kIO); + + ioEdge = graph()->addDataEdge((canonical_ast::Edge*)0, this, biasNode, ioTensor); + +done: + return biasNode; +} + +/** + * Analogous to captureCanonicalParams + * + * This function is useful when no canonical node is available and + * to derive a new set of params with newly created unit + * scale data. + **/ +NvDlaError engine_ast::SDPScaleOpNode::populateWithUnitScaleParams +( + engine_ast::SDPMode scaleMode, + Dims4 scaleDims +) +{ + NvDlaError e = NvDlaSuccess; + + surface::SurfacePrecision computePrecision = graph()->profile()->computePrecision(); + Weights unitScaleData = Weights(nvdla::DataType::FLOAT, NULL, 0); + + Tensor* scaleDataTensor; + engine_ast::Edge* scaleDataEdge = NULL; + NVDLA_UNUSED(scaleDataEdge); + + /* Creates a new unit scale data */ + PRECISION_SWITCH(nvdla::DataType::FLOAT, computePrecision.v(), unitScaleData, + WeightTrns::createUnitScaleData, + scaleMode, + scaleDims); + + params().x1Params().setEnabled(true); + params().x1Params().setMode(scaleMode); + params().setScaleDims(scaleDims); + params().setRawScaleData(unitScaleData); + params().setDLAScaleData(Weights(DataType::FLOAT, NULL, 0)); + + setUnitScale(true); + + /* adds aux tensor and an edge corresponding to it */ + scaleDataTensor = graph()->addAuxTensor(graph()->newAuxTensorName(), params().scaleDims(), TensorType::kSCALE); + scaleDataEdge = graph()->addDataEdge((canonical_ast::Edge*)0, 0, this, scaleDataTensor); + + return e; +} + +NvDlaError engine_ast::SDPScaleOpNode::captureCanonicalScaleData() +{ + NvDlaError e = NvDlaSuccess; + Tensor* rawSclDataTensor; + engine_ast::Edge* rawSclDataEdge = NULL; + NVDLA_UNUSED(rawSclDataEdge); + + rawSclDataTensor = graph()->addAuxTensor(graph()->newAuxTensorName(), params().scaleDims(), TensorType::kSCALE); + rawSclDataEdge = graph()->addDataEdge((canonical_ast::Edge*)0, 0, this, rawSclDataTensor); + + return e; +} + +void engine_ast::SDPScaleOpNode::captureCanonicalParams() +{ + NvDlaError e = NvDlaSuccess; + + surface::SurfacePrecision computePrecision = graph()->profile()->computePrecision(); + nvdla::QuantizationMode quantizationMode = graph()->profile()->quantizationMode(); + + params().x1Params().setEnabled(true); + params().x1Params().setAluType(SDPALUTypeEnum::SDP_ALU_TYPE_SUM); + params().x1Params().setOpType(SDPOpTypeEnum::SDP_OP_TYPE_MUL); + + /** + * Cautiously captures canonical params into engine params. + * Convert per-layer scaling data to per-channel scaling data if + * [1] per-filter quantization mode is enabled and operated at INT8 precision + * [2] SDP scale mode is PER_LAYER. + * This conversion is done in advance to avoid possible complex computation at later stages, + * when rescaling factors of convolution combine with SDP scale data. + **/ + if (computePrecision.v() == surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8 && + quantizationMode.v() == nvdla::QuantizationMode::PER_FILTER && + canonicalNode()->params().mode() == ScaleMode::sUNIFORM) + { + Dims4 trnsScaleDims; + Weights orignalScaleBlob = canonicalNode()->params().scale(); + Weights trnsScaleBlob = Weights(DataType::FLOAT, NULL, 0); + + if (canonicalNode()->inputEdges().size() == 0) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "No input edges available for %s", canonicalNode()->name().c_str()); + } + + Tensor *inputTensor = canonicalNode()->inputEdges().at(0)->originalTensor(); + if (inputTensor == NULL) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Missing input tensor for %s", canonicalNode()->name().c_str()); + } + + // Update scale channels to input edge channels. + trnsScaleDims = canonicalNode()->params().scaleDims(); + trnsScaleDims.c = inputTensor->getDimensions().c; + + // conversion from per-layer to per-channel + PRECISION_SWITCH(orignalScaleBlob.type.v(), computePrecision.v(), trnsScaleBlob, + WeightTrns::translatePLScaleToPCScale, + orignalScaleBlob, + trnsScaleDims.c); + + params().x1Params().setMode(SDPModeEnum::SDP_MODE_PER_CHANNEL); + params().setScaleDims(trnsScaleDims); + params().setRawScaleData(trnsScaleBlob); + } + else{ + switch(canonicalNode()->params().mode()) + { + case ScaleMode::sUNIFORM: params().x1Params().setMode(SDPModeEnum::SDP_MODE_PER_LAYER); break; + case ScaleMode::sCHANNEL: params().x1Params().setMode(SDPModeEnum::SDP_MODE_PER_CHANNEL); break; + case ScaleMode::sm_ELEMENTWISE: params().x1Params().setMode(SDPModeEnum::SDP_MODE_PER_ELEMENT); break; + default: params().x1Params().setMode(SDPModeEnum::SDP_MODE_UNKNOWN); + } + params().setScaleDims(canonicalNode()->params().scaleDims()); + params().setRawScaleData(canonicalNode()->params().scale()); + } + params().setDLAScaleData(Weights(DataType::FLOAT, NULL, 0)); + PROPAGATE_ERROR_FAIL(captureCanonicalScaleData()); + + if ( graph()->debugWeights() ) + { + Weights rawData = params().rawScaleData(); + gLogInfo << "raw weights of " << name() << ": "; + for (ssize_t ii = 0; ii < rawData.count; ++ii) + gLogInfo << reinterpret_cast(const_cast(rawData.values))[ii] << ", "; + gLogInfo << endl; + } +fail: + return; +} + +void engine_ast::SDPScaleOpNode::inheritParams(Node* otherNode) +{ + // inherit the parameters that make sense (keep adding later) + SDPScaleOpNode* otherScale = NodeFactory::nodeCast(otherNode); + params().setX1Params(otherScale->params().x1Params()); + params().setScaleDims(otherScale->params().scaleDims()); + params().setRawScaleData(otherScale->params().rawScaleData()); + params().setDLAScaleData(otherScale->params().DLAScaleData()); + params().setConvMode(otherScale->params().convMode()); + params().setWinogradParams(otherScale->params().winogradParams()); + params().setNumGroups(otherScale->params().numGroups()); + params().setOutCVT(otherScale->params().outCVT()); +} + + +//!< take reciprocal of raw caffe scale-data +template +Weights engine_ast::SDPScaleOpNode::inverseScaleData +( + engine_ast::SDPMode scaleMode, // per-layer/channel/elementwise + Dims4 scaleDims, // dims of orig caffe scale-data blob + Weights& srcScaleData // ptr to orig caffe scale blob +) +{ + Weights invSclData = Weights(nvdla::DataType::FLOAT, NULL, 0); + + API_CHECK_WEIGHTS_RETVAL(srcScaleData, invSclData); + + MP* pSrcScale = reinterpret_cast(const_cast(srcScaleData.values)); + MP* pDestScale = (MP*)engine_ast::MemoryCollector::getInstance()->allocateMemory(srcScaleData.count* sizeof(MP)); + memset(pDestScale, 0, srcScaleData.count * sizeof(MP)); + + invSclData.type = srcScaleData.type; + invSclData.count = srcScaleData.count; + invSclData.values = NULL; + + // Scale data can be of 3 types: per-layer/per-channel/per-element + // Per-Layer: + if (scaleMode.v() == engine_ast::SDPModeEnum::SDP_MODE_PER_LAYER) + { + pDestScale[0] = 1/pSrcScale[0]; + } + // Per-Channel: + else if (scaleMode.v() == engine_ast::SDPModeEnum::SDP_MODE_PER_CHANNEL) + { + int c = 0; + for ( ; c < scaleDims.c; ++c) + { + pDestScale[c] = 1/pSrcScale[c]; + } + } + else + { + int i = 0; + for ( ; i < (scaleDims.c * scaleDims.w * scaleDims.h); ++i) + { + pDestScale[i] = 1/pSrcScale[i]; + } + } + + invSclData.values = pDestScale; + + return invSclData; +} + +/*-----------------------Merge Similar Math Ops------------------------------*/ +engine_ast::Node* engine_ast::SDPScaleOpNode::mergeWithSDPOp(SDPNode* nextSDP) +{ + Node* removableNode = NULL; + + // If activation is already enabled, do not allow any math op fusions + if (params().x1Params().actType().v() != SDP_ACT_TYPE_UNKNOWN + && params().x1Params().actType().v() != SDP_ACT_TYPE_NONE) + { + if (graph()->debugMathOptz()) + { + gLogInfo << "Merge not feasible: " << this->name() << " activation: "; + gLogInfo << NvU16(params().x1Params().actType().v()) << endl; + } + goto fail; + } + + // fixme: limit the scale math op fusion with only relu for now + if (nextSDP->engineOpType().v() == EngineOpTypeEnum::SDP_ACTIVATION) + { + removableNode = tryToMergeWithActOp(nextSDP); + } + +fail: + return removableNode; +} + +/** + * Utility function to convert input scale data into a float vector (trnsFp32Scale) + **/ +NvDlaError engine_ast::SDPScaleOpNode::getFp32ScaleData +( + const Weights data, + std::vector& trnsFp32Scale +) +{ + NvDlaError e = NvDlaSuccess; + + if (data.count <= 0 || data.values == NULL) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Invalid scale data provided"); + } + + for (NvU32 ii = 0; ii < data.count; ii++) + { + NvF32 scaleValue = 0; + switch(data.type) + { + case nvdla::DataType::FLOAT: + scaleValue = static_cast(reinterpret_cast(const_cast(data.values))[ii]); + break; + case nvdla::DataType::HALF: + scaleValue = static_cast(reinterpret_cast(const_cast(data.values))[ii]); + break; + case nvdla::DataType::INT16: + scaleValue = static_cast(reinterpret_cast(const_cast(data.values))[ii]); + break; + case nvdla::DataType::INT8: + scaleValue = static_cast(reinterpret_cast(const_cast(data.values))[ii]); + break; + default: + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, + "Can't convert scale data which is not FLOAT/HALF/INT16/INT8 for %s", + name().c_str()); + } + trnsFp32Scale.push_back(scaleValue); + } + +fail: + return e; +} + +/** + * Converts raw scale data to NvF32 and rescales. + * Rescaling applicable if the following conditions statisfied. + * [1] If there exists a fused convolution node with SDP scale + * [2] Quantization mode: PER_FILTER operating at INT8 precision + * + * Usecase + * ------- + * B = A * W op C + * S_B * Q_B = (S_A * Q_A) * (S_W[k] * Q_W) op C + * Q_B = (Q_A * Q_W) * (((S_A * S_W[k]) op C) /S_B) + * Q_B = (Q_A * Q_W) * (2 ^ -m * n_i16[k']) + * + * Where Q_A, quantized int8 input to conv + * Q_B, rescaled int8 output from SDP + * C, actual scale data - PER_CHANNEL or PER_ELEMENT (k') + * + * rescaleScaleDataForPerFilter computes ((S_A * S_W[k]) op C)/S_B in fp32 precision + * and overwrites existing raw scale data with it. + **/ +NvDlaError engine_ast::SDPScaleOpNode::rescaleScaleDataForPerFilter() +{ + NvDlaError e = NvDlaSuccess; + + ConvCoreNode* fusedConv; + + /* Different scalars */ + std::vector filterScales; + std::vector inTensorScales; + std::vector outTensorScales; + + NvF32 perTensorInTensorScale; + NvF32 perTensorOutTensorScale; + + /* Original data of scale */ + engine_ast::SDPMode scaleMode; + Dims4 origScaleDims; + Weights origScaleBlob; + + std::vector trnsFp32Scale; + + Weights trnsScaleBlob = Weights(nvdla::DataType::FLOAT, NULL, 0); + NvF32 *trnsScaleData = NULL; + NvU32 trnsCnt = 0; + + fusedConv = NodeFactory::nodeCast(dependencyParams(0).fusedNode(IODirectionEnum::INPUT)); + if (fusedConv == NULL) + { + // Rescale only if fused conv available. + goto fail; + } + + filterScales = fusedConv->params().filterScales(); + inTensorScales = fusedConv->inputEdges().at(0)->originalTensor()->getChannelScales(); + outTensorScales = outputEdges().at(0)->originalTensor()->getChannelScales(); + + perTensorInTensorScale = inTensorScales.at(0); + perTensorOutTensorScale = outTensorScales.at(0); + + origScaleBlob = params().rawScaleData(); + origScaleDims = params().scaleDims(); + scaleMode = params().x1Params().mode(); + + // Preliminary checks + ASSERT(filterScales.size() == (size_t)outputEdges().at(0)->tensorSurfaceDesc()->dimensions().c); + + ASSERT(inTensorScales.size() == (size_t)fusedConv->inputEdges().at(0)->tensorSurfaceDesc()->dimensions().c); + for (NvF32 its = 1; its < inTensorScales.size(); ++its) + { + if ( perTensorInTensorScale != inTensorScales[its] ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Channel scales should be same for input of %s when PER_TENSOR " + "scaling is ON", fusedConv->name().c_str()); + } + } + + ASSERT(outTensorScales.size() == (size_t)outputEdges().at(0)->tensorSurfaceDesc()->dimensions().c); + for (NvF32 ots = 1; ots < outTensorScales.size(); ++ots) + { + if ( perTensorOutTensorScale != outTensorScales[ots] ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Channel scales should be same for output of %s when PER_TENSOR " + "scaling is ON", name().c_str()); + } + } + + // With PER_FILTER quantization mode, scale data can never be PER_LAYER. + if (scaleMode.v() == engine_ast::SDPModeEnum::SDP_MODE_PER_LAYER) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Invalid SDP mode: %s when PER_FILTER is ON", + scaleMode.c_str()); + } + + // Convert scale data into float and get it as vector + trnsFp32Scale.clear(); + PROPAGATE_ERROR_FAIL(getFp32ScaleData(origScaleBlob, trnsFp32Scale)); + ASSERT(trnsFp32Scale.size() == (NvU32)origScaleBlob.count); + + trnsScaleData = + reinterpret_cast( + engine_ast::MemoryCollector::getInstance()->allocateMemory(origScaleBlob.count * sizeof(NvF32)) + ); + + // Rescale based on filter values. Considering it to NCHW format. + for (NvS32 cc = 0; cc < origScaleDims.c; cc++) + { + NvF32 perChannelScale = filterScales.at(cc); + for (NvS32 hh = 0; hh < origScaleDims.h; hh++) + { + for (NvS32 ww = 0; ww < origScaleDims.w; ww++) + { + NvU32 offset = ww + + origScaleDims.w * ( hh + + origScaleDims.h * (cc) ); + trnsScaleData[offset] = + (((trnsFp32Scale.at(offset) * perChannelScale) * perTensorInTensorScale) / perTensorOutTensorScale); + trnsCnt++; + } + } + } + + trnsScaleBlob.type = nvdla::DataType::FLOAT; + trnsScaleBlob.count = trnsCnt; + trnsScaleBlob.values = trnsScaleData; + + params().setRawScaleData(trnsScaleBlob); + +fail: + return e; +} + +/** + * Converts raw scale data to NvF32 and rescales. + * Rescaling applicable if the following conditions statisfied. + * [1] If there exists a fused convolution node with SDP scale + * [2] Quantization mode: PER_KERNEL operating at INT8 precision + * + * Usecase + * ------- + * B = A * W op C + * S_B * Q_B = (S_A * Q_A) * (S_W[1] * Q_W) op C + * Q_B = (Q_A * Q_W) * (((S_A * S_W[1]) op C) /S_B) + * Q_B = (Q_A * Q_W) * (2 ^ -m * n_i16[k']) + * + * Where Q_A, quantized int8 input to conv + * Q_B, rescaled int8 output from SDP + * C, actual scale data - PER_LAYER, PER_CHANNEL, PER_ELEMENT (k') + * + * rescaleScaleDataForPerKernel computes ((S_A * S_W[1]) op C)/S_B in fp32 precision + * and overwrites existing raw scale data with it. + **/ +NvDlaError engine_ast::SDPScaleOpNode::rescaleScaleDataForPerKernel() +{ + NvDlaError e = NvDlaSuccess; + + ConvCoreNode* fusedConv; + + std::vector filterScales; + std::vector inTensorScales; + std::vector outTensorScales; + NvF32 perKernelScale; + NvF32 perTensorInTensorScale; + NvF32 perTensorOutTensorScale; + + Weights origScaleBlob; + Dims4 origScaleDims; + + std::vector trnsFp32Scale; + + Weights trnsScaleBlob = Weights(nvdla::DataType::FLOAT, NULL, 0); + NvF32 *trnsScaleData = NULL; + NvU32 trnsCnt = 0; + + fusedConv = NodeFactory::nodeCast(dependencyParams(0).fusedNode(IODirectionEnum::INPUT)); + if (fusedConv == NULL) + { + // Rescale only if fused conv available. + goto fail; + } + + filterScales = fusedConv->params().filterScales(); + perKernelScale = filterScales.at(0); + inTensorScales = fusedConv->inputEdges().at(0)->originalTensor()->getChannelScales(); + perTensorInTensorScale = inTensorScales.at(0); + outTensorScales = outputEdges().at(0)->originalTensor()->getChannelScales(); + perTensorOutTensorScale = outTensorScales.at(0); + + origScaleBlob = params().rawScaleData(); + origScaleDims = params().scaleDims(); + + // Preliminary checks + ASSERT(filterScales.size() == (size_t)outputEdges().at(0)->tensorSurfaceDesc()->dimensions().c); + for (NvU32 ff = 1; ff < filterScales.size(); ++ff) + { + if ( perKernelScale != filterScales[ff] ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Filter scales should be same for %s when PER_KERNEL " + "quantization is ON", fusedConv->name().c_str()); + } + } + + ASSERT(inTensorScales.size() == (size_t)fusedConv->inputEdges().at(0)->tensorSurfaceDesc()->dimensions().c); + for (NvF32 its = 1; its < inTensorScales.size(); ++its) + { + if ( perTensorInTensorScale != inTensorScales[its] ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Channel scales should be same for input of %s when PER_TENSOR " + "scaling is ON", fusedConv->name().c_str()); + } + } + + ASSERT(outTensorScales.size() == (size_t)outputEdges().at(0)->tensorSurfaceDesc()->dimensions().c); + for (NvF32 ots = 1; ots < outTensorScales.size(); ++ots) + { + if ( perTensorOutTensorScale != outTensorScales[ots] ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Channel scales should be same for output of %s when PER_TENSOR " + "scaling is ON", name().c_str()); + } + } + + // Convert scale data into float and get it as vector + trnsFp32Scale.clear(); + PROPAGATE_ERROR_FAIL(getFp32ScaleData(origScaleBlob, trnsFp32Scale)); + ASSERT(trnsFp32Scale.size() == (NvU32)origScaleBlob.count); + + trnsScaleData = + reinterpret_cast( + engine_ast::MemoryCollector::getInstance()->allocateMemory(origScaleBlob.count * sizeof(NvF32)) + ); + + // Rescale based on filter values. Considering it to NCHW format. + for (NvS32 cc = 0; cc < origScaleDims.c; cc++) + { + for (NvS32 hh = 0; hh < origScaleDims.h; hh++) + { + for (NvS32 ww = 0; ww < origScaleDims.w; ww++) + { + NvU32 offset = ww + + origScaleDims.w * ( hh + + origScaleDims.h * (cc) ); + trnsScaleData[offset] = + (((trnsFp32Scale.at(offset) * perKernelScale) * perTensorInTensorScale) / perTensorOutTensorScale); + trnsCnt++; + } + } + } + + trnsScaleBlob.type = nvdla::DataType::FLOAT; + trnsScaleBlob.count = trnsCnt; + trnsScaleBlob.values = trnsScaleData; + + params().setRawScaleData(trnsScaleBlob); + +fail: + return e; +} + +/** + * Converts raw scale data to NvF32 and rescales. + * Rescaling applicable when sdp exists as standalone. + * + * Usecase + * ------- + * B = A op C + * S_B * Q_B = (S_A * Q_A) op C + * Q_B = (Q_A * Q_W) * ((S_A op C) /S_B) + * Q_B = (Q_A * Q_W) * (2 ^ -m * n_i16[k']) + * + * Where Q_A, quantized int8 input to SDP + * Q_B, rescaled int8 output from SDP + * C, actual scale data - PER_LAYER, PER_CHANNEL, PER_ELEMENT + * + * rescaleScaleDataForNoFusedConv computes (S_A op C)/S_B in fp32 precision + * and overwrites existing raw scale data with it. + **/ +NvDlaError engine_ast::SDPScaleOpNode::rescaleScaleDataForNoFusedConv() +{ + NvDlaError e = NvDlaSuccess; + + std::vector trnsFp32Scale; + + std::vector inTensorScales = inputEdges().at(0)->originalTensor()->getChannelScales(); + std::vector outTensorScales = outputEdges().at(0)->originalTensor()->getChannelScales(); + NvF32 perTensorInTensorScale = inTensorScales.at(0); + NvF32 perTensorOutTensorScale = outTensorScales.at(0); + + Weights origScaleBlob = params().rawScaleData(); + Dims4 origScaleDims = params().scaleDims(); + + Weights trnsScaleBlob = Weights(nvdla::DataType::FLOAT, NULL, 0); + NvF32 *trnsScaleData = NULL; + NvU32 trnsCnt = 0; + + // Preliminary checks + ASSERT(inTensorScales.size() == (size_t)inputEdges().at(0)->tensorSurfaceDesc()->dimensions().c); + for (NvF32 its = 1; its < inTensorScales.size(); ++its) + { + if ( perTensorInTensorScale != inTensorScales[its] ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Channel scales should be same for input of %s when PER_TENSOR " + "scaling is ON", name().c_str()); + } + } + + ASSERT(outTensorScales.size() == (size_t)outputEdges().at(0)->tensorSurfaceDesc()->dimensions().c); + for (NvF32 ots = 1; ots < outTensorScales.size(); ++ots) + { + if ( perTensorOutTensorScale != outTensorScales[ots] ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Channel scales should be same for output of %s when PER_TENSOR " + "scaling is ON", name().c_str()); + } + } + + // Convert scale data into float and get it as vector + trnsFp32Scale.clear(); + PROPAGATE_ERROR_FAIL(getFp32ScaleData(origScaleBlob, trnsFp32Scale)); + ASSERT(trnsFp32Scale.size() == (NvU32)origScaleBlob.count); + + trnsScaleData = + reinterpret_cast( + engine_ast::MemoryCollector::getInstance()->allocateMemory(origScaleBlob.count * sizeof(NvF32)) + ); + + for (NvS32 cc = 0; cc < origScaleDims.c; cc++) + { + for (NvS32 hh = 0; hh < origScaleDims.h; hh++) + { + for (NvS32 ww = 0; ww < origScaleDims.w; ww++) + { + NvU32 offset = ww + + origScaleDims.w * ( hh + + origScaleDims.h * (cc) ); + trnsScaleData[offset] = ((trnsFp32Scale.at(offset) * perTensorInTensorScale) / perTensorOutTensorScale); + trnsCnt++; + if (graph()->debugQuantization()) + { + gLogInfo << name() << " rawScl * Si / So: " << trnsFp32Scale.at(offset) + << " * " << perTensorInTensorScale << " / " + << perTensorOutTensorScale << " = " << trnsScaleData[offset] << endl; + } + } + } + } + + trnsScaleBlob.type = nvdla::DataType::FLOAT; + trnsScaleBlob.count = trnsCnt; + trnsScaleBlob.values = trnsScaleData; + + params().setRawScaleData(trnsScaleBlob); + +fail: + return e; +} + +static bool absCompare(NvF32 a, NvF32 b) +{ + return (std::fabs(a) < std::fabs(b)); +} + +/** + * Converts scale data -> SDP Mul(Int16) + truncate. + **/ +NvDlaError engine_ast::SDPScaleOpNode::scaleDataToInt16() +{ + NvDlaError e = NvDlaSuccess; + + Weights origScaleBlob; + + NvF32 maxScaleValue; + std::pair< NvS16, NvU8 > maxScaleAndShift; + std::vector> scaleAndShift; + + std::vector trnsFp32Scale; + NvS16 *trnsScaleI16Data; + Weights trnsScaleI16Blob; + + origScaleBlob = params().rawScaleData(); + + // Convert scale data into float and get it as vector + PROPAGATE_ERROR_FAIL(getFp32ScaleData(origScaleBlob, trnsFp32Scale)); + ASSERT(trnsFp32Scale.size() == (NvU32)origScaleBlob.count); + + // Compute m and n where each transformed scale value can be represented as s = 2^-m . n + maxScaleValue = *std::max_element(trnsFp32Scale.begin(), trnsFp32Scale.end(), absCompare); + e = calculateScaleAndShiftFromScalar(maxScaleValue, &maxScaleAndShift); + if (e != NvDlaSuccess) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, " Couldn't converge on `2^(x) * y` which could " + "safely represent %f within acceptable tolerance for %s\n", + maxScaleValue, name().c_str()); + } + e = factorizeScalars(trnsFp32Scale, &scaleAndShift, maxScaleAndShift.second); + if (e != NvDlaSuccess) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Can't factorize scalars for %s for int8 into scale+truncate pairs", + name().c_str()); + } + + // reset raw scaling data and truncate values + trnsScaleI16Data = + reinterpret_cast(engine_ast::MemoryCollector::getInstance()->allocateMemory(origScaleBlob.count * sizeof(NvS16))); + for (NvU32 ii = 0; ii < origScaleBlob.count; ii++) + { + trnsScaleI16Data[ii] = scaleAndShift.at(ii).first; + if (graph()->debugQuantization()) + { + gLogInfo << name() << " i16Scale: " << trnsFp32Scale.at(ii) << " = " << scaleAndShift.at(ii).first + << " * 2^- " << (int)maxScaleAndShift.second << endl; + } + } + + trnsScaleI16Blob = Weights(nvdla::DataType::INT16, trnsScaleI16Data, origScaleBlob.count); + + params().setRawScaleData(trnsScaleI16Blob); + params().x1Params().setTruncate(maxScaleAndShift.second); +fail: + return e; +} + +NvDlaError engine_ast::SDPScaleOpNode::handleLowPrecisionConversions() +{ + NvDlaError e = NvDlaSuccess; + ConvCoreNode* fusedConv; + + if (graph()->profile()->computePrecision().v() != surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8) + { + // Handles only for low precision INT8 + goto fail; + } + + /** + * Rescales scale data (in fp32 precision) based on different use cases. + * Three usecases may arise, + * [1] With fusedConv (PER_KERNEL quantization)+ sdp scale. This use case arises because + * (a) No profile other than fast-math supports mathematical fusion. + * (b) If not other sdp node immediately follows SDPScaleOpNode, no math fusion. + * [2] With fusedConv (PER_FILTER quantiation) + sdp scale. Similar to [1] + * [2] SDP scale without conv. + **/ + fusedConv = NodeFactory::nodeCast(dependencyParams(0).fusedNode(IODirectionEnum::INPUT)); + if (fusedConv != NULL) + { + if (graph()->profile()->quantizationMode().v() == nvdla::QuantizationMode::PER_KERNEL) + { + PROPAGATE_ERROR_FAIL(rescaleScaleDataForPerKernel()); + } + else if (graph()->profile()->quantizationMode().v() == nvdla::QuantizationMode::PER_FILTER) + { + PROPAGATE_ERROR_FAIL(rescaleScaleDataForPerFilter()); + } + } + else + { + PROPAGATE_ERROR_FAIL(rescaleScaleDataForNoFusedConv()); + } + + /** + * converts rescaled scale data to int16 precision (S_fp = 2^-m . n_i16) + **/ + if (auxEdges()[0]->tensorSurfaceDesc()->surfaceFormat().f().precision() == + surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16) + { + PROPAGATE_ERROR_FAIL(scaleDataToInt16()); + } + else + { + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, + "Unsupported handling of scale data with %s precision", + auxEdges()[0]->tensorSurfaceDesc()->surfaceFormat().f().precision().c_str()); + } + +fail: + return e; +} + +std::vector engine_ast::SDPScaleOpNode::suggestAuxSurfaceFormats(engine_ast::Edge* xEdge) +{ + NvDlaError e = NvDlaSuccess; + NVDLA_UNUSED(e); + std::vector supportedAuxSFs = supportedAuxSurfFormats(); + std::vector suggestedAuxSFs; + std::vector::iterator auxSFItr; + surface::SurfacePrecision compPrec = graph()->profile()->computePrecision(); + + if (supportedAuxSFs.size() == 0) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "No supported aux surface formats for %s", name().c_str()); + } + + switch(compPrec.v()) + { + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_FP16: { + surface::IsSurfacePrecisionDifferent desiredSP(surface::SurfacePrecisionEnum::NVDLA_PRECISION_FP16); + supportedAuxSFs.erase(std::remove_if(supportedAuxSFs.begin(), supportedAuxSFs.end(), desiredSP), supportedAuxSFs.end()); + } break; + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16: + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8: { + surface::IsSurfacePrecisionDifferent desiredSP(surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16); + supportedAuxSFs.erase(std::remove_if(supportedAuxSFs.begin(), supportedAuxSFs.end(), desiredSP), supportedAuxSFs.end()); + } break; + default: + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Don't support compute precision: %s for %s\n", + compPrec.c_str(), name().c_str()); + } + + suggestedAuxSFs = supportedAuxSFs; + +fail: + return suggestedAuxSFs; +} + +/* Configure SDP SuperOp SubEngine with Scale Op */ +NvDlaError engine_ast::SDPScaleOpNode::configureSDPSuperOpSubEngine(SDPSuperOpNode* sdpSuperOp, SDPSubEngineType xN) +{ + NvDlaError e = NvDlaSuccess; + + if (xN == SDP_ENGINE_X1) + { + sdpSuperOp->params().setX1Params(params().x1Params()); + sdpSuperOp->params().setConvMode(params().convMode()); + sdpSuperOp->params().setWinogradParams(params().winogradParams()); + } + else + { + sdpSuperOp->params().setX2Params(params().x1Params()); + } + + sdpSuperOp->params().setAuxDataType(xN, TensorType::kSCALE); + + sdpSuperOp->params().setMultiplierDims(xN, params().scaleDims()); + sdpSuperOp->params().setDLADataDims(xN, params().scaleDims()); + + sdpSuperOp->params().setRawMultiplierData(xN, params().rawScaleData()); + sdpSuperOp->params().setDLAData(xN, params().DLAScaleData()); + + sdpSuperOp->params().setAuxSurfaceFormats(xN, suggestAuxSurfaceFormats()); + + if ( graph()->debugFuseSubEngineOps() ) + { + gLogInfo << "configureSDPSuperOpSubEngine: " << this->name() << " in "; + gLogInfo << sdpSuperOp->name() << " x" << (NvU16)xN.e()+1 << endl; + } + + return e; +} + +/********************************Aux Data Translation***************************/ +NvDlaError engine_ast::SDPScaleOpNode::translateAuxData() +{ + NvDlaError e = NvDlaSuccess; + + engine_ast::Edge* auxEdge; + Weights trnsSclData; + Weights rawSclData = params().rawScaleData(); + surface::SurfacePrecision computePrecision; + surface::SurfacePrecision srcPrecision; + NvU32 channelsPerGroup = 0; + + PROPAGATE_ERROR_FAIL( verifyEdgePorts() ); + + auxEdge = auxEdges()[0]; + computePrecision = auxEdge->tensorSurfaceDesc()->surfaceFormat().f().precision(); + srcPrecision = inputEdges()[0]->tensorSurfaceDesc()->surfaceFormat().f().precision(); + + if ( graph()->debugWeights() ) + { + gLogInfo << "translating weights for " << name() << "scale-dims = " << + auxEdge->tensorSurfaceDesc()->dimensions().n << "," << + auxEdge->tensorSurfaceDesc()->dimensions().c << "," << + auxEdge->tensorSurfaceDesc()->dimensions().h << "," << + auxEdge->tensorSurfaceDesc()->dimensions().w << "," << + "and size= " << rawSclData.count << endl; + } + + if (srcPrecision == surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8) + { + channelsPerGroup = graph()->target_config()->atomicKSize(); + } + + { + WeightTrns::WeightDims sclDims (rawSclData.count, + auxEdge->tensorSurfaceDesc()->dimensions().n, + auxEdge->tensorSurfaceDesc()->dimensions().c, + auxEdge->tensorSurfaceDesc()->dimensions().w, + auxEdge->tensorSurfaceDesc()->dimensions().h, + 1, //strides dont matter for Scale + 1); + + PRECISION_SWITCH(rawSclData.type.v(), computePrecision.v(), trnsSclData, WeightTrns::translateDataForScale, + params().x1Params().mode(), + sclDims, + rawSclData, + channelsPerGroup); + + if (trnsSclData.values == NULL) + { + PROPAGATE_ERROR_FAIL(NvDlaError_BadValue, "Scale data trnaslation failed for node '%s'", name().c_str()); + } + + params().setDLAScaleData(trnsSclData); + } + +fail: + return e; +} +NvDlaError engine_ast::SDPScaleOpNode::emitOp(Graph *g, + DLAInterface *target_dla, + NvU32 op_slot, NvU32 batch_id, + DLACommonOpDescAccessor dep, + DLAOperationContainerAccessor op, + DLASurfaceContainerAccessor surf) +{ + NvDlaError e = NvDlaSuccess; + DLASDPOpDescAccessor sdp_op = op.sdpOpDescAccessor(0); + DLACVTParamAccessor out_cvt_acc = sdp_op.outCVTAccessor(); + DLASDPOpAccessor x1_op_acc = sdp_op.x1OpAccessor(); + DLASDPOpAccessor x2_op_acc = sdp_op.x2OpAccessor(); + DLASDPOpAccessor y_op_acc = sdp_op.yOpAccessor(); + DLASDPSurfaceDescAccessor surf_acc = surf.sdpSurfaceDescAccessor(0); + DLADataCubeAccessor src_data_acc = surf_acc.srcDataAccessor(); + DLADataCubeAccessor dst_data_acc = surf_acc.dstDataAccessor(); + DLADataCubeAccessor x1_data_acc = surf_acc.x1DataAccessor(); + DLADataCubeAccessor x2_data_acc = surf_acc.x2DataAccessor(); + DLADataCubeAccessor y_data_acc = surf_acc.yDataAccessor(); + DLAConsumerAccessor fused_acc = dep.fusedParentAccessor(); + NVDLA_UNUSED(x2_data_acc); + NVDLA_UNUSED(y_data_acc); + NVDLA_UNUSED(fused_acc); + + surface::TensorSurfaceDesc *src_tsd = g->nodeInputTensorSurface(this, 0, supportedInSurfCategories()); + surface::TensorSurfaceDesc *dst_tsd = g->nodeOutputTensorSurface(this, 0, supportedOutSurfCategories()); + surface::TensorSurfaceDesc *scale_tsd = g->nodeInputTensorSurface(this, 0, supportedAuxSurfCategories()); + + *sdp_op.srcPrecision() = ASTToDLAInterface::getSDPPrecision(target_dla, src_tsd->surfaceFormat().precision()); + *sdp_op.dstPrecision() = ASTToDLAInterface::getSDPPrecision(target_dla, dst_tsd->surfaceFormat().precision()); + *sdp_op.LUTIndex() = -1; + *sdp_op.batchNum() = 1; + *sdp_op.batchStride() = 0; + + *out_cvt_acc.scale() = 1; + *out_cvt_acc.truncate() = 0; + *out_cvt_acc.offset() = 0; + *out_cvt_acc.enable() = 1; + + *x1_op_acc.enable() = 1; + *x1_op_acc.ALUType() = x1_op_acc.ALUType_Sum(); + *x1_op_acc.type() = x1_op_acc.type_Mul(); + *x1_op_acc.mode() = ASTToDLAInterface::getSDPMode(target_dla, + params(batch_id).x1Params().mode()); + *x1_op_acc.act() = ASTToDLAInterface::getSDPActType(target_dla, params(batch_id).x1Params().actType()); + *x1_op_acc.shiftValue() = 0; + *x1_op_acc.ALUOperand() = 0; + + if (params(batch_id).x1Params().mode().e() == + engine_ast::SDPModeEnum::SDP_MODE_PER_LAYER) + { + Weights scaleData = params().DLAScaleData(); + + if (scaleData.count > 1) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, + "More than one data available" + "in per-layer mode(#data = %u)", + scaleData.count); + } + switch (scaleData.type) + { + case DataType::HALF: + case DataType::INT16: + *x1_op_acc.MulOperand() = + *reinterpret_cast(scaleData.values); + break; + case DataType::INT8: + *x1_op_acc.MulOperand() = + *reinterpret_cast(scaleData.values); + break; + default: + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, + "Unexpected data type %s", + scaleData.type.c_str()); + } + } + else + { + *x1_op_acc.MulOperand() = 1; + } + *x1_op_acc.truncate() = params().x1Params().truncate();; + *x1_op_acc.precision() = ASTToDLAInterface::getSDPPrecision(target_dla, scale_tsd->surfaceFormat().precision()); + + *x2_op_acc.enable() = 0; + *y_op_acc.enable() = 0; + + emitDependencyParams(target_dla, dep, batch_id); + setDataCubeAccessor(src_data_acc, src_tsd, IODirectionEnum::INPUT, batch_id); + if (params(batch_id).x1Params().mode().e() != + engine_ast::SDPModeEnum::SDP_MODE_PER_LAYER) { + setDataCubeAccessor(x1_data_acc, scale_tsd, IODirectionEnum::UNKNOWN, + batch_id); + } + setDataCubeAccessor(dst_data_acc, dst_tsd, IODirectionEnum::OUTPUT, batch_id); + + if ( params(batch_id).convMode().v() == ConvolutionModeEnum::CONV_WINOGRAD ) + { + *sdp_op.convMode() = sdp_op.convMode_Winograd(); + + *src_data_acc.width() = params().winogradParams().ioDims.w; + *src_data_acc.height() = params().winogradParams().ioDims.h; + + *dst_data_acc.width() = params().winogradParams().ioDims.w; + *dst_data_acc.height() = params().winogradParams().ioDims.h; + } + else if ( params(batch_id).convMode().v() == ConvolutionModeEnum::CONV_DIRECT ) + { + *sdp_op.convMode() = sdp_op.convMode_Direct(); + } + else + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unsupported Conv mode for %s", name().c_str()); + } + + + if ( g->debugOps() ) + { + gLogInfo << "SDP scale node @ op_slot = " << op_slot << " batch_id = " << batch_id << endl; + gLogInfo << "\tsrc precision " << (int)*sdp_op.srcPrecision() << endl; + gLogInfo << "\tdst precision " << (int)*sdp_op.dstPrecision() << endl; + gLogInfo << "\tx1 enable " << (int)*x1_op_acc.enable() << endl; + if (*x1_op_acc.enable()) + { + gLogInfo << "\tx1 precision " << (int)*x1_op_acc.precision() << endl; + gLogInfo << "\tx1 aluType " << (int)*x1_op_acc.ALUType() << endl; + gLogInfo << "\tx1 type " << (int)*x1_op_acc.type() << endl; + gLogInfo << "\tx1 mode " << (int)*x1_op_acc.mode() << endl; + gLogInfo << "\tx1 act " << (int)*x1_op_acc.act() << endl; + gLogInfo << "\tx1 shiftValue " << (int)*x1_op_acc.shiftValue() << endl; + gLogInfo << "\tx1 aluOperand " << (int)*x1_op_acc.ALUOperand() << endl; + gLogInfo << "\tx1 mulOperand " << (int)*x1_op_acc.MulOperand() << endl; + gLogInfo << "\tx1 truncate " << (int)*x1_op_acc.truncate() << endl; + } + gLogInfo << "\tx2 enable " << (int)*x2_op_acc.enable() << endl; + if (*x2_op_acc.enable()) + { + gLogInfo << "\tx2 precision " << (int)*x2_op_acc.precision() << endl; + gLogInfo << "\tx2 aluType " << (int)*x2_op_acc.ALUType() << endl; + gLogInfo << "\tx2 type " << (int)*x2_op_acc.type() << endl; + gLogInfo << "\tx2 mode " << (int)*x2_op_acc.mode() << endl; + gLogInfo << "\tx2 act " << (int)*x2_op_acc.act() << endl; + gLogInfo << "\tx2 shiftValue " << (int)*x2_op_acc.shiftValue() << endl; + gLogInfo << "\tx2 aluOperand " << (int)*x2_op_acc.ALUOperand() << endl; + gLogInfo << "\tx2 mulOperand " << (int)*x2_op_acc.MulOperand() << endl; + gLogInfo << "\tx2 truncate " << (int)*x2_op_acc.truncate() << endl; + } + gLogInfo << "\ty enable " << (int)*y_op_acc.enable() << endl; + if (*y_op_acc.enable()) + { + gLogInfo << "\ty precision " << (int)*y_op_acc.precision() << endl; + gLogInfo << "\ty aluType " << (int)*y_op_acc.ALUType() << endl; + gLogInfo << "\ty type " << (int)*y_op_acc.type() << endl; + gLogInfo << "\ty mode " << (int)*y_op_acc.mode() << endl; + gLogInfo << "\ty act " << (int)*y_op_acc.act() << endl; + gLogInfo << "\ty shiftValue " << (int)*y_op_acc.shiftValue() << endl; + gLogInfo << "\ty aluOperand " << (int)*y_op_acc.ALUOperand() << endl; + gLogInfo << "\ty mulOperand " << (int)*y_op_acc.MulOperand() << endl; + gLogInfo << "\ty truncate " << (int)*y_op_acc.truncate() << endl; + } + gLogInfo << "\tsrc tsd:" << src_tsd->id() << endl; + gLogInfo << "\tdst tsd:" << dst_tsd->id() << "/" << dst_tsd->tensorBufferDesc()->id() + << ":off= " << dst_tsd->bufferOffset() << endl; + gLogInfo << "\tdependencyCount" << (int)*dep.dependencyCount() << endl; + gLogInfo << "\tconv_mode " << (int)*sdp_op.convMode() << endl; + gLogInfo << "\tsrc addr=" << *src_data_acc.address() << "[" << *src_data_acc.offset() << "]" << endl; + gLogInfo << "\tsrc type=" << (int)*src_data_acc.type() << endl; + gLogInfo << "\tsrc size " << *src_data_acc.size() << endl; + gLogInfo << "\tsrc width " << *src_data_acc.width() << endl; + gLogInfo << "\tsrc height " << *src_data_acc.height() << endl; + gLogInfo << "\tsrc channel " << *src_data_acc.channel() << endl; + gLogInfo << "\tsrc linestride " << *src_data_acc.lineStride() << endl; + gLogInfo << "\tsrc surfstride " << *src_data_acc.surfStride() << endl; + gLogInfo << "\tscale addr=" << *x1_data_acc.address() << "[" << *x1_data_acc.offset() << "]" << endl; + gLogInfo << "\tscale type=" << (int)*x1_data_acc.type() << endl; + gLogInfo << "\tscale size " << *x1_data_acc.size() << endl; + gLogInfo << "\tscale width " << *x1_data_acc.width() << endl; + gLogInfo << "\tscale height " << *x1_data_acc.height() << endl; + gLogInfo << "\tscale channel " << *x1_data_acc.channel() << endl; + gLogInfo << "\tscale linestride " << *x1_data_acc.lineStride() << endl; + gLogInfo << "\tscale surfstride " << *x1_data_acc.surfStride() << endl; + gLogInfo << "\tdst addr=" << *dst_data_acc.address() << "[" << *dst_data_acc.offset() << "]" << endl; + gLogInfo << "\tdst type=" << (int)*dst_data_acc.type() << endl; + gLogInfo << "\tdst size " << *dst_data_acc.size() << endl; + gLogInfo << "\tdst width " << *dst_data_acc.width() << endl; + gLogInfo << "\tdst height " << *dst_data_acc.height() << endl; + gLogInfo << "\tdst channel " << *dst_data_acc.channel() << endl; + gLogInfo << "\tdst linestride " << *dst_data_acc.lineStride() << endl; + gLogInfo << "\tdst surfstride " << *dst_data_acc.surfStride() << endl; + } + +fail: + return e; +} + +void engine_ast::CPUScaleOpNode::captureCanonicalParams() +{ + params().setPower(canonicalNode()->params().power()); + params().setScale(canonicalNode()->params().scale()); + params().setShift(canonicalNode()->params().shift()); +} + +NvDlaError engine_ast::CPUScaleOpNode::emitOp(Graph *g, + EMUInterface *emu_if, + NvU32 op_slot, NvU32 batch_id, + EMUOperationContainerAccessor op, + EMUOperationBufferContainerAccessor buf) +{ + NvDlaError e = NvDlaSuccess; + NvU32 mem_atomic_size = graph()->target_config()->memoryAtomicSize(); + EMUPowerOpDescAccessor power_op = op.powerOpDescAccessor(0); + EMUCommonOpDescAccessor power_op_common = power_op.commonOpDescAccessor(); + + surface::TensorSurfaceDesc *src_tsd = g->nodeInputTensorSurface(this, 0, supportedInSurfCategories()); + surface::TensorSurfaceDesc *dst_tsd = g->nodeOutputTensorSurface(this, 0, supportedOutSurfCategories()); + + *power_op_common.op_type() = 0; //<-- EMU_OP_POWER + if (graph()->profile()->computePrecision().v() == surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8) + { + *power_op_common.input_scale_factor() = inputEdges().at(0)->originalTensor()->getChannelScales().at(0); + *power_op_common.output_scale_factor() = outputEdges().at(0)->originalTensor()->getChannelScales().at(0); + } + else + { + *power_op_common.input_scale_factor() = 1.0f; + *power_op_common.output_scale_factor() = 1.0f; + } + + *power_op.power() = *reinterpret_cast(const_cast(this->params().power().values)); + *power_op.scale() = *reinterpret_cast(const_cast(this->params().scale().values)); + *power_op.shift() = *reinterpret_cast(const_cast(this->params().shift().values)); + *power_op.scale() = 1.0f; //fixme: hack for current mnist fp16 test + + EMUPowerBufferDescsAccessor power_buffer = buf.powerBufferDescsAccessor(0); + EMUBufferDescAccessor src_data_acc = power_buffer.srcDataAccessor(); + EMUBufferDescAccessor dst_data_acc = power_buffer.dstDataAccessor(); + + NvS16 src_id, dst_id; + + src_id = src_tsd->addressId(batch_id); + dst_id = dst_tsd->addressId(batch_id); + + *src_data_acc.addressIndex() = src_id; + *src_data_acc.addressIndexOffset() = src_tsd->addressIdOffset(batch_id); + *src_data_acc.size() = (NvU32)src_tsd->size(); //fixme: 64b -> 32b + *src_data_acc.format() = ASTToEMUInterface::getDataFormat(emu_if, src_tsd->surfaceFormat(), mem_atomic_size); + *src_data_acc.width() = (NvU16)src_tsd->dimensions().w; //fixme: 32b -> 16b + *src_data_acc.height() = (NvU16)src_tsd->dimensions().h; //fixme: 32b -> 16b + *src_data_acc.channel() = (NvU16)src_tsd->dimensions().c; //fixme: 32b -> 16b + if ( src_tsd->bindable() ) { + NvS16 addrId = src_tsd->addressId(batch_id); + + uintptr_t lineOffs = uintptr_t(src_data_acc.lineStride());// - uintptr_t(power_buffer.struct_base()); + uintptr_t surfOffs = uintptr_t(src_data_acc.surfStride());// - uintptr_t(power_buffer.struct_base()); + g->insertRelocEntry(ILoadable::RelocEntry(addrId, lineOffs, + NVDLA_LOADABLE_INTERFACE_EMU1, + NVDLA_LOADABLE_SUB_INTERFACE_EMU1_SURFS, + ELST_Line)); + g->insertRelocEntry(ILoadable::RelocEntry(addrId, surfOffs, + NVDLA_LOADABLE_INTERFACE_EMU1, + NVDLA_LOADABLE_SUB_INTERFACE_EMU1_SURFS, + ELST_Surf)); + } + *src_data_acc.lineStride() = src_tsd->lineStride(); + *src_data_acc.surfStride() = src_tsd->surfaceStride(); + + *dst_data_acc.addressIndex() = dst_id; + *dst_data_acc.addressIndexOffset() = dst_tsd->addressIdOffset(batch_id); + *dst_data_acc.size() = (NvU32)dst_tsd->size(); //fixme: 64b -> 32b + *dst_data_acc.format() = ASTToEMUInterface::getDataFormat(emu_if, dst_tsd->surfaceFormat(), mem_atomic_size); + *dst_data_acc.width() = (NvU16)dst_tsd->dimensions().w; //fixme: 32b -> 16b + *dst_data_acc.height() = (NvU16)dst_tsd->dimensions().h; //fixme: 32b -> 16b + *dst_data_acc.channel() = (NvU16)dst_tsd->dimensions().c; //fixme: 32b -> 16b + if ( dst_tsd->bindable() ) { + NvS16 addrId = dst_tsd->addressId(batch_id); + uintptr_t lineOffs = uintptr_t(dst_data_acc.lineStride());// - uintptr_t(power_buffer.struct_base()); + uintptr_t surfOffs = uintptr_t(dst_data_acc.surfStride());// - uintptr_t(power_buffer.struct_base()); + g->insertRelocEntry(ILoadable::RelocEntry(addrId, lineOffs, + NVDLA_LOADABLE_INTERFACE_EMU1, + NVDLA_LOADABLE_SUB_INTERFACE_EMU1_SURFS, + ELST_Line)); + g->insertRelocEntry(ILoadable::RelocEntry(addrId, surfOffs, + NVDLA_LOADABLE_INTERFACE_EMU1, + NVDLA_LOADABLE_SUB_INTERFACE_EMU1_SURFS, + ELST_Surf)); + } + *dst_data_acc.lineStride() = dst_tsd->lineStride(); + *dst_data_acc.surfStride() = dst_tsd->surfaceStride(); + + if ( g->debugOps() ) + { + gLogInfo << "Power node @ op_slot = " << op_slot << " batch_id = " << batch_id << endl; + gLogInfo << "\tsrc tsd:batch= " << src_tsd->id() << " addr= " << *src_data_acc.addressIndex() << "[" << *src_data_acc.addressIndexOffset() << "]" << endl; + gLogInfo << "\tdst tsd:batch= " << dst_tsd->id() << " addr= " << *dst_data_acc.addressIndex() << "[" << *dst_data_acc.addressIndexOffset() << "]" << endl; + gLogInfo << "\tinput scale factor " << *power_op_common.input_scale_factor() << endl; + gLogInfo << "\toutput scale factor " << *power_op_common.output_scale_factor() << endl; + + gLogInfo << "\tsrc size=" << *src_data_acc.size() << endl; + gLogInfo << "\tsrc format=" << *src_data_acc.format() << endl; + gLogInfo << "\tsrc width=" << *src_data_acc.width() << endl; + gLogInfo << "\tsrc height=" << *src_data_acc.height() << endl; + gLogInfo << "\tsrc channel=" << *src_data_acc.channel() << endl; + + gLogInfo << "\tdst size=" << *dst_data_acc.size() << endl; + gLogInfo << "\tdst format=" << *dst_data_acc.format() << endl; + gLogInfo << "\tdst width=" << *dst_data_acc.width() << endl; + gLogInfo << "\tdst height=" << *dst_data_acc.height() << endl; + gLogInfo << "\tdst channel=" << *dst_data_acc.channel() << endl; + + } + + return e; +} + +#ifdef NVDLA_COMPILER_OUTPUT_FOR_PROTOTEST +static nvdla_prototest_interface::SDPOp_SDPOpMode opMode2InfOpMode(engine_ast::SDPMode om) +{ + nvdla_prototest_interface::SDPOp_SDPOpMode iom = nvdla_prototest_interface::SDPOp_SDPOpMode::SDPOp_SDPOpMode_SDP_OP_PER_KERNEL; + switch(om.v()) + { + case engine_ast::SDPModeEnum::SDP_MODE_PER_CHANNEL: iom = + nvdla_prototest_interface::SDPOp_SDPOpMode::SDPOp_SDPOpMode_SDP_OP_PER_KERNEL; break; + case engine_ast::SDPModeEnum::SDP_MODE_PER_ELEMENT: iom = + nvdla_prototest_interface::SDPOp_SDPOpMode::SDPOp_SDPOpMode_SDP_OP_PER_POINT; break; + case engine_ast::SDPModeEnum::SDP_MODE_PER_LAYER: iom = + nvdla_prototest_interface::SDPOp_SDPOpMode::SDPOp_SDPOpMode_SDP_OP_PER_LAYER; break; + default: + REPORT_ERROR(NvDlaError_BadParameter, "Unknown op mode: %s", om.c_str()); + } + + return iom; +} + +static nvdla_prototest_interface::SDPActivation actType2InfActType(engine_ast::SDPActType at) +{ + nvdla_prototest_interface::SDPActivation iat = nvdla_prototest_interface::SDPActivation::ACT_NONE; + switch(at.v()) + { + case engine_ast::SDPActTypeEnum::SDP_ACT_TYPE_NONE: iat = + nvdla_prototest_interface::SDPActivation::ACT_NONE; break; + case engine_ast::SDPActTypeEnum::SDP_ACT_TYPE_RELU: iat = + nvdla_prototest_interface::SDPActivation::ACT_RELU; break; + case engine_ast::SDPActTypeEnum::SDP_ACT_TYPE_TANH: + case engine_ast::SDPActTypeEnum::SDP_ACT_TYPE_SIGMOID:iat = + nvdla_prototest_interface::SDPActivation::ACT_LUT; break; + default: + REPORT_ERROR(NvDlaError_BadParameter, "Unknown act type: %s", at.c_str()); + } + + return iat; +} + +NvDlaError engine_ast::SDPScaleOpNode::emitOp(NvU32 op_slot, NvU32 batch_id, + DLAInterface* target_dla, + DLACommonOpDescAccessor& dep, + DLAOperationContainerAccessor& op, + DLASurfaceContainerAccessor& surf, + nvdla_prototest_interface::Layer* protoLayer) +{ + NvDlaError e = NvDlaSuccess; + NvU8 numConsumers = 0; + + DLASDPOpDescAccessor sdp_op = op.sdpOpDescAccessor(0); + DLACVTParamAccessor out_cvt_acc = sdp_op.outCVTAccessor(); + DLASDPOpAccessor x1_op_acc = sdp_op.x1OpAccessor(); + DLASDPOpAccessor x2_op_acc = sdp_op.x2OpAccessor(); + DLASDPOpAccessor y_op_acc = sdp_op.yOpAccessor(); + DLASDPSurfaceDescAccessor surf_acc = surf.sdpSurfaceDescAccessor(0); + DLADataCubeAccessor src_data_acc = surf_acc.srcDataAccessor(); + DLADataCubeAccessor dst_data_acc = surf_acc.dstDataAccessor(); + DLADataCubeAccessor x1_data_acc = surf_acc.x1DataAccessor(); + DLADataCubeAccessor x2_data_acc = surf_acc.x2DataAccessor(); + DLADataCubeAccessor y_data_acc = surf_acc.yDataAccessor(); + DLAConsumerAccessor fused_acc = dep.fusedParentAccessor(); + NVDLA_UNUSED(out_cvt_acc); + NVDLA_UNUSED(x2_data_acc); + NVDLA_UNUSED(y_data_acc); + NVDLA_UNUSED(batch_id); + + surface::TensorSurfaceDesc *src_tsd = graph()->nodeInputTensorSurface(this, 0, supportedInSurfCategories()); + surface::TensorSurfaceDesc *dst_tsd = graph()->nodeOutputTensorSurface(this, 0, supportedOutSurfCategories()); + surface::TensorSurfaceDesc *scale_tsd = graph()->nodeInputTensorSurface(this, 0, supportedAuxSurfCategories()); + + + nvdla_prototest_interface::SDPOpDesc* protoSDPOpDesc = protoLayer->mutable_op_config()->mutable_sdp_op(); + nvdla_prototest_interface::SDPSurfaceDesc* protoSDPSurfDesc = protoLayer->mutable_surface()->mutable_sdp_surface(); + nvdla_prototest_interface::SDPOp* protoSDPX1OpDesc = protoSDPOpDesc->mutable_x1_op(); + nvdla_prototest_interface::SDPOp* protoSDPX2OpDesc = protoSDPOpDesc->mutable_x2_op(); + nvdla_prototest_interface::SDPOp* protoSDPYOpDesc = protoSDPOpDesc->mutable_y_op(); + nvdla_prototest_interface::DataCube* protoSrcDataCube = protoSDPSurfDesc->mutable_src_data(); + nvdla_prototest_interface::DataCube* protoDstDataCube = protoSDPSurfDesc->mutable_dst_data(); + nvdla_prototest_interface::DataCube* protoX1DataCube = protoSDPSurfDesc->mutable_x1_data(); + nvdla_prototest_interface::DataPrecision protoSrcPrec, protoDstPrec; + + protoLayer->set_index(op_slot); + protoLayer->set_roi_index(0); + protoLayer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_SDP); + protoLayer->set_dependency_count(*dep.dependencyCount()); + + /* consumers */ + for (size_t c = 0; c < EngineType::num_elements(); c++) + { + NvS8 fw_op_index = ASTToDLAInterface::getEngineType(target_dla, c); + if ( fw_op_index < 0 ) + { + continue; + } + + DLAConsumerAccessor cons_acc = dep.consumerAccessor(fw_op_index); + if (*cons_acc.index() != -1) { + numConsumers++; + nvdla_prototest_interface::Consumer* protoConsumer = protoLayer->add_bottom(); + protoConsumer->set_index(*cons_acc.index()); + switch(c) { + case EngineTypeEnum::BDMA : protoConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_BDMA); break; + case EngineTypeEnum::CONVOLUTION : protoConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_CONV); break; + case EngineTypeEnum::SDP : protoConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_SDP); break; + case EngineTypeEnum::PDP : protoConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_PDP); break; + case EngineTypeEnum::CDP : protoConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_CDP); break; + case EngineTypeEnum::RUBIK: protoConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_RUBIK); break; + default: ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unrecognized consumer"); + } + switch(dependencyParams().consumer(c).opEvent().v()) { + case OperationEventTypeEnum::OP_CDMA_WEIGHT_DONE : protoConsumer->set_event(nvdla_prototest_interface::Consumer_EventType::Consumer_EventType_CDMA_WT_DONE); break; + case OperationEventTypeEnum::OP_CDMA_DATA_DONE : protoConsumer->set_event(nvdla_prototest_interface::Consumer_EventType::Consumer_EventType_CDMA_DT_DONE); break; + case OperationEventTypeEnum::OP_COMPLETED : protoConsumer->set_event(nvdla_prototest_interface::Consumer_EventType::Consumer_EventType_OP_COMPLETED); break; + case OperationEventTypeEnum::OP_ENABLED : protoConsumer->set_event(nvdla_prototest_interface::Consumer_EventType::Consumer_EventType_OP_ENABLED); break; + case OperationEventTypeEnum::OP_PROGRAMMED : protoConsumer->set_event(nvdla_prototest_interface::Consumer_EventType::Consumer_EventType_OP_PROGRAMMED); break; + default: ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unrecognized consumer event"); + } + } + } + + /* fused node */ + if (dependencyParams().fusedNode(engine_ast::IODirectionEnum::INPUT)) + { + nvdla_prototest_interface::Consumer* protoFusedConsumer = protoLayer->mutable_fused(); + protoFusedConsumer->set_index(*fused_acc.index()); + protoFusedConsumer->set_event(nvdla_prototest_interface::Consumer_EventType::Consumer_EventType_OP_ENABLED); + switch(dependencyParams().fusedNode(engine_ast::IODirectionEnum::INPUT)->engineType().v()) { + case EngineTypeEnum::CONVOLUTION: protoFusedConsumer->set_type(nvdla_prototest_interface::LayerType::DLA_OP_CONV); break; + default: ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "SDP can have only Conv op as its fused partner on input side"); + } + } + + switch(src_tsd->surfaceFormat().precision().v()) { + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_FP16 : protoSrcPrec = nvdla_prototest_interface::DataPrecision::PRECISION_FP16; break; + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16 : protoSrcPrec = nvdla_prototest_interface::DataPrecision::PRECISION_INT16; break; + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8 : protoSrcPrec = nvdla_prototest_interface::DataPrecision::PRECISION_INT8; break; + default: ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unrecognized src precision"); + } + + switch(dst_tsd->surfaceFormat().precision().v()) { + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_FP16 : protoDstPrec = nvdla_prototest_interface::DataPrecision::PRECISION_FP16; break; + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16 : protoDstPrec = nvdla_prototest_interface::DataPrecision::PRECISION_INT16; break; + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8 : protoDstPrec = nvdla_prototest_interface::DataPrecision::PRECISION_INT8; break; + default: ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unrecognized dst precision"); + } + + protoSDPOpDesc->set_src_precision(protoSrcPrec); + protoSDPOpDesc->set_dst_precision(protoDstPrec); + protoSDPOpDesc->set_lut_index(-1); + + protoSDPOpDesc->mutable_out_cvt()->set_enable(1); + protoSDPOpDesc->mutable_out_cvt()->set_offset(0); + protoSDPOpDesc->mutable_out_cvt()->set_scale(1); + protoSDPOpDesc->mutable_out_cvt()->set_truncate(0); + + protoSDPOpDesc->set_conv_mode(nvdla_prototest_interface::ConvMode::DIRECT); + protoSDPOpDesc->set_batch_num(1); + protoSDPOpDesc->set_batch_stride(0); + + protoSDPX1OpDesc->set_enable(*x1_op_acc.enable()); + protoSDPX1OpDesc->set_alu_type(nvdla_prototest_interface::ALUType::ALU_SUM); + protoSDPX1OpDesc->set_type(nvdla_prototest_interface::SDPOpType::SDP_OP_MUL); + protoSDPX1OpDesc->set_mode(opMode2InfOpMode(params().x1Params().mode())); + protoSDPX1OpDesc->set_act(actType2InfActType(params().x1Params().actType())); + protoSDPX1OpDesc->set_shift_value(*x1_op_acc.shiftValue()); + protoSDPX1OpDesc->set_alu_operand(*x1_op_acc.ALUOperand()); + protoSDPX1OpDesc->set_mul_operand(*x1_op_acc.MulOperand()); + protoSDPX1OpDesc->set_truncate(*x1_op_acc.truncate()); + protoSDPX1OpDesc->set_precision(protoSrcPrec); + protoSDPX1OpDesc->mutable_cvt()->mutable_alu_cvt()->set_enable(*x1_op_acc.cvt().aluCVTAccessor().enable()); + protoSDPX1OpDesc->mutable_cvt()->mutable_alu_cvt()->set_truncate(*x1_op_acc.cvt().aluCVTAccessor().truncate()); + protoSDPX1OpDesc->mutable_cvt()->mutable_alu_cvt()->set_scale(*x1_op_acc.cvt().aluCVTAccessor().scale()); + protoSDPX1OpDesc->mutable_cvt()->mutable_alu_cvt()->set_offset(*x1_op_acc.cvt().aluCVTAccessor().offset()); + protoSDPX1OpDesc->mutable_cvt()->mutable_mul_cvt()->set_enable(*x1_op_acc.cvt().mulCVTAccessor().enable()); + protoSDPX1OpDesc->mutable_cvt()->mutable_mul_cvt()->set_truncate(*x1_op_acc.cvt().mulCVTAccessor().truncate()); + protoSDPX1OpDesc->mutable_cvt()->mutable_mul_cvt()->set_scale(*x1_op_acc.cvt().mulCVTAccessor().scale()); + protoSDPX1OpDesc->mutable_cvt()->mutable_mul_cvt()->set_offset(*x1_op_acc.cvt().mulCVTAccessor().offset()); + + protoSDPX2OpDesc->set_enable(*x2_op_acc.enable()); + protoSDPX2OpDesc->set_alu_type(nvdla_prototest_interface::ALUType::ALU_SUM); + protoSDPX2OpDesc->set_type(nvdla_prototest_interface::SDPOpType::SDP_OP_ADD); + protoSDPX2OpDesc->set_mode(nvdla_prototest_interface::SDPOp_SDPOpMode::SDPOp_SDPOpMode_SDP_OP_PER_KERNEL); + protoSDPX2OpDesc->set_act(nvdla_prototest_interface::SDPActivation::ACT_NONE); + protoSDPX2OpDesc->set_shift_value(*x2_op_acc.shiftValue()); + protoSDPX2OpDesc->set_alu_operand(*x2_op_acc.ALUOperand()); + protoSDPX2OpDesc->set_mul_operand(*x2_op_acc.MulOperand()); + protoSDPX2OpDesc->set_truncate(*x2_op_acc.truncate()); + protoSDPX2OpDesc->set_precision(protoSrcPrec); + protoSDPX2OpDesc->mutable_cvt()->mutable_alu_cvt()->set_enable(*x2_op_acc.cvt().aluCVTAccessor().enable()); + protoSDPX2OpDesc->mutable_cvt()->mutable_alu_cvt()->set_truncate(*x2_op_acc.cvt().aluCVTAccessor().truncate()); + protoSDPX2OpDesc->mutable_cvt()->mutable_alu_cvt()->set_scale(*x2_op_acc.cvt().aluCVTAccessor().scale()); + protoSDPX2OpDesc->mutable_cvt()->mutable_alu_cvt()->set_offset(*x2_op_acc.cvt().aluCVTAccessor().offset()); + protoSDPX2OpDesc->mutable_cvt()->mutable_mul_cvt()->set_enable(*x2_op_acc.cvt().mulCVTAccessor().enable()); + protoSDPX2OpDesc->mutable_cvt()->mutable_mul_cvt()->set_truncate(*x2_op_acc.cvt().mulCVTAccessor().truncate()); + protoSDPX2OpDesc->mutable_cvt()->mutable_mul_cvt()->set_scale(*x2_op_acc.cvt().mulCVTAccessor().scale()); + protoSDPX2OpDesc->mutable_cvt()->mutable_mul_cvt()->set_offset(*x2_op_acc.cvt().mulCVTAccessor().offset()); + + + protoSDPYOpDesc->set_enable(*y_op_acc.enable()); + protoSDPYOpDesc->set_alu_type(nvdla_prototest_interface::ALUType::ALU_SUM); + protoSDPYOpDesc->set_type(nvdla_prototest_interface::SDPOpType::SDP_OP_ADD); + protoSDPYOpDesc->set_mode(nvdla_prototest_interface::SDPOp_SDPOpMode::SDPOp_SDPOpMode_SDP_OP_PER_KERNEL); + protoSDPYOpDesc->set_act(nvdla_prototest_interface::SDPActivation::ACT_NONE); + protoSDPYOpDesc->set_shift_value(*y_op_acc.shiftValue()); + protoSDPYOpDesc->set_alu_operand(*y_op_acc.ALUOperand()); + protoSDPYOpDesc->set_mul_operand(*y_op_acc.MulOperand()); + protoSDPYOpDesc->set_truncate(*y_op_acc.truncate()); + protoSDPYOpDesc->set_precision(protoSrcPrec); + protoSDPYOpDesc->mutable_cvt()->mutable_alu_cvt()->set_enable(*y_op_acc.cvt().aluCVTAccessor().enable()); + protoSDPYOpDesc->mutable_cvt()->mutable_alu_cvt()->set_truncate(*y_op_acc.cvt().aluCVTAccessor().truncate()); + protoSDPYOpDesc->mutable_cvt()->mutable_alu_cvt()->set_scale(*y_op_acc.cvt().aluCVTAccessor().scale()); + protoSDPYOpDesc->mutable_cvt()->mutable_alu_cvt()->set_offset(*y_op_acc.cvt().aluCVTAccessor().offset()); + protoSDPYOpDesc->mutable_cvt()->mutable_mul_cvt()->set_enable(*y_op_acc.cvt().mulCVTAccessor().enable()); + protoSDPYOpDesc->mutable_cvt()->mutable_mul_cvt()->set_truncate(*y_op_acc.cvt().mulCVTAccessor().truncate()); + protoSDPYOpDesc->mutable_cvt()->mutable_mul_cvt()->set_scale(*y_op_acc.cvt().mulCVTAccessor().scale()); + protoSDPYOpDesc->mutable_cvt()->mutable_mul_cvt()->set_offset(*y_op_acc.cvt().mulCVTAccessor().offset()); + + + if (*fused_acc.index() != -1) { + protoSrcDataCube->set_type(nvdla_prototest_interface::MemType::DLA_MEM_HW); + } else { + protoSrcDataCube->set_type(nvdla_prototest_interface::MemType::DLA_MEM_MC); + } + protoSrcDataCube->set_address(*src_data_acc.address()); + protoSrcDataCube->set_size(src_tsd->tensorBufferDesc()->size() - src_tsd->bufferOffset()); + protoSrcDataCube->set_width(*src_data_acc.width()); + protoSrcDataCube->set_height(*src_data_acc.height()); + protoSrcDataCube->set_channel(*src_data_acc.channel()); + protoSrcDataCube->set_line_stride(*src_data_acc.lineStride()); + protoSrcDataCube->set_surf_stride(*src_data_acc.surfStride()); + protoSrcDataCube->set_plane_stride(*src_data_acc.planeStride()); + protoSrcDataCube->mutable_mem_info()->set_mem_id(src_tsd->tensorBufferDesc()->memoryId(batch_id)); + protoSrcDataCube->mutable_mem_info()->set_mem_size(src_tsd->tensorBufferDesc()->size()); + protoSrcDataCube->mutable_mem_info()->set_offset(src_tsd->bufferOffset()); + + protoDstDataCube->set_type(nvdla_prototest_interface::MemType::DLA_MEM_MC); + protoDstDataCube->set_address(*dst_data_acc.address()); + protoDstDataCube->set_size(dst_tsd->tensorBufferDesc()->size() - dst_tsd->bufferOffset()); + protoDstDataCube->set_width(*dst_data_acc.width()); + protoDstDataCube->set_height(*dst_data_acc.height()); + protoDstDataCube->set_channel(*dst_data_acc.channel()); + protoDstDataCube->set_line_stride(*dst_data_acc.lineStride()); + protoDstDataCube->set_surf_stride(*dst_data_acc.surfStride()); + protoDstDataCube->set_plane_stride(*dst_data_acc.planeStride()); + protoDstDataCube->mutable_mem_info()->set_mem_id(dst_tsd->tensorBufferDesc()->memoryId(batch_id)); + protoDstDataCube->mutable_mem_info()->set_mem_size(dst_tsd->tensorBufferDesc()->size()); + protoDstDataCube->mutable_mem_info()->set_offset(dst_tsd->bufferOffset()); + if (numConsumers == 0) { + protoDstDataCube->mutable_mem_info()->set_fill_type(nvdla_prototest_interface::FillerType::FILL_NONE); + protoDstDataCube->mutable_mem_info()->set_flag(nvdla_prototest_interface::MemFlag::DLA_MEM_OUTPUT); + protoDstDataCube->mutable_mem_info()->set_precision(protoDstPrec); + } + + protoX1DataCube->set_type(nvdla_prototest_interface::MemType::DLA_MEM_MC); + protoX1DataCube->set_address(*x1_data_acc.address()); + protoX1DataCube->set_size(scale_tsd->tensorBufferDesc()->size()); + protoX1DataCube->set_width(*x1_data_acc.width()); + protoX1DataCube->set_height(*x1_data_acc.height()); + protoX1DataCube->set_channel(*x1_data_acc.channel()); + protoX1DataCube->set_line_stride(*x1_data_acc.lineStride()); + protoX1DataCube->set_surf_stride(*x1_data_acc.surfStride()); + protoX1DataCube->set_plane_stride(*x1_data_acc.planeStride()); + protoX1DataCube->mutable_mem_info()->set_mem_id(scale_tsd->tensorBufferDesc()->memoryId(batch_id)); + protoX1DataCube->mutable_mem_info()->set_mem_size(scale_tsd->tensorBufferDesc()->size()); + protoX1DataCube->mutable_mem_info()->set_offset(scale_tsd->bufferOffset()); +fail: + return e; +} +#endif + + +}; // nvdla::priv:: +}; // nvdla:: diff --git a/umd/core/src/compiler/engine-ast/SoftMaxOp.cpp b/umd/core/src/compiler/engine-ast/SoftMaxOp.cpp new file mode 100644 index 00000000..0e4fa37a --- /dev/null +++ b/umd/core/src/compiler/engine-ast/SoftMaxOp.cpp @@ -0,0 +1,153 @@ +/* + * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#include + +#include "priv/EngineAST.h" +#include "priv/Profile.h" +#include "priv/Tensor.h" + +#include "ErrorMacros.h" + +using std::endl; + +namespace nvdla +{ +namespace priv +{ +void engine_ast::CPUSoftMaxOpNode::captureCanonicalParams() { } + +NvDlaError engine_ast::CPUSoftMaxOpNode::emitOp(Graph *g, + EMUInterface *emu_if, + NvU32 op_slot, NvU32 batch_id, + EMUOperationContainerAccessor op, + EMUOperationBufferContainerAccessor buf) +{ + NvDlaError e = NvDlaSuccess; + NvU32 mem_atomic_size = graph()->target_config()->memoryAtomicSize(); + EMUSoftmaxOpDescAccessor softmax_op = op.softmaxOpDescAccessor(0); + EMUCommonOpDescAccessor softmax_op_common = softmax_op.commonOpDescAccessor(); + + surface::TensorSurfaceDesc *src_tsd = g->nodeInputTensorSurface(this, 0, supportedInSurfCategories()); + surface::TensorSurfaceDesc *dst_tsd = g->nodeOutputTensorSurface(this, 0, supportedOutSurfCategories()); + + *softmax_op_common.op_type() = 1; //<-- EMU_OP_SOFTMAX + if (graph()->profile()->computePrecision().v() == surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8) + { + *softmax_op_common.input_scale_factor() = inputEdges().at(0)->originalTensor()->getChannelScales().at(0); + *softmax_op_common.output_scale_factor() = outputEdges().at(0)->originalTensor()->getChannelScales().at(0); + } + else + { + *softmax_op_common.input_scale_factor() = 1.0f; + *softmax_op_common.output_scale_factor() = 1.0f; + } + + *softmax_op.axis() = 1; //fixme: this->getParams().axis() + + EMUPowerBufferDescsAccessor power_buffer = buf.powerBufferDescsAccessor(0); + EMUBufferDescAccessor src_data_acc = power_buffer.srcDataAccessor(); + EMUBufferDescAccessor dst_data_acc = power_buffer.dstDataAccessor(); + + NvS16 src_id, dst_id; + + src_id = src_tsd->addressId(batch_id); + dst_id = dst_tsd->addressId(batch_id); + + *src_data_acc.addressIndex() = src_id; + *src_data_acc.addressIndexOffset() = src_tsd->addressIdOffset(batch_id); + *src_data_acc.size() = (NvU32)src_tsd->size(); //fixme: 64b -> 32b + *src_data_acc.format() = ASTToEMUInterface::getDataFormat(emu_if, src_tsd->surfaceFormat(), mem_atomic_size); + *src_data_acc.width() = (NvU16)src_tsd->dimensions().w; //fixme: 32b -> 16b + *src_data_acc.height() = (NvU16)src_tsd->dimensions().h; //fixme: 32b -> 16b + *src_data_acc.channel() = (NvU16)src_tsd->dimensions().c; //fixme: 32b -> 16b + if ( src_tsd->bindable() ) { + NvS16 addrId = src_tsd->addressId(batch_id); + uintptr_t lineOffs = uintptr_t(src_data_acc.lineStride());// - uintptr_t(power_buffer.struct_base()); + uintptr_t surfOffs = uintptr_t(src_data_acc.surfStride());// - uintptr_t(power_buffer.struct_base()); + g->insertRelocEntry(ILoadable::RelocEntry(addrId, lineOffs, + NVDLA_LOADABLE_INTERFACE_EMU1, + NVDLA_LOADABLE_SUB_INTERFACE_EMU1_SURFS, + ELST_Line)); + g->insertRelocEntry(ILoadable::RelocEntry(addrId, surfOffs, + NVDLA_LOADABLE_INTERFACE_EMU1, + NVDLA_LOADABLE_SUB_INTERFACE_EMU1_SURFS, + ELST_Surf)); + } + *src_data_acc.lineStride() = src_tsd->lineStride(); + *src_data_acc.surfStride() = src_tsd->surfaceStride(); + + *dst_data_acc.addressIndex() = dst_id; + *dst_data_acc.addressIndexOffset() = dst_tsd->addressIdOffset(batch_id); + *dst_data_acc.size() = (NvU32)dst_tsd->size(); //fixme: 64b -> 32b + *dst_data_acc.format() = ASTToEMUInterface::getDataFormat(emu_if, dst_tsd->surfaceFormat(), mem_atomic_size); + *dst_data_acc.width() = (NvU16)dst_tsd->dimensions().w; //fixme: 32b -> 16b + *dst_data_acc.height() = (NvU16)dst_tsd->dimensions().h; //fixme: 32b -> 16b + *dst_data_acc.channel() = (NvU16)dst_tsd->dimensions().c; //fixme: 32b -> 16b + if ( dst_tsd->bindable() ) { + NvS16 addrId = dst_tsd->addressId(batch_id); + uintptr_t lineOffs = uintptr_t(dst_data_acc.lineStride());// - uintptr_t(power_buffer.struct_base()); + uintptr_t surfOffs = uintptr_t(dst_data_acc.surfStride());// - uintptr_t(power_buffer.struct_base()); + g->insertRelocEntry(ILoadable::RelocEntry(addrId, lineOffs, + NVDLA_LOADABLE_INTERFACE_EMU1, + NVDLA_LOADABLE_SUB_INTERFACE_EMU1_SURFS, + ELST_Line)); + g->insertRelocEntry(ILoadable::RelocEntry(addrId, surfOffs, + NVDLA_LOADABLE_INTERFACE_EMU1, + NVDLA_LOADABLE_SUB_INTERFACE_EMU1_SURFS, + ELST_Surf)); + } + *dst_data_acc.lineStride() = dst_tsd->lineStride(); + *dst_data_acc.surfStride() = dst_tsd->surfaceStride(); + + if ( g->debugOps() ) + { + gLogInfo << "Softmax node @ op_slot = " << op_slot << " batch_id = " << batch_id << endl; + gLogInfo << "\tsrc addr=" << *src_data_acc.addressIndex() << "[" << *src_data_acc.addressIndexOffset() << "]" << endl; + gLogInfo << "\tdst addr=" << *dst_data_acc.addressIndex() << "[" << *dst_data_acc.addressIndexOffset() << "]" << endl; + gLogInfo << "\tinput scale factor " << *softmax_op_common.input_scale_factor() << endl; + gLogInfo << "\toutput scale factor " << *softmax_op_common.output_scale_factor() << endl; + + gLogInfo << "\tsrc size=" << *src_data_acc.size() << endl; + gLogInfo << "\tsrc format=" << *src_data_acc.format() << endl; + gLogInfo << "\tsrc width=" << *src_data_acc.width() << endl; + gLogInfo << "\tsrc height=" << *src_data_acc.height() << endl; + gLogInfo << "\tsrc channel=" << *src_data_acc.channel() << endl; + + gLogInfo << "\tdst size=" << *dst_data_acc.size() << endl; + gLogInfo << "\tdst format=" << *dst_data_acc.format() << endl; + gLogInfo << "\tdst width=" << *dst_data_acc.width() << endl; + gLogInfo << "\tdst height=" << *dst_data_acc.height() << endl; + gLogInfo << "\tdst channel=" << *dst_data_acc.channel() << endl; + } + + return e; +} + +}; // nvdla::priv:: +}; // nvdla:: diff --git a/umd/core/src/compiler/engine-ast/SplitOp.cpp b/umd/core/src/compiler/engine-ast/SplitOp.cpp new file mode 100644 index 00000000..cf57aa67 --- /dev/null +++ b/umd/core/src/compiler/engine-ast/SplitOp.cpp @@ -0,0 +1,800 @@ +/* + * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#include + +#include "priv/EngineAST.h" +#include "priv/Profile.h" +#include "priv/Surface.h" + +using std::endl; + +namespace nvdla +{ +namespace priv +{ + +void engine_ast::SplitNode::captureCanonicalParams() +{ + // default to split along Channel direction. + // TODO: For other modes, add support in network/layer and canonical ast too + params().setSplitAxis(SplitAxisEnum::SPLIT_ALONG_C); +} + +// not idempotent since relies on some canonical details +NvDlaError engine_ast::SplitNode::populateEdgePorts() +{ + NvDlaError e = NvDlaSuccess; + + typedef engine_ast::Graph::EdgeSequence EngineEdges; + typedef engine_ast::Graph::EdgeSequenceIterator EngineEdgeIterator; + + typedef canonical_ast::Graph::EdgeSequence CanonicalEdges; + typedef canonical_ast::Graph::EdgeSequenceIterator CanonicalEdgeIterator; + + EngineEdges engInEdges = graph()->upstreamDataEdges(this); + EngineEdges engOutEdges = graph()->downstreamDataEdges(this); + + + if (engInEdges.size() > 1) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "%s has > 1 input edges", name().c_str()); + } + else + { + markInputEdge(engInEdges[0]); + } + + // if canonical equivalent exists, use order of output edge insertions in canonical land to establish strict order + if (canonicalNode()) + { + CanonicalEdges canOutEdges = canonicalNode()->outputEdges(); + for (CanonicalEdgeIterator cei = canOutEdges.begin(); cei != canOutEdges.end(); ++cei) + { + IsSameCanonicalEdge match_can_edge(*cei); + EngineEdgeIterator eei = std::find_if(engOutEdges.begin(), engOutEdges.end(), match_can_edge); + if (eei == engOutEdges.end()) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "%s is not an output edge of %s", (*eei)->id().c_str(), name().c_str()); + } + markOutputEdge(*eei); + } + } + // else simply mark output edges in order of appearance + else + { + for (EngineEdgeIterator eei = engOutEdges.begin(); eei != engOutEdges.end(); ++eei) + { + markOutputEdge(*eei); + } + } + + PROPAGATE_ERROR_FAIL(verifyEdgePorts()); +fail: + return e; +} + +Dims4 engine_ast::SplitNode::suggestSurfaceDims(surface::TensorSurfaceDesc* tsd) +{ + NvDlaError e = NvDlaSuccess; + + EdgeSequence outDataEdges; + bool isDstTSD = false; + bool isSrcTSD = false; + Node* srcNode = NULL; + Dims4 srcSuggestedDims(-1,-1,-1,-1); + Dims4 returnSuggestedDims(-1,-1,-1,-1); + Dims4 tsdActualDims = tsd->dimensions(); + + PROPAGATE_ERROR_FAIL(verifyEdgePorts()); + + outDataEdges = outputEdges(); + + for (EdgeSequenceIterator oei = outDataEdges.begin(); oei != outDataEdges.end(); ++oei) + { + if ((*oei)->tensorSurfaceDesc() == tsd) + { + isDstTSD = true; + break; + } + } + isSrcTSD = inputEdges()[0]->tensorSurfaceDesc() == tsd; + + if (!isSrcTSD && !isDstTSD) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "TSD %s doesn't belong to %s", tsd->id().c_str(), name().c_str()); + } + + // split node doesn't affect any tensor dimensions, + // except just distributing them to the downstream nodes. + // as a result, respect the suggested dims from upstream node if any + srcNode = graph()->upstreamNodes(inputEdges()[0]).size() ? + graph()->upstreamNodes(inputEdges()[0])[0] : NULL; + if (srcNode) + { + srcSuggestedDims = srcNode->suggestSurfaceDims(inputEdges()[0]->tensorSurfaceDesc()); + } + + switch(params().splitAxis().v()) + { + case SplitAxisEnum::SPLIT_ALONG_W: + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Don't yet support split along Width direction for %s", + name().c_str()); + break; + case SplitAxisEnum::SPLIT_ALONG_H: + returnSuggestedDims.w = std::max(tsdActualDims.w, srcSuggestedDims.w); + returnSuggestedDims.h = tsdActualDims.h; + returnSuggestedDims.c = std::max(tsdActualDims.c, srcSuggestedDims.c); + break; + case SplitAxisEnum::SPLIT_ALONG_C: + returnSuggestedDims.w = std::max(tsdActualDims.w, srcSuggestedDims.w); + returnSuggestedDims.h = std::max(tsdActualDims.h, srcSuggestedDims.h); + returnSuggestedDims.c = tsdActualDims.c; + break; + case SplitAxisEnum::SPLIT_ALONG_NONE: + // split-along-none is a pass through + returnSuggestedDims.w = std::max(tsdActualDims.w, srcSuggestedDims.w); + returnSuggestedDims.h = std::max(tsdActualDims.h, srcSuggestedDims.h); + returnSuggestedDims.c = std::max(tsdActualDims.c, srcSuggestedDims.c); + break; + default: + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Unknown split mode %s for %s", + params().splitAxis().c_str(), name().c_str()); + } + +fail: + return returnSuggestedDims; +} + +NvU32 engine_ast::SplitNode::suggestLineStride(surface::TensorSurfaceDesc* tsd) +{ + NvDlaError e = NvDlaSuccess; + + NvU32 lineStride = 0; + EdgeSequence outDataEdges; + bool isDstTSD = false; + bool isSrcTSD = false; + surface::TensorSurfaceDesc* srcTSD = NULL; + + PROPAGATE_ERROR_FAIL( verifyEdgePorts() ); + + if (m_nodeTSDLineStride.find(tsd) != m_nodeTSDLineStride.end()) + { + lineStride = m_nodeTSDLineStride[tsd]; + goto fail; + } + + outDataEdges = outputEdges(); + + for (EdgeSequenceIterator oei = outDataEdges.begin(); oei != outDataEdges.end(); ++oei) + { + if ((*oei)->tensorSurfaceDesc() == tsd) + { + isDstTSD = true; + break; + } + } + isSrcTSD = inputEdges()[0]->tensorSurfaceDesc() == tsd; + + if (!isSrcTSD && !isDstTSD) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "TSD %s doesn't belong to %s", tsd->id().c_str(), name().c_str()); + } + + srcTSD = isSrcTSD ? tsd : inputEdges()[0]->tensorSurfaceDesc(); + + /* In DLA, a small cube can be read from/written to a larger cube + * provided the sizes are programmed correctly. Split is one such + * operation, where multiple smaller cubes can be read from a single + * larger input cube provided the strides of the larger cube are + * programmed into each of them. + * Linestride is same for all input and output tensors of split node; + * request the LS suggestion from the upstream node if any + */ + lineStride = graph()->upstreamNodes(inputEdges()[0]).size() ? + graph()->upstreamNodes(inputEdges()[0])[0]->suggestLineStride(srcTSD) : + tsd->lineStride(); + + m_nodeTSDLineStride[tsd] = lineStride; + +fail: + return lineStride; +} + +NvU32 engine_ast::SplitNode::suggestSurfaceStride(surface::TensorSurfaceDesc* tsd) +{ + NvDlaError e = NvDlaSuccess; + + NvU32 surfaceStride = 0; + EdgeSequence outDataEdges; + bool isDstTSD = false; + bool isSrcTSD = false; + surface::TensorSurfaceDesc* srcTSD = NULL; + + PROPAGATE_ERROR_FAIL( verifyEdgePorts() ); + + if (m_nodeTSDSurfaceStride.find(tsd) != m_nodeTSDSurfaceStride.end()) + { + surfaceStride = m_nodeTSDSurfaceStride[tsd]; + goto fail; + } + + outDataEdges = outputEdges(); + + for (EdgeSequenceIterator oei = outDataEdges.begin(); oei != outDataEdges.end(); ++oei) + { + if ((*oei)->tensorSurfaceDesc() == tsd) + { + isDstTSD = true; + break; + } + } + isSrcTSD = inputEdges()[0]->tensorSurfaceDesc() == tsd; + + if (!isSrcTSD && !isDstTSD) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "TSD %s doesn't belong to %s", tsd->id().c_str(), name().c_str()); + } + + srcTSD = isSrcTSD ? tsd : inputEdges()[0]->tensorSurfaceDesc(); + + /* In DLA, a small cube can be read from/written to a larger cube + * provided the sizes are programmed correctly. Split is one such + * operation, where multiple smaller cubes can be read from a single + * larger input cube provided the strides of the larger cube are + * programmed into each of them. + * Surfacestride is same for all input and output tensors of split node; + * request the SS suggestion from the upstream node if any + */ + surfaceStride = graph()->upstreamNodes(inputEdges()[0]).size() ? + graph()->upstreamNodes(inputEdges()[0])[0]->suggestSurfaceStride(srcTSD) : + srcTSD->surfaceStride(); + + m_nodeTSDSurfaceStride[tsd] = surfaceStride; + +fail: + return surfaceStride; +} + +NvU64 engine_ast::SplitNode::suggestSurfaceSize(surface::TensorSurfaceDesc* tsd) +{ + NvDlaError e = NvDlaSuccess; + + NvU64 size = 0; + EdgeSequence outDataEdges; + bool isDstTSD = false; + bool isSrcTSD = false; + surface::TensorSurfaceDesc* srcTSD = NULL; + EdgeSequenceIterator outEdgeItr; + + PROPAGATE_ERROR_FAIL(verifyEdgePorts()); + + if (m_nodeTSDSurfaceSize.find(tsd) != m_nodeTSDSurfaceSize.end()) + { + size = m_nodeTSDSurfaceSize[tsd]; + goto fail; + } + + outDataEdges = outputEdges(); + for (outEdgeItr = outDataEdges.begin(); outEdgeItr != outDataEdges.end(); ++outEdgeItr) + { + if ((*outEdgeItr)->tensorSurfaceDesc() == tsd) + { + isDstTSD = true; + break; + } + } + isSrcTSD = inputEdges()[0]->tensorSurfaceDesc() == tsd; + + if (!isSrcTSD && !isDstTSD) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "TSD %s doesn't belong to %s", tsd->id().c_str(), name().c_str()); + } + + srcTSD = isSrcTSD ? tsd : inputEdges()[0]->tensorSurfaceDesc(); + + if (isDstTSD) + { + Dims4 largeSurfDims; + Dims4 inSurfDims; + surface::TensorSurfaceDesc tempSplitLargeSurface = *srcTSD; + Node* srcNode = graph()->upstreamNodes(inputEdges()[0]).size() ? + graph()->upstreamNodes(inputEdges()[0])[0] : NULL; + if (srcNode) + { + inSurfDims = srcNode->suggestSurfaceDims(inputEdges()[0]->tensorSurfaceDesc()); + } + else + { + inSurfDims = inputEdges()[0]->tensorSurfaceDesc()->dimensions(); + } + + switch(params().splitAxis().v()) + { + case SplitAxisEnum::SPLIT_ALONG_W: + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Don't yet support split along Width direction for %s", + name().c_str()); + break; + case SplitAxisEnum::SPLIT_ALONG_H: + largeSurfDims.w = std::max(tsd->dimensions().w, inSurfDims.w); + largeSurfDims.h = tsd->dimensions().h; + largeSurfDims.c = std::max(tsd->dimensions().c, inSurfDims.c); + break; + case SplitAxisEnum::SPLIT_ALONG_C: + largeSurfDims.w = std::max(tsd->dimensions().w, inSurfDims.w); + largeSurfDims.h = std::max(tsd->dimensions().h, inSurfDims.h); + largeSurfDims.c = tsd->dimensions().c; + break; + case SplitAxisEnum::SPLIT_ALONG_NONE: + // split-along-none is a pass through + largeSurfDims.w = inSurfDims.w; + largeSurfDims.h = inSurfDims.h; + largeSurfDims.c = inSurfDims.c; + break; + default: + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Unknown split mode %s for %s", + params().splitAxis().c_str(), name().c_str()); + } + + tempSplitLargeSurface.setDimensions(largeSurfDims); + tempSplitLargeSurface.resetSize(); + size = tempSplitLargeSurface.size(); + } + else if (isSrcTSD) + { + size = graph()->upstreamNodes(inputEdges()[0]).size() ? + graph()->upstreamNodes(inputEdges()[0])[0]->suggestSurfaceSize(tsd) : + tsd->size(); + } + + m_nodeTSDSurfaceSize[tsd] = size; + +fail: + return size; +} + +NvU64 engine_ast::SplitNode::suggestOffsetInSplitChain(surface::TensorSurfaceDesc* outTSD) +{ + NvDlaError e = NvDlaSuccess; + NVDLA_UNUSED(e); + NvU64 offsetInCommonBuff = 0; + bool isSplitChain = graph()->upstreamDataNodes(this).size() ? + graph()->upstreamDataNodes(this)[0]->engineType().v() == EngineTypeEnum::SPLIT : + false; + if (isSplitChain) + { + SplitNode* srcSplit = NodeFactory::nodeCast(graph()->upstreamDataNodes(this)[0]); + surface::TensorSurfaceDesc* currSplitSrcTSD = inputEdges()[0]->tensorSurfaceDesc(); + offsetInCommonBuff += srcSplit->suggestOffsetInSplitChain(currSplitSrcTSD); + } + else + { + EdgeSequence outEdges = outputEdges(); + for (EdgeSequenceIterator oei = outEdges.begin(); oei != outEdges.end(); ++oei) + { + if ((*oei)->tensorSurfaceDesc() == outTSD) + { + break; + } + else + { + Dims4 outSurfDims; + Node* sinkNode = graph()->downstreamNodes(*oei).size() ? graph()->downstreamNodes(*oei)[0] : NULL; + if (sinkNode) + { + outSurfDims = sinkNode->suggestSurfaceDims((*oei)->tensorSurfaceDesc()); + } + else + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "No downstream node for output edge %s to node %s", + (*oei)->id().c_str(), name().c_str()); + } + + switch (params().splitAxis().v()) + { + case SplitAxisEnum::SPLIT_ALONG_W: + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Don't yet support split along W dimension for %s", name().c_str()); + break; + case SplitAxisEnum::SPLIT_ALONG_H: + offsetInCommonBuff += ((*oei)->tensorSurfaceDesc()->lineStride() * outSurfDims.h); + break; + case SplitAxisEnum::SPLIT_ALONG_C: + offsetInCommonBuff += (*oei)->tensorSurfaceDesc()->size(); + break; + case SplitAxisEnum::SPLIT_ALONG_NONE: + // split-along-none is a pass through + offsetInCommonBuff += 0; + break; + default: + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Unknown split mode for %s", name().c_str()); + } + } + } + } + +fail: + return offsetInCommonBuff; +} + +NvU64 engine_ast::SplitNode::suggestSurfaceOffsetInBuffer(surface::TensorSurfaceDesc* tsd) +{ + NvDlaError e = NvDlaSuccess; + + NvU64 offsetInCommonBuff = 0; + bool isDstTSD = false; + bool isSrcTSD = false; + EdgeSequence outEdges; + EdgeSequence inEdges; + + PROPAGATE_ERROR_FAIL(verifyEdgePorts()); + + if (m_nodeTSDSurfaceOffsetInBuffer.find(tsd) != m_nodeTSDSurfaceOffsetInBuffer.end()) + { + offsetInCommonBuff = m_nodeTSDSurfaceOffsetInBuffer[tsd]; + goto fail; + } + + outEdges = outputEdges(); + inEdges = inputEdges(); + + for (EdgeSequenceIterator oei = outEdges.begin(); oei != outEdges.end(); ++oei) + { + if ((*oei)->tensorSurfaceDesc() == tsd) + { + isDstTSD = true; + break; + } + } + isSrcTSD = inEdges[0]->tensorSurfaceDesc() == tsd; + + if (!isSrcTSD && !isDstTSD) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "TSD %s doesn't belong to %s", tsd->id().c_str(), name().c_str()); + } + + if (isDstTSD) + { + Dims4 inSurfDims; + EdgeSequenceIterator outEdgeItr; + Node* srcNode = graph()->upstreamNodes(inputEdges()[0]).size() ? + graph()->upstreamNodes(inputEdges()[0])[0] : NULL; + if (srcNode) + { + inSurfDims = srcNode->suggestSurfaceDims(inputEdges()[0]->tensorSurfaceDesc()); + } + else + { + inSurfDims = inputEdges()[0]->tensorSurfaceDesc()->dimensions(); + } + + for (outEdgeItr = outEdges.begin(); outEdgeItr != outEdges.end(); ++outEdgeItr) + { + if ((*outEdgeItr)->tensorSurfaceDesc() == tsd) + { + break; + } + else + { + Dims4 outSurfDims; + Node* sinkNode = graph()->downstreamNodes(*outEdgeItr).size() ? + graph()->downstreamNodes(*outEdgeItr)[0] : NULL; + if (sinkNode) + { + outSurfDims = sinkNode->suggestSurfaceDims((*outEdgeItr)->tensorSurfaceDesc()); + } + else + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "No downstream node for output edge %s of %s", + (*outEdgeItr)->id().c_str(), name().c_str()); + } + + switch(params().splitAxis().v()) + { + case SplitAxisEnum::SPLIT_ALONG_W: + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Dont yet support split along Widht direction for %s", + name().c_str()); + break; + case SplitAxisEnum::SPLIT_ALONG_H: + offsetInCommonBuff += (suggestLineStride((*outEdgeItr)->tensorSurfaceDesc()) * outSurfDims.h); + break; + case SplitAxisEnum::SPLIT_ALONG_C: + offsetInCommonBuff += suggestSurfaceSize((*outEdgeItr)->tensorSurfaceDesc()); + break; + case SplitAxisEnum::SPLIT_ALONG_NONE: + // split-along-none is a pass through + offsetInCommonBuff = 0; + break; + default: + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Unknown split mode %s for %s", + params().splitAxis().c_str(), name().c_str()); + } + } + } + + if (params().splitAxis().v() == SplitAxisEnum::SPLIT_ALONG_H) + { + NvS32 sumSplitOutHeight = 0; + for (EdgeSequenceIterator oei = outEdges.begin(); oei != outEdges.end(); ++oei) + { + Dims4 surfDims; + Node* sink = graph()->downstreamNodes(*oei).size() ? + graph()->downstreamNodes(*oei)[0] : NULL; + if (sink) + { + surfDims = sink->suggestSurfaceDims((*oei)->tensorSurfaceDesc()); + } + else + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "No downstream node for output edge %s of %s", + (*oei)->id().c_str(), name().c_str()); + } + sumSplitOutHeight += surfDims.h; + } + + if ((sumSplitOutHeight == inSurfDims.h) && + (sumSplitOutHeight == inputEdges()[0]->tensorSurfaceDesc()->dimensions().h)) + { + // this means there are no overlapping slices in H-direction + // among the split out edges; in this case offset of a split tensor + // in common buffer is deterministic + } + else + { + // otherwise there are overlapping slices; + // in this case, offset of a split tensor in common buffer is undeterministic + // so, consider the offset calculated by the client on the other end of the tsd as gospel + Node* sinkNode = graph()->downstreamNodes((*outEdgeItr)).size() ? + graph()->downstreamNodes((*outEdgeItr))[0] : NULL; + if (!sinkNode) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "No sink node for output edge %s of %s", + (*outEdgeItr)->id().c_str(), name().c_str()); + } + offsetInCommonBuff = sinkNode->suggestSurfaceOffsetInBuffer(tsd); + } + } + // add to the calculated offset, the offset of the input edge since it could be part of a larger buffer + offsetInCommonBuff += suggestSurfaceOffsetInBuffer(inputEdges()[0]->tensorSurfaceDesc()); + + if ( debugSplit() ) + { + gLogInfo << "(" << name() << ") output edge " << (*outEdgeItr)->id() + << "(" << tsd->dimensions().c << "x" << tsd->dimensions().h << "x" << tsd->dimensions().w << ")" + << " is at offset " << offsetInCommonBuff + << " in its buffer: " << (tsd->tensorBufferDesc() ? tsd->tensorBufferDesc()->id() : "TBR") << endl; + } + } + else if (isSrcTSD) + { + offsetInCommonBuff = 0; + // if input of split is part of an upstream split, it may be at a non-0 offset in the + // revalent buffer; return presiding buffer offset in that case + bool isSplitChain = graph()->upstreamDataNodes(this).size() ? + graph()->upstreamDataNodes(this)[0]->engineType().v() == EngineTypeEnum::SPLIT : + false; + if (isSplitChain) + { + SplitNode* srcSplit = NodeFactory::nodeCast(graph()->upstreamDataNodes(this)[0]); + surface::TensorSurfaceDesc* currSplitSrcTSD = tsd; + offsetInCommonBuff = srcSplit->suggestOffsetInSplitChain(currSplitSrcTSD); + } + else + { + offsetInCommonBuff = 0; + } + + if ( debugSplit() ) + { + gLogInfo << "(" << name() << ") input edge " << inputEdges().at(0)->id() + << "(" << tsd->dimensions().c << "x" << tsd->dimensions().h << "x" << tsd->dimensions().w << ")" + << " is at offset " << offsetInCommonBuff + << " in its buffer: " << (tsd->tensorBufferDesc() ? tsd->tensorBufferDesc()->id() : "TBR") << endl; + } + } + + m_nodeTSDSurfaceOffsetInBuffer[tsd] = offsetInCommonBuff; + +fail: + return offsetInCommonBuff; +} + +memory::TensorBufferDesc* engine_ast::SplitNode::suggestBuffer(surface::TensorSurfaceDesc* tsd) +{ + NvDlaError e = NvDlaSuccess; + memory::TensorBufferDesc* commonTBD = NULL; + bool isDstTSD = false; + bool isSrcTSD = false; + EdgeSequence outEdges; + EdgeSequence inEdges; + NvU16 numBatches = graph()->profile()->multiBatchSize(); + + PROPAGATE_ERROR_FAIL(verifyEdgePorts()); + + outEdges = outputEdges(); + inEdges = inputEdges(); + + for (EdgeSequenceIterator oei = outEdges.begin(); oei != outEdges.end(); ++oei) + { + if ((*oei)->tensorSurfaceDesc() == tsd) + { + isDstTSD = true; + break; + } + } + isSrcTSD = inputEdges()[0]->tensorSurfaceDesc() == tsd; + + if (!isSrcTSD && !isDstTSD) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "TSD %s doesn't belong to %s", tsd->id().c_str(), name().c_str()); + } + else if ( tsd->tensorCategory().v() == memory::TensorCategoryEnum::UNKNOWN_TENSOR ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Edge %s has 'unknown' tensor category", + tsd->id().c_str()); + } + + // hunt across all edges to find a common TBD if any was registered before + commonTBD = isSrcTSD ? tsd->tensorBufferDesc() : inputEdges()[0]->tensorBufferDesc(); + if ( !commonTBD ) + { + for (EdgeSequenceIterator oei = outEdges.begin(); oei != outEdges.end(); ++oei) + { + if ((*oei)->tensorBufferDesc()) + { + commonTBD = (*oei)->tensorBufferDesc(); + break; + } + } + } + + if ( !commonTBD ) + { + commonTBD = graph()->resourceMgr()->regTensorBufferDesc(numBatches); + } + +fail: + return commonTBD; +} + +NvDlaError engine_ast::SplitNode::verifySurfaceIsPartOfSplit +( + surface::TensorSurfaceDesc* srcTSD, + surface::TensorSurfaceDesc* dstTSD, + engine_ast::SplitAxis axis +) +{ + NvDlaError e = NvDlaSuccess; + Dims4 srcDims = suggestSurfaceDims(srcTSD); + Dims4 dstDims = suggestSurfaceDims(dstTSD); + + if (axis.v() == engine_ast::SplitAxisEnum::SPLIT_ALONG_C) + { + if (srcDims.w != dstDims.w || srcDims.h != dstDims.h) + { + gLogError << "In-" << srcTSD->id() << " WxH : " + << srcDims.w << "x" << srcDims.h << endl; + gLogError << "Out-" << dstTSD->id() << " WxH : " + << dstDims.w << "x" << dstDims.h << endl; + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Split along C should have " + "all edges of the same WxH"); + } + } + else if (axis.v() == engine_ast::SplitAxisEnum::SPLIT_ALONG_H) + { + if (srcDims.w != dstDims.w || srcDims.c != dstDims.c) + { + gLogError << "In-" << srcTSD->id() << " WxC : " + << srcDims.w << "x" << srcDims.c << endl; + gLogError << "Out-" << dstTSD->id() << " WxC : " + << dstDims.w << "x" << dstDims.c << endl; + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Split along H should have " + "all edges of the same WxC"); + } + } + else if (axis.v() == engine_ast::SplitAxisEnum::SPLIT_ALONG_W) + { + if (srcDims.h != dstDims.h || srcDims.c != dstDims.c) + { + gLogError << "In-" << srcTSD->id() << " HxC : " + << srcDims.h << "x" << srcDims.c << endl; + gLogError << "Out-" << dstTSD->id() << " HxC : " + << dstDims.h << "x" << dstDims.c << endl; + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Split along W should have " + "all edges of the same HXC"); + } + } + else if (axis.v() == engine_ast::SplitAxisEnum::SPLIT_ALONG_NONE) + { + if (srcDims.w != dstDims.w || srcDims.h != dstDims.h || srcDims.c != dstDims.c) + { + gLogError << "In-" << srcTSD->id() << " WxHxC : " + << srcDims.w << "x" << srcDims.h << "x" << srcDims.c << endl; + gLogError << "Out-" << dstTSD->id() << " WxHxC : " + << dstDims.w << "x" << dstDims.h << "x" << dstDims.c << endl; + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Split along none should have " + "all edges of the same WxHXC"); + } + } + else + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Unknown split axis: %s", axis.c_str()); + } + +fail: + return e; +} + +NvDlaError engine_ast::SplitNode::verifySurfaceDims(surface::TensorSurfaceDesc* tsd) +{ + NvDlaError e = NvDlaSuccess; + + EdgeSequence outDataEdges; + bool isSrcTSD = false; + bool isDstTSD = false; + surface::TensorSurfaceDesc* srcTSD = NULL; + surface::TensorSurfaceDesc* dstTSD = NULL; + + PROPAGATE_ERROR_FAIL(verifyEdgePorts()); + + outDataEdges = outputEdges(); + for (EdgeSequenceIterator oei = outDataEdges.begin(); oei != outDataEdges.end(); ++oei) + { + if ((*oei)->tensorSurfaceDesc() == tsd) + { + isDstTSD = true; + break; + } + } + isSrcTSD = inputEdges()[0]->tensorSurfaceDesc() == tsd; + + if (!isSrcTSD && !isDstTSD) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "TSD %s doesn't belong to %s", tsd->id().c_str(), name().c_str()); + } + + srcTSD = isSrcTSD ? tsd : inputEdges()[0]->tensorSurfaceDesc(); + dstTSD = isDstTSD ? tsd : NULL; + + if (isSrcTSD) + { + for (EdgeSequenceIterator oei = outDataEdges.begin(); oei != outDataEdges.end(); ++oei) + { + surface::TensorSurfaceDesc* dstTSD = (*oei)->tensorSurfaceDesc(); + PROPAGATE_ERROR_FAIL( verifySurfaceIsPartOfSplit(srcTSD, dstTSD, params().splitAxis()) ); + } + } + else + { + PROPAGATE_ERROR_FAIL( verifySurfaceIsPartOfSplit(srcTSD, dstTSD, params().splitAxis()) ); + } + +fail: + return e; +} +}; // nvdla::priv:: +}; // nvdla:: diff --git a/umd/core/src/compiler/include/priv/AST.h b/umd/core/src/compiler/include/priv/AST.h new file mode 100644 index 00000000..24a77acb --- /dev/null +++ b/umd/core/src/compiler/include/priv/AST.h @@ -0,0 +1,1911 @@ +/* + * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#ifndef NVDLA_PRIV_AST_H +#define NVDLA_PRIV_AST_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "dlaerror.h" + +#include "priv/Check.h" +#include "priv/Type.h" +#include "priv/ASTEnums.h" + +#include "ErrorMacros.h" + +namespace nvdla +{ + +namespace priv +{ + +namespace ast +{ + +enum EdgeDirectionEnum { + AST_EDGE_DIRECTION_ENUMS(GEN_ENUM) +}; +typedef SequenceEnum EdgeDirection; + +enum EdgeSideEnum { + AST_EDGE_SIDE_ENUMS(GEN_ENUM) +}; +typedef SequenceEnum EdgeSide; + + +template class Graph; + + + +template +class GraphOrdering +{ +public: + typedef typename G::Node Node; + typedef typename G::Edge Edge; + typedef typename G::Elem Elem; + typedef typename G::NodeSequence NodeSequence; + typedef typename G::EdgeSequence EdgeSequence; + typedef typename G::ElemSequence ElemSequence; + typedef typename G::NodeSequenceIterator NodeSequenceIterator; + typedef typename G::EdgeSequenceIterator EdgeSequenceIterator; + typedef typename G::ElemSequenceIterator ElemSequenceIterator; + + GraphOrdering(G *graph) : m_graph(graph) { } + GraphOrdering() : m_graph(0) { } + virtual ~GraphOrdering() { } + + G *graph() const { return m_graph; } + + void setGraph(G *graph) + { + clear(); + m_graph = graph; + } + + NodeSequenceIterator findNode(Node *n) { return m_node_order.find(n); } + EdgeSequenceIterator findEdge(Edge *e) { return m_edge_order.find(e); } + ElemSequenceIterator findElem(Elem e) { return m_elem_order.find(e); } + + const ElemSequence &elemOrder() const { return m_elem_order; } + const NodeSequence &nodeOrder() const { return m_node_order; } + const EdgeSequence &edgeOrder() const { return m_edge_order; } + + virtual NvDlaError generate() = 0; + + virtual void clear() + { + m_node_order.clear(); + m_edge_order.clear(); + m_elem_order.clear(); + } + +protected: + G *m_graph; + NodeSequence m_node_order; + EdgeSequence m_edge_order; + ElemSequence m_elem_order; + + NodeSequenceIterator nodeBegin() { return m_node_order.begin(); } + NodeSequenceIterator nodeEnd() { return m_node_order.end(); } + + EdgeSequenceIterator edgeBegin() { return m_edge_order.begin(); } + EdgeSequenceIterator edgeEnd() { return m_edge_order.end(); } + + ElemSequenceIterator elemBegin() { return m_elem_order.begin(); } + ElemSequenceIterator elemEnd() { return m_elem_order.end(); } + +}; + + +class GraphTraversalState +{ +public: + // note: these state values are strictly ordered... + enum State { e_undiscovered = 0U, e_discovered = 1U, e_finishable = 2U, e_finished = 3U }; + + GraphTraversalState() : + m_e(e_undiscovered), m_discovered(-1), m_finishable(-1), m_finished(-1) { } + + GraphTraversalState(const GraphTraversalState &o) : + m_e(o.m_e), m_discovered(o.m_discovered), + m_finishable(o.m_finishable), m_finished(o.m_finished) { } + + virtual ~GraphTraversalState() { } + + void setDiscovered(int t) { m_e = e_discovered; m_discovered = t; } + void setFinished(int t) { m_e = e_finished; m_finished = t; } + void setFinishable(int t) { m_e = e_finishable; m_finishable = t; } + + bool isUndiscovered() const { return m_e == e_undiscovered; } + bool isDiscovered() const { return m_discovered != -1; } + bool isFinished() const { return m_finished != -1; } + bool isFinishable() const { return m_e == e_finishable; } + + State state() const { return m_e; } + int discoveryTime() const { return m_discovered; } + int finishTime() const { return m_finished; } + int finishableTime() const { return m_finishable; } + + const std::string toString() + { + std::stringstream ss; + const char * state_names[] = { "und", "dis", "fab", "fin" }; + ss << "s=" << state_names[int(m_e)] << " dis=" << m_discovered << " fab=" << m_finishable << " fin=" << m_finished; + return ss.str(); + } + + bool operator==(const GraphTraversalState &rhs) const + { + return (m_e == rhs.m_e) && (m_discovered == rhs.m_discovered) && + (m_finishable == rhs.m_finishable) && (m_finished == rhs.m_finished); + } + + bool operator<(const GraphTraversalState &rhs) const + { + if ( *this == rhs ) + { + return false; + } + // we know they won't be == now. + + // states: undiscovered < discovered < finishable < finished + // within each state (i.e. comparing two with same state) use associated time. + // but, unless absolutely == (all states' times the same) we should use prior + // states' times as well to determine order of two items in the same state. + + if ( int(m_e) != int(rhs.m_e) ) + { + // not in the same state just compare which state they're in + // this isn't really interesting... typically we're comparing + // states which are all of one type. but do something reasonable. + return int(m_e) < int(rhs.m_e); + } + // now we know they're both in the same state ( && != each other ) + switch ( m_e ) + { + case e_discovered: + return m_discovered < rhs.m_discovered; + break; + + case e_finishable: + if ( m_finishable == rhs.m_finishable ) + { + return (m_discovered < rhs.m_discovered); + } + else + { + return m_finishable < rhs.m_finishable; + } + break; + + case e_finished: + if ( m_finished == rhs.m_finished ) + { + if ( m_finishable == rhs.m_finishable ) + { + return m_discovered < rhs.m_discovered; + } + else + { + return m_finishable < rhs.m_finishable; + } + } + else + { + return m_finished < rhs.m_finished; + } + break; + + case e_undiscovered: + default: + return false; // should be == as there is no time. + } + + /*not reached*/ + return false; + } + +protected: + State m_e; + int m_discovered; // -1 := not yet discovered + int m_finishable; // -1 := not yet finishable + int m_finished; // -1 := not yet finished +}; + + +template class GraphScoreboard; + +template +class GraphTraversalPointer +{ +public: + typedef typename G::Node Node; + typedef typename G::Edge Edge; + typedef typename G::Elem Elem; + typedef typename G::ElemSequence ElemSequence; + typedef typename G::NodeSequence NodeSequence; + typedef typename G::EdgeSequence EdgeSequence; + typedef typename G::ElemSequenceIterator ElemSequenceIterator; + typedef typename G::NodeSequenceIterator NodeSequenceIterator; + typedef typename G::EdgeSequenceIterator EdgeSequenceIterator; + + typedef typename GraphScoreboard::Score Score; + typedef typename GraphScoreboard::NodeScoresIterator NodeScoresIterator; + typedef typename GraphScoreboard::EdgeScoresIterator EdgeScoresIterator; + typedef typename GraphScoreboard::ElemScoresIterator ElemScoresIterator; + + + GraphTraversalPointer() : m_graph(0), m_node(0) { } + + GraphTraversalPointer(G *g, Node *n) : m_graph(g), m_node(n) , m_state() { } + GraphTraversalPointer(const GraphTraversalPointer &o) : m_graph(o.m_graph), m_node(o.m_node) , m_state(o.m_state) { } + ~GraphTraversalPointer() { } + + GraphTraversalState state() const { return m_state; } + void setState(GraphTraversalState s) { m_state = s; } + + G *graph() const { return m_graph; } + + Node *node() const { return m_node; } + void setNode(Node *n) { m_node = n; /* !!! note m_state is stale !!! */ } + +#if 0 + Edge *edge() const { return m_edge; } + void setEdge() { m_edge = e; } /* note m_state is stale */ +#endif + + bool operator==(const GraphTraversalPointer &rhs) const + { + return (m_node == rhs.m_node) && (m_state == rhs.m_state); + } + +protected: + G *m_graph; + Node *m_node; + GraphTraversalState m_state; +}; + + +template +class GraphScoreboard +{ +public: + GraphScoreboard(G *g = 0) : m_graph(g) { } + virtual ~GraphScoreboard() { } + + typedef typename G::Node Node; + typedef typename G::Edge Edge; + typedef typename G::Elem Elem; + typedef typename G::ElemSequence ElemSequence; + typedef typename G::NodeSequence NodeSequence; + typedef typename G::EdgeSequence EdgeSequence; + typedef typename G::ElemSequenceIterator ElemSequenceIterator; + typedef typename G::NodeSequenceIterator NodeSequenceIterator; + typedef typename G::EdgeSequenceIterator EdgeSequenceIterator; + + typedef ast::GraphTraversalState Score; + typedef std::map NodeScores; + typedef std::map EdgeScores; + typedef std::map ElemScores; + typedef typename NodeScores::iterator NodeScoresIterator; + typedef typename EdgeScores::iterator EdgeScoresIterator; + typedef typename ElemScores::iterator ElemScoresIterator; + + NodeScoresIterator nodeBegin() { return m_node_score.begin(); } + NodeScoresIterator nodeEnd() { return m_node_score.end(); } + NodeScoresIterator findNode(Node *n) { return m_node_score.find(n); } + + EdgeScoresIterator edgeBegin() { return m_edge_score.begin(); } + EdgeScoresIterator edgeEnd() { return m_edge_score.end(); } + EdgeScoresIterator findEdge(Edge *e) { return m_edge_score.find(e); } + + ElemScoresIterator elemBegin() { return m_elem_score.begin(); } + ElemScoresIterator elemEnd() { return m_elem_score.end(); } + ElemScoresIterator findElem(Elem e) { return m_elem_score.find(e); } + + std::pair insertNode(std::pair p) { return m_node_score.insert(p); } + std::pair insertEdge(std::pair p) { return m_edge_score.insert(p); } + std::pair insertElem(std::pair p) { return m_elem_score.insert(p); } + + void clear() { m_node_score.clear(); m_edge_score.clear(); m_elem_score.clear(); } + void setGraph(G *g) { m_graph = g; clear(); } + + // + // fetch means find it and if it doesn't exist create it and mark as discovered + // + EdgeScoresIterator fetchEdgeScore(int time, Edge *edge) + { + // gLogInfo << __func__ << " edge=" << edge->id() << std::endl; + EdgeScoresIterator f_i = findEdge(edge); + if ( f_i == edgeEnd() ) + { + std::pair inserted = + insertEdge(std::pair(edge, GraphTraversalState())); + f_i = inserted.first; + f_i->second.setDiscovered(time); + } + return f_i; + } + + + NodeScoresIterator fetchNodeScore(int time, Node *node) + { + // gLogInfo << __func__ << " node=" << node->id() << std::endl; + NodeScoresIterator f_i = findNode(node); + if ( f_i == nodeEnd() ) + { + std::pair inserted = + insertNode(std::pair(node, GraphTraversalState())); + f_i = inserted.first; + f_i->second.setDiscovered(time); + } + return f_i; + } + + // the fetch elem score entry points are slightly different + // because they are derived from already-present (finished) + // nodes and edges. + ElemScoresIterator fetchElemScore(Node *node, Score score) + { + Elem elem(node, 0); + ElemScoresIterator f_i = findElem( elem ); + // gLogInfo << __func__ << " node=" << node->id() << std::endl; + if ( f_i == elemEnd() ) + { + insertElem(std::pair(elem, score)); + } + return f_i; + } + + ElemScoresIterator fetchElemScore(Edge *edge, Score score) + { + Elem elem(0, edge); + ElemScoresIterator f_i = findElem( elem ); + // gLogInfo << __func__ << " node=" << node->id() << std::endl; + if ( f_i == elemEnd() ) + { + insertElem(std::pair(elem, score)); + } + return f_i; + } + + // + // evaluate edge state based upon upstream nodes. + // this can result in an edge being *finished*. + // node evaluation doesn't do that. + // + EdgeScoresIterator evaluateEdgeScore(int time, Edge *edge) + { + // gLogInfo << __func__ << " edge=" << edge->id() << std::endl; + EdgeScoresIterator edge_score_i; + NodeSequence up_nodes; + + edge_score_i = fetchEdgeScore(time, edge); + + if ( edge_score_i->second.isFinished() ) + { + return edge_score_i; + } + + up_nodes = m_graph->upstreamNodes(edge); + + bool all_nodes_finished = true; // note: edges w/o upstream nodes are finishable at 0... + int nodes_finishable_time = 0; + int nodes_finished_time = 0; + + for ( size_t un_i = 0, UN_I = up_nodes.size(); un_i != UN_I; ++un_i ) + { + Node *up_node = up_nodes[un_i]; + NodeScoresIterator node_score_i; + + node_score_i = fetchNodeScore(time, up_node); + + all_nodes_finished = all_nodes_finished && node_score_i->second.isFinished(); + nodes_finished_time = std::max(nodes_finished_time, node_score_i->second.finishTime()); + nodes_finishable_time = std::max(nodes_finishable_time, node_score_i->second.finishableTime()); + } + + if ( all_nodes_finished ) + { + edge_score_i->second.setFinishable(nodes_finishable_time); // := same as node finishable + edge_score_i->second.setFinished(nodes_finished_time); // := same as node finish + + // gLogInfo << "finish edge=" << edge_score_i->first->id() << " score=" << edge_score_i->second.toString() << std::endl; + fetchElemScore(edge_score_i->first, edge_score_i->second); + } + + return edge_score_i; + } + + + // + // evaluate node state based upon upstream edges. + // unlike edge evaluation, node evaluation does *not* finish nodes. + // + NodeScoresIterator evaluateNodeScore(int time, Node *node) + { + // gLogInfo << __func__ << " node=" << node->id() << std::endl; + NodeScoresIterator node_score_i; + + node_score_i = fetchNodeScore(time, node); + + if ( node_score_i->second.isFinished() ) + { + return node_score_i; + } + + // input edges + EdgeSequence up_edges = m_graph->upstreamEdges(node); + + bool all_up_edges_finishable = true; // nodes w/o upstream edges are finishable. + int all_up_edges_finishable_time = 0; + + for (EdgeSequenceIterator ue_i = up_edges.begin(); all_up_edges_finishable && (ue_i != up_edges.end()); ++ue_i ) + { + EdgeScoresIterator up_edge_score_i; + + up_edge_score_i = evaluateEdgeScore(time, *ue_i); + + all_up_edges_finishable = all_up_edges_finishable && (up_edge_score_i->second.isFinished() || up_edge_score_i->second.isFinishable()); + all_up_edges_finishable_time = std::max(all_up_edges_finishable_time, up_edge_score_i->second.finishableTime()); + } + + if ( all_up_edges_finishable ) + { + node_score_i->second.setFinishable(all_up_edges_finishable_time + 1); // := last edge completion + 1 + } + + return node_score_i; + } + + + NodeScoresIterator evaluateScore(GraphTraversalPointer &ptr, int t) + { + NodeScoresIterator f_i = evaluateNodeScore(t, ptr.node()); + ptr.setState(f_i->second); + return f_i; + } + + // + // finishes a node and increments time. note: any upstream edges which were finishable + // but which hadn't been yet take time == t and the node itself takes time = t + 1; + // + NvDlaError finishNode(GraphTraversalPointer &ptr, int t) + { + NvDlaError e = NvDlaError_Success; + + EdgeSequence up_edges = m_graph->upstreamEdges(ptr.node()); + for ( EdgeSequenceIterator up_i = up_edges.begin(); up_i != up_edges.end(); ++up_i) + { + EdgeScoresIterator edge_score_i = fetchEdgeScore(t, *up_i); + if ( edge_score_i->second.isFinishable() ) // implies !edge_score_i->second.isFinished() ) + { + edge_score_i->second.setFinished(t); + // gLogInfo << "at node=" << ptr.node()->id() << " finish edge=" << (*up_i)->id() << " score=" << edge_score_i->second.toString() << std::endl; + fetchElemScore(edge_score_i->first, edge_score_i->second); + } + } + + NodeScoresIterator score_i = fetchNodeScore(t, ptr.node()); + score_i->second.setFinished(t+1); + ptr.setState(score_i->second); + + fetchElemScore(score_i->first, score_i->second); + + return e; + } + +protected: + G *m_graph; + NodeScores m_node_score; + EdgeScores m_edge_score; + ElemScores m_elem_score; +}; + + + + + +template +class ScoredGraphOrdering +{ +public: + + typedef typename G::Node Node; + typedef typename G::Edge Edge; + typedef typename G::Elem Elem; + + typedef typename G::NodeSequence NodeSequence; + typedef typename G::EdgeSequence EdgeSequence; + typedef typename G::ElemSequence ElemSequence; + + typedef typename G::NodeSequenceIterator NodeSequenceIterator; + typedef typename G::EdgeSequenceIterator EdgeSequenceIterator; + typedef typename G::ElemSequenceIterator ElemSequenceIterator; + + typedef typename GraphScoreboard::Score Score; + typedef typename GraphScoreboard::NodeScores NodeScores; + typedef typename GraphScoreboard::EdgeScores EdgeScores; + typedef typename GraphScoreboard::ElemScores ElemScores; + + typedef typename GraphScoreboard::NodeScoresIterator NodeScoresIterator; + typedef typename GraphScoreboard::EdgeScoresIterator EdgeScoresIterator; + typedef typename GraphScoreboard::ElemScoresIterator ElemScoresIterator; + + ScoredGraphOrdering(G *graph = 0) : m_graph(graph), m_scores(graph) { } + virtual ~ScoredGraphOrdering() { } + + G *graph() const { return m_graph; } + void setGraph(G *graph) + { + clear(); + m_graph = graph; + } + + GraphScoreboard &scores() { return m_scores; } + + NodeScoresIterator findNodeScore(Node *n) { return m_scores.findNode(n); } + EdgeScoresIterator findEdgeScore(Edge *e) { return m_scores.findEdge(e); } + ElemScoresIterator findElemScore(Elem e) { return m_scores.findElem(e); } + + const std::vector &elemScoreOrder() const { return m_elem_score_order; } + const std::vector &nodeScoreOrder() const { return m_node_score_order; } + const std::vector &edgeScoreOrder() const { return m_edge_score_order; } + + // + // the real business... generally speaking, does the following: + // . seed the scheme with the nodes reachable from the graph's input edges + // . while traversal pointers exist + // . evaluate nodes at and edges immediately upstream of the pointers + // . scrub finished pointers + // . find first pointer which is finishable + // . finish the node there + // . advance pointer downstream + // . add more pointers as needed + // . finish off dangling edges + // . sort the scoreboard results to provide a linear ordering + // + // note that this scheme allows for portions of the graph to go undiscovered + // (or unfinished) if the input edges to the graph don't cover enough. + // + virtual NvDlaError generate() // default is DepthFirstDependencyOrder() + { + NvDlaError e = NvDlaError_Success; + int time = 0; + typename EdgeSequence::const_iterator ie_i; + std::list> pointer_list; + + // gLogInfo << "generating scoreboard." << std::endl; + + if ( !m_graph ) { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "missing graph"); + } + + clear(); + + // for all graph input edges... + for ( ie_i = m_graph->inputEdges().begin(); ie_i != m_graph->inputEdges().end(); ++ie_i) + { + // this *should* be zero sized, check it. + NodeSequence upstream_nodes = m_graph->upstreamNodes(*ie_i); + if ( upstream_nodes.size() ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "Unexpected source node for network input edge '%s'", + (*ie_i)->id().c_str()); + } + NodeSequence downstream_nodes = m_graph->downstreamNodes(*ie_i); + + // for all downstream nodes... + for ( size_t ni = 0, NI = downstream_nodes.size(); ni != NI; ++ni ) + { + Node *downstream_node = downstream_nodes[ni]; + GraphTraversalPointer downstream_pointer(m_graph, downstream_node); + // don't push more than once as there can be multiple paths to a node from the inputs. + // also note that is the very first such time this happens and so it's impossible for + // the GTP pointers to have anything other than "discovered" as their current state. + // that means the find GTP (downstream_pointer) comparison is really only testing for + // the presence of the same node. + if ( pointer_list.end() == std::find(pointer_list.begin(), pointer_list.end(), downstream_pointer) ) + { + pointer_list.push_back( downstream_pointer ); + } + } + } + + while ( pointer_list.size() ) + { + // helper predicate + struct GraphTraversalPointer_is_Finished + { + bool operator() (const GraphTraversalPointer & tptr) { return tptr.state().isFinished(); } + }; + + // + // evaluate to find the first which is finishable + // + typename std::list>::iterator finishable_i; + + finishable_i = pointer_list.end(); + + for ( typename std::list>::iterator p_i = pointer_list.begin(); + p_i != pointer_list.end(); + ++p_i) + { + NodeScoresIterator check_score_i; + + check_score_i = m_scores.evaluateScore(*p_i, time); + + if ( check_score_i->second.isFinishable() && (finishable_i == pointer_list.end() ) ) + { + finishable_i = p_i; + } + } + + // + // scrub finished pointers from the list. + // note: list iterators which aren't removed stay valid. + // + pointer_list.remove_if( GraphTraversalPointer_is_Finished() ); + + if ( pointer_list.size() == 0 ) + { + continue; // done. + } + + // + // something should be finishable every time through this list + // + if ( finishable_i == pointer_list.end() ) + { + sort(); // just so the end result is quasi-legit. don't ignore failure though. + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "%s is not converging for :%s %s ", __func__, pointer_list.front().node()->id().c_str(), pointer_list.front().node()->name().c_str() ); + } + + GraphTraversalPointer &ptr = *finishable_i; + + // + // finish and advance downstream + // + m_scores.finishNode(ptr, time); + time++; + + // + // if there's more than one downstream node then add to the pointer list. + // but add next to this one so stable-ish ordering is maintained. + // + NodeSequence advance_nodes; + EdgeSequence down_edges = m_graph->downstreamEdges(ptr.node()); + + // for each downstream edge... + for ( EdgeSequenceIterator de_i = down_edges.begin(); de_i != down_edges.end(); ++de_i ) + { + Edge *down_edge = *de_i; + NodeSequence down_nodes = m_graph->downstreamNodes(down_edge); + + // make sure any downstream dangling (no output nodes) edges get finished + m_scores.evaluateEdgeScore(time, down_edge); + + // for each downstream node on the (multi-)edge... + for ( size_t ni = 0, NI = down_nodes.size(); ni != NI; ++ni ) { + Node *down_node = down_nodes[ni]; + + // add the nodes to the list only once... + if ( advance_nodes.end() == std::find(advance_nodes.begin(), advance_nodes.end(), down_node) ) + { + advance_nodes.push_back(down_node); + } + } + } + + if ( advance_nodes.size() ) + { +#if 0 + gLogInfo << "\tadvance nodes:"; + for ( size_t ai = 0, AI = advance_nodes.size(); ai != AI; ++ai ) { + gLogInfo << "[" << advance_nodes[ai]->id() << "] "; + } + gLogInfo << std::endl; +#endif + + // + // the first of these can be followed by our current pointer. the rest should be inserted. + // do the insertion in reverse so we can just use finishable_i as the insertion point. + // + int new_pointers = advance_nodes.size(); + typename std::list>::iterator insertion_point = ++finishable_i; + + for ( int new_pointer_i = new_pointers - 1; new_pointer_i > 0; --new_pointer_i ) + { + pointer_list.insert( insertion_point, GraphTraversalPointer(m_graph, advance_nodes[new_pointer_i] ) ); + } + ptr.setNode(advance_nodes[0]); // we'll reevaluate next time through... + } + +#if 0 + gLogInfo << "\t ptr list: "; + for ( typename std::list>::iterator ai = pointer_list.begin(); ai != pointer_list.end(); ++ai ) + { + gLogInfo << "[" << ai->node()->id() << "] "; + } + gLogInfo << std::endl; +#endif + } // while path pointers exist + + + sort(); + + fail: + return e; + + } + +protected: + NodeScoresIterator nodeScoreBegin() { return m_scores.nodeBegin(); } + NodeScoresIterator nodeScoreEnd() { return m_scores.nodeEnd(); } + + EdgeScoresIterator edgeScoreBegin() { return m_scores.edgeBegin(); } + EdgeScoresIterator edgeScoreEnd() { return m_scores.edgeEnd(); } + + ElemScoresIterator elemScoreBegin() { return m_scores.elemBegin(); } + ElemScoresIterator elemScoreEnd() { return m_scores.elemEnd(); } + +public: + + virtual void clear() + { + m_node_score_order.clear(); + m_edge_score_order.clear(); + m_elem_score_order.clear(); + m_scores.clear(); + } + + +protected: + G *m_graph; + GraphScoreboard m_scores; + std::vector m_node_score_order; + std::vector m_edge_score_order; + std::vector m_elem_score_order; + + struct ElemScoreSorter + { + ElemScoreSorter(GraphScoreboard &scores) : m_use_scores(scores) { } + bool operator() (ElemScoresIterator i, ElemScoresIterator j) + { + NvDlaError e = NvDlaSuccess; + + bool i_lt_j = i->second < j->second; + bool i_eq_j = i->second == j->second; + + if ( !i->first.first == !i->first.second ) + { + THROW_ERROR(NvDlaError_InvalidState, "invalid element"); + } + + if ( i_eq_j ) + { + // gLogInfo << "type tie-breaker elem i [" << (i->first.first?"node: ":"edge: ") << i->second.toString() << "] < j[" << + // (j->first.first?"node: ":"edge: ") << j->second.toString() << "] = " << i_lt_j << std::endl; + + // nodes before edges if otherwise equal + if ( i->first.first && j->first.second ) + { + i_lt_j = true; + } + else if ( i->first.second && j->first.first ) + { + i_lt_j = false; + // i_eq_j = false; + } + } + // gLogInfo << "elem i [" << (i->first.first?"node: ":"edge: ") << i->second.toString() << "] < j[" << + // (j->first.first?"node: ":"edge: ") << j->second.toString() << "] = " << i_lt_j << std::endl; + + return i_lt_j; + } + GraphScoreboard &m_use_scores; + }; + + struct NodeScoreSorter + { + NodeScoreSorter(GraphScoreboard &scores) : m_use_scores(scores) { } + bool operator() (NodeScoresIterator i, NodeScoresIterator j) + { + bool i_lt_j = i->second < j->second; + // gLogInfo << "node i [" << i->second.toString() << "] < j[" << j->second.toString() << "] = " << i_lt_j << std::endl; + return i_lt_j; + } + GraphScoreboard &m_use_scores; + }; + + struct EdgeScoreSorter + { + EdgeScoreSorter(GraphScoreboard &scores) : m_use_scores(scores) { } + bool operator() (EdgeScoresIterator i, EdgeScoresIterator j) + { + bool i_lt_j = i->second < j->second; + // gLogInfo << "edge i [" << i->second.toString() << "] < j[" << j->second.toString() << "] = " << i_lt_j << std::endl; + return i_lt_j; + } + GraphScoreboard &m_use_scores; + }; + + void sort() + { + NodeScoreSorter node_score_sorter(m_scores); + EdgeScoreSorter edge_score_sorter(m_scores); + ElemScoreSorter elem_score_sorter(m_scores); + + m_node_score_order.clear(); + m_edge_score_order.clear(); + m_elem_score_order.clear(); + + NodeScoresIterator node_score_i; + EdgeScoresIterator edge_score_i; + ElemScoresIterator elem_score_i; + + // gLogInfo << "sorting graph" << std::endl; + + for ( node_score_i = m_scores.nodeBegin(); node_score_i != m_scores.nodeEnd(); ++node_score_i ) { + m_node_score_order.push_back(node_score_i); + } + + for ( edge_score_i = m_scores.edgeBegin(); edge_score_i != m_scores.edgeEnd(); ++edge_score_i ) { + m_edge_score_order.push_back(edge_score_i); + } + + for ( elem_score_i = m_scores.elemBegin(); elem_score_i != m_scores.elemEnd(); ++elem_score_i ) { + m_elem_score_order.push_back(elem_score_i); + } + + std::sort(m_node_score_order.begin(), m_node_score_order.end(), node_score_sorter); + std::sort(m_edge_score_order.begin(), m_edge_score_order.end(), edge_score_sorter); + std::sort(m_elem_score_order.begin(), m_elem_score_order.end(), elem_score_sorter); + +#if 0 + gLogInfo << "m_node_order" << &m_node_order << std::endl; + for ( node_score_i = m_node_order.begin(); node_score_i != m_node_order.end(); ++node_score_i ) { + gLogInfo << "\t\tsc=[" << node_score_i->second.toString() << "]" << std::endl; + } +#endif + + } +}; + +#if 0 +template +class StaticGraphOrdering : public GraphOrdering +{ +public: + StaticGraphOrdering(GraphOrdering *from) : GraphOrdering(from->graph()) + { + m_node_order = from->nodeOrder(); + m_edge_order = from->edgeOrder(); + m_elem_order = from->elemOrder(); + } + + StaticGraphOrdering(ScoredGraphOrdering *from) : GraphOrdering(from->graph()) + { + const std::vector::ElemScoresIterator> &elemScoreOrder = from->elemScoreOrder(); + for ( size_t i = 0; i < elemScoreOrder.size(); ++i ) + { + NvDlaError e = NvDlaSuccess; + Elem elem = elemScoreOrder[i]->first; + ScoredGraphOrdering::Score s = elemScoreOrder[i]->second; + m_elemOrder.push_back(elem); + + if ( !elem.first == !elem.second ) + { + ORIGINATE_ERROR_FAIL(NvDlaError_InvalidState, "illegal element"); + } + + if ( elem.first ) { + m_nodeOrder.push_back(elem.first); + } + else if ( elem.second ) + { + m_edgeOrder.push_back(elem.second); + } + } + fail: + return e; + + } + + virtual ~StaticGraphOrdering() { } + + virtual NvDlaError generate() + { + NvDlaError e = NvDlaSuccess; + ORIGINATE_ERROR_FAIL(NvDlaError_InvalidState, "tried to (re)generate a static graph ordering"); + fail: + return e; + } + +}; +#endif + +template +class GraphVisitor +{ +public: + typedef typename G::Node Node; + typedef typename G::Edge Edge; + typedef typename G::Elem Elem; + typedef typename G::NodeSequence NodeSequence; + typedef typename G::EdgeSequence EdgeSequence; + typedef typename G::ElemSequence ElemSequence; + typedef typename G::NodeSequenceIterator NodeSequenceIterator; + typedef typename G::EdgeSequenceIterator EdgeSequenceIterator; + typedef typename G::ElemSequenceIterator ElemSequenceIterator; + + GraphVisitor() { } + virtual ~GraphVisitor() { } + + // note on pure virtual vs. override: i'd prefer to define these and override, + // but the override keyword doesn't show up until c++11. + // since we're targetting c++03/08 for misra compliance, and to avoid + // silently getting the signatures wrong, force pure virtual. + virtual NvDlaError visitBegin(G *) = 0; // { return NvDlaSuccess; } + virtual NvDlaError visitEnd(G *, NvDlaError ve) = 0; // { return ve; } + virtual NvDlaError visitNode(Node *) = 0; // { return NvDlaSuccess; } + virtual NvDlaError visitEdge(Edge *) = 0; // { return NvDlaSuccess; } + virtual NvDlaError visitElem(Elem) = 0; // { return NvDlaSuccess; } + + NvDlaError visitNodes(GraphOrdering *order) + { + NvDlaError e = NvDlaSuccess; + NodeSequenceIterator node_score_i, node_score_end; + const NodeSequence &nodeOrder = order->nodeOrder(); + PROPAGATE_ERROR_FAIL( visitBegin(order->graph()) ); + for ( size_t i = 0; i < nodeOrder.size(); ++i ) { PROPAGATE_ERROR_FAIL( visitNode(nodeOrder[i]) ); } + fail: + e = visitEnd(order->graph(), e); + return e; + } + + NvDlaError visitNodes(const NodeSequence &nodeOrder) + { + NvDlaError e = NvDlaSuccess; + if (!nodeOrder.size()) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter, "visiting an empty node sequence."); + } + PROPAGATE_ERROR_FAIL( visitBegin(nodeOrder[0]->graph()) ); + for ( size_t i = 0; i < nodeOrder.size(); ++i ) { PROPAGATE_ERROR_FAIL( visitNode(nodeOrder[i]) ); } + fail: + e = visitEnd(nodeOrder[0]->graph(), e); + return e; + } + + NvDlaError visitEdges(GraphOrdering *order) + { + NvDlaError e = NvDlaSuccess; + EdgeSequenceIterator edge_score_i, edge_score_end; + const EdgeSequence &edgeOrder = order->edgeOrder(); + PROPAGATE_ERROR_FAIL( visitBegin(order->graph()) ); + for ( size_t i = 0; i < edgeOrder.size(); ++i ) { PROPAGATE_ERROR_FAIL( visitEdge(edgeOrder[i]) ); } + fail: + e = visitEnd(order->graph(), e); + return e; + } + + NvDlaError visitElems(GraphOrdering *order) + { + NvDlaError e = NvDlaSuccess; + ElemSequenceIterator elem_score_i, elem_score_end; + const ElemSequence &elemOrder = order->elemOrder(); + PROPAGATE_ERROR_FAIL( visitBegin(order->graph()) ); + for ( size_t i = 0; i < elemOrder.size(); ++i ) { PROPAGATE_ERROR_FAIL( visitElem(elemOrder[i]) ); } + fail: + e = visitEnd(order->graph(), e); + return e; + } +}; + + +template +class ScoredGraphVisitor +{ +public: + typedef typename G::Node Node; + typedef typename G::Edge Edge; + typedef typename G::Elem Elem; + + typedef typename GraphScoreboard::Score Score; + typedef typename GraphScoreboard::NodeScores NodeScores; + typedef typename GraphScoreboard::EdgeScores EdgeScores; + typedef typename GraphScoreboard::ElemScores ElemScores; + typedef typename GraphScoreboard::NodeScoresIterator NodeScoresIterator; + typedef typename GraphScoreboard::EdgeScoresIterator EdgeScoresIterator; + typedef typename GraphScoreboard::ElemScoresIterator ElemScoresIterator; + + ScoredGraphVisitor() { } + virtual ~ScoredGraphVisitor() { } + + // note on pure virtual vs. override: i'd prefer to define these and 'override'. + // but the override keyword doesn't show up until c++11. + // since we're targetting c++03/08 for misra compliance and to avoid + // silently getting the signatures wrong force pure virtual. + virtual NvDlaError visitBegin(G *, GraphScoreboard< G > &) = 0; // { return NvDlaSuccess; } + virtual NvDlaError visitEnd(G *, GraphScoreboard< G > &, NvDlaError ve) = 0; // { return ve; } + virtual NvDlaError visitNode(Node *, Score) = 0; // { return NvDlaSuccess; } + virtual NvDlaError visitEdge(Edge *, Score) = 0; // { return NvDlaSuccess; } + virtual NvDlaError visitElem(Elem , Score) = 0; // { return NvDlaSuccess; } + + NvDlaError visitNodes(ScoredGraphOrdering *order) + { + NvDlaError e = NvDlaSuccess; + NodeScoresIterator node_score_i, node_score_end; + const std::vector &nodeOrder = order->nodeScoreOrder(); + PROPAGATE_ERROR_FAIL( visitBegin(order->graph(), order->scores()) ); + for ( size_t i = 0; i < nodeOrder.size(); ++i ) { PROPAGATE_ERROR_FAIL( visitNode(nodeOrder[i]->first, nodeOrder[i]->second) ); } + fail: + e = visitEnd(order->graph(), order->scores(), e); + return e; + } + + NvDlaError visitEdges(ScoredGraphOrdering *order) + { + NvDlaError e = NvDlaSuccess; + EdgeScoresIterator edge_score_i, edge_score_end; + const std::vector &edgeOrder = order->edgeScoreOrder(); + PROPAGATE_ERROR_FAIL( visitBegin(order->graph(), order->scores()) ); + for ( size_t i = 0; i < edgeOrder.size(); ++i ) { PROPAGATE_ERROR_FAIL( visitEdge(edgeOrder[i]->first, edgeOrder[i]->second) ); } + fail: + e = visitEnd(order->graph(), order->scores(), e); + return e; + } + + NvDlaError visitElems(ScoredGraphOrdering *order) + { + NvDlaError e = NvDlaSuccess; + ElemScoresIterator elem_score_i, elem_score_end; + const std::vector &elemOrder = order->elemScoreOrder(); + PROPAGATE_ERROR_FAIL( visitBegin(order->graph(), order->scores()) ); + for ( size_t i = 0; i < elemOrder.size(); ++i ) { PROPAGATE_ERROR_FAIL( visitElem(elemOrder[i]->first, elemOrder[i]->second) ); } + fail: + e = visitEnd(order->graph(), order->scores(), e); + return e; + } +}; + + +template +class Graph +{ +public: + typedef ast::Graph GraphBase; + typedef NodeClass Node; + typedef EdgeClass Edge; + typedef std::pair Elem; + typedef std::vector< Node *> NodeSequence; + typedef std::vector< Edge *> EdgeSequence; + typedef std::vector< Elem > ElemSequence; + typedef typename std::vector< Node *>::iterator NodeSequenceIterator; + typedef typename std::vector< Edge *>::iterator EdgeSequenceIterator; + typedef typename std::vector< Elem >::iterator ElemSequenceIterator; + struct nodeCompareFn + { + bool operator() (const Node* lhs, const Node* rhs) const + { + bool ret = false; + if (lhs && rhs) + ret = lhs->uniqueId() < rhs->uniqueId(); + else if (!lhs) + ret = true; + else + ret = false; + return ret; + } + }; + + struct edgeCompareFn + { + bool operator() (const Edge* lhs, const Edge* rhs) const + { + bool ret = false; + if (lhs && rhs) + ret = lhs->uniqueId() < rhs->uniqueId(); + else if (!lhs) + ret = true; + else + ret = false; + return ret; + } + }; + + struct elemCompareFn + { + bool operator() (const Elem& lhs, const Elem& rhs) const + { + bool ret = false; + if (lhs.first && rhs.first) + ret = lhs.first->uniqueId() < rhs.first->uniqueId(); + else if (lhs.second && rhs.second) + ret = lhs.second->uniqueId() < rhs.second->uniqueId(); + else if (!lhs.first && rhs.first) + ret = true; + else if (!lhs.second && rhs.second) + ret = true; + else + ret = false; + return ret; + } + }; + + typedef std::set NodeSet; + typedef std::set EdgeSet; + typedef std::set ElemSet; + typedef typename NodeSet::iterator NodeSetIterator; + typedef typename EdgeSet::iterator EdgeSetIterator; + typedef typename ElemSet::iterator ElemSetIterator; + + typedef std::unordered_set NodeUnorderedSet; + typedef typename NodeUnorderedSet::iterator NodeUnorderedSetIterator; + + Graph() : m_dirty(false) { } + virtual ~Graph() { } + + virtual Graph *clone() { return new Graph(*this); } + + // any operation which changes the graph will markDirty. + // client(s) are in charge of noticing this and marking + // clean after they've taken consideration of the new + // state. + bool dirty() const { return m_dirty; } + virtual void markDirty() { m_dirty = true; } + virtual void markClean() { m_dirty = false; } + + // unsorted/ordered graph elements + const NodeSet & nodes() const { return m_nodes; } + const EdgeSet & edges() const { return m_edges; } + + // top level graph inputs, outputs + const EdgeSequence &inputEdges() const { return m_input_edges; } + const EdgeSequence &outputEdges() const { return m_output_edges; } + + Edge* outputEdge(size_t id) { return (id < m_output_edges.size()) ? m_output_edges[id] : 0; } + Edge* inputEdge (size_t id) { return (id < m_input_edges.size()) ? m_input_edges[id] : 0; } + + void setInputEdges (const EdgeSequence &input) { m_input_edges = input; } + void setOutputEdges(const EdgeSequence &output) { m_output_edges = output; } + + size_t numNodes() + { + return m_nodes.size(); + } + + size_t numEdges() + { + return m_edges.size(); + } + + virtual bool insertNode(Node *n) + { + NodeSetIterator f = m_nodes.find(n); + if ( f != m_nodes.end() ) + { + return false; + } + m_nodes.insert(n); + + markDirty(); + return true; + } + + virtual bool removeNode(Node *node) + { + bool found = false; + NodeAttr *node_attr; + + NodeSetIterator f = m_nodes.find(node); + EdgeSequenceIterator begin, end; + if ( f == m_nodes.end() ) + { + found = false; + goto done; + } + + node_attr = lookupNodeAttr(node); + + found = true; + + if ( !node_attr ) + { + goto done_dirty; + } + for (EdgeSide::underlying_type esi = EdgeSideEnum::FIRST, ESI = EdgeSideEnum::SECOND; esi <= ESI; ++esi ) + { + begin = node_attr->m_edges[esi].begin(); + end = node_attr->m_edges[esi].end(); + for (EdgeSequenceIterator ei = begin; ei != end; ++ei) + { + EdgeAttr *edge_attr = lookupEdgeAttr(*ei); + if ( edge_attr ) + { + removeNodeFromEdge_Internal(edge_attr, node, EdgeSideEnum(esi)); + } + } + } + + m_node_attr_map.erase(node); + + done_dirty: + m_nodes.erase(node); + markDirty(); + + done: + return found; + } + + virtual bool insertEdge(Edge *edge) + { + EdgeSetIterator f = m_edges.find(edge); + if ( f != m_edges.end() ) + { + return false; + } + m_edges.insert(edge); + markDirty(); + + return true; + } + + virtual bool removeEdge(Edge *edge) + { + EdgeSetIterator f = m_edges.find(edge); + if ( f == m_edges.end() ) + { + return false; + } + m_edges.erase(edge); + + markDirty(); + + return true; + + } + + // any previously associated nodes with the edge are cleared. + bool setEdgeNodes(Edge *edge, + const NodeSequence &first_nodes, + const NodeSequence &second_nodes) + { + bool ok = false; + Node *node; + NodeAttr *node_attr; + EdgeSide::underlying_type edge_side; + EdgeAttr *edge_attr = fetchEdgeAttr(edge); + + if ( !edge_attr ) + { + // catch something elswhere... oom failure. + gLogError << "no edge attr?!?!"; + goto done; + } + + // detach if previously set + for ( edge_side = EdgeSideEnum::FIRST; edge_side <= EdgeSideEnum::SECOND; ++edge_side ) + { + for ( size_t ni = 0, NI = edge_attr->m_nodes[edge_side].size(); ni < NI; ++ni) + { + node = edge_attr->m_nodes[edge_side][ni]; + node_attr = lookupNodeAttr(node); + if ( !node_attr ) + { + continue; // must not have been property attached? not fatal but weird + // maybe throw logic error? + } + removeEdgeFromNode_Internal(node_attr, edge, edge_side); + } + } + + // now attach + for ( size_t ni = 0, NI = first_nodes.size(); ni < NI; ++ni ) + { + node = first_nodes[ni]; + node_attr = fetchNodeAttr(node); + if ( !node_attr ) + { + // catch oom elsewhere. + goto done; + } + appendEdgeToNode_Internal(node_attr, edge, EdgeSideEnum::FIRST); + } + + for ( size_t ni = 0, NI = second_nodes.size(); ni < NI; ++ni ) + { + node = second_nodes[ni]; + node_attr = fetchNodeAttr(node); + if ( !node_attr ) + { + // catch oom elsewhere. + goto done; + } + appendEdgeToNode_Internal(node_attr, edge, EdgeSideEnum::SECOND); + } + + // tbd: there's an optimization to be had above + // when the set is a simple append or erase of a small subset + + edge_attr->m_nodes[EdgeSideEnum::FIRST] = first_nodes; + edge_attr->m_nodes[EdgeSideEnum::SECOND] = second_nodes; + + markDirty(); + + done: + return ok; + } + + bool adjacentNodes(Node *n1, Node *n2) + { + bool res = false; + NodeAttr *n1_attr = fetchNodeAttr(n1); + NodeAttr *n2_attr = fetchNodeAttr(n2); + + EdgeSequence n1_input_edges = n1_attr->m_edges[EdgeSideEnum::SECOND]; + EdgeSequence n1_output_edges = n1_attr->m_edges[EdgeSideEnum::FIRST]; + EdgeSequence n2_input_edges = n2_attr->m_edges[EdgeSideEnum::SECOND]; + EdgeSequence n2_output_edges = n2_attr->m_edges[EdgeSideEnum::FIRST]; + + if (!n1_attr || !n2_attr) + { + goto done; + } + + for (EdgeSequenceIterator n1ie = n1_input_edges.begin(); n1ie != n1_input_edges.end(); ++n1ie) + { + if (std::find(n2_output_edges.begin(), n2_output_edges.end(), *n1ie) != n2_output_edges.end()) + { + res = true; + goto done; + } + } + + for (EdgeSequenceIterator n1oe = n1_output_edges.begin(); n1oe != n1_output_edges.end(); ++n1oe) + { + if (std::find(n2_input_edges.begin(), n2_input_edges.end(), *n1oe) != n2_input_edges.end()) + { + res = true; + goto done; + } + } + + for (EdgeSequenceIterator n2ie = n2_input_edges.begin(); n2ie != n2_input_edges.end(); ++n2ie) + { + if (std::find(n1_output_edges.begin(), n1_output_edges.end(), *n2ie) != n1_output_edges.end()) + { + res = true; + goto done; + } + } + + for (EdgeSequenceIterator n2oe = n2_output_edges.begin(); n2oe != n2_output_edges.end(); ++n2oe) + { + if (std::find(n1_input_edges.begin(), n1_input_edges.end(), *n2oe) != n1_input_edges.end()) + { + res = true; + goto done; + } + } + done: + return res; + } + + NodeSequence edgeNodes(const Edge *edge, EdgeSide side) + { + NodeSequence r; + EdgeAttr *edge_attr = fetchEdgeAttr(edge); + if ( !edge_attr ) + { + return r; + } + if ( side.e() == EdgeSideEnum::BOTH ) + { + return r; + } + return edge_attr->m_nodes[side.v()]; + } + + size_t numEdgeNodes(const Edge *edge, EdgeSide side) const + { + size_t r = 0; + EdgeAttr *edge_attr = lookupEdgeAttr(edge); + if ( !edge_attr ) + { + return 0; + } + if (side.e() == EdgeSideEnum::BOTH) + { + r = edge_attr->m_nodes[EdgeSideEnum::FIRST].size() + + edge_attr->m_nodes[EdgeSideEnum::SECOND].size(); + } + else + { + r = edge_attr->m_nodes[side.v()].size(); + } + return r; + } + + + + virtual bool appendNodeToEdge(Edge *edge, EdgeSide side, Node *node) + { + EdgeAttr *edge_attr = fetchEdgeAttr(edge); + NodeAttr *node_attr = fetchNodeAttr(node); + if ( ! (edge_attr && node_attr) ) + { + // catch oom elsewhere + gLogError << "ugh, oom failed" << std::endl; + return false; + } + if ( side.e() == EdgeSideEnum::BOTH ) + { + appendNodeToEdge_Internal(edge_attr, node, EdgeSideEnum::FIRST); + appendNodeToEdge_Internal(edge_attr, node, EdgeSideEnum::SECOND); + + appendEdgeToNode_Internal(node_attr, edge, EdgeSideEnum::FIRST); + appendEdgeToNode_Internal(node_attr, edge, EdgeSideEnum::SECOND); + } + else + { + appendNodeToEdge_Internal(edge_attr, node, side.v()); + + appendEdgeToNode_Internal(node_attr, edge, side.v()); + } + + markDirty(); + + return true; + } + + virtual bool removeNodeFromEdge(Edge *edge, EdgeSide side, Node *node) + { + EdgeAttr *edge_attr = fetchEdgeAttr(edge); + if( !edge_attr ) + { + return false; + } + if ( side.e() == EdgeSideEnum::BOTH ) + { + removeNodeFromEdge_Internal(edge_attr, node, EdgeSideEnum::FIRST); + removeNodeFromEdge_Internal(edge_attr, node, EdgeSideEnum::SECOND); + } + else + { + removeNodeFromEdge_Internal(edge_attr, node, side.v()); + } + + markDirty(); + + return true; + } + + virtual bool removeEdgeFromNode(Edge *edge, EdgeSide side, Node *node) + { + NodeAttr *node_attr = lookupNodeAttr(node); + if ( !node_attr ) + { + return false; + } + if ( side.e() == EdgeSideEnum::BOTH ) + { + gLogError << __func__ << " side can't be BOTH " << std::endl; + return false; + } + else + { + removeEdgeFromNode_Internal(node_attr, edge, side.v()); + } + + markDirty(); + + return true; + } + + EdgeSequence nodeEdges(const Node *_node, EdgeSide side) + { + Node *node = const_cast(_node); // no changes... + NodeAttr *node_attr = lookupNodeAttr(node); + EdgeSequence all_edges; + if ( !node_attr) + { + return EdgeSequence(); + } + if (side.e() == EdgeSideEnum::BOTH) + { + all_edges.reserve(node_attr->m_edges[EdgeSideEnum::FIRST].size() + + node_attr->m_edges[EdgeSideEnum::SECOND].size()); + all_edges.insert(all_edges.end(), node_attr->m_edges[EdgeSideEnum::FIRST].begin(), + node_attr->m_edges[EdgeSideEnum::FIRST].end()); + all_edges.insert(all_edges.end(), node_attr->m_edges[EdgeSideEnum::SECOND].begin(), + node_attr->m_edges[EdgeSideEnum::SECOND].end()); + } + else if (side.e() == EdgeSideEnum::FIRST) + { + all_edges.reserve(node_attr->m_edges[EdgeSideEnum::FIRST].size()); + all_edges.insert(all_edges.end(), node_attr->m_edges[EdgeSideEnum::FIRST].begin(), + node_attr->m_edges[EdgeSideEnum::FIRST].end()); + } + else if (side.e() == EdgeSideEnum::SECOND) + { + all_edges.reserve(node_attr->m_edges[EdgeSideEnum::SECOND].size()); + all_edges.insert(all_edges.end(), node_attr->m_edges[EdgeSideEnum::SECOND].begin(), + node_attr->m_edges[EdgeSideEnum::SECOND].end()); + } + return all_edges; + } + + size_t numNodeEdges(const Node *node, EdgeSide side) + { + size_t r = 0; + NodeAttr *node_attr = lookupNodeAttr(node); + if ( !node_attr ) + { + return 0; + } + if (side.e() == EdgeSideEnum::BOTH) + { + r = node_attr->m_edges[EdgeSideEnum::FIRST].size() + + node_attr->m_edges[EdgeSideEnum::SECOND].size(); + } + else + { + r = node_attr->m_edges[side.v()].size(); + } + return r; + } + + NodeSequence upstreamNodes(const Edge *edge) + { + return edgeNodes(edge, EdgeSideEnum::FIRST); + } + + NodeSequence downstreamNodes(const Edge *edge) + { + return edgeNodes(edge, EdgeSideEnum::SECOND); + } + + EdgeSequence upstreamEdges(const Node *node) + { + return nodeEdges(node, ast::EdgeSideEnum::SECOND); + } + + EdgeSequence downstreamEdges(const Node *node) + { + return nodeEdges(node, ast::EdgeSideEnum::FIRST); + } + + std::vector upstreamNodes(const NodeClass *node) + { + std::unordered_set unodes; // used to guarantee uniqueness + std::vector allUpstreamNodes = std::vector(); + std::vector upstrmEdges = upstreamEdges(node); + + for (typename std::vector::iterator uei = upstrmEdges.begin(); uei != upstrmEdges.end(); ++uei) + { + std::vector upstrmNodes = upstreamNodes(*uei); + for ( size_t uni = 0, UNI = upstrmNodes.size(); uni != UNI; ++uni) + { + std::pair< typename std::unordered_set::iterator, bool> r; + NodeClass *un = upstrmNodes[uni]; + r = unodes.insert(un); + if ( r.second == true ) + { + allUpstreamNodes.push_back(un); + } + } + } + return allUpstreamNodes; + } + + std::vector downstreamNodes(const NodeClass *node) + { + std::unordered_set dnodes; // used to guarantee uniqueness + std::vector allDownstreamNodes; + std::vector downstrmEdges = downstreamEdges(node); + + for (typename std::vector::iterator dei = downstrmEdges.begin(); dei != downstrmEdges.end(); ++dei) + { + std::vector downstrmNodes = downstreamNodes(*dei); + for ( size_t dni = 0, DNI = downstrmNodes.size(); dni != DNI; ++dni ) + { + std::pair< typename std::unordered_set::iterator , bool> r; + NodeClass *dn = downstrmNodes[dni]; + r = dnodes.insert(dn); + if ( r.second == true ) + { + allDownstreamNodes.push_back(dn); + } + } + } + return allDownstreamNodes; + } + +protected: + // + // use of set is nice here because adding/subtracting is free-ish. + // below we'll use these as attribute map keys. + // + NodeSet m_nodes; + EdgeSet m_edges; + + EdgeSequence m_input_edges; + EdgeSequence m_output_edges; + + // we only set/clear here but mark and clean + // are virtual hooks for more interesting derived behavior. + bool m_dirty; + + // + // here we maintain an associative mapping to connectivity and + // element attribute information. + // + struct NodeAttr + { + EdgeSequence m_edges[2]; // for each side, ordered, small-ish, static-ish + NodeAttr() { + m_edges[0].reserve(1); + m_edges[1].reserve(1); + } + }; + + struct EdgeAttr + { + NodeSequence m_nodes[2]; // one for each side, ordered, small-ish, static-ish + EdgeAttr() { + m_nodes[0].reserve(1); + m_nodes[1].reserve(1); + } + }; + + typedef std::unordered_map NodeAttrMap; + typedef std::unordered_map EdgeAttrMap; + + NodeAttrMap m_node_attr_map; + EdgeAttrMap m_edge_attr_map; + + inline EdgeAttr *lookupEdgeAttr(const Edge *edge) + { + typename EdgeAttrMap::iterator f = m_edge_attr_map.find(edge); + if ( f == m_edge_attr_map.end() ) + { + return 0; + } + return &f->second; + } + + inline NodeAttr *lookupNodeAttr(Node *node) + { + typename NodeAttrMap::iterator f = m_node_attr_map.find(node); + if ( f == m_node_attr_map.end() ) + { + return 0; + } + return &f->second; + } + + // + // fetch := find || (alloc && insert) (assuming when input is != 0) + // + EdgeAttr *fetchEdgeAttr(const Edge *edge) + { + typename EdgeAttrMap::iterator f; + EdgeAttr *ret_attr = 0; + if ( !edge ) + { + goto done; + } + ret_attr = lookupEdgeAttr(edge); + if ( !ret_attr ) + { + m_edge_attr_map[edge] = EdgeAttr(); + ret_attr = &m_edge_attr_map[edge]; + } + done: + return ret_attr; + } + NodeAttr *fetchNodeAttr(Node *node) + { + typename NodeAttrMap::iterator f; + NodeAttr *ret_attr = 0; + if ( !node ) + { + goto done; + } + ret_attr = lookupNodeAttr(node); + if ( !ret_attr ) + { + m_node_attr_map[node] = NodeAttr(); + ret_attr = &m_node_attr_map[node]; + } + done: + return ret_attr; + } + + + void appendEdgeToNode_Internal(NodeAttr *n_attr, Edge *edge, size_t side) + { + EdgeSequenceIterator + f, begin = n_attr->m_edges[side].begin(), end = n_attr->m_edges[side].end(); + + f = std::find( begin, end, edge ); + if ( f == end ) + { + n_attr->m_edges[side].push_back(edge); + if (n_attr->m_edges[side].size() > 1) + { + std::sort(n_attr->m_edges[side].begin(), n_attr->m_edges[side].end(), edgeCompareFn()); + } + } + } + + void appendNodeToEdge_Internal(EdgeAttr *e_attr, Node *node, size_t side) + { + NodeSequenceIterator + f, begin = e_attr->m_nodes[side].begin(), end = e_attr->m_nodes[side].end(); + + f = std::find( begin, end, node ); + if ( f == end ) + { + e_attr->m_nodes[side].push_back(node); + if (e_attr->m_nodes[side].size() > 1) + { + std::sort(e_attr->m_nodes[side].begin(), e_attr->m_nodes[side].end(), nodeCompareFn()); + } + } + } + + void removeEdgeFromNode_Internal(NodeAttr *n_attr, Edge *edge, size_t side) + { + EdgeSequence new_edges; + EdgeSequenceIterator + f, begin = n_attr->m_edges[side].begin(), end = n_attr->m_edges[side].end(); + for ( f = begin; f != end; ++f ) + { + // lose reference to the sought after edge, don't delete it + if ( *f != edge ) + { + new_edges.push_back(*f); + } + } + n_attr->m_edges[side] = new_edges; + } + + void removeNodeFromEdge_Internal(EdgeAttr *e_attr, Node *node, size_t side) + { + NodeSequence new_nodes; + NodeSequenceIterator + f, begin = e_attr->m_nodes[side].begin(), end = e_attr->m_nodes[side].end(); + for ( f = begin; f != end; ++f ) + { + if ( *f != node ) + { + new_nodes.push_back(*f); + } + } + e_attr->m_nodes[side] = new_nodes; + } +}; + + + +template +class GraphMap +{ +public: + GraphMap() : m_gl(0), m_gr(0) {} + GraphMap(GraphL *l, GraphR *r) : m_gl(l), m_gr(r) {} + + virtual ~GraphMap() { } + + GraphL *graphL() { return m_gl; } + void setGraphL(GraphL *l) { clear(); m_gl = l; } + GraphR *graphR() { return m_gr; } + void setGraphR(GraphR *r) { clear(); m_gr = r; } + + typedef typename GraphL::node_class_t l_node_t; + typedef typename GraphL::edge_class_t l_edge_t; + + typedef typename GraphR::node_class_t r_node_t; + typedef typename GraphR::edge_class_t r_edge_t; + + typedef std::map> lr_node_map_t; + typedef std::map> rl_node_map_t; + typedef std::map> lr_edge_map_t; + typedef std::map> rl_edge_map_t; + + void clear() { + m_lr_node_map.clear(); + m_rl_node_map.clear(); + m_lr_edge_map.clear(); + m_rl_edge_map.clear(); + } + + void insertNodeL(const l_node_t *l_node, std::vector r_nodes) { + m_lr_node_map[l_node] = r_nodes; + } + + void insertEdgeL(const l_edge_t *l_edge, std::vector r_edges) { + m_lr_edge_map[l_edge] = r_edges; + } + + void insertNodeR(const r_node_t *r_node, std::vector l_nodes) { + m_rl_node_map[r_node] = l_nodes; + } + + void insertEdgeR(const r_edge_t *r_edge, std::vector l_edges) { + m_rl_edge_map[r_edge] = l_edges; + } + +protected: + GraphL *m_gl; + GraphR *m_gr; + + lr_node_map_t m_lr_node_map; + rl_node_map_t m_rl_node_map; + lr_edge_map_t m_lr_edge_map; + rl_edge_map_t m_rl_edge_map; + +}; + + + +// some might not make sense in all contexts +enum PrettyIdFlags +{ + PrettyId_None = 0U, + PrettyId_Id = 1U, + PrettyId_ClassName = 2U, + PrettyId_Name = 4U, + PrettyId_Type = 8U, + PrettyId_Default = 0xFU, + PrettyId_Verbose = 0x10U, + PrettyId_All = 0xFFU +}; + + + + +} // nvdla::priv::ast +} // nvdla::priv +} // nvdla + +#endif diff --git a/umd/core/src/compiler/include/priv/ASTEnums.h b/umd/core/src/compiler/include/priv/ASTEnums.h new file mode 100644 index 00000000..6ab05623 --- /dev/null +++ b/umd/core/src/compiler/include/priv/ASTEnums.h @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#ifndef NVDLA_PRIV_AST_ENUMS_H +#define NVDLA_PRIV_AST_ENUMS_H + +#define AST_EDGE_DIRECTION_ENUMS(op) \ + op(UNDIRECTED, 0U) \ + op(DIRECTED, 1U) \ + op(BIDIRECTIONAL, 2U) + + +#define AST_EDGE_SIDE_ENUMS(op) \ + op(FIRST, 0U) \ + op(SECOND, 1U) \ + op(BOTH, 2U) + + +#endif // NVDLA_PRIV_AST_ENUMS_H + diff --git a/umd/core/src/compiler/include/priv/CanonicalAST.h b/umd/core/src/compiler/include/priv/CanonicalAST.h new file mode 100644 index 00000000..d5b1d8bd --- /dev/null +++ b/umd/core/src/compiler/include/priv/CanonicalAST.h @@ -0,0 +1,950 @@ +/* + * Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#ifndef NVDLA_PRIV_CANONICAL_AST_H +#define NVDLA_PRIV_CANONICAL_AST_H + +#include +#include +#include +#include + +#include "priv/AST.h" +#include "priv/CanonicalEnums.h" +#include "priv/Layer.h" +#include "priv/Type.h" // for misc + + +// +// provide explicit hash fn specialization for std::pair (Elem) +// +namespace nvdla { namespace priv { namespace canonical_ast { class Node; class Edge; } } } +namespace std +{ + template <> struct hash> + { + std::size_t operator()(const std::pair &v) const noexcept + { + std::size_t h; + // one side or the other will be non-zero. + if ( v.first ) + { + h = std::hash{}(v.first); + } + else + { + h = std::hash{}(v.second); + } + return h; + } + }; +} + +namespace nvdla +{ + +class ITensor; + +namespace priv +{ + +namespace canonical_ast +{ + +// +// The canonical parameter space which inherits parameters from the parsed network +// so that the UMD compiler has a unanimous interpretation of any network +// irrespective of which frameworks they come from. +// +// since compiler works with graphs/asts, this interface is called the +// canonical-ast-interface. +// + +class CanonicalParams +{ +public: + CanonicalParams() { } + virtual ~CanonicalParams() { } + + virtual bool hasBiasTerm() const; + virtual void setHasBiasTerm(bool); +}; + +class ConvolutionParams : public CanonicalParams +{ +public: + ConvolutionParams() : + m_bias_mode(BiasMode::bNONE), + m_has_bias_term(false), + m_padding_value(0), + m_num_groups(1) + { } + virtual ~ConvolutionParams() { } + + + nvdla::BiasMode biasMode() const { return m_bias_mode; } + void setBiasMode(nvdla::BiasMode mode) { m_bias_mode = mode; } + + Dims2 dilation() const { return m_dilation; } + void setDilation(Dims2 dilation) { m_dilation = dilation; } + + Dims2 stride() const { return m_stride; } + void setStride(Dims2 stride) { m_stride = stride; } + + Dims2 topLeftPadding() const { return m_TL_padding; } + void setTopLeftPadding(Dims2 tlPadding) { m_TL_padding = tlPadding; } + + Dims2 bottomRightPadding() const { return m_BR_padding; } + void setBottomRightPadding(Dims2 brPadding) { m_BR_padding = brPadding; } + + virtual bool hasBiasTerm() const { return m_has_bias_term; } + virtual void setHasBiasTerm(bool hasBiasTerm) { m_has_bias_term = hasBiasTerm; } + + NvU32 paddingValue() const { return m_padding_value; } + void setPaddingValue(NvU32 paddingValue) { m_padding_value = paddingValue; } + + const Dims4& biasDims() const { return m_bias_dims; } + void setBiasDims(const Dims4& bd) { m_bias_dims = bd; } + + const Dims4& weightDims() const { return m_weight_dims; } + void setWeightDims(const Dims4& kd) { m_weight_dims = kd; } + + const Weights& biasData() const { return m_bias_data; } + void setBiasData(const Weights& biasData) { m_bias_data = biasData; } + + const Weights& weights() const { return m_weights; } + void setWeights(const Weights& weights) { m_weights = weights; } + + NvU32 numGroups() const { return m_num_groups; } + void setNumGroups(NvU32 numGroups) { m_num_groups = numGroups; } + +protected: + BiasMode m_bias_mode; + bool m_has_bias_term; + Dims2 m_TL_padding; + Dims2 m_BR_padding; + Dims2 m_stride; + Dims2 m_dilation; + Dims4 m_bias_dims; + Dims4 m_weight_dims; + NvU32 m_padding_value; + Weights m_weights; + Weights m_bias_data; + NvU32 m_num_groups; +}; + +// innerproduct/fullyconnected +class FullyConnectedParams : public CanonicalParams +{ +public: + FullyConnectedParams() : + m_bias_mode(BiasMode::bNONE), + m_has_bias_term(false) + { } + virtual ~FullyConnectedParams() { } + + nvdla::BiasMode biasMode() const { return m_bias_mode; } + void setBiasMode(nvdla::BiasMode mode) { m_bias_mode = mode; } + + virtual bool hasBiasTerm() const { return m_has_bias_term; } + virtual void setHasBiasTerm(bool hasBiasTerm) { m_has_bias_term = hasBiasTerm; } + + const Dims4& weightDims() const { return m_weight_dims; } + void setWeightDims(const Dims4& weightDims) { m_weight_dims = weightDims; } + + const Weights& weights() const { return m_weights; } + void setWeights(const Weights& weights) { m_weights = weights; } + + const Dims4& biasDims() const { return m_bias_dims; } + void setBiasDims(const Dims4& biasDims) { m_bias_dims = biasDims; } + + const Weights& biasData() const { return m_bias_data; } + void setBiasData(const Weights& bias) { m_bias_data = bias; } + +protected: + BiasMode m_bias_mode; + bool m_has_bias_term; + Dims4 m_weight_dims; + Dims4 m_bias_dims; + Weights m_weights; + Weights m_bias_data; +}; + +// relu +// sigmoid +class ActivationParams : public CanonicalParams +{ +public: + ActivationParams() : + m_activation_type(ActivationType::kRELU) + { } + virtual ~ActivationParams() { } + + nvdla::ActivationType activationType() const { return m_activation_type; } + void setActivationType(nvdla::ActivationType activationType) { m_activation_type = activationType; } + +protected: + nvdla::ActivationType m_activation_type; +}; + +class PoolingParams : public CanonicalParams +{ +public: + PoolingParams() : + m_pool_type(PoolingType::kMAX) + { } + virtual ~PoolingParams() { } + + nvdla::PoolingType poolType() const { return m_pool_type; } + void setPoolType(nvdla::PoolingType poolType) { m_pool_type = poolType; } + + Dims2 kernelDims() const { return m_kernel_dims; } + void setKernelDims(Dims2 kernelDims) { m_kernel_dims = kernelDims; } + + Dims2 stride() const { return m_stride; } + void setStride(Dims2 stride) { m_stride = stride; } + + Dims2 topLeftPadding() const { return m_TL_padding; } + void setTopLeftPadding(Dims2 tlPadding) { m_TL_padding = tlPadding; } + + Dims2 bottomRightPadding() const { return m_BR_padding; } + void setBottomRightPadding(Dims2 brPadding) { m_BR_padding = brPadding; } + +protected: + nvdla::PoolingType m_pool_type; + Dims2 m_TL_padding; + Dims2 m_BR_padding; + Dims2 m_kernel_dims; + Dims2 m_stride; +}; + +class LRNParams : public CanonicalParams +{ +public: + LRNParams() : + m_local_size(5), + m_alpha(1.0f), + m_beta(0.75f), + m_k(1.0f) + { } + virtual ~LRNParams() { } + + NvF32 alpha() const { return m_alpha; } + void setAlpha(NvF32 alpha) { m_alpha = alpha; } + + NvF32 beta() const { return m_beta; } + void setBeta(NvF32 beta) { m_beta = beta; } + + NvF32 k() const { return m_k; } + void setK(NvF32 k) { m_k = k; } + + NvU32 localSize() const { return m_local_size; } + void setLocalSize(NvU32 localSize = 5) { m_local_size = localSize; } + +protected: + // these params are extracted from ditcaffe::LRNParameter + NvU32 m_local_size; //or window_size [def = 5] + NvF32 m_alpha; // [def = 1.0f] + NvF32 m_beta; // [def = 0.75f] + NvF32 m_k; // [def = 1.0f] + //TODO: NvU32 m_norm_region = 0; + //TODO: NvU32 m_engine = 0; +}; + +//scale layer +//power layer +class ScaleParams : public CanonicalParams +{ +public: + ScaleParams() : + m_mode(ScaleMode::sUNIFORM), + m_has_bias_term(false), + m_power(), + m_scale(), + m_shift() + { } + virtual ~ScaleParams() { } + + nvdla::ScaleMode mode() const { return m_mode; } + void setMode(nvdla::ScaleMode mode) { m_mode = mode; } + + const Weights power() const { return m_power; } + void setPower(const Weights power) { m_power = power; } + + const Weights scale() const { return m_scale; } + void setScale(const Weights scale) { m_scale = scale; } + + const Weights shift() const { return m_shift; } + void setShift(const Weights shift) { m_shift = shift; } + + const Dims4& powerDims() const { return m_power_dims; } + void setPowerDims(const Dims4& powerDims) { m_power_dims = powerDims; } + + const Dims4& scaleDims() const { return m_scale_dims; } + void setScaleDims(const Dims4& scaleDims) { m_scale_dims = scaleDims; } + + const Dims4& shiftDims() const { return m_shift_dims; } + void setShiftDims(const Dims4& shiftDims) { m_shift_dims = shiftDims; } + + virtual bool hasBiasTerm() const { return m_has_bias_term; } + virtual void setHasBiasTerm(bool hasBiasTerm) { m_has_bias_term = hasBiasTerm; } + +protected: + nvdla::ScaleMode m_mode; // [def = nvdla::kUNIFORM] + bool m_has_bias_term; + + // these params are extracted from ditcaffe::PowerParameter + Weights m_power; // [def = 1.0f] + Weights m_scale; // [def = 1.0f] + Weights m_shift; // [def = 0.0f] + + // extra params + Dims4 m_scale_dims; + Dims4 m_shift_dims; + Dims4 m_power_dims; +}; + +//batch norm layer +class BatchNormParams : public CanonicalParams +{ +public: + BatchNormParams() : + m_mode(BatchNormMode::bnUNIFORM), + m_epsilon(0.0f), + m_mean(), + m_variance() + { } + virtual ~BatchNormParams() { } + + nvdla::BatchNormMode mode() const { return m_mode; } + void setMode(nvdla::BatchNormMode mode) { m_mode = mode; } + + float epsilon() const { return m_epsilon; } + void setEpsilon(const float e) { m_epsilon = e; } + + const Weights mean() const { return m_mean; } + void setMean(const Weights mean) { m_mean = mean; } + + const Weights variance() const { return m_variance; } + void setVariance(const Weights variance) { m_variance = variance; } + + const Dims4& meanDims() const { return m_mean_dims; } + void setMeanDims(const Dims4& md) { m_mean_dims = md; } + + const Dims4& varianceDims() const { return m_variance_dims; } + void setVarianceDims(const Dims4& vd) { m_variance_dims = vd; } + +protected: + nvdla::BatchNormMode m_mode; // [def = nvdla::bUNIFORM] + Dims4 m_mean_dims; + Dims4 m_variance_dims; + float m_epsilon; + Weights m_mean; + Weights m_variance; +}; + +// softmax +// softmaxwithloss +class SoftMaxParams : public CanonicalParams +{ +public: + SoftMaxParams() : + m_engine(0), + m_axis(1) + { } + virtual ~SoftMaxParams() { } + +protected: + // these params are extracted from ditcaffe::SoftMaxParameter + NvU32 m_engine; + NvS32 m_axis; +}; + +class ConcatenationParams : public CanonicalParams +{ +public: + ConcatenationParams() : + m_axis(1), + m_concat_dim(1), + m_num_inputs(0) + { } + virtual ~ConcatenationParams() { } + + NvU32 numInputs() const { return m_num_inputs; } + void setNumInputs(NvU8 numInputs) { m_num_inputs = numInputs; } + +protected: + // these params are extracted from ditcaffe::ConcatParameter + NvS32 m_axis; + NvU32 m_concat_dim; // deprecated + NvU32 m_num_inputs; +}; + +class SplitParams : public CanonicalParams +{ +public: + SplitParams() : + m_axis(1), + m_num_outputs(0) + { } + virtual ~SplitParams() { } + + NvU32 numOutputs() const { return m_num_outputs; } + void setNumOutputs(NvU8 numOutputs) { m_num_outputs = numOutputs; } + +protected: + // these params are extracted from ditcaffe::SliceParameter + NvS32 m_axis; + NvU32 m_num_outputs; +}; + +class DeconvolutionParams : public CanonicalParams +{ +public: + DeconvolutionParams() : + m_bias_mode(BiasMode::bNONE), + m_has_bias_term(false), + m_padding_value(0), + m_num_groups(1) + { } + virtual ~DeconvolutionParams() { } + + nvdla::BiasMode biasMode() const { return m_bias_mode; } + void setBiasMode(nvdla::BiasMode mode) { m_bias_mode = mode; } + + Dims2 dilation() const { return m_dilation; } + void setDilation(Dims2 dilation) { m_dilation = dilation; } + + Dims2 stride() const { return m_stride; } + void setStride(Dims2 stride) { m_stride = stride; } + + Dims2 topLeftPadding() const { return m_TL_padding; } + void setTopLeftPadding(Dims2 tlPadding) { m_TL_padding = tlPadding; } + + Dims2 bottomRightPadding() const { return m_BR_padding; } + void setBottomRightPadding(Dims2 brPadding) { m_BR_padding = brPadding; } + + virtual bool hasBiasTerm() const { return m_has_bias_term; } + virtual void setHasBiasTerm(bool hasBiasTerm) { m_has_bias_term = hasBiasTerm; } + + NvU32 paddingValue() const { return m_padding_value; } + void setPaddingValue(NvU32 paddingValue) { m_padding_value = paddingValue; } + + const Dims4& biasDims() const { return m_bias_dims; } + void setBiasDims(const Dims4& bd) { m_bias_dims = bd; } + + const Dims4& weightDims() const { return m_weight_dims; } + void setWeightDims(const Dims4& kd) { m_weight_dims = kd; } + + const Weights& biasData() const { return m_bias_data; } + void setBiasData(const Weights& biasData) { m_bias_data = biasData; } + + const Weights& weights() const { return m_weights; } + void setWeights(const Weights& weights) { m_weights = weights; } + + NvU32 numGroups() const { return m_num_groups; } + void setNumGroups(NvU32 numGroups) { m_num_groups = numGroups; } + +protected: + BiasMode m_bias_mode; + bool m_has_bias_term; + Dims2 m_TL_padding; + Dims2 m_BR_padding; + Dims2 m_stride; + Dims2 m_dilation; + Dims4 m_bias_dims; + Dims4 m_weight_dims; + NvU32 m_padding_value; + Weights m_weights; + Weights m_bias_data; + NvU32 m_num_groups; +}; + +class ElementWiseParams : public CanonicalParams +{ +public: + ElementWiseParams() : + m_type(ElementWiseOperation::kSUM), + m_has_stable_prod_grad(true) + { } + virtual ~ElementWiseParams() { } + + nvdla::ElementWiseOperation type() const { return m_type; } + void setType(nvdla::ElementWiseOperation type) { m_type = type; } + +protected: + // these params are extracted from ditcaffe::EltWiseParameter + nvdla::ElementWiseOperation m_type; // [def = nvdla::kSUM] + bool m_has_stable_prod_grad; +}; + +}; // nvdla::priv::canonical_ast + +}; // nvdla::priv + +}; // nvdla:: + +namespace nvdla +{ + +class INetwork; +class ITensor; + +namespace priv +{ + +class Network; +class Tensor; +class Wisdom; +class WisdomContainerEntry; + +namespace canonical_ast +{ + + enum CanonicalOpTypeEnum { + CANONICAL_OPERATION_TYPE_ENUMS(GEN_ENUM) + }; + typedef SequenceEnum CanonicalOpType; + + class Node; + class Edge; + + class Graph : public ast::Graph + { + public: + Graph() : m_next_node_id(0), m_next_edge_id(0) + { + m_scored_ordering = new ast::ScoredGraphOrdering(this); + } + ast::ScoredGraphOrdering *scoredOrdering() { return m_scored_ordering; } + virtual ~Graph() + { + delete m_scored_ordering; + } + + Graph* clone(); + + std::string nextNodeId() { return std::string("n-") + toString(m_next_node_id++); } + std::string nextEdgeId() { return std::string("e-") + toString(m_next_edge_id++); } + + protected: + int m_next_node_id; + int m_next_edge_id; + + ast::ScoredGraphOrdering *m_scored_ordering; + }; + + class Node + { + public: + virtual std::string className() const { return std::string("Node"); } + virtual std::string pretty() const { return "";} // override in specific nodes to add. careful... + + static std::string prettyId(const Node *n, NvU8 flags = ast::PrettyId_Default) + { + if ( !n ) { return std::string("(null)"); } + std::stringstream r; std::string sep(""); + if ( flags & ast::PrettyId_Id ) { r << sep << n->id(); sep = " "; } + if ( flags & ast::PrettyId_ClassName ) { r << sep << n->className(); sep = " "; } + if ( flags & ast::PrettyId_Name ) { r << sep << n->id(); sep = " "; } // same as id + if ( flags & (ast::PrettyId_Verbose) ) { r << sep << n->pretty(); sep = " "; } + return r.str(); + } + + typedef canonical_ast::Graph::EdgeSequence EdgeSequence; + + Node() : m_containing_graph(0) + { + m_unique_id = m_next_id++; + } + virtual ~Node() { } + + const std::string id() const { return m_id; } + void setId(const std::string id) { m_id = id; } + + NvU32 uniqueId() const { return m_unique_id;} + + const std::string name() const { return m_name; } + void setName(const std::string name) { m_name = name; } + + Graph* graph() { return m_containing_graph; } + void setGraph(Graph* g) { m_containing_graph = g; } + + CanonicalOpType canonicalOpType() const { return m_can_op_type; } + + virtual CanonicalParams& params() + { + return m_basic_can_params; + } + + const EdgeSequence& inputEdges() const { return m_input_edges; } + void markInputEdge(Edge* input) + { + if (std::find(m_input_edges.begin(), m_input_edges.end(), input) == m_input_edges.end()) + m_input_edges.push_back(input); + } + + const EdgeSequence& outputEdges() const { return m_output_edges; } + void markOutputEdge(Edge* output) + { + if (std::find(m_output_edges.begin(), m_output_edges.end(), output) == m_output_edges.end()) + m_output_edges.push_back(output); + } + + protected: + std::string m_id; // unique within the graph + NvU32 m_unique_id; // id for graph ordering. u32 instead of string. + static NvU32 m_next_id; + std::string m_name; + Graph* m_containing_graph; + CanonicalOpType m_can_op_type; + CanonicalParams m_basic_can_params; + EdgeSequence m_input_edges; + EdgeSequence m_output_edges; + }; + + // scale (when power non-trivial) + // power + class ScaleNode : public Node + { + public: + virtual std::string className() const { return std::string("ScaleNode"); } + ScaleNode() : Node() + { + m_can_op_type = SCALE; + } + virtual ~ScaleNode() { } + + virtual void captureNetworkParams(ScaleLayer* scale); + virtual ScaleParams& params() { return m_can_params; } + protected: + ScaleParams m_can_params; + }; + + // batch-norm + class BatchNormNode : public Node + { + public: + virtual std::string className() const { return std::string("BatchNormNode"); } + BatchNormNode() : Node() + { + m_can_op_type = BATCH_NORM; + } + virtual ~BatchNormNode() { } + + virtual void captureNetworkParams(BatchNormLayer* bn); + virtual BatchNormParams& params() { return m_can_params; } + protected: + BatchNormParams m_can_params; + }; + + // softmax + class SoftMaxNode : public Node + { + public: + virtual std::string className() const { return std::string("SoftMaxNode"); } + SoftMaxNode() : Node() + { + m_can_op_type = SOFTMAX; + } + virtual ~SoftMaxNode() { } + + virtual void captureNetworkParams(SoftMaxLayer* sm); + virtual SoftMaxParams& params() { return m_can_params; } + protected: + SoftMaxParams m_can_params; + }; + + // convolution layer + // deconvolve 1st + class ConvolutionNode : public Node + { + public: + virtual std::string className() const { return std::string("ConvolutionNode"); } + ConvolutionNode() : Node() + { + m_can_op_type = CONVOLUTION; + } + virtual ~ConvolutionNode() { } + + virtual void captureNetworkParams(ConvolutionLayer* conv); + virtual ConvolutionParams& params() { return m_can_params; } + protected: + ConvolutionParams m_can_params; + }; + + // fully connected + class FullyConnectedNode : public Node + { + public: + virtual std::string className() const { return std::string("FullyConnectedNode"); } + FullyConnectedNode() : Node() + { + m_can_op_type = FULLY_CONNECTED; + } + virtual ~FullyConnectedNode() { } + + virtual void captureNetworkParams(FullyConnectedLayer* fc); + virtual FullyConnectedParams& params() { return m_can_params; } + protected: + FullyConnectedParams m_can_params; + }; + + // deconvolve 2nd + class DeconvolutionNode : public Node + { + public: + virtual std::string className() const { return std::string("DeconvolutionNode"); } + DeconvolutionNode() : Node() + { + m_can_op_type = DECONVOLUTION; + } + virtual ~DeconvolutionNode() { } + + virtual void captureNetworkParams(DeconvolutionLayer* deconv); + virtual DeconvolutionParams& params() { return m_can_params; } + protected: + DeconvolutionParams m_can_params; + }; + + // activation + class ActivationNode : public Node + { + public: + virtual std::string className() const { return std::string("ActivationNode"); } + ActivationNode() : Node() + { + m_can_op_type = ACTIVATION; + } + virtual ~ActivationNode() { } + + virtual void captureNetworkParams(ActivationLayer* act); + virtual ActivationParams& params() { return m_can_params; } + protected: + ActivationParams m_can_params; + }; + + // elementwise + class ElementWiseNode : public Node + { + public: + virtual std::string className() const { return std::string("ElementWiseNode"); } + ElementWiseNode() : Node() + { + m_can_op_type = ELEMENTWISE; + } + virtual ~ElementWiseNode() { } + + virtual void captureNetworkParams(ElementWiseLayer* ew); + virtual ElementWiseParams& params() { return m_can_params; } + protected: + ElementWiseParams m_can_params; + }; + + // pooling + class PoolingNode : public Node + { + public: + virtual std::string className() const { return std::string("PoolingNode"); } + PoolingNode() : Node() + { + m_can_op_type = POOLING; + } + virtual ~PoolingNode() { } + + virtual void captureNetworkParams(PoolingLayer* pool); + virtual PoolingParams& params() { return m_can_params; } + protected: + PoolingParams m_can_params; + }; + + // lrn + class LRNNode : public Node + { + public: + virtual std::string className() const { return std::string("LRNNode"); } + LRNNode() : Node() + { + m_can_op_type = LRN; + } + virtual ~LRNNode() { } + + virtual void captureNetworkParams(LRNLayer* lrn); + virtual LRNParams& params() { return m_can_params; } + protected: + LRNParams m_can_params; + }; + + // concat + class ConcatenationNode : public Node + { + public: + virtual std::string className() const { return std::string("ConcatenationNode"); } + ConcatenationNode() : Node() + { + m_can_op_type = CONCATENATION; + } + virtual ~ConcatenationNode() { } + + virtual void captureNetworkParams(ConcatenationLayer* concat); + virtual ConcatenationParams& params() { return m_can_params; } + protected: + ConcatenationParams m_can_params; + }; + + // split + class SplitNode : public Node + { + public: + virtual std::string className() const { return std::string("SplitNode"); } + SplitNode() : Node() + { + m_can_op_type = SPLIT; + } + virtual ~SplitNode() { } + + virtual void captureNetworkParams(SliceLayer* split); + virtual SplitParams& getParams() { return m_can_params; } + protected: + SplitParams m_can_params; + }; + + class Edge + { + public: + virtual std::string className() const { return std::string("Edge"); } + static std::string prettyId(const Edge *e, NvU8 flags = ast::PrettyId_All ) + { + if ( !e ) { return std::string("(null)"); } + std::stringstream r; std::string sep(""); + if ( flags & ast::PrettyId_Id ) { r << sep << e->id(); sep = " "; } + if ( flags & ast::PrettyId_Name ) { r << sep << e->id(); sep = " "; } // same as name + if ( flags & ast::PrettyId_ClassName ) { r << sep << e->className(); sep = " "; } + if ( flags & ast::PrettyId_Type ) { r << sep << "canonical_ast::" << e->className(); sep = " "; } + + return r.str(); + } + + Edge() : m_containing_graph(0), m_original_tensor(0) + { + m_unique_id = m_next_id++; + } + virtual ~Edge() { } + + const std::string id() const { return m_id; } + void setId(const std::string id) { m_id = id; } + + NvU32 uniqueId() const { return m_unique_id;} + + Graph* graph() { return m_containing_graph; } + void setGraph(Graph* g) { m_containing_graph = g; } + + Tensor *originalTensor() const { return m_original_tensor; } + void setOriginalTensor(Tensor* tensor) { m_original_tensor = tensor; } + + protected: + std::string m_id; // unique within the graph + NvU32 m_unique_id; // id for graph ordering. u32 instead of string. + static NvU32 m_next_id; + Graph* m_containing_graph; + Tensor* m_original_tensor; + }; + + + Graph* generateGraph(Network *); + + Node *newCanonicalNode(Layer* orig_nw_layer); + + void traverseGraph(Graph *); + + // for sending to debug tools + std::ostream & outputJson(Graph *, std::ostream &); + std::ostream & outputJson(Graph *, Edge *, std::ostream &); + std::ostream & outputJson(Graph *, Node *, std::ostream &); + + + INetwork *original_network(); + + bool serializeTo(WisdomContainerEntry *); + bool deserializeFrom(WisdomContainerEntry *); + // virtual bool assignSymbols(Wisdom *); + + class NodeFactory + { + public: + static ConvolutionNode* newConvNode(ConvolutionLayer* orig_nw_layer); + static FullyConnectedNode* newFCNode(FullyConnectedLayer* orig_nw_layer); + static ActivationNode* newActivationNode(ActivationLayer* orig_nw_layer); + static PoolingNode* newPoolingNode(PoolingLayer* orig_nw_layer); + static LRNNode* newLRNNode(LRNLayer* orig_nw_layer); + static ScaleNode* newScaleNode(ScaleLayer* orig_nw_layer); + static BatchNormNode* newBatchNormNode(BatchNormLayer* orig_nw_layer); + static SoftMaxNode* newSoftMaxNode(SoftMaxLayer* orig_nw_layer); + static ConcatenationNode* newConcatNode(ConcatenationLayer* orig_nw_layer); + static SplitNode* newSplitNode(SliceLayer* orig_nw_layer); + static DeconvolutionNode* newDeconvNode(DeconvolutionLayer* orig_nw_layer); + static ElementWiseNode* newEWNode(ElementWiseLayer* orig_nw_layer); + + template static T nodeCast(Node*); + + protected: + static std::map s_conv_priv; + static std::map s_fc_priv; + static std::map s_act_priv; + static std::map s_pool_priv; + static std::map s_lrn_priv; + static std::map s_scale_priv; + static std::map s_bn_priv; + static std::map s_sm_priv; + static std::map s_concat_priv; + static std::map s_split_priv; + static std::map s_deconv_priv; + static std::map s_ew_priv; + }; + + +typedef Graph::NodeSequence NodeSequence; + + +}; // nvdla::priv::canonical_ast + + +typedef ast::Graph CanonicalGraph; +typedef ast::Graph::ElemSequence CanonicalGraphElemSequence; +typedef ast::Graph::NodeSequence CanonicalGraphNodeSequence; +typedef ast::Graph::EdgeSequence CanonicalGraphEdgeSequence; +typedef ast::GraphVisitor CanonicalGraphVisitor; + + +}; // nvdla::priv + +}; // nvdla + + + +#endif // NVDLA_PRIV_CANONICAL_AST_H diff --git a/umd/core/src/compiler/include/priv/CanonicalEnums.h b/umd/core/src/compiler/include/priv/CanonicalEnums.h new file mode 100644 index 00000000..9a99d941 --- /dev/null +++ b/umd/core/src/compiler/include/priv/CanonicalEnums.h @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#ifndef NVDLA_PRIV_CANONICAL_ENUMS_H +#define NVDLA_PRIV_CANONICAL_ENUMS_H + +// CanonicalAST::OperationType +#define CANONICAL_OPERATION_TYPE_ENUMS(op) \ + op(CONVOLUTION, 0U) \ + op(FULLY_CONNECTED, 1U) \ + op(ACTIVATION, 2U) \ + op(POOLING, 3U) \ + op(LRN, 4U) \ + op(SCALE, 5U) \ + op(BATCH_NORM, 6U) \ + op(SOFTMAX, 7U) \ + op(CONCATENATION, 8U) \ + op(DECONVOLUTION, 9U) \ + op(ELEMENTWISE, 10U) \ + op(SPLIT, 11U) + +#endif /* NVDLA_PRIV_CANONICAL_ENUMS_H */ + + diff --git a/umd/core/src/compiler/include/priv/Check.h b/umd/core/src/compiler/include/priv/Check.h new file mode 100644 index 00000000..cbb711bf --- /dev/null +++ b/umd/core/src/compiler/include/priv/Check.h @@ -0,0 +1,261 @@ +/* + * Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#ifndef NVDLA_PRIV_CHECK_H +#define NVDLA_PRIV_CHECK_H + +#include +#include + +#include + +#define ROUNDUP_AND_ALIGN(N, A) (((N) % (A)) ? ((N) + (A) - ((N) % (A))) : (N)) +#define ROUNDDOWN_AND_ALIGN(N, A) (((N) % (A)) ? ((N) - ((N) % (A))) : (N)) + +namespace nvdla +{ + +namespace priv +{ + +class Logger +{ +public: + enum Severity + { + INTERNAL_ERROR = 0, + ERROR = 1, + WARNING = 2, + INFO = 3 + }; + virtual void log(Severity severity, const char* msg); + Logger(); + virtual ~Logger(); +}; + + +extern Logger* gLogger; + + + +template +class LogStream : public std::ostream +{ + class Buf : public std::stringbuf + { + public: + virtual int sync() + { + std::string s = str(); + while (!s.empty() && s[s.length() - 1] == '\n') + s.erase(s.length() - 1); + gLogger->log(S, s.c_str()); + str(""); + return 0; + } + }; + + Buf buffer; +public: + LogStream() : std::ostream(&buffer) + { + } +}; + +extern LogStream gLogInternalError; +extern LogStream gLogError; +extern LogStream gLogWarning; +extern LogStream gLogInfo; + +} // nvdla::priv + +} // nvdla + + +// +// "using" in headers is typically a bad idea. +// but here it's internal for a good cause. +// +using nvdla::priv::gLogInternalError; +using nvdla::priv::gLogError; +using nvdla::priv::gLogWarning; +using nvdla::priv::gLogInfo; + + +#ifdef _MSC_VER +# define FN_NAME __FUNCTION__ +#else +# define FN_NAME __func__ +#endif + + + + +#define ASSERT(cond) \ + if (!(cond)) { ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Condition Asserted"); } + +#define API_CHECK(condition) \ + do { \ + if ((condition) == false) { \ + std::ostringstream _error; \ + gLogError << "Parameter check failed in " << FN_NAME; \ + gLogError << ", file " << __FILE__ << " line " << __LINE__; \ + gLogError << ", condition: " << #condition << std::endl; \ + return; \ + } \ + } while(0) + +#define API_CHECK_RETVAL(condition, retval) \ + do { \ + if ((condition) == false) { \ + std::ostringstream _error; \ + gLogError << "Parameter check failed in " << FN_NAME; \ + gLogError << ", condition: " << #condition << std::endl; \ + return retval; \ + } \ + } while(0) + +#define API_CHECK_WEIGHTS(Name) do { \ + API_CHECK(Name.values != 0); \ + API_CHECK(Name.count > 0); \ + API_CHECK(DataType::UnderlyingType(Name.type) < EnumMax()); \ + } while(0) + +#define API_CHECK_WEIGHTS0(Name) do { \ + API_CHECK(Name.count >= 0); \ + API_CHECK(Name.count > 0 ? (Name.values != 0) : (Name.values == 0)); \ + API_CHECK(DataType::UnderlyingType(Name.type) < EnumMax()); \ + }while(0) + +#define API_CHECK_WEIGHTS_RETVAL(Name, retval) do { \ + API_CHECK_RETVAL(Name.values != 0, retval); \ + API_CHECK_RETVAL(Name.count > 0, retval); \ + API_CHECK_RETVAL(DataType::UnderlyingType(Name.type) < EnumMax(), retval); \ + } while(0) + +#define API_CHECK_WEIGHTS0_RETVAL(Name, retval) do { \ + API_CHECK_RETVAL(Name.count >= 0, retval); \ + API_CHECK_RETVAL(Name.count > 0 ? (Name.values != 0) : (Name.values == 0), retval); \ + API_CHECK_RETVAL(DataType::UnderlyingType(Name.type) < EnumMax(), retval); \ + } while (0) + + +#define API_CHECK_NULL(param) API_CHECK((param) != 0) +#define API_CHECK_NULL_RETVAL(param, retval) API_CHECK_RETVAL((param) != 0, retval) +#define API_CHECK_NULL_RET_NULL(ptr) API_CHECK_NULL_RETVAL(ptr, 0) +#define API_CHECK_ENUM_RANGE(Type, val) API_CHECK(int(val) >= 0 && int(val) < EnumMax()) +#define API_CHECK_ENUM_RANGE_RETVAL(Type, val, retval) API_CHECK_RETVAL(int(val) >= 0 && int(val) < EnumMax(), retval) +#define API_CHECK_DIMS3_TENSOR_RETVAL(dims, retval) API_CHECK_RETVAL(dims.c > 0 && dims.h > 0 && dims.w > 0 && uint64_t(dims.c)*uint64_t(dims.h)*uint64_t(dims.w) < MAX_TENSOR_SIZE, retval) +#define API_CHECK_DIMS4_TENSOR_RETVAL(dims, retval) API_CHECK_RETVAL(dims.n > 0 && dims.c > 0 && dims.h > 0 && dims.w > 0 && uint64_t(dims.c)*uint64_t(dims.h)*uint64_t(dims.w) < MAX_TENSOR_SIZE, retval) +#define API_CHECK_DIMS3_TENSOR(dims) API_CHECK(dims.c > 0 && dims.h > 0 && dims.w > 0 && uint64_t(dims.c)*uint64_t(dims.h)*uint64_t(dims.w) < MAX_TENSOR_SIZE) + + + +#define ACCESSOR_MUTATOR(Type, Name, CapName) \ + Type CurrentScope :: get##CapName() const \ + { \ + return mParams.Name; \ + } \ + \ + void CurrentScope :: set##CapName(Type val) \ + { \ + mParams.Name = val; \ + /*mNetwork->markChanged(*this);*/ \ + } + +#define ACCESSOR_MUTATOR_CHECK_ENUM(Type, Name, CapName) \ + Type CurrentScope :: get##CapName() const \ + { \ + return mParams.Name; \ + } \ + \ + void CurrentScope :: set##CapName(Type Name) \ + { \ + API_CHECK(int(Name) >= 0 && int(Name) < EnumMax()); \ + mParams.Name = Name; \ + /*mNetwork->markChanged(this);*/ \ + } + +#define ACCESSOR_MUTATOR_CHECK_EXPR(Type, Name, CapName, CheckExpr) \ + Type CurrentScope :: get##CapName() const \ + { \ + return mParams.Name; \ + } \ + \ + void CurrentScope :: set##CapName(Type Name) \ + { \ + API_CHECK(CheckExpr); \ + mParams.Name = Name; \ + /* mNetwork->markChanged(this);*/ \ + } + + +#define ACCESSOR_MUTATOR_WEIGHTS(Type, Name, CapName) \ + Weights CurrentScope :: get##CapName() const \ + { \ + return mParams.Name; \ + } \ + \ + void CurrentScope :: set##CapName(Weights Name) \ + { \ + API_CHECK(Name.values != 0); \ + API_CHECK(Name.count > 0); \ + API_CHECK(DataType::UnderlyingType(Name.type) < EnumMax()); \ + mParams.Name = Name; \ + /*mNetwork->markChanged(this);*/ \ + } + + +// +// internal error checks (sends to gLogInternalError vs. gLogError) +// +#define CHECK_NULL(ptr) do { \ + if (ptr == 0) { \ + gLogInternalError << "error: input " << #ptr << \ + " is NULL in " << FN_NAME << std::endl; \ + return; \ + } \ + } while (0) + +#define CHECK_NULL_RET_NULL(ptr) do { \ + if (ptr == 0) { \ + gLogInternalError << "error: input " << #ptr << \ + " is NULL in " << FN_NAME << std::endl; \ + return 0; \ + } \ + } while(0) + +#define CHECK_NULL_RET_VAL(ptr, val) do { \ + if (ptr == 0) { \ + gLogInternalError << "error: input " << #ptr << \ + " is NULL in " << FN_NAME << std::endl; \ + return val; \ + } \ + } while(0) + +#endif // NVDLA_PRIV_CHECK_H diff --git a/umd/core/src/compiler/include/priv/Compiler.h b/umd/core/src/compiler/include/priv/Compiler.h new file mode 100644 index 00000000..6f7928c6 --- /dev/null +++ b/umd/core/src/compiler/include/priv/Compiler.h @@ -0,0 +1,329 @@ +/* + * Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#ifndef NVDLA_PRIV_COMPILER_H +#define NVDLA_PRIV_COMPILER_H + +#include +#include +#include +#include + +#include "priv/Type.h" +#include "priv/Check.h" + +#include "nvdla/ICompiler.h" + +#include "priv/Memory.h" +#include "priv/Loadable.h" +#include "priv/CanonicalAST.h" +#include "priv/EngineAST.h" + + +namespace nvdla +{ + +namespace priv +{ + +class Compiler; +class Loadable; + +class CompilerFactory +{ +public: + typedef PrivPair CompilerPrivPair; + + static CompilerPrivPair newCompiler(); + static NvDlaError deleteCompiler(ICompiler *compiler); + + static Compiler *priv(ICompiler *); + static ICompiler *i(Compiler *); + static ICompiler *self(void *s); + +protected: + static BiMap s_priv; + static BiMap s_self; +}; + + +class DLAInterface; + +class Compiler : public ICompiler +{ +public: // externally facing + virtual IWisdom *wisdom() const; + + virtual NvDlaError getDataType(DataType::UnderlyingType *d) const; + virtual NvDlaError compile(const char *profile_name, const char *target_config_name, ILoadable **); // "" := default + virtual NvDlaError getLoadableImage(const char *profile_name, NvU8 *flatbuf); + virtual NvDlaError getLoadableImageSize(const char *profile_name, NvU64 *size); + + virtual NvDlaError compileCheck(const char *, const char *); + +public: // internally facing + + NvDlaError emit(engine_ast::Graph * g, LoadableFactory::LoadablePrivPair &); + + Compiler(); + virtual ~Compiler(); + + void setWisdom(Wisdom *w) { m_wisdom = w; } + + virtual NvU16 getFactoryType() const; + + inline bool debugVersions() const { return false; } + inline bool debugTasks() const { return false; } + inline bool debugMemoryLayout() const { return false; } + inline bool debugGraphs() const { return false; } + inline bool debugProfile() const { return false; } + +protected: + + friend class Wisdom; + friend class CompilerFactory; + + Wisdom *m_wisdom; + + /** + * @Purpose:-> + * Register all unique and shared buffers with the RM + * do not reserve spaces for them with the RM since some + * buffer sizes might change later for eg: during weight translation + * if padding bytes are added + */ + engine_ast::Graph *registerBuffers(engine_ast::Graph *); + + /** + * @Purpose:-> + * Most DNN models are trained on FP32 and the trained data is + * not in a form friendly to the DLA (in precision, core-value and layout). + * For eg: trained weights for a model could be related to SUB or DIV ops; + * but DLA likes ADD and MUL. This api pre-processes the likes of these. + * Also, since the max precision available on DLA is FP16, this api also + * evaluates if some of the trained weights may not be representable in + * the lower precision and tries to contrain them + */ + engine_ast::Graph *preProcessAuxData(engine_ast::Graph *); + + /** + * @Purpose:-> + * Adjacent activation ops can be merged together to save extra memory passes. + * Sometimes ops like adjacent addition(s) and/or multiplication(s) can be + * combined or translated into a 3rd equation if the combined co-efficients + * don't overshoot the compute precision's dynamic range + * eg: + * - {Scale1, Scale2} = Scale3 + * - {Bias1, Bias2} = Bias3 + * - {NOP, Act1} = Act1 + * - {Scale, Bias} = Batch-Norm + * - etc + */ + engine_ast::Graph *mergeActivationOperations(engine_ast::Graph *); + + /** + * @Purpose:-> + * INT8 elementwise operations require both input tensors scaled to + * same scaling factor. This pass tries to find input layer which can + * be rescaled and updates it's scaling factor. If not layer found + * then it will insert scaling layer after one of the input layer + * to rescale output of that layer. It is done after merging activation + * layers so that math fusion is done before updating factors and before + * quantizing aux data so that if scaling factor is updated then new + * factor is used to scale data. + */ + engine_ast::Graph *updateScalingFactors(engine_ast::Graph *); + + /** + * @Purpose:-> + * INT8 operations on DLA need quantized activation and trained data. + * This phase of the compiler uses per-filter or per-kernel quantization + * modes (depending on how the profile is set) and quantizes high precision + * trained data (weights/biases/scales/means/variances/etc) in fp16/fp32 to + * suitable quantized representations for executing operations in int8 mode + */ + engine_ast::Graph *quantizeAuxData(engine_ast::Graph *); + + /** + * @Purpose:-> + * Adjacent SDP ops can be fused together in SDP SubEngines X1, X2 & Y + * to save extra memory passes. + * First SDP Op can be configured in X1 while second SDP op in X2 / Y + * e.g. + * - {Batch-Norm, Eltwise} = SDPSuperOp X1, X2 + * - {Batch-Norm, Eltwise, Relu} = SDPSuperOp X1, X2 with Relu + * - {Batch-Norm, Eltwise, Sigmoid} = SDPSuperOp X1, X2, Y with LUT + * - etc + */ + engine_ast::Graph *fuseSubEngineOps(engine_ast::Graph *); + + /** + * @Purpose:-> + * Determine low precision convertor configs for various ops + */ + engine_ast::Graph *handleLowPrecisionConversions(engine_ast::Graph *); + + /** + * @Purpose:-> + * DLA requires auxillary data for each operation to be laid out in a + * specific manner. This API translates aux data to a layout suitable for DLA + */ + engine_ast::Graph *translateAuxData(engine_ast::Graph *); + + /** + * @Purpose:-> + * Reserve sizes of all registered buffers. + * Idempotent op. + */ + engine_ast::Graph *reserveBuffers(engine_ast::Graph *); + + /** + * @Purpose:-> + * Some engines dont have memory out port (conv). Operations of such + * an engine should be fused with those of an engine which have a write + * out potr (sdp). Besides, operations can be fused together if they + * are connected over wire in order to save the memory pass latency (sdp+pdp) + */ + engine_ast::Graph *fuseOnTheFlyNodes(engine_ast::Graph *); + + /** + * @Purpose:-> + * Some group of engine operations could be optimized by above compiler + * phases and should be executed as atomic such that their execution could + * not be intercepted by those from another batch/roi. Group them together + */ + engine_ast::Graph *groupAtomicOperations(engine_ast::Graph *); + + /** + * @Purpose:-> + * Engines have limited sized caching buffers (conv, pdp); its not + * always possible to fetch the entire src data before operating on it. + * Such operations have to be split and later concatenated using software + * magic + */ + engine_ast::Graph *splitNodes(engine_ast::Graph *); + + /** + * @Purpose:-> //xxx: mostly can this phase as the duty is spread out to other ops + * As a result of splits, fusions and introducing multiple ROIs, + * the graph might have several nodes that need special treatment: + * - intra-roi nodes might need joins + * - nodes around a split node might have to be split themselves + * - etc (as we find) + * Massage the graph to bound/tighten the nodes from either sides. + */ + engine_ast::Graph *boundGraph(engine_ast::Graph *); + + /** + * @Purpose:-> + * All the compute related decisions made for single batch so far should be now + * leveraged to provision for multiple batches. Handle all the operation and + * memory related nuances for the multiple batches. + */ + engine_ast::Graph *handleMultiBatch(engine_ast::Graph *); + + /** + * @Purpose:-> + * Flatten the engine graph such that all the multi-ops super nodes + * are replaced by their respective nested graph contents. + */ + engine_ast::Graph *flattenGraph(engine_ast::Graph *); + + /** + * @Purpose:-> + * # Resolve all types of dependencies: + * - data dependencies between nodes exchanging tensor + * - compute dependencies between nodes of same engine + * - software dependencies around software (no h/w required) ops like + * split & concat + * # Determine task boundaries (DLA/EMU/DLA/etc) + * # And generate node annotation order within each task so that it + * represents functional data-flow among nodes and allows chronological + * memory allocation for each of them + * # Finally, inherit the dependency graph state generated for 1 batch + * into that of the 'N' multiple batches (if N > 1). + */ + engine_ast::Graph *generateDependencyParams(engine_ast::Graph *, engine_ast::NodeSequence &); + + /** + * @Purpose:-> + * Schedule/reserve memory resources. + */ + engine_ast::Graph *resolveMemory(engine_ast::Graph *, const engine_ast::NodeSequence &); + + /** + * @Purpose:-> + * This compilation phase adds debug bdmas to copy intermediate + * surfaces to sysmem. Each such surface is presented + * as a bindable debug buffer to the runtime. + */ + engine_ast::Graph *enableCopyOutDebugSurfaces(engine_ast::Graph *); + + DLAInterface *getTargetDLAInterface(Profile *); + EMUInterface *getTargetEMUInterface(Profile *); + + /** + * Internal functions which are unsafe and external interfaces wraps them + * to catch possible exception thrown. + **/ + NvDlaError compileInternal(const char *, const char *, ILoadable **, bool); + NvDlaError compileInternal(Profile *, TargetConfig *, ILoadable **, bool); + NvDlaError getLoadableImageInternal(const char *profile_name, NvU8 *flatbuf); + NvDlaError getLoadableImageSizeInternal(const char *profile_name, NvU64 *size); + +private: + NvDlaError getLoadableFromWisdom(const char *test_point_name, + ILoadable **i); +}; + + +class DumpGraphBase +{ +public: + DumpGraphBase(const std::string &filename, const std::string &graphId) : + _m_filename(filename), _m_graph_id(graphId) { } // don't write file by default + + virtual ~DumpGraphBase() { } + + virtual void setFilename(const std::string s) { _m_filename = s; } + virtual void setGraphId(const std::string i) { _m_graph_id = i; } + virtual std::ofstream &out() { return _m_file; } + +protected: + std::string _m_filename; + std::string _m_graph_id; + std::ofstream _m_file; + std::string _m_delim; +}; + + +} // nvdla::priv + +} // nvdla + +#endif // NVDLA_PRIV_COMPILER_H diff --git a/umd/core/src/compiler/include/priv/DLAInterface.h b/umd/core/src/compiler/include/priv/DLAInterface.h new file mode 100644 index 00000000..755309cf --- /dev/null +++ b/umd/core/src/compiler/include/priv/DLAInterface.h @@ -0,0 +1,2315 @@ +/* + * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#ifndef NVDLA_PRIV_DLA_INTERFACE_H +#define NVDLA_PRIV_DLA_INTERFACE_H + +#include + +#include "priv/Type.h" + +namespace nvdla +{ +namespace priv +{ + +// +// struct dla_network_desc +// +class DLANetworkDesc +{ +public: + virtual size_t struct_size() const = 0; + virtual size_t struct_align() const = 0; + + virtual size_t op_BDMA() const = 0; + virtual size_t op_CONV() const = 0; + virtual size_t op_SDP() const = 0; + virtual size_t op_PDP() const = 0; + virtual size_t op_CDP() const = 0; + virtual size_t op_RUBIK() const = 0; + virtual size_t numOpHeads() const = 0; + + virtual int16_t * operationDescIndex(NvU8 *base) const = 0; + virtual int16_t * surfaceDescIndex(NvU8 *base) const = 0; + virtual int16_t * dependencyGraphIndex(NvU8 *base) const = 0; + virtual int16_t * LUTDataIndex(NvU8 *base) const = 0; + virtual int16_t * ROIArrayIndex(NvU8 *base) const = 0; + virtual int16_t * surfaceIndex(NvU8 *base) const = 0; + virtual int16_t * statListIndex(NvU8 *base) const = 0; + virtual int16_t * reserved1(NvU8* base) const = 0; + virtual int16_t * opHead(NvU8 *base, size_t h) const = 0; + virtual uint16_t * numROIs(NvU8 *base) const = 0; + virtual uint16_t * numOperations(NvU8 *base) const = 0; + virtual uint16_t * numLUTs(NvU8 *base) const = 0; + virtual uint16_t * numAddresses(NvU8 *base) const = 0; + virtual int16_t * inputLayer(NvU8 *base) const = 0; + virtual uint8_t * dynamicROI(NvU8 *base) const = 0; + virtual uint8_t * reserved0(NvU8 *base) const = 0; + +protected: + DLANetworkDesc() { } + virtual ~DLANetworkDesc() { } +}; + +class DLANetworkDescAccessor +{ +public: + NvU8 * struct_base() const; + size_t struct_size() const; + size_t struct_align() const; + + size_t op_BDMA() const; + size_t op_CONV() const; + size_t op_SDP() const; + size_t op_PDP() const; + size_t op_CDP() const; + size_t op_RUBIK() const; + size_t numOpHeads() const; + + int16_t * operationDescIndex() const; + int16_t * surfaceDescIndex() const; + int16_t * dependencyGraphIndex() const; + int16_t * LUTDataIndex() const; + int16_t * ROIArrayIndex() const; + int16_t * surfaceIndex() const; + int16_t * statListIndex() const; + int16_t * reserved1() const; + int16_t * opHead(size_t h) const; + uint16_t * numROIs() const; + uint16_t * numOperations() const; + uint16_t * numLUTs() const; + uint16_t * numAddresses() const; + int16_t * inputLayer() const; + uint8_t * dynamicROI() const; + uint8_t * reserved0() const; + + DLANetworkDescAccessor(NvU8 *base, const DLANetworkDesc &); + +protected: + NvU8 *_base; + const DLANetworkDesc &_n; +}; + +// +// struct dla_consumer +// +class DLAConsumer +{ +public: + + virtual size_t struct_size() const = 0; + virtual size_t struct_align() const = 0; + + virtual int16_t * index(NvU8 *base) const = 0; + virtual uint8_t * event(NvU8 *base) const = 0; + virtual uint8_t event_OpCompleted() const = 0; + virtual uint8_t event_OpProgrammed() const = 0; + virtual uint8_t event_OpEnabled() const = 0; + virtual uint8_t event_OpCDMAWeightDone() const = 0; + virtual uint8_t event_OpCDMADataDone() const = 0; + virtual uint8_t * res (NvU8 *base) const = 0; + +protected: + DLAConsumer() { } + virtual ~DLAConsumer() { } +}; + +class DLAConsumerAccessor +{ +public: + NvU8 * struct_base() const; + size_t struct_size() const; + size_t struct_align() const; + + int16_t * index() const; + uint8_t * event() const; + uint8_t event_OpCompleted() const; + uint8_t event_OpProgrammed() const; + uint8_t event_OpEnabled() const; + uint8_t event_OpCDMAWeightDone() const; + uint8_t event_OpCDMADataDone() const; + uint8_t * res() const; + + DLAConsumerAccessor(NvU8 *base, const DLAConsumer &); + +protected: + NvU8 *_base; + const DLAConsumer &_c; +}; + +// +// struct dla_common_op_desc +// +class DLACommonOpDesc +{ +public: + virtual size_t struct_size() const = 0; + virtual size_t struct_align() const = 0; + + virtual int16_t * index(NvU8 *base) const = 0; + virtual int8_t * roiIndex(NvU8 *base) const = 0; + virtual uint8_t * opType(NvU8 *base) const = 0; + virtual uint8_t opType_BDMA() const = 0; + virtual uint8_t opType_CONV() const = 0; + virtual uint8_t opType_SDP() const = 0; + virtual uint8_t opType_PDP() const = 0; + virtual uint8_t opType_CDP() const = 0; + virtual uint8_t opType_RUBIK() const = 0; + virtual uint8_t * dependencyCount(NvU8 *base) const = 0; + virtual uint8_t * reserved_xxx(NvU8 *base) const = 0; + virtual uint8_t * reserved0(NvU8 *base, size_t i) const = 0; + virtual size_t numConsumers() const = 0; + virtual DLAConsumerAccessor consumerAccessor(NvU8 *base, size_t c) const = 0; + virtual DLAConsumerAccessor fusedParentAccessor(NvU8 *base) const = 0; + +protected: + DLACommonOpDesc() { } + virtual ~DLACommonOpDesc() { } +}; + + +class DLACommonOpDescAccessor +{ +public: + NvU8 * struct_base() const; + size_t struct_size() const; + size_t struct_align() const; + + int16_t * index() const; + int8_t * roiIndex() const; + uint8_t * opType() const; + uint8_t opType_BDMA() const; + uint8_t opType_CONV() const; + uint8_t opType_SDP() const; + uint8_t opType_PDP() const; + uint8_t opType_CDP() const; + uint8_t opType_RUBIK() const; + + uint8_t * dependencyCount() const; + uint8_t * reserved_xxx() const; + uint8_t * reserved0(size_t i) const; + size_t numConsumers() const; + DLAConsumerAccessor consumerAccessor(size_t c) const; + DLAConsumerAccessor fusedParentAccessor() const; + + DLACommonOpDescAccessor(NvU8 *base, const DLACommonOpDesc &); + +protected: + NvU8 *_base; + const DLACommonOpDesc &_c; +}; + + +// +// struct dla_bdma_transfer_desc +// +class DLABDMATransferDesc +{ +public: + virtual size_t struct_size() const = 0; + virtual size_t struct_align() const = 0; + + virtual int16_t * srcAddress(NvU8 *base) const = 0; + virtual int16_t * dstAddress(NvU8 *base) const = 0; + virtual uint32_t * lineSize(NvU8 *base) const = 0; + virtual uint32_t * lineRepeat(NvU8 *base) const = 0; + virtual uint32_t * srcLine(NvU8 *base) const = 0; + virtual uint32_t * dstLine(NvU8 *base) const = 0; + virtual uint32_t * surfaceRepeat(NvU8 *base) const = 0; + virtual uint32_t * srcSurface(NvU8 *base) const = 0; + virtual uint32_t * dstSurface(NvU8 *base) const = 0; + +protected: + DLABDMATransferDesc() { } + virtual ~DLABDMATransferDesc() { } +}; + +class DLABDMATransferDescAccessor +{ +public: + NvU8 * struct_base() const; + size_t struct_size() const; + size_t struct_align() const; + + int16_t * srcAddress() const; + int16_t * dstAddress() const; + uint32_t * lineSize() const; + uint32_t * lineRepeat() const; + uint32_t * srcLine() const; + uint32_t * dstLine() const; + uint32_t * surfaceRepeat() const; + uint32_t * srcSurface() const; + uint32_t * dstSurface() const; + + DLABDMATransferDescAccessor(NvU8 *base, const DLABDMATransferDesc &); + +protected: + NvU8 *_base; + const DLABDMATransferDesc &_t; +}; + +// +// struct dla_bdma_surface_desc +// +class DLABDMASurfaceDesc +{ +public: + virtual size_t struct_size() const = 0; + virtual size_t struct_align() const = 0; + + virtual uint8_t * srcType(NvU8 *base) const = 0; + virtual uint8_t * dstType(NvU8 *base) const = 0; + virtual uint8_t type_MC() const = 0; + virtual uint8_t type_CV() const = 0; + virtual uint8_t type_HW() const = 0; + + virtual uint16_t * numTransfers(NvU8 *base) const = 0; + virtual uint16_t maxNumTransfers() const = 0; + virtual DLABDMATransferDescAccessor transferAccessor(NvU8 *base, size_t c) const = 0; + +protected: + DLABDMASurfaceDesc() { } + virtual ~DLABDMASurfaceDesc() { } +}; + +class DLABDMASurfaceDescAccessor +{ +public: + NvU8 * struct_base() const; + size_t struct_size() const; + size_t struct_align() const; + + uint8_t type_MC() const; + uint8_t type_CV() const; + uint8_t type_HW() const; + uint16_t maxNumTransfers() const; + + uint8_t * srcType() const; + uint8_t * dstType() const; + uint16_t * numTransfers() const; + DLABDMATransferDescAccessor transferAccessor(size_t c) const; + + DLABDMASurfaceDescAccessor(NvU8 *base, const DLABDMASurfaceDesc &); + +protected: + NvU8 *_base; + const DLABDMASurfaceDesc &_s; +}; + + +// +// struct dla_bdma_op_desc +// +class DLABDMAOpDesc +{ +public: + virtual size_t struct_size() const = 0; + virtual size_t struct_align() const = 0; + + virtual uint16_t * numTransfers(NvU8 *base) const = 0; + virtual uint16_t * reserved0(NvU8 *base) const = 0; + +protected: + DLABDMAOpDesc() { } + virtual ~DLABDMAOpDesc() { } +}; + +class DLABDMAOpDescAccessor +{ +public: + NvU8 * struct_base() const; + size_t struct_size() const; + size_t struct_align() const; + + uint16_t * numTransfers() const; + uint16_t * reserved0() const; + + DLABDMAOpDescAccessor(NvU8 *base, const DLABDMAOpDesc &); + +protected: + NvU8 *_base; + const DLABDMAOpDesc &_s; +}; + + +// +// struct dla_bdma_stat_desc +// +class DLABDMAStatDesc +{ +public: + virtual size_t struct_size() const = 0; + virtual size_t struct_align() const = 0; + + virtual uint32_t * readStall(NvU8 *base) const = 0; + virtual uint32_t * writeStall(NvU8 *base) const = 0; + virtual uint32_t * runtime(NvU8 *base) const = 0; + +protected: + DLABDMAStatDesc() { } + virtual ~DLABDMAStatDesc() { } +}; + +class DLABDMAStatDescAccessor +{ +public: + NvU8 * struct_base() const; + size_t struct_size() const; + size_t struct_align() const; + + uint32_t * readStall() const; + uint32_t * writeStall() const; + uint32_t * runtime() const; + + DLABDMAStatDescAccessor(NvU8 *base, const DLABDMAStatDesc &); + +protected: + NvU8 * _base; + const DLABDMAStatDesc &_s; +}; + +// +// struct dla_cvt_param +// +class DLACVTParam +{ +public: + virtual size_t struct_size() const = 0; + virtual size_t struct_align() const = 0; + + virtual int16_t * scale(NvU8 *base) const = 0; + virtual uint8_t * truncate(NvU8 *base) const = 0; + virtual int32_t * offset(NvU8 *base) const = 0; + virtual uint8_t * enable(NvU8 *base) const = 0; + virtual uint16_t * reserved_xxx(NvU8 *base) const = 0; + +protected: + DLACVTParam() { } + virtual ~DLACVTParam() { } +}; + + +class DLACVTParamAccessor +{ +public: + NvU8 * struct_base() const; + size_t struct_size() const; + size_t struct_align() const; + + int16_t * scale() const; + uint8_t * truncate() const; + int32_t * offset() const; + uint8_t * enable() const; + uint16_t * reserved_xxx() const; + + DLACVTParamAccessor(NvU8 *base, const DLACVTParam &); + +protected: + NvU8 *_base; + const DLACVTParam &_l; +}; + + +// +// struct dla_data_cube +// +class DLADataCube +{ +public: + virtual size_t struct_size() const = 0; + virtual size_t struct_align() const = 0; + + virtual uint8_t * type_xxx(NvU8 *base) const = 0; + virtual uint8_t type_MC_xxx() const = 0; + virtual uint8_t type_CV_xxx() const = 0; + virtual uint8_t type_HW_xxx() const = 0; + virtual uint16_t * type(NvU8 *base) const = 0; + virtual uint16_t type_MC() const = 0; + virtual uint16_t type_CV() const = 0; + virtual uint16_t type_HW() const = 0; + virtual int16_t * address(NvU8 *base) const = 0; + virtual uint32_t * offset(NvU8 *base) const = 0; + virtual uint32_t * size(NvU8 *base) const = 0; + virtual uint16_t * width(NvU8 *base) const = 0; + virtual uint16_t * height(NvU8 *base) const = 0; + virtual uint16_t * channel(NvU8 *base) const = 0; + virtual uint16_t * reserved0(NvU8 *base) const = 0; + virtual uint32_t * lineStride(NvU8 *base) const = 0; + virtual uint32_t * surfStride(NvU8 *base) const = 0; + virtual uint32_t * planeStride(NvU8 *base) const = 0; + +protected: + DLADataCube() { } + virtual ~DLADataCube() { } +}; + + +class DLADataCubeAccessor +{ +public: + NvU8 * struct_base() const; + size_t struct_size() const; + size_t struct_align() const; + + uint8_t * type_xxx() const; + uint8_t type_MC_xxx() const; + uint8_t type_CV_xxx() const; + uint8_t type_HW_xxx() const; + uint16_t * type() const; + uint16_t type_MC() const; + uint16_t type_CV() const; + uint16_t type_HW() const; + int16_t * address() const; + uint32_t * offset() const; + uint32_t * size() const; + uint16_t * width() const; + uint16_t * height() const; + uint16_t * channel() const; + uint16_t * reserved0() const; + uint32_t * lineStride() const; + uint32_t * surfStride() const; + uint32_t * planeStride() const; + + DLADataCubeAccessor(NvU8 *base, const DLADataCube &); + +protected: + NvU8 *_base; + const DLADataCube &_l; +}; + +// +// struct dla_conv_surface_desc +// +class DLAConvSurfaceDesc +{ +public: + virtual size_t struct_size() const = 0; + virtual size_t struct_align() const = 0; + + virtual DLADataCubeAccessor weightDataAccessor(NvU8 *base) const = 0; + virtual DLADataCubeAccessor meanDataAccessor(NvU8 *base) const = 0; + virtual DLADataCubeAccessor wmbDataAccessor(NvU8 *base) const = 0; + virtual DLADataCubeAccessor wgsDataAccessor(NvU8 *base) const = 0; + virtual DLADataCubeAccessor srcDataAccessor(NvU8 *base) const = 0; + virtual DLADataCubeAccessor dstDataAccessor(NvU8 *base) const = 0; + virtual uint64_t * offsetU_xxx(NvU8 *base) const = 0; + virtual int64_t * offsetU(NvU8 *base) const = 0; + virtual uint32_t * offsetV(NvU8 *base) const = 0; + virtual uint32_t * inLineUVStride(NvU8 *base) const = 0; + +protected: + DLAConvSurfaceDesc() { } + virtual ~DLAConvSurfaceDesc() { } +}; + + +class DLAConvSurfaceDescAccessor +{ +public: + NvU8 * struct_base() const; + size_t struct_size() const; + size_t struct_align() const; + + DLADataCubeAccessor weightDataAccessor() const; + DLADataCubeAccessor meanDataAccessor() const; + DLADataCubeAccessor wmbDataAccessor() const; + DLADataCubeAccessor wgsDataAccessor() const; + DLADataCubeAccessor srcDataAccessor() const; + DLADataCubeAccessor dstDataAccessor() const; + uint64_t * offsetU_xxx() const; + int64_t * offsetU() const; + uint32_t * offsetV() const; + uint32_t * inLineUVStride() const; + + DLAConvSurfaceDescAccessor(NvU8 *base, const DLAConvSurfaceDesc &); + +protected: + NvU8 *_base; + const DLAConvSurfaceDesc &_l; +}; + +// +// struct dla_conv_op_desc +// +class DLAConvOpDesc +{ +public: + virtual size_t struct_size() const = 0; + virtual size_t struct_align() const = 0; + + virtual uint8_t * inPrecision(NvU8 *base) const = 0; + virtual uint8_t inPrecision_Int8() const = 0; + virtual uint8_t inPrecision_Int16() const = 0; + virtual uint8_t inPrecision_FP16() const = 0; + virtual uint8_t * outPrecision(NvU8 *base) const = 0; + virtual uint8_t outPrecision_Int8() const = 0; + virtual uint8_t outPrecision_Int16() const = 0; + virtual uint8_t outPrecision_FP16() const = 0; + virtual DLACVTParamAccessor inCVTAccessor(NvU8 *base) const = 0; + virtual DLACVTParamAccessor outCVTAccessor(NvU8 *base) const = 0; + virtual int16_t * padVal(NvU8 *base) const = 0; + virtual uint8_t * convMode(NvU8 *base) const = 0; + virtual uint8_t convMode_Direct() const = 0; + virtual uint8_t convMode_Winograd() const = 0; + virtual uint8_t * dataReuse(NvU8 *base) const = 0; + virtual uint8_t * weightReuse(NvU8 *base) const = 0; + virtual uint8_t * skipDataRls(NvU8 *base) const = 0; + virtual uint8_t * skipWeightRls(NvU8 *base) const = 0; + virtual uint8_t * reserved0(NvU8 *base) const = 0; + virtual uint16_t * entryPerSlice(NvU8 *base) const = 0; + virtual uint16_t * fetchGrain(NvU8 *base) const = 0; + virtual uint8_t * dataFormat(NvU8 *base) const = 0; + virtual uint8_t dataFormat_T_R8() const = 0; + virtual uint8_t dataFormat_T_R10() const = 0; + virtual uint8_t dataFormat_T_R12() const = 0; + virtual uint8_t dataFormat_T_R16() const = 0; + virtual uint8_t dataFormat_T_R16_I() const = 0; + virtual uint8_t dataFormat_T_R16_F() const = 0; + virtual uint8_t dataFormat_T_A16B16G16R16() const = 0; + virtual uint8_t dataFormat_T_X16B16G16R16() const = 0; + virtual uint8_t dataFormat_T_A16B16G16R16_F() const = 0; + virtual uint8_t dataFormat_T_A16Y16U16V16() const = 0; + virtual uint8_t dataFormat_T_V16U16Y16A16() const = 0; + virtual uint8_t dataFormat_T_A16Y16U16V16_F() const = 0; + virtual uint8_t dataFormat_T_A8B8G8R8() const = 0; + virtual uint8_t dataFormat_T_A8R8G8B8() const = 0; + virtual uint8_t dataFormat_T_B8G8R8A8() const = 0; + virtual uint8_t dataFormat_T_R8G8B8A8() const = 0; + virtual uint8_t dataFormat_T_X8B8G8R8() const = 0; + virtual uint8_t dataFormat_T_X8R8G8B8() const = 0; + virtual uint8_t dataFormat_T_B8G8R8X8() const = 0; + virtual uint8_t dataFormat_T_R8G8B8X8() const = 0; + virtual uint8_t dataFormat_T_A2B10G10R10() const = 0; + virtual uint8_t dataFormat_T_A2R10G10B10() const = 0; + virtual uint8_t dataFormat_T_B10G10R10A2() const = 0; + virtual uint8_t dataFormat_T_R10G10B10A2() const = 0; + virtual uint8_t dataFormat_T_Y8___U8V8_N444() const = 0; + virtual uint8_t dataFormat_T_Y8___V8U8_N444() const = 0; + virtual uint8_t dataFormat_T_Y10___U10V10_N444() const = 0; + virtual uint8_t dataFormat_T_Y10___V10U10_N444() const = 0; + virtual uint8_t dataFormat_T_Y12___U12V12_N444() const = 0; + virtual uint8_t dataFormat_T_Y12___V12U12_N444() const = 0; + virtual uint8_t dataFormat_T_Y16___U16V16_N444() const = 0; + virtual uint8_t dataFormat_T_Y16___V16U16_N444() const = 0; + virtual uint8_t dataFormat_T_Y16___U8V8_N444() const = 0; + virtual uint8_t dataFormat_T_Y16___V8U8_N444() const = 0; + virtual uint8_t dataFormat_T_Y8___U8___V8_N444() const = 0; + virtual uint8_t dataFormat_T_Y10___U10___V10_N444() const = 0; + virtual uint8_t dataFormat_T_Y12___U12___V12_N444() const = 0; + virtual uint8_t dataFormat_T_Y16___U16___V16_N444() const = 0; + virtual uint8_t dataFormat_T_Y16___U8___V8_N444() const = 0; + virtual uint8_t dataFormat_T_A2Y10U10V10() const = 0; + virtual uint8_t dataFormat_T_V10U10Y10A2() const = 0; + virtual uint8_t dataFormat_T_A8Y8U8V8() const = 0; + virtual uint8_t dataFormat_T_V8U8Y8A8() const = 0; + virtual uint8_t dataFormat_FEATURE() const = 0; + virtual uint8_t * pixelMapping(NvU8 *base) const = 0; + virtual uint8_t pixelMapping_PitchLinear() const = 0; + virtual uint8_t * batch(NvU8 *base) const = 0; + virtual uint8_t * weightFormat(NvU8 *base) const = 0; + virtual uint8_t weightFormat_Uncompressed() const = 0; + virtual uint8_t weightFormat_Compressed() const = 0; + virtual uint8_t * dataBank(NvU8 *base) const = 0; + virtual uint8_t * weightBank(NvU8 *base) const = 0; + virtual uint32_t * batchStride(NvU8 *base) const = 0; + virtual uint16_t * release(NvU8 *base) const = 0; + virtual uint8_t * postExtension(NvU8 *base) const = 0; + virtual uint8_t * reserved1_xxx(NvU8 *base) const = 0; + virtual uint8_t * pixelOverride(NvU8 *base) const = 0; + virtual uint8_t pixelOverride_UINT() const = 0; + virtual uint8_t pixelOverride_INT() const = 0; + virtual uint8_t * meanFormat(NvU8 *base) const = 0; + virtual uint8_t meanFormat_None() const = 0; + virtual uint8_t meanFormat_Global() const = 0; + virtual uint8_t meanFormat_PerPixel() const = 0; + virtual uint8_t meanFormat_Disable() const = 0; + virtual uint8_t meanFormat_Enable() const = 0; + virtual int16_t * meanRY(NvU8 *base) const = 0; + virtual int16_t * meanGU(NvU8 *base) const = 0; + virtual int16_t * meanBV(NvU8 *base) const = 0; + virtual int16_t * meanAX(NvU8 *base) const = 0; + virtual uint8_t * convStrideX(NvU8 *base) const = 0; + virtual uint8_t * convStrideY(NvU8 *base) const = 0; + virtual uint8_t * padXLeft(NvU8 *base) const = 0; + virtual uint8_t * padXRight(NvU8 *base) const = 0; + virtual uint8_t * padYTop(NvU8 *base) const = 0; + virtual uint8_t * padYBottom(NvU8 *base) const = 0; + virtual uint8_t * dilationX(NvU8 *base) const = 0; + virtual uint8_t * dilationY(NvU8 *base) const = 0; + virtual uint8_t * reserved2(NvU8 *base, size_t i) const = 0; + virtual uint8_t * praTruncate(NvU8 *base) const = 0; + virtual uint16_t * inputWidthCSC(NvU8 *base) const = 0; + virtual uint16_t * inputHeightCSC(NvU8 *base) const = 0; + virtual uint16_t * inputChannelCSC(NvU8 *base) const = 0; + virtual uint16_t * kernelWidthCSC(NvU8 *base) const = 0; + virtual uint16_t * kernelHeightCSC(NvU8 *base) const = 0; + virtual uint16_t * kernelChannelCSC(NvU8 *base) const = 0; + virtual uint16_t * inputWidthCMAC(NvU8 *base) const = 0; + virtual uint16_t * inputHeightCMAC(NvU8 *base) const = 0; + virtual uint32_t * bytesPerKernel(NvU8 *base) const = 0; + +protected: + DLAConvOpDesc() { } + virtual ~DLAConvOpDesc() { } +}; + + +class DLAConvOpDescAccessor +{ +public: + NvU8 * struct_base() const; + size_t struct_size() const; + size_t struct_align() const; + + uint8_t * inPrecision() const; + uint8_t inPrecision_Int8() const; + uint8_t inPrecision_Int16() const; + uint8_t inPrecision_FP16() const; + uint8_t * outPrecision() const; + uint8_t outPrecision_Int8() const; + uint8_t outPrecision_Int16() const; + uint8_t outPrecision_FP16() const; + DLACVTParamAccessor inCVTAccessor() const; + DLACVTParamAccessor outCVTAccessor() const; + int16_t * padVal() const; + uint8_t * convMode() const; + uint8_t convMode_Direct() const; + uint8_t convMode_Winograd() const; + uint8_t * dataReuse() const; + uint8_t * weightReuse() const; + uint8_t * skipDataRls() const; + uint8_t * skipWeightRls() const; + uint8_t * reserved0() const; + uint16_t * entryPerSlice() const; + uint16_t * fetchGrain() const; + uint8_t * dataFormat() const; + uint8_t dataFormat_T_R8() const; + uint8_t dataFormat_T_R10() const; + uint8_t dataFormat_T_R12() const; + uint8_t dataFormat_T_R16() const; + uint8_t dataFormat_T_R16_I() const; + uint8_t dataFormat_T_R16_F() const; + uint8_t dataFormat_T_A16B16G16R16() const; + uint8_t dataFormat_T_X16B16G16R16() const; + uint8_t dataFormat_T_A16B16G16R16_F() const; + uint8_t dataFormat_T_A16Y16U16V16() const; + uint8_t dataFormat_T_V16U16Y16A16() const; + uint8_t dataFormat_T_A16Y16U16V16_F() const; + uint8_t dataFormat_T_A8B8G8R8() const; + uint8_t dataFormat_T_A8R8G8B8() const; + uint8_t dataFormat_T_B8G8R8A8() const; + uint8_t dataFormat_T_R8G8B8A8() const; + uint8_t dataFormat_T_X8B8G8R8() const; + uint8_t dataFormat_T_X8R8G8B8() const; + uint8_t dataFormat_T_B8G8R8X8() const; + uint8_t dataFormat_T_R8G8B8X8() const; + uint8_t dataFormat_T_A2B10G10R10() const; + uint8_t dataFormat_T_A2R10G10B10() const; + uint8_t dataFormat_T_B10G10R10A2() const; + uint8_t dataFormat_T_R10G10B10A2() const; + uint8_t dataFormat_T_Y8___U8V8_N444() const; + uint8_t dataFormat_T_Y8___V8U8_N444() const; + uint8_t dataFormat_T_Y10___U10V10_N444() const; + uint8_t dataFormat_T_Y10___V10U10_N444() const; + uint8_t dataFormat_T_Y12___U12V12_N444() const; + uint8_t dataFormat_T_Y12___V12U12_N444() const; + uint8_t dataFormat_T_Y16___U16V16_N444() const; + uint8_t dataFormat_T_Y16___V16U16_N444() const; + uint8_t dataFormat_T_Y16___U8V8_N444() const; + uint8_t dataFormat_T_Y16___V8U8_N444() const; + uint8_t dataFormat_T_Y8___U8___V8_N444() const; + uint8_t dataFormat_T_Y10___U10___V10_N444() const; + uint8_t dataFormat_T_Y12___U12___V12_N444() const; + uint8_t dataFormat_T_Y16___U16___V16_N444() const; + uint8_t dataFormat_T_Y16___U8___V8_N444() const; + uint8_t dataFormat_T_A2Y10U10V10() const; + uint8_t dataFormat_T_V10U10Y10A2() const; + uint8_t dataFormat_T_A8Y8U8V8() const; + uint8_t dataFormat_T_V8U8Y8A8() const; + uint8_t dataFormat_FEATURE() const; + uint8_t * pixelMapping() const; + uint8_t pixelMapping_PitchLinear() const; + uint8_t * batch() const; + uint8_t * weightFormat() const; + uint8_t weightFormat_Uncompressed() const; + uint8_t weightFormat_Compressed() const; + uint8_t * dataBank() const; + uint8_t * weightBank() const; + uint32_t * batchStride() const; + uint16_t * release() const; + uint8_t * postExtension() const; + uint8_t * reserved1_xxx() const; + uint8_t * pixelOverride() const; + uint8_t pixelOverride_UINT() const; + uint8_t pixelOverride_INT() const; + uint8_t * meanFormat() const; + uint8_t meanFormat_None() const; + uint8_t meanFormat_Global() const; + uint8_t meanFormat_PerPixel() const; + uint8_t meanFormat_Disable() const; + uint8_t meanFormat_Enable() const; + int16_t * meanRY() const; + int16_t * meanGU() const; + int16_t * meanBV() const; + int16_t * meanAX() const; + uint8_t * convStrideX() const; + uint8_t * convStrideY() const; + uint8_t * padXLeft() const; + uint8_t * padXRight() const; + uint8_t * padYTop() const; + uint8_t * padYBottom() const; + uint8_t * dilationX() const; + uint8_t * dilationY() const; + uint8_t * reserved2(size_t) const; + uint8_t * praTruncate() const; + uint16_t * inputWidthCSC() const; + uint16_t * inputHeightCSC() const; + uint16_t * inputChannelCSC() const; + uint16_t * kernelWidthCSC() const; + uint16_t * kernelHeightCSC() const; + uint16_t * kernelChannelCSC() const; + uint16_t * inputWidthCMAC() const; + uint16_t * inputHeightCMAC() const; + uint32_t * bytesPerKernel() const; + + DLAConvOpDescAccessor(NvU8 *base, const DLAConvOpDesc &); + +protected: + NvU8 *_base; + const DLAConvOpDesc &_l; +}; + +// +// struct dla_conv_stat_desc +// +class DLAConvStatDesc +{ +public: + virtual size_t struct_size() const = 0; + virtual size_t struct_align() const = 0; + + virtual uint32_t * dataReadStall(NvU8 *base) const = 0; + virtual uint32_t * weightReadStall(NvU8 *base) const = 0; + virtual uint32_t * dataReadLatency(NvU8 *base) const = 0; + virtual uint32_t * weightReadLatency(NvU8 *base) const = 0; + virtual uint32_t * saturationCount(NvU8 *base) const = 0; + virtual uint32_t * nanDataNum(NvU8 *base) const = 0; + virtual uint32_t * nanWeightNum(NvU8 *base) const = 0; + virtual uint32_t * infDataNum(NvU8 *base) const = 0; + virtual uint32_t * infWeightNum(NvU8 *base) const = 0; + virtual uint32_t * runtime(NvU8 *base) const = 0; + +protected: + DLAConvStatDesc() { } + virtual ~DLAConvStatDesc() { } +}; + +class DLAConvStatDescAccessor +{ +public: + NvU8 * struct_base() const; + size_t struct_size() const; + size_t struct_align() const; + + uint32_t * dataReadStall() const; + uint32_t * weightReadStall() const; + uint32_t * dataReadLatency() const; + uint32_t * weightReadLatency() const; + uint32_t * saturationCount() const; + uint32_t * nanDataNum() const; + uint32_t * nanWeightNum() const; + uint32_t * infDataNum() const; + uint32_t * infWeightNum() const; + uint32_t * runtime() const; + + DLAConvStatDescAccessor(NvU8 *base, const DLAConvStatDesc &); + +protected: + NvU8 *_base; + const DLAConvStatDesc &_l; +}; + +// +// union dla_lut_offset +// +class DLALUTOffset +{ +public: + virtual size_t struct_size() const = 0; + virtual size_t struct_align() const = 0; + + virtual uint8_t * expOffset_xxx(NvU8 *base) const = 0; + virtual int8_t * expOffset(NvU8 *base) const = 0; + virtual uint8_t * fracBits_xxx(NvU8 *base) const = 0; + virtual int8_t * fracBits(NvU8 *base) const = 0; + virtual uint16_t * reserved0(NvU8 *base) const = 0; + +protected: + DLALUTOffset() { } + virtual ~DLALUTOffset() { } +}; + + +class DLALUTOffsetAccessor +{ +public: + NvU8 * struct_base() const; + size_t struct_size() const; + size_t struct_align() const; + + uint8_t * expOffset_xxx() const; + int8_t * expOffset() const; + uint8_t * fracBits_xxx() const; + int8_t * fracBits() const; + uint16_t * reserved0() const; + + DLALUTOffsetAccessor(NvU8 *base, const DLALUTOffset &); + +protected: + NvU8 *_base; + const DLALUTOffset &_l; +}; + +// +// struct dla_float_data +// +class DLAFloatData +{ +public: + virtual size_t struct_size() const = 0; + virtual size_t struct_align() const = 0; + + virtual int16_t * scale(NvU8 *base) const = 0; + virtual uint8_t * shifter_xxx(NvU8 *base) const = 0; + virtual int8_t * shifter(NvU8 *base) const = 0; + virtual uint8_t * reserved0(NvU8 *base) const = 0; + +protected: + DLAFloatData() { } + virtual ~DLAFloatData() { } +}; + + +class DLAFloatDataAccessor +{ +public: + NvU8 * struct_base() const; + size_t struct_size() const; + size_t struct_align() const; + + int16_t * scale() const; + uint8_t * shifter_xxx() const; + int8_t * shifter() const; + uint8_t * reserved0() const; + + DLAFloatDataAccessor(NvU8 *base, const DLAFloatData &); + +protected: + NvU8 *_base; + const DLAFloatData &_l; +}; + +// +// struct dla_slope +// +class DLASlope +{ +public: + virtual size_t struct_size() const = 0; + virtual size_t struct_align() const = 0; + + virtual DLAFloatDataAccessor dataIAccessor(NvU8 *base) const = 0; + virtual uint16_t * dataF(NvU8 *base) const = 0; + +protected: + DLASlope() { } + virtual ~DLASlope() { } +}; + + +class DLASlopeAccessor +{ +public: + NvU8 * struct_base() const; + size_t struct_size() const; + size_t struct_align() const; + + DLAFloatDataAccessor dataIAccessor() const; + uint16_t * dataF() const; + + DLASlopeAccessor(NvU8 *base, const DLASlope &); + +protected: + NvU8 *_base; + const DLASlope &_l; +}; + +// +// struct dla_lut_param +// +class DLALUTParam +{ +public: + virtual size_t struct_size() const = 0; + virtual size_t struct_align() const = 0; + + virtual int16_t * linearExpTable(NvU8 *base, size_t i) const = 0; + virtual size_t numLinearExpTable() const = 0; + virtual int16_t * linearOnlyTable(NvU8 *base, size_t i) const = 0; + virtual size_t numLinearOnlyTable() const = 0; + + virtual uint8_t * method(NvU8 *base) const = 0; + virtual uint8_t method_Exponential() const = 0; + virtual uint8_t method_Linear() const = 0; + virtual DLALUTOffsetAccessor linearExpOffsetAccessor(NvU8 *base) const = 0; + virtual DLALUTOffsetAccessor linearOnlyOffsetAccessor(NvU8 *base) const = 0; + + virtual uint64_t * linearExpStart(NvU8 *base) const = 0; + virtual uint64_t * linearExpEnd(NvU8 *base) const = 0; + virtual uint64_t * linearOnlyStart(NvU8 *base) const = 0; + virtual uint64_t * linearOnlyEnd(NvU8 *base) const = 0; + + virtual DLASlopeAccessor linearExpUnderflowSlopeAccessor(NvU8 *base) const = 0; + virtual DLASlopeAccessor linearExpOverflowSlopeAccessor(NvU8 *base) const = 0; + virtual DLASlopeAccessor linearOnlyUnderflowSlopeAccessor(NvU8 *base) const = 0; + virtual DLASlopeAccessor linearOnlyOverflowSlopeAccessor(NvU8 *base) const = 0; + + virtual uint8_t * hybridPriority(NvU8 *base) const = 0; + virtual uint8_t * underflowPriority(NvU8 *base) const = 0; + virtual uint8_t * overflowPriority(NvU8 *base) const = 0; + virtual uint8_t priority_LinearExp() const = 0; + virtual uint8_t priority_LinearOnly() const = 0; + virtual int8_t * inputScaleLog2(NvU8 *base) const = 0; + +protected: + DLALUTParam() { } + virtual ~DLALUTParam() { } +}; + + +class DLALUTParamAccessor +{ +public: + NvU8 * struct_base() const; + size_t struct_size() const; + size_t struct_align() const; + + int16_t * linearExpTable(size_t i) const; + size_t numLinearExpTable() const; + int16_t * linearOnlyTable(size_t i) const; + size_t numLinearOnlyTable() const; + uint8_t * method() const; + uint8_t method_Exponential() const; + uint8_t method_Linear() const; + DLALUTOffsetAccessor linearExpOffsetAccessor() const; + DLALUTOffsetAccessor linearOnlyOffsetAccessor() const; + uint64_t * linearExpStart() const; + uint64_t * linearExpEnd() const; + uint64_t * linearOnlyStart() const; + uint64_t * linearOnlyEnd() const; + DLASlopeAccessor linearExpUnderflowSlopeAccessor() const; + DLASlopeAccessor linearExpOverflowSlopeAccessor() const; + DLASlopeAccessor linearOnlyUnderflowSlopeAccessor() const; + DLASlopeAccessor linearOnlyOverflowSlopeAccessor() const; + uint8_t * hybridPriority() const; + uint8_t * underflowPriority() const; + uint8_t * overflowPriority() const; + uint8_t priority_LinearExp() const; + uint8_t priority_LinearOnly() const; + int8_t * inputScaleLog2() const; + + DLALUTParamAccessor(NvU8 *base, const DLALUTParam &); + +protected: + NvU8 *_base; + const DLALUTParam &_l; +}; + +// +// struct dla_sdp_surface_desc +// +class DLASDPSurfaceDesc +{ +public: + virtual size_t struct_size() const = 0; + virtual size_t struct_align() const = 0; + + virtual DLADataCubeAccessor srcDataAccessor(NvU8 *base) const = 0; + virtual DLADataCubeAccessor x1DataAccessor(NvU8 *base) const = 0; + virtual DLADataCubeAccessor x2DataAccessor(NvU8 *base) const = 0; + virtual DLADataCubeAccessor yDataAccessor(NvU8 *base) const = 0; + virtual DLADataCubeAccessor dstDataAccessor(NvU8 *base) const = 0; + +protected: + DLASDPSurfaceDesc() { } + virtual ~DLASDPSurfaceDesc() { } +}; + + +class DLASDPSurfaceDescAccessor +{ +public: + NvU8 * struct_base() const; + size_t struct_size() const; + size_t struct_align() const; + + DLADataCubeAccessor srcDataAccessor() const; + DLADataCubeAccessor x1DataAccessor() const; + DLADataCubeAccessor x2DataAccessor() const; + DLADataCubeAccessor yDataAccessor() const; + DLADataCubeAccessor dstDataAccessor() const; + + DLASDPSurfaceDescAccessor(NvU8 *base, const DLASDPSurfaceDesc &); + +protected: + NvU8 *_base; + const DLASDPSurfaceDesc &_l; +}; + +class DLASDPCVT +{ +public: + virtual size_t struct_size() const = 0; + virtual size_t struct_align() const = 0; + + virtual DLACVTParamAccessor aluCVTAccessor(NvU8 *base) const = 0; + virtual DLACVTParamAccessor mulCVTAccessor(NvU8 *base) const = 0; + +protected: + DLASDPCVT() { } + virtual ~DLASDPCVT() { } +}; + +class DLASDPCVTAccessor +{ +public: + NvU8 * struct_base() const; + size_t struct_size() const; + size_t struct_align() const; + + DLACVTParamAccessor aluCVTAccessor() const; + DLACVTParamAccessor mulCVTAccessor() const; + + DLASDPCVTAccessor(NvU8 *base, const DLASDPCVT &); + +protected: + NvU8 * _base; + const DLASDPCVT &_l; +}; + +// +// dla_sdp_op +// +class DLASDPOp +{ +public: + virtual size_t struct_size() const = 0; + virtual size_t struct_align() const = 0; + + virtual uint8_t * enable(NvU8 *base) const = 0; + virtual uint8_t * ALUType(NvU8 *base) const = 0; + virtual uint8_t ALUType_Max() const = 0; + virtual uint8_t ALUType_Min() const = 0; + virtual uint8_t ALUType_Sum() const = 0; + virtual uint8_t ALUType_Eql() const = 0; + virtual uint8_t * type(NvU8 *base) const = 0; + virtual uint8_t type_None() const = 0; + virtual uint8_t type_Mul() const = 0; + virtual uint8_t type_Add() const = 0; + virtual uint8_t type_Both() const = 0; + virtual uint8_t * mode(NvU8 *base) const = 0; + virtual uint8_t mode_PerLayer() const = 0; + virtual uint8_t mode_PerKernel() const = 0; + virtual uint8_t mode_PerPoint() const = 0; + virtual uint8_t * act(NvU8 *base) const = 0; + virtual uint8_t act_None() const = 0; + virtual uint8_t act_RelU() const = 0; + virtual uint8_t act_LUT() const = 0; + virtual uint8_t * shiftValue(NvU8 *base) const = 0; + virtual int16_t * ALUOperand_xxx(NvU8 *base) const = 0; + virtual int16_t * MulOperand_xxx(NvU8 *base) const = 0; + virtual int32_t * ALUOperand(NvU8 *base) const = 0; + virtual int32_t * MulOperand(NvU8 *base) const = 0; + virtual uint8_t * truncate(NvU8 *base) const = 0; + virtual uint8_t * precision(NvU8 *base) const = 0; + virtual DLASDPCVTAccessor cvt(NvU8 *base) const = 0; + +protected: + DLASDPOp() { } + virtual ~DLASDPOp() { } +}; + + +class DLASDPOpAccessor +{ +public: + NvU8 * struct_base() const; + size_t struct_size() const; + size_t struct_align() const; + + uint8_t * enable() const; + uint8_t * ALUType() const; + uint8_t ALUType_Max() const; + uint8_t ALUType_Min() const; + uint8_t ALUType_Sum() const; + uint8_t ALUType_Eql() const; + uint8_t * type() const; + uint8_t type_None() const; + uint8_t type_Mul() const; + uint8_t type_Add() const; + uint8_t type_Both() const; + uint8_t * mode() const; + uint8_t mode_PerLayer() const; + uint8_t mode_PerKernel() const; + uint8_t mode_PerPoint() const; + uint8_t * act() const; + uint8_t act_None() const; + uint8_t act_RelU() const; + uint8_t act_LUT() const; + uint8_t * shiftValue() const; + int16_t * ALUOperand_xxx() const; + int16_t * MulOperand_xxx() const; + int32_t * ALUOperand() const; + int32_t * MulOperand() const; + uint8_t * truncate() const; + uint8_t * precision() const; + DLASDPCVTAccessor cvt() const; + + DLASDPOpAccessor(NvU8 *base, const DLASDPOp &); + +protected: + NvU8 *_base; + const DLASDPOp &_l; +}; + +// +// struct dla_sdp_op_desc +// +class DLASDPOpDesc +{ +public: + virtual size_t struct_size() const = 0; + virtual size_t struct_align() const = 0; + + virtual uint8_t * srcPrecision(NvU8 *base) const = 0; + virtual uint8_t srcPrecision_Int8() const = 0; + virtual uint8_t srcPrecision_Int16() const = 0; + virtual uint8_t srcPrecision_FP16() const = 0; + virtual uint8_t * dstPrecision(NvU8 *base) const = 0; + virtual uint8_t dstPrecision_Int8() const = 0; + virtual uint8_t dstPrecision_Int16() const = 0; + virtual uint8_t dstPrecision_FP16() const = 0; + virtual int16_t * LUTIndex(NvU8 *base) const = 0; + virtual DLACVTParamAccessor outCVTAccessor(NvU8 *base) const = 0; + virtual uint8_t * convMode(NvU8 *base) const = 0; + virtual uint8_t convMode_Direct() const = 0; + virtual uint8_t convMode_Winograd() const = 0; + virtual uint8_t * batchNum(NvU8 *base) const = 0; + virtual uint16_t * reserved0(NvU8 *base) const = 0; + virtual uint32_t * batchStride(NvU8 *base) const = 0; + virtual DLASDPOpAccessor x1OpAccessor(NvU8 *base) const = 0; + virtual DLASDPOpAccessor x2OpAccessor(NvU8 *base) const = 0; + virtual DLASDPOpAccessor yOpAccessor(NvU8 *base) const = 0; + +protected: + DLASDPOpDesc() { } + virtual ~DLASDPOpDesc() { } +}; + + +class DLASDPOpDescAccessor +{ +public: + NvU8 * struct_base() const; + size_t struct_size() const; + size_t struct_align() const; + + uint8_t * srcPrecision() const; + uint8_t srcPrecision_Int8() const; + uint8_t srcPrecision_Int16() const; + uint8_t srcPrecision_FP16() const; + uint8_t * dstPrecision() const; + uint8_t dstPrecision_Int8() const; + uint8_t dstPrecision_Int16() const; + uint8_t dstPrecision_FP16() const; + int16_t * LUTIndex() const; + DLACVTParamAccessor outCVTAccessor() const; + uint8_t * convMode() const; + uint8_t convMode_Direct() const; + uint8_t convMode_Winograd() const; + uint8_t * batchNum() const; + uint16_t * reserved0() const; + uint32_t * batchStride() const; + DLASDPOpAccessor x1OpAccessor() const; + DLASDPOpAccessor x2OpAccessor() const; + DLASDPOpAccessor yOpAccessor() const; + + DLASDPOpDescAccessor(NvU8 *base, const DLASDPOpDesc &); + +protected: + NvU8 *_base; + const DLASDPOpDesc &_l; +}; + +// +// struct dla_sdp_stat_desc +// +class DLASDPStatDesc +{ +public: + virtual size_t struct_size() const = 0; + virtual size_t struct_align() const = 0; + + virtual uint32_t * nanInputNum(NvU8* base) const = 0; + virtual uint32_t * infInputNum(NvU8* base) const = 0; + virtual uint32_t * nanOutputNum(NvU8* base) const = 0; + virtual uint32_t * wdmaWriteStall(NvU8* base) const = 0; + virtual uint32_t * lutUnderflow(NvU8* base) const = 0; + virtual uint32_t * lutOverflow(NvU8* base) const = 0; + virtual uint32_t * lutHybrid(NvU8* base) const = 0; + virtual uint32_t * lutLEHit(NvU8* base) const = 0; + virtual uint32_t * lutLOHit(NvU8* base) const = 0; + virtual uint32_t * saturationCount(NvU8* base) const = 0; + virtual uint32_t * runtime(NvU8* base) const = 0; + +protected: + DLASDPStatDesc() { } + virtual ~DLASDPStatDesc() { } +}; + +class DLASDPStatDescAccessor +{ +public: + NvU8 * struct_base() const; + size_t struct_size() const; + size_t struct_align() const; + + uint32_t * nanInputNum() const; + uint32_t * infInputNum() const; + uint32_t * nanOutputNum() const; + uint32_t * wdmaWriteStall() const; + uint32_t * lutUnderflow() const; + uint32_t * lutOverflow() const; + uint32_t * lutHybrid() const; + uint32_t * lutLEHit() const; + uint32_t * lutLOHit() const; + uint32_t * saturationCount() const; + uint32_t * runtime() const; + + DLASDPStatDescAccessor(NvU8 *base, const DLASDPStatDesc &); + +protected: + NvU8 *_base; + const DLASDPStatDesc &_l; +}; + +// +// struct dla_pdp_surface_desc +// +class DLAPDPSurfaceDesc +{ +public: + virtual size_t struct_size() const = 0; + virtual size_t struct_align() const = 0; + + virtual DLADataCubeAccessor srcDataAccessor(NvU8 *base) const = 0; + virtual DLADataCubeAccessor dstDataAccessor(NvU8 *base) const = 0; + +protected: + DLAPDPSurfaceDesc() { } + virtual ~DLAPDPSurfaceDesc() { } +}; + + +class DLAPDPSurfaceDescAccessor +{ +public: + NvU8 * struct_base() const; + size_t struct_size() const; + size_t struct_align() const; + + DLADataCubeAccessor srcDataAccessor() const; + DLADataCubeAccessor dstDataAccessor() const; + + DLAPDPSurfaceDescAccessor(NvU8 *base, const DLAPDPSurfaceDesc &); + +protected: + NvU8 *_base; + const DLAPDPSurfaceDesc &_l; +}; + +// +// dla_pdp_op_desc +// +class DLAPDPOpDesc +{ +public: + virtual size_t struct_size() const = 0; + virtual size_t struct_align() const = 0; + + virtual uint8_t *precision(NvU8 *base) const = 0; + virtual uint8_t precision_Int8() const = 0; + virtual uint8_t precision_Int16() const = 0; + virtual uint8_t precision_FP16() const = 0; + virtual uint8_t *reserved0_xxx(NvU8 *base, size_t i) const = 0; + virtual uint8_t *reserved0(NvU8 *base) const = 0; + virtual int16_t *paddingValue_xxx(NvU8 *base, size_t i) const = 0; + virtual int32_t *paddingValue(NvU8 *base, size_t i) const = 0; + virtual uint8_t *splitNum(NvU8 *base) const = 0; + virtual uint8_t *reserved1_xxx(NvU8 *base, size_t i) const = 0; + virtual uint16_t *partialInWidthFirst(NvU8 *base) const = 0; + virtual uint16_t *partialInWidthMid(NvU8 *base) const = 0; + virtual uint16_t *partialInWidthLast(NvU8 *base) const = 0; + + virtual uint16_t *partialWidthFirst(NvU8 *base) const = 0; + virtual uint16_t *partialWidthMid(NvU8 *base) const = 0; + virtual uint16_t *partialWidthLast(NvU8 *base) const = 0; + + virtual uint8_t *poolMode(NvU8 *base) const = 0; + virtual uint8_t poolMode_AVG() const = 0; + virtual uint8_t poolMode_MAX() const = 0; + virtual uint8_t poolMode_MIN() const = 0; + virtual uint8_t *poolWidth(NvU8 *base) const = 0; + virtual uint8_t *poolHeight(NvU8 *base) const = 0; + virtual uint8_t *reserved2_xxx(NvU8 *base) const = 0; + + virtual uint8_t *strideX(NvU8 *base) const = 0; + virtual uint8_t *strideY(NvU8 *base) const = 0; + virtual uint16_t *strideX_xxx(NvU8 *base) const = 0; + virtual uint16_t *strideY_xxx(NvU8 *base) const = 0; + virtual uint16_t *reserved3_xxx(NvU8 *base) const = 0; + + virtual uint8_t *padLeft(NvU8 *base) const = 0; + virtual uint8_t *padRight(NvU8 *base) const = 0; + virtual uint8_t *padTop(NvU8 *base) const = 0; + virtual uint8_t *padBottom(NvU8 *base) const = 0; + +protected: + DLAPDPOpDesc() { } + virtual ~DLAPDPOpDesc() { } +}; + +class DLAPDPOpDescAccessor +{ +public: + NvU8 * struct_base() const; + size_t struct_size() const; + size_t struct_align() const; + + uint8_t *precision() const; + uint8_t precision_Int8() const; + uint8_t precision_Int16() const; + uint8_t precision_FP16() const; + uint8_t *reserved0_xxx(size_t i) const; + uint8_t *reserved0() const; + + int16_t *paddingValue_xxx(size_t i) const; + int32_t *paddingValue(size_t i) const; + uint8_t *splitNum() const; + uint8_t *reserved1_xxx(size_t i) const; + uint16_t *partialInWidthFirst() const; + uint16_t *partialInWidthMid() const; + uint16_t *partialInWidthLast() const; + + uint16_t *partialWidthFirst() const; + uint16_t *partialWidthMid() const; + uint16_t *partialWidthLast() const; + + uint8_t *poolMode() const; + uint8_t poolMode_AVG() const; + uint8_t poolMode_MAX() const; + uint8_t poolMode_MIN() const; + uint8_t *poolWidth() const; + uint8_t *poolHeight() const; + uint8_t *reserved2_xxx() const; + + uint8_t *strideX() const; + uint8_t *strideY() const; + uint16_t *strideX_xxx() const; + uint16_t *strideY_xxx() const; + uint16_t *reserved3_xxx() const; + + uint8_t *padLeft() const; + uint8_t *padRight() const; + uint8_t *padTop() const; + uint8_t *padBottom() const; + + DLAPDPOpDescAccessor(NvU8 *base, const DLAPDPOpDesc &); + +protected: + NvU8 *_base; + const DLAPDPOpDesc &_l; +}; + + +// +// struct dla_pdp_stat_desc +// +class DLAPDPStatDesc +{ +public: + virtual size_t struct_size() const = 0; + virtual size_t struct_align() const = 0; + + + virtual uint32_t * infInputNum(NvU8* base) const = 0; + virtual uint32_t * nanInputNum(NvU8* base) const = 0; + virtual uint32_t * nanOutputNum(NvU8* base) const = 0; + virtual uint32_t * writeStall(NvU8* base) const = 0; + virtual uint32_t * runtime(NvU8* base) const = 0; + +protected: + DLAPDPStatDesc() { } + virtual ~DLAPDPStatDesc() { } +}; + +class DLAPDPStatDescAccessor +{ +public: + NvU8 * struct_base() const; + size_t struct_size() const; + size_t struct_align() const; + + uint32_t * infInputNum() const; + uint32_t * nanInputNum() const; + uint32_t * nanOutputNum() const; + uint32_t * writeStall() const; + uint32_t * runtime() const; + + DLAPDPStatDescAccessor(NvU8 *base, const DLAPDPStatDesc &); + +protected: + NvU8 *_base; + const DLAPDPStatDesc &_l; +}; + +// +// dla_cdp_surface_desc +// +class DLACDPSurfaceDesc +{ +public: + virtual size_t struct_size() const = 0; + virtual size_t struct_align() const = 0; + + virtual DLADataCubeAccessor srcDataAccessor(NvU8 *base) const = 0; + virtual DLADataCubeAccessor dstDataAccessor(NvU8 *base) const = 0; + +protected: + DLACDPSurfaceDesc() { } + virtual ~DLACDPSurfaceDesc() { } +}; + + +class DLACDPSurfaceDescAccessor +{ +public: + NvU8 * struct_base() const; + size_t struct_size() const; + size_t struct_align() const; + + DLADataCubeAccessor srcDataAccessor() const; + DLADataCubeAccessor dstDataAccessor() const; + + DLACDPSurfaceDescAccessor(NvU8 *base, const DLACDPSurfaceDesc &); + +protected: + NvU8 *_base; + const DLACDPSurfaceDesc &_l; +}; + +// +// dla_cdp_op_desc +// +class DLACDPOpDesc +{ +public: + virtual size_t struct_size() const = 0; + virtual size_t struct_align() const = 0; + + virtual uint8_t *inPrecision(NvU8 *base) const = 0; + virtual uint8_t inPrecision_Int8() const = 0; + virtual uint8_t inPrecision_Int16() const = 0; + virtual uint8_t inPrecision_FP16() const = 0; + virtual uint8_t *outPrecision(NvU8 *base) const = 0; + virtual uint8_t outPrecision_Int8() const = 0; + virtual uint8_t outPrecision_Int16() const = 0; + virtual uint8_t outPrecision_FP16() const = 0; + virtual int16_t *LUTIndex(NvU8 *base) const = 0; + virtual DLACVTParamAccessor inCVTAccessor(NvU8 *base) const = 0; + virtual DLACVTParamAccessor outCVTAccessor(NvU8 *base) const = 0; + virtual uint8_t *localSize(NvU8 *base) const = 0; + virtual uint8_t *bypassSquareSum(NvU8 *base) const = 0; + virtual uint8_t *bypassOutMul(NvU8 *base) const = 0; + virtual uint8_t *reserved0(NvU8 *base) const = 0; + +protected: + DLACDPOpDesc() { } + virtual ~DLACDPOpDesc() { } +}; + +class DLACDPOpDescAccessor +{ +public: + NvU8 * struct_base() const; + size_t struct_size() const; + size_t struct_align() const; + + uint8_t *inPrecision() const; + uint8_t inPrecision_Int8() const; + uint8_t inPrecision_Int16() const; + uint8_t inPrecision_FP16() const; + uint8_t *outPrecision() const; + uint8_t outPrecision_Int8() const; + uint8_t outPrecision_Int16() const; + uint8_t outPrecision_FP16() const; + int16_t *LUTIndex() const; + DLACVTParamAccessor inCVTAccessor() const; + DLACVTParamAccessor outCVTAccessor() const; + uint8_t *localSize() const; + uint8_t *bypassSquareSum() const; + uint8_t *bypassOutMul() const; + uint8_t *reserved0() const; + + DLACDPOpDescAccessor(NvU8 *base, const DLACDPOpDesc &); + +protected: + NvU8 *_base; + const DLACDPOpDesc &_l; +}; + +// +// struct dla_cdp_stat_desc +// +class DLACDPStatDesc +{ +public: + virtual size_t struct_size() const = 0; + virtual size_t struct_align() const = 0; + + virtual uint32_t * nanInputNum(NvU8* base) const = 0; + virtual uint32_t * infInputNum(NvU8* base) const = 0; + virtual uint32_t * nanOutputNum(NvU8* base) const = 0; + virtual uint32_t * writeStall(NvU8* base) const = 0; + virtual uint32_t * lutUflow(NvU8* base) const = 0; + virtual uint32_t * lutOflow(NvU8* base) const = 0; + virtual uint32_t * lutHybrid(NvU8* base) const = 0; + virtual uint32_t * lutLEHit(NvU8* base) const = 0; + virtual uint32_t * lutLOHit(NvU8* base) const = 0; + virtual uint32_t * saturationCount(NvU8* base) const = 0; + virtual uint32_t * runtime(NvU8* base) const = 0; + +protected: + DLACDPStatDesc() { } + virtual ~DLACDPStatDesc() { } +}; + +class DLACDPStatDescAccessor +{ +public: + NvU8 * struct_base() const; + size_t struct_size() const; + size_t struct_align() const; + + uint32_t * nanInputNum() const; + uint32_t * infInputNum() const; + uint32_t * nanOutputNum() const; + uint32_t * writeStall() const; + uint32_t * lutUflow() const; + uint32_t * lutOflow() const; + uint32_t * lutHybrid() const; + uint32_t * lutLEHit() const; + uint32_t * lutLOHit() const; + uint32_t * saturationCount() const; + uint32_t * runtime() const; + + DLACDPStatDescAccessor(NvU8 *base, const DLACDPStatDesc &); + +protected: + NvU8 *_base; + const DLACDPStatDesc &_l; +}; + +// +// struct dla_rubik_surface_desc +// +class DLARubikSurfaceDesc +{ +public: + virtual size_t struct_size() const = 0; + virtual size_t struct_align() const = 0; + + virtual DLADataCubeAccessor srcDataAccessor(NvU8 *base) const = 0; + virtual DLADataCubeAccessor dstDataAccessor(NvU8 *base) const = 0; + +protected: + DLARubikSurfaceDesc() { } + virtual ~DLARubikSurfaceDesc() { } +}; + + +class DLARubikSurfaceDescAccessor +{ +public: + NvU8 * struct_base() const; + size_t struct_size() const; + size_t struct_align() const; + + DLADataCubeAccessor srcDataAccessor() const; + DLADataCubeAccessor dstDataAccessor() const; + + DLARubikSurfaceDescAccessor(NvU8 *base, const DLARubikSurfaceDesc &); + +protected: + NvU8 *_base; + const DLARubikSurfaceDesc &_l; +}; + + +// +// dla_rubik_op_desc +// +class DLARubikOpDesc +{ +public: + virtual size_t struct_size() const = 0; + virtual size_t struct_align() const = 0; + + virtual uint8_t *mode(NvU8 *base) const =0; + virtual uint8_t mode_Contract() const = 0; + virtual uint8_t mode_Split() const = 0; + virtual uint8_t mode_Merge() const = 0; + virtual uint8_t *precision(NvU8 *base) const = 0; + virtual uint8_t precision_Int8() const = 0; + virtual uint8_t precision_Int16() const = 0; + virtual uint8_t precision_FP16() const = 0; + virtual uint8_t *strideX(NvU8 *base) const = 0; + virtual uint8_t *strideY(NvU8 *base) const = 0; + +protected: + DLARubikOpDesc() { } + virtual ~DLARubikOpDesc() { } +}; + +class DLARubikOpDescAccessor +{ +public: + NvU8 * struct_base() const; + size_t struct_size() const; + size_t struct_align() const; + + uint8_t *mode() const; + uint8_t mode_Contract() const; + uint8_t mode_Split() const; + uint8_t mode_Merge() const; + uint8_t *precision() const; + uint8_t precision_Int8() const; + uint8_t precision_Int16() const; + uint8_t precision_FP16() const; + uint8_t *strideX() const; + uint8_t *strideY() const; + + DLARubikOpDescAccessor(NvU8 *base, const DLARubikOpDesc &); + +protected: + NvU8 *_base; + const DLARubikOpDesc &_l; +}; + +// +// struct dla_rubik_stat_desc +// +class DLARubikStatDesc +{ +public: + virtual size_t struct_size() const = 0; + virtual size_t struct_align() const = 0; + + virtual uint32_t * readStall(NvU8* base) const = 0; + virtual uint32_t * writeStall(NvU8* base) const = 0; + virtual uint32_t * runtime(NvU8* base) const = 0; + +protected: + DLARubikStatDesc() { } + virtual ~DLARubikStatDesc() { } +}; + +class DLARubikStatDescAccessor +{ +public: + NvU8 * struct_base() const; + size_t struct_size() const; + size_t struct_align() const; + + uint32_t * readStall() const; + uint32_t * writeStall() const; + uint32_t * runtime() const; + + DLARubikStatDescAccessor(NvU8 *base, const DLARubikStatDesc &); + +protected: + NvU8 *_base; + const DLARubikStatDesc &_l; +}; + +// +// union dla_surface_container +// +class DLASurfaceContainer +{ +public: + virtual size_t struct_size() const = 0; + virtual size_t struct_align() const = 0; + + virtual DLABDMASurfaceDescAccessor bdmaSurfaceDescAccessor(NvU8 *b, size_t c) const = 0; + virtual DLAConvSurfaceDescAccessor convSurfaceDescAccessor(NvU8 *b, size_t c) const = 0; + virtual DLASDPSurfaceDescAccessor sdpSurfaceDescAccessor (NvU8 *b, size_t c) const = 0; + virtual DLAPDPSurfaceDescAccessor pdpSurfaceDescAccessor (NvU8 *b, size_t c) const = 0; + virtual DLACDPSurfaceDescAccessor cdpSurfaceDescAccessor (NvU8 *b, size_t c) const = 0; + virtual DLARubikSurfaceDescAccessor rubikSurfaceDescAccessor(NvU8 *b, size_t c) const = 0; + +protected: + DLASurfaceContainer() { } + virtual ~DLASurfaceContainer() { } +}; + + +class DLASurfaceContainerAccessor +{ +public: + NvU8 * struct_base() const; + size_t struct_size() const; + size_t struct_align() const; + + DLABDMASurfaceDescAccessor bdmaSurfaceDescAccessor(size_t c) const; + DLAConvSurfaceDescAccessor convSurfaceDescAccessor(size_t c) const; + DLASDPSurfaceDescAccessor sdpSurfaceDescAccessor(size_t c) const; + DLAPDPSurfaceDescAccessor pdpSurfaceDescAccessor(size_t c) const; + DLACDPSurfaceDescAccessor cdpSurfaceDescAccessor(size_t c) const; + DLARubikSurfaceDescAccessor rubikSurfaceDescAccessor(size_t c) const; + + DLASurfaceContainerAccessor(NvU8 *base, const DLASurfaceContainer &); + +protected: + NvU8 *_base; + const DLASurfaceContainer &_l; +}; + +// +// union dla_operation_container +// +class DLAOperationContainer +{ +public: + virtual size_t struct_size() const = 0; + virtual size_t struct_align() const = 0; + + virtual DLABDMAOpDescAccessor bdmaOpDescAccessor(NvU8 *b, size_t c) const = 0; + virtual DLAConvOpDescAccessor convOpDescAccessor(NvU8 *b, size_t c) const = 0; + virtual DLASDPOpDescAccessor sdpOpDescAccessor(NvU8 *b, size_t c) const = 0; + virtual DLAPDPOpDescAccessor pdpOpDescAccessor(NvU8 *b, size_t c) const = 0; + virtual DLACDPOpDescAccessor cdpOpDescAccessor(NvU8 *b, size_t c) const = 0; + virtual DLARubikOpDescAccessor rubikOpDescAccessor(NvU8 *b, size_t c) const = 0; + +protected: + DLAOperationContainer() { } + virtual ~DLAOperationContainer() { } +}; + + +class DLAOperationContainerAccessor +{ +public: + NvU8 * struct_base() const; + size_t struct_size() const; + size_t struct_align() const; + + DLABDMAOpDescAccessor bdmaOpDescAccessor(size_t c) const; + DLAConvOpDescAccessor convOpDescAccessor(size_t c) const; + DLASDPOpDescAccessor sdpOpDescAccessor(size_t c) const; + DLAPDPOpDescAccessor pdpOpDescAccessor(size_t c) const; + DLACDPOpDescAccessor cdpOpDescAccessor(size_t c) const; + DLARubikOpDescAccessor rubikOpDescAccessor(size_t c) const; + + DLAOperationContainerAccessor(NvU8 *base, const DLAOperationContainer &); + +protected: + NvU8 *_base; + const DLAOperationContainer &_l; +}; + +// +// union dla_stat_container +// +class DLAStatContainer +{ +public: + virtual size_t struct_size() const = 0; + virtual size_t struct_align() const = 0; + + virtual DLABDMAStatDescAccessor bdmaStatDescAccessor(NvU8 *b, size_t c) const = 0; + virtual DLAConvStatDescAccessor convStatDescAccessor(NvU8 *b, size_t c) const = 0; + virtual DLASDPStatDescAccessor sdpStatDescAccessor(NvU8 *b, size_t c) const = 0; + virtual DLAPDPStatDescAccessor pdpStatDescAccessor(NvU8 *b, size_t c) const = 0; + virtual DLACDPStatDescAccessor cdpStatDescAccessor(NvU8 *b, size_t c) const = 0; + virtual DLARubikStatDescAccessor rubikStatDescAccessor(NvU8 *b, size_t c) const = 0; + +protected: + DLAStatContainer() { } + virtual ~DLAStatContainer() { } +}; + +class DLAStatContainerAccessor +{ +public: + NvU8 * struct_base() const; + size_t struct_size() const; + size_t struct_align() const; + + DLABDMAStatDescAccessor bdmaStatDescAccessor(size_t c) const; + DLAConvStatDescAccessor convStatDescAccessor(size_t c) const; + DLASDPStatDescAccessor sdpStatDescAccessor(size_t c) const; + DLAPDPStatDescAccessor pdpStatDescAccessor(size_t c) const; + DLACDPStatDescAccessor cdpStatDescAccessor(size_t c) const; + DLARubikStatDescAccessor rubikStatDescAccessor(size_t c) const; + + DLAStatContainerAccessor(NvU8 *base, const DLAStatContainer &l); + +protected: + NvU8 * _base; + const DLAStatContainer &_l; +}; + +class DLAInterface +{ +public: + virtual ~DLAInterface() { } + + // these are the targetted versions + virtual NvU8 firmwareTargetVersionMajor() const = 0; + virtual NvU8 firmwareTargetVersionMinor() const = 0; + virtual NvU8 firmwareTargetVersionSubminor() const = 0; + virtual NvU32 firmwareTargetVersion() const = 0; + + virtual NvU8 firmwareVersionMajor() const = 0; + virtual NvU8 firmwareVersionMinor() const = 0; + virtual NvU8 firmwareVersionSubminor() const = 0; + virtual NvU32 firmwareVersion() const = 0; + + DLANetworkDescAccessor networkDescAccessor(NvU8 *b) const; + DLAConsumerAccessor consumerAccessor(NvU8 *b) const; + DLACommonOpDescAccessor commonOpDescAccessor(NvU8 *b) const; + DLACVTParamAccessor cvtParamAccessor(NvU8 *b) const; + DLADataCubeAccessor dataCubeAccessor(NvU8 *b) const; + DLAConvSurfaceDescAccessor convSurfaceDescAccessor(NvU8 *b) const; + DLAConvOpDescAccessor convOpDescAccessor(NvU8 *b) const; + DLALUTOffsetAccessor lutOffsetAccessor(NvU8 *b) const; + DLAFloatDataAccessor floatDataAccessor(NvU8 *b) const; + DLASlopeAccessor slopeAccessor(NvU8 *b) const; + DLALUTParamAccessor lutParamAccessor(NvU8 *b) const; + DLASDPSurfaceDescAccessor sdpSurfaceDescAccessor(NvU8 *b) const; + DLASDPOpAccessor sdpOpAccessor(NvU8 *b) const; + DLASDPOpDescAccessor sdpOpDescAccessor(NvU8 *b) const; + DLASDPCVTAccessor sdpCVTAccessor(NvU8 *b) const; + DLAPDPSurfaceDescAccessor pdpSurfaceDescAccessor(NvU8 *b) const; + DLAPDPOpDescAccessor pdpOpDescAccessor(NvU8 *b) const; + DLACDPSurfaceDescAccessor cdpSurfaceDescAccessor(NvU8 *b) const; + DLACDPOpDescAccessor cdpOpDescAccessor(NvU8 *b) const; + DLARubikSurfaceDescAccessor rubikSurfaceDescAccessor(NvU8 *b) const; + DLARubikOpDescAccessor rubikOpDescAccessor(NvU8 *b) const; + DLASurfaceContainerAccessor surfaceContainerAccessor(NvU8 *b) const; + DLAOperationContainerAccessor operationContainerAccessor(NvU8 *b) const; + +protected: + virtual const DLANetworkDesc & networkDesc() const = 0; + virtual const DLAConsumer & consumer() const = 0; + virtual const DLACommonOpDesc & commonOpDesc() const = 0; + virtual const DLACVTParam & cvtParam() const = 0; + virtual const DLADataCube & dataCube() const = 0; + virtual const DLAConvSurfaceDesc & convSurfaceDesc() const = 0; + virtual const DLAConvOpDesc & convOpDesc()const = 0; + virtual const DLALUTOffset & lutOffset() const = 0; + virtual const DLAFloatData & floatData() const = 0; + virtual const DLASlope & slope() const = 0; + virtual const DLALUTParam & lutParam() const = 0; + virtual const DLASDPSurfaceDesc & sdpSurfaceDesc() const = 0; + virtual const DLASDPOp & sdpOp() const = 0; + virtual const DLASDPOpDesc & sdpOpDesc() const = 0; + virtual const DLASDPCVT & sdpCVT() const = 0; + virtual const DLAPDPSurfaceDesc & pdpSurfaceDesc() const = 0; + virtual const DLAPDPOpDesc & pdpOpDesc() const = 0; + virtual const DLACDPSurfaceDesc & cdpSurfaceDesc() const = 0; + virtual const DLACDPOpDesc & cdpOpDesc() const = 0; + virtual const DLARubikSurfaceDesc & rubikSurfaceDesc() const = 0; + virtual const DLARubikOpDesc & rubikOpDesc() const = 0; + virtual const DLASurfaceContainer & surfaceContainer() const = 0; + virtual const DLAOperationContainer & operationContainer() const = 0; +}; + + + +class DLAInterfaceA : public DLAInterface +{ +public: + virtual ~DLAInterfaceA() { } + + virtual NvU8 firmwareTargetVersionMajor() const; + virtual NvU8 firmwareTargetVersionMinor() const; + virtual NvU8 firmwareTargetVersionSubminor() const; + virtual NvU32 firmwareTargetVersion() const; + + virtual NvU8 firmwareVersionMajor() const; + virtual NvU8 firmwareVersionMinor() const; + virtual NvU8 firmwareVersionSubminor() const; + virtual NvU32 firmwareVersion() const; + + DLANetworkDescAccessor networkDescAccessor(NvU8 *b) const; + DLAConsumerAccessor consumerAccessor(NvU8 *b) const; + DLACommonOpDescAccessor commonOpDescAccessor(NvU8 *b) const; + DLACVTParamAccessor cvtParamAccessor(NvU8 *b) const; + DLADataCubeAccessor dataCubeAccessor(NvU8 *b) const; + DLAConvSurfaceDescAccessor convSurfaceDescAccessor(NvU8 *b) const; + DLAConvOpDescAccessor convOpDescAccessor(NvU8 *b) const; + DLALUTOffsetAccessor lutOffsetAccessor(NvU8 *b) const; + DLAFloatDataAccessor floatDataAccessor(NvU8 *b) const; + DLASlopeAccessor slopeAccessor(NvU8 *b) const; + DLALUTParamAccessor lutParamAccessor(NvU8 *b) const; + DLASDPSurfaceDescAccessor sdpSurfaceDescAccessor(NvU8 *b) const; + DLASDPOpAccessor sdpOpAccessor(NvU8 *b) const; + DLASDPOpDescAccessor sdpOpDescAccessor(NvU8 *b) const; + DLAPDPSurfaceDescAccessor pdpSurfaceDescAccessor(NvU8 *b) const; + DLAPDPOpDescAccessor pdpOpDescAccessor(NvU8 *b) const; + DLACDPSurfaceDescAccessor cdpSurfaceDescAccessor(NvU8 *b) const; + DLACDPOpDescAccessor cdpOpDescAccessor(NvU8 *b) const; + DLARubikSurfaceDescAccessor rubikSurfaceDescAccessor(NvU8 *b) const; + DLARubikOpDescAccessor rubikOpDescAccessor(NvU8 *b) const; + DLASurfaceContainerAccessor surfaceContainerAccessor(NvU8 *b) const; + DLAOperationContainerAccessor operationContainerAccessor(NvU8 *b) const; + +protected: + virtual const DLANetworkDesc & networkDesc() const; + virtual const DLAConsumer & consumer() const; + virtual const DLACommonOpDesc & commonOpDesc() const; + virtual const DLACVTParam & cvtParam() const; + virtual const DLADataCube & dataCube() const; + virtual const DLAConvSurfaceDesc & convSurfaceDesc() const; + virtual const DLAConvOpDesc & convOpDesc() const; + virtual const DLALUTOffset & lutOffset() const; + virtual const DLAFloatData & floatData() const; + virtual const DLASlope & slope() const; + virtual const DLALUTParam & lutParam() const; + virtual const DLASDPSurfaceDesc & sdpSurfaceDesc() const; + virtual const DLASDPOp & sdpOp() const; + virtual const DLASDPOpDesc & sdpOpDesc() const; + virtual const DLASDPCVT & sdpCVT() const; + virtual const DLAPDPSurfaceDesc & pdpSurfaceDesc() const; + virtual const DLAPDPOpDesc & pdpOpDesc() const; + virtual const DLACDPSurfaceDesc & cdpSurfaceDesc() const; + virtual const DLACDPOpDesc & cdpOpDesc() const; + virtual const DLARubikSurfaceDesc & rubikSurfaceDesc() const; + virtual const DLARubikOpDesc & rubikOpDesc() const; + virtual const DLASurfaceContainer & surfaceContainer() const; + virtual const DLAOperationContainer & operationContainer() const; + // virtual const & () const; + // virtual const & () const; +}; + + + + +class DLAInterfaceB : public DLAInterface +{ +public: + virtual ~DLAInterfaceB() { } + + virtual NvU8 firmwareTargetVersionMajor() const; + virtual NvU8 firmwareTargetVersionMinor() const; + virtual NvU8 firmwareTargetVersionSubminor() const; + virtual NvU32 firmwareTargetVersion() const; + + virtual NvU8 firmwareVersionMajor() const; + virtual NvU8 firmwareVersionMinor() const; + virtual NvU8 firmwareVersionSubminor() const; + virtual NvU32 firmwareVersion() const; + + DLANetworkDescAccessor networkDescAccessor(NvU8 *b) const; + DLAConsumerAccessor consumerAccessor(NvU8 *b) const; + DLACommonOpDescAccessor commonOpDescAccessor(NvU8 *b) const; + DLACVTParamAccessor cvtParamAccessor(NvU8 *b) const; + DLADataCubeAccessor dataCubeAccessor(NvU8 *b) const; + DLAConvSurfaceDescAccessor convSurfaceDescAccessor(NvU8 *b) const; + DLAConvOpDescAccessor convOpDescAccessor(NvU8 *b) const; + DLALUTOffsetAccessor lutOffsetAccessor(NvU8 *b) const; + DLAFloatDataAccessor floatDataAccessor(NvU8 *b) const; + DLASlopeAccessor slopeAccessor(NvU8 *b) const; + DLALUTParamAccessor lutParamAccessor(NvU8 *b) const; + DLASDPSurfaceDescAccessor sdpSurfaceDescAccessor(NvU8 *b) const; + DLASDPOpAccessor sdpOpAccessor(NvU8 *b) const; + DLASDPOpDescAccessor sdpOpDescAccessor(NvU8 *b) const; + DLAPDPSurfaceDescAccessor pdpSurfaceDescAccessor(NvU8 *b) const; + DLAPDPOpDescAccessor pdpOpDescAccessor(NvU8 *b) const; + DLACDPSurfaceDescAccessor cdpSurfaceDescAccessor(NvU8 *b) const; + DLACDPOpDescAccessor cdpOpDescAccessor(NvU8 *b) const; + DLARubikSurfaceDescAccessor rubikSurfaceDescAccessor(NvU8 *b) const; + DLARubikOpDescAccessor rubikOpDescAccessor(NvU8 *b) const; + DLASurfaceContainerAccessor surfaceContainerAccessor(NvU8 *b) const; + DLAOperationContainerAccessor operationContainerAccessor(NvU8 *b) const; + +protected: + virtual const DLANetworkDesc & networkDesc() const; + virtual const DLAConsumer & consumer() const; + virtual const DLACommonOpDesc & commonOpDesc() const; + virtual const DLACVTParam & cvtParam() const; + virtual const DLADataCube & dataCube() const; + virtual const DLAConvSurfaceDesc & convSurfaceDesc() const; + virtual const DLAConvOpDesc & convOpDesc() const; + virtual const DLALUTOffset & lutOffset() const; + virtual const DLAFloatData & floatData() const; + virtual const DLASlope & slope() const; + virtual const DLALUTParam & lutParam() const; + virtual const DLASDPSurfaceDesc & sdpSurfaceDesc() const; + virtual const DLASDPOp & sdpOp() const; + virtual const DLASDPOpDesc & sdpOpDesc() const; + virtual const DLASDPCVT & sdpCVT() const; + virtual const DLAPDPSurfaceDesc & pdpSurfaceDesc() const; + virtual const DLAPDPOpDesc & pdpOpDesc() const; + virtual const DLACDPSurfaceDesc & cdpSurfaceDesc() const; + virtual const DLACDPOpDesc & cdpOpDesc() const; + virtual const DLARubikSurfaceDesc & rubikSurfaceDesc() const; + virtual const DLARubikOpDesc & rubikOpDesc() const; + virtual const DLASurfaceContainer & surfaceContainer() const; + virtual const DLAOperationContainer & operationContainer() const; + // virtual const & () const; + // virtual const & () const; +}; + + +class DLAInterfaceC : public DLAInterface +{ +public: + virtual ~DLAInterfaceC() { } + + virtual NvU8 firmwareTargetVersionMajor() const; + virtual NvU8 firmwareTargetVersionMinor() const; + virtual NvU8 firmwareTargetVersionSubminor() const; + virtual NvU32 firmwareTargetVersion() const; + + virtual NvU8 firmwareVersionMajor() const; + virtual NvU8 firmwareVersionMinor() const; + virtual NvU8 firmwareVersionSubminor() const; + virtual NvU32 firmwareVersion() const; + + DLANetworkDescAccessor networkDescAccessor(NvU8 *b) const; + DLAConsumerAccessor consumerAccessor(NvU8 *b) const; + DLACommonOpDescAccessor commonOpDescAccessor(NvU8 *b) const; + DLACVTParamAccessor cvtParamAccessor(NvU8 *b) const; + DLADataCubeAccessor dataCubeAccessor(NvU8 *b) const; + DLAConvSurfaceDescAccessor convSurfaceDescAccessor(NvU8 *b) const; + DLAConvOpDescAccessor convOpDescAccessor(NvU8 *b) const; + DLALUTOffsetAccessor lutOffsetAccessor(NvU8 *b) const; + DLAFloatDataAccessor floatDataAccessor(NvU8 *b) const; + DLASlopeAccessor slopeAccessor(NvU8 *b) const; + DLALUTParamAccessor lutParamAccessor(NvU8 *b) const; + DLASDPSurfaceDescAccessor sdpSurfaceDescAccessor(NvU8 *b) const; + DLASDPOpAccessor sdpOpAccessor(NvU8 *b) const; + DLASDPOpDescAccessor sdpOpDescAccessor(NvU8 *b) const; + DLAPDPSurfaceDescAccessor pdpSurfaceDescAccessor(NvU8 *b) const; + DLAPDPOpDescAccessor pdpOpDescAccessor(NvU8 *b) const; + DLACDPSurfaceDescAccessor cdpSurfaceDescAccessor(NvU8 *b) const; + DLACDPOpDescAccessor cdpOpDescAccessor(NvU8 *b) const; + DLARubikSurfaceDescAccessor rubikSurfaceDescAccessor(NvU8 *b) const; + DLARubikOpDescAccessor rubikOpDescAccessor(NvU8 *b) const; + DLASurfaceContainerAccessor surfaceContainerAccessor(NvU8 *b) const; + DLAOperationContainerAccessor operationContainerAccessor(NvU8 *b) const; + +protected: + virtual const DLANetworkDesc & networkDesc() const; + virtual const DLAConsumer & consumer() const; + virtual const DLACommonOpDesc & commonOpDesc() const; + virtual const DLACVTParam & cvtParam() const; + virtual const DLADataCube & dataCube() const; + virtual const DLAConvSurfaceDesc & convSurfaceDesc() const; + virtual const DLAConvOpDesc & convOpDesc() const; + virtual const DLALUTOffset & lutOffset() const; + virtual const DLAFloatData & floatData() const; + virtual const DLASlope & slope() const; + virtual const DLALUTParam & lutParam() const; + virtual const DLASDPSurfaceDesc & sdpSurfaceDesc() const; + virtual const DLASDPOp & sdpOp() const; + virtual const DLASDPOpDesc & sdpOpDesc() const; + virtual const DLASDPCVT & sdpCVT() const; + virtual const DLAPDPSurfaceDesc & pdpSurfaceDesc() const; + virtual const DLAPDPOpDesc & pdpOpDesc() const; + virtual const DLACDPSurfaceDesc & cdpSurfaceDesc() const; + virtual const DLACDPOpDesc & cdpOpDesc() const; + virtual const DLARubikSurfaceDesc & rubikSurfaceDesc() const; + virtual const DLARubikOpDesc & rubikOpDesc() const; + virtual const DLASurfaceContainer & surfaceContainer() const; + virtual const DLAOperationContainer & operationContainer() const; + // virtual const & () const; + // virtual const & () const; +}; + +class DLAInterfaceD : public DLAInterface +{ +public: + virtual ~DLAInterfaceD() { } + + virtual NvU8 firmwareTargetVersionMajor() const; + virtual NvU8 firmwareTargetVersionMinor() const; + virtual NvU8 firmwareTargetVersionSubminor() const; + virtual NvU32 firmwareTargetVersion() const; + + virtual NvU8 firmwareVersionMajor() const; + virtual NvU8 firmwareVersionMinor() const; + virtual NvU8 firmwareVersionSubminor() const; + virtual NvU32 firmwareVersion() const; + + DLANetworkDescAccessor networkDescAccessor(NvU8 *b) const; + DLAConsumerAccessor consumerAccessor(NvU8 *b) const; + DLACommonOpDescAccessor commonOpDescAccessor(NvU8 *b) const; + DLACVTParamAccessor cvtParamAccessor(NvU8 *b) const; + DLADataCubeAccessor dataCubeAccessor(NvU8 *b) const; + DLAConvSurfaceDescAccessor convSurfaceDescAccessor(NvU8 *b) const; + DLAConvOpDescAccessor convOpDescAccessor(NvU8 *b) const; + DLALUTOffsetAccessor lutOffsetAccessor(NvU8 *b) const; + DLAFloatDataAccessor floatDataAccessor(NvU8 *b) const; + DLASlopeAccessor slopeAccessor(NvU8 *b) const; + DLALUTParamAccessor lutParamAccessor(NvU8 *b) const; + DLASDPSurfaceDescAccessor sdpSurfaceDescAccessor(NvU8 *b) const; + DLASDPOpAccessor sdpOpAccessor(NvU8 *b) const; + DLASDPOpDescAccessor sdpOpDescAccessor(NvU8 *b) const; + DLAPDPSurfaceDescAccessor pdpSurfaceDescAccessor(NvU8 *b) const; + DLAPDPOpDescAccessor pdpOpDescAccessor(NvU8 *b) const; + DLACDPSurfaceDescAccessor cdpSurfaceDescAccessor(NvU8 *b) const; + DLACDPOpDescAccessor cdpOpDescAccessor(NvU8 *b) const; + DLARubikSurfaceDescAccessor rubikSurfaceDescAccessor(NvU8 *b) const; + DLARubikOpDescAccessor rubikOpDescAccessor(NvU8 *b) const; + DLASurfaceContainerAccessor surfaceContainerAccessor(NvU8 *b) const; + DLAOperationContainerAccessor operationContainerAccessor(NvU8 *b) const; + +protected: + virtual const DLANetworkDesc & networkDesc() const; + virtual const DLAConsumer & consumer() const; + virtual const DLACommonOpDesc & commonOpDesc() const; + virtual const DLACVTParam & cvtParam() const; + virtual const DLADataCube & dataCube() const; + virtual const DLAConvSurfaceDesc & convSurfaceDesc() const; + virtual const DLAConvOpDesc & convOpDesc() const; + virtual const DLALUTOffset & lutOffset() const; + virtual const DLAFloatData & floatData() const; + virtual const DLASlope & slope() const; + virtual const DLALUTParam & lutParam() const; + virtual const DLASDPSurfaceDesc & sdpSurfaceDesc() const; + virtual const DLASDPOp & sdpOp() const; + virtual const DLASDPOpDesc & sdpOpDesc() const; + virtual const DLASDPCVT & sdpCVT() const; + virtual const DLAPDPSurfaceDesc & pdpSurfaceDesc() const; + virtual const DLAPDPOpDesc & pdpOpDesc() const; + virtual const DLACDPSurfaceDesc & cdpSurfaceDesc() const; + virtual const DLACDPOpDesc & cdpOpDesc() const; + virtual const DLARubikSurfaceDesc & rubikSurfaceDesc() const; + virtual const DLARubikOpDesc & rubikOpDesc() const; + virtual const DLASurfaceContainer & surfaceContainer() const; + virtual const DLAOperationContainer & operationContainer() const; + // virtual const & () const; + // virtual const & () const; +}; + +class DLAInterfaceE : public DLAInterface +{ +public: + virtual ~DLAInterfaceE() { } + + virtual NvU8 firmwareTargetVersionMajor() const; + virtual NvU8 firmwareTargetVersionMinor() const; + virtual NvU8 firmwareTargetVersionSubminor() const; + virtual NvU32 firmwareTargetVersion() const; + + virtual NvU8 firmwareVersionMajor() const; + virtual NvU8 firmwareVersionMinor() const; + virtual NvU8 firmwareVersionSubminor() const; + virtual NvU32 firmwareVersion() const; + + DLANetworkDescAccessor networkDescAccessor(NvU8 *b) const; + DLAConsumerAccessor consumerAccessor(NvU8 *b) const; + DLACommonOpDescAccessor commonOpDescAccessor(NvU8 *b) const; + DLACVTParamAccessor cvtParamAccessor(NvU8 *b) const; + DLADataCubeAccessor dataCubeAccessor(NvU8 *b) const; + DLAConvSurfaceDescAccessor convSurfaceDescAccessor(NvU8 *b) const; + DLAConvOpDescAccessor convOpDescAccessor(NvU8 *b) const; + DLALUTOffsetAccessor lutOffsetAccessor(NvU8 *b) const; + DLAFloatDataAccessor floatDataAccessor(NvU8 *b) const; + DLASlopeAccessor slopeAccessor(NvU8 *b) const; + DLALUTParamAccessor lutParamAccessor(NvU8 *b) const; + DLASDPSurfaceDescAccessor sdpSurfaceDescAccessor(NvU8 *b) const; + DLASDPOpAccessor sdpOpAccessor(NvU8 *b) const; + DLASDPOpDescAccessor sdpOpDescAccessor(NvU8 *b) const; + DLAPDPSurfaceDescAccessor pdpSurfaceDescAccessor(NvU8 *b) const; + DLAPDPOpDescAccessor pdpOpDescAccessor(NvU8 *b) const; + DLACDPSurfaceDescAccessor cdpSurfaceDescAccessor(NvU8 *b) const; + DLACDPOpDescAccessor cdpOpDescAccessor(NvU8 *b) const; + DLARubikSurfaceDescAccessor rubikSurfaceDescAccessor(NvU8 *b) const; + DLARubikOpDescAccessor rubikOpDescAccessor(NvU8 *b) const; + DLASurfaceContainerAccessor surfaceContainerAccessor(NvU8 *b) const; + DLAOperationContainerAccessor operationContainerAccessor(NvU8 *b) const; + +protected: + virtual const DLANetworkDesc & networkDesc() const; + virtual const DLAConsumer & consumer() const; + virtual const DLACommonOpDesc & commonOpDesc() const; + virtual const DLACVTParam & cvtParam() const; + virtual const DLADataCube & dataCube() const; + virtual const DLAConvSurfaceDesc & convSurfaceDesc() const; + virtual const DLAConvOpDesc & convOpDesc() const; + virtual const DLALUTOffset & lutOffset() const; + virtual const DLAFloatData & floatData() const; + virtual const DLASlope & slope() const; + virtual const DLALUTParam & lutParam() const; + virtual const DLASDPSurfaceDesc & sdpSurfaceDesc() const; + virtual const DLASDPOp & sdpOp() const; + virtual const DLASDPOpDesc & sdpOpDesc() const; + virtual const DLASDPCVT & sdpCVT() const; + virtual const DLAPDPSurfaceDesc & pdpSurfaceDesc() const; + virtual const DLAPDPOpDesc & pdpOpDesc() const; + virtual const DLACDPSurfaceDesc & cdpSurfaceDesc() const; + virtual const DLACDPOpDesc & cdpOpDesc() const; + virtual const DLARubikSurfaceDesc & rubikSurfaceDesc() const; + virtual const DLARubikOpDesc & rubikOpDesc() const; + virtual const DLASurfaceContainer & surfaceContainer() const; + virtual const DLAOperationContainer & operationContainer() const; + // virtual const & () const; + // virtual const & () const; +}; + +} // nvdla::priv +} // nvdla + + +#endif // NVDLA_PRIV_DLA_INTERFACE_H diff --git a/umd/core/src/compiler/include/priv/DLAResourceManager.h b/umd/core/src/compiler/include/priv/DLAResourceManager.h new file mode 100644 index 00000000..2203f1f5 --- /dev/null +++ b/umd/core/src/compiler/include/priv/DLAResourceManager.h @@ -0,0 +1,139 @@ +/* + * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#ifndef NVDLA_PRIV_DLA_RESOURCE_MANAGER_H +#define NVDLA_PRIV_DLA_RESOURCE_MANAGER_H + +#include +#include + +#include "priv/Memory.h" +#include "priv/Surface.h" +#include "priv/Network.h" +#include "priv/ResourceEnums.h" // for memory enums +#include "priv/Type.h" + + +namespace nvdla +{ + +namespace priv +{ + +namespace memory +{ + +class Pool; +class TensorBufferDesc; + +class DLAResourceManager +{ + +public: + DLAResourceManager() : + m_next_buffer_id(0), + m_next_surface_desc_id(0) + { + m_pools = std::vector< Pool >(PoolType::num_elements(), Pool()); + } + DLAResourceManager(const DLAResourceManager &o); + ~DLAResourceManager(); + + std::string nextSurfaceDescId() + { + return std::string("tsd-") + toString(m_next_surface_desc_id++); + } + + std::string nextBufferId() + { + return std::string("tb-") + toString(m_next_buffer_id++); + } + + std::vector< Pool > * memoryPools() { return &m_pools; } + std::vector< TensorBufferDesc *> getBufferDescs(); + std::vector< surface::TensorSurfaceDesc *> getSurfaceDescs(); + + /* TENSOR-BUFFER MANAGEMENT */ + // register a new tensor buffer desc and add it to the directory + // and the memory pool + // numBatches = number of batches this BD represents + TensorBufferDesc* regTensorBufferDesc(NvU16 numBatches); + + // unregister a tensor buffer desc and remove it from the directory + // and the memory pool + bool unregTensorBufferDesc(TensorBufferDesc *); + + // reserve size #bytes for a registered tensor buffer desc + // return -1 on error + // int reserveSize(TensorBufferDesc *, NvU64 size); + + // free the supplied tensor buffer, thereby reclaiming its memory + // return -1 on error + // int freeTensorBuffer(TensorBufferDesc *); + + /* TENSOR-SURFACE_DESCRIPTOR MANAGEMENT */ + // register a new tensor surface descriptor for the given type of tensor + // and add it to the directory + // surface type = kernel/bias/feature-data/image + // numBatches = number of batches this SD represents + surface::TensorSurfaceDesc* regTensorSurfaceDesc(TensorType type, NvU16 numBatches); + + // unregister a tensor surface desc and remove it from the directory + bool unregTensorSurfaceDesc(surface::TensorSurfaceDesc *); + +protected: + + std::vector< Pool > m_pools; + std::string m_name; + + int m_next_buffer_id; + int m_next_surface_desc_id; + + // for keeping directories ordered by (string) id + template struct CompareById + { + bool operator() (const Tp &lhs, const Tp &rhs) const { return lhs->id()id(); } + }; + + // just sets with specific ordering + typedef std::set< surface::TensorSurfaceDesc *, CompareById > TensorSurfaceDirectory; + typedef std::set< TensorBufferDesc *, CompareById< TensorBufferDesc *> > TensorBufferDirectory; + + TensorBufferDirectory m_buffer_desc_directory; + TensorSurfaceDirectory m_surface_desc_directory; + + typedef TensorSurfaceDirectory::iterator TensorSurfaceDirectoryIter; + typedef TensorBufferDirectory::iterator TensorBufferDirectoryIter; + +}; + +} // nvdla::memory +} // nvdla::priv +} // nvdla + +#endif // NVDLA_PRIV_MEMORY_MANAGER_H diff --git a/umd/core/src/compiler/include/priv/DlaPrototestInterface.pb.h b/umd/core/src/compiler/include/priv/DlaPrototestInterface.pb.h new file mode 100644 index 00000000..0d0b8498 --- /dev/null +++ b/umd/core/src/compiler/include/priv/DlaPrototestInterface.pb.h @@ -0,0 +1,15522 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: DlaPrototestInterface.proto + +#ifndef PROTOBUF_DlaPrototestInterface_2eproto__INCLUDED +#define PROTOBUF_DlaPrototestInterface_2eproto__INCLUDED + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 2006000 +#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 2006000 < 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 +// @@protoc_insertion_point(includes) + +namespace nvdla_prototest_interface { + +// Internal implementation detail -- do not call these. +void protobuf_AddDesc_DlaPrototestInterface_2eproto(); +void protobuf_AssignDesc_DlaPrototestInterface_2eproto(); +void protobuf_ShutdownFile_DlaPrototestInterface_2eproto(); + +class LUTOffset; +class FloatData; +class DLASlope; +class DataFile; +class Constant; +class DataFiller; +class LUTParam; +class BDMATransferDesc; +class BDMASurfaceDesc; +class BDMAOpDesc; +class CVTParam; +class MemInfo; +class DataCube; +class CONVSurfaceDesc; +class CONVOpDesc; +class SDPCvt; +class SDPOp; +class SDPSurfaceDesc; +class SDPOpDesc; +class PDPSurfaceDesc; +class PDPOpDesc; +class CDPSurfaceDesc; +class CDPOpDesc; +class RUBIKSurfaceDesc; +class RUBIKOpDesc; +class SurfaceContainer; +class OperationContainer; +class Consumer; +class Layer; +class NetworkLayer; +class NetworkDesc; +class LUTParamList; +class ROIArrayDesc; +class ROIDesc; +class ROIDescription; +class Network; +class TaskStatus; +class Action; +class TaskSchedule; +class TasksData; +class Event; +class EventList; +class SubmitSlot; +class TestInfo; +class Test; + +enum SDPOp_SDPOpMode { + SDPOp_SDPOpMode_SDP_OP_PER_LAYER = 0, + SDPOp_SDPOpMode_SDP_OP_PER_KERNEL = 1, + SDPOp_SDPOpMode_SDP_OP_PER_POINT = 2 +}; +bool SDPOp_SDPOpMode_IsValid(int value); +const SDPOp_SDPOpMode SDPOp_SDPOpMode_SDPOpMode_MIN = SDPOp_SDPOpMode_SDP_OP_PER_LAYER; +const SDPOp_SDPOpMode SDPOp_SDPOpMode_SDPOpMode_MAX = SDPOp_SDPOpMode_SDP_OP_PER_POINT; +const int SDPOp_SDPOpMode_SDPOpMode_ARRAYSIZE = SDPOp_SDPOpMode_SDPOpMode_MAX + 1; + +const ::google::protobuf::EnumDescriptor* SDPOp_SDPOpMode_descriptor(); +inline const ::std::string& SDPOp_SDPOpMode_Name(SDPOp_SDPOpMode value) { + return ::google::protobuf::internal::NameOfEnum( + SDPOp_SDPOpMode_descriptor(), value); +} +inline bool SDPOp_SDPOpMode_Parse( + const ::std::string& name, SDPOp_SDPOpMode* value) { + return ::google::protobuf::internal::ParseNamedEnum( + SDPOp_SDPOpMode_descriptor(), name, value); +} +enum PDPOpDesc_PoolingMode { + PDPOpDesc_PoolingMode_MODE_AVG = 0, + PDPOpDesc_PoolingMode_MODE_MAX = 1, + PDPOpDesc_PoolingMode_MODE_MIN = 2 +}; +bool PDPOpDesc_PoolingMode_IsValid(int value); +const PDPOpDesc_PoolingMode PDPOpDesc_PoolingMode_PoolingMode_MIN = PDPOpDesc_PoolingMode_MODE_AVG; +const PDPOpDesc_PoolingMode PDPOpDesc_PoolingMode_PoolingMode_MAX = PDPOpDesc_PoolingMode_MODE_MIN; +const int PDPOpDesc_PoolingMode_PoolingMode_ARRAYSIZE = PDPOpDesc_PoolingMode_PoolingMode_MAX + 1; + +const ::google::protobuf::EnumDescriptor* PDPOpDesc_PoolingMode_descriptor(); +inline const ::std::string& PDPOpDesc_PoolingMode_Name(PDPOpDesc_PoolingMode value) { + return ::google::protobuf::internal::NameOfEnum( + PDPOpDesc_PoolingMode_descriptor(), value); +} +inline bool PDPOpDesc_PoolingMode_Parse( + const ::std::string& name, PDPOpDesc_PoolingMode* value) { + return ::google::protobuf::internal::ParseNamedEnum( + PDPOpDesc_PoolingMode_descriptor(), name, value); +} +enum Consumer_EventType { + Consumer_EventType_OP_COMPLETED = 1, + Consumer_EventType_OP_PROGRAMMED = 2, + Consumer_EventType_OP_ENABLED = 3, + Consumer_EventType_CDMA_WT_DONE = 4, + Consumer_EventType_CDMA_DT_DONE = 5 +}; +bool Consumer_EventType_IsValid(int value); +const Consumer_EventType Consumer_EventType_EventType_MIN = Consumer_EventType_OP_COMPLETED; +const Consumer_EventType Consumer_EventType_EventType_MAX = Consumer_EventType_CDMA_DT_DONE; +const int Consumer_EventType_EventType_ARRAYSIZE = Consumer_EventType_EventType_MAX + 1; + +const ::google::protobuf::EnumDescriptor* Consumer_EventType_descriptor(); +inline const ::std::string& Consumer_EventType_Name(Consumer_EventType value) { + return ::google::protobuf::internal::NameOfEnum( + Consumer_EventType_descriptor(), value); +} +inline bool Consumer_EventType_Parse( + const ::std::string& name, Consumer_EventType* value) { + return ::google::protobuf::internal::ParseNamedEnum( + Consumer_EventType_descriptor(), name, value); +} +enum Event_EventType { + Event_EventType_SYNCPOINT = 0, + Event_EventType_SYNCFD = 1, + Event_EventType_SEMAPHORE = 2, + Event_EventType_TS_SEMAPHORE = 3 +}; +bool Event_EventType_IsValid(int value); +const Event_EventType Event_EventType_EventType_MIN = Event_EventType_SYNCPOINT; +const Event_EventType Event_EventType_EventType_MAX = Event_EventType_TS_SEMAPHORE; +const int Event_EventType_EventType_ARRAYSIZE = Event_EventType_EventType_MAX + 1; + +const ::google::protobuf::EnumDescriptor* Event_EventType_descriptor(); +inline const ::std::string& Event_EventType_Name(Event_EventType value) { + return ::google::protobuf::internal::NameOfEnum( + Event_EventType_descriptor(), value); +} +inline bool Event_EventType_Parse( + const ::std::string& name, Event_EventType* value) { + return ::google::protobuf::internal::ParseNamedEnum( + Event_EventType_descriptor(), name, value); +} +enum DataPrecision { + PRECISION_INT8 = 0, + PRECISION_INT16 = 1, + PRECISION_FP16 = 2 +}; +bool DataPrecision_IsValid(int value); +const DataPrecision DataPrecision_MIN = PRECISION_INT8; +const DataPrecision DataPrecision_MAX = PRECISION_FP16; +const int DataPrecision_ARRAYSIZE = DataPrecision_MAX + 1; + +const ::google::protobuf::EnumDescriptor* DataPrecision_descriptor(); +inline const ::std::string& DataPrecision_Name(DataPrecision value) { + return ::google::protobuf::internal::NameOfEnum( + DataPrecision_descriptor(), value); +} +inline bool DataPrecision_Parse( + const ::std::string& name, DataPrecision* value) { + return ::google::protobuf::internal::ParseNamedEnum( + DataPrecision_descriptor(), name, value); +} +enum MemType { + DLA_MEM_MC = 0, + DLA_MEM_CV = 1, + DLA_MEM_HW = 2 +}; +bool MemType_IsValid(int value); +const MemType MemType_MIN = DLA_MEM_MC; +const MemType MemType_MAX = DLA_MEM_HW; +const int MemType_ARRAYSIZE = MemType_MAX + 1; + +const ::google::protobuf::EnumDescriptor* MemType_descriptor(); +inline const ::std::string& MemType_Name(MemType value) { + return ::google::protobuf::internal::NameOfEnum( + MemType_descriptor(), value); +} +inline bool MemType_Parse( + const ::std::string& name, MemType* value) { + return ::google::protobuf::internal::ParseNamedEnum( + MemType_descriptor(), name, value); +} +enum MemFlag { + DLA_MEM_ALLOC = 0, + DLA_MEM_SET = 1, + DLA_MEM_INPUT = 2, + DLA_MEM_OUTPUT = 3, + DLA_MEM_DEBUG = 4 +}; +bool MemFlag_IsValid(int value); +const MemFlag MemFlag_MIN = DLA_MEM_ALLOC; +const MemFlag MemFlag_MAX = DLA_MEM_DEBUG; +const int MemFlag_ARRAYSIZE = MemFlag_MAX + 1; + +const ::google::protobuf::EnumDescriptor* MemFlag_descriptor(); +inline const ::std::string& MemFlag_Name(MemFlag value) { + return ::google::protobuf::internal::NameOfEnum( + MemFlag_descriptor(), value); +} +inline bool MemFlag_Parse( + const ::std::string& name, MemFlag* value) { + return ::google::protobuf::internal::ParseNamedEnum( + MemFlag_descriptor(), name, value); +} +enum EngineID { + DLA_0 = 0, + DLA_1 = 1 +}; +bool EngineID_IsValid(int value); +const EngineID EngineID_MIN = DLA_0; +const EngineID EngineID_MAX = DLA_1; +const int EngineID_ARRAYSIZE = EngineID_MAX + 1; + +const ::google::protobuf::EnumDescriptor* EngineID_descriptor(); +inline const ::std::string& EngineID_Name(EngineID value) { + return ::google::protobuf::internal::NameOfEnum( + EngineID_descriptor(), value); +} +inline bool EngineID_Parse( + const ::std::string& name, EngineID* value) { + return ::google::protobuf::internal::ParseNamedEnum( + EngineID_descriptor(), name, value); +} +enum LayerType { + DLA_OP_BDMA = 0, + DLA_OP_CONV = 1, + DLA_OP_SDP = 2, + DLA_OP_PDP = 3, + DLA_OP_CDP = 4, + DLA_OP_RUBIK = 5 +}; +bool LayerType_IsValid(int value); +const LayerType LayerType_MIN = DLA_OP_BDMA; +const LayerType LayerType_MAX = DLA_OP_RUBIK; +const int LayerType_ARRAYSIZE = LayerType_MAX + 1; + +const ::google::protobuf::EnumDescriptor* LayerType_descriptor(); +inline const ::std::string& LayerType_Name(LayerType value) { + return ::google::protobuf::internal::NameOfEnum( + LayerType_descriptor(), value); +} +inline bool LayerType_Parse( + const ::std::string& name, LayerType* value) { + return ::google::protobuf::internal::ParseNamedEnum( + LayerType_descriptor(), name, value); +} +enum ALUType { + ALU_MAX = 0, + ALU_MIN = 1, + ALU_SUM = 2, + ALU_EQL = 3 +}; +bool ALUType_IsValid(int value); +const ALUType ALUType_MIN = ALU_MAX; +const ALUType ALUType_MAX = ALU_EQL; +const int ALUType_ARRAYSIZE = ALUType_MAX + 1; + +const ::google::protobuf::EnumDescriptor* ALUType_descriptor(); +inline const ::std::string& ALUType_Name(ALUType value) { + return ::google::protobuf::internal::NameOfEnum( + ALUType_descriptor(), value); +} +inline bool ALUType_Parse( + const ::std::string& name, ALUType* value) { + return ::google::protobuf::internal::ParseNamedEnum( + ALUType_descriptor(), name, value); +} +enum SDPOpType { + SDP_OP_NONE = 0, + SDP_OP_MUL = 1, + SDP_OP_ADD = 2, + SDP_OP_BOTH = 3 +}; +bool SDPOpType_IsValid(int value); +const SDPOpType SDPOpType_MIN = SDP_OP_NONE; +const SDPOpType SDPOpType_MAX = SDP_OP_BOTH; +const int SDPOpType_ARRAYSIZE = SDPOpType_MAX + 1; + +const ::google::protobuf::EnumDescriptor* SDPOpType_descriptor(); +inline const ::std::string& SDPOpType_Name(SDPOpType value) { + return ::google::protobuf::internal::NameOfEnum( + SDPOpType_descriptor(), value); +} +inline bool SDPOpType_Parse( + const ::std::string& name, SDPOpType* value) { + return ::google::protobuf::internal::ParseNamedEnum( + SDPOpType_descriptor(), name, value); +} +enum LUTLOGSize { + EXP_TABLE_ENTRY_LOG2 = 6, + LINEAR_TABLE_ENTRY_LOG2 = 8 +}; +bool LUTLOGSize_IsValid(int value); +const LUTLOGSize LUTLOGSize_MIN = EXP_TABLE_ENTRY_LOG2; +const LUTLOGSize LUTLOGSize_MAX = LINEAR_TABLE_ENTRY_LOG2; +const int LUTLOGSize_ARRAYSIZE = LUTLOGSize_MAX + 1; + +const ::google::protobuf::EnumDescriptor* LUTLOGSize_descriptor(); +inline const ::std::string& LUTLOGSize_Name(LUTLOGSize value) { + return ::google::protobuf::internal::NameOfEnum( + LUTLOGSize_descriptor(), value); +} +inline bool LUTLOGSize_Parse( + const ::std::string& name, LUTLOGSize* value) { + return ::google::protobuf::internal::ParseNamedEnum( + LUTLOGSize_descriptor(), name, value); +} +enum LUTTable { + EXP_TABLE = 0, + LINEAR_TABLE = 1 +}; +bool LUTTable_IsValid(int value); +const LUTTable LUTTable_MIN = EXP_TABLE; +const LUTTable LUTTable_MAX = LINEAR_TABLE; +const int LUTTable_ARRAYSIZE = LUTTable_MAX + 1; + +const ::google::protobuf::EnumDescriptor* LUTTable_descriptor(); +inline const ::std::string& LUTTable_Name(LUTTable value) { + return ::google::protobuf::internal::NameOfEnum( + LUTTable_descriptor(), value); +} +inline bool LUTTable_Parse( + const ::std::string& name, LUTTable* value) { + return ::google::protobuf::internal::ParseNamedEnum( + LUTTable_descriptor(), name, value); +} +enum LUTMethod { + METHOD_EXPONENTIAL = 0, + METHOD_LINEAR = 1 +}; +bool LUTMethod_IsValid(int value); +const LUTMethod LUTMethod_MIN = METHOD_EXPONENTIAL; +const LUTMethod LUTMethod_MAX = METHOD_LINEAR; +const int LUTMethod_ARRAYSIZE = LUTMethod_MAX + 1; + +const ::google::protobuf::EnumDescriptor* LUTMethod_descriptor(); +inline const ::std::string& LUTMethod_Name(LUTMethod value) { + return ::google::protobuf::internal::NameOfEnum( + LUTMethod_descriptor(), value); +} +inline bool LUTMethod_Parse( + const ::std::string& name, LUTMethod* value) { + return ::google::protobuf::internal::ParseNamedEnum( + LUTMethod_descriptor(), name, value); +} +enum LUTPriority { + PRI_EXPONENTIAL = 0, + PRI_LINEAR = 1 +}; +bool LUTPriority_IsValid(int value); +const LUTPriority LUTPriority_MIN = PRI_EXPONENTIAL; +const LUTPriority LUTPriority_MAX = PRI_LINEAR; +const int LUTPriority_ARRAYSIZE = LUTPriority_MAX + 1; + +const ::google::protobuf::EnumDescriptor* LUTPriority_descriptor(); +inline const ::std::string& LUTPriority_Name(LUTPriority value) { + return ::google::protobuf::internal::NameOfEnum( + LUTPriority_descriptor(), value); +} +inline bool LUTPriority_Parse( + const ::std::string& name, LUTPriority* value) { + return ::google::protobuf::internal::ParseNamedEnum( + LUTPriority_descriptor(), name, value); +} +enum ConvMode { + DIRECT = 0, + WINOGRAD = 1 +}; +bool ConvMode_IsValid(int value); +const ConvMode ConvMode_MIN = DIRECT; +const ConvMode ConvMode_MAX = WINOGRAD; +const int ConvMode_ARRAYSIZE = ConvMode_MAX + 1; + +const ::google::protobuf::EnumDescriptor* ConvMode_descriptor(); +inline const ::std::string& ConvMode_Name(ConvMode value) { + return ::google::protobuf::internal::NameOfEnum( + ConvMode_descriptor(), value); +} +inline bool ConvMode_Parse( + const ::std::string& name, ConvMode* value) { + return ::google::protobuf::internal::ParseNamedEnum( + ConvMode_descriptor(), name, value); +} +enum ConvPixelMAP { + PITCH_LINEAR = 0 +}; +bool ConvPixelMAP_IsValid(int value); +const ConvPixelMAP ConvPixelMAP_MIN = PITCH_LINEAR; +const ConvPixelMAP ConvPixelMAP_MAX = PITCH_LINEAR; +const int ConvPixelMAP_ARRAYSIZE = ConvPixelMAP_MAX + 1; + +const ::google::protobuf::EnumDescriptor* ConvPixelMAP_descriptor(); +inline const ::std::string& ConvPixelMAP_Name(ConvPixelMAP value) { + return ::google::protobuf::internal::NameOfEnum( + ConvPixelMAP_descriptor(), value); +} +inline bool ConvPixelMAP_Parse( + const ::std::string& name, ConvPixelMAP* value) { + return ::google::protobuf::internal::ParseNamedEnum( + ConvPixelMAP_descriptor(), name, value); +} +enum PixelOverride { + OVERRIDE_UINT = 0, + OVERRIDE_INT = 1 +}; +bool PixelOverride_IsValid(int value); +const PixelOverride PixelOverride_MIN = OVERRIDE_UINT; +const PixelOverride PixelOverride_MAX = OVERRIDE_INT; +const int PixelOverride_ARRAYSIZE = PixelOverride_MAX + 1; + +const ::google::protobuf::EnumDescriptor* PixelOverride_descriptor(); +inline const ::std::string& PixelOverride_Name(PixelOverride value) { + return ::google::protobuf::internal::NameOfEnum( + PixelOverride_descriptor(), value); +} +inline bool PixelOverride_Parse( + const ::std::string& name, PixelOverride* value) { + return ::google::protobuf::internal::ParseNamedEnum( + PixelOverride_descriptor(), name, value); +} +enum PoolSize { + SIZE_1 = 0, + SIZE_2 = 1, + SIZE_3 = 2, + SIZE_4 = 3, + SIZE_5 = 4, + SIZE_6 = 5, + SIZE_7 = 6, + SIZE_8 = 7 +}; +bool PoolSize_IsValid(int value); +const PoolSize PoolSize_MIN = SIZE_1; +const PoolSize PoolSize_MAX = SIZE_8; +const int PoolSize_ARRAYSIZE = PoolSize_MAX + 1; + +const ::google::protobuf::EnumDescriptor* PoolSize_descriptor(); +inline const ::std::string& PoolSize_Name(PoolSize value) { + return ::google::protobuf::internal::NameOfEnum( + PoolSize_descriptor(), value); +} +inline bool PoolSize_Parse( + const ::std::string& name, PoolSize* value) { + return ::google::protobuf::internal::ParseNamedEnum( + PoolSize_descriptor(), name, value); +} +enum RUBIKMode { + MODE_CONTRACT = 0, + MODE_SPLIT = 1, + MODE_MERGE = 2 +}; +bool RUBIKMode_IsValid(int value); +const RUBIKMode RUBIKMode_MIN = MODE_CONTRACT; +const RUBIKMode RUBIKMode_MAX = MODE_MERGE; +const int RUBIKMode_ARRAYSIZE = RUBIKMode_MAX + 1; + +const ::google::protobuf::EnumDescriptor* RUBIKMode_descriptor(); +inline const ::std::string& RUBIKMode_Name(RUBIKMode value) { + return ::google::protobuf::internal::NameOfEnum( + RUBIKMode_descriptor(), value); +} +inline bool RUBIKMode_Parse( + const ::std::string& name, RUBIKMode* value) { + return ::google::protobuf::internal::ParseNamedEnum( + RUBIKMode_descriptor(), name, value); +} +enum WeightFormat { + UNCOMPRESSED = 0, + COMPRESSED = 1 +}; +bool WeightFormat_IsValid(int value); +const WeightFormat WeightFormat_MIN = UNCOMPRESSED; +const WeightFormat WeightFormat_MAX = COMPRESSED; +const int WeightFormat_ARRAYSIZE = WeightFormat_MAX + 1; + +const ::google::protobuf::EnumDescriptor* WeightFormat_descriptor(); +inline const ::std::string& WeightFormat_Name(WeightFormat value) { + return ::google::protobuf::internal::NameOfEnum( + WeightFormat_descriptor(), value); +} +inline bool WeightFormat_Parse( + const ::std::string& name, WeightFormat* value) { + return ::google::protobuf::internal::ParseNamedEnum( + WeightFormat_descriptor(), name, value); +} +enum MeanFormat { + MEAN_DISABLE = 0, + MEAN_ENABLE = 1 +}; +bool MeanFormat_IsValid(int value); +const MeanFormat MeanFormat_MIN = MEAN_DISABLE; +const MeanFormat MeanFormat_MAX = MEAN_ENABLE; +const int MeanFormat_ARRAYSIZE = MeanFormat_MAX + 1; + +const ::google::protobuf::EnumDescriptor* MeanFormat_descriptor(); +inline const ::std::string& MeanFormat_Name(MeanFormat value) { + return ::google::protobuf::internal::NameOfEnum( + MeanFormat_descriptor(), value); +} +inline bool MeanFormat_Parse( + const ::std::string& name, MeanFormat* value) { + return ::google::protobuf::internal::ParseNamedEnum( + MeanFormat_descriptor(), name, value); +} +enum SDPActivation { + ACT_NONE = 0, + ACT_RELU = 1, + ACT_LUT = 2, + ACT_PRELU = 3 +}; +bool SDPActivation_IsValid(int value); +const SDPActivation SDPActivation_MIN = ACT_NONE; +const SDPActivation SDPActivation_MAX = ACT_PRELU; +const int SDPActivation_ARRAYSIZE = SDPActivation_MAX + 1; + +const ::google::protobuf::EnumDescriptor* SDPActivation_descriptor(); +inline const ::std::string& SDPActivation_Name(SDPActivation value) { + return ::google::protobuf::internal::NameOfEnum( + SDPActivation_descriptor(), value); +} +inline bool SDPActivation_Parse( + const ::std::string& name, SDPActivation* value) { + return ::google::protobuf::internal::ParseNamedEnum( + SDPActivation_descriptor(), name, value); +} +enum DataFormat { + FORMAT_T_R8 = 0, + FORMAT_T_R10 = 1, + FORMAT_T_R12 = 2, + FORMAT_T_R16 = 3, + FORMAT_T_R16_I = 4, + FORMAT_T_R16_F = 5, + FORMAT_T_A16B16G16R16 = 6, + FORMAT_T_X16B16G16R16 = 7, + FORMAT_T_A16B16G16R16_F = 8, + FORMAT_T_A16Y16U16V16 = 9, + FORMAT_T_V16U16Y16A16 = 10, + FORMAT_T_A16Y16U16V16_F = 11, + FORMAT_T_A8B8G8R8 = 12, + FORMAT_T_A8R8G8B8 = 13, + FORMAT_T_B8G8R8A8 = 14, + FORMAT_T_R8G8B8A8 = 15, + FORMAT_T_X8B8G8R8 = 16, + FORMAT_T_X8R8G8B8 = 17, + FORMAT_T_B8G8R8X8 = 18, + FORMAT_T_R8G8B8X8 = 19, + FORMAT_T_A2B10G10R10 = 20, + FORMAT_T_A2R10G10B10 = 21, + FORMAT_T_B10G10R10A2 = 22, + FORMAT_T_R10G10B10A2 = 23, + FORMAT_T_A2Y10U10V10 = 24, + FORMAT_T_V10U10Y10A2 = 25, + FORMAT_T_A8Y8U8V8 = 26, + FORMAT_T_V8U8Y8A8 = 27, + FORMAT_T_Y8___U8V8_N444 = 28, + FORMAT_T_Y8___V8U8_N444 = 29, + FORMAT_T_Y10___U10V10_N444 = 30, + FORMAT_T_Y10___V10U10_N444 = 31, + FORMAT_T_Y12___U12V12_N444 = 32, + FORMAT_T_Y12___V12U12_N444 = 33, + FORMAT_T_Y16___U16V16_N444 = 34, + FORMAT_T_Y16___V16U16_N444 = 35, + FORMAT_FEATURE = 36 +}; +bool DataFormat_IsValid(int value); +const DataFormat DataFormat_MIN = FORMAT_T_R8; +const DataFormat DataFormat_MAX = FORMAT_FEATURE; +const int DataFormat_ARRAYSIZE = DataFormat_MAX + 1; + +const ::google::protobuf::EnumDescriptor* DataFormat_descriptor(); +inline const ::std::string& DataFormat_Name(DataFormat value) { + return ::google::protobuf::internal::NameOfEnum( + DataFormat_descriptor(), value); +} +inline bool DataFormat_Parse( + const ::std::string& name, DataFormat* value) { + return ::google::protobuf::internal::ParseNamedEnum( + DataFormat_descriptor(), name, value); +} +enum FillerType { + FILL_NONE = 0, + FILL_FILE = 1, + FILL_CONSTANT = 2, + FILL_RANDOM = 3 +}; +bool FillerType_IsValid(int value); +const FillerType FillerType_MIN = FILL_NONE; +const FillerType FillerType_MAX = FILL_RANDOM; +const int FillerType_ARRAYSIZE = FillerType_MAX + 1; + +const ::google::protobuf::EnumDescriptor* FillerType_descriptor(); +inline const ::std::string& FillerType_Name(FillerType value) { + return ::google::protobuf::internal::NameOfEnum( + FillerType_descriptor(), value); +} +inline bool FillerType_Parse( + const ::std::string& name, FillerType* value) { + return ::google::protobuf::internal::ParseNamedEnum( + FillerType_descriptor(), name, value); +} +enum FileType { + FILE_PROTOBIN = 0, + FILE_PROTOTXT = 1, + FILE_RAWBIN = 2, + FILE_PNG = 3, + FILE_JPEG = 4 +}; +bool FileType_IsValid(int value); +const FileType FileType_MIN = FILE_PROTOBIN; +const FileType FileType_MAX = FILE_JPEG; +const int FileType_ARRAYSIZE = FileType_MAX + 1; + +const ::google::protobuf::EnumDescriptor* FileType_descriptor(); +inline const ::std::string& FileType_Name(FileType value) { + return ::google::protobuf::internal::NameOfEnum( + FileType_descriptor(), value); +} +inline bool FileType_Parse( + const ::std::string& name, FileType* value) { + return ::google::protobuf::internal::ParseNamedEnum( + FileType_descriptor(), name, value); +} +enum DataType { + DLA_DATA_DC_WEIGHT = 0, + DLA_DATA_WG_WEIGHT = 1, + DLA_DATA_IMG_WEIGHT = 2, + DLA_DATA_FC_WEIGHT = 3, + DLA_DATA_BIAS = 4, + DLA_DATA_IMAGE = 5, + DLA_DATA_LUT = 6, + DLA_DATA_FEATURE = 7 +}; +bool DataType_IsValid(int value); +const DataType DataType_MIN = DLA_DATA_DC_WEIGHT; +const DataType DataType_MAX = DLA_DATA_FEATURE; +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); +} +// =================================================================== + +class LUTOffset : public ::google::protobuf::Message { + public: + LUTOffset(); + virtual ~LUTOffset(); + + LUTOffset(const LUTOffset& from); + + inline LUTOffset& operator=(const LUTOffset& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const LUTOffset& default_instance(); + + enum LutOffsetOneofCase { + kExpOffset = 1, + kFracBits = 2, + LUT_OFFSET_ONEOF_NOT_SET = 0, + }; + + void Swap(LUTOffset* other); + + // implements Message ---------------------------------------------- + + LUTOffset* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const LUTOffset& from); + void MergeFrom(const LUTOffset& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional int32 exp_offset = 1; + inline bool has_exp_offset() const; + inline void clear_exp_offset(); + static const int kExpOffsetFieldNumber = 1; + inline ::google::protobuf::int32 exp_offset() const; + inline void set_exp_offset(::google::protobuf::int32 value); + + // optional int32 frac_bits = 2; + inline bool has_frac_bits() const; + inline void clear_frac_bits(); + static const int kFracBitsFieldNumber = 2; + inline ::google::protobuf::int32 frac_bits() const; + inline void set_frac_bits(::google::protobuf::int32 value); + + inline LutOffsetOneofCase lut_offset_oneof_case() const; + // @@protoc_insertion_point(class_scope:nvdla_prototest_interface.LUTOffset) + private: + inline void set_has_exp_offset(); + inline void set_has_frac_bits(); + + inline bool has_lut_offset_oneof(); + void clear_lut_offset_oneof(); + inline void clear_has_lut_offset_oneof(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + union LutOffsetOneofUnion { + ::google::protobuf::int32 exp_offset_; + ::google::protobuf::int32 frac_bits_; + } lut_offset_oneof_; + ::google::protobuf::uint32 _oneof_case_[1]; + + friend void protobuf_AddDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_AssignDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_ShutdownFile_DlaPrototestInterface_2eproto(); + + void InitAsDefaultInstance(); + static LUTOffset* default_instance_; +}; +// ------------------------------------------------------------------- + +class FloatData : public ::google::protobuf::Message { + public: + FloatData(); + virtual ~FloatData(); + + FloatData(const FloatData& from); + + inline FloatData& operator=(const FloatData& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const FloatData& default_instance(); + + void Swap(FloatData* other); + + // implements Message ---------------------------------------------- + + FloatData* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const FloatData& from); + void MergeFrom(const FloatData& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // required int32 scale = 1; + inline bool has_scale() const; + inline void clear_scale(); + static const int kScaleFieldNumber = 1; + inline ::google::protobuf::int32 scale() const; + inline void set_scale(::google::protobuf::int32 value); + + // required int32 shifter = 2; + inline bool has_shifter() const; + inline void clear_shifter(); + static const int kShifterFieldNumber = 2; + inline ::google::protobuf::int32 shifter() const; + inline void set_shifter(::google::protobuf::int32 value); + + // optional uint32 reserved0 = 3 [default = 0]; + inline bool has_reserved0() const; + inline void clear_reserved0(); + static const int kReserved0FieldNumber = 3; + inline ::google::protobuf::uint32 reserved0() const; + inline void set_reserved0(::google::protobuf::uint32 value); + + // @@protoc_insertion_point(class_scope:nvdla_prototest_interface.FloatData) + private: + inline void set_has_scale(); + inline void clear_has_scale(); + inline void set_has_shifter(); + inline void clear_has_shifter(); + inline void set_has_reserved0(); + inline void clear_has_reserved0(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::int32 scale_; + ::google::protobuf::int32 shifter_; + ::google::protobuf::uint32 reserved0_; + friend void protobuf_AddDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_AssignDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_ShutdownFile_DlaPrototestInterface_2eproto(); + + void InitAsDefaultInstance(); + static FloatData* default_instance_; +}; +// ------------------------------------------------------------------- + +class DLASlope : public ::google::protobuf::Message { + public: + DLASlope(); + virtual ~DLASlope(); + + DLASlope(const DLASlope& from); + + inline DLASlope& operator=(const DLASlope& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const DLASlope& default_instance(); + + enum DlaSlopeOneofCase { + kDataI = 1, + kDataF = 2, + DLA_SLOPE_ONEOF_NOT_SET = 0, + }; + + void Swap(DLASlope* other); + + // implements Message ---------------------------------------------- + + DLASlope* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const DLASlope& from); + void MergeFrom(const DLASlope& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional .nvdla_prototest_interface.FloatData data_i = 1; + inline bool has_data_i() const; + inline void clear_data_i(); + static const int kDataIFieldNumber = 1; + inline const ::nvdla_prototest_interface::FloatData& data_i() const; + inline ::nvdla_prototest_interface::FloatData* mutable_data_i(); + inline ::nvdla_prototest_interface::FloatData* release_data_i(); + inline void set_allocated_data_i(::nvdla_prototest_interface::FloatData* data_i); + + // optional uint32 data_f = 2; + inline bool has_data_f() const; + inline void clear_data_f(); + static const int kDataFFieldNumber = 2; + inline ::google::protobuf::uint32 data_f() const; + inline void set_data_f(::google::protobuf::uint32 value); + + inline DlaSlopeOneofCase dla_slope_oneof_case() const; + // @@protoc_insertion_point(class_scope:nvdla_prototest_interface.DLASlope) + private: + inline void set_has_data_i(); + inline void set_has_data_f(); + + inline bool has_dla_slope_oneof(); + void clear_dla_slope_oneof(); + inline void clear_has_dla_slope_oneof(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + union DlaSlopeOneofUnion { + ::nvdla_prototest_interface::FloatData* data_i_; + ::google::protobuf::uint32 data_f_; + } dla_slope_oneof_; + ::google::protobuf::uint32 _oneof_case_[1]; + + friend void protobuf_AddDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_AssignDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_ShutdownFile_DlaPrototestInterface_2eproto(); + + void InitAsDefaultInstance(); + static DLASlope* default_instance_; +}; +// ------------------------------------------------------------------- + +class DataFile : public ::google::protobuf::Message { + public: + DataFile(); + virtual ~DataFile(); + + DataFile(const DataFile& from); + + inline DataFile& operator=(const DataFile& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const DataFile& default_instance(); + + void Swap(DataFile* other); + + // implements Message ---------------------------------------------- + + DataFile* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const DataFile& from); + void MergeFrom(const DataFile& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // required string name = 1; + inline bool has_name() const; + inline void clear_name(); + static const int kNameFieldNumber = 1; + inline const ::std::string& name() const; + inline void set_name(const ::std::string& value); + inline void set_name(const char* value); + inline void set_name(const char* value, size_t size); + inline ::std::string* mutable_name(); + inline ::std::string* release_name(); + inline void set_allocated_name(::std::string* name); + + // required .nvdla_prototest_interface.DataType data_type = 2; + inline bool has_data_type() const; + inline void clear_data_type(); + static const int kDataTypeFieldNumber = 2; + inline ::nvdla_prototest_interface::DataType data_type() const; + inline void set_data_type(::nvdla_prototest_interface::DataType value); + + // required uint32 offset = 3; + inline bool has_offset() const; + inline void clear_offset(); + static const int kOffsetFieldNumber = 3; + inline ::google::protobuf::uint32 offset() const; + inline void set_offset(::google::protobuf::uint32 value); + + // required uint32 size = 4; + inline bool has_size() const; + inline void clear_size(); + static const int kSizeFieldNumber = 4; + inline ::google::protobuf::uint32 size() const; + inline void set_size(::google::protobuf::uint32 value); + + // required .nvdla_prototest_interface.FileType file_type = 5; + inline bool has_file_type() const; + inline void clear_file_type(); + static const int kFileTypeFieldNumber = 5; + inline ::nvdla_prototest_interface::FileType file_type() const; + inline void set_file_type(::nvdla_prototest_interface::FileType value); + + // @@protoc_insertion_point(class_scope:nvdla_prototest_interface.DataFile) + private: + inline void set_has_name(); + inline void clear_has_name(); + inline void set_has_data_type(); + inline void clear_has_data_type(); + inline void set_has_offset(); + inline void clear_has_offset(); + inline void set_has_size(); + inline void clear_has_size(); + inline void set_has_file_type(); + inline void clear_has_file_type(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::std::string* name_; + int data_type_; + ::google::protobuf::uint32 offset_; + ::google::protobuf::uint32 size_; + int file_type_; + friend void protobuf_AddDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_AssignDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_ShutdownFile_DlaPrototestInterface_2eproto(); + + void InitAsDefaultInstance(); + static DataFile* default_instance_; +}; +// ------------------------------------------------------------------- + +class Constant : public ::google::protobuf::Message { + public: + Constant(); + virtual ~Constant(); + + Constant(const Constant& from); + + inline Constant& operator=(const Constant& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const Constant& default_instance(); + + void Swap(Constant* other); + + // implements Message ---------------------------------------------- + + Constant* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const Constant& from); + void MergeFrom(const Constant& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // required int32 value = 1; + inline bool has_value() const; + inline void clear_value(); + static const int kValueFieldNumber = 1; + inline ::google::protobuf::int32 value() const; + inline void set_value(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:nvdla_prototest_interface.Constant) + private: + inline void set_has_value(); + inline void clear_has_value(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::int32 value_; + friend void protobuf_AddDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_AssignDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_ShutdownFile_DlaPrototestInterface_2eproto(); + + void InitAsDefaultInstance(); + static Constant* default_instance_; +}; +// ------------------------------------------------------------------- + +class DataFiller : public ::google::protobuf::Message { + public: + DataFiller(); + virtual ~DataFiller(); + + DataFiller(const DataFiller& from); + + inline DataFiller& operator=(const DataFiller& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const DataFiller& default_instance(); + + enum DataFillerOneofCase { + kDataFile = 1, + kConst = 2, + DATA_FILLER_ONEOF_NOT_SET = 0, + }; + + void Swap(DataFiller* other); + + // implements Message ---------------------------------------------- + + DataFiller* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const DataFiller& from); + void MergeFrom(const DataFiller& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional .nvdla_prototest_interface.DataFile data_file = 1; + inline bool has_data_file() const; + inline void clear_data_file(); + static const int kDataFileFieldNumber = 1; + inline const ::nvdla_prototest_interface::DataFile& data_file() const; + inline ::nvdla_prototest_interface::DataFile* mutable_data_file(); + inline ::nvdla_prototest_interface::DataFile* release_data_file(); + inline void set_allocated_data_file(::nvdla_prototest_interface::DataFile* data_file); + + // optional .nvdla_prototest_interface.Constant const = 2; + inline bool has_const_() const; + inline void clear_const_(); + static const int kConstFieldNumber = 2; + inline const ::nvdla_prototest_interface::Constant& const_() const; + inline ::nvdla_prototest_interface::Constant* mutable_const_(); + inline ::nvdla_prototest_interface::Constant* release_const_(); + inline void set_allocated_const_(::nvdla_prototest_interface::Constant* const_); + + inline DataFillerOneofCase data_filler_oneof_case() const; + // @@protoc_insertion_point(class_scope:nvdla_prototest_interface.DataFiller) + private: + inline void set_has_data_file(); + inline void set_has_const_(); + + inline bool has_data_filler_oneof(); + void clear_data_filler_oneof(); + inline void clear_has_data_filler_oneof(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + union DataFillerOneofUnion { + ::nvdla_prototest_interface::DataFile* data_file_; + ::nvdla_prototest_interface::Constant* const__; + } data_filler_oneof_; + ::google::protobuf::uint32 _oneof_case_[1]; + + friend void protobuf_AddDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_AssignDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_ShutdownFile_DlaPrototestInterface_2eproto(); + + void InitAsDefaultInstance(); + static DataFiller* default_instance_; +}; +// ------------------------------------------------------------------- + +class LUTParam : public ::google::protobuf::Message { + public: + LUTParam(); + virtual ~LUTParam(); + + LUTParam(const LUTParam& from); + + inline LUTParam& operator=(const LUTParam& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const LUTParam& default_instance(); + + void Swap(LUTParam* other); + + // implements Message ---------------------------------------------- + + LUTParam* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const LUTParam& from); + void MergeFrom(const LUTParam& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated int32 linear_exp_table = 1 [packed = true]; + inline int linear_exp_table_size() const; + inline void clear_linear_exp_table(); + static const int kLinearExpTableFieldNumber = 1; + inline ::google::protobuf::int32 linear_exp_table(int index) const; + inline void set_linear_exp_table(int index, ::google::protobuf::int32 value); + inline void add_linear_exp_table(::google::protobuf::int32 value); + inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& + linear_exp_table() const; + inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* + mutable_linear_exp_table(); + + // repeated int32 linear_only_table = 2 [packed = true]; + inline int linear_only_table_size() const; + inline void clear_linear_only_table(); + static const int kLinearOnlyTableFieldNumber = 2; + inline ::google::protobuf::int32 linear_only_table(int index) const; + inline void set_linear_only_table(int index, ::google::protobuf::int32 value); + inline void add_linear_only_table(::google::protobuf::int32 value); + inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& + linear_only_table() const; + inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* + mutable_linear_only_table(); + + // required .nvdla_prototest_interface.LUTOffset linear_exp_offset = 3; + inline bool has_linear_exp_offset() const; + inline void clear_linear_exp_offset(); + static const int kLinearExpOffsetFieldNumber = 3; + inline const ::nvdla_prototest_interface::LUTOffset& linear_exp_offset() const; + inline ::nvdla_prototest_interface::LUTOffset* mutable_linear_exp_offset(); + inline ::nvdla_prototest_interface::LUTOffset* release_linear_exp_offset(); + inline void set_allocated_linear_exp_offset(::nvdla_prototest_interface::LUTOffset* linear_exp_offset); + + // required .nvdla_prototest_interface.LUTOffset linear_only_offset = 4; + inline bool has_linear_only_offset() const; + inline void clear_linear_only_offset(); + static const int kLinearOnlyOffsetFieldNumber = 4; + inline const ::nvdla_prototest_interface::LUTOffset& linear_only_offset() const; + inline ::nvdla_prototest_interface::LUTOffset* mutable_linear_only_offset(); + inline ::nvdla_prototest_interface::LUTOffset* release_linear_only_offset(); + inline void set_allocated_linear_only_offset(::nvdla_prototest_interface::LUTOffset* linear_only_offset); + + // required uint64 linear_exp_start = 5; + inline bool has_linear_exp_start() const; + inline void clear_linear_exp_start(); + static const int kLinearExpStartFieldNumber = 5; + inline ::google::protobuf::uint64 linear_exp_start() const; + inline void set_linear_exp_start(::google::protobuf::uint64 value); + + // required uint64 linear_exp_end = 6; + inline bool has_linear_exp_end() const; + inline void clear_linear_exp_end(); + static const int kLinearExpEndFieldNumber = 6; + inline ::google::protobuf::uint64 linear_exp_end() const; + inline void set_linear_exp_end(::google::protobuf::uint64 value); + + // required uint64 linear_only_start = 7; + inline bool has_linear_only_start() const; + inline void clear_linear_only_start(); + static const int kLinearOnlyStartFieldNumber = 7; + inline ::google::protobuf::uint64 linear_only_start() const; + inline void set_linear_only_start(::google::protobuf::uint64 value); + + // required uint64 linear_only_end = 8; + inline bool has_linear_only_end() const; + inline void clear_linear_only_end(); + static const int kLinearOnlyEndFieldNumber = 8; + inline ::google::protobuf::uint64 linear_only_end() const; + inline void set_linear_only_end(::google::protobuf::uint64 value); + + // required .nvdla_prototest_interface.DLASlope linear_exp_underflow_slope = 9; + inline bool has_linear_exp_underflow_slope() const; + inline void clear_linear_exp_underflow_slope(); + static const int kLinearExpUnderflowSlopeFieldNumber = 9; + inline const ::nvdla_prototest_interface::DLASlope& linear_exp_underflow_slope() const; + inline ::nvdla_prototest_interface::DLASlope* mutable_linear_exp_underflow_slope(); + inline ::nvdla_prototest_interface::DLASlope* release_linear_exp_underflow_slope(); + inline void set_allocated_linear_exp_underflow_slope(::nvdla_prototest_interface::DLASlope* linear_exp_underflow_slope); + + // required .nvdla_prototest_interface.DLASlope linear_exp_overflow_slope = 10; + inline bool has_linear_exp_overflow_slope() const; + inline void clear_linear_exp_overflow_slope(); + static const int kLinearExpOverflowSlopeFieldNumber = 10; + inline const ::nvdla_prototest_interface::DLASlope& linear_exp_overflow_slope() const; + inline ::nvdla_prototest_interface::DLASlope* mutable_linear_exp_overflow_slope(); + inline ::nvdla_prototest_interface::DLASlope* release_linear_exp_overflow_slope(); + inline void set_allocated_linear_exp_overflow_slope(::nvdla_prototest_interface::DLASlope* linear_exp_overflow_slope); + + // required .nvdla_prototest_interface.DLASlope linear_only_underflow_slope = 11; + inline bool has_linear_only_underflow_slope() const; + inline void clear_linear_only_underflow_slope(); + static const int kLinearOnlyUnderflowSlopeFieldNumber = 11; + inline const ::nvdla_prototest_interface::DLASlope& linear_only_underflow_slope() const; + inline ::nvdla_prototest_interface::DLASlope* mutable_linear_only_underflow_slope(); + inline ::nvdla_prototest_interface::DLASlope* release_linear_only_underflow_slope(); + inline void set_allocated_linear_only_underflow_slope(::nvdla_prototest_interface::DLASlope* linear_only_underflow_slope); + + // required .nvdla_prototest_interface.DLASlope linear_only_overflow_slope = 12; + inline bool has_linear_only_overflow_slope() const; + inline void clear_linear_only_overflow_slope(); + static const int kLinearOnlyOverflowSlopeFieldNumber = 12; + inline const ::nvdla_prototest_interface::DLASlope& linear_only_overflow_slope() const; + inline ::nvdla_prototest_interface::DLASlope* mutable_linear_only_overflow_slope(); + inline ::nvdla_prototest_interface::DLASlope* release_linear_only_overflow_slope(); + inline void set_allocated_linear_only_overflow_slope(::nvdla_prototest_interface::DLASlope* linear_only_overflow_slope); + + // required uint32 hybrid_priority = 13; + inline bool has_hybrid_priority() const; + inline void clear_hybrid_priority(); + static const int kHybridPriorityFieldNumber = 13; + inline ::google::protobuf::uint32 hybrid_priority() const; + inline void set_hybrid_priority(::google::protobuf::uint32 value); + + // required uint32 underflow_priority = 14; + inline bool has_underflow_priority() const; + inline void clear_underflow_priority(); + static const int kUnderflowPriorityFieldNumber = 14; + inline ::google::protobuf::uint32 underflow_priority() const; + inline void set_underflow_priority(::google::protobuf::uint32 value); + + // required uint32 overflow_priority = 15; + inline bool has_overflow_priority() const; + inline void clear_overflow_priority(); + static const int kOverflowPriorityFieldNumber = 15; + inline ::google::protobuf::uint32 overflow_priority() const; + inline void set_overflow_priority(::google::protobuf::uint32 value); + + // required .nvdla_prototest_interface.LUTMethod method = 16; + inline bool has_method() const; + inline void clear_method(); + static const int kMethodFieldNumber = 16; + inline ::nvdla_prototest_interface::LUTMethod method() const; + inline void set_method(::nvdla_prototest_interface::LUTMethod value); + + // optional .nvdla_prototest_interface.FillerType fill_type = 17 [default = FILL_NONE]; + inline bool has_fill_type() const; + inline void clear_fill_type(); + static const int kFillTypeFieldNumber = 17; + inline ::nvdla_prototest_interface::FillerType fill_type() const; + inline void set_fill_type(::nvdla_prototest_interface::FillerType value); + + // optional .nvdla_prototest_interface.DataFiller filler = 18; + inline bool has_filler() const; + inline void clear_filler(); + static const int kFillerFieldNumber = 18; + inline const ::nvdla_prototest_interface::DataFiller& filler() const; + inline ::nvdla_prototest_interface::DataFiller* mutable_filler(); + inline ::nvdla_prototest_interface::DataFiller* release_filler(); + inline void set_allocated_filler(::nvdla_prototest_interface::DataFiller* filler); + + // optional .nvdla_prototest_interface.DataPrecision precision = 19 [default = PRECISION_INT16]; + inline bool has_precision() const; + inline void clear_precision(); + static const int kPrecisionFieldNumber = 19; + inline ::nvdla_prototest_interface::DataPrecision precision() const; + inline void set_precision(::nvdla_prototest_interface::DataPrecision value); + + // @@protoc_insertion_point(class_scope:nvdla_prototest_interface.LUTParam) + private: + inline void set_has_linear_exp_offset(); + inline void clear_has_linear_exp_offset(); + inline void set_has_linear_only_offset(); + inline void clear_has_linear_only_offset(); + inline void set_has_linear_exp_start(); + inline void clear_has_linear_exp_start(); + inline void set_has_linear_exp_end(); + inline void clear_has_linear_exp_end(); + inline void set_has_linear_only_start(); + inline void clear_has_linear_only_start(); + inline void set_has_linear_only_end(); + inline void clear_has_linear_only_end(); + inline void set_has_linear_exp_underflow_slope(); + inline void clear_has_linear_exp_underflow_slope(); + inline void set_has_linear_exp_overflow_slope(); + inline void clear_has_linear_exp_overflow_slope(); + inline void set_has_linear_only_underflow_slope(); + inline void clear_has_linear_only_underflow_slope(); + inline void set_has_linear_only_overflow_slope(); + inline void clear_has_linear_only_overflow_slope(); + inline void set_has_hybrid_priority(); + inline void clear_has_hybrid_priority(); + inline void set_has_underflow_priority(); + inline void clear_has_underflow_priority(); + inline void set_has_overflow_priority(); + inline void clear_has_overflow_priority(); + inline void set_has_method(); + inline void clear_has_method(); + inline void set_has_fill_type(); + inline void clear_has_fill_type(); + inline void set_has_filler(); + inline void clear_has_filler(); + inline void set_has_precision(); + inline void clear_has_precision(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 > linear_exp_table_; + mutable int _linear_exp_table_cached_byte_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 > linear_only_table_; + mutable int _linear_only_table_cached_byte_size_; + ::nvdla_prototest_interface::LUTOffset* linear_exp_offset_; + ::nvdla_prototest_interface::LUTOffset* linear_only_offset_; + ::google::protobuf::uint64 linear_exp_start_; + ::google::protobuf::uint64 linear_exp_end_; + ::google::protobuf::uint64 linear_only_start_; + ::google::protobuf::uint64 linear_only_end_; + ::nvdla_prototest_interface::DLASlope* linear_exp_underflow_slope_; + ::nvdla_prototest_interface::DLASlope* linear_exp_overflow_slope_; + ::nvdla_prototest_interface::DLASlope* linear_only_underflow_slope_; + ::nvdla_prototest_interface::DLASlope* linear_only_overflow_slope_; + ::google::protobuf::uint32 hybrid_priority_; + ::google::protobuf::uint32 underflow_priority_; + ::google::protobuf::uint32 overflow_priority_; + int method_; + ::nvdla_prototest_interface::DataFiller* filler_; + int fill_type_; + int precision_; + friend void protobuf_AddDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_AssignDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_ShutdownFile_DlaPrototestInterface_2eproto(); + + void InitAsDefaultInstance(); + static LUTParam* default_instance_; +}; +// ------------------------------------------------------------------- + +class BDMATransferDesc : public ::google::protobuf::Message { + public: + BDMATransferDesc(); + virtual ~BDMATransferDesc(); + + BDMATransferDesc(const BDMATransferDesc& from); + + inline BDMATransferDesc& operator=(const BDMATransferDesc& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const BDMATransferDesc& default_instance(); + + void Swap(BDMATransferDesc* other); + + // implements Message ---------------------------------------------- + + BDMATransferDesc* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const BDMATransferDesc& from); + void MergeFrom(const BDMATransferDesc& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // required int32 source_address = 1; + inline bool has_source_address() const; + inline void clear_source_address(); + static const int kSourceAddressFieldNumber = 1; + inline ::google::protobuf::int32 source_address() const; + inline void set_source_address(::google::protobuf::int32 value); + + // required int32 destination_address = 2; + inline bool has_destination_address() const; + inline void clear_destination_address(); + static const int kDestinationAddressFieldNumber = 2; + inline ::google::protobuf::int32 destination_address() const; + inline void set_destination_address(::google::protobuf::int32 value); + + // required uint32 line_size = 3; + inline bool has_line_size() const; + inline void clear_line_size(); + static const int kLineSizeFieldNumber = 3; + inline ::google::protobuf::uint32 line_size() const; + inline void set_line_size(::google::protobuf::uint32 value); + + // required uint32 line_repeat = 4; + inline bool has_line_repeat() const; + inline void clear_line_repeat(); + static const int kLineRepeatFieldNumber = 4; + inline ::google::protobuf::uint32 line_repeat() const; + inline void set_line_repeat(::google::protobuf::uint32 value); + + // required uint32 source_line = 5; + inline bool has_source_line() const; + inline void clear_source_line(); + static const int kSourceLineFieldNumber = 5; + inline ::google::protobuf::uint32 source_line() const; + inline void set_source_line(::google::protobuf::uint32 value); + + // required uint32 destination_line = 6; + inline bool has_destination_line() const; + inline void clear_destination_line(); + static const int kDestinationLineFieldNumber = 6; + inline ::google::protobuf::uint32 destination_line() const; + inline void set_destination_line(::google::protobuf::uint32 value); + + // required uint32 surface_repeat = 7; + inline bool has_surface_repeat() const; + inline void clear_surface_repeat(); + static const int kSurfaceRepeatFieldNumber = 7; + inline ::google::protobuf::uint32 surface_repeat() const; + inline void set_surface_repeat(::google::protobuf::uint32 value); + + // required uint32 source_surface = 8; + inline bool has_source_surface() const; + inline void clear_source_surface(); + static const int kSourceSurfaceFieldNumber = 8; + inline ::google::protobuf::uint32 source_surface() const; + inline void set_source_surface(::google::protobuf::uint32 value); + + // required uint32 destination_surface = 9; + inline bool has_destination_surface() const; + inline void clear_destination_surface(); + static const int kDestinationSurfaceFieldNumber = 9; + inline ::google::protobuf::uint32 destination_surface() const; + inline void set_destination_surface(::google::protobuf::uint32 value); + + // required .nvdla_prototest_interface.MemInfo src_mem_info = 10; + inline bool has_src_mem_info() const; + inline void clear_src_mem_info(); + static const int kSrcMemInfoFieldNumber = 10; + inline const ::nvdla_prototest_interface::MemInfo& src_mem_info() const; + inline ::nvdla_prototest_interface::MemInfo* mutable_src_mem_info(); + inline ::nvdla_prototest_interface::MemInfo* release_src_mem_info(); + inline void set_allocated_src_mem_info(::nvdla_prototest_interface::MemInfo* src_mem_info); + + // required .nvdla_prototest_interface.MemInfo dst_mem_info = 11; + inline bool has_dst_mem_info() const; + inline void clear_dst_mem_info(); + static const int kDstMemInfoFieldNumber = 11; + inline const ::nvdla_prototest_interface::MemInfo& dst_mem_info() const; + inline ::nvdla_prototest_interface::MemInfo* mutable_dst_mem_info(); + inline ::nvdla_prototest_interface::MemInfo* release_dst_mem_info(); + inline void set_allocated_dst_mem_info(::nvdla_prototest_interface::MemInfo* dst_mem_info); + + // @@protoc_insertion_point(class_scope:nvdla_prototest_interface.BDMATransferDesc) + private: + inline void set_has_source_address(); + inline void clear_has_source_address(); + inline void set_has_destination_address(); + inline void clear_has_destination_address(); + inline void set_has_line_size(); + inline void clear_has_line_size(); + inline void set_has_line_repeat(); + inline void clear_has_line_repeat(); + inline void set_has_source_line(); + inline void clear_has_source_line(); + inline void set_has_destination_line(); + inline void clear_has_destination_line(); + inline void set_has_surface_repeat(); + inline void clear_has_surface_repeat(); + inline void set_has_source_surface(); + inline void clear_has_source_surface(); + inline void set_has_destination_surface(); + inline void clear_has_destination_surface(); + inline void set_has_src_mem_info(); + inline void clear_has_src_mem_info(); + inline void set_has_dst_mem_info(); + inline void clear_has_dst_mem_info(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::int32 source_address_; + ::google::protobuf::int32 destination_address_; + ::google::protobuf::uint32 line_size_; + ::google::protobuf::uint32 line_repeat_; + ::google::protobuf::uint32 source_line_; + ::google::protobuf::uint32 destination_line_; + ::google::protobuf::uint32 surface_repeat_; + ::google::protobuf::uint32 source_surface_; + ::nvdla_prototest_interface::MemInfo* src_mem_info_; + ::nvdla_prototest_interface::MemInfo* dst_mem_info_; + ::google::protobuf::uint32 destination_surface_; + friend void protobuf_AddDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_AssignDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_ShutdownFile_DlaPrototestInterface_2eproto(); + + void InitAsDefaultInstance(); + static BDMATransferDesc* default_instance_; +}; +// ------------------------------------------------------------------- + +class BDMASurfaceDesc : public ::google::protobuf::Message { + public: + BDMASurfaceDesc(); + virtual ~BDMASurfaceDesc(); + + BDMASurfaceDesc(const BDMASurfaceDesc& from); + + inline BDMASurfaceDesc& operator=(const BDMASurfaceDesc& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const BDMASurfaceDesc& default_instance(); + + void Swap(BDMASurfaceDesc* other); + + // implements Message ---------------------------------------------- + + BDMASurfaceDesc* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const BDMASurfaceDesc& from); + void MergeFrom(const BDMASurfaceDesc& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // required .nvdla_prototest_interface.MemType source_type = 1; + inline bool has_source_type() const; + inline void clear_source_type(); + static const int kSourceTypeFieldNumber = 1; + inline ::nvdla_prototest_interface::MemType source_type() const; + inline void set_source_type(::nvdla_prototest_interface::MemType value); + + // required .nvdla_prototest_interface.MemType destination_type = 2; + inline bool has_destination_type() const; + inline void clear_destination_type(); + static const int kDestinationTypeFieldNumber = 2; + inline ::nvdla_prototest_interface::MemType destination_type() const; + inline void set_destination_type(::nvdla_prototest_interface::MemType value); + + // required uint32 num_transfers = 3; + inline bool has_num_transfers() const; + inline void clear_num_transfers(); + static const int kNumTransfersFieldNumber = 3; + inline ::google::protobuf::uint32 num_transfers() const; + inline void set_num_transfers(::google::protobuf::uint32 value); + + // repeated .nvdla_prototest_interface.BDMATransferDesc transfers = 4; + inline int transfers_size() const; + inline void clear_transfers(); + static const int kTransfersFieldNumber = 4; + inline const ::nvdla_prototest_interface::BDMATransferDesc& transfers(int index) const; + inline ::nvdla_prototest_interface::BDMATransferDesc* mutable_transfers(int index); + inline ::nvdla_prototest_interface::BDMATransferDesc* add_transfers(); + inline const ::google::protobuf::RepeatedPtrField< ::nvdla_prototest_interface::BDMATransferDesc >& + transfers() const; + inline ::google::protobuf::RepeatedPtrField< ::nvdla_prototest_interface::BDMATransferDesc >* + mutable_transfers(); + + // @@protoc_insertion_point(class_scope:nvdla_prototest_interface.BDMASurfaceDesc) + private: + inline void set_has_source_type(); + inline void clear_has_source_type(); + inline void set_has_destination_type(); + inline void clear_has_destination_type(); + inline void set_has_num_transfers(); + inline void clear_has_num_transfers(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + int source_type_; + int destination_type_; + ::google::protobuf::RepeatedPtrField< ::nvdla_prototest_interface::BDMATransferDesc > transfers_; + ::google::protobuf::uint32 num_transfers_; + friend void protobuf_AddDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_AssignDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_ShutdownFile_DlaPrototestInterface_2eproto(); + + void InitAsDefaultInstance(); + static BDMASurfaceDesc* default_instance_; +}; +// ------------------------------------------------------------------- + +class BDMAOpDesc : public ::google::protobuf::Message { + public: + BDMAOpDesc(); + virtual ~BDMAOpDesc(); + + BDMAOpDesc(const BDMAOpDesc& from); + + inline BDMAOpDesc& operator=(const BDMAOpDesc& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const BDMAOpDesc& default_instance(); + + void Swap(BDMAOpDesc* other); + + // implements Message ---------------------------------------------- + + BDMAOpDesc* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const BDMAOpDesc& from); + void MergeFrom(const BDMAOpDesc& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // required uint32 num_transfers = 1; + inline bool has_num_transfers() const; + inline void clear_num_transfers(); + static const int kNumTransfersFieldNumber = 1; + inline ::google::protobuf::uint32 num_transfers() const; + inline void set_num_transfers(::google::protobuf::uint32 value); + + // optional uint32 reserved0 = 2 [default = 0]; + inline bool has_reserved0() const; + inline void clear_reserved0(); + static const int kReserved0FieldNumber = 2; + inline ::google::protobuf::uint32 reserved0() const; + inline void set_reserved0(::google::protobuf::uint32 value); + + // @@protoc_insertion_point(class_scope:nvdla_prototest_interface.BDMAOpDesc) + private: + inline void set_has_num_transfers(); + inline void clear_has_num_transfers(); + inline void set_has_reserved0(); + inline void clear_has_reserved0(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::uint32 num_transfers_; + ::google::protobuf::uint32 reserved0_; + friend void protobuf_AddDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_AssignDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_ShutdownFile_DlaPrototestInterface_2eproto(); + + void InitAsDefaultInstance(); + static BDMAOpDesc* default_instance_; +}; +// ------------------------------------------------------------------- + +class CVTParam : public ::google::protobuf::Message { + public: + CVTParam(); + virtual ~CVTParam(); + + CVTParam(const CVTParam& from); + + inline CVTParam& operator=(const CVTParam& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const CVTParam& default_instance(); + + void Swap(CVTParam* other); + + // implements Message ---------------------------------------------- + + CVTParam* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const CVTParam& from); + void MergeFrom(const CVTParam& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // required int32 scale = 1; + inline bool has_scale() const; + inline void clear_scale(); + static const int kScaleFieldNumber = 1; + inline ::google::protobuf::int32 scale() const; + inline void set_scale(::google::protobuf::int32 value); + + // required uint32 truncate = 2; + inline bool has_truncate() const; + inline void clear_truncate(); + static const int kTruncateFieldNumber = 2; + inline ::google::protobuf::uint32 truncate() const; + inline void set_truncate(::google::protobuf::uint32 value); + + // required uint32 enable = 3; + inline bool has_enable() const; + inline void clear_enable(); + static const int kEnableFieldNumber = 3; + inline ::google::protobuf::uint32 enable() const; + inline void set_enable(::google::protobuf::uint32 value); + + // required int32 offset = 4; + inline bool has_offset() const; + inline void clear_offset(); + static const int kOffsetFieldNumber = 4; + inline ::google::protobuf::int32 offset() const; + inline void set_offset(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:nvdla_prototest_interface.CVTParam) + private: + inline void set_has_scale(); + inline void clear_has_scale(); + inline void set_has_truncate(); + inline void clear_has_truncate(); + inline void set_has_enable(); + inline void clear_has_enable(); + inline void set_has_offset(); + inline void clear_has_offset(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::int32 scale_; + ::google::protobuf::uint32 truncate_; + ::google::protobuf::uint32 enable_; + ::google::protobuf::int32 offset_; + friend void protobuf_AddDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_AssignDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_ShutdownFile_DlaPrototestInterface_2eproto(); + + void InitAsDefaultInstance(); + static CVTParam* default_instance_; +}; +// ------------------------------------------------------------------- + +class MemInfo : public ::google::protobuf::Message { + public: + MemInfo(); + virtual ~MemInfo(); + + MemInfo(const MemInfo& from); + + inline MemInfo& operator=(const MemInfo& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const MemInfo& default_instance(); + + void Swap(MemInfo* other); + + // implements Message ---------------------------------------------- + + MemInfo* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const MemInfo& from); + void MergeFrom(const MemInfo& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // required int32 mem_id = 1 [default = -1]; + inline bool has_mem_id() const; + inline void clear_mem_id(); + static const int kMemIdFieldNumber = 1; + inline ::google::protobuf::int32 mem_id() const; + inline void set_mem_id(::google::protobuf::int32 value); + + // required uint32 mem_size = 2 [default = 0]; + inline bool has_mem_size() const; + inline void clear_mem_size(); + static const int kMemSizeFieldNumber = 2; + inline ::google::protobuf::uint32 mem_size() const; + inline void set_mem_size(::google::protobuf::uint32 value); + + // required uint32 offset = 3 [default = 0]; + inline bool has_offset() const; + inline void clear_offset(); + static const int kOffsetFieldNumber = 3; + inline ::google::protobuf::uint32 offset() const; + inline void set_offset(::google::protobuf::uint32 value); + + // optional .nvdla_prototest_interface.FillerType fill_type = 4 [default = FILL_NONE]; + inline bool has_fill_type() const; + inline void clear_fill_type(); + static const int kFillTypeFieldNumber = 4; + inline ::nvdla_prototest_interface::FillerType fill_type() const; + inline void set_fill_type(::nvdla_prototest_interface::FillerType value); + + // optional .nvdla_prototest_interface.DataFiller filler = 5; + inline bool has_filler() const; + inline void clear_filler(); + static const int kFillerFieldNumber = 5; + inline const ::nvdla_prototest_interface::DataFiller& filler() const; + inline ::nvdla_prototest_interface::DataFiller* mutable_filler(); + inline ::nvdla_prototest_interface::DataFiller* release_filler(); + inline void set_allocated_filler(::nvdla_prototest_interface::DataFiller* filler); + + // optional .nvdla_prototest_interface.MemFlag flag = 6 [default = DLA_MEM_ALLOC]; + inline bool has_flag() const; + inline void clear_flag(); + static const int kFlagFieldNumber = 6; + inline ::nvdla_prototest_interface::MemFlag flag() const; + inline void set_flag(::nvdla_prototest_interface::MemFlag value); + + // optional .nvdla_prototest_interface.DataPrecision precision = 7 [default = PRECISION_INT8]; + inline bool has_precision() const; + inline void clear_precision(); + static const int kPrecisionFieldNumber = 7; + inline ::nvdla_prototest_interface::DataPrecision precision() const; + inline void set_precision(::nvdla_prototest_interface::DataPrecision value); + + // optional uint32 sw_dilation_x = 8 [default = 1]; + inline bool has_sw_dilation_x() const; + inline void clear_sw_dilation_x(); + static const int kSwDilationXFieldNumber = 8; + inline ::google::protobuf::uint32 sw_dilation_x() const; + inline void set_sw_dilation_x(::google::protobuf::uint32 value); + + // optional uint32 sw_dilation_y = 9 [default = 1]; + inline bool has_sw_dilation_y() const; + inline void clear_sw_dilation_y(); + static const int kSwDilationYFieldNumber = 9; + inline ::google::protobuf::uint32 sw_dilation_y() const; + inline void set_sw_dilation_y(::google::protobuf::uint32 value); + + // @@protoc_insertion_point(class_scope:nvdla_prototest_interface.MemInfo) + private: + inline void set_has_mem_id(); + inline void clear_has_mem_id(); + inline void set_has_mem_size(); + inline void clear_has_mem_size(); + inline void set_has_offset(); + inline void clear_has_offset(); + inline void set_has_fill_type(); + inline void clear_has_fill_type(); + inline void set_has_filler(); + inline void clear_has_filler(); + inline void set_has_flag(); + inline void clear_has_flag(); + inline void set_has_precision(); + inline void clear_has_precision(); + inline void set_has_sw_dilation_x(); + inline void clear_has_sw_dilation_x(); + inline void set_has_sw_dilation_y(); + inline void clear_has_sw_dilation_y(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::int32 mem_id_; + ::google::protobuf::uint32 mem_size_; + ::google::protobuf::uint32 offset_; + int fill_type_; + ::nvdla_prototest_interface::DataFiller* filler_; + int flag_; + int precision_; + ::google::protobuf::uint32 sw_dilation_x_; + ::google::protobuf::uint32 sw_dilation_y_; + friend void protobuf_AddDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_AssignDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_ShutdownFile_DlaPrototestInterface_2eproto(); + + void InitAsDefaultInstance(); + static MemInfo* default_instance_; +}; +// ------------------------------------------------------------------- + +class DataCube : public ::google::protobuf::Message { + public: + DataCube(); + virtual ~DataCube(); + + DataCube(const DataCube& from); + + inline DataCube& operator=(const DataCube& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const DataCube& default_instance(); + + void Swap(DataCube* other); + + // implements Message ---------------------------------------------- + + DataCube* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const DataCube& from); + void MergeFrom(const DataCube& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional uint32 reserved0 = 1 [default = 0]; + inline bool has_reserved0() const; + inline void clear_reserved0(); + static const int kReserved0FieldNumber = 1; + inline ::google::protobuf::uint32 reserved0() const; + inline void set_reserved0(::google::protobuf::uint32 value); + + // required .nvdla_prototest_interface.MemType type = 2; + inline bool has_type() const; + inline void clear_type(); + static const int kTypeFieldNumber = 2; + inline ::nvdla_prototest_interface::MemType type() const; + inline void set_type(::nvdla_prototest_interface::MemType value); + + // required int32 address = 3; + inline bool has_address() const; + inline void clear_address(); + static const int kAddressFieldNumber = 3; + inline ::google::protobuf::int32 address() const; + inline void set_address(::google::protobuf::int32 value); + + // required uint32 size = 4; + inline bool has_size() const; + inline void clear_size(); + static const int kSizeFieldNumber = 4; + inline ::google::protobuf::uint32 size() const; + inline void set_size(::google::protobuf::uint32 value); + + // required uint32 width = 5; + inline bool has_width() const; + inline void clear_width(); + static const int kWidthFieldNumber = 5; + inline ::google::protobuf::uint32 width() const; + inline void set_width(::google::protobuf::uint32 value); + + // required uint32 height = 6; + inline bool has_height() const; + inline void clear_height(); + static const int kHeightFieldNumber = 6; + inline ::google::protobuf::uint32 height() const; + inline void set_height(::google::protobuf::uint32 value); + + // required uint32 channel = 7; + inline bool has_channel() const; + inline void clear_channel(); + static const int kChannelFieldNumber = 7; + inline ::google::protobuf::uint32 channel() const; + inline void set_channel(::google::protobuf::uint32 value); + + // optional uint32 reserved1 = 8 [default = 0]; + inline bool has_reserved1() const; + inline void clear_reserved1(); + static const int kReserved1FieldNumber = 8; + inline ::google::protobuf::uint32 reserved1() const; + inline void set_reserved1(::google::protobuf::uint32 value); + + // required uint32 line_stride = 9; + inline bool has_line_stride() const; + inline void clear_line_stride(); + static const int kLineStrideFieldNumber = 9; + inline ::google::protobuf::uint32 line_stride() const; + inline void set_line_stride(::google::protobuf::uint32 value); + + // required uint32 surf_stride = 10; + inline bool has_surf_stride() const; + inline void clear_surf_stride(); + static const int kSurfStrideFieldNumber = 10; + inline ::google::protobuf::uint32 surf_stride() const; + inline void set_surf_stride(::google::protobuf::uint32 value); + + // required uint32 plane_stride = 11; + inline bool has_plane_stride() const; + inline void clear_plane_stride(); + static const int kPlaneStrideFieldNumber = 11; + inline ::google::protobuf::uint32 plane_stride() const; + inline void set_plane_stride(::google::protobuf::uint32 value); + + // required .nvdla_prototest_interface.MemInfo mem_info = 12; + inline bool has_mem_info() const; + inline void clear_mem_info(); + static const int kMemInfoFieldNumber = 12; + inline const ::nvdla_prototest_interface::MemInfo& mem_info() const; + inline ::nvdla_prototest_interface::MemInfo* mutable_mem_info(); + inline ::nvdla_prototest_interface::MemInfo* release_mem_info(); + inline void set_allocated_mem_info(::nvdla_prototest_interface::MemInfo* mem_info); + + // @@protoc_insertion_point(class_scope:nvdla_prototest_interface.DataCube) + private: + inline void set_has_reserved0(); + inline void clear_has_reserved0(); + inline void set_has_type(); + inline void clear_has_type(); + inline void set_has_address(); + inline void clear_has_address(); + inline void set_has_size(); + inline void clear_has_size(); + inline void set_has_width(); + inline void clear_has_width(); + inline void set_has_height(); + inline void clear_has_height(); + inline void set_has_channel(); + inline void clear_has_channel(); + inline void set_has_reserved1(); + inline void clear_has_reserved1(); + inline void set_has_line_stride(); + inline void clear_has_line_stride(); + inline void set_has_surf_stride(); + inline void clear_has_surf_stride(); + inline void set_has_plane_stride(); + inline void clear_has_plane_stride(); + inline void set_has_mem_info(); + inline void clear_has_mem_info(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::uint32 reserved0_; + int type_; + ::google::protobuf::int32 address_; + ::google::protobuf::uint32 size_; + ::google::protobuf::uint32 width_; + ::google::protobuf::uint32 height_; + ::google::protobuf::uint32 channel_; + ::google::protobuf::uint32 reserved1_; + ::google::protobuf::uint32 line_stride_; + ::google::protobuf::uint32 surf_stride_; + ::nvdla_prototest_interface::MemInfo* mem_info_; + ::google::protobuf::uint32 plane_stride_; + friend void protobuf_AddDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_AssignDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_ShutdownFile_DlaPrototestInterface_2eproto(); + + void InitAsDefaultInstance(); + static DataCube* default_instance_; +}; +// ------------------------------------------------------------------- + +class CONVSurfaceDesc : public ::google::protobuf::Message { + public: + CONVSurfaceDesc(); + virtual ~CONVSurfaceDesc(); + + CONVSurfaceDesc(const CONVSurfaceDesc& from); + + inline CONVSurfaceDesc& operator=(const CONVSurfaceDesc& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const CONVSurfaceDesc& default_instance(); + + void Swap(CONVSurfaceDesc* other); + + // implements Message ---------------------------------------------- + + CONVSurfaceDesc* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const CONVSurfaceDesc& from); + void MergeFrom(const CONVSurfaceDesc& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // required .nvdla_prototest_interface.DataCube weight_data = 1; + inline bool has_weight_data() const; + inline void clear_weight_data(); + static const int kWeightDataFieldNumber = 1; + inline const ::nvdla_prototest_interface::DataCube& weight_data() const; + inline ::nvdla_prototest_interface::DataCube* mutable_weight_data(); + inline ::nvdla_prototest_interface::DataCube* release_weight_data(); + inline void set_allocated_weight_data(::nvdla_prototest_interface::DataCube* weight_data); + + // optional .nvdla_prototest_interface.DataCube wmb_data = 2; + inline bool has_wmb_data() const; + inline void clear_wmb_data(); + static const int kWmbDataFieldNumber = 2; + inline const ::nvdla_prototest_interface::DataCube& wmb_data() const; + inline ::nvdla_prototest_interface::DataCube* mutable_wmb_data(); + inline ::nvdla_prototest_interface::DataCube* release_wmb_data(); + inline void set_allocated_wmb_data(::nvdla_prototest_interface::DataCube* wmb_data); + + // optional .nvdla_prototest_interface.DataCube wgs_data = 3; + inline bool has_wgs_data() const; + inline void clear_wgs_data(); + static const int kWgsDataFieldNumber = 3; + inline const ::nvdla_prototest_interface::DataCube& wgs_data() const; + inline ::nvdla_prototest_interface::DataCube* mutable_wgs_data(); + inline ::nvdla_prototest_interface::DataCube* release_wgs_data(); + inline void set_allocated_wgs_data(::nvdla_prototest_interface::DataCube* wgs_data); + + // required .nvdla_prototest_interface.DataCube src_data = 4; + inline bool has_src_data() const; + inline void clear_src_data(); + static const int kSrcDataFieldNumber = 4; + inline const ::nvdla_prototest_interface::DataCube& src_data() const; + inline ::nvdla_prototest_interface::DataCube* mutable_src_data(); + inline ::nvdla_prototest_interface::DataCube* release_src_data(); + inline void set_allocated_src_data(::nvdla_prototest_interface::DataCube* src_data); + + // required .nvdla_prototest_interface.DataCube dst_data = 5; + inline bool has_dst_data() const; + inline void clear_dst_data(); + static const int kDstDataFieldNumber = 5; + inline const ::nvdla_prototest_interface::DataCube& dst_data() const; + inline ::nvdla_prototest_interface::DataCube* mutable_dst_data(); + inline ::nvdla_prototest_interface::DataCube* release_dst_data(); + inline void set_allocated_dst_data(::nvdla_prototest_interface::DataCube* dst_data); + + // required int64 offset_u = 6; + inline bool has_offset_u() const; + inline void clear_offset_u(); + static const int kOffsetUFieldNumber = 6; + inline ::google::protobuf::int64 offset_u() const; + inline void set_offset_u(::google::protobuf::int64 value); + + // required uint32 in_line_uv_stride = 7; + inline bool has_in_line_uv_stride() const; + inline void clear_in_line_uv_stride(); + static const int kInLineUvStrideFieldNumber = 7; + inline ::google::protobuf::uint32 in_line_uv_stride() const; + inline void set_in_line_uv_stride(::google::protobuf::uint32 value); + + // @@protoc_insertion_point(class_scope:nvdla_prototest_interface.CONVSurfaceDesc) + private: + inline void set_has_weight_data(); + inline void clear_has_weight_data(); + inline void set_has_wmb_data(); + inline void clear_has_wmb_data(); + inline void set_has_wgs_data(); + inline void clear_has_wgs_data(); + inline void set_has_src_data(); + inline void clear_has_src_data(); + inline void set_has_dst_data(); + inline void clear_has_dst_data(); + inline void set_has_offset_u(); + inline void clear_has_offset_u(); + inline void set_has_in_line_uv_stride(); + inline void clear_has_in_line_uv_stride(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::nvdla_prototest_interface::DataCube* weight_data_; + ::nvdla_prototest_interface::DataCube* wmb_data_; + ::nvdla_prototest_interface::DataCube* wgs_data_; + ::nvdla_prototest_interface::DataCube* src_data_; + ::nvdla_prototest_interface::DataCube* dst_data_; + ::google::protobuf::int64 offset_u_; + ::google::protobuf::uint32 in_line_uv_stride_; + friend void protobuf_AddDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_AssignDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_ShutdownFile_DlaPrototestInterface_2eproto(); + + void InitAsDefaultInstance(); + static CONVSurfaceDesc* default_instance_; +}; +// ------------------------------------------------------------------- + +class CONVOpDesc : public ::google::protobuf::Message { + public: + CONVOpDesc(); + virtual ~CONVOpDesc(); + + CONVOpDesc(const CONVOpDesc& from); + + inline CONVOpDesc& operator=(const CONVOpDesc& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const CONVOpDesc& default_instance(); + + void Swap(CONVOpDesc* other); + + // implements Message ---------------------------------------------- + + CONVOpDesc* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const CONVOpDesc& from); + void MergeFrom(const CONVOpDesc& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // required .nvdla_prototest_interface.ConvMode conv_mode = 1; + inline bool has_conv_mode() const; + inline void clear_conv_mode(); + static const int kConvModeFieldNumber = 1; + inline ::nvdla_prototest_interface::ConvMode conv_mode() const; + inline void set_conv_mode(::nvdla_prototest_interface::ConvMode value); + + // required uint32 data_reuse = 2; + inline bool has_data_reuse() const; + inline void clear_data_reuse(); + static const int kDataReuseFieldNumber = 2; + inline ::google::protobuf::uint32 data_reuse() const; + inline void set_data_reuse(::google::protobuf::uint32 value); + + // required uint32 weight_reuse = 3; + inline bool has_weight_reuse() const; + inline void clear_weight_reuse(); + static const int kWeightReuseFieldNumber = 3; + inline ::google::protobuf::uint32 weight_reuse() const; + inline void set_weight_reuse(::google::protobuf::uint32 value); + + // required uint32 skip_data_rls = 4; + inline bool has_skip_data_rls() const; + inline void clear_skip_data_rls(); + static const int kSkipDataRlsFieldNumber = 4; + inline ::google::protobuf::uint32 skip_data_rls() const; + inline void set_skip_data_rls(::google::protobuf::uint32 value); + + // required uint32 skip_weight_rls = 5; + inline bool has_skip_weight_rls() const; + inline void clear_skip_weight_rls(); + static const int kSkipWeightRlsFieldNumber = 5; + inline ::google::protobuf::uint32 skip_weight_rls() const; + inline void set_skip_weight_rls(::google::protobuf::uint32 value); + + // optional uint32 reserved0 = 6 [default = 0]; + inline bool has_reserved0() const; + inline void clear_reserved0(); + static const int kReserved0FieldNumber = 6; + inline ::google::protobuf::uint32 reserved0() const; + inline void set_reserved0(::google::protobuf::uint32 value); + + // required uint32 entry_per_slice = 7; + inline bool has_entry_per_slice() const; + inline void clear_entry_per_slice(); + static const int kEntryPerSliceFieldNumber = 7; + inline ::google::protobuf::uint32 entry_per_slice() const; + inline void set_entry_per_slice(::google::protobuf::uint32 value); + + // required .nvdla_prototest_interface.DataFormat data_format = 8; + inline bool has_data_format() const; + inline void clear_data_format(); + static const int kDataFormatFieldNumber = 8; + inline ::nvdla_prototest_interface::DataFormat data_format() const; + inline void set_data_format(::nvdla_prototest_interface::DataFormat value); + + // required uint32 pixel_mapping = 9; + inline bool has_pixel_mapping() const; + inline void clear_pixel_mapping(); + static const int kPixelMappingFieldNumber = 9; + inline ::google::protobuf::uint32 pixel_mapping() const; + inline void set_pixel_mapping(::google::protobuf::uint32 value); + + // required uint32 fetch_grain = 10; + inline bool has_fetch_grain() const; + inline void clear_fetch_grain(); + static const int kFetchGrainFieldNumber = 10; + inline ::google::protobuf::uint32 fetch_grain() const; + inline void set_fetch_grain(::google::protobuf::uint32 value); + + // required uint32 pixel_offset_x = 11; + inline bool has_pixel_offset_x() const; + inline void clear_pixel_offset_x(); + static const int kPixelOffsetXFieldNumber = 11; + inline ::google::protobuf::uint32 pixel_offset_x() const; + inline void set_pixel_offset_x(::google::protobuf::uint32 value); + + // required uint32 pixel_offset_y = 12; + inline bool has_pixel_offset_y() const; + inline void clear_pixel_offset_y(); + static const int kPixelOffsetYFieldNumber = 12; + inline ::google::protobuf::uint32 pixel_offset_y() const; + inline void set_pixel_offset_y(::google::protobuf::uint32 value); + + // required uint32 gob_per_line = 13; + inline bool has_gob_per_line() const; + inline void clear_gob_per_line(); + static const int kGobPerLineFieldNumber = 13; + inline ::google::protobuf::uint32 gob_per_line() const; + inline void set_gob_per_line(::google::protobuf::uint32 value); + + // required uint32 gob_height = 14; + inline bool has_gob_height() const; + inline void clear_gob_height(); + static const int kGobHeightFieldNumber = 14; + inline ::google::protobuf::uint32 gob_height() const; + inline void set_gob_height(::google::protobuf::uint32 value); + + // required uint32 gob_y_index = 15; + inline bool has_gob_y_index() const; + inline void clear_gob_y_index(); + static const int kGobYIndexFieldNumber = 15; + inline ::google::protobuf::uint32 gob_y_index() const; + inline void set_gob_y_index(::google::protobuf::uint32 value); + + // required uint32 gob_per_uv_line = 16; + inline bool has_gob_per_uv_line() const; + inline void clear_gob_per_uv_line(); + static const int kGobPerUvLineFieldNumber = 16; + inline ::google::protobuf::uint32 gob_per_uv_line() const; + inline void set_gob_per_uv_line(::google::protobuf::uint32 value); + + // required uint32 batch = 17; + inline bool has_batch() const; + inline void clear_batch(); + static const int kBatchFieldNumber = 17; + inline ::google::protobuf::uint32 batch() const; + inline void set_batch(::google::protobuf::uint32 value); + + // required .nvdla_prototest_interface.WeightFormat weight_format = 18; + inline bool has_weight_format() const; + inline void clear_weight_format(); + static const int kWeightFormatFieldNumber = 18; + inline ::nvdla_prototest_interface::WeightFormat weight_format() const; + inline void set_weight_format(::nvdla_prototest_interface::WeightFormat value); + + // required uint32 data_bank = 19; + inline bool has_data_bank() const; + inline void clear_data_bank(); + static const int kDataBankFieldNumber = 19; + inline ::google::protobuf::uint32 data_bank() const; + inline void set_data_bank(::google::protobuf::uint32 value); + + // required uint32 weight_bank = 20; + inline bool has_weight_bank() const; + inline void clear_weight_bank(); + static const int kWeightBankFieldNumber = 20; + inline ::google::protobuf::uint32 weight_bank() const; + inline void set_weight_bank(::google::protobuf::uint32 value); + + // required uint32 batch_stride = 21; + inline bool has_batch_stride() const; + inline void clear_batch_stride(); + static const int kBatchStrideFieldNumber = 21; + inline ::google::protobuf::uint32 batch_stride() const; + inline void set_batch_stride(::google::protobuf::uint32 value); + + // required uint32 post_extension = 22; + inline bool has_post_extension() const; + inline void clear_post_extension(); + static const int kPostExtensionFieldNumber = 22; + inline ::google::protobuf::uint32 post_extension() const; + inline void set_post_extension(::google::protobuf::uint32 value); + + // optional .nvdla_prototest_interface.PixelOverride pixel_override = 23; + inline bool has_pixel_override() const; + inline void clear_pixel_override(); + static const int kPixelOverrideFieldNumber = 23; + inline ::nvdla_prototest_interface::PixelOverride pixel_override() const; + inline void set_pixel_override(::nvdla_prototest_interface::PixelOverride value); + + // required uint32 release = 24; + inline bool has_release() const; + inline void clear_release(); + static const int kReleaseFieldNumber = 24; + inline ::google::protobuf::uint32 release() const; + inline void set_release(::google::protobuf::uint32 value); + + // required uint32 input_width_csc = 25; + inline bool has_input_width_csc() const; + inline void clear_input_width_csc(); + static const int kInputWidthCscFieldNumber = 25; + inline ::google::protobuf::uint32 input_width_csc() const; + inline void set_input_width_csc(::google::protobuf::uint32 value); + + // required uint32 input_height_csc = 26; + inline bool has_input_height_csc() const; + inline void clear_input_height_csc(); + static const int kInputHeightCscFieldNumber = 26; + inline ::google::protobuf::uint32 input_height_csc() const; + inline void set_input_height_csc(::google::protobuf::uint32 value); + + // required uint32 input_channel_csc = 27; + inline bool has_input_channel_csc() const; + inline void clear_input_channel_csc(); + static const int kInputChannelCscFieldNumber = 27; + inline ::google::protobuf::uint32 input_channel_csc() const; + inline void set_input_channel_csc(::google::protobuf::uint32 value); + + // required uint32 kernel_width_csc = 28; + inline bool has_kernel_width_csc() const; + inline void clear_kernel_width_csc(); + static const int kKernelWidthCscFieldNumber = 28; + inline ::google::protobuf::uint32 kernel_width_csc() const; + inline void set_kernel_width_csc(::google::protobuf::uint32 value); + + // required uint32 kernel_height_csc = 29; + inline bool has_kernel_height_csc() const; + inline void clear_kernel_height_csc(); + static const int kKernelHeightCscFieldNumber = 29; + inline ::google::protobuf::uint32 kernel_height_csc() const; + inline void set_kernel_height_csc(::google::protobuf::uint32 value); + + // required uint32 kernel_channel_csc = 30; + inline bool has_kernel_channel_csc() const; + inline void clear_kernel_channel_csc(); + static const int kKernelChannelCscFieldNumber = 30; + inline ::google::protobuf::uint32 kernel_channel_csc() const; + inline void set_kernel_channel_csc(::google::protobuf::uint32 value); + + // required uint32 input_width_cmac = 31; + inline bool has_input_width_cmac() const; + inline void clear_input_width_cmac(); + static const int kInputWidthCmacFieldNumber = 31; + inline ::google::protobuf::uint32 input_width_cmac() const; + inline void set_input_width_cmac(::google::protobuf::uint32 value); + + // required uint32 input_height_cmac = 32; + inline bool has_input_height_cmac() const; + inline void clear_input_height_cmac(); + static const int kInputHeightCmacFieldNumber = 32; + inline ::google::protobuf::uint32 input_height_cmac() const; + inline void set_input_height_cmac(::google::protobuf::uint32 value); + + // required uint32 bytes_per_kernel = 33; + inline bool has_bytes_per_kernel() const; + inline void clear_bytes_per_kernel(); + static const int kBytesPerKernelFieldNumber = 33; + inline ::google::protobuf::uint32 bytes_per_kernel() const; + inline void set_bytes_per_kernel(::google::protobuf::uint32 value); + + // required int32 mean_ry = 34; + inline bool has_mean_ry() const; + inline void clear_mean_ry(); + static const int kMeanRyFieldNumber = 34; + inline ::google::protobuf::int32 mean_ry() const; + inline void set_mean_ry(::google::protobuf::int32 value); + + // required int32 mean_gu = 35; + inline bool has_mean_gu() const; + inline void clear_mean_gu(); + static const int kMeanGuFieldNumber = 35; + inline ::google::protobuf::int32 mean_gu() const; + inline void set_mean_gu(::google::protobuf::int32 value); + + // required int32 mean_bv = 36; + inline bool has_mean_bv() const; + inline void clear_mean_bv(); + static const int kMeanBvFieldNumber = 36; + inline ::google::protobuf::int32 mean_bv() const; + inline void set_mean_bv(::google::protobuf::int32 value); + + // required int32 mean_ax = 37; + inline bool has_mean_ax() const; + inline void clear_mean_ax(); + static const int kMeanAxFieldNumber = 37; + inline ::google::protobuf::int32 mean_ax() const; + inline void set_mean_ax(::google::protobuf::int32 value); + + // required .nvdla_prototest_interface.MeanFormat mean_format = 38; + inline bool has_mean_format() const; + inline void clear_mean_format(); + static const int kMeanFormatFieldNumber = 38; + inline ::nvdla_prototest_interface::MeanFormat mean_format() const; + inline void set_mean_format(::nvdla_prototest_interface::MeanFormat value); + + // required uint32 conv_stride_x = 39; + inline bool has_conv_stride_x() const; + inline void clear_conv_stride_x(); + static const int kConvStrideXFieldNumber = 39; + inline ::google::protobuf::uint32 conv_stride_x() const; + inline void set_conv_stride_x(::google::protobuf::uint32 value); + + // required uint32 conv_stride_y = 40; + inline bool has_conv_stride_y() const; + inline void clear_conv_stride_y(); + static const int kConvStrideYFieldNumber = 40; + inline ::google::protobuf::uint32 conv_stride_y() const; + inline void set_conv_stride_y(::google::protobuf::uint32 value); + + // required uint32 pad_x_left = 41; + inline bool has_pad_x_left() const; + inline void clear_pad_x_left(); + static const int kPadXLeftFieldNumber = 41; + inline ::google::protobuf::uint32 pad_x_left() const; + inline void set_pad_x_left(::google::protobuf::uint32 value); + + // required uint32 pad_x_right = 42; + inline bool has_pad_x_right() const; + inline void clear_pad_x_right(); + static const int kPadXRightFieldNumber = 42; + inline ::google::protobuf::uint32 pad_x_right() const; + inline void set_pad_x_right(::google::protobuf::uint32 value); + + // required uint32 pad_y_top = 43; + inline bool has_pad_y_top() const; + inline void clear_pad_y_top(); + static const int kPadYTopFieldNumber = 43; + inline ::google::protobuf::uint32 pad_y_top() const; + inline void set_pad_y_top(::google::protobuf::uint32 value); + + // required uint32 pad_y_bottom = 44; + inline bool has_pad_y_bottom() const; + inline void clear_pad_y_bottom(); + static const int kPadYBottomFieldNumber = 44; + inline ::google::protobuf::uint32 pad_y_bottom() const; + inline void set_pad_y_bottom(::google::protobuf::uint32 value); + + // required uint32 dilation_x = 45; + inline bool has_dilation_x() const; + inline void clear_dilation_x(); + static const int kDilationXFieldNumber = 45; + inline ::google::protobuf::uint32 dilation_x() const; + inline void set_dilation_x(::google::protobuf::uint32 value); + + // required uint32 dilation_y = 46; + inline bool has_dilation_y() const; + inline void clear_dilation_y(); + static const int kDilationYFieldNumber = 46; + inline ::google::protobuf::uint32 dilation_y() const; + inline void set_dilation_y(::google::protobuf::uint32 value); + + // repeated uint32 reserved2 = 47 [packed = true]; + inline int reserved2_size() const; + inline void clear_reserved2(); + static const int kReserved2FieldNumber = 47; + inline ::google::protobuf::uint32 reserved2(int index) const; + inline void set_reserved2(int index, ::google::protobuf::uint32 value); + inline void add_reserved2(::google::protobuf::uint32 value); + inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& + reserved2() const; + inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* + mutable_reserved2(); + + // required uint32 pra_truncate = 48; + inline bool has_pra_truncate() const; + inline void clear_pra_truncate(); + static const int kPraTruncateFieldNumber = 48; + inline ::google::protobuf::uint32 pra_truncate() const; + inline void set_pra_truncate(::google::protobuf::uint32 value); + + // required .nvdla_prototest_interface.DataPrecision in_precision = 49; + inline bool has_in_precision() const; + inline void clear_in_precision(); + static const int kInPrecisionFieldNumber = 49; + inline ::nvdla_prototest_interface::DataPrecision in_precision() const; + inline void set_in_precision(::nvdla_prototest_interface::DataPrecision value); + + // required .nvdla_prototest_interface.DataPrecision out_precision = 50; + inline bool has_out_precision() const; + inline void clear_out_precision(); + static const int kOutPrecisionFieldNumber = 50; + inline ::nvdla_prototest_interface::DataPrecision out_precision() const; + inline void set_out_precision(::nvdla_prototest_interface::DataPrecision value); + + // required int32 pad_val = 51; + inline bool has_pad_val() const; + inline void clear_pad_val(); + static const int kPadValFieldNumber = 51; + inline ::google::protobuf::int32 pad_val() const; + inline void set_pad_val(::google::protobuf::int32 value); + + // required .nvdla_prototest_interface.CVTParam in_cvt = 52; + inline bool has_in_cvt() const; + inline void clear_in_cvt(); + static const int kInCvtFieldNumber = 52; + inline const ::nvdla_prototest_interface::CVTParam& in_cvt() const; + inline ::nvdla_prototest_interface::CVTParam* mutable_in_cvt(); + inline ::nvdla_prototest_interface::CVTParam* release_in_cvt(); + inline void set_allocated_in_cvt(::nvdla_prototest_interface::CVTParam* in_cvt); + + // required .nvdla_prototest_interface.CVTParam out_cvt = 53; + inline bool has_out_cvt() const; + inline void clear_out_cvt(); + static const int kOutCvtFieldNumber = 53; + inline const ::nvdla_prototest_interface::CVTParam& out_cvt() const; + inline ::nvdla_prototest_interface::CVTParam* mutable_out_cvt(); + inline ::nvdla_prototest_interface::CVTParam* release_out_cvt(); + inline void set_allocated_out_cvt(::nvdla_prototest_interface::CVTParam* out_cvt); + + // @@protoc_insertion_point(class_scope:nvdla_prototest_interface.CONVOpDesc) + private: + inline void set_has_conv_mode(); + inline void clear_has_conv_mode(); + inline void set_has_data_reuse(); + inline void clear_has_data_reuse(); + inline void set_has_weight_reuse(); + inline void clear_has_weight_reuse(); + inline void set_has_skip_data_rls(); + inline void clear_has_skip_data_rls(); + inline void set_has_skip_weight_rls(); + inline void clear_has_skip_weight_rls(); + inline void set_has_reserved0(); + inline void clear_has_reserved0(); + inline void set_has_entry_per_slice(); + inline void clear_has_entry_per_slice(); + inline void set_has_data_format(); + inline void clear_has_data_format(); + inline void set_has_pixel_mapping(); + inline void clear_has_pixel_mapping(); + inline void set_has_fetch_grain(); + inline void clear_has_fetch_grain(); + inline void set_has_pixel_offset_x(); + inline void clear_has_pixel_offset_x(); + inline void set_has_pixel_offset_y(); + inline void clear_has_pixel_offset_y(); + inline void set_has_gob_per_line(); + inline void clear_has_gob_per_line(); + inline void set_has_gob_height(); + inline void clear_has_gob_height(); + inline void set_has_gob_y_index(); + inline void clear_has_gob_y_index(); + inline void set_has_gob_per_uv_line(); + inline void clear_has_gob_per_uv_line(); + inline void set_has_batch(); + inline void clear_has_batch(); + inline void set_has_weight_format(); + inline void clear_has_weight_format(); + inline void set_has_data_bank(); + inline void clear_has_data_bank(); + inline void set_has_weight_bank(); + inline void clear_has_weight_bank(); + inline void set_has_batch_stride(); + inline void clear_has_batch_stride(); + inline void set_has_post_extension(); + inline void clear_has_post_extension(); + inline void set_has_pixel_override(); + inline void clear_has_pixel_override(); + inline void set_has_release(); + inline void clear_has_release(); + inline void set_has_input_width_csc(); + inline void clear_has_input_width_csc(); + inline void set_has_input_height_csc(); + inline void clear_has_input_height_csc(); + inline void set_has_input_channel_csc(); + inline void clear_has_input_channel_csc(); + inline void set_has_kernel_width_csc(); + inline void clear_has_kernel_width_csc(); + inline void set_has_kernel_height_csc(); + inline void clear_has_kernel_height_csc(); + inline void set_has_kernel_channel_csc(); + inline void clear_has_kernel_channel_csc(); + inline void set_has_input_width_cmac(); + inline void clear_has_input_width_cmac(); + inline void set_has_input_height_cmac(); + inline void clear_has_input_height_cmac(); + inline void set_has_bytes_per_kernel(); + inline void clear_has_bytes_per_kernel(); + inline void set_has_mean_ry(); + inline void clear_has_mean_ry(); + inline void set_has_mean_gu(); + inline void clear_has_mean_gu(); + inline void set_has_mean_bv(); + inline void clear_has_mean_bv(); + inline void set_has_mean_ax(); + inline void clear_has_mean_ax(); + inline void set_has_mean_format(); + inline void clear_has_mean_format(); + inline void set_has_conv_stride_x(); + inline void clear_has_conv_stride_x(); + inline void set_has_conv_stride_y(); + inline void clear_has_conv_stride_y(); + inline void set_has_pad_x_left(); + inline void clear_has_pad_x_left(); + inline void set_has_pad_x_right(); + inline void clear_has_pad_x_right(); + inline void set_has_pad_y_top(); + inline void clear_has_pad_y_top(); + inline void set_has_pad_y_bottom(); + inline void clear_has_pad_y_bottom(); + inline void set_has_dilation_x(); + inline void clear_has_dilation_x(); + inline void set_has_dilation_y(); + inline void clear_has_dilation_y(); + inline void set_has_pra_truncate(); + inline void clear_has_pra_truncate(); + inline void set_has_in_precision(); + inline void clear_has_in_precision(); + inline void set_has_out_precision(); + inline void clear_has_out_precision(); + inline void set_has_pad_val(); + inline void clear_has_pad_val(); + inline void set_has_in_cvt(); + inline void clear_has_in_cvt(); + inline void set_has_out_cvt(); + inline void clear_has_out_cvt(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[2]; + int conv_mode_; + ::google::protobuf::uint32 data_reuse_; + ::google::protobuf::uint32 weight_reuse_; + ::google::protobuf::uint32 skip_data_rls_; + ::google::protobuf::uint32 skip_weight_rls_; + ::google::protobuf::uint32 reserved0_; + ::google::protobuf::uint32 entry_per_slice_; + int data_format_; + ::google::protobuf::uint32 pixel_mapping_; + ::google::protobuf::uint32 fetch_grain_; + ::google::protobuf::uint32 pixel_offset_x_; + ::google::protobuf::uint32 pixel_offset_y_; + ::google::protobuf::uint32 gob_per_line_; + ::google::protobuf::uint32 gob_height_; + ::google::protobuf::uint32 gob_y_index_; + ::google::protobuf::uint32 gob_per_uv_line_; + ::google::protobuf::uint32 batch_; + int weight_format_; + ::google::protobuf::uint32 data_bank_; + ::google::protobuf::uint32 weight_bank_; + ::google::protobuf::uint32 batch_stride_; + ::google::protobuf::uint32 post_extension_; + int pixel_override_; + ::google::protobuf::uint32 release_; + ::google::protobuf::uint32 input_width_csc_; + ::google::protobuf::uint32 input_height_csc_; + ::google::protobuf::uint32 input_channel_csc_; + ::google::protobuf::uint32 kernel_width_csc_; + ::google::protobuf::uint32 kernel_height_csc_; + ::google::protobuf::uint32 kernel_channel_csc_; + ::google::protobuf::uint32 input_width_cmac_; + ::google::protobuf::uint32 input_height_cmac_; + ::google::protobuf::uint32 bytes_per_kernel_; + ::google::protobuf::int32 mean_ry_; + ::google::protobuf::int32 mean_gu_; + ::google::protobuf::int32 mean_bv_; + ::google::protobuf::int32 mean_ax_; + int mean_format_; + ::google::protobuf::uint32 conv_stride_x_; + ::google::protobuf::uint32 conv_stride_y_; + ::google::protobuf::uint32 pad_x_left_; + ::google::protobuf::uint32 pad_x_right_; + ::google::protobuf::uint32 pad_y_top_; + ::google::protobuf::uint32 pad_y_bottom_; + ::google::protobuf::uint32 dilation_x_; + ::google::protobuf::uint32 dilation_y_; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > reserved2_; + mutable int _reserved2_cached_byte_size_; + ::google::protobuf::uint32 pra_truncate_; + int in_precision_; + int out_precision_; + ::google::protobuf::int32 pad_val_; + ::nvdla_prototest_interface::CVTParam* in_cvt_; + ::nvdla_prototest_interface::CVTParam* out_cvt_; + mutable int _cached_size_; + friend void protobuf_AddDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_AssignDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_ShutdownFile_DlaPrototestInterface_2eproto(); + + void InitAsDefaultInstance(); + static CONVOpDesc* default_instance_; +}; +// ------------------------------------------------------------------- + +class SDPCvt : public ::google::protobuf::Message { + public: + SDPCvt(); + virtual ~SDPCvt(); + + SDPCvt(const SDPCvt& from); + + inline SDPCvt& operator=(const SDPCvt& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const SDPCvt& default_instance(); + + void Swap(SDPCvt* other); + + // implements Message ---------------------------------------------- + + SDPCvt* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const SDPCvt& from); + void MergeFrom(const SDPCvt& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // required .nvdla_prototest_interface.CVTParam alu_cvt = 1; + inline bool has_alu_cvt() const; + inline void clear_alu_cvt(); + static const int kAluCvtFieldNumber = 1; + inline const ::nvdla_prototest_interface::CVTParam& alu_cvt() const; + inline ::nvdla_prototest_interface::CVTParam* mutable_alu_cvt(); + inline ::nvdla_prototest_interface::CVTParam* release_alu_cvt(); + inline void set_allocated_alu_cvt(::nvdla_prototest_interface::CVTParam* alu_cvt); + + // required .nvdla_prototest_interface.CVTParam mul_cvt = 2; + inline bool has_mul_cvt() const; + inline void clear_mul_cvt(); + static const int kMulCvtFieldNumber = 2; + inline const ::nvdla_prototest_interface::CVTParam& mul_cvt() const; + inline ::nvdla_prototest_interface::CVTParam* mutable_mul_cvt(); + inline ::nvdla_prototest_interface::CVTParam* release_mul_cvt(); + inline void set_allocated_mul_cvt(::nvdla_prototest_interface::CVTParam* mul_cvt); + + // @@protoc_insertion_point(class_scope:nvdla_prototest_interface.SDPCvt) + private: + inline void set_has_alu_cvt(); + inline void clear_has_alu_cvt(); + inline void set_has_mul_cvt(); + inline void clear_has_mul_cvt(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::nvdla_prototest_interface::CVTParam* alu_cvt_; + ::nvdla_prototest_interface::CVTParam* mul_cvt_; + friend void protobuf_AddDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_AssignDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_ShutdownFile_DlaPrototestInterface_2eproto(); + + void InitAsDefaultInstance(); + static SDPCvt* default_instance_; +}; +// ------------------------------------------------------------------- + +class SDPOp : public ::google::protobuf::Message { + public: + SDPOp(); + virtual ~SDPOp(); + + SDPOp(const SDPOp& from); + + inline SDPOp& operator=(const SDPOp& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const SDPOp& default_instance(); + + void Swap(SDPOp* other); + + // implements Message ---------------------------------------------- + + SDPOp* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const SDPOp& from); + void MergeFrom(const SDPOp& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + typedef SDPOp_SDPOpMode SDPOpMode; + static const SDPOpMode SDP_OP_PER_LAYER = SDPOp_SDPOpMode_SDP_OP_PER_LAYER; + static const SDPOpMode SDP_OP_PER_KERNEL = SDPOp_SDPOpMode_SDP_OP_PER_KERNEL; + static const SDPOpMode SDP_OP_PER_POINT = SDPOp_SDPOpMode_SDP_OP_PER_POINT; + static inline bool SDPOpMode_IsValid(int value) { + return SDPOp_SDPOpMode_IsValid(value); + } + static const SDPOpMode SDPOpMode_MIN = + SDPOp_SDPOpMode_SDPOpMode_MIN; + static const SDPOpMode SDPOpMode_MAX = + SDPOp_SDPOpMode_SDPOpMode_MAX; + static const int SDPOpMode_ARRAYSIZE = + SDPOp_SDPOpMode_SDPOpMode_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + SDPOpMode_descriptor() { + return SDPOp_SDPOpMode_descriptor(); + } + static inline const ::std::string& SDPOpMode_Name(SDPOpMode value) { + return SDPOp_SDPOpMode_Name(value); + } + static inline bool SDPOpMode_Parse(const ::std::string& name, + SDPOpMode* value) { + return SDPOp_SDPOpMode_Parse(name, value); + } + + // accessors ------------------------------------------------------- + + // required uint32 enable = 1; + inline bool has_enable() const; + inline void clear_enable(); + static const int kEnableFieldNumber = 1; + inline ::google::protobuf::uint32 enable() const; + inline void set_enable(::google::protobuf::uint32 value); + + // required .nvdla_prototest_interface.ALUType alu_type = 2; + inline bool has_alu_type() const; + inline void clear_alu_type(); + static const int kAluTypeFieldNumber = 2; + inline ::nvdla_prototest_interface::ALUType alu_type() const; + inline void set_alu_type(::nvdla_prototest_interface::ALUType value); + + // required .nvdla_prototest_interface.SDPOpType type = 3; + inline bool has_type() const; + inline void clear_type(); + static const int kTypeFieldNumber = 3; + inline ::nvdla_prototest_interface::SDPOpType type() const; + inline void set_type(::nvdla_prototest_interface::SDPOpType value); + + // required .nvdla_prototest_interface.SDPOp.SDPOpMode mode = 4; + inline bool has_mode() const; + inline void clear_mode(); + static const int kModeFieldNumber = 4; + inline ::nvdla_prototest_interface::SDPOp_SDPOpMode mode() const; + inline void set_mode(::nvdla_prototest_interface::SDPOp_SDPOpMode value); + + // required .nvdla_prototest_interface.SDPActivation act = 5; + inline bool has_act() const; + inline void clear_act(); + static const int kActFieldNumber = 5; + inline ::nvdla_prototest_interface::SDPActivation act() const; + inline void set_act(::nvdla_prototest_interface::SDPActivation value); + + // required uint32 shift_value = 6; + inline bool has_shift_value() const; + inline void clear_shift_value(); + static const int kShiftValueFieldNumber = 6; + inline ::google::protobuf::uint32 shift_value() const; + inline void set_shift_value(::google::protobuf::uint32 value); + + // required uint32 truncate = 7; + inline bool has_truncate() const; + inline void clear_truncate(); + static const int kTruncateFieldNumber = 7; + inline ::google::protobuf::uint32 truncate() const; + inline void set_truncate(::google::protobuf::uint32 value); + + // required .nvdla_prototest_interface.DataPrecision precision = 8; + inline bool has_precision() const; + inline void clear_precision(); + static const int kPrecisionFieldNumber = 8; + inline ::nvdla_prototest_interface::DataPrecision precision() const; + inline void set_precision(::nvdla_prototest_interface::DataPrecision value); + + // required int32 alu_operand = 9; + inline bool has_alu_operand() const; + inline void clear_alu_operand(); + static const int kAluOperandFieldNumber = 9; + inline ::google::protobuf::int32 alu_operand() const; + inline void set_alu_operand(::google::protobuf::int32 value); + + // required int32 mul_operand = 10; + inline bool has_mul_operand() const; + inline void clear_mul_operand(); + static const int kMulOperandFieldNumber = 10; + inline ::google::protobuf::int32 mul_operand() const; + inline void set_mul_operand(::google::protobuf::int32 value); + + // required .nvdla_prototest_interface.SDPCvt cvt = 11; + inline bool has_cvt() const; + inline void clear_cvt(); + static const int kCvtFieldNumber = 11; + inline const ::nvdla_prototest_interface::SDPCvt& cvt() const; + inline ::nvdla_prototest_interface::SDPCvt* mutable_cvt(); + inline ::nvdla_prototest_interface::SDPCvt* release_cvt(); + inline void set_allocated_cvt(::nvdla_prototest_interface::SDPCvt* cvt); + + // @@protoc_insertion_point(class_scope:nvdla_prototest_interface.SDPOp) + private: + inline void set_has_enable(); + inline void clear_has_enable(); + inline void set_has_alu_type(); + inline void clear_has_alu_type(); + inline void set_has_type(); + inline void clear_has_type(); + inline void set_has_mode(); + inline void clear_has_mode(); + inline void set_has_act(); + inline void clear_has_act(); + inline void set_has_shift_value(); + inline void clear_has_shift_value(); + inline void set_has_truncate(); + inline void clear_has_truncate(); + inline void set_has_precision(); + inline void clear_has_precision(); + inline void set_has_alu_operand(); + inline void clear_has_alu_operand(); + inline void set_has_mul_operand(); + inline void clear_has_mul_operand(); + inline void set_has_cvt(); + inline void clear_has_cvt(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::uint32 enable_; + int alu_type_; + int type_; + int mode_; + int act_; + ::google::protobuf::uint32 shift_value_; + ::google::protobuf::uint32 truncate_; + int precision_; + ::google::protobuf::int32 alu_operand_; + ::google::protobuf::int32 mul_operand_; + ::nvdla_prototest_interface::SDPCvt* cvt_; + friend void protobuf_AddDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_AssignDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_ShutdownFile_DlaPrototestInterface_2eproto(); + + void InitAsDefaultInstance(); + static SDPOp* default_instance_; +}; +// ------------------------------------------------------------------- + +class SDPSurfaceDesc : public ::google::protobuf::Message { + public: + SDPSurfaceDesc(); + virtual ~SDPSurfaceDesc(); + + SDPSurfaceDesc(const SDPSurfaceDesc& from); + + inline SDPSurfaceDesc& operator=(const SDPSurfaceDesc& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const SDPSurfaceDesc& default_instance(); + + void Swap(SDPSurfaceDesc* other); + + // implements Message ---------------------------------------------- + + SDPSurfaceDesc* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const SDPSurfaceDesc& from); + void MergeFrom(const SDPSurfaceDesc& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // required .nvdla_prototest_interface.DataCube src_data = 1; + inline bool has_src_data() const; + inline void clear_src_data(); + static const int kSrcDataFieldNumber = 1; + inline const ::nvdla_prototest_interface::DataCube& src_data() const; + inline ::nvdla_prototest_interface::DataCube* mutable_src_data(); + inline ::nvdla_prototest_interface::DataCube* release_src_data(); + inline void set_allocated_src_data(::nvdla_prototest_interface::DataCube* src_data); + + // optional .nvdla_prototest_interface.DataCube x1_data = 2; + inline bool has_x1_data() const; + inline void clear_x1_data(); + static const int kX1DataFieldNumber = 2; + inline const ::nvdla_prototest_interface::DataCube& x1_data() const; + inline ::nvdla_prototest_interface::DataCube* mutable_x1_data(); + inline ::nvdla_prototest_interface::DataCube* release_x1_data(); + inline void set_allocated_x1_data(::nvdla_prototest_interface::DataCube* x1_data); + + // optional .nvdla_prototest_interface.DataCube x2_data = 3; + inline bool has_x2_data() const; + inline void clear_x2_data(); + static const int kX2DataFieldNumber = 3; + inline const ::nvdla_prototest_interface::DataCube& x2_data() const; + inline ::nvdla_prototest_interface::DataCube* mutable_x2_data(); + inline ::nvdla_prototest_interface::DataCube* release_x2_data(); + inline void set_allocated_x2_data(::nvdla_prototest_interface::DataCube* x2_data); + + // optional .nvdla_prototest_interface.DataCube y_data = 4; + inline bool has_y_data() const; + inline void clear_y_data(); + static const int kYDataFieldNumber = 4; + inline const ::nvdla_prototest_interface::DataCube& y_data() const; + inline ::nvdla_prototest_interface::DataCube* mutable_y_data(); + inline ::nvdla_prototest_interface::DataCube* release_y_data(); + inline void set_allocated_y_data(::nvdla_prototest_interface::DataCube* y_data); + + // required .nvdla_prototest_interface.DataCube dst_data = 5; + inline bool has_dst_data() const; + inline void clear_dst_data(); + static const int kDstDataFieldNumber = 5; + inline const ::nvdla_prototest_interface::DataCube& dst_data() const; + inline ::nvdla_prototest_interface::DataCube* mutable_dst_data(); + inline ::nvdla_prototest_interface::DataCube* release_dst_data(); + inline void set_allocated_dst_data(::nvdla_prototest_interface::DataCube* dst_data); + + // @@protoc_insertion_point(class_scope:nvdla_prototest_interface.SDPSurfaceDesc) + private: + inline void set_has_src_data(); + inline void clear_has_src_data(); + inline void set_has_x1_data(); + inline void clear_has_x1_data(); + inline void set_has_x2_data(); + inline void clear_has_x2_data(); + inline void set_has_y_data(); + inline void clear_has_y_data(); + inline void set_has_dst_data(); + inline void clear_has_dst_data(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::nvdla_prototest_interface::DataCube* src_data_; + ::nvdla_prototest_interface::DataCube* x1_data_; + ::nvdla_prototest_interface::DataCube* x2_data_; + ::nvdla_prototest_interface::DataCube* y_data_; + ::nvdla_prototest_interface::DataCube* dst_data_; + friend void protobuf_AddDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_AssignDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_ShutdownFile_DlaPrototestInterface_2eproto(); + + void InitAsDefaultInstance(); + static SDPSurfaceDesc* default_instance_; +}; +// ------------------------------------------------------------------- + +class SDPOpDesc : public ::google::protobuf::Message { + public: + SDPOpDesc(); + virtual ~SDPOpDesc(); + + SDPOpDesc(const SDPOpDesc& from); + + inline SDPOpDesc& operator=(const SDPOpDesc& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const SDPOpDesc& default_instance(); + + void Swap(SDPOpDesc* other); + + // implements Message ---------------------------------------------- + + SDPOpDesc* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const SDPOpDesc& from); + void MergeFrom(const SDPOpDesc& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // required .nvdla_prototest_interface.DataPrecision src_precision = 1; + inline bool has_src_precision() const; + inline void clear_src_precision(); + static const int kSrcPrecisionFieldNumber = 1; + inline ::nvdla_prototest_interface::DataPrecision src_precision() const; + inline void set_src_precision(::nvdla_prototest_interface::DataPrecision value); + + // required .nvdla_prototest_interface.DataPrecision dst_precision = 2; + inline bool has_dst_precision() const; + inline void clear_dst_precision(); + static const int kDstPrecisionFieldNumber = 2; + inline ::nvdla_prototest_interface::DataPrecision dst_precision() const; + inline void set_dst_precision(::nvdla_prototest_interface::DataPrecision value); + + // required int32 lut_index = 3; + inline bool has_lut_index() const; + inline void clear_lut_index(); + static const int kLutIndexFieldNumber = 3; + inline ::google::protobuf::int32 lut_index() const; + inline void set_lut_index(::google::protobuf::int32 value); + + // required .nvdla_prototest_interface.CVTParam out_cvt = 4; + inline bool has_out_cvt() const; + inline void clear_out_cvt(); + static const int kOutCvtFieldNumber = 4; + inline const ::nvdla_prototest_interface::CVTParam& out_cvt() const; + inline ::nvdla_prototest_interface::CVTParam* mutable_out_cvt(); + inline ::nvdla_prototest_interface::CVTParam* release_out_cvt(); + inline void set_allocated_out_cvt(::nvdla_prototest_interface::CVTParam* out_cvt); + + // required .nvdla_prototest_interface.ConvMode conv_mode = 5; + inline bool has_conv_mode() const; + inline void clear_conv_mode(); + static const int kConvModeFieldNumber = 5; + inline ::nvdla_prototest_interface::ConvMode conv_mode() const; + inline void set_conv_mode(::nvdla_prototest_interface::ConvMode value); + + // required uint32 batch_num = 6; + inline bool has_batch_num() const; + inline void clear_batch_num(); + static const int kBatchNumFieldNumber = 6; + inline ::google::protobuf::uint32 batch_num() const; + inline void set_batch_num(::google::protobuf::uint32 value); + + // optional uint32 reserved0 = 7 [default = 0]; + inline bool has_reserved0() const; + inline void clear_reserved0(); + static const int kReserved0FieldNumber = 7; + inline ::google::protobuf::uint32 reserved0() const; + inline void set_reserved0(::google::protobuf::uint32 value); + + // required uint32 batch_stride = 8; + inline bool has_batch_stride() const; + inline void clear_batch_stride(); + static const int kBatchStrideFieldNumber = 8; + inline ::google::protobuf::uint32 batch_stride() const; + inline void set_batch_stride(::google::protobuf::uint32 value); + + // required .nvdla_prototest_interface.SDPOp x1_op = 9; + inline bool has_x1_op() const; + inline void clear_x1_op(); + static const int kX1OpFieldNumber = 9; + inline const ::nvdla_prototest_interface::SDPOp& x1_op() const; + inline ::nvdla_prototest_interface::SDPOp* mutable_x1_op(); + inline ::nvdla_prototest_interface::SDPOp* release_x1_op(); + inline void set_allocated_x1_op(::nvdla_prototest_interface::SDPOp* x1_op); + + // required .nvdla_prototest_interface.SDPOp x2_op = 10; + inline bool has_x2_op() const; + inline void clear_x2_op(); + static const int kX2OpFieldNumber = 10; + inline const ::nvdla_prototest_interface::SDPOp& x2_op() const; + inline ::nvdla_prototest_interface::SDPOp* mutable_x2_op(); + inline ::nvdla_prototest_interface::SDPOp* release_x2_op(); + inline void set_allocated_x2_op(::nvdla_prototest_interface::SDPOp* x2_op); + + // required .nvdla_prototest_interface.SDPOp y_op = 11; + inline bool has_y_op() const; + inline void clear_y_op(); + static const int kYOpFieldNumber = 11; + inline const ::nvdla_prototest_interface::SDPOp& y_op() const; + inline ::nvdla_prototest_interface::SDPOp* mutable_y_op(); + inline ::nvdla_prototest_interface::SDPOp* release_y_op(); + inline void set_allocated_y_op(::nvdla_prototest_interface::SDPOp* y_op); + + // @@protoc_insertion_point(class_scope:nvdla_prototest_interface.SDPOpDesc) + private: + inline void set_has_src_precision(); + inline void clear_has_src_precision(); + inline void set_has_dst_precision(); + inline void clear_has_dst_precision(); + inline void set_has_lut_index(); + inline void clear_has_lut_index(); + inline void set_has_out_cvt(); + inline void clear_has_out_cvt(); + inline void set_has_conv_mode(); + inline void clear_has_conv_mode(); + inline void set_has_batch_num(); + inline void clear_has_batch_num(); + inline void set_has_reserved0(); + inline void clear_has_reserved0(); + inline void set_has_batch_stride(); + inline void clear_has_batch_stride(); + inline void set_has_x1_op(); + inline void clear_has_x1_op(); + inline void set_has_x2_op(); + inline void clear_has_x2_op(); + inline void set_has_y_op(); + inline void clear_has_y_op(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + int src_precision_; + int dst_precision_; + ::nvdla_prototest_interface::CVTParam* out_cvt_; + ::google::protobuf::int32 lut_index_; + int conv_mode_; + ::google::protobuf::uint32 batch_num_; + ::google::protobuf::uint32 reserved0_; + ::nvdla_prototest_interface::SDPOp* x1_op_; + ::nvdla_prototest_interface::SDPOp* x2_op_; + ::nvdla_prototest_interface::SDPOp* y_op_; + ::google::protobuf::uint32 batch_stride_; + friend void protobuf_AddDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_AssignDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_ShutdownFile_DlaPrototestInterface_2eproto(); + + void InitAsDefaultInstance(); + static SDPOpDesc* default_instance_; +}; +// ------------------------------------------------------------------- + +class PDPSurfaceDesc : public ::google::protobuf::Message { + public: + PDPSurfaceDesc(); + virtual ~PDPSurfaceDesc(); + + PDPSurfaceDesc(const PDPSurfaceDesc& from); + + inline PDPSurfaceDesc& operator=(const PDPSurfaceDesc& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const PDPSurfaceDesc& default_instance(); + + void Swap(PDPSurfaceDesc* other); + + // implements Message ---------------------------------------------- + + PDPSurfaceDesc* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const PDPSurfaceDesc& from); + void MergeFrom(const PDPSurfaceDesc& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // required .nvdla_prototest_interface.DataCube src_data = 1; + inline bool has_src_data() const; + inline void clear_src_data(); + static const int kSrcDataFieldNumber = 1; + inline const ::nvdla_prototest_interface::DataCube& src_data() const; + inline ::nvdla_prototest_interface::DataCube* mutable_src_data(); + inline ::nvdla_prototest_interface::DataCube* release_src_data(); + inline void set_allocated_src_data(::nvdla_prototest_interface::DataCube* src_data); + + // required .nvdla_prototest_interface.DataCube dst_data = 2; + inline bool has_dst_data() const; + inline void clear_dst_data(); + static const int kDstDataFieldNumber = 2; + inline const ::nvdla_prototest_interface::DataCube& dst_data() const; + inline ::nvdla_prototest_interface::DataCube* mutable_dst_data(); + inline ::nvdla_prototest_interface::DataCube* release_dst_data(); + inline void set_allocated_dst_data(::nvdla_prototest_interface::DataCube* dst_data); + + // @@protoc_insertion_point(class_scope:nvdla_prototest_interface.PDPSurfaceDesc) + private: + inline void set_has_src_data(); + inline void clear_has_src_data(); + inline void set_has_dst_data(); + inline void clear_has_dst_data(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::nvdla_prototest_interface::DataCube* src_data_; + ::nvdla_prototest_interface::DataCube* dst_data_; + friend void protobuf_AddDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_AssignDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_ShutdownFile_DlaPrototestInterface_2eproto(); + + void InitAsDefaultInstance(); + static PDPSurfaceDesc* default_instance_; +}; +// ------------------------------------------------------------------- + +class PDPOpDesc : public ::google::protobuf::Message { + public: + PDPOpDesc(); + virtual ~PDPOpDesc(); + + PDPOpDesc(const PDPOpDesc& from); + + inline PDPOpDesc& operator=(const PDPOpDesc& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const PDPOpDesc& default_instance(); + + void Swap(PDPOpDesc* other); + + // implements Message ---------------------------------------------- + + PDPOpDesc* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const PDPOpDesc& from); + void MergeFrom(const PDPOpDesc& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + typedef PDPOpDesc_PoolingMode PoolingMode; + static const PoolingMode MODE_AVG = PDPOpDesc_PoolingMode_MODE_AVG; + static const PoolingMode MODE_MAX = PDPOpDesc_PoolingMode_MODE_MAX; + static const PoolingMode MODE_MIN = PDPOpDesc_PoolingMode_MODE_MIN; + static inline bool PoolingMode_IsValid(int value) { + return PDPOpDesc_PoolingMode_IsValid(value); + } + static const PoolingMode PoolingMode_MIN = + PDPOpDesc_PoolingMode_PoolingMode_MIN; + static const PoolingMode PoolingMode_MAX = + PDPOpDesc_PoolingMode_PoolingMode_MAX; + static const int PoolingMode_ARRAYSIZE = + PDPOpDesc_PoolingMode_PoolingMode_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + PoolingMode_descriptor() { + return PDPOpDesc_PoolingMode_descriptor(); + } + static inline const ::std::string& PoolingMode_Name(PoolingMode value) { + return PDPOpDesc_PoolingMode_Name(value); + } + static inline bool PoolingMode_Parse(const ::std::string& name, + PoolingMode* value) { + return PDPOpDesc_PoolingMode_Parse(name, value); + } + + // accessors ------------------------------------------------------- + + // required uint32 partial_in_width_first = 1; + inline bool has_partial_in_width_first() const; + inline void clear_partial_in_width_first(); + static const int kPartialInWidthFirstFieldNumber = 1; + inline ::google::protobuf::uint32 partial_in_width_first() const; + inline void set_partial_in_width_first(::google::protobuf::uint32 value); + + // required uint32 partial_in_width_mid = 2; + inline bool has_partial_in_width_mid() const; + inline void clear_partial_in_width_mid(); + static const int kPartialInWidthMidFieldNumber = 2; + inline ::google::protobuf::uint32 partial_in_width_mid() const; + inline void set_partial_in_width_mid(::google::protobuf::uint32 value); + + // required uint32 partial_in_width_last = 3; + inline bool has_partial_in_width_last() const; + inline void clear_partial_in_width_last(); + static const int kPartialInWidthLastFieldNumber = 3; + inline ::google::protobuf::uint32 partial_in_width_last() const; + inline void set_partial_in_width_last(::google::protobuf::uint32 value); + + // required uint32 partial_width_first = 4; + inline bool has_partial_width_first() const; + inline void clear_partial_width_first(); + static const int kPartialWidthFirstFieldNumber = 4; + inline ::google::protobuf::uint32 partial_width_first() const; + inline void set_partial_width_first(::google::protobuf::uint32 value); + + // required uint32 partial_width_mid = 5; + inline bool has_partial_width_mid() const; + inline void clear_partial_width_mid(); + static const int kPartialWidthMidFieldNumber = 5; + inline ::google::protobuf::uint32 partial_width_mid() const; + inline void set_partial_width_mid(::google::protobuf::uint32 value); + + // required uint32 partial_width_last = 6; + inline bool has_partial_width_last() const; + inline void clear_partial_width_last(); + static const int kPartialWidthLastFieldNumber = 6; + inline ::google::protobuf::uint32 partial_width_last() const; + inline void set_partial_width_last(::google::protobuf::uint32 value); + + // required uint32 split_num = 7; + inline bool has_split_num() const; + inline void clear_split_num(); + static const int kSplitNumFieldNumber = 7; + inline ::google::protobuf::uint32 split_num() const; + inline void set_split_num(::google::protobuf::uint32 value); + + // required .nvdla_prototest_interface.PDPOpDesc.PoolingMode pool_mode = 8; + inline bool has_pool_mode() const; + inline void clear_pool_mode(); + static const int kPoolModeFieldNumber = 8; + inline ::nvdla_prototest_interface::PDPOpDesc_PoolingMode pool_mode() const; + inline void set_pool_mode(::nvdla_prototest_interface::PDPOpDesc_PoolingMode value); + + // required .nvdla_prototest_interface.PoolSize pool_width = 9; + inline bool has_pool_width() const; + inline void clear_pool_width(); + static const int kPoolWidthFieldNumber = 9; + inline ::nvdla_prototest_interface::PoolSize pool_width() const; + inline void set_pool_width(::nvdla_prototest_interface::PoolSize value); + + // required .nvdla_prototest_interface.PoolSize pool_height = 10; + inline bool has_pool_height() const; + inline void clear_pool_height(); + static const int kPoolHeightFieldNumber = 10; + inline ::nvdla_prototest_interface::PoolSize pool_height() const; + inline void set_pool_height(::nvdla_prototest_interface::PoolSize value); + + // required uint32 stride_x = 11; + inline bool has_stride_x() const; + inline void clear_stride_x(); + static const int kStrideXFieldNumber = 11; + inline ::google::protobuf::uint32 stride_x() const; + inline void set_stride_x(::google::protobuf::uint32 value); + + // required uint32 stride_y = 12; + inline bool has_stride_y() const; + inline void clear_stride_y(); + static const int kStrideYFieldNumber = 12; + inline ::google::protobuf::uint32 stride_y() const; + inline void set_stride_y(::google::protobuf::uint32 value); + + // required uint32 pad_left = 13; + inline bool has_pad_left() const; + inline void clear_pad_left(); + static const int kPadLeftFieldNumber = 13; + inline ::google::protobuf::uint32 pad_left() const; + inline void set_pad_left(::google::protobuf::uint32 value); + + // required uint32 pad_right = 14; + inline bool has_pad_right() const; + inline void clear_pad_right(); + static const int kPadRightFieldNumber = 14; + inline ::google::protobuf::uint32 pad_right() const; + inline void set_pad_right(::google::protobuf::uint32 value); + + // required uint32 pad_top = 15; + inline bool has_pad_top() const; + inline void clear_pad_top(); + static const int kPadTopFieldNumber = 15; + inline ::google::protobuf::uint32 pad_top() const; + inline void set_pad_top(::google::protobuf::uint32 value); + + // required uint32 pad_bottom = 16; + inline bool has_pad_bottom() const; + inline void clear_pad_bottom(); + static const int kPadBottomFieldNumber = 16; + inline ::google::protobuf::uint32 pad_bottom() const; + inline void set_pad_bottom(::google::protobuf::uint32 value); + + // required .nvdla_prototest_interface.DataPrecision precision = 17; + inline bool has_precision() const; + inline void clear_precision(); + static const int kPrecisionFieldNumber = 17; + inline ::nvdla_prototest_interface::DataPrecision precision() const; + inline void set_precision(::nvdla_prototest_interface::DataPrecision value); + + // optional uint32 reserved0 = 18 [default = 0]; + inline bool has_reserved0() const; + inline void clear_reserved0(); + static const int kReserved0FieldNumber = 18; + inline ::google::protobuf::uint32 reserved0() const; + inline void set_reserved0(::google::protobuf::uint32 value); + + // repeated int32 padding_value = 19 [packed = true]; + inline int padding_value_size() const; + inline void clear_padding_value(); + static const int kPaddingValueFieldNumber = 19; + inline ::google::protobuf::int32 padding_value(int index) const; + inline void set_padding_value(int index, ::google::protobuf::int32 value); + inline void add_padding_value(::google::protobuf::int32 value); + inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& + padding_value() const; + inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* + mutable_padding_value(); + + // @@protoc_insertion_point(class_scope:nvdla_prototest_interface.PDPOpDesc) + private: + inline void set_has_partial_in_width_first(); + inline void clear_has_partial_in_width_first(); + inline void set_has_partial_in_width_mid(); + inline void clear_has_partial_in_width_mid(); + inline void set_has_partial_in_width_last(); + inline void clear_has_partial_in_width_last(); + inline void set_has_partial_width_first(); + inline void clear_has_partial_width_first(); + inline void set_has_partial_width_mid(); + inline void clear_has_partial_width_mid(); + inline void set_has_partial_width_last(); + inline void clear_has_partial_width_last(); + inline void set_has_split_num(); + inline void clear_has_split_num(); + inline void set_has_pool_mode(); + inline void clear_has_pool_mode(); + inline void set_has_pool_width(); + inline void clear_has_pool_width(); + inline void set_has_pool_height(); + inline void clear_has_pool_height(); + inline void set_has_stride_x(); + inline void clear_has_stride_x(); + inline void set_has_stride_y(); + inline void clear_has_stride_y(); + inline void set_has_pad_left(); + inline void clear_has_pad_left(); + inline void set_has_pad_right(); + inline void clear_has_pad_right(); + inline void set_has_pad_top(); + inline void clear_has_pad_top(); + inline void set_has_pad_bottom(); + inline void clear_has_pad_bottom(); + inline void set_has_precision(); + inline void clear_has_precision(); + inline void set_has_reserved0(); + inline void clear_has_reserved0(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::uint32 partial_in_width_first_; + ::google::protobuf::uint32 partial_in_width_mid_; + ::google::protobuf::uint32 partial_in_width_last_; + ::google::protobuf::uint32 partial_width_first_; + ::google::protobuf::uint32 partial_width_mid_; + ::google::protobuf::uint32 partial_width_last_; + ::google::protobuf::uint32 split_num_; + int pool_mode_; + int pool_width_; + int pool_height_; + ::google::protobuf::uint32 stride_x_; + ::google::protobuf::uint32 stride_y_; + ::google::protobuf::uint32 pad_left_; + ::google::protobuf::uint32 pad_right_; + ::google::protobuf::uint32 pad_top_; + ::google::protobuf::uint32 pad_bottom_; + int precision_; + ::google::protobuf::uint32 reserved0_; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 > padding_value_; + mutable int _padding_value_cached_byte_size_; + friend void protobuf_AddDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_AssignDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_ShutdownFile_DlaPrototestInterface_2eproto(); + + void InitAsDefaultInstance(); + static PDPOpDesc* default_instance_; +}; +// ------------------------------------------------------------------- + +class CDPSurfaceDesc : public ::google::protobuf::Message { + public: + CDPSurfaceDesc(); + virtual ~CDPSurfaceDesc(); + + CDPSurfaceDesc(const CDPSurfaceDesc& from); + + inline CDPSurfaceDesc& operator=(const CDPSurfaceDesc& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const CDPSurfaceDesc& default_instance(); + + void Swap(CDPSurfaceDesc* other); + + // implements Message ---------------------------------------------- + + CDPSurfaceDesc* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const CDPSurfaceDesc& from); + void MergeFrom(const CDPSurfaceDesc& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // required .nvdla_prototest_interface.DataCube src_data = 1; + inline bool has_src_data() const; + inline void clear_src_data(); + static const int kSrcDataFieldNumber = 1; + inline const ::nvdla_prototest_interface::DataCube& src_data() const; + inline ::nvdla_prototest_interface::DataCube* mutable_src_data(); + inline ::nvdla_prototest_interface::DataCube* release_src_data(); + inline void set_allocated_src_data(::nvdla_prototest_interface::DataCube* src_data); + + // required .nvdla_prototest_interface.DataCube dst_data = 2; + inline bool has_dst_data() const; + inline void clear_dst_data(); + static const int kDstDataFieldNumber = 2; + inline const ::nvdla_prototest_interface::DataCube& dst_data() const; + inline ::nvdla_prototest_interface::DataCube* mutable_dst_data(); + inline ::nvdla_prototest_interface::DataCube* release_dst_data(); + inline void set_allocated_dst_data(::nvdla_prototest_interface::DataCube* dst_data); + + // @@protoc_insertion_point(class_scope:nvdla_prototest_interface.CDPSurfaceDesc) + private: + inline void set_has_src_data(); + inline void clear_has_src_data(); + inline void set_has_dst_data(); + inline void clear_has_dst_data(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::nvdla_prototest_interface::DataCube* src_data_; + ::nvdla_prototest_interface::DataCube* dst_data_; + friend void protobuf_AddDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_AssignDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_ShutdownFile_DlaPrototestInterface_2eproto(); + + void InitAsDefaultInstance(); + static CDPSurfaceDesc* default_instance_; +}; +// ------------------------------------------------------------------- + +class CDPOpDesc : public ::google::protobuf::Message { + public: + CDPOpDesc(); + virtual ~CDPOpDesc(); + + CDPOpDesc(const CDPOpDesc& from); + + inline CDPOpDesc& operator=(const CDPOpDesc& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const CDPOpDesc& default_instance(); + + void Swap(CDPOpDesc* other); + + // implements Message ---------------------------------------------- + + CDPOpDesc* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const CDPOpDesc& from); + void MergeFrom(const CDPOpDesc& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // required .nvdla_prototest_interface.DataPrecision in_precision = 1; + inline bool has_in_precision() const; + inline void clear_in_precision(); + static const int kInPrecisionFieldNumber = 1; + inline ::nvdla_prototest_interface::DataPrecision in_precision() const; + inline void set_in_precision(::nvdla_prototest_interface::DataPrecision value); + + // required .nvdla_prototest_interface.DataPrecision out_precision = 2; + inline bool has_out_precision() const; + inline void clear_out_precision(); + static const int kOutPrecisionFieldNumber = 2; + inline ::nvdla_prototest_interface::DataPrecision out_precision() const; + inline void set_out_precision(::nvdla_prototest_interface::DataPrecision value); + + // required int32 lut_index = 3; + inline bool has_lut_index() const; + inline void clear_lut_index(); + static const int kLutIndexFieldNumber = 3; + inline ::google::protobuf::int32 lut_index() const; + inline void set_lut_index(::google::protobuf::int32 value); + + // required .nvdla_prototest_interface.CVTParam in_cvt = 4; + inline bool has_in_cvt() const; + inline void clear_in_cvt(); + static const int kInCvtFieldNumber = 4; + inline const ::nvdla_prototest_interface::CVTParam& in_cvt() const; + inline ::nvdla_prototest_interface::CVTParam* mutable_in_cvt(); + inline ::nvdla_prototest_interface::CVTParam* release_in_cvt(); + inline void set_allocated_in_cvt(::nvdla_prototest_interface::CVTParam* in_cvt); + + // required .nvdla_prototest_interface.CVTParam out_cvt = 5; + inline bool has_out_cvt() const; + inline void clear_out_cvt(); + static const int kOutCvtFieldNumber = 5; + inline const ::nvdla_prototest_interface::CVTParam& out_cvt() const; + inline ::nvdla_prototest_interface::CVTParam* mutable_out_cvt(); + inline ::nvdla_prototest_interface::CVTParam* release_out_cvt(); + inline void set_allocated_out_cvt(::nvdla_prototest_interface::CVTParam* out_cvt); + + // required uint32 local_size = 6; + inline bool has_local_size() const; + inline void clear_local_size(); + static const int kLocalSizeFieldNumber = 6; + inline ::google::protobuf::uint32 local_size() const; + inline void set_local_size(::google::protobuf::uint32 value); + + // required uint32 bypass_sqsum = 7; + inline bool has_bypass_sqsum() const; + inline void clear_bypass_sqsum(); + static const int kBypassSqsumFieldNumber = 7; + inline ::google::protobuf::uint32 bypass_sqsum() const; + inline void set_bypass_sqsum(::google::protobuf::uint32 value); + + // required uint32 bypass_out_mul = 8; + inline bool has_bypass_out_mul() const; + inline void clear_bypass_out_mul(); + static const int kBypassOutMulFieldNumber = 8; + inline ::google::protobuf::uint32 bypass_out_mul() const; + inline void set_bypass_out_mul(::google::protobuf::uint32 value); + + // optional uint32 reserved0 = 9 [default = 0]; + inline bool has_reserved0() const; + inline void clear_reserved0(); + static const int kReserved0FieldNumber = 9; + inline ::google::protobuf::uint32 reserved0() const; + inline void set_reserved0(::google::protobuf::uint32 value); + + // @@protoc_insertion_point(class_scope:nvdla_prototest_interface.CDPOpDesc) + private: + inline void set_has_in_precision(); + inline void clear_has_in_precision(); + inline void set_has_out_precision(); + inline void clear_has_out_precision(); + inline void set_has_lut_index(); + inline void clear_has_lut_index(); + inline void set_has_in_cvt(); + inline void clear_has_in_cvt(); + inline void set_has_out_cvt(); + inline void clear_has_out_cvt(); + inline void set_has_local_size(); + inline void clear_has_local_size(); + inline void set_has_bypass_sqsum(); + inline void clear_has_bypass_sqsum(); + inline void set_has_bypass_out_mul(); + inline void clear_has_bypass_out_mul(); + inline void set_has_reserved0(); + inline void clear_has_reserved0(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + int in_precision_; + int out_precision_; + ::nvdla_prototest_interface::CVTParam* in_cvt_; + ::google::protobuf::int32 lut_index_; + ::google::protobuf::uint32 local_size_; + ::nvdla_prototest_interface::CVTParam* out_cvt_; + ::google::protobuf::uint32 bypass_sqsum_; + ::google::protobuf::uint32 bypass_out_mul_; + ::google::protobuf::uint32 reserved0_; + friend void protobuf_AddDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_AssignDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_ShutdownFile_DlaPrototestInterface_2eproto(); + + void InitAsDefaultInstance(); + static CDPOpDesc* default_instance_; +}; +// ------------------------------------------------------------------- + +class RUBIKSurfaceDesc : public ::google::protobuf::Message { + public: + RUBIKSurfaceDesc(); + virtual ~RUBIKSurfaceDesc(); + + RUBIKSurfaceDesc(const RUBIKSurfaceDesc& from); + + inline RUBIKSurfaceDesc& operator=(const RUBIKSurfaceDesc& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const RUBIKSurfaceDesc& default_instance(); + + void Swap(RUBIKSurfaceDesc* other); + + // implements Message ---------------------------------------------- + + RUBIKSurfaceDesc* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const RUBIKSurfaceDesc& from); + void MergeFrom(const RUBIKSurfaceDesc& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // required .nvdla_prototest_interface.DataCube src_data = 1; + inline bool has_src_data() const; + inline void clear_src_data(); + static const int kSrcDataFieldNumber = 1; + inline const ::nvdla_prototest_interface::DataCube& src_data() const; + inline ::nvdla_prototest_interface::DataCube* mutable_src_data(); + inline ::nvdla_prototest_interface::DataCube* release_src_data(); + inline void set_allocated_src_data(::nvdla_prototest_interface::DataCube* src_data); + + // required .nvdla_prototest_interface.DataCube dst_data = 2; + inline bool has_dst_data() const; + inline void clear_dst_data(); + static const int kDstDataFieldNumber = 2; + inline const ::nvdla_prototest_interface::DataCube& dst_data() const; + inline ::nvdla_prototest_interface::DataCube* mutable_dst_data(); + inline ::nvdla_prototest_interface::DataCube* release_dst_data(); + inline void set_allocated_dst_data(::nvdla_prototest_interface::DataCube* dst_data); + + // @@protoc_insertion_point(class_scope:nvdla_prototest_interface.RUBIKSurfaceDesc) + private: + inline void set_has_src_data(); + inline void clear_has_src_data(); + inline void set_has_dst_data(); + inline void clear_has_dst_data(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::nvdla_prototest_interface::DataCube* src_data_; + ::nvdla_prototest_interface::DataCube* dst_data_; + friend void protobuf_AddDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_AssignDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_ShutdownFile_DlaPrototestInterface_2eproto(); + + void InitAsDefaultInstance(); + static RUBIKSurfaceDesc* default_instance_; +}; +// ------------------------------------------------------------------- + +class RUBIKOpDesc : public ::google::protobuf::Message { + public: + RUBIKOpDesc(); + virtual ~RUBIKOpDesc(); + + RUBIKOpDesc(const RUBIKOpDesc& from); + + inline RUBIKOpDesc& operator=(const RUBIKOpDesc& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const RUBIKOpDesc& default_instance(); + + void Swap(RUBIKOpDesc* other); + + // implements Message ---------------------------------------------- + + RUBIKOpDesc* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const RUBIKOpDesc& from); + void MergeFrom(const RUBIKOpDesc& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // required .nvdla_prototest_interface.RUBIKMode mode = 1; + inline bool has_mode() const; + inline void clear_mode(); + static const int kModeFieldNumber = 1; + inline ::nvdla_prototest_interface::RUBIKMode mode() const; + inline void set_mode(::nvdla_prototest_interface::RUBIKMode value); + + // required .nvdla_prototest_interface.DataPrecision precision = 2; + inline bool has_precision() const; + inline void clear_precision(); + static const int kPrecisionFieldNumber = 2; + inline ::nvdla_prototest_interface::DataPrecision precision() const; + inline void set_precision(::nvdla_prototest_interface::DataPrecision value); + + // required uint32 stride_x = 3; + inline bool has_stride_x() const; + inline void clear_stride_x(); + static const int kStrideXFieldNumber = 3; + inline ::google::protobuf::uint32 stride_x() const; + inline void set_stride_x(::google::protobuf::uint32 value); + + // required uint32 stride_y = 4; + inline bool has_stride_y() const; + inline void clear_stride_y(); + static const int kStrideYFieldNumber = 4; + inline ::google::protobuf::uint32 stride_y() const; + inline void set_stride_y(::google::protobuf::uint32 value); + + // @@protoc_insertion_point(class_scope:nvdla_prototest_interface.RUBIKOpDesc) + private: + inline void set_has_mode(); + inline void clear_has_mode(); + inline void set_has_precision(); + inline void clear_has_precision(); + inline void set_has_stride_x(); + inline void clear_has_stride_x(); + inline void set_has_stride_y(); + inline void clear_has_stride_y(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + int mode_; + int precision_; + ::google::protobuf::uint32 stride_x_; + ::google::protobuf::uint32 stride_y_; + friend void protobuf_AddDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_AssignDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_ShutdownFile_DlaPrototestInterface_2eproto(); + + void InitAsDefaultInstance(); + static RUBIKOpDesc* default_instance_; +}; +// ------------------------------------------------------------------- + +class SurfaceContainer : public ::google::protobuf::Message { + public: + SurfaceContainer(); + virtual ~SurfaceContainer(); + + SurfaceContainer(const SurfaceContainer& from); + + inline SurfaceContainer& operator=(const SurfaceContainer& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const SurfaceContainer& default_instance(); + + enum SurfaceContainerOneofCase { + kBdmaSurface = 1, + kConvSurface = 2, + kSdpSurface = 3, + kPdpSurface = 4, + kCdpSurface = 5, + kRubikSurface = 6, + SURFACE_CONTAINER_ONEOF_NOT_SET = 0, + }; + + void Swap(SurfaceContainer* other); + + // implements Message ---------------------------------------------- + + SurfaceContainer* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const SurfaceContainer& from); + void MergeFrom(const SurfaceContainer& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional .nvdla_prototest_interface.BDMASurfaceDesc bdma_surface = 1; + inline bool has_bdma_surface() const; + inline void clear_bdma_surface(); + static const int kBdmaSurfaceFieldNumber = 1; + inline const ::nvdla_prototest_interface::BDMASurfaceDesc& bdma_surface() const; + inline ::nvdla_prototest_interface::BDMASurfaceDesc* mutable_bdma_surface(); + inline ::nvdla_prototest_interface::BDMASurfaceDesc* release_bdma_surface(); + inline void set_allocated_bdma_surface(::nvdla_prototest_interface::BDMASurfaceDesc* bdma_surface); + + // optional .nvdla_prototest_interface.CONVSurfaceDesc conv_surface = 2; + inline bool has_conv_surface() const; + inline void clear_conv_surface(); + static const int kConvSurfaceFieldNumber = 2; + inline const ::nvdla_prototest_interface::CONVSurfaceDesc& conv_surface() const; + inline ::nvdla_prototest_interface::CONVSurfaceDesc* mutable_conv_surface(); + inline ::nvdla_prototest_interface::CONVSurfaceDesc* release_conv_surface(); + inline void set_allocated_conv_surface(::nvdla_prototest_interface::CONVSurfaceDesc* conv_surface); + + // optional .nvdla_prototest_interface.SDPSurfaceDesc sdp_surface = 3; + inline bool has_sdp_surface() const; + inline void clear_sdp_surface(); + static const int kSdpSurfaceFieldNumber = 3; + inline const ::nvdla_prototest_interface::SDPSurfaceDesc& sdp_surface() const; + inline ::nvdla_prototest_interface::SDPSurfaceDesc* mutable_sdp_surface(); + inline ::nvdla_prototest_interface::SDPSurfaceDesc* release_sdp_surface(); + inline void set_allocated_sdp_surface(::nvdla_prototest_interface::SDPSurfaceDesc* sdp_surface); + + // optional .nvdla_prototest_interface.PDPSurfaceDesc pdp_surface = 4; + inline bool has_pdp_surface() const; + inline void clear_pdp_surface(); + static const int kPdpSurfaceFieldNumber = 4; + inline const ::nvdla_prototest_interface::PDPSurfaceDesc& pdp_surface() const; + inline ::nvdla_prototest_interface::PDPSurfaceDesc* mutable_pdp_surface(); + inline ::nvdla_prototest_interface::PDPSurfaceDesc* release_pdp_surface(); + inline void set_allocated_pdp_surface(::nvdla_prototest_interface::PDPSurfaceDesc* pdp_surface); + + // optional .nvdla_prototest_interface.CDPSurfaceDesc cdp_surface = 5; + inline bool has_cdp_surface() const; + inline void clear_cdp_surface(); + static const int kCdpSurfaceFieldNumber = 5; + inline const ::nvdla_prototest_interface::CDPSurfaceDesc& cdp_surface() const; + inline ::nvdla_prototest_interface::CDPSurfaceDesc* mutable_cdp_surface(); + inline ::nvdla_prototest_interface::CDPSurfaceDesc* release_cdp_surface(); + inline void set_allocated_cdp_surface(::nvdla_prototest_interface::CDPSurfaceDesc* cdp_surface); + + // optional .nvdla_prototest_interface.RUBIKSurfaceDesc rubik_surface = 6; + inline bool has_rubik_surface() const; + inline void clear_rubik_surface(); + static const int kRubikSurfaceFieldNumber = 6; + inline const ::nvdla_prototest_interface::RUBIKSurfaceDesc& rubik_surface() const; + inline ::nvdla_prototest_interface::RUBIKSurfaceDesc* mutable_rubik_surface(); + inline ::nvdla_prototest_interface::RUBIKSurfaceDesc* release_rubik_surface(); + inline void set_allocated_rubik_surface(::nvdla_prototest_interface::RUBIKSurfaceDesc* rubik_surface); + + inline SurfaceContainerOneofCase surface_container_oneof_case() const; + // @@protoc_insertion_point(class_scope:nvdla_prototest_interface.SurfaceContainer) + private: + inline void set_has_bdma_surface(); + inline void set_has_conv_surface(); + inline void set_has_sdp_surface(); + inline void set_has_pdp_surface(); + inline void set_has_cdp_surface(); + inline void set_has_rubik_surface(); + + inline bool has_surface_container_oneof(); + void clear_surface_container_oneof(); + inline void clear_has_surface_container_oneof(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + union SurfaceContainerOneofUnion { + ::nvdla_prototest_interface::BDMASurfaceDesc* bdma_surface_; + ::nvdla_prototest_interface::CONVSurfaceDesc* conv_surface_; + ::nvdla_prototest_interface::SDPSurfaceDesc* sdp_surface_; + ::nvdla_prototest_interface::PDPSurfaceDesc* pdp_surface_; + ::nvdla_prototest_interface::CDPSurfaceDesc* cdp_surface_; + ::nvdla_prototest_interface::RUBIKSurfaceDesc* rubik_surface_; + } surface_container_oneof_; + ::google::protobuf::uint32 _oneof_case_[1]; + + friend void protobuf_AddDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_AssignDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_ShutdownFile_DlaPrototestInterface_2eproto(); + + void InitAsDefaultInstance(); + static SurfaceContainer* default_instance_; +}; +// ------------------------------------------------------------------- + +class OperationContainer : public ::google::protobuf::Message { + public: + OperationContainer(); + virtual ~OperationContainer(); + + OperationContainer(const OperationContainer& from); + + inline OperationContainer& operator=(const OperationContainer& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const OperationContainer& default_instance(); + + enum OpContainerOneofCase { + kBdmaOp = 1, + kConvOp = 2, + kSdpOp = 3, + kPdpOp = 4, + kCdpOp = 5, + kRubikOp = 6, + OP_CONTAINER_ONEOF_NOT_SET = 0, + }; + + void Swap(OperationContainer* other); + + // implements Message ---------------------------------------------- + + OperationContainer* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const OperationContainer& from); + void MergeFrom(const OperationContainer& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional .nvdla_prototest_interface.BDMAOpDesc bdma_op = 1; + inline bool has_bdma_op() const; + inline void clear_bdma_op(); + static const int kBdmaOpFieldNumber = 1; + inline const ::nvdla_prototest_interface::BDMAOpDesc& bdma_op() const; + inline ::nvdla_prototest_interface::BDMAOpDesc* mutable_bdma_op(); + inline ::nvdla_prototest_interface::BDMAOpDesc* release_bdma_op(); + inline void set_allocated_bdma_op(::nvdla_prototest_interface::BDMAOpDesc* bdma_op); + + // optional .nvdla_prototest_interface.CONVOpDesc conv_op = 2; + inline bool has_conv_op() const; + inline void clear_conv_op(); + static const int kConvOpFieldNumber = 2; + inline const ::nvdla_prototest_interface::CONVOpDesc& conv_op() const; + inline ::nvdla_prototest_interface::CONVOpDesc* mutable_conv_op(); + inline ::nvdla_prototest_interface::CONVOpDesc* release_conv_op(); + inline void set_allocated_conv_op(::nvdla_prototest_interface::CONVOpDesc* conv_op); + + // optional .nvdla_prototest_interface.SDPOpDesc sdp_op = 3; + inline bool has_sdp_op() const; + inline void clear_sdp_op(); + static const int kSdpOpFieldNumber = 3; + inline const ::nvdla_prototest_interface::SDPOpDesc& sdp_op() const; + inline ::nvdla_prototest_interface::SDPOpDesc* mutable_sdp_op(); + inline ::nvdla_prototest_interface::SDPOpDesc* release_sdp_op(); + inline void set_allocated_sdp_op(::nvdla_prototest_interface::SDPOpDesc* sdp_op); + + // optional .nvdla_prototest_interface.PDPOpDesc pdp_op = 4; + inline bool has_pdp_op() const; + inline void clear_pdp_op(); + static const int kPdpOpFieldNumber = 4; + inline const ::nvdla_prototest_interface::PDPOpDesc& pdp_op() const; + inline ::nvdla_prototest_interface::PDPOpDesc* mutable_pdp_op(); + inline ::nvdla_prototest_interface::PDPOpDesc* release_pdp_op(); + inline void set_allocated_pdp_op(::nvdla_prototest_interface::PDPOpDesc* pdp_op); + + // optional .nvdla_prototest_interface.CDPOpDesc cdp_op = 5; + inline bool has_cdp_op() const; + inline void clear_cdp_op(); + static const int kCdpOpFieldNumber = 5; + inline const ::nvdla_prototest_interface::CDPOpDesc& cdp_op() const; + inline ::nvdla_prototest_interface::CDPOpDesc* mutable_cdp_op(); + inline ::nvdla_prototest_interface::CDPOpDesc* release_cdp_op(); + inline void set_allocated_cdp_op(::nvdla_prototest_interface::CDPOpDesc* cdp_op); + + // optional .nvdla_prototest_interface.RUBIKOpDesc rubik_op = 6; + inline bool has_rubik_op() const; + inline void clear_rubik_op(); + static const int kRubikOpFieldNumber = 6; + inline const ::nvdla_prototest_interface::RUBIKOpDesc& rubik_op() const; + inline ::nvdla_prototest_interface::RUBIKOpDesc* mutable_rubik_op(); + inline ::nvdla_prototest_interface::RUBIKOpDesc* release_rubik_op(); + inline void set_allocated_rubik_op(::nvdla_prototest_interface::RUBIKOpDesc* rubik_op); + + inline OpContainerOneofCase op_container_oneof_case() const; + // @@protoc_insertion_point(class_scope:nvdla_prototest_interface.OperationContainer) + private: + inline void set_has_bdma_op(); + inline void set_has_conv_op(); + inline void set_has_sdp_op(); + inline void set_has_pdp_op(); + inline void set_has_cdp_op(); + inline void set_has_rubik_op(); + + inline bool has_op_container_oneof(); + void clear_op_container_oneof(); + inline void clear_has_op_container_oneof(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + union OpContainerOneofUnion { + ::nvdla_prototest_interface::BDMAOpDesc* bdma_op_; + ::nvdla_prototest_interface::CONVOpDesc* conv_op_; + ::nvdla_prototest_interface::SDPOpDesc* sdp_op_; + ::nvdla_prototest_interface::PDPOpDesc* pdp_op_; + ::nvdla_prototest_interface::CDPOpDesc* cdp_op_; + ::nvdla_prototest_interface::RUBIKOpDesc* rubik_op_; + } op_container_oneof_; + ::google::protobuf::uint32 _oneof_case_[1]; + + friend void protobuf_AddDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_AssignDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_ShutdownFile_DlaPrototestInterface_2eproto(); + + void InitAsDefaultInstance(); + static OperationContainer* default_instance_; +}; +// ------------------------------------------------------------------- + +class Consumer : public ::google::protobuf::Message { + public: + Consumer(); + virtual ~Consumer(); + + Consumer(const Consumer& from); + + inline Consumer& operator=(const Consumer& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const Consumer& default_instance(); + + void Swap(Consumer* other); + + // implements Message ---------------------------------------------- + + Consumer* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const Consumer& from); + void MergeFrom(const Consumer& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + typedef Consumer_EventType EventType; + static const EventType OP_COMPLETED = Consumer_EventType_OP_COMPLETED; + static const EventType OP_PROGRAMMED = Consumer_EventType_OP_PROGRAMMED; + static const EventType OP_ENABLED = Consumer_EventType_OP_ENABLED; + static const EventType CDMA_WT_DONE = Consumer_EventType_CDMA_WT_DONE; + static const EventType CDMA_DT_DONE = Consumer_EventType_CDMA_DT_DONE; + static inline bool EventType_IsValid(int value) { + return Consumer_EventType_IsValid(value); + } + static const EventType EventType_MIN = + Consumer_EventType_EventType_MIN; + static const EventType EventType_MAX = + Consumer_EventType_EventType_MAX; + static const int EventType_ARRAYSIZE = + Consumer_EventType_EventType_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + EventType_descriptor() { + return Consumer_EventType_descriptor(); + } + static inline const ::std::string& EventType_Name(EventType value) { + return Consumer_EventType_Name(value); + } + static inline bool EventType_Parse(const ::std::string& name, + EventType* value) { + return Consumer_EventType_Parse(name, value); + } + + // accessors ------------------------------------------------------- + + // required int32 index = 1; + inline bool has_index() const; + inline void clear_index(); + static const int kIndexFieldNumber = 1; + inline ::google::protobuf::int32 index() const; + inline void set_index(::google::protobuf::int32 value); + + // required .nvdla_prototest_interface.LayerType type = 2; + inline bool has_type() const; + inline void clear_type(); + static const int kTypeFieldNumber = 2; + inline ::nvdla_prototest_interface::LayerType type() const; + inline void set_type(::nvdla_prototest_interface::LayerType value); + + // required .nvdla_prototest_interface.Consumer.EventType event = 3; + inline bool has_event() const; + inline void clear_event(); + static const int kEventFieldNumber = 3; + inline ::nvdla_prototest_interface::Consumer_EventType event() const; + inline void set_event(::nvdla_prototest_interface::Consumer_EventType value); + + // @@protoc_insertion_point(class_scope:nvdla_prototest_interface.Consumer) + private: + inline void set_has_index(); + inline void clear_has_index(); + inline void set_has_type(); + inline void clear_has_type(); + inline void set_has_event(); + inline void clear_has_event(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::int32 index_; + int type_; + int event_; + friend void protobuf_AddDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_AssignDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_ShutdownFile_DlaPrototestInterface_2eproto(); + + void InitAsDefaultInstance(); + static Consumer* default_instance_; +}; +// ------------------------------------------------------------------- + +class Layer : public ::google::protobuf::Message { + public: + Layer(); + virtual ~Layer(); + + Layer(const Layer& from); + + inline Layer& operator=(const Layer& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const Layer& default_instance(); + + void Swap(Layer* other); + + // implements Message ---------------------------------------------- + + Layer* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const Layer& from); + void MergeFrom(const Layer& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // required int32 index = 1; + inline bool has_index() const; + inline void clear_index(); + static const int kIndexFieldNumber = 1; + inline ::google::protobuf::int32 index() const; + inline void set_index(::google::protobuf::int32 value); + + // required int32 roi_index = 2; + inline bool has_roi_index() const; + inline void clear_roi_index(); + static const int kRoiIndexFieldNumber = 2; + inline ::google::protobuf::int32 roi_index() const; + inline void set_roi_index(::google::protobuf::int32 value); + + // required .nvdla_prototest_interface.LayerType type = 3; + inline bool has_type() const; + inline void clear_type(); + static const int kTypeFieldNumber = 3; + inline ::nvdla_prototest_interface::LayerType type() const; + inline void set_type(::nvdla_prototest_interface::LayerType value); + + // required uint32 dependency_count = 4; + inline bool has_dependency_count() const; + inline void clear_dependency_count(); + static const int kDependencyCountFieldNumber = 4; + inline ::google::protobuf::uint32 dependency_count() const; + inline void set_dependency_count(::google::protobuf::uint32 value); + + // repeated uint32 reserved = 5 [packed = true]; + inline int reserved_size() const; + inline void clear_reserved(); + static const int kReservedFieldNumber = 5; + inline ::google::protobuf::uint32 reserved(int index) const; + inline void set_reserved(int index, ::google::protobuf::uint32 value); + inline void add_reserved(::google::protobuf::uint32 value); + inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& + reserved() const; + inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* + mutable_reserved(); + + // repeated .nvdla_prototest_interface.Consumer bottom = 6; + inline int bottom_size() const; + inline void clear_bottom(); + static const int kBottomFieldNumber = 6; + inline const ::nvdla_prototest_interface::Consumer& bottom(int index) const; + inline ::nvdla_prototest_interface::Consumer* mutable_bottom(int index); + inline ::nvdla_prototest_interface::Consumer* add_bottom(); + inline const ::google::protobuf::RepeatedPtrField< ::nvdla_prototest_interface::Consumer >& + bottom() const; + inline ::google::protobuf::RepeatedPtrField< ::nvdla_prototest_interface::Consumer >* + mutable_bottom(); + + // optional .nvdla_prototest_interface.Consumer fused = 7; + inline bool has_fused() const; + inline void clear_fused(); + static const int kFusedFieldNumber = 7; + inline const ::nvdla_prototest_interface::Consumer& fused() const; + inline ::nvdla_prototest_interface::Consumer* mutable_fused(); + inline ::nvdla_prototest_interface::Consumer* release_fused(); + inline void set_allocated_fused(::nvdla_prototest_interface::Consumer* fused); + + // required .nvdla_prototest_interface.OperationContainer op_config = 8; + inline bool has_op_config() const; + inline void clear_op_config(); + static const int kOpConfigFieldNumber = 8; + inline const ::nvdla_prototest_interface::OperationContainer& op_config() const; + inline ::nvdla_prototest_interface::OperationContainer* mutable_op_config(); + inline ::nvdla_prototest_interface::OperationContainer* release_op_config(); + inline void set_allocated_op_config(::nvdla_prototest_interface::OperationContainer* op_config); + + // required .nvdla_prototest_interface.SurfaceContainer surface = 9; + inline bool has_surface() const; + inline void clear_surface(); + static const int kSurfaceFieldNumber = 9; + inline const ::nvdla_prototest_interface::SurfaceContainer& surface() const; + inline ::nvdla_prototest_interface::SurfaceContainer* mutable_surface(); + inline ::nvdla_prototest_interface::SurfaceContainer* release_surface(); + inline void set_allocated_surface(::nvdla_prototest_interface::SurfaceContainer* surface); + + // @@protoc_insertion_point(class_scope:nvdla_prototest_interface.Layer) + private: + inline void set_has_index(); + inline void clear_has_index(); + inline void set_has_roi_index(); + inline void clear_has_roi_index(); + inline void set_has_type(); + inline void clear_has_type(); + inline void set_has_dependency_count(); + inline void clear_has_dependency_count(); + inline void set_has_fused(); + inline void clear_has_fused(); + inline void set_has_op_config(); + inline void clear_has_op_config(); + inline void set_has_surface(); + inline void clear_has_surface(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::int32 index_; + ::google::protobuf::int32 roi_index_; + int type_; + ::google::protobuf::uint32 dependency_count_; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > reserved_; + mutable int _reserved_cached_byte_size_; + ::google::protobuf::RepeatedPtrField< ::nvdla_prototest_interface::Consumer > bottom_; + ::nvdla_prototest_interface::Consumer* fused_; + ::nvdla_prototest_interface::OperationContainer* op_config_; + ::nvdla_prototest_interface::SurfaceContainer* surface_; + friend void protobuf_AddDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_AssignDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_ShutdownFile_DlaPrototestInterface_2eproto(); + + void InitAsDefaultInstance(); + static Layer* default_instance_; +}; +// ------------------------------------------------------------------- + +class NetworkLayer : public ::google::protobuf::Message { + public: + NetworkLayer(); + virtual ~NetworkLayer(); + + NetworkLayer(const NetworkLayer& from); + + inline NetworkLayer& operator=(const NetworkLayer& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const NetworkLayer& default_instance(); + + void Swap(NetworkLayer* other); + + // implements Message ---------------------------------------------- + + NetworkLayer* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const NetworkLayer& from); + void MergeFrom(const NetworkLayer& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .nvdla_prototest_interface.Layer layer = 1; + inline int layer_size() const; + inline void clear_layer(); + static const int kLayerFieldNumber = 1; + inline const ::nvdla_prototest_interface::Layer& layer(int index) const; + inline ::nvdla_prototest_interface::Layer* mutable_layer(int index); + inline ::nvdla_prototest_interface::Layer* add_layer(); + inline const ::google::protobuf::RepeatedPtrField< ::nvdla_prototest_interface::Layer >& + layer() const; + inline ::google::protobuf::RepeatedPtrField< ::nvdla_prototest_interface::Layer >* + mutable_layer(); + + // @@protoc_insertion_point(class_scope:nvdla_prototest_interface.NetworkLayer) + private: + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::RepeatedPtrField< ::nvdla_prototest_interface::Layer > layer_; + friend void protobuf_AddDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_AssignDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_ShutdownFile_DlaPrototestInterface_2eproto(); + + void InitAsDefaultInstance(); + static NetworkLayer* default_instance_; +}; +// ------------------------------------------------------------------- + +class NetworkDesc : public ::google::protobuf::Message { + public: + NetworkDesc(); + virtual ~NetworkDesc(); + + NetworkDesc(const NetworkDesc& from); + + inline NetworkDesc& operator=(const NetworkDesc& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const NetworkDesc& default_instance(); + + void Swap(NetworkDesc* other); + + // implements Message ---------------------------------------------- + + NetworkDesc* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const NetworkDesc& from); + void MergeFrom(const NetworkDesc& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // required int32 operation_desc_index = 1; + inline bool has_operation_desc_index() const; + inline void clear_operation_desc_index(); + static const int kOperationDescIndexFieldNumber = 1; + inline ::google::protobuf::int32 operation_desc_index() const; + inline void set_operation_desc_index(::google::protobuf::int32 value); + + // required int32 surface_desc_index = 2; + inline bool has_surface_desc_index() const; + inline void clear_surface_desc_index(); + static const int kSurfaceDescIndexFieldNumber = 2; + inline ::google::protobuf::int32 surface_desc_index() const; + inline void set_surface_desc_index(::google::protobuf::int32 value); + + // required int32 dependency_graph_index = 3; + inline bool has_dependency_graph_index() const; + inline void clear_dependency_graph_index(); + static const int kDependencyGraphIndexFieldNumber = 3; + inline ::google::protobuf::int32 dependency_graph_index() const; + inline void set_dependency_graph_index(::google::protobuf::int32 value); + + // required int32 lut_data_index = 4; + inline bool has_lut_data_index() const; + inline void clear_lut_data_index(); + static const int kLutDataIndexFieldNumber = 4; + inline ::google::protobuf::int32 lut_data_index() const; + inline void set_lut_data_index(::google::protobuf::int32 value); + + // required int32 roi_array_index = 5; + inline bool has_roi_array_index() const; + inline void clear_roi_array_index(); + static const int kRoiArrayIndexFieldNumber = 5; + inline ::google::protobuf::int32 roi_array_index() const; + inline void set_roi_array_index(::google::protobuf::int32 value); + + // required int32 surface_index = 6; + inline bool has_surface_index() const; + inline void clear_surface_index(); + static const int kSurfaceIndexFieldNumber = 6; + inline ::google::protobuf::int32 surface_index() const; + inline void set_surface_index(::google::protobuf::int32 value); + + // optional int32 stat_list_index = 7 [default = -1]; + inline bool has_stat_list_index() const; + inline void clear_stat_list_index(); + static const int kStatListIndexFieldNumber = 7; + inline ::google::protobuf::int32 stat_list_index() const; + inline void set_stat_list_index(::google::protobuf::int32 value); + + // optional int32 reserved1 = 8 [default = -1]; + inline bool has_reserved1() const; + inline void clear_reserved1(); + static const int kReserved1FieldNumber = 8; + inline ::google::protobuf::int32 reserved1() const; + inline void set_reserved1(::google::protobuf::int32 value); + + // repeated int32 op_head = 9 [packed = true]; + inline int op_head_size() const; + inline void clear_op_head(); + static const int kOpHeadFieldNumber = 9; + inline ::google::protobuf::int32 op_head(int index) const; + inline void set_op_head(int index, ::google::protobuf::int32 value); + inline void add_op_head(::google::protobuf::int32 value); + inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& + op_head() const; + inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* + mutable_op_head(); + + // required uint32 num_rois = 10; + inline bool has_num_rois() const; + inline void clear_num_rois(); + static const int kNumRoisFieldNumber = 10; + inline ::google::protobuf::uint32 num_rois() const; + inline void set_num_rois(::google::protobuf::uint32 value); + + // required uint32 num_operations = 11; + inline bool has_num_operations() const; + inline void clear_num_operations(); + static const int kNumOperationsFieldNumber = 11; + inline ::google::protobuf::uint32 num_operations() const; + inline void set_num_operations(::google::protobuf::uint32 value); + + // required uint32 num_luts = 12; + inline bool has_num_luts() const; + inline void clear_num_luts(); + static const int kNumLutsFieldNumber = 12; + inline ::google::protobuf::uint32 num_luts() const; + inline void set_num_luts(::google::protobuf::uint32 value); + + // required uint32 num_addresses = 13; + inline bool has_num_addresses() const; + inline void clear_num_addresses(); + static const int kNumAddressesFieldNumber = 13; + inline ::google::protobuf::uint32 num_addresses() const; + inline void set_num_addresses(::google::protobuf::uint32 value); + + // required int32 input_layer = 14; + inline bool has_input_layer() const; + inline void clear_input_layer(); + static const int kInputLayerFieldNumber = 14; + inline ::google::protobuf::int32 input_layer() const; + inline void set_input_layer(::google::protobuf::int32 value); + + // required uint32 dynamic_roi = 15; + inline bool has_dynamic_roi() const; + inline void clear_dynamic_roi(); + static const int kDynamicRoiFieldNumber = 15; + inline ::google::protobuf::uint32 dynamic_roi() const; + inline void set_dynamic_roi(::google::protobuf::uint32 value); + + // optional uint32 reserved0 = 16 [default = 0]; + inline bool has_reserved0() const; + inline void clear_reserved0(); + static const int kReserved0FieldNumber = 16; + inline ::google::protobuf::uint32 reserved0() const; + inline void set_reserved0(::google::protobuf::uint32 value); + + // @@protoc_insertion_point(class_scope:nvdla_prototest_interface.NetworkDesc) + private: + inline void set_has_operation_desc_index(); + inline void clear_has_operation_desc_index(); + inline void set_has_surface_desc_index(); + inline void clear_has_surface_desc_index(); + inline void set_has_dependency_graph_index(); + inline void clear_has_dependency_graph_index(); + inline void set_has_lut_data_index(); + inline void clear_has_lut_data_index(); + inline void set_has_roi_array_index(); + inline void clear_has_roi_array_index(); + inline void set_has_surface_index(); + inline void clear_has_surface_index(); + inline void set_has_stat_list_index(); + inline void clear_has_stat_list_index(); + inline void set_has_reserved1(); + inline void clear_has_reserved1(); + inline void set_has_num_rois(); + inline void clear_has_num_rois(); + inline void set_has_num_operations(); + inline void clear_has_num_operations(); + inline void set_has_num_luts(); + inline void clear_has_num_luts(); + inline void set_has_num_addresses(); + inline void clear_has_num_addresses(); + inline void set_has_input_layer(); + inline void clear_has_input_layer(); + inline void set_has_dynamic_roi(); + inline void clear_has_dynamic_roi(); + inline void set_has_reserved0(); + inline void clear_has_reserved0(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::int32 operation_desc_index_; + ::google::protobuf::int32 surface_desc_index_; + ::google::protobuf::int32 dependency_graph_index_; + ::google::protobuf::int32 lut_data_index_; + ::google::protobuf::int32 roi_array_index_; + ::google::protobuf::int32 surface_index_; + ::google::protobuf::int32 stat_list_index_; + ::google::protobuf::int32 reserved1_; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 > op_head_; + mutable int _op_head_cached_byte_size_; + ::google::protobuf::uint32 num_rois_; + ::google::protobuf::uint32 num_operations_; + ::google::protobuf::uint32 num_luts_; + ::google::protobuf::uint32 num_addresses_; + ::google::protobuf::int32 input_layer_; + ::google::protobuf::uint32 dynamic_roi_; + ::google::protobuf::uint32 reserved0_; + friend void protobuf_AddDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_AssignDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_ShutdownFile_DlaPrototestInterface_2eproto(); + + void InitAsDefaultInstance(); + static NetworkDesc* default_instance_; +}; +// ------------------------------------------------------------------- + +class LUTParamList : public ::google::protobuf::Message { + public: + LUTParamList(); + virtual ~LUTParamList(); + + LUTParamList(const LUTParamList& from); + + inline LUTParamList& operator=(const LUTParamList& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const LUTParamList& default_instance(); + + void Swap(LUTParamList* other); + + // implements Message ---------------------------------------------- + + LUTParamList* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const LUTParamList& from); + void MergeFrom(const LUTParamList& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .nvdla_prototest_interface.LUTParam lut_param = 1; + inline int lut_param_size() const; + inline void clear_lut_param(); + static const int kLutParamFieldNumber = 1; + inline const ::nvdla_prototest_interface::LUTParam& lut_param(int index) const; + inline ::nvdla_prototest_interface::LUTParam* mutable_lut_param(int index); + inline ::nvdla_prototest_interface::LUTParam* add_lut_param(); + inline const ::google::protobuf::RepeatedPtrField< ::nvdla_prototest_interface::LUTParam >& + lut_param() const; + inline ::google::protobuf::RepeatedPtrField< ::nvdla_prototest_interface::LUTParam >* + mutable_lut_param(); + + // @@protoc_insertion_point(class_scope:nvdla_prototest_interface.LUTParamList) + private: + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::RepeatedPtrField< ::nvdla_prototest_interface::LUTParam > lut_param_; + friend void protobuf_AddDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_AssignDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_ShutdownFile_DlaPrototestInterface_2eproto(); + + void InitAsDefaultInstance(); + static LUTParamList* default_instance_; +}; +// ------------------------------------------------------------------- + +class ROIArrayDesc : public ::google::protobuf::Message { + public: + ROIArrayDesc(); + virtual ~ROIArrayDesc(); + + ROIArrayDesc(const ROIArrayDesc& from); + + inline ROIArrayDesc& operator=(const ROIArrayDesc& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const ROIArrayDesc& default_instance(); + + void Swap(ROIArrayDesc* other); + + // implements Message ---------------------------------------------- + + ROIArrayDesc* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const ROIArrayDesc& from); + void MergeFrom(const ROIArrayDesc& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // required uint32 array_length = 1; + inline bool has_array_length() const; + inline void clear_array_length(); + static const int kArrayLengthFieldNumber = 1; + inline ::google::protobuf::uint32 array_length() const; + inline void set_array_length(::google::protobuf::uint32 value); + + // required uint32 array_reserved = 2; + inline bool has_array_reserved() const; + inline void clear_array_reserved(); + static const int kArrayReservedFieldNumber = 2; + inline ::google::protobuf::uint32 array_reserved() const; + inline void set_array_reserved(::google::protobuf::uint32 value); + + // @@protoc_insertion_point(class_scope:nvdla_prototest_interface.ROIArrayDesc) + private: + inline void set_has_array_length(); + inline void clear_has_array_length(); + inline void set_has_array_reserved(); + inline void clear_has_array_reserved(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::uint32 array_length_; + ::google::protobuf::uint32 array_reserved_; + friend void protobuf_AddDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_AssignDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_ShutdownFile_DlaPrototestInterface_2eproto(); + + void InitAsDefaultInstance(); + static ROIArrayDesc* default_instance_; +}; +// ------------------------------------------------------------------- + +class ROIDesc : public ::google::protobuf::Message { + public: + ROIDesc(); + virtual ~ROIDesc(); + + ROIDesc(const ROIDesc& from); + + inline ROIDesc& operator=(const ROIDesc& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const ROIDesc& default_instance(); + + void Swap(ROIDesc* other); + + // implements Message ---------------------------------------------- + + ROIDesc* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const ROIDesc& from); + void MergeFrom(const ROIDesc& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // required uint32 left = 1; + inline bool has_left() const; + inline void clear_left(); + static const int kLeftFieldNumber = 1; + inline ::google::protobuf::uint32 left() const; + inline void set_left(::google::protobuf::uint32 value); + + // required uint32 top = 2; + inline bool has_top() const; + inline void clear_top(); + static const int kTopFieldNumber = 2; + inline ::google::protobuf::uint32 top() const; + inline void set_top(::google::protobuf::uint32 value); + + // required uint32 right = 3; + inline bool has_right() const; + inline void clear_right(); + static const int kRightFieldNumber = 3; + inline ::google::protobuf::uint32 right() const; + inline void set_right(::google::protobuf::uint32 value); + + // required uint32 bottom = 4; + inline bool has_bottom() const; + inline void clear_bottom(); + static const int kBottomFieldNumber = 4; + inline ::google::protobuf::uint32 bottom() const; + inline void set_bottom(::google::protobuf::uint32 value); + + // @@protoc_insertion_point(class_scope:nvdla_prototest_interface.ROIDesc) + private: + inline void set_has_left(); + inline void clear_has_left(); + inline void set_has_top(); + inline void clear_has_top(); + inline void set_has_right(); + inline void clear_has_right(); + inline void set_has_bottom(); + inline void clear_has_bottom(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::uint32 left_; + ::google::protobuf::uint32 top_; + ::google::protobuf::uint32 right_; + ::google::protobuf::uint32 bottom_; + friend void protobuf_AddDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_AssignDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_ShutdownFile_DlaPrototestInterface_2eproto(); + + void InitAsDefaultInstance(); + static ROIDesc* default_instance_; +}; +// ------------------------------------------------------------------- + +class ROIDescription : public ::google::protobuf::Message { + public: + ROIDescription(); + virtual ~ROIDescription(); + + ROIDescription(const ROIDescription& from); + + inline ROIDescription& operator=(const ROIDescription& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const ROIDescription& default_instance(); + + void Swap(ROIDescription* other); + + // implements Message ---------------------------------------------- + + ROIDescription* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const ROIDescription& from); + void MergeFrom(const ROIDescription& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // required .nvdla_prototest_interface.ROIArrayDesc roi_arr = 1; + inline bool has_roi_arr() const; + inline void clear_roi_arr(); + static const int kRoiArrFieldNumber = 1; + inline const ::nvdla_prototest_interface::ROIArrayDesc& roi_arr() const; + inline ::nvdla_prototest_interface::ROIArrayDesc* mutable_roi_arr(); + inline ::nvdla_prototest_interface::ROIArrayDesc* release_roi_arr(); + inline void set_allocated_roi_arr(::nvdla_prototest_interface::ROIArrayDesc* roi_arr); + + // repeated .nvdla_prototest_interface.ROIDesc roi_desc = 2; + inline int roi_desc_size() const; + inline void clear_roi_desc(); + static const int kRoiDescFieldNumber = 2; + inline const ::nvdla_prototest_interface::ROIDesc& roi_desc(int index) const; + inline ::nvdla_prototest_interface::ROIDesc* mutable_roi_desc(int index); + inline ::nvdla_prototest_interface::ROIDesc* add_roi_desc(); + inline const ::google::protobuf::RepeatedPtrField< ::nvdla_prototest_interface::ROIDesc >& + roi_desc() const; + inline ::google::protobuf::RepeatedPtrField< ::nvdla_prototest_interface::ROIDesc >* + mutable_roi_desc(); + + // @@protoc_insertion_point(class_scope:nvdla_prototest_interface.ROIDescription) + private: + inline void set_has_roi_arr(); + inline void clear_has_roi_arr(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::nvdla_prototest_interface::ROIArrayDesc* roi_arr_; + ::google::protobuf::RepeatedPtrField< ::nvdla_prototest_interface::ROIDesc > roi_desc_; + friend void protobuf_AddDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_AssignDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_ShutdownFile_DlaPrototestInterface_2eproto(); + + void InitAsDefaultInstance(); + static ROIDescription* default_instance_; +}; +// ------------------------------------------------------------------- + +class Network : public ::google::protobuf::Message { + public: + Network(); + virtual ~Network(); + + Network(const Network& from); + + inline Network& operator=(const Network& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const Network& default_instance(); + + void Swap(Network* other); + + // implements Message ---------------------------------------------- + + Network* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const Network& from); + void MergeFrom(const Network& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // required .nvdla_prototest_interface.NetworkDesc param = 1; + inline bool has_param() const; + inline void clear_param(); + static const int kParamFieldNumber = 1; + inline const ::nvdla_prototest_interface::NetworkDesc& param() const; + inline ::nvdla_prototest_interface::NetworkDesc* mutable_param(); + inline ::nvdla_prototest_interface::NetworkDesc* release_param(); + inline void set_allocated_param(::nvdla_prototest_interface::NetworkDesc* param); + + // required .nvdla_prototest_interface.NetworkLayer layers = 2; + inline bool has_layers() const; + inline void clear_layers(); + static const int kLayersFieldNumber = 2; + inline const ::nvdla_prototest_interface::NetworkLayer& layers() const; + inline ::nvdla_prototest_interface::NetworkLayer* mutable_layers(); + inline ::nvdla_prototest_interface::NetworkLayer* release_layers(); + inline void set_allocated_layers(::nvdla_prototest_interface::NetworkLayer* layers); + + // required .nvdla_prototest_interface.LUTParamList lut_list = 3; + inline bool has_lut_list() const; + inline void clear_lut_list(); + static const int kLutListFieldNumber = 3; + inline const ::nvdla_prototest_interface::LUTParamList& lut_list() const; + inline ::nvdla_prototest_interface::LUTParamList* mutable_lut_list(); + inline ::nvdla_prototest_interface::LUTParamList* release_lut_list(); + inline void set_allocated_lut_list(::nvdla_prototest_interface::LUTParamList* lut_list); + + // required .nvdla_prototest_interface.ROIDescription roi_list = 4; + inline bool has_roi_list() const; + inline void clear_roi_list(); + static const int kRoiListFieldNumber = 4; + inline const ::nvdla_prototest_interface::ROIDescription& roi_list() const; + inline ::nvdla_prototest_interface::ROIDescription* mutable_roi_list(); + inline ::nvdla_prototest_interface::ROIDescription* release_roi_list(); + inline void set_allocated_roi_list(::nvdla_prototest_interface::ROIDescription* roi_list); + + // @@protoc_insertion_point(class_scope:nvdla_prototest_interface.Network) + private: + inline void set_has_param(); + inline void clear_has_param(); + inline void set_has_layers(); + inline void clear_has_layers(); + inline void set_has_lut_list(); + inline void clear_has_lut_list(); + inline void set_has_roi_list(); + inline void clear_has_roi_list(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::nvdla_prototest_interface::NetworkDesc* param_; + ::nvdla_prototest_interface::NetworkLayer* layers_; + ::nvdla_prototest_interface::LUTParamList* lut_list_; + ::nvdla_prototest_interface::ROIDescription* roi_list_; + friend void protobuf_AddDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_AssignDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_ShutdownFile_DlaPrototestInterface_2eproto(); + + void InitAsDefaultInstance(); + static Network* default_instance_; +}; +// ------------------------------------------------------------------- + +class TaskStatus : public ::google::protobuf::Message { + public: + TaskStatus(); + virtual ~TaskStatus(); + + TaskStatus(const TaskStatus& from); + + inline TaskStatus& operator=(const TaskStatus& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const TaskStatus& default_instance(); + + void Swap(TaskStatus* other); + + // implements Message ---------------------------------------------- + + TaskStatus* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const TaskStatus& from); + void MergeFrom(const TaskStatus& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // required uint64 timestamp = 1; + inline bool has_timestamp() const; + inline void clear_timestamp(); + static const int kTimestampFieldNumber = 1; + inline ::google::protobuf::uint64 timestamp() const; + inline void set_timestamp(::google::protobuf::uint64 value); + + // required uint32 status_engine = 2; + inline bool has_status_engine() const; + inline void clear_status_engine(); + static const int kStatusEngineFieldNumber = 2; + inline ::google::protobuf::uint32 status_engine() const; + inline void set_status_engine(::google::protobuf::uint32 value); + + // required uint32 subframe = 3; + inline bool has_subframe() const; + inline void clear_subframe(); + static const int kSubframeFieldNumber = 3; + inline ::google::protobuf::uint32 subframe() const; + inline void set_subframe(::google::protobuf::uint32 value); + + // required uint32 status_task = 4; + inline bool has_status_task() const; + inline void clear_status_task(); + static const int kStatusTaskFieldNumber = 4; + inline ::google::protobuf::uint32 status_task() const; + inline void set_status_task(::google::protobuf::uint32 value); + + // @@protoc_insertion_point(class_scope:nvdla_prototest_interface.TaskStatus) + private: + inline void set_has_timestamp(); + inline void clear_has_timestamp(); + inline void set_has_status_engine(); + inline void clear_has_status_engine(); + inline void set_has_subframe(); + inline void clear_has_subframe(); + inline void set_has_status_task(); + inline void clear_has_status_task(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::uint64 timestamp_; + ::google::protobuf::uint32 status_engine_; + ::google::protobuf::uint32 subframe_; + ::google::protobuf::uint32 status_task_; + friend void protobuf_AddDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_AssignDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_ShutdownFile_DlaPrototestInterface_2eproto(); + + void InitAsDefaultInstance(); + static TaskStatus* default_instance_; +}; +// ------------------------------------------------------------------- + +class Action : public ::google::protobuf::Message { + public: + Action(); + virtual ~Action(); + + Action(const Action& from); + + inline Action& operator=(const Action& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const Action& default_instance(); + + void Swap(Action* other); + + // implements Message ---------------------------------------------- + + Action* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const Action& from); + void MergeFrom(const Action& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated uint32 event_id = 1 [packed = true]; + inline int event_id_size() const; + inline void clear_event_id(); + static const int kEventIdFieldNumber = 1; + inline ::google::protobuf::uint32 event_id(int index) const; + inline void set_event_id(int index, ::google::protobuf::uint32 value); + inline void add_event_id(::google::protobuf::uint32 value); + inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& + event_id() const; + inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* + mutable_event_id(); + + // @@protoc_insertion_point(class_scope:nvdla_prototest_interface.Action) + private: + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > event_id_; + mutable int _event_id_cached_byte_size_; + friend void protobuf_AddDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_AssignDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_ShutdownFile_DlaPrototestInterface_2eproto(); + + void InitAsDefaultInstance(); + static Action* default_instance_; +}; +// ------------------------------------------------------------------- + +class TaskSchedule : public ::google::protobuf::Message { + public: + TaskSchedule(); + virtual ~TaskSchedule(); + + TaskSchedule(const TaskSchedule& from); + + inline TaskSchedule& operator=(const TaskSchedule& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const TaskSchedule& default_instance(); + + void Swap(TaskSchedule* other); + + // implements Message ---------------------------------------------- + + TaskSchedule* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const TaskSchedule& from); + void MergeFrom(const TaskSchedule& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional .nvdla_prototest_interface.Action pre_actions = 1; + inline bool has_pre_actions() const; + inline void clear_pre_actions(); + static const int kPreActionsFieldNumber = 1; + inline const ::nvdla_prototest_interface::Action& pre_actions() const; + inline ::nvdla_prototest_interface::Action* mutable_pre_actions(); + inline ::nvdla_prototest_interface::Action* release_pre_actions(); + inline void set_allocated_pre_actions(::nvdla_prototest_interface::Action* pre_actions); + + // optional .nvdla_prototest_interface.Action post_actions = 2; + inline bool has_post_actions() const; + inline void clear_post_actions(); + static const int kPostActionsFieldNumber = 2; + inline const ::nvdla_prototest_interface::Action& post_actions() const; + inline ::nvdla_prototest_interface::Action* mutable_post_actions(); + inline ::nvdla_prototest_interface::Action* release_post_actions(); + inline void set_allocated_post_actions(::nvdla_prototest_interface::Action* post_actions); + + // @@protoc_insertion_point(class_scope:nvdla_prototest_interface.TaskSchedule) + private: + inline void set_has_pre_actions(); + inline void clear_has_pre_actions(); + inline void set_has_post_actions(); + inline void clear_has_post_actions(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::nvdla_prototest_interface::Action* pre_actions_; + ::nvdla_prototest_interface::Action* post_actions_; + friend void protobuf_AddDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_AssignDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_ShutdownFile_DlaPrototestInterface_2eproto(); + + void InitAsDefaultInstance(); + static TaskSchedule* default_instance_; +}; +// ------------------------------------------------------------------- + +class TasksData : public ::google::protobuf::Message { + public: + TasksData(); + virtual ~TasksData(); + + TasksData(const TasksData& from); + + inline TasksData& operator=(const TasksData& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const TasksData& default_instance(); + + void Swap(TasksData* other); + + // implements Message ---------------------------------------------- + + TasksData* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const TasksData& from); + void MergeFrom(const TasksData& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional uint32 task_id = 1; + inline bool has_task_id() const; + inline void clear_task_id(); + static const int kTaskIdFieldNumber = 1; + inline ::google::protobuf::uint32 task_id() const; + inline void set_task_id(::google::protobuf::uint32 value); + + // required .nvdla_prototest_interface.EngineID engine_id = 2; + inline bool has_engine_id() const; + inline void clear_engine_id(); + static const int kEngineIdFieldNumber = 2; + inline ::nvdla_prototest_interface::EngineID engine_id() const; + inline void set_engine_id(::nvdla_prototest_interface::EngineID value); + + // required .nvdla_prototest_interface.Network network = 3; + inline bool has_network() const; + inline void clear_network(); + static const int kNetworkFieldNumber = 3; + inline const ::nvdla_prototest_interface::Network& network() const; + inline ::nvdla_prototest_interface::Network* mutable_network(); + inline ::nvdla_prototest_interface::Network* release_network(); + inline void set_allocated_network(::nvdla_prototest_interface::Network* network); + + // optional .nvdla_prototest_interface.TaskSchedule schedule = 4; + inline bool has_schedule() const; + inline void clear_schedule(); + static const int kScheduleFieldNumber = 4; + inline const ::nvdla_prototest_interface::TaskSchedule& schedule() const; + inline ::nvdla_prototest_interface::TaskSchedule* mutable_schedule(); + inline ::nvdla_prototest_interface::TaskSchedule* release_schedule(); + inline void set_allocated_schedule(::nvdla_prototest_interface::TaskSchedule* schedule); + + // optional .nvdla_prototest_interface.TaskStatus task_status = 5; + inline bool has_task_status() const; + inline void clear_task_status(); + static const int kTaskStatusFieldNumber = 5; + inline const ::nvdla_prototest_interface::TaskStatus& task_status() const; + inline ::nvdla_prototest_interface::TaskStatus* mutable_task_status(); + inline ::nvdla_prototest_interface::TaskStatus* release_task_status(); + inline void set_allocated_task_status(::nvdla_prototest_interface::TaskStatus* task_status); + + // optional uint32 task_timeout = 6 [default = 4294967295]; + inline bool has_task_timeout() const; + inline void clear_task_timeout(); + static const int kTaskTimeoutFieldNumber = 6; + inline ::google::protobuf::uint32 task_timeout() const; + inline void set_task_timeout(::google::protobuf::uint32 value); + + // optional int32 task_result = 7 [default = 0]; + inline bool has_task_result() const; + inline void clear_task_result(); + static const int kTaskResultFieldNumber = 7; + inline ::google::protobuf::int32 task_result() const; + inline void set_task_result(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:nvdla_prototest_interface.TasksData) + private: + inline void set_has_task_id(); + inline void clear_has_task_id(); + inline void set_has_engine_id(); + inline void clear_has_engine_id(); + inline void set_has_network(); + inline void clear_has_network(); + inline void set_has_schedule(); + inline void clear_has_schedule(); + inline void set_has_task_status(); + inline void clear_has_task_status(); + inline void set_has_task_timeout(); + inline void clear_has_task_timeout(); + inline void set_has_task_result(); + inline void clear_has_task_result(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::uint32 task_id_; + int engine_id_; + ::nvdla_prototest_interface::Network* network_; + ::nvdla_prototest_interface::TaskSchedule* schedule_; + ::nvdla_prototest_interface::TaskStatus* task_status_; + ::google::protobuf::uint32 task_timeout_; + ::google::protobuf::int32 task_result_; + friend void protobuf_AddDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_AssignDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_ShutdownFile_DlaPrototestInterface_2eproto(); + + void InitAsDefaultInstance(); + static TasksData* default_instance_; +}; +// ------------------------------------------------------------------- + +class Event : public ::google::protobuf::Message { + public: + Event(); + virtual ~Event(); + + Event(const Event& from); + + inline Event& operator=(const Event& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const Event& default_instance(); + + void Swap(Event* other); + + // implements Message ---------------------------------------------- + + Event* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const Event& from); + void MergeFrom(const Event& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + typedef Event_EventType EventType; + static const EventType SYNCPOINT = Event_EventType_SYNCPOINT; + static const EventType SYNCFD = Event_EventType_SYNCFD; + static const EventType SEMAPHORE = Event_EventType_SEMAPHORE; + static const EventType TS_SEMAPHORE = Event_EventType_TS_SEMAPHORE; + static inline bool EventType_IsValid(int value) { + return Event_EventType_IsValid(value); + } + static const EventType EventType_MIN = + Event_EventType_EventType_MIN; + static const EventType EventType_MAX = + Event_EventType_EventType_MAX; + static const int EventType_ARRAYSIZE = + Event_EventType_EventType_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + EventType_descriptor() { + return Event_EventType_descriptor(); + } + static inline const ::std::string& EventType_Name(EventType value) { + return Event_EventType_Name(value); + } + static inline bool EventType_Parse(const ::std::string& name, + EventType* value) { + return Event_EventType_Parse(name, value); + } + + // accessors ------------------------------------------------------- + + // required uint32 event_id = 1; + inline bool has_event_id() const; + inline void clear_event_id(); + static const int kEventIdFieldNumber = 1; + inline ::google::protobuf::uint32 event_id() const; + inline void set_event_id(::google::protobuf::uint32 value); + + // required .nvdla_prototest_interface.Event.EventType event_type = 2; + inline bool has_event_type() const; + inline void clear_event_type(); + static const int kEventTypeFieldNumber = 2; + inline ::nvdla_prototest_interface::Event_EventType event_type() const; + inline void set_event_type(::nvdla_prototest_interface::Event_EventType value); + + // required uint32 event_flags = 3; + inline bool has_event_flags() const; + inline void clear_event_flags(); + static const int kEventFlagsFieldNumber = 3; + inline ::google::protobuf::uint32 event_flags() const; + inline void set_event_flags(::google::protobuf::uint32 value); + + // optional uint32 event_timeout = 4 [default = 4294967295]; + inline bool has_event_timeout() const; + inline void clear_event_timeout(); + static const int kEventTimeoutFieldNumber = 4; + inline ::google::protobuf::uint32 event_timeout() const; + inline void set_event_timeout(::google::protobuf::uint32 value); + + // @@protoc_insertion_point(class_scope:nvdla_prototest_interface.Event) + private: + inline void set_has_event_id(); + inline void clear_has_event_id(); + inline void set_has_event_type(); + inline void clear_has_event_type(); + inline void set_has_event_flags(); + inline void clear_has_event_flags(); + inline void set_has_event_timeout(); + inline void clear_has_event_timeout(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::uint32 event_id_; + int event_type_; + ::google::protobuf::uint32 event_flags_; + ::google::protobuf::uint32 event_timeout_; + friend void protobuf_AddDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_AssignDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_ShutdownFile_DlaPrototestInterface_2eproto(); + + void InitAsDefaultInstance(); + static Event* default_instance_; +}; +// ------------------------------------------------------------------- + +class EventList : public ::google::protobuf::Message { + public: + EventList(); + virtual ~EventList(); + + EventList(const EventList& from); + + inline EventList& operator=(const EventList& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const EventList& default_instance(); + + void Swap(EventList* other); + + // implements Message ---------------------------------------------- + + EventList* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const EventList& from); + void MergeFrom(const EventList& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .nvdla_prototest_interface.Event event = 1; + inline int event_size() const; + inline void clear_event(); + static const int kEventFieldNumber = 1; + inline const ::nvdla_prototest_interface::Event& event(int index) const; + inline ::nvdla_prototest_interface::Event* mutable_event(int index); + inline ::nvdla_prototest_interface::Event* add_event(); + inline const ::google::protobuf::RepeatedPtrField< ::nvdla_prototest_interface::Event >& + event() const; + inline ::google::protobuf::RepeatedPtrField< ::nvdla_prototest_interface::Event >* + mutable_event(); + + // @@protoc_insertion_point(class_scope:nvdla_prototest_interface.EventList) + private: + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::RepeatedPtrField< ::nvdla_prototest_interface::Event > event_; + friend void protobuf_AddDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_AssignDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_ShutdownFile_DlaPrototestInterface_2eproto(); + + void InitAsDefaultInstance(); + static EventList* default_instance_; +}; +// ------------------------------------------------------------------- + +class SubmitSlot : public ::google::protobuf::Message { + public: + SubmitSlot(); + virtual ~SubmitSlot(); + + SubmitSlot(const SubmitSlot& from); + + inline SubmitSlot& operator=(const SubmitSlot& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const SubmitSlot& default_instance(); + + void Swap(SubmitSlot* other); + + // implements Message ---------------------------------------------- + + SubmitSlot* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const SubmitSlot& from); + void MergeFrom(const SubmitSlot& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated uint32 task_id = 1; + inline int task_id_size() const; + inline void clear_task_id(); + static const int kTaskIdFieldNumber = 1; + inline ::google::protobuf::uint32 task_id(int index) const; + inline void set_task_id(int index, ::google::protobuf::uint32 value); + inline void add_task_id(::google::protobuf::uint32 value); + inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& + task_id() const; + inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* + mutable_task_id(); + + // @@protoc_insertion_point(class_scope:nvdla_prototest_interface.SubmitSlot) + private: + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > task_id_; + friend void protobuf_AddDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_AssignDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_ShutdownFile_DlaPrototestInterface_2eproto(); + + void InitAsDefaultInstance(); + static SubmitSlot* default_instance_; +}; +// ------------------------------------------------------------------- + +class TestInfo : public ::google::protobuf::Message { + public: + TestInfo(); + virtual ~TestInfo(); + + TestInfo(const TestInfo& from); + + inline TestInfo& operator=(const TestInfo& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const TestInfo& default_instance(); + + void Swap(TestInfo* other); + + // implements Message ---------------------------------------------- + + TestInfo* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const TestInfo& from); + void MergeFrom(const TestInfo& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // required uint32 num_tasks = 1; + inline bool has_num_tasks() const; + inline void clear_num_tasks(); + static const int kNumTasksFieldNumber = 1; + inline ::google::protobuf::uint32 num_tasks() const; + inline void set_num_tasks(::google::protobuf::uint32 value); + + // required uint32 num_buffers = 2; + inline bool has_num_buffers() const; + inline void clear_num_buffers(); + static const int kNumBuffersFieldNumber = 2; + inline ::google::protobuf::uint32 num_buffers() const; + inline void set_num_buffers(::google::protobuf::uint32 value); + + // repeated .nvdla_prototest_interface.TasksData task = 3; + inline int task_size() const; + inline void clear_task(); + static const int kTaskFieldNumber = 3; + inline const ::nvdla_prototest_interface::TasksData& task(int index) const; + inline ::nvdla_prototest_interface::TasksData* mutable_task(int index); + inline ::nvdla_prototest_interface::TasksData* add_task(); + inline const ::google::protobuf::RepeatedPtrField< ::nvdla_prototest_interface::TasksData >& + task() const; + inline ::google::protobuf::RepeatedPtrField< ::nvdla_prototest_interface::TasksData >* + mutable_task(); + + // optional .nvdla_prototest_interface.EventList event_list = 4; + inline bool has_event_list() const; + inline void clear_event_list(); + static const int kEventListFieldNumber = 4; + inline const ::nvdla_prototest_interface::EventList& event_list() const; + inline ::nvdla_prototest_interface::EventList* mutable_event_list(); + inline ::nvdla_prototest_interface::EventList* release_event_list(); + inline void set_allocated_event_list(::nvdla_prototest_interface::EventList* event_list); + + // repeated .nvdla_prototest_interface.SubmitSlot slots = 5; + inline int slots_size() const; + inline void clear_slots(); + static const int kSlotsFieldNumber = 5; + inline const ::nvdla_prototest_interface::SubmitSlot& slots(int index) const; + inline ::nvdla_prototest_interface::SubmitSlot* mutable_slots(int index); + inline ::nvdla_prototest_interface::SubmitSlot* add_slots(); + inline const ::google::protobuf::RepeatedPtrField< ::nvdla_prototest_interface::SubmitSlot >& + slots() const; + inline ::google::protobuf::RepeatedPtrField< ::nvdla_prototest_interface::SubmitSlot >* + mutable_slots(); + + // @@protoc_insertion_point(class_scope:nvdla_prototest_interface.TestInfo) + private: + inline void set_has_num_tasks(); + inline void clear_has_num_tasks(); + inline void set_has_num_buffers(); + inline void clear_has_num_buffers(); + inline void set_has_event_list(); + inline void clear_has_event_list(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::uint32 num_tasks_; + ::google::protobuf::uint32 num_buffers_; + ::google::protobuf::RepeatedPtrField< ::nvdla_prototest_interface::TasksData > task_; + ::nvdla_prototest_interface::EventList* event_list_; + ::google::protobuf::RepeatedPtrField< ::nvdla_prototest_interface::SubmitSlot > slots_; + friend void protobuf_AddDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_AssignDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_ShutdownFile_DlaPrototestInterface_2eproto(); + + void InitAsDefaultInstance(); + static TestInfo* default_instance_; +}; +// ------------------------------------------------------------------- + +class Test : public ::google::protobuf::Message { + public: + Test(); + virtual ~Test(); + + Test(const Test& from); + + inline Test& operator=(const Test& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const Test& default_instance(); + + void Swap(Test* other); + + // implements Message ---------------------------------------------- + + Test* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const Test& from); + void MergeFrom(const Test& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // required .nvdla_prototest_interface.TestInfo test = 1; + inline bool has_test() const; + inline void clear_test(); + static const int kTestFieldNumber = 1; + inline const ::nvdla_prototest_interface::TestInfo& test() const; + inline ::nvdla_prototest_interface::TestInfo* mutable_test(); + inline ::nvdla_prototest_interface::TestInfo* release_test(); + inline void set_allocated_test(::nvdla_prototest_interface::TestInfo* test); + + // @@protoc_insertion_point(class_scope:nvdla_prototest_interface.Test) + private: + inline void set_has_test(); + inline void clear_has_test(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::nvdla_prototest_interface::TestInfo* test_; + friend void protobuf_AddDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_AssignDesc_DlaPrototestInterface_2eproto(); + friend void protobuf_ShutdownFile_DlaPrototestInterface_2eproto(); + + void InitAsDefaultInstance(); + static Test* default_instance_; +}; +// =================================================================== + + +// =================================================================== + +// LUTOffset + +// optional int32 exp_offset = 1; +inline bool LUTOffset::has_exp_offset() const { + return lut_offset_oneof_case() == kExpOffset; +} +inline void LUTOffset::set_has_exp_offset() { + _oneof_case_[0] = kExpOffset; +} +inline void LUTOffset::clear_exp_offset() { + if (has_exp_offset()) { + lut_offset_oneof_.exp_offset_ = 0; + clear_has_lut_offset_oneof(); + } +} +inline ::google::protobuf::int32 LUTOffset::exp_offset() const { + if (has_exp_offset()) { + return lut_offset_oneof_.exp_offset_; + } + return 0; +} +inline void LUTOffset::set_exp_offset(::google::protobuf::int32 value) { + if (!has_exp_offset()) { + clear_lut_offset_oneof(); + set_has_exp_offset(); + } + lut_offset_oneof_.exp_offset_ = value; +} + +// optional int32 frac_bits = 2; +inline bool LUTOffset::has_frac_bits() const { + return lut_offset_oneof_case() == kFracBits; +} +inline void LUTOffset::set_has_frac_bits() { + _oneof_case_[0] = kFracBits; +} +inline void LUTOffset::clear_frac_bits() { + if (has_frac_bits()) { + lut_offset_oneof_.frac_bits_ = 0; + clear_has_lut_offset_oneof(); + } +} +inline ::google::protobuf::int32 LUTOffset::frac_bits() const { + if (has_frac_bits()) { + return lut_offset_oneof_.frac_bits_; + } + return 0; +} +inline void LUTOffset::set_frac_bits(::google::protobuf::int32 value) { + if (!has_frac_bits()) { + clear_lut_offset_oneof(); + set_has_frac_bits(); + } + lut_offset_oneof_.frac_bits_ = value; +} + +inline bool LUTOffset::has_lut_offset_oneof() { + return lut_offset_oneof_case() != LUT_OFFSET_ONEOF_NOT_SET; +} +inline void LUTOffset::clear_has_lut_offset_oneof() { + _oneof_case_[0] = LUT_OFFSET_ONEOF_NOT_SET; +} +inline LUTOffset::LutOffsetOneofCase LUTOffset::lut_offset_oneof_case() const { + return LUTOffset::LutOffsetOneofCase(_oneof_case_[0]); +} +// ------------------------------------------------------------------- + +// FloatData + +// required int32 scale = 1; +inline bool FloatData::has_scale() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void FloatData::set_has_scale() { + _has_bits_[0] |= 0x00000001u; +} +inline void FloatData::clear_has_scale() { + _has_bits_[0] &= ~0x00000001u; +} +inline void FloatData::clear_scale() { + scale_ = 0; + clear_has_scale(); +} +inline ::google::protobuf::int32 FloatData::scale() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.FloatData.scale) + return scale_; +} +inline void FloatData::set_scale(::google::protobuf::int32 value) { + set_has_scale(); + scale_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.FloatData.scale) +} + +// required int32 shifter = 2; +inline bool FloatData::has_shifter() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void FloatData::set_has_shifter() { + _has_bits_[0] |= 0x00000002u; +} +inline void FloatData::clear_has_shifter() { + _has_bits_[0] &= ~0x00000002u; +} +inline void FloatData::clear_shifter() { + shifter_ = 0; + clear_has_shifter(); +} +inline ::google::protobuf::int32 FloatData::shifter() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.FloatData.shifter) + return shifter_; +} +inline void FloatData::set_shifter(::google::protobuf::int32 value) { + set_has_shifter(); + shifter_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.FloatData.shifter) +} + +// optional uint32 reserved0 = 3 [default = 0]; +inline bool FloatData::has_reserved0() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void FloatData::set_has_reserved0() { + _has_bits_[0] |= 0x00000004u; +} +inline void FloatData::clear_has_reserved0() { + _has_bits_[0] &= ~0x00000004u; +} +inline void FloatData::clear_reserved0() { + reserved0_ = 0u; + clear_has_reserved0(); +} +inline ::google::protobuf::uint32 FloatData::reserved0() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.FloatData.reserved0) + return reserved0_; +} +inline void FloatData::set_reserved0(::google::protobuf::uint32 value) { + set_has_reserved0(); + reserved0_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.FloatData.reserved0) +} + +// ------------------------------------------------------------------- + +// DLASlope + +// optional .nvdla_prototest_interface.FloatData data_i = 1; +inline bool DLASlope::has_data_i() const { + return dla_slope_oneof_case() == kDataI; +} +inline void DLASlope::set_has_data_i() { + _oneof_case_[0] = kDataI; +} +inline void DLASlope::clear_data_i() { + if (has_data_i()) { + delete dla_slope_oneof_.data_i_; + clear_has_dla_slope_oneof(); + } +} +inline const ::nvdla_prototest_interface::FloatData& DLASlope::data_i() const { + return has_data_i() ? *dla_slope_oneof_.data_i_ + : ::nvdla_prototest_interface::FloatData::default_instance(); +} +inline ::nvdla_prototest_interface::FloatData* DLASlope::mutable_data_i() { + if (!has_data_i()) { + clear_dla_slope_oneof(); + set_has_data_i(); + dla_slope_oneof_.data_i_ = new ::nvdla_prototest_interface::FloatData; + } + return dla_slope_oneof_.data_i_; +} +inline ::nvdla_prototest_interface::FloatData* DLASlope::release_data_i() { + if (has_data_i()) { + clear_has_dla_slope_oneof(); + ::nvdla_prototest_interface::FloatData* temp = dla_slope_oneof_.data_i_; + dla_slope_oneof_.data_i_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void DLASlope::set_allocated_data_i(::nvdla_prototest_interface::FloatData* data_i) { + clear_dla_slope_oneof(); + if (data_i) { + set_has_data_i(); + dla_slope_oneof_.data_i_ = data_i; + } +} + +// optional uint32 data_f = 2; +inline bool DLASlope::has_data_f() const { + return dla_slope_oneof_case() == kDataF; +} +inline void DLASlope::set_has_data_f() { + _oneof_case_[0] = kDataF; +} +inline void DLASlope::clear_data_f() { + if (has_data_f()) { + dla_slope_oneof_.data_f_ = 0u; + clear_has_dla_slope_oneof(); + } +} +inline ::google::protobuf::uint32 DLASlope::data_f() const { + if (has_data_f()) { + return dla_slope_oneof_.data_f_; + } + return 0u; +} +inline void DLASlope::set_data_f(::google::protobuf::uint32 value) { + if (!has_data_f()) { + clear_dla_slope_oneof(); + set_has_data_f(); + } + dla_slope_oneof_.data_f_ = value; +} + +inline bool DLASlope::has_dla_slope_oneof() { + return dla_slope_oneof_case() != DLA_SLOPE_ONEOF_NOT_SET; +} +inline void DLASlope::clear_has_dla_slope_oneof() { + _oneof_case_[0] = DLA_SLOPE_ONEOF_NOT_SET; +} +inline DLASlope::DlaSlopeOneofCase DLASlope::dla_slope_oneof_case() const { + return DLASlope::DlaSlopeOneofCase(_oneof_case_[0]); +} +// ------------------------------------------------------------------- + +// DataFile + +// required string name = 1; +inline bool DataFile::has_name() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void DataFile::set_has_name() { + _has_bits_[0] |= 0x00000001u; +} +inline void DataFile::clear_has_name() { + _has_bits_[0] &= ~0x00000001u; +} +inline void DataFile::clear_name() { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_->clear(); + } + clear_has_name(); +} +inline const ::std::string& DataFile::name() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.DataFile.name) + return *name_; +} +inline void DataFile::set_name(const ::std::string& value) { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + name_->assign(value); + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.DataFile.name) +} +inline void DataFile::set_name(const char* value) { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + name_->assign(value); + // @@protoc_insertion_point(field_set_char:nvdla_prototest_interface.DataFile.name) +} +inline void DataFile::set_name(const char* value, size_t size) { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + name_->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:nvdla_prototest_interface.DataFile.name) +} +inline ::std::string* DataFile::mutable_name() { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:nvdla_prototest_interface.DataFile.name) + return name_; +} +inline ::std::string* DataFile::release_name() { + clear_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = name_; + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void DataFile::set_allocated_name(::std::string* name) { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete name_; + } + if (name) { + set_has_name(); + name_ = name; + } else { + clear_has_name(); + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:nvdla_prototest_interface.DataFile.name) +} + +// required .nvdla_prototest_interface.DataType data_type = 2; +inline bool DataFile::has_data_type() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void DataFile::set_has_data_type() { + _has_bits_[0] |= 0x00000002u; +} +inline void DataFile::clear_has_data_type() { + _has_bits_[0] &= ~0x00000002u; +} +inline void DataFile::clear_data_type() { + data_type_ = 0; + clear_has_data_type(); +} +inline ::nvdla_prototest_interface::DataType DataFile::data_type() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.DataFile.data_type) + return static_cast< ::nvdla_prototest_interface::DataType >(data_type_); +} +inline void DataFile::set_data_type(::nvdla_prototest_interface::DataType value) { + assert(::nvdla_prototest_interface::DataType_IsValid(value)); + set_has_data_type(); + data_type_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.DataFile.data_type) +} + +// required uint32 offset = 3; +inline bool DataFile::has_offset() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void DataFile::set_has_offset() { + _has_bits_[0] |= 0x00000004u; +} +inline void DataFile::clear_has_offset() { + _has_bits_[0] &= ~0x00000004u; +} +inline void DataFile::clear_offset() { + offset_ = 0u; + clear_has_offset(); +} +inline ::google::protobuf::uint32 DataFile::offset() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.DataFile.offset) + return offset_; +} +inline void DataFile::set_offset(::google::protobuf::uint32 value) { + set_has_offset(); + offset_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.DataFile.offset) +} + +// required uint32 size = 4; +inline bool DataFile::has_size() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void DataFile::set_has_size() { + _has_bits_[0] |= 0x00000008u; +} +inline void DataFile::clear_has_size() { + _has_bits_[0] &= ~0x00000008u; +} +inline void DataFile::clear_size() { + size_ = 0u; + clear_has_size(); +} +inline ::google::protobuf::uint32 DataFile::size() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.DataFile.size) + return size_; +} +inline void DataFile::set_size(::google::protobuf::uint32 value) { + set_has_size(); + size_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.DataFile.size) +} + +// required .nvdla_prototest_interface.FileType file_type = 5; +inline bool DataFile::has_file_type() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +inline void DataFile::set_has_file_type() { + _has_bits_[0] |= 0x00000010u; +} +inline void DataFile::clear_has_file_type() { + _has_bits_[0] &= ~0x00000010u; +} +inline void DataFile::clear_file_type() { + file_type_ = 0; + clear_has_file_type(); +} +inline ::nvdla_prototest_interface::FileType DataFile::file_type() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.DataFile.file_type) + return static_cast< ::nvdla_prototest_interface::FileType >(file_type_); +} +inline void DataFile::set_file_type(::nvdla_prototest_interface::FileType value) { + assert(::nvdla_prototest_interface::FileType_IsValid(value)); + set_has_file_type(); + file_type_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.DataFile.file_type) +} + +// ------------------------------------------------------------------- + +// Constant + +// required int32 value = 1; +inline bool Constant::has_value() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void Constant::set_has_value() { + _has_bits_[0] |= 0x00000001u; +} +inline void Constant::clear_has_value() { + _has_bits_[0] &= ~0x00000001u; +} +inline void Constant::clear_value() { + value_ = 0; + clear_has_value(); +} +inline ::google::protobuf::int32 Constant::value() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.Constant.value) + return value_; +} +inline void Constant::set_value(::google::protobuf::int32 value) { + set_has_value(); + value_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.Constant.value) +} + +// ------------------------------------------------------------------- + +// DataFiller + +// optional .nvdla_prototest_interface.DataFile data_file = 1; +inline bool DataFiller::has_data_file() const { + return data_filler_oneof_case() == kDataFile; +} +inline void DataFiller::set_has_data_file() { + _oneof_case_[0] = kDataFile; +} +inline void DataFiller::clear_data_file() { + if (has_data_file()) { + delete data_filler_oneof_.data_file_; + clear_has_data_filler_oneof(); + } +} +inline const ::nvdla_prototest_interface::DataFile& DataFiller::data_file() const { + return has_data_file() ? *data_filler_oneof_.data_file_ + : ::nvdla_prototest_interface::DataFile::default_instance(); +} +inline ::nvdla_prototest_interface::DataFile* DataFiller::mutable_data_file() { + if (!has_data_file()) { + clear_data_filler_oneof(); + set_has_data_file(); + data_filler_oneof_.data_file_ = new ::nvdla_prototest_interface::DataFile; + } + return data_filler_oneof_.data_file_; +} +inline ::nvdla_prototest_interface::DataFile* DataFiller::release_data_file() { + if (has_data_file()) { + clear_has_data_filler_oneof(); + ::nvdla_prototest_interface::DataFile* temp = data_filler_oneof_.data_file_; + data_filler_oneof_.data_file_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void DataFiller::set_allocated_data_file(::nvdla_prototest_interface::DataFile* data_file) { + clear_data_filler_oneof(); + if (data_file) { + set_has_data_file(); + data_filler_oneof_.data_file_ = data_file; + } +} + +// optional .nvdla_prototest_interface.Constant const = 2; +inline bool DataFiller::has_const_() const { + return data_filler_oneof_case() == kConst; +} +inline void DataFiller::set_has_const_() { + _oneof_case_[0] = kConst; +} +inline void DataFiller::clear_const_() { + if (has_const_()) { + delete data_filler_oneof_.const__; + clear_has_data_filler_oneof(); + } +} +inline const ::nvdla_prototest_interface::Constant& DataFiller::const_() const { + return has_const_() ? *data_filler_oneof_.const__ + : ::nvdla_prototest_interface::Constant::default_instance(); +} +inline ::nvdla_prototest_interface::Constant* DataFiller::mutable_const_() { + if (!has_const_()) { + clear_data_filler_oneof(); + set_has_const_(); + data_filler_oneof_.const__ = new ::nvdla_prototest_interface::Constant; + } + return data_filler_oneof_.const__; +} +inline ::nvdla_prototest_interface::Constant* DataFiller::release_const_() { + if (has_const_()) { + clear_has_data_filler_oneof(); + ::nvdla_prototest_interface::Constant* temp = data_filler_oneof_.const__; + data_filler_oneof_.const__ = NULL; + return temp; + } else { + return NULL; + } +} +inline void DataFiller::set_allocated_const_(::nvdla_prototest_interface::Constant* const_) { + clear_data_filler_oneof(); + if (const_) { + set_has_const_(); + data_filler_oneof_.const__ = const_; + } +} + +inline bool DataFiller::has_data_filler_oneof() { + return data_filler_oneof_case() != DATA_FILLER_ONEOF_NOT_SET; +} +inline void DataFiller::clear_has_data_filler_oneof() { + _oneof_case_[0] = DATA_FILLER_ONEOF_NOT_SET; +} +inline DataFiller::DataFillerOneofCase DataFiller::data_filler_oneof_case() const { + return DataFiller::DataFillerOneofCase(_oneof_case_[0]); +} +// ------------------------------------------------------------------- + +// LUTParam + +// repeated int32 linear_exp_table = 1 [packed = true]; +inline int LUTParam::linear_exp_table_size() const { + return linear_exp_table_.size(); +} +inline void LUTParam::clear_linear_exp_table() { + linear_exp_table_.Clear(); +} +inline ::google::protobuf::int32 LUTParam::linear_exp_table(int index) const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.LUTParam.linear_exp_table) + return linear_exp_table_.Get(index); +} +inline void LUTParam::set_linear_exp_table(int index, ::google::protobuf::int32 value) { + linear_exp_table_.Set(index, value); + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.LUTParam.linear_exp_table) +} +inline void LUTParam::add_linear_exp_table(::google::protobuf::int32 value) { + linear_exp_table_.Add(value); + // @@protoc_insertion_point(field_add:nvdla_prototest_interface.LUTParam.linear_exp_table) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +LUTParam::linear_exp_table() const { + // @@protoc_insertion_point(field_list:nvdla_prototest_interface.LUTParam.linear_exp_table) + return linear_exp_table_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +LUTParam::mutable_linear_exp_table() { + // @@protoc_insertion_point(field_mutable_list:nvdla_prototest_interface.LUTParam.linear_exp_table) + return &linear_exp_table_; +} + +// repeated int32 linear_only_table = 2 [packed = true]; +inline int LUTParam::linear_only_table_size() const { + return linear_only_table_.size(); +} +inline void LUTParam::clear_linear_only_table() { + linear_only_table_.Clear(); +} +inline ::google::protobuf::int32 LUTParam::linear_only_table(int index) const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.LUTParam.linear_only_table) + return linear_only_table_.Get(index); +} +inline void LUTParam::set_linear_only_table(int index, ::google::protobuf::int32 value) { + linear_only_table_.Set(index, value); + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.LUTParam.linear_only_table) +} +inline void LUTParam::add_linear_only_table(::google::protobuf::int32 value) { + linear_only_table_.Add(value); + // @@protoc_insertion_point(field_add:nvdla_prototest_interface.LUTParam.linear_only_table) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +LUTParam::linear_only_table() const { + // @@protoc_insertion_point(field_list:nvdla_prototest_interface.LUTParam.linear_only_table) + return linear_only_table_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +LUTParam::mutable_linear_only_table() { + // @@protoc_insertion_point(field_mutable_list:nvdla_prototest_interface.LUTParam.linear_only_table) + return &linear_only_table_; +} + +// required .nvdla_prototest_interface.LUTOffset linear_exp_offset = 3; +inline bool LUTParam::has_linear_exp_offset() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void LUTParam::set_has_linear_exp_offset() { + _has_bits_[0] |= 0x00000004u; +} +inline void LUTParam::clear_has_linear_exp_offset() { + _has_bits_[0] &= ~0x00000004u; +} +inline void LUTParam::clear_linear_exp_offset() { + if (linear_exp_offset_ != NULL) linear_exp_offset_->::nvdla_prototest_interface::LUTOffset::Clear(); + clear_has_linear_exp_offset(); +} +inline const ::nvdla_prototest_interface::LUTOffset& LUTParam::linear_exp_offset() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.LUTParam.linear_exp_offset) + return linear_exp_offset_ != NULL ? *linear_exp_offset_ : *default_instance_->linear_exp_offset_; +} +inline ::nvdla_prototest_interface::LUTOffset* LUTParam::mutable_linear_exp_offset() { + set_has_linear_exp_offset(); + if (linear_exp_offset_ == NULL) linear_exp_offset_ = new ::nvdla_prototest_interface::LUTOffset; + // @@protoc_insertion_point(field_mutable:nvdla_prototest_interface.LUTParam.linear_exp_offset) + return linear_exp_offset_; +} +inline ::nvdla_prototest_interface::LUTOffset* LUTParam::release_linear_exp_offset() { + clear_has_linear_exp_offset(); + ::nvdla_prototest_interface::LUTOffset* temp = linear_exp_offset_; + linear_exp_offset_ = NULL; + return temp; +} +inline void LUTParam::set_allocated_linear_exp_offset(::nvdla_prototest_interface::LUTOffset* linear_exp_offset) { + delete linear_exp_offset_; + linear_exp_offset_ = linear_exp_offset; + if (linear_exp_offset) { + set_has_linear_exp_offset(); + } else { + clear_has_linear_exp_offset(); + } + // @@protoc_insertion_point(field_set_allocated:nvdla_prototest_interface.LUTParam.linear_exp_offset) +} + +// required .nvdla_prototest_interface.LUTOffset linear_only_offset = 4; +inline bool LUTParam::has_linear_only_offset() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void LUTParam::set_has_linear_only_offset() { + _has_bits_[0] |= 0x00000008u; +} +inline void LUTParam::clear_has_linear_only_offset() { + _has_bits_[0] &= ~0x00000008u; +} +inline void LUTParam::clear_linear_only_offset() { + if (linear_only_offset_ != NULL) linear_only_offset_->::nvdla_prototest_interface::LUTOffset::Clear(); + clear_has_linear_only_offset(); +} +inline const ::nvdla_prototest_interface::LUTOffset& LUTParam::linear_only_offset() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.LUTParam.linear_only_offset) + return linear_only_offset_ != NULL ? *linear_only_offset_ : *default_instance_->linear_only_offset_; +} +inline ::nvdla_prototest_interface::LUTOffset* LUTParam::mutable_linear_only_offset() { + set_has_linear_only_offset(); + if (linear_only_offset_ == NULL) linear_only_offset_ = new ::nvdla_prototest_interface::LUTOffset; + // @@protoc_insertion_point(field_mutable:nvdla_prototest_interface.LUTParam.linear_only_offset) + return linear_only_offset_; +} +inline ::nvdla_prototest_interface::LUTOffset* LUTParam::release_linear_only_offset() { + clear_has_linear_only_offset(); + ::nvdla_prototest_interface::LUTOffset* temp = linear_only_offset_; + linear_only_offset_ = NULL; + return temp; +} +inline void LUTParam::set_allocated_linear_only_offset(::nvdla_prototest_interface::LUTOffset* linear_only_offset) { + delete linear_only_offset_; + linear_only_offset_ = linear_only_offset; + if (linear_only_offset) { + set_has_linear_only_offset(); + } else { + clear_has_linear_only_offset(); + } + // @@protoc_insertion_point(field_set_allocated:nvdla_prototest_interface.LUTParam.linear_only_offset) +} + +// required uint64 linear_exp_start = 5; +inline bool LUTParam::has_linear_exp_start() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +inline void LUTParam::set_has_linear_exp_start() { + _has_bits_[0] |= 0x00000010u; +} +inline void LUTParam::clear_has_linear_exp_start() { + _has_bits_[0] &= ~0x00000010u; +} +inline void LUTParam::clear_linear_exp_start() { + linear_exp_start_ = GOOGLE_ULONGLONG(0); + clear_has_linear_exp_start(); +} +inline ::google::protobuf::uint64 LUTParam::linear_exp_start() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.LUTParam.linear_exp_start) + return linear_exp_start_; +} +inline void LUTParam::set_linear_exp_start(::google::protobuf::uint64 value) { + set_has_linear_exp_start(); + linear_exp_start_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.LUTParam.linear_exp_start) +} + +// required uint64 linear_exp_end = 6; +inline bool LUTParam::has_linear_exp_end() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +inline void LUTParam::set_has_linear_exp_end() { + _has_bits_[0] |= 0x00000020u; +} +inline void LUTParam::clear_has_linear_exp_end() { + _has_bits_[0] &= ~0x00000020u; +} +inline void LUTParam::clear_linear_exp_end() { + linear_exp_end_ = GOOGLE_ULONGLONG(0); + clear_has_linear_exp_end(); +} +inline ::google::protobuf::uint64 LUTParam::linear_exp_end() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.LUTParam.linear_exp_end) + return linear_exp_end_; +} +inline void LUTParam::set_linear_exp_end(::google::protobuf::uint64 value) { + set_has_linear_exp_end(); + linear_exp_end_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.LUTParam.linear_exp_end) +} + +// required uint64 linear_only_start = 7; +inline bool LUTParam::has_linear_only_start() const { + return (_has_bits_[0] & 0x00000040u) != 0; +} +inline void LUTParam::set_has_linear_only_start() { + _has_bits_[0] |= 0x00000040u; +} +inline void LUTParam::clear_has_linear_only_start() { + _has_bits_[0] &= ~0x00000040u; +} +inline void LUTParam::clear_linear_only_start() { + linear_only_start_ = GOOGLE_ULONGLONG(0); + clear_has_linear_only_start(); +} +inline ::google::protobuf::uint64 LUTParam::linear_only_start() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.LUTParam.linear_only_start) + return linear_only_start_; +} +inline void LUTParam::set_linear_only_start(::google::protobuf::uint64 value) { + set_has_linear_only_start(); + linear_only_start_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.LUTParam.linear_only_start) +} + +// required uint64 linear_only_end = 8; +inline bool LUTParam::has_linear_only_end() const { + return (_has_bits_[0] & 0x00000080u) != 0; +} +inline void LUTParam::set_has_linear_only_end() { + _has_bits_[0] |= 0x00000080u; +} +inline void LUTParam::clear_has_linear_only_end() { + _has_bits_[0] &= ~0x00000080u; +} +inline void LUTParam::clear_linear_only_end() { + linear_only_end_ = GOOGLE_ULONGLONG(0); + clear_has_linear_only_end(); +} +inline ::google::protobuf::uint64 LUTParam::linear_only_end() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.LUTParam.linear_only_end) + return linear_only_end_; +} +inline void LUTParam::set_linear_only_end(::google::protobuf::uint64 value) { + set_has_linear_only_end(); + linear_only_end_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.LUTParam.linear_only_end) +} + +// required .nvdla_prototest_interface.DLASlope linear_exp_underflow_slope = 9; +inline bool LUTParam::has_linear_exp_underflow_slope() const { + return (_has_bits_[0] & 0x00000100u) != 0; +} +inline void LUTParam::set_has_linear_exp_underflow_slope() { + _has_bits_[0] |= 0x00000100u; +} +inline void LUTParam::clear_has_linear_exp_underflow_slope() { + _has_bits_[0] &= ~0x00000100u; +} +inline void LUTParam::clear_linear_exp_underflow_slope() { + if (linear_exp_underflow_slope_ != NULL) linear_exp_underflow_slope_->::nvdla_prototest_interface::DLASlope::Clear(); + clear_has_linear_exp_underflow_slope(); +} +inline const ::nvdla_prototest_interface::DLASlope& LUTParam::linear_exp_underflow_slope() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.LUTParam.linear_exp_underflow_slope) + return linear_exp_underflow_slope_ != NULL ? *linear_exp_underflow_slope_ : *default_instance_->linear_exp_underflow_slope_; +} +inline ::nvdla_prototest_interface::DLASlope* LUTParam::mutable_linear_exp_underflow_slope() { + set_has_linear_exp_underflow_slope(); + if (linear_exp_underflow_slope_ == NULL) linear_exp_underflow_slope_ = new ::nvdla_prototest_interface::DLASlope; + // @@protoc_insertion_point(field_mutable:nvdla_prototest_interface.LUTParam.linear_exp_underflow_slope) + return linear_exp_underflow_slope_; +} +inline ::nvdla_prototest_interface::DLASlope* LUTParam::release_linear_exp_underflow_slope() { + clear_has_linear_exp_underflow_slope(); + ::nvdla_prototest_interface::DLASlope* temp = linear_exp_underflow_slope_; + linear_exp_underflow_slope_ = NULL; + return temp; +} +inline void LUTParam::set_allocated_linear_exp_underflow_slope(::nvdla_prototest_interface::DLASlope* linear_exp_underflow_slope) { + delete linear_exp_underflow_slope_; + linear_exp_underflow_slope_ = linear_exp_underflow_slope; + if (linear_exp_underflow_slope) { + set_has_linear_exp_underflow_slope(); + } else { + clear_has_linear_exp_underflow_slope(); + } + // @@protoc_insertion_point(field_set_allocated:nvdla_prototest_interface.LUTParam.linear_exp_underflow_slope) +} + +// required .nvdla_prototest_interface.DLASlope linear_exp_overflow_slope = 10; +inline bool LUTParam::has_linear_exp_overflow_slope() const { + return (_has_bits_[0] & 0x00000200u) != 0; +} +inline void LUTParam::set_has_linear_exp_overflow_slope() { + _has_bits_[0] |= 0x00000200u; +} +inline void LUTParam::clear_has_linear_exp_overflow_slope() { + _has_bits_[0] &= ~0x00000200u; +} +inline void LUTParam::clear_linear_exp_overflow_slope() { + if (linear_exp_overflow_slope_ != NULL) linear_exp_overflow_slope_->::nvdla_prototest_interface::DLASlope::Clear(); + clear_has_linear_exp_overflow_slope(); +} +inline const ::nvdla_prototest_interface::DLASlope& LUTParam::linear_exp_overflow_slope() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.LUTParam.linear_exp_overflow_slope) + return linear_exp_overflow_slope_ != NULL ? *linear_exp_overflow_slope_ : *default_instance_->linear_exp_overflow_slope_; +} +inline ::nvdla_prototest_interface::DLASlope* LUTParam::mutable_linear_exp_overflow_slope() { + set_has_linear_exp_overflow_slope(); + if (linear_exp_overflow_slope_ == NULL) linear_exp_overflow_slope_ = new ::nvdla_prototest_interface::DLASlope; + // @@protoc_insertion_point(field_mutable:nvdla_prototest_interface.LUTParam.linear_exp_overflow_slope) + return linear_exp_overflow_slope_; +} +inline ::nvdla_prototest_interface::DLASlope* LUTParam::release_linear_exp_overflow_slope() { + clear_has_linear_exp_overflow_slope(); + ::nvdla_prototest_interface::DLASlope* temp = linear_exp_overflow_slope_; + linear_exp_overflow_slope_ = NULL; + return temp; +} +inline void LUTParam::set_allocated_linear_exp_overflow_slope(::nvdla_prototest_interface::DLASlope* linear_exp_overflow_slope) { + delete linear_exp_overflow_slope_; + linear_exp_overflow_slope_ = linear_exp_overflow_slope; + if (linear_exp_overflow_slope) { + set_has_linear_exp_overflow_slope(); + } else { + clear_has_linear_exp_overflow_slope(); + } + // @@protoc_insertion_point(field_set_allocated:nvdla_prototest_interface.LUTParam.linear_exp_overflow_slope) +} + +// required .nvdla_prototest_interface.DLASlope linear_only_underflow_slope = 11; +inline bool LUTParam::has_linear_only_underflow_slope() const { + return (_has_bits_[0] & 0x00000400u) != 0; +} +inline void LUTParam::set_has_linear_only_underflow_slope() { + _has_bits_[0] |= 0x00000400u; +} +inline void LUTParam::clear_has_linear_only_underflow_slope() { + _has_bits_[0] &= ~0x00000400u; +} +inline void LUTParam::clear_linear_only_underflow_slope() { + if (linear_only_underflow_slope_ != NULL) linear_only_underflow_slope_->::nvdla_prototest_interface::DLASlope::Clear(); + clear_has_linear_only_underflow_slope(); +} +inline const ::nvdla_prototest_interface::DLASlope& LUTParam::linear_only_underflow_slope() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.LUTParam.linear_only_underflow_slope) + return linear_only_underflow_slope_ != NULL ? *linear_only_underflow_slope_ : *default_instance_->linear_only_underflow_slope_; +} +inline ::nvdla_prototest_interface::DLASlope* LUTParam::mutable_linear_only_underflow_slope() { + set_has_linear_only_underflow_slope(); + if (linear_only_underflow_slope_ == NULL) linear_only_underflow_slope_ = new ::nvdla_prototest_interface::DLASlope; + // @@protoc_insertion_point(field_mutable:nvdla_prototest_interface.LUTParam.linear_only_underflow_slope) + return linear_only_underflow_slope_; +} +inline ::nvdla_prototest_interface::DLASlope* LUTParam::release_linear_only_underflow_slope() { + clear_has_linear_only_underflow_slope(); + ::nvdla_prototest_interface::DLASlope* temp = linear_only_underflow_slope_; + linear_only_underflow_slope_ = NULL; + return temp; +} +inline void LUTParam::set_allocated_linear_only_underflow_slope(::nvdla_prototest_interface::DLASlope* linear_only_underflow_slope) { + delete linear_only_underflow_slope_; + linear_only_underflow_slope_ = linear_only_underflow_slope; + if (linear_only_underflow_slope) { + set_has_linear_only_underflow_slope(); + } else { + clear_has_linear_only_underflow_slope(); + } + // @@protoc_insertion_point(field_set_allocated:nvdla_prototest_interface.LUTParam.linear_only_underflow_slope) +} + +// required .nvdla_prototest_interface.DLASlope linear_only_overflow_slope = 12; +inline bool LUTParam::has_linear_only_overflow_slope() const { + return (_has_bits_[0] & 0x00000800u) != 0; +} +inline void LUTParam::set_has_linear_only_overflow_slope() { + _has_bits_[0] |= 0x00000800u; +} +inline void LUTParam::clear_has_linear_only_overflow_slope() { + _has_bits_[0] &= ~0x00000800u; +} +inline void LUTParam::clear_linear_only_overflow_slope() { + if (linear_only_overflow_slope_ != NULL) linear_only_overflow_slope_->::nvdla_prototest_interface::DLASlope::Clear(); + clear_has_linear_only_overflow_slope(); +} +inline const ::nvdla_prototest_interface::DLASlope& LUTParam::linear_only_overflow_slope() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.LUTParam.linear_only_overflow_slope) + return linear_only_overflow_slope_ != NULL ? *linear_only_overflow_slope_ : *default_instance_->linear_only_overflow_slope_; +} +inline ::nvdla_prototest_interface::DLASlope* LUTParam::mutable_linear_only_overflow_slope() { + set_has_linear_only_overflow_slope(); + if (linear_only_overflow_slope_ == NULL) linear_only_overflow_slope_ = new ::nvdla_prototest_interface::DLASlope; + // @@protoc_insertion_point(field_mutable:nvdla_prototest_interface.LUTParam.linear_only_overflow_slope) + return linear_only_overflow_slope_; +} +inline ::nvdla_prototest_interface::DLASlope* LUTParam::release_linear_only_overflow_slope() { + clear_has_linear_only_overflow_slope(); + ::nvdla_prototest_interface::DLASlope* temp = linear_only_overflow_slope_; + linear_only_overflow_slope_ = NULL; + return temp; +} +inline void LUTParam::set_allocated_linear_only_overflow_slope(::nvdla_prototest_interface::DLASlope* linear_only_overflow_slope) { + delete linear_only_overflow_slope_; + linear_only_overflow_slope_ = linear_only_overflow_slope; + if (linear_only_overflow_slope) { + set_has_linear_only_overflow_slope(); + } else { + clear_has_linear_only_overflow_slope(); + } + // @@protoc_insertion_point(field_set_allocated:nvdla_prototest_interface.LUTParam.linear_only_overflow_slope) +} + +// required uint32 hybrid_priority = 13; +inline bool LUTParam::has_hybrid_priority() const { + return (_has_bits_[0] & 0x00001000u) != 0; +} +inline void LUTParam::set_has_hybrid_priority() { + _has_bits_[0] |= 0x00001000u; +} +inline void LUTParam::clear_has_hybrid_priority() { + _has_bits_[0] &= ~0x00001000u; +} +inline void LUTParam::clear_hybrid_priority() { + hybrid_priority_ = 0u; + clear_has_hybrid_priority(); +} +inline ::google::protobuf::uint32 LUTParam::hybrid_priority() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.LUTParam.hybrid_priority) + return hybrid_priority_; +} +inline void LUTParam::set_hybrid_priority(::google::protobuf::uint32 value) { + set_has_hybrid_priority(); + hybrid_priority_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.LUTParam.hybrid_priority) +} + +// required uint32 underflow_priority = 14; +inline bool LUTParam::has_underflow_priority() const { + return (_has_bits_[0] & 0x00002000u) != 0; +} +inline void LUTParam::set_has_underflow_priority() { + _has_bits_[0] |= 0x00002000u; +} +inline void LUTParam::clear_has_underflow_priority() { + _has_bits_[0] &= ~0x00002000u; +} +inline void LUTParam::clear_underflow_priority() { + underflow_priority_ = 0u; + clear_has_underflow_priority(); +} +inline ::google::protobuf::uint32 LUTParam::underflow_priority() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.LUTParam.underflow_priority) + return underflow_priority_; +} +inline void LUTParam::set_underflow_priority(::google::protobuf::uint32 value) { + set_has_underflow_priority(); + underflow_priority_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.LUTParam.underflow_priority) +} + +// required uint32 overflow_priority = 15; +inline bool LUTParam::has_overflow_priority() const { + return (_has_bits_[0] & 0x00004000u) != 0; +} +inline void LUTParam::set_has_overflow_priority() { + _has_bits_[0] |= 0x00004000u; +} +inline void LUTParam::clear_has_overflow_priority() { + _has_bits_[0] &= ~0x00004000u; +} +inline void LUTParam::clear_overflow_priority() { + overflow_priority_ = 0u; + clear_has_overflow_priority(); +} +inline ::google::protobuf::uint32 LUTParam::overflow_priority() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.LUTParam.overflow_priority) + return overflow_priority_; +} +inline void LUTParam::set_overflow_priority(::google::protobuf::uint32 value) { + set_has_overflow_priority(); + overflow_priority_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.LUTParam.overflow_priority) +} + +// required .nvdla_prototest_interface.LUTMethod method = 16; +inline bool LUTParam::has_method() const { + return (_has_bits_[0] & 0x00008000u) != 0; +} +inline void LUTParam::set_has_method() { + _has_bits_[0] |= 0x00008000u; +} +inline void LUTParam::clear_has_method() { + _has_bits_[0] &= ~0x00008000u; +} +inline void LUTParam::clear_method() { + method_ = 0; + clear_has_method(); +} +inline ::nvdla_prototest_interface::LUTMethod LUTParam::method() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.LUTParam.method) + return static_cast< ::nvdla_prototest_interface::LUTMethod >(method_); +} +inline void LUTParam::set_method(::nvdla_prototest_interface::LUTMethod value) { + assert(::nvdla_prototest_interface::LUTMethod_IsValid(value)); + set_has_method(); + method_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.LUTParam.method) +} + +// optional .nvdla_prototest_interface.FillerType fill_type = 17 [default = FILL_NONE]; +inline bool LUTParam::has_fill_type() const { + return (_has_bits_[0] & 0x00010000u) != 0; +} +inline void LUTParam::set_has_fill_type() { + _has_bits_[0] |= 0x00010000u; +} +inline void LUTParam::clear_has_fill_type() { + _has_bits_[0] &= ~0x00010000u; +} +inline void LUTParam::clear_fill_type() { + fill_type_ = 0; + clear_has_fill_type(); +} +inline ::nvdla_prototest_interface::FillerType LUTParam::fill_type() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.LUTParam.fill_type) + return static_cast< ::nvdla_prototest_interface::FillerType >(fill_type_); +} +inline void LUTParam::set_fill_type(::nvdla_prototest_interface::FillerType value) { + assert(::nvdla_prototest_interface::FillerType_IsValid(value)); + set_has_fill_type(); + fill_type_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.LUTParam.fill_type) +} + +// optional .nvdla_prototest_interface.DataFiller filler = 18; +inline bool LUTParam::has_filler() const { + return (_has_bits_[0] & 0x00020000u) != 0; +} +inline void LUTParam::set_has_filler() { + _has_bits_[0] |= 0x00020000u; +} +inline void LUTParam::clear_has_filler() { + _has_bits_[0] &= ~0x00020000u; +} +inline void LUTParam::clear_filler() { + if (filler_ != NULL) filler_->::nvdla_prototest_interface::DataFiller::Clear(); + clear_has_filler(); +} +inline const ::nvdla_prototest_interface::DataFiller& LUTParam::filler() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.LUTParam.filler) + return filler_ != NULL ? *filler_ : *default_instance_->filler_; +} +inline ::nvdla_prototest_interface::DataFiller* LUTParam::mutable_filler() { + set_has_filler(); + if (filler_ == NULL) filler_ = new ::nvdla_prototest_interface::DataFiller; + // @@protoc_insertion_point(field_mutable:nvdla_prototest_interface.LUTParam.filler) + return filler_; +} +inline ::nvdla_prototest_interface::DataFiller* LUTParam::release_filler() { + clear_has_filler(); + ::nvdla_prototest_interface::DataFiller* temp = filler_; + filler_ = NULL; + return temp; +} +inline void LUTParam::set_allocated_filler(::nvdla_prototest_interface::DataFiller* filler) { + delete filler_; + filler_ = filler; + if (filler) { + set_has_filler(); + } else { + clear_has_filler(); + } + // @@protoc_insertion_point(field_set_allocated:nvdla_prototest_interface.LUTParam.filler) +} + +// optional .nvdla_prototest_interface.DataPrecision precision = 19 [default = PRECISION_INT16]; +inline bool LUTParam::has_precision() const { + return (_has_bits_[0] & 0x00040000u) != 0; +} +inline void LUTParam::set_has_precision() { + _has_bits_[0] |= 0x00040000u; +} +inline void LUTParam::clear_has_precision() { + _has_bits_[0] &= ~0x00040000u; +} +inline void LUTParam::clear_precision() { + precision_ = 1; + clear_has_precision(); +} +inline ::nvdla_prototest_interface::DataPrecision LUTParam::precision() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.LUTParam.precision) + return static_cast< ::nvdla_prototest_interface::DataPrecision >(precision_); +} +inline void LUTParam::set_precision(::nvdla_prototest_interface::DataPrecision value) { + assert(::nvdla_prototest_interface::DataPrecision_IsValid(value)); + set_has_precision(); + precision_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.LUTParam.precision) +} + +// ------------------------------------------------------------------- + +// BDMATransferDesc + +// required int32 source_address = 1; +inline bool BDMATransferDesc::has_source_address() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void BDMATransferDesc::set_has_source_address() { + _has_bits_[0] |= 0x00000001u; +} +inline void BDMATransferDesc::clear_has_source_address() { + _has_bits_[0] &= ~0x00000001u; +} +inline void BDMATransferDesc::clear_source_address() { + source_address_ = 0; + clear_has_source_address(); +} +inline ::google::protobuf::int32 BDMATransferDesc::source_address() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.BDMATransferDesc.source_address) + return source_address_; +} +inline void BDMATransferDesc::set_source_address(::google::protobuf::int32 value) { + set_has_source_address(); + source_address_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.BDMATransferDesc.source_address) +} + +// required int32 destination_address = 2; +inline bool BDMATransferDesc::has_destination_address() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void BDMATransferDesc::set_has_destination_address() { + _has_bits_[0] |= 0x00000002u; +} +inline void BDMATransferDesc::clear_has_destination_address() { + _has_bits_[0] &= ~0x00000002u; +} +inline void BDMATransferDesc::clear_destination_address() { + destination_address_ = 0; + clear_has_destination_address(); +} +inline ::google::protobuf::int32 BDMATransferDesc::destination_address() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.BDMATransferDesc.destination_address) + return destination_address_; +} +inline void BDMATransferDesc::set_destination_address(::google::protobuf::int32 value) { + set_has_destination_address(); + destination_address_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.BDMATransferDesc.destination_address) +} + +// required uint32 line_size = 3; +inline bool BDMATransferDesc::has_line_size() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void BDMATransferDesc::set_has_line_size() { + _has_bits_[0] |= 0x00000004u; +} +inline void BDMATransferDesc::clear_has_line_size() { + _has_bits_[0] &= ~0x00000004u; +} +inline void BDMATransferDesc::clear_line_size() { + line_size_ = 0u; + clear_has_line_size(); +} +inline ::google::protobuf::uint32 BDMATransferDesc::line_size() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.BDMATransferDesc.line_size) + return line_size_; +} +inline void BDMATransferDesc::set_line_size(::google::protobuf::uint32 value) { + set_has_line_size(); + line_size_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.BDMATransferDesc.line_size) +} + +// required uint32 line_repeat = 4; +inline bool BDMATransferDesc::has_line_repeat() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void BDMATransferDesc::set_has_line_repeat() { + _has_bits_[0] |= 0x00000008u; +} +inline void BDMATransferDesc::clear_has_line_repeat() { + _has_bits_[0] &= ~0x00000008u; +} +inline void BDMATransferDesc::clear_line_repeat() { + line_repeat_ = 0u; + clear_has_line_repeat(); +} +inline ::google::protobuf::uint32 BDMATransferDesc::line_repeat() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.BDMATransferDesc.line_repeat) + return line_repeat_; +} +inline void BDMATransferDesc::set_line_repeat(::google::protobuf::uint32 value) { + set_has_line_repeat(); + line_repeat_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.BDMATransferDesc.line_repeat) +} + +// required uint32 source_line = 5; +inline bool BDMATransferDesc::has_source_line() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +inline void BDMATransferDesc::set_has_source_line() { + _has_bits_[0] |= 0x00000010u; +} +inline void BDMATransferDesc::clear_has_source_line() { + _has_bits_[0] &= ~0x00000010u; +} +inline void BDMATransferDesc::clear_source_line() { + source_line_ = 0u; + clear_has_source_line(); +} +inline ::google::protobuf::uint32 BDMATransferDesc::source_line() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.BDMATransferDesc.source_line) + return source_line_; +} +inline void BDMATransferDesc::set_source_line(::google::protobuf::uint32 value) { + set_has_source_line(); + source_line_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.BDMATransferDesc.source_line) +} + +// required uint32 destination_line = 6; +inline bool BDMATransferDesc::has_destination_line() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +inline void BDMATransferDesc::set_has_destination_line() { + _has_bits_[0] |= 0x00000020u; +} +inline void BDMATransferDesc::clear_has_destination_line() { + _has_bits_[0] &= ~0x00000020u; +} +inline void BDMATransferDesc::clear_destination_line() { + destination_line_ = 0u; + clear_has_destination_line(); +} +inline ::google::protobuf::uint32 BDMATransferDesc::destination_line() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.BDMATransferDesc.destination_line) + return destination_line_; +} +inline void BDMATransferDesc::set_destination_line(::google::protobuf::uint32 value) { + set_has_destination_line(); + destination_line_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.BDMATransferDesc.destination_line) +} + +// required uint32 surface_repeat = 7; +inline bool BDMATransferDesc::has_surface_repeat() const { + return (_has_bits_[0] & 0x00000040u) != 0; +} +inline void BDMATransferDesc::set_has_surface_repeat() { + _has_bits_[0] |= 0x00000040u; +} +inline void BDMATransferDesc::clear_has_surface_repeat() { + _has_bits_[0] &= ~0x00000040u; +} +inline void BDMATransferDesc::clear_surface_repeat() { + surface_repeat_ = 0u; + clear_has_surface_repeat(); +} +inline ::google::protobuf::uint32 BDMATransferDesc::surface_repeat() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.BDMATransferDesc.surface_repeat) + return surface_repeat_; +} +inline void BDMATransferDesc::set_surface_repeat(::google::protobuf::uint32 value) { + set_has_surface_repeat(); + surface_repeat_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.BDMATransferDesc.surface_repeat) +} + +// required uint32 source_surface = 8; +inline bool BDMATransferDesc::has_source_surface() const { + return (_has_bits_[0] & 0x00000080u) != 0; +} +inline void BDMATransferDesc::set_has_source_surface() { + _has_bits_[0] |= 0x00000080u; +} +inline void BDMATransferDesc::clear_has_source_surface() { + _has_bits_[0] &= ~0x00000080u; +} +inline void BDMATransferDesc::clear_source_surface() { + source_surface_ = 0u; + clear_has_source_surface(); +} +inline ::google::protobuf::uint32 BDMATransferDesc::source_surface() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.BDMATransferDesc.source_surface) + return source_surface_; +} +inline void BDMATransferDesc::set_source_surface(::google::protobuf::uint32 value) { + set_has_source_surface(); + source_surface_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.BDMATransferDesc.source_surface) +} + +// required uint32 destination_surface = 9; +inline bool BDMATransferDesc::has_destination_surface() const { + return (_has_bits_[0] & 0x00000100u) != 0; +} +inline void BDMATransferDesc::set_has_destination_surface() { + _has_bits_[0] |= 0x00000100u; +} +inline void BDMATransferDesc::clear_has_destination_surface() { + _has_bits_[0] &= ~0x00000100u; +} +inline void BDMATransferDesc::clear_destination_surface() { + destination_surface_ = 0u; + clear_has_destination_surface(); +} +inline ::google::protobuf::uint32 BDMATransferDesc::destination_surface() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.BDMATransferDesc.destination_surface) + return destination_surface_; +} +inline void BDMATransferDesc::set_destination_surface(::google::protobuf::uint32 value) { + set_has_destination_surface(); + destination_surface_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.BDMATransferDesc.destination_surface) +} + +// required .nvdla_prototest_interface.MemInfo src_mem_info = 10; +inline bool BDMATransferDesc::has_src_mem_info() const { + return (_has_bits_[0] & 0x00000200u) != 0; +} +inline void BDMATransferDesc::set_has_src_mem_info() { + _has_bits_[0] |= 0x00000200u; +} +inline void BDMATransferDesc::clear_has_src_mem_info() { + _has_bits_[0] &= ~0x00000200u; +} +inline void BDMATransferDesc::clear_src_mem_info() { + if (src_mem_info_ != NULL) src_mem_info_->::nvdla_prototest_interface::MemInfo::Clear(); + clear_has_src_mem_info(); +} +inline const ::nvdla_prototest_interface::MemInfo& BDMATransferDesc::src_mem_info() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.BDMATransferDesc.src_mem_info) + return src_mem_info_ != NULL ? *src_mem_info_ : *default_instance_->src_mem_info_; +} +inline ::nvdla_prototest_interface::MemInfo* BDMATransferDesc::mutable_src_mem_info() { + set_has_src_mem_info(); + if (src_mem_info_ == NULL) src_mem_info_ = new ::nvdla_prototest_interface::MemInfo; + // @@protoc_insertion_point(field_mutable:nvdla_prototest_interface.BDMATransferDesc.src_mem_info) + return src_mem_info_; +} +inline ::nvdla_prototest_interface::MemInfo* BDMATransferDesc::release_src_mem_info() { + clear_has_src_mem_info(); + ::nvdla_prototest_interface::MemInfo* temp = src_mem_info_; + src_mem_info_ = NULL; + return temp; +} +inline void BDMATransferDesc::set_allocated_src_mem_info(::nvdla_prototest_interface::MemInfo* src_mem_info) { + delete src_mem_info_; + src_mem_info_ = src_mem_info; + if (src_mem_info) { + set_has_src_mem_info(); + } else { + clear_has_src_mem_info(); + } + // @@protoc_insertion_point(field_set_allocated:nvdla_prototest_interface.BDMATransferDesc.src_mem_info) +} + +// required .nvdla_prototest_interface.MemInfo dst_mem_info = 11; +inline bool BDMATransferDesc::has_dst_mem_info() const { + return (_has_bits_[0] & 0x00000400u) != 0; +} +inline void BDMATransferDesc::set_has_dst_mem_info() { + _has_bits_[0] |= 0x00000400u; +} +inline void BDMATransferDesc::clear_has_dst_mem_info() { + _has_bits_[0] &= ~0x00000400u; +} +inline void BDMATransferDesc::clear_dst_mem_info() { + if (dst_mem_info_ != NULL) dst_mem_info_->::nvdla_prototest_interface::MemInfo::Clear(); + clear_has_dst_mem_info(); +} +inline const ::nvdla_prototest_interface::MemInfo& BDMATransferDesc::dst_mem_info() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.BDMATransferDesc.dst_mem_info) + return dst_mem_info_ != NULL ? *dst_mem_info_ : *default_instance_->dst_mem_info_; +} +inline ::nvdla_prototest_interface::MemInfo* BDMATransferDesc::mutable_dst_mem_info() { + set_has_dst_mem_info(); + if (dst_mem_info_ == NULL) dst_mem_info_ = new ::nvdla_prototest_interface::MemInfo; + // @@protoc_insertion_point(field_mutable:nvdla_prototest_interface.BDMATransferDesc.dst_mem_info) + return dst_mem_info_; +} +inline ::nvdla_prototest_interface::MemInfo* BDMATransferDesc::release_dst_mem_info() { + clear_has_dst_mem_info(); + ::nvdla_prototest_interface::MemInfo* temp = dst_mem_info_; + dst_mem_info_ = NULL; + return temp; +} +inline void BDMATransferDesc::set_allocated_dst_mem_info(::nvdla_prototest_interface::MemInfo* dst_mem_info) { + delete dst_mem_info_; + dst_mem_info_ = dst_mem_info; + if (dst_mem_info) { + set_has_dst_mem_info(); + } else { + clear_has_dst_mem_info(); + } + // @@protoc_insertion_point(field_set_allocated:nvdla_prototest_interface.BDMATransferDesc.dst_mem_info) +} + +// ------------------------------------------------------------------- + +// BDMASurfaceDesc + +// required .nvdla_prototest_interface.MemType source_type = 1; +inline bool BDMASurfaceDesc::has_source_type() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void BDMASurfaceDesc::set_has_source_type() { + _has_bits_[0] |= 0x00000001u; +} +inline void BDMASurfaceDesc::clear_has_source_type() { + _has_bits_[0] &= ~0x00000001u; +} +inline void BDMASurfaceDesc::clear_source_type() { + source_type_ = 0; + clear_has_source_type(); +} +inline ::nvdla_prototest_interface::MemType BDMASurfaceDesc::source_type() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.BDMASurfaceDesc.source_type) + return static_cast< ::nvdla_prototest_interface::MemType >(source_type_); +} +inline void BDMASurfaceDesc::set_source_type(::nvdla_prototest_interface::MemType value) { + assert(::nvdla_prototest_interface::MemType_IsValid(value)); + set_has_source_type(); + source_type_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.BDMASurfaceDesc.source_type) +} + +// required .nvdla_prototest_interface.MemType destination_type = 2; +inline bool BDMASurfaceDesc::has_destination_type() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void BDMASurfaceDesc::set_has_destination_type() { + _has_bits_[0] |= 0x00000002u; +} +inline void BDMASurfaceDesc::clear_has_destination_type() { + _has_bits_[0] &= ~0x00000002u; +} +inline void BDMASurfaceDesc::clear_destination_type() { + destination_type_ = 0; + clear_has_destination_type(); +} +inline ::nvdla_prototest_interface::MemType BDMASurfaceDesc::destination_type() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.BDMASurfaceDesc.destination_type) + return static_cast< ::nvdla_prototest_interface::MemType >(destination_type_); +} +inline void BDMASurfaceDesc::set_destination_type(::nvdla_prototest_interface::MemType value) { + assert(::nvdla_prototest_interface::MemType_IsValid(value)); + set_has_destination_type(); + destination_type_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.BDMASurfaceDesc.destination_type) +} + +// required uint32 num_transfers = 3; +inline bool BDMASurfaceDesc::has_num_transfers() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void BDMASurfaceDesc::set_has_num_transfers() { + _has_bits_[0] |= 0x00000004u; +} +inline void BDMASurfaceDesc::clear_has_num_transfers() { + _has_bits_[0] &= ~0x00000004u; +} +inline void BDMASurfaceDesc::clear_num_transfers() { + num_transfers_ = 0u; + clear_has_num_transfers(); +} +inline ::google::protobuf::uint32 BDMASurfaceDesc::num_transfers() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.BDMASurfaceDesc.num_transfers) + return num_transfers_; +} +inline void BDMASurfaceDesc::set_num_transfers(::google::protobuf::uint32 value) { + set_has_num_transfers(); + num_transfers_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.BDMASurfaceDesc.num_transfers) +} + +// repeated .nvdla_prototest_interface.BDMATransferDesc transfers = 4; +inline int BDMASurfaceDesc::transfers_size() const { + return transfers_.size(); +} +inline void BDMASurfaceDesc::clear_transfers() { + transfers_.Clear(); +} +inline const ::nvdla_prototest_interface::BDMATransferDesc& BDMASurfaceDesc::transfers(int index) const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.BDMASurfaceDesc.transfers) + return transfers_.Get(index); +} +inline ::nvdla_prototest_interface::BDMATransferDesc* BDMASurfaceDesc::mutable_transfers(int index) { + // @@protoc_insertion_point(field_mutable:nvdla_prototest_interface.BDMASurfaceDesc.transfers) + return transfers_.Mutable(index); +} +inline ::nvdla_prototest_interface::BDMATransferDesc* BDMASurfaceDesc::add_transfers() { + // @@protoc_insertion_point(field_add:nvdla_prototest_interface.BDMASurfaceDesc.transfers) + return transfers_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::nvdla_prototest_interface::BDMATransferDesc >& +BDMASurfaceDesc::transfers() const { + // @@protoc_insertion_point(field_list:nvdla_prototest_interface.BDMASurfaceDesc.transfers) + return transfers_; +} +inline ::google::protobuf::RepeatedPtrField< ::nvdla_prototest_interface::BDMATransferDesc >* +BDMASurfaceDesc::mutable_transfers() { + // @@protoc_insertion_point(field_mutable_list:nvdla_prototest_interface.BDMASurfaceDesc.transfers) + return &transfers_; +} + +// ------------------------------------------------------------------- + +// BDMAOpDesc + +// required uint32 num_transfers = 1; +inline bool BDMAOpDesc::has_num_transfers() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void BDMAOpDesc::set_has_num_transfers() { + _has_bits_[0] |= 0x00000001u; +} +inline void BDMAOpDesc::clear_has_num_transfers() { + _has_bits_[0] &= ~0x00000001u; +} +inline void BDMAOpDesc::clear_num_transfers() { + num_transfers_ = 0u; + clear_has_num_transfers(); +} +inline ::google::protobuf::uint32 BDMAOpDesc::num_transfers() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.BDMAOpDesc.num_transfers) + return num_transfers_; +} +inline void BDMAOpDesc::set_num_transfers(::google::protobuf::uint32 value) { + set_has_num_transfers(); + num_transfers_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.BDMAOpDesc.num_transfers) +} + +// optional uint32 reserved0 = 2 [default = 0]; +inline bool BDMAOpDesc::has_reserved0() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void BDMAOpDesc::set_has_reserved0() { + _has_bits_[0] |= 0x00000002u; +} +inline void BDMAOpDesc::clear_has_reserved0() { + _has_bits_[0] &= ~0x00000002u; +} +inline void BDMAOpDesc::clear_reserved0() { + reserved0_ = 0u; + clear_has_reserved0(); +} +inline ::google::protobuf::uint32 BDMAOpDesc::reserved0() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.BDMAOpDesc.reserved0) + return reserved0_; +} +inline void BDMAOpDesc::set_reserved0(::google::protobuf::uint32 value) { + set_has_reserved0(); + reserved0_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.BDMAOpDesc.reserved0) +} + +// ------------------------------------------------------------------- + +// CVTParam + +// required int32 scale = 1; +inline bool CVTParam::has_scale() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void CVTParam::set_has_scale() { + _has_bits_[0] |= 0x00000001u; +} +inline void CVTParam::clear_has_scale() { + _has_bits_[0] &= ~0x00000001u; +} +inline void CVTParam::clear_scale() { + scale_ = 0; + clear_has_scale(); +} +inline ::google::protobuf::int32 CVTParam::scale() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CVTParam.scale) + return scale_; +} +inline void CVTParam::set_scale(::google::protobuf::int32 value) { + set_has_scale(); + scale_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.CVTParam.scale) +} + +// required uint32 truncate = 2; +inline bool CVTParam::has_truncate() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void CVTParam::set_has_truncate() { + _has_bits_[0] |= 0x00000002u; +} +inline void CVTParam::clear_has_truncate() { + _has_bits_[0] &= ~0x00000002u; +} +inline void CVTParam::clear_truncate() { + truncate_ = 0u; + clear_has_truncate(); +} +inline ::google::protobuf::uint32 CVTParam::truncate() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CVTParam.truncate) + return truncate_; +} +inline void CVTParam::set_truncate(::google::protobuf::uint32 value) { + set_has_truncate(); + truncate_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.CVTParam.truncate) +} + +// required uint32 enable = 3; +inline bool CVTParam::has_enable() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void CVTParam::set_has_enable() { + _has_bits_[0] |= 0x00000004u; +} +inline void CVTParam::clear_has_enable() { + _has_bits_[0] &= ~0x00000004u; +} +inline void CVTParam::clear_enable() { + enable_ = 0u; + clear_has_enable(); +} +inline ::google::protobuf::uint32 CVTParam::enable() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CVTParam.enable) + return enable_; +} +inline void CVTParam::set_enable(::google::protobuf::uint32 value) { + set_has_enable(); + enable_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.CVTParam.enable) +} + +// required int32 offset = 4; +inline bool CVTParam::has_offset() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void CVTParam::set_has_offset() { + _has_bits_[0] |= 0x00000008u; +} +inline void CVTParam::clear_has_offset() { + _has_bits_[0] &= ~0x00000008u; +} +inline void CVTParam::clear_offset() { + offset_ = 0; + clear_has_offset(); +} +inline ::google::protobuf::int32 CVTParam::offset() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CVTParam.offset) + return offset_; +} +inline void CVTParam::set_offset(::google::protobuf::int32 value) { + set_has_offset(); + offset_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.CVTParam.offset) +} + +// ------------------------------------------------------------------- + +// MemInfo + +// required int32 mem_id = 1 [default = -1]; +inline bool MemInfo::has_mem_id() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void MemInfo::set_has_mem_id() { + _has_bits_[0] |= 0x00000001u; +} +inline void MemInfo::clear_has_mem_id() { + _has_bits_[0] &= ~0x00000001u; +} +inline void MemInfo::clear_mem_id() { + mem_id_ = -1; + clear_has_mem_id(); +} +inline ::google::protobuf::int32 MemInfo::mem_id() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.MemInfo.mem_id) + return mem_id_; +} +inline void MemInfo::set_mem_id(::google::protobuf::int32 value) { + set_has_mem_id(); + mem_id_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.MemInfo.mem_id) +} + +// required uint32 mem_size = 2 [default = 0]; +inline bool MemInfo::has_mem_size() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void MemInfo::set_has_mem_size() { + _has_bits_[0] |= 0x00000002u; +} +inline void MemInfo::clear_has_mem_size() { + _has_bits_[0] &= ~0x00000002u; +} +inline void MemInfo::clear_mem_size() { + mem_size_ = 0u; + clear_has_mem_size(); +} +inline ::google::protobuf::uint32 MemInfo::mem_size() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.MemInfo.mem_size) + return mem_size_; +} +inline void MemInfo::set_mem_size(::google::protobuf::uint32 value) { + set_has_mem_size(); + mem_size_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.MemInfo.mem_size) +} + +// required uint32 offset = 3 [default = 0]; +inline bool MemInfo::has_offset() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void MemInfo::set_has_offset() { + _has_bits_[0] |= 0x00000004u; +} +inline void MemInfo::clear_has_offset() { + _has_bits_[0] &= ~0x00000004u; +} +inline void MemInfo::clear_offset() { + offset_ = 0u; + clear_has_offset(); +} +inline ::google::protobuf::uint32 MemInfo::offset() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.MemInfo.offset) + return offset_; +} +inline void MemInfo::set_offset(::google::protobuf::uint32 value) { + set_has_offset(); + offset_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.MemInfo.offset) +} + +// optional .nvdla_prototest_interface.FillerType fill_type = 4 [default = FILL_NONE]; +inline bool MemInfo::has_fill_type() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void MemInfo::set_has_fill_type() { + _has_bits_[0] |= 0x00000008u; +} +inline void MemInfo::clear_has_fill_type() { + _has_bits_[0] &= ~0x00000008u; +} +inline void MemInfo::clear_fill_type() { + fill_type_ = 0; + clear_has_fill_type(); +} +inline ::nvdla_prototest_interface::FillerType MemInfo::fill_type() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.MemInfo.fill_type) + return static_cast< ::nvdla_prototest_interface::FillerType >(fill_type_); +} +inline void MemInfo::set_fill_type(::nvdla_prototest_interface::FillerType value) { + assert(::nvdla_prototest_interface::FillerType_IsValid(value)); + set_has_fill_type(); + fill_type_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.MemInfo.fill_type) +} + +// optional .nvdla_prototest_interface.DataFiller filler = 5; +inline bool MemInfo::has_filler() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +inline void MemInfo::set_has_filler() { + _has_bits_[0] |= 0x00000010u; +} +inline void MemInfo::clear_has_filler() { + _has_bits_[0] &= ~0x00000010u; +} +inline void MemInfo::clear_filler() { + if (filler_ != NULL) filler_->::nvdla_prototest_interface::DataFiller::Clear(); + clear_has_filler(); +} +inline const ::nvdla_prototest_interface::DataFiller& MemInfo::filler() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.MemInfo.filler) + return filler_ != NULL ? *filler_ : *default_instance_->filler_; +} +inline ::nvdla_prototest_interface::DataFiller* MemInfo::mutable_filler() { + set_has_filler(); + if (filler_ == NULL) filler_ = new ::nvdla_prototest_interface::DataFiller; + // @@protoc_insertion_point(field_mutable:nvdla_prototest_interface.MemInfo.filler) + return filler_; +} +inline ::nvdla_prototest_interface::DataFiller* MemInfo::release_filler() { + clear_has_filler(); + ::nvdla_prototest_interface::DataFiller* temp = filler_; + filler_ = NULL; + return temp; +} +inline void MemInfo::set_allocated_filler(::nvdla_prototest_interface::DataFiller* filler) { + delete filler_; + filler_ = filler; + if (filler) { + set_has_filler(); + } else { + clear_has_filler(); + } + // @@protoc_insertion_point(field_set_allocated:nvdla_prototest_interface.MemInfo.filler) +} + +// optional .nvdla_prototest_interface.MemFlag flag = 6 [default = DLA_MEM_ALLOC]; +inline bool MemInfo::has_flag() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +inline void MemInfo::set_has_flag() { + _has_bits_[0] |= 0x00000020u; +} +inline void MemInfo::clear_has_flag() { + _has_bits_[0] &= ~0x00000020u; +} +inline void MemInfo::clear_flag() { + flag_ = 0; + clear_has_flag(); +} +inline ::nvdla_prototest_interface::MemFlag MemInfo::flag() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.MemInfo.flag) + return static_cast< ::nvdla_prototest_interface::MemFlag >(flag_); +} +inline void MemInfo::set_flag(::nvdla_prototest_interface::MemFlag value) { + assert(::nvdla_prototest_interface::MemFlag_IsValid(value)); + set_has_flag(); + flag_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.MemInfo.flag) +} + +// optional .nvdla_prototest_interface.DataPrecision precision = 7 [default = PRECISION_INT8]; +inline bool MemInfo::has_precision() const { + return (_has_bits_[0] & 0x00000040u) != 0; +} +inline void MemInfo::set_has_precision() { + _has_bits_[0] |= 0x00000040u; +} +inline void MemInfo::clear_has_precision() { + _has_bits_[0] &= ~0x00000040u; +} +inline void MemInfo::clear_precision() { + precision_ = 0; + clear_has_precision(); +} +inline ::nvdla_prototest_interface::DataPrecision MemInfo::precision() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.MemInfo.precision) + return static_cast< ::nvdla_prototest_interface::DataPrecision >(precision_); +} +inline void MemInfo::set_precision(::nvdla_prototest_interface::DataPrecision value) { + assert(::nvdla_prototest_interface::DataPrecision_IsValid(value)); + set_has_precision(); + precision_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.MemInfo.precision) +} + +// optional uint32 sw_dilation_x = 8 [default = 1]; +inline bool MemInfo::has_sw_dilation_x() const { + return (_has_bits_[0] & 0x00000080u) != 0; +} +inline void MemInfo::set_has_sw_dilation_x() { + _has_bits_[0] |= 0x00000080u; +} +inline void MemInfo::clear_has_sw_dilation_x() { + _has_bits_[0] &= ~0x00000080u; +} +inline void MemInfo::clear_sw_dilation_x() { + sw_dilation_x_ = 1u; + clear_has_sw_dilation_x(); +} +inline ::google::protobuf::uint32 MemInfo::sw_dilation_x() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.MemInfo.sw_dilation_x) + return sw_dilation_x_; +} +inline void MemInfo::set_sw_dilation_x(::google::protobuf::uint32 value) { + set_has_sw_dilation_x(); + sw_dilation_x_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.MemInfo.sw_dilation_x) +} + +// optional uint32 sw_dilation_y = 9 [default = 1]; +inline bool MemInfo::has_sw_dilation_y() const { + return (_has_bits_[0] & 0x00000100u) != 0; +} +inline void MemInfo::set_has_sw_dilation_y() { + _has_bits_[0] |= 0x00000100u; +} +inline void MemInfo::clear_has_sw_dilation_y() { + _has_bits_[0] &= ~0x00000100u; +} +inline void MemInfo::clear_sw_dilation_y() { + sw_dilation_y_ = 1u; + clear_has_sw_dilation_y(); +} +inline ::google::protobuf::uint32 MemInfo::sw_dilation_y() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.MemInfo.sw_dilation_y) + return sw_dilation_y_; +} +inline void MemInfo::set_sw_dilation_y(::google::protobuf::uint32 value) { + set_has_sw_dilation_y(); + sw_dilation_y_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.MemInfo.sw_dilation_y) +} + +// ------------------------------------------------------------------- + +// DataCube + +// optional uint32 reserved0 = 1 [default = 0]; +inline bool DataCube::has_reserved0() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void DataCube::set_has_reserved0() { + _has_bits_[0] |= 0x00000001u; +} +inline void DataCube::clear_has_reserved0() { + _has_bits_[0] &= ~0x00000001u; +} +inline void DataCube::clear_reserved0() { + reserved0_ = 0u; + clear_has_reserved0(); +} +inline ::google::protobuf::uint32 DataCube::reserved0() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.DataCube.reserved0) + return reserved0_; +} +inline void DataCube::set_reserved0(::google::protobuf::uint32 value) { + set_has_reserved0(); + reserved0_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.DataCube.reserved0) +} + +// required .nvdla_prototest_interface.MemType type = 2; +inline bool DataCube::has_type() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void DataCube::set_has_type() { + _has_bits_[0] |= 0x00000002u; +} +inline void DataCube::clear_has_type() { + _has_bits_[0] &= ~0x00000002u; +} +inline void DataCube::clear_type() { + type_ = 0; + clear_has_type(); +} +inline ::nvdla_prototest_interface::MemType DataCube::type() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.DataCube.type) + return static_cast< ::nvdla_prototest_interface::MemType >(type_); +} +inline void DataCube::set_type(::nvdla_prototest_interface::MemType value) { + assert(::nvdla_prototest_interface::MemType_IsValid(value)); + set_has_type(); + type_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.DataCube.type) +} + +// required int32 address = 3; +inline bool DataCube::has_address() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void DataCube::set_has_address() { + _has_bits_[0] |= 0x00000004u; +} +inline void DataCube::clear_has_address() { + _has_bits_[0] &= ~0x00000004u; +} +inline void DataCube::clear_address() { + address_ = 0; + clear_has_address(); +} +inline ::google::protobuf::int32 DataCube::address() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.DataCube.address) + return address_; +} +inline void DataCube::set_address(::google::protobuf::int32 value) { + set_has_address(); + address_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.DataCube.address) +} + +// required uint32 size = 4; +inline bool DataCube::has_size() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void DataCube::set_has_size() { + _has_bits_[0] |= 0x00000008u; +} +inline void DataCube::clear_has_size() { + _has_bits_[0] &= ~0x00000008u; +} +inline void DataCube::clear_size() { + size_ = 0u; + clear_has_size(); +} +inline ::google::protobuf::uint32 DataCube::size() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.DataCube.size) + return size_; +} +inline void DataCube::set_size(::google::protobuf::uint32 value) { + set_has_size(); + size_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.DataCube.size) +} + +// required uint32 width = 5; +inline bool DataCube::has_width() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +inline void DataCube::set_has_width() { + _has_bits_[0] |= 0x00000010u; +} +inline void DataCube::clear_has_width() { + _has_bits_[0] &= ~0x00000010u; +} +inline void DataCube::clear_width() { + width_ = 0u; + clear_has_width(); +} +inline ::google::protobuf::uint32 DataCube::width() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.DataCube.width) + return width_; +} +inline void DataCube::set_width(::google::protobuf::uint32 value) { + set_has_width(); + width_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.DataCube.width) +} + +// required uint32 height = 6; +inline bool DataCube::has_height() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +inline void DataCube::set_has_height() { + _has_bits_[0] |= 0x00000020u; +} +inline void DataCube::clear_has_height() { + _has_bits_[0] &= ~0x00000020u; +} +inline void DataCube::clear_height() { + height_ = 0u; + clear_has_height(); +} +inline ::google::protobuf::uint32 DataCube::height() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.DataCube.height) + return height_; +} +inline void DataCube::set_height(::google::protobuf::uint32 value) { + set_has_height(); + height_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.DataCube.height) +} + +// required uint32 channel = 7; +inline bool DataCube::has_channel() const { + return (_has_bits_[0] & 0x00000040u) != 0; +} +inline void DataCube::set_has_channel() { + _has_bits_[0] |= 0x00000040u; +} +inline void DataCube::clear_has_channel() { + _has_bits_[0] &= ~0x00000040u; +} +inline void DataCube::clear_channel() { + channel_ = 0u; + clear_has_channel(); +} +inline ::google::protobuf::uint32 DataCube::channel() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.DataCube.channel) + return channel_; +} +inline void DataCube::set_channel(::google::protobuf::uint32 value) { + set_has_channel(); + channel_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.DataCube.channel) +} + +// optional uint32 reserved1 = 8 [default = 0]; +inline bool DataCube::has_reserved1() const { + return (_has_bits_[0] & 0x00000080u) != 0; +} +inline void DataCube::set_has_reserved1() { + _has_bits_[0] |= 0x00000080u; +} +inline void DataCube::clear_has_reserved1() { + _has_bits_[0] &= ~0x00000080u; +} +inline void DataCube::clear_reserved1() { + reserved1_ = 0u; + clear_has_reserved1(); +} +inline ::google::protobuf::uint32 DataCube::reserved1() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.DataCube.reserved1) + return reserved1_; +} +inline void DataCube::set_reserved1(::google::protobuf::uint32 value) { + set_has_reserved1(); + reserved1_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.DataCube.reserved1) +} + +// required uint32 line_stride = 9; +inline bool DataCube::has_line_stride() const { + return (_has_bits_[0] & 0x00000100u) != 0; +} +inline void DataCube::set_has_line_stride() { + _has_bits_[0] |= 0x00000100u; +} +inline void DataCube::clear_has_line_stride() { + _has_bits_[0] &= ~0x00000100u; +} +inline void DataCube::clear_line_stride() { + line_stride_ = 0u; + clear_has_line_stride(); +} +inline ::google::protobuf::uint32 DataCube::line_stride() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.DataCube.line_stride) + return line_stride_; +} +inline void DataCube::set_line_stride(::google::protobuf::uint32 value) { + set_has_line_stride(); + line_stride_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.DataCube.line_stride) +} + +// required uint32 surf_stride = 10; +inline bool DataCube::has_surf_stride() const { + return (_has_bits_[0] & 0x00000200u) != 0; +} +inline void DataCube::set_has_surf_stride() { + _has_bits_[0] |= 0x00000200u; +} +inline void DataCube::clear_has_surf_stride() { + _has_bits_[0] &= ~0x00000200u; +} +inline void DataCube::clear_surf_stride() { + surf_stride_ = 0u; + clear_has_surf_stride(); +} +inline ::google::protobuf::uint32 DataCube::surf_stride() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.DataCube.surf_stride) + return surf_stride_; +} +inline void DataCube::set_surf_stride(::google::protobuf::uint32 value) { + set_has_surf_stride(); + surf_stride_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.DataCube.surf_stride) +} + +// required uint32 plane_stride = 11; +inline bool DataCube::has_plane_stride() const { + return (_has_bits_[0] & 0x00000400u) != 0; +} +inline void DataCube::set_has_plane_stride() { + _has_bits_[0] |= 0x00000400u; +} +inline void DataCube::clear_has_plane_stride() { + _has_bits_[0] &= ~0x00000400u; +} +inline void DataCube::clear_plane_stride() { + plane_stride_ = 0u; + clear_has_plane_stride(); +} +inline ::google::protobuf::uint32 DataCube::plane_stride() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.DataCube.plane_stride) + return plane_stride_; +} +inline void DataCube::set_plane_stride(::google::protobuf::uint32 value) { + set_has_plane_stride(); + plane_stride_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.DataCube.plane_stride) +} + +// required .nvdla_prototest_interface.MemInfo mem_info = 12; +inline bool DataCube::has_mem_info() const { + return (_has_bits_[0] & 0x00000800u) != 0; +} +inline void DataCube::set_has_mem_info() { + _has_bits_[0] |= 0x00000800u; +} +inline void DataCube::clear_has_mem_info() { + _has_bits_[0] &= ~0x00000800u; +} +inline void DataCube::clear_mem_info() { + if (mem_info_ != NULL) mem_info_->::nvdla_prototest_interface::MemInfo::Clear(); + clear_has_mem_info(); +} +inline const ::nvdla_prototest_interface::MemInfo& DataCube::mem_info() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.DataCube.mem_info) + return mem_info_ != NULL ? *mem_info_ : *default_instance_->mem_info_; +} +inline ::nvdla_prototest_interface::MemInfo* DataCube::mutable_mem_info() { + set_has_mem_info(); + if (mem_info_ == NULL) mem_info_ = new ::nvdla_prototest_interface::MemInfo; + // @@protoc_insertion_point(field_mutable:nvdla_prototest_interface.DataCube.mem_info) + return mem_info_; +} +inline ::nvdla_prototest_interface::MemInfo* DataCube::release_mem_info() { + clear_has_mem_info(); + ::nvdla_prototest_interface::MemInfo* temp = mem_info_; + mem_info_ = NULL; + return temp; +} +inline void DataCube::set_allocated_mem_info(::nvdla_prototest_interface::MemInfo* mem_info) { + delete mem_info_; + mem_info_ = mem_info; + if (mem_info) { + set_has_mem_info(); + } else { + clear_has_mem_info(); + } + // @@protoc_insertion_point(field_set_allocated:nvdla_prototest_interface.DataCube.mem_info) +} + +// ------------------------------------------------------------------- + +// CONVSurfaceDesc + +// required .nvdla_prototest_interface.DataCube weight_data = 1; +inline bool CONVSurfaceDesc::has_weight_data() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void CONVSurfaceDesc::set_has_weight_data() { + _has_bits_[0] |= 0x00000001u; +} +inline void CONVSurfaceDesc::clear_has_weight_data() { + _has_bits_[0] &= ~0x00000001u; +} +inline void CONVSurfaceDesc::clear_weight_data() { + if (weight_data_ != NULL) weight_data_->::nvdla_prototest_interface::DataCube::Clear(); + clear_has_weight_data(); +} +inline const ::nvdla_prototest_interface::DataCube& CONVSurfaceDesc::weight_data() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CONVSurfaceDesc.weight_data) + return weight_data_ != NULL ? *weight_data_ : *default_instance_->weight_data_; +} +inline ::nvdla_prototest_interface::DataCube* CONVSurfaceDesc::mutable_weight_data() { + set_has_weight_data(); + if (weight_data_ == NULL) weight_data_ = new ::nvdla_prototest_interface::DataCube; + // @@protoc_insertion_point(field_mutable:nvdla_prototest_interface.CONVSurfaceDesc.weight_data) + return weight_data_; +} +inline ::nvdla_prototest_interface::DataCube* CONVSurfaceDesc::release_weight_data() { + clear_has_weight_data(); + ::nvdla_prototest_interface::DataCube* temp = weight_data_; + weight_data_ = NULL; + return temp; +} +inline void CONVSurfaceDesc::set_allocated_weight_data(::nvdla_prototest_interface::DataCube* weight_data) { + delete weight_data_; + weight_data_ = weight_data; + if (weight_data) { + set_has_weight_data(); + } else { + clear_has_weight_data(); + } + // @@protoc_insertion_point(field_set_allocated:nvdla_prototest_interface.CONVSurfaceDesc.weight_data) +} + +// optional .nvdla_prototest_interface.DataCube wmb_data = 2; +inline bool CONVSurfaceDesc::has_wmb_data() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void CONVSurfaceDesc::set_has_wmb_data() { + _has_bits_[0] |= 0x00000002u; +} +inline void CONVSurfaceDesc::clear_has_wmb_data() { + _has_bits_[0] &= ~0x00000002u; +} +inline void CONVSurfaceDesc::clear_wmb_data() { + if (wmb_data_ != NULL) wmb_data_->::nvdla_prototest_interface::DataCube::Clear(); + clear_has_wmb_data(); +} +inline const ::nvdla_prototest_interface::DataCube& CONVSurfaceDesc::wmb_data() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CONVSurfaceDesc.wmb_data) + return wmb_data_ != NULL ? *wmb_data_ : *default_instance_->wmb_data_; +} +inline ::nvdla_prototest_interface::DataCube* CONVSurfaceDesc::mutable_wmb_data() { + set_has_wmb_data(); + if (wmb_data_ == NULL) wmb_data_ = new ::nvdla_prototest_interface::DataCube; + // @@protoc_insertion_point(field_mutable:nvdla_prototest_interface.CONVSurfaceDesc.wmb_data) + return wmb_data_; +} +inline ::nvdla_prototest_interface::DataCube* CONVSurfaceDesc::release_wmb_data() { + clear_has_wmb_data(); + ::nvdla_prototest_interface::DataCube* temp = wmb_data_; + wmb_data_ = NULL; + return temp; +} +inline void CONVSurfaceDesc::set_allocated_wmb_data(::nvdla_prototest_interface::DataCube* wmb_data) { + delete wmb_data_; + wmb_data_ = wmb_data; + if (wmb_data) { + set_has_wmb_data(); + } else { + clear_has_wmb_data(); + } + // @@protoc_insertion_point(field_set_allocated:nvdla_prototest_interface.CONVSurfaceDesc.wmb_data) +} + +// optional .nvdla_prototest_interface.DataCube wgs_data = 3; +inline bool CONVSurfaceDesc::has_wgs_data() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void CONVSurfaceDesc::set_has_wgs_data() { + _has_bits_[0] |= 0x00000004u; +} +inline void CONVSurfaceDesc::clear_has_wgs_data() { + _has_bits_[0] &= ~0x00000004u; +} +inline void CONVSurfaceDesc::clear_wgs_data() { + if (wgs_data_ != NULL) wgs_data_->::nvdla_prototest_interface::DataCube::Clear(); + clear_has_wgs_data(); +} +inline const ::nvdla_prototest_interface::DataCube& CONVSurfaceDesc::wgs_data() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CONVSurfaceDesc.wgs_data) + return wgs_data_ != NULL ? *wgs_data_ : *default_instance_->wgs_data_; +} +inline ::nvdla_prototest_interface::DataCube* CONVSurfaceDesc::mutable_wgs_data() { + set_has_wgs_data(); + if (wgs_data_ == NULL) wgs_data_ = new ::nvdla_prototest_interface::DataCube; + // @@protoc_insertion_point(field_mutable:nvdla_prototest_interface.CONVSurfaceDesc.wgs_data) + return wgs_data_; +} +inline ::nvdla_prototest_interface::DataCube* CONVSurfaceDesc::release_wgs_data() { + clear_has_wgs_data(); + ::nvdla_prototest_interface::DataCube* temp = wgs_data_; + wgs_data_ = NULL; + return temp; +} +inline void CONVSurfaceDesc::set_allocated_wgs_data(::nvdla_prototest_interface::DataCube* wgs_data) { + delete wgs_data_; + wgs_data_ = wgs_data; + if (wgs_data) { + set_has_wgs_data(); + } else { + clear_has_wgs_data(); + } + // @@protoc_insertion_point(field_set_allocated:nvdla_prototest_interface.CONVSurfaceDesc.wgs_data) +} + +// required .nvdla_prototest_interface.DataCube src_data = 4; +inline bool CONVSurfaceDesc::has_src_data() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void CONVSurfaceDesc::set_has_src_data() { + _has_bits_[0] |= 0x00000008u; +} +inline void CONVSurfaceDesc::clear_has_src_data() { + _has_bits_[0] &= ~0x00000008u; +} +inline void CONVSurfaceDesc::clear_src_data() { + if (src_data_ != NULL) src_data_->::nvdla_prototest_interface::DataCube::Clear(); + clear_has_src_data(); +} +inline const ::nvdla_prototest_interface::DataCube& CONVSurfaceDesc::src_data() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CONVSurfaceDesc.src_data) + return src_data_ != NULL ? *src_data_ : *default_instance_->src_data_; +} +inline ::nvdla_prototest_interface::DataCube* CONVSurfaceDesc::mutable_src_data() { + set_has_src_data(); + if (src_data_ == NULL) src_data_ = new ::nvdla_prototest_interface::DataCube; + // @@protoc_insertion_point(field_mutable:nvdla_prototest_interface.CONVSurfaceDesc.src_data) + return src_data_; +} +inline ::nvdla_prototest_interface::DataCube* CONVSurfaceDesc::release_src_data() { + clear_has_src_data(); + ::nvdla_prototest_interface::DataCube* temp = src_data_; + src_data_ = NULL; + return temp; +} +inline void CONVSurfaceDesc::set_allocated_src_data(::nvdla_prototest_interface::DataCube* src_data) { + delete src_data_; + src_data_ = src_data; + if (src_data) { + set_has_src_data(); + } else { + clear_has_src_data(); + } + // @@protoc_insertion_point(field_set_allocated:nvdla_prototest_interface.CONVSurfaceDesc.src_data) +} + +// required .nvdla_prototest_interface.DataCube dst_data = 5; +inline bool CONVSurfaceDesc::has_dst_data() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +inline void CONVSurfaceDesc::set_has_dst_data() { + _has_bits_[0] |= 0x00000010u; +} +inline void CONVSurfaceDesc::clear_has_dst_data() { + _has_bits_[0] &= ~0x00000010u; +} +inline void CONVSurfaceDesc::clear_dst_data() { + if (dst_data_ != NULL) dst_data_->::nvdla_prototest_interface::DataCube::Clear(); + clear_has_dst_data(); +} +inline const ::nvdla_prototest_interface::DataCube& CONVSurfaceDesc::dst_data() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CONVSurfaceDesc.dst_data) + return dst_data_ != NULL ? *dst_data_ : *default_instance_->dst_data_; +} +inline ::nvdla_prototest_interface::DataCube* CONVSurfaceDesc::mutable_dst_data() { + set_has_dst_data(); + if (dst_data_ == NULL) dst_data_ = new ::nvdla_prototest_interface::DataCube; + // @@protoc_insertion_point(field_mutable:nvdla_prototest_interface.CONVSurfaceDesc.dst_data) + return dst_data_; +} +inline ::nvdla_prototest_interface::DataCube* CONVSurfaceDesc::release_dst_data() { + clear_has_dst_data(); + ::nvdla_prototest_interface::DataCube* temp = dst_data_; + dst_data_ = NULL; + return temp; +} +inline void CONVSurfaceDesc::set_allocated_dst_data(::nvdla_prototest_interface::DataCube* dst_data) { + delete dst_data_; + dst_data_ = dst_data; + if (dst_data) { + set_has_dst_data(); + } else { + clear_has_dst_data(); + } + // @@protoc_insertion_point(field_set_allocated:nvdla_prototest_interface.CONVSurfaceDesc.dst_data) +} + +// required int64 offset_u = 6; +inline bool CONVSurfaceDesc::has_offset_u() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +inline void CONVSurfaceDesc::set_has_offset_u() { + _has_bits_[0] |= 0x00000020u; +} +inline void CONVSurfaceDesc::clear_has_offset_u() { + _has_bits_[0] &= ~0x00000020u; +} +inline void CONVSurfaceDesc::clear_offset_u() { + offset_u_ = GOOGLE_LONGLONG(0); + clear_has_offset_u(); +} +inline ::google::protobuf::int64 CONVSurfaceDesc::offset_u() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CONVSurfaceDesc.offset_u) + return offset_u_; +} +inline void CONVSurfaceDesc::set_offset_u(::google::protobuf::int64 value) { + set_has_offset_u(); + offset_u_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.CONVSurfaceDesc.offset_u) +} + +// required uint32 in_line_uv_stride = 7; +inline bool CONVSurfaceDesc::has_in_line_uv_stride() const { + return (_has_bits_[0] & 0x00000040u) != 0; +} +inline void CONVSurfaceDesc::set_has_in_line_uv_stride() { + _has_bits_[0] |= 0x00000040u; +} +inline void CONVSurfaceDesc::clear_has_in_line_uv_stride() { + _has_bits_[0] &= ~0x00000040u; +} +inline void CONVSurfaceDesc::clear_in_line_uv_stride() { + in_line_uv_stride_ = 0u; + clear_has_in_line_uv_stride(); +} +inline ::google::protobuf::uint32 CONVSurfaceDesc::in_line_uv_stride() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CONVSurfaceDesc.in_line_uv_stride) + return in_line_uv_stride_; +} +inline void CONVSurfaceDesc::set_in_line_uv_stride(::google::protobuf::uint32 value) { + set_has_in_line_uv_stride(); + in_line_uv_stride_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.CONVSurfaceDesc.in_line_uv_stride) +} + +// ------------------------------------------------------------------- + +// CONVOpDesc + +// required .nvdla_prototest_interface.ConvMode conv_mode = 1; +inline bool CONVOpDesc::has_conv_mode() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void CONVOpDesc::set_has_conv_mode() { + _has_bits_[0] |= 0x00000001u; +} +inline void CONVOpDesc::clear_has_conv_mode() { + _has_bits_[0] &= ~0x00000001u; +} +inline void CONVOpDesc::clear_conv_mode() { + conv_mode_ = 0; + clear_has_conv_mode(); +} +inline ::nvdla_prototest_interface::ConvMode CONVOpDesc::conv_mode() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CONVOpDesc.conv_mode) + return static_cast< ::nvdla_prototest_interface::ConvMode >(conv_mode_); +} +inline void CONVOpDesc::set_conv_mode(::nvdla_prototest_interface::ConvMode value) { + assert(::nvdla_prototest_interface::ConvMode_IsValid(value)); + set_has_conv_mode(); + conv_mode_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.CONVOpDesc.conv_mode) +} + +// required uint32 data_reuse = 2; +inline bool CONVOpDesc::has_data_reuse() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void CONVOpDesc::set_has_data_reuse() { + _has_bits_[0] |= 0x00000002u; +} +inline void CONVOpDesc::clear_has_data_reuse() { + _has_bits_[0] &= ~0x00000002u; +} +inline void CONVOpDesc::clear_data_reuse() { + data_reuse_ = 0u; + clear_has_data_reuse(); +} +inline ::google::protobuf::uint32 CONVOpDesc::data_reuse() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CONVOpDesc.data_reuse) + return data_reuse_; +} +inline void CONVOpDesc::set_data_reuse(::google::protobuf::uint32 value) { + set_has_data_reuse(); + data_reuse_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.CONVOpDesc.data_reuse) +} + +// required uint32 weight_reuse = 3; +inline bool CONVOpDesc::has_weight_reuse() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void CONVOpDesc::set_has_weight_reuse() { + _has_bits_[0] |= 0x00000004u; +} +inline void CONVOpDesc::clear_has_weight_reuse() { + _has_bits_[0] &= ~0x00000004u; +} +inline void CONVOpDesc::clear_weight_reuse() { + weight_reuse_ = 0u; + clear_has_weight_reuse(); +} +inline ::google::protobuf::uint32 CONVOpDesc::weight_reuse() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CONVOpDesc.weight_reuse) + return weight_reuse_; +} +inline void CONVOpDesc::set_weight_reuse(::google::protobuf::uint32 value) { + set_has_weight_reuse(); + weight_reuse_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.CONVOpDesc.weight_reuse) +} + +// required uint32 skip_data_rls = 4; +inline bool CONVOpDesc::has_skip_data_rls() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void CONVOpDesc::set_has_skip_data_rls() { + _has_bits_[0] |= 0x00000008u; +} +inline void CONVOpDesc::clear_has_skip_data_rls() { + _has_bits_[0] &= ~0x00000008u; +} +inline void CONVOpDesc::clear_skip_data_rls() { + skip_data_rls_ = 0u; + clear_has_skip_data_rls(); +} +inline ::google::protobuf::uint32 CONVOpDesc::skip_data_rls() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CONVOpDesc.skip_data_rls) + return skip_data_rls_; +} +inline void CONVOpDesc::set_skip_data_rls(::google::protobuf::uint32 value) { + set_has_skip_data_rls(); + skip_data_rls_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.CONVOpDesc.skip_data_rls) +} + +// required uint32 skip_weight_rls = 5; +inline bool CONVOpDesc::has_skip_weight_rls() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +inline void CONVOpDesc::set_has_skip_weight_rls() { + _has_bits_[0] |= 0x00000010u; +} +inline void CONVOpDesc::clear_has_skip_weight_rls() { + _has_bits_[0] &= ~0x00000010u; +} +inline void CONVOpDesc::clear_skip_weight_rls() { + skip_weight_rls_ = 0u; + clear_has_skip_weight_rls(); +} +inline ::google::protobuf::uint32 CONVOpDesc::skip_weight_rls() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CONVOpDesc.skip_weight_rls) + return skip_weight_rls_; +} +inline void CONVOpDesc::set_skip_weight_rls(::google::protobuf::uint32 value) { + set_has_skip_weight_rls(); + skip_weight_rls_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.CONVOpDesc.skip_weight_rls) +} + +// optional uint32 reserved0 = 6 [default = 0]; +inline bool CONVOpDesc::has_reserved0() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +inline void CONVOpDesc::set_has_reserved0() { + _has_bits_[0] |= 0x00000020u; +} +inline void CONVOpDesc::clear_has_reserved0() { + _has_bits_[0] &= ~0x00000020u; +} +inline void CONVOpDesc::clear_reserved0() { + reserved0_ = 0u; + clear_has_reserved0(); +} +inline ::google::protobuf::uint32 CONVOpDesc::reserved0() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CONVOpDesc.reserved0) + return reserved0_; +} +inline void CONVOpDesc::set_reserved0(::google::protobuf::uint32 value) { + set_has_reserved0(); + reserved0_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.CONVOpDesc.reserved0) +} + +// required uint32 entry_per_slice = 7; +inline bool CONVOpDesc::has_entry_per_slice() const { + return (_has_bits_[0] & 0x00000040u) != 0; +} +inline void CONVOpDesc::set_has_entry_per_slice() { + _has_bits_[0] |= 0x00000040u; +} +inline void CONVOpDesc::clear_has_entry_per_slice() { + _has_bits_[0] &= ~0x00000040u; +} +inline void CONVOpDesc::clear_entry_per_slice() { + entry_per_slice_ = 0u; + clear_has_entry_per_slice(); +} +inline ::google::protobuf::uint32 CONVOpDesc::entry_per_slice() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CONVOpDesc.entry_per_slice) + return entry_per_slice_; +} +inline void CONVOpDesc::set_entry_per_slice(::google::protobuf::uint32 value) { + set_has_entry_per_slice(); + entry_per_slice_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.CONVOpDesc.entry_per_slice) +} + +// required .nvdla_prototest_interface.DataFormat data_format = 8; +inline bool CONVOpDesc::has_data_format() const { + return (_has_bits_[0] & 0x00000080u) != 0; +} +inline void CONVOpDesc::set_has_data_format() { + _has_bits_[0] |= 0x00000080u; +} +inline void CONVOpDesc::clear_has_data_format() { + _has_bits_[0] &= ~0x00000080u; +} +inline void CONVOpDesc::clear_data_format() { + data_format_ = 0; + clear_has_data_format(); +} +inline ::nvdla_prototest_interface::DataFormat CONVOpDesc::data_format() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CONVOpDesc.data_format) + return static_cast< ::nvdla_prototest_interface::DataFormat >(data_format_); +} +inline void CONVOpDesc::set_data_format(::nvdla_prototest_interface::DataFormat value) { + assert(::nvdla_prototest_interface::DataFormat_IsValid(value)); + set_has_data_format(); + data_format_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.CONVOpDesc.data_format) +} + +// required uint32 pixel_mapping = 9; +inline bool CONVOpDesc::has_pixel_mapping() const { + return (_has_bits_[0] & 0x00000100u) != 0; +} +inline void CONVOpDesc::set_has_pixel_mapping() { + _has_bits_[0] |= 0x00000100u; +} +inline void CONVOpDesc::clear_has_pixel_mapping() { + _has_bits_[0] &= ~0x00000100u; +} +inline void CONVOpDesc::clear_pixel_mapping() { + pixel_mapping_ = 0u; + clear_has_pixel_mapping(); +} +inline ::google::protobuf::uint32 CONVOpDesc::pixel_mapping() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CONVOpDesc.pixel_mapping) + return pixel_mapping_; +} +inline void CONVOpDesc::set_pixel_mapping(::google::protobuf::uint32 value) { + set_has_pixel_mapping(); + pixel_mapping_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.CONVOpDesc.pixel_mapping) +} + +// required uint32 fetch_grain = 10; +inline bool CONVOpDesc::has_fetch_grain() const { + return (_has_bits_[0] & 0x00000200u) != 0; +} +inline void CONVOpDesc::set_has_fetch_grain() { + _has_bits_[0] |= 0x00000200u; +} +inline void CONVOpDesc::clear_has_fetch_grain() { + _has_bits_[0] &= ~0x00000200u; +} +inline void CONVOpDesc::clear_fetch_grain() { + fetch_grain_ = 0u; + clear_has_fetch_grain(); +} +inline ::google::protobuf::uint32 CONVOpDesc::fetch_grain() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CONVOpDesc.fetch_grain) + return fetch_grain_; +} +inline void CONVOpDesc::set_fetch_grain(::google::protobuf::uint32 value) { + set_has_fetch_grain(); + fetch_grain_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.CONVOpDesc.fetch_grain) +} + +// required uint32 pixel_offset_x = 11; +inline bool CONVOpDesc::has_pixel_offset_x() const { + return (_has_bits_[0] & 0x00000400u) != 0; +} +inline void CONVOpDesc::set_has_pixel_offset_x() { + _has_bits_[0] |= 0x00000400u; +} +inline void CONVOpDesc::clear_has_pixel_offset_x() { + _has_bits_[0] &= ~0x00000400u; +} +inline void CONVOpDesc::clear_pixel_offset_x() { + pixel_offset_x_ = 0u; + clear_has_pixel_offset_x(); +} +inline ::google::protobuf::uint32 CONVOpDesc::pixel_offset_x() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CONVOpDesc.pixel_offset_x) + return pixel_offset_x_; +} +inline void CONVOpDesc::set_pixel_offset_x(::google::protobuf::uint32 value) { + set_has_pixel_offset_x(); + pixel_offset_x_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.CONVOpDesc.pixel_offset_x) +} + +// required uint32 pixel_offset_y = 12; +inline bool CONVOpDesc::has_pixel_offset_y() const { + return (_has_bits_[0] & 0x00000800u) != 0; +} +inline void CONVOpDesc::set_has_pixel_offset_y() { + _has_bits_[0] |= 0x00000800u; +} +inline void CONVOpDesc::clear_has_pixel_offset_y() { + _has_bits_[0] &= ~0x00000800u; +} +inline void CONVOpDesc::clear_pixel_offset_y() { + pixel_offset_y_ = 0u; + clear_has_pixel_offset_y(); +} +inline ::google::protobuf::uint32 CONVOpDesc::pixel_offset_y() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CONVOpDesc.pixel_offset_y) + return pixel_offset_y_; +} +inline void CONVOpDesc::set_pixel_offset_y(::google::protobuf::uint32 value) { + set_has_pixel_offset_y(); + pixel_offset_y_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.CONVOpDesc.pixel_offset_y) +} + +// required uint32 gob_per_line = 13; +inline bool CONVOpDesc::has_gob_per_line() const { + return (_has_bits_[0] & 0x00001000u) != 0; +} +inline void CONVOpDesc::set_has_gob_per_line() { + _has_bits_[0] |= 0x00001000u; +} +inline void CONVOpDesc::clear_has_gob_per_line() { + _has_bits_[0] &= ~0x00001000u; +} +inline void CONVOpDesc::clear_gob_per_line() { + gob_per_line_ = 0u; + clear_has_gob_per_line(); +} +inline ::google::protobuf::uint32 CONVOpDesc::gob_per_line() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CONVOpDesc.gob_per_line) + return gob_per_line_; +} +inline void CONVOpDesc::set_gob_per_line(::google::protobuf::uint32 value) { + set_has_gob_per_line(); + gob_per_line_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.CONVOpDesc.gob_per_line) +} + +// required uint32 gob_height = 14; +inline bool CONVOpDesc::has_gob_height() const { + return (_has_bits_[0] & 0x00002000u) != 0; +} +inline void CONVOpDesc::set_has_gob_height() { + _has_bits_[0] |= 0x00002000u; +} +inline void CONVOpDesc::clear_has_gob_height() { + _has_bits_[0] &= ~0x00002000u; +} +inline void CONVOpDesc::clear_gob_height() { + gob_height_ = 0u; + clear_has_gob_height(); +} +inline ::google::protobuf::uint32 CONVOpDesc::gob_height() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CONVOpDesc.gob_height) + return gob_height_; +} +inline void CONVOpDesc::set_gob_height(::google::protobuf::uint32 value) { + set_has_gob_height(); + gob_height_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.CONVOpDesc.gob_height) +} + +// required uint32 gob_y_index = 15; +inline bool CONVOpDesc::has_gob_y_index() const { + return (_has_bits_[0] & 0x00004000u) != 0; +} +inline void CONVOpDesc::set_has_gob_y_index() { + _has_bits_[0] |= 0x00004000u; +} +inline void CONVOpDesc::clear_has_gob_y_index() { + _has_bits_[0] &= ~0x00004000u; +} +inline void CONVOpDesc::clear_gob_y_index() { + gob_y_index_ = 0u; + clear_has_gob_y_index(); +} +inline ::google::protobuf::uint32 CONVOpDesc::gob_y_index() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CONVOpDesc.gob_y_index) + return gob_y_index_; +} +inline void CONVOpDesc::set_gob_y_index(::google::protobuf::uint32 value) { + set_has_gob_y_index(); + gob_y_index_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.CONVOpDesc.gob_y_index) +} + +// required uint32 gob_per_uv_line = 16; +inline bool CONVOpDesc::has_gob_per_uv_line() const { + return (_has_bits_[0] & 0x00008000u) != 0; +} +inline void CONVOpDesc::set_has_gob_per_uv_line() { + _has_bits_[0] |= 0x00008000u; +} +inline void CONVOpDesc::clear_has_gob_per_uv_line() { + _has_bits_[0] &= ~0x00008000u; +} +inline void CONVOpDesc::clear_gob_per_uv_line() { + gob_per_uv_line_ = 0u; + clear_has_gob_per_uv_line(); +} +inline ::google::protobuf::uint32 CONVOpDesc::gob_per_uv_line() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CONVOpDesc.gob_per_uv_line) + return gob_per_uv_line_; +} +inline void CONVOpDesc::set_gob_per_uv_line(::google::protobuf::uint32 value) { + set_has_gob_per_uv_line(); + gob_per_uv_line_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.CONVOpDesc.gob_per_uv_line) +} + +// required uint32 batch = 17; +inline bool CONVOpDesc::has_batch() const { + return (_has_bits_[0] & 0x00010000u) != 0; +} +inline void CONVOpDesc::set_has_batch() { + _has_bits_[0] |= 0x00010000u; +} +inline void CONVOpDesc::clear_has_batch() { + _has_bits_[0] &= ~0x00010000u; +} +inline void CONVOpDesc::clear_batch() { + batch_ = 0u; + clear_has_batch(); +} +inline ::google::protobuf::uint32 CONVOpDesc::batch() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CONVOpDesc.batch) + return batch_; +} +inline void CONVOpDesc::set_batch(::google::protobuf::uint32 value) { + set_has_batch(); + batch_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.CONVOpDesc.batch) +} + +// required .nvdla_prototest_interface.WeightFormat weight_format = 18; +inline bool CONVOpDesc::has_weight_format() const { + return (_has_bits_[0] & 0x00020000u) != 0; +} +inline void CONVOpDesc::set_has_weight_format() { + _has_bits_[0] |= 0x00020000u; +} +inline void CONVOpDesc::clear_has_weight_format() { + _has_bits_[0] &= ~0x00020000u; +} +inline void CONVOpDesc::clear_weight_format() { + weight_format_ = 0; + clear_has_weight_format(); +} +inline ::nvdla_prototest_interface::WeightFormat CONVOpDesc::weight_format() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CONVOpDesc.weight_format) + return static_cast< ::nvdla_prototest_interface::WeightFormat >(weight_format_); +} +inline void CONVOpDesc::set_weight_format(::nvdla_prototest_interface::WeightFormat value) { + assert(::nvdla_prototest_interface::WeightFormat_IsValid(value)); + set_has_weight_format(); + weight_format_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.CONVOpDesc.weight_format) +} + +// required uint32 data_bank = 19; +inline bool CONVOpDesc::has_data_bank() const { + return (_has_bits_[0] & 0x00040000u) != 0; +} +inline void CONVOpDesc::set_has_data_bank() { + _has_bits_[0] |= 0x00040000u; +} +inline void CONVOpDesc::clear_has_data_bank() { + _has_bits_[0] &= ~0x00040000u; +} +inline void CONVOpDesc::clear_data_bank() { + data_bank_ = 0u; + clear_has_data_bank(); +} +inline ::google::protobuf::uint32 CONVOpDesc::data_bank() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CONVOpDesc.data_bank) + return data_bank_; +} +inline void CONVOpDesc::set_data_bank(::google::protobuf::uint32 value) { + set_has_data_bank(); + data_bank_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.CONVOpDesc.data_bank) +} + +// required uint32 weight_bank = 20; +inline bool CONVOpDesc::has_weight_bank() const { + return (_has_bits_[0] & 0x00080000u) != 0; +} +inline void CONVOpDesc::set_has_weight_bank() { + _has_bits_[0] |= 0x00080000u; +} +inline void CONVOpDesc::clear_has_weight_bank() { + _has_bits_[0] &= ~0x00080000u; +} +inline void CONVOpDesc::clear_weight_bank() { + weight_bank_ = 0u; + clear_has_weight_bank(); +} +inline ::google::protobuf::uint32 CONVOpDesc::weight_bank() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CONVOpDesc.weight_bank) + return weight_bank_; +} +inline void CONVOpDesc::set_weight_bank(::google::protobuf::uint32 value) { + set_has_weight_bank(); + weight_bank_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.CONVOpDesc.weight_bank) +} + +// required uint32 batch_stride = 21; +inline bool CONVOpDesc::has_batch_stride() const { + return (_has_bits_[0] & 0x00100000u) != 0; +} +inline void CONVOpDesc::set_has_batch_stride() { + _has_bits_[0] |= 0x00100000u; +} +inline void CONVOpDesc::clear_has_batch_stride() { + _has_bits_[0] &= ~0x00100000u; +} +inline void CONVOpDesc::clear_batch_stride() { + batch_stride_ = 0u; + clear_has_batch_stride(); +} +inline ::google::protobuf::uint32 CONVOpDesc::batch_stride() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CONVOpDesc.batch_stride) + return batch_stride_; +} +inline void CONVOpDesc::set_batch_stride(::google::protobuf::uint32 value) { + set_has_batch_stride(); + batch_stride_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.CONVOpDesc.batch_stride) +} + +// required uint32 post_extension = 22; +inline bool CONVOpDesc::has_post_extension() const { + return (_has_bits_[0] & 0x00200000u) != 0; +} +inline void CONVOpDesc::set_has_post_extension() { + _has_bits_[0] |= 0x00200000u; +} +inline void CONVOpDesc::clear_has_post_extension() { + _has_bits_[0] &= ~0x00200000u; +} +inline void CONVOpDesc::clear_post_extension() { + post_extension_ = 0u; + clear_has_post_extension(); +} +inline ::google::protobuf::uint32 CONVOpDesc::post_extension() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CONVOpDesc.post_extension) + return post_extension_; +} +inline void CONVOpDesc::set_post_extension(::google::protobuf::uint32 value) { + set_has_post_extension(); + post_extension_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.CONVOpDesc.post_extension) +} + +// optional .nvdla_prototest_interface.PixelOverride pixel_override = 23; +inline bool CONVOpDesc::has_pixel_override() const { + return (_has_bits_[0] & 0x00400000u) != 0; +} +inline void CONVOpDesc::set_has_pixel_override() { + _has_bits_[0] |= 0x00400000u; +} +inline void CONVOpDesc::clear_has_pixel_override() { + _has_bits_[0] &= ~0x00400000u; +} +inline void CONVOpDesc::clear_pixel_override() { + pixel_override_ = 0; + clear_has_pixel_override(); +} +inline ::nvdla_prototest_interface::PixelOverride CONVOpDesc::pixel_override() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CONVOpDesc.pixel_override) + return static_cast< ::nvdla_prototest_interface::PixelOverride >(pixel_override_); +} +inline void CONVOpDesc::set_pixel_override(::nvdla_prototest_interface::PixelOverride value) { + assert(::nvdla_prototest_interface::PixelOverride_IsValid(value)); + set_has_pixel_override(); + pixel_override_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.CONVOpDesc.pixel_override) +} + +// required uint32 release = 24; +inline bool CONVOpDesc::has_release() const { + return (_has_bits_[0] & 0x00800000u) != 0; +} +inline void CONVOpDesc::set_has_release() { + _has_bits_[0] |= 0x00800000u; +} +inline void CONVOpDesc::clear_has_release() { + _has_bits_[0] &= ~0x00800000u; +} +inline void CONVOpDesc::clear_release() { + release_ = 0u; + clear_has_release(); +} +inline ::google::protobuf::uint32 CONVOpDesc::release() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CONVOpDesc.release) + return release_; +} +inline void CONVOpDesc::set_release(::google::protobuf::uint32 value) { + set_has_release(); + release_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.CONVOpDesc.release) +} + +// required uint32 input_width_csc = 25; +inline bool CONVOpDesc::has_input_width_csc() const { + return (_has_bits_[0] & 0x01000000u) != 0; +} +inline void CONVOpDesc::set_has_input_width_csc() { + _has_bits_[0] |= 0x01000000u; +} +inline void CONVOpDesc::clear_has_input_width_csc() { + _has_bits_[0] &= ~0x01000000u; +} +inline void CONVOpDesc::clear_input_width_csc() { + input_width_csc_ = 0u; + clear_has_input_width_csc(); +} +inline ::google::protobuf::uint32 CONVOpDesc::input_width_csc() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CONVOpDesc.input_width_csc) + return input_width_csc_; +} +inline void CONVOpDesc::set_input_width_csc(::google::protobuf::uint32 value) { + set_has_input_width_csc(); + input_width_csc_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.CONVOpDesc.input_width_csc) +} + +// required uint32 input_height_csc = 26; +inline bool CONVOpDesc::has_input_height_csc() const { + return (_has_bits_[0] & 0x02000000u) != 0; +} +inline void CONVOpDesc::set_has_input_height_csc() { + _has_bits_[0] |= 0x02000000u; +} +inline void CONVOpDesc::clear_has_input_height_csc() { + _has_bits_[0] &= ~0x02000000u; +} +inline void CONVOpDesc::clear_input_height_csc() { + input_height_csc_ = 0u; + clear_has_input_height_csc(); +} +inline ::google::protobuf::uint32 CONVOpDesc::input_height_csc() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CONVOpDesc.input_height_csc) + return input_height_csc_; +} +inline void CONVOpDesc::set_input_height_csc(::google::protobuf::uint32 value) { + set_has_input_height_csc(); + input_height_csc_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.CONVOpDesc.input_height_csc) +} + +// required uint32 input_channel_csc = 27; +inline bool CONVOpDesc::has_input_channel_csc() const { + return (_has_bits_[0] & 0x04000000u) != 0; +} +inline void CONVOpDesc::set_has_input_channel_csc() { + _has_bits_[0] |= 0x04000000u; +} +inline void CONVOpDesc::clear_has_input_channel_csc() { + _has_bits_[0] &= ~0x04000000u; +} +inline void CONVOpDesc::clear_input_channel_csc() { + input_channel_csc_ = 0u; + clear_has_input_channel_csc(); +} +inline ::google::protobuf::uint32 CONVOpDesc::input_channel_csc() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CONVOpDesc.input_channel_csc) + return input_channel_csc_; +} +inline void CONVOpDesc::set_input_channel_csc(::google::protobuf::uint32 value) { + set_has_input_channel_csc(); + input_channel_csc_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.CONVOpDesc.input_channel_csc) +} + +// required uint32 kernel_width_csc = 28; +inline bool CONVOpDesc::has_kernel_width_csc() const { + return (_has_bits_[0] & 0x08000000u) != 0; +} +inline void CONVOpDesc::set_has_kernel_width_csc() { + _has_bits_[0] |= 0x08000000u; +} +inline void CONVOpDesc::clear_has_kernel_width_csc() { + _has_bits_[0] &= ~0x08000000u; +} +inline void CONVOpDesc::clear_kernel_width_csc() { + kernel_width_csc_ = 0u; + clear_has_kernel_width_csc(); +} +inline ::google::protobuf::uint32 CONVOpDesc::kernel_width_csc() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CONVOpDesc.kernel_width_csc) + return kernel_width_csc_; +} +inline void CONVOpDesc::set_kernel_width_csc(::google::protobuf::uint32 value) { + set_has_kernel_width_csc(); + kernel_width_csc_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.CONVOpDesc.kernel_width_csc) +} + +// required uint32 kernel_height_csc = 29; +inline bool CONVOpDesc::has_kernel_height_csc() const { + return (_has_bits_[0] & 0x10000000u) != 0; +} +inline void CONVOpDesc::set_has_kernel_height_csc() { + _has_bits_[0] |= 0x10000000u; +} +inline void CONVOpDesc::clear_has_kernel_height_csc() { + _has_bits_[0] &= ~0x10000000u; +} +inline void CONVOpDesc::clear_kernel_height_csc() { + kernel_height_csc_ = 0u; + clear_has_kernel_height_csc(); +} +inline ::google::protobuf::uint32 CONVOpDesc::kernel_height_csc() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CONVOpDesc.kernel_height_csc) + return kernel_height_csc_; +} +inline void CONVOpDesc::set_kernel_height_csc(::google::protobuf::uint32 value) { + set_has_kernel_height_csc(); + kernel_height_csc_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.CONVOpDesc.kernel_height_csc) +} + +// required uint32 kernel_channel_csc = 30; +inline bool CONVOpDesc::has_kernel_channel_csc() const { + return (_has_bits_[0] & 0x20000000u) != 0; +} +inline void CONVOpDesc::set_has_kernel_channel_csc() { + _has_bits_[0] |= 0x20000000u; +} +inline void CONVOpDesc::clear_has_kernel_channel_csc() { + _has_bits_[0] &= ~0x20000000u; +} +inline void CONVOpDesc::clear_kernel_channel_csc() { + kernel_channel_csc_ = 0u; + clear_has_kernel_channel_csc(); +} +inline ::google::protobuf::uint32 CONVOpDesc::kernel_channel_csc() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CONVOpDesc.kernel_channel_csc) + return kernel_channel_csc_; +} +inline void CONVOpDesc::set_kernel_channel_csc(::google::protobuf::uint32 value) { + set_has_kernel_channel_csc(); + kernel_channel_csc_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.CONVOpDesc.kernel_channel_csc) +} + +// required uint32 input_width_cmac = 31; +inline bool CONVOpDesc::has_input_width_cmac() const { + return (_has_bits_[0] & 0x40000000u) != 0; +} +inline void CONVOpDesc::set_has_input_width_cmac() { + _has_bits_[0] |= 0x40000000u; +} +inline void CONVOpDesc::clear_has_input_width_cmac() { + _has_bits_[0] &= ~0x40000000u; +} +inline void CONVOpDesc::clear_input_width_cmac() { + input_width_cmac_ = 0u; + clear_has_input_width_cmac(); +} +inline ::google::protobuf::uint32 CONVOpDesc::input_width_cmac() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CONVOpDesc.input_width_cmac) + return input_width_cmac_; +} +inline void CONVOpDesc::set_input_width_cmac(::google::protobuf::uint32 value) { + set_has_input_width_cmac(); + input_width_cmac_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.CONVOpDesc.input_width_cmac) +} + +// required uint32 input_height_cmac = 32; +inline bool CONVOpDesc::has_input_height_cmac() const { + return (_has_bits_[0] & 0x80000000u) != 0; +} +inline void CONVOpDesc::set_has_input_height_cmac() { + _has_bits_[0] |= 0x80000000u; +} +inline void CONVOpDesc::clear_has_input_height_cmac() { + _has_bits_[0] &= ~0x80000000u; +} +inline void CONVOpDesc::clear_input_height_cmac() { + input_height_cmac_ = 0u; + clear_has_input_height_cmac(); +} +inline ::google::protobuf::uint32 CONVOpDesc::input_height_cmac() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CONVOpDesc.input_height_cmac) + return input_height_cmac_; +} +inline void CONVOpDesc::set_input_height_cmac(::google::protobuf::uint32 value) { + set_has_input_height_cmac(); + input_height_cmac_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.CONVOpDesc.input_height_cmac) +} + +// required uint32 bytes_per_kernel = 33; +inline bool CONVOpDesc::has_bytes_per_kernel() const { + return (_has_bits_[1] & 0x00000001u) != 0; +} +inline void CONVOpDesc::set_has_bytes_per_kernel() { + _has_bits_[1] |= 0x00000001u; +} +inline void CONVOpDesc::clear_has_bytes_per_kernel() { + _has_bits_[1] &= ~0x00000001u; +} +inline void CONVOpDesc::clear_bytes_per_kernel() { + bytes_per_kernel_ = 0u; + clear_has_bytes_per_kernel(); +} +inline ::google::protobuf::uint32 CONVOpDesc::bytes_per_kernel() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CONVOpDesc.bytes_per_kernel) + return bytes_per_kernel_; +} +inline void CONVOpDesc::set_bytes_per_kernel(::google::protobuf::uint32 value) { + set_has_bytes_per_kernel(); + bytes_per_kernel_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.CONVOpDesc.bytes_per_kernel) +} + +// required int32 mean_ry = 34; +inline bool CONVOpDesc::has_mean_ry() const { + return (_has_bits_[1] & 0x00000002u) != 0; +} +inline void CONVOpDesc::set_has_mean_ry() { + _has_bits_[1] |= 0x00000002u; +} +inline void CONVOpDesc::clear_has_mean_ry() { + _has_bits_[1] &= ~0x00000002u; +} +inline void CONVOpDesc::clear_mean_ry() { + mean_ry_ = 0; + clear_has_mean_ry(); +} +inline ::google::protobuf::int32 CONVOpDesc::mean_ry() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CONVOpDesc.mean_ry) + return mean_ry_; +} +inline void CONVOpDesc::set_mean_ry(::google::protobuf::int32 value) { + set_has_mean_ry(); + mean_ry_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.CONVOpDesc.mean_ry) +} + +// required int32 mean_gu = 35; +inline bool CONVOpDesc::has_mean_gu() const { + return (_has_bits_[1] & 0x00000004u) != 0; +} +inline void CONVOpDesc::set_has_mean_gu() { + _has_bits_[1] |= 0x00000004u; +} +inline void CONVOpDesc::clear_has_mean_gu() { + _has_bits_[1] &= ~0x00000004u; +} +inline void CONVOpDesc::clear_mean_gu() { + mean_gu_ = 0; + clear_has_mean_gu(); +} +inline ::google::protobuf::int32 CONVOpDesc::mean_gu() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CONVOpDesc.mean_gu) + return mean_gu_; +} +inline void CONVOpDesc::set_mean_gu(::google::protobuf::int32 value) { + set_has_mean_gu(); + mean_gu_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.CONVOpDesc.mean_gu) +} + +// required int32 mean_bv = 36; +inline bool CONVOpDesc::has_mean_bv() const { + return (_has_bits_[1] & 0x00000008u) != 0; +} +inline void CONVOpDesc::set_has_mean_bv() { + _has_bits_[1] |= 0x00000008u; +} +inline void CONVOpDesc::clear_has_mean_bv() { + _has_bits_[1] &= ~0x00000008u; +} +inline void CONVOpDesc::clear_mean_bv() { + mean_bv_ = 0; + clear_has_mean_bv(); +} +inline ::google::protobuf::int32 CONVOpDesc::mean_bv() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CONVOpDesc.mean_bv) + return mean_bv_; +} +inline void CONVOpDesc::set_mean_bv(::google::protobuf::int32 value) { + set_has_mean_bv(); + mean_bv_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.CONVOpDesc.mean_bv) +} + +// required int32 mean_ax = 37; +inline bool CONVOpDesc::has_mean_ax() const { + return (_has_bits_[1] & 0x00000010u) != 0; +} +inline void CONVOpDesc::set_has_mean_ax() { + _has_bits_[1] |= 0x00000010u; +} +inline void CONVOpDesc::clear_has_mean_ax() { + _has_bits_[1] &= ~0x00000010u; +} +inline void CONVOpDesc::clear_mean_ax() { + mean_ax_ = 0; + clear_has_mean_ax(); +} +inline ::google::protobuf::int32 CONVOpDesc::mean_ax() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CONVOpDesc.mean_ax) + return mean_ax_; +} +inline void CONVOpDesc::set_mean_ax(::google::protobuf::int32 value) { + set_has_mean_ax(); + mean_ax_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.CONVOpDesc.mean_ax) +} + +// required .nvdla_prototest_interface.MeanFormat mean_format = 38; +inline bool CONVOpDesc::has_mean_format() const { + return (_has_bits_[1] & 0x00000020u) != 0; +} +inline void CONVOpDesc::set_has_mean_format() { + _has_bits_[1] |= 0x00000020u; +} +inline void CONVOpDesc::clear_has_mean_format() { + _has_bits_[1] &= ~0x00000020u; +} +inline void CONVOpDesc::clear_mean_format() { + mean_format_ = 0; + clear_has_mean_format(); +} +inline ::nvdla_prototest_interface::MeanFormat CONVOpDesc::mean_format() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CONVOpDesc.mean_format) + return static_cast< ::nvdla_prototest_interface::MeanFormat >(mean_format_); +} +inline void CONVOpDesc::set_mean_format(::nvdla_prototest_interface::MeanFormat value) { + assert(::nvdla_prototest_interface::MeanFormat_IsValid(value)); + set_has_mean_format(); + mean_format_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.CONVOpDesc.mean_format) +} + +// required uint32 conv_stride_x = 39; +inline bool CONVOpDesc::has_conv_stride_x() const { + return (_has_bits_[1] & 0x00000040u) != 0; +} +inline void CONVOpDesc::set_has_conv_stride_x() { + _has_bits_[1] |= 0x00000040u; +} +inline void CONVOpDesc::clear_has_conv_stride_x() { + _has_bits_[1] &= ~0x00000040u; +} +inline void CONVOpDesc::clear_conv_stride_x() { + conv_stride_x_ = 0u; + clear_has_conv_stride_x(); +} +inline ::google::protobuf::uint32 CONVOpDesc::conv_stride_x() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CONVOpDesc.conv_stride_x) + return conv_stride_x_; +} +inline void CONVOpDesc::set_conv_stride_x(::google::protobuf::uint32 value) { + set_has_conv_stride_x(); + conv_stride_x_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.CONVOpDesc.conv_stride_x) +} + +// required uint32 conv_stride_y = 40; +inline bool CONVOpDesc::has_conv_stride_y() const { + return (_has_bits_[1] & 0x00000080u) != 0; +} +inline void CONVOpDesc::set_has_conv_stride_y() { + _has_bits_[1] |= 0x00000080u; +} +inline void CONVOpDesc::clear_has_conv_stride_y() { + _has_bits_[1] &= ~0x00000080u; +} +inline void CONVOpDesc::clear_conv_stride_y() { + conv_stride_y_ = 0u; + clear_has_conv_stride_y(); +} +inline ::google::protobuf::uint32 CONVOpDesc::conv_stride_y() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CONVOpDesc.conv_stride_y) + return conv_stride_y_; +} +inline void CONVOpDesc::set_conv_stride_y(::google::protobuf::uint32 value) { + set_has_conv_stride_y(); + conv_stride_y_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.CONVOpDesc.conv_stride_y) +} + +// required uint32 pad_x_left = 41; +inline bool CONVOpDesc::has_pad_x_left() const { + return (_has_bits_[1] & 0x00000100u) != 0; +} +inline void CONVOpDesc::set_has_pad_x_left() { + _has_bits_[1] |= 0x00000100u; +} +inline void CONVOpDesc::clear_has_pad_x_left() { + _has_bits_[1] &= ~0x00000100u; +} +inline void CONVOpDesc::clear_pad_x_left() { + pad_x_left_ = 0u; + clear_has_pad_x_left(); +} +inline ::google::protobuf::uint32 CONVOpDesc::pad_x_left() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CONVOpDesc.pad_x_left) + return pad_x_left_; +} +inline void CONVOpDesc::set_pad_x_left(::google::protobuf::uint32 value) { + set_has_pad_x_left(); + pad_x_left_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.CONVOpDesc.pad_x_left) +} + +// required uint32 pad_x_right = 42; +inline bool CONVOpDesc::has_pad_x_right() const { + return (_has_bits_[1] & 0x00000200u) != 0; +} +inline void CONVOpDesc::set_has_pad_x_right() { + _has_bits_[1] |= 0x00000200u; +} +inline void CONVOpDesc::clear_has_pad_x_right() { + _has_bits_[1] &= ~0x00000200u; +} +inline void CONVOpDesc::clear_pad_x_right() { + pad_x_right_ = 0u; + clear_has_pad_x_right(); +} +inline ::google::protobuf::uint32 CONVOpDesc::pad_x_right() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CONVOpDesc.pad_x_right) + return pad_x_right_; +} +inline void CONVOpDesc::set_pad_x_right(::google::protobuf::uint32 value) { + set_has_pad_x_right(); + pad_x_right_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.CONVOpDesc.pad_x_right) +} + +// required uint32 pad_y_top = 43; +inline bool CONVOpDesc::has_pad_y_top() const { + return (_has_bits_[1] & 0x00000400u) != 0; +} +inline void CONVOpDesc::set_has_pad_y_top() { + _has_bits_[1] |= 0x00000400u; +} +inline void CONVOpDesc::clear_has_pad_y_top() { + _has_bits_[1] &= ~0x00000400u; +} +inline void CONVOpDesc::clear_pad_y_top() { + pad_y_top_ = 0u; + clear_has_pad_y_top(); +} +inline ::google::protobuf::uint32 CONVOpDesc::pad_y_top() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CONVOpDesc.pad_y_top) + return pad_y_top_; +} +inline void CONVOpDesc::set_pad_y_top(::google::protobuf::uint32 value) { + set_has_pad_y_top(); + pad_y_top_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.CONVOpDesc.pad_y_top) +} + +// required uint32 pad_y_bottom = 44; +inline bool CONVOpDesc::has_pad_y_bottom() const { + return (_has_bits_[1] & 0x00000800u) != 0; +} +inline void CONVOpDesc::set_has_pad_y_bottom() { + _has_bits_[1] |= 0x00000800u; +} +inline void CONVOpDesc::clear_has_pad_y_bottom() { + _has_bits_[1] &= ~0x00000800u; +} +inline void CONVOpDesc::clear_pad_y_bottom() { + pad_y_bottom_ = 0u; + clear_has_pad_y_bottom(); +} +inline ::google::protobuf::uint32 CONVOpDesc::pad_y_bottom() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CONVOpDesc.pad_y_bottom) + return pad_y_bottom_; +} +inline void CONVOpDesc::set_pad_y_bottom(::google::protobuf::uint32 value) { + set_has_pad_y_bottom(); + pad_y_bottom_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.CONVOpDesc.pad_y_bottom) +} + +// required uint32 dilation_x = 45; +inline bool CONVOpDesc::has_dilation_x() const { + return (_has_bits_[1] & 0x00001000u) != 0; +} +inline void CONVOpDesc::set_has_dilation_x() { + _has_bits_[1] |= 0x00001000u; +} +inline void CONVOpDesc::clear_has_dilation_x() { + _has_bits_[1] &= ~0x00001000u; +} +inline void CONVOpDesc::clear_dilation_x() { + dilation_x_ = 0u; + clear_has_dilation_x(); +} +inline ::google::protobuf::uint32 CONVOpDesc::dilation_x() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CONVOpDesc.dilation_x) + return dilation_x_; +} +inline void CONVOpDesc::set_dilation_x(::google::protobuf::uint32 value) { + set_has_dilation_x(); + dilation_x_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.CONVOpDesc.dilation_x) +} + +// required uint32 dilation_y = 46; +inline bool CONVOpDesc::has_dilation_y() const { + return (_has_bits_[1] & 0x00002000u) != 0; +} +inline void CONVOpDesc::set_has_dilation_y() { + _has_bits_[1] |= 0x00002000u; +} +inline void CONVOpDesc::clear_has_dilation_y() { + _has_bits_[1] &= ~0x00002000u; +} +inline void CONVOpDesc::clear_dilation_y() { + dilation_y_ = 0u; + clear_has_dilation_y(); +} +inline ::google::protobuf::uint32 CONVOpDesc::dilation_y() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CONVOpDesc.dilation_y) + return dilation_y_; +} +inline void CONVOpDesc::set_dilation_y(::google::protobuf::uint32 value) { + set_has_dilation_y(); + dilation_y_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.CONVOpDesc.dilation_y) +} + +// repeated uint32 reserved2 = 47 [packed = true]; +inline int CONVOpDesc::reserved2_size() const { + return reserved2_.size(); +} +inline void CONVOpDesc::clear_reserved2() { + reserved2_.Clear(); +} +inline ::google::protobuf::uint32 CONVOpDesc::reserved2(int index) const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CONVOpDesc.reserved2) + return reserved2_.Get(index); +} +inline void CONVOpDesc::set_reserved2(int index, ::google::protobuf::uint32 value) { + reserved2_.Set(index, value); + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.CONVOpDesc.reserved2) +} +inline void CONVOpDesc::add_reserved2(::google::protobuf::uint32 value) { + reserved2_.Add(value); + // @@protoc_insertion_point(field_add:nvdla_prototest_interface.CONVOpDesc.reserved2) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +CONVOpDesc::reserved2() const { + // @@protoc_insertion_point(field_list:nvdla_prototest_interface.CONVOpDesc.reserved2) + return reserved2_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +CONVOpDesc::mutable_reserved2() { + // @@protoc_insertion_point(field_mutable_list:nvdla_prototest_interface.CONVOpDesc.reserved2) + return &reserved2_; +} + +// required uint32 pra_truncate = 48; +inline bool CONVOpDesc::has_pra_truncate() const { + return (_has_bits_[1] & 0x00008000u) != 0; +} +inline void CONVOpDesc::set_has_pra_truncate() { + _has_bits_[1] |= 0x00008000u; +} +inline void CONVOpDesc::clear_has_pra_truncate() { + _has_bits_[1] &= ~0x00008000u; +} +inline void CONVOpDesc::clear_pra_truncate() { + pra_truncate_ = 0u; + clear_has_pra_truncate(); +} +inline ::google::protobuf::uint32 CONVOpDesc::pra_truncate() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CONVOpDesc.pra_truncate) + return pra_truncate_; +} +inline void CONVOpDesc::set_pra_truncate(::google::protobuf::uint32 value) { + set_has_pra_truncate(); + pra_truncate_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.CONVOpDesc.pra_truncate) +} + +// required .nvdla_prototest_interface.DataPrecision in_precision = 49; +inline bool CONVOpDesc::has_in_precision() const { + return (_has_bits_[1] & 0x00010000u) != 0; +} +inline void CONVOpDesc::set_has_in_precision() { + _has_bits_[1] |= 0x00010000u; +} +inline void CONVOpDesc::clear_has_in_precision() { + _has_bits_[1] &= ~0x00010000u; +} +inline void CONVOpDesc::clear_in_precision() { + in_precision_ = 0; + clear_has_in_precision(); +} +inline ::nvdla_prototest_interface::DataPrecision CONVOpDesc::in_precision() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CONVOpDesc.in_precision) + return static_cast< ::nvdla_prototest_interface::DataPrecision >(in_precision_); +} +inline void CONVOpDesc::set_in_precision(::nvdla_prototest_interface::DataPrecision value) { + assert(::nvdla_prototest_interface::DataPrecision_IsValid(value)); + set_has_in_precision(); + in_precision_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.CONVOpDesc.in_precision) +} + +// required .nvdla_prototest_interface.DataPrecision out_precision = 50; +inline bool CONVOpDesc::has_out_precision() const { + return (_has_bits_[1] & 0x00020000u) != 0; +} +inline void CONVOpDesc::set_has_out_precision() { + _has_bits_[1] |= 0x00020000u; +} +inline void CONVOpDesc::clear_has_out_precision() { + _has_bits_[1] &= ~0x00020000u; +} +inline void CONVOpDesc::clear_out_precision() { + out_precision_ = 0; + clear_has_out_precision(); +} +inline ::nvdla_prototest_interface::DataPrecision CONVOpDesc::out_precision() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CONVOpDesc.out_precision) + return static_cast< ::nvdla_prototest_interface::DataPrecision >(out_precision_); +} +inline void CONVOpDesc::set_out_precision(::nvdla_prototest_interface::DataPrecision value) { + assert(::nvdla_prototest_interface::DataPrecision_IsValid(value)); + set_has_out_precision(); + out_precision_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.CONVOpDesc.out_precision) +} + +// required int32 pad_val = 51; +inline bool CONVOpDesc::has_pad_val() const { + return (_has_bits_[1] & 0x00040000u) != 0; +} +inline void CONVOpDesc::set_has_pad_val() { + _has_bits_[1] |= 0x00040000u; +} +inline void CONVOpDesc::clear_has_pad_val() { + _has_bits_[1] &= ~0x00040000u; +} +inline void CONVOpDesc::clear_pad_val() { + pad_val_ = 0; + clear_has_pad_val(); +} +inline ::google::protobuf::int32 CONVOpDesc::pad_val() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CONVOpDesc.pad_val) + return pad_val_; +} +inline void CONVOpDesc::set_pad_val(::google::protobuf::int32 value) { + set_has_pad_val(); + pad_val_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.CONVOpDesc.pad_val) +} + +// required .nvdla_prototest_interface.CVTParam in_cvt = 52; +inline bool CONVOpDesc::has_in_cvt() const { + return (_has_bits_[1] & 0x00080000u) != 0; +} +inline void CONVOpDesc::set_has_in_cvt() { + _has_bits_[1] |= 0x00080000u; +} +inline void CONVOpDesc::clear_has_in_cvt() { + _has_bits_[1] &= ~0x00080000u; +} +inline void CONVOpDesc::clear_in_cvt() { + if (in_cvt_ != NULL) in_cvt_->::nvdla_prototest_interface::CVTParam::Clear(); + clear_has_in_cvt(); +} +inline const ::nvdla_prototest_interface::CVTParam& CONVOpDesc::in_cvt() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CONVOpDesc.in_cvt) + return in_cvt_ != NULL ? *in_cvt_ : *default_instance_->in_cvt_; +} +inline ::nvdla_prototest_interface::CVTParam* CONVOpDesc::mutable_in_cvt() { + set_has_in_cvt(); + if (in_cvt_ == NULL) in_cvt_ = new ::nvdla_prototest_interface::CVTParam; + // @@protoc_insertion_point(field_mutable:nvdla_prototest_interface.CONVOpDesc.in_cvt) + return in_cvt_; +} +inline ::nvdla_prototest_interface::CVTParam* CONVOpDesc::release_in_cvt() { + clear_has_in_cvt(); + ::nvdla_prototest_interface::CVTParam* temp = in_cvt_; + in_cvt_ = NULL; + return temp; +} +inline void CONVOpDesc::set_allocated_in_cvt(::nvdla_prototest_interface::CVTParam* in_cvt) { + delete in_cvt_; + in_cvt_ = in_cvt; + if (in_cvt) { + set_has_in_cvt(); + } else { + clear_has_in_cvt(); + } + // @@protoc_insertion_point(field_set_allocated:nvdla_prototest_interface.CONVOpDesc.in_cvt) +} + +// required .nvdla_prototest_interface.CVTParam out_cvt = 53; +inline bool CONVOpDesc::has_out_cvt() const { + return (_has_bits_[1] & 0x00100000u) != 0; +} +inline void CONVOpDesc::set_has_out_cvt() { + _has_bits_[1] |= 0x00100000u; +} +inline void CONVOpDesc::clear_has_out_cvt() { + _has_bits_[1] &= ~0x00100000u; +} +inline void CONVOpDesc::clear_out_cvt() { + if (out_cvt_ != NULL) out_cvt_->::nvdla_prototest_interface::CVTParam::Clear(); + clear_has_out_cvt(); +} +inline const ::nvdla_prototest_interface::CVTParam& CONVOpDesc::out_cvt() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CONVOpDesc.out_cvt) + return out_cvt_ != NULL ? *out_cvt_ : *default_instance_->out_cvt_; +} +inline ::nvdla_prototest_interface::CVTParam* CONVOpDesc::mutable_out_cvt() { + set_has_out_cvt(); + if (out_cvt_ == NULL) out_cvt_ = new ::nvdla_prototest_interface::CVTParam; + // @@protoc_insertion_point(field_mutable:nvdla_prototest_interface.CONVOpDesc.out_cvt) + return out_cvt_; +} +inline ::nvdla_prototest_interface::CVTParam* CONVOpDesc::release_out_cvt() { + clear_has_out_cvt(); + ::nvdla_prototest_interface::CVTParam* temp = out_cvt_; + out_cvt_ = NULL; + return temp; +} +inline void CONVOpDesc::set_allocated_out_cvt(::nvdla_prototest_interface::CVTParam* out_cvt) { + delete out_cvt_; + out_cvt_ = out_cvt; + if (out_cvt) { + set_has_out_cvt(); + } else { + clear_has_out_cvt(); + } + // @@protoc_insertion_point(field_set_allocated:nvdla_prototest_interface.CONVOpDesc.out_cvt) +} + +// ------------------------------------------------------------------- + +// SDPCvt + +// required .nvdla_prototest_interface.CVTParam alu_cvt = 1; +inline bool SDPCvt::has_alu_cvt() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void SDPCvt::set_has_alu_cvt() { + _has_bits_[0] |= 0x00000001u; +} +inline void SDPCvt::clear_has_alu_cvt() { + _has_bits_[0] &= ~0x00000001u; +} +inline void SDPCvt::clear_alu_cvt() { + if (alu_cvt_ != NULL) alu_cvt_->::nvdla_prototest_interface::CVTParam::Clear(); + clear_has_alu_cvt(); +} +inline const ::nvdla_prototest_interface::CVTParam& SDPCvt::alu_cvt() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.SDPCvt.alu_cvt) + return alu_cvt_ != NULL ? *alu_cvt_ : *default_instance_->alu_cvt_; +} +inline ::nvdla_prototest_interface::CVTParam* SDPCvt::mutable_alu_cvt() { + set_has_alu_cvt(); + if (alu_cvt_ == NULL) alu_cvt_ = new ::nvdla_prototest_interface::CVTParam; + // @@protoc_insertion_point(field_mutable:nvdla_prototest_interface.SDPCvt.alu_cvt) + return alu_cvt_; +} +inline ::nvdla_prototest_interface::CVTParam* SDPCvt::release_alu_cvt() { + clear_has_alu_cvt(); + ::nvdla_prototest_interface::CVTParam* temp = alu_cvt_; + alu_cvt_ = NULL; + return temp; +} +inline void SDPCvt::set_allocated_alu_cvt(::nvdla_prototest_interface::CVTParam* alu_cvt) { + delete alu_cvt_; + alu_cvt_ = alu_cvt; + if (alu_cvt) { + set_has_alu_cvt(); + } else { + clear_has_alu_cvt(); + } + // @@protoc_insertion_point(field_set_allocated:nvdla_prototest_interface.SDPCvt.alu_cvt) +} + +// required .nvdla_prototest_interface.CVTParam mul_cvt = 2; +inline bool SDPCvt::has_mul_cvt() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void SDPCvt::set_has_mul_cvt() { + _has_bits_[0] |= 0x00000002u; +} +inline void SDPCvt::clear_has_mul_cvt() { + _has_bits_[0] &= ~0x00000002u; +} +inline void SDPCvt::clear_mul_cvt() { + if (mul_cvt_ != NULL) mul_cvt_->::nvdla_prototest_interface::CVTParam::Clear(); + clear_has_mul_cvt(); +} +inline const ::nvdla_prototest_interface::CVTParam& SDPCvt::mul_cvt() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.SDPCvt.mul_cvt) + return mul_cvt_ != NULL ? *mul_cvt_ : *default_instance_->mul_cvt_; +} +inline ::nvdla_prototest_interface::CVTParam* SDPCvt::mutable_mul_cvt() { + set_has_mul_cvt(); + if (mul_cvt_ == NULL) mul_cvt_ = new ::nvdla_prototest_interface::CVTParam; + // @@protoc_insertion_point(field_mutable:nvdla_prototest_interface.SDPCvt.mul_cvt) + return mul_cvt_; +} +inline ::nvdla_prototest_interface::CVTParam* SDPCvt::release_mul_cvt() { + clear_has_mul_cvt(); + ::nvdla_prototest_interface::CVTParam* temp = mul_cvt_; + mul_cvt_ = NULL; + return temp; +} +inline void SDPCvt::set_allocated_mul_cvt(::nvdla_prototest_interface::CVTParam* mul_cvt) { + delete mul_cvt_; + mul_cvt_ = mul_cvt; + if (mul_cvt) { + set_has_mul_cvt(); + } else { + clear_has_mul_cvt(); + } + // @@protoc_insertion_point(field_set_allocated:nvdla_prototest_interface.SDPCvt.mul_cvt) +} + +// ------------------------------------------------------------------- + +// SDPOp + +// required uint32 enable = 1; +inline bool SDPOp::has_enable() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void SDPOp::set_has_enable() { + _has_bits_[0] |= 0x00000001u; +} +inline void SDPOp::clear_has_enable() { + _has_bits_[0] &= ~0x00000001u; +} +inline void SDPOp::clear_enable() { + enable_ = 0u; + clear_has_enable(); +} +inline ::google::protobuf::uint32 SDPOp::enable() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.SDPOp.enable) + return enable_; +} +inline void SDPOp::set_enable(::google::protobuf::uint32 value) { + set_has_enable(); + enable_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.SDPOp.enable) +} + +// required .nvdla_prototest_interface.ALUType alu_type = 2; +inline bool SDPOp::has_alu_type() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void SDPOp::set_has_alu_type() { + _has_bits_[0] |= 0x00000002u; +} +inline void SDPOp::clear_has_alu_type() { + _has_bits_[0] &= ~0x00000002u; +} +inline void SDPOp::clear_alu_type() { + alu_type_ = 0; + clear_has_alu_type(); +} +inline ::nvdla_prototest_interface::ALUType SDPOp::alu_type() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.SDPOp.alu_type) + return static_cast< ::nvdla_prototest_interface::ALUType >(alu_type_); +} +inline void SDPOp::set_alu_type(::nvdla_prototest_interface::ALUType value) { + assert(::nvdla_prototest_interface::ALUType_IsValid(value)); + set_has_alu_type(); + alu_type_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.SDPOp.alu_type) +} + +// required .nvdla_prototest_interface.SDPOpType type = 3; +inline bool SDPOp::has_type() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void SDPOp::set_has_type() { + _has_bits_[0] |= 0x00000004u; +} +inline void SDPOp::clear_has_type() { + _has_bits_[0] &= ~0x00000004u; +} +inline void SDPOp::clear_type() { + type_ = 0; + clear_has_type(); +} +inline ::nvdla_prototest_interface::SDPOpType SDPOp::type() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.SDPOp.type) + return static_cast< ::nvdla_prototest_interface::SDPOpType >(type_); +} +inline void SDPOp::set_type(::nvdla_prototest_interface::SDPOpType value) { + assert(::nvdla_prototest_interface::SDPOpType_IsValid(value)); + set_has_type(); + type_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.SDPOp.type) +} + +// required .nvdla_prototest_interface.SDPOp.SDPOpMode mode = 4; +inline bool SDPOp::has_mode() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void SDPOp::set_has_mode() { + _has_bits_[0] |= 0x00000008u; +} +inline void SDPOp::clear_has_mode() { + _has_bits_[0] &= ~0x00000008u; +} +inline void SDPOp::clear_mode() { + mode_ = 0; + clear_has_mode(); +} +inline ::nvdla_prototest_interface::SDPOp_SDPOpMode SDPOp::mode() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.SDPOp.mode) + return static_cast< ::nvdla_prototest_interface::SDPOp_SDPOpMode >(mode_); +} +inline void SDPOp::set_mode(::nvdla_prototest_interface::SDPOp_SDPOpMode value) { + assert(::nvdla_prototest_interface::SDPOp_SDPOpMode_IsValid(value)); + set_has_mode(); + mode_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.SDPOp.mode) +} + +// required .nvdla_prototest_interface.SDPActivation act = 5; +inline bool SDPOp::has_act() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +inline void SDPOp::set_has_act() { + _has_bits_[0] |= 0x00000010u; +} +inline void SDPOp::clear_has_act() { + _has_bits_[0] &= ~0x00000010u; +} +inline void SDPOp::clear_act() { + act_ = 0; + clear_has_act(); +} +inline ::nvdla_prototest_interface::SDPActivation SDPOp::act() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.SDPOp.act) + return static_cast< ::nvdla_prototest_interface::SDPActivation >(act_); +} +inline void SDPOp::set_act(::nvdla_prototest_interface::SDPActivation value) { + assert(::nvdla_prototest_interface::SDPActivation_IsValid(value)); + set_has_act(); + act_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.SDPOp.act) +} + +// required uint32 shift_value = 6; +inline bool SDPOp::has_shift_value() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +inline void SDPOp::set_has_shift_value() { + _has_bits_[0] |= 0x00000020u; +} +inline void SDPOp::clear_has_shift_value() { + _has_bits_[0] &= ~0x00000020u; +} +inline void SDPOp::clear_shift_value() { + shift_value_ = 0u; + clear_has_shift_value(); +} +inline ::google::protobuf::uint32 SDPOp::shift_value() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.SDPOp.shift_value) + return shift_value_; +} +inline void SDPOp::set_shift_value(::google::protobuf::uint32 value) { + set_has_shift_value(); + shift_value_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.SDPOp.shift_value) +} + +// required uint32 truncate = 7; +inline bool SDPOp::has_truncate() const { + return (_has_bits_[0] & 0x00000040u) != 0; +} +inline void SDPOp::set_has_truncate() { + _has_bits_[0] |= 0x00000040u; +} +inline void SDPOp::clear_has_truncate() { + _has_bits_[0] &= ~0x00000040u; +} +inline void SDPOp::clear_truncate() { + truncate_ = 0u; + clear_has_truncate(); +} +inline ::google::protobuf::uint32 SDPOp::truncate() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.SDPOp.truncate) + return truncate_; +} +inline void SDPOp::set_truncate(::google::protobuf::uint32 value) { + set_has_truncate(); + truncate_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.SDPOp.truncate) +} + +// required .nvdla_prototest_interface.DataPrecision precision = 8; +inline bool SDPOp::has_precision() const { + return (_has_bits_[0] & 0x00000080u) != 0; +} +inline void SDPOp::set_has_precision() { + _has_bits_[0] |= 0x00000080u; +} +inline void SDPOp::clear_has_precision() { + _has_bits_[0] &= ~0x00000080u; +} +inline void SDPOp::clear_precision() { + precision_ = 0; + clear_has_precision(); +} +inline ::nvdla_prototest_interface::DataPrecision SDPOp::precision() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.SDPOp.precision) + return static_cast< ::nvdla_prototest_interface::DataPrecision >(precision_); +} +inline void SDPOp::set_precision(::nvdla_prototest_interface::DataPrecision value) { + assert(::nvdla_prototest_interface::DataPrecision_IsValid(value)); + set_has_precision(); + precision_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.SDPOp.precision) +} + +// required int32 alu_operand = 9; +inline bool SDPOp::has_alu_operand() const { + return (_has_bits_[0] & 0x00000100u) != 0; +} +inline void SDPOp::set_has_alu_operand() { + _has_bits_[0] |= 0x00000100u; +} +inline void SDPOp::clear_has_alu_operand() { + _has_bits_[0] &= ~0x00000100u; +} +inline void SDPOp::clear_alu_operand() { + alu_operand_ = 0; + clear_has_alu_operand(); +} +inline ::google::protobuf::int32 SDPOp::alu_operand() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.SDPOp.alu_operand) + return alu_operand_; +} +inline void SDPOp::set_alu_operand(::google::protobuf::int32 value) { + set_has_alu_operand(); + alu_operand_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.SDPOp.alu_operand) +} + +// required int32 mul_operand = 10; +inline bool SDPOp::has_mul_operand() const { + return (_has_bits_[0] & 0x00000200u) != 0; +} +inline void SDPOp::set_has_mul_operand() { + _has_bits_[0] |= 0x00000200u; +} +inline void SDPOp::clear_has_mul_operand() { + _has_bits_[0] &= ~0x00000200u; +} +inline void SDPOp::clear_mul_operand() { + mul_operand_ = 0; + clear_has_mul_operand(); +} +inline ::google::protobuf::int32 SDPOp::mul_operand() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.SDPOp.mul_operand) + return mul_operand_; +} +inline void SDPOp::set_mul_operand(::google::protobuf::int32 value) { + set_has_mul_operand(); + mul_operand_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.SDPOp.mul_operand) +} + +// required .nvdla_prototest_interface.SDPCvt cvt = 11; +inline bool SDPOp::has_cvt() const { + return (_has_bits_[0] & 0x00000400u) != 0; +} +inline void SDPOp::set_has_cvt() { + _has_bits_[0] |= 0x00000400u; +} +inline void SDPOp::clear_has_cvt() { + _has_bits_[0] &= ~0x00000400u; +} +inline void SDPOp::clear_cvt() { + if (cvt_ != NULL) cvt_->::nvdla_prototest_interface::SDPCvt::Clear(); + clear_has_cvt(); +} +inline const ::nvdla_prototest_interface::SDPCvt& SDPOp::cvt() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.SDPOp.cvt) + return cvt_ != NULL ? *cvt_ : *default_instance_->cvt_; +} +inline ::nvdla_prototest_interface::SDPCvt* SDPOp::mutable_cvt() { + set_has_cvt(); + if (cvt_ == NULL) cvt_ = new ::nvdla_prototest_interface::SDPCvt; + // @@protoc_insertion_point(field_mutable:nvdla_prototest_interface.SDPOp.cvt) + return cvt_; +} +inline ::nvdla_prototest_interface::SDPCvt* SDPOp::release_cvt() { + clear_has_cvt(); + ::nvdla_prototest_interface::SDPCvt* temp = cvt_; + cvt_ = NULL; + return temp; +} +inline void SDPOp::set_allocated_cvt(::nvdla_prototest_interface::SDPCvt* cvt) { + delete cvt_; + cvt_ = cvt; + if (cvt) { + set_has_cvt(); + } else { + clear_has_cvt(); + } + // @@protoc_insertion_point(field_set_allocated:nvdla_prototest_interface.SDPOp.cvt) +} + +// ------------------------------------------------------------------- + +// SDPSurfaceDesc + +// required .nvdla_prototest_interface.DataCube src_data = 1; +inline bool SDPSurfaceDesc::has_src_data() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void SDPSurfaceDesc::set_has_src_data() { + _has_bits_[0] |= 0x00000001u; +} +inline void SDPSurfaceDesc::clear_has_src_data() { + _has_bits_[0] &= ~0x00000001u; +} +inline void SDPSurfaceDesc::clear_src_data() { + if (src_data_ != NULL) src_data_->::nvdla_prototest_interface::DataCube::Clear(); + clear_has_src_data(); +} +inline const ::nvdla_prototest_interface::DataCube& SDPSurfaceDesc::src_data() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.SDPSurfaceDesc.src_data) + return src_data_ != NULL ? *src_data_ : *default_instance_->src_data_; +} +inline ::nvdla_prototest_interface::DataCube* SDPSurfaceDesc::mutable_src_data() { + set_has_src_data(); + if (src_data_ == NULL) src_data_ = new ::nvdla_prototest_interface::DataCube; + // @@protoc_insertion_point(field_mutable:nvdla_prototest_interface.SDPSurfaceDesc.src_data) + return src_data_; +} +inline ::nvdla_prototest_interface::DataCube* SDPSurfaceDesc::release_src_data() { + clear_has_src_data(); + ::nvdla_prototest_interface::DataCube* temp = src_data_; + src_data_ = NULL; + return temp; +} +inline void SDPSurfaceDesc::set_allocated_src_data(::nvdla_prototest_interface::DataCube* src_data) { + delete src_data_; + src_data_ = src_data; + if (src_data) { + set_has_src_data(); + } else { + clear_has_src_data(); + } + // @@protoc_insertion_point(field_set_allocated:nvdla_prototest_interface.SDPSurfaceDesc.src_data) +} + +// optional .nvdla_prototest_interface.DataCube x1_data = 2; +inline bool SDPSurfaceDesc::has_x1_data() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void SDPSurfaceDesc::set_has_x1_data() { + _has_bits_[0] |= 0x00000002u; +} +inline void SDPSurfaceDesc::clear_has_x1_data() { + _has_bits_[0] &= ~0x00000002u; +} +inline void SDPSurfaceDesc::clear_x1_data() { + if (x1_data_ != NULL) x1_data_->::nvdla_prototest_interface::DataCube::Clear(); + clear_has_x1_data(); +} +inline const ::nvdla_prototest_interface::DataCube& SDPSurfaceDesc::x1_data() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.SDPSurfaceDesc.x1_data) + return x1_data_ != NULL ? *x1_data_ : *default_instance_->x1_data_; +} +inline ::nvdla_prototest_interface::DataCube* SDPSurfaceDesc::mutable_x1_data() { + set_has_x1_data(); + if (x1_data_ == NULL) x1_data_ = new ::nvdla_prototest_interface::DataCube; + // @@protoc_insertion_point(field_mutable:nvdla_prototest_interface.SDPSurfaceDesc.x1_data) + return x1_data_; +} +inline ::nvdla_prototest_interface::DataCube* SDPSurfaceDesc::release_x1_data() { + clear_has_x1_data(); + ::nvdla_prototest_interface::DataCube* temp = x1_data_; + x1_data_ = NULL; + return temp; +} +inline void SDPSurfaceDesc::set_allocated_x1_data(::nvdla_prototest_interface::DataCube* x1_data) { + delete x1_data_; + x1_data_ = x1_data; + if (x1_data) { + set_has_x1_data(); + } else { + clear_has_x1_data(); + } + // @@protoc_insertion_point(field_set_allocated:nvdla_prototest_interface.SDPSurfaceDesc.x1_data) +} + +// optional .nvdla_prototest_interface.DataCube x2_data = 3; +inline bool SDPSurfaceDesc::has_x2_data() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void SDPSurfaceDesc::set_has_x2_data() { + _has_bits_[0] |= 0x00000004u; +} +inline void SDPSurfaceDesc::clear_has_x2_data() { + _has_bits_[0] &= ~0x00000004u; +} +inline void SDPSurfaceDesc::clear_x2_data() { + if (x2_data_ != NULL) x2_data_->::nvdla_prototest_interface::DataCube::Clear(); + clear_has_x2_data(); +} +inline const ::nvdla_prototest_interface::DataCube& SDPSurfaceDesc::x2_data() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.SDPSurfaceDesc.x2_data) + return x2_data_ != NULL ? *x2_data_ : *default_instance_->x2_data_; +} +inline ::nvdla_prototest_interface::DataCube* SDPSurfaceDesc::mutable_x2_data() { + set_has_x2_data(); + if (x2_data_ == NULL) x2_data_ = new ::nvdla_prototest_interface::DataCube; + // @@protoc_insertion_point(field_mutable:nvdla_prototest_interface.SDPSurfaceDesc.x2_data) + return x2_data_; +} +inline ::nvdla_prototest_interface::DataCube* SDPSurfaceDesc::release_x2_data() { + clear_has_x2_data(); + ::nvdla_prototest_interface::DataCube* temp = x2_data_; + x2_data_ = NULL; + return temp; +} +inline void SDPSurfaceDesc::set_allocated_x2_data(::nvdla_prototest_interface::DataCube* x2_data) { + delete x2_data_; + x2_data_ = x2_data; + if (x2_data) { + set_has_x2_data(); + } else { + clear_has_x2_data(); + } + // @@protoc_insertion_point(field_set_allocated:nvdla_prototest_interface.SDPSurfaceDesc.x2_data) +} + +// optional .nvdla_prototest_interface.DataCube y_data = 4; +inline bool SDPSurfaceDesc::has_y_data() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void SDPSurfaceDesc::set_has_y_data() { + _has_bits_[0] |= 0x00000008u; +} +inline void SDPSurfaceDesc::clear_has_y_data() { + _has_bits_[0] &= ~0x00000008u; +} +inline void SDPSurfaceDesc::clear_y_data() { + if (y_data_ != NULL) y_data_->::nvdla_prototest_interface::DataCube::Clear(); + clear_has_y_data(); +} +inline const ::nvdla_prototest_interface::DataCube& SDPSurfaceDesc::y_data() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.SDPSurfaceDesc.y_data) + return y_data_ != NULL ? *y_data_ : *default_instance_->y_data_; +} +inline ::nvdla_prototest_interface::DataCube* SDPSurfaceDesc::mutable_y_data() { + set_has_y_data(); + if (y_data_ == NULL) y_data_ = new ::nvdla_prototest_interface::DataCube; + // @@protoc_insertion_point(field_mutable:nvdla_prototest_interface.SDPSurfaceDesc.y_data) + return y_data_; +} +inline ::nvdla_prototest_interface::DataCube* SDPSurfaceDesc::release_y_data() { + clear_has_y_data(); + ::nvdla_prototest_interface::DataCube* temp = y_data_; + y_data_ = NULL; + return temp; +} +inline void SDPSurfaceDesc::set_allocated_y_data(::nvdla_prototest_interface::DataCube* y_data) { + delete y_data_; + y_data_ = y_data; + if (y_data) { + set_has_y_data(); + } else { + clear_has_y_data(); + } + // @@protoc_insertion_point(field_set_allocated:nvdla_prototest_interface.SDPSurfaceDesc.y_data) +} + +// required .nvdla_prototest_interface.DataCube dst_data = 5; +inline bool SDPSurfaceDesc::has_dst_data() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +inline void SDPSurfaceDesc::set_has_dst_data() { + _has_bits_[0] |= 0x00000010u; +} +inline void SDPSurfaceDesc::clear_has_dst_data() { + _has_bits_[0] &= ~0x00000010u; +} +inline void SDPSurfaceDesc::clear_dst_data() { + if (dst_data_ != NULL) dst_data_->::nvdla_prototest_interface::DataCube::Clear(); + clear_has_dst_data(); +} +inline const ::nvdla_prototest_interface::DataCube& SDPSurfaceDesc::dst_data() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.SDPSurfaceDesc.dst_data) + return dst_data_ != NULL ? *dst_data_ : *default_instance_->dst_data_; +} +inline ::nvdla_prototest_interface::DataCube* SDPSurfaceDesc::mutable_dst_data() { + set_has_dst_data(); + if (dst_data_ == NULL) dst_data_ = new ::nvdla_prototest_interface::DataCube; + // @@protoc_insertion_point(field_mutable:nvdla_prototest_interface.SDPSurfaceDesc.dst_data) + return dst_data_; +} +inline ::nvdla_prototest_interface::DataCube* SDPSurfaceDesc::release_dst_data() { + clear_has_dst_data(); + ::nvdla_prototest_interface::DataCube* temp = dst_data_; + dst_data_ = NULL; + return temp; +} +inline void SDPSurfaceDesc::set_allocated_dst_data(::nvdla_prototest_interface::DataCube* dst_data) { + delete dst_data_; + dst_data_ = dst_data; + if (dst_data) { + set_has_dst_data(); + } else { + clear_has_dst_data(); + } + // @@protoc_insertion_point(field_set_allocated:nvdla_prototest_interface.SDPSurfaceDesc.dst_data) +} + +// ------------------------------------------------------------------- + +// SDPOpDesc + +// required .nvdla_prototest_interface.DataPrecision src_precision = 1; +inline bool SDPOpDesc::has_src_precision() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void SDPOpDesc::set_has_src_precision() { + _has_bits_[0] |= 0x00000001u; +} +inline void SDPOpDesc::clear_has_src_precision() { + _has_bits_[0] &= ~0x00000001u; +} +inline void SDPOpDesc::clear_src_precision() { + src_precision_ = 0; + clear_has_src_precision(); +} +inline ::nvdla_prototest_interface::DataPrecision SDPOpDesc::src_precision() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.SDPOpDesc.src_precision) + return static_cast< ::nvdla_prototest_interface::DataPrecision >(src_precision_); +} +inline void SDPOpDesc::set_src_precision(::nvdla_prototest_interface::DataPrecision value) { + assert(::nvdla_prototest_interface::DataPrecision_IsValid(value)); + set_has_src_precision(); + src_precision_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.SDPOpDesc.src_precision) +} + +// required .nvdla_prototest_interface.DataPrecision dst_precision = 2; +inline bool SDPOpDesc::has_dst_precision() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void SDPOpDesc::set_has_dst_precision() { + _has_bits_[0] |= 0x00000002u; +} +inline void SDPOpDesc::clear_has_dst_precision() { + _has_bits_[0] &= ~0x00000002u; +} +inline void SDPOpDesc::clear_dst_precision() { + dst_precision_ = 0; + clear_has_dst_precision(); +} +inline ::nvdla_prototest_interface::DataPrecision SDPOpDesc::dst_precision() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.SDPOpDesc.dst_precision) + return static_cast< ::nvdla_prototest_interface::DataPrecision >(dst_precision_); +} +inline void SDPOpDesc::set_dst_precision(::nvdla_prototest_interface::DataPrecision value) { + assert(::nvdla_prototest_interface::DataPrecision_IsValid(value)); + set_has_dst_precision(); + dst_precision_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.SDPOpDesc.dst_precision) +} + +// required int32 lut_index = 3; +inline bool SDPOpDesc::has_lut_index() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void SDPOpDesc::set_has_lut_index() { + _has_bits_[0] |= 0x00000004u; +} +inline void SDPOpDesc::clear_has_lut_index() { + _has_bits_[0] &= ~0x00000004u; +} +inline void SDPOpDesc::clear_lut_index() { + lut_index_ = 0; + clear_has_lut_index(); +} +inline ::google::protobuf::int32 SDPOpDesc::lut_index() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.SDPOpDesc.lut_index) + return lut_index_; +} +inline void SDPOpDesc::set_lut_index(::google::protobuf::int32 value) { + set_has_lut_index(); + lut_index_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.SDPOpDesc.lut_index) +} + +// required .nvdla_prototest_interface.CVTParam out_cvt = 4; +inline bool SDPOpDesc::has_out_cvt() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void SDPOpDesc::set_has_out_cvt() { + _has_bits_[0] |= 0x00000008u; +} +inline void SDPOpDesc::clear_has_out_cvt() { + _has_bits_[0] &= ~0x00000008u; +} +inline void SDPOpDesc::clear_out_cvt() { + if (out_cvt_ != NULL) out_cvt_->::nvdla_prototest_interface::CVTParam::Clear(); + clear_has_out_cvt(); +} +inline const ::nvdla_prototest_interface::CVTParam& SDPOpDesc::out_cvt() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.SDPOpDesc.out_cvt) + return out_cvt_ != NULL ? *out_cvt_ : *default_instance_->out_cvt_; +} +inline ::nvdla_prototest_interface::CVTParam* SDPOpDesc::mutable_out_cvt() { + set_has_out_cvt(); + if (out_cvt_ == NULL) out_cvt_ = new ::nvdla_prototest_interface::CVTParam; + // @@protoc_insertion_point(field_mutable:nvdla_prototest_interface.SDPOpDesc.out_cvt) + return out_cvt_; +} +inline ::nvdla_prototest_interface::CVTParam* SDPOpDesc::release_out_cvt() { + clear_has_out_cvt(); + ::nvdla_prototest_interface::CVTParam* temp = out_cvt_; + out_cvt_ = NULL; + return temp; +} +inline void SDPOpDesc::set_allocated_out_cvt(::nvdla_prototest_interface::CVTParam* out_cvt) { + delete out_cvt_; + out_cvt_ = out_cvt; + if (out_cvt) { + set_has_out_cvt(); + } else { + clear_has_out_cvt(); + } + // @@protoc_insertion_point(field_set_allocated:nvdla_prototest_interface.SDPOpDesc.out_cvt) +} + +// required .nvdla_prototest_interface.ConvMode conv_mode = 5; +inline bool SDPOpDesc::has_conv_mode() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +inline void SDPOpDesc::set_has_conv_mode() { + _has_bits_[0] |= 0x00000010u; +} +inline void SDPOpDesc::clear_has_conv_mode() { + _has_bits_[0] &= ~0x00000010u; +} +inline void SDPOpDesc::clear_conv_mode() { + conv_mode_ = 0; + clear_has_conv_mode(); +} +inline ::nvdla_prototest_interface::ConvMode SDPOpDesc::conv_mode() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.SDPOpDesc.conv_mode) + return static_cast< ::nvdla_prototest_interface::ConvMode >(conv_mode_); +} +inline void SDPOpDesc::set_conv_mode(::nvdla_prototest_interface::ConvMode value) { + assert(::nvdla_prototest_interface::ConvMode_IsValid(value)); + set_has_conv_mode(); + conv_mode_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.SDPOpDesc.conv_mode) +} + +// required uint32 batch_num = 6; +inline bool SDPOpDesc::has_batch_num() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +inline void SDPOpDesc::set_has_batch_num() { + _has_bits_[0] |= 0x00000020u; +} +inline void SDPOpDesc::clear_has_batch_num() { + _has_bits_[0] &= ~0x00000020u; +} +inline void SDPOpDesc::clear_batch_num() { + batch_num_ = 0u; + clear_has_batch_num(); +} +inline ::google::protobuf::uint32 SDPOpDesc::batch_num() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.SDPOpDesc.batch_num) + return batch_num_; +} +inline void SDPOpDesc::set_batch_num(::google::protobuf::uint32 value) { + set_has_batch_num(); + batch_num_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.SDPOpDesc.batch_num) +} + +// optional uint32 reserved0 = 7 [default = 0]; +inline bool SDPOpDesc::has_reserved0() const { + return (_has_bits_[0] & 0x00000040u) != 0; +} +inline void SDPOpDesc::set_has_reserved0() { + _has_bits_[0] |= 0x00000040u; +} +inline void SDPOpDesc::clear_has_reserved0() { + _has_bits_[0] &= ~0x00000040u; +} +inline void SDPOpDesc::clear_reserved0() { + reserved0_ = 0u; + clear_has_reserved0(); +} +inline ::google::protobuf::uint32 SDPOpDesc::reserved0() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.SDPOpDesc.reserved0) + return reserved0_; +} +inline void SDPOpDesc::set_reserved0(::google::protobuf::uint32 value) { + set_has_reserved0(); + reserved0_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.SDPOpDesc.reserved0) +} + +// required uint32 batch_stride = 8; +inline bool SDPOpDesc::has_batch_stride() const { + return (_has_bits_[0] & 0x00000080u) != 0; +} +inline void SDPOpDesc::set_has_batch_stride() { + _has_bits_[0] |= 0x00000080u; +} +inline void SDPOpDesc::clear_has_batch_stride() { + _has_bits_[0] &= ~0x00000080u; +} +inline void SDPOpDesc::clear_batch_stride() { + batch_stride_ = 0u; + clear_has_batch_stride(); +} +inline ::google::protobuf::uint32 SDPOpDesc::batch_stride() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.SDPOpDesc.batch_stride) + return batch_stride_; +} +inline void SDPOpDesc::set_batch_stride(::google::protobuf::uint32 value) { + set_has_batch_stride(); + batch_stride_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.SDPOpDesc.batch_stride) +} + +// required .nvdla_prototest_interface.SDPOp x1_op = 9; +inline bool SDPOpDesc::has_x1_op() const { + return (_has_bits_[0] & 0x00000100u) != 0; +} +inline void SDPOpDesc::set_has_x1_op() { + _has_bits_[0] |= 0x00000100u; +} +inline void SDPOpDesc::clear_has_x1_op() { + _has_bits_[0] &= ~0x00000100u; +} +inline void SDPOpDesc::clear_x1_op() { + if (x1_op_ != NULL) x1_op_->::nvdla_prototest_interface::SDPOp::Clear(); + clear_has_x1_op(); +} +inline const ::nvdla_prototest_interface::SDPOp& SDPOpDesc::x1_op() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.SDPOpDesc.x1_op) + return x1_op_ != NULL ? *x1_op_ : *default_instance_->x1_op_; +} +inline ::nvdla_prototest_interface::SDPOp* SDPOpDesc::mutable_x1_op() { + set_has_x1_op(); + if (x1_op_ == NULL) x1_op_ = new ::nvdla_prototest_interface::SDPOp; + // @@protoc_insertion_point(field_mutable:nvdla_prototest_interface.SDPOpDesc.x1_op) + return x1_op_; +} +inline ::nvdla_prototest_interface::SDPOp* SDPOpDesc::release_x1_op() { + clear_has_x1_op(); + ::nvdla_prototest_interface::SDPOp* temp = x1_op_; + x1_op_ = NULL; + return temp; +} +inline void SDPOpDesc::set_allocated_x1_op(::nvdla_prototest_interface::SDPOp* x1_op) { + delete x1_op_; + x1_op_ = x1_op; + if (x1_op) { + set_has_x1_op(); + } else { + clear_has_x1_op(); + } + // @@protoc_insertion_point(field_set_allocated:nvdla_prototest_interface.SDPOpDesc.x1_op) +} + +// required .nvdla_prototest_interface.SDPOp x2_op = 10; +inline bool SDPOpDesc::has_x2_op() const { + return (_has_bits_[0] & 0x00000200u) != 0; +} +inline void SDPOpDesc::set_has_x2_op() { + _has_bits_[0] |= 0x00000200u; +} +inline void SDPOpDesc::clear_has_x2_op() { + _has_bits_[0] &= ~0x00000200u; +} +inline void SDPOpDesc::clear_x2_op() { + if (x2_op_ != NULL) x2_op_->::nvdla_prototest_interface::SDPOp::Clear(); + clear_has_x2_op(); +} +inline const ::nvdla_prototest_interface::SDPOp& SDPOpDesc::x2_op() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.SDPOpDesc.x2_op) + return x2_op_ != NULL ? *x2_op_ : *default_instance_->x2_op_; +} +inline ::nvdla_prototest_interface::SDPOp* SDPOpDesc::mutable_x2_op() { + set_has_x2_op(); + if (x2_op_ == NULL) x2_op_ = new ::nvdla_prototest_interface::SDPOp; + // @@protoc_insertion_point(field_mutable:nvdla_prototest_interface.SDPOpDesc.x2_op) + return x2_op_; +} +inline ::nvdla_prototest_interface::SDPOp* SDPOpDesc::release_x2_op() { + clear_has_x2_op(); + ::nvdla_prototest_interface::SDPOp* temp = x2_op_; + x2_op_ = NULL; + return temp; +} +inline void SDPOpDesc::set_allocated_x2_op(::nvdla_prototest_interface::SDPOp* x2_op) { + delete x2_op_; + x2_op_ = x2_op; + if (x2_op) { + set_has_x2_op(); + } else { + clear_has_x2_op(); + } + // @@protoc_insertion_point(field_set_allocated:nvdla_prototest_interface.SDPOpDesc.x2_op) +} + +// required .nvdla_prototest_interface.SDPOp y_op = 11; +inline bool SDPOpDesc::has_y_op() const { + return (_has_bits_[0] & 0x00000400u) != 0; +} +inline void SDPOpDesc::set_has_y_op() { + _has_bits_[0] |= 0x00000400u; +} +inline void SDPOpDesc::clear_has_y_op() { + _has_bits_[0] &= ~0x00000400u; +} +inline void SDPOpDesc::clear_y_op() { + if (y_op_ != NULL) y_op_->::nvdla_prototest_interface::SDPOp::Clear(); + clear_has_y_op(); +} +inline const ::nvdla_prototest_interface::SDPOp& SDPOpDesc::y_op() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.SDPOpDesc.y_op) + return y_op_ != NULL ? *y_op_ : *default_instance_->y_op_; +} +inline ::nvdla_prototest_interface::SDPOp* SDPOpDesc::mutable_y_op() { + set_has_y_op(); + if (y_op_ == NULL) y_op_ = new ::nvdla_prototest_interface::SDPOp; + // @@protoc_insertion_point(field_mutable:nvdla_prototest_interface.SDPOpDesc.y_op) + return y_op_; +} +inline ::nvdla_prototest_interface::SDPOp* SDPOpDesc::release_y_op() { + clear_has_y_op(); + ::nvdla_prototest_interface::SDPOp* temp = y_op_; + y_op_ = NULL; + return temp; +} +inline void SDPOpDesc::set_allocated_y_op(::nvdla_prototest_interface::SDPOp* y_op) { + delete y_op_; + y_op_ = y_op; + if (y_op) { + set_has_y_op(); + } else { + clear_has_y_op(); + } + // @@protoc_insertion_point(field_set_allocated:nvdla_prototest_interface.SDPOpDesc.y_op) +} + +// ------------------------------------------------------------------- + +// PDPSurfaceDesc + +// required .nvdla_prototest_interface.DataCube src_data = 1; +inline bool PDPSurfaceDesc::has_src_data() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void PDPSurfaceDesc::set_has_src_data() { + _has_bits_[0] |= 0x00000001u; +} +inline void PDPSurfaceDesc::clear_has_src_data() { + _has_bits_[0] &= ~0x00000001u; +} +inline void PDPSurfaceDesc::clear_src_data() { + if (src_data_ != NULL) src_data_->::nvdla_prototest_interface::DataCube::Clear(); + clear_has_src_data(); +} +inline const ::nvdla_prototest_interface::DataCube& PDPSurfaceDesc::src_data() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.PDPSurfaceDesc.src_data) + return src_data_ != NULL ? *src_data_ : *default_instance_->src_data_; +} +inline ::nvdla_prototest_interface::DataCube* PDPSurfaceDesc::mutable_src_data() { + set_has_src_data(); + if (src_data_ == NULL) src_data_ = new ::nvdla_prototest_interface::DataCube; + // @@protoc_insertion_point(field_mutable:nvdla_prototest_interface.PDPSurfaceDesc.src_data) + return src_data_; +} +inline ::nvdla_prototest_interface::DataCube* PDPSurfaceDesc::release_src_data() { + clear_has_src_data(); + ::nvdla_prototest_interface::DataCube* temp = src_data_; + src_data_ = NULL; + return temp; +} +inline void PDPSurfaceDesc::set_allocated_src_data(::nvdla_prototest_interface::DataCube* src_data) { + delete src_data_; + src_data_ = src_data; + if (src_data) { + set_has_src_data(); + } else { + clear_has_src_data(); + } + // @@protoc_insertion_point(field_set_allocated:nvdla_prototest_interface.PDPSurfaceDesc.src_data) +} + +// required .nvdla_prototest_interface.DataCube dst_data = 2; +inline bool PDPSurfaceDesc::has_dst_data() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void PDPSurfaceDesc::set_has_dst_data() { + _has_bits_[0] |= 0x00000002u; +} +inline void PDPSurfaceDesc::clear_has_dst_data() { + _has_bits_[0] &= ~0x00000002u; +} +inline void PDPSurfaceDesc::clear_dst_data() { + if (dst_data_ != NULL) dst_data_->::nvdla_prototest_interface::DataCube::Clear(); + clear_has_dst_data(); +} +inline const ::nvdla_prototest_interface::DataCube& PDPSurfaceDesc::dst_data() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.PDPSurfaceDesc.dst_data) + return dst_data_ != NULL ? *dst_data_ : *default_instance_->dst_data_; +} +inline ::nvdla_prototest_interface::DataCube* PDPSurfaceDesc::mutable_dst_data() { + set_has_dst_data(); + if (dst_data_ == NULL) dst_data_ = new ::nvdla_prototest_interface::DataCube; + // @@protoc_insertion_point(field_mutable:nvdla_prototest_interface.PDPSurfaceDesc.dst_data) + return dst_data_; +} +inline ::nvdla_prototest_interface::DataCube* PDPSurfaceDesc::release_dst_data() { + clear_has_dst_data(); + ::nvdla_prototest_interface::DataCube* temp = dst_data_; + dst_data_ = NULL; + return temp; +} +inline void PDPSurfaceDesc::set_allocated_dst_data(::nvdla_prototest_interface::DataCube* dst_data) { + delete dst_data_; + dst_data_ = dst_data; + if (dst_data) { + set_has_dst_data(); + } else { + clear_has_dst_data(); + } + // @@protoc_insertion_point(field_set_allocated:nvdla_prototest_interface.PDPSurfaceDesc.dst_data) +} + +// ------------------------------------------------------------------- + +// PDPOpDesc + +// required uint32 partial_in_width_first = 1; +inline bool PDPOpDesc::has_partial_in_width_first() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void PDPOpDesc::set_has_partial_in_width_first() { + _has_bits_[0] |= 0x00000001u; +} +inline void PDPOpDesc::clear_has_partial_in_width_first() { + _has_bits_[0] &= ~0x00000001u; +} +inline void PDPOpDesc::clear_partial_in_width_first() { + partial_in_width_first_ = 0u; + clear_has_partial_in_width_first(); +} +inline ::google::protobuf::uint32 PDPOpDesc::partial_in_width_first() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.PDPOpDesc.partial_in_width_first) + return partial_in_width_first_; +} +inline void PDPOpDesc::set_partial_in_width_first(::google::protobuf::uint32 value) { + set_has_partial_in_width_first(); + partial_in_width_first_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.PDPOpDesc.partial_in_width_first) +} + +// required uint32 partial_in_width_mid = 2; +inline bool PDPOpDesc::has_partial_in_width_mid() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void PDPOpDesc::set_has_partial_in_width_mid() { + _has_bits_[0] |= 0x00000002u; +} +inline void PDPOpDesc::clear_has_partial_in_width_mid() { + _has_bits_[0] &= ~0x00000002u; +} +inline void PDPOpDesc::clear_partial_in_width_mid() { + partial_in_width_mid_ = 0u; + clear_has_partial_in_width_mid(); +} +inline ::google::protobuf::uint32 PDPOpDesc::partial_in_width_mid() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.PDPOpDesc.partial_in_width_mid) + return partial_in_width_mid_; +} +inline void PDPOpDesc::set_partial_in_width_mid(::google::protobuf::uint32 value) { + set_has_partial_in_width_mid(); + partial_in_width_mid_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.PDPOpDesc.partial_in_width_mid) +} + +// required uint32 partial_in_width_last = 3; +inline bool PDPOpDesc::has_partial_in_width_last() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void PDPOpDesc::set_has_partial_in_width_last() { + _has_bits_[0] |= 0x00000004u; +} +inline void PDPOpDesc::clear_has_partial_in_width_last() { + _has_bits_[0] &= ~0x00000004u; +} +inline void PDPOpDesc::clear_partial_in_width_last() { + partial_in_width_last_ = 0u; + clear_has_partial_in_width_last(); +} +inline ::google::protobuf::uint32 PDPOpDesc::partial_in_width_last() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.PDPOpDesc.partial_in_width_last) + return partial_in_width_last_; +} +inline void PDPOpDesc::set_partial_in_width_last(::google::protobuf::uint32 value) { + set_has_partial_in_width_last(); + partial_in_width_last_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.PDPOpDesc.partial_in_width_last) +} + +// required uint32 partial_width_first = 4; +inline bool PDPOpDesc::has_partial_width_first() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void PDPOpDesc::set_has_partial_width_first() { + _has_bits_[0] |= 0x00000008u; +} +inline void PDPOpDesc::clear_has_partial_width_first() { + _has_bits_[0] &= ~0x00000008u; +} +inline void PDPOpDesc::clear_partial_width_first() { + partial_width_first_ = 0u; + clear_has_partial_width_first(); +} +inline ::google::protobuf::uint32 PDPOpDesc::partial_width_first() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.PDPOpDesc.partial_width_first) + return partial_width_first_; +} +inline void PDPOpDesc::set_partial_width_first(::google::protobuf::uint32 value) { + set_has_partial_width_first(); + partial_width_first_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.PDPOpDesc.partial_width_first) +} + +// required uint32 partial_width_mid = 5; +inline bool PDPOpDesc::has_partial_width_mid() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +inline void PDPOpDesc::set_has_partial_width_mid() { + _has_bits_[0] |= 0x00000010u; +} +inline void PDPOpDesc::clear_has_partial_width_mid() { + _has_bits_[0] &= ~0x00000010u; +} +inline void PDPOpDesc::clear_partial_width_mid() { + partial_width_mid_ = 0u; + clear_has_partial_width_mid(); +} +inline ::google::protobuf::uint32 PDPOpDesc::partial_width_mid() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.PDPOpDesc.partial_width_mid) + return partial_width_mid_; +} +inline void PDPOpDesc::set_partial_width_mid(::google::protobuf::uint32 value) { + set_has_partial_width_mid(); + partial_width_mid_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.PDPOpDesc.partial_width_mid) +} + +// required uint32 partial_width_last = 6; +inline bool PDPOpDesc::has_partial_width_last() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +inline void PDPOpDesc::set_has_partial_width_last() { + _has_bits_[0] |= 0x00000020u; +} +inline void PDPOpDesc::clear_has_partial_width_last() { + _has_bits_[0] &= ~0x00000020u; +} +inline void PDPOpDesc::clear_partial_width_last() { + partial_width_last_ = 0u; + clear_has_partial_width_last(); +} +inline ::google::protobuf::uint32 PDPOpDesc::partial_width_last() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.PDPOpDesc.partial_width_last) + return partial_width_last_; +} +inline void PDPOpDesc::set_partial_width_last(::google::protobuf::uint32 value) { + set_has_partial_width_last(); + partial_width_last_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.PDPOpDesc.partial_width_last) +} + +// required uint32 split_num = 7; +inline bool PDPOpDesc::has_split_num() const { + return (_has_bits_[0] & 0x00000040u) != 0; +} +inline void PDPOpDesc::set_has_split_num() { + _has_bits_[0] |= 0x00000040u; +} +inline void PDPOpDesc::clear_has_split_num() { + _has_bits_[0] &= ~0x00000040u; +} +inline void PDPOpDesc::clear_split_num() { + split_num_ = 0u; + clear_has_split_num(); +} +inline ::google::protobuf::uint32 PDPOpDesc::split_num() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.PDPOpDesc.split_num) + return split_num_; +} +inline void PDPOpDesc::set_split_num(::google::protobuf::uint32 value) { + set_has_split_num(); + split_num_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.PDPOpDesc.split_num) +} + +// required .nvdla_prototest_interface.PDPOpDesc.PoolingMode pool_mode = 8; +inline bool PDPOpDesc::has_pool_mode() const { + return (_has_bits_[0] & 0x00000080u) != 0; +} +inline void PDPOpDesc::set_has_pool_mode() { + _has_bits_[0] |= 0x00000080u; +} +inline void PDPOpDesc::clear_has_pool_mode() { + _has_bits_[0] &= ~0x00000080u; +} +inline void PDPOpDesc::clear_pool_mode() { + pool_mode_ = 0; + clear_has_pool_mode(); +} +inline ::nvdla_prototest_interface::PDPOpDesc_PoolingMode PDPOpDesc::pool_mode() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.PDPOpDesc.pool_mode) + return static_cast< ::nvdla_prototest_interface::PDPOpDesc_PoolingMode >(pool_mode_); +} +inline void PDPOpDesc::set_pool_mode(::nvdla_prototest_interface::PDPOpDesc_PoolingMode value) { + assert(::nvdla_prototest_interface::PDPOpDesc_PoolingMode_IsValid(value)); + set_has_pool_mode(); + pool_mode_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.PDPOpDesc.pool_mode) +} + +// required .nvdla_prototest_interface.PoolSize pool_width = 9; +inline bool PDPOpDesc::has_pool_width() const { + return (_has_bits_[0] & 0x00000100u) != 0; +} +inline void PDPOpDesc::set_has_pool_width() { + _has_bits_[0] |= 0x00000100u; +} +inline void PDPOpDesc::clear_has_pool_width() { + _has_bits_[0] &= ~0x00000100u; +} +inline void PDPOpDesc::clear_pool_width() { + pool_width_ = 0; + clear_has_pool_width(); +} +inline ::nvdla_prototest_interface::PoolSize PDPOpDesc::pool_width() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.PDPOpDesc.pool_width) + return static_cast< ::nvdla_prototest_interface::PoolSize >(pool_width_); +} +inline void PDPOpDesc::set_pool_width(::nvdla_prototest_interface::PoolSize value) { + assert(::nvdla_prototest_interface::PoolSize_IsValid(value)); + set_has_pool_width(); + pool_width_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.PDPOpDesc.pool_width) +} + +// required .nvdla_prototest_interface.PoolSize pool_height = 10; +inline bool PDPOpDesc::has_pool_height() const { + return (_has_bits_[0] & 0x00000200u) != 0; +} +inline void PDPOpDesc::set_has_pool_height() { + _has_bits_[0] |= 0x00000200u; +} +inline void PDPOpDesc::clear_has_pool_height() { + _has_bits_[0] &= ~0x00000200u; +} +inline void PDPOpDesc::clear_pool_height() { + pool_height_ = 0; + clear_has_pool_height(); +} +inline ::nvdla_prototest_interface::PoolSize PDPOpDesc::pool_height() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.PDPOpDesc.pool_height) + return static_cast< ::nvdla_prototest_interface::PoolSize >(pool_height_); +} +inline void PDPOpDesc::set_pool_height(::nvdla_prototest_interface::PoolSize value) { + assert(::nvdla_prototest_interface::PoolSize_IsValid(value)); + set_has_pool_height(); + pool_height_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.PDPOpDesc.pool_height) +} + +// required uint32 stride_x = 11; +inline bool PDPOpDesc::has_stride_x() const { + return (_has_bits_[0] & 0x00000400u) != 0; +} +inline void PDPOpDesc::set_has_stride_x() { + _has_bits_[0] |= 0x00000400u; +} +inline void PDPOpDesc::clear_has_stride_x() { + _has_bits_[0] &= ~0x00000400u; +} +inline void PDPOpDesc::clear_stride_x() { + stride_x_ = 0u; + clear_has_stride_x(); +} +inline ::google::protobuf::uint32 PDPOpDesc::stride_x() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.PDPOpDesc.stride_x) + return stride_x_; +} +inline void PDPOpDesc::set_stride_x(::google::protobuf::uint32 value) { + set_has_stride_x(); + stride_x_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.PDPOpDesc.stride_x) +} + +// required uint32 stride_y = 12; +inline bool PDPOpDesc::has_stride_y() const { + return (_has_bits_[0] & 0x00000800u) != 0; +} +inline void PDPOpDesc::set_has_stride_y() { + _has_bits_[0] |= 0x00000800u; +} +inline void PDPOpDesc::clear_has_stride_y() { + _has_bits_[0] &= ~0x00000800u; +} +inline void PDPOpDesc::clear_stride_y() { + stride_y_ = 0u; + clear_has_stride_y(); +} +inline ::google::protobuf::uint32 PDPOpDesc::stride_y() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.PDPOpDesc.stride_y) + return stride_y_; +} +inline void PDPOpDesc::set_stride_y(::google::protobuf::uint32 value) { + set_has_stride_y(); + stride_y_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.PDPOpDesc.stride_y) +} + +// required uint32 pad_left = 13; +inline bool PDPOpDesc::has_pad_left() const { + return (_has_bits_[0] & 0x00001000u) != 0; +} +inline void PDPOpDesc::set_has_pad_left() { + _has_bits_[0] |= 0x00001000u; +} +inline void PDPOpDesc::clear_has_pad_left() { + _has_bits_[0] &= ~0x00001000u; +} +inline void PDPOpDesc::clear_pad_left() { + pad_left_ = 0u; + clear_has_pad_left(); +} +inline ::google::protobuf::uint32 PDPOpDesc::pad_left() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.PDPOpDesc.pad_left) + return pad_left_; +} +inline void PDPOpDesc::set_pad_left(::google::protobuf::uint32 value) { + set_has_pad_left(); + pad_left_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.PDPOpDesc.pad_left) +} + +// required uint32 pad_right = 14; +inline bool PDPOpDesc::has_pad_right() const { + return (_has_bits_[0] & 0x00002000u) != 0; +} +inline void PDPOpDesc::set_has_pad_right() { + _has_bits_[0] |= 0x00002000u; +} +inline void PDPOpDesc::clear_has_pad_right() { + _has_bits_[0] &= ~0x00002000u; +} +inline void PDPOpDesc::clear_pad_right() { + pad_right_ = 0u; + clear_has_pad_right(); +} +inline ::google::protobuf::uint32 PDPOpDesc::pad_right() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.PDPOpDesc.pad_right) + return pad_right_; +} +inline void PDPOpDesc::set_pad_right(::google::protobuf::uint32 value) { + set_has_pad_right(); + pad_right_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.PDPOpDesc.pad_right) +} + +// required uint32 pad_top = 15; +inline bool PDPOpDesc::has_pad_top() const { + return (_has_bits_[0] & 0x00004000u) != 0; +} +inline void PDPOpDesc::set_has_pad_top() { + _has_bits_[0] |= 0x00004000u; +} +inline void PDPOpDesc::clear_has_pad_top() { + _has_bits_[0] &= ~0x00004000u; +} +inline void PDPOpDesc::clear_pad_top() { + pad_top_ = 0u; + clear_has_pad_top(); +} +inline ::google::protobuf::uint32 PDPOpDesc::pad_top() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.PDPOpDesc.pad_top) + return pad_top_; +} +inline void PDPOpDesc::set_pad_top(::google::protobuf::uint32 value) { + set_has_pad_top(); + pad_top_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.PDPOpDesc.pad_top) +} + +// required uint32 pad_bottom = 16; +inline bool PDPOpDesc::has_pad_bottom() const { + return (_has_bits_[0] & 0x00008000u) != 0; +} +inline void PDPOpDesc::set_has_pad_bottom() { + _has_bits_[0] |= 0x00008000u; +} +inline void PDPOpDesc::clear_has_pad_bottom() { + _has_bits_[0] &= ~0x00008000u; +} +inline void PDPOpDesc::clear_pad_bottom() { + pad_bottom_ = 0u; + clear_has_pad_bottom(); +} +inline ::google::protobuf::uint32 PDPOpDesc::pad_bottom() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.PDPOpDesc.pad_bottom) + return pad_bottom_; +} +inline void PDPOpDesc::set_pad_bottom(::google::protobuf::uint32 value) { + set_has_pad_bottom(); + pad_bottom_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.PDPOpDesc.pad_bottom) +} + +// required .nvdla_prototest_interface.DataPrecision precision = 17; +inline bool PDPOpDesc::has_precision() const { + return (_has_bits_[0] & 0x00010000u) != 0; +} +inline void PDPOpDesc::set_has_precision() { + _has_bits_[0] |= 0x00010000u; +} +inline void PDPOpDesc::clear_has_precision() { + _has_bits_[0] &= ~0x00010000u; +} +inline void PDPOpDesc::clear_precision() { + precision_ = 0; + clear_has_precision(); +} +inline ::nvdla_prototest_interface::DataPrecision PDPOpDesc::precision() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.PDPOpDesc.precision) + return static_cast< ::nvdla_prototest_interface::DataPrecision >(precision_); +} +inline void PDPOpDesc::set_precision(::nvdla_prototest_interface::DataPrecision value) { + assert(::nvdla_prototest_interface::DataPrecision_IsValid(value)); + set_has_precision(); + precision_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.PDPOpDesc.precision) +} + +// optional uint32 reserved0 = 18 [default = 0]; +inline bool PDPOpDesc::has_reserved0() const { + return (_has_bits_[0] & 0x00020000u) != 0; +} +inline void PDPOpDesc::set_has_reserved0() { + _has_bits_[0] |= 0x00020000u; +} +inline void PDPOpDesc::clear_has_reserved0() { + _has_bits_[0] &= ~0x00020000u; +} +inline void PDPOpDesc::clear_reserved0() { + reserved0_ = 0u; + clear_has_reserved0(); +} +inline ::google::protobuf::uint32 PDPOpDesc::reserved0() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.PDPOpDesc.reserved0) + return reserved0_; +} +inline void PDPOpDesc::set_reserved0(::google::protobuf::uint32 value) { + set_has_reserved0(); + reserved0_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.PDPOpDesc.reserved0) +} + +// repeated int32 padding_value = 19 [packed = true]; +inline int PDPOpDesc::padding_value_size() const { + return padding_value_.size(); +} +inline void PDPOpDesc::clear_padding_value() { + padding_value_.Clear(); +} +inline ::google::protobuf::int32 PDPOpDesc::padding_value(int index) const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.PDPOpDesc.padding_value) + return padding_value_.Get(index); +} +inline void PDPOpDesc::set_padding_value(int index, ::google::protobuf::int32 value) { + padding_value_.Set(index, value); + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.PDPOpDesc.padding_value) +} +inline void PDPOpDesc::add_padding_value(::google::protobuf::int32 value) { + padding_value_.Add(value); + // @@protoc_insertion_point(field_add:nvdla_prototest_interface.PDPOpDesc.padding_value) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +PDPOpDesc::padding_value() const { + // @@protoc_insertion_point(field_list:nvdla_prototest_interface.PDPOpDesc.padding_value) + return padding_value_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +PDPOpDesc::mutable_padding_value() { + // @@protoc_insertion_point(field_mutable_list:nvdla_prototest_interface.PDPOpDesc.padding_value) + return &padding_value_; +} + +// ------------------------------------------------------------------- + +// CDPSurfaceDesc + +// required .nvdla_prototest_interface.DataCube src_data = 1; +inline bool CDPSurfaceDesc::has_src_data() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void CDPSurfaceDesc::set_has_src_data() { + _has_bits_[0] |= 0x00000001u; +} +inline void CDPSurfaceDesc::clear_has_src_data() { + _has_bits_[0] &= ~0x00000001u; +} +inline void CDPSurfaceDesc::clear_src_data() { + if (src_data_ != NULL) src_data_->::nvdla_prototest_interface::DataCube::Clear(); + clear_has_src_data(); +} +inline const ::nvdla_prototest_interface::DataCube& CDPSurfaceDesc::src_data() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CDPSurfaceDesc.src_data) + return src_data_ != NULL ? *src_data_ : *default_instance_->src_data_; +} +inline ::nvdla_prototest_interface::DataCube* CDPSurfaceDesc::mutable_src_data() { + set_has_src_data(); + if (src_data_ == NULL) src_data_ = new ::nvdla_prototest_interface::DataCube; + // @@protoc_insertion_point(field_mutable:nvdla_prototest_interface.CDPSurfaceDesc.src_data) + return src_data_; +} +inline ::nvdla_prototest_interface::DataCube* CDPSurfaceDesc::release_src_data() { + clear_has_src_data(); + ::nvdla_prototest_interface::DataCube* temp = src_data_; + src_data_ = NULL; + return temp; +} +inline void CDPSurfaceDesc::set_allocated_src_data(::nvdla_prototest_interface::DataCube* src_data) { + delete src_data_; + src_data_ = src_data; + if (src_data) { + set_has_src_data(); + } else { + clear_has_src_data(); + } + // @@protoc_insertion_point(field_set_allocated:nvdla_prototest_interface.CDPSurfaceDesc.src_data) +} + +// required .nvdla_prototest_interface.DataCube dst_data = 2; +inline bool CDPSurfaceDesc::has_dst_data() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void CDPSurfaceDesc::set_has_dst_data() { + _has_bits_[0] |= 0x00000002u; +} +inline void CDPSurfaceDesc::clear_has_dst_data() { + _has_bits_[0] &= ~0x00000002u; +} +inline void CDPSurfaceDesc::clear_dst_data() { + if (dst_data_ != NULL) dst_data_->::nvdla_prototest_interface::DataCube::Clear(); + clear_has_dst_data(); +} +inline const ::nvdla_prototest_interface::DataCube& CDPSurfaceDesc::dst_data() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CDPSurfaceDesc.dst_data) + return dst_data_ != NULL ? *dst_data_ : *default_instance_->dst_data_; +} +inline ::nvdla_prototest_interface::DataCube* CDPSurfaceDesc::mutable_dst_data() { + set_has_dst_data(); + if (dst_data_ == NULL) dst_data_ = new ::nvdla_prototest_interface::DataCube; + // @@protoc_insertion_point(field_mutable:nvdla_prototest_interface.CDPSurfaceDesc.dst_data) + return dst_data_; +} +inline ::nvdla_prototest_interface::DataCube* CDPSurfaceDesc::release_dst_data() { + clear_has_dst_data(); + ::nvdla_prototest_interface::DataCube* temp = dst_data_; + dst_data_ = NULL; + return temp; +} +inline void CDPSurfaceDesc::set_allocated_dst_data(::nvdla_prototest_interface::DataCube* dst_data) { + delete dst_data_; + dst_data_ = dst_data; + if (dst_data) { + set_has_dst_data(); + } else { + clear_has_dst_data(); + } + // @@protoc_insertion_point(field_set_allocated:nvdla_prototest_interface.CDPSurfaceDesc.dst_data) +} + +// ------------------------------------------------------------------- + +// CDPOpDesc + +// required .nvdla_prototest_interface.DataPrecision in_precision = 1; +inline bool CDPOpDesc::has_in_precision() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void CDPOpDesc::set_has_in_precision() { + _has_bits_[0] |= 0x00000001u; +} +inline void CDPOpDesc::clear_has_in_precision() { + _has_bits_[0] &= ~0x00000001u; +} +inline void CDPOpDesc::clear_in_precision() { + in_precision_ = 0; + clear_has_in_precision(); +} +inline ::nvdla_prototest_interface::DataPrecision CDPOpDesc::in_precision() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CDPOpDesc.in_precision) + return static_cast< ::nvdla_prototest_interface::DataPrecision >(in_precision_); +} +inline void CDPOpDesc::set_in_precision(::nvdla_prototest_interface::DataPrecision value) { + assert(::nvdla_prototest_interface::DataPrecision_IsValid(value)); + set_has_in_precision(); + in_precision_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.CDPOpDesc.in_precision) +} + +// required .nvdla_prototest_interface.DataPrecision out_precision = 2; +inline bool CDPOpDesc::has_out_precision() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void CDPOpDesc::set_has_out_precision() { + _has_bits_[0] |= 0x00000002u; +} +inline void CDPOpDesc::clear_has_out_precision() { + _has_bits_[0] &= ~0x00000002u; +} +inline void CDPOpDesc::clear_out_precision() { + out_precision_ = 0; + clear_has_out_precision(); +} +inline ::nvdla_prototest_interface::DataPrecision CDPOpDesc::out_precision() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CDPOpDesc.out_precision) + return static_cast< ::nvdla_prototest_interface::DataPrecision >(out_precision_); +} +inline void CDPOpDesc::set_out_precision(::nvdla_prototest_interface::DataPrecision value) { + assert(::nvdla_prototest_interface::DataPrecision_IsValid(value)); + set_has_out_precision(); + out_precision_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.CDPOpDesc.out_precision) +} + +// required int32 lut_index = 3; +inline bool CDPOpDesc::has_lut_index() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void CDPOpDesc::set_has_lut_index() { + _has_bits_[0] |= 0x00000004u; +} +inline void CDPOpDesc::clear_has_lut_index() { + _has_bits_[0] &= ~0x00000004u; +} +inline void CDPOpDesc::clear_lut_index() { + lut_index_ = 0; + clear_has_lut_index(); +} +inline ::google::protobuf::int32 CDPOpDesc::lut_index() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CDPOpDesc.lut_index) + return lut_index_; +} +inline void CDPOpDesc::set_lut_index(::google::protobuf::int32 value) { + set_has_lut_index(); + lut_index_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.CDPOpDesc.lut_index) +} + +// required .nvdla_prototest_interface.CVTParam in_cvt = 4; +inline bool CDPOpDesc::has_in_cvt() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void CDPOpDesc::set_has_in_cvt() { + _has_bits_[0] |= 0x00000008u; +} +inline void CDPOpDesc::clear_has_in_cvt() { + _has_bits_[0] &= ~0x00000008u; +} +inline void CDPOpDesc::clear_in_cvt() { + if (in_cvt_ != NULL) in_cvt_->::nvdla_prototest_interface::CVTParam::Clear(); + clear_has_in_cvt(); +} +inline const ::nvdla_prototest_interface::CVTParam& CDPOpDesc::in_cvt() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CDPOpDesc.in_cvt) + return in_cvt_ != NULL ? *in_cvt_ : *default_instance_->in_cvt_; +} +inline ::nvdla_prototest_interface::CVTParam* CDPOpDesc::mutable_in_cvt() { + set_has_in_cvt(); + if (in_cvt_ == NULL) in_cvt_ = new ::nvdla_prototest_interface::CVTParam; + // @@protoc_insertion_point(field_mutable:nvdla_prototest_interface.CDPOpDesc.in_cvt) + return in_cvt_; +} +inline ::nvdla_prototest_interface::CVTParam* CDPOpDesc::release_in_cvt() { + clear_has_in_cvt(); + ::nvdla_prototest_interface::CVTParam* temp = in_cvt_; + in_cvt_ = NULL; + return temp; +} +inline void CDPOpDesc::set_allocated_in_cvt(::nvdla_prototest_interface::CVTParam* in_cvt) { + delete in_cvt_; + in_cvt_ = in_cvt; + if (in_cvt) { + set_has_in_cvt(); + } else { + clear_has_in_cvt(); + } + // @@protoc_insertion_point(field_set_allocated:nvdla_prototest_interface.CDPOpDesc.in_cvt) +} + +// required .nvdla_prototest_interface.CVTParam out_cvt = 5; +inline bool CDPOpDesc::has_out_cvt() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +inline void CDPOpDesc::set_has_out_cvt() { + _has_bits_[0] |= 0x00000010u; +} +inline void CDPOpDesc::clear_has_out_cvt() { + _has_bits_[0] &= ~0x00000010u; +} +inline void CDPOpDesc::clear_out_cvt() { + if (out_cvt_ != NULL) out_cvt_->::nvdla_prototest_interface::CVTParam::Clear(); + clear_has_out_cvt(); +} +inline const ::nvdla_prototest_interface::CVTParam& CDPOpDesc::out_cvt() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CDPOpDesc.out_cvt) + return out_cvt_ != NULL ? *out_cvt_ : *default_instance_->out_cvt_; +} +inline ::nvdla_prototest_interface::CVTParam* CDPOpDesc::mutable_out_cvt() { + set_has_out_cvt(); + if (out_cvt_ == NULL) out_cvt_ = new ::nvdla_prototest_interface::CVTParam; + // @@protoc_insertion_point(field_mutable:nvdla_prototest_interface.CDPOpDesc.out_cvt) + return out_cvt_; +} +inline ::nvdla_prototest_interface::CVTParam* CDPOpDesc::release_out_cvt() { + clear_has_out_cvt(); + ::nvdla_prototest_interface::CVTParam* temp = out_cvt_; + out_cvt_ = NULL; + return temp; +} +inline void CDPOpDesc::set_allocated_out_cvt(::nvdla_prototest_interface::CVTParam* out_cvt) { + delete out_cvt_; + out_cvt_ = out_cvt; + if (out_cvt) { + set_has_out_cvt(); + } else { + clear_has_out_cvt(); + } + // @@protoc_insertion_point(field_set_allocated:nvdla_prototest_interface.CDPOpDesc.out_cvt) +} + +// required uint32 local_size = 6; +inline bool CDPOpDesc::has_local_size() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +inline void CDPOpDesc::set_has_local_size() { + _has_bits_[0] |= 0x00000020u; +} +inline void CDPOpDesc::clear_has_local_size() { + _has_bits_[0] &= ~0x00000020u; +} +inline void CDPOpDesc::clear_local_size() { + local_size_ = 0u; + clear_has_local_size(); +} +inline ::google::protobuf::uint32 CDPOpDesc::local_size() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CDPOpDesc.local_size) + return local_size_; +} +inline void CDPOpDesc::set_local_size(::google::protobuf::uint32 value) { + set_has_local_size(); + local_size_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.CDPOpDesc.local_size) +} + +// required uint32 bypass_sqsum = 7; +inline bool CDPOpDesc::has_bypass_sqsum() const { + return (_has_bits_[0] & 0x00000040u) != 0; +} +inline void CDPOpDesc::set_has_bypass_sqsum() { + _has_bits_[0] |= 0x00000040u; +} +inline void CDPOpDesc::clear_has_bypass_sqsum() { + _has_bits_[0] &= ~0x00000040u; +} +inline void CDPOpDesc::clear_bypass_sqsum() { + bypass_sqsum_ = 0u; + clear_has_bypass_sqsum(); +} +inline ::google::protobuf::uint32 CDPOpDesc::bypass_sqsum() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CDPOpDesc.bypass_sqsum) + return bypass_sqsum_; +} +inline void CDPOpDesc::set_bypass_sqsum(::google::protobuf::uint32 value) { + set_has_bypass_sqsum(); + bypass_sqsum_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.CDPOpDesc.bypass_sqsum) +} + +// required uint32 bypass_out_mul = 8; +inline bool CDPOpDesc::has_bypass_out_mul() const { + return (_has_bits_[0] & 0x00000080u) != 0; +} +inline void CDPOpDesc::set_has_bypass_out_mul() { + _has_bits_[0] |= 0x00000080u; +} +inline void CDPOpDesc::clear_has_bypass_out_mul() { + _has_bits_[0] &= ~0x00000080u; +} +inline void CDPOpDesc::clear_bypass_out_mul() { + bypass_out_mul_ = 0u; + clear_has_bypass_out_mul(); +} +inline ::google::protobuf::uint32 CDPOpDesc::bypass_out_mul() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CDPOpDesc.bypass_out_mul) + return bypass_out_mul_; +} +inline void CDPOpDesc::set_bypass_out_mul(::google::protobuf::uint32 value) { + set_has_bypass_out_mul(); + bypass_out_mul_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.CDPOpDesc.bypass_out_mul) +} + +// optional uint32 reserved0 = 9 [default = 0]; +inline bool CDPOpDesc::has_reserved0() const { + return (_has_bits_[0] & 0x00000100u) != 0; +} +inline void CDPOpDesc::set_has_reserved0() { + _has_bits_[0] |= 0x00000100u; +} +inline void CDPOpDesc::clear_has_reserved0() { + _has_bits_[0] &= ~0x00000100u; +} +inline void CDPOpDesc::clear_reserved0() { + reserved0_ = 0u; + clear_has_reserved0(); +} +inline ::google::protobuf::uint32 CDPOpDesc::reserved0() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.CDPOpDesc.reserved0) + return reserved0_; +} +inline void CDPOpDesc::set_reserved0(::google::protobuf::uint32 value) { + set_has_reserved0(); + reserved0_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.CDPOpDesc.reserved0) +} + +// ------------------------------------------------------------------- + +// RUBIKSurfaceDesc + +// required .nvdla_prototest_interface.DataCube src_data = 1; +inline bool RUBIKSurfaceDesc::has_src_data() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void RUBIKSurfaceDesc::set_has_src_data() { + _has_bits_[0] |= 0x00000001u; +} +inline void RUBIKSurfaceDesc::clear_has_src_data() { + _has_bits_[0] &= ~0x00000001u; +} +inline void RUBIKSurfaceDesc::clear_src_data() { + if (src_data_ != NULL) src_data_->::nvdla_prototest_interface::DataCube::Clear(); + clear_has_src_data(); +} +inline const ::nvdla_prototest_interface::DataCube& RUBIKSurfaceDesc::src_data() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.RUBIKSurfaceDesc.src_data) + return src_data_ != NULL ? *src_data_ : *default_instance_->src_data_; +} +inline ::nvdla_prototest_interface::DataCube* RUBIKSurfaceDesc::mutable_src_data() { + set_has_src_data(); + if (src_data_ == NULL) src_data_ = new ::nvdla_prototest_interface::DataCube; + // @@protoc_insertion_point(field_mutable:nvdla_prototest_interface.RUBIKSurfaceDesc.src_data) + return src_data_; +} +inline ::nvdla_prototest_interface::DataCube* RUBIKSurfaceDesc::release_src_data() { + clear_has_src_data(); + ::nvdla_prototest_interface::DataCube* temp = src_data_; + src_data_ = NULL; + return temp; +} +inline void RUBIKSurfaceDesc::set_allocated_src_data(::nvdla_prototest_interface::DataCube* src_data) { + delete src_data_; + src_data_ = src_data; + if (src_data) { + set_has_src_data(); + } else { + clear_has_src_data(); + } + // @@protoc_insertion_point(field_set_allocated:nvdla_prototest_interface.RUBIKSurfaceDesc.src_data) +} + +// required .nvdla_prototest_interface.DataCube dst_data = 2; +inline bool RUBIKSurfaceDesc::has_dst_data() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void RUBIKSurfaceDesc::set_has_dst_data() { + _has_bits_[0] |= 0x00000002u; +} +inline void RUBIKSurfaceDesc::clear_has_dst_data() { + _has_bits_[0] &= ~0x00000002u; +} +inline void RUBIKSurfaceDesc::clear_dst_data() { + if (dst_data_ != NULL) dst_data_->::nvdla_prototest_interface::DataCube::Clear(); + clear_has_dst_data(); +} +inline const ::nvdla_prototest_interface::DataCube& RUBIKSurfaceDesc::dst_data() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.RUBIKSurfaceDesc.dst_data) + return dst_data_ != NULL ? *dst_data_ : *default_instance_->dst_data_; +} +inline ::nvdla_prototest_interface::DataCube* RUBIKSurfaceDesc::mutable_dst_data() { + set_has_dst_data(); + if (dst_data_ == NULL) dst_data_ = new ::nvdla_prototest_interface::DataCube; + // @@protoc_insertion_point(field_mutable:nvdla_prototest_interface.RUBIKSurfaceDesc.dst_data) + return dst_data_; +} +inline ::nvdla_prototest_interface::DataCube* RUBIKSurfaceDesc::release_dst_data() { + clear_has_dst_data(); + ::nvdla_prototest_interface::DataCube* temp = dst_data_; + dst_data_ = NULL; + return temp; +} +inline void RUBIKSurfaceDesc::set_allocated_dst_data(::nvdla_prototest_interface::DataCube* dst_data) { + delete dst_data_; + dst_data_ = dst_data; + if (dst_data) { + set_has_dst_data(); + } else { + clear_has_dst_data(); + } + // @@protoc_insertion_point(field_set_allocated:nvdla_prototest_interface.RUBIKSurfaceDesc.dst_data) +} + +// ------------------------------------------------------------------- + +// RUBIKOpDesc + +// required .nvdla_prototest_interface.RUBIKMode mode = 1; +inline bool RUBIKOpDesc::has_mode() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void RUBIKOpDesc::set_has_mode() { + _has_bits_[0] |= 0x00000001u; +} +inline void RUBIKOpDesc::clear_has_mode() { + _has_bits_[0] &= ~0x00000001u; +} +inline void RUBIKOpDesc::clear_mode() { + mode_ = 0; + clear_has_mode(); +} +inline ::nvdla_prototest_interface::RUBIKMode RUBIKOpDesc::mode() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.RUBIKOpDesc.mode) + return static_cast< ::nvdla_prototest_interface::RUBIKMode >(mode_); +} +inline void RUBIKOpDesc::set_mode(::nvdla_prototest_interface::RUBIKMode value) { + assert(::nvdla_prototest_interface::RUBIKMode_IsValid(value)); + set_has_mode(); + mode_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.RUBIKOpDesc.mode) +} + +// required .nvdla_prototest_interface.DataPrecision precision = 2; +inline bool RUBIKOpDesc::has_precision() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void RUBIKOpDesc::set_has_precision() { + _has_bits_[0] |= 0x00000002u; +} +inline void RUBIKOpDesc::clear_has_precision() { + _has_bits_[0] &= ~0x00000002u; +} +inline void RUBIKOpDesc::clear_precision() { + precision_ = 0; + clear_has_precision(); +} +inline ::nvdla_prototest_interface::DataPrecision RUBIKOpDesc::precision() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.RUBIKOpDesc.precision) + return static_cast< ::nvdla_prototest_interface::DataPrecision >(precision_); +} +inline void RUBIKOpDesc::set_precision(::nvdla_prototest_interface::DataPrecision value) { + assert(::nvdla_prototest_interface::DataPrecision_IsValid(value)); + set_has_precision(); + precision_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.RUBIKOpDesc.precision) +} + +// required uint32 stride_x = 3; +inline bool RUBIKOpDesc::has_stride_x() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void RUBIKOpDesc::set_has_stride_x() { + _has_bits_[0] |= 0x00000004u; +} +inline void RUBIKOpDesc::clear_has_stride_x() { + _has_bits_[0] &= ~0x00000004u; +} +inline void RUBIKOpDesc::clear_stride_x() { + stride_x_ = 0u; + clear_has_stride_x(); +} +inline ::google::protobuf::uint32 RUBIKOpDesc::stride_x() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.RUBIKOpDesc.stride_x) + return stride_x_; +} +inline void RUBIKOpDesc::set_stride_x(::google::protobuf::uint32 value) { + set_has_stride_x(); + stride_x_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.RUBIKOpDesc.stride_x) +} + +// required uint32 stride_y = 4; +inline bool RUBIKOpDesc::has_stride_y() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void RUBIKOpDesc::set_has_stride_y() { + _has_bits_[0] |= 0x00000008u; +} +inline void RUBIKOpDesc::clear_has_stride_y() { + _has_bits_[0] &= ~0x00000008u; +} +inline void RUBIKOpDesc::clear_stride_y() { + stride_y_ = 0u; + clear_has_stride_y(); +} +inline ::google::protobuf::uint32 RUBIKOpDesc::stride_y() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.RUBIKOpDesc.stride_y) + return stride_y_; +} +inline void RUBIKOpDesc::set_stride_y(::google::protobuf::uint32 value) { + set_has_stride_y(); + stride_y_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.RUBIKOpDesc.stride_y) +} + +// ------------------------------------------------------------------- + +// SurfaceContainer + +// optional .nvdla_prototest_interface.BDMASurfaceDesc bdma_surface = 1; +inline bool SurfaceContainer::has_bdma_surface() const { + return surface_container_oneof_case() == kBdmaSurface; +} +inline void SurfaceContainer::set_has_bdma_surface() { + _oneof_case_[0] = kBdmaSurface; +} +inline void SurfaceContainer::clear_bdma_surface() { + if (has_bdma_surface()) { + delete surface_container_oneof_.bdma_surface_; + clear_has_surface_container_oneof(); + } +} +inline const ::nvdla_prototest_interface::BDMASurfaceDesc& SurfaceContainer::bdma_surface() const { + return has_bdma_surface() ? *surface_container_oneof_.bdma_surface_ + : ::nvdla_prototest_interface::BDMASurfaceDesc::default_instance(); +} +inline ::nvdla_prototest_interface::BDMASurfaceDesc* SurfaceContainer::mutable_bdma_surface() { + if (!has_bdma_surface()) { + clear_surface_container_oneof(); + set_has_bdma_surface(); + surface_container_oneof_.bdma_surface_ = new ::nvdla_prototest_interface::BDMASurfaceDesc; + } + return surface_container_oneof_.bdma_surface_; +} +inline ::nvdla_prototest_interface::BDMASurfaceDesc* SurfaceContainer::release_bdma_surface() { + if (has_bdma_surface()) { + clear_has_surface_container_oneof(); + ::nvdla_prototest_interface::BDMASurfaceDesc* temp = surface_container_oneof_.bdma_surface_; + surface_container_oneof_.bdma_surface_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void SurfaceContainer::set_allocated_bdma_surface(::nvdla_prototest_interface::BDMASurfaceDesc* bdma_surface) { + clear_surface_container_oneof(); + if (bdma_surface) { + set_has_bdma_surface(); + surface_container_oneof_.bdma_surface_ = bdma_surface; + } +} + +// optional .nvdla_prototest_interface.CONVSurfaceDesc conv_surface = 2; +inline bool SurfaceContainer::has_conv_surface() const { + return surface_container_oneof_case() == kConvSurface; +} +inline void SurfaceContainer::set_has_conv_surface() { + _oneof_case_[0] = kConvSurface; +} +inline void SurfaceContainer::clear_conv_surface() { + if (has_conv_surface()) { + delete surface_container_oneof_.conv_surface_; + clear_has_surface_container_oneof(); + } +} +inline const ::nvdla_prototest_interface::CONVSurfaceDesc& SurfaceContainer::conv_surface() const { + return has_conv_surface() ? *surface_container_oneof_.conv_surface_ + : ::nvdla_prototest_interface::CONVSurfaceDesc::default_instance(); +} +inline ::nvdla_prototest_interface::CONVSurfaceDesc* SurfaceContainer::mutable_conv_surface() { + if (!has_conv_surface()) { + clear_surface_container_oneof(); + set_has_conv_surface(); + surface_container_oneof_.conv_surface_ = new ::nvdla_prototest_interface::CONVSurfaceDesc; + } + return surface_container_oneof_.conv_surface_; +} +inline ::nvdla_prototest_interface::CONVSurfaceDesc* SurfaceContainer::release_conv_surface() { + if (has_conv_surface()) { + clear_has_surface_container_oneof(); + ::nvdla_prototest_interface::CONVSurfaceDesc* temp = surface_container_oneof_.conv_surface_; + surface_container_oneof_.conv_surface_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void SurfaceContainer::set_allocated_conv_surface(::nvdla_prototest_interface::CONVSurfaceDesc* conv_surface) { + clear_surface_container_oneof(); + if (conv_surface) { + set_has_conv_surface(); + surface_container_oneof_.conv_surface_ = conv_surface; + } +} + +// optional .nvdla_prototest_interface.SDPSurfaceDesc sdp_surface = 3; +inline bool SurfaceContainer::has_sdp_surface() const { + return surface_container_oneof_case() == kSdpSurface; +} +inline void SurfaceContainer::set_has_sdp_surface() { + _oneof_case_[0] = kSdpSurface; +} +inline void SurfaceContainer::clear_sdp_surface() { + if (has_sdp_surface()) { + delete surface_container_oneof_.sdp_surface_; + clear_has_surface_container_oneof(); + } +} +inline const ::nvdla_prototest_interface::SDPSurfaceDesc& SurfaceContainer::sdp_surface() const { + return has_sdp_surface() ? *surface_container_oneof_.sdp_surface_ + : ::nvdla_prototest_interface::SDPSurfaceDesc::default_instance(); +} +inline ::nvdla_prototest_interface::SDPSurfaceDesc* SurfaceContainer::mutable_sdp_surface() { + if (!has_sdp_surface()) { + clear_surface_container_oneof(); + set_has_sdp_surface(); + surface_container_oneof_.sdp_surface_ = new ::nvdla_prototest_interface::SDPSurfaceDesc; + } + return surface_container_oneof_.sdp_surface_; +} +inline ::nvdla_prototest_interface::SDPSurfaceDesc* SurfaceContainer::release_sdp_surface() { + if (has_sdp_surface()) { + clear_has_surface_container_oneof(); + ::nvdla_prototest_interface::SDPSurfaceDesc* temp = surface_container_oneof_.sdp_surface_; + surface_container_oneof_.sdp_surface_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void SurfaceContainer::set_allocated_sdp_surface(::nvdla_prototest_interface::SDPSurfaceDesc* sdp_surface) { + clear_surface_container_oneof(); + if (sdp_surface) { + set_has_sdp_surface(); + surface_container_oneof_.sdp_surface_ = sdp_surface; + } +} + +// optional .nvdla_prototest_interface.PDPSurfaceDesc pdp_surface = 4; +inline bool SurfaceContainer::has_pdp_surface() const { + return surface_container_oneof_case() == kPdpSurface; +} +inline void SurfaceContainer::set_has_pdp_surface() { + _oneof_case_[0] = kPdpSurface; +} +inline void SurfaceContainer::clear_pdp_surface() { + if (has_pdp_surface()) { + delete surface_container_oneof_.pdp_surface_; + clear_has_surface_container_oneof(); + } +} +inline const ::nvdla_prototest_interface::PDPSurfaceDesc& SurfaceContainer::pdp_surface() const { + return has_pdp_surface() ? *surface_container_oneof_.pdp_surface_ + : ::nvdla_prototest_interface::PDPSurfaceDesc::default_instance(); +} +inline ::nvdla_prototest_interface::PDPSurfaceDesc* SurfaceContainer::mutable_pdp_surface() { + if (!has_pdp_surface()) { + clear_surface_container_oneof(); + set_has_pdp_surface(); + surface_container_oneof_.pdp_surface_ = new ::nvdla_prototest_interface::PDPSurfaceDesc; + } + return surface_container_oneof_.pdp_surface_; +} +inline ::nvdla_prototest_interface::PDPSurfaceDesc* SurfaceContainer::release_pdp_surface() { + if (has_pdp_surface()) { + clear_has_surface_container_oneof(); + ::nvdla_prototest_interface::PDPSurfaceDesc* temp = surface_container_oneof_.pdp_surface_; + surface_container_oneof_.pdp_surface_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void SurfaceContainer::set_allocated_pdp_surface(::nvdla_prototest_interface::PDPSurfaceDesc* pdp_surface) { + clear_surface_container_oneof(); + if (pdp_surface) { + set_has_pdp_surface(); + surface_container_oneof_.pdp_surface_ = pdp_surface; + } +} + +// optional .nvdla_prototest_interface.CDPSurfaceDesc cdp_surface = 5; +inline bool SurfaceContainer::has_cdp_surface() const { + return surface_container_oneof_case() == kCdpSurface; +} +inline void SurfaceContainer::set_has_cdp_surface() { + _oneof_case_[0] = kCdpSurface; +} +inline void SurfaceContainer::clear_cdp_surface() { + if (has_cdp_surface()) { + delete surface_container_oneof_.cdp_surface_; + clear_has_surface_container_oneof(); + } +} +inline const ::nvdla_prototest_interface::CDPSurfaceDesc& SurfaceContainer::cdp_surface() const { + return has_cdp_surface() ? *surface_container_oneof_.cdp_surface_ + : ::nvdla_prototest_interface::CDPSurfaceDesc::default_instance(); +} +inline ::nvdla_prototest_interface::CDPSurfaceDesc* SurfaceContainer::mutable_cdp_surface() { + if (!has_cdp_surface()) { + clear_surface_container_oneof(); + set_has_cdp_surface(); + surface_container_oneof_.cdp_surface_ = new ::nvdla_prototest_interface::CDPSurfaceDesc; + } + return surface_container_oneof_.cdp_surface_; +} +inline ::nvdla_prototest_interface::CDPSurfaceDesc* SurfaceContainer::release_cdp_surface() { + if (has_cdp_surface()) { + clear_has_surface_container_oneof(); + ::nvdla_prototest_interface::CDPSurfaceDesc* temp = surface_container_oneof_.cdp_surface_; + surface_container_oneof_.cdp_surface_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void SurfaceContainer::set_allocated_cdp_surface(::nvdla_prototest_interface::CDPSurfaceDesc* cdp_surface) { + clear_surface_container_oneof(); + if (cdp_surface) { + set_has_cdp_surface(); + surface_container_oneof_.cdp_surface_ = cdp_surface; + } +} + +// optional .nvdla_prototest_interface.RUBIKSurfaceDesc rubik_surface = 6; +inline bool SurfaceContainer::has_rubik_surface() const { + return surface_container_oneof_case() == kRubikSurface; +} +inline void SurfaceContainer::set_has_rubik_surface() { + _oneof_case_[0] = kRubikSurface; +} +inline void SurfaceContainer::clear_rubik_surface() { + if (has_rubik_surface()) { + delete surface_container_oneof_.rubik_surface_; + clear_has_surface_container_oneof(); + } +} +inline const ::nvdla_prototest_interface::RUBIKSurfaceDesc& SurfaceContainer::rubik_surface() const { + return has_rubik_surface() ? *surface_container_oneof_.rubik_surface_ + : ::nvdla_prototest_interface::RUBIKSurfaceDesc::default_instance(); +} +inline ::nvdla_prototest_interface::RUBIKSurfaceDesc* SurfaceContainer::mutable_rubik_surface() { + if (!has_rubik_surface()) { + clear_surface_container_oneof(); + set_has_rubik_surface(); + surface_container_oneof_.rubik_surface_ = new ::nvdla_prototest_interface::RUBIKSurfaceDesc; + } + return surface_container_oneof_.rubik_surface_; +} +inline ::nvdla_prototest_interface::RUBIKSurfaceDesc* SurfaceContainer::release_rubik_surface() { + if (has_rubik_surface()) { + clear_has_surface_container_oneof(); + ::nvdla_prototest_interface::RUBIKSurfaceDesc* temp = surface_container_oneof_.rubik_surface_; + surface_container_oneof_.rubik_surface_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void SurfaceContainer::set_allocated_rubik_surface(::nvdla_prototest_interface::RUBIKSurfaceDesc* rubik_surface) { + clear_surface_container_oneof(); + if (rubik_surface) { + set_has_rubik_surface(); + surface_container_oneof_.rubik_surface_ = rubik_surface; + } +} + +inline bool SurfaceContainer::has_surface_container_oneof() { + return surface_container_oneof_case() != SURFACE_CONTAINER_ONEOF_NOT_SET; +} +inline void SurfaceContainer::clear_has_surface_container_oneof() { + _oneof_case_[0] = SURFACE_CONTAINER_ONEOF_NOT_SET; +} +inline SurfaceContainer::SurfaceContainerOneofCase SurfaceContainer::surface_container_oneof_case() const { + return SurfaceContainer::SurfaceContainerOneofCase(_oneof_case_[0]); +} +// ------------------------------------------------------------------- + +// OperationContainer + +// optional .nvdla_prototest_interface.BDMAOpDesc bdma_op = 1; +inline bool OperationContainer::has_bdma_op() const { + return op_container_oneof_case() == kBdmaOp; +} +inline void OperationContainer::set_has_bdma_op() { + _oneof_case_[0] = kBdmaOp; +} +inline void OperationContainer::clear_bdma_op() { + if (has_bdma_op()) { + delete op_container_oneof_.bdma_op_; + clear_has_op_container_oneof(); + } +} +inline const ::nvdla_prototest_interface::BDMAOpDesc& OperationContainer::bdma_op() const { + return has_bdma_op() ? *op_container_oneof_.bdma_op_ + : ::nvdla_prototest_interface::BDMAOpDesc::default_instance(); +} +inline ::nvdla_prototest_interface::BDMAOpDesc* OperationContainer::mutable_bdma_op() { + if (!has_bdma_op()) { + clear_op_container_oneof(); + set_has_bdma_op(); + op_container_oneof_.bdma_op_ = new ::nvdla_prototest_interface::BDMAOpDesc; + } + return op_container_oneof_.bdma_op_; +} +inline ::nvdla_prototest_interface::BDMAOpDesc* OperationContainer::release_bdma_op() { + if (has_bdma_op()) { + clear_has_op_container_oneof(); + ::nvdla_prototest_interface::BDMAOpDesc* temp = op_container_oneof_.bdma_op_; + op_container_oneof_.bdma_op_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void OperationContainer::set_allocated_bdma_op(::nvdla_prototest_interface::BDMAOpDesc* bdma_op) { + clear_op_container_oneof(); + if (bdma_op) { + set_has_bdma_op(); + op_container_oneof_.bdma_op_ = bdma_op; + } +} + +// optional .nvdla_prototest_interface.CONVOpDesc conv_op = 2; +inline bool OperationContainer::has_conv_op() const { + return op_container_oneof_case() == kConvOp; +} +inline void OperationContainer::set_has_conv_op() { + _oneof_case_[0] = kConvOp; +} +inline void OperationContainer::clear_conv_op() { + if (has_conv_op()) { + delete op_container_oneof_.conv_op_; + clear_has_op_container_oneof(); + } +} +inline const ::nvdla_prototest_interface::CONVOpDesc& OperationContainer::conv_op() const { + return has_conv_op() ? *op_container_oneof_.conv_op_ + : ::nvdla_prototest_interface::CONVOpDesc::default_instance(); +} +inline ::nvdla_prototest_interface::CONVOpDesc* OperationContainer::mutable_conv_op() { + if (!has_conv_op()) { + clear_op_container_oneof(); + set_has_conv_op(); + op_container_oneof_.conv_op_ = new ::nvdla_prototest_interface::CONVOpDesc; + } + return op_container_oneof_.conv_op_; +} +inline ::nvdla_prototest_interface::CONVOpDesc* OperationContainer::release_conv_op() { + if (has_conv_op()) { + clear_has_op_container_oneof(); + ::nvdla_prototest_interface::CONVOpDesc* temp = op_container_oneof_.conv_op_; + op_container_oneof_.conv_op_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void OperationContainer::set_allocated_conv_op(::nvdla_prototest_interface::CONVOpDesc* conv_op) { + clear_op_container_oneof(); + if (conv_op) { + set_has_conv_op(); + op_container_oneof_.conv_op_ = conv_op; + } +} + +// optional .nvdla_prototest_interface.SDPOpDesc sdp_op = 3; +inline bool OperationContainer::has_sdp_op() const { + return op_container_oneof_case() == kSdpOp; +} +inline void OperationContainer::set_has_sdp_op() { + _oneof_case_[0] = kSdpOp; +} +inline void OperationContainer::clear_sdp_op() { + if (has_sdp_op()) { + delete op_container_oneof_.sdp_op_; + clear_has_op_container_oneof(); + } +} +inline const ::nvdla_prototest_interface::SDPOpDesc& OperationContainer::sdp_op() const { + return has_sdp_op() ? *op_container_oneof_.sdp_op_ + : ::nvdla_prototest_interface::SDPOpDesc::default_instance(); +} +inline ::nvdla_prototest_interface::SDPOpDesc* OperationContainer::mutable_sdp_op() { + if (!has_sdp_op()) { + clear_op_container_oneof(); + set_has_sdp_op(); + op_container_oneof_.sdp_op_ = new ::nvdla_prototest_interface::SDPOpDesc; + } + return op_container_oneof_.sdp_op_; +} +inline ::nvdla_prototest_interface::SDPOpDesc* OperationContainer::release_sdp_op() { + if (has_sdp_op()) { + clear_has_op_container_oneof(); + ::nvdla_prototest_interface::SDPOpDesc* temp = op_container_oneof_.sdp_op_; + op_container_oneof_.sdp_op_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void OperationContainer::set_allocated_sdp_op(::nvdla_prototest_interface::SDPOpDesc* sdp_op) { + clear_op_container_oneof(); + if (sdp_op) { + set_has_sdp_op(); + op_container_oneof_.sdp_op_ = sdp_op; + } +} + +// optional .nvdla_prototest_interface.PDPOpDesc pdp_op = 4; +inline bool OperationContainer::has_pdp_op() const { + return op_container_oneof_case() == kPdpOp; +} +inline void OperationContainer::set_has_pdp_op() { + _oneof_case_[0] = kPdpOp; +} +inline void OperationContainer::clear_pdp_op() { + if (has_pdp_op()) { + delete op_container_oneof_.pdp_op_; + clear_has_op_container_oneof(); + } +} +inline const ::nvdla_prototest_interface::PDPOpDesc& OperationContainer::pdp_op() const { + return has_pdp_op() ? *op_container_oneof_.pdp_op_ + : ::nvdla_prototest_interface::PDPOpDesc::default_instance(); +} +inline ::nvdla_prototest_interface::PDPOpDesc* OperationContainer::mutable_pdp_op() { + if (!has_pdp_op()) { + clear_op_container_oneof(); + set_has_pdp_op(); + op_container_oneof_.pdp_op_ = new ::nvdla_prototest_interface::PDPOpDesc; + } + return op_container_oneof_.pdp_op_; +} +inline ::nvdla_prototest_interface::PDPOpDesc* OperationContainer::release_pdp_op() { + if (has_pdp_op()) { + clear_has_op_container_oneof(); + ::nvdla_prototest_interface::PDPOpDesc* temp = op_container_oneof_.pdp_op_; + op_container_oneof_.pdp_op_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void OperationContainer::set_allocated_pdp_op(::nvdla_prototest_interface::PDPOpDesc* pdp_op) { + clear_op_container_oneof(); + if (pdp_op) { + set_has_pdp_op(); + op_container_oneof_.pdp_op_ = pdp_op; + } +} + +// optional .nvdla_prototest_interface.CDPOpDesc cdp_op = 5; +inline bool OperationContainer::has_cdp_op() const { + return op_container_oneof_case() == kCdpOp; +} +inline void OperationContainer::set_has_cdp_op() { + _oneof_case_[0] = kCdpOp; +} +inline void OperationContainer::clear_cdp_op() { + if (has_cdp_op()) { + delete op_container_oneof_.cdp_op_; + clear_has_op_container_oneof(); + } +} +inline const ::nvdla_prototest_interface::CDPOpDesc& OperationContainer::cdp_op() const { + return has_cdp_op() ? *op_container_oneof_.cdp_op_ + : ::nvdla_prototest_interface::CDPOpDesc::default_instance(); +} +inline ::nvdla_prototest_interface::CDPOpDesc* OperationContainer::mutable_cdp_op() { + if (!has_cdp_op()) { + clear_op_container_oneof(); + set_has_cdp_op(); + op_container_oneof_.cdp_op_ = new ::nvdla_prototest_interface::CDPOpDesc; + } + return op_container_oneof_.cdp_op_; +} +inline ::nvdla_prototest_interface::CDPOpDesc* OperationContainer::release_cdp_op() { + if (has_cdp_op()) { + clear_has_op_container_oneof(); + ::nvdla_prototest_interface::CDPOpDesc* temp = op_container_oneof_.cdp_op_; + op_container_oneof_.cdp_op_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void OperationContainer::set_allocated_cdp_op(::nvdla_prototest_interface::CDPOpDesc* cdp_op) { + clear_op_container_oneof(); + if (cdp_op) { + set_has_cdp_op(); + op_container_oneof_.cdp_op_ = cdp_op; + } +} + +// optional .nvdla_prototest_interface.RUBIKOpDesc rubik_op = 6; +inline bool OperationContainer::has_rubik_op() const { + return op_container_oneof_case() == kRubikOp; +} +inline void OperationContainer::set_has_rubik_op() { + _oneof_case_[0] = kRubikOp; +} +inline void OperationContainer::clear_rubik_op() { + if (has_rubik_op()) { + delete op_container_oneof_.rubik_op_; + clear_has_op_container_oneof(); + } +} +inline const ::nvdla_prototest_interface::RUBIKOpDesc& OperationContainer::rubik_op() const { + return has_rubik_op() ? *op_container_oneof_.rubik_op_ + : ::nvdla_prototest_interface::RUBIKOpDesc::default_instance(); +} +inline ::nvdla_prototest_interface::RUBIKOpDesc* OperationContainer::mutable_rubik_op() { + if (!has_rubik_op()) { + clear_op_container_oneof(); + set_has_rubik_op(); + op_container_oneof_.rubik_op_ = new ::nvdla_prototest_interface::RUBIKOpDesc; + } + return op_container_oneof_.rubik_op_; +} +inline ::nvdla_prototest_interface::RUBIKOpDesc* OperationContainer::release_rubik_op() { + if (has_rubik_op()) { + clear_has_op_container_oneof(); + ::nvdla_prototest_interface::RUBIKOpDesc* temp = op_container_oneof_.rubik_op_; + op_container_oneof_.rubik_op_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void OperationContainer::set_allocated_rubik_op(::nvdla_prototest_interface::RUBIKOpDesc* rubik_op) { + clear_op_container_oneof(); + if (rubik_op) { + set_has_rubik_op(); + op_container_oneof_.rubik_op_ = rubik_op; + } +} + +inline bool OperationContainer::has_op_container_oneof() { + return op_container_oneof_case() != OP_CONTAINER_ONEOF_NOT_SET; +} +inline void OperationContainer::clear_has_op_container_oneof() { + _oneof_case_[0] = OP_CONTAINER_ONEOF_NOT_SET; +} +inline OperationContainer::OpContainerOneofCase OperationContainer::op_container_oneof_case() const { + return OperationContainer::OpContainerOneofCase(_oneof_case_[0]); +} +// ------------------------------------------------------------------- + +// Consumer + +// required int32 index = 1; +inline bool Consumer::has_index() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void Consumer::set_has_index() { + _has_bits_[0] |= 0x00000001u; +} +inline void Consumer::clear_has_index() { + _has_bits_[0] &= ~0x00000001u; +} +inline void Consumer::clear_index() { + index_ = 0; + clear_has_index(); +} +inline ::google::protobuf::int32 Consumer::index() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.Consumer.index) + return index_; +} +inline void Consumer::set_index(::google::protobuf::int32 value) { + set_has_index(); + index_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.Consumer.index) +} + +// required .nvdla_prototest_interface.LayerType type = 2; +inline bool Consumer::has_type() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void Consumer::set_has_type() { + _has_bits_[0] |= 0x00000002u; +} +inline void Consumer::clear_has_type() { + _has_bits_[0] &= ~0x00000002u; +} +inline void Consumer::clear_type() { + type_ = 0; + clear_has_type(); +} +inline ::nvdla_prototest_interface::LayerType Consumer::type() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.Consumer.type) + return static_cast< ::nvdla_prototest_interface::LayerType >(type_); +} +inline void Consumer::set_type(::nvdla_prototest_interface::LayerType value) { + assert(::nvdla_prototest_interface::LayerType_IsValid(value)); + set_has_type(); + type_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.Consumer.type) +} + +// required .nvdla_prototest_interface.Consumer.EventType event = 3; +inline bool Consumer::has_event() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void Consumer::set_has_event() { + _has_bits_[0] |= 0x00000004u; +} +inline void Consumer::clear_has_event() { + _has_bits_[0] &= ~0x00000004u; +} +inline void Consumer::clear_event() { + event_ = 1; + clear_has_event(); +} +inline ::nvdla_prototest_interface::Consumer_EventType Consumer::event() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.Consumer.event) + return static_cast< ::nvdla_prototest_interface::Consumer_EventType >(event_); +} +inline void Consumer::set_event(::nvdla_prototest_interface::Consumer_EventType value) { + assert(::nvdla_prototest_interface::Consumer_EventType_IsValid(value)); + set_has_event(); + event_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.Consumer.event) +} + +// ------------------------------------------------------------------- + +// Layer + +// required int32 index = 1; +inline bool Layer::has_index() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void Layer::set_has_index() { + _has_bits_[0] |= 0x00000001u; +} +inline void Layer::clear_has_index() { + _has_bits_[0] &= ~0x00000001u; +} +inline void Layer::clear_index() { + index_ = 0; + clear_has_index(); +} +inline ::google::protobuf::int32 Layer::index() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.Layer.index) + return index_; +} +inline void Layer::set_index(::google::protobuf::int32 value) { + set_has_index(); + index_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.Layer.index) +} + +// required int32 roi_index = 2; +inline bool Layer::has_roi_index() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void Layer::set_has_roi_index() { + _has_bits_[0] |= 0x00000002u; +} +inline void Layer::clear_has_roi_index() { + _has_bits_[0] &= ~0x00000002u; +} +inline void Layer::clear_roi_index() { + roi_index_ = 0; + clear_has_roi_index(); +} +inline ::google::protobuf::int32 Layer::roi_index() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.Layer.roi_index) + return roi_index_; +} +inline void Layer::set_roi_index(::google::protobuf::int32 value) { + set_has_roi_index(); + roi_index_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.Layer.roi_index) +} + +// required .nvdla_prototest_interface.LayerType type = 3; +inline bool Layer::has_type() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void Layer::set_has_type() { + _has_bits_[0] |= 0x00000004u; +} +inline void Layer::clear_has_type() { + _has_bits_[0] &= ~0x00000004u; +} +inline void Layer::clear_type() { + type_ = 0; + clear_has_type(); +} +inline ::nvdla_prototest_interface::LayerType Layer::type() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.Layer.type) + return static_cast< ::nvdla_prototest_interface::LayerType >(type_); +} +inline void Layer::set_type(::nvdla_prototest_interface::LayerType value) { + assert(::nvdla_prototest_interface::LayerType_IsValid(value)); + set_has_type(); + type_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.Layer.type) +} + +// required uint32 dependency_count = 4; +inline bool Layer::has_dependency_count() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void Layer::set_has_dependency_count() { + _has_bits_[0] |= 0x00000008u; +} +inline void Layer::clear_has_dependency_count() { + _has_bits_[0] &= ~0x00000008u; +} +inline void Layer::clear_dependency_count() { + dependency_count_ = 0u; + clear_has_dependency_count(); +} +inline ::google::protobuf::uint32 Layer::dependency_count() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.Layer.dependency_count) + return dependency_count_; +} +inline void Layer::set_dependency_count(::google::protobuf::uint32 value) { + set_has_dependency_count(); + dependency_count_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.Layer.dependency_count) +} + +// repeated uint32 reserved = 5 [packed = true]; +inline int Layer::reserved_size() const { + return reserved_.size(); +} +inline void Layer::clear_reserved() { + reserved_.Clear(); +} +inline ::google::protobuf::uint32 Layer::reserved(int index) const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.Layer.reserved) + return reserved_.Get(index); +} +inline void Layer::set_reserved(int index, ::google::protobuf::uint32 value) { + reserved_.Set(index, value); + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.Layer.reserved) +} +inline void Layer::add_reserved(::google::protobuf::uint32 value) { + reserved_.Add(value); + // @@protoc_insertion_point(field_add:nvdla_prototest_interface.Layer.reserved) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +Layer::reserved() const { + // @@protoc_insertion_point(field_list:nvdla_prototest_interface.Layer.reserved) + return reserved_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +Layer::mutable_reserved() { + // @@protoc_insertion_point(field_mutable_list:nvdla_prototest_interface.Layer.reserved) + return &reserved_; +} + +// repeated .nvdla_prototest_interface.Consumer bottom = 6; +inline int Layer::bottom_size() const { + return bottom_.size(); +} +inline void Layer::clear_bottom() { + bottom_.Clear(); +} +inline const ::nvdla_prototest_interface::Consumer& Layer::bottom(int index) const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.Layer.bottom) + return bottom_.Get(index); +} +inline ::nvdla_prototest_interface::Consumer* Layer::mutable_bottom(int index) { + // @@protoc_insertion_point(field_mutable:nvdla_prototest_interface.Layer.bottom) + return bottom_.Mutable(index); +} +inline ::nvdla_prototest_interface::Consumer* Layer::add_bottom() { + // @@protoc_insertion_point(field_add:nvdla_prototest_interface.Layer.bottom) + return bottom_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::nvdla_prototest_interface::Consumer >& +Layer::bottom() const { + // @@protoc_insertion_point(field_list:nvdla_prototest_interface.Layer.bottom) + return bottom_; +} +inline ::google::protobuf::RepeatedPtrField< ::nvdla_prototest_interface::Consumer >* +Layer::mutable_bottom() { + // @@protoc_insertion_point(field_mutable_list:nvdla_prototest_interface.Layer.bottom) + return &bottom_; +} + +// optional .nvdla_prototest_interface.Consumer fused = 7; +inline bool Layer::has_fused() const { + return (_has_bits_[0] & 0x00000040u) != 0; +} +inline void Layer::set_has_fused() { + _has_bits_[0] |= 0x00000040u; +} +inline void Layer::clear_has_fused() { + _has_bits_[0] &= ~0x00000040u; +} +inline void Layer::clear_fused() { + if (fused_ != NULL) fused_->::nvdla_prototest_interface::Consumer::Clear(); + clear_has_fused(); +} +inline const ::nvdla_prototest_interface::Consumer& Layer::fused() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.Layer.fused) + return fused_ != NULL ? *fused_ : *default_instance_->fused_; +} +inline ::nvdla_prototest_interface::Consumer* Layer::mutable_fused() { + set_has_fused(); + if (fused_ == NULL) fused_ = new ::nvdla_prototest_interface::Consumer; + // @@protoc_insertion_point(field_mutable:nvdla_prototest_interface.Layer.fused) + return fused_; +} +inline ::nvdla_prototest_interface::Consumer* Layer::release_fused() { + clear_has_fused(); + ::nvdla_prototest_interface::Consumer* temp = fused_; + fused_ = NULL; + return temp; +} +inline void Layer::set_allocated_fused(::nvdla_prototest_interface::Consumer* fused) { + delete fused_; + fused_ = fused; + if (fused) { + set_has_fused(); + } else { + clear_has_fused(); + } + // @@protoc_insertion_point(field_set_allocated:nvdla_prototest_interface.Layer.fused) +} + +// required .nvdla_prototest_interface.OperationContainer op_config = 8; +inline bool Layer::has_op_config() const { + return (_has_bits_[0] & 0x00000080u) != 0; +} +inline void Layer::set_has_op_config() { + _has_bits_[0] |= 0x00000080u; +} +inline void Layer::clear_has_op_config() { + _has_bits_[0] &= ~0x00000080u; +} +inline void Layer::clear_op_config() { + if (op_config_ != NULL) op_config_->::nvdla_prototest_interface::OperationContainer::Clear(); + clear_has_op_config(); +} +inline const ::nvdla_prototest_interface::OperationContainer& Layer::op_config() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.Layer.op_config) + return op_config_ != NULL ? *op_config_ : *default_instance_->op_config_; +} +inline ::nvdla_prototest_interface::OperationContainer* Layer::mutable_op_config() { + set_has_op_config(); + if (op_config_ == NULL) op_config_ = new ::nvdla_prototest_interface::OperationContainer; + // @@protoc_insertion_point(field_mutable:nvdla_prototest_interface.Layer.op_config) + return op_config_; +} +inline ::nvdla_prototest_interface::OperationContainer* Layer::release_op_config() { + clear_has_op_config(); + ::nvdla_prototest_interface::OperationContainer* temp = op_config_; + op_config_ = NULL; + return temp; +} +inline void Layer::set_allocated_op_config(::nvdla_prototest_interface::OperationContainer* op_config) { + delete op_config_; + op_config_ = op_config; + if (op_config) { + set_has_op_config(); + } else { + clear_has_op_config(); + } + // @@protoc_insertion_point(field_set_allocated:nvdla_prototest_interface.Layer.op_config) +} + +// required .nvdla_prototest_interface.SurfaceContainer surface = 9; +inline bool Layer::has_surface() const { + return (_has_bits_[0] & 0x00000100u) != 0; +} +inline void Layer::set_has_surface() { + _has_bits_[0] |= 0x00000100u; +} +inline void Layer::clear_has_surface() { + _has_bits_[0] &= ~0x00000100u; +} +inline void Layer::clear_surface() { + if (surface_ != NULL) surface_->::nvdla_prototest_interface::SurfaceContainer::Clear(); + clear_has_surface(); +} +inline const ::nvdla_prototest_interface::SurfaceContainer& Layer::surface() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.Layer.surface) + return surface_ != NULL ? *surface_ : *default_instance_->surface_; +} +inline ::nvdla_prototest_interface::SurfaceContainer* Layer::mutable_surface() { + set_has_surface(); + if (surface_ == NULL) surface_ = new ::nvdla_prototest_interface::SurfaceContainer; + // @@protoc_insertion_point(field_mutable:nvdla_prototest_interface.Layer.surface) + return surface_; +} +inline ::nvdla_prototest_interface::SurfaceContainer* Layer::release_surface() { + clear_has_surface(); + ::nvdla_prototest_interface::SurfaceContainer* temp = surface_; + surface_ = NULL; + return temp; +} +inline void Layer::set_allocated_surface(::nvdla_prototest_interface::SurfaceContainer* surface) { + delete surface_; + surface_ = surface; + if (surface) { + set_has_surface(); + } else { + clear_has_surface(); + } + // @@protoc_insertion_point(field_set_allocated:nvdla_prototest_interface.Layer.surface) +} + +// ------------------------------------------------------------------- + +// NetworkLayer + +// repeated .nvdla_prototest_interface.Layer layer = 1; +inline int NetworkLayer::layer_size() const { + return layer_.size(); +} +inline void NetworkLayer::clear_layer() { + layer_.Clear(); +} +inline const ::nvdla_prototest_interface::Layer& NetworkLayer::layer(int index) const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.NetworkLayer.layer) + return layer_.Get(index); +} +inline ::nvdla_prototest_interface::Layer* NetworkLayer::mutable_layer(int index) { + // @@protoc_insertion_point(field_mutable:nvdla_prototest_interface.NetworkLayer.layer) + return layer_.Mutable(index); +} +inline ::nvdla_prototest_interface::Layer* NetworkLayer::add_layer() { + // @@protoc_insertion_point(field_add:nvdla_prototest_interface.NetworkLayer.layer) + return layer_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::nvdla_prototest_interface::Layer >& +NetworkLayer::layer() const { + // @@protoc_insertion_point(field_list:nvdla_prototest_interface.NetworkLayer.layer) + return layer_; +} +inline ::google::protobuf::RepeatedPtrField< ::nvdla_prototest_interface::Layer >* +NetworkLayer::mutable_layer() { + // @@protoc_insertion_point(field_mutable_list:nvdla_prototest_interface.NetworkLayer.layer) + return &layer_; +} + +// ------------------------------------------------------------------- + +// NetworkDesc + +// required int32 operation_desc_index = 1; +inline bool NetworkDesc::has_operation_desc_index() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void NetworkDesc::set_has_operation_desc_index() { + _has_bits_[0] |= 0x00000001u; +} +inline void NetworkDesc::clear_has_operation_desc_index() { + _has_bits_[0] &= ~0x00000001u; +} +inline void NetworkDesc::clear_operation_desc_index() { + operation_desc_index_ = 0; + clear_has_operation_desc_index(); +} +inline ::google::protobuf::int32 NetworkDesc::operation_desc_index() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.NetworkDesc.operation_desc_index) + return operation_desc_index_; +} +inline void NetworkDesc::set_operation_desc_index(::google::protobuf::int32 value) { + set_has_operation_desc_index(); + operation_desc_index_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.NetworkDesc.operation_desc_index) +} + +// required int32 surface_desc_index = 2; +inline bool NetworkDesc::has_surface_desc_index() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void NetworkDesc::set_has_surface_desc_index() { + _has_bits_[0] |= 0x00000002u; +} +inline void NetworkDesc::clear_has_surface_desc_index() { + _has_bits_[0] &= ~0x00000002u; +} +inline void NetworkDesc::clear_surface_desc_index() { + surface_desc_index_ = 0; + clear_has_surface_desc_index(); +} +inline ::google::protobuf::int32 NetworkDesc::surface_desc_index() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.NetworkDesc.surface_desc_index) + return surface_desc_index_; +} +inline void NetworkDesc::set_surface_desc_index(::google::protobuf::int32 value) { + set_has_surface_desc_index(); + surface_desc_index_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.NetworkDesc.surface_desc_index) +} + +// required int32 dependency_graph_index = 3; +inline bool NetworkDesc::has_dependency_graph_index() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void NetworkDesc::set_has_dependency_graph_index() { + _has_bits_[0] |= 0x00000004u; +} +inline void NetworkDesc::clear_has_dependency_graph_index() { + _has_bits_[0] &= ~0x00000004u; +} +inline void NetworkDesc::clear_dependency_graph_index() { + dependency_graph_index_ = 0; + clear_has_dependency_graph_index(); +} +inline ::google::protobuf::int32 NetworkDesc::dependency_graph_index() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.NetworkDesc.dependency_graph_index) + return dependency_graph_index_; +} +inline void NetworkDesc::set_dependency_graph_index(::google::protobuf::int32 value) { + set_has_dependency_graph_index(); + dependency_graph_index_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.NetworkDesc.dependency_graph_index) +} + +// required int32 lut_data_index = 4; +inline bool NetworkDesc::has_lut_data_index() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void NetworkDesc::set_has_lut_data_index() { + _has_bits_[0] |= 0x00000008u; +} +inline void NetworkDesc::clear_has_lut_data_index() { + _has_bits_[0] &= ~0x00000008u; +} +inline void NetworkDesc::clear_lut_data_index() { + lut_data_index_ = 0; + clear_has_lut_data_index(); +} +inline ::google::protobuf::int32 NetworkDesc::lut_data_index() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.NetworkDesc.lut_data_index) + return lut_data_index_; +} +inline void NetworkDesc::set_lut_data_index(::google::protobuf::int32 value) { + set_has_lut_data_index(); + lut_data_index_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.NetworkDesc.lut_data_index) +} + +// required int32 roi_array_index = 5; +inline bool NetworkDesc::has_roi_array_index() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +inline void NetworkDesc::set_has_roi_array_index() { + _has_bits_[0] |= 0x00000010u; +} +inline void NetworkDesc::clear_has_roi_array_index() { + _has_bits_[0] &= ~0x00000010u; +} +inline void NetworkDesc::clear_roi_array_index() { + roi_array_index_ = 0; + clear_has_roi_array_index(); +} +inline ::google::protobuf::int32 NetworkDesc::roi_array_index() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.NetworkDesc.roi_array_index) + return roi_array_index_; +} +inline void NetworkDesc::set_roi_array_index(::google::protobuf::int32 value) { + set_has_roi_array_index(); + roi_array_index_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.NetworkDesc.roi_array_index) +} + +// required int32 surface_index = 6; +inline bool NetworkDesc::has_surface_index() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +inline void NetworkDesc::set_has_surface_index() { + _has_bits_[0] |= 0x00000020u; +} +inline void NetworkDesc::clear_has_surface_index() { + _has_bits_[0] &= ~0x00000020u; +} +inline void NetworkDesc::clear_surface_index() { + surface_index_ = 0; + clear_has_surface_index(); +} +inline ::google::protobuf::int32 NetworkDesc::surface_index() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.NetworkDesc.surface_index) + return surface_index_; +} +inline void NetworkDesc::set_surface_index(::google::protobuf::int32 value) { + set_has_surface_index(); + surface_index_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.NetworkDesc.surface_index) +} + +// optional int32 stat_list_index = 7 [default = -1]; +inline bool NetworkDesc::has_stat_list_index() const { + return (_has_bits_[0] & 0x00000040u) != 0; +} +inline void NetworkDesc::set_has_stat_list_index() { + _has_bits_[0] |= 0x00000040u; +} +inline void NetworkDesc::clear_has_stat_list_index() { + _has_bits_[0] &= ~0x00000040u; +} +inline void NetworkDesc::clear_stat_list_index() { + stat_list_index_ = -1; + clear_has_stat_list_index(); +} +inline ::google::protobuf::int32 NetworkDesc::stat_list_index() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.NetworkDesc.stat_list_index) + return stat_list_index_; +} +inline void NetworkDesc::set_stat_list_index(::google::protobuf::int32 value) { + set_has_stat_list_index(); + stat_list_index_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.NetworkDesc.stat_list_index) +} + +// optional int32 reserved1 = 8 [default = -1]; +inline bool NetworkDesc::has_reserved1() const { + return (_has_bits_[0] & 0x00000080u) != 0; +} +inline void NetworkDesc::set_has_reserved1() { + _has_bits_[0] |= 0x00000080u; +} +inline void NetworkDesc::clear_has_reserved1() { + _has_bits_[0] &= ~0x00000080u; +} +inline void NetworkDesc::clear_reserved1() { + reserved1_ = -1; + clear_has_reserved1(); +} +inline ::google::protobuf::int32 NetworkDesc::reserved1() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.NetworkDesc.reserved1) + return reserved1_; +} +inline void NetworkDesc::set_reserved1(::google::protobuf::int32 value) { + set_has_reserved1(); + reserved1_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.NetworkDesc.reserved1) +} + +// repeated int32 op_head = 9 [packed = true]; +inline int NetworkDesc::op_head_size() const { + return op_head_.size(); +} +inline void NetworkDesc::clear_op_head() { + op_head_.Clear(); +} +inline ::google::protobuf::int32 NetworkDesc::op_head(int index) const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.NetworkDesc.op_head) + return op_head_.Get(index); +} +inline void NetworkDesc::set_op_head(int index, ::google::protobuf::int32 value) { + op_head_.Set(index, value); + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.NetworkDesc.op_head) +} +inline void NetworkDesc::add_op_head(::google::protobuf::int32 value) { + op_head_.Add(value); + // @@protoc_insertion_point(field_add:nvdla_prototest_interface.NetworkDesc.op_head) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +NetworkDesc::op_head() const { + // @@protoc_insertion_point(field_list:nvdla_prototest_interface.NetworkDesc.op_head) + return op_head_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +NetworkDesc::mutable_op_head() { + // @@protoc_insertion_point(field_mutable_list:nvdla_prototest_interface.NetworkDesc.op_head) + return &op_head_; +} + +// required uint32 num_rois = 10; +inline bool NetworkDesc::has_num_rois() const { + return (_has_bits_[0] & 0x00000200u) != 0; +} +inline void NetworkDesc::set_has_num_rois() { + _has_bits_[0] |= 0x00000200u; +} +inline void NetworkDesc::clear_has_num_rois() { + _has_bits_[0] &= ~0x00000200u; +} +inline void NetworkDesc::clear_num_rois() { + num_rois_ = 0u; + clear_has_num_rois(); +} +inline ::google::protobuf::uint32 NetworkDesc::num_rois() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.NetworkDesc.num_rois) + return num_rois_; +} +inline void NetworkDesc::set_num_rois(::google::protobuf::uint32 value) { + set_has_num_rois(); + num_rois_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.NetworkDesc.num_rois) +} + +// required uint32 num_operations = 11; +inline bool NetworkDesc::has_num_operations() const { + return (_has_bits_[0] & 0x00000400u) != 0; +} +inline void NetworkDesc::set_has_num_operations() { + _has_bits_[0] |= 0x00000400u; +} +inline void NetworkDesc::clear_has_num_operations() { + _has_bits_[0] &= ~0x00000400u; +} +inline void NetworkDesc::clear_num_operations() { + num_operations_ = 0u; + clear_has_num_operations(); +} +inline ::google::protobuf::uint32 NetworkDesc::num_operations() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.NetworkDesc.num_operations) + return num_operations_; +} +inline void NetworkDesc::set_num_operations(::google::protobuf::uint32 value) { + set_has_num_operations(); + num_operations_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.NetworkDesc.num_operations) +} + +// required uint32 num_luts = 12; +inline bool NetworkDesc::has_num_luts() const { + return (_has_bits_[0] & 0x00000800u) != 0; +} +inline void NetworkDesc::set_has_num_luts() { + _has_bits_[0] |= 0x00000800u; +} +inline void NetworkDesc::clear_has_num_luts() { + _has_bits_[0] &= ~0x00000800u; +} +inline void NetworkDesc::clear_num_luts() { + num_luts_ = 0u; + clear_has_num_luts(); +} +inline ::google::protobuf::uint32 NetworkDesc::num_luts() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.NetworkDesc.num_luts) + return num_luts_; +} +inline void NetworkDesc::set_num_luts(::google::protobuf::uint32 value) { + set_has_num_luts(); + num_luts_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.NetworkDesc.num_luts) +} + +// required uint32 num_addresses = 13; +inline bool NetworkDesc::has_num_addresses() const { + return (_has_bits_[0] & 0x00001000u) != 0; +} +inline void NetworkDesc::set_has_num_addresses() { + _has_bits_[0] |= 0x00001000u; +} +inline void NetworkDesc::clear_has_num_addresses() { + _has_bits_[0] &= ~0x00001000u; +} +inline void NetworkDesc::clear_num_addresses() { + num_addresses_ = 0u; + clear_has_num_addresses(); +} +inline ::google::protobuf::uint32 NetworkDesc::num_addresses() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.NetworkDesc.num_addresses) + return num_addresses_; +} +inline void NetworkDesc::set_num_addresses(::google::protobuf::uint32 value) { + set_has_num_addresses(); + num_addresses_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.NetworkDesc.num_addresses) +} + +// required int32 input_layer = 14; +inline bool NetworkDesc::has_input_layer() const { + return (_has_bits_[0] & 0x00002000u) != 0; +} +inline void NetworkDesc::set_has_input_layer() { + _has_bits_[0] |= 0x00002000u; +} +inline void NetworkDesc::clear_has_input_layer() { + _has_bits_[0] &= ~0x00002000u; +} +inline void NetworkDesc::clear_input_layer() { + input_layer_ = 0; + clear_has_input_layer(); +} +inline ::google::protobuf::int32 NetworkDesc::input_layer() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.NetworkDesc.input_layer) + return input_layer_; +} +inline void NetworkDesc::set_input_layer(::google::protobuf::int32 value) { + set_has_input_layer(); + input_layer_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.NetworkDesc.input_layer) +} + +// required uint32 dynamic_roi = 15; +inline bool NetworkDesc::has_dynamic_roi() const { + return (_has_bits_[0] & 0x00004000u) != 0; +} +inline void NetworkDesc::set_has_dynamic_roi() { + _has_bits_[0] |= 0x00004000u; +} +inline void NetworkDesc::clear_has_dynamic_roi() { + _has_bits_[0] &= ~0x00004000u; +} +inline void NetworkDesc::clear_dynamic_roi() { + dynamic_roi_ = 0u; + clear_has_dynamic_roi(); +} +inline ::google::protobuf::uint32 NetworkDesc::dynamic_roi() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.NetworkDesc.dynamic_roi) + return dynamic_roi_; +} +inline void NetworkDesc::set_dynamic_roi(::google::protobuf::uint32 value) { + set_has_dynamic_roi(); + dynamic_roi_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.NetworkDesc.dynamic_roi) +} + +// optional uint32 reserved0 = 16 [default = 0]; +inline bool NetworkDesc::has_reserved0() const { + return (_has_bits_[0] & 0x00008000u) != 0; +} +inline void NetworkDesc::set_has_reserved0() { + _has_bits_[0] |= 0x00008000u; +} +inline void NetworkDesc::clear_has_reserved0() { + _has_bits_[0] &= ~0x00008000u; +} +inline void NetworkDesc::clear_reserved0() { + reserved0_ = 0u; + clear_has_reserved0(); +} +inline ::google::protobuf::uint32 NetworkDesc::reserved0() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.NetworkDesc.reserved0) + return reserved0_; +} +inline void NetworkDesc::set_reserved0(::google::protobuf::uint32 value) { + set_has_reserved0(); + reserved0_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.NetworkDesc.reserved0) +} + +// ------------------------------------------------------------------- + +// LUTParamList + +// repeated .nvdla_prototest_interface.LUTParam lut_param = 1; +inline int LUTParamList::lut_param_size() const { + return lut_param_.size(); +} +inline void LUTParamList::clear_lut_param() { + lut_param_.Clear(); +} +inline const ::nvdla_prototest_interface::LUTParam& LUTParamList::lut_param(int index) const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.LUTParamList.lut_param) + return lut_param_.Get(index); +} +inline ::nvdla_prototest_interface::LUTParam* LUTParamList::mutable_lut_param(int index) { + // @@protoc_insertion_point(field_mutable:nvdla_prototest_interface.LUTParamList.lut_param) + return lut_param_.Mutable(index); +} +inline ::nvdla_prototest_interface::LUTParam* LUTParamList::add_lut_param() { + // @@protoc_insertion_point(field_add:nvdla_prototest_interface.LUTParamList.lut_param) + return lut_param_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::nvdla_prototest_interface::LUTParam >& +LUTParamList::lut_param() const { + // @@protoc_insertion_point(field_list:nvdla_prototest_interface.LUTParamList.lut_param) + return lut_param_; +} +inline ::google::protobuf::RepeatedPtrField< ::nvdla_prototest_interface::LUTParam >* +LUTParamList::mutable_lut_param() { + // @@protoc_insertion_point(field_mutable_list:nvdla_prototest_interface.LUTParamList.lut_param) + return &lut_param_; +} + +// ------------------------------------------------------------------- + +// ROIArrayDesc + +// required uint32 array_length = 1; +inline bool ROIArrayDesc::has_array_length() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ROIArrayDesc::set_has_array_length() { + _has_bits_[0] |= 0x00000001u; +} +inline void ROIArrayDesc::clear_has_array_length() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ROIArrayDesc::clear_array_length() { + array_length_ = 0u; + clear_has_array_length(); +} +inline ::google::protobuf::uint32 ROIArrayDesc::array_length() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.ROIArrayDesc.array_length) + return array_length_; +} +inline void ROIArrayDesc::set_array_length(::google::protobuf::uint32 value) { + set_has_array_length(); + array_length_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.ROIArrayDesc.array_length) +} + +// required uint32 array_reserved = 2; +inline bool ROIArrayDesc::has_array_reserved() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void ROIArrayDesc::set_has_array_reserved() { + _has_bits_[0] |= 0x00000002u; +} +inline void ROIArrayDesc::clear_has_array_reserved() { + _has_bits_[0] &= ~0x00000002u; +} +inline void ROIArrayDesc::clear_array_reserved() { + array_reserved_ = 0u; + clear_has_array_reserved(); +} +inline ::google::protobuf::uint32 ROIArrayDesc::array_reserved() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.ROIArrayDesc.array_reserved) + return array_reserved_; +} +inline void ROIArrayDesc::set_array_reserved(::google::protobuf::uint32 value) { + set_has_array_reserved(); + array_reserved_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.ROIArrayDesc.array_reserved) +} + +// ------------------------------------------------------------------- + +// ROIDesc + +// required uint32 left = 1; +inline bool ROIDesc::has_left() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ROIDesc::set_has_left() { + _has_bits_[0] |= 0x00000001u; +} +inline void ROIDesc::clear_has_left() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ROIDesc::clear_left() { + left_ = 0u; + clear_has_left(); +} +inline ::google::protobuf::uint32 ROIDesc::left() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.ROIDesc.left) + return left_; +} +inline void ROIDesc::set_left(::google::protobuf::uint32 value) { + set_has_left(); + left_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.ROIDesc.left) +} + +// required uint32 top = 2; +inline bool ROIDesc::has_top() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void ROIDesc::set_has_top() { + _has_bits_[0] |= 0x00000002u; +} +inline void ROIDesc::clear_has_top() { + _has_bits_[0] &= ~0x00000002u; +} +inline void ROIDesc::clear_top() { + top_ = 0u; + clear_has_top(); +} +inline ::google::protobuf::uint32 ROIDesc::top() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.ROIDesc.top) + return top_; +} +inline void ROIDesc::set_top(::google::protobuf::uint32 value) { + set_has_top(); + top_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.ROIDesc.top) +} + +// required uint32 right = 3; +inline bool ROIDesc::has_right() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void ROIDesc::set_has_right() { + _has_bits_[0] |= 0x00000004u; +} +inline void ROIDesc::clear_has_right() { + _has_bits_[0] &= ~0x00000004u; +} +inline void ROIDesc::clear_right() { + right_ = 0u; + clear_has_right(); +} +inline ::google::protobuf::uint32 ROIDesc::right() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.ROIDesc.right) + return right_; +} +inline void ROIDesc::set_right(::google::protobuf::uint32 value) { + set_has_right(); + right_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.ROIDesc.right) +} + +// required uint32 bottom = 4; +inline bool ROIDesc::has_bottom() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void ROIDesc::set_has_bottom() { + _has_bits_[0] |= 0x00000008u; +} +inline void ROIDesc::clear_has_bottom() { + _has_bits_[0] &= ~0x00000008u; +} +inline void ROIDesc::clear_bottom() { + bottom_ = 0u; + clear_has_bottom(); +} +inline ::google::protobuf::uint32 ROIDesc::bottom() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.ROIDesc.bottom) + return bottom_; +} +inline void ROIDesc::set_bottom(::google::protobuf::uint32 value) { + set_has_bottom(); + bottom_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.ROIDesc.bottom) +} + +// ------------------------------------------------------------------- + +// ROIDescription + +// required .nvdla_prototest_interface.ROIArrayDesc roi_arr = 1; +inline bool ROIDescription::has_roi_arr() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ROIDescription::set_has_roi_arr() { + _has_bits_[0] |= 0x00000001u; +} +inline void ROIDescription::clear_has_roi_arr() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ROIDescription::clear_roi_arr() { + if (roi_arr_ != NULL) roi_arr_->::nvdla_prototest_interface::ROIArrayDesc::Clear(); + clear_has_roi_arr(); +} +inline const ::nvdla_prototest_interface::ROIArrayDesc& ROIDescription::roi_arr() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.ROIDescription.roi_arr) + return roi_arr_ != NULL ? *roi_arr_ : *default_instance_->roi_arr_; +} +inline ::nvdla_prototest_interface::ROIArrayDesc* ROIDescription::mutable_roi_arr() { + set_has_roi_arr(); + if (roi_arr_ == NULL) roi_arr_ = new ::nvdla_prototest_interface::ROIArrayDesc; + // @@protoc_insertion_point(field_mutable:nvdla_prototest_interface.ROIDescription.roi_arr) + return roi_arr_; +} +inline ::nvdla_prototest_interface::ROIArrayDesc* ROIDescription::release_roi_arr() { + clear_has_roi_arr(); + ::nvdla_prototest_interface::ROIArrayDesc* temp = roi_arr_; + roi_arr_ = NULL; + return temp; +} +inline void ROIDescription::set_allocated_roi_arr(::nvdla_prototest_interface::ROIArrayDesc* roi_arr) { + delete roi_arr_; + roi_arr_ = roi_arr; + if (roi_arr) { + set_has_roi_arr(); + } else { + clear_has_roi_arr(); + } + // @@protoc_insertion_point(field_set_allocated:nvdla_prototest_interface.ROIDescription.roi_arr) +} + +// repeated .nvdla_prototest_interface.ROIDesc roi_desc = 2; +inline int ROIDescription::roi_desc_size() const { + return roi_desc_.size(); +} +inline void ROIDescription::clear_roi_desc() { + roi_desc_.Clear(); +} +inline const ::nvdla_prototest_interface::ROIDesc& ROIDescription::roi_desc(int index) const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.ROIDescription.roi_desc) + return roi_desc_.Get(index); +} +inline ::nvdla_prototest_interface::ROIDesc* ROIDescription::mutable_roi_desc(int index) { + // @@protoc_insertion_point(field_mutable:nvdla_prototest_interface.ROIDescription.roi_desc) + return roi_desc_.Mutable(index); +} +inline ::nvdla_prototest_interface::ROIDesc* ROIDescription::add_roi_desc() { + // @@protoc_insertion_point(field_add:nvdla_prototest_interface.ROIDescription.roi_desc) + return roi_desc_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::nvdla_prototest_interface::ROIDesc >& +ROIDescription::roi_desc() const { + // @@protoc_insertion_point(field_list:nvdla_prototest_interface.ROIDescription.roi_desc) + return roi_desc_; +} +inline ::google::protobuf::RepeatedPtrField< ::nvdla_prototest_interface::ROIDesc >* +ROIDescription::mutable_roi_desc() { + // @@protoc_insertion_point(field_mutable_list:nvdla_prototest_interface.ROIDescription.roi_desc) + return &roi_desc_; +} + +// ------------------------------------------------------------------- + +// Network + +// required .nvdla_prototest_interface.NetworkDesc param = 1; +inline bool Network::has_param() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void Network::set_has_param() { + _has_bits_[0] |= 0x00000001u; +} +inline void Network::clear_has_param() { + _has_bits_[0] &= ~0x00000001u; +} +inline void Network::clear_param() { + if (param_ != NULL) param_->::nvdla_prototest_interface::NetworkDesc::Clear(); + clear_has_param(); +} +inline const ::nvdla_prototest_interface::NetworkDesc& Network::param() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.Network.param) + return param_ != NULL ? *param_ : *default_instance_->param_; +} +inline ::nvdla_prototest_interface::NetworkDesc* Network::mutable_param() { + set_has_param(); + if (param_ == NULL) param_ = new ::nvdla_prototest_interface::NetworkDesc; + // @@protoc_insertion_point(field_mutable:nvdla_prototest_interface.Network.param) + return param_; +} +inline ::nvdla_prototest_interface::NetworkDesc* Network::release_param() { + clear_has_param(); + ::nvdla_prototest_interface::NetworkDesc* temp = param_; + param_ = NULL; + return temp; +} +inline void Network::set_allocated_param(::nvdla_prototest_interface::NetworkDesc* param) { + delete param_; + param_ = param; + if (param) { + set_has_param(); + } else { + clear_has_param(); + } + // @@protoc_insertion_point(field_set_allocated:nvdla_prototest_interface.Network.param) +} + +// required .nvdla_prototest_interface.NetworkLayer layers = 2; +inline bool Network::has_layers() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void Network::set_has_layers() { + _has_bits_[0] |= 0x00000002u; +} +inline void Network::clear_has_layers() { + _has_bits_[0] &= ~0x00000002u; +} +inline void Network::clear_layers() { + if (layers_ != NULL) layers_->::nvdla_prototest_interface::NetworkLayer::Clear(); + clear_has_layers(); +} +inline const ::nvdla_prototest_interface::NetworkLayer& Network::layers() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.Network.layers) + return layers_ != NULL ? *layers_ : *default_instance_->layers_; +} +inline ::nvdla_prototest_interface::NetworkLayer* Network::mutable_layers() { + set_has_layers(); + if (layers_ == NULL) layers_ = new ::nvdla_prototest_interface::NetworkLayer; + // @@protoc_insertion_point(field_mutable:nvdla_prototest_interface.Network.layers) + return layers_; +} +inline ::nvdla_prototest_interface::NetworkLayer* Network::release_layers() { + clear_has_layers(); + ::nvdla_prototest_interface::NetworkLayer* temp = layers_; + layers_ = NULL; + return temp; +} +inline void Network::set_allocated_layers(::nvdla_prototest_interface::NetworkLayer* layers) { + delete layers_; + layers_ = layers; + if (layers) { + set_has_layers(); + } else { + clear_has_layers(); + } + // @@protoc_insertion_point(field_set_allocated:nvdla_prototest_interface.Network.layers) +} + +// required .nvdla_prototest_interface.LUTParamList lut_list = 3; +inline bool Network::has_lut_list() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void Network::set_has_lut_list() { + _has_bits_[0] |= 0x00000004u; +} +inline void Network::clear_has_lut_list() { + _has_bits_[0] &= ~0x00000004u; +} +inline void Network::clear_lut_list() { + if (lut_list_ != NULL) lut_list_->::nvdla_prototest_interface::LUTParamList::Clear(); + clear_has_lut_list(); +} +inline const ::nvdla_prototest_interface::LUTParamList& Network::lut_list() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.Network.lut_list) + return lut_list_ != NULL ? *lut_list_ : *default_instance_->lut_list_; +} +inline ::nvdla_prototest_interface::LUTParamList* Network::mutable_lut_list() { + set_has_lut_list(); + if (lut_list_ == NULL) lut_list_ = new ::nvdla_prototest_interface::LUTParamList; + // @@protoc_insertion_point(field_mutable:nvdla_prototest_interface.Network.lut_list) + return lut_list_; +} +inline ::nvdla_prototest_interface::LUTParamList* Network::release_lut_list() { + clear_has_lut_list(); + ::nvdla_prototest_interface::LUTParamList* temp = lut_list_; + lut_list_ = NULL; + return temp; +} +inline void Network::set_allocated_lut_list(::nvdla_prototest_interface::LUTParamList* lut_list) { + delete lut_list_; + lut_list_ = lut_list; + if (lut_list) { + set_has_lut_list(); + } else { + clear_has_lut_list(); + } + // @@protoc_insertion_point(field_set_allocated:nvdla_prototest_interface.Network.lut_list) +} + +// required .nvdla_prototest_interface.ROIDescription roi_list = 4; +inline bool Network::has_roi_list() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void Network::set_has_roi_list() { + _has_bits_[0] |= 0x00000008u; +} +inline void Network::clear_has_roi_list() { + _has_bits_[0] &= ~0x00000008u; +} +inline void Network::clear_roi_list() { + if (roi_list_ != NULL) roi_list_->::nvdla_prototest_interface::ROIDescription::Clear(); + clear_has_roi_list(); +} +inline const ::nvdla_prototest_interface::ROIDescription& Network::roi_list() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.Network.roi_list) + return roi_list_ != NULL ? *roi_list_ : *default_instance_->roi_list_; +} +inline ::nvdla_prototest_interface::ROIDescription* Network::mutable_roi_list() { + set_has_roi_list(); + if (roi_list_ == NULL) roi_list_ = new ::nvdla_prototest_interface::ROIDescription; + // @@protoc_insertion_point(field_mutable:nvdla_prototest_interface.Network.roi_list) + return roi_list_; +} +inline ::nvdla_prototest_interface::ROIDescription* Network::release_roi_list() { + clear_has_roi_list(); + ::nvdla_prototest_interface::ROIDescription* temp = roi_list_; + roi_list_ = NULL; + return temp; +} +inline void Network::set_allocated_roi_list(::nvdla_prototest_interface::ROIDescription* roi_list) { + delete roi_list_; + roi_list_ = roi_list; + if (roi_list) { + set_has_roi_list(); + } else { + clear_has_roi_list(); + } + // @@protoc_insertion_point(field_set_allocated:nvdla_prototest_interface.Network.roi_list) +} + +// ------------------------------------------------------------------- + +// TaskStatus + +// required uint64 timestamp = 1; +inline bool TaskStatus::has_timestamp() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void TaskStatus::set_has_timestamp() { + _has_bits_[0] |= 0x00000001u; +} +inline void TaskStatus::clear_has_timestamp() { + _has_bits_[0] &= ~0x00000001u; +} +inline void TaskStatus::clear_timestamp() { + timestamp_ = GOOGLE_ULONGLONG(0); + clear_has_timestamp(); +} +inline ::google::protobuf::uint64 TaskStatus::timestamp() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.TaskStatus.timestamp) + return timestamp_; +} +inline void TaskStatus::set_timestamp(::google::protobuf::uint64 value) { + set_has_timestamp(); + timestamp_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.TaskStatus.timestamp) +} + +// required uint32 status_engine = 2; +inline bool TaskStatus::has_status_engine() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void TaskStatus::set_has_status_engine() { + _has_bits_[0] |= 0x00000002u; +} +inline void TaskStatus::clear_has_status_engine() { + _has_bits_[0] &= ~0x00000002u; +} +inline void TaskStatus::clear_status_engine() { + status_engine_ = 0u; + clear_has_status_engine(); +} +inline ::google::protobuf::uint32 TaskStatus::status_engine() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.TaskStatus.status_engine) + return status_engine_; +} +inline void TaskStatus::set_status_engine(::google::protobuf::uint32 value) { + set_has_status_engine(); + status_engine_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.TaskStatus.status_engine) +} + +// required uint32 subframe = 3; +inline bool TaskStatus::has_subframe() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void TaskStatus::set_has_subframe() { + _has_bits_[0] |= 0x00000004u; +} +inline void TaskStatus::clear_has_subframe() { + _has_bits_[0] &= ~0x00000004u; +} +inline void TaskStatus::clear_subframe() { + subframe_ = 0u; + clear_has_subframe(); +} +inline ::google::protobuf::uint32 TaskStatus::subframe() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.TaskStatus.subframe) + return subframe_; +} +inline void TaskStatus::set_subframe(::google::protobuf::uint32 value) { + set_has_subframe(); + subframe_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.TaskStatus.subframe) +} + +// required uint32 status_task = 4; +inline bool TaskStatus::has_status_task() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void TaskStatus::set_has_status_task() { + _has_bits_[0] |= 0x00000008u; +} +inline void TaskStatus::clear_has_status_task() { + _has_bits_[0] &= ~0x00000008u; +} +inline void TaskStatus::clear_status_task() { + status_task_ = 0u; + clear_has_status_task(); +} +inline ::google::protobuf::uint32 TaskStatus::status_task() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.TaskStatus.status_task) + return status_task_; +} +inline void TaskStatus::set_status_task(::google::protobuf::uint32 value) { + set_has_status_task(); + status_task_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.TaskStatus.status_task) +} + +// ------------------------------------------------------------------- + +// Action + +// repeated uint32 event_id = 1 [packed = true]; +inline int Action::event_id_size() const { + return event_id_.size(); +} +inline void Action::clear_event_id() { + event_id_.Clear(); +} +inline ::google::protobuf::uint32 Action::event_id(int index) const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.Action.event_id) + return event_id_.Get(index); +} +inline void Action::set_event_id(int index, ::google::protobuf::uint32 value) { + event_id_.Set(index, value); + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.Action.event_id) +} +inline void Action::add_event_id(::google::protobuf::uint32 value) { + event_id_.Add(value); + // @@protoc_insertion_point(field_add:nvdla_prototest_interface.Action.event_id) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +Action::event_id() const { + // @@protoc_insertion_point(field_list:nvdla_prototest_interface.Action.event_id) + return event_id_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +Action::mutable_event_id() { + // @@protoc_insertion_point(field_mutable_list:nvdla_prototest_interface.Action.event_id) + return &event_id_; +} + +// ------------------------------------------------------------------- + +// TaskSchedule + +// optional .nvdla_prototest_interface.Action pre_actions = 1; +inline bool TaskSchedule::has_pre_actions() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void TaskSchedule::set_has_pre_actions() { + _has_bits_[0] |= 0x00000001u; +} +inline void TaskSchedule::clear_has_pre_actions() { + _has_bits_[0] &= ~0x00000001u; +} +inline void TaskSchedule::clear_pre_actions() { + if (pre_actions_ != NULL) pre_actions_->::nvdla_prototest_interface::Action::Clear(); + clear_has_pre_actions(); +} +inline const ::nvdla_prototest_interface::Action& TaskSchedule::pre_actions() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.TaskSchedule.pre_actions) + return pre_actions_ != NULL ? *pre_actions_ : *default_instance_->pre_actions_; +} +inline ::nvdla_prototest_interface::Action* TaskSchedule::mutable_pre_actions() { + set_has_pre_actions(); + if (pre_actions_ == NULL) pre_actions_ = new ::nvdla_prototest_interface::Action; + // @@protoc_insertion_point(field_mutable:nvdla_prototest_interface.TaskSchedule.pre_actions) + return pre_actions_; +} +inline ::nvdla_prototest_interface::Action* TaskSchedule::release_pre_actions() { + clear_has_pre_actions(); + ::nvdla_prototest_interface::Action* temp = pre_actions_; + pre_actions_ = NULL; + return temp; +} +inline void TaskSchedule::set_allocated_pre_actions(::nvdla_prototest_interface::Action* pre_actions) { + delete pre_actions_; + pre_actions_ = pre_actions; + if (pre_actions) { + set_has_pre_actions(); + } else { + clear_has_pre_actions(); + } + // @@protoc_insertion_point(field_set_allocated:nvdla_prototest_interface.TaskSchedule.pre_actions) +} + +// optional .nvdla_prototest_interface.Action post_actions = 2; +inline bool TaskSchedule::has_post_actions() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void TaskSchedule::set_has_post_actions() { + _has_bits_[0] |= 0x00000002u; +} +inline void TaskSchedule::clear_has_post_actions() { + _has_bits_[0] &= ~0x00000002u; +} +inline void TaskSchedule::clear_post_actions() { + if (post_actions_ != NULL) post_actions_->::nvdla_prototest_interface::Action::Clear(); + clear_has_post_actions(); +} +inline const ::nvdla_prototest_interface::Action& TaskSchedule::post_actions() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.TaskSchedule.post_actions) + return post_actions_ != NULL ? *post_actions_ : *default_instance_->post_actions_; +} +inline ::nvdla_prototest_interface::Action* TaskSchedule::mutable_post_actions() { + set_has_post_actions(); + if (post_actions_ == NULL) post_actions_ = new ::nvdla_prototest_interface::Action; + // @@protoc_insertion_point(field_mutable:nvdla_prototest_interface.TaskSchedule.post_actions) + return post_actions_; +} +inline ::nvdla_prototest_interface::Action* TaskSchedule::release_post_actions() { + clear_has_post_actions(); + ::nvdla_prototest_interface::Action* temp = post_actions_; + post_actions_ = NULL; + return temp; +} +inline void TaskSchedule::set_allocated_post_actions(::nvdla_prototest_interface::Action* post_actions) { + delete post_actions_; + post_actions_ = post_actions; + if (post_actions) { + set_has_post_actions(); + } else { + clear_has_post_actions(); + } + // @@protoc_insertion_point(field_set_allocated:nvdla_prototest_interface.TaskSchedule.post_actions) +} + +// ------------------------------------------------------------------- + +// TasksData + +// optional uint32 task_id = 1; +inline bool TasksData::has_task_id() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void TasksData::set_has_task_id() { + _has_bits_[0] |= 0x00000001u; +} +inline void TasksData::clear_has_task_id() { + _has_bits_[0] &= ~0x00000001u; +} +inline void TasksData::clear_task_id() { + task_id_ = 0u; + clear_has_task_id(); +} +inline ::google::protobuf::uint32 TasksData::task_id() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.TasksData.task_id) + return task_id_; +} +inline void TasksData::set_task_id(::google::protobuf::uint32 value) { + set_has_task_id(); + task_id_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.TasksData.task_id) +} + +// required .nvdla_prototest_interface.EngineID engine_id = 2; +inline bool TasksData::has_engine_id() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void TasksData::set_has_engine_id() { + _has_bits_[0] |= 0x00000002u; +} +inline void TasksData::clear_has_engine_id() { + _has_bits_[0] &= ~0x00000002u; +} +inline void TasksData::clear_engine_id() { + engine_id_ = 0; + clear_has_engine_id(); +} +inline ::nvdla_prototest_interface::EngineID TasksData::engine_id() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.TasksData.engine_id) + return static_cast< ::nvdla_prototest_interface::EngineID >(engine_id_); +} +inline void TasksData::set_engine_id(::nvdla_prototest_interface::EngineID value) { + assert(::nvdla_prototest_interface::EngineID_IsValid(value)); + set_has_engine_id(); + engine_id_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.TasksData.engine_id) +} + +// required .nvdla_prototest_interface.Network network = 3; +inline bool TasksData::has_network() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void TasksData::set_has_network() { + _has_bits_[0] |= 0x00000004u; +} +inline void TasksData::clear_has_network() { + _has_bits_[0] &= ~0x00000004u; +} +inline void TasksData::clear_network() { + if (network_ != NULL) network_->::nvdla_prototest_interface::Network::Clear(); + clear_has_network(); +} +inline const ::nvdla_prototest_interface::Network& TasksData::network() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.TasksData.network) + return network_ != NULL ? *network_ : *default_instance_->network_; +} +inline ::nvdla_prototest_interface::Network* TasksData::mutable_network() { + set_has_network(); + if (network_ == NULL) network_ = new ::nvdla_prototest_interface::Network; + // @@protoc_insertion_point(field_mutable:nvdla_prototest_interface.TasksData.network) + return network_; +} +inline ::nvdla_prototest_interface::Network* TasksData::release_network() { + clear_has_network(); + ::nvdla_prototest_interface::Network* temp = network_; + network_ = NULL; + return temp; +} +inline void TasksData::set_allocated_network(::nvdla_prototest_interface::Network* network) { + delete network_; + network_ = network; + if (network) { + set_has_network(); + } else { + clear_has_network(); + } + // @@protoc_insertion_point(field_set_allocated:nvdla_prototest_interface.TasksData.network) +} + +// optional .nvdla_prototest_interface.TaskSchedule schedule = 4; +inline bool TasksData::has_schedule() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void TasksData::set_has_schedule() { + _has_bits_[0] |= 0x00000008u; +} +inline void TasksData::clear_has_schedule() { + _has_bits_[0] &= ~0x00000008u; +} +inline void TasksData::clear_schedule() { + if (schedule_ != NULL) schedule_->::nvdla_prototest_interface::TaskSchedule::Clear(); + clear_has_schedule(); +} +inline const ::nvdla_prototest_interface::TaskSchedule& TasksData::schedule() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.TasksData.schedule) + return schedule_ != NULL ? *schedule_ : *default_instance_->schedule_; +} +inline ::nvdla_prototest_interface::TaskSchedule* TasksData::mutable_schedule() { + set_has_schedule(); + if (schedule_ == NULL) schedule_ = new ::nvdla_prototest_interface::TaskSchedule; + // @@protoc_insertion_point(field_mutable:nvdla_prototest_interface.TasksData.schedule) + return schedule_; +} +inline ::nvdla_prototest_interface::TaskSchedule* TasksData::release_schedule() { + clear_has_schedule(); + ::nvdla_prototest_interface::TaskSchedule* temp = schedule_; + schedule_ = NULL; + return temp; +} +inline void TasksData::set_allocated_schedule(::nvdla_prototest_interface::TaskSchedule* schedule) { + delete schedule_; + schedule_ = schedule; + if (schedule) { + set_has_schedule(); + } else { + clear_has_schedule(); + } + // @@protoc_insertion_point(field_set_allocated:nvdla_prototest_interface.TasksData.schedule) +} + +// optional .nvdla_prototest_interface.TaskStatus task_status = 5; +inline bool TasksData::has_task_status() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +inline void TasksData::set_has_task_status() { + _has_bits_[0] |= 0x00000010u; +} +inline void TasksData::clear_has_task_status() { + _has_bits_[0] &= ~0x00000010u; +} +inline void TasksData::clear_task_status() { + if (task_status_ != NULL) task_status_->::nvdla_prototest_interface::TaskStatus::Clear(); + clear_has_task_status(); +} +inline const ::nvdla_prototest_interface::TaskStatus& TasksData::task_status() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.TasksData.task_status) + return task_status_ != NULL ? *task_status_ : *default_instance_->task_status_; +} +inline ::nvdla_prototest_interface::TaskStatus* TasksData::mutable_task_status() { + set_has_task_status(); + if (task_status_ == NULL) task_status_ = new ::nvdla_prototest_interface::TaskStatus; + // @@protoc_insertion_point(field_mutable:nvdla_prototest_interface.TasksData.task_status) + return task_status_; +} +inline ::nvdla_prototest_interface::TaskStatus* TasksData::release_task_status() { + clear_has_task_status(); + ::nvdla_prototest_interface::TaskStatus* temp = task_status_; + task_status_ = NULL; + return temp; +} +inline void TasksData::set_allocated_task_status(::nvdla_prototest_interface::TaskStatus* task_status) { + delete task_status_; + task_status_ = task_status; + if (task_status) { + set_has_task_status(); + } else { + clear_has_task_status(); + } + // @@protoc_insertion_point(field_set_allocated:nvdla_prototest_interface.TasksData.task_status) +} + +// optional uint32 task_timeout = 6 [default = 4294967295]; +inline bool TasksData::has_task_timeout() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +inline void TasksData::set_has_task_timeout() { + _has_bits_[0] |= 0x00000020u; +} +inline void TasksData::clear_has_task_timeout() { + _has_bits_[0] &= ~0x00000020u; +} +inline void TasksData::clear_task_timeout() { + task_timeout_ = 4294967295u; + clear_has_task_timeout(); +} +inline ::google::protobuf::uint32 TasksData::task_timeout() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.TasksData.task_timeout) + return task_timeout_; +} +inline void TasksData::set_task_timeout(::google::protobuf::uint32 value) { + set_has_task_timeout(); + task_timeout_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.TasksData.task_timeout) +} + +// optional int32 task_result = 7 [default = 0]; +inline bool TasksData::has_task_result() const { + return (_has_bits_[0] & 0x00000040u) != 0; +} +inline void TasksData::set_has_task_result() { + _has_bits_[0] |= 0x00000040u; +} +inline void TasksData::clear_has_task_result() { + _has_bits_[0] &= ~0x00000040u; +} +inline void TasksData::clear_task_result() { + task_result_ = 0; + clear_has_task_result(); +} +inline ::google::protobuf::int32 TasksData::task_result() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.TasksData.task_result) + return task_result_; +} +inline void TasksData::set_task_result(::google::protobuf::int32 value) { + set_has_task_result(); + task_result_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.TasksData.task_result) +} + +// ------------------------------------------------------------------- + +// Event + +// required uint32 event_id = 1; +inline bool Event::has_event_id() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void Event::set_has_event_id() { + _has_bits_[0] |= 0x00000001u; +} +inline void Event::clear_has_event_id() { + _has_bits_[0] &= ~0x00000001u; +} +inline void Event::clear_event_id() { + event_id_ = 0u; + clear_has_event_id(); +} +inline ::google::protobuf::uint32 Event::event_id() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.Event.event_id) + return event_id_; +} +inline void Event::set_event_id(::google::protobuf::uint32 value) { + set_has_event_id(); + event_id_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.Event.event_id) +} + +// required .nvdla_prototest_interface.Event.EventType event_type = 2; +inline bool Event::has_event_type() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void Event::set_has_event_type() { + _has_bits_[0] |= 0x00000002u; +} +inline void Event::clear_has_event_type() { + _has_bits_[0] &= ~0x00000002u; +} +inline void Event::clear_event_type() { + event_type_ = 0; + clear_has_event_type(); +} +inline ::nvdla_prototest_interface::Event_EventType Event::event_type() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.Event.event_type) + return static_cast< ::nvdla_prototest_interface::Event_EventType >(event_type_); +} +inline void Event::set_event_type(::nvdla_prototest_interface::Event_EventType value) { + assert(::nvdla_prototest_interface::Event_EventType_IsValid(value)); + set_has_event_type(); + event_type_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.Event.event_type) +} + +// required uint32 event_flags = 3; +inline bool Event::has_event_flags() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void Event::set_has_event_flags() { + _has_bits_[0] |= 0x00000004u; +} +inline void Event::clear_has_event_flags() { + _has_bits_[0] &= ~0x00000004u; +} +inline void Event::clear_event_flags() { + event_flags_ = 0u; + clear_has_event_flags(); +} +inline ::google::protobuf::uint32 Event::event_flags() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.Event.event_flags) + return event_flags_; +} +inline void Event::set_event_flags(::google::protobuf::uint32 value) { + set_has_event_flags(); + event_flags_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.Event.event_flags) +} + +// optional uint32 event_timeout = 4 [default = 4294967295]; +inline bool Event::has_event_timeout() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void Event::set_has_event_timeout() { + _has_bits_[0] |= 0x00000008u; +} +inline void Event::clear_has_event_timeout() { + _has_bits_[0] &= ~0x00000008u; +} +inline void Event::clear_event_timeout() { + event_timeout_ = 4294967295u; + clear_has_event_timeout(); +} +inline ::google::protobuf::uint32 Event::event_timeout() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.Event.event_timeout) + return event_timeout_; +} +inline void Event::set_event_timeout(::google::protobuf::uint32 value) { + set_has_event_timeout(); + event_timeout_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.Event.event_timeout) +} + +// ------------------------------------------------------------------- + +// EventList + +// repeated .nvdla_prototest_interface.Event event = 1; +inline int EventList::event_size() const { + return event_.size(); +} +inline void EventList::clear_event() { + event_.Clear(); +} +inline const ::nvdla_prototest_interface::Event& EventList::event(int index) const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.EventList.event) + return event_.Get(index); +} +inline ::nvdla_prototest_interface::Event* EventList::mutable_event(int index) { + // @@protoc_insertion_point(field_mutable:nvdla_prototest_interface.EventList.event) + return event_.Mutable(index); +} +inline ::nvdla_prototest_interface::Event* EventList::add_event() { + // @@protoc_insertion_point(field_add:nvdla_prototest_interface.EventList.event) + return event_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::nvdla_prototest_interface::Event >& +EventList::event() const { + // @@protoc_insertion_point(field_list:nvdla_prototest_interface.EventList.event) + return event_; +} +inline ::google::protobuf::RepeatedPtrField< ::nvdla_prototest_interface::Event >* +EventList::mutable_event() { + // @@protoc_insertion_point(field_mutable_list:nvdla_prototest_interface.EventList.event) + return &event_; +} + +// ------------------------------------------------------------------- + +// SubmitSlot + +// repeated uint32 task_id = 1; +inline int SubmitSlot::task_id_size() const { + return task_id_.size(); +} +inline void SubmitSlot::clear_task_id() { + task_id_.Clear(); +} +inline ::google::protobuf::uint32 SubmitSlot::task_id(int index) const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.SubmitSlot.task_id) + return task_id_.Get(index); +} +inline void SubmitSlot::set_task_id(int index, ::google::protobuf::uint32 value) { + task_id_.Set(index, value); + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.SubmitSlot.task_id) +} +inline void SubmitSlot::add_task_id(::google::protobuf::uint32 value) { + task_id_.Add(value); + // @@protoc_insertion_point(field_add:nvdla_prototest_interface.SubmitSlot.task_id) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +SubmitSlot::task_id() const { + // @@protoc_insertion_point(field_list:nvdla_prototest_interface.SubmitSlot.task_id) + return task_id_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +SubmitSlot::mutable_task_id() { + // @@protoc_insertion_point(field_mutable_list:nvdla_prototest_interface.SubmitSlot.task_id) + return &task_id_; +} + +// ------------------------------------------------------------------- + +// TestInfo + +// required uint32 num_tasks = 1; +inline bool TestInfo::has_num_tasks() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void TestInfo::set_has_num_tasks() { + _has_bits_[0] |= 0x00000001u; +} +inline void TestInfo::clear_has_num_tasks() { + _has_bits_[0] &= ~0x00000001u; +} +inline void TestInfo::clear_num_tasks() { + num_tasks_ = 0u; + clear_has_num_tasks(); +} +inline ::google::protobuf::uint32 TestInfo::num_tasks() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.TestInfo.num_tasks) + return num_tasks_; +} +inline void TestInfo::set_num_tasks(::google::protobuf::uint32 value) { + set_has_num_tasks(); + num_tasks_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.TestInfo.num_tasks) +} + +// required uint32 num_buffers = 2; +inline bool TestInfo::has_num_buffers() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void TestInfo::set_has_num_buffers() { + _has_bits_[0] |= 0x00000002u; +} +inline void TestInfo::clear_has_num_buffers() { + _has_bits_[0] &= ~0x00000002u; +} +inline void TestInfo::clear_num_buffers() { + num_buffers_ = 0u; + clear_has_num_buffers(); +} +inline ::google::protobuf::uint32 TestInfo::num_buffers() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.TestInfo.num_buffers) + return num_buffers_; +} +inline void TestInfo::set_num_buffers(::google::protobuf::uint32 value) { + set_has_num_buffers(); + num_buffers_ = value; + // @@protoc_insertion_point(field_set:nvdla_prototest_interface.TestInfo.num_buffers) +} + +// repeated .nvdla_prototest_interface.TasksData task = 3; +inline int TestInfo::task_size() const { + return task_.size(); +} +inline void TestInfo::clear_task() { + task_.Clear(); +} +inline const ::nvdla_prototest_interface::TasksData& TestInfo::task(int index) const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.TestInfo.task) + return task_.Get(index); +} +inline ::nvdla_prototest_interface::TasksData* TestInfo::mutable_task(int index) { + // @@protoc_insertion_point(field_mutable:nvdla_prototest_interface.TestInfo.task) + return task_.Mutable(index); +} +inline ::nvdla_prototest_interface::TasksData* TestInfo::add_task() { + // @@protoc_insertion_point(field_add:nvdla_prototest_interface.TestInfo.task) + return task_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::nvdla_prototest_interface::TasksData >& +TestInfo::task() const { + // @@protoc_insertion_point(field_list:nvdla_prototest_interface.TestInfo.task) + return task_; +} +inline ::google::protobuf::RepeatedPtrField< ::nvdla_prototest_interface::TasksData >* +TestInfo::mutable_task() { + // @@protoc_insertion_point(field_mutable_list:nvdla_prototest_interface.TestInfo.task) + return &task_; +} + +// optional .nvdla_prototest_interface.EventList event_list = 4; +inline bool TestInfo::has_event_list() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void TestInfo::set_has_event_list() { + _has_bits_[0] |= 0x00000008u; +} +inline void TestInfo::clear_has_event_list() { + _has_bits_[0] &= ~0x00000008u; +} +inline void TestInfo::clear_event_list() { + if (event_list_ != NULL) event_list_->::nvdla_prototest_interface::EventList::Clear(); + clear_has_event_list(); +} +inline const ::nvdla_prototest_interface::EventList& TestInfo::event_list() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.TestInfo.event_list) + return event_list_ != NULL ? *event_list_ : *default_instance_->event_list_; +} +inline ::nvdla_prototest_interface::EventList* TestInfo::mutable_event_list() { + set_has_event_list(); + if (event_list_ == NULL) event_list_ = new ::nvdla_prototest_interface::EventList; + // @@protoc_insertion_point(field_mutable:nvdla_prototest_interface.TestInfo.event_list) + return event_list_; +} +inline ::nvdla_prototest_interface::EventList* TestInfo::release_event_list() { + clear_has_event_list(); + ::nvdla_prototest_interface::EventList* temp = event_list_; + event_list_ = NULL; + return temp; +} +inline void TestInfo::set_allocated_event_list(::nvdla_prototest_interface::EventList* event_list) { + delete event_list_; + event_list_ = event_list; + if (event_list) { + set_has_event_list(); + } else { + clear_has_event_list(); + } + // @@protoc_insertion_point(field_set_allocated:nvdla_prototest_interface.TestInfo.event_list) +} + +// repeated .nvdla_prototest_interface.SubmitSlot slots = 5; +inline int TestInfo::slots_size() const { + return slots_.size(); +} +inline void TestInfo::clear_slots() { + slots_.Clear(); +} +inline const ::nvdla_prototest_interface::SubmitSlot& TestInfo::slots(int index) const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.TestInfo.slots) + return slots_.Get(index); +} +inline ::nvdla_prototest_interface::SubmitSlot* TestInfo::mutable_slots(int index) { + // @@protoc_insertion_point(field_mutable:nvdla_prototest_interface.TestInfo.slots) + return slots_.Mutable(index); +} +inline ::nvdla_prototest_interface::SubmitSlot* TestInfo::add_slots() { + // @@protoc_insertion_point(field_add:nvdla_prototest_interface.TestInfo.slots) + return slots_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::nvdla_prototest_interface::SubmitSlot >& +TestInfo::slots() const { + // @@protoc_insertion_point(field_list:nvdla_prototest_interface.TestInfo.slots) + return slots_; +} +inline ::google::protobuf::RepeatedPtrField< ::nvdla_prototest_interface::SubmitSlot >* +TestInfo::mutable_slots() { + // @@protoc_insertion_point(field_mutable_list:nvdla_prototest_interface.TestInfo.slots) + return &slots_; +} + +// ------------------------------------------------------------------- + +// Test + +// required .nvdla_prototest_interface.TestInfo test = 1; +inline bool Test::has_test() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void Test::set_has_test() { + _has_bits_[0] |= 0x00000001u; +} +inline void Test::clear_has_test() { + _has_bits_[0] &= ~0x00000001u; +} +inline void Test::clear_test() { + if (test_ != NULL) test_->::nvdla_prototest_interface::TestInfo::Clear(); + clear_has_test(); +} +inline const ::nvdla_prototest_interface::TestInfo& Test::test() const { + // @@protoc_insertion_point(field_get:nvdla_prototest_interface.Test.test) + return test_ != NULL ? *test_ : *default_instance_->test_; +} +inline ::nvdla_prototest_interface::TestInfo* Test::mutable_test() { + set_has_test(); + if (test_ == NULL) test_ = new ::nvdla_prototest_interface::TestInfo; + // @@protoc_insertion_point(field_mutable:nvdla_prototest_interface.Test.test) + return test_; +} +inline ::nvdla_prototest_interface::TestInfo* Test::release_test() { + clear_has_test(); + ::nvdla_prototest_interface::TestInfo* temp = test_; + test_ = NULL; + return temp; +} +inline void Test::set_allocated_test(::nvdla_prototest_interface::TestInfo* test) { + delete test_; + test_ = test; + if (test) { + set_has_test(); + } else { + clear_has_test(); + } + // @@protoc_insertion_point(field_set_allocated:nvdla_prototest_interface.Test.test) +} + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace nvdla_prototest_interface + +#ifndef SWIG +namespace google { +namespace protobuf { + +template <> struct is_proto_enum< ::nvdla_prototest_interface::SDPOp_SDPOpMode> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::nvdla_prototest_interface::SDPOp_SDPOpMode>() { + return ::nvdla_prototest_interface::SDPOp_SDPOpMode_descriptor(); +} +template <> struct is_proto_enum< ::nvdla_prototest_interface::PDPOpDesc_PoolingMode> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::nvdla_prototest_interface::PDPOpDesc_PoolingMode>() { + return ::nvdla_prototest_interface::PDPOpDesc_PoolingMode_descriptor(); +} +template <> struct is_proto_enum< ::nvdla_prototest_interface::Consumer_EventType> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::nvdla_prototest_interface::Consumer_EventType>() { + return ::nvdla_prototest_interface::Consumer_EventType_descriptor(); +} +template <> struct is_proto_enum< ::nvdla_prototest_interface::Event_EventType> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::nvdla_prototest_interface::Event_EventType>() { + return ::nvdla_prototest_interface::Event_EventType_descriptor(); +} +template <> struct is_proto_enum< ::nvdla_prototest_interface::DataPrecision> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::nvdla_prototest_interface::DataPrecision>() { + return ::nvdla_prototest_interface::DataPrecision_descriptor(); +} +template <> struct is_proto_enum< ::nvdla_prototest_interface::MemType> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::nvdla_prototest_interface::MemType>() { + return ::nvdla_prototest_interface::MemType_descriptor(); +} +template <> struct is_proto_enum< ::nvdla_prototest_interface::MemFlag> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::nvdla_prototest_interface::MemFlag>() { + return ::nvdla_prototest_interface::MemFlag_descriptor(); +} +template <> struct is_proto_enum< ::nvdla_prototest_interface::EngineID> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::nvdla_prototest_interface::EngineID>() { + return ::nvdla_prototest_interface::EngineID_descriptor(); +} +template <> struct is_proto_enum< ::nvdla_prototest_interface::LayerType> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::nvdla_prototest_interface::LayerType>() { + return ::nvdla_prototest_interface::LayerType_descriptor(); +} +template <> struct is_proto_enum< ::nvdla_prototest_interface::ALUType> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::nvdla_prototest_interface::ALUType>() { + return ::nvdla_prototest_interface::ALUType_descriptor(); +} +template <> struct is_proto_enum< ::nvdla_prototest_interface::SDPOpType> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::nvdla_prototest_interface::SDPOpType>() { + return ::nvdla_prototest_interface::SDPOpType_descriptor(); +} +template <> struct is_proto_enum< ::nvdla_prototest_interface::LUTLOGSize> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::nvdla_prototest_interface::LUTLOGSize>() { + return ::nvdla_prototest_interface::LUTLOGSize_descriptor(); +} +template <> struct is_proto_enum< ::nvdla_prototest_interface::LUTTable> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::nvdla_prototest_interface::LUTTable>() { + return ::nvdla_prototest_interface::LUTTable_descriptor(); +} +template <> struct is_proto_enum< ::nvdla_prototest_interface::LUTMethod> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::nvdla_prototest_interface::LUTMethod>() { + return ::nvdla_prototest_interface::LUTMethod_descriptor(); +} +template <> struct is_proto_enum< ::nvdla_prototest_interface::LUTPriority> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::nvdla_prototest_interface::LUTPriority>() { + return ::nvdla_prototest_interface::LUTPriority_descriptor(); +} +template <> struct is_proto_enum< ::nvdla_prototest_interface::ConvMode> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::nvdla_prototest_interface::ConvMode>() { + return ::nvdla_prototest_interface::ConvMode_descriptor(); +} +template <> struct is_proto_enum< ::nvdla_prototest_interface::ConvPixelMAP> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::nvdla_prototest_interface::ConvPixelMAP>() { + return ::nvdla_prototest_interface::ConvPixelMAP_descriptor(); +} +template <> struct is_proto_enum< ::nvdla_prototest_interface::PixelOverride> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::nvdla_prototest_interface::PixelOverride>() { + return ::nvdla_prototest_interface::PixelOverride_descriptor(); +} +template <> struct is_proto_enum< ::nvdla_prototest_interface::PoolSize> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::nvdla_prototest_interface::PoolSize>() { + return ::nvdla_prototest_interface::PoolSize_descriptor(); +} +template <> struct is_proto_enum< ::nvdla_prototest_interface::RUBIKMode> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::nvdla_prototest_interface::RUBIKMode>() { + return ::nvdla_prototest_interface::RUBIKMode_descriptor(); +} +template <> struct is_proto_enum< ::nvdla_prototest_interface::WeightFormat> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::nvdla_prototest_interface::WeightFormat>() { + return ::nvdla_prototest_interface::WeightFormat_descriptor(); +} +template <> struct is_proto_enum< ::nvdla_prototest_interface::MeanFormat> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::nvdla_prototest_interface::MeanFormat>() { + return ::nvdla_prototest_interface::MeanFormat_descriptor(); +} +template <> struct is_proto_enum< ::nvdla_prototest_interface::SDPActivation> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::nvdla_prototest_interface::SDPActivation>() { + return ::nvdla_prototest_interface::SDPActivation_descriptor(); +} +template <> struct is_proto_enum< ::nvdla_prototest_interface::DataFormat> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::nvdla_prototest_interface::DataFormat>() { + return ::nvdla_prototest_interface::DataFormat_descriptor(); +} +template <> struct is_proto_enum< ::nvdla_prototest_interface::FillerType> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::nvdla_prototest_interface::FillerType>() { + return ::nvdla_prototest_interface::FillerType_descriptor(); +} +template <> struct is_proto_enum< ::nvdla_prototest_interface::FileType> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::nvdla_prototest_interface::FileType>() { + return ::nvdla_prototest_interface::FileType_descriptor(); +} +template <> struct is_proto_enum< ::nvdla_prototest_interface::DataType> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::nvdla_prototest_interface::DataType>() { + return ::nvdla_prototest_interface::DataType_descriptor(); +} + +} // namespace google +} // namespace protobuf +#endif // SWIG + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_DlaPrototestInterface_2eproto__INCLUDED diff --git a/umd/core/src/compiler/include/priv/EngineAST.h b/umd/core/src/compiler/include/priv/EngineAST.h new file mode 100644 index 00000000..9318aba5 --- /dev/null +++ b/umd/core/src/compiler/include/priv/EngineAST.h @@ -0,0 +1,3736 @@ +/* + * Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#ifndef NVDLA_PRIV_ENGINE_AST_H +#define NVDLA_PRIV_ENGINE_AST_H + + +#include +#include +#include +#include +#include +#include + +#include "priv/AST.h" +#include "priv/Type.h" // for misc +#include "priv/Tensor.h" + +#include "priv/Loadable.h" +#include "priv/MultiBatch.h" +#include "priv/Surface.h" +#include "priv/CanonicalAST.h" +#include "priv/TargetConfig.h" + +#include "priv/DLAInterface.h" +#include "priv/EMUInterface.h" +#include "priv/DLAResourceManager.h" +#include "priv/LutManager.h" +#include "priv/EngineASTEnums.h" + +#ifdef NVDLA_COMPILER_OUTPUT_FOR_PROTOTEST +#include "priv/DlaPrototestInterface.pb.h" +#endif + +#define NUM_MAX_BDMA_OPS 1 +#define SDP_ADDER_DATA_INDEX 0 +#define SDP_MULTIPLIER_DATA_INDEX 1 +#define SDP_LEFT_SHIFT_MAX_PLACES 16 +#define SDP_RIGHTT_SHIFT_MAX_PLACES 32 + +#define FOR_EACH(SEQ, ITR, FUNC) \ + for ( ITR i = SEQ.begin(); i != SEQ.end(); ++i ) \ + { \ + PROPAGATE_ERROR_FAIL((*i)->FUNC()); \ + } + + +// +// provide explicit hash fn specialization for std::pair (Elem) +// +namespace nvdla { namespace priv { namespace engine_ast { class Node; class Edge; } } } +namespace std +{ + template <> struct hash> + { + std::size_t operator()(const std::pair &v) const noexcept + { + std::size_t h; + // one side or the other will be non-zero. + if ( v.first ) + { + h = std::hash{}(v.first); + } + else + { + h = std::hash{}(v.second); + } + return h; + } + }; +} + + +namespace nvdla +{ + +namespace priv +{ + +static surface::SurfaceFormatEnum IMG_FORMATS[] = { + surface::SurfaceFormatEnum::NVDLA_IMG_R8, + surface::SurfaceFormatEnum::NVDLA_IMG_R10, + surface::SurfaceFormatEnum::NVDLA_IMG_R12, + surface::SurfaceFormatEnum::NVDLA_IMG_R16, + surface::SurfaceFormatEnum::NVDLA_IMG_R16_I, + surface::SurfaceFormatEnum::NVDLA_IMG_R16_F, + surface::SurfaceFormatEnum::NVDLA_IMG_A16B16G16R16, + surface::SurfaceFormatEnum::NVDLA_IMG_X16B16G16R16, + surface::SurfaceFormatEnum::NVDLA_IMG_A16B16G16R16_F, + surface::SurfaceFormatEnum::NVDLA_IMG_A16Y16U16V16, + surface::SurfaceFormatEnum::NVDLA_IMG_V16U16Y16A16, + surface::SurfaceFormatEnum::NVDLA_IMG_A16Y16U16V16_F, + surface::SurfaceFormatEnum::NVDLA_IMG_A8B8G8R8, + surface::SurfaceFormatEnum::NVDLA_IMG_A8R8G8B8, + surface::SurfaceFormatEnum::NVDLA_IMG_B8G8R8A8, + surface::SurfaceFormatEnum::NVDLA_IMG_R8G8B8A8, + surface::SurfaceFormatEnum::NVDLA_IMG_X8B8G8R8, + surface::SurfaceFormatEnum::NVDLA_IMG_X8R8G8B8, + surface::SurfaceFormatEnum::NVDLA_IMG_B8G8R8X8, + surface::SurfaceFormatEnum::NVDLA_IMG_R8G8B8X8, + surface::SurfaceFormatEnum::NVDLA_IMG_A2B10G10R10, + surface::SurfaceFormatEnum::NVDLA_IMG_A2R10G10B10, + surface::SurfaceFormatEnum::NVDLA_IMG_B10G10R10A2, + surface::SurfaceFormatEnum::NVDLA_IMG_R10G10B10A2, + surface::SurfaceFormatEnum::NVDLA_IMG_A2Y10U10V10, + surface::SurfaceFormatEnum::NVDLA_IMG_V10U10Y10A2, + surface::SurfaceFormatEnum::NVDLA_IMG_A8Y8U8V8, + surface::SurfaceFormatEnum::NVDLA_IMG_V8U8Y8A8, + surface::SurfaceFormatEnum::NVDLA_IMG_Y8___U8V8_N444, + surface::SurfaceFormatEnum::NVDLA_IMG_Y8___V8U8_N444, + surface::SurfaceFormatEnum::NVDLA_IMG_Y10___U10V10_N444, + surface::SurfaceFormatEnum::NVDLA_IMG_Y10___V10U10_N444, + surface::SurfaceFormatEnum::NVDLA_IMG_Y12___U12V12_N444, + surface::SurfaceFormatEnum::NVDLA_IMG_Y12___V12U12_N444, + surface::SurfaceFormatEnum::NVDLA_IMG_Y16___U16V16_N444, + surface::SurfaceFormatEnum::NVDLA_IMG_Y16___V16U16_N444 +}; + +class Loadable; + +namespace engine_ast +{ + +// +// EngineParams hold all the details needed to program the HW engine +// Some of the engine params are directly inherited from the canonical AST +// equivalent operations, whereas some others are computed over the course +// of engine AST compilation. +// +// In short, only those params which are directly needed for HW engine programming +// should be held in EngineParams. Any dynamic state for assisting compilation +// should be held in the OpParams of respective engine nodes. +// + +enum ConcatAxisEnum { + ENGINE_AST_CONCAT_AXIS_ENUMS(GEN_ENUM) +}; +typedef SequenceEnum ConcatAxis; + +enum SplitAxisEnum { + ENGINE_AST_SPLIT_AXIS_ENUMS(GEN_ENUM) +}; +typedef SequenceEnum SplitAxis; + +enum ConvolutionModeEnum { + ENGINE_AST_CONVOLUTION_MODE_ENUMS(GEN_ENUM) +}; +typedef SequenceEnum ConvolutionMode; + +enum SDPModeEnum { + ENGINE_AST_SDP_MODE_ENUMS(GEN_ENUM) +}; +typedef SequenceEnum SDPMode; + +enum SDPALUTypeEnum { + ENGINE_AST_SDP_ALU_TYPE_ENUMS(GEN_ENUM) +}; +typedef SequenceEnum SDPALUType; + +enum SDPOpTypeEnum { + ENGINE_AST_SDP_OP_TYPE_ENUMS(GEN_ENUM) +}; +typedef SequenceEnum SDPOpType; + +enum SDPActTypeEnum { + ENGINE_AST_SDP_ACT_TYPE_ENUMS(GEN_ENUM) +}; +typedef SequenceEnum SDPActType; + +enum SDPSubEngineTypeEnum { + ENGINE_AST_SDP_SUBENGINE_TYPE_ENUMS(GEN_ENUM) +}; +typedef SequenceEnum SDPSubEngineType; + +enum RubikModeEnum { + ENGINE_AST_RUBIK_MODE_ENUMS(GEN_ENUM) +}; +typedef SequenceEnum RubikMode; + +class EngineParams +{ +public: + virtual ~EngineParams() { } +}; + +class PrecisionCVTParams +{ +public: + PrecisionCVTParams() : + m_truncate(0), + m_scale(1), + m_offset(0), + m_enable(false) + { } + virtual ~PrecisionCVTParams() { } + + /* clone */ + PrecisionCVTParams(const PrecisionCVTParams &other) : + m_truncate(other.m_truncate), + m_scale(other.m_scale), + m_offset(other.m_offset), + m_enable(other.m_enable) + { } + + NvS16 scale() const { return m_scale; } + void setScale(NvS16 scale) { m_scale = scale; } + + NvU8 truncate() const { return m_truncate; } + void setTruncate(NvU8 truncate) { m_truncate = truncate; } + + NvU8 offset() const { return m_offset; } + void setOffset(NvU8 offset) { m_offset = offset; } + + bool isEnable() const { return m_enable; } + void setEnable(bool enable) { m_enable = enable; } + +protected: + NvU8 m_truncate; // u6 right shifter + NvS16 m_scale; // i16 scalar + NvS32 m_offset; + bool m_enable; +}; + +class ConvCoreCVTParams +{ +public: + ConvCoreCVTParams() : + m_pra_truncate(0), + m_out_truncate(0) + { } + virtual ~ConvCoreCVTParams() { } + + /* clone */ + ConvCoreCVTParams(const ConvCoreCVTParams &other) : + m_pra_truncate(other.m_pra_truncate), + m_out_truncate(other.m_out_truncate), + m_input_cvt(other.m_input_cvt) + { } + + NvU8 outTruncate() const { return m_out_truncate; } + void setOutTruncate(NvU8 outTruncate) { m_out_truncate = outTruncate; } + + NvU8 praTruncate() const { return m_pra_truncate; } + void setPraTruncate(NvU8 praTruncate) { m_pra_truncate = praTruncate; } + + PrecisionCVTParams& inputCVT() { return m_input_cvt; } + void setInputCVT(const PrecisionCVTParams& inputCvt) { m_input_cvt = inputCvt; } + +protected: + NvU8 m_pra_truncate; // u2 right shifter + NvU8 m_out_truncate; // u6 right shifter + PrecisionCVTParams m_input_cvt; // input side CVT +}; + +static EngineParams EngineParamsNULL; + +class ConvCoreEngineParams : public EngineParams +{ +public: + ConvCoreEngineParams() : EngineParams(), + m_has_bias_term(0), + m_padding_value(0), + m_raw_weights(), + m_dla_weights(), + m_conv_mode(ConvolutionModeEnum::CONV_MODE_UNKNOWN), + m_reuse_data(false), + m_reuse_weights(false), + m_release_data(true), + m_release_weights(true), + m_retain_slices(0), + m_data_banks_allotted(0), + m_weight_banks_allotted(0), + m_num_groups(1) + { } + virtual ~ConvCoreEngineParams() { } + + /* clone */ + ConvCoreEngineParams(const ConvCoreEngineParams &other) : + m_has_bias_term(other.m_has_bias_term), + m_padding_value(other.m_padding_value), + m_raw_weights(other.m_raw_weights), + m_dla_weights(other.m_dla_weights), + m_conv_mode(other.m_conv_mode), + m_wg_params(other.m_wg_params), + m_reuse_data(other.m_reuse_data), + m_reuse_weights(other.m_reuse_weights), + m_release_data(other.m_release_data), + m_release_weights(other.m_release_weights), + m_retain_slices(other.m_retain_slices), + m_data_banks_allotted(other.m_data_banks_allotted), + m_weight_banks_allotted(other.m_weight_banks_allotted), + m_num_groups(other.m_num_groups) + { } + + // hold all winograd specific params here + struct WinogradParams { + Dims4 inDims; + Dims4 outDims; + Dims4 auxDims; + }; + + Dims2 dilation() const { return m_dilation; } + void setDilation(Dims2 dilation) { m_dilation = dilation; } + + NvU8 hasBiasTerm() const { return m_has_bias_term; } + void setHasBiasTerm(NvU8 hasBias) { m_has_bias_term = hasBias; } + + int paddingValue() const { return m_padding_value; } + void setPaddingValue(int p) { m_padding_value = p; } + + Dims2 bottomRightPadding() const { return m_BR_padding; } + void setBottomRightPadding(Dims2 br) { m_BR_padding = br; } + + Dims2 topLeftPadding() const { return m_TL_padding; } + void setTopLeftPadding(Dims2 tl) { m_TL_padding = tl; } + + Dims2 stride() const { return m_stride; } + void setStride(Dims2 stride) { m_stride = stride; } + + Weights rawWeights() const { return m_raw_weights; } + void setRawWeights(Weights raw) { m_raw_weights = raw; } + + Weights DLAWeights() const { return m_dla_weights; } + void setDLAWeights(Weights trns){ m_dla_weights = trns; } + + const Dims4 weightDims() const { return m_weight_dims; } + void setWeightDims(const Dims4 wd) { m_weight_dims = wd; } + + ConvolutionMode convMode() const { return m_conv_mode; } + void setConvMode(ConvolutionMode convMode) { m_conv_mode = convMode; } + + WinogradParams& winogradParams() { return m_wg_params; } + void setWinogradParams(const WinogradParams& wgp) { m_wg_params = wgp; } + void clearWinogradParams() { + m_wg_params.inDims = Dims4(-1, -1, -1, -1); + m_wg_params.outDims = Dims4(-1, -1, -1, -1); + m_wg_params.auxDims = Dims4(-1, -1, -1, -1); + } + + ConvCoreCVTParams& convCoreCVT() { return m_cc_cvt; } + void setConvCoreCVT(const ConvCoreCVTParams& ccCvt) { m_cc_cvt = ccCvt; } + + NvU8 dataBanksAllotted() const { return m_data_banks_allotted; } + void setAllottedDataBanks(NvU8 db) { m_data_banks_allotted = db; } + + NvU8 weightBanksAllotted() const { return m_weight_banks_allotted; } + void setAllottedWeightBanks(NvU8 wb) { m_weight_banks_allotted = wb; } + + bool isReuseData() const { return m_reuse_data; } + void setReuseData(bool dataReuse) { m_reuse_data = dataReuse; } + + bool isReuseWeights() const { return m_reuse_weights; } + void setReuseWeights(bool weightsReuse) { m_reuse_weights = weightsReuse; } + + bool isReleaseData() const { return m_release_data; } + void setReleaseData(bool dataRelease) { m_release_data = dataRelease; } + + bool isReleaseWeights() const { return m_release_weights; } + void setReleaseWeights(bool weightsRelease) { m_release_weights = weightsRelease; } + + NvU16 retainSlices() const { return m_retain_slices; } + void setRetainSlices(NvU16 releaseSlices) { m_retain_slices = releaseSlices; } + + NvU32 numGroups() const { return m_num_groups; } + void setNumGroups(NvU16 numGroups) { m_num_groups = numGroups; } + + std::vector& filterScales() { return m_filter_scales; } + void setFilterScales(const std::vector& filterScales) { m_filter_scales = filterScales; } + +protected: + NvU8 m_has_bias_term; + NvU32 m_padding_value; + Dims2 m_stride; + Dims2 m_dilation; + Dims2 m_TL_padding; + Dims2 m_BR_padding; + Dims4 m_weight_dims; + Weights m_raw_weights; + Weights m_dla_weights; + + ConvolutionMode m_conv_mode; + WinogradParams m_wg_params; + ConvCoreCVTParams m_cc_cvt; + + bool m_reuse_data; + bool m_reuse_weights; + bool m_release_data; + bool m_release_weights; + NvU16 m_retain_slices; + NvU8 m_data_banks_allotted; + NvU8 m_weight_banks_allotted; + NvU16 m_num_groups; + std::vector m_filter_scales; +}; + +class SDPSubEngineParams +{ +public: + SDPSubEngineParams() : + m_enabled(false), + m_mode(SDPModeEnum::SDP_MODE_UNKNOWN), + m_alu_type(SDPALUTypeEnum::SDP_ALU_TYPE_UNKNOWN), + m_op_type(SDPOpTypeEnum::SDP_OP_TYPE_NONE), + m_act_type(SDPActTypeEnum::SDP_ACT_TYPE_NONE), + m_truncate(0), + m_shift_value(0), + m_alu_operand(0), + m_mul_operand(0), + m_precision(surface::SurfacePrecisionEnum::NVDLA_PRECISION_UNKNOWN), + m_isINT8Rescaling(false) + { } + virtual ~SDPSubEngineParams() { } + + /* clone */ + SDPSubEngineParams(const SDPSubEngineParams &other) : + m_enabled(other.m_enabled), + m_mode(other.m_mode), + m_alu_type(other.m_alu_type), + m_op_type(other.m_op_type), + m_act_type(other.m_act_type), + m_truncate(other.m_truncate), + m_shift_value(other.m_shift_value), + m_alu_operand(other.m_alu_operand), + m_mul_operand(other.m_mul_operand), + m_precision(other.m_precision), + m_isINT8Rescaling(other.m_isINT8Rescaling) + { } + + bool enabled() const { return m_enabled; } + void setEnabled(bool enabled) { m_enabled = enabled; } + + SDPMode mode() const { return m_mode; } + void setMode(SDPMode mode) { m_mode = mode; } + + SDPActType actType() const { return m_act_type; } + void setActType(SDPActType actType) { m_act_type = actType; } + + SDPOpType opType() const { return m_op_type; } + void setOpType(SDPOpType opType) { m_op_type = opType; } + + SDPALUType aluType() const { return m_alu_type; } + void setAluType(SDPALUType aluType) { m_alu_type = aluType; } + + NvU8 truncate() const { return m_truncate; } + void setTruncate(NvU8 truncate) { m_truncate = truncate; } + + NvU8 shiftValue() const { return m_shift_value; } + void setShiftValue(NvU8 shiftValue) { m_shift_value = shiftValue; } + + NvS16 aluOperand() const { return m_alu_operand; } + void setAluOperand(NvS16 aluOperand) { m_alu_operand = aluOperand; } + + NvS16 mulOperand() const { return m_mul_operand; } + void setMulOperand(NvS16 mulOperand) { m_mul_operand = mulOperand; } + + surface::SurfacePrecision precision() const { return m_precision; } + void setPrecision(surface::SurfacePrecision precision) { m_precision = precision; } + + PrecisionCVTParams& mulCVT() { return m_mul_cvt; } + void setMULCVT(const PrecisionCVTParams& mulCvt) { m_mul_cvt = mulCvt; } + + PrecisionCVTParams& aluCVT() { return m_alu_cvt; } + void setALUCVT(const PrecisionCVTParams& aluCvt) { m_alu_cvt = aluCvt; } + + bool isINT8Rescaling() { return m_isINT8Rescaling; } + void setINT8Rescaling(bool enb) { m_isINT8Rescaling = enb; } + +protected: + bool m_enabled; + SDPMode m_mode; + SDPALUType m_alu_type; + SDPOpType m_op_type; + SDPActType m_act_type; + NvU8 m_truncate; + NvU8 m_shift_value; + NvS16 m_alu_operand; + NvS16 m_mul_operand; + surface::SurfacePrecision m_precision; + PrecisionCVTParams m_alu_cvt; + PrecisionCVTParams m_mul_cvt; + bool m_isINT8Rescaling; +}; + +class SDPEngineParams : public EngineParams +{ +public: + SDPEngineParams() : EngineParams(), + m_x1_params(), + m_x2_params(), + m_y_params(), + m_conv_mode(ConvolutionModeEnum::CONV_DIRECT), + m_wg_params(), + m_num_groups(1) + { } + virtual ~SDPEngineParams() { } + + /* clone */ + SDPEngineParams(const SDPEngineParams &other) : + m_x1_params(other.m_x1_params), + m_x2_params(other.m_x2_params), + m_y_params(other.m_y_params), + m_conv_mode(other.m_conv_mode), + m_wg_params(other.m_wg_params), + m_num_groups(other.m_num_groups), + m_out_cvt(other.m_out_cvt) + { } + + // hold all winograd specific params here + struct WinogradParams { + Dims4 ioDims; + Dims4 auxDims; + }; + + SDPSubEngineParams& x1Params() { return m_x1_params; } + void setX1Params(const SDPSubEngineParams& x1Params) { m_x1_params = x1Params; } + + SDPSubEngineParams& x2Params() { return m_x2_params; } + void setX2Params(const SDPSubEngineParams& x2Params) { m_x2_params = x2Params; } + + SDPSubEngineParams& yParams() { return m_y_params; } + void setYParams(const SDPSubEngineParams& yParams) { m_y_params = yParams; } + + ConvolutionMode convMode() const { return m_conv_mode; } + void setConvMode(ConvolutionMode convMode) { m_conv_mode = convMode; } + + WinogradParams& winogradParams() { return m_wg_params; } + void setWinogradParams(const WinogradParams& wgp) { m_wg_params = wgp; } + + NvU16 numGroups() const { return m_num_groups; } + void setNumGroups(NvU16 groups) { m_num_groups = groups; } + + PrecisionCVTParams& outCVT() { return m_out_cvt; } + void setOutCVT(const PrecisionCVTParams& outCvt) { m_out_cvt = outCvt; } + +protected: + SDPSubEngineParams m_x1_params; // for x1,x2,y + SDPSubEngineParams m_x2_params; + SDPSubEngineParams m_y_params; + ConvolutionMode m_conv_mode; + WinogradParams m_wg_params; + NvU16 m_num_groups; + PrecisionCVTParams m_out_cvt; +}; + +class CPUParams : public EngineParams +{ +public: + CPUParams() : EngineParams() { } + virtual ~CPUParams() { } +}; + +class RubikEngineParams : public EngineParams +{ +public: + RubikEngineParams() : + m_mode(RubikModeEnum::RUBIK_MODE_UNKNOWN) + { } + virtual ~RubikEngineParams() { } + + RubikMode mode() const { return m_mode; } + void setMode(RubikMode mode) { m_mode = mode; } + + Dims2 deconvStride() const { return m_deconv_stride; } + void setDeconvStride(Dims2 stride) { m_deconv_stride = stride; } + + // hold all contract op related params here + struct ContractOpParams { + Dims4 inDims; + Dims4 outDims; + }; + + ContractOpParams& contractOpParams() { return m_contract_op_params; } + void setContractOpParams(const ContractOpParams& cp) { m_contract_op_params = cp; } + +protected: + RubikMode m_mode; + Dims2 m_deconv_stride; + ContractOpParams m_contract_op_params; +}; + +class PDPEngineParams : public EngineParams +{ +public: + PDPEngineParams() { } + virtual ~PDPEngineParams() { } + + struct hwSplitWidthInfo { + NvS32 numSplits; + NvS32 rightPadding; + NvS32 bottomPadding; + // input + NvS32 firstInWidth; + NvS32 midInWidth; + NvS32 lastInWidth; + NvS32 numOverlapStripes; + // output + NvS32 firstOutWidth; + NvS32 midOutWidth; + NvS32 lastOutWidth; + + hwSplitWidthInfo() : + numSplits(0), + rightPadding(0), + bottomPadding(0), + firstInWidth(0), + midInWidth(0), + lastInWidth(0), + numOverlapStripes(0), + firstOutWidth(0), + midOutWidth(0), + lastOutWidth(0) + { } + }; + + nvdla::PoolingType poolingType() const { return m_pooling_type; } + void setPoolingType(nvdla::PoolingType poolingType) { m_pooling_type = poolingType; } + + virtual int paddingValue() const { return m_padding_value; } + virtual void setPaddingValue(int p) { m_padding_value = p; } + + virtual Dims2 bottomRightPadding() const { return m_BR_padding; } + virtual void setBottomRightPadding(Dims2 pad) { m_BR_padding = pad; } + + virtual Dims2 topLeftPadding() const { return m_TL_padding; } + virtual void setTopLeftPadding(Dims2 pad) { m_TL_padding = pad; } + + virtual Dims2 stride() const { return m_stride; } + virtual void setStride(Dims2 stride) { m_stride = stride; } + + virtual Dims2 poolingWindow() const { return m_pooling_window; } + virtual void setPoolingWindow(Dims2 window) { m_pooling_window = window; } + + hwSplitWidthInfo getHwSplitWidthInfo() const { return m_hwSplitWidthInfo; } + void setHwSplitWidthInfo(hwSplitWidthInfo sinfo) { m_hwSplitWidthInfo = sinfo; } + +protected: + nvdla::PoolingType m_pooling_type; + Dims2 m_TL_padding; + Dims2 m_BR_padding; + NvU32 m_padding_value; + Dims2 m_stride; + Dims2 m_pooling_window; + hwSplitWidthInfo m_hwSplitWidthInfo; +}; + +class CDPEngineParams : public EngineParams +{ +public: + CDPEngineParams() { } + virtual ~CDPEngineParams() { } + + virtual NvU32 localSize() const { return m_local_size; } + virtual void setLocalSize(NvU32 localSize) { m_local_size = localSize; } + + virtual NvF32 alpha() const { return m_alpha; } + virtual void setAlpha(NvF32 alpha) { m_alpha = alpha; } + + virtual NvF32 beta() const { return m_beta; } + virtual void setBeta(NvF32 beta) { m_beta = beta; } + + virtual NvF32 k() const { return m_k; } + virtual void setK(NvF32 k) { m_k = k; } + +protected: + NvU32 m_local_size; + NvF32 m_alpha; + NvF32 m_beta; + NvF32 m_k; +}; + + + +class BDMAEngineParams : public EngineParams +{ +public: + BDMAEngineParams() { } + virtual ~BDMAEngineParams() { } + + NvU32 destLine() const { return m_dest_line; } + void setDestLine(NvU32 destLine) { m_dest_line = destLine; } + + NvU32 destSurface() const { return m_dest_surface; } + void setDestSurface(NvU32 destSurface) { m_dest_surface = destSurface; } + + NvU32 lineRepeat() const { return m_line_repeat; } + void setLineRepeat(NvU32 lineRepeat) { m_line_repeat = lineRepeat; } + + NvU32 lineSize() const { return m_line_size; } + void setLineSize(NvU32 lineSize) { m_line_size = lineSize; } + + NvU32 srcLine() const { return m_src_line; } + void setSrcLine(NvU32 srcLine) { m_src_line = srcLine; } + + NvU32 srcSurface() const { return m_src_surface; } + void setSrcSurface(NvU32 srcSurface) { m_src_surface = srcSurface; } + + NvU32 surfaceRepeat() const { return m_surface_repeat; } + void setSurfaceRepeat(NvU32 surfaceRepeat) { m_surface_repeat = surfaceRepeat; } + + NvU32 numTransfers() const { return m_num_transfers; } + void setNumTransfers(NvU32 numTransfers) { m_num_transfers = numTransfers; } + +private: + NvU32 m_line_size; + NvU32 m_line_repeat; + NvU32 m_src_line; + NvU32 m_dest_line; + NvU32 m_surface_repeat; + NvU32 m_src_surface; + NvU32 m_dest_surface; + NvU32 m_num_transfers; +}; + +class SplitParams : public EngineParams +{ +public: + SplitParams() { } + virtual ~SplitParams() { } + +}; + +}; // nvdla::priv::engine_ast + +}; // nvdla::priv + +}; // nvdla:: + + +namespace nvdla +{ + +class INetwork; +class ILayer; +class ITensor; + +namespace priv +{ + +class Layer; +class Network; +class Tensor; +class Wisdom; +class WisdomContainerEntry; +class Profile; +class TargetConfig; +class LutManager; + +namespace memory +{ +class MemoryResolver; +}; + +namespace engine_ast +{ +// +// types related to business handled int the edge and node info +// any of these which should be visible in consumers of the graph +// need to stay public. +// +enum EdgeTypeEnum { + ENGINE_AST_EDGE_TYPE_ENUMS(GEN_ENUM) +}; +typedef SequenceEnum EdgeType; + +enum EngineTypeEnum { + ENGINE_AST_ENGINE_TYPE_ENUMS(GEN_ENUM) +}; +typedef SequenceEnum EngineType; + +enum EngineOpTypeEnum { + ENGINE_AST_ENGINE_OP_TYPE_ENUMS(GEN_ENUM) +}; +typedef SequenceEnum EngineOpType; + +enum IODirectionEnum { + ENGINE_AST_IO_DIRECTION_ENUMS(GEN_ENUM) +}; +typedef SequenceEnum IODirection; + +enum OperationEventTypeEnum { + ENGINE_AST_OPERATION_EVENT_TYPE_ENUMS(GEN_ENUM) +}; +typedef SequenceEnum OperationEventType; + +static std::vector viaData = { {engine_ast::EdgeTypeEnum::DATA} }; +static std::vector viaCompute = { {engine_ast::EdgeTypeEnum::COMPUTE} }; +static std::vector viaHazard = { {engine_ast::EdgeTypeEnum::HAZARD} }; +static std::vector viaComputeData = { {engine_ast::EdgeTypeEnum::COMPUTE}, + {engine_ast::EdgeTypeEnum::DATA} }; +static std::vector viaComputeHazard = { {engine_ast::EdgeTypeEnum::COMPUTE}, + {engine_ast::EdgeTypeEnum::HAZARD} }; +static std::vector allowData = { {engine_ast::EdgeTypeEnum::DATA} }; +static std::vector allowDataCompute = { {engine_ast::EdgeTypeEnum::DATA}, + {engine_ast::EdgeTypeEnum::COMPUTE} }; +static std::vector allowAll; + +class ASTToEMUInterface +{ +public: + static NvU16 getDataFormat(EMUInterface*, surface::SurfaceFormat, NvU32 mem_atomic_size); +}; + +class ASTToDLAInterface +{ +public: + static NvS8 getEngineType(DLAInterface*, EngineType); + static NvU8 getOperationEventType(DLAInterface*, OperationEventType); + static NvU8 getDataFormat(DLAInterface*, surface::SurfaceFormat); + static NvU8 getConvCorePrecision(DLAInterface*, surface::SurfacePrecision); + static NvU8 getSDPEnable(DLAInterface*, bool enabled); + static NvU8 getSDPPrecision(DLAInterface*, surface::SurfacePrecision); + static NvU8 getSDPActType(DLAInterface* dla_if, engine_ast::SDPActType sat); + static NvU8 getSDPALUType(DLAInterface* dla_if, engine_ast::SDPALUType sat); + static NvU8 getSDPMode(DLAInterface* dla_if, engine_ast::SDPMode smode); + static NvU8 getSDPOpType(DLAInterface* dla_if, engine_ast::SDPOpType sat); + static NvU8 getPDPPrecision(DLAInterface*, surface::SurfacePrecision); + static NvU8 getCDPPrecision(DLAInterface*, surface::SurfacePrecision); + static NvU8 getPDPMode(DLAInterface*, nvdla::PoolingType); + static NvU8 getRubikPrecision(DLAInterface*, surface::SurfacePrecision); + static NvU8 getRubikMode(DLAInterface*, engine_ast::RubikMode); +}; + +class MemoryCollector; +class Graph; +class Node; +class Edge; +class ScoredDependencyOrdering; +class DependencyOrdering; + +class MemoryCollector +{ +public: + + static MemoryCollector* getInstance() + { + if (collector == NULL) + { + collector = new MemoryCollector(); + } + return collector; + } + + MemoryCollector() {} + virtual ~MemoryCollector() {} + + void* allocateMemory(size_t size) + { + // Allocate memory and register it internally. + void* memory = malloc(size); + if (memory != NULL) + { + registerMemory(memory); + } + + return memory; + } + + void freeMemory(void* memory) + { + // unregister memory and free it. + if (memory != NULL) + { + unregisterMemory(memory); + free(memory); + } + } + + void freeRemainingMemories() + { + // Free all remaining unfreed memories. + for (auto it = m_registered_memories.begin(); it != m_registered_memories.end(); ++it) + { + free(*it); + } + m_registered_memories.clear(); + + delete collector; + collector = NULL; + } + +private: + void registerMemory(void* memory) { m_registered_memories.insert(memory); } + void unregisterMemory(void* memory) { m_registered_memories.erase(memory); } + + // singleton + static MemoryCollector* collector; + std::unordered_set m_registered_memories; +}; + + +class Graph : public ast::Graph +{ +public: + Graph(Profile *profile, TargetConfig *target_config); + + virtual ~Graph(); + Graph* clone() { return new Graph(*this); } + + virtual std::string name() { return std::string("OUTER_GRAPH"); } + virtual void setScoredOrdering(ScoredDependencyOrdering *o) { m_scored_ordering = o; } + virtual void setOrdering(DependencyOrdering *o) { m_ordering = o; } + virtual DependencyOrdering *ordering() { return m_ordering; } + virtual ScoredDependencyOrdering *scoredOrdering() { return m_scored_ordering; } + + /* Getters and Setters */ + virtual std::string nextNodeId() { return std::string("n-") + toString(m_next_node_id++); } + virtual std::string nextEdgeId() { return std::string("e-") + toString(m_next_edge_id++); } + + // downstreamDataEdges := downstreamEdges where type == DATA + std::vector downstreamDataEdges(Node * node); + std::vector downstreamComputeEdges(Node * node); + std::vector downstreamHazardEdges(Node * node); + std::vector downstreamDataNodes(Node* node); + std::vector downstreamComputeNodes(Node* node); + std::vector downstreamHazardNodes(Node* node); + + std::vector upstreamDataEdges(Node * node); + std::vector upstreamHazardEdges(Node * node); + + Edge* connectingDataEdge(Node* fromNode, Node* toNode, ast::EdgeSide fromDir); + + std::vector upstreamAuxEdges(Node * node); + Edge* getUpstreamAuxEdge(Node * node, NvU8 id = 0); + + std::vector upstreamDataNodes(Node* node); + + std::vector siblingDataEdges(Edge* edge); + + // the profile using which this graph and its constituents are compiled + virtual Profile *profile() const { return m_profile; } + virtual TargetConfig *target_config() const { return m_targetconfig; } + virtual memory::DLAResourceManager *resourceMgr() { return &m_resource_mgr; } + virtual LutManager *lutManager() { return m_lutManager; } + + NvDlaError initGraphResources(); + + // the caffe parser doesnt encapsulate the auxiliary inputs like + // kernel and bias weights into tensors. but we need them in the graph + std::string newAuxTensorName(); + Tensor* addAuxTensor(const std::string &s, const Dims4 dims, TensorType tt); + + surface::TensorSurfaceDesc *nodeInputTensorSurface(const Node *, size_t i, const std::vector &); + surface::TensorSurfaceDesc *nodeOutputTensorSurface(const Node *, size_t i, const std::vector &); + + inline bool debugGraphDump() const { return false; } + inline bool debugClone() const { return false; } + inline bool debugOps() const { return false; } + inline bool debugGroupOps() const { return false; } + inline bool debugMathOptz() const { return false; } + inline bool debugWeights() const { return false; } + inline bool debugQuantization() const { return false; } + inline bool debugFuseSubEngineOps() const { return false; } + inline bool debugSurfaces() const { return false; } + inline bool debugBuffers() const { return false; } + inline bool debugCopyOutDebug() const { return false; } + inline bool debugMemoryLayout() const { return false; } + inline bool debugBinding() const { return false; } + inline bool debugDepGraph() const { return false; } + inline bool debugMemHazards() const { return false; } + inline bool debugRelocs() const { return false; } + + class Graphlet + { + public: + Graphlet() : m_node_list(NodeSequence()) + { + m_engine_op_heads = NodeSequence(EngineType::num_elements(), NULL); + } + virtual ~Graphlet() { } + virtual Graphlet *clone() + { + return new Graphlet(*this); + } + NodeSequence & nodeList() + { + return m_node_list; + } + void setNodeList(const NodeSequence& nl) + { + m_node_list = nl; + } + NodeSequence & opHeads() + { + return m_engine_op_heads; + } + + protected: + NodeSequence m_node_list; + NodeSequence m_engine_op_heads; // FIXME: clone this suitably + }; + + inline std::vector< Graphlet *> & graphlets() + { + return m_graphlets; + } + + ScoredDependencyOrdering *m_scored_ordering; + DependencyOrdering *m_ordering; + + virtual void checkDirty(); + + virtual const NodeSequence &orderedNodes(); + virtual const EdgeSequence &orderedEdges(); + virtual const ElemSequence &orderedElems(); + + const EdgeSequence &orderedComputeEdges(); + const EdgeSequence &orderedDataEdges(); + + NvDlaError determineNwSurfaceFormat(TensorType); + surface::SurfaceFormat suggestNwSurfaceFormat(TensorType); + + /* Compiler operations on graph */ + NvDlaError registerAllSurfaces(); + NvDlaError registerAllBuffers(); + NvDlaError reserveAllBuffers(); + NvDlaError preProcessAuxData(); + NvDlaError mergeUnitScaleOperations(); + NvDlaError mergeActivationOperations(); + NvDlaError updateScalingFactors(); + NvDlaError quantizeAuxData(); + NvDlaError handleLowPrecisionConversions(); + NvDlaError translateAuxData(); + NvDlaError fuseOnTheFlyNodes(); + NvDlaError groupAtomicOperations(); + NvDlaError splitNodes(); + NvDlaError handleMultiBatch(); + NvDlaError fuseSDPSubEngineOps(); + NvDlaError flattenGraph(); + NvDlaError topologicalSort(NodeSequence& topological_order); + NvDlaError resolveDataDependencies(const NodeSequence& allNodes); + NvDlaError resolveComputeDependencies(const NodeSequence& allNodes); + NvDlaError resolveSoftwareDependencies(); + NvDlaError resolveMultiBatchDependencies(); + NvDlaError regroupAtomicOperations(); + NvDlaError determineTaskBoundaries(const NodeSequence& allNodes); + NvDlaError annotateNodes(NvS16& lastUsedAnnId); + NvDlaError resolveMemory(const NodeSequence &topological_order); + + /* verification/sanity operations on graph */ + NvDlaError verifyAllSurfaces(); + NvDlaError verifyAllBuffers(); + NvDlaError verifyDependencyGraph(); + + /* refresh graph state */ + NvDlaError refreshGraphState(); + + /* Code emission operations on graph */ + NvDlaError prepareMemoryListEntries(Loadable *l); + NvDlaError createTensorDescListEntry(surface::TensorSurfaceDesc *, ILoadable::TensorDescListEntry &, NvU32 memAtomsize); + + /* graph utils */ + bool connectedComputeNodes(Node* upStream, Node* downStream); + bool connectedDataNodes(Node* upStream, Node* downStream); + void replaceEdgeNodes(Edge* edge, ast::EdgeSide dir, Node* oldNode, Node* newNode); + void replaceNodeEdges(Node* node, ast::EdgeSide dir, Edge* oldEdge, Edge* newEdge); + virtual bool connectNodesWithEdge(Edge* newEdge, Node* fromNode, Node* toNode); + NvDlaError removeNodeFromAST(Node* killNode, IODirection iod); + NvDlaError substituteNodeInAST(Node* origNode, NodeSequence subNodes); + NvDlaError substituteEdgeInAST(Edge* origEdge, Edge* subEdge); + Edge *addComputeEdge(Node *fromNode, Node *toNode); + Edge *addDataEdge(canonical_ast::Edge *canEdge, Node *fromNode, Node *toNode, Tensor *tensor); + Edge *addDataEdge(engine_ast::Edge *cloneEdge, Node *fromNode, Node *toNode, Tensor *tensor); + Edge *addHazardEdge(Node *fromNode, Node *toNode); + + void resetRelocEntries(); + void insertRelocEntry(ILoadable::RelocEntry); + NvDlaError gatherRelocEntries(NvS16 opsId, NvU8 *opsBase, + NvS16 surfsId, NvU8 *surfsBase, + NvS16 depsId, NvU8 *depsBase); + std::vector &getRelocEntries() { return m_relocEntries; } + + static void printGraph(engine_ast::Graph* g, bool nested, std::string graphName = ""); + +protected: + Graph(const Graph &other); + surface::TensorSurfaceDesc *nodeTensorSurface(const Node *, size_t i, + const std::vector &types, + ast::EdgeSideEnum dir); + int m_next_node_id; + int m_next_edge_id; + EdgeSequence m_graph_input_edges; + EdgeSequence m_graph_output_edges; + memory::DLAResourceManager m_resource_mgr; + + std::vector m_graphlets; + std::vector m_stream_tensors; + std::vector m_aux_tensors; + std::vector m_io_tensors; + std::vector m_debug_tensors; + std::map m_tbd_memory_list_id; + Profile *m_profile; + TargetConfig *m_targetconfig; + + // helper class used to implement resolveMemory() + memory::MemoryResolver *m_memoryResolver; + + LutManager* m_lutManager; + + std::vector m_relocEntries; +}; + +typedef Graph::NodeSequence NodeSequence; + +class DependencyParams +{ +public: + + typedef engine_ast::Graph::NodeSequence NodeSequence; + + class BindNode + { + public: + BindNode() : + m_bind_node(NULL), + m_bind_node_ann_id(-1), + m_op_event(OperationEventTypeEnum::OP_COMPLETED) + { } + virtual ~BindNode() { } + + OperationEventType opEvent() { return m_op_event; } + void setOpEvent(const OperationEventType opEvent) { m_op_event = opEvent; } + + Node* node() { return m_bind_node; } + void setNode(Node* node) { m_bind_node = node; } + + NvS16 nodeAnnId() const { return m_bind_node_ann_id; } + void setNodeAnnId(NvS16 nodeAnnId) { m_bind_node_ann_id = nodeAnnId; } + + protected: + Node* m_bind_node; + NvS16 m_bind_node_ann_id; + OperationEventType m_op_event; + }; + + DependencyParams() : m_annotation_id(-1), m_fused_nodes(NodeSequence()) + { + // init null initialized fused node array of fixed size + m_fused_nodes = NodeSequence(IODirection::num_elements(), NULL); + + // init null initialized producer and consumer arrays of fixed sizes + m_consumers = std::vector(EngineType::num_elements(), BindNode()); + m_producers = std::vector(EngineType::num_elements(), BindNode()); + } + virtual ~DependencyParams() { } + virtual DependencyParams* clone() { return new DependencyParams(*this); } + + BindNode& consumer(NvU8 index) { return m_consumers[index]; } + std::vector & consumers() { return m_consumers; } + + BindNode& producer(NvU8 index) { return m_producers[index]; } + std::vector & producers() { return m_producers; } + + Node *fusedNode(IODirection dir) const { return m_fused_nodes[dir.v()]; } + void setFusedNode(IODirection dir, Node *node) { m_fused_nodes[dir.v()] = node; } + + void setAnnotationId(NvS16 id) { m_annotation_id = id; } + NvS16 annotationId() const { return m_annotation_id; } + + NvU16 getDependencyCount(); + + void clear() + { + for (size_t ii = 0; ii < EngineType::num_elements(); ++ii) + { + m_producers[ii].setNode(NULL); + m_producers[ii].setOpEvent(OperationEventTypeEnum::OP_COMPLETED); + m_consumers[ii].setNode(NULL); + m_consumers[ii].setOpEvent(OperationEventTypeEnum::OP_COMPLETED); + } + setAnnotationId(-1); + setFusedNode(IODirectionEnum::INPUT, NULL); + setFusedNode(IODirectionEnum::OUTPUT, NULL); + } + + /* clone */ + DependencyParams(const DependencyParams &other) : + m_annotation_id(other.m_annotation_id), + m_fused_nodes(other.m_fused_nodes) + { } + +protected: + NvS16 m_annotation_id; + NodeSequence m_fused_nodes; // [IODirection::num_elements()]; + std::vector m_consumers; + std::vector m_producers; +}; + +class SDPNode; //fwd decl + +class Node +{ +public: + virtual std::string className() const { return std::string("Node"); } + virtual std::string pretty() const { return "";} // override in specific nodes to add. careful... + + static std::string prettyId(const Node *n, NvU8 flags = ast::PrettyId_Default) + { + if ( !n ) { return std::string("(null)"); } + std::stringstream r; std::string sep(""); + if ( flags & ast::PrettyId_Id ) { r << sep << n->id(); sep = " "; } + if ( flags & ast::PrettyId_ClassName ) { r << sep << n->className(); sep = " "; } + if ( flags & ast::PrettyId_Name ) { r << sep << n->name(); sep = " "; } + if ( flags & (ast::PrettyId_Verbose) ) { r << sep << n->pretty(); sep = " "; } + return r.str(); + } + + + typedef engine_ast::Graph::NodeSequence NodeSequence; + typedef engine_ast::Graph::EdgeSequence EdgeSequence; + typedef engine_ast::Graph::NodeSequenceIterator NodeSequenceIterator; + typedef engine_ast::Graph::EdgeSequenceIterator EdgeSequenceIterator; + + Node(NvU16 numBatches = 1) : m_containing_graph(0), m_taskId(-1) + { + m_unique_id = m_next_id++; + m_mb_dependency_params = new MultiBatchState< DependencyParams >(numBatches); + m_sup_in_surf_formats = std::vector< surface::SurfaceFormat >(); + m_sup_out_surf_formats = std::vector< surface::SurfaceFormat >(); + m_sup_aux_surf_formats = std::vector< surface::SurfaceFormat >(); + } + virtual ~Node() { } + virtual Node *clone () { return new Node(*this); } + + const std::string id() const { return m_id; } + void setId(const std::string id) { m_id = id; } + + NvU32 uniqueId() const { return m_unique_id;} + + const std::string name() const { return m_name; } + void setName(const std::string name) { m_name = name; } + + inline Graph* graph() const { return m_containing_graph; } + void setGraph(Graph* g) { m_containing_graph = g; } + + EngineType engineType() const { return m_engine_type; } + void setEngineType(EngineType et) { m_engine_type = et; } + + EngineOpType engineOpType() const { return m_engine_op_type; } + void setEngineOpType(EngineOpType eot) { m_engine_op_type = eot; } + + bool isEMUEngineType() const { return m_engine_type.e() == CPU; } + bool isDLAEngineType() const { return !(m_engine_type.e() == CPU || + m_engine_type.e() == SPLIT || + m_engine_type.e() == CONCATENATION); } + bool isSoftwareNode() const { return (m_engine_type.e() == SPLIT || + m_engine_type.e() == CONCATENATION); } + virtual bool isEngineType(EngineType et) { return m_engine_type == et; } + + virtual EngineParams& params(NvU16) { return EngineParamsNULL; } + virtual void inheritParams(Node*) { return; } + virtual const void* getAuxData(Edge* auxEdge) { return NULL; } + virtual Dims4 getAuxDims() { return Dims4(-1,-1,-1,-1); } + + virtual canonical_ast::Node *canonicalNode() const { return NULL; } + + inline const std::vector< surface::SurfaceFormat >& supportedInSurfFormats() const { return m_sup_in_surf_formats; } + inline const std::vector< surface::SurfaceFormat >& supportedOutSurfFormats() const { return m_sup_out_surf_formats; } + inline const std::vector< surface::SurfaceFormat >& supportedAuxSurfFormats() const { return m_sup_aux_surf_formats; } + + const std::vector< surface::SurfaceCategory > supportedInSurfCategories() const; + const std::vector< surface::SurfaceCategory > supportedOutSurfCategories() const; + const std::vector< surface::SurfaceCategory > supportedAuxSurfCategories() const; + + bool dependsOn(Node *on, const std::vector &requireVia, const std::vector &allowVia) const; + + std::vector< surface::TensorSurfaceDesc *> auxSurfaces() const; + std::vector< surface::TensorSurfaceDesc *> inputSurfaces() const; + std::vector< surface::TensorSurfaceDesc *> outputSurfaces() const; + + void emitDependencyParams(DLAInterface* target_dla, DLACommonOpDescAccessor dep, NvU32 batchId); + void setDataCubeAccessor(DLADataCubeAccessor acc, surface::TensorSurfaceDesc* tsd, IODirection iod, NvU32 batchId); + + virtual std::vector< surface::SurfaceFormat > suggestAuxSurfaceFormats(Edge* auxEdge); + std::vector< surface::SurfaceFormat > suggestOutputSurfaceFormats(); + std::vector< surface::SurfaceFormat > suggestInputSurfaceFormats(); + NvDlaError supportsSurfaceFormat(surface::SurfaceFormat, std::vector< surface::SurfaceFormat >); + + virtual Dims4 suggestSurfaceDims(surface::TensorSurfaceDesc* tsd); + virtual NvU32 suggestLineStride(surface::TensorSurfaceDesc* tsd); + virtual NvU32 suggestSurfaceStride(surface::TensorSurfaceDesc* tsd); + virtual NvU64 suggestSurfaceSize(surface::TensorSurfaceDesc* tsd); + virtual NvU64 suggestSurfaceOffsetInBuffer(surface::TensorSurfaceDesc* tsd); + virtual memory::TensorBufferDesc* suggestBuffer(surface::TensorSurfaceDesc* tsd); + + virtual NvDlaError preProcessAuxData() { return NvDlaSuccess; } + virtual Node* mergeWithSDPOp(SDPNode* other_op) { return NULL; } + virtual NvDlaError updateScalingFactors() { return NvDlaSuccess; } + virtual NvDlaError quantizeAuxData() { return NvDlaSuccess; } + virtual NvDlaError fuseOnTheFlyNodes() { return NvDlaSuccess; } + virtual NvDlaError handleLowPrecisionConversions() { return NvDlaSuccess; } + virtual NvDlaError translateAuxData() { return NvDlaSuccess; } + virtual NvDlaError splitNodes() { return NvDlaSuccess; } + virtual NvDlaError handleMultiBatch() { return NvDlaSuccess; } + virtual NvDlaError resolveDataDependencies(Node* next); + virtual NvDlaError resolveComputeDependencies(const NodeSequence& ordered_nodes); + NvDlaError resolveSoftwareDependencies(); + virtual NvDlaError resolveMultiBatchDependencies(); + virtual NvDlaError selfAnnotate(NvS16& lastUsedAnnId); + + virtual NvDlaError verifyEdgePorts() { return NvDlaSuccess; } + virtual NvDlaError verifySurfaceDims(surface::TensorSurfaceDesc*) { return NvDlaSuccess; } + NvDlaError verifySurfaces(); + NvDlaError verifyDependencyParams(); + + const EdgeSequence& inputEdges() const { return m_input_edges; } + void markInputEdge(Edge* input) + { + if (std::find(m_input_edges.begin(), m_input_edges.end(), input) == m_input_edges.end()) + m_input_edges.push_back(input); + } + + const EdgeSequence& outputEdges() const { return m_output_edges; } + void markOutputEdge(Edge* output) + { + if (std::find(m_output_edges.begin(), m_output_edges.end(), output) == m_output_edges.end()) + m_output_edges.push_back(output); + } + + const EdgeSequence& auxEdges() const { return m_aux_edges; } + void markAuxEdge(Edge* aux) + { + if (std::find(m_aux_edges.begin(), m_aux_edges.end(), aux) == m_aux_edges.end()) + m_aux_edges.push_back(aux); + } + + // cache reference to input/aux/output edges of each node into the respective edge ports + virtual NvDlaError populateEdgePorts(); + void unpopulateEdgePorts() { m_input_edges.clear(); m_aux_edges.clear(); m_output_edges.clear(); } + NvDlaError repopulateEdgePorts() { unpopulateEdgePorts(); return populateEdgePorts(); } + + // get the data edge which matches any of the supplied tensor surface categories + NvDlaError nodeDataEdge(const std::vector& types, ast::EdgeSideEnum dir, engine_ast::Edge** retEdge); + // get the data edge which matches the supplied raw tensor type (used when SD is not yet defined for the edge) + NvDlaError nodeDataEdge(TensorType raw_tt, ast::EdgeSideEnum dir, engine_ast::Edge** retEdge); + + // get the aux edge associated with the node + virtual NvDlaError nodeAuxEdge(engine_ast::Edge **ret_edge) { *ret_edge = NULL; return NvDlaSuccess; } + + virtual void captureCanonicalParams() { return; } + + DependencyParams& dependencyParams() { return m_mb_dependency_params->batch(0); } + DependencyParams& dependencyParams(NvU16 batchId) { return m_mb_dependency_params->batch(batchId); } + + /* Code Emission and DLA interface APIs */ + void setTaskId(NvS16 id) { m_taskId = id; } + NvS16 taskId() const { return m_taskId; } + + inline bool debugWinograd() const { return false; } + inline bool debugSplits() const { return false; } + inline bool debugFusion() const { return false; } + inline bool debugResolveDependencies() const { return false; } + + virtual NvDlaError emitOp(Graph *, DLAInterface *, NvU32 op_slot, NvU32 batch_id, + DLACommonOpDescAccessor, + DLAOperationContainerAccessor, + DLASurfaceContainerAccessor); + +#ifdef NVDLA_COMPILER_OUTPUT_FOR_PROTOTEST + virtual NvDlaError emitOp(NvU32 /*op_slot*/, NvU32 /*batch_id*/, + DLAInterface*, + DLACommonOpDescAccessor&, + DLAOperationContainerAccessor&, + DLASurfaceContainerAccessor&, + nvdla_prototest_interface::Layer*) { return NvDlaSuccess; } +#endif + + virtual NvDlaError emitOp(Graph *, EMUInterface *, NvU32 op_slot, NvU32 batch_id, + EMUOperationContainerAccessor, + EMUOperationBufferContainerAccessor); + + NvDlaError clearNodeTSDStateMapping() + { + m_nodeTSDSurfaceOffsetInBuffer.clear(); + m_nodeTSDLineStride.clear(); + m_nodeTSDSurfaceStride.clear(); + m_nodeTSDSurfaceSize.clear(); + + return NvDlaSuccess; + } + +protected: + /* for clone */ + Node(const Node &other) : + m_id(other.m_id), + m_unique_id(m_next_id++), + m_name(other.m_name), + m_containing_graph(0), + m_engine_type(other.m_engine_type), + m_engine_op_type(other.m_engine_op_type), + m_aux_edges(other.m_aux_edges), + m_input_edges(other.m_input_edges), + m_output_edges(other.m_output_edges), + m_mb_dependency_params(other.m_mb_dependency_params), + m_sup_in_surf_formats(other.m_sup_in_surf_formats), + m_sup_aux_surf_formats(other.m_sup_aux_surf_formats), + m_sup_out_surf_formats(other.m_sup_out_surf_formats), + m_taskId(-1), + m_nodeTSDSurfaceOffsetInBuffer(), + m_nodeTSDLineStride(), + m_nodeTSDSurfaceStride(), + m_nodeTSDSurfaceSize() + { + // of all the attributes, you don't want the cloned node to inherit + // the containing_graph from orig node. The cloned node should belong + // to the new graph under construction. (see Graph(const Graph& other)) + } + + friend class Graph; + std::string m_id; // unique within the graph + NvU32 m_unique_id; // id for graph ordering. u32 instead of string. + static NvU32 m_next_id; + std::string m_name; + Graph* m_containing_graph; + EngineType m_engine_type; + EngineOpType m_engine_op_type; + EdgeSequence m_aux_edges; // definitive aux edge ports + EdgeSequence m_input_edges; // definitive input edge ports + EdgeSequence m_output_edges; // definitive output edge ports + MultiBatchState< DependencyParams > *m_mb_dependency_params; + std::vector< surface::SurfaceFormat > m_sup_in_surf_formats; + std::vector< surface::SurfaceFormat > m_sup_aux_surf_formats; + std::vector< surface::SurfaceFormat > m_sup_out_surf_formats; + NvS16 m_taskId; + std::map m_nodeTSDSurfaceOffsetInBuffer; + std::map m_nodeTSDLineStride; + std::map m_nodeTSDSurfaceStride; + std::map m_nodeTSDSurfaceSize; +}; + +class NestedGraph : public Graph +{ +public: + NestedGraph() : Graph(0, 0) + { + m_ng_scored_ordering = 0; + m_ng_ordering = 0; + m_containing_super_node = 0; + } + virtual ~NestedGraph() { } + NestedGraph* clone() { return new NestedGraph(*this); } + + virtual std::string name() { return std::string("INNER_GRAPH"); } + + virtual bool insertEdge(Edge*); + virtual bool insertNode(Node*); + virtual bool removeEdge(Edge*); + virtual bool removeNode(Node*); + virtual bool removeEdgeFromNode(Edge *, ast::EdgeSide, Node *); + virtual bool removeNodeFromEdge(Edge *, ast::EdgeSide, Node *); + virtual bool appendNodeToEdge(Edge *, ast::EdgeSide, Node *); + + bool connectNodesWithEdge(Edge* newEdge, Node* fromNode, Node* toNode); + + virtual void setScoredOrdering(ScoredDependencyOrdering *o) { m_ng_scored_ordering = o; } + virtual void setOrdering(DependencyOrdering *o) { m_ng_ordering = o; } + virtual DependencyOrdering *ordering() { return m_ng_ordering; } + virtual ScoredDependencyOrdering *scoredOrdering() { return m_ng_scored_ordering; } + + virtual std::string nextNodeId() { return std::string("ng-n-") + toString(m_next_node_id++); } + virtual std::string nextEdgeId() { return std::string("ng-e-") + toString(m_next_edge_id++); } + + virtual void checkDirty(); + virtual const NodeSequence &orderedNodes(); + virtual const EdgeSequence &orderedEdges(); + virtual const ElemSequence &orderedElems(); + + virtual Profile *profile() const { return m_containing_super_node->graph()->profile(); } + virtual TargetConfig *target_config() const { return m_containing_super_node->graph()->target_config(); } + virtual memory::DLAResourceManager *resourceMgr() { return m_containing_super_node->graph()->resourceMgr(); } + virtual LutManager *lutManager() { return m_containing_super_node->graph()->lutManager(); } + + NvDlaError populateNestedGraph(NodeSequence& groupedOps); + + inline Node* containingSuperNode() const { return m_containing_super_node; } + void setContainingSuperNode(Node* sn) { m_containing_super_node = sn; } + + NodeSequence topNodes(); + NodeSequence bottomNodes(); + + inline bool debugNestedGraph() { return false; } + +protected: + ScoredDependencyOrdering *m_ng_scored_ordering; + DependencyOrdering *m_ng_ordering; + Node* m_containing_super_node; +}; + +// collection of engine op nodes that can be executed atomically as a group +class MultiOpsNode : public Node +{ +public: + virtual std::string className() const { return std::string("MultiOpsNode"); } + + MultiOpsNode(NvU16 numBatches = 1) : Node(numBatches) + { + m_engine_type = MULTI_OPS; + m_nested_graph = 0; + m_is_online = false; + m_sup_in_surf_formats.assign(IMG_FORMATS, IMG_FORMATS + (sizeof(IMG_FORMATS)/sizeof(IMG_FORMATS[0]))); + m_sup_in_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_INT8); + m_sup_in_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_FP16); + m_sup_out_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_INT8); + m_sup_out_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_FP16); + } + virtual ~MultiOpsNode() { } + + /* + * Return true if the super node or any of its inner nodes have the same engine type + * as the one provided + */ + virtual bool isEngineType(EngineType et); + + virtual NvDlaError populateEdgePorts(); + virtual NvDlaError repopulateEdgePorts(); + + virtual NvDlaError splitNodes(); + virtual NvDlaError handleMultiBatch(); + virtual NvDlaError selfAnnotate(NvS16& lastUsedAnnId); + virtual NvDlaError resolveMultiBatchDependencies(); + + inline NestedGraph* nestedGraph() { return m_nested_graph; } + void setNestedGraph(NestedGraph* ng) { m_nested_graph = ng; } + + bool isOnline() const { return m_is_online; } + void setIsOnline(bool isOnline) { m_is_online = isOnline; } + + /* + * Some compiler operations like to see flattened graph (resolving dependencies, etc) + * these api's allow to replace the multi-op node with its contents in place + * and vice-versa + */ + NvDlaError plugNestedGraph(); + NvDlaError unplugNestedGraph(); + + Edge* outerGraphIsomorphEdgeOf(Edge*); + + const std::unordered_map< Edge*, Edge* >& isomorphicEdgeMap() { return m_isomorphic_edge_map; } + void setIsomorphicEdgeMap(const std::unordered_map< Edge*, Edge* >& iemap) { m_isomorphic_edge_map = iemap; } + + virtual NvDlaError verifyEdgePorts(); + +protected: + /* state of the multi-ops node as connected/disconnected from + * outer graph + */ + bool m_is_online; + NestedGraph* m_nested_graph; + + /* + * The super node should maintain a cache of isomorphic sets of edges: + * 1 set represents the input-output edges to the super node when it is a part of the outer graph + * and the 2nd set represents the graph input-output edges of the nested graph within + */ + std::unordered_map< Edge*, Edge* > m_isomorphic_edge_map; +}; + + + +// scale (when power non-trivial) +// softmax +class CPUNode : public Node +{ +public: + virtual std::string className() const { return std::string("CPUNode"); } + + CPUNode(NvU16 numBatches) : Node(numBatches) { m_engine_type = CPU; } + virtual ~CPUNode() { } + + virtual CPUNode *clone() { return new CPUNode(*this); } + virtual canonical_ast::Node* canonicalNode() const { return NULL; } + virtual void captureCanonicalParams(){ return; } +}; + +// scale op in CPU engine :- y = (scale_factor * x) +class CPUScaleOpNode : public CPUNode +{ +public: + virtual std::string className() const { return std::string("CPUScaleOpNode"); } + + class OpParams : public CPUParams + { + public: + OpParams() { } + virtual ~OpParams() { } + + const Weights& power() const { return m_power; } + void setPower(const Weights& power) { m_power = power;} + + const Weights& scale() const { return m_scale; } + void setScale(const Weights& scale) { m_scale = scale; } + + const Weights& shift() const { return m_shift; } + void setShift(const Weights& shift) { m_shift = shift; } + + protected: + // add everything relevant to CPU based scale op + Weights m_scale; + Weights m_power; + Weights m_shift; + }; + + CPUScaleOpNode(canonical_ast::ScaleNode* can_scale_node, NvU16 numBatches = 1) : CPUNode(numBatches) + { + m_engine_type = CPU; + m_engine_op_type = CPU_SCALE; + m_can_scale_node = can_scale_node; + m_mb_op_params = new MultiBatchState < OpParams >(numBatches); + m_sup_in_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_INT8); + m_sup_in_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_FP16); + m_sup_out_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_INT8); + m_sup_out_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_FP16); + } + virtual ~CPUScaleOpNode() { } + + OpParams& params(NvU16 batchId = 0) { return m_mb_op_params->batch(batchId); } + virtual void captureCanonicalParams(); + virtual CPUScaleOpNode *clone() { return new CPUScaleOpNode(*this); } + virtual canonical_ast::ScaleNode* canonicalNode() const { return m_can_scale_node; } + virtual NvDlaError emitOp(Graph *, EMUInterface *, NvU32 op_slot, NvU32 batch_id, + EMUOperationContainerAccessor, + EMUOperationBufferContainerAccessor); + +protected: + canonical_ast::ScaleNode* m_can_scale_node; + MultiBatchState < OpParams >* m_mb_op_params; +}; + +// softmax op in CPU node +class CPUSoftMaxOpNode : public CPUNode +{ +public: + virtual std::string className() const { return std::string("CPUSoftMaxOpNode"); } + + class OpParams : public CPUParams + { + public: + OpParams() { } + virtual ~OpParams() { } + + protected: + // add everything relevant to CPU based softmax op + }; + + CPUSoftMaxOpNode(canonical_ast::SoftMaxNode* can_sm_node, NvU16 numBatches = 1) : CPUNode(numBatches) + { + m_engine_type = CPU; + m_engine_op_type = CPU_SOFTMAX; + m_can_sm_node = can_sm_node; + m_mb_op_params = new MultiBatchState < OpParams >(numBatches); + m_sup_in_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_INT8); + m_sup_in_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_FP16); + m_sup_out_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_INT8); + m_sup_out_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_FP16); + } + virtual ~CPUSoftMaxOpNode() { } + + virtual void captureCanonicalParams(); + virtual CPUSoftMaxOpNode *clone() { return new CPUSoftMaxOpNode(*this); } + virtual canonical_ast::SoftMaxNode* canonicalNode() const { return m_can_sm_node; } + virtual NvDlaError emitOp(Graph *, EMUInterface *, NvU32 op_slot, NvU32 batch_id, + EMUOperationContainerAccessor, + EMUOperationBufferContainerAccessor); + +protected: + canonical_ast::SoftMaxNode* m_can_sm_node; + MultiBatchState < OpParams >* m_mb_op_params; + +}; + +// concat +class ConcatenationNode : public Node +{ +public: + virtual std::string className() const { return std::string("ConcatenationNode"); } + + class OpParams : public EngineParams + { + public: + OpParams() : m_concat_axis(ConcatAxisEnum::CONCAT_AXIS_UNKNOWN) { } + virtual ~OpParams() { } + + ConcatAxis concatAxis() const { return m_concat_axis; } + void setConcatAxis(ConcatAxis axis) { m_concat_axis = axis; } + + protected: + ConcatAxis m_concat_axis; + }; + + ConcatenationNode(canonical_ast::ConcatenationNode* concat, NvU16 numBatches = 1) : Node(numBatches) + { + m_engine_type = CONCATENATION; + m_engine_op_type = CONCATENATION_CONCAT; + m_can_concat_node = concat; + m_mb_op_params = new MultiBatchState < OpParams >(numBatches); + m_sup_in_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_INT8); + m_sup_in_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_FP16); + m_sup_out_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_INT8); + m_sup_out_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_FP16); + } + virtual ~ConcatenationNode() { } + + inline bool debugConcat() { return false; } + virtual void captureCanonicalParams(); + OpParams& params(NvU16 batchId = 0) { return m_mb_op_params->batch(batchId); } + + NvDlaError verifySurfaceIsPartOfConcat(surface::TensorSurfaceDesc* src, surface::TensorSurfaceDesc* dst, ConcatAxis axis); + NvU64 suggestOffsetInConcatChain(surface::TensorSurfaceDesc* inTSD); + virtual Dims4 suggestSurfaceDims(surface::TensorSurfaceDesc* tsd); + virtual NvU32 suggestLineStride(surface::TensorSurfaceDesc* tsd); + virtual NvU32 suggestSurfaceStride(surface::TensorSurfaceDesc* tsd); + virtual NvU64 suggestSurfaceSize(surface::TensorSurfaceDesc* tsd); + virtual NvU64 suggestSurfaceOffsetInBuffer(surface::TensorSurfaceDesc* tsd); + virtual memory::TensorBufferDesc* suggestBuffer(surface::TensorSurfaceDesc* tsd); + + // cache reference to input/output edges in their order of appearance + virtual NvDlaError populateEdgePorts(); + virtual NvDlaError resolveMultiBatchDependencies() { return NvDlaSuccess; } + virtual ConcatenationNode *clone() { return new ConcatenationNode(*this); } + virtual canonical_ast::ConcatenationNode *canonicalNode() const { return m_can_concat_node; } + + virtual NvDlaError verifyEdgePorts() + { + if (outputEdges().size() != 1) + return NvDlaError_BadValue; + else + return NvDlaSuccess; + } + virtual NvDlaError verifySurfaceDims(surface::TensorSurfaceDesc*); + +protected: + canonical_ast::ConcatenationNode* m_can_concat_node; + MultiBatchState< OpParams > *m_mb_op_params; +}; + +// sw split +class SplitNode : public Node +{ +public: + virtual std::string className() const { return std::string("SplitNode"); } + + class OpParams : public EngineParams + { + public: + OpParams() : m_split_axis(SplitAxisEnum::SPLIT_AXIS_UNKNOWN) { } + virtual ~OpParams() { } + + SplitAxis splitAxis() const { return m_split_axis; } + void setSplitAxis(SplitAxis axis) { m_split_axis = axis; } + + protected: + SplitAxis m_split_axis; + }; + + SplitNode(canonical_ast::SplitNode* split, NvU16 numBatches = 1) : Node(numBatches) + { + m_engine_type = SPLIT; + m_engine_op_type = SPLIT_SOFTWARE; + m_can_split_node = split; + m_mb_op_params = new MultiBatchState < OpParams >(numBatches); + m_sup_in_surf_formats.assign(IMG_FORMATS, IMG_FORMATS + (sizeof(IMG_FORMATS)/sizeof(IMG_FORMATS[0]))); + m_sup_in_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_INT8); + m_sup_in_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_FP16); + m_sup_out_surf_formats.assign(IMG_FORMATS, IMG_FORMATS + (sizeof(IMG_FORMATS)/sizeof(IMG_FORMATS[0]))); + m_sup_out_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_INT8); + m_sup_out_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_FP16); + } + virtual ~SplitNode() { } + + inline bool debugSplit() { return false; } + virtual void captureCanonicalParams(); + OpParams& params(NvU16 batchId = 0) { return m_mb_op_params->batch(batchId); } + + NvDlaError verifySurfaceIsPartOfSplit(surface::TensorSurfaceDesc* src, surface::TensorSurfaceDesc* dst, SplitAxis axis); + NvU64 suggestOffsetInSplitChain(surface::TensorSurfaceDesc* outTSD); + virtual Dims4 suggestSurfaceDims(surface::TensorSurfaceDesc* tsd); + virtual NvU32 suggestLineStride(surface::TensorSurfaceDesc* tsd); + virtual NvU32 suggestSurfaceStride(surface::TensorSurfaceDesc* tsd); + virtual NvU64 suggestSurfaceSize(surface::TensorSurfaceDesc* tsd); + virtual NvU64 suggestSurfaceOffsetInBuffer(surface::TensorSurfaceDesc* tsd); + virtual memory::TensorBufferDesc* suggestBuffer(surface::TensorSurfaceDesc* tsd); + + // cache reference to input/output edges in their order of appearance + virtual NvDlaError populateEdgePorts(); + virtual NvDlaError resolveMultiBatchDependencies() { return NvDlaSuccess; } + virtual SplitNode *clone() { return new SplitNode(*this); } + virtual canonical_ast::SplitNode *canonicalNode() const { return m_can_split_node; } + + virtual NvDlaError verifyEdgePorts() + { + if (inputEdges().size() != 1) + return NvDlaError_BadValue; + else + return NvDlaSuccess; + } + virtual NvDlaError verifySurfaceDims(surface::TensorSurfaceDesc*); + +protected: + canonical_ast::SplitNode* m_can_split_node; + MultiBatchState< OpParams > *m_mb_op_params; +}; + +class SDPNode; //fwd decl + +// convolution layer +// fully connected +// deconvolve 1st +class ConvCoreNode : public Node +{ +public: + virtual std::string className() const { return std::string("ConvCoreNode"); } + + ConvCoreNode(NvU16 numBatches) : Node(numBatches) + { + m_engine_type = CONVOLUTION; + m_mb_engine_params = new MultiBatchState < ConvCoreEngineParams >(numBatches); + } + virtual ~ConvCoreNode() { } + + // data-split can happen for conv/fc/deconv + struct SplitDataInfo { + // for split-h + NvS32 topSliceID; + NvS32 bottomSliceID; + NvS32 topPadding; + NvS32 bottomPadding; + // for split-w + NvS32 leftSliceID; + NvS32 rightSliceID; + NvS32 leftPadding; + NvS32 rightPadding; + // common + Dims4 inDims; + Dims4 outDims; + NvS32 numConvs; + NvS32 numOverlapSlices; + NvS32 numRetainSlices; + + NvU64 inputBufferOffset; + NvU64 outputBufferOffset; + + NvU16 wtBanks; + NvU16 dataBanks; + + SplitDataInfo() : + topSliceID(-1), bottomSliceID(-1), topPadding(-1), bottomPadding(-1), + leftSliceID(-1), rightSliceID(-1), leftPadding(-1), rightPadding(-1), + numConvs(-1), numOverlapSlices(-1), numRetainSlices(-1), + inputBufferOffset(0), outputBufferOffset(0), + wtBanks(0), dataBanks(0) + { + inDims = Dims4(0, 0, 0, 0); + outDims = Dims4(0, 0, 0, 0); + } + }; + + NvDlaError captureCanonicalWeights(); + + bool debugFactorization() { return false; } + + virtual Dims4 suggestSurfaceDims(surface::TensorSurfaceDesc* tsd); + virtual NvU32 suggestLineStride(surface::TensorSurfaceDesc* tsd); + virtual NvU32 suggestSurfaceStride(surface::TensorSurfaceDesc* tsd); + virtual NvU64 suggestSurfaceSize(surface::TensorSurfaceDesc* tsd); + virtual NvU64 suggestSurfaceOffsetInBuffer(surface::TensorSurfaceDesc* tsd); + virtual NvDlaError preProcessAuxData(); + virtual Node* mergeWithSDPOp(SDPNode* other_op); + virtual NvDlaError quantizeAuxData(); + virtual NvDlaError handleLowPrecisionConversions(); + virtual NvDlaError fuseOnTheFlyNodes(); + virtual NvDlaError translateAuxData(); + virtual NvDlaError splitNodes(); + virtual NvDlaError handleMultiBatch(); + virtual NvDlaError resolveDataDependencies(Node* next); + + virtual ConvCoreEngineParams& params(NvU16 batchId = 0) { return m_mb_engine_params->batch(batchId); } + virtual ConvCoreNode *clone() { return new ConvCoreNode(*this); } + virtual void captureCanonicalParams() { return; } + + virtual NvDlaError nodeAuxEdge(engine_ast::Edge **ret_edge); + + // Conv Core doesn't have a write port, so the FD o/p from conv core + // has to pass through SDP to be written into memory + SDPNode* addSDPJointOpNode(canonical_ast::Node* canConv); + SDPNode* addSDPJointOpNode(SDPNode* copyFromSDP); + + virtual std::vector< surface::SurfaceFormat > suggestAuxSurfaceFormats(Edge* auxEdge=NULL); + + NvDlaError determineWinogradParams(); + + SplitDataInfo& splitDataInfo() { return m_split_data_info; } + void setSplitDataInfo(const SplitDataInfo& sdi) { m_split_data_info = sdi; } + + NvDlaError processWtsForIMG(); + NvDlaError mandatoryChnlExtForIMG(); + NvDlaError optionalChnlExtForIMG(); + Node* tryToMergeWithScaleOp(SDPNode* sdp_scl_op); + Node* tryToMergeWithBatchNormOp(SDPNode* sdp_bn_op); + NvDlaError squashWeightGroups(); + NvDlaError splitNodesInternal(); + NvDlaError splitData(NvU16 avlbDataBanks); + NvDlaError splitWeightsAndData(NvU16 avlbWtBanks, NvU16 avlbDataBanks); + NvDlaError determineSplitDataRatios(NvU16& avlbDataBanks, std::vector& splitChunks); + + virtual NvDlaError verifyEdgePorts() + { + if (inputEdges().size() != 1 || + auxEdges().size() != 1 || + outputEdges().size() != 1) + return NvDlaError_BadValue; + else + return NvDlaSuccess; + } + virtual NvDlaError verifySurfaceDims(surface::TensorSurfaceDesc*); + +protected: + NvS16 calculateEPS(surface::TensorSurfaceDesc*); + NvU16 calculateTotalBanksForData(surface::TensorSurfaceDesc*); + NvU16 calculateMinBanksForWeight(surface::TensorSurfaceDesc*); + NvU16 calculateTotalBanksForWeight(surface::TensorSurfaceDesc*); + NvDlaError verifyPartialHInfo(const std::vector&, bool); + MultiBatchState < ConvCoreEngineParams > *m_mb_engine_params; + SplitDataInfo m_split_data_info; +}; + +// convolution op in conv engine +class ConvCoreConvolutionOpNode : public ConvCoreNode +{ +public: + virtual std::string className() const { return std::string("ConvolutionOpNode"); } + + class OpParams : public ConvCoreEngineParams + { + public: + OpParams() : ConvCoreEngineParams() + { + m_post_extension = 0; + } + virtual ~OpParams() { } + + NvU8 postExtension() const { return m_post_extension; } + void setPostExtension(NvU8 ext) { m_post_extension = ext; } + + protected: + NvU8 m_post_extension; + }; + + ConvCoreConvolutionOpNode(canonical_ast::ConvolutionNode* can_conv_node, NvU16 numBatches = 1) : ConvCoreNode(numBatches) + { + m_engine_op_type = CONVOLUTION_CONV; + m_can_conv_node = can_conv_node; + m_mb_op_params = new MultiBatchState < OpParams >(numBatches); + m_sup_in_surf_formats.assign(IMG_FORMATS, IMG_FORMATS + (sizeof(IMG_FORMATS)/sizeof(IMG_FORMATS[0]))); + m_sup_in_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_INT8); + m_sup_in_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_FP16); + m_sup_out_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_INT8); + m_sup_out_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_FP16); + m_sup_aux_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_WEIGHT_DC_INT8); + m_sup_aux_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_WEIGHT_DC_FP16); + m_sup_aux_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_WEIGHT_IMG_INT8); + m_sup_aux_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_WEIGHT_IMG_FP16); + m_sup_aux_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_WEIGHT_WG_INT8); + m_sup_aux_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_WEIGHT_WG_FP16); + } + virtual ~ConvCoreConvolutionOpNode() { } + + NvDlaError fallbackWGConvToDC(); + + virtual OpParams& params(NvU16 batchId = 0) { return m_mb_op_params->batch(batchId); } + virtual ConvCoreConvolutionOpNode *clone() { return new ConvCoreConvolutionOpNode(*this); } + virtual canonical_ast::ConvolutionNode* canonicalNode() const { return m_can_conv_node; } + virtual void captureCanonicalParams(); + virtual const void* getAuxData(Edge* auxEdge) { return params().DLAWeights().values; } + virtual Dims4 getAuxDims() { return params().weightDims(); } + virtual void inheritParams(Node*); + + virtual NvDlaError emitOp(Graph *, DLAInterface *, NvU32 op_slot, NvU32 batch_id, + DLACommonOpDescAccessor, + DLAOperationContainerAccessor, + DLASurfaceContainerAccessor); + +#ifdef NVDLA_COMPILER_OUTPUT_FOR_PROTOTEST + virtual NvDlaError emitOp(NvU32 op_slot, NvU32 batch_id, + DLAInterface*, + DLACommonOpDescAccessor&, + DLAOperationContainerAccessor&, + DLASurfaceContainerAccessor&, + nvdla_prototest_interface::Layer*); +#endif + +protected: + canonical_ast::ConvolutionNode* m_can_conv_node; + MultiBatchState< OpParams > *m_mb_op_params; +}; + +// fc op in conv engine +class ConvCoreFullyConnectedOpNode : public ConvCoreNode +{ +public: + virtual std::string className() const { return std::string("FullyConnectedOpNode"); } + + class OpParams : public ConvCoreEngineParams + { + // add that is relevant to FC + }; + + ConvCoreFullyConnectedOpNode(canonical_ast::FullyConnectedNode* can_fc_node, NvU16 numBatches = 1) + : ConvCoreNode(numBatches) + { + m_engine_op_type = CONVOLUTION_FC; + m_can_fc_node = can_fc_node; + m_mb_op_params = new MultiBatchState < OpParams >(numBatches); + m_sup_in_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_IMG_R16_F); + m_sup_in_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_INT8); + m_sup_in_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_FP16); + m_sup_out_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_INT8); + m_sup_out_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_FP16); + m_sup_aux_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_WEIGHT_DC_INT8); + m_sup_aux_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_WEIGHT_DC_FP16); + } + virtual ~ConvCoreFullyConnectedOpNode() { } + + virtual OpParams& params(NvU16 batchId = 0) { return m_mb_op_params->batch(batchId); } + virtual ConvCoreFullyConnectedOpNode *clone() { return new ConvCoreFullyConnectedOpNode(*this); } + virtual canonical_ast::FullyConnectedNode* canonicalNode() const { return m_can_fc_node; } + virtual void captureCanonicalParams(); + virtual const void* getAuxData(Edge* auxEdge) { return params().DLAWeights().values; } + virtual Dims4 getAuxDims() { return params().weightDims(); } + + virtual NvDlaError emitOp(Graph *, DLAInterface *, NvU32 op_slot, NvU32 batch_id, + DLACommonOpDescAccessor, + DLAOperationContainerAccessor, + DLASurfaceContainerAccessor); + +#ifdef NVDLA_COMPILER_OUTPUT_FOR_PROTOTEST + virtual NvDlaError emitOp(NvU32 op_slot, NvU32 batch_id, + DLAInterface*, + DLACommonOpDescAccessor&, + DLAOperationContainerAccessor&, + DLASurfaceContainerAccessor&, + nvdla_prototest_interface::Layer*); +#endif + + +protected: + canonical_ast::FullyConnectedNode* m_can_fc_node; + MultiBatchState< OpParams > *m_mb_op_params; +}; + +// deconv op in conv engine +class ConvCoreDeconvolutionOpNode : public ConvCoreNode +{ +public: + virtual std::string className() const { return std::string("DeconvolutionOpNode"); } + + class OpParams : public ConvCoreEngineParams + { + // add all that is relevant to deconv + }; + ConvCoreDeconvolutionOpNode(canonical_ast::DeconvolutionNode* can_deconv_node, NvU16 numBatches = 1) + : ConvCoreNode(numBatches) + { + m_engine_op_type = CONVOLUTION_DECONV; + m_can_deconv_node = can_deconv_node; + m_mb_op_params = new MultiBatchState < OpParams >(numBatches); + m_sup_in_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_INT8); + m_sup_in_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_FP16); + m_sup_out_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_INT8); + m_sup_out_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_FP16); + m_sup_aux_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_WEIGHT_DC_INT8); + m_sup_aux_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_WEIGHT_DC_FP16); + } + virtual ~ConvCoreDeconvolutionOpNode() { } + + virtual OpParams& params(NvU16 batchId = 0) { return m_mb_op_params->batch(batchId); } + virtual ConvCoreDeconvolutionOpNode *clone() { return new ConvCoreDeconvolutionOpNode(*this); } + virtual canonical_ast::DeconvolutionNode* canonicalNode() const { return m_can_deconv_node; } + virtual void captureCanonicalParams(); + virtual void inheritParams(Node*); + virtual const void* getAuxData(Edge* auxEdge) { return params().DLAWeights().values; } + virtual Dims4 getAuxDims() { return params().weightDims(); } + + virtual Dims4 suggestSurfaceDims(surface::TensorSurfaceDesc* tsd); + virtual NvDlaError preProcessAuxData(); + virtual NvDlaError quantizeAuxData(); + virtual NvDlaError translateAuxData(); + + virtual NvDlaError emitOp(Graph *, DLAInterface *, NvU32 op_slot, NvU32 batch_id, + DLACommonOpDescAccessor, + DLAOperationContainerAccessor, + DLASurfaceContainerAccessor); +protected: + canonical_ast::DeconvolutionNode* m_can_deconv_node; + MultiBatchState< OpParams > *m_mb_op_params; +}; + +// activation +// scale (sometimes, unless power != 0? then cpu?) +// elementwise +// bias reduction +// SDP super op node (x1 + x2 + y ops) +class SDPSuperOpNode; //fwd declaration + +class SDPNode : public Node +{ +public: + virtual std::string className() const { return std::string("SDPNode"); } + + SDPNode(NvU16 numBatches) : Node(numBatches) + { + m_engine_type = SDP; + m_mb_engine_params = new MultiBatchState < SDPEngineParams >(numBatches); + m_isUnitScale = false; + } + virtual ~SDPNode() { } + + bool debugFactorization() { return false; } + + virtual std::vector< surface::SurfaceFormat > suggestAuxSurfaceFormats(Edge* auxEdge=NULL); + virtual Dims4 suggestSurfaceDims(surface::TensorSurfaceDesc* tsd); + virtual NvU32 suggestLineStride(surface::TensorSurfaceDesc* tsd); + virtual NvU32 suggestSurfaceStride(surface::TensorSurfaceDesc* tsd); + virtual NvU64 suggestSurfaceSize(surface::TensorSurfaceDesc* tsd); + virtual NvU64 suggestSurfaceOffsetInBuffer(surface::TensorSurfaceDesc* tsd); + + Node* tryToMergeWithActOp(SDPNode* sdp_act_op); + + virtual Node* mergeWithSDPOp(SDPNode* /*other_op*/); + virtual NvDlaError fuseOnTheFlyNodes(); + virtual NvDlaError handleMultiBatch(); + virtual NvDlaError resolveDataDependencies(Node* next); + virtual Node* fuseSDPSubEngineOp(SDPNode* nextSDP); + virtual Node* mergeUnitScaleOp(SDPNode* nextSDP); + bool isFeasibleToFuseSDPSubEngineOp(SDPNode* nextSDP); + bool isFeasibleToFuseSDPEltwiseOp(SDPNode* nextSDP); + virtual NvDlaError configureSDPSuperOpSubEngine(SDPSuperOpNode* sdpSuperOp, SDPSubEngineType xN) + { + return NvDlaError_BadParameter; + } + + NvDlaError determineWinogradParams(ConvCoreNode* wgConvNode); + + virtual SDPNode *clone() { return new SDPNode(*this); } + virtual canonical_ast::Node* canonicalNode() const { return NULL; } + virtual void captureCanonicalParams() { return; } + virtual NvDlaError nodeAuxEdge(engine_ast::Edge **ret_edge); + + virtual SDPEngineParams& params(NvU16 batchId = 0) { return m_mb_engine_params->batch(batchId); } + + virtual NvDlaError verifySurfaceDims(surface::TensorSurfaceDesc*); + + bool isUnitScale() { return m_isUnitScale; } + void setUnitScale(bool enb) { m_isUnitScale = enb; } + + const Weights& rescaleData() const { return m_rescaleData; } + void setRescaleData(const Weights& rd) { m_rescaleData = rd; } + +protected: + MultiBatchState < SDPEngineParams > *m_mb_engine_params; + bool m_isUnitScale; + Weights m_rescaleData; +}; + +// activation op in SDP engine +class SDPActivationOpNode : public SDPNode +{ +public: + virtual std::string className() const { return std::string("SDPActivationNode"); } + + class OpParams : public SDPEngineParams + { + public: + OpParams() : SDPEngineParams() + { + SDPSubEngineParams x1params; + SDPSubEngineParams x2params; + SDPSubEngineParams yparams; + + x1params.setEnabled(false); + x2params.setEnabled(false); + yparams.setEnabled(false); + + setX1Params(x1params); + setX2Params(x2params); + setYParams(yparams); + } + virtual ~OpParams() { } + + // add anything relevant to Activation here + }; + + SDPActivationOpNode(canonical_ast::ActivationNode* can_act_node, NvU16 numBatches = 1) : SDPNode(numBatches) + { + m_engine_op_type = SDP_ACTIVATION; + m_can_act_node = can_act_node; + m_mb_op_params = new MultiBatchState < OpParams >(numBatches); + m_hLut = -1; + m_sup_in_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_INT8); + m_sup_in_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_FP16); + m_sup_out_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_INT8); + m_sup_out_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_FP16); + } + virtual ~SDPActivationOpNode() { } + + virtual void inheritParams(Node* inheritFrom); + virtual OpParams& params(NvU16 batchId = 0) { return m_mb_op_params->batch(batchId); } + virtual SDPActivationOpNode *clone() { return new SDPActivationOpNode(*this); } + virtual canonical_ast::ActivationNode* canonicalNode() const { return m_can_act_node; } + virtual void captureCanonicalParams(); + + virtual NvDlaError verifyEdgePorts() + { + if (inputEdges().size() != 1 || + auxEdges().size() != 0 || + outputEdges().size() != 1) + return NvDlaError_BadValue; + else + return NvDlaSuccess; + } + + virtual NvDlaError emitOp(Graph *g, + DLAInterface *target_dla, + NvU32 op_slot, NvU32 batch_id, + DLACommonOpDescAccessor dep, + DLAOperationContainerAccessor op, + DLASurfaceContainerAccessor surf); + +#ifdef NVDLA_COMPILER_OUTPUT_FOR_PROTOTEST + virtual NvDlaError emitOp(NvU32 op_slot, NvU32 batch_id, + DLAInterface*, + DLACommonOpDescAccessor&, + DLAOperationContainerAccessor&, + DLASurfaceContainerAccessor&, + nvdla_prototest_interface::Layer*); +#endif + + NvDlaError emitReLU(DLASDPOpDescAccessor sdp_op); + NvDlaError emitLut(DLASDPOpDescAccessor sdp_op); + +protected: + canonical_ast::ActivationNode* m_can_act_node; + MultiBatchState< OpParams > *m_mb_op_params; + LutManager::LutHandle m_hLut; +}; + +// scale op in SDP engine :- y = (scale_factor * x) +class SDPScaleOpNode : public SDPNode +{ +public: + virtual std::string className() const { return std::string("SDPScaleNode"); } + + class OpParams : public SDPEngineParams + { + public: + OpParams() : SDPEngineParams() + { + SDPSubEngineParams x1params; + SDPSubEngineParams x2params; + SDPSubEngineParams yparams; + + x1params.setEnabled(true); + x2params.setEnabled(false); + yparams.setEnabled(false); + + x1params.setAluType(SDPALUTypeEnum::SDP_ALU_TYPE_SUM); + x1params.setOpType(SDPOpTypeEnum::SDP_OP_TYPE_MUL); + + setX1Params(x1params); + setX2Params(x2params); + setYParams(yparams); + } + virtual ~OpParams() { } + + const Dims4& scaleDims() const { return m_scale_dims; } + void setScaleDims(const Dims4& sd) { m_scale_dims = sd; } + + Weights rawScaleData() const { return m_raw_scale_data; } + void setRawScaleData(Weights sc) { m_raw_scale_data = sc; } + + const Weights& DLAScaleData() const { return m_dla_scale_data; } + void setDLAScaleData(const Weights& dsd) { m_dla_scale_data = dsd; } + + protected: + Dims4 m_scale_dims; + Weights m_raw_scale_data; + Weights m_dla_scale_data; + }; + + SDPScaleOpNode(canonical_ast::ScaleNode* can_scale_node, NvU16 numBatches = 1) + : SDPNode(numBatches) + { + m_engine_op_type = SDP_SCALE; + m_can_scale_node = can_scale_node; + m_mb_op_params = new MultiBatchState < OpParams >(numBatches); + m_sup_in_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_INT8); + m_sup_in_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_FP16); + m_sup_out_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_INT8); + m_sup_out_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_FP16); + m_sup_aux_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_SCALE_DATA_INT8); + m_sup_aux_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_SCALE_DATA_INT16); + m_sup_aux_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_SCALE_DATA_FP16); + } + virtual ~SDPScaleOpNode() { } + + template + Weights inverseScaleData + ( + engine_ast::SDPMode scaleMode, // per-layer/channel/elementwise + Dims4 scaleDims, // dims of orig caffe scale-data blob + Weights& srcScaleData // ptr to orig caffe scale blob + ); + + NvDlaError populateWithUnitScaleParams + ( + engine_ast::SDPMode scaleMode, + Dims4 scaleDims + ); + + virtual void inheritParams(Node* inheritFrom); + virtual OpParams& params(NvU16 batchId = 0) { return m_mb_op_params->batch(batchId); } + virtual void captureCanonicalParams(); + virtual SDPScaleOpNode *clone() { return new SDPScaleOpNode(*this); } + virtual canonical_ast::ScaleNode* canonicalNode() const { return m_can_scale_node; } + + virtual std::vector< surface::SurfaceFormat > suggestAuxSurfaceFormats(Edge* auxEdge=NULL); + + // Some scale operations have optional bias + SDPNode* addSDPBiasOpNode(canonical_ast::Node* can_node); + virtual Node* mergeWithSDPOp(SDPNode* other_op); + virtual NvDlaError handleLowPrecisionConversions(); + virtual NvDlaError configureSDPSuperOpSubEngine(SDPSuperOpNode* sdpSuperOp, SDPSubEngineType xN) override; + virtual NvDlaError translateAuxData(); + + // Utility functions for handling sdp scales INT8 + NvDlaError getFp32ScaleData(const Weights data, std::vector& trnsFp32Scale); + NvDlaError scaleDataToInt16(); + NvDlaError rescaleScaleDataForNoFusedConv(); + NvDlaError rescaleScaleDataForPerFilter(); + NvDlaError rescaleScaleDataForPerKernel(); + + NvDlaError captureCanonicalScaleData(); + virtual const void* getAuxData(Edge* auxEdge) { return params().DLAScaleData().values; } + virtual Dims4 getAuxDims() { return params().scaleDims(); } + + virtual NvDlaError verifyEdgePorts() + { + if (inputEdges().size() != 1 || + auxEdges().size() != 1 || + outputEdges().size() != 1) + return NvDlaError_BadValue; + else + return NvDlaSuccess; + } + + virtual NvDlaError emitOp(Graph *, DLAInterface *, NvU32 op_slot, NvU32 batch_id, + DLACommonOpDescAccessor, + DLAOperationContainerAccessor, + DLASurfaceContainerAccessor); + +#ifdef NVDLA_COMPILER_OUTPUT_FOR_PROTOTEST + virtual NvDlaError emitOp(NvU32 op_slot, NvU32 batch_id, + DLAInterface*, + DLACommonOpDescAccessor&, + DLAOperationContainerAccessor&, + DLASurfaceContainerAccessor&, + nvdla_prototest_interface::Layer*); +#endif + +protected: + canonical_ast::ScaleNode* m_can_scale_node; + MultiBatchState< OpParams > *m_mb_op_params; +}; + +// batch norm :- y = (x - mean)/var +class SDPBatchNormOpNode : public SDPNode +{ +public: + virtual std::string className() const { return std::string("SDPBatchNormOpNode"); } + + class OpParams : public SDPEngineParams + { + public: + OpParams() : SDPEngineParams(), + m_epsilon(0.0f) + { + SDPSubEngineParams x1params; + SDPSubEngineParams x2params; + SDPSubEngineParams yparams; + + x1params.setEnabled(true); + x2params.setEnabled(false); + yparams.setEnabled(false); + + x1params.setAluType(SDPALUTypeEnum::SDP_ALU_TYPE_SUM); + x1params.setOpType(SDPOpTypeEnum::SDP_OP_TYPE_BOTH); + + setX1Params(x1params); + setX2Params(x2params); + setYParams(yparams); + } + virtual ~OpParams() { } + + float epsilon() const { return m_epsilon; } + void setEpsilon(const float e) { m_epsilon = e; } + + const Dims4& meanDims() const { return m_mean_dims; } + void setMeanDims(const Dims4& md) { m_mean_dims = md; } + + const Dims4& varianceDims() const { return m_var_dims; } + void setVarianceDims(const Dims4& vd) { m_var_dims = vd; } + + const Dims4& batchNormDims() const { return m_bn_dims; } + void setBatchNormDims(const Dims4& dims) { m_bn_dims = dims; } + + const Weights& rawMeanData() const { return m_raw_mean_data; } + void setRawMeanData(const Weights& rmd) { m_raw_mean_data = rmd; } + + const Weights& rawVarianceData() const { return m_raw_var_data; } + void setRawVarianceData(const Weights& rvd) { m_raw_var_data = rvd; } + + const Weights& DLABatchNormData() const { return m_dla_bn_data; } + void setDLABatchNormData(const Weights& bn) { m_dla_bn_data = bn; } + + protected: + float m_epsilon; + Dims4 m_mean_dims; + Dims4 m_var_dims; + Dims4 m_bn_dims; + Weights m_raw_mean_data; + Weights m_raw_var_data; + Weights m_dla_bn_data; + }; + + SDPBatchNormOpNode(canonical_ast::BatchNormNode* can_bn_node, NvU16 numBatches) + : SDPNode(numBatches) + { + m_engine_op_type = SDP_BATCH_NORM; + m_can_bn_node = can_bn_node; + m_mb_op_params = new MultiBatchState < OpParams >(numBatches); + m_sup_in_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_INT8); + m_sup_in_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_FP16); + m_sup_out_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_INT8); + m_sup_out_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_FP16); + m_sup_aux_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_BATCH_NORM_DATA_INT8); + m_sup_aux_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_BATCH_NORM_DATA_INT16); + m_sup_aux_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_BATCH_NORM_DATA_FP16); + } + virtual ~SDPBatchNormOpNode() { } + + enum AuxDataType { + MEAN_DATA = 0, + VARIANCE_DATA = 1 + }; + + virtual std::vector< surface::SurfaceFormat > suggestAuxSurfaceFormats(Edge* auxEdge=NULL); + + template + NvU32 factorsPerEntity + ( + MP rawValue, + AuxDataType auxType, + MP* factorizedValue = NULL + ); + + template + NvDlaError maxFactorsPerEntity + ( + Weights& auxData, + AuxDataType auxType, + NvU32* numFactors + ); + + template + NvDlaError processMeanAndVar + ( + Weights& rawMeanData, + Weights& processedMeanData, + Weights& rawVarData, + std::vector& processedVarData + ); + + NvDlaError scaleMeanToInt16(ConvCoreNode* fusedConv, std::vector& filterScales, std::vector& inTensorScales); + + Node* tryToMergeWithScaleOp(SDPNode* sdp_scl_op); + Node* tryToMergeWithBiasOp(SDPNode* sdp_bias_op); + Node* tryToMergeWithBiasOpInplace(SDPNode* sdp_bias_op); + virtual Node* mergeWithSDPOp(SDPNode* other_op); + virtual NvDlaError preProcessAuxData(); + virtual NvDlaError quantizeAuxData(); + virtual NvDlaError handleLowPrecisionConversions(); + + template + NvDlaError performPerLayerRescaling + ( + ConvCoreNode* fusedConv, + std::vector& filterScales, + Weights& rawVarData, + std::vector& inTensorScales, + std::vector& outTensorScales + ); + + template + NvDlaError performPerChannelRescaling + ( + ConvCoreNode* fusedConv, + std::vector& filterScales, + Weights& rawVarData, + std::vector& inTensorScales, + std::vector& outTensorScales + ); + + virtual NvDlaError translateAuxData(); + virtual NvDlaError configureSDPSuperOpSubEngine(SDPSuperOpNode* sdpSuperOp, SDPSubEngineType xN) override; + + bool debugFactorization() { return false; } + virtual void inheritParams(Node* inheritFrom); + virtual OpParams& params(NvU16 batchId = 0) { return m_mb_op_params->batch(batchId); } + NvDlaError captureCanonicalBatchNormData(); + virtual void captureCanonicalParams(); + virtual SDPBatchNormOpNode *clone() { return new SDPBatchNormOpNode(*this); } + virtual canonical_ast::BatchNormNode* canonicalNode() const { return m_can_bn_node; } + virtual const void* getAuxData(Edge* auxEdge) { return params().DLABatchNormData().values; } + virtual Dims4 getAuxDims() { return params().batchNormDims(); } + + virtual NvDlaError verifyEdgePorts() + { + if (inputEdges().size() != 1 || + auxEdges().size() != 1 || + outputEdges().size() != 1) + return NvDlaError_BadValue; + else + return NvDlaSuccess; + } + + virtual NvDlaError emitOp(Graph *, DLAInterface *, NvU32 op_slot, NvU32 batch_id, + DLACommonOpDescAccessor, + DLAOperationContainerAccessor, + DLASurfaceContainerAccessor); + +#ifdef NVDLA_COMPILER_OUTPUT_FOR_PROTOTEST + virtual NvDlaError emitOp(NvU32 op_slot, NvU32 batch_id, + DLAInterface*, + DLACommonOpDescAccessor&, + DLAOperationContainerAccessor&, + DLASurfaceContainerAccessor&, + nvdla_prototest_interface::Layer*); +#endif + +protected: + canonical_ast::BatchNormNode* m_can_bn_node; + MultiBatchState< OpParams > *m_mb_op_params; +}; + +// elementwise op in SDP engine +class SDPElementWiseOpNode : public SDPNode +{ +public: + virtual std::string className() const { return std::string("SDPElementWiseOpNode"); } + + class OpParams : public SDPEngineParams + { + public: + OpParams() : SDPEngineParams() + { + SDPSubEngineParams x1params; + SDPSubEngineParams x2params; + SDPSubEngineParams yparams; + + x1params.setEnabled(true); + x2params.setEnabled(false); + yparams.setEnabled(false); + + setX1Params(x1params); + setX2Params(x2params); + setYParams(yparams); + } + virtual ~OpParams() { } + + // add anything relevant to ElementWise here + }; + + SDPElementWiseOpNode(canonical_ast::ElementWiseNode* can_ew_node, NvU16 numBatches = 1) : + SDPNode(numBatches) + { + m_engine_op_type = SDP_ELEMENTWISE; + m_can_ew_node = can_ew_node; + m_mb_op_params = new MultiBatchState < OpParams >(numBatches); + m_sup_in_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_INT8); + m_sup_in_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_FP16); + m_sup_out_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_INT8); + m_sup_out_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_FP16); + } + virtual ~SDPElementWiseOpNode() { } + + virtual NvDlaError handleLowPrecisionConversions(); + NvDlaError performPerTensorRescaling + ( + std::vector& inTensorScales, + std::vector& outTensorScales, + PrecisionCVTParams& outCvt + ); + + virtual void inheritParams(Node* inheritFrom); + virtual OpParams& params(NvU16 batchId = 0) { return m_mb_op_params->batch(batchId); } + virtual void captureCanonicalParams(); + virtual SDPElementWiseOpNode *clone() { return new SDPElementWiseOpNode(*this); } + virtual canonical_ast::ElementWiseNode* canonicalNode() const { return m_can_ew_node; } + virtual NvDlaError configureSDPSuperOpSubEngine(SDPSuperOpNode* sdpSuperOp, SDPSubEngineType xN) override; + Node* getPeerSource(SDPNode* currentSource); + virtual Node* mergeWithSDPOp(SDPNode* other_op); + virtual NvDlaError populateEdgePorts(); + virtual NvDlaError verifyEdgePorts() + { + if (inputEdges().size() != 2 || + auxEdges().size() != 0 || + outputEdges().size() != 1) + return NvDlaError_BadValue; + else + return NvDlaSuccess; + } + + virtual NvDlaError emitOp(Graph *, DLAInterface *, NvU32 op_slot, NvU32 batch_id, + DLACommonOpDescAccessor, + DLAOperationContainerAccessor, + DLASurfaceContainerAccessor); + +#ifdef NVDLA_COMPILER_OUTPUT_FOR_PROTOTEST + virtual NvDlaError emitOp(NvU32 op_slot, NvU32 batch_id, + DLAInterface*, + DLACommonOpDescAccessor&, + DLAOperationContainerAccessor&, + DLASurfaceContainerAccessor&, + nvdla_prototest_interface::Layer*); +#endif + +protected: + canonical_ast::ElementWiseNode* m_can_ew_node; + MultiBatchState< OpParams > *m_mb_op_params; +}; + +// sdp bias to club with conv w/ bias term (bias-reduction) +// sdp bias to club with sdp scale w/ shift term (bias-addition) +class SDPBiasOpNode : public SDPNode +{ +public: + virtual std::string className() const { return std::string("SDPBiasOpNode"); } + + class OpParams : public SDPEngineParams + { + public: + OpParams() : SDPEngineParams(), + m_HasBiasReduction(false), + m_axis(0) + { + SDPSubEngineParams x1params; + SDPSubEngineParams x2params; + SDPSubEngineParams yparams; + + x1params.setEnabled(true); + x2params.setEnabled(false); + yparams.setEnabled(false); + + x1params.setAluType(SDPALUTypeEnum::SDP_ALU_TYPE_SUM); + x1params.setOpType(SDPOpTypeEnum::SDP_OP_TYPE_ADD); + + setX1Params(x1params); + setX2Params(x2params); + setYParams(yparams); + } + virtual ~OpParams() { } + + bool hasBiasReduction() const { return m_HasBiasReduction; } + void setHasBiasReduction(bool br) { m_HasBiasReduction = br; } + + NvS32 axis() const { return m_axis; } + void setAxis(NvS32 a) { m_axis = a; } + + virtual Weights rawBiasData() const { return m_raw_bias_data; } + virtual void setRawBiasData(Weights raw) { m_raw_bias_data = raw; } + + virtual Weights DLABiasData() const { return m_dla_bias_data; } + virtual void setDLABiasData(Weights trns) { m_dla_bias_data = trns; } + + const Dims4& biasDims() const { return m_bias_dims; } + void setBiasDims(const Dims4& bd) { m_bias_dims = bd; } + + protected: + bool m_HasBiasReduction; + NvS32 m_axis; + Dims4 m_bias_dims; + Weights m_raw_bias_data; + Weights m_dla_bias_data; + }; + + SDPBiasOpNode(canonical_ast::Node* can_node, NvU16 numBatches = 1) : SDPNode(numBatches) + { + m_engine_op_type = SDP_BIAS; + m_can_node = can_node; + m_mb_op_params = new MultiBatchState < OpParams >(numBatches); + m_sup_in_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_INT8); + m_sup_in_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_FP16); + m_sup_out_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_INT8); + m_sup_out_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_FP16); + m_sup_aux_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_BIAS_DATA_INT8); + m_sup_aux_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_BIAS_DATA_INT16); + m_sup_aux_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_BIAS_DATA_FP16); + } + virtual ~SDPBiasOpNode() { } + + virtual std::vector< surface::SurfaceFormat > suggestAuxSurfaceFormats(Edge* auxEdge=NULL); + + NvDlaError quantizeBiasToInt8(ConvCoreNode* fusedConv, std::vector& filterScales, std::vector& inTensorScales); + NvDlaError scaleBiasToInt16(ConvCoreNode* fusedConv, std::vector& filterScales, std::vector& inTensorScales); + + virtual NvDlaError quantizeAuxData(); + virtual NvDlaError handleLowPrecisionConversions(); + + NvDlaError performPerKernelRescaling + ( + ConvCoreNode* fusedConv, + std::vector& filterScales, + std::vector& inTensorScales, + std::vector& outTensorScales, + PrecisionCVTParams& outCvt + ); + NvDlaError performPerChannelRescaling + ( + ConvCoreNode* fusedConv, + std::vector& filterScales, + std::vector& inTensorScales, + std::vector& outTensorScales, + PrecisionCVTParams& outCvt + ); + + Node* tryToMergeWithBiasOp(SDPNode* sdp_bias_op); + Node* tryToMergeWithScaleOp(SDPNode* sdp_scl_op); + Node* tryToMergeWithBatchNormOp(SDPNode* sdp_bn_op); + virtual NvDlaError configureSDPSuperOpSubEngine(SDPSuperOpNode* sdpSuperOp, SDPSubEngineType xN) override; + virtual Node* mergeWithSDPOp(SDPNode* /*other_op*/); + virtual NvDlaError translateAuxData(); + NvDlaError captureCanonicalBiasData(); + + virtual void inheritParams(Node* inheritFrom); + virtual OpParams& params(NvU16 batchId = 0) { return m_mb_op_params->batch(batchId); } + virtual void captureCanonicalParams(); + virtual SDPBiasOpNode *clone() { return new SDPBiasOpNode(*this); } + virtual canonical_ast::Node* canonicalNode() const { return m_can_node; } + virtual const void* getAuxData(Edge* auxEdge) { return params().DLABiasData().values; } + virtual Dims4 getAuxDims() { return params().biasDims(); } + + virtual NvDlaError verifyEdgePorts() + { + if (inputEdges().size() != 1 || + auxEdges().size() != 1 || + outputEdges().size() != 1) + return NvDlaError_BadValue; + else + return NvDlaSuccess; + } + + virtual NvDlaError emitOp(Graph *, DLAInterface *, NvU32 op_slot, NvU32 batch_id, + DLACommonOpDescAccessor, + DLAOperationContainerAccessor, + DLASurfaceContainerAccessor); + +#ifdef NVDLA_COMPILER_OUTPUT_FOR_PROTOTEST + virtual NvDlaError emitOp(NvU32 op_slot, NvU32 batch_id, + DLAInterface*, + DLACommonOpDescAccessor&, + DLAOperationContainerAccessor&, + DLASurfaceContainerAccessor&, + nvdla_prototest_interface::Layer*); +#endif + +protected: + canonical_ast::Node* m_can_node; + MultiBatchState< OpParams > *m_mb_op_params; +}; + + +// sdp nop to club with conv w/o bias term +class SDPNOPNode : public SDPNode +{ +public: + virtual std::string className() const { return std::string("SDPNOPNode"); } + + class OpParams : public SDPEngineParams + { + public: + OpParams() : SDPEngineParams() + { + SDPSubEngineParams x1params; + SDPSubEngineParams x2params; + SDPSubEngineParams yparams; + + x1params.setEnabled(false); + x2params.setEnabled(false); + yparams.setEnabled(false); + + setX1Params(x1params); + setX2Params(x2params); + setYParams(yparams); + } + virtual ~OpParams() { } + + // add anything relevant to NOP here + }; + + SDPNOPNode(canonical_ast::Node* can_node, NvU16 numBatches = 1) : SDPNode(numBatches) + { + m_engine_op_type = SDP_NOP; + m_can_node = can_node; + m_mb_op_params = new MultiBatchState < OpParams >(numBatches); + m_sup_in_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_INT8); + m_sup_in_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_FP16); + m_sup_out_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_INT8); + m_sup_out_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_FP16); + } + virtual ~SDPNOPNode() { } + + virtual void inheritParams(Node* inheritFrom); + virtual OpParams& params(NvU16 batchId = 0) { return m_mb_op_params->batch(batchId); } + virtual void captureCanonicalParams(); + virtual SDPNOPNode *clone() { return new SDPNOPNode(*this); } + virtual canonical_ast::Node* canonicalNode() const { return m_can_node; } + + virtual NvDlaError verifyEdgePorts() + { + if (inputEdges().size() != 1 || + auxEdges().size() != 0 || + outputEdges().size() != 1) + return NvDlaError_BadValue; + else + return NvDlaSuccess; + } + + virtual NvDlaError emitOp(Graph *, DLAInterface *, NvU32 op_slot, NvU32 batch_id, + DLACommonOpDescAccessor, + DLAOperationContainerAccessor, + DLASurfaceContainerAccessor); + +#ifdef NVDLA_COMPILER_OUTPUT_FOR_PROTOTEST + virtual NvDlaError emitOp(NvU32 op_slot, NvU32 batch_id, + DLAInterface*, + DLACommonOpDescAccessor&, + DLAOperationContainerAccessor&, + DLASurfaceContainerAccessor&, + nvdla_prototest_interface::Layer*); +#endif + +protected: + canonical_ast::Node* m_can_node; + MultiBatchState< OpParams > *m_mb_op_params; +}; + +// SDP Super Op node +class SDPSuperOpNode : public SDPNode +{ +public: + virtual std::string className() const { return std::string("SDPSuperOpNode"); } + + class OpParams : public SDPEngineParams + { + public: + OpParams() : SDPEngineParams() + { + SDPSubEngineParams x1params; + SDPSubEngineParams x2params; + SDPSubEngineParams yparams; + + x1params.setEnabled(false); + x2params.setEnabled(false); + yparams.setEnabled(false); + + setX1Params(x1params); + setX2Params(x2params); + setYParams(yparams); + } + virtual ~OpParams() { } + + const Dims4& multiplierDims(SDPSubEngineType xN) const { return m_DataParams[xN.e()].multiplier_dims; } + void setMultiplierDims(SDPSubEngineType xN, const Dims4& dims) { m_DataParams[xN.e()].multiplier_dims = dims; } + + const Dims4& adderDims(SDPSubEngineType xN) const { return m_DataParams[xN.e()].adder_dims; } + void setAdderDims(SDPSubEngineType xN, const Dims4& dims) { m_DataParams[xN.e()].adder_dims = dims; } + + const Dims4& dlaDataDims(SDPSubEngineType xN) const { return m_DataParams[xN.e()].dla_data_dims; } + void setDLADataDims(SDPSubEngineType xN, const Dims4& dims) { m_DataParams[xN.e()].dla_data_dims = dims; } + + const Weights& rawMultiplierData(SDPSubEngineType xN) const { return m_DataParams[xN.e()].multiplier_data; } + void setRawMultiplierData(SDPSubEngineType xN, const Weights& data) { m_DataParams[xN.e()].multiplier_data = data; } + + const Weights& rawAdderData(SDPSubEngineType xN) const { return m_DataParams[xN.e()].adder_data; } + void setRawAdderData(SDPSubEngineType xN, const Weights& data) { m_DataParams[xN.e()].adder_data = data; } + + const Weights& dlaData(SDPSubEngineType xN) const { return m_DataParams[xN.e()].dla_data; } + void setDLAData(SDPSubEngineType xN, const Weights& data) { m_DataParams[xN.e()].dla_data = data; } + + TensorType auxDataType(SDPSubEngineType xN) const { return m_DataParams[xN.e()].data_type; } + void setAuxDataType(SDPSubEngineType xN, TensorType dt) { m_DataParams[xN.e()].data_type = dt; } + + const std::vector< surface::SurfaceFormat > auxSurfaceFormats(SDPSubEngineType xN) const + { + return m_DataParams[xN.e()].aux_surface_formats; + } + void setAuxSurfaceFormats(SDPSubEngineType xN, const std::vector< surface::SurfaceFormat > data) + { + m_DataParams[xN.e()].aux_surface_formats = data; + } + + protected: + class DataParams { + public: + TensorType data_type; + + Weights multiplier_data; + Dims4 multiplier_dims; + + Weights adder_data; + Dims4 adder_dims; + + Weights dla_data; + Dims4 dla_data_dims; + + std::vector< surface::SurfaceFormat > aux_surface_formats; + }; + // X1, X2 and Y engine params + std::array m_DataParams; + }; + +protected: + canonical_ast::Node* m_can_node; + MultiBatchState< OpParams > *m_mb_op_params; + std::map< NvU8, engine_ast::Edge* > m_sdpXengineToAuxEdgeMap; + typedef std::map< NvU8, engine_ast::Edge* >::iterator SdpXengineToEdgeMapIterator; + engine_ast::Edge* m_InputEdge; + + NvDlaError translateAuxDataInternal(SDPSubEngineType xN, SDPSubEngineParams& xParams); + SdpXengineToEdgeMapIterator findSdpAuxEdge(Edge* edge); + void printSdpXEdgeMap(); + SDPSubEngineParams* subEngineParams(SDPSubEngineType xN); + +public: + SDPSuperOpNode(canonical_ast::Node* can_node, NvU16 numBatches) + : SDPNode(numBatches) + { + m_engine_op_type = SDP_SUPER; + m_can_node = can_node; + m_mb_op_params = new MultiBatchState < OpParams >(numBatches); + m_sup_in_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_INT8); + m_sup_in_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_FP16); + m_sup_out_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_INT8); + m_sup_out_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_FP16); + m_sup_aux_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_BIAS_DATA_INT8); + m_sup_aux_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_BIAS_DATA_INT16); + m_sup_aux_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_BIAS_DATA_FP16); + m_sup_aux_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_SCALE_DATA_INT8); + m_sup_aux_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_SCALE_DATA_INT16); + m_sup_aux_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_SCALE_DATA_FP16); + m_sup_aux_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_BATCH_NORM_DATA_INT8); + m_sup_aux_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_BATCH_NORM_DATA_INT16); + m_sup_aux_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_BATCH_NORM_DATA_FP16); + m_InputEdge = NULL; + } + virtual ~SDPSuperOpNode() { } + + virtual NvDlaError preProcessAuxData(); + virtual NvDlaError translateAuxData(); + + virtual std::vector< surface::SurfaceFormat > suggestAuxSurfaceFormats(Edge* auxEdge=NULL); + + bool debugFactorization() { return false; } + virtual void inheritParams(Node* inheritFrom); + void inheritParamsForSubEngine(SDPSuperOpNode* otherSuperOp, SDPSubEngineType xN); + virtual OpParams& params(NvU16 batchId = 0) { return m_mb_op_params->batch(batchId); } + + virtual NvDlaError captureCanonicalData(SDPSubEngineType xN, TensorType tN); + //virtual void captureCanonicalParams(); + virtual SDPSuperOpNode *clone() { return new SDPSuperOpNode(*this); } + virtual canonical_ast::Node* canonicalNode() const { return m_can_node; } + virtual const void* getAuxData(Edge* auxEdge); + + void markSdpAuxEdge(SDPSubEngineType xN, Edge* edge) { m_sdpXengineToAuxEdgeMap[xN.e()] = edge; } + NvDlaError auxEdgeBySubEngine(SDPSubEngineType xN, Edge **ret_edge); + + virtual NvDlaError populateEdgePorts(); + virtual NvDlaError verifyEdgePorts(); + virtual NvDlaError emitOp(Graph *, DLAInterface *, NvU32 op_slot, NvU32 batch_id, + DLACommonOpDescAccessor, + DLAOperationContainerAccessor, + DLASurfaceContainerAccessor); + virtual NvU64 suggestSurfaceSize(surface::TensorSurfaceDesc* tsd); + +#ifdef NVDLA_COMPILER_OUTPUT_FOR_PROTOTEST + virtual NvDlaError emitOp(NvU32 op_slot, NvU32 batch_id, + DLAInterface*, + DLACommonOpDescAccessor&, + DLAOperationContainerAccessor&, + DLASurfaceContainerAccessor&, + nvdla_prototest_interface::Layer*); +#endif +}; + +// pooling +class PDPNode : public Node +{ +public: + virtual std::string className() const { return std::string("PDPNode"); } + + class OpParams : public PDPEngineParams + { + public: + OpParams() : PDPEngineParams() + { + m_pdpOnFlying = false; + } + virtual ~OpParams() { } + + bool isPDPOnFlying() const { return m_pdpOnFlying; } + void setPDPFlyingMode(bool isOnFly) { m_pdpOnFlying = isOnFly; } + + protected: + bool m_pdpOnFlying; + }; + + PDPNode(canonical_ast::PoolingNode* pool, NvU16 numBatches = 1) : Node(numBatches) + { + m_engine_type = PDP; + m_engine_op_type = PDP_POOL; + m_can_pool_node = pool; + m_mb_op_params = new MultiBatchState < OpParams >(numBatches); + m_sup_in_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_INT8); + m_sup_in_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_FP16); + m_sup_out_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_INT8); + m_sup_out_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_FP16); + } + virtual ~PDPNode() { } + + virtual NvDlaError fuseOnTheFlyNodes(); + virtual NvDlaError splitNodes(); + virtual NvDlaError handleMultiBatch(); + void adjustBRPadding(); + NvDlaError pdpSWSplit(); + NvDlaError pdpHWSplitWidth(); + NvDlaError verifySplitWInfo(engine_ast::PDPEngineParams::hwSplitWidthInfo); + + OpParams& params(NvU16 batchId = 0) { return m_mb_op_params->batch(batchId); } + virtual PDPNode *clone() { return new PDPNode(*this); } + virtual canonical_ast::PoolingNode *canonicalNode() const { return m_can_pool_node; } + virtual void captureCanonicalParams(); + + virtual NvDlaError verifyEdgePorts() + { + if (inputEdges().size() != 1 || + auxEdges().size() != 0 || + outputEdges().size() != 1) + return NvDlaError_BadValue; + else + return NvDlaSuccess; + } + virtual NvDlaError verifySurfaceDims(surface::TensorSurfaceDesc*); + + virtual NvDlaError emitOp(Graph *, DLAInterface *, NvU32 op_slot, NvU32 batch_id, + DLACommonOpDescAccessor, + DLAOperationContainerAccessor, + DLASurfaceContainerAccessor); + +#ifdef NVDLA_COMPILER_OUTPUT_FOR_PROTOTEST + virtual NvDlaError emitOp(NvU32 op_slot, NvU32 batch_id, + DLAInterface *, + DLACommonOpDescAccessor&, + DLAOperationContainerAccessor&, + DLASurfaceContainerAccessor&, + nvdla_prototest_interface::Layer*); +#endif + +protected: + NvU16 calculateMaxWidth(surface::SurfacePrecision, NvU16, NvU16); + + canonical_ast::PoolingNode* m_can_pool_node; + MultiBatchState< OpParams > *m_mb_op_params; +}; + +// lrn +class CDPNode : public Node +{ +public: + virtual std::string className() const { return std::string("CDPNode"); } + + class OpParams : public CDPEngineParams + { + public: + OpParams() : CDPEngineParams() {} + virtual ~OpParams() { } + }; + + CDPNode(NvU16 numBatches = 1) : Node(numBatches) { m_engine_type = CDP; } + virtual ~CDPNode() { } + + virtual void captureCanonicalParams(); + virtual CDPNode *clone() { return new CDPNode(*this); } + + virtual NvDlaError handleMultiBatch(); + + virtual NvDlaError verifyEdgePorts() + { + if (inputEdges().size() != 1 || + auxEdges().size() != 0 || + outputEdges().size() != 1) + return NvDlaError_BadValue; + else + return NvDlaSuccess; + } + virtual NvDlaError verifySurfaceDims(surface::TensorSurfaceDesc*); +}; + +// lrn +class CDPLRNOpNode : public CDPNode +{ +public: + virtual std::string className() const { return std::string("CDPLRNOpNode"); } + + class OpParams : public CDPEngineParams + { + public: + OpParams() : CDPEngineParams() {} + virtual ~OpParams() { } + }; + + CDPLRNOpNode(canonical_ast::LRNNode* can_lrn_node, NvU16 numBatches = 1) : CDPNode(numBatches) + { + m_engine_op_type = CDP_LRN; + m_can_lrn_node = can_lrn_node; + m_mb_op_params = new MultiBatchState < OpParams >(numBatches); + m_hLut = -1; + m_sup_in_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_FP16); + m_sup_out_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_FP16); + } + virtual ~CDPLRNOpNode() { } + + OpParams& params(NvU16 batchId = 0) { return m_mb_op_params->batch(batchId); } + virtual void captureCanonicalParams(); + virtual CDPLRNOpNode *clone() { return new CDPLRNOpNode(*this); } + virtual canonical_ast::LRNNode *canonicalNode() const { return m_can_lrn_node; } + + virtual NvDlaError verifyEdgePorts() + { + if (inputEdges().size() != 1 || + auxEdges().size() != 0 || + outputEdges().size() != 1) + return NvDlaError_BadValue; + else + return NvDlaSuccess; + } + + virtual NvDlaError emitOp(Graph *, DLAInterface *, NvU32 op_slot, NvU32 batch_id, + DLACommonOpDescAccessor, + DLAOperationContainerAccessor, + DLASurfaceContainerAccessor); + +#ifdef NVDLA_COMPILER_OUTPUT_FOR_PROTOTEST + virtual NvDlaError emitOp(NvU32 op_slot, NvU32 batch_id, + DLAInterface *, + DLACommonOpDescAccessor&, + DLAOperationContainerAccessor&, + DLASurfaceContainerAccessor&, + nvdla_prototest_interface::Layer*); +#endif + +protected: + canonical_ast::LRNNode* m_can_lrn_node; + MultiBatchState< OpParams > *m_mb_op_params; + LutManager::LutHandle m_hLut; +}; + +// deconvolve 2nd +class RubikNode : public Node +{ +public: + virtual std::string className() const { return std::string("RubikNode"); } + + class OpParams : public RubikEngineParams + { + public: + OpParams() : RubikEngineParams() { } + virtual ~OpParams() { } + // add anything relevant to rubik here + }; + + RubikNode(canonical_ast::DeconvolutionNode* deconv, NvU16 numBatches = 1) : Node(numBatches) + { + m_engine_type = RUBIK; + m_engine_op_type = RUBIK_DECONV; + m_can_deconv_node = deconv; + m_mb_op_params = new MultiBatchState < OpParams >(numBatches); + m_sup_in_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_INT8); + m_sup_in_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_FP16); + m_sup_out_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_INT8); + m_sup_out_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_FP16); + } + virtual ~RubikNode() { } + + virtual Dims4 suggestSurfaceDims(surface::TensorSurfaceDesc* tsd); + virtual NvU32 suggestLineStride(surface::TensorSurfaceDesc* tsd); + virtual NvU32 suggestSurfaceStride(surface::TensorSurfaceDesc* tsd); + virtual NvU64 suggestSurfaceSize(surface::TensorSurfaceDesc* tsd); + virtual NvDlaError handleMultiBatch(); + + NvDlaError determineContractOpParams(); + + inline bool debugRubik() const { return false; } + + OpParams& params(NvU16 batchId = 0) { return m_mb_op_params->batch(batchId); } + virtual void captureCanonicalParams(); + virtual RubikNode *clone() { return new RubikNode(*this); } + virtual canonical_ast::DeconvolutionNode *canonicalNode() const { return m_can_deconv_node; } + + virtual NvDlaError emitOp(Graph *, DLAInterface *, NvU32 op_slot, NvU32 batch_id, + DLACommonOpDescAccessor, + DLAOperationContainerAccessor, + DLASurfaceContainerAccessor); +protected: + canonical_ast::DeconvolutionNode* m_can_deconv_node; + MultiBatchState< OpParams > *m_mb_op_params; +}; + +// bdma - single transfer +// bdma - group transfer +class BDMANode : public Node +{ +public: + virtual std::string className() const { return std::string("BDMANode"); } + + BDMANode() : Node() + { + m_engine_type = BDMA; + m_sup_in_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_FP16); + m_sup_out_surf_formats.push_back(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_FP16); + } + virtual ~BDMANode() { } + + virtual BDMANode *clone() { return new BDMANode(*this); } + virtual canonical_ast::Node *canonicalNode() const { return NULL; } + + BDMAEngineParams calcTransferParams(surface::TensorSurfaceDesc*, surface::TensorSurfaceDesc*); + +}; + +class BDMASingleDMAOpNode : public BDMANode +{ +public: + virtual std::string className() const { return std::string("BDMASingleDMAOpNode"); } + + class OpParams : public BDMAEngineParams + { + public: + OpParams() : BDMAEngineParams() { } + virtual ~OpParams() { } + + // anything relevant to single bdma op + }; + + BDMASingleDMAOpNode() : BDMANode() + { + m_engine_op_type = BDMA_SINGLE_DMA; + } + + OpParams& getTransferParams() { return m_params; } + void setTransferParams(OpParams trns_params) { m_params = trns_params; } + + virtual NvDlaError emitOp(Graph *, DLAInterface *, NvU32, NvU32, + DLACommonOpDescAccessor, + DLAOperationContainerAccessor, + DLASurfaceContainerAccessor); +protected: + OpParams m_params; // note: bdma doesnt need multi batch support +}; + +class BDMAGroupDMAOpNode : public BDMANode +{ +public: + virtual std::string className() const { return std::string("BDMAGroupDMAOpNode"); } + + class OpParams : public BDMAEngineParams + { + public: + OpParams() : BDMAEngineParams() { } + virtual ~OpParams() { } + + // anything relevant to group BDMA goes here + }; + + BDMAGroupDMAOpNode() : BDMANode() + { + m_engine_op_type = BDMA_GROUP_DMA; + } + + std::vector & getTransferParams() { return m_params; } + void setTransferParams(std::vector trns_params) { m_params = trns_params; } + +protected: + std::vector< OpParams > m_params; // note: bdma doesnt need multi batch support +}; + +class Edge +{ +public: + virtual std::string className() const { return std::string("Edge"); } + + Edge(canonical_ast::Edge *can_edge) : + m_containing_graph(NULL), + m_can_edge(can_edge), + m_original_tensor(NULL), + m_tensor_surface_desc(NULL), + m_bindId(-1), // non-bindable + m_bindDomain(IOD_Max) // n/a + { + m_unique_id = m_next_id++; + } + virtual ~Edge() { } + + static inline bool debugBinding() { return false; } + + const std::string id() const { return m_id; } + void setId(const std::string id) { m_id = id; } + + NvU32 uniqueId() const { return m_unique_id;} + + Graph* graph() { return m_containing_graph; } + void setGraph(Graph* g) { m_containing_graph = g; } + + canonical_ast::Edge *canonicalEdge() const { return m_can_edge; } + + inline EdgeType edgeType() const { return m_edge_type; } + + inline void setEdgeType(EdgeType et) { m_edge_type = et; } + + inline bool isComputeEdge() const { return m_edge_type.v() == EdgeTypeEnum::COMPUTE; } + inline void setComputeEdge() { setEdgeType(engine_ast::EdgeTypeEnum::COMPUTE); } + + inline bool isDataEdge() const { return m_edge_type.v() == EdgeTypeEnum::DATA; } + inline void setDataEdge() { setEdgeType(engine_ast::EdgeTypeEnum::DATA); } + + inline bool isHazardEdge() const { return m_edge_type.v() == EdgeTypeEnum::HAZARD; } + inline void setHazardEdge() { setEdgeType(engine_ast::EdgeTypeEnum::HAZARD); } + + inline bool isAuxEdge() const + { + bool retval = false; + if (isDataEdge() && originalTensor()) + { + nvdla::TensorType tt = originalTensor()->getTensorType(); + retval = (tt == nvdla::TensorType::kBATCH_NORM || + tt == nvdla::TensorType::kBIAS || + tt == nvdla::TensorType::kSCALE || + tt == nvdla::TensorType::kWEIGHT); + } + return retval; + } + + Tensor *originalTensor() const { return m_original_tensor; } + void setOriginalTensor(Tensor* tensor) { m_original_tensor = tensor; } + + NvDlaError registerSurface(); + NvDlaError determineSurfaceClients(); + NvDlaError determineSurfaceFormat(); + NvDlaError determineSurfaceStrides(); + NvDlaError determineSurfaceSize(); + NvDlaError determineSurfaceOffsetInBuffer(); + NvDlaError registerBuffer(); + NvDlaError reserveBuffer(); + NvDlaError handleMultiBatch(); + + NvDlaError verifySurfaceClients(); + NvDlaError verifySurfaceFormat(); + NvDlaError verifySurfaceDims(); + NvDlaError verifySurfaceStrides(); + NvDlaError verifySurfaceSize(); + NvDlaError verifySurfaceOffsetInBuffer(); + NvDlaError verifySurfaceTensorScales(); + NvDlaError verifySurface(); + NvDlaError verifyBuffer(); + + virtual Edge *clone() { return new Edge(*this); } + + static std::string prettyId(const Edge *e, NvU8 flags = ast::PrettyId_All ) + { + if ( !e ) { return std::string("(null)"); } + std::stringstream r; std::string sep(""); + if ( flags & ast::PrettyId_Id ) { r << sep << e->id(); sep = " "; } + if ( flags & ast::PrettyId_ClassName ) { r << sep << e->className(); sep = " "; } + if ( flags & ast::PrettyId_Type ) { r << sep << e->edgeType().c_str(); sep = " "; } + return r.str(); + } + + bool bindable() const + { + bool isBindable = m_bindId >= 0; + if ( debugBinding() ) + { + gLogInfo << "::Edge edge=" << m_id << " bindable=" << isBindable << std::endl; + } + return isBindable; + } + NvS16 bindId() const + { + if ( debugBinding() ) + { + gLogInfo << "::Edge edge=" << m_id << " bindid=" << m_bindId << std::endl; + } + return m_bindId; + } + + IOD bindDomain() const { return m_bindDomain; } + + NvS16 bindId(enum IOD &bindDomain) const + { + if ( debugBinding() ) + { + gLogInfo << "::Edge edge=" << m_id << " domain=" << (int)m_bindDomain << " bind_id=" << m_bindId << std::endl; + } + bindDomain = m_bindDomain; + return m_bindId; + } + void setBindId(NvS16 id, enum IOD bindDomain) + { + if ( debugBinding() ) + { + gLogInfo << "::Edge setBindId edge=" << m_id << " domain=" << (int)bindDomain << " id=" << id << std::endl; + } + m_bindDomain = bindDomain; + m_bindId = id; + } + + + surface::TensorSurfaceDesc *tensorSurfaceDesc() const { return m_tensor_surface_desc; } + void setTensorSurfaceDesc(surface::TensorSurfaceDesc* t) { m_tensor_surface_desc = t; } + memory::TensorBufferDesc *tensorBufferDesc() const { return m_tensor_surface_desc ? m_tensor_surface_desc->tensorBufferDesc() : 0; } + + /* for clone */ + Edge(const Edge &other) : + m_id(other.m_id + std::string("-cloned")), + m_unique_id(m_next_id++), + m_containing_graph(0), + m_can_edge(other.m_can_edge), + m_edge_type(other.m_edge_type), + m_original_tensor(other.m_original_tensor), + m_tensor_surface_desc(other.m_tensor_surface_desc), + m_bindId(other.m_bindId), + m_bindDomain(other.m_bindDomain) + { + // of all the attributes, you don't want the cloned edge to inherit + // the containing_graph from orig edge. The cloned edge should belong + // to the new graph under construction. (see AST.h:Graph(const Graph& other) + } + +protected: + std::string m_id; // unique within the graph + NvU32 m_unique_id; // id for graph ordering. u32 instead of string. + static NvU32 m_next_id; + Graph* m_containing_graph; + canonical_ast::Edge *m_can_edge; + EdgeType m_edge_type; // compute or data + Tensor *m_original_tensor; + surface::TensorSurfaceDesc *m_tensor_surface_desc; + NvS16 m_bindId; + enum IOD m_bindDomain; +}; + +class IsSameCanonicalEdge +{ +public: + + IsSameCanonicalEdge(canonical_ast::Edge* can_edge) : m_can_edge(can_edge) { } + bool operator()(engine_ast::Edge* engEdge) + { + if (engEdge->canonicalEdge() == m_can_edge) { + return true; + } + return false; + } + +protected: + canonical_ast::Edge* m_can_edge; +}; + +class NodeWithSameEngineType +{ +public: + NodeWithSameEngineType(EngineType et) : m_engine_type(et) { } + bool operator()(engine_ast::Node* test_node) + { + if (m_engine_type == test_node->engineType()) { + return true; + } + return false; + } +protected: + EngineType m_engine_type; +}; + +Graph* generateGraph(Profile *, TargetConfig *, canonical_ast::Graph *); + +// certain can nodes get transformed into more than one engine nodes because +// of h/w limitation. eg: canonical_conv = eng_conv + eng_sdp-nop (if no bias term) +NvDlaError transformCanNode +( + Graph* engGraph, + canonical_ast::Node *canNode, + Graph::EdgeSequence engSrcEdges, + Graph::EdgeSequence engSinkEdges, + Graph::NodeSequence& transformedEngNodes +); + +// for sending to debug tools +std::ostream & outputJson(Graph *, std::ostream &); +std::ostream & outputJson(Graph *, Edge *, std::ostream &); +std::ostream & outputJson(Graph *, Node *, std::ostream &); + +bool serializeTo(WisdomContainerEntry *); +bool deserializeFrom(WisdomContainerEntry *); +// virtual bool assignSymbols(Wisdom *); + + +canonical_ast::Graph * mirrorEdges (Graph *, canonical_ast::Graph *, BiMap &edge_correlation); +void produceNodes(Graph *, canonical_ast::Graph *); + +class NodeFactory { + +public: + + static void clearMaps(void); + static ConvCoreConvolutionOpNode* newConvCoreConvolutionOpNode(canonical_ast::ConvolutionNode*, Graph*); + static ConvCoreFullyConnectedOpNode* newConvCoreFullyConnectedOpNode(canonical_ast::FullyConnectedNode*, Graph*); + static ConvCoreDeconvolutionOpNode* newConvCoreDeconvolutionOpNode(canonical_ast::DeconvolutionNode*, Graph*); + static SDPScaleOpNode* newSDPScaleOpNode(canonical_ast::ScaleNode*, Graph*); + static SDPBatchNormOpNode* newSDPBatchNormOpNode(canonical_ast::BatchNormNode*, Graph*); + static SDPActivationOpNode* newSDPActivationOpNode(canonical_ast::ActivationNode*, Graph*); + static SDPElementWiseOpNode* newSDPElementWiseOpNode(canonical_ast::ElementWiseNode*, Graph*); + static SDPBiasOpNode* newSDPBiasOpNode(canonical_ast::Node*, Graph*); + static SDPNOPNode* newSDPNOPNode(canonical_ast::Node*, Graph*); + static SDPSuperOpNode* newSDPSuperOpNode(canonical_ast::Node*, Graph*); + static PDPNode* newPDPNode(canonical_ast::PoolingNode*, Graph*); + static CDPLRNOpNode* newCDPLRNOpNode(canonical_ast::LRNNode*, Graph*); + static CPUScaleOpNode* newCPUScaleOpNode(canonical_ast::ScaleNode*, Graph*); + static CPUSoftMaxOpNode* newCPUSoftMaxOpNode(canonical_ast::SoftMaxNode*, Graph*); + static RubikNode* newRubikNode(canonical_ast::DeconvolutionNode*, Graph*); + static ConcatenationNode* newConcatNode(canonical_ast::ConcatenationNode*, Graph*); + static SplitNode* newSplitNode(canonical_ast::SplitNode*, Graph*); + static BDMASingleDMAOpNode* newSingleBDMANode(Graph*); + static BDMAGroupDMAOpNode* newGroupBDMANode(Graph*); + static MultiOpsNode* newMultiOpsNode(Graph::NodeSequence&, Graph*); + + + template static T nodeCast(Node*); + +protected: + static std::map s_conv_conv_priv; + static std::map s_conv_fc_priv; + static std::map s_conv_deconv_priv; + static std::map s_sdp_scale_priv; + static std::map s_sdp_bn_priv; + static std::map s_sdp_act_priv; + static std::map s_sdp_ew_priv; + static std::map s_sdp_bias_priv; + static std::map s_sdp_nop_priv; + static std::map s_sdp_super_priv; + static std::map s_pdp_priv; + static std::map s_cdp_lrn_priv; + static std::map s_cpu_scale_priv; + static std::map s_cpu_sm_priv; + static std::map s_rubik_priv; + static std::map s_concat_priv; + static std::map s_split_priv; + static std::map s_single_bdma_priv; + static std::map s_group_bdma_priv; + static std::map s_multi_ops_priv; +}; + + + +// the default generate() produces a depth first dependency ordering. +class ScoredDependencyOrdering : public ast::ScoredGraphOrdering< engine_ast::Graph > +{ +public: + ScoredDependencyOrdering(engine_ast::Graph *g) : ast::ScoredGraphOrdering< engine_ast::Graph >(g) { } + virtual ~ScoredDependencyOrdering() { } +protected: +}; + +// this class flattens the scores out, but retains the original order given by the scored ordering. +// we treat this as the front-end in that it pulls through from the scored order. +class DependencyOrdering : public ast::GraphOrdering< engine_ast::Graph > +{ +public: + DependencyOrdering(ScoredDependencyOrdering *sdo) : ast::GraphOrdering< engine_ast::Graph >(sdo->graph()), m_sdo(sdo) { } + virtual ~DependencyOrdering() { } + virtual NvDlaError generate(); + virtual void clear(); + const EdgeSequence &dataEdgeOrder() const { return m_data_edge_order; } + const EdgeSequence &computeEdgeOrder() const { return m_compute_edge_order; } + const EdgeSequence &hazardEdgeOrder() const { return m_hazard_edge_order; } + + ScoredDependencyOrdering *scoredOrdering() { return m_sdo; } +protected: + ScoredDependencyOrdering *m_sdo; + EdgeSequence m_data_edge_order; + EdgeSequence m_compute_edge_order; + EdgeSequence m_hazard_edge_order; +}; + + +class AddCopyOutDebugBDMA : public ast::GraphVisitor< engine_ast::Graph > +{ +public: + AddCopyOutDebugBDMA() : ast::GraphVisitor() { } + virtual ~AddCopyOutDebugBDMA() { } + + // only visiting nodes for this... + virtual NvDlaError visitBegin(engine_ast::Graph *); + virtual NvDlaError visitElem(engine_ast::Graph::Elem) { return NvDlaError_InvalidState; } + virtual NvDlaError visitEdge(engine_ast::Edge *) { return NvDlaError_InvalidState; } + virtual NvDlaError visitNode(engine_ast::Node *); + virtual NvDlaError visitEnd(engine_ast::Graph *, NvDlaError ve) + { + if ( ve == NvDlaSuccess ) + { + m_graph->ordering()->generate(); + } + return ve; + } + +protected: + engine_ast::Graph *m_graph; + NvS16 m_debugBindId; + + inline bool debugCopyOutDebug() { return false; } + +}; + + + +}; // nvdla::priv::engine_ast + + +namespace memory +{ + +class MemoryResolver : public ast::GraphVisitor< engine_ast::Graph > +{ +public: + MemoryResolver(); // engine_ast::Graph *g); + virtual ~MemoryResolver() { } + + // only visiting nodes for this... + virtual NvDlaError visitBegin(engine_ast::Graph *); + virtual NvDlaError visitElem(engine_ast::Graph::Elem) { return NvDlaError_InvalidState; } + virtual NvDlaError visitEdge(engine_ast::Edge *) { return NvDlaError_InvalidState; } + virtual NvDlaError visitNode(engine_ast::Node *); + virtual NvDlaError visitEnd(engine_ast::Graph *, NvDlaError ve); + + // records earliest annotationId a deallocation becomes possible for a surface. + typedef std::pair DeallocableSurface; + typedef std::pair SurfacePair; + +protected: + NvDlaError findReuseHazards(engine_ast::Node *, surface::TensorSurfaceDesc *, std::vector &collisions); + NvDlaError resolveHazards(engine_ast::Node *, std::vector &collisions); + + NvDlaError tryAllocInsidePool(engine_ast::Node *node, + surface::TensorSurfaceDesc *tsd, + memory::TensorBufferDesc* tbd, + std::vector& tryPools, + bool isAUX, bool& retry); + NvDlaError tryAllocOutsidePool(engine_ast::Node *node, + surface::TensorSurfaceDesc* tsd, + memory::TensorBufferDesc* tbd, + bool isAUX); + NvDlaError resolveSurfacePlacement(engine_ast::Node *node, + surface::TensorSurfaceDesc *tsd, + memory::TensorBufferDesc *tbd, + bool isAUX, bool &retry, + bool allowFallback); + + NvDlaError placeSurfaceContent(engine_ast::Node *node, surface::TensorSurfaceDesc *tsd); + + //note, these are snapshotted at visitBegin(...) + bool m_useMemPool; + bool m_useReusePooledMemory; + bool m_useGreedyEviction; + bool m_useCVSRAM; + + std::vector *m_pools; + memory::Pool *m_localCVSRAM; + memory::Pool *m_localSDRAM; + memory::Pool *m_globalSDRAM; + bool m_debug; + + std::list< DeallocableSurface > m_deallocated; + std::set m_inLocalPool; +}; + +}; // nvdla::priv::memory + + +}; // nvdla::priv + +}; // nvdla + + + +#endif // NVDLA_PRIV_ENGINE_AST_H diff --git a/umd/core/src/compiler/include/priv/EngineASTEnums.h b/umd/core/src/compiler/include/priv/EngineASTEnums.h new file mode 100644 index 00000000..00cff618 --- /dev/null +++ b/umd/core/src/compiler/include/priv/EngineASTEnums.h @@ -0,0 +1,154 @@ +/* + * Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#ifndef NVDLA_PRIV_ENGINE_AST_ENUMS_H +#define NVDLA_PRIV_ENGINE_AST_ENUMS_H + +// EngineAST::EdgeType +#define ENGINE_AST_EDGE_TYPE_ENUMS(op) \ + op(DATA, 0U) \ + op(COMPUTE, 1U) \ + op(HAZARD, 2U) + +// EngineAST::EngineType +#define ENGINE_AST_ENGINE_TYPE_ENUMS(op) \ + op(CPU, 0U) \ + op(CONVOLUTION, 1U) \ + op(RUBIK, 2U) \ + op(SDP, 3U) \ + op(PDP, 4U) \ + op(CDP, 5U) \ + op(BDMA, 6U) \ + op(CONCATENATION, 7U) \ + op(SPLIT, 8U) \ + op(MULTI_OPS, 9U) + +// EngineAST::EngineOpType +#define ENGINE_AST_ENGINE_OP_TYPE_ENUMS(op) \ + op(CPU_SCALE, 0U) \ + op(CPU_SOFTMAX, 1U) \ + op(CONVOLUTION_CONV, 2U) \ + op(CONVOLUTION_FC, 3U) \ + op(CONVOLUTION_DECONV, 4U) \ + op(RUBIK_DECONV, 5U) \ + op(SDP_ACTIVATION, 6U) \ + op(SDP_SCALE, 7U) \ + op(SDP_BATCH_NORM, 8U) \ + op(SDP_ELEMENTWISE, 9U) \ + op(SDP_BIAS, 10U) \ + op(SDP_NOP, 11U) \ + op(PDP_POOL, 12U) \ + op(CDP_LRN, 13U) \ + op(BDMA_SINGLE_DMA, 14U) \ + op(BDMA_GROUP_DMA, 15U) \ + op(CONCATENATION_CONCAT, 16U) \ + op(SPLIT_SOFTWARE, 17U) \ + op(SDP_SUPER, 18U) + + +// EngineAST::IODirection +#define ENGINE_AST_IO_DIRECTION_ENUMS(op) \ + op(UNKNOWN, 0U) \ + op(INPUT, 1U) \ + op(OUTPUT, 2U) + +// EngineAST::OperationEventType +#define ENGINE_AST_OPERATION_EVENT_TYPE_ENUMS(op) \ + op(OP_COMPLETED, 0U) \ + op(OP_PROGRAMMED, 1U) \ + op(OP_ENABLED, 2U) \ + op(OP_CDMA_WEIGHT_DONE, 3U) \ + op(OP_CDMA_DATA_DONE, 4U) + +// EngineAST::ConcatAxis +#define ENGINE_AST_CONCAT_AXIS_ENUMS(op) \ + op(CONCAT_AXIS_UNKNOWN, 0U) \ + op(CONCAT_ALONG_C, 1U) \ + op(CONCAT_ALONG_H, 2U) \ + op(CONCAT_ALONG_W, 3U) + +// EngineAST::SplitAxis +#define ENGINE_AST_SPLIT_AXIS_ENUMS(op) \ + op(SPLIT_AXIS_UNKNOWN, 0U) \ + op(SPLIT_ALONG_C, 1U) \ + op(SPLIT_ALONG_H, 2U) \ + op(SPLIT_ALONG_W, 3U) \ + op(SPLIT_ALONG_NONE, 4U) + +// EngineAST::ConvCoreEngineParams::ConvolutionMode +#define ENGINE_AST_CONVOLUTION_MODE_ENUMS(op) \ + op(CONV_MODE_UNKNOWN, 0U) \ + op(CONV_DIRECT, 1U) \ + op(CONV_WINOGRAD, 2U) + +// EngineAST::SDPSubEngineParams::SDPMode +#define ENGINE_AST_SDP_MODE_ENUMS(op) \ + op(SDP_MODE_UNKNOWN, 0U) \ + op(SDP_MODE_PER_LAYER, 1U) \ + op(SDP_MODE_PER_CHANNEL, 2U) \ + op(SDP_MODE_PER_ELEMENT, 3U) + +// EngineAST::SDPSubEngineParams::SDPALUType +#define ENGINE_AST_SDP_ALU_TYPE_ENUMS(op) \ + op(SDP_ALU_TYPE_UNKNOWN, 0U) \ + op(SDP_ALU_TYPE_MAX, 1U) \ + op(SDP_ALU_TYPE_MIN, 2U) \ + op(SDP_ALU_TYPE_SUM, 3U) \ + op(SDP_ALU_TYPE_EQL, 4U) + +// EngineAST::SDPSubEngineParams::SDPOpType +#define ENGINE_AST_SDP_OP_TYPE_ENUMS(op) \ + op(SDP_OP_TYPE_UNKNOWN, 0U) \ + op(SDP_OP_TYPE_NONE, 1U) \ + op(SDP_OP_TYPE_MUL, 2U) \ + op(SDP_OP_TYPE_ADD, 3U) \ + op(SDP_OP_TYPE_BOTH, 4U) + +// EngineAST::SDPSubEngineParams::SDPActType +#define ENGINE_AST_SDP_ACT_TYPE_ENUMS(op) \ + op(SDP_ACT_TYPE_UNKNOWN, 0U) \ + op(SDP_ACT_TYPE_NONE, 1U) \ + op(SDP_ACT_TYPE_RELU, 2U) \ + op(SDP_ACT_TYPE_SIGMOID, 3U) \ + op(SDP_ACT_TYPE_TANH, 4U) + +// EngineAST::SDPSubEngineParams::SDPSubEngineType +#define ENGINE_AST_SDP_SUBENGINE_TYPE_ENUMS(op) \ + op(SDP_ENGINE_X1, 0U) \ + op(SDP_ENGINE_X2, 1U) \ + op(SDP_ENGINE_Y, 2U) + +// EngineAST::RubikEngineParams::RubikMode +#define ENGINE_AST_RUBIK_MODE_ENUMS(op) \ + op(RUBIK_MODE_UNKNOWN, 0U) \ + op(RUBIK_MODE_CONTRACT, 1U) \ + op(RUBIK_MODE_SPLIT, 2U) \ + op(RUBIK_MODE_MERGE, 3U) + +#endif // NVDLA_PRIV_ENGINE_AST_ENUMS_H + diff --git a/umd/core/src/compiler/include/priv/Layer.h b/umd/core/src/compiler/include/priv/Layer.h new file mode 100644 index 00000000..1d94d1d5 --- /dev/null +++ b/umd/core/src/compiler/include/priv/Layer.h @@ -0,0 +1,781 @@ +/* + * Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#ifndef NVDLA_PRIV_LAYER_H +#define NVDLA_PRIV_LAYER_H + +#include +#include +#include + +#include "priv/Type.h" +#include "nvdla/ILayer.h" + +#define MAX_CONCAT_INPUTS 10000 +#define MAX_SLICE_OUTPUTS 10000 +#define MAX_KERNEL_DIMS_PRODUCT 100000 +#define MAX_PADDING_SUM 100000 +#define MAX_PADDING_VALUE 255 +#define MAX_STRIDE_SUM 100000 +#define MAX_DILATION_SUM 100000 +#define MAX_OUTPUT_MAPS (1<<28) +#define MAX_GROUPS 10000 +#define MAX_WEIGHTS_COUNT (1<<28) + +#define MAX_BATCH_SIZE (1<<28) +#define MAX_FIND_ITERATIONS 1000 +#define MAX_NUM_INPUT_LAYERS 10000 +#define MAX_NUM_OUTPUT_LAYERS 10000 + + +// +// note: preprocessor definitions must happen at global scope level per MISRA +// + +// +// LayerFactory can instance these... +// +#define LAYER_FACTORY_TYPE_ENUMS(op) \ + op(CONVOLUTION, 0U) \ + op(FULLY_CONNECTED, 1U) \ + op(ACTIVATION, 2U) \ + op(POOLING, 3U) \ + op(LRN, 4U) \ + op(SCALE, 5U) \ + op(BATCH_NORM, 6U) \ + op(SOFT_MAX, 7U) \ + op(CONCATENATION, 8U) \ + op(DECONVOLUTION, 9U) \ + op(ELEMENT_WISE, 10U) \ + op(INPUT, 11U) \ + op(SLICE, 12U) + + +namespace nvdla +{ +class INetwork; +class ITensor; +class ILayer; + +namespace priv +{ + +class Wisdom; +class WisdomContainerEntry; + +class Layer; +class ConvolutionLayer; +class FullyConnectedLayer; +class ActivationLayer; +class PoolingLayer; +class LRNLayer; +class ScaleLayer; +class BatchNormLayer; +class SoftMaxLayer; +class ConcatenationLayer; +class SliceLayer; +class DeconvolutionLayer; +class ElementWiseLayer; +class InputLayer; + +class LayerFactoryType +{ +public: + enum Enum { + LAYER_FACTORY_TYPE_ENUMS(GEN_ENUM) + }; +}; +typedef SequenceEnum LayerTypeEnum; + +typedef PrivDiamond ConvolutionLayerDiamond; +typedef PrivDiamond FullyConnectedLayerDiamond; +typedef PrivDiamond ActivationLayerDiamond; +typedef PrivDiamond PoolingLayerDiamond; +typedef PrivDiamond LRNLayerDiamond; +typedef PrivDiamond ScaleLayerDiamond; +typedef PrivDiamond BatchNormLayerDiamond; +typedef PrivDiamond SoftMaxLayerDiamond; +typedef PrivDiamond ConcatenationLayerDiamond; +typedef PrivDiamond SliceLayerDiamond; +typedef PrivDiamond DeconvolutionLayerDiamond; +typedef PrivDiamond ElementWiseLayerDiamond; +typedef PrivDiamond InputLayerDiamond; + +class LayerFactory +{ +public: + + // called before deserialization when data otherwise given to the constructor is not available. + template static D newLayer(); + + static ILayer *deserializeFrom(WisdomContainerEntry *); + static Layer *priv(ILayer *); + static ILayer *i(Layer *); + static ILayer *self(void *); + + // these are called when constructor data is available. would prefer to remove these + // and replace with a scheme to unify deserialization and initial construction. + static ConvolutionLayerDiamond newConvolutionLayer (INetwork * network, const std::string & name, + ITensor * input, ITensor * output, + int numOutputMaps, int paddingValue, + Dims2 kernelSize, Dims2 tlPadding, Dims2 brPadding, Dims2 stride, Dims2 dilation, + Weights kernelWeights, Weights biasWeights, BiasMode biasMode, int numGroups); + static FullyConnectedLayerDiamond newFullyConnectedLayer(INetwork* network, const std::string& name, + ITensor* input, ITensor* output, + int numOutputChannels, + Weights kernelWeights, Weights biasWeights, BiasMode biasMode); + static ActivationLayerDiamond newActivationLayer (INetwork* network, const std::string& name, + ITensor* input, ITensor* output, + ActivationType activationType); + static PoolingLayerDiamond newPoolingLayer (INetwork* network, const std::string& name, + ITensor* input, ITensor* output, + PoolingType type, + Dims2 windowSize, Dims2 stride, Dims2 tlPadding, Dims2 brPadding); + static LRNLayerDiamond newLRNLayer (INetwork* network, const std::string& name, + ITensor* input, + ITensor* output, + int windowSize, float alpha, float beta, float k); + static ScaleLayerDiamond newScaleLayer (INetwork* network, const std::string& name, + ITensor* input, ITensor* output, + ScaleMode mode, + Weights shift, Weights scale, Weights power); + static BatchNormLayerDiamond newBatchNormLayer (INetwork* network, const std::string& name, + ITensor* input, ITensor* output, + BatchNormMode mode, + Weights mean, Weights variance, float epsilon); + static SoftMaxLayerDiamond newSoftMaxLayer (INetwork* network, const std::string& name, + ITensor* input, ITensor* output); + static ConcatenationLayerDiamond newConcatenationLayer (INetwork* network, const std::string& name, + ITensor*const * inputs, int numInputs, + ITensor* output); + static SliceLayerDiamond newSliceLayer (INetwork* network, const std::string& name, + ITensor* input, + ITensor* const* outputs, int numOutputs); + static DeconvolutionLayerDiamond newDeconvolutionLayer (INetwork* network, const std::string& name, + ITensor* input, ITensor* output, + int numOutputMaps, int paddingValue, + Dims2 kernelSize, Dims2 tlPadding, Dims2 brPadding, Dims2 stride, Dims2 dilation, + Weights kernelWeights, Weights biasWeights, BiasMode biasMode, int numGroups); + static ElementWiseLayerDiamond newElementWiseLayer (INetwork* network, const std::string& name, + ITensor*const *inputs, ITensor* output, + ElementWiseOperation op); + + static InputLayerDiamond newInputLayer (INetwork* network, const std::string& name, + ITensor* const *inputs, ITensor* output); + + + template static typename D::DerivedPrivType *derivedPriv(typename D::BasePrivType *base_priv); + + +protected: + static BiMap s_priv; + static BiMap s_self; + + template static typename D::BaseInterfaceType *deserializeLayer(WisdomContainerEntry *); + + // this would be nice, but you can't declare a templated member variable. only functions. + // template static std::map s_priv_diamond; + +}; + + +class Network; + +class Layer : public virtual ILayer +{ +public: // externally facing + Layer(Network* network); + virtual Dims4 getOutputDimensions() const = 0; + + virtual void setName(const char* name); + virtual const char* getName() const; + + virtual LayerType getType() const; + + virtual int getNumInputs() const; + virtual ITensor* getInput(int i) const; + + virtual int getNumOutputs() const; + virtual ITensor* getOutput(int i) const; + + virtual void setKernelSize(Dims2 kernelSize); + virtual Dims2 getKernelSize() const; + + virtual void setNumOutputMaps(int numOutputMaps); + virtual int getNumOutputMaps() const; + + virtual void setStride(Dims2 stride); + virtual Dims2 getStride() const; + + virtual Dims2 getDilation() const; + virtual void setDilation(Dims2); + + virtual int getPaddingValue() const; + virtual void setPaddingValue(int); + + virtual Dims2 getBottomRightPadding() const; + virtual void setBottomRightPadding(Dims2); + + virtual Dims2 getTopLeftPadding() const; + virtual void setTopLeftPadding(Dims2); + + virtual void setNumGroups(int numGroups); + virtual int getNumGroups() const; + + virtual void setKernelWeights(Weights weights); + virtual Weights getKernelWeights() const; + virtual bool hasKernelWeights() { return false; } + + virtual void setBiasWeights(Weights weights); + virtual Weights getBiasWeights() const; + virtual bool hasBiasWeights() { return false; } + + virtual NvDlaError supportsPrecision(nvdla::DataType compPrec); + virtual NvDlaError setComputePrecision(nvdla::DataType compPrec) { return NvDlaError_NotSupported; } + +public: // internally facing + + virtual NvU16 getFactoryType() const = 0; + virtual bool serializeTo(WisdomContainerEntry *) const; + virtual bool deserializeFrom(WisdomContainerEntry *); + + std::string getInputSymbol(int i) const; + void setInput(int i, ITensor *); + + std::string getOutputSymbol(int o) const; + void setOutput(int o, ITensor *); + + virtual bool assignSymbols(Wisdom *wisdom); + +protected: + + INetwork* mNetwork; + + Layer(INetwork *n, LayerType type, const std::string& name, + ITensor * const * inputs, int numInputs, + ITensor * const * outputs, int numOutputs); + + Layer(INetwork *n, LayerType type, const std::string& name, + std::vector &input_symbols, int numInputs, + std::vector &output_symbols, int numOutputs); + + Layer(INetwork *n, LayerType type, const std::string& name, + ITensor* input, + ITensor* output); + + virtual ~Layer(); + + const LayerType mType; + std::string mName; + std::vector mInputs, mOutputs; + std::vector mInputSymbols, mOutputSymbols; +}; + + +class ConvolutionLayer : public virtual IConvolutionLayer, public priv::Layer +{ +public: + ConvolutionLayer(INetwork * network, const std::string & name, + ITensor * input, ITensor * output, + int numOutputMaps, Dims2 kernelSize, Weights kernelWeights, Weights biasWeights, BiasMode biasMode, int numGroups); + ConvolutionLayer(INetwork * network, const std::string & name, + ITensor * input, ITensor * output, int numOutputMaps, int paddingValue, + Dims2 kernelSize, Dims2 tlPadding, Dims2 brPadding, Dims2 stride, Dims2 dilation, + Weights kernelWeights, Weights biasWeights, BiasMode biasMode, int numGroups); + virtual ~ConvolutionLayer(); + + virtual NvU16 getFactoryType() const; + virtual bool deserializeFrom(WisdomContainerEntry *); + virtual bool serializeTo(WisdomContainerEntry *) const; + + virtual Dims2 getKernelSize() const; + virtual void setKernelSize(Dims2 ksize); + + virtual int getPaddingValue() const; + virtual void setPaddingValue(int); + + virtual Dims2 getBottomRightPadding() const; + virtual void setBottomRightPadding(Dims2); + + virtual Dims2 getTopLeftPadding() const; + virtual void setTopLeftPadding(Dims2); + + virtual Dims2 getStride() const; + virtual void setStride(Dims2); + + virtual Dims2 getDilation() const; + virtual void setDilation(Dims2); + + virtual int getNumGroups() const; + virtual void setNumGroups(int); + + virtual int getNumOutputMaps() const; + virtual void setNumOutputMaps(int); + + virtual Weights getKernelWeights() const; + virtual void setKernelWeights(Weights); + virtual bool hasKernelWeights() { return true; } + + virtual Weights getBiasWeights() const; + virtual void setBiasWeights(Weights); + virtual bool hasBiasWeights() { return true; } + + virtual BiasMode getBiasMode() const; + virtual void setBiasMode(BiasMode); + + virtual Dims4 getOutputDimensions() const; + const Parameters& getParams() const; + +protected: + + friend class LayerFactory; + ConvolutionLayer(); + + Parameters mParams; +}; + +class FullyConnectedLayer : public virtual IFullyConnectedLayer, public priv::Layer +{ +public: + FullyConnectedLayer(INetwork* network, const std::string& name, + ITensor* input, ITensor* output, + int numOutputChannels, + Weights kernelWeights, Weights biasWeights, BiasMode biasMode); + virtual ~FullyConnectedLayer(); + + virtual NvU16 getFactoryType() const; + virtual bool deserializeFrom(WisdomContainerEntry *); + virtual bool serializeTo(WisdomContainerEntry *) const; + + virtual int getNumOutputChannels() const; + virtual void setNumOutputChannels(int); + + virtual int getNumOutputMaps() const; + virtual void setNumOutputMaps(int); + + virtual Dims2 getKernelSize() const; + virtual void setKernelSize(Dims2 ksize); + + virtual Weights getKernelWeights() const; + virtual void setKernelWeights(Weights); + virtual bool hasKernelWeights() { return true; } + + virtual Weights getBiasWeights() const; + virtual void setBiasWeights(Weights); + virtual bool hasBiasWeights() { return true; } + + virtual BiasMode getBiasMode() const; + virtual void setBiasMode(BiasMode); + + virtual Dims4 getOutputDimensions() const; + + const Parameters& getParams() const; + +protected: + friend class LayerFactory; + FullyConnectedLayer(); + + Parameters mParams; +}; + +class ActivationLayer : public virtual IActivationLayer, public priv::Layer +{ +public: + ActivationLayer(INetwork* network, const std::string& name, + ITensor* input, ITensor* output, + ActivationType activationType); + virtual ~ActivationLayer(); + + virtual NvU16 getFactoryType() const; + + virtual bool deserializeFrom(WisdomContainerEntry *); + virtual bool serializeTo(WisdomContainerEntry *) const; + + virtual ActivationType getActivationType() const; + virtual void setActivationType(ActivationType); + + virtual Dims4 getOutputDimensions() const; + const Parameters& getParams() const; + +protected: + friend class LayerFactory; + ActivationLayer(); + + Parameters mParams; +}; + +class PoolingLayer : public virtual IPoolingLayer, public priv::Layer +{ +public: + PoolingLayer(INetwork* network, const std::string& name, + ITensor* input, ITensor* output, + PoolingType type, Dims2 windowSize); + PoolingLayer(INetwork* network, const std::string& name, + ITensor* input, ITensor* output, + PoolingType type, + Dims2 windowSize, Dims2 stride, + Dims2 tlPadding, Dims2 brPadding); + virtual ~PoolingLayer(); + + virtual NvU16 getFactoryType() const; + virtual bool deserializeFrom(WisdomContainerEntry *); + virtual bool serializeTo(WisdomContainerEntry *) const; + + virtual PoolingType getPoolingType() const; + virtual void setPoolingType(PoolingType); + + virtual Dims2 getWindowSize() const; + virtual void setWindowSize(Dims2); + + virtual Dims2 getBottomRightPadding() const; + virtual void setBottomRightPadding(Dims2); + + virtual Dims2 getTopLeftPadding() const; + virtual void setTopLeftPadding(Dims2); + + virtual Dims2 getStride() const; + virtual void setStride(Dims2); + + virtual Dims4 getOutputDimensions() const; + const Parameters& getParams() const; + +protected: + friend class LayerFactory; + PoolingLayer(); + + Parameters mParams; +}; + + +class LRNLayer : public virtual ILRNLayer, public priv::Layer +{ +public: + LRNLayer(INetwork* network, const std::string& name, + ITensor* input, + ITensor* output, + int windowSize, float alpha, float beta, float k); + virtual ~LRNLayer(); + + virtual NvU16 getFactoryType() const; + virtual bool deserializeFrom(WisdomContainerEntry *); + virtual bool serializeTo(WisdomContainerEntry *) const; + + virtual float getAlpha() const; + virtual void setAlpha(float); + + virtual float getBeta() const; + virtual void setBeta(float); + + virtual float getK() const; + virtual void setK(float); + + virtual int getWindowSize() const; + virtual void setWindowSize(int); + + + // ACCESSOR_DECL(DataType, arithmeticType, ArithmeticType) + + virtual Dims4 getOutputDimensions() const; + const Parameters& getParams() const; + + virtual NvDlaError supportsPrecision(nvdla::DataType compPrec) { return NvDlaError_NotSupported; } +protected: + friend class LayerFactory; + LRNLayer(); + + Parameters mParams; +}; + +class ScaleLayer : public virtual IScaleLayer, public priv::Layer +{ +public: + ScaleLayer(INetwork* network, const std::string& name, + ITensor* input, ITensor* output, + ScaleMode mode, + Weights shift, Weights scale, Weights power); + virtual ~ScaleLayer(); + + virtual NvU16 getFactoryType() const; + virtual bool deserializeFrom(WisdomContainerEntry *); + virtual bool serializeTo(WisdomContainerEntry *) const; + + virtual Weights getScale() const; + virtual void setScale(Weights); + + virtual Weights getShift() const; + virtual void setShift(Weights); + + virtual Weights getPower() const; + virtual void setPower(Weights); + + virtual ScaleMode getMode() const; + virtual void setMode(ScaleMode); + + virtual Dims4 getOutputDimensions() const; + const Parameters& getParams() const; + + virtual NvDlaError supportsPrecision(nvdla::DataType compPrec) { return NvDlaError_NotSupported; } +protected: + friend class LayerFactory; + ScaleLayer(); + + Parameters mParams; +}; + +class BatchNormLayer : public virtual IBatchNormLayer, public priv::Layer +{ +public: + BatchNormLayer(INetwork* network, const std::string& name, + ITensor* input, ITensor* output, + BatchNormMode mode, + Weights mean, Weights variance, float epsilon); + virtual ~BatchNormLayer(); + + virtual NvU16 getFactoryType() const; + virtual bool deserializeFrom(WisdomContainerEntry *); + virtual bool serializeTo(WisdomContainerEntry *) const; + + virtual float getEpsilon() const; + virtual void setEpsilon(float); + + virtual Weights getMean() const; + virtual void setMean(Weights); + + virtual Weights getVariance() const; + virtual void setVariance(Weights); + + virtual BatchNormMode getMode() const; + virtual void setMode(BatchNormMode); + + virtual Dims4 getOutputDimensions() const; + const Parameters& getParams() const; + + virtual NvDlaError supportsPrecision(nvdla::DataType compPrec) { return NvDlaError_NotSupported; } + +protected: + friend class LayerFactory; + BatchNormLayer(); + + Parameters mParams; +}; + +class SoftMaxLayer : public virtual ISoftMaxLayer, public priv::Layer +{ +public: + SoftMaxLayer(INetwork* network, const std::string& name, + ITensor* input, ITensor* output); + virtual ~SoftMaxLayer(); + + virtual NvU16 getFactoryType() const; + virtual bool deserializeFrom(WisdomContainerEntry *); + virtual bool serializeTo(WisdomContainerEntry *) const; + + virtual Dims4 getOutputDimensions() const; + const Parameters& getParams() const; + + virtual NvDlaError supportsPrecision(nvdla::DataType compPrec) { return NvDlaError_NotSupported; } + +protected: + friend class LayerFactory; + SoftMaxLayer(); + + Parameters mParams; +}; + +class ConcatenationLayer : public virtual IConcatenationLayer, public priv::Layer +{ +public: + ConcatenationLayer(INetwork* network, const std::string& name, + ITensor*const * inputs, int numInputs, + ITensor* output); + virtual ~ConcatenationLayer(); + + virtual NvU16 getFactoryType() const; + virtual bool deserializeFrom(WisdomContainerEntry *); + virtual bool serializeTo(WisdomContainerEntry *) const; + + virtual Dims4 getOutputDimensions() const; + const Parameters& getParams() const; + + virtual NvDlaError supportsPrecision(nvdla::DataType compPrec) { return NvDlaError_NotSupported; } + +protected: + friend class LayerFactory; + ConcatenationLayer(); + + Weights mBiasWeights; + Weights mFilterWeights; + Parameters mParams; +}; + +class SliceLayer : public virtual ISliceLayer, public priv::Layer +{ +public: + SliceLayer(INetwork* network, const std::string& name, + ITensor* input, + ITensor* const* outputs, + int numOutputs); + virtual ~SliceLayer(); + + virtual NvU16 getFactoryType() const; + virtual bool deserializeFrom(WisdomContainerEntry *); + virtual bool serializeTo(WisdomContainerEntry *) const; + + virtual Dims4 getOutputDimensions() const; + const Parameters& getParams() const; + + virtual NvDlaError supportsPrecision(nvdla::DataType compPrec) { return NvDlaError_NotSupported; } + +protected: + friend class LayerFactory; + SliceLayer(); + + Parameters mParams; +}; + +class DeconvolutionLayer : public virtual IDeconvolutionLayer, public priv::Layer +{ +public: + DeconvolutionLayer(INetwork* network, const std::string& name, + ITensor* input, + ITensor* output, int numOutputMaps, + Dims2 kernelSize, Weights kernelWeights, Weights biasWeights); + DeconvolutionLayer(INetwork* network, const std::string& name, + ITensor* input, ITensor* output, int numOutputMaps, int paddingValue, + Dims2 kernelSize, Dims2 tlPadding, Dims2 brPadding, Dims2 stride, Dims2 dilation, + Weights kernelWeights, Weights biasWeights, BiasMode biasMode, int numGroups); + virtual ~DeconvolutionLayer(); + + virtual NvU16 getFactoryType() const; + virtual bool deserializeFrom(WisdomContainerEntry *); + virtual bool serializeTo(WisdomContainerEntry *) const; + + virtual Dims2 getKernelSize() const; + virtual void setKernelSize(Dims2 ksize); + + virtual int getPaddingValue() const; + virtual void setPaddingValue(int); + + virtual Dims2 getBottomRightPadding() const; + virtual void setBottomRightPadding(Dims2); + + virtual Dims2 getTopLeftPadding() const; + virtual void setTopLeftPadding(Dims2); + + virtual Dims2 getStride() const; + virtual void setStride(Dims2); + + virtual Dims2 getDilation() const; + virtual void setDilation(Dims2); + + virtual int getNumGroups() const; + virtual void setNumGroups(int numGroups); + + virtual int getNumOutputMaps() const; + virtual void setNumOutputMaps(int); + + virtual Weights getKernelWeights() const; + virtual void setKernelWeights(Weights); + virtual bool hasKernelWeights() { return true; } + + virtual Weights getBiasWeights() const; + virtual void setBiasWeights(Weights); + virtual bool hasBiasWeights() { return true; } + + virtual BiasMode getBiasMode() const; + virtual void setBiasMode(BiasMode); + + virtual Dims4 getOutputDimensions() const; + const Parameters& getParams() const; + + virtual NvDlaError supportsPrecision(nvdla::DataType compPrec) { return NvDlaError_NotSupported; } + +protected: + friend class LayerFactory; + DeconvolutionLayer(); + + Parameters mParams; +}; + +class ElementWiseLayer : public virtual IElementWiseLayer, public priv::Layer +{ +public: + ElementWiseLayer(INetwork* network, const std::string& name, + ITensor*const *inputs, ITensor* output, + ElementWiseOperation op); + virtual ~ElementWiseLayer(); + + virtual NvU16 getFactoryType() const; + virtual bool deserializeFrom(WisdomContainerEntry *); + virtual bool serializeTo(WisdomContainerEntry *) const; + + virtual ElementWiseOperation getOperation() const; + virtual void setOperation(ElementWiseOperation); + + virtual Dims4 getOutputDimensions() const; + const Parameters& getParams() const; + + virtual NvDlaError supportsPrecision(nvdla::DataType compPrec) { return NvDlaError_NotSupported; } + +protected: + friend class LayerFactory; + ElementWiseLayer(); + + Parameters mParams; +}; + + +class InputLayer : public virtual IInputLayer, public priv::Layer +{ +public: + InputLayer(INetwork* network, const std::string& name, + ITensor*const *inputs, ITensor* output); + virtual ~InputLayer(); + + virtual NvU16 getFactoryType() const; + virtual bool deserializeFrom(WisdomContainerEntry *); + virtual bool serializeTo(WisdomContainerEntry *) const; + + // virtual InputOperation getOperation() const; + // virtual void setOperation(InputOperation); + + virtual Dims4 getOutputDimensions() const; + const Parameters& getParams() const; + +protected: + friend class LayerFactory; + InputLayer(); + + Parameters mParams; +}; + + +} +} + +#endif // NVDLA_PRIV_LAYER_H diff --git a/umd/core/src/compiler/include/priv/LowPrecision.h b/umd/core/src/compiler/include/priv/LowPrecision.h new file mode 100644 index 00000000..5d1e94b3 --- /dev/null +++ b/umd/core/src/compiler/include/priv/LowPrecision.h @@ -0,0 +1,344 @@ +/* + * Copyright (c) 2018-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#include // for pow + +#include "ErrorMacros.h" + +using std::endl; + +#define DLA_MAX_TRUNCATE_SIZE (std::pow(2,6) - 1) + +// support api's for int8 quantization and scaling/rescaling + +template +NvDlaError scaleAndShiftFromScalarImpl1 +( + NvF32 scalar, + std::pair* scaleAndShift, + NvU32 powerOfTwo = 0 +) +{ + NvDlaError e = NvDlaSuccess; + + const bool debug = false; + + NvS32 scale = 1; + NvU32 attempts = 0; + + bool found = false; + bool isNeg = scalar < 0; + bool sclInRange = true; + bool shftInRange = true; + + NvF32 approxValue = 0.0f; + NvF32 absScalar = fabs(scalar); + NvF32 closestFound = 0.0f; + NvF32 toleranceMax = std::pow(2, 4); + + if (absScalar > 1) + { + bool isNoFractional = (absScalar == floor(absScalar)); + if (isNoFractional && (absScalar <= std::numeric_limits::max())) + { + scale = SC(scalar); + powerOfTwo = 0; + found = true; + } + else + { + scale = std::numeric_limits::max(); + // use suggested powerOf2 (if any) and adjust scale to meet the scalar + powerOfTwo = powerOfTwo != 0 ? powerOfTwo : ceil(log(NvF32(absScalar / scale))/log(2)); + + NvF32 tolerance = 1; + do { + do + { + approxValue = NvF32(scale) * std::pow(2, powerOfTwo); + closestFound = std::min(fabs(closestFound - absScalar), fabs(approxValue - absScalar)) == + fabs(closestFound - absScalar) ? + closestFound : approxValue; + if (fabs(approxValue - absScalar) <= tolerance) + { + found = true; + break; + } + else + { + scale--; + } + + sclInRange = (scale <= std::numeric_limits::max()) && + (scale >= std::numeric_limits::min()); + shftInRange = (powerOfTwo <= std::numeric_limits::max()) && + (powerOfTwo >= std::numeric_limits::min()); + attempts++; + } while (attempts != 1000 && sclInRange && shftInRange); + + if (found) + break; + + // reset stats and retry + tolerance += 1; + attempts = 0; + scale = std::numeric_limits::max(); + powerOfTwo = powerOfTwo != 0 ? powerOfTwo : ceil(log(NvF32(absScalar / scale))/log(2)); + } while (tolerance <= toleranceMax); + } + + if (found) + { + if ( debug ) + { + gLogInfo << scalar << " = " << (isNeg ? -scale : scale) << "*2^" + << powerOfTwo << " [" << approxValue << "]" << std::endl; + } + scale *= isNeg ? -1 : 1; + *scaleAndShift = std::make_pair(SC(scale), SH(powerOfTwo)); + } + else + { + gLogWarning << "Couldn't converge on `2^(ls) * m` which could safely represent " << scalar + << " within acceptable tolerance of +/-" << toleranceMax + << " using closest found: " << closestFound << "instead" << endl; + scale = closestFound / std::pow(2, powerOfTwo); + scale *= isNeg ? -1 : 1; + *scaleAndShift = std::make_pair(SC(scale), SH(powerOfTwo)); + } + } + else + { + scale = 1; + powerOfTwo = 0; + NvF32 tolerance = 10e-8; + NvF32 toleranceMax = 0.1; + do { + do { + approxValue = NvF32(scale) / std::pow(2, powerOfTwo); + closestFound = std::min(fabs(closestFound - absScalar), fabs(approxValue - absScalar)) == + fabs(closestFound - absScalar) ? closestFound : approxValue; + if (fabs(approxValue - absScalar) <= tolerance) + { + found = true; + break; + } + + if (approxValue > absScalar) + { + powerOfTwo++; + } + else if (approxValue < absScalar) + { + scale++; + } + + sclInRange = (scale <= std::numeric_limits::max()) && + (scale >= std::numeric_limits::min()); + shftInRange = (powerOfTwo <= std::numeric_limits::max()) && + (powerOfTwo >= std::numeric_limits::min()); + attempts++; + } while (attempts != 1000 && sclInRange && shftInRange); + + if (found) + break; + + // reset stats and retry + tolerance *= 10; + attempts = 0; + scale = 1; + powerOfTwo = 0; + } while (tolerance <= toleranceMax); + + if (found) + { + if ( debug ) + { + gLogInfo << scalar << " = " << (isNeg ? -scale : scale) << "/(2^" + << powerOfTwo << ") [" << approxValue << "]" << std::endl; + } + scale *= -isNeg ? -1 : 1; + *scaleAndShift = std::make_pair(SC((isNeg ? -scale : scale)), SH(powerOfTwo)); + } + else + { + gLogWarning << "Couldn't converge on `2^(-t) * s` which could safely represent " << scalar + << " within acceptable tolerance of +/-" << toleranceMax + << " using closest found: " << closestFound << "instead" << endl; + scale = closestFound * std::pow(2, powerOfTwo); + scale *= isNeg ? -1 : 1; + *scaleAndShift = std::make_pair(SC(scale), SH(powerOfTwo)); + } + } + + if (!found) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Couldn't converge on `2^(x) * y` which could " + "safely represent %f within acceptable tolerance\n", scalar); + } + +fail: + return e; +} + +/** + * All scalar values (S_fp) can be represented as n * (2 ^ -m) if within range + * + * S_fp = n_i16 * (2 ^ -m), such that + * m = 15 - b', + * n_i16 = INT16(S_fp * (2 ^ (15 - b'))) + * where b' represent #bits to tranverse from MSB before radix point (in binary) + * of S_fp is hit. + * + * Since we can only have signed 16 bit scale/numerator, limiting the right shift + * to 15 bits. With a larger divisor, we lose precision and small scales become 0 + * With a smaller divisor, then the largest value overflows. If the numerator/scale + * overflows NvS16 bynamic range, compilation should fail. + * + * todo: for dla2, add constraints on max shift/truncate width + **/ +template +NvDlaError scaleAndShiftFromScalarImpl2 +( + NvF32 scalar, + std::pair* scaleAndShift, + //NvU32 maxShiftWidth, + NvU32 powerOfTwo = 0 +) +{ + NvDlaError e = NvDlaSuccess; + + const NvS32 MIN_TOLERABLE_SCALE = std::pow(2,1); + + NvF32 absScalar = fabs(scalar); + bool isNeg = scalar < 0; + NvS32 scale = 0; + NvS32 numBits = 0; + + // Handle special case of scalar being zero. + if(absScalar == 0) + { + powerOfTwo = powerOfTwo != 0 ? powerOfTwo : 1; // Any value would do if none provided + scale = 0; + } + else + { + // Find the number of bits required for non-fractional part + numBits = floor(log(absScalar)/log(2)) + 1; + + // Check if it is within range + if (powerOfTwo == 0 && numBits > 15) + { + PROPAGATE_ERROR_FAIL(NvDlaError_BadValue, "Scale value for %f is " + "beyond dynamic range of NvS16\n", scalar); + } + + // Update truncateFactor (powerOfTwo) and scale based on numBits + powerOfTwo = powerOfTwo != 0 ? powerOfTwo : 15 - numBits; + + if (powerOfTwo > 31 && powerOfTwo <= 63) + { + /* Warn user on high truncate value */ + REPORT_ERROR(NvDlaError_BadParameter, "Truncate too high: %d\n", powerOfTwo); + } + else if (powerOfTwo >= 64) + { + /* Error out as impossible to program */ + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, + "Truncate value %d is out of range [0,63]", + powerOfTwo); + } + + scale = std::pow(2, powerOfTwo) * absScalar; + if (scale == 0) + { + // TODO: PROPAGATE_ERROR_FAIL once everything in place + REPORT_ERROR(NvDlaError_BadValue, "Scale value is 0 for %f\n", scalar); + } + else if (scale < MIN_TOLERABLE_SCALE) + { + gLogWarning << "Scale value " << scale << " for " << scalar << " is too small " + << "(threshold: " << MIN_TOLERABLE_SCALE << ")" << endl; + } + else if (scale > std::numeric_limits::max()) + { + PROPAGATE_ERROR_FAIL(NvDlaError_BadValue, "Scale value %d for %f is " + "beyond dynamic range of NvS16\n", scale, scalar); + } + } + + *scaleAndShift = std::make_pair(SC((isNeg ? -scale : scale)), SH(powerOfTwo)); + +fail: + return e; +} + + +template +NvDlaError calculateScaleAndShiftFromScalar +( + NvF32 scalar, + std::pair* scaleAndShift, + NvU32 powerOfTwo = 0 +) +{ + NvDlaError e = NvDlaSuccess; + + // toggle between the 2 implementations in case of debugging Impl2 is safe for now (mnist) + // PROPAGATE_ERROR_FAIL( scaleAndShiftFromScalarImpl1(scalar, scaleAndShift, powerOfTwo) ); + PROPAGATE_ERROR_FAIL( scaleAndShiftFromScalarImpl2(scalar, scaleAndShift, powerOfTwo) ); + +fail: + return e; +} + +template +NvDlaError factorizeScalars +( + std::vector scalars, + std::vector< std::pair >* scalesAndShifts, + NvU32 commonPowerOfTwo = 0 +) +{ + NvDlaError e = NvDlaSuccess; + + for (NvU32 ss = 0; ss < scalars.size(); ++ss) + { + std::pair sclAndShft; + e = calculateScaleAndShiftFromScalar(scalars[ss], &sclAndShft, commonPowerOfTwo); + if (e != NvDlaSuccess) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, " Couldn't converge on `2^(x) * y` which could " + "safely represent %f within acceptable tolerance\n", scalars[ss]); + } + scalesAndShifts->push_back(sclAndShft); + } + +fail: + return e; +} diff --git a/umd/core/src/compiler/include/priv/LutManager.h b/umd/core/src/compiler/include/priv/LutManager.h new file mode 100644 index 00000000..2ba9789e --- /dev/null +++ b/umd/core/src/compiler/include/priv/LutManager.h @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#ifndef NVDLA_PRIV_LUT_MANAGER_H +#define NVDLA_PRIV_LUT_MANAGER_H + +#include "priv/EngineAST.h" + +namespace nvdla +{ +namespace priv +{ + +class LutManager +{ +public: + LutManager(); + virtual ~LutManager(); + + typedef NvS16 LutHandle; + +protected: + enum LutTypeEnum + { + LUT_TYPE_LRN, + LUT_TYPE_SIGMOID, + LUT_TYPE_TANH + }; + + struct LRNParams + { + NvU32 localSize; + NvF32 alpha; + NvF32 beta; + NvF32 k; + }; + + struct LutParams + { + LutTypeEnum type; + surface::SurfacePrecisionEnum precision; + LRNParams lrnParams; + }; + + NvDlaError genKey(const LutParams* params, std::string* key) const; + NvDlaError getHandle(const LutParams* lutParams, LutHandle* hLut); + +public: + NvDlaError registerLRN(surface::SurfacePrecisionEnum precision, NvU32 localSize, NvF32 alpha, NvF32 beta, NvF32 k, LutHandle* hLut); + NvDlaError registerSigmoid(surface::SurfacePrecisionEnum precision, LutHandle* hLut); + NvDlaError registerTanh(surface::SurfacePrecisionEnum precision, LutHandle* hLut); + + NvS16 getIndex(LutHandle hLut) const; + NvS16 getNumRegisteredLuts(); + + NvDlaError writeLutData(NvU16 lutSlot, DLALUTParamAccessor lutAcc); + NvDlaError writeLRNData(const LutParams* lutParams, DLALUTParamAccessor lutAcc); + NvDlaError writeSigmoidData(const LutParams* lutParams, DLALUTParamAccessor lutAcc); + NvDlaError writeTanhData(const LutParams* lutParams, DLALUTParamAccessor lutAcc); + +protected: + std::map m_lutHandles; + std::map m_lutParams; + LutHandle m_hNextFree; +}; + +}; //nvdla::priv +}; //nvdla:: + +#endif // NVDLA_PRIV_LUT_MANAGER_H diff --git a/umd/core/src/compiler/include/priv/Memory.h b/umd/core/src/compiler/include/priv/Memory.h new file mode 100644 index 00000000..89917085 --- /dev/null +++ b/umd/core/src/compiler/include/priv/Memory.h @@ -0,0 +1,275 @@ +/* + * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#ifndef NVDLA_PRIV_MEMORY_H +#define NVDLA_PRIV_MEMORY_H + +#include +#include +#include + +#include "BuddyAlloc.h" +#include "priv/Check.h" +#include "priv/MultiBatch.h" +#include "priv/ResourceEnums.h" // for memory enums +#include "priv/Type.h" +//#include "priv/EngineAST.h" + +namespace nvdla +{ + +namespace priv +{ + +namespace engine_ast +{ +class Node; +} + +namespace surface +{ +class TensorSurfaceDesc; +} + +namespace memory +{ +class TensorBufferDesc; + +enum PoolTypeEnum { + POOL_TYPE_ENUMS(GEN_ENUM) +}; +typedef SequenceEnum PoolType; + +enum LocationEnum { + MEMORY_LOCATION_ENUMS(GEN_ENUM) +}; +typedef SequenceEnum Location; + +enum MemoryBufferTypeEnum { + MEMORY_BUFFER_TYPE_ENUMS(GEN_ENUM) +}; +typedef SequenceEnum MemoryBufferType; + +enum TensorCategoryEnum { + TENSOR_CATEGORY_ENUMS(GEN_ENUM) +}; +typedef SequenceEnum TensorCategory; + +// +// used by the compiler to partition memory pools. +// +class Pool +{ +public: + Pool() : + m_base_addr(NULL), + m_size(0), + m_min_buffer_size(0), + m_addr_mgr(NULL), + m_name(""), + m_memoryId(-1), + m_addressId(-1), + m_type(PoolTypeEnum::LOCAL_DRAM_POOL), + m_size_used(0) + { } + + Pool(const Pool &o) : + m_base_addr(o.m_base_addr), + m_size(o.m_size), + m_min_buffer_size(o.m_min_buffer_size), + m_addr_mgr(o.m_addr_mgr), // xxx clone behavior? + m_name(o.m_name), + m_memoryId(o.m_memoryId), + m_addressId(o.m_addressId), + m_type(o.m_type), + m_contents(o.m_contents), // xxx clone behavior? + m_size_used(o.m_size_used) + { } + ~Pool(); + + const std::string name() const { return m_name; } + PoolType type() const { return m_type; } + + NvDlaError init(PoolType pt, NvU64 poolSize, NvU32 minBufferSize); + NvU64 size() const { return m_size; } + NvU64 sizeUsed() const { return m_size_used; } + + Location location(); + NvDlaError allocate(TensorBufferDesc* tbd, NvU16 batchId = 0); + NvDlaError deallocate(TensorBufferDesc* tbd, NvU16 batchId = 0); + + void setMemoryId(NvS16 id) { m_memoryId = id; } + NvS16 memoryId() const { return m_memoryId; } + + void setAddressId(NvS16 id) { m_addressId = id; } + NvS16 addressId() const { return m_addressId; } + + void insertContent(surface::TensorSurfaceDesc *tsd) { m_contents.insert(tsd); } + std::set &contents() { return m_contents; } + + static inline bool debug() { return false; } + static inline bool debugBinding() { return false; } + +protected: + + void * m_base_addr; + NvU64 m_size; + NvU32 m_min_buffer_size; + NvDlaBuddyAllocInst* m_addr_mgr; + std::string m_name; + NvS16 m_memoryId; + NvS16 m_addressId; + PoolType m_type; + std::set m_contents; + NvU64 m_size_used; +}; + +class TensorBufferDesc +{ +public: + class BufferDescState + { + public: + BufferDescState() : + m_address(0), + m_is_allocated(false), + m_memoryId(-1), + m_pool_offset(0), + m_mem_loc(LocationEnum::lUNKNOWN), + m_pool(NULL) + { } + virtual ~BufferDescState() { } + + void setBufferAddress(void* addr) { m_address = addr; } + template T* bufferAddress() const { return (T*)m_address; } + + void setAllocated() { m_is_allocated = true; } + void clearAllocated() { m_is_allocated = false; } + bool allocated() { return m_is_allocated; } + + void setMemoryId(NvS16 mid) { m_memoryId = mid; } + NvS16 memoryId() const { return m_memoryId; } + + NvU64 poolOffset() const { return m_pool_offset; } + void setPoolOffset(NvU64 poolOffset) { m_pool_offset = poolOffset; } + + void setMemoryLoc(Location loc) { m_mem_loc = loc; } + Location memoryLoc() const { return m_mem_loc; } + + Pool* pool() const { return m_pool; } + void setPool(Pool* pool) { m_pool = pool; } + + protected: + void* m_address; + bool m_is_allocated; + NvS16 m_memoryId; + NvU64 m_pool_offset; + Location m_mem_loc; // DRAM/CV-SRAM/CBuff/Stream + Pool* m_pool; + }; + + TensorBufferDesc(NvU16 numBatches) : + m_id(""), + m_align_bytes(32), + m_size(0) + { + m_mb_tbd_state = new MultiBatchState < BufferDescState >(numBatches); + } + + ~TensorBufferDesc(); + + static inline bool debugBinding() { return false; } + + void setId(const std::string id) { m_id = id; } + const std::string id() const { return m_id; } + + void setMemoryId(NvS16 mid, NvU16 batchId = 0) + { + if (m_mb_tbd_state->batch(batchId).pool()) + { + gLogError << "tried to assign a memory id to a buffer (" << id() << ") within a pool" << std::endl; + } + m_mb_tbd_state->batch(batchId).setMemoryId(mid); + } + NvS16 memoryId(NvU16 batchId = 0) + { + // if buffer is within pool, it uses same memId as the pool's and doesn't have its own + if (m_mb_tbd_state->batch(batchId).pool()) + { + return m_mb_tbd_state->batch(batchId).pool()->memoryId(); + } + return m_mb_tbd_state->batch(batchId).memoryId(); + } + + void setAddress(void* addr, NvU16 batchId = 0) { m_mb_tbd_state->batch(batchId).setBufferAddress(addr); } + template T* address(NvU16 batchId = 0) { return m_mb_tbd_state->batch(batchId).bufferAddress(); } + + void setPoolOffset(NvU64 off, NvU16 batchId = 0) { m_mb_tbd_state->batch(batchId).setPoolOffset(off); } + NvU64 poolOffset(NvU16 batchId = 0) { return m_mb_tbd_state->batch(batchId).poolOffset(); } + + void setMemoryLoc(Location loc, NvU16 batchId = 0) { m_mb_tbd_state->batch(batchId).setMemoryLoc(loc); } + Location memoryLoc(NvU16 batchId = 0) const { return m_mb_tbd_state->batch(batchId).memoryLoc(); } + + Pool* pool(NvU16 batchId = 0) const { return m_mb_tbd_state->batch(batchId).pool(); } + void setPool(Pool* pool, NvU16 batchId = 0) { m_mb_tbd_state->batch(batchId).setPool(pool); } + + void setAllocated(NvU16 batchId = 0) { m_mb_tbd_state->batch(batchId).setAllocated(); } + void clearAllocated(NvU16 batchId = 0) { m_mb_tbd_state->batch(batchId).clearAllocated(); } + bool allocated(NvU16 batchId = 0) { return m_mb_tbd_state->batch(batchId).allocated(); } + + void setAlignment(NvU16 align) { m_align_bytes = align; } + NvU16 alignBytes() { return m_align_bytes; } + + NvU64 size() { return m_size; } + void setSize(NvU64 size) { m_size = size; } + void resetSize() { m_size = 0; } + + NvDlaError addSurface(nvdla::priv::surface::TensorSurfaceDesc *tsd); + std::set& surfaces(); + + bool bindable() const; + NvS16 bindId(enum IOD &bindDomain) const; + surface::TensorSurfaceDesc *boundSurface(size_t) const; + + // void setContent(const void* data) { m_content = true; std::memcpy(address(), data, size()); } + bool content() const; + +protected: + std::string m_id; + NvU16 m_align_bytes; + NvU64 m_size; + std::set m_surfaces; + // tbd state for each of the batches in multi-batch case + MultiBatchState < BufferDescState > *m_mb_tbd_state; +}; + +} // nvdla::memory +} // nvdla::priv +} // nvdla + +#endif // NVDLA_PRIV_MEMORY_H diff --git a/umd/core/src/compiler/include/priv/MultiBatch.h b/umd/core/src/compiler/include/priv/MultiBatch.h new file mode 100644 index 00000000..fc356cce --- /dev/null +++ b/umd/core/src/compiler/include/priv/MultiBatch.h @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#ifndef NVDLA_PRIV_MULTIBATCH_H +#define NVDLA_PRIV_MULTIBATCH_H + +#include "ErrorMacros.h" + +namespace nvdla +{ +namespace priv +{ + +template < typename StateClass > +class MultiBatchState +{ +public: + MultiBatchState() : m_batch_size(1) + { + m_batch_states = std::vector< StateClass >(1); + } + MultiBatchState(NvU16 numBatches) + { + m_batch_size = numBatches; + m_batch_states = std::vector< StateClass >(numBatches); + } + virtual ~MultiBatchState() { } + + StateClass& batch(NvU16 batchId) + { + if (batchId > m_batch_size) + { + REPORT_ERROR(NvDlaError_BadParameter, "batchId: %d > batch_size: %d. Returning state for batch=0", batchId, m_batch_size); + return m_batch_states[0]; + } + else + { + return m_batch_states[batchId]; + } + } + +protected: + NvU16 m_batch_size; + std::vector< StateClass > m_batch_states; +}; + +}; // nvdla::priv + +}; // nvdla:: + +#endif /* NVDLA_PRIV_MULTIBATCH_H */ diff --git a/umd/core/src/compiler/include/priv/Network.h b/umd/core/src/compiler/include/priv/Network.h new file mode 100644 index 00000000..a1df43c4 --- /dev/null +++ b/umd/core/src/compiler/include/priv/Network.h @@ -0,0 +1,169 @@ +/* + * Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#ifndef NVDLA_PRIV_NETWORK_H +#define NVDLA_PRIV_NETWORK_H + +#include +#include +#include +#include +#include + +#include "nvdla/INetwork.h" +#include "nvdla/ITensor.h" +#include "priv/ResourceEnums.h" // for tensor surface types +#include "priv/Type.h" +#include "priv/WisdomContainer.h" + +// #include "priv/EngineAST.h" + +namespace nvdla +{ +namespace priv +{ + +class Network; + +class NetworkFactory +{ +public: + typedef PrivPair NetworkPrivPair; + + static NetworkPrivPair newNetwork(); + static NvDlaError deleteNetwork(INetwork *network); + + static Network *priv(INetwork *); + static INetwork *i(Network *); + static INetwork *self(void *s); + + static INetwork *deserializeFrom(WisdomContainerEntry *); + +protected: + static BiMap s_priv; + static BiMap s_self; + + static INetwork *deserializeNetwork(WisdomContainerEntry *); +}; + +class Network : public INetwork +{ +public: // externally facing + + virtual ITensor* addInput(const char* name, Dims4 dimensions); + + // virtual void markChanged(const ILayer*); + virtual bool markInput(ITensor * tensor); + virtual void markOutput(ITensor* tensor); + + virtual IConvolutionLayer * addConvolution(ITensor* input, int numOutputs, int paddingValue, + Dims2 kernelSize, Dims2 tlPadding, Dims2 brPadding, Dims2 stride, Dims2 dilation, + Weights kernelWeights, Weights biasWeights, BiasMode biasmode, int numGroups); + virtual IFullyConnectedLayer * addFullyConnected(ITensor* input, int outputSize, Weights kernelWeights, Weights biasWeights, BiasMode biasMode); + virtual IActivationLayer * addActivation(ITensor* input, ActivationType type); + virtual IPoolingLayer * addPooling(ITensor* input, PoolingType type, + Dims2 windowSize, Dims2 stride, Dims2 tlPadding, Dims2 brPadding); + virtual ILRNLayer * addLRN(ITensor* input, int window, float alpha, float beta, float k); + virtual IScaleLayer * addScale(ITensor* input, ScaleMode mode, Weights shift, Weights scale, Weights power); + virtual IBatchNormLayer * addBatchNorm(ITensor* input, BatchNormMode mode, Weights mean, Weights variance, float epsilon); + virtual ISoftMaxLayer * addSoftMax(ITensor* input); + virtual IConcatenationLayer * addConcatenation(ITensor * const * inputs, int numInputs); + virtual ISliceLayer * addSlice(ITensor* input, int numOutputs); + virtual IDeconvolutionLayer * addDeconvolution(ITensor* input, int numOutputs, int paddingValue, + Dims2 kernelSize, Dims2 tlPadding, Dims2 brPadding, Dims2 stride, Dims2 dilation, + Weights kernelWeights, Weights biasWeights, BiasMode biasMode, int numGroups); + virtual IElementWiseLayer * addElementWise(ITensor* input0, ITensor* input1, ElementWiseOperation op); + + virtual int getNumInputs() const; + virtual int getNumOutputs() const; + virtual int getNumLayers() const ; + + virtual ILayer * getLayer(int index) const; + virtual ITensor * getOutput(int index) const; + virtual ITensor * getInput(int index) const; + + virtual void setPoolingOutputDimensionsFormula (OutputDimensionsFormula* callback); + virtual void setConvolutionOutputDimensionsFormula (OutputDimensionsFormula* callback); + virtual void setDeconvolutionOutputDimensionsFormula(OutputDimensionsFormula* callback); + + virtual OutputDimensionsFormula& getPoolingOutputDimensionsFormula() const; + virtual OutputDimensionsFormula& getConvolutionOutputDimensionsFormula() const; + virtual OutputDimensionsFormula& getDeconvolutionOutputDimensionsFormula() const; + + virtual const std::vector& getInputs() const; + virtual const std::vector& getLayers() const; + virtual const std::vector& getOutputs() const; + + virtual NvU16 getFactoryType() const; + + +public: // internally facing + Network(); + virtual ~Network(); + virtual bool serializeTo(WisdomContainerEntry *) const; + virtual bool deserializeFrom(WisdomContainerEntry *); + virtual bool assignSymbols(Wisdom *); + +protected: + friend class Wisdom; + friend class NetworkFactory; + + void destroy(); + +private: + + std::string newLayerName() const; + std::string newTensorName() const; + + ITensor* addTensor(const std::string & s); + const ILayer* findLayer(const std::string& name) const; + bool checkNames(const char* name); + + std::vector mTensors; + std::vector mLayers; + std::vector mInputs; + std::vector mOutputs; + + // provides layer dimension caching. Layers can be mutated in any order and dimensions queried at any point. + // So mutating a layer trims this, and querying always refills the cache up to the queried layer + // mutable std::vector mDimensions; + + // internal flags used by the builder that are not accessible through the API + // int mInternalBuildFlags{ InternalBuildFlags::kENABLE_GRAPH_OPTIMIZATIONS }; + OutputDimensionsFormula* mConvDims, *mDeconvDims, *mPoolDims; + + +}; + +extern std::map layerTypeNames; +extern std::map activationTypeNames; + +} // nvdla::priv +} // nvdla + +#endif /* NVDLA_NETWORK_PRIV_H */ diff --git a/umd/core/src/compiler/include/priv/Profile.h b/umd/core/src/compiler/include/priv/Profile.h new file mode 100644 index 00000000..4c064bfb --- /dev/null +++ b/umd/core/src/compiler/include/priv/Profile.h @@ -0,0 +1,279 @@ +/* + * Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#ifndef NVDLA_PRIV_PROFILE_H +#define NVDLA_PRIV_PROFILE_H + +#include +#include + +#include "nvdla/IProfile.h" + +#include "priv/Surface.h" +#include "priv/Type.h" +#include "priv/Surface.h" + + +namespace nvdla +{ + +class ILayerProfile; +class ITensorProfile; + +namespace priv +{ + +class WisdomContainerEntry; + +class Profile; + +class ProfileFactory +{ +public: + typedef PrivPair ProfilePrivPair; + static ProfilePrivPair newProfile(); + static Profile *priv(IProfile *); + static IProfile *i(Profile *); + static IProfile *self(void *); + static IProfile *deserializeFrom(WisdomContainerEntry *); + +protected: + static BiMap s_priv; + static BiMap s_self; + static IProfile *deserializeProfile(WisdomContainerEntry *); +}; + +class Profile : public IProfile +{ +public: // externally facing + Profile() { } + virtual ~Profile() { } + + virtual const char* getName() const; + + virtual NvDlaError getNumLoadables(int *) const; + virtual NvDlaError getLoadable(const std::string &name, int index, ILoadable **); + +public: // internally facing + void setBasicProfile(); + void setDefaultProfile(); + void setPerformanceProfile(); + void setFastMathProfile(); + virtual void setName(const char *); + + virtual NvU16 getFactoryType() const; + virtual bool serializeTo(WisdomContainerEntry *) const; + virtual bool deserializeFrom(WisdomContainerEntry *); + + virtual NvDlaError insertLoadable(const std::string &name, int index, ILoadable *i_loadable); + + virtual NvDlaError setNetworkInputSurfaceFormat(nvdla::PixelFormat); + surface::SurfaceFormat networkInputSurfaceFormat() const { return m_globalParams.m_NwInSurfFormat; } + + virtual NvDlaError setNetworkOutputSurfaceFormat(nvdla::PixelFormat); + surface::SurfaceFormat networkOutputSurfaceFormat() const { return m_globalParams.m_NwOutSurfFormat; } + + virtual NvDlaError setNetworkInputPixelMapping(nvdla::PixelMapping); + surface::PixelMapping networkInputPixelMapping() const { return m_globalParams.m_NwInPixelMapping; } + + virtual NvDlaError setNetworkInputDataFormat(const nvdla::DataFormat nidf) { m_globalParams.m_NwInDataFormat = nidf; return NvDlaSuccess;} + nvdla::DataFormat networkInputDataFormat() const { return m_globalParams.m_NwInDataFormat; } + + virtual NvDlaError setNetworkOutputDataFormat(const nvdla::DataFormat nodf) { m_globalParams.m_NwOutDataFormat = nodf; return NvDlaSuccess; } + nvdla::DataFormat networkOutputDataFormat() const { return m_globalParams.m_NwOutDataFormat; } + + virtual NvDlaError setNetworkInputPixelOffX(NvU32 offX) { m_globalParams.m_NwInPixelOffX = offX; return NvDlaSuccess; } + NvU32 networkInputPixelOffX() const { return m_globalParams.m_NwInPixelOffX; } + + virtual NvDlaError setNetworkInputPixelOffY(NvU32 offY) { m_globalParams.m_NwInPixelOffY = offY; return NvDlaSuccess; } + NvU32 networkInputPixelOffY() const { return m_globalParams.m_NwInPixelOffY; } + + + virtual NvDlaError setCanCompressWeights(bool ccp) { m_compileParams.m_canCompressWeights = ccp; return NvDlaSuccess; } + bool canCompressWeights() const { return m_compileParams.m_canCompressWeights; } + + virtual NvDlaError setCanWinograd(bool cw) { m_compileParams.m_canWinograd = cw; return NvDlaSuccess; } + bool canWinograd() const { return m_compileParams.m_canWinograd; } + + virtual NvDlaError setCanSDPFuseVerticalOps(bool csfv) { m_compileParams.m_canSDPFuseVerticalOps = csfv; return NvDlaSuccess; } + bool canSDPFuseVerticalOps() const { return m_compileParams.m_canSDPFuseVerticalOps; } + + virtual NvDlaError setCanSDPMergeMathOps(bool csmm) { m_compileParams.m_canSDPMergeMathOps = csmm; return NvDlaSuccess; } + bool canSDPMergeMathOps() const { return m_compileParams.m_canSDPMergeMathOps; } + + virtual NvDlaError setCanSDPFuseSubEngineOps(bool csmm) { m_compileParams.m_canSDPFuseSubEngineOps = csmm; return NvDlaSuccess; } + bool canSDPFuseSubEngineOps() const { return m_compileParams.m_canSDPFuseSubEngineOps; } + + virtual NvDlaError setCanSDPBustNOPs(bool csbn) { m_compileParams.m_canSDPBustNOPs = csbn; return NvDlaSuccess; } + bool canSDPBustNOPs() const { return m_compileParams.m_canSDPBustNOPs; } + + virtual NvDlaError setCanSDPPDPOnFly(bool cspo) { m_compileParams.m_canSDPPDPOnFly = cspo; return NvDlaSuccess; } + bool canSDPPDPOnFly() const { return m_compileParams.m_canSDPPDPOnFly; } + + virtual NvDlaError setUseCVSRAMAllocate(bool uca) { m_compileParams.m_useCVSRAMAllocate = uca; return NvDlaSuccess; } + bool useCVSRAMAllocate() const { return m_compileParams.m_useCVSRAMAllocate; } + + virtual NvDlaError setUseMemPool(bool ump) { m_compileParams.m_useMemPool = ump; return NvDlaSuccess; } + bool useMemPool() const { return m_compileParams.m_useMemPool; } + + virtual NvDlaError setUseReusePooledMemory(bool urpm) { m_compileParams.m_useReusePooledMemory = urpm; return NvDlaSuccess; } + bool useReusePooledMemory() const { return m_compileParams.m_useReusePooledMemory; } + + virtual NvDlaError setCopyOutDebugSurfaces(bool cods) { m_compileParams.m_copyOutDebugSurfaces = cods; return NvDlaSuccess; } + bool copyOutDebugSurfaces() const { return m_compileParams.m_copyOutDebugSurfaces; } + + virtual NvDlaError setUseGreedyEviction(bool uge) { m_compileParams.m_useGreedyEviction = uge; return NvDlaSuccess; } + bool useGreedyEviction() const { return m_compileParams.m_useGreedyEviction; } + + virtual NvDlaError setCONVDataBanksAllotted(NvU32 db) { m_compileParams.m_CONVDataBanksAllotted = db; return NvDlaSuccess; } + NvU32 dataBanksAlloted() const { return m_compileParams.m_CONVDataBanksAllotted; } + + virtual NvDlaError setCONVWeightBanksAllotted(NvU32 wb) { m_compileParams.m_CONVWeightBanksAllotted = wb; return NvDlaSuccess; } + NvU32 weightBanksAlloted() const { return m_compileParams.m_CONVWeightBanksAllotted; } + + virtual NvDlaError setGlobalDRAMSize(NvU64 gds) { m_compileParams.m_globalDRAMSize = gds; return NvDlaSuccess; } + NvU64 globalDRAMPoolSize() const { return m_compileParams.m_globalDRAMSize; } + + virtual NvDlaError setLocalDRAMSize(NvU64 lds) { m_compileParams.m_localDRAMSize = lds; return NvDlaSuccess; } + NvU64 localDRAMPoolSize() const { return m_compileParams.m_localDRAMSize; } + + virtual NvDlaError setLocalCVSRAMSize(NvU64 lcs) { m_compileParams.m_localCVSRAMSize = lcs; return NvDlaSuccess; } + NvU64 localCVSRAMPoolSize() const { return m_compileParams.m_localCVSRAMSize; } + + virtual NvDlaError setMultiBatchSize(NvU32 mbs) { m_compileParams.m_multiBatchSize = mbs; return NvDlaSuccess; } + NvU32 multiBatchSize() const { return m_compileParams.m_multiBatchSize; } + + virtual NvDlaError setCanIMGPostChnlExtend(bool cipce) { m_compileParams.m_canIMGPostChnlExtend = cipce; return NvDlaSuccess; } + bool canIMGPostChnlExtend() const { return m_compileParams.m_canIMGPostChnlExtend; } + + virtual NvDlaError setComputePrecision(nvdla::DataType cp); + surface::SurfacePrecision computePrecision() const { return m_compileParams.m_computePrecision; } + + virtual NvDlaError setTensorScalingMode(nvdla::TensorScalingMode tsm); + nvdla::TensorScalingMode tensorScalingMode() const { return m_compileParams.m_tensorScalingMode; } + + virtual NvDlaError setQuantizationMode(nvdla::QuantizationMode qm); + nvdla::QuantizationMode quantizationMode() const { return m_compileParams.m_quantizationMode; } + + inline bool debug() const { return false; } + + virtual NvDlaError initGlobalParams(IGlobalParams* gp); + virtual NvDlaError initCompileParams(ICompileParams* cp); + virtual void initWithDefaultProfile(); + + struct GlobalParams + { + NvU32 m_NwInPixelOffX; + NvU32 m_NwInPixelOffY; + nvdla::DataFormat m_NwInDataFormat; // NCHW default + nvdla::DataFormat m_NwOutDataFormat; // NCHW default + surface::SurfaceFormat m_NwInSurfFormat; + surface::SurfaceFormat m_NwOutSurfFormat; + surface::PixelMapping m_NwInPixelMapping; + + GlobalParams() : + m_NwInPixelOffX(0), + m_NwInPixelOffY(0), + m_NwInDataFormat(nvdla::DataFormat::NCHW), + m_NwOutDataFormat(nvdla::DataFormat::NCHW), + m_NwInSurfFormat(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_FP16), + m_NwOutSurfFormat(surface::SurfaceFormatEnum::NVDLA_FEATURE_DATA_FP16), + m_NwInPixelMapping(surface::PixelMappingEnum::PITCH_LINEAR) + { } + }; + + struct CompileParams + { + bool m_canCompressWeights; + bool m_canWinograd; + NvU32 m_CONVWeightBanksAllotted; + NvU32 m_CONVDataBanksAllotted; + bool m_canSDPPDPOnFly; + bool m_canSDPMergeMathOps; + bool m_canSDPFuseSubEngineOps; + bool m_canSDPBustNOPs; + bool m_canSDPFuseVerticalOps; + bool m_useCVSRAMAllocate; + bool m_useMemPool; + bool m_useReusePooledMemory; + bool m_copyOutDebugSurfaces; + bool m_useGreedyEviction; + NvU64 m_globalDRAMSize; + NvU64 m_localDRAMSize; + NvU64 m_localCVSRAMSize; + NvU32 m_multiBatchSize; + bool m_canIMGPostChnlExtend; + surface::SurfacePrecision m_computePrecision; + nvdla::TensorScalingMode m_tensorScalingMode; + nvdla::QuantizationMode m_quantizationMode; + + CompileParams(): + m_canCompressWeights(false), + m_canWinograd(false), + m_CONVWeightBanksAllotted(8), + m_CONVDataBanksAllotted(8), + m_canSDPPDPOnFly(false), + m_canSDPMergeMathOps(false), + m_canSDPFuseSubEngineOps(false), + m_canSDPBustNOPs(false), + m_canSDPFuseVerticalOps(false), + m_useCVSRAMAllocate(false), + m_useMemPool(false), + m_useReusePooledMemory(false), + m_copyOutDebugSurfaces(false), + m_useGreedyEviction(false), + m_globalDRAMSize(1LLU << 29), + m_localDRAMSize(1LLU << 30), + m_localCVSRAMSize(1LLU << 20), + m_multiBatchSize(0), + m_canIMGPostChnlExtend(true), + m_computePrecision(surface::SurfacePrecisionEnum::NVDLA_PRECISION_FP16), + m_tensorScalingMode(nvdla::TensorScalingMode::NONE), + m_quantizationMode(nvdla::QuantizationMode::NONE) + { } + }; +protected: + std::string m_name; + std::map< std::string, ILoadable *> m_loadablesByName; + std::vector m_loadables; + + inline bool isBasicProfile() { return m_name == std::string("basic"); } + inline bool isDefaultProfile() { return m_name == std::string("default"); } + inline bool isPerformanceProfile() { return m_name == std::string("performance"); } + inline bool isFastMathProfile() { return m_name == std::string("fast-math"); } + + GlobalParams m_globalParams; + CompileParams m_compileParams; +}; + + +} // nvdla::priv + +} // nvdla + +#endif // NVDLA_PRIV_PROFILE_H diff --git a/umd/core/src/compiler/include/priv/Profiler.h b/umd/core/src/compiler/include/priv/Profiler.h new file mode 100644 index 00000000..5451275e --- /dev/null +++ b/umd/core/src/compiler/include/priv/Profiler.h @@ -0,0 +1,116 @@ +/* + * Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#ifndef NVDLA_PRIV_PROFILER_H +#define NVDLA_PRIV_PROFILER_H + + +#include +#include +#include +#include +#include + +#include "priv/Type.h" + +#include "nvdla/IProfiler.h" +#include "priv/Profile.h" +#include "priv/TargetConfig.h" +#include "priv/WisdomContainer.h" + + +namespace nvdla +{ + +namespace priv +{ + +class Profiler; + +class ProfilerFactory +{ +public: + typedef PrivPair ProfilerPrivPair; + + static ProfilerPrivPair newProfiler(); + static NvDlaError deleteProfiler(IProfiler *profiler); + + static Profiler *priv(IProfiler *); + static IProfiler *i(Profiler *); + static IProfiler *self(void *); + +protected: + static BiMap s_priv; + static BiMap s_self; + +}; + +class Profile; +class TargetConfig; +class TestPoint; + +class TestPointEvaluationResult +{ + +}; + + +class Profiler : public IProfiler +{ +public: // externally facing + + virtual IWisdom *wisdom(); + + virtual IProfile *createProfile(const char *profile_name); + virtual IProfile *getProfile(const char *profile_name); + virtual ITargetConfig *getTargetConfig(const char *target_config_name); + +public: // internally facing + + Profiler(); + virtual ~Profiler(); + + virtual NvU16 getFactoryType() const; + void setWisdom(Wisdom *w) { m_wisdom = w; } + + +protected: + friend class Wisdom; + friend class ProfilerFactory; + + Wisdom *m_wisdom; + + std::map m_profiles; + std::map m_targetConfigs; + +}; + +} // nvdla::priv +} // nvdla + +#endif // NVDLA_PRIV_PROFILER_H diff --git a/umd/core/src/compiler/include/priv/ResourceEnums.h b/umd/core/src/compiler/include/priv/ResourceEnums.h new file mode 100644 index 00000000..51af3bbc --- /dev/null +++ b/umd/core/src/compiler/include/priv/ResourceEnums.h @@ -0,0 +1,104 @@ +/* + * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#ifndef NVDLA_PRIV_RESOURCE_ENUMS_H +#define NVDLA_PRIV_RESOURCE_ENUMS_H + +// +// the category to which a tensor surface desc belongs: +// EXTERNAL: network i/p and network o/p +// GLOBAL: common tensors across images: weights/bias/etc +// LOCAL: temp tensors passed between engines 'through mem' +// STREAM: temp tensors passed between engines 'over the wire' +// +// used in dla-engine-ast's tensor surface desc context +// +#define TENSOR_CATEGORY_ENUMS(op) \ + op(UNKNOWN_TENSOR, 0U) \ + op(EXTERNAL_TENSOR, 1U) \ + op(GLOBAL_TENSOR, 2U) \ + op(LOCAL_TENSOR, 3U) \ + op(STREAM_TENSOR, 4U) + +// +// the type of data a memory buffer represents +// Types: +// - IMAGE_DATA: image input data +// - FEATURE_DATA: feature data +// - KERNEL_WEIGHTS: kernel weights +// - BIAS_WEIGHTS: bias weights +// +// used in the dla-engine-ast's mem mgmnt context +// +#define MEMORY_BUFFER_TYPE_ENUMS(op) \ + op(bIMAGE_DATA, 0U) \ + op(bFEATURE_DATA, 1U) \ + op(bKERNEL_WEIGHTS, 2U) \ + op(bBIAS_WEIGHTS, 3U) + +// +// the memory destination where a buffer resides +// Types: +// - DRAM: aka sysmem +// - CVSRAM: dla/pva shared fast local mem +// - CBUFF: convolution buffer +// - STREAM: stream/on-the-fly +// +// used in the dla-engine-ast context +// +#define MEMORY_LOCATION_ENUMS(op) \ + op(lUNKNOWN, 0U) \ + op(lDRAM, 1U) \ + op(lCVSRAM, 2U) \ + op(lCBUFF, 3U) \ + op(lSTREAM, 4U) + +// +// the type of resource-pool a RM manages that contains all buffers +// and their descriptors; along with the description of the various surfaces +// looking into different sections of those buffers. +// +// Types: +// - GLOBAL_DRAM_POOL: pool managing kernel/bias weight buffers in DRAM +// - LOCAL_DRAM_POOL: pool managing per task temporary data buffers in DRAM +// - LOCAL_CVSRAM_POOL: pool managing weights and feature data buffers in CV-SRAM +// +// !!! !!! +// !!! NOTE: we make use of the fact that global is := 0 !!! +// !!! and that the others form array indices to follow... !!! +// !!! !!! +// +// used in the dla-engine-ast context +// +#define POOL_TYPE_ENUMS(op) \ + op(GLOBAL_DRAM_POOL, 0U) \ + op(LOCAL_DRAM_POOL, 1U) \ + op(LOCAL_CVSRAM_POOL, 2U) + + +#endif /* NVDLA_PRIV_RESOURCE_ENUMS_H */ diff --git a/umd/core/src/compiler/include/priv/Setup.h b/umd/core/src/compiler/include/priv/Setup.h new file mode 100644 index 00000000..4cacbf10 --- /dev/null +++ b/umd/core/src/compiler/include/priv/Setup.h @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#ifndef NVDLA_PRIV_SETUP_H +#define NVDLA_PRIV_SETUP_H + + +#include +#include +#include +#include +#include + +#include "priv/Type.h" + +#include "nvdla/ISetup.h" + +#include "priv/WisdomContainer.h" + + +namespace nvdla +{ + +namespace priv +{ + +class Setup; + +class SetupFactory +{ +public: + typedef PrivPair SetupPrivPair; + + static SetupPrivPair newSetup(); + static NvDlaError deleteSetup(ISetup *setup); + + static Setup *priv(ISetup *); + static ISetup *i(Setup *); + +protected: + static BiMap s_priv; + +}; + +class Setup : public ISetup +{ +public: // externally facing + + virtual IWisdom *wisdom(); + +public: // internally facing + + Setup(); + + virtual NvU16 getFactoryType() const; + + // void setWisdom(Wisdom *w) { m_wisdom = w; } + + +protected: + friend class Wisdom; + friend class SetupFactory; + + Wisdom *m_wisdom; + + virtual ~Setup(); + +private: + + + +}; + +ISetup *createSetup(); +NvDlaError destroySetup(ISetup *setup); + +} // nvdla::priv + +} // nvdla + +#endif // NVDLA_PRIV_SETUP_H diff --git a/umd/core/src/compiler/include/priv/Surface.h b/umd/core/src/compiler/include/priv/Surface.h new file mode 100644 index 00000000..f4b61643 --- /dev/null +++ b/umd/core/src/compiler/include/priv/Surface.h @@ -0,0 +1,577 @@ +/* + * Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#ifndef NVDLA_PRIV_SURFACE_H +#define NVDLA_PRIV_SURFACE_H + +#include +#include +#include "priv/Type.h" + +#include "priv/Memory.h" + +#include "priv/SurfaceEnums.h" + +#include "ErrorMacros.h" + +#define GEN_SURFACE_STR(X, C, P, B, Ch, N) #X, +#define GEN_SURFACE_FORMAT(X, C, P, B, Ch, N) surface::Format(surface :: X, C, P, B, Ch), +#define GEN_SURFACE_ENUM(X, C, P, B, Ch, N) X = N, + +#define SURFACE_ENUM_STATIC_MEMBERS(S, U, E, Z) \ + template<> const char * const SurfaceEnum::s_c_strs[] = { E(GEN_SURFACE_STR) }; \ + template<> const surface::Format SurfaceEnum::s_surface_formats[] = { E(GEN_SURFACE_FORMAT) };\ + template<> const char * SurfaceEnum::s_c_str = Z; \ + template<> const size_t SurfaceEnum::s_num_elements = \ + sizeof(SurfaceEnum::s_c_strs) / sizeof(SurfaceEnum::s_c_strs[0]); + +namespace nvdla { namespace priv { namespace engine_ast { class Node; class Edge; } } } + +namespace nvdla +{ +namespace priv +{ + +template < typename EnumClass, typename UnderlyingType > +class SurfaceEnum; + +namespace surface +{ + +class TensorSurfaceDesc; + +enum SurfaceCategoryEnum { + SURFACE_CATEGORY_ENUMS(GEN_ENUM) +}; +typedef SequenceEnum SurfaceCategory; + +enum SurfacePrecisionEnum { + SURFACE_PRECISION_ENUMS(GEN_ENUM) +}; +typedef SequenceEnum SurfacePrecision; + +enum BiasDataCategoryEnum { + BIAS_DATA_CATEGORY_ENUMS(GEN_ENUM) +}; +typedef SequenceEnum BiasDataCategory; + +enum BatchNormDataCategoryEnum { + BATCH_NORM_DATA_CATEGORY_ENUMS(GEN_ENUM) +}; +typedef SequenceEnum BatchNormDataCategory; + +enum ScaleDataCategoryEnum { + SCALE_DATA_CATEGORY_ENUMS(GEN_ENUM) +}; +typedef SequenceEnum ScaleDataCategory; + +enum PixelMappingEnum { + PIXEL_MAPPING_ENUMS(GEN_ENUM) +}; +typedef SequenceEnum PixelMapping; + +enum SurfaceFormatEnum { + SURFACE_FORMAT_ENUMS(GEN_SURFACE_ENUM) +}; +typedef SurfaceEnum SurfaceFormat; + +struct PitchLinearSurfaceDesc +{ + static NvU32 lineStride(const TensorSurfaceDesc*); + static NvU32 lineUVStride(const TensorSurfaceDesc*); + static NvU64 size(const TensorSurfaceDesc*); +}; + +struct IMGDesc +{ + static PixelMapping pixelMapping(const TensorSurfaceDesc*); + static NvU32 lineStride(const TensorSurfaceDesc*); + static NvU32 surfaceStride(const TensorSurfaceDesc*); + static NvU64 size(const TensorSurfaceDesc*); +}; + +struct WeightDesc +{ + /* + * Weights for DC: {[RSKpCp]Cfg[RSKpCf]}Kfg{[RSKfCp]Cfg[RSKfCf]} + * Weights for WG: [CfgKpRSCf]Kfg[CfgKfRSCf] + * Weights for IMG: + * Weights for Deconvolution: + */ + + // are weights compressed + static bool iscompressed(const TensorSurfaceDesc*); + // full channels per group (For DC:-> =64 for int8; For WG:-> = 4) + static NvU32 fullChnlsPerGrp(const TensorSurfaceDesc*); + // full channel groups (total_channels / Cf) + static NvU32 fullChnlGroups(const TensorSurfaceDesc*); + // partial channels per group (total_channels % Cf - which is <64 for int8; or <32 for int16/fp16) + static NvU32 partialChnlsPerGrp(const TensorSurfaceDesc*); + // full kernels per group (=32 for int8; =16 for int16/fp16) + static NvU32 fullKrnlsPerGrp(const TensorSurfaceDesc*); + // full kernel groups (total_kernels / Kf) + static NvU32 fullKrnlGroups(const TensorSurfaceDesc*); + // partial kernels per group (total_kernels % Kf - which is <32 for int8; or <16 for int16/fp16) + static NvU32 partialKrnlsPerGrp(const TensorSurfaceDesc*); + + static NvU32 wgs(const TensorSurfaceDesc*); + static NvU32 wmb(const TensorSurfaceDesc*); + + static NvU64 size(const TensorSurfaceDesc*); + static NvU32 bytesPerKernel(const TensorSurfaceDesc*); + // get raw non-rounded weight tensor size + static NvU64 rawSize(const TensorSurfaceDesc*); +}; + +struct BiasDataDesc +{ + /* Bias Data could be any of the 3 types: + * per-Layer: 1 x 1 x 1 + * per-Channel: 1 x 1 x C + * per-Element: W x H x C + */ + static BiasDataCategory biasDataCategory(const TensorSurfaceDesc*); + static NvU32 channelsPerGroup(const TensorSurfaceDesc*); + static NvU32 lineStride(const TensorSurfaceDesc*); + static NvU32 surfaceStride(const TensorSurfaceDesc*); + static NvU64 size(const TensorSurfaceDesc*); +}; + +struct BatchNormDataDesc +{ + /* BatchNorm Data could be any of the 2 types: + * per-Layer: 1 x 1 x 1 + * per-Channel: 1 x 1 x C + */ + static BatchNormDataCategory batchNormDataCategory(const TensorSurfaceDesc*); + static NvU32 lineStride(const TensorSurfaceDesc*); + static NvU32 surfaceStride(const TensorSurfaceDesc*); + static NvU64 size(const TensorSurfaceDesc*); +}; + +struct ScaleDataDesc +{ + /* Scale Data could be any of the 3 types: + * per-Layer: 1 x 1 x 1 + * per-Channel: 1 x 1 x C + * per-Element: W x H x C + */ + static ScaleDataCategory scaleDataCategory(const TensorSurfaceDesc*); + static NvU32 lineStride(const TensorSurfaceDesc*); + static NvU32 surfaceStride(const TensorSurfaceDesc*); + static NvU64 size(const TensorSurfaceDesc*); +}; + +struct FeatureDataDesc +{ + /* Format: N_CHWC' */ + + // N (used during multi-batch mode) + static NvU32 numBatches(const TensorSurfaceDesc*); + // C (=ceil(total_channels/m_channels_per_group)) + static NvU32 channelGroups(const TensorSurfaceDesc*); + // C' (=16 for int16/fp16; =32 for int8) + static NvU32 channelsPerGroup(const TensorSurfaceDesc*); + static NvU32 height(const TensorSurfaceDesc*); + static NvU32 width(const TensorSurfaceDesc*); + static NvU32 lineStride(const TensorSurfaceDesc*); + static NvU32 surfaceStride(const TensorSurfaceDesc*); + static NvU64 size(const TensorSurfaceDesc*); +}; + +struct EltwiseDataDesc +{ + static NvU32 channelGroups(const TensorSurfaceDesc*); + static NvU32 channelsPerGroup(const TensorSurfaceDesc*); + static NvU32 lineStride(const TensorSurfaceDesc*); + static NvU32 surfaceStride(const TensorSurfaceDesc*); + static NvU64 size(const TensorSurfaceDesc*); +}; + +class Format +{ +public: + Format() : + m_enum(NVDLA_UNKNOWN_FORMAT), + mSurfCategory(SURFACE_CATEGORY_UNKNOWN), + mSurfPrecision(NVDLA_PRECISION_UNKNOWN), + mBytesPerElement(0), + mChannelsPerAtom(-1) + { } + Format(SurfaceFormatEnum en, SurfaceCategory sc, SurfacePrecision sp, NvU8 bpe, NvU8 cpa) : + m_enum(en), + mSurfCategory(sc), + mSurfPrecision(sp), + mBytesPerElement(bpe), + mChannelsPerAtom(cpa) + { } + Format(const Format &other) : + m_enum(other.m_enum), + mSurfCategory(other.mSurfCategory), + mSurfPrecision(other.mSurfPrecision), + mBytesPerElement(other.mBytesPerElement), + mChannelsPerAtom(other.mChannelsPerAtom) + { } + virtual ~Format() { } + + SurfaceFormatEnum formatEnum() const { return m_enum; } + + SurfaceCategory category() const { return mSurfCategory; } + SurfacePrecision precision() const { return mSurfPrecision; } + NvU8 bytesPerElement() const { return mBytesPerElement; } + NvS8 channelsPerAtom() const { return mChannelsPerAtom; } + +protected: + SurfaceFormatEnum m_enum; + SurfaceCategory mSurfCategory; // img/weight/bias_data/FD/M-planar + SurfacePrecision mSurfPrecision; // int8/int16/fp16 + NvU8 mBytesPerElement; // 1/2 + NvS8 mChannelsPerAtom; // channels/atom [channels/pixel for image; -1 for FD/wt/etc] +}; + +} // nvdla::priv::surface:: +} // nvdla::priv:: +} // nvdla:: + +namespace nvdla +{ +namespace priv +{ + +template < typename EnumClass, typename UnderlyingType = NvU8 > +class SurfaceEnum +{ +public: + typedef UnderlyingType underlying_type; + +protected: + underlying_type m_e; + static const char * const s_c_strs[]; // enum strings + static const surface::Format s_surface_formats[]; // array of type Format + + static const char * s_c_str; // class name string + static const size_t s_num_elements; + +public: + static const char * parameter_name_c_str() { return s_c_str; } + const char * c_str() const { return s_c_strs[m_e]; } + + underlying_type v() const { return m_e; } + EnumClass e() const { return EnumClass(m_e); } + surface::Format f() const { return surface::Format(s_surface_formats[m_e]); } + surface::SurfaceCategory category() const { return s_surface_formats[m_e].category(); } + surface::SurfacePrecision precision() const { return s_surface_formats[m_e].precision(); } + NvU8 bytesPerElement() const { return s_surface_formats[m_e].bytesPerElement(); } + NvS8 channelsPerAtom() const { return s_surface_formats[m_e].channelsPerAtom(); } + + static inline size_t num_elements() { return s_num_elements; } + + SurfaceEnum() : m_e( underlying_type(s_num_elements)) {/* note, invalid!*/ } + SurfaceEnum(EnumClass p) : m_e(p) { } + SurfaceEnum(underlying_type v) { + if (v > s_num_elements) { + v = s_num_elements; // FIXME: reverse? + // throw: out of range!?! (prefer) + // or require check on validity? + // or coerce to valid? + } + m_e = v; + } + bool operator() (const SurfaceEnum &n) { + return n.v() == m_e; + } + bool operator< (const SurfaceEnum &other) const { + return (m_e < other.v()); + } +}; + +} // nvdla::priv:: +} // nvdla:: + +namespace nvdla +{ +namespace priv +{ + +namespace surface +{ + +class IsSurfacePrecisionDifferent +{ +public: + + IsSurfacePrecisionDifferent(SurfacePrecision sp) : m_surf_prec(sp) { } + bool operator()(SurfaceFormat sf) + { + if (sf.f().precision().e() != m_surf_prec.e()) { + return true; + } + return false; + } + + bool operator()(SurfacePrecision sp) + { + if (sp.e() != m_surf_prec.e()) { + return true; + } + return false; + } + +protected: + SurfacePrecision m_surf_prec; +}; + +class TensorSurfaceDesc +{ +public: + class SurfaceDescState + { + public: + SurfaceDescState() : + m_addressId(-2), // (so if you see -2 you know something's wrong) + m_addressIdOffset(0), + m_offset_in_buffer(0) + { } + virtual ~SurfaceDescState() { } + + void setAddressId(NvS16 id) { m_addressId = id; } + NvS16 addressId() const { return m_addressId; } + + void setAddressIdOffset(NvU32 o) { m_addressIdOffset = o; } + NvU32 addressIdOffset() const { return m_addressIdOffset; } + + void setBufferOffset(NvU64 offset) { m_offset_in_buffer = offset; } + NvU64 bufferOffset() const { return m_offset_in_buffer; } + void resetBufferOffset() { m_offset_in_buffer = 0; } + + protected: + NvS16 m_addressId; + NvU32 m_addressIdOffset; + NvU64 m_offset_in_buffer; + }; + + TensorSurfaceDesc(NvU16 numBatches = 1) : + m_size(0), + m_line_stride(0), + m_surface_stride(0), + m_tensor_category(memory::TensorCategoryEnum::UNKNOWN_TENSOR), + m_data_format(nvdla::DataFormat::UNKNOWN), + m_surface_format(SurfaceFormatEnum::NVDLA_UNKNOWN_FORMAT), + m_buffer_desc(0), + m_copyOutDebugSurface(false), + m_content(false), + m_align_ls(false), + m_activeProducers(0), + m_activeConsumers(0), + m_bindId(-1), // non-bindable + m_bindDomain(IOD_Max), // n/a + m_edge(NULL) + { + m_mb_tsd_state = new MultiBatchState < SurfaceDescState >(numBatches); + }; + ~TensorSurfaceDesc(); + + /* for clone */ + TensorSurfaceDesc(const TensorSurfaceDesc& other) : + m_dims(other.m_dims), + m_size(other.m_size), + m_line_stride(other.m_line_stride), + m_surface_stride(other.m_surface_stride), + m_tensor_category(other.m_tensor_category), + m_data_format(other.m_data_format), + m_surface_format(other.m_surface_format), + m_buffer_desc(other.m_buffer_desc), + m_copyOutDebugSurface(other.m_copyOutDebugSurface), + m_content(other.m_content), + m_align_ls(other.m_align_ls), + m_activeProducers(other.m_activeProducers), + m_activeConsumers(other.m_activeConsumers), + m_bindId(other.m_bindId), + m_bindDomain(other.m_bindDomain), + m_edge(other.m_edge) + { + m_mb_tsd_state = other.m_mb_tsd_state; // Is this correct? + } + + static inline bool debugBinding() { return false; } + + void setName(const std::string name) { m_name = name; } + const std::string name() const { return m_name; } + + void setId(const std::string id) { m_id = id; } + const std::string id() const { return m_id; } + + void setDimensions(Dims4 dims) { m_dims = dims; } + Dims4 dimensions() const { return m_dims; } + + void setTensorCategory(memory::TensorCategory cat) { m_tensor_category = cat; } + memory::TensorCategory tensorCategory() const { return m_tensor_category; } + + void setTensorBufferDesc(memory::TensorBufferDesc* buff_desc) { m_buffer_desc = buff_desc; } + memory::TensorBufferDesc* tensorBufferDesc() const { return m_buffer_desc; } + + nvdla::DataFormat dataFormat() const { return m_data_format; } + void setDataFormat(nvdla::DataFormat dataFormat) { m_data_format = dataFormat; } + + SurfaceFormat surfaceFormat() const { return m_surface_format; } + void setSurfaceFormat(SurfaceFormat surfaceFormat) { m_surface_format = surfaceFormat; } + void resetSurfaceFormat() { m_surface_format = surface::SurfaceFormatEnum::NVDLA_UNKNOWN_FORMAT; } + + NvU64 size(); + NvU32 lineStride(); + NvU32 surfaceStride(); + NvU32 planeStride() const; + + void setSize(NvU64 size) { m_size = size; } + void resetSize() { m_size = 0; } + void setLineStride(NvU32 lineStride) { m_line_stride = lineStride; } + void resetLineStride() { m_line_stride = 0; } + void setSurfaceStride(NvU32 surfaceStride) { m_surface_stride = surfaceStride; } + void resetSurfaceStride() { m_surface_stride = 0; } + + bool copyOutDebugSurface() const { return m_copyOutDebugSurface; } + void setCopyOutDebugSurface(bool b) { m_copyOutDebugSurface = b; } + bool isSurfaceSymmetricTo(TensorSurfaceDesc* other); + + void addProducer(nvdla::priv::engine_ast::Node *prod) { m_producers.insert(prod); } + void removeProducer(nvdla::priv::engine_ast::Node *prod) { if (m_producers.find(prod) != m_producers.end()) m_producers.erase(prod); } + const std::unordered_set& producers() const { return m_producers; } + void clearProducers() { m_producers.clear(); } + + void addConsumer(nvdla::priv::engine_ast::Node * cons) { m_consumers.insert(cons); } + void removeConsumer(nvdla::priv::engine_ast::Node *cons) { if (m_consumers.find(cons) != m_consumers.end()) m_consumers.erase(cons); } + const std::unordered_set& consumers() const { return m_consumers; } + void clearConsumers() { m_consumers.clear(); } + + void setAddressId(NvS16 id, NvU16 batchId = 0) { m_mb_tsd_state->batch(batchId).setAddressId(id); } + NvS16 addressId(NvU16 batchId = 0) { return m_mb_tsd_state->batch(batchId).addressId(); } + + void setAddressIdOffset(NvU32 o, NvU16 batchId = 0) { m_mb_tsd_state->batch(batchId).setAddressIdOffset(o); } + NvU32 addressIdOffset(NvU16 batchId = 0) { return m_mb_tsd_state->batch(batchId).addressIdOffset(); } + + bool bindable() const + { + bool isBindable = m_bindId >= 0; + if ( debugBinding() ) + { + gLogInfo << "\t\t\t\t::Surface surface=" << id() + << ": bindable=" << isBindable << std::endl; + } + return isBindable; + } + NvS16 bindId() const + { + if ( debugBinding() ) + { + gLogInfo << "\t\t\t\t::Surface bindId(" << id() << ":" << m_bindId << std::endl; + } + return m_bindId; + } + + void setBindId(NvS16 bid, enum IOD bindDomain) + { + if ( debugBinding() ) + { + gLogInfo << "\t\t\t\t::Surface bindId(" << id() << ", " + << (int)bindDomain << ") -> " << bid << std::endl; + } + m_bindDomain = bindDomain; + m_bindId = bid; + } + NvS16 bindId(enum IOD &bindDomain) const + { + if ( debugBinding() ) + { + gLogInfo << "\t\t\t\t::Surface bindId(" << id() << ", " + << (int)m_bindDomain << ") -> " << m_bindId << std::endl; + } + bindDomain = m_bindDomain; + return m_bindId; + } + + // address comes from the buffer + offset into it + template T* address(NvU16 batchId = 0) const + { + return m_buffer_desc ? + ((T*) (m_buffer_desc->address(batchId) + bufferOffset(batchId))) : + 0; + } + + void setBufferOffset(NvU64 offset, NvU16 batchId = 0) + { + m_mb_tsd_state->batch(batchId).setBufferOffset(offset); + } + NvU64 bufferOffset(NvU16 batchId = 0) const { return m_mb_tsd_state->batch(batchId).bufferOffset(); } + void resetBufferOffset(NvU16 batchId = 0) { m_mb_tsd_state->batch(batchId).resetBufferOffset(); } + + // setcontent only happens for aux tensors, whose there's only 1 copy for all batches + void setContent(const void* data) { m_content = true; std::memcpy(address(/*batchId*/0), data, size()); } + bool content() const { return m_content; } + + void setAlignLineStride(bool enb) { m_align_ls = enb; } + bool alignLineStride() const { return m_align_ls; } + + bool referencedByEMU() const; + + nvdla::priv::engine_ast::Edge * parentEdge() const { return m_edge; } + void setParentEdge(nvdla::priv::engine_ast::Edge *edg) { m_edge = edg; } + +protected: + std::string m_name; + std::string m_id; + Dims4 m_dims; + NvU64 m_size; + NvU32 m_line_stride; + NvU32 m_surface_stride; + memory::TensorCategory m_tensor_category; // Global/Local/Stream + nvdla::DataFormat m_data_format; + SurfaceFormat m_surface_format; + memory::TensorBufferDesc* m_buffer_desc; + bool m_copyOutDebugSurface; + + std::unordered_set m_producers; // producers of this surface + std::unordered_set m_consumers; // consumers of this surface + + bool m_content; + bool m_align_ls; + size_t m_activeProducers; + size_t m_activeConsumers; + NvS16 m_bindId; + enum IOD m_bindDomain; + + // tsd state for each of the batches in multi-batch case + MultiBatchState < SurfaceDescState >* m_mb_tsd_state; + + nvdla::priv::engine_ast::Edge *m_edge; //associated edge +}; + +}; // nvdla::priv::surface:: +} // nvdla::priv:: +} // nvdla:: + +#endif // NVDLA_PRIV_SURFACE_H diff --git a/umd/core/src/compiler/include/priv/SurfaceEnums.h b/umd/core/src/compiler/include/priv/SurfaceEnums.h new file mode 100644 index 00000000..7d829575 --- /dev/null +++ b/umd/core/src/compiler/include/priv/SurfaceEnums.h @@ -0,0 +1,151 @@ +/* + * Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#ifndef NVDLA_PRIV_SURFACE_ENUMS_H +#define NVDLA_PRIV_SURFACE_ENUMS_H + +#define SURFACE_CATEGORY_ENUMS(op) \ + op(SURFACE_CATEGORY_UNKNOWN, 0U) \ + op(IMG, 1U) /* input pixel data */ \ + op(WEIGHT, 2U) /* Kernel weight data */ \ + op(FEATURE_DATA, 3U) /* N(C/X)HWC - dla specific feature data format */\ + op(M_PLANAR, 4U) /* NCHW - format to talk with other engines */ \ + op(BIAS_DATA, 5U) /* Bias Data */ \ + op(BATCH_NORM_DATA, 6U) /* Batch Norm Data */ \ + op(SCALE_DATA, 7U) /* Scale Data */ + /* other formats follow like mean data, PReLU data, etc */ + +#define SURFACE_PRECISION_ENUMS(op) \ + op(NVDLA_PRECISION_UNKNOWN, 0U) \ + op(NVDLA_PRECISION_INT8, 1U) \ + op(NVDLA_PRECISION_INT16, 2U) \ + op(NVDLA_PRECISION_FP16, 3U) \ + op(NVDLA_PRECISION_UINT8, 4U) \ + op(NVDLA_PRECISION_UINT16, 5U) \ + +#define BIAS_DATA_CATEGORY_ENUMS(op) \ + op(BIAS_DATA_CATEGORY_UNKNOWN, 0U) \ + op(PER_LAYER_BIAS_DATA, 1U) \ + op(PER_CHANNEL_BIAS_DATA, 2U) \ + op(PER_ELEMENT_BIAS_DATA, 3U) + +#define BATCH_NORM_DATA_CATEGORY_ENUMS(op) \ + op(BATCH_NORM_DATA_CATEGORY_UNKNOWN, 0U) \ + op(PER_LAYER_BATCH_NORM_DATA, 1U) \ + op(PER_CHANNEL_BATCH_NORM_DATA, 2U) + +#define SCALE_DATA_CATEGORY_ENUMS(op) \ + op(SCALE_DATA_CATEGORY_UNKNOWN, 0U) \ + op(PER_LAYER_SCALE_DATA, 1U) \ + op(PER_CHANNEL_SCALE_DATA, 2U) \ + op(PER_ELEMENT_SCALE_DATA, 3U) + +#define PIXEL_MAPPING_ENUMS(op) \ + op(PIXEL_MAPPING_UNKNOWN, 0U) \ + op(PITCH_LINEAR, 1U) + +/* Enum_Name : Surface_Category : Precision : Bytes-Per-Element : Channels-Per-Atom : Enum_Ordinal */ +#define SURFACE_FORMAT_ENUMS(op) \ + op(NVDLA_IMG_R8, surface::SurfaceCategoryEnum::IMG, surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8, 1, 1, 0U) \ + op(NVDLA_IMG_R10, surface::SurfaceCategoryEnum::IMG, surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16, 2, 1, 1U) \ + op(NVDLA_IMG_R12, surface::SurfaceCategoryEnum::IMG, surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16, 2, 1, 2U) \ + op(NVDLA_IMG_R16, surface::SurfaceCategoryEnum::IMG, surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16, 2, 1, 3U) \ + op(NVDLA_IMG_R16_I, surface::SurfaceCategoryEnum::IMG, surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16, 2, 1, 4U) \ + op(NVDLA_IMG_R16_F, surface::SurfaceCategoryEnum::IMG, surface::SurfacePrecisionEnum::NVDLA_PRECISION_FP16, 2, 1, 5U) \ + op(NVDLA_IMG_A16B16G16R16, surface::SurfaceCategoryEnum::IMG, surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16, 2, 4, 6U) \ + op(NVDLA_IMG_X16B16G16R16, surface::SurfaceCategoryEnum::IMG, surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16, 2, 4, 7U) \ + op(NVDLA_IMG_A16B16G16R16_F, surface::SurfaceCategoryEnum::IMG, surface::SurfacePrecisionEnum::NVDLA_PRECISION_FP16, 2, 4, 8U) \ + op(NVDLA_IMG_A16Y16U16V16, surface::SurfaceCategoryEnum::IMG, surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16, 2, 4, 9U) \ + op(NVDLA_IMG_V16U16Y16A16, surface::SurfaceCategoryEnum::IMG, surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16, 2, 4, 10U) \ + op(NVDLA_IMG_A16Y16U16V16_F, surface::SurfaceCategoryEnum::IMG, surface::SurfacePrecisionEnum::NVDLA_PRECISION_FP16, 2, 4, 11U) \ + op(NVDLA_IMG_A8B8G8R8, surface::SurfaceCategoryEnum::IMG, surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8, 1, 4, 12U) \ + op(NVDLA_IMG_A8R8G8B8, surface::SurfaceCategoryEnum::IMG, surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8, 1, 4, 13U) \ + op(NVDLA_IMG_B8G8R8A8, surface::SurfaceCategoryEnum::IMG, surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8, 1, 4, 14U) \ + op(NVDLA_IMG_R8G8B8A8, surface::SurfaceCategoryEnum::IMG, surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8, 1, 4, 15U) \ + op(NVDLA_IMG_X8B8G8R8, surface::SurfaceCategoryEnum::IMG, surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8, 1, 4, 16U) \ + op(NVDLA_IMG_X8R8G8B8, surface::SurfaceCategoryEnum::IMG, surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8, 1, 4, 17U) \ + op(NVDLA_IMG_B8G8R8X8, surface::SurfaceCategoryEnum::IMG, surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8, 1, 4, 18U) \ + op(NVDLA_IMG_R8G8B8X8, surface::SurfaceCategoryEnum::IMG, surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8, 1, 4, 19U) \ + op(NVDLA_IMG_A2B10G10R10, surface::SurfaceCategoryEnum::IMG, surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16, 2, 4, 20U) \ + op(NVDLA_IMG_A2R10G10B10, surface::SurfaceCategoryEnum::IMG, surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16, 2, 4, 21U) \ + op(NVDLA_IMG_B10G10R10A2, surface::SurfaceCategoryEnum::IMG, surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16, 2, 4, 22U) \ + op(NVDLA_IMG_R10G10B10A2, surface::SurfaceCategoryEnum::IMG, surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16, 2, 4, 23U) \ + op(NVDLA_IMG_A2Y10U10V10, surface::SurfaceCategoryEnum::IMG, surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16, 2, 4, 24U) \ + op(NVDLA_IMG_V10U10Y10A2, surface::SurfaceCategoryEnum::IMG, surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16, 2, 4, 25U) \ + op(NVDLA_IMG_A8Y8U8V8, surface::SurfaceCategoryEnum::IMG, surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8, 1, 4, 26U) \ + op(NVDLA_IMG_V8U8Y8A8, surface::SurfaceCategoryEnum::IMG, surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8, 1, 4, 27U) \ + op(NVDLA_IMG_Y8___U8V8_N444, surface::SurfaceCategoryEnum::IMG, surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8, 1, 3, 28U) \ + op(NVDLA_IMG_Y8___V8U8_N444, surface::SurfaceCategoryEnum::IMG, surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8, 1, 3, 29U) \ + op(NVDLA_IMG_Y10___U10V10_N444, surface::SurfaceCategoryEnum::IMG, surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16, 2, 3, 30U) \ + op(NVDLA_IMG_Y10___V10U10_N444, surface::SurfaceCategoryEnum::IMG, surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16, 2, 3, 31U) \ + op(NVDLA_IMG_Y12___U12V12_N444, surface::SurfaceCategoryEnum::IMG, surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16, 2, 3, 32U) \ + op(NVDLA_IMG_Y12___V12U12_N444, surface::SurfaceCategoryEnum::IMG, surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16, 2, 3, 33U) \ + op(NVDLA_IMG_Y16___U16V16_N444, surface::SurfaceCategoryEnum::IMG, surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16, 2, 3, 34U) \ + op(NVDLA_IMG_Y16___V16U16_N444, surface::SurfaceCategoryEnum::IMG, surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16, 2, 3, 35U) \ + op(NVDLA_WEIGHT_DC_INT8, surface::SurfaceCategoryEnum::WEIGHT, surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8, 1, -1, 36U) \ + op(NVDLA_WEIGHT_DC_INT8_COMPRESSED, surface::SurfaceCategoryEnum::WEIGHT, surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8, 1, -1, 37U) \ + op(NVDLA_WEIGHT_WG_INT8, surface::SurfaceCategoryEnum::WEIGHT, surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8, 1, -1, 38U) \ + op(NVDLA_WEIGHT_WG_INT8_COMPRESSED, surface::SurfaceCategoryEnum::WEIGHT, surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8, 1, -1, 39U) \ + op(NVDLA_WEIGHT_IMG_INT8, surface::SurfaceCategoryEnum::WEIGHT, surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8, 1, -1, 40U) \ + op(NVDLA_WEIGHT_IMG_INT8_COMPRESSED, surface::SurfaceCategoryEnum::WEIGHT, surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8, 1, -1, 41U) \ + op(NVDLA_WEIGHT_DECONV_INT8, surface::SurfaceCategoryEnum::WEIGHT, surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8, 1, -1, 42U) \ + op(NVDLA_WEIGHT_DECONV_INT8_COMPRESSED, surface::SurfaceCategoryEnum::WEIGHT, surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8, 1, -1, 43U) \ + op(NVDLA_WEIGHT_DC_INT16, surface::SurfaceCategoryEnum::WEIGHT, surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16, 2, -1, 44U) \ + op(NVDLA_WEIGHT_DC_INT16_COMPRESSED, surface::SurfaceCategoryEnum::WEIGHT, surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16, 2, -1, 45U) \ + op(NVDLA_WEIGHT_WG_INT16, surface::SurfaceCategoryEnum::WEIGHT, surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16, 2, -1, 46U) \ + op(NVDLA_WEIGHT_WG_INT16_COMPRESSED, surface::SurfaceCategoryEnum::WEIGHT, surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16, 2, -1, 47U) \ + op(NVDLA_WEIGHT_IMG_INT16, surface::SurfaceCategoryEnum::WEIGHT, surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16, 2, -1, 48U) \ + op(NVDLA_WEIGHT_IMG_INT16_COMPRESSED, surface::SurfaceCategoryEnum::WEIGHT, surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16, 2, -1, 49U) \ + op(NVDLA_WEIGHT_DECONV_INT16, surface::SurfaceCategoryEnum::WEIGHT, surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16, 2, -1, 50U) \ + op(NVDLA_WEIGHT_DECONV_INT16_COMPRESSED,surface::SurfaceCategoryEnum::WEIGHT, surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16, 2, -1, 51U) \ + op(NVDLA_WEIGHT_DC_FP16, surface::SurfaceCategoryEnum::WEIGHT, surface::SurfacePrecisionEnum::NVDLA_PRECISION_FP16, 2, -1, 52U) \ + op(NVDLA_WEIGHT_DC_FP16_COMPRESSED, surface::SurfaceCategoryEnum::WEIGHT, surface::SurfacePrecisionEnum::NVDLA_PRECISION_FP16, 2, -1, 53U) \ + op(NVDLA_WEIGHT_WG_FP16, surface::SurfaceCategoryEnum::WEIGHT, surface::SurfacePrecisionEnum::NVDLA_PRECISION_FP16, 2, -1, 54U) \ + op(NVDLA_WEIGHT_WG_FP16_COMPRESSED, surface::SurfaceCategoryEnum::WEIGHT, surface::SurfacePrecisionEnum::NVDLA_PRECISION_FP16, 2, -1, 55U) \ + op(NVDLA_WEIGHT_IMG_FP16, surface::SurfaceCategoryEnum::WEIGHT, surface::SurfacePrecisionEnum::NVDLA_PRECISION_FP16, 2, -1, 56U) \ + op(NVDLA_WEIGHT_IMG_FP16_COMPRESSED, surface::SurfaceCategoryEnum::WEIGHT, surface::SurfacePrecisionEnum::NVDLA_PRECISION_FP16, 2, -1, 57U) \ + op(NVDLA_WEIGHT_DECONV_FP16, surface::SurfaceCategoryEnum::WEIGHT, surface::SurfacePrecisionEnum::NVDLA_PRECISION_FP16, 2, -1, 58U) \ + op(NVDLA_WEIGHT_DECONV_FP16_COMPRESSED, surface::SurfaceCategoryEnum::WEIGHT, surface::SurfacePrecisionEnum::NVDLA_PRECISION_FP16, 2, -1, 59U) \ + op(NVDLA_BIAS_DATA_INT8, surface::SurfaceCategoryEnum::BIAS_DATA, surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8, 1, -1, 60U) \ + op(NVDLA_BIAS_DATA_INT16, surface::SurfaceCategoryEnum::BIAS_DATA, surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16, 2, -1, 61U) \ + op(NVDLA_BIAS_DATA_FP16, surface::SurfaceCategoryEnum::BIAS_DATA, surface::SurfacePrecisionEnum::NVDLA_PRECISION_FP16, 2, -1, 62U) \ + op(NVDLA_FEATURE_DATA_INT8, surface::SurfaceCategoryEnum::FEATURE_DATA, surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8, 1, -1, 63U) \ + op(NVDLA_FEATURE_DATA_INT16, surface::SurfaceCategoryEnum::FEATURE_DATA, surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16, 2, -1, 64U) \ + op(NVDLA_FEATURE_DATA_FP16, surface::SurfaceCategoryEnum::FEATURE_DATA, surface::SurfacePrecisionEnum::NVDLA_PRECISION_FP16, 2, -1, 65U) \ + op(NVDLA_M_PLANAR_INT8, surface::SurfaceCategoryEnum::M_PLANAR, surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8, 1, -1, 66U) \ + op(NVDLA_M_PLANAR_INT16, surface::SurfaceCategoryEnum::M_PLANAR, surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16, 2, -1, 67U) \ + op(NVDLA_M_PLANAR_FP16, surface::SurfaceCategoryEnum::M_PLANAR, surface::SurfacePrecisionEnum::NVDLA_PRECISION_FP16, 2, -1, 68U) \ + op(NVDLA_BATCH_NORM_DATA_INT8, surface::SurfaceCategoryEnum::BATCH_NORM_DATA, surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8, 1, -1, 69U) \ + op(NVDLA_BATCH_NORM_DATA_INT16, surface::SurfaceCategoryEnum::BATCH_NORM_DATA, surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16, 2, -1, 70U) \ + op(NVDLA_BATCH_NORM_DATA_FP16, surface::SurfaceCategoryEnum::BATCH_NORM_DATA, surface::SurfacePrecisionEnum::NVDLA_PRECISION_FP16, 2, -1, 71U) \ + op(NVDLA_SCALE_DATA_INT8, surface::SurfaceCategoryEnum::SCALE_DATA, surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8, 1, -1, 72U) \ + op(NVDLA_SCALE_DATA_INT16, surface::SurfaceCategoryEnum::SCALE_DATA, surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16, 2, -1, 73U) \ + op(NVDLA_SCALE_DATA_FP16, surface::SurfaceCategoryEnum::SCALE_DATA, surface::SurfacePrecisionEnum::NVDLA_PRECISION_FP16, 2, -1, 74U) \ + op(NVDLA_UNKNOWN_FORMAT, surface::SurfaceCategoryEnum::SURFACE_CATEGORY_UNKNOWN, surface::SurfacePrecisionEnum::NVDLA_PRECISION_UNKNOWN, 0, -1, 75U) + +#endif diff --git a/umd/core/src/compiler/include/priv/TargetConfig.h b/umd/core/src/compiler/include/priv/TargetConfig.h new file mode 100644 index 00000000..e349b4ba --- /dev/null +++ b/umd/core/src/compiler/include/priv/TargetConfig.h @@ -0,0 +1,156 @@ +/* + * Copyright (c) 2018-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#ifndef NVDLA_PRIV_TARGETCONFIG_H +#define NVDLA_PRIV_TARGETCONFIG_H + +#include +#include + +#include "nvdla/ITargetConfig.h" + +#include "priv/Surface.h" +#include "priv/Type.h" +#include "priv/Surface.h" + + +namespace nvdla +{ + +namespace priv +{ + +class WisdomContainerEntry; + +class TargetConfig; + +class TargetConfigFactory +{ +public: + typedef PrivPair TargetConfigPrivPair; + static TargetConfigPrivPair newTargetConfig(); + static TargetConfig *priv(ITargetConfig *); + static ITargetConfig *i(TargetConfig *); + static ITargetConfig *self(void *); + +protected: + static BiMap s_priv; + static BiMap s_self; +}; + +class TargetConfig : public ITargetConfig +{ +public: // externally facing + TargetConfig() { } + virtual ~TargetConfig() { } + + virtual const char* getName() const; + +public: + virtual void setName(const char *); + + NvU32 atomicCSize() const { return m_targetConfigParams.m_atomicCSize; } + NvU32 atomicKSize() const { return m_targetConfigParams.m_atomicKSize; } + NvU32 memoryAtomicSize() const { return m_targetConfigParams.m_memoryAtomicSize; } + NvU32 bufBankAllotted() const { return m_targetConfigParams.m_numConvBufBankAllotted; } + NvU32 bufEntriesPerBank() const { return m_targetConfigParams.m_numConvBufEntriesPerBank; } + NvU32 bufEntryWidth() const { return m_targetConfigParams.m_numConvBufEntryWidth; } + NvU32 maxBatchSize() const { return m_targetConfigParams.m_maxBatchSize; } + + bool isWinogradCapable() const { return m_targetConfigParams.m_isWinogradCapable; } + bool isCompressWeightsCapable() const { return m_targetConfigParams.m_isCompressWeightsCapable; } + bool isBatchModeCapable() const { return m_targetConfigParams.m_isBatchModeCapable; } + bool isPDPCapable() const { return m_targetConfigParams.m_isPDPCapable; } + bool isCDPCapable() const { return m_targetConfigParams.m_isCDPCapable; } + bool isSDPBiasCapable() const { return m_targetConfigParams.m_isSDPBiasCapable; } + bool isSDPBatchNormCapable() const { return m_targetConfigParams.m_isSDPBatchNormCapable; } + bool isSDPEltWiseCapable() const { return m_targetConfigParams.m_isSDPEltWiseCapable; } + bool isSDPLutCapable() const { return m_targetConfigParams.m_isSDPLutCapable; } + bool isBDMACapable() const { return m_targetConfigParams.m_isBDMACapable; } + bool isRubikCapable() const { return m_targetConfigParams.m_isRubikCapable; } + + virtual NvDlaError initTargetConfigParams(ITargetConfigParams* cp); + + struct TargetConfigParams + { + NvU32 m_atomicCSize; + NvU32 m_atomicKSize; + NvU32 m_memoryAtomicSize; + NvU32 m_numConvBufBankAllotted; + NvU32 m_numConvBufEntriesPerBank; + NvU32 m_numConvBufEntryWidth; + NvU32 m_maxBatchSize; + bool m_isWinogradCapable; + bool m_isCompressWeightsCapable; + bool m_isBatchModeCapable; + bool m_isPDPCapable; + bool m_isCDPCapable; + bool m_isSDPBiasCapable; + bool m_isSDPBatchNormCapable; + bool m_isSDPEltWiseCapable; + bool m_isSDPLutCapable; + bool m_isBDMACapable; + bool m_isRubikCapable; + + TargetConfigParams(): + m_atomicCSize(64), + m_atomicKSize(32), + m_memoryAtomicSize(32), + m_numConvBufBankAllotted(16), + m_numConvBufEntriesPerBank(256), + m_numConvBufEntryWidth(128), + m_maxBatchSize(32), + m_isWinogradCapable(false), + m_isCompressWeightsCapable(false), + m_isBatchModeCapable(false), + m_isPDPCapable(false), + m_isCDPCapable(false), + m_isSDPBiasCapable(false), + m_isSDPBatchNormCapable(false), + m_isSDPEltWiseCapable(false), + m_isSDPLutCapable(false), + m_isBDMACapable(false), + m_isRubikCapable(false) + { } + }; + + inline bool isFullConfig() { return m_instance_name == std::string("nv_full"); } + inline bool isLargeConfig() { return m_instance_name == std::string("nv_large"); } + inline bool isSmallConfig() { return m_instance_name == std::string("nv_small"); } + +protected: + std::string m_instance_name; + TargetConfigParams m_targetConfigParams; +}; + + +} // nvdla::priv + +} // nvdla + +#endif // NVDLA_PRIV_CONFIG_H diff --git a/umd/core/src/compiler/include/priv/Tensor.h b/umd/core/src/compiler/include/priv/Tensor.h new file mode 100644 index 00000000..f3b7ae9b --- /dev/null +++ b/umd/core/src/compiler/include/priv/Tensor.h @@ -0,0 +1,160 @@ +/* + * Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#ifndef NVDLA_PRIV_TENSOR_H +#define NVDLA_PRIV_TENSOR_H + +#include + +#include "nvdla/INetwork.h" +#include "nvdla/ITensor.h" +#include "priv/Network.h" +#include "priv/Type.h" + +#define MAX_TENSOR_SIZE (1<<30) + + +namespace nvdla +{ + +namespace priv +{ + +class WisdomContainerEntry; + +class Tensor; + +class TensorFactory +{ +public: + typedef PrivPair TensorPrivPair; + + static TensorPrivPair newTensor(); + + static Tensor *priv(ITensor *); + static ITensor *i(Tensor *); + static ITensor *self(void *); + + static ITensor *deserializeFrom(WisdomContainerEntry *); + +protected: + static BiMap s_priv; + static BiMap s_self; + static ITensor *deserializeTensor(WisdomContainerEntry *); +}; + +class Tensor : public ITensor +{ +public: // externally facing + Tensor(INetwork * network, const std::string name); + virtual ~Tensor(); + + virtual NvU16 getFactoryType() const; + + virtual const char* getName() const; + virtual void setName(const char* n); + + virtual Dims4 getDimensions() const; + virtual void setDimensions(Dims4 dimensions); + + virtual bool isNetworkInput() const; + virtual bool isNetworkOutput() const; + + virtual DataFormat getDataFormat() const; + virtual void setDataFormat(DataFormat); + + virtual DataType getDataType() const; + virtual void setDataType(DataType); + + TensorType getTensorType() const; + void setTensorType(TensorType); + + virtual INetwork *getNetwork() const; + + virtual Tensor *clone() { return new Tensor(*this); } + + virtual NvDlaError setChannelDynamicRange(NvS32 chnlIndx, NvF32 min, NvF32 max); + virtual NvDlaError setChannelOffset(NvS32 chnlIndx, NvF32 offset); + + const std::vector& getChannelScales() const { return mChnlScales; } + void setChannelScales(std::vector chnlScales) { mChnlScales = chnlScales; } + + const std::vector& getChannelOffsets() const { return mChnlOffsets; } + void setChannelOffsets(std::vector chnlOffsets) { mChnlOffsets = chnlOffsets; } + + +#if 0 + virtual ILayer *getProducerLayer() const; + virtual int getNumConsumerLayers() const; + virtual ILayer *getConsumerLayer(int index) const; +#endif + + +public: // internally facing + Tensor() : + mDimensions({0,0,0,0}), + mNetwork(NULL), + mName(""), + mDataFormat(DataFormat::UNKNOWN), + mDataType(DataType::UNKNOWN), + mTensorType(TensorType::kUNKNOWN) + { }; + + void setNetwork(INetwork *network); + // void setName(const std::string name); + Tensor(const Tensor& other) : + mDimensions(other.mDimensions), + mNetwork(other.mNetwork), + mName(other.mName), + mDataFormat(other.mDataFormat), + mDataType(other.mDataType), + mTensorType(other.mTensorType), + mChnlScales(other.mChnlScales), + mChnlOffsets(other.mChnlOffsets) + { }; + + virtual bool serializeTo(WisdomContainerEntry *) const; + virtual bool deserializeFrom(WisdomContainerEntry *); + +protected: + Dims4 mDimensions; + INetwork* mNetwork; + std::string mName; // the user name if the user provided one, else + DataFormat mDataFormat; + DataType mDataType; + TensorType mTensorType; // the type of surface this tensor represents: image/i-o/kernel/bias + std::vector mChnlScales; // per-channel scaling factors + std::vector mChnlOffsets; // per-channel offsets +}; + + +} // nvdla::priv + +} // nvdla + +#endif // NVDLA_PRIV_TENSOR_H diff --git a/umd/core/src/compiler/include/priv/TestPointParameter.h b/umd/core/src/compiler/include/priv/TestPointParameter.h new file mode 100644 index 00000000..15f3fcac --- /dev/null +++ b/umd/core/src/compiler/include/priv/TestPointParameter.h @@ -0,0 +1,279 @@ +/* + * Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#ifndef NVDLA_PRIV_TEST_POINT_PARAMETER_H +#define NVDLA_PRIV_TEST_POINT_PARAMETER_H + + +#include + +#include "dlatypes.h" + + +#define GEN_ENUM(X, N) X = N, +#define GEN_STR(X, N) #X, + +#include "priv/TestPointParameterEnum.h" + +namespace nvdla +{ +namespace priv +{ + +// +// A "setting" is a specific value as applied to a given "parameter". + +// +// Wrapper class to represent parameters made up of enumerations. +// Here the enumerations are required to be unsigned contiguous +// sequences beginning at 0. E.g. 0, 1, 2... not flags (0, 1, 2, 4) +// or booleans (flags) +// +template +class TestPointEnumParameter +{ +public: + typedef UnderlyingType underlying_type; + +protected: + underlying_type m_e; + TestPointEnumParameter(underlying_type v) : m_e(v) { } + + static const char * s_c_str; // class name str + static const char * const s_c_strs[]; // class enum strs + static const size_t s_num_elements; + +public: + static const char * parameter_name_c_str() { return s_c_str; } + const char *c_str() { return s_c_strs[ m_e ]; } + + underlying_type v() { return m_e; } + EnumClass e() { return EnumClass(m_e); } + bool valid() { return m_e < s_num_elements; } + + TestPointEnumParameter(EnumClass p) : m_e(p) { } +}; + +class BatchMode { +public: + enum Enum { + BATCH_MODE_ENUMS(GEN_ENUM) + }; +}; +typedef TestPointEnumParameter BatchModeParameter; + +class CVSRamSize { +public: + enum Enum { + CVSRAM_SIZE_ENUMS(GEN_ENUM) + }; +}; +typedef TestPointEnumParameter CVSRamSizeParameter; + +class HWLayerTuning { +public: + enum Enum { + HW_LAYER_TUNING_ENUMS(GEN_ENUM) + }; +}; + +class MappingWeights { +public: + enum Enum { + MAPPING_WEIGHTS_ENUMS(GEN_ENUM) + }; +}; + +class Padding { +public: + enum Enum { + PADDING_ENUMS(GEN_ENUM) + }; +}; + +class OutputSequence { +public: + enum Enum { + OUTPUT_SEQUENCE_ENUMS(GEN_ENUM) + }; +}; + +class Dilation { +public: + enum Enum { + DILATION_ENUMS(GEN_ENUM) + }; +}; + +class WeightDensity { +public: + enum Enum { + WEIGHT_DENSITY_ENUMS(GEN_ENUM) + }; +}; + +class FeatureDensity { +public: + enum Enum { + FEATURE_DENSITY_ENUMS(GEN_ENUM) + }; +}; + +class ChannelExtension { +public: + enum Enum { + CHANNEL_EXTENSION_ENUMS(GEN_ENUM) + }; +}; + +class ConvMACRedundancy { +public: + enum Enum { + CONV_MAC_REDUNDANCY_ENUMS(GEN_ENUM) + }; +}; + + +class ConvBufBankMgmt { +public: + enum Enum { + CONV_BUF_BANK_MGMT_ENUMS(GEN_ENUM) + }; +}; + +class PDPOpMode { +public: + enum Enum { + PDP_OP_MODE_ENUMS(GEN_ENUM) + }; +}; + +class OffFlyingOpMode { +public: + enum Enum { + OFF_FLYING_OP_MODE_ENUMS(GEN_ENUM) + }; +}; + +class SDPOpMode { +public: + enum Enum { + SDP_OP_MODE_ENUMS(GEN_ENUM) + }; +}; + +class AXIFSched { +public: + enum Enum { + AXIF_SCHED_ENUMS(GEN_ENUM) + }; +}; + +class PixelDataFormat { +public: + enum Enum { + PIXEL_DATA_FORMAT_ENUMS(GEN_ENUM) + }; +}; + +class NetworkForks { +public: + enum Enum { + NETWORK_FORKS_ENUMS(GEN_ENUM) + }; +}; + + +typedef TestPointEnumParameter HWLayerTuningParameter; +typedef TestPointEnumParameter MappingWeightsParameter; +typedef TestPointEnumParameter PaddingParameter; +typedef TestPointEnumParameter OutputSequenceParameter; +typedef TestPointEnumParameter DilationParameter; +typedef TestPointEnumParameter WeightDensityParameter; +typedef TestPointEnumParameter FeatureDensityParameter; +typedef TestPointEnumParameter ChannelExtensionParameter; +typedef TestPointEnumParameter ConvMACRedundancyParameter; +typedef TestPointEnumParameter ConvBufBankMgmtParameter; +typedef TestPointEnumParameter PDPOpModeParameter; +typedef TestPointEnumParameter OffFlyingOpModeParameter; +typedef TestPointEnumParameter SDPOpModeParameter; +typedef TestPointEnumParameter AXIFSchedParameter; +typedef TestPointEnumParameter PixelDataFormatParameter; +typedef TestPointEnumParameter NetworkForksParameter; + +// global (system) parameters/constraints +// e.g.: +// dla0 - use cvsram +// dla1 - no cvsram +// + +class GlobalParameters { +public: + CVSRamSizeParameter m_cvsram_size[2]; + + // ... +}; + +// these show up in the description of the network somewhere +class LayerSettings { // i.e. move these to the network layer? +public: + // PaddingParameter m_padding; + DilationParameter m_dilation; + PixelDataFormatParameter m_pixel_data_format; +}; + +class LocalParameters { +public: + BatchModeParameter m_batch_mode; + PaddingParameter m_padding; // packed vs. padded stride or alignment choices instead? + CVSRamSizeParameter m_cvsram_size; // discrete set of choices + ChannelExtensionParameter m_channel_extension; + HWLayerTuningParameter m_hw_layer_tuning; + MappingWeightsParameter m_mapping_weights; + OutputSequenceParameter m_output_sequence; + WeightDensityParameter m_weight_density; + FeatureDensityParameter m_feature_density; + ConvMACRedundancyParameter m_conv_mac_redundancy; + ConvBufBankMgmtParameter m_conv_buf_bank_mgmt; + PDPOpModeParameter m_pdp_op_mode; + OffFlyingOpModeParameter m_off_flying_op_mode; + SDPOpModeParameter m_sdp_op_mode; + AXIFSchedParameter m_axif_sched; + NetworkForksParameter m_network_forks; +}; + + + + + +} // nvdla::priv +} // nvdla + + + +#endif // NVDLA_PRIV_TEST_POINT_PARAMETER_H diff --git a/umd/core/src/compiler/include/priv/TestPointParameterEnum.h b/umd/core/src/compiler/include/priv/TestPointParameterEnum.h new file mode 100644 index 00000000..41ff20f5 --- /dev/null +++ b/umd/core/src/compiler/include/priv/TestPointParameterEnum.h @@ -0,0 +1,126 @@ +/* + * Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#ifndef NVDLA_PRIV_TEST_POINT_PARAMETER_ENUM_H +#define NVDLA_PRIV_TEST_POINT_PARAMETER_ENUM_H + +// These show up here instead of "next to" the enum class wrapper +// because the MISRA rules disallow defining macros at anything other +// than global scope. And, the enum class wrappers are being used + +// for class BatchModeParameter::SERIAL, ... +#define BATCH_MODE_ENUMS(op) \ + op(SERIAL, 0U) \ + op(MULTI, 1U) + +// for class CVSRamSizeParameter::ZERO_MB, ... +#define CVSRAM_SIZE_ENUMS(op) \ + op(ZERO_MB, 0U) \ + op(TWO_MB, 1U) \ + op(FOUR_MB, 2U) + +// for class HWLayerTuningParameter::DC, ... +#define HW_LAYER_TUNING_ENUMS(op) \ + op(DC, 0U) \ + op(WINOGRAD, 1U) + +// for class MappingWeightsParameter::COMPRESSED, ... +#define MAPPING_WEIGHTS_ENUMS(op) \ + op(COMPRESSED, 0U) \ + op(UNCOMPRESSED, 1U) + +// for class PaddingParameter::NO_PADDING, ... +#define PADDING_ENUMS(op) \ + op(NO_PADDING, 0U) \ + op(PADDED, 1U) + +// for class OutputSequenceParameter::PARTIAL_HEIGHT, ... +#define OUTPUT_SEQUENCE_ENUMS(op) \ + op(PARTIAL_HEIGHT, 0U) \ + op(PARTIAL_HEIGHT_LAST, 1U) + +// for class DilationParameter::DISABLED, ... +#define DILATION_ENUMS(op) \ + op(DISABLED, 0U) \ + op(ENABLED, 1U) + +// for class WeightDensityParameter::FULL, ... +#define WEIGHT_DENSITY_ENUMS(op) \ + op(FULL, 0U) \ + op(PARTIAL, 1U) + +// for class FeatureDensityParameter::FULL, ... +#define FEATURE_DENSITY_ENUMS(op) \ + op(FULL, 0U) \ + op(PARTIAL, 1U) + +// for class ChannelExtensionParameter::DISABLED, ... +#define CHANNEL_EXTENSION_ENUMS(op) \ + op(DISABLED, 0U) \ + op(ENABLED, 1U) + +// for class ConvMACRedundancyParameter::DISABLED, ... +#define CONV_MAC_REDUNDANCY_ENUMS(op) \ + op(DISABLED, 0U) \ + op(ENABLED, 1U) + +// for class ConvBufBankMgmtParameter::DISABLED, ... +#define CONV_BUF_BANK_MGMT_ENUMS(op) \ + op(DISABLED, 0U) \ + op(ENABLED, 1U) + +// for class PDPOpModeParameter::ON_FLYING, ... +#define PDP_OP_MODE_ENUMS(op) \ + op(ON_FLYING, 0U) \ + op(OFF_FLYING, 1U) + +// for class OffFlyingOpModeParameter::NO_REFETCH, ... +#define OFF_FLYING_OP_MODE_ENUMS(op) \ + op(NO_REFETCH, 0U) \ + op(REFETCH, 1U) + +// for class SDPOpModeParameter::ON_FLYING, ... +#define SDP_OP_MODE_ENUMS(op) \ + op(ON_FLYING, 0U) \ + op(OFF_FLYING, 1U) + +// for class AXIFSchedParameter::DISABLED, ... +#define AXIF_SCHED_ENUMS(op) \ + op(DISABLED, 0U) \ + op(ENABLED, 1U) + +// for class PixelDataFormatParameter::PITCH_LINEAR, ... +#define PIXEL_DATA_FORMAT_ENUMS(op) \ + op(PITCH_LINEAR, 0U) + +// for class NetworkForksParameter::DISABLED, ... +#define NETWORK_FORKS_ENUMS(op) \ + op(DISABLED, 0U) \ + op(ENABLED, 1U) + +#endif // NVDLA_PRIV_TEST_POINT_PARAMETER_ENUM diff --git a/umd/core/src/compiler/include/priv/Type.h b/umd/core/src/compiler/include/priv/Type.h new file mode 100644 index 00000000..60e6341f --- /dev/null +++ b/umd/core/src/compiler/include/priv/Type.h @@ -0,0 +1,306 @@ +/* + * Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#ifndef NVDLA_PRIV_TYPE_H +#define NVDLA_PRIV_TYPE_H + +#include +#include +#include +#include +#include + +#include "priv/Check.h" +#include "nvdla/IType.h" + +namespace nvdla +{ + +namespace priv +{ + +// Note: these are used as array indices. +enum IOD { IOD_Input = 0U, IOD_Output = 1U, IOD_Debug = 2U, IOD_Max = 3U }; +enum IO { IO_Input = 0U, IO_Output = 1U, IO_Max = 2U }; + +enum ELST { ELST_Elem = 0U, ELST_Line = 1U, ELST_Surf = 2U, ELST_Tensor = 3U, ELST_Max = 4U }; + +class NvErrorException +{ +public: + NvErrorException(NvDlaError e, const char *file, const char *function, size_t line) : + m_e(e), m_file(file), m_function(function), m_line(line) { } + + NvDlaError m_e; + const char *m_file; + const char *m_function; + size_t m_line; +}; + + +// +// Wrapper for contiguous (starting at zero) sequence enumeration(s). +// +template +class SequenceEnum +{ +public: + typedef UnderlyingType underlying_type; + +protected: + underlying_type m_e; + + + static const char * s_c_str; // class name str + static const char * const s_c_strs[]; // class enum strs + static const size_t s_num_elements; + +public: + static const char * parameter_name_c_str() { return s_c_str; } + const char *c_str() const { return s_c_strs[ m_e ]; } + + underlying_type v() const { return m_e; } + EnumClass e() const { return EnumClass(m_e); } + bool valid() const { return m_e < s_num_elements; } + static inline size_t num_elements() { return s_num_elements; } + + SequenceEnum &operator =(underlying_type rhs) { + m_e = rhs; + return *this; + } + + bool operator ==(const SequenceEnum &rhs) const + { + return m_e == rhs.m_e; + } + + + SequenceEnum(EnumClass p) : m_e(p) { } + SequenceEnum() : m_e( underlying_type(s_num_elements)) {/* note, invalid!*/ } + SequenceEnum(underlying_type v) { + if (v > s_num_elements) { + v = s_num_elements; // FIXME: reverse? + // throw: out of range!?! (prefer) + // or require check on validity? + // or coerce to valid? + } + m_e = v; + } + +}; + +/* +template < typename EnumClass > +bool SequenceEnumCompare(const EnumClass& a, const EnumClass& b) +{ + return a.v() < b.v(); +} +*/ +template < typename EnumClass > +struct SequenceEnumCompare { + bool operator() (const EnumClass& lhs, const EnumClass& rhs) const + {return lhs.v() < rhs.v();} +}; +//bool operator<(const EnumClass a, const EnumClass b) + + +} // nvdla::priv +} // nvdla + + +// +// note: preprocessor definitions must happen at global scope level per MISRA +// +#define GEN_ENUM(X, N) X = N, +#define GEN_STR(X, N) #X, + + +// +// Note: it'd be possible to reduce the number of parameters here +// but the MISRA rules only allow a single ## or # per macro. :( +// e.g.: ENUM_PARAMETER_STATIC(X,Y) X##Parameter{} s_c_str = #X; ... +// +#define ENUM_PARAMETER_STATIC(X,Y,Z) \ + template<> const char *const X::s_c_strs[] = { Y(GEN_STR) }; \ + template<> const char * X::s_c_str = Z; \ + template<> const size_t X::s_num_elements = sizeof(X::s_c_strs)/sizeof(X::s_c_strs[0]); + +// note: use this from inside the 'priv' namespace as that's where the SequenceEnum template is specified +// the E parameter is priv implied but can be scoped further if needed. +#define SEQUENCE_ENUM_STATIC_MEMBERS(E, U, Y, Z) \ + template<> const char *const SequenceEnum::s_c_strs[] = { Y(GEN_STR) }; \ + template<> const char * SequenceEnum::s_c_str = Z; \ + template<> const size_t SequenceEnum::s_num_elements = \ + sizeof(SequenceEnum::s_c_strs) / sizeof(SequenceEnum::s_c_strs[0]); + + + +namespace nvdla +{ +namespace priv +{ + +// +// this isn't meant to be complicated. just to reduce typing and errors. +// +template +class BiMap +{ +public: + BiMap() { } + ~BiMap() { } + + typedef typename std::map::iterator left_iterator; + typedef typename std::map::iterator right_iterator; + + //typedef typename std::map::const_iterator left_const_iterator; + // typedef typename std::map::const_iterator right_const_iterator; + + + void insert(L l, R r) { m_left_right[l] = r; m_right_left[r] = l; } + void remove(L l) { R r = m_left_right[l]; m_left_right.erase(l); m_right_left.erase(r); } + + left_iterator begin_left() { return m_left_right.begin(); } + left_iterator end_left() { return m_left_right.end(); } + left_iterator find_left(L l) { return m_left_right.find(l); } + + right_iterator begin_right() { return m_right_left.begin(); } + right_iterator end_right() { return m_right_left.end(); } + right_iterator find_right(R r) { return m_right_left.find(r); } + +protected: + std::map m_left_right; + std::map m_right_left; +}; + +// +// PrivPair and PrivDiamond simplify management of the pointers necessary +// to track public interfaces, their private implementations and derivations +// of such which result in a diamond inheritance pattern. These are simply +// fancy 2 and 4-tuples implemented by std::pair and 2x same. +// Note: with RTTI enabled this can all disappear as dynamic_cast<>() +// would be available instead ;( +// +template +class PrivPair +{ +public: + typedef I InterfaceType; + typedef P PrivateType; + + PrivPair() : m_i_priv(0, 0) { } + + PrivPair(I i, P priv) : + m_i_priv(i, priv) + { } + + PrivPair(const PrivPair &p) : + m_i_priv(p.m_i_priv) + { } + + inline bool operator !() const { return (!m_i_priv.first) || (!m_i_priv.second); } + inline bool operator ==(const PrivPair &rhs) const { return m_i_priv == rhs.m_i_priv; } + inline bool operator <(const PrivPair &rhs) const { return m_i_priv < rhs.m_i_priv; } + + inline I i() const { return m_i_priv.first; } + inline P priv() const { return m_i_priv.second; } + +protected: + std::pair m_i_priv; +}; + +template +class PrivDiamond +{ +public: + typedef BI BaseInterfaceType; + typedef BP BasePrivType; + typedef DI DerivedInterfaceType; + typedef DP DerivedPrivType; + typedef PrivPair BasePairType; + typedef PrivPair DerivedPairType; + + PrivDiamond() : m_base(0, 0), m_derived(0, 0) { } + + PrivDiamond(const PrivDiamond &d) : + m_base(d.base()), + m_derived(d.derived()) + { } + + PrivDiamond(const BasePairType &b, const DerivedPairType &d) : + m_base(b), + m_derived(d) + { } + + PrivDiamond(BI *b_i, BP *b_priv, DI *d_i, DP *d_priv) : + m_base(b_i, b_priv), + m_derived(d_i, d_priv) + { } + + inline bool operator !() const { return (!m_base) || (!m_derived); } + + inline BasePairType base() const { return m_base; } + inline DerivedPairType derived() const { return m_derived; } + +protected: + BasePairType m_base; + DerivedPairType m_derived; +}; + + +// simple converters, utils +static inline const std::string toString(int i) +{ + std::stringstream ss; + ss << i; + return ss.str(); +} + +template +O saturate(const I& in) { + return static_cast(std::max(std::min(in, static_cast(std::numeric_limits::max())), + static_cast(std::numeric_limits::lowest()))); +} + +template struct PtrPrintIdList +{ + PtrPrintIdList() : m_sep("") {} + ~PtrPrintIdList() { } + void operator()(T * & t) { gLogInfo << m_sep << (t?t->id():std::string("null")); m_sep=std::string(", "); } + void operator()(T * const & t) { gLogInfo << m_sep << (t?t->id():std::string("null")); m_sep=std::string(", "); } + std::string m_sep; +}; + + + + +} // nvdla::priv + +} // nvdla + +#endif // NVDLA_PRIV_TYPE_H diff --git a/umd/core/src/compiler/include/priv/WeightTranslationUnit.h b/umd/core/src/compiler/include/priv/WeightTranslationUnit.h new file mode 100644 index 00000000..c5186870 --- /dev/null +++ b/umd/core/src/compiler/include/priv/WeightTranslationUnit.h @@ -0,0 +1,3172 @@ +/* + * Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#ifndef NVDLA_PRIV_WEIGHT_TRNS_UNIT_H +#define NVDLA_PRIV_WEIGHT_TRNS_UNIT_H + +#include +#include +#include +#include "half.h" +#include "nvdla/IType.h" +#include "priv/Check.h" +#include "priv/EngineAST.h" + +#define ENABLE_PRECISION_RANGE_CHECK 0 + +#define WG_FULL_CHANNELS_PER_ATOM 4 +#define WG_BYTES_PER_ATOM 32 +#define WG_WTS_SIZE_ALIGN 128 + +#define PRECISION_SWITCH(modelPrec, computePrec, retVal, func, ...) \ + switch(modelPrec) { \ + case nvdla::DataType::INT8: \ + switch(computePrec) { \ + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8: \ + retVal = func(__VA_ARGS__); break; \ + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16: \ + retVal = func(__VA_ARGS__); break; \ + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_FP16: \ + retVal = func(__VA_ARGS__); break; \ + default: \ + REPORT_ERROR(NvDlaError_NotSupported, "Don't support %d", computePrec); \ + }; break; \ + case nvdla::DataType::INT16: \ + switch(computePrec) { \ + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8: \ + retVal = func(__VA_ARGS__); break; \ + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16: \ + retVal = func(__VA_ARGS__); break; \ + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_FP16: \ + retVal = func(__VA_ARGS__); break; \ + default: \ + REPORT_ERROR(NvDlaError_NotSupported, "Don't support %d", computePrec); \ + }; break; \ + case nvdla::DataType::HALF: \ + switch(computePrec) { \ + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8: \ + retVal = func(__VA_ARGS__); break; \ + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16: \ + retVal = func(__VA_ARGS__); break; \ + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_FP16: \ + retVal = func(__VA_ARGS__); break; \ + default: \ + REPORT_ERROR(NvDlaError_NotSupported, "Don't support %d", computePrec); \ + }; break; \ + case nvdla::DataType::FLOAT: \ + switch(computePrec) { \ + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT8: \ + retVal = func(__VA_ARGS__); break; \ + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_INT16: \ + retVal = func(__VA_ARGS__); break; \ + case surface::SurfacePrecisionEnum::NVDLA_PRECISION_FP16: \ + retVal = func(__VA_ARGS__); break; \ + default: \ + REPORT_ERROR(NvDlaError_NotSupported, "Don't support %d", computePrec); \ + }; break; \ + default: \ + REPORT_ERROR(NvDlaError_NotSupported, "Don't support %d", modelPrec); \ + } + +namespace nvdla +{ +namespace priv +{ + +class WeightTrns +{ + static bool debugMath() { return false; } + template + static std::string toString(T val) + { + std::stringstream stream; + stream << val; + return stream.str(); + } + + public: + struct WeightDims { + NvS64 wtSize; //!< total size of conv layer weights + int numKernels; //!< total kernels in the weight + int numChannels; //!< total channels in each kernel + int width; //!< width of the weight + int height; //!< height of the height + int strideX; //!< kernel stride along width + int strideY; //!< kernel stride along height + + WeightDims(NvS64 size, int k, int c, int w, int h, int cx, int cy) : + wtSize(size), numKernels(k), numChannels(c), + width(w), height(h), + strideX(cx), strideY(cy) {}; + + WeightDims() : + wtSize(0), numKernels(0), numChannels(0), + width(0), height(0), + strideX(0), strideY(0){}; + }; + + /* Check if given value fits within the data format precision range. + * + * <--|----------|-----|-----|----------|--> + * -ve min -ve max 0 +ve min +ve max + * api: lowest() -1*min() min() max() + * fp16: -65504 -6.10e-05 6.10e-05 65504 + * + * note: + * - lowest() is c++11 api + * - there is no standard api to get -ve max value for a data format, + * hence -1 * min() is used. + * + */ + template + static inline bool isWithinNumericalLimits(IT val) + { + bool retval = true; +#if ENABLE_PRECISION_RANGE_CHECK + if ( (val > std::numeric_limits::max()) + || (val < std::numeric_limits::lowest()) + || (val !=0 && val < std::numeric_limits::min() && val > (-1.0f*std::numeric_limits::min())) ) + { + if ( debugMath() ) + { + gLogInfo << val << " is beyond " + << "Pmax(" << float(std::numeric_limits::max()) + << ")/Nmin("<< float(std::numeric_limits::lowest()) + << ") OR is within " + << "Pmin("<< float(std::numeric_limits::min()) + << ")<->Nmax("<< float(-1.0f*std::numeric_limits::min()) + << ") limits of compute precision" << std::endl; + } + retval = false; + } +#endif + return retval; + } + + //! Quantize weights per-kernel (1 scaling factor for the entire KCRS blob) + template + static std::vector perKernelQuantizeWts + ( + Weights highPrecWts, + NvS32 G, NvS32 K, NvS32 C, NvS32 RS, NvS32 kStride, NvS32 cStride, + NvS8* quantizedWts + ) + { + std::vector filterScales; + NvF32 max = std::numeric_limits::lowest(); + const MP* origWts = reinterpret_cast(const_cast(highPrecWts.values)); + + for (NvS32 g = 0; g < G; g++) + { + NvS32 gOffset = g * K * C * RS; + for (NvS32 k = 0; k < K; k++) + { + for (NvS32 c = 0; c < C; c++) + { + for (NvS32 rs = 0; rs < RS; rs++) + // max = std::max(max, std::abs(origWts[gOffset + k * kStride + c * cStride + rs] * inScale)); + max = std::max(max, std::fabs(origWts[gOffset + k * kStride + c * cStride + rs])); + } + } + } + + NvF32 scale = max / 127, invScale = 1 / scale; + + for (NvS32 g = 0; g < G; g++) + { + NvS32 gOffset = g * K * C * RS; + for (NvS32 k = 0; k < K; k++) + { + for (NvS32 c = 0; c < C; c++) + { + for (NvS32 rs = 0; rs < RS; rs++) + { + NvS32 index = gOffset + k * kStride + c * cStride + rs; + // quantizedWts[index] = int8_t(std::floor(origWts[index] * inScale * invScale + 0.5f)); + + // quantizedWts[index] = static_cast(std::floor(origWts[index] * invScale + 0.5f)); + NvS32 int32Weight = static_cast(std::floor(origWts[index] * invScale + 0.5f)); + quantizedWts[index] = static_cast(std::max(std::min(int32Weight, static_cast(std::numeric_limits::max())), + static_cast(std::numeric_limits::lowest()))); + } + } + filterScales.push_back(scale); + } + } + return filterScales; + } + + //! Quantize weights per-filter (1 scaling factor for each CRS blob) + template + static std::vector perFilterQuantizeWts + ( + Weights highPrecWts, + NvS32 G, NvS32 K, NvS32 C, NvS32 RS, NvS32 kStride, NvS32 cStride, + NvS8* quantizedWts + ) + { + std::vector filterScales; + const MP* origWts = reinterpret_cast(const_cast(highPrecWts.values)); + + for (NvS32 g = 0; g < G; g++) + { + NvS32 gOffset = g * K * C * RS; + for (NvS32 k = 0; k < K; k++) + { + NvF32 max = std::numeric_limits::lowest(); + for (NvS32 c = 0; c < C; c++) + { + for (NvS32 rs = 0; rs < RS; rs++) + // max = std::max(max, std::abs(origWts[gOffset + k * kStride + c * cStride + rs] * inScale)); + max = std::max(max, std::fabs(origWts[gOffset + k * kStride + c * cStride + rs])); + } + + NvF32 scale = max / 127, invScale = 1 / scale; + + + for (NvS32 c = 0; c < C; c++) + { + for (NvS32 rs = 0; rs < RS; rs++) + { + NvS32 index = gOffset + k * kStride + c * cStride + rs; + // quantizedWts[index] = int8_t(std::floor(origWts[index] * inScale * invScale + 0.5f)); + + // quantizedWts[index] = static_cast(std::floor(origWts[index] * invScale + 0.5f)); + NvS32 int32Weight = static_cast(std::floor(origWts[index] * invScale + 0.5f)); + quantizedWts[index] = static_cast(std::max(std::min(int32Weight, static_cast(std::numeric_limits::max())), + static_cast(std::numeric_limits::lowest()))); + } + } + filterScales.push_back(scale); + } + } + return filterScales; + } + + //!< Zero pad caffe wts to match its #chnls with IMG input + template + static Weights zeroPadWtsForIMG + ( + WeightDims origWDims, //!< dims of orig caffe wt blob + WeightDims zeroPadWDims, //!< dims of wt blob after zero padding + Weights srcWts //!< pts to orig caffe wt blob + ) + { + NvS64 trnsSize = 0; + NvS64 zpCnt = 0; + Weights IMG_ZP_wts = Weights(nvdla::DataType::FLOAT, NULL, 0); + API_CHECK_WEIGHTS_RETVAL(srcWts, IMG_ZP_wts); + + IT* pSrcWts = reinterpret_cast(const_cast(srcWts.values)); + + int zpR = zeroPadWDims.height; + int zpS = zeroPadWDims.width; + int zpC = zeroPadWDims.numChannels; + int zpK = zeroPadWDims.numKernels; + int zpSize = zeroPadWDims.wtSize; + + IT* pIMGZPWts = reinterpret_cast(engine_ast::MemoryCollector::getInstance()->allocateMemory(zpSize * sizeof(IT))); + memset(pIMGZPWts, 0, zpSize * sizeof(IT)); + IT* pIMGZPWtsCopy = pIMGZPWts; + + for (int ind_k = 0; ind_k < zpK; ++ind_k) + for (int ind_c = 0; ind_c < zpC; ++ind_c) + for (int ind_r = 0; ind_r < zpR; ++ind_r) + for (int ind_s = 0; ind_s < zpS; ++ind_s) + { + IT* dest = getAddrOffset(ind_k, ind_c, ind_r, ind_s, + zeroPadWDims, pIMGZPWts); + IT* src = getAddrOffset(ind_k, ind_c, ind_r, + ind_s, origWDims, pSrcWts); + if (src != NULL) { + *dest = *src; + } + else { + *dest = 0.0f; + zpCnt++; + } + trnsSize++; + } + + if (trnsSize != zeroPadWDims.wtSize) + { + return IMG_ZP_wts; + } + + IMG_ZP_wts.type = getEnumFromType(); + IMG_ZP_wts.values = pIMGZPWtsCopy; + IMG_ZP_wts.count = zeroPadWDims.wtSize; + + return IMG_ZP_wts; + } + + //!< Zero pad for per-element data > + template + static Weights zeroPadFeatureData + ( + WeightDims origDims, // dims of data (bias/scale) + WeightDims zeroPadDims, // dims after padding + Weights srcData // source data + ) + { + /* Support only for numKernel == 1 */ + if (zeroPadDims.numKernels != 1) { + return Weights(nvdla::DataType::FLOAT, NULL, 0); + } + + return zeroPadWtsForIMG(origDims, zeroPadDims, srcData); + } + + //!< Split weights into multiple kernels if number of groups greater than 1 > + template + static Weights padGroupWeights + ( + WeightDims origWDims, //!< dims of orig caffe wt blob + WeightDims groupWDims, //!< dims of wt blob after padding + Weights srcWts, //!< pts to orig caffe wt blob + NvU32 numGroups //!< number of groups + ) + { + Weights Group_wts = Weights(nvdla::DataType::FLOAT, NULL, 0); + API_CHECK_WEIGHTS_RETVAL(srcWts, Group_wts); + + IT* pSrcWts = reinterpret_cast(const_cast(srcWts.values)); + + unsigned int oR = origWDims.height; + unsigned int oS = origWDims.width; + unsigned int oC = origWDims.numChannels; + unsigned int oK = origWDims.numKernels; + + unsigned int groupWSize = groupWDims.wtSize; + + IT* pGroupWts = reinterpret_cast(engine_ast::MemoryCollector::getInstance()->allocateMemory(groupWSize * sizeof(IT))); + memset(pGroupWts, 0, groupWSize * sizeof(IT)); + IT* pGroupWtsCopy = pGroupWts; + + NvU32 perGroupK = oK/numGroups; + + for (unsigned int ind_g = 0; ind_g < numGroups; ind_g++) + { + for (unsigned int ind_k = 0; ind_k < perGroupK; ind_k++) + { + for (unsigned int ind_c = 0; ind_c < oC; ind_c++) + { + for (unsigned int ind_r = 0; ind_r < oR; ind_r++) + { + for (unsigned int ind_s = 0; ind_s < oS; ind_s++) + { + unsigned int ind_kk = ind_g * perGroupK + ind_k; + IT* src = getAddrOffset(ind_kk, ind_c, ind_r, ind_s, + origWDims, pSrcWts); + IT* dest = getAddrOffsetForGroup(ind_kk, ind_c, ind_r, + ind_s, ind_g, oC, groupWDims, pGroupWts); + *dest = *src; + } + } + } + } + } + + Group_wts.type = getEnumFromType(); + Group_wts.values = pGroupWtsCopy; + Group_wts.count = groupWDims.wtSize; + + return Group_wts; + } + + //!< Do channel pre-extension on raw caffe wts for IMG convolution + template + static Weights preChnlExtWtsForIMG + ( + WeightDims origWDims, //!< dims of orig caffe wt blob + WeightDims preCEWDims, //!< dims of wt blob after pre Chnl Ext + Weights srcWts //!< ptr to orig caffe wt blob + ) + { + NvS64 trnsCnt = 0; + Weights IMG_Pre_CE_Wts = Weights(nvdla::DataType::FLOAT, NULL, 0); + API_CHECK_WEIGHTS_RETVAL(srcWts, IMG_Pre_CE_Wts); + + IT* pSrcWts = reinterpret_cast(const_cast(srcWts.values)); + + int origK = origWDims.numKernels; + + int ceS = preCEWDims.width; + int ceR = preCEWDims.height; + int ceC = preCEWDims.numChannels; + int ceK = preCEWDims.numKernels; + NVDLA_UNUSED(ceK); + + if (preCEWDims.wtSize != origWDims.wtSize) + return IMG_Pre_CE_Wts; + + IT* pIMGPreCEWts = + reinterpret_cast(engine_ast::MemoryCollector::getInstance()->allocateMemory(preCEWDims.wtSize * sizeof(IT))); + memset(pIMGPreCEWts, 0, preCEWDims.wtSize * sizeof(IT)); + IT* pIMGPreCEWtsCopy = pIMGPreCEWts; + + for (int ind_k = 0; ind_k < origK; ++ind_k) + for (int ind_c = 0; ind_c < ceC; ++ind_c) + for (int ind_r = 0; ind_r < ceR; ++ind_r) + for (int ind_s = 0; ind_s < ceS; ++ind_s) + { + IT* dest = getAddrOffset(ind_k, ind_c, ind_r, ind_s, + preCEWDims, pIMGPreCEWts); + IT* src = getCaffeAddrForIMGPreChnlExt(ind_k, ind_c, ind_r, + ind_s, origWDims, pSrcWts); + if (src != NULL) { + *dest = *src; + } + else { + *dest = 0.0f; + } + trnsCnt++; + } + + if (trnsCnt != preCEWDims.wtSize) { + return IMG_Pre_CE_Wts; + } + + IMG_Pre_CE_Wts.type = getEnumFromType(); + IMG_Pre_CE_Wts.values = pIMGPreCEWtsCopy; + IMG_Pre_CE_Wts.count = trnsCnt; + + return IMG_Pre_CE_Wts; + } + + //!< Do channel post-extension on raw caffe wts for IMG convolution + template + static Weights postChnlExtWtsForIMG + ( + WeightDims wDims, //!< dims of wt blob before post Chnl Extension + Weights srcWts, //!< ptr to orig caffe wt blob + NvU32 postExtFactor, //!< factor(1,2 or 4) upto which extension should be made + bool &postChnlExtWtsSuccess, + int atomicKSize, + int atomicCSize, + int cbufWidth + ) + { + Weights IMG_Post_CE_Wts = Weights(nvdla::DataType::FLOAT, NULL, 0); + + API_CHECK_WEIGHTS0_RETVAL(srcWts, IMG_Post_CE_Wts); + + IT* pSrcWts = reinterpret_cast(const_cast(srcWts.values)); + + std::vector vWtOps; + vWtOps.clear(); + + // postExtFactor == 1, means no change after. + if (postExtFactor == 1) + { + postChnlExtWtsSuccess = false; + return IMG_Post_CE_Wts; + } + + //Prepare wt translation ops + prepWtTrnsOpsForIMGPostCE(wDims, postExtFactor, vWtOps, atomicKSize, atomicCSize); + + + if (vWtOps.size() == 0) { + postChnlExtWtsSuccess = false; + return IMG_Post_CE_Wts; + } + + //Execute wt translation ops + IMG_Post_CE_Wts = execWtTrnsOpsForIMGPostCE(wDims, pSrcWts, vWtOps, atomicKSize, atomicCSize, cbufWidth); + + postChnlExtWtsSuccess = true; + return IMG_Post_CE_Wts; + } + + /* Join factors of 2 adjacent product ops into single blob iff they dont overshoot + * the dynamic range of the compute precision + */ + template + static Weights combineMultiplicationFactors + ( + engine_ast::SDPMode mode, // per-channel/layer + WeightDims commonDims, + Weights& rawF1Data, + Weights& rawF2Data + ) + { + NvDlaError e = NvDlaSuccess; + Weights combinedData = Weights(nvdla::DataType::FLOAT, NULL, 0); + NVDLA_UNUSED(e); + + IT* pRawF1Blob = reinterpret_cast(const_cast(rawF1Data.values)); + IT* pRawF2Blob = reinterpret_cast(const_cast(rawF2Data.values)); + IT* pCombinedBlob; + + API_CHECK_WEIGHTS_RETVAL(rawF1Data, combinedData); + API_CHECK_WEIGHTS_RETVAL(rawF2Data, combinedData); + + if (rawF1Data.count != rawF2Data.count) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Can't combine multiplication " + "factors of 2 blobs which are of different sizes %d != %d", + rawF1Data.count, rawF2Data.count); + } + + combinedData.type = rawF1Data.type; + combinedData.count = rawF1Data.count; + pCombinedBlob = + reinterpret_cast(engine_ast::MemoryCollector::getInstance()->allocateMemory(rawF1Data.count * sizeof(IT))); + combinedData.values = NULL; + + if (mode.v() == engine_ast::SDPModeEnum::SDP_MODE_PER_LAYER) + { + IT combinedVal = pRawF1Blob[0] * pRawF2Blob[0]; + if (!isWithinNumericalLimits(combinedVal)) + { + engine_ast::MemoryCollector::getInstance()->freeMemory(pCombinedBlob); + goto fail; + } + pCombinedBlob[0] = combinedVal; + } + else if (mode.v() == engine_ast::SDPModeEnum::SDP_MODE_PER_CHANNEL) + { + for (int cc = 0; cc < commonDims.numChannels; ++cc) + { + IT combinedVal = pRawF1Blob[cc] * pRawF2Blob[cc]; + if (!isWithinNumericalLimits(combinedVal)) + { + engine_ast::MemoryCollector::getInstance()->freeMemory(pCombinedBlob); + goto fail; + } + pCombinedBlob[cc] = combinedVal; + } + } + else + { + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Don't support joining multiplication " + "factors for SDP mode %s", mode.c_str()); + } + + combinedData.values = pCombinedBlob; + + fail: + return combinedData; + } + + /* Join factors of 2 adjacent additive ops into single blob iff they dont overshoot + * the dynamic range of the compute precision + */ + template + static Weights combineAdditionFactors + ( + engine_ast::SDPMode mode, // per-channel/layer + WeightDims commonDims, + Weights& rawF1Data, + Weights& rawF2Data + ) + { + NvDlaError e = NvDlaSuccess; + Weights combinedData = Weights(nvdla::DataType::FLOAT, NULL, 0); + NVDLA_UNUSED(e); + + IT* pRawF1Blob = reinterpret_cast(const_cast(rawF1Data.values)); + IT* pRawF2Blob = reinterpret_cast(const_cast(rawF2Data.values)); + IT* pCombinedBlob; + + API_CHECK_WEIGHTS_RETVAL(rawF1Data, combinedData); + API_CHECK_WEIGHTS_RETVAL(rawF2Data, combinedData); + + if (rawF1Data.count != rawF2Data.count) + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Can't combine addition " + "factors of 2 blobs which are of different sizes %d != %d", + rawF1Data.count, rawF2Data.count); + } + + combinedData.type = rawF1Data.type; + combinedData.count = rawF1Data.count; + pCombinedBlob = + reinterpret_cast(engine_ast::MemoryCollector::getInstance()->allocateMemory(rawF1Data.count * sizeof(IT))); + combinedData.values = NULL; + + if (mode.v() == engine_ast::SDPModeEnum::SDP_MODE_PER_LAYER) + { + IT combinedVal = pRawF1Blob[0] + pRawF2Blob[0]; + if (!isWithinNumericalLimits(combinedVal)) + { + engine_ast::MemoryCollector::getInstance()->freeMemory(pCombinedBlob); + goto fail; + } + pCombinedBlob[0] = combinedVal; + } + else if (mode.v() == engine_ast::SDPModeEnum::SDP_MODE_PER_CHANNEL) + { + for (int cc = 0; cc < commonDims.numChannels; ++cc) + { + IT combinedVal = pRawF1Blob[cc] + pRawF2Blob[cc]; + if (!isWithinNumericalLimits(combinedVal)) + { + engine_ast::MemoryCollector::getInstance()->freeMemory(pCombinedBlob); + goto fail; + } + pCombinedBlob[cc] = combinedVal; + } + } + else + { + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Don't support joining addition " + "factors for SDP mode %s", mode.c_str()); + } + + combinedData.values = pCombinedBlob; + + fail: + return combinedData; + } + + template + Weights combineKernelWeightsAndScaleData + ( + engine_ast::SDPMode sclMode, // per-channel/layer + nvdla::Dims4 krnlWtDims, + nvdla::Dims4 sclDims, + Weights& krnlWts, + Weights& sclData + ) + { + NvDlaError e = NvDlaSuccess; + Weights combinedData = Weights(nvdla::DataType::FLOAT, NULL, 0); + NVDLA_UNUSED(e); + + IT* pKrnlWts = reinterpret_cast(const_cast(krnlWts.values)); + IT* pSclData = reinterpret_cast(const_cast(sclData.values)); + IT* pCombinedBlob; + + API_CHECK_WEIGHTS_RETVAL(krnlWts, combinedData); + API_CHECK_WEIGHTS_RETVAL(sclData, combinedData); + + combinedData.type = krnlWts.type; + combinedData.count = krnlWts.count; + pCombinedBlob = + reinterpret_cast(engine_ast::MemoryCollector::getInstance()->allocateMemory(krnlWts.count * sizeof(IT))); + combinedData.values = NULL; + + if (sclMode.v() == engine_ast::SDPModeEnum::SDP_MODE_PER_LAYER) + { + for (int i = 0; i < krnlWts.count; ++i) + { + IT combinedVal = pKrnlWts[i] * pSclData[0]; + if (!isWithinNumericalLimits(combinedVal)) + { + engine_ast::MemoryCollector::getInstance()->freeMemory(pCombinedBlob); + goto fail; + } + pCombinedBlob[i] = combinedVal; + } + } + else if (sclMode.v() == engine_ast::SDPModeEnum::SDP_MODE_PER_CHANNEL) + { + for (int kk = 0; kk < krnlWtDims.n; ++kk) + { + IT perChnlScl = pSclData[kk]; + NvU64 wtsPerKrnl = krnlWtDims.c * krnlWtDims.h * krnlWtDims.w; + for (int cc = 0; cc < (int)wtsPerKrnl; ++cc) + { + IT combinedVal = pKrnlWts[(kk * wtsPerKrnl) + cc] * perChnlScl; + if (!isWithinNumericalLimits(combinedVal)) + { + engine_ast::MemoryCollector::getInstance()->freeMemory(pCombinedBlob); + goto fail; + } + pCombinedBlob[(kk * wtsPerKrnl) + cc] = combinedVal; + } + } + } + else + { + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Don't support joining kernel wts and scale " + "factors for SDP mode %s", sclMode.c_str()); + } + + combinedData.values = pCombinedBlob; + + fail: + return combinedData; + } + + //!< translate raw caffe wts to that suitable for direct convolution + //!< We only support: + //!< - int8 -> int8 translation + //!< - int16-> int16 translation + //!< - fp16 -> fp16 translation + //!< - fp32 -> fp32 translation (will deprecate soon) + //!< - fp32 -> fp16 translation + template + static Weights translateWtsForDC + ( + WeightDims wDims, //!< dims of orig caffe wt blob + Weights& srcWts, //!< ptr to orig caffe wt blob + int atomicKSize, + int atomicCSize, + int cbufWidth, + std::map& mCaffeHash = *(new std::map()) //!< hash of the entire caffe wt blob + ) + { + Weights DC_tr_wts = Weights(nvdla::DataType::FLOAT, NULL, 0); + + API_CHECK_WEIGHTS_RETVAL(srcWts, DC_tr_wts); + + bool isSanityOn = mCaffeHash.size() > 0 ? true : false; + IT* pSrcWts = reinterpret_cast(const_cast(srcWts.values)); + IT* pDCCEWts = pSrcWts; + WeightDims origWDims = wDims; + std::vector vWtOps; + vWtOps.clear(); + + //Channel extend if need be + //pDCCEWts = doSlowCEForDC(wDims, pSrcWts); // FIXME: do wt chnl extension only for IMGs in a separate API + + //if (isSanityOn) + // if(runSanityForDCWtChnlExt(pSrcWts, origWDims, pDCCEWts, wDims)) + // return Weights{nvdla::DataType::FLOAT, NULL, 0}; + + //Prepare wt translation ops + prepWtTrnsOpsForDC(wDims, vWtOps, atomicKSize, atomicCSize); + + //Execute wt translation ops + DC_tr_wts = execWtTrnsOpsForDC(wDims, pDCCEWts, vWtOps, atomicKSize, atomicCSize, cbufWidth); + + if (isSanityOn) + if (runSanityForDCWtTrns(reinterpret_cast(const_cast(DC_tr_wts.values)), + origWDims, + vWtOps, + mCaffeHash, + atomicKSize, + atomicCSize)) + return Weights{nvdla::DataType::FLOAT, NULL, 0}; + + if (pDCCEWts != pSrcWts) + { + engine_ast::MemoryCollector::getInstance()->freeMemory(pDCCEWts); + pDCCEWts = NULL; + } + + return DC_tr_wts; + } + + //!< convert weights from CKRS to KCRS format + //!< This function implements: + //!< - int8 -> fp32 translation + //!< - int16-> fp32 translation + //!< - fp16 -> fp32 translation + template + static Weights convertWtsToKCRS + ( + WeightDims wDims, //!< dims of orig caffe wt blob + Weights& srcWts //!< ptr to orig caffe wt blob + ) + { + NvU32 trnsCount = 0; + Weights DC_tr_wts = Weights(nvdla::DataType::FLOAT, NULL, 0); + + API_CHECK_WEIGHTS_RETVAL(srcWts, DC_tr_wts); + + IT* pSrcWts = reinterpret_cast(const_cast(srcWts.values)); + + NvF32* pDCDestWts = + reinterpret_cast(engine_ast::MemoryCollector::getInstance()->allocateMemory(wDims.wtSize * sizeof(NvF32))); + memset(pDCDestWts, 0, wDims.wtSize * sizeof(NvF32)); + NvF32* pDCDestWtsCopy = pDCDestWts; + + for (int k = 0; k < wDims.numKernels; ++k) + { + for (int c = 0; c < wDims.numChannels; ++c) + { + for (int r = 0; r < wDims.height; ++r) + { + for (int s = 0; s < wDims.width; ++s) + { + int ckrsIndex = s + wDims.width * + (r + wDims.height * + (k + wDims.numKernels * + (c))); + IT value = pSrcWts[ckrsIndex]; + *pDCDestWts = NvF32(value); + pDCDestWts++; + trnsCount++; + } + } + } + } + + DC_tr_wts.type = getEnumFromType(); + DC_tr_wts.values = pDCDestWtsCopy; + DC_tr_wts.count = trnsCount; + + return DC_tr_wts; + } + + /** + * Splits the raw KCRS weights into set of weights based on deconvolution strides. + * This function returns set of splitted weights along with splitSetWtDims. + **/ + template + static std::vector splitWeightsForDeconv + ( + Weights rawKCRSWts, + Dims4 origWtDims, + Dims2 deconvStrides, + Dims4& splitSetWtDims + ) + { + std::vector splitSetWts; + + // Determine split dimension + NvS32 splitSetW = (NvS32)ceilf(origWtDims.w/float(deconvStrides.w)); + NvS32 splitSetH = (NvS32)ceilf(origWtDims.h/float(deconvStrides.h)); + + splitSetWtDims = Dims4(origWtDims.n, origWtDims.c, splitSetH, splitSetW); + + // Splitting weight data + IT* pKCRS = reinterpret_cast(const_cast(rawKCRSWts.values)); + + for (NvU16 y = 0; y < deconvStrides.h; ++y) + { + for (NvU16 x = 0; x < deconvStrides.w; ++x) + { + NvU16 sStartIndex = x; + NvU16 rStartIndex = y; + + IT* pSplitSet = + (IT*) engine_ast::MemoryCollector::getInstance()->allocateMemory(sizeof(IT) * + (splitSetWtDims.n * + splitSetWtDims.c * + splitSetWtDims.h * + splitSetWtDims.w)); + IT* pSplitSetCopy = pSplitSet; + NvU64 splitSetCnt = 0; + + for (NvU16 k = 0; k < splitSetWtDims.n; ++k) + { + for (NvU16 c = 0; c < splitSetWtDims.c; ++c) + { + for (NvU16 r = 0; r < splitSetWtDims.h; ++r) + { + for (NvU16 s = 0; s < splitSetWtDims.w; ++s) + { + NvU16 sJumpIndex = sStartIndex + (s * deconvStrides.w); + NvU16 rJumpIndex = rStartIndex + (r * deconvStrides.h); + if ((sJumpIndex < origWtDims.w) && (rJumpIndex < origWtDims.h)) + { + NvU32 unsplitWtIndex = sJumpIndex + origWtDims.w * + (rJumpIndex + origWtDims.h * + (c + origWtDims.c * (k))); + *pSplitSet = pKCRS[unsplitWtIndex]; + } + else + { + *pSplitSet = 0; + } + ++pSplitSet; + ++splitSetCnt; + } + } + } + } + + splitSetWts.push_back(Weights(getEnumFromType(), pSplitSetCopy, splitSetCnt)); + } + } + + return splitSetWts; + } + + //!< translate raw caffe wts to that suitable for Deconvolution + //!< We only support: + //!< - int8 -> int8 translation + //!< - int16-> int16 translation + //!< - fp16 -> fp16 translation + //!< - fp32 -> fp32 translation (will deprecate soon) + //!< - fp32 -> fp16 translation + template + static Weights translateWtsForDeconv + ( + WeightDims wDims, //!< dims of orig caffe wt blob + Weights& srcWts, //!< ptr to orig caffe wt blob + int atomicKSize, + int atomicCSize, + int cbufWidth, + std::map& mCaffeHash = *(new std::map()) //!< hash of the entire caffe wt blob + ) + { + Weights DC_tr_wts = Weights(nvdla::DataType::FLOAT, NULL, 0); + + API_CHECK_WEIGHTS_RETVAL(srcWts, DC_tr_wts); + + bool isSanityOn = mCaffeHash.size() > 0 ? true : false; + IT* pSrcWts = reinterpret_cast(const_cast(srcWts.values)); + WeightDims origWDims = wDims; + std::vector vWtOps; + vWtOps.clear(); + + prepWtTrnsOpsForDeconv(wDims, vWtOps, atomicKSize, atomicCSize); + + //Execute wt translation ops + DC_tr_wts = execWtTrnsOpsForDeconv(wDims, pSrcWts, vWtOps, atomicKSize, atomicCSize, cbufWidth); + + if (isSanityOn) + if (runSanityForDeconvWtTrns(reinterpret_cast(const_cast(DC_tr_wts.values)), + origWDims, + vWtOps, + mCaffeHash, + atomicKSize, + atomicCSize)) + return Weights{nvdla::DataType::FLOAT, NULL, 0}; + + return DC_tr_wts; + } + + + //!< check if wt dims and conv stride allow WG convolution such as: + //!< Stride = 1, size = 3x3 or + //!< Stride = 2, size = 6x6 or 5x5 or + //!< Stride = 3, size = 7x7 or 8x8 or 9x9, etc + static bool isWGPossible + ( + WeightDims wDims + ) + { + // right now restrict only to 3x3 stride 1 +// if (wDims.width > wDims.strideX * 2 && +// wDims.width <= wDims.strideX * 3 && +// wDims.height > wDims.strideY * 2 && +// wDims.height <= wDims.strideY * 3) + if (wDims.width == 3 && wDims.height == 3 && + wDims.strideX == 1 && wDims.strideY == 1) + return true; + else + return false; + } + + //!< translate raw caffe wts to that suitable for winograd convolution + template + static Weights translateWtsForWG + ( + WeightDims wDims, //!< dims of orig caffe wt blob + Weights& srcWts, //!< ptr to orig caffe wt blob + std::map& mCaffeHash = *(new std::map())//!< hash of the entire caffe wt blob + ) + { + Weights WG_tr_wts = Weights{nvdla::DataType::FLOAT, NULL, 0}; + API_CHECK_WEIGHTS_RETVAL(srcWts, WG_tr_wts); + + bool isSanityOn = mCaffeHash.size() > 0 ? true : false; + IT* pSrcWts = reinterpret_cast(const_cast(srcWts.values)); + IT* pWGZPWts = pSrcWts; + IT* pWGCEWts = pSrcWts; + IT* pWGMTWts = pSrcWts; + WeightDims origWDims = wDims; + WeightDims zpWDims = wDims; + WeightDims ceWDims = wDims; + std::vector vWtOps; + vWtOps.clear(); + + if (wDims.strideX != wDims.strideY) + return srcWts; // WG trns is not possible for unequal X/Y strides + + int bpe = sizeof(RT); + + //Zero pad channels if not a multiple of 32 + if ((wDims.numChannels % (WG_BYTES_PER_ATOM/bpe)) != 0) + { + int numPadChnls = WG_BYTES_PER_ATOM/bpe - + (wDims.numChannels % (WG_BYTES_PER_ATOM/bpe)); + + /* if padding zeroes in chnl direction, update caffeWtHash */ + mCaffeHash.clear(); + pWGZPWts = padZerosForWG(wDims, pSrcWts, numPadChnls, mCaffeHash); + zpWDims = wDims; + + /* check sanctity of zero padding */ + if (isSanityOn) + if (runSanityForWGWtZeroPadded(pSrcWts, origWDims, pWGZPWts, zpWDims)) + return Weights{nvdla::DataType::FLOAT, NULL, 0}; + } + + //Channel extend if need be (stride > 1) + if (wDims.width != 3 && + wDims.height != 3 && + wDims.strideX > 1) + { + /* if extending channels, update caffeWtHash */ + mCaffeHash.clear(); + pWGCEWts = doCEForWG(wDims, pWGZPWts, mCaffeHash); + ceWDims = wDims; + + /* check sanity for chnl extn */ + if (isSanityOn) + if (runSanityForWGWtChnlExt(pWGZPWts, zpWDims, pWGCEWts, wDims)) + return Weights{nvdla::DataType::FLOAT, NULL, 0}; + } + //free up mem allocated for ZP wt surface if CE also happened + if (pWGCEWts != pSrcWts && pWGZPWts != pSrcWts) + { + engine_ast::MemoryCollector::getInstance()->freeMemory(pWGZPWts); + pWGZPWts = NULL; + } + else if (pWGCEWts == pSrcWts) + { + //if CE didn't happen irrespective of ZP + ceWDims = zpWDims; + pWGCEWts = pWGZPWts; + } + + + //Translate the 3x3xC cube to 4x4xC + pWGMTWts = WGMatrixTrns(wDims, pWGCEWts); + + /* check sanity of mat trns */ + if (isSanityOn) + if (runSanityForWGWtMatrixTrns(pWGCEWts, ceWDims, pWGMTWts, wDims)) + return Weights{nvdla::DataType::FLOAT, NULL, 0}; + + //free up mem allocated for CE + if (pWGCEWts != pSrcWts) + { + engine_ast::MemoryCollector::getInstance()->freeMemory(pWGCEWts); + pWGCEWts = NULL; + } + + //Prepare wt translation ops + prepWtTrnsOpsForWG(wDims, vWtOps); + + //Execute wt translation ops + WG_tr_wts = execWtTrnsOpsForWG(wDims, pWGMTWts, vWtOps); + + /* check sanity of wt trns */ + if (isSanityOn) + if (runSanityForWGWtTrns(reinterpret_cast(const_cast(WG_tr_wts.values)), + vWtOps, + mCaffeHash)) + return Weights{nvdla::DataType::FLOAT, NULL, 0}; + + engine_ast::MemoryCollector::getInstance()->freeMemory(pWGMTWts); + pWGMTWts = NULL; + + return WG_tr_wts; + } + + // convert CRS blob to Cpg[RSCf]Cfg[RSCf] blob + template + static Weights translateCRSToFeatureData + ( + WeightDims crsDims, + Weights srcData, + int channelsPerGroup = 0 + ) + { + NvU32 trnsCount = 0; + Weights featureFormatData = Weights(nvdla::DataType::FLOAT, NULL, 0); + + // use channelsPerGroup if specified + int cf = channelsPerGroup != 0? channelsPerGroup: + sizeof(RT) == 1 ? 32 : 16; // full channels per group + + int cfg = crsDims.numChannels / cf; // number of full channel groups + int cp = crsDims.numChannels % cf; // partial channels per group + int cpg = cp ? 1 : 0; // number of partial channel groups + NvU64 ffSize = (cfg + cpg) * cf * crsDims.width * crsDims.height; + + IT *pSrcData = reinterpret_cast(const_cast(srcData.values)); + RT *pDestData = reinterpret_cast(engine_ast::MemoryCollector::getInstance()->allocateMemory(ffSize * sizeof(RT))); + memset(pDestData, 0, ffSize * sizeof(RT)); + + RT *pDestDataCopy = pDestData; + + for (unsigned ind_cfg = 0; ind_cfg < (unsigned)cfg; ind_cfg++) + { + for (unsigned ind_r = 0; ind_r < (unsigned)crsDims.height; ind_r++) + { + for (unsigned ind_s = 0; ind_s < (unsigned)crsDims.width; ind_s++) + { + for (unsigned ind_c = ind_cfg*cf; ind_c < (unsigned)((ind_cfg*cf) + cf); ind_c++) + { + IT value = pSrcData[ind_s + + crsDims.width*(ind_r + + crsDims.height*(ind_c))]; + *pDestData = RT(value); + pDestData++; + trnsCount++; + } + } + } + } + + if (cpg) + { + for (unsigned ind_r = 0; ind_r < (unsigned)crsDims.height; ind_r++) + { + for (unsigned ind_s = 0; ind_s < (unsigned)crsDims.width; ind_s++) + { + for (unsigned ind_c = cfg*cf; ind_c < (unsigned)((cfg*cf) + cf); ind_c++) + { + if (ind_c < (unsigned)((cfg*cf) + cp)) + { + IT value = pSrcData[ind_s + + crsDims.width*(ind_r + + crsDims.height*(ind_c))]; + *pDestData = RT(value); + } + else + { + *pDestData = 0; + } + pDestData++; + trnsCount++; + } + } + } + } + + if (trnsCount != ffSize) + { + gLogInternalError << "Problem in translating data to FF:" + << "copy count: " << trnsCount + << "dimension count:"<< ffSize + << std::endl; + return featureFormatData; + } + + featureFormatData.type = getEnumFromType(); + featureFormatData.values = pDestDataCopy; + featureFormatData.count = trnsCount; + return featureFormatData; + } + + template + static Weights translatePEBiasToFD + ( + WeightDims dims, + Weights srcData, + int channelsPerGroup = 0 + ) + { + return translateCRSToFeatureData(dims, srcData, channelsPerGroup); + } + + // interleave/alternate between data bits from 2 data blobs + template + static Weights interlayDataBlobs + ( + Weights& D1Blob, + Weights& D2Blob + ) + { + NvDlaError e = NvDlaSuccess; + NVDLA_UNUSED(e); + + NvS64 trnsCount = 0; + Weights interleavedData = Weights(nvdla::DataType::FLOAT, NULL, 0); + + RT* pDestData = NULL; + RT* pDestDataCopy = NULL; + + API_CHECK_WEIGHTS_RETVAL(D1Blob, interleavedData); + API_CHECK_WEIGHTS_RETVAL(D2Blob, interleavedData); + + IT* pD1Data = reinterpret_cast(const_cast(D1Blob.values)); + IT* pD2Data = reinterpret_cast(const_cast(D2Blob.values)); + + ASSERT( D1Blob.count == D2Blob.count ); + + pDestData = reinterpret_cast(engine_ast::MemoryCollector::getInstance()->allocateMemory(D1Blob.count * 2 * sizeof(RT))); + + memset(pDestData, 0, D1Blob.count * 2 * sizeof(RT)); + pDestDataCopy = pDestData; + + for (NvU64 c = 0 ; c < static_cast(D1Blob.count); ++c) + { + IT d1Val = pD1Data[c]; + IT d2Val = pD2Data[c]; + + *pDestData = RT(d1Val); + ++pDestData; + *pDestData = RT(d2Val); + ++pDestData; + trnsCount++; + } + + interleavedData.type = getEnumFromType(); + interleavedData.values = pDestDataCopy; + interleavedData.count = trnsCount; + + fail: + return interleavedData; + } + + template + static Weights translatePESclDataToFD + ( + WeightDims dims, + Weights srcData, + int channelsPerGroup = 0 + ) + { + return translateCRSToFeatureData(dims, srcData, channelsPerGroup); + } + + //!< translate raw caffe bias-data to that suitable for SDP Bias op + template + static Weights translateDataForBias + ( + engine_ast::SDPMode biasMode, //!< per-layer/channel/elementwise + WeightDims biasDims, //!< dims of orig caffe bias-data blob + Weights& srcBias, //!< ptr to orig caffe mean blob + int channelsPerGroup = 0 + ) + { + NvDlaError e = NvDlaSuccess; + NVDLA_UNUSED(e); + NvS64 trnsCount = 0; + Weights Bias_tr_data = Weights(nvdla::DataType::FLOAT, NULL, 0); + + API_CHECK_WEIGHTS_RETVAL(srcBias, Bias_tr_data); + + IT* pSrcBias = reinterpret_cast(const_cast(srcBias.values)); + + RT* pDestBias = + reinterpret_cast(engine_ast::MemoryCollector::getInstance()->allocateMemory(biasDims.wtSize * sizeof(RT))); + memset(pDestBias, 0, biasDims.wtSize * sizeof(RT)); + RT* pDestBiasCopy = pDestBias; + + /* Bias:-> y = x + bias*/ + + // Bias data can be of 3 types: per-layer/per-channel/per-element + // Per-Layer: + if (biasMode.v() == engine_ast::SDPModeEnum::SDP_MODE_PER_LAYER) + { + *pDestBias = pSrcBias[0]; + trnsCount++; + } + // Per-Channel: + else if (biasMode.v() == engine_ast::SDPModeEnum::SDP_MODE_PER_CHANNEL) + { + int c = 0; + for ( ; c < biasDims.numChannels; ++c) + { + IT srcBias = pSrcBias[c]; + *pDestBias = RT(srcBias); + ++pDestBias; + trnsCount++; + } + } + // Per-Element: + else if (biasMode.v() == engine_ast::SDPModeEnum::SDP_MODE_PER_ELEMENT) + { + /* Translate to feature format */ + Bias_tr_data = translatePEBiasToFD(biasDims, srcBias, channelsPerGroup); + goto fail; + } + else + { + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Don't support data translation for " + "bias op with sdp mode: %s", biasMode.c_str()); + } + + Bias_tr_data.type = getEnumFromType(); + Bias_tr_data.values = pDestBiasCopy; + Bias_tr_data.count = trnsCount; + + fail: + return Bias_tr_data; + } + + //!< translate raw caffe mean/variance to that suitable for SDP BatchNorm + template + static Weights translateDataForBatchNorm + ( + engine_ast::SDPMode bnMode, //!< per-channel/layer + WeightDims bnDims, //!< dims of orig caffe mean/variance blobs + Weights& srcMean, //!< ptr to orig caffe mean blob + Weights& srcVar //!< ptr to orig caffe variance blob + ) + { + NvDlaError e = NvDlaSuccess; + + NVDLA_UNUSED(e); + NVDLA_UNUSED(bnDims); + + Weights BNTrnsData = Weights(nvdla::DataType::FLOAT, NULL, 0); + + /* Batch-Norm:-> y = (x - mean) / sqrt(variance+eps) + * SDP can do ADD and MUL, not SUB and DIV + */ + + // Batch norm data can be only of 2 types: per-layer/per-channel + if ( bnMode.v() == engine_ast::SDPModeEnum::SDP_MODE_PER_LAYER || + bnMode.v() == engine_ast::SDPModeEnum::SDP_MODE_PER_CHANNEL) + { + BNTrnsData = interlayDataBlobs(srcMean, srcVar); + } + else if (bnMode.v() == engine_ast::SDPModeEnum::SDP_MODE_PER_ELEMENT) + { + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "BN per-elemet translation is not yet supported\n"); + } + else + { + ORIGINATE_ERROR_FAIL(NvDlaError_BadValue, "Unknown BN mode\n"); + } + + fail: + return BNTrnsData; + } + + /** + * Creates a unit(or identity) scale Weight based on mode and precision. + * This is useful when rescaling is handled by separate scale node. + **/ + template + static Weights createUnitScaleData + ( + engine_ast::SDPMode scaleMode, + Dims4 scaleDims + ) + { + NvDlaError e = NvDlaSuccess; + NVDLA_UNUSED(e); + Weights unitScaleData = Weights(nvdla::DataType::FLOAT, NULL, 0); + + NvS32 unitScaleCount = scaleDims.c * scaleDims.h * scaleDims.w; + NvS32 trnsCnt = 0; + + MP* unitScaleValues = + (MP*)engine_ast::MemoryCollector::getInstance()->allocateMemory(unitScaleCount * sizeof(MP)); + memset(unitScaleValues, 0, unitScaleCount * sizeof(MP)); + + if (scaleMode.v() == engine_ast::SDPModeEnum::SDP_MODE_PER_LAYER) + { + unitScaleValues[0] = 1; + trnsCnt++; + } + else if (scaleMode.v() == engine_ast::SDPModeEnum::SDP_MODE_PER_CHANNEL) + { + int c = 0; + for ( ; c < scaleDims.c; ++c) + { + unitScaleValues[c] = 1; + trnsCnt++; + } + } + else if (scaleMode.v() == engine_ast::SDPModeEnum::SDP_MODE_PER_ELEMENT) + { + int i = 0; + for ( ; i < (scaleDims.c * scaleDims.w * scaleDims.h); ++i) + { + unitScaleValues[i] = 1; + trnsCnt++; + } + } + else + { + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Unsupported scale mode: %d\n", scaleMode.v()); + } + + ASSERT(trnsCnt == unitScaleCount); + + unitScaleData.type = getEnumFromType(); + unitScaleData.count = unitScaleCount; + unitScaleData.values = unitScaleValues; + + fail: + return unitScaleData; + } + + + //!< Converts per-layer scale data to per-channel scale data + // Repeats the same data #numChannels number of times. Data type is maintained after conversion + template + static Weights translatePLScaleToPCScale + ( + Weights& srcScale, //!< ptr to orig caffe mean blob + NvU32 numChannels //!< #channels + ) + { + Weights Scale_tr_data = Weights(nvdla::DataType::FLOAT, NULL, 0); + NvU32 newCount = numChannels * srcScale.count; + + API_CHECK_WEIGHTS_RETVAL(srcScale, Scale_tr_data); + + IT* pSrcScale = reinterpret_cast(const_cast(srcScale.values)); + IT* pDestScale = + reinterpret_cast(engine_ast::MemoryCollector::getInstance()->allocateMemory(newCount * sizeof(IT))); + + for (NvU32 ii = 0; ii < numChannels; ii++) + { + pDestScale[ii] = pSrcScale[0]; + } + + Scale_tr_data.type = srcScale.type; + Scale_tr_data.count = newCount; + Scale_tr_data.values = pDestScale; + + return Scale_tr_data; + } + + + //!< translate raw caffe scale-data to that suitable for SDP Scale + template + static Weights translateDataForScale + ( + engine_ast::SDPMode scaleMode, //!< per-layer/channel/elementwise + WeightDims scaleDims, //!< dims of orig caffe scale-data blob + Weights& srcScale, //!< ptr to orig caffe mean blob + int channelsPerGroup = 0 + ) + { + NvS64 trnsCount = 0; + Weights Scale_tr_data = Weights(nvdla::DataType::FLOAT, NULL, 0); + + API_CHECK_WEIGHTS_RETVAL(srcScale, Scale_tr_data); + + IT* pSrcScale = reinterpret_cast(const_cast(srcScale.values)); + + RT* pDestScale = + reinterpret_cast(engine_ast::MemoryCollector::getInstance()->allocateMemory(scaleDims.wtSize * sizeof(RT))); + memset(pDestScale, 0, scaleDims.wtSize * sizeof(RT)); + RT* pDestScaleCopy = pDestScale; + + /* Scale:-> y = x * scale_factor */ + + // Scale data can be of 3 types: per-layer/per-channel/per-element + // Per-Layer: + if (scaleMode.v() == engine_ast::SDPModeEnum::SDP_MODE_PER_LAYER) + { + *pDestScale = RT(pSrcScale[0]); + trnsCount++; + } + // Per-Channel: + else if (scaleMode.v() == engine_ast::SDPModeEnum::SDP_MODE_PER_CHANNEL) + { + int c = 0; + for ( ; c < scaleDims.numChannels; ++c) + { + IT srcScale = pSrcScale[c]; + *pDestScale = RT(srcScale); + ++pDestScale; + trnsCount++; + } + } + // Per-Element + else if (scaleMode.v() == engine_ast::SDPModeEnum::SDP_MODE_PER_ELEMENT) + { + /* Translate to feature format */ + Scale_tr_data = translatePESclDataToFD(scaleDims, srcScale, channelsPerGroup); + goto fail; + } + + Scale_tr_data.type = getEnumFromType(); + Scale_tr_data.values = pDestScaleCopy; + Scale_tr_data.count = trnsCount; + + fail: + return Scale_tr_data; + } + + /* Reciprocal of the data blob. */ + template + static Weights invertDataBlob + ( + engine_ast::SDPMode mode, // per-channel/layer + WeightDims dataDims, + Weights& rawData + ) + { + NvDlaError e = NvDlaSuccess; + Weights invertData = Weights(nvdla::DataType::FLOAT, NULL, 0); + NVDLA_UNUSED(e); + + IT* pRawBlob = reinterpret_cast(const_cast(rawData.values)); + IT* pInvertBlob; + + API_CHECK_WEIGHTS_RETVAL(rawData, invertData); + + invertData.type = rawData.type; + invertData.count = rawData.count; + pInvertBlob = + reinterpret_cast(engine_ast::MemoryCollector::getInstance()->allocateMemory(rawData.count * sizeof(IT))); + invertData.values = NULL; + + if (mode.v() == engine_ast::SDPModeEnum::SDP_MODE_PER_LAYER) + { + IT invertVal = IT(1) / pRawBlob[0]; + if (!isWithinNumericalLimits(invertVal)) + { + engine_ast::MemoryCollector::getInstance()->freeMemory(pInvertBlob); + goto fail; + } + pInvertBlob[0] = invertVal; + } + else if (mode.v() == engine_ast::SDPModeEnum::SDP_MODE_PER_CHANNEL) + { + for (int cc = 0; cc < dataDims.numChannels; ++cc) + { + IT invertVal = IT(1) / pRawBlob[cc]; + if (!isWithinNumericalLimits(invertVal)) + { + engine_ast::MemoryCollector::getInstance()->freeMemory(pInvertBlob); + goto fail; + } + pInvertBlob[cc] = invertVal; + } + } + else + { + ORIGINATE_ERROR_FAIL(NvDlaError_NotSupported, "Don't support invert data " + "for SDP mode %s", mode.c_str()); + } + + invertData.values = pInvertBlob; + + fail: + return invertData; + } + + private: + + struct Oplimits { + int startIndex; + int limit; + + Oplimits(int start, int limit): + startIndex(start), limit(limit) { }; + }; + + struct AtomicWtOp { + Oplimits kg; //!< the prevalent kernel group + Oplimits cg; //!< num of channel groups in 1 atomic wt op + Oplimits r; //!< kernel height to be covered in 1 atomic wt op + Oplimits s; //!< kernel width to be covered in 1 atomic wt op + Oplimits k; //!< num of kernels in 1 atomic wt op + Oplimits c; //!< num of channels in 1 atomic wt op + + AtomicWtOp(Oplimits kg, + Oplimits cg, + Oplimits r, + Oplimits s, + Oplimits k, + Oplimits c): + kg(kg), cg(cg), r(r), s(s), k(k), c(c) {} + }; + + struct IMGAtomicWtOp { + Oplimits kg; //!< the prevalent kernel group + Oplimits rg; //!< number of vertical lines in 1 atomic wt op + Oplimits s; //!< kernel width to be covered in 1 atomic wt op + Oplimits k; //!< number of kernels to be covered in 1 atomic wt op + Oplimits r; //!< kernel height to be covered in 1 atomic wt op + Oplimits c; //!< number of channels to be covered in 1 atomic wt op + + IMGAtomicWtOp(Oplimits kg, + Oplimits rg, + Oplimits s, + Oplimits k, + Oplimits r, + Oplimits c): + kg(kg), rg(rg), s(s), k(k), r(r), c(c) {} + }; + + template + static nvdla::DataType getEnumFromType() + { + nvdla::DataType ret = nvdla::DataType::UNKNOWN; + T max = std::numeric_limits::max(); + NvS8 nvs8_max = std::numeric_limits::max(); + NvS16 nvs16_max = std::numeric_limits::max(); + NvF32 fp32_max = std::numeric_limits::max(); + half_float::half half_max = std::numeric_limits::max(); + + + if (max == (T)nvs8_max) + { + ret = nvdla::DataType::INT8; + } + else if (max == (T)nvs16_max) + { + ret = nvdla::DataType::INT16; + } + else if (max == (T)half_max) + { + ret = nvdla::DataType::HALF; + } + else if (max == (T)fp32_max) + { + ret = nvdla::DataType::FLOAT; + } + return ret; + } + + //!< determine position in the wt blob from array indexes + template + static T* getAddrOffset + ( + int indK, //!< kernel index in the blob + int indC, //!< chnl index + int indR, //!< row index + int indS, //!< column index + WeightDims wDims, //!< dims of the wt blob + T* pWts //!< ptr to the wt blob + ) + { + if (indK >= wDims.numKernels || + indC >= wDims.numChannels || + indR >= wDims.height || + indS >= wDims.width) + { + return NULL; + } + + return &pWts[indS + + wDims.width*(indR + + wDims.height*(indC + + wDims.numChannels*(indK)))]; + } + + //!< determine position in the wt blob from array indexes for group operation + template + static T* getAddrOffsetForGroup + ( + int indK, //!< kernel index in the blob + int indC, //!< chnl index + int indR, //!< row index + int indS, //!< column index + int indG, //!< group index + int numChannels, //!< channel size of original weights + WeightDims wDims, //!< dims of the wt blob + T* pWts //!< ptr to the wt blob + ) + { + indC = indG * numChannels + indC; + + if (indK >= wDims.numKernels || + indC >= wDims.numChannels || + indR >= wDims.height || + indS >= wDims.width) + { + return NULL; + } + + return &pWts[indS + + wDims.width*(indR + + wDims.height*(indC + + wDims.numChannels*(indK)))]; + } + + //!< determine position in the raw caffe weights from array indexes suitable for IMD Pre Chnl Ext + template + static T* getCaffeAddrForIMGPreChnlExt + ( + int indK, //!< kernel index in the raw caffe wt blob + int indC, //!< channel index + int indR, //!< row index + int indS, //!< channel index + WeightDims caffeWDims, //!< dims of the wt blob + T* pCaffeWts //!< pts to the wt blob + ) + { + int caffeS = caffeWDims.width; + int caffeR = caffeWDims.height; + int caffeC = caffeWDims.numChannels; + NVDLA_UNUSED(indS); // indS is always 1 for pre Chnl Ext + + int ind_s = indC / caffeC; + int ind_r = indR; + int ind_c = indC % caffeC; + + if (ind_s < caffeS && ind_r < caffeR && ind_c < caffeC) + return &pCaffeWts[ind_s + + caffeS*(ind_r + + caffeR*(ind_c + + caffeC*(indK)))]; + else + return NULL; + } + + //!< determine position in the raw caffe weights from array indexes suitable for WG Chnl Ext + template + static T* getCaffeAddrForWGChnlExt + ( + int indK, //!< kernel index in theraw caffe wt blob + int indC, //!< channel index + int indR, //!< row index + int indS, //!< channel index + WeightDims caffeWDims, //!< dims of the wt blob + T* pCaffeWts //!< pts to the wt blob + ) + { + int caffeStX = caffeWDims.strideX; + int caffeStY = caffeWDims.strideY; + int caffeR = caffeWDims.height; + int caffeS = caffeWDims.width; + int caffeC = caffeWDims.numChannels; + + // change caffe_s only after 1 origC is finished + int ind_s = (indS * caffeStX) + ((indC % (caffeC * caffeStX)) / caffeC); + // change caffe_r only after 1 ceS row is finished + int ind_r = (indR * caffeStY) + (indC / (caffeC * caffeStX)); + int ind_c = indC % caffeC; + + if (ind_r < caffeR && ind_s < caffeS) + return &pCaffeWts[ind_s + + caffeS*(ind_r + + caffeR*(ind_c + + caffeC*(indK)))]; + else + return NULL; + } + + //!< determine position in the raw caffe weights from array indexes suitable for DC Chnl Ext (which is de-featured; keeping as backup) + template + static T* getCaffeAddrForDCChnlExt + ( + int indK, //!< kernel index in theraw caffe wt blob + int indC, //!< channel index + int indR, //!< row index + int indS, //!< channel index + WeightDims caffeWDims, //!< dims of the wt blob + T* pCaffeWts //!< pts to the wt blob + ) + { + return getCaffeAddrForWGChnlExt(indK, indC, indR, indS, caffeWDims, pCaffeWts); + } + + //!< prepare weight translation sub-ops for IMG post channel extension + template + static void prepWtTrnsOpsForIMGPostCE + ( + WeightDims wDims, //!< dimensions of the weights + NvU32 postExtFactor, + std::vector& vWtOps, //!< list of all operations to achieve the translation + int atomicKSize, + int atomicCSize + ) + { + int s = wDims.width; + int c = wDims.numChannels; + int rf = postExtFactor; + int kf = (sizeof(RT) == 1 ? atomicKSize : (atomicKSize / 2)); + int rfg = wDims.height / rf; + int kfg = wDims.numKernels / kf; + int rp = wDims.height % rf; + int kp = wDims.numKernels % kf; + int rpg = 1; //!< partial row group will always be 1 in number if any + int kpg = 1; //!< partial kernel group will always be 1 in number if any + + const int FULL_ROWS_PER_GROUP = rf; + + if (c > atomicCSize || rfg <= 1) + return; + + bool isFullRowGroupsPoss = rfg > 0 ? true : false; + bool isFullKrnlGroupsPoss = kfg > 0 ? true : false; + bool isPartRowGroupsPoss = rp > 0 ? true : false; + bool isPartKrnlGroupsPoss = kp > 0 ? true : false; + + //!< Prepare atomic ops for full kernel groups + if (isFullKrnlGroupsPoss) + { + for (int ind_kfg = 0; ind_kfg < kfg; ++ind_kfg) + { + if (isFullRowGroupsPoss) + { + vWtOps.push_back( + IMGAtomicWtOp(Oplimits(ind_kfg, 1), + Oplimits(0, rfg), + Oplimits(0, s), + Oplimits(0, kf), + Oplimits(0, rf), + Oplimits(0, c))); + } + if (isPartRowGroupsPoss) + { + vWtOps.push_back( + IMGAtomicWtOp(Oplimits(ind_kfg, 1), + Oplimits(0, rpg), + Oplimits(0, s), + Oplimits(0, kf), + Oplimits(rfg * FULL_ROWS_PER_GROUP, rp), + Oplimits(0, c))); + } + } + } + + //!< Prepare atomic ops for the partial kernel group + if (isPartKrnlGroupsPoss) + { + if (isFullRowGroupsPoss) + { + vWtOps.push_back( + IMGAtomicWtOp(Oplimits(kfg, kpg), + Oplimits(0, rfg), + Oplimits(0, s), + Oplimits(0, kp), + Oplimits(0, rf), + Oplimits(0, c))); + } + if (isPartRowGroupsPoss) + { + vWtOps.push_back( + IMGAtomicWtOp(Oplimits(kfg, kpg), + Oplimits(0, rpg), + Oplimits(0, s), + Oplimits(0, kp), + Oplimits(rfg * FULL_ROWS_PER_GROUP, rp), + Oplimits(0, c))); + } + } + } + + //!< execute the wt translation sub-ops for IMG Post Chnl Ext + template + static Weights execWtTrnsOpsForIMGPostCE + ( + WeightDims wDims, //!< dims of the conv layer wts + IT* pSrcWts, //!< surface ptr of caffe wts + const std::vector& vWtOps, //!< list of wt translation ops + int atomicKSize, + int atomicCSize, + int cbufWidth + ) + { + NvS64 trnsCnt = 0; + Weights IMG_Post_CE_Wts = Weights(nvdla::DataType::FLOAT, NULL, 0); + + RT* pIMGPostCEWts = + reinterpret_cast(engine_ast::MemoryCollector::getInstance()->allocateMemory( + ROUNDUP_AND_ALIGN(wDims.wtSize * sizeof(RT), cbufWidth))); + memset(pIMGPostCEWts, 0, ROUNDUP_AND_ALIGN(wDims.wtSize * sizeof(RT), cbufWidth)); + RT* pIMGPostCEWtsCopy = pIMGPostCEWts; + + int ind_rg = 0; + int ind_s = 0; + int ind_k = 0; + int ind_r = 0; + int ind_c = 0; + int krnlPerGrp = (sizeof(RT) == 1 ? atomicKSize : (atomicKSize / 2)); + + const int FULL_ROWS_PER_GROUP = atomicCSize / wDims.numChannels; + + std::vector::const_iterator iterWtOp = vWtOps.begin(); + for ( ; iterWtOp != vWtOps.end(); ++iterWtOp) + { + for (ind_rg = iterWtOp->rg.startIndex; + ind_rg < iterWtOp->rg.limit; + ++ind_rg) + { + for (ind_s = iterWtOp->s.startIndex; + ind_s < iterWtOp->s.limit; + ++ind_s) + { + for (ind_k = iterWtOp->kg.startIndex*krnlPerGrp; + ind_k < iterWtOp->kg.startIndex*krnlPerGrp + + iterWtOp->k.limit; + ++ind_k) + { + for (ind_r = ind_rg*FULL_ROWS_PER_GROUP + + iterWtOp->r.startIndex; + ind_r < (ind_rg*FULL_ROWS_PER_GROUP + + iterWtOp->r.startIndex + + iterWtOp->r.limit); + ++ind_r) + { + for (ind_c = iterWtOp->c.startIndex; + ind_c < iterWtOp->c.limit; + ++ind_c) + { + // We only support: + // - int8 -> int8 translation + // - int16-> int16 translation + // - fp16 -> fp16 translation + // - fp32 -> fp32 translation (will deprecate soon) + // - fp32 -> fp16 translation + IT value = pSrcWts[ind_s + + wDims.width*(ind_r + + wDims.height*(ind_c + + wDims.numChannels*(ind_k)))]; + *pIMGPostCEWts = RT(value); + ++pIMGPostCEWts; + ++trnsCnt; + } + } + } + } + } + } + + IMG_Post_CE_Wts.type = getEnumFromType(); + IMG_Post_CE_Wts.values = pIMGPostCEWtsCopy; + IMG_Post_CE_Wts.count = trnsCnt; + + return IMG_Post_CE_Wts; + } + + //!< do a slow channel extension for direct convolution + template + static T* doSlowCEForDC + ( + WeightDims& origWDims, //!< dims of orig non chnl extnd wt blob + T* pSrcWts //!< ptr to orig non chnl extnd wt blob + ) + { + T* pDCCEWts; + T* pDCCEWtsCopy; + WeightDims ceWDims; + + int origR = origWDims.height; + int origS = origWDims.width; + int origC = origWDims.numChannels; + int origK = origWDims.numKernels; + int origStX = origWDims.strideX; + int origStY = origWDims.strideY; + + if (origStX == 1 && origStY == 1) + { + return pSrcWts; + } + + int ceR = (origR + origStY - 1)/origStY; + int ceS = (origS + origStX - 1)/origStX; + int ceC = origC * origStX * origStY; + int ceWtSize = origK * ceC * ceR * ceS; + + ceWDims.height = ceR; + ceWDims.width = ceS; + ceWDims.numChannels = ceC; + ceWDims.numKernels = origK; + ceWDims.strideX = 1; + ceWDims.strideY = 1; + ceWDims.wtSize = ceWtSize; + + pDCCEWts = reinterpret_cast(engine_ast::MemoryCollector::getInstance()->allocateMemory(ceWtSize * sizeof(T))); + memset(pDCCEWts, 0, ceWtSize * sizeof(T)); + pDCCEWtsCopy = pDCCEWts; + + for (int ind_k = 0; ind_k < origK; ++ind_k) + for (int ind_c = 0; ind_c < ceC; ++ind_c) + for (int ind_r = 0; ind_r < ceR; ++ind_r) + for (int ind_s = 0; ind_s < ceS; ++ind_s) + { + T* dest = getAddrOffset(ind_k, ind_c, ind_r, ind_s, + ceWDims, pDCCEWts); + T* src = getCaffeAddrForDCChnlExt(ind_k, ind_c, ind_r, + ind_s, origWDims, pSrcWts); + if (src != NULL) + *dest = *src; + else + *dest = 0.0f; + } + + origWDims = ceWDims; + return pDCCEWtsCopy; + } + + //!< do chnl extension for direct convolution + template + static T* doCEForDC + ( + WeightDims& wDims, //!< dims of orig non chnl extnd wt blob + T* pSrcWts //!< ptr to orig non chnl extnd wt blob + ) + { + T* pDCCEWts; + T* pDCCEWtsCopy; + + int origR = wDims.height; + int origS = wDims.width; + int origC = wDims.numChannels; + int origK = wDims.numKernels; + int origStX = wDims.strideX; + int origStY = wDims.strideY; + + if (origStX == 1 && origStY == 1) + { + return pSrcWts; + } + + int ceR = (origR + origStY - 1)/origStY; + int ceS = (origS + origStX - 1)/origStX; + int ceC = origC * origStX * origStY; + int ceWtSize = origK * ceC * ceR * ceS; + + pDCCEWts = reinterpret_cast(engine_ast::MemoryCollector::getInstance()->allocateMemory(ceWtSize * sizeof(T))); + memset(pDCCEWts, 0, ceWtSize * sizeof(T)); + pDCCEWtsCopy = pDCCEWts; + + for (int ind_k = 0; ind_k < origK; ++ind_k) + for (int ind_c = 0; ind_c < ceC; ++ind_c) + for (int ind_r = 0; ind_r < ceR; ++ind_r) + for (int ind_s = 0; ind_s < ceS; ++ind_s) + { + // change caffe_s only after 1 origC is finished + int caffe_s = (ind_s * origStX) + + ((ind_c % (origC * origStX)) / origC); + // change caffe_r only after 1 ceS row is finished + int caffe_r = (ind_r * origStY) + + (ind_c / (origC * origStX)); + int caffe_c = ind_c % origC; + if (caffe_r < origR && caffe_s < origS) + *pDCCEWts = pSrcWts[caffe_s + + origS*(caffe_r + + origR*(caffe_c + + origC*(ind_k)))]; + else + *pDCCEWts = 0; + ++pDCCEWts; + } + wDims.height = ceR; + wDims.width = ceS; + wDims.numChannels = ceC; + wDims.wtSize = ceWtSize; + wDims.strideX = 1; + wDims.strideY = 1; + + return pDCCEWtsCopy; + } + + //!< prepare weight translation sub-ops for direct convolution + template + static void prepWtTrnsOpsForDC + ( + WeightDims wDims, //!< dimensions of the weights + std::vector& vWtOps, //!< list of all operations to achieve the translation + int atomicKSize, + int atomicCSize + ) + { + int r = wDims.height; + int s = wDims.width; + int cf = atomicCSize; + int cp = wDims.numChannels % atomicCSize; + int cfg = wDims.numChannels / atomicCSize; + int cpg = 1; //!< Partial channel group will always be 1 in number if any + int kf = (sizeof(RT) == 1 ? atomicKSize : (atomicKSize / 2)); + int kp = wDims.numKernels % kf; + int kfg = wDims.numKernels / kf; + int kpg = 1; //!< Partial kernel group will always be 1 in number if any + + bool isFullChnlGroupsPoss = cfg > 0 ? true : false; + bool isFullKrnlGroupsPoss = kfg > 0 ? true : false; + bool isPartChnlGroupsPoss = cp > 0 ? true : false; + bool isPartKrnlGroupsPoss = kp > 0 ? true : false; + + //!< Prepare atomic ops for full kernel groups + if (isFullKrnlGroupsPoss) + { + for (int ind_kfg = 0; ind_kfg < kfg; ++ind_kfg) + { + if (isFullChnlGroupsPoss) + { + vWtOps.push_back( + AtomicWtOp(Oplimits(ind_kfg, 1), + Oplimits(0, cfg), + Oplimits(0, r), + Oplimits(0, s), + Oplimits(0, kf), + Oplimits(0, cf))); + } + if (isPartChnlGroupsPoss) + { + vWtOps.push_back( + AtomicWtOp(Oplimits(ind_kfg, 1), + Oplimits(0, cpg), + Oplimits(0, r), + Oplimits(0, s), + Oplimits(0, kf), + Oplimits(cfg*atomicCSize, cp))); + } + } + } + + //!< Prepare atomic ops for the partial kernel group + if (isPartKrnlGroupsPoss) + { + if (isFullChnlGroupsPoss) + { + vWtOps.push_back( + AtomicWtOp(Oplimits(kfg, kpg), + Oplimits(0, cfg), + Oplimits(0, r), + Oplimits(0, s), + Oplimits(0, kp), + Oplimits(0, cf))); + } + if (isPartChnlGroupsPoss) + { + vWtOps.push_back( + AtomicWtOp(Oplimits(kfg, kpg), + Oplimits(0, cpg), + Oplimits(0, r), + Oplimits(0, s), + Oplimits(0, kp), + Oplimits(cfg*atomicCSize, cp))); + } + } + } + + //!< prepare weight translation sub-ops for deconvolution (same as direct convolution) + template + static void prepWtTrnsOpsForDeconv + ( + WeightDims wDims, //!< dimensions of the weights + std::vector& vWtOps, //!< list of all operations to achieve the translation + int atomicKSize, + int atomicCSize + ) + { + prepWtTrnsOpsForDC(wDims, vWtOps, atomicKSize, atomicCSize); + } + + //!< execute the wt translation sub-ops for DC + template + static Weights execWtTrnsOpsForDC + ( + WeightDims wDims, //!< dims of the conv layer wts + IT* pSrcWts, //!< surface ptr of caffe wts + const std::vector& vWtOps, //!< list of wt translation ops + int atomicKSize, + int atomicCSize, + int cbufWidth + ) + { + NvS64 trns_size = 0; + int ind_cg = 0; + int ind_r = 0; + int ind_s = 0; + int ind_k = 0; + int ind_c = 0; + Weights DC_tr_wts; + std::vector::const_iterator iterWtOp = vWtOps.begin(); + int krnlPerGrp = (sizeof(RT) == 1 ? atomicKSize : (atomicKSize / 2)); + + RT* pDCDestWts = + reinterpret_cast(engine_ast::MemoryCollector::getInstance()->allocateMemory( + ROUNDUP_AND_ALIGN(wDims.wtSize * sizeof(RT), cbufWidth))); + memset(pDCDestWts, 0, ROUNDUP_AND_ALIGN(wDims.wtSize * sizeof(RT), cbufWidth)); + RT* pDCDestWtsCopy = pDCDestWts; + + for ( ; iterWtOp != vWtOps.end(); ++iterWtOp) + { + for (ind_cg = iterWtOp->cg.startIndex; + ind_cg < iterWtOp->cg.limit; + ++ind_cg) + { + for (ind_r = iterWtOp->r.startIndex; + ind_r < iterWtOp->r.limit; + ++ind_r) + { + for (ind_s = iterWtOp->s.startIndex; + ind_s < iterWtOp->s.limit; + ++ind_s) + { + for (ind_k = iterWtOp->kg.startIndex*krnlPerGrp; + ind_k < iterWtOp->kg.startIndex*krnlPerGrp + + iterWtOp->k.limit; + ++ind_k) + { + for (ind_c = ind_cg*atomicCSize + + iterWtOp->c.startIndex; + ind_c < (ind_cg*atomicCSize + + iterWtOp->c.startIndex + + iterWtOp->c.limit); + ++ind_c) + { + // We only support: + // - int8 -> int8 translation + // - int16-> int16 translation + // - fp16 -> fp16 translation + // - fp32 -> fp32 translation (will deprecate soon) + // - fp32 -> fp16 translation + IT value = pSrcWts[ind_s + + iterWtOp->s.limit*(ind_r + + iterWtOp->r.limit*(ind_c + + wDims.numChannels*(ind_k)))]; + *pDCDestWts = RT(value); + ++pDCDestWts; + ++trns_size; + } + } + } + } + } + } + + DC_tr_wts.type = getEnumFromType(); + DC_tr_wts.values = pDCDestWtsCopy; + DC_tr_wts.count = trns_size; + + return DC_tr_wts; + } + + //!< execute the wt translation sub-ops for Deconvoltion + //!< (same as direct convolution, except that the kernel bytes are laid out in the reverse raster scan order + //!< for eg: (Sn-1,Rn-1) -> (Sn-2,Rn-1) ------> (S1,R0) -> (S0,R0) + template + static Weights execWtTrnsOpsForDeconv + ( + WeightDims wDims, //!< dims of the conv layer wts + IT* pSrcWts, //!< surface ptr of caffe wts + const std::vector& vWtOps, //!< list of wt translation ops + int atomicKSize, + int atomicCSize, + int cbufWidth + ) + { + NvS64 trns_size = 0; + int ind_cg = 0; + int ind_r = 0; + int ind_s = 0; + int ind_k = 0; + int ind_c = 0; + Weights DC_tr_wts; + std::vector::const_iterator iterWtOp = vWtOps.begin(); + int krnlPerGrp = (sizeof(RT) == 1 ? atomicKSize : (atomicKSize / 2)); + + RT* pDCDestWts = + reinterpret_cast(engine_ast::MemoryCollector::getInstance()->allocateMemory( + ROUNDUP_AND_ALIGN(wDims.wtSize * sizeof(RT), cbufWidth))); + memset(pDCDestWts, 0, ROUNDUP_AND_ALIGN(wDims.wtSize * sizeof(RT), cbufWidth)); + RT* pDCDestWtsCopy = pDCDestWts; + + for ( ; iterWtOp != vWtOps.end(); ++iterWtOp) + { + for (ind_cg = iterWtOp->cg.startIndex; + ind_cg < iterWtOp->cg.limit; + ++ind_cg) + { + for (ind_r = iterWtOp->r.limit - 1; + ind_r >= iterWtOp->r.startIndex; + --ind_r) + { + for (ind_s = iterWtOp->s.limit - 1; + ind_s >= iterWtOp->s.startIndex; + --ind_s) + { + for (ind_k = iterWtOp->kg.startIndex*krnlPerGrp; + ind_k < iterWtOp->kg.startIndex*krnlPerGrp + + iterWtOp->k.limit; + ++ind_k) + { + for (ind_c = ind_cg*atomicCSize + + iterWtOp->c.startIndex; + ind_c < (ind_cg*atomicCSize + + iterWtOp->c.startIndex + + iterWtOp->c.limit); + ++ind_c) + { + // We only support: + // - int8 -> int8 translation + // - int16-> int16 translation + // - fp16 -> fp16 translation + // - fp32 -> fp32 translation (will deprecate soon) + // - fp32 -> fp16 translation + IT value = pSrcWts[ind_s + + iterWtOp->s.limit*(ind_r + + iterWtOp->r.limit*(ind_c + + wDims.numChannels*(ind_k)))]; + *pDCDestWts = RT(value); + ++pDCDestWts; + ++trns_size; + } + } + } + } + } + } + + DC_tr_wts.type = getEnumFromType(); + DC_tr_wts.values = pDCDestWtsCopy; + DC_tr_wts.count = trns_size; + + return DC_tr_wts; + } + + //!< add zero padding to the wt blob for Winograd convolution + template + static T* padZerosForWG + ( + WeightDims& wDims, //!< dims of the raw wt blob + T* pSrcWts, //!< original wt blob + int numPadChnls, //!< numChnls to be zero padded after existing chnls + std::map& mCaffeHash //!< hash of the entire wt blob + ) + { + bool isSanityOn = mCaffeHash.size() > 0 ? true : false; + std::string key; + T* pWGZPWts; + T* pWGZPWtsCopy; + + NvU64 zeroPadWtSize = wDims.numKernels * + wDims.height * + wDims.width * + (wDims.numChannels + numPadChnls); + pWGZPWts = reinterpret_cast(engine_ast::MemoryCollector::getInstance()->allocateMemory(zeroPadWtSize * sizeof(T))); + pWGZPWtsCopy = pWGZPWts; + + for (int ind_k = 0; ind_k < wDims.numKernels; ++ind_k) + { + //!< copy existing channels as it is upto origC + for (int ind_c = 0; ind_c < wDims.numChannels; ++ind_c) + for (int ind_r = 0; ind_r < wDims.height; ++ind_r) + for (int ind_s = 0; ind_s < wDims.width; ++ind_s) + { + *pWGZPWts = pSrcWts[ind_s + + wDims.width*(ind_r + + wDims.height*(ind_c + + wDims.numChannels*(ind_k)))]; + key = toString(ind_k) + "-" + + toString(ind_c) + "-" + + toString(ind_r) + "-" + + toString(ind_s); + + if (isSanityOn) + mCaffeHash.insert(std::pair(key, *pWGZPWts)); + + ++pWGZPWts; + } + //!< add zero padded channels upto numPadChnls + for (int ind_czp = wDims.numChannels; + ind_czp < (wDims.numChannels + numPadChnls); ++ind_czp) + for (int ind_r = 0; ind_r < wDims.height; ++ind_r) + for (int ind_s = 0; ind_s < wDims.width; ++ind_s) + { + *pWGZPWts = 0; + key = toString(ind_k) + "-" + + toString(ind_czp) + "-" + + toString(ind_r) + "-" + + toString(ind_s); + + if (isSanityOn) + mCaffeHash.insert(std::pair(key, *pWGZPWts)); + + ++pWGZPWts; + } + } + + wDims.numChannels += numPadChnls; + wDims.wtSize = zeroPadWtSize; + + return pWGZPWtsCopy; + } + + + //!< do chnl extension for WG + template + static T* doCEForWG + ( + WeightDims &origWDims, //!< dims of orig non chnl extnd wt blob + T* pSrcWts, //!< ptr to orig non chnl extnd wt blob + std::map& mCaffeHash //!< hash of the entire wt blob + ) + { + bool isSanityOn = mCaffeHash.size() > 0 ? true : false; + std::string key; + T* pWGCEWts; + T* pWGCEWtsCopy; + WeightDims ceWDims; + + int origR = origWDims.height; + int origS = origWDims.width; + int origC = origWDims.numChannels; + int origK = origWDims.numKernels; + int origStX = origWDims.strideX; + int origStY = origWDims.strideY; + + int ceR = (origR + origStY - 1)/origStY; + int ceS = (origS + origStX - 1)/origStX; + + if (ceR != 3 || ceS != 3) + { + return pSrcWts; + } + + int ceC = origC * origStX * origStY; + int ceWtSize = origK * ceC * ceR * ceS; + + ceWDims.height = ceR; + ceWDims.width = ceS; + ceWDims.numChannels = ceC; + ceWDims.numKernels = origK; + ceWDims.strideX = 1; + ceWDims.strideY = 1; + ceWDims.wtSize = ceWtSize; + + pWGCEWts = reinterpret_cast(engine_ast::MemoryCollector::getInstance()->allocateMemory(ceWtSize * sizeof(T))); + pWGCEWtsCopy = pWGCEWts; + + for (int ind_k = 0; ind_k < origK; ++ind_k) + for (int ind_c = 0; ind_c < ceC; ++ind_c) + for (int ind_r = 0; ind_r < ceR; ++ind_r) + for (int ind_s = 0; ind_s < ceS; ++ind_s) + { + T* dest = getAddrOffset(ind_k, ind_c, ind_r, ind_s, + ceWDims, pWGCEWts); + T* src = getCaffeAddrForWGChnlExt(ind_k, ind_c, ind_r, + ind_s, origWDims, pSrcWts); + if (src != NULL) + *dest = *src; + else + *dest = 0.0f; + key = toString(ind_k) + "-" + + toString(ind_c) + "-" + + toString(ind_r) + "-" + + toString(ind_s); + + if (isSanityOn) + mCaffeHash.insert(std::pair(key, *dest)); + } + + + origWDims = ceWDims; + return pWGCEWtsCopy; + } + + //!< convert a 3x3 matrix to 4x4 for Winograd + template + static void WGMatrixUtil + ( + int indKrnl, + int indChnl, + int numChnls, + T* pSrcWts, + T* pWGMatTrWts + ) + { + const NvF32 G[4][3] = { + {1, 0, 0}, + {0.5, 0.5, 0.5}, + {0.5, -0.5, 0.5}, + {0, 0, 1}, + }; + const NvF32 Gt[3][4] = { + {1, 0.5, 0.5, 0}, + {0, 0.5, -0.5, 0}, + {0, 0.5, 0.5, 1} + }; + T g[3][3] = {{T(0)}}; + NvF32 temp[4][3] = {{0.0f}}; + NvF32 trnsFP32Wts[4][4] = {{0.0f}}; + + for (int ind_r = 0; ind_r < 3; ind_r++) + { + for (int ind_s = 0; ind_s < 3; ind_s++) + { + g[ind_r][ind_s] = pSrcWts[ind_s + + 3*(ind_r + + 3*(indChnl + + numChnls*(indKrnl)))]; + } + } + + //Matrix multiply (Gxg)xGt + for (int ind_m = 0; ind_m < 4; ++ind_m) + { + for (int ind_p = 0; ind_p < 3; ++ind_p) + { + temp[ind_m][ind_p] = 0.0f; + for (int ind_n = 0; ind_n < 3; ++ind_n) + temp[ind_m][ind_p] += G[ind_m][ind_n] * g[ind_n][ind_p]; + } + } + + //Matrix multiply Gx(gxGt) + for (int ind_r = 0; ind_r < 4; ++ind_r) + { + for (int ind_s = 0; ind_s < 4; ++ind_s) + { + for (int ind_n = 0; ind_n < 3; ++ind_n) + { + trnsFP32Wts[ind_r][ind_s] += temp[ind_r][ind_n] * Gt[ind_n][ind_s]; + } + NvU32 target_ind = ind_s + 4*(ind_r + 4*(indChnl + numChnls*(indKrnl))); + pWGMatTrWts[target_ind] = T(trnsFP32Wts[ind_r][ind_s]); + } + } + } + + //!< convert 3x3xC matrix to 4x4xC + template + static T* WGMatrixTrns + ( + WeightDims& wDims, + T* pSrcWts + ) + { + T* pWGMatTrWts; + T* pWGMatTrWtsCopy; + + //Here the kernels would be resized to 4x4xC each + NvU64 mtWtSize = wDims.numKernels * wDims.numChannels * 4 * 4; + + pWGMatTrWts = reinterpret_cast(engine_ast::MemoryCollector::getInstance()->allocateMemory(mtWtSize * sizeof(T))); + pWGMatTrWtsCopy = pWGMatTrWts; + + for (int ind_k = 0; ind_k < wDims.numKernels; ++ind_k) + { + for (int ind_c = 0; ind_c < wDims.numChannels; ++ind_c) + { + //Convert the weights from 3x3xC to 4x4xC format1 chnl at a time + WGMatrixUtil(ind_k, ind_c, wDims.numChannels, + pSrcWts, pWGMatTrWts); + } + } + + + wDims.width = 4; + wDims.height = 4; + wDims.wtSize = mtWtSize; + + return pWGMatTrWtsCopy; + } + + //!< prepare wt translation ops for WG + template + static void prepWtTrnsOpsForWG + ( + WeightDims wDims, //!< dimensions of the weights + std::vector& vWtOps //!< list of all operations to achieve the translation + ) + { + int r = wDims.height; + int s = wDims.width; + int cf = WG_FULL_CHANNELS_PER_ATOM; + int cfg = wDims.numChannels / WG_FULL_CHANNELS_PER_ATOM; + int kf = sizeof(RT) == 1 ? 32 : 16; + int kp = wDims.numKernels % kf; + int kfg = wDims.numKernels / kf; + int kpg = 1; //!< Partial kernel group will always be 1 in number + + bool isFullKrnlGroupsPoss = kfg > 0 ? true : false; + bool isFullChnlGroupsPoss = cfg > 0 ? true : false; + bool isPartKrnlGroupsPoss = kp > 0 ? true : false; + bool isPartChnlGroupsPoss = false; //!< In WG, #chanls are rounded upto nearest multiple of 32 + NVDLA_UNUSED(isPartChnlGroupsPoss); + + //!< Prepare atomic ops for full kernel groups + if (isFullKrnlGroupsPoss) + { + for (int ind_kfg = 0; ind_kfg < kfg; ++ind_kfg) + { + if (isFullChnlGroupsPoss) + { + vWtOps.push_back( + AtomicWtOp(Oplimits(ind_kfg, 1), + Oplimits(0, cfg), + Oplimits(0, r), + Oplimits(0, s), + Oplimits(0, kf), + Oplimits(0, cf))); + } + } + } + + //!< Prepare atomic ops for the partial kernel group + if (isPartKrnlGroupsPoss) + { + if (isFullChnlGroupsPoss) + { + vWtOps.push_back( + AtomicWtOp(Oplimits(kfg, kpg), + Oplimits(0, cfg), + Oplimits(0, r), + Oplimits(0, s), + Oplimits(0, kp), + Oplimits(0, cf))); + } + } + } + + + //!< exec wt translation ops for WG + template + static Weights execWtTrnsOpsForWG + ( + WeightDims wDims, //!< dims of the output wt blob + IT* pSrcWts, //!< ptr to the processed caffe wt blob + const std::vector& vWtOps //!< list of ops to trns the caffe blob + ) + { + int krnlPerGrp = sizeof(RT) == 1 ? 32 : 16; + RT* pWGDestWts; + RT* pWGDestWtsCopy; + NvS64 trns_size = 0; + Weights WG_tr_wts; + + std::vector::const_iterator iterWtOp = vWtOps.begin(); + + pWGDestWts = + reinterpret_cast(engine_ast::MemoryCollector::getInstance()->allocateMemory( + ROUNDUP_AND_ALIGN(wDims.wtSize * sizeof(RT), WG_WTS_SIZE_ALIGN))); + memset(pWGDestWts, 0, ROUNDUP_AND_ALIGN(wDims.wtSize * sizeof(RT), WG_WTS_SIZE_ALIGN)); + pWGDestWtsCopy = pWGDestWts; + + for (int loop = 0; iterWtOp != vWtOps.end(); ++iterWtOp, ++loop) + { + for (int ind_cg = iterWtOp->cg.startIndex; + ind_cg < iterWtOp->cg.limit; + ++ind_cg) + { + for (int ind_k = iterWtOp->kg.startIndex*krnlPerGrp; + ind_k < iterWtOp->kg.startIndex*krnlPerGrp + + iterWtOp->k.limit; + ++ind_k) + { + for (int ind_r = iterWtOp->r.startIndex; + ind_r < iterWtOp->r.limit; + ++ind_r) + { + for (int ind_s = iterWtOp->s.startIndex; + ind_s < iterWtOp->s.limit; + ++ind_s) + { + for (int ind_c = ind_cg*WG_FULL_CHANNELS_PER_ATOM; + ind_c < (ind_cg*WG_FULL_CHANNELS_PER_ATOM + + iterWtOp->c.limit); + ++ind_c) + { + IT value = pSrcWts[ind_s + + iterWtOp->s.limit*(ind_r + + iterWtOp->r.limit*(ind_c + + wDims.numChannels*(ind_k)))]; + // We only support: + // - int8 -> int8 translation + // - int16-> int16 translation + // - fp16 -> fp16 translation + // - fp32 -> fp32 translation (will deprecate soon) + // - fp32 -> fp16 translation + *pWGDestWts = RT(value); + ++pWGDestWts; + ++trns_size; + } + } + } + } + } + } + + WG_tr_wts.type = getEnumFromType(); + WG_tr_wts.values = pWGDestWtsCopy; + WG_tr_wts.count = trns_size; + + return WG_tr_wts; + } + + + //!< get original 3x3 matrix from 4x4 by doing inverse WG translation + template + static void getOrigWGMat + ( + T trnsMat[4][4], + T (&origMat)[3][3] + ) + { + T temp[3][4] = {{T(0)}}; + const NvS8 GInv[3][4] = { + {1, 0, 0, 0}, + {0, 1, -1, 0}, + {0, 0, 0, 1}, + }; + + const NvS8 GtInv[4][3] = { + {1, 0, 0}, + {0, 1, 0}, + {0, -1, 0}, + {0, 0, 1}, + }; + + //Matrix multiply [G^(-1)xGxgxGt]xGt^(-1) + for(int ind_m = 0; ind_m < 3; ++ind_m) + { + for (int ind_p = 0; ind_p < 4; ++ind_p) + { + temp[ind_m][ind_p] = 0.0f; + for (int ind_n = 0; ind_n < 4; ++ind_n) + temp[ind_m][ind_p] += GInv[ind_m][ind_n] * + trnsMat[ind_n][ind_p]; + } + } + + //Matrix multiply G^(-1)x[GxgxGtxGt^(-1)] + for (int ind_r = 0; ind_r < 3; ++ind_r) + { + for (int ind_s = 0; ind_s < 3; ++ind_s) + { + origMat[ind_r][ind_s] = 0; + for (int ind_n = 0; ind_n < 4; ++ind_n) { + origMat[ind_r][ind_s] += temp[ind_r][ind_n] * + GtInv[ind_n][ind_s]; + } + } + } + } + + //!< compare 2 3x3 matrices + template + static int compare3By3Matrices + ( + T mat1[][3], + T mat2[][3] + ) + { + for (int ind_m = 0; ind_m < 3; ++ind_m) + for (int ind_n = 0; ind_n < 3; ++ind_n) + if (round(1000 * mat1[ind_m][ind_n]) != + round(1000 * mat2[ind_m][ind_n])) + { + // try a bigger hammer one more time b4 failing + if (round(100 * mat1[ind_m][ind_n]) != + round(100 * mat2[ind_m][ind_n])) + return -1; + else + continue; + } + return 0; + } + + + //!< get original 3x3x3 cube from 4x4x4 + template + static void getOrigWGCube + ( + T trnsCube[4][4][4], + T (&origCube)[3][3][3] + ) + { + T trnsMat[4][4] = {{T(0)}}; + T origMat[3][3] = {{T(0)}}; + for (int ind_c = 0; ind_c < 4; ++ind_c) + { + memset(trnsMat, 0, sizeof(trnsMat[0][0]) * 4 * 4); + for (int ind_r = 0; ind_r < 4; ++ind_r) + { + for (int ind_s = 0; ind_s < 4; ++ind_s) + { + trnsMat[ind_r][ind_s] = trnsCube[ind_r][ind_s][ind_c]; + } + } + + memset(origMat, 0, sizeof(origMat[0][0]) * 3 * 3); + getOrigWGMat(trnsMat, origMat); + for (int ind_r = 0; ind_r < 3; ++ind_r) + { + for (int ind_s = 0; ind_s < 3; ++ind_s) + { + origCube[ind_r][ind_s][ind_c] = origMat[ind_r][ind_s]; + } + } + } + } + + //!< run sanity after doing CE for DC + template + static int runSanityForDCWtChnlExt + ( + T* pSrcWts, //!< orig wt blob + WeightDims srcWDims, //!< dims of orig wt blob + T* pDCCEWts, //!< chnl extnd wt blob + WeightDims ceWDims //!< dims of chnl extnd wt blob + ) + { + T ceWt; + T caffeWt; + for (int ind_k = 0; ind_k < ceWDims.numKernels; ++ind_k) + for (int ind_c = 0; ind_c < ceWDims.numChannels; ++ind_c) + for (int ind_r = 0; ind_r < ceWDims.height; ++ind_r) + for (int ind_s = 0; ind_s < ceWDims.width; ++ind_s) + { + ceWt = pDCCEWts[ind_s + + ceWDims.width*(ind_r + + ceWDims.height*(ind_c + + ceWDims.numChannels*(ind_k)))]; + int orig_c = ind_c % srcWDims.numChannels; + int orig_r = (ind_r * srcWDims.strideY) + + ((ind_c / srcWDims.numChannels) / + srcWDims.strideY); + int orig_s = (ind_s * srcWDims.strideX) + + ((ind_c / srcWDims.numChannels) % + srcWDims.strideX); + if (orig_r < srcWDims.height && + orig_s < srcWDims.width) + caffeWt = pSrcWts[orig_s + + srcWDims.width*(orig_r + + srcWDims.height*(orig_c + + srcWDims.numChannels*(ind_k)))]; + else + caffeWt = 0; + if (ceWt != caffeWt) + { + return -1; + } + } + return 0; + } + + //!< run sanity after complete wt translation for DC + template + static int runSanityForDCWtTrns + ( + RT* pDCTrWts, //!< ptr to translated wt blob for DC + WeightDims srcWDims, //!< dims of translated wt blob for DC + std::vector vWtOps, //!< list of all ops to achieve wt translation for DC + std::map& mCaffeHash, //!< hash of entire raw caffe wt blob + int atomicKSize, + int atomicCSize + ) + { + int err = 0; + std::map mDCHash; + mDCHash.clear(); + + int krnlPerGrp = (sizeof(RT) == 1 ? atomicKSize : (atomicKSize / 2)); + + std::vector::const_iterator iterWtOp = vWtOps.begin(); + + for ( ; iterWtOp != vWtOps.end(); ++iterWtOp) + { + for (int ind_cg = iterWtOp->cg.startIndex; + ind_cg < iterWtOp->cg.limit; + ++ind_cg) + { + for (int ind_r = iterWtOp->r.startIndex; + ind_r < iterWtOp->r.limit; + ++ind_r) + { + for (int ind_s = iterWtOp->s.startIndex; + ind_s < iterWtOp->s.limit; + ++ind_s) + { + for (int ind_k = iterWtOp->kg.startIndex*krnlPerGrp; + ind_k < iterWtOp->kg.startIndex*krnlPerGrp + + iterWtOp->k.limit; + ++ind_k) + { + for (int ind_c = ind_cg*atomicCSize + + iterWtOp->c.startIndex; + ind_c < (ind_cg*atomicCSize + + iterWtOp->c.startIndex + + iterWtOp->c.limit); + ++ind_c) + { + int orig_c = ind_c % srcWDims.numChannels; + int orig_r = (ind_r * srcWDims.strideY) + + ((ind_c / srcWDims.numChannels) / + srcWDims.strideY); + int orig_s = (ind_s * srcWDims.strideX) + + ((ind_c / srcWDims.numChannels) % + srcWDims.strideX); + std::string key; + if (orig_r < srcWDims.height && + orig_s < srcWDims.width) + { + key = toString(ind_k) + "-" + + toString(orig_c) + "-" + + toString(orig_r) + "-" + + toString(orig_s); + mDCHash.insert(std::pair(key, *pDCTrWts)); + } + ++pDCTrWts; + } + } + } + } + } + } + + typename std::map::iterator iterCaffe = mCaffeHash.begin(); + typename std::map::iterator iterDC = mDCHash.begin(); + + if (mCaffeHash.size() != mDCHash.size()) + { + err = -1; + goto exit; + } + + // FIXME: have stricter check here + for ( ; iterCaffe != mCaffeHash.end(); ++iterCaffe) + { + iterDC = mDCHash.find(iterCaffe->first); + if (iterDC == mDCHash.end()) + { + err = -1; + goto exit; + } + } + + exit: + mDCHash.clear(); + return err; + } + + + //!< run sanity after complete wt translation for Deconvolution (same as direct convolution - UNVERIFIED) + template + static int runSanityForDeconvWtTrns + ( + RT* pDCTrWts, //!< ptr to translated wt blob for DC + WeightDims srcWDims, //!< dims of translated wt blob for DC + std::vector vWtOps, //!< list of all ops to achieve wt translation for DC + std::map& mCaffeHash, //!< hash of entire raw caffe wt blob + int atomicKSize, + int atomicCSize + ) + { + return runSanityForDCWtTrns(pDCTrWts, srcWDims, vWtOps, mCaffeHash, atomicKSize, atomicCSize); + } + + //!< run sanity after zero padding wt blob for WG + template + static int runSanityForWGWtZeroPadded + ( + T* pSrcWts, //!< ptr to orig non zero padded wt blob + WeightDims srcWDims,//!< dims of orig non zero padded wt blob + T* pWGZPWts, //!< ptr to zero padded wt blob + WeightDims zpWDims //!< dims of zero padded wt blob + ) + { + int ind_zp = 0; + int ind_src = 0; + for (; ind_zp < zpWDims.wtSize; ++ind_zp) + { + if (!pWGZPWts[ind_zp]) + { + if (ind_src < srcWDims.wtSize && + !pSrcWts[ind_src]) + ind_src++; + continue; + } + + if (pWGZPWts[ind_zp] != pSrcWts[ind_src]) + { + return -1; + } + else + ind_src++; + } + return 0; + } + + + //!< run sanity after doing CE for WG + template + static int runSanityForWGWtChnlExt + ( + T* pSrcWts, //!< ptr to orig non chnl extnd wt blob + WeightDims srcWDims,//!< dims of orig non chnl extnd wt blob + T* pWGCEWts, //!< ptr to chnl extnd wt blob + WeightDims ceWDims //!< dims of chnl extnd wt blob + ) + { + T ceWt = T(0); + T caffeWt = T(0); + for (int ind_k = 0; ind_k < ceWDims.numKernels; ++ind_k) + for (int ind_c = 0; ind_c < ceWDims.numChannels; ++ind_c) + for (int ind_r = 0; ind_r < ceWDims.height; ++ind_r) + for (int ind_s = 0; ind_s < ceWDims.width; ++ind_s) + { + ceWt = pWGCEWts[ind_s + + ceWDims.width*(ind_r + + ceWDims.height*(ind_c + + ceWDims.numChannels*(ind_k)))]; + int orig_c = ind_c % srcWDims.numChannels; + int orig_r = (ind_r * srcWDims.strideY) + + ((ind_c / srcWDims.numChannels) / + srcWDims.strideY); + int orig_s = (ind_s * srcWDims.strideX) + + ((ind_c / srcWDims.numChannels) % + srcWDims.strideX); + if (orig_r < srcWDims.height && + orig_s < srcWDims.width) + caffeWt = pSrcWts[orig_s + + srcWDims.width*(orig_r + + srcWDims.height*(orig_c + + srcWDims.numChannels*(ind_k)))]; + else + caffeWt = 0; + if (ceWt != caffeWt) + { + return -1; + } + } + return 0; + } + + //!< run sanity after doing matrix translation on the wt blob for WG + template + static int runSanityForWGWtMatrixTrns + ( + T* pSrcWts, //!< ptr to orig non matrix translated wt blob + WeightDims srcWDims, //!< dims of orig non matrix translated wt blob + T* pWGMatTrWts,//!< ptr to matrix translated wt blob + WeightDims mtWDims //!< dims of matrix translated wt blob + ) + { + T trnsMat[4][4] = {{T(0)}}; + T origMat[3][3] = {{T(0)}}; + T retrievedMat[3][3] = {{T(0)}}; + + for (int ind_k = 0; ind_k < mtWDims.numKernels; ++ind_k) + { + for (int ind_c = 0; ind_c < mtWDims.numChannels; ++ind_c) + { + memset(trnsMat, 0.0f, sizeof(trnsMat[0][0]) * 4 * 4); + for (int ind_rt = 0; ind_rt < mtWDims.height; ++ind_rt) + { + for (int ind_st = 0; ind_st < mtWDims.width; ++ind_st) + { + trnsMat[ind_rt][ind_st] = pWGMatTrWts[ind_st + + mtWDims.width*(ind_rt + + mtWDims.height*(ind_c + + mtWDims.numChannels*(ind_k)))]; + } + } + + memset(origMat, 0.0f, sizeof(origMat[0][0]) * 3 * 3); + for (int ind_ro = 0; ind_ro < srcWDims.height; ++ind_ro) + { + for (int ind_so = 0; ind_so < srcWDims.width; ++ind_so) + { + origMat[ind_ro][ind_so] = pSrcWts[ind_so + + srcWDims.width*(ind_ro + + srcWDims.height*(ind_c + + srcWDims.numChannels*(ind_k)))]; + } + } + + memset(retrievedMat, 0.0f, sizeof(retrievedMat[0][0]) * 3 * 3); + getOrigWGMat(trnsMat, retrievedMat); + if (compare3By3Matrices(origMat, retrievedMat)) + { + return -1; + } + } + } + return 0; + } + + + //!< run sanity after complete wt translation for WG + template + static int runSanityForWGWtTrns + ( + RT* pWGTrWts, //!< ptr to translated wt blob for WG + std::vector vWtOps, //!< list of all ops to achieve wt translation + std::map& mCaffeHash //!< hash of the entire raw caffe wt blob + ) + { + int err = 0; + RT trnsWGCube[4][4][4] = {{{RT(0)}}}; + RT origWGCube[3][3][3] = {{{RT(0)}}}; + std::map mWGHash; + mWGHash.clear(); + + int krnlPerGrp = (sizeof(RT) == 1 ? 32 : 16); + + std::vector::const_iterator iterWtOp = vWtOps.begin(); + + for (; iterWtOp != vWtOps.end(); ++iterWtOp) + { + for (int ind_cg = iterWtOp->cg.startIndex; + ind_cg < iterWtOp->cg.limit; + ++ind_cg) + { + for (int ind_k = iterWtOp->kg.startIndex*krnlPerGrp; + ind_k < iterWtOp->kg.startIndex*krnlPerGrp + + iterWtOp->k.limit; + ++ind_k) + { + memset(trnsWGCube, 0, sizeof(trnsWGCube[0][0][0]) * 4 * 4 * 4); + for (int ind_rt = 0; ind_rt < 4; ++ind_rt) + { + for (int ind_st = 0; ind_st < 4; ++ind_st) + { + for (int ind_c = 0; ind_c < WG_FULL_CHANNELS_PER_ATOM; ++ind_c) + { + trnsWGCube[ind_rt][ind_st][ind_c] = *pWGTrWts; + ++pWGTrWts; + } + } + } + + memset(origWGCube, 0, sizeof(origWGCube[0][0][0]) * 3 * 3 * 3); + getOrigWGCube(trnsWGCube, origWGCube); + + for (int ind_ro = 0; ind_ro < 3; ++ind_ro) + { + for (int ind_so = 0; ind_so < 3; ++ind_so) + { + for (int ind_c = 0; ind_c < WG_FULL_CHANNELS_PER_ATOM; ++ind_c) + { + int orig_c = ind_cg * WG_FULL_CHANNELS_PER_ATOM + ind_c; + std::string key = toString(ind_k) + "-" + + toString(orig_c) + "-" + + toString(ind_ro) + "-" + + toString(ind_so); + mWGHash.insert(std::pair(key, + origWGCube[ind_ro][ind_so][ind_c])); + } + } + } + } + } + } + + typename std::map::iterator iterCaffe = mCaffeHash.begin(); + typename std::map::iterator iterWG = mWGHash.begin(); + + if (mCaffeHash.size() != mWGHash.size()) + { + err = -1; + goto exit; + } + + for ( ; iterCaffe != mCaffeHash.end(); ++iterCaffe) + { + iterWG = mWGHash.find(iterCaffe->first); + if (iterWG == mWGHash.end()) + { + err = -1; + goto exit; + } + } + + exit: + mWGHash.clear(); + return err; + } +}; + + +} // nvdla::priv +} // nvdla + +#endif /* NVDLA_PRIV_WEIGHT_TRNS_UNIT_H */ diff --git a/umd/core/src/compiler/include/priv/Wisdom.h b/umd/core/src/compiler/include/priv/Wisdom.h new file mode 100644 index 00000000..422b680c --- /dev/null +++ b/umd/core/src/compiler/include/priv/Wisdom.h @@ -0,0 +1,256 @@ +/* + * Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#ifndef NVDLA_PRIV_WISDOM_H +#define NVDLA_PRIV_WISDOM_H + +#include "priv/Type.h" + +#include "nvdla/IWisdom.h" + +#include "priv/Layer.h" +#include "priv/Loadable.h" +#include "priv/Network.h" +#include "priv/Tensor.h" +#include "priv/Profiler.h" +#include "priv/Compiler.h" + +namespace nvdla +{ + +class INetwork; +class ILayer; +class ITensor; + +namespace priv +{ + +class WisdomContainer; + + +class SymbolTable +{ +public: + bool insertNetwork(INetwork *net, const std::string &sym); + bool insertLayer(ILayer *layer, const std::string &sym); + bool insertTensor(ITensor *tensor, const std::string &sym); + bool insertLoadable(ILoadable *loadable, const std::string &sym); + bool insertProfile(IProfile *profile, const std::string &sym); + + INetwork *findNetwork(const std::string &sym); + bool findNetwork(Network *, std::string &sym); + + ILayer *findLayer(const std::string &sym); + bool findLayer(Layer *l, std::string &sym); + + ITensor *findTensor(const std::string &sym); + bool findTensor(Tensor *t, std::string &sym); + + ILoadable *findLoadable(const std::string &sym); + bool findLoadable(Loadable *l, std::string &sym); + + IProfile *findProfile(const std::string &sym); + bool findProfile(Profile *p, std::string &sym); + + // bool networkSymbolAssigned(const std::string &sym) const; + // bool layerSymbolAssigned(const std::string &sym) const; + // bool tensorSymbolAssigned(const std::string &sym) const; + +protected: + typedef BiMap::left_iterator SymNetIter; + typedef BiMap::right_iterator NetSymIter; + + // typedef std::map::iterator SymNetIter; + // typedef std::map::iterator NetSymIter; + + typedef std::map::iterator SymLayerIter; + typedef std::map::iterator LayerSymIter; + + typedef std::map::iterator SymTensorIter; + typedef std::map::iterator TensorSymIter; + + typedef std::map::iterator SymLoadableIter; + typedef std::map::iterator LoadableSymIter; + + typedef std::map::iterator SymProfileIter; + typedef std::map::iterator ProfileSymIter; + + + + BiMap m_sym_net; + // std::map m_sym_net; + // std::map m_net_sym; + + std::map m_sym_layer; + std::map m_layer_sym; + + std::map m_sym_tensor; + std::map m_tensor_sym; + + + std::map m_sym_loadable; + std::map m_loadable_sym; + + std::map m_sym_profile; + std::map m_profile_sym; +}; + + +class WisdomFactory +{ +public: + typedef PrivPair WisdomPrivPair; + + static WisdomPrivPair newWisdom(); + static NvDlaError deleteWisdom(IWisdom *wisdom); + + static Wisdom *priv(IWisdom *); + static IWisdom *i(Wisdom *); + static IWisdom *self(void *s); + + static IWisdom *deserializeFrom(WisdomContainerEntry *); + +protected: + static BiMap s_priv; + static BiMap s_self; + + // static IWisdom *deserializeWisdom(WisdomContainerEntry *); + +}; + + +class Wisdom : public IWisdom +{ +public: + Wisdom(); + virtual ~Wisdom(); + + // virtual bool open(IWisdomContainer *); + virtual bool open(const std::string &uri); + + // const INetwork *getNetwork(); // AST, original input + // int getNumTestPoints(); + // void save(INetwork *, NVDLANetwork *); + // void save(const OpList &, const WisdomTestPoint &); + // WisdomTestPoint &getTestPoint(int); + + virtual void close(); + + virtual IWisdomContainerEntry *getRootEntry(); + + virtual bool setNetwork(INetwork *); + virtual bool setNetworkTransient(INetwork *); + + virtual INetwork *getNetwork(); + + virtual IProfiler *getProfiler(); + + virtual ICompiler *getCompiler(); + + // + // Dictionary/symbol table interfaces. For the following: + // find -> look-up, only + // get -> look-up and, if not found, instantiate + // may result in object with dangling symbolic references... + // assign-> produce a unique symbol name (first, try object "name") + // then insert into the table. + // + virtual bool insertNetworkSymbol(INetwork *, const std::string &); + virtual INetwork *findNetworkSymbol(const std::string &); + + virtual bool insertLayerSymbol(ILayer *, const std::string &); + virtual ILayer *findLayerSymbol(const std::string &); + virtual ILayer *getLayerFromSymbol(const std::string &); + virtual bool assignLayerSymbol(Layer *, std::string &); + virtual bool setLayer(Layer *); // error for it not to have been assigned a symbol + + virtual bool insertTensorSymbol(ITensor *, const std::string &); + virtual ITensor *findTensorSymbol(const std::string &); + virtual ITensor *getTensorFromSymbol(const std::string &); + virtual bool assignTensorSymbol(Tensor *, std::string &); + virtual bool setTensor(Tensor *); // error for it not to have been assigned a symbol + + virtual bool insertLoadableSymbol(ILoadable *, const std::string &); + virtual ILoadable *findLoadableSymbol(const std::string &); + // virtual ILoadable *getLoadableFromSymbol(const std::string &); + // virtual bool assignLoadableSymbol(Loadable *, std::string &); + // virtual bool setLoadable(Loadable *); // error for it not to have been assigned a symbol + + virtual bool insertProfileSymbol(IProfile *, const std::string &); + virtual IProfile *findProfileSymbol(const std::string &); + + virtual NvDlaError setDataType(DataType::UnderlyingType d); + virtual NvDlaError getDataType(DataType::UnderlyingType *) const; + +public:// internally facing + virtual bool findITensorSymbol(ITensor *, std::string &); + virtual bool findTensorSymbol (Tensor *, std::string &); + + virtual bool findILayerSymbol(ILayer *, std::string &); + virtual bool findLayerSymbol(Layer *, std::string &); + + virtual bool findILoadableSymbol(ILoadable *, std::string &); + virtual bool findLoadableSymbol(Loadable *, std::string &); + + virtual bool findIProfileSymbol(IProfile *, std::string &); + virtual bool findProfileSymbol(Profile *, std::string &); + + +protected: + WisdomContainer *m_container; + INetwork *m_network; + + SymbolTable m_symbol_table; + + LayerFactory m_layer_factory; + NetworkFactory m_network_factory; + TensorFactory m_tensor_factory; + LoadableFactory m_loadable_factory; + + ICompiler *m_compiler; + IProfiler *m_profiler; + + DataType m_data_type; + + /** + * Internal functions which are unsafe and external interfaces wraps them + * to catch possible exception thrown. + **/ + virtual bool openInternal(const std::string &uri); + virtual void closeInternal(); + virtual bool setNetworkInternal(INetwork *); + virtual INetwork *getNetworkInternal(); + virtual NvDlaError setDataTypeInternal(DataType::UnderlyingType d); +}; + + + +} // nvdla::priv +} // nvdla + +#endif // NVDLA_PRIV_WISDOM_H diff --git a/umd/core/src/compiler/include/priv/WisdomContainer.h b/umd/core/src/compiler/include/priv/WisdomContainer.h new file mode 100644 index 00000000..9d9fb2fc --- /dev/null +++ b/umd/core/src/compiler/include/priv/WisdomContainer.h @@ -0,0 +1,229 @@ +/* + * Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#ifndef NVDLA_PRIV_WISDOM_CONTAINER_H +#define NVDLA_PRIV_WISDOM_CONTAINER_H + +#include "nvdla/IWisdomContainer.h" + +namespace nvdla +{ + +namespace priv +{ + +class WisdomContainer; +class Wisdom; + +class WisdomContainerEntry : public IWisdomContainerEntry +{ +public: // externally facing + virtual IWisdomContainer *container() const; + virtual const std::string path() const; + virtual const std::string name() const; + virtual EntryType type() const; + + virtual bool writeUInt8(NvU8 v); + virtual bool writeString(const std::string &v); + virtual bool writeUInt8Vector(const std::vector &v); + virtual bool writeUInt8Vector(const NvU8 *v, size_t); + virtual bool writeUInt32(NvU32 v); + virtual bool writeUInt64(NvU64 v); + virtual bool writeInt32(NvS32 v); + virtual bool writeFloat32(NvF32 v); + + virtual bool readUInt8(NvU8 &) const; + virtual bool readString(std::string &) const; + virtual bool readUInt8Vector(std::vector &) const; + virtual bool readUInt8Vector(NvU8 **v, size_t *s) const; + virtual bool readUInt32(NvU32 &) const; + virtual bool readUInt64(NvU64 &) const; + virtual bool readInt32(NvS32 &) const; + virtual bool readFloat32(NvF32 &) const; + + virtual bool insertEntry(const std::string &name, EntryType, IWisdomContainerEntry *&); + virtual bool removeEntry(const std::string &name); + + virtual bool getEntryNames(std::vector *); + virtual bool getEntry(const std::string &name, EntryType, IWisdomContainerEntry *&); + + +public: // internally facing + bool insertEntry(const std::string &name, EntryType, WisdomContainerEntry *); + bool getEntry(const std::string &name, EntryType, WisdomContainerEntry *) const; + + WisdomContainer *container_priv() { return m_container; } + + virtual ~WisdomContainerEntry(); + WisdomContainerEntry(); + WisdomContainerEntry(WisdomContainer *c, const std::string &path, + const std::string &name, EntryType type); + + // serialize to and from a new, named entry in an existing OBJECT type container entry. + bool writeUInt8Enum(const std::string &entry_name, NvU8 v); + bool writeString(const std::string &entry_name, const std::string &v); + bool writeUInt8Vector(const std::string &entry_name, const std::vector &v); + bool writeUInt8Vector(const std::string &entry_name, const NvU8 *data, size_t size); + bool writeUInt32(const std::string &entry_name, NvU32 v); + bool writeUInt64(const std::string &entry_name, NvU64 v); + bool writeInt32(const std::string &entry_name, NvS32 v); + bool writeFloat32(const std::string &entry_name, NvF32 v); + bool writeObject(const std::string &entry_name); + bool writeDims2(const std::string &entry_name, const Dims2 &); + bool writeDims3(const std::string &entry_name, const Dims3 &); + bool writeDims4(const std::string &entry_name, const Dims4 &); + bool writeWeights(const std::string &entry_name, const Weights &); + + bool readUInt8Enum(const std::string &entry_name, NvU8 &) const; + bool readString(const std::string &entry_name, std::string &) const; + bool readUInt8Vector(const std::string &entry_name, std::vector &) const; + bool readUInt8Vector(const std::string &entry_name, const NvU8 **data, size_t *size); + bool readUInt32(const std::string &entry_name, NvU32 &) const; + bool readUInt64(const std::string &entry_name, NvU64 &) const; + bool readInt32(const std::string &entry_name, NvS32 &) const; + bool readFloat32(const std::string &entry_name, NvF32 &) const; + bool readObject(const std::string &entry_name) const; + bool readDims2(const std::string &entry_name, Dims2 &) const; + bool readDims3(const std::string &entry_name, Dims3 &) const; + bool readDims4(const std::string &entry_name, Dims4 &) const; + bool readWeights(const std::string &entry_name, Weights &) const; + + bool insertEntryIfNotPresent(const std::string &name, EntryType, WisdomContainerEntry *); + + +protected: + friend class WisdomContainer; + + + WisdomContainer *m_container; + std::string m_path; + std::string m_name; + EntryType m_type; + inline const std::string pathName() const { + if ( m_name.size() && (m_name != std::string(".")) ) { + return m_path + "/" + m_name; + } + return m_path; + } + + WisdomContainerEntry &operator =(const WisdomContainerEntry &rhs) + { + m_container = rhs.m_container; + m_path = rhs.m_path; + m_name = rhs.m_name; + m_type = rhs.m_type; + return *this; + } +}; + + +// +// Ideally this is a base class for various implementation schemes to derive +// from. For now it's a concrete class with a recursive filesystem implementation. +// + +class WisdomContainer : public IWisdomContainer +{ +public: // externally facing + virtual bool open(const std::string &uri); // filename, dirname, dbname, etc. + virtual bool isOpen(); + virtual void close(); + + virtual IWisdom *wisdom(); + virtual IWisdomContainerEntry *root(); + + virtual bool insertEntry(const std::string &path, + const std::string &name, + IWisdomContainerEntry::EntryType, + IWisdomContainerEntry *&); + virtual bool removeEntry(const std::string &path); + + virtual bool getEntryNames(const std::string &path, std::vector *); + virtual bool getEntry(const std::string &path, const std::string &name, + IWisdomContainerEntry::EntryType type, + IWisdomContainerEntry *&entry); + + virtual bool writeUInt8(const std::string &path, NvU8); + virtual bool writeString(const std::string &path, const std::string &); + virtual bool writeUInt8Vector(const std::string &path, const std::vector &); + virtual bool writeUInt8Vector(const std::string &path, const NvU8 *, size_t); + virtual bool writeUInt32(const std::string &path, NvU32); + virtual bool writeUInt64(const std::string &path, NvU64); + virtual bool writeInt32(const std::string &path, NvS32); + virtual bool writeFloat32(const std::string &path, NvF32); + + virtual bool readUInt8(const std::string &path, NvU8 &); + virtual bool readString(const std::string &path, std::string &); + virtual bool readUInt8Vector(const std::string &path, std::vector &); + virtual bool readUInt8Vector(const std::string &path, NvU8 **, size_t *); + virtual bool readUInt32(const std::string &path, NvU32 &); + virtual bool readUInt64(const std::string &path, NvU64 &); + virtual bool readInt32(const std::string &path, NvS32 &); + virtual bool readFloat32(const std::string &path, NvF32 &); + + +public: // internally facing + + WisdomContainer(Wisdom *); + virtual ~WisdomContainer(); + + WisdomContainerEntry *root_priv(); + Wisdom *wisdom_priv(); + virtual bool insertEntry(const std::string &path, + const std::string &name, + IWisdomContainerEntry::EntryType, + WisdomContainerEntry *); + + virtual bool getEntry(const std::string &path, const std::string &name, + IWisdomContainerEntry::EntryType type, + WisdomContainerEntry *entry); + + + +protected: + friend class Wisdom; + friend class WisdomContainerEntry; + + IWisdom *m_wisdom; + Wisdom *m_wisdom_priv; + + std::string m_root; + WisdomContainerEntry m_root_entry; + + const std::string entryFilename(const std::string &path, const std::string &name) const; + const std::string entryFilename(IWisdomContainerEntry *) const; + const std::string entryFilename(const std::string &name) const; + + const std::string entryDirname(const std::string &path, const std::string &name) const; + +}; + +} // nvdla::priv +} // nvdla + +#endif /* NVDLA_WISDOM_CONTAINER_PRIV_H */ diff --git a/umd/core/src/compiler/include/priv/caffe/CaffeParser.h b/umd/core/src/compiler/include/priv/caffe/CaffeParser.h new file mode 100644 index 00000000..80201700 --- /dev/null +++ b/umd/core/src/compiler/include/priv/caffe/CaffeParser.h @@ -0,0 +1,140 @@ +/* + * Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#ifndef NVDLA_PRIV_CAFFE_PARSER_H +#define NVDLA_PRIV_CAFFE_PARSER_H + +#include +#include +#include +#include +#include +#include + +#include "priv/Type.h" +#include "priv/Network.h" +#include "priv/Layer.h" +#include "nvdla/caffe/ICaffeParser.h" + +namespace ditcaffe{ +class NetParameter; +} + +namespace nvdla { +namespace caffe { +namespace priv { + +class BlobNameToTensor : public IBlobNameToTensor +{ +public: + virtual void add(const std::string& name, ITensor* tensor); + + virtual ITensor* find(const char* name) const; + virtual ITensor*& operator[](const std::string& name); + + virtual void setTensorNames(); + virtual ~BlobNameToTensor(); + +private: + std::map mMap; +}; + +class BinaryProtoBlob : public IBinaryProtoBlob +{ +public: + BinaryProtoBlob(void* memory, DataType type, Dims4 dimensions); + + const void* getData(); + Dims4 getDimensions(); + void destroy(); +protected: + void* mMemory; + DataType mDataType; + Dims4 mDimensions; + virtual ~BinaryProtoBlob(); +}; + +class CaffeParser; + +class CaffeParserFactory +{ +public: + typedef nvdla::priv::PrivPair CaffeParserPrivPair; + + static CaffeParserPrivPair newCaffeParser(); + static NvDlaError deleteCaffeParser(ICaffeParser *parser); + + static CaffeParser *priv(ICaffeParser *); + static ICaffeParser *i(CaffeParser *); + static ICaffeParser *self(void *); + +protected: + static nvdla::priv::BiMap s_priv; + static nvdla::priv::BiMap s_self; +}; + + +class CaffeParser : public ICaffeParser +{ +public: + CaffeParser() : + ICaffeParser(), + mDeploy(NULL), + mModel(NULL), + mTmpAllocs(), + mDimsCallback(NULL), + mBlobNameToTensor(NULL), + mProtobufBufferSize(1024 << 20) + { } + + virtual const IBlobNameToTensor* parse(const char* deploy, + const char* model, + INetwork* network); + virtual int identifyOutputs(INetwork * network); + virtual ~CaffeParser(); + + void setProtobufBufferSize(size_t size) { mProtobufBufferSize = size; } + + // read a blob from a protobuf file (typically a mean blob) + static BinaryProtoBlob* parseBinaryProto(const char* fileName); + + static void shutdownProtobufLibrary(); +private: + ditcaffe::NetParameter * mDeploy; + ditcaffe::NetParameter * mModel; + std::vector mTmpAllocs; + INetwork::OutputDimensionsFormula* mDimsCallback; + IBlobNameToTensor* mBlobNameToTensor; + size_t mProtobufBufferSize; +}; + +} +} +} + +#endif // NVDLA_PRIV_CAFFE_PARSER_H diff --git a/umd/core/src/compiler/include/priv/dla/dla1/A/dla_fw_version.h b/umd/core/src/compiler/include/priv/dla/dla1/A/dla_fw_version.h new file mode 100644 index 00000000..92427cfb --- /dev/null +++ b/umd/core/src/compiler/include/priv/dla/dla1/A/dla_fw_version.h @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#ifndef _DLA_FW_VERSION_H_ +#define _DLA_FW_VERSION_H_ + +#define FIRMWARE_VERSION_MAJOR 0x00 +#define FIRMWARE_VERSION_MINOR 0x0c +#define FIRMWARE_VERSION_SUBMINOR 0x03 + +static inline uint32_t dla_version(void) +{ + return (uint32_t)(((FIRMWARE_VERSION_MAJOR & 0xff) << 16) | + ((FIRMWARE_VERSION_MINOR & 0xff) << 8) | + ((FIRMWARE_VERSION_SUBMINOR & 0xff))); +} + +#endif diff --git a/umd/core/src/compiler/include/priv/dla/dla1/A/dla_interface.h b/umd/core/src/compiler/include/priv/dla/dla1/A/dla_interface.h new file mode 100644 index 00000000..0b59716e --- /dev/null +++ b/umd/core/src/compiler/include/priv/dla/dla1/A/dla_interface.h @@ -0,0 +1,865 @@ +/* + * Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#ifndef _DLA_INTERFACE_H_ +#define _DLA_INTERFACE_H_ + +/** + * @ingroup Processors + * @name DLA Processors + * Processor modules in DLA engine. Each processor has it's + * own operation a.k.a. HW layer. Network is formed using + * graph of these operations + * @{ + */ +#define DLA_OP_BDMA 0 +#define DLA_OP_CONV 1 +#define DLA_OP_SDP 2 +#define DLA_OP_PDP 3 +#define DLA_OP_CDP 4 +#define DLA_OP_RUBIK 5 +/** @} */ + +/** + * @ingroup Processors + * @name Maximum number of processors + * @brief DLA ash 6 processors + * @{ + */ +#define DLA_OP_NUM 6 +/** @} */ + +/** + * @ingroup Processors + * @name Number of groups + * @brief Each processor has 2 groups of registers + * @{ + */ +#define DLA_NUM_GROUPS 2 +/** @} */ + +/** + * Network descriptor + * + * Contains all information to execute a network + * + * @op_head: Index of first operation of each type in operations list + * @num_rois: Number of ROIs + * @num_operations: Number of operations in one list + * @num_luts: Number of LUTs + */ +struct dla_network_desc { + int16_t operation_desc_index; + int16_t surface_desc_index; + + int16_t dependency_graph_index; + int16_t lut_data_index; + + int16_t roi_array_index; + int16_t surface_index; + + int16_t stat_list_index; + int16_t reserved1; + + int16_t op_head[DLA_OP_NUM]; + + uint16_t num_rois; + uint16_t num_operations; + + uint16_t num_luts; + uint16_t num_addresses; + + int16_t input_layer; + uint8_t dynamic_roi; /* bool to indicate whether network.roi_array_index */ + uint8_t reserved0; +} __attribute__ ((packed, aligned(4))); + +/** + * @name Memory types + * @brief DLA engnine can read/write to/from 3 memory types + * @{ + */ +#define DLA_MEM_MC 0 /* External DRAM */ +#define DLA_MEM_CV 1 /* CV-SRAM */ +#define DLA_MEM_HW 2 /* DLA sub-module */ +/** @} */ + +/** + * @ingroup Events + * @name Operation events + * @brief Different events triggered by an operations + * @{ + */ +#define DLA_EVENT_OP_COMPLETED 1 +#define DLA_EVENT_OP_PROGRAMMED 2 +#define DLA_EVENT_OP_ENABLED 3 +#define DLA_EVENT_CDMA_WT_DONE 4 +#define DLA_EVENT_CDMA_DT_DONE 5 +/** @} */ + +struct dla_consumer { + int16_t index; /* the index of dla_common_op_desc in dep_graph_addr */ + uint8_t event; + uint8_t res; +} __attribute__ ((packed, aligned(4))); + +struct dla_common_op_desc { + int16_t index; /* set by ucode */ + int8_t roi_index; + uint8_t op_type; + + uint8_t dependency_count; + uint8_t reserved0[3]; + + struct dla_consumer consumers[DLA_OP_NUM]; + struct dla_consumer fused_parent; +} __attribute__ ((packed, aligned(4))); + +struct dla_roi_array_desc { + uint32_t array_length; + + uint32_t array_reserved; +} __attribute__ ((packed, aligned(4))); + +struct dla_roi_desc { + uint32_t left; + + uint32_t top; + + uint32_t right; + + uint32_t bottom; +} __attribute__ ((packed, aligned(4))); + +/** + * @ingroup BDMA + * @name Maximum BDMA transfers + * @brief BDMA supports multiple transfers in operation. This indicates + * maximum number of transfers possible in one operation. + * @{ + */ +#define NUM_MAX_BDMA_OPS 20 +/** @} */ + +struct dla_bdma_transfer_desc { + int16_t source_address; + int16_t destination_address; + + uint32_t line_size; + + uint32_t line_repeat; + + uint32_t source_line; + + uint32_t destination_line; + + uint32_t surface_repeat; + + uint32_t source_surface; + + uint32_t destination_surface; +} __attribute__ ((packed, aligned(4))); + +struct dla_bdma_surface_desc { + uint8_t source_type; + uint8_t destination_type; + uint16_t num_transfers; + + struct dla_bdma_transfer_desc transfers[NUM_MAX_BDMA_OPS]; +} __attribute__ ((packed, aligned(4))); + +struct dla_bdma_op_desc { + uint16_t num_transfers; + uint16_t reserved0; +} __attribute__ ((packed, aligned(4))); + +struct dla_bdma_stat_desc { + uint32_t read_stall; + uint32_t write_stall; + uint32_t runtime; +} __attribute__ ((packed, aligned(4))); + +/** + * @ingroup Convolution + * @name Convolution mode + * @brief Convolution modes support by DLA + * @{ + */ +#define CONV_MODE_DIRECT 0 +#define CONV_MODE_WINOGRAD 1 +/** @} */ + +/** + * @ingroup Processors + * @name Precision BPE mapping + * @brief Precision formats and Bit Per Elements mapping + * @{ + */ +#define BPE_PRECISION_INT8 1 +#define BPE_PRECISION_INT16 2 +#define BPE_PRECISION_FP16 2 +/** @} */ + + +/** + * @ingroup Processors + * @name Precision types + * @brief Precision formats supported by DLA engine + * @{ + */ +#define PRECISION_INT8 0 +#define PRECISION_INT16 1 +#define PRECISION_FP16 2 +/** @} */ + +/** + * @ingroup Processors + * @name Data formats + * @brief Data formats supported by DLA engine + * @{ + */ +#define FORMAT_T_R8 0 +#define FORMAT_T_R10 1 +#define FORMAT_T_R12 2 +#define FORMAT_T_R16 3 +#define FORMAT_T_R16_I 4 +#define FORMAT_T_R16_F 5 +#define FORMAT_T_A16B16G16R16 6 +#define FORMAT_T_X16B16G16R16 7 +#define FORMAT_T_A16B16G16R16_F 8 +#define FORMAT_T_A16Y16U16V16 9 +#define FORMAT_T_V16U16Y16A16 10 +#define FORMAT_T_A16Y16U16V16_F 11 +#define FORMAT_T_A8B8G8R8 12 +#define FORMAT_T_A8R8G8B8 13 +#define FORMAT_T_B8G8R8A8 14 +#define FORMAT_T_R8G8B8A8 15 +#define FORMAT_T_X8B8G8R8 16 +#define FORMAT_T_X8R8G8B8 17 +#define FORMAT_T_B8G8R8X8 18 +#define FORMAT_T_R8G8B8X8 19 +#define FORMAT_T_A2B10G10R10 20 +#define FORMAT_T_A2R10G10B10 21 +#define FORMAT_T_B10G10R10A2 22 +#define FORMAT_T_R10G10B10A2 23 +#define FORMAT_T_A2Y10U10V10 24 +#define FORMAT_T_V10U10Y10A2 25 +#define FORMAT_T_A8Y8U8V8 26 +#define FORMAT_T_V8U8Y8A8 27 +#define FORMAT_T_Y8___U8V8_N444 28 +#define FORMAT_T_Y8___V8U8_N444 29 +#define FORMAT_T_Y10___U10V10_N444 30 +#define FORMAT_T_Y10___V10U10_N444 31 +#define FORMAT_T_Y12___U12V12_N444 32 +#define FORMAT_T_Y12___V12U12_N444 33 +#define FORMAT_T_Y16___U16V16_N444 34 +#define FORMAT_T_Y16___V16U16_N444 35 +#define FORMAT_FEATURE 36 +/** @} */ + +/** + * @ingroup Convolution + * @name Pixel mapping + * @brief Pixel mapping formats supported for image input in Convolution + * @{ + */ +#define MAP_PITCH_LINEAR 0 +/** @} */ + +/** + * @ingroup Convolution + * @name Weight formats + * @brief Weight data formats supported in Convolution + * @{ + */ +#define WEIGHT_FORMAT_UNCOMPRESSED 0 +#define WEIGHT_FORMAT_COMPRESSED 1 +/** @} */ + +/** + * @ingroup Convolution + * @name Mean data format + * @brief Mean data formats supported in Convolution + * @{ + */ +#define MEAN_FORMAT_DISABLE 0 +#define MEAN_FORMAT_ENABLE 1 +/** @} */ + +struct dla_cvt_param { + int16_t scale; + uint8_t truncate; + uint8_t enable; + + int32_t offset; +} __attribute__ ((packed, aligned(4))); + +struct dla_data_cube { + uint16_t type; /* dla_mem_type */ + int16_t address; /* offset to the actual IOVA in task.address_list */ + + uint32_t offset; /* offset within address */ + uint32_t size; + + /* cube dimensions */ + uint16_t width; + uint16_t height; + + uint16_t channel; + uint16_t reserved0; + + /* stride information */ + uint32_t line_stride; + uint32_t surf_stride; + + /* For Rubik only */ + uint32_t plane_stride; +} __attribute__ ((packed, aligned(4))); + +#define PIXEL_OVERRIDE_UINT 0 +#define PIXEL_OVERRIDE_INT 1 + +struct dla_conv_surface_desc { + /* Data cube */ + struct dla_data_cube weight_data; + struct dla_data_cube wmb_data; + struct dla_data_cube wgs_data; + struct dla_data_cube src_data; + struct dla_data_cube dst_data; + + /* + * u_addr = input_data.source_addr + offset_u + * this field should be set when YUV is not interleave format + * */ + int64_t offset_u; + + /* line stride for 2nd plane, must be 32bytes aligned */ + uint32_t in_line_uv_stride; +} __attribute__ ((packed, aligned(4))); + +struct dla_conv_op_desc { + /* Performance parameters */ + + /* dla_conv_mode */ + uint8_t conv_mode; + uint8_t data_reuse; + uint8_t weight_reuse; + uint8_t skip_data_rls; + + uint8_t skip_weight_rls; + uint8_t reserved0; + uint16_t entry_per_slice; + + uint8_t data_format; /* dla_data_format */ + uint8_t pixel_mapping; /* dla_pixel_mapping */ + uint16_t fetch_grain; /* number of free slices before fetch */ + + uint8_t reserved_b[8]; + + uint8_t batch; /* batch_num */ + uint8_t weight_format; /* dla_weight_format */ + uint8_t data_bank; + uint8_t weight_bank; + + uint32_t batch_stride; /* the offset in bytes of each data cube in a batch */ + + uint8_t post_extension; + uint8_t pixel_override; + uint16_t release; /* number of slices need to be released */ + + /* The input cube dimension for CSC */ + uint16_t input_width_csc; + uint16_t input_height_csc; + + uint16_t input_channel_csc; + uint16_t kernel_width_csc; + + uint16_t kernel_height_csc; + uint16_t kernel_channel_csc; + + /* The input cube dimension for CMAC */ + uint16_t input_width_cmac; + uint16_t input_height_cmac; + + uint32_t bytes_per_kernel; /* actual size in bytes */ + + /* Algorithm parameters */ + + int16_t mean_ry; /* mean value for red in RGB or Y in YUV */ + int16_t mean_gu; /* mean value for green in RGB or U in YUV */ + + int16_t mean_bv; /* mean value for blue in RGB or V in YUV */ + int16_t mean_ax; + + uint8_t mean_format; /* dla_mean_format */ + uint8_t conv_stride_x; + uint8_t conv_stride_y; + uint8_t pad_x_left; + + uint8_t pad_x_right; + uint8_t pad_y_top; + uint8_t pad_y_bottom; + uint8_t dilation_x; + + uint8_t dilation_y; + uint8_t reserved2[2]; + + /* Precision parameters */ + uint8_t pra_truncate; + + uint8_t in_precision; + uint8_t out_precision; /* The output precision from CONV, it's the MAC processing precison */ + int16_t pad_val; + + struct dla_cvt_param in_cvt; /* input convertor parameters */ + struct dla_cvt_param out_cvt; /* output convertor parameters, support truncate only */ + +} __attribute__ ((packed, aligned(4))); + +struct dla_conv_stat_desc { + uint32_t data_read_stall; + uint32_t weight_read_stall; + uint32_t data_read_latency; + uint32_t weight_read_latency; + uint32_t saturation_count; + uint32_t nan_data_num; + uint32_t nan_weight_num; + uint32_t inf_data_num; + uint32_t inf_weight_num; + uint32_t runtime; +} __attribute__ ((packed, aligned(4))); + +/** + * @ingroup SDP + * @name Activation functions + * @brief Activation functions supported in SDP + * @{ + */ +#define ACTIVATION_NONE 0 +#define ACTIVATION_RELU 1 +#define ACTIVATION_LUT 2 +#define ACTIVATION_PRELU 3 +/** @} */ + +/** + * @ingroup LUT + * @name LUT size + * @brief LUT sizes for linear and exponentila LUT + * @{ + */ +#define LUT_LINEAR_EXP_TABLE_ENTRY_LOG2 6 +#define LUT_LINEAR_ONLY_TABLE_ENTRY_LOG2 8 +/** @} */ + +/** + * @ingroup LUT + * @name LUT types + * @brief DLA supports two types of LUT, linear and exonential + * @{ + */ +#define LUT_LINEAR_EXP_TABLE 0 +#define LUT_LINEAR_ONLY_TABLE 1 +/** @} */ + +/** + * @ingroup LUT + * @name LUT methods + * @brief DLA supports two types of LUT, linear and exonential + * @{ + */ +#define LUT_METHOD_EXPONENTIAL 0 +#define LUT_METHOD_LINEAR 1 +/** @} */ + +/** + * @ingroup LUT + * @name LUT + * @brief DLA supports two types of LUT, linear and exonential + * @{ + */ +#define LUT_PRI_LINEAR_EXP 0 +#define LUT_PRI_LINEAR_ONLY 1 +/** @} */ + +union dla_lut_offset { + /** + * Number should be substracted on log domain before look up + * exponetial table it has the same definition as hardware + * thus input scaling should also take into account when + * set this field. + */ + int8_t exp_offset; + /** + * Number of bits should be right shift before looking + * up linear table + */ + int8_t frac_bits; + uint16_t reserved0; +}; + +/** + * This struct is used to represent floating point values by INT + * suppose we have a float point number fp_x, it will be represented + * as: + * + * fp_x = scale_int_x>>(shifter_x) + * + * This is very useful for INT pipeline; + */ +struct dla_float_data { + int16_t scale; + int8_t shifter; + uint8_t reserved0; +} __attribute__ ((packed, aligned(4))); + +/** + * For INT pipeline, we use the struct above to represent a floating number; + * For FP16 pipeline, we should store the FP16 encoded value into a uint16_t + * container + */ +union dla_slope { + struct dla_float_data data_i; + + uint16_t data_f; +}; + +struct dla_lut_param { + /** + * value of expression ((1< 1 + + /* Algorithm parameters */ + struct dla_sdp_op x1_op; + struct dla_sdp_op x2_op; + struct dla_sdp_op y_op; +} __attribute__ ((packed, aligned(4))); + +struct dla_sdp_stat_desc { + uint32_t nan_input_num; + uint32_t inf_input_num; + uint32_t nan_output_num; + uint32_t wdma_write_stall; + uint32_t lut_underflow; + uint32_t lut_overflow; + uint32_t lut_hybrid; + uint32_t lut_le_hit; + uint32_t lut_lo_hit; + uint32_t saturation_count; + uint32_t runtime; +} __attribute__ ((packed, aligned(4))); + +#define POOL_MODE_AVG 0 +#define POOL_MODE_MAX 1 +#define POOL_MODE_MIN 2 + +#define POOL_SIZE_1 0 +#define POOL_SIZE_2 1 +#define POOL_SIZE_3 2 +#define POOL_SIZE_4 3 +#define POOL_SIZE_5 4 +#define POOL_SIZE_6 5 +#define POOL_SIZE_7 6 +#define POOL_SIZE_8 7 + +#define PDP_PAD_VAL_NUM 7 + +struct dla_pdp_surface_desc { + /* Data cube */ + struct dla_data_cube src_data; + + struct dla_data_cube dst_data; +} __attribute__ ((packed, aligned(4))); + +struct dla_pdp_op_desc { + /* Performance parameters */ + uint16_t partial_in_width_first; + uint16_t partial_in_width_mid; + + uint16_t partial_in_width_last; + uint16_t partial_width_first; + + uint16_t partial_width_mid; + uint16_t partial_width_last; + + uint8_t split_num; + + /* Algorithm parameters */ + uint8_t pool_mode; /* dla_pool_mode */ + uint8_t pool_width; /* dla_pool_width */ + uint8_t pool_height; /* dla_pool_height */ + + uint8_t stride_x; + uint8_t stride_y; + + /* The left/right padding size, pad_right might be less than pad_left */ + uint8_t pad_left; + uint8_t pad_right; + + /* The top/bottom padding size */ + uint8_t pad_top; + uint8_t pad_bottom; + + /* Precision parameters */ + uint8_t precision; /* dla_precision */ + uint8_t reserved0; + /** + * if input has non-zero "offset", this value should be set + * There'll be 7 different paddding values, the relationship between + * those versions are: + * padding_value[0] = -offset*scaling; + * padding_value[1] = 2*padding_value[0] + * padding_value[2] = 3*padding_value[0] + * ... + * The purpose is to avoid ucode implement FP16 multiplier(for FP16 mode) + */ + int32_t padding_value[PDP_PAD_VAL_NUM]; +} __attribute__ ((packed, aligned(4))); + +struct dla_pdp_stat_desc { + uint32_t inf_input_num; + uint32_t nan_input_num; + uint32_t nan_output_num; + uint32_t write_stall; + uint32_t runtime; +} __attribute__ ((packed, aligned(4))); + +struct dla_cdp_surface_desc { + /* Data cube */ + struct dla_data_cube src_data; + + struct dla_data_cube dst_data; +} __attribute__ ((packed, aligned(4))); + +struct dla_cdp_op_desc { + /* Precision parameters */ + + /* dla_precision */ + uint8_t in_precision; + uint8_t out_precision; + int16_t lut_index; + + struct dla_cvt_param in_cvt; + struct dla_cvt_param out_cvt; + + /* Performance parameters */ + + /* Algorithm parameters */ + uint8_t local_size; + uint8_t bypass_sqsum; + uint8_t bypass_out_mul; + uint8_t reserved0; +} __attribute__ ((packed, aligned(4))); + +struct dla_cdp_stat_desc { + uint32_t nan_input_num; + uint32_t inf_input_num; + uint32_t nan_output_num; + uint32_t write_stall; + uint32_t lut_uflow; + uint32_t lut_oflow; + uint32_t lut_hybrid; + uint32_t lut_le_hit; + uint32_t lut_lo_hit; + uint32_t saturation_count; + uint32_t runtime; +} __attribute__ ((packed, aligned(4))); + +struct dla_rubik_surface_desc { + /* Data cube */ + struct dla_data_cube src_data; + + struct dla_data_cube dst_data; +} __attribute__ ((packed, aligned(4))); + +/* rubik mode */ +#define RUBIK_MODE_CONTRACT 0 +#define RUBIK_MODE_SPLIT 1 +#define RUBIK_MODE_MERGE 2 + +struct dla_rubik_op_desc { + /* Precision parameters */ + uint8_t mode; + uint8_t precision; + uint8_t stride_x; + uint8_t stride_y; +} __attribute__ ((packed, aligned(4))); + +struct dla_rubik_stat_desc { + uint32_t read_stall; + uint32_t write_stall; + uint32_t runtime; +} __attribute__ ((packed, aligned(4))); + +union dla_surface_container { + struct dla_bdma_surface_desc bdma_surface; + struct dla_conv_surface_desc conv_surface; + struct dla_sdp_surface_desc sdp_surface; + struct dla_pdp_surface_desc pdp_surface; + struct dla_cdp_surface_desc cdp_surface; + struct dla_rubik_surface_desc rubik_surface; +}; + +union dla_operation_container { + struct dla_bdma_op_desc bdma_op; + struct dla_conv_op_desc conv_op; + struct dla_sdp_op_desc sdp_op; + struct dla_pdp_op_desc pdp_op; + struct dla_cdp_op_desc cdp_op; + struct dla_rubik_op_desc rubik_op; +}; + +union dla_stat_container { + struct dla_bdma_stat_desc bdma_stat; + struct dla_conv_stat_desc conv_stat; + struct dla_sdp_stat_desc sdp_stat; + struct dla_pdp_stat_desc pdp_stat; + struct dla_cdp_stat_desc cdp_stat; + struct dla_rubik_stat_desc rubik_stat; +}; + +/** + * status notifier structure + * + * @address: 64-bit timestamp representing the time at which + * the notifier was written + * @status_engine: status work captured from HW engine + * @subframe: NA + * @status_task: status word as configured from an action list + */ +struct dla_task_status { + uint64_t timestamp; + + uint32_t status_engine; + + uint16_t subframe; + uint16_t status_task; +} __attribute__ ((packed, aligned(4))); + +#endif diff --git a/umd/core/src/compiler/libprotobuf.a b/umd/core/src/compiler/libprotobuf.a new file mode 100644 index 00000000..493494b5 Binary files /dev/null and b/umd/core/src/compiler/libprotobuf.a differ diff --git a/umd/core/src/compiler/rules.mk b/umd/core/src/compiler/rules.mk new file mode 100644 index 00000000..66d70088 --- /dev/null +++ b/umd/core/src/compiler/rules.mk @@ -0,0 +1,118 @@ +# Copyright (c) 2015-2019, NVIDIA CORPORATION. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * 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. +# * Neither the name of NVIDIA CORPORATION 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 ``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. + +# +# libnvdla_compiler +# + +LOCAL_DIR := $(GET_LOCAL_DIR) + +MODULE_CC := gcc +MODULE_CPP := g++ +MODULE_LD := ld + +NVDLA_SRC_FILES := \ + caffe/CaffeParser.cpp \ + caffe/ditcaffe/protobuf-2.6.1/ditcaffe.pb.cpp \ + engine-ast/ActivationOp.cpp \ + engine-ast/BatchNormOp.cpp \ + engine-ast/BDMANode.cpp \ + engine-ast/BDMASingleOp.cpp \ + engine-ast/BDMAGroupOp.cpp \ + engine-ast/BiasOp.cpp \ + engine-ast/CDPLRNOp.cpp \ + engine-ast/CDPNode.cpp \ + engine-ast/ConcatOp.cpp \ + engine-ast/ConvCoreNode.cpp \ + engine-ast/ConvolutionOp.cpp \ + engine-ast/CPUNode.cpp \ + engine-ast/DeconvolutionOp.cpp \ + engine-ast/EngineAST.cpp \ + engine-ast/EngineEdge.cpp \ + engine-ast/EngineGraph.cpp \ + engine-ast/EngineNode.cpp \ + engine-ast/EngineNodeFactory.cpp \ + engine-ast/FullyConnectedOp.cpp \ + engine-ast/MultiOpsNode.cpp \ + engine-ast/NestedGraph.cpp \ + engine-ast/PDPNode.cpp \ + engine-ast/RubikNode.cpp \ + engine-ast/ScaleOp.cpp \ + engine-ast/SDPEltWiseOp.cpp \ + engine-ast/SDPNode.cpp \ + engine-ast/SDPNOP.cpp \ + engine-ast/SDPSuperOp.cpp \ + engine-ast/SoftMaxOp.cpp \ + engine-ast/SplitOp.cpp \ + AST.cpp \ + CanonicalAST.cpp \ + Check.cpp \ + Compiler.cpp \ + DlaPrototestInterface.pb.cpp \ + DLAResourceManager.cpp \ + DLAInterface.cpp \ + DLAInterfaceA.cpp \ + $(ROOT)/core/src/common/EMUInterface.cpp \ + $(ROOT)/core/src/common/EMUInterfaceA.cpp \ + Layer.cpp \ + $(ROOT)/core/src/common/Loadable.cpp \ + LutManager.cpp \ + Memory.cpp \ + Network.cpp \ + Profile.cpp \ + Profiler.cpp \ + Setup.cpp \ + Surface.cpp \ + TargetConfig.cpp \ + Tensor.cpp \ + TestPointParameter.cpp \ + Wisdom.cpp \ + WisdomContainer.cpp \ + $(ROOT)/utils/BitBinaryTree.c \ + $(ROOT)/utils/BuddyAlloc.c \ + $(ROOT)/utils/ErrorLogging.c \ + $(ROOT)/port/linux/nvdla_os.c + +INCLUDES += \ + -I$(LOCAL_DIR)/include \ + -I$(ROOT)/include \ + -I$(ROOT)/core/include \ + -I$(ROOT)/external/include \ + -I$(ROOT)/port/linux/include \ + -I$(ROOT)/core/src/common/include \ + -I${PROTOBUF_INSTALL_DIR}/include \ + +MODULE_CPPFLAGS += \ + -DNVDLA_UTILS_ERROR_TAG="\"DLA\"" \ + -DGOOGLE_PROTOBUF_NO_RTTI \ + -DNVDLA_COMPILER_OUTPUT_FOR_PROTOTEST \ + +MODULE_CFLAGS += \ + -DNVDLA_UTILS_ERROR_TAG="\"DLA\"" \ + +MODULE_SRCS := $(NVDLA_SRC_FILES) + +include $(ROOT)/make/module.mk diff --git a/umd/core/runtime/Emulator.cpp b/umd/core/src/runtime/Emulator.cpp similarity index 100% rename from umd/core/runtime/Emulator.cpp rename to umd/core/src/runtime/Emulator.cpp diff --git a/umd/core/runtime/Makefile b/umd/core/src/runtime/Makefile similarity index 98% rename from umd/core/runtime/Makefile rename to umd/core/src/runtime/Makefile index 3913d1bc..c6ef9d1d 100644 --- a/umd/core/runtime/Makefile +++ b/umd/core/src/runtime/Makefile @@ -36,7 +36,7 @@ MODULE := libnvdla_runtime include $(ROOT)/make/macros.mk -BUILDOUT ?= $(ROOT)/out/runtime +BUILDOUT ?= $(ROOT)/out/core/src/runtime BUILDDIR := $(BUILDOUT)/$(MODULE) LIB := $(BUILDDIR)/$(MODULE).so diff --git a/umd/core/runtime/Runtime.cpp b/umd/core/src/runtime/Runtime.cpp similarity index 100% rename from umd/core/runtime/Runtime.cpp rename to umd/core/src/runtime/Runtime.cpp diff --git a/umd/core/runtime/include/priv/Emulator.h b/umd/core/src/runtime/include/priv/Emulator.h similarity index 100% rename from umd/core/runtime/include/priv/Emulator.h rename to umd/core/src/runtime/include/priv/Emulator.h diff --git a/umd/core/runtime/include/priv/Runtime.h b/umd/core/src/runtime/include/priv/Runtime.h similarity index 100% rename from umd/core/runtime/include/priv/Runtime.h rename to umd/core/src/runtime/include/priv/Runtime.h diff --git a/umd/core/runtime/rules.mk b/umd/core/src/runtime/rules.mk similarity index 84% rename from umd/core/runtime/rules.mk rename to umd/core/src/runtime/rules.mk index 9777e441..f6f286a6 100644 --- a/umd/core/runtime/rules.mk +++ b/umd/core/src/runtime/rules.mk @@ -30,12 +30,16 @@ LOCAL_DIR := $(GET_LOCAL_DIR) +MODULE_CC := $(TOOLCHAIN_PREFIX)gcc +MODULE_CPP := $(TOOLCHAIN_PREFIX)g++ +MODULE_LD := $(TOOLCHAIN_PREFIX)ld + NVDLA_RUNTIME_SRC_FILES := \ - $(ROOT)/core/common/Check.cpp \ - $(ROOT)/core/common/ErrorLogging.c \ - $(ROOT)/core/common/EMUInterface.cpp \ - $(ROOT)/core/common/EMUInterfaceA.cpp \ - $(ROOT)/core/common/Loadable.cpp \ + $(ROOT)/core/src/common/Check.cpp \ + $(ROOT)/core/src/common/ErrorLogging.c \ + $(ROOT)/core/src/common/EMUInterface.cpp \ + $(ROOT)/core/src/common/EMUInterfaceA.cpp \ + $(ROOT)/core/src/common/Loadable.cpp \ $(ROOT)/port/linux/nvdla.c \ $(ROOT)/port/linux/nvdla_os.c \ Emulator.cpp \ @@ -44,7 +48,7 @@ NVDLA_RUNTIME_SRC_FILES := \ INCLUDES += \ -I$(ROOT)/include \ -I$(ROOT)/core/include \ - -I$(ROOT)/core/common/include \ + -I$(ROOT)/core/src/common/include \ -I$(ROOT)/port/linux/include \ -I$(ROOT)/external/include \ -I$(LOCAL_DIR)/include \ diff --git a/umd/external/include/rapidjson/allocators.h b/umd/external/include/rapidjson/allocators.h new file mode 100644 index 00000000..655f4a38 --- /dev/null +++ b/umd/external/include/rapidjson/allocators.h @@ -0,0 +1,271 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef RAPIDJSON_ALLOCATORS_H_ +#define RAPIDJSON_ALLOCATORS_H_ + +#include "rapidjson.h" + +RAPIDJSON_NAMESPACE_BEGIN + +/////////////////////////////////////////////////////////////////////////////// +// Allocator + +/*! \class rapidjson::Allocator + \brief Concept for allocating, resizing and freeing memory block. + + Note that Malloc() and Realloc() are non-static but Free() is static. + + So if an allocator need to support Free(), it needs to put its pointer in + the header of memory block. + +\code +concept Allocator { + static const bool kNeedFree; //!< Whether this allocator needs to call Free(). + + // Allocate a memory block. + // \param size of the memory block in bytes. + // \returns pointer to the memory block. + void* Malloc(size_t size); + + // Resize a memory block. + // \param originalPtr The pointer to current memory block. Null pointer is permitted. + // \param originalSize The current size in bytes. (Design issue: since some allocator may not book-keep this, explicitly pass to it can save memory.) + // \param newSize the new size in bytes. + void* Realloc(void* originalPtr, size_t originalSize, size_t newSize); + + // Free a memory block. + // \param pointer to the memory block. Null pointer is permitted. + static void Free(void *ptr); +}; +\endcode +*/ + +/////////////////////////////////////////////////////////////////////////////// +// CrtAllocator + +//! C-runtime library allocator. +/*! This class is just wrapper for standard C library memory routines. + \note implements Allocator concept +*/ +class CrtAllocator { +public: + static const bool kNeedFree = true; + void* Malloc(size_t size) { + if (size) // behavior of malloc(0) is implementation defined. + return std::malloc(size); + else + return NULL; // standardize to returning NULL. + } + void* Realloc(void* originalPtr, size_t originalSize, size_t newSize) { + (void)originalSize; + if (newSize == 0) { + std::free(originalPtr); + return NULL; + } + return std::realloc(originalPtr, newSize); + } + static void Free(void *ptr) { std::free(ptr); } +}; + +/////////////////////////////////////////////////////////////////////////////// +// MemoryPoolAllocator + +//! Default memory allocator used by the parser and DOM. +/*! This allocator allocate memory blocks from pre-allocated memory chunks. + + It does not free memory blocks. And Realloc() only allocate new memory. + + The memory chunks are allocated by BaseAllocator, which is CrtAllocator by default. + + User may also supply a buffer as the first chunk. + + If the user-buffer is full then additional chunks are allocated by BaseAllocator. + + The user-buffer is not deallocated by this allocator. + + \tparam BaseAllocator the allocator type for allocating memory chunks. Default is CrtAllocator. + \note implements Allocator concept +*/ +template +class MemoryPoolAllocator { +public: + static const bool kNeedFree = false; //!< Tell users that no need to call Free() with this allocator. (concept Allocator) + + //! Constructor with chunkSize. + /*! \param chunkSize The size of memory chunk. The default is kDefaultChunkSize. + \param baseAllocator The allocator for allocating memory chunks. + */ + MemoryPoolAllocator(size_t chunkSize = kDefaultChunkCapacity, BaseAllocator* baseAllocator = 0) : + chunkHead_(0), chunk_capacity_(chunkSize), userBuffer_(0), baseAllocator_(baseAllocator), ownBaseAllocator_(0) + { + } + + //! Constructor with user-supplied buffer. + /*! The user buffer will be used firstly. When it is full, memory pool allocates new chunk with chunk size. + + The user buffer will not be deallocated when this allocator is destructed. + + \param buffer User supplied buffer. + \param size Size of the buffer in bytes. It must at least larger than sizeof(ChunkHeader). + \param chunkSize The size of memory chunk. The default is kDefaultChunkSize. + \param baseAllocator The allocator for allocating memory chunks. + */ + MemoryPoolAllocator(void *buffer, size_t size, size_t chunkSize = kDefaultChunkCapacity, BaseAllocator* baseAllocator = 0) : + chunkHead_(0), chunk_capacity_(chunkSize), userBuffer_(buffer), baseAllocator_(baseAllocator), ownBaseAllocator_(0) + { + RAPIDJSON_ASSERT(buffer != 0); + RAPIDJSON_ASSERT(size > sizeof(ChunkHeader)); + chunkHead_ = reinterpret_cast(buffer); + chunkHead_->capacity = size - sizeof(ChunkHeader); + chunkHead_->size = 0; + chunkHead_->next = 0; + } + + //! Destructor. + /*! This deallocates all memory chunks, excluding the user-supplied buffer. + */ + ~MemoryPoolAllocator() { + Clear(); + RAPIDJSON_DELETE(ownBaseAllocator_); + } + + //! Deallocates all memory chunks, excluding the user-supplied buffer. + void Clear() { + while (chunkHead_ && chunkHead_ != userBuffer_) { + ChunkHeader* next = chunkHead_->next; + baseAllocator_->Free(chunkHead_); + chunkHead_ = next; + } + if (chunkHead_ && chunkHead_ == userBuffer_) + chunkHead_->size = 0; // Clear user buffer + } + + //! Computes the total capacity of allocated memory chunks. + /*! \return total capacity in bytes. + */ + size_t Capacity() const { + size_t capacity = 0; + for (ChunkHeader* c = chunkHead_; c != 0; c = c->next) + capacity += c->capacity; + return capacity; + } + + //! Computes the memory blocks allocated. + /*! \return total used bytes. + */ + size_t Size() const { + size_t size = 0; + for (ChunkHeader* c = chunkHead_; c != 0; c = c->next) + size += c->size; + return size; + } + + //! Allocates a memory block. (concept Allocator) + void* Malloc(size_t size) { + if (!size) + return NULL; + + size = RAPIDJSON_ALIGN(size); + if (chunkHead_ == 0 || chunkHead_->size + size > chunkHead_->capacity) + if (!AddChunk(chunk_capacity_ > size ? chunk_capacity_ : size)) + return NULL; + + void *buffer = reinterpret_cast(chunkHead_) + RAPIDJSON_ALIGN(sizeof(ChunkHeader)) + chunkHead_->size; + chunkHead_->size += size; + return buffer; + } + + //! Resizes a memory block (concept Allocator) + void* Realloc(void* originalPtr, size_t originalSize, size_t newSize) { + if (originalPtr == 0) + return Malloc(newSize); + + if (newSize == 0) + return NULL; + + originalSize = RAPIDJSON_ALIGN(originalSize); + newSize = RAPIDJSON_ALIGN(newSize); + + // Do not shrink if new size is smaller than original + if (originalSize >= newSize) + return originalPtr; + + // Simply expand it if it is the last allocation and there is sufficient space + if (originalPtr == reinterpret_cast(chunkHead_) + RAPIDJSON_ALIGN(sizeof(ChunkHeader)) + chunkHead_->size - originalSize) { + size_t increment = static_cast(newSize - originalSize); + if (chunkHead_->size + increment <= chunkHead_->capacity) { + chunkHead_->size += increment; + return originalPtr; + } + } + + // Realloc process: allocate and copy memory, do not free original buffer. + if (void* newBuffer = Malloc(newSize)) { + if (originalSize) + std::memcpy(newBuffer, originalPtr, originalSize); + return newBuffer; + } + else + return NULL; + } + + //! Frees a memory block (concept Allocator) + static void Free(void *ptr) { (void)ptr; } // Do nothing + +private: + //! Copy constructor is not permitted. + MemoryPoolAllocator(const MemoryPoolAllocator& rhs) /* = delete */; + //! Copy assignment operator is not permitted. + MemoryPoolAllocator& operator=(const MemoryPoolAllocator& rhs) /* = delete */; + + //! Creates a new chunk. + /*! \param capacity Capacity of the chunk in bytes. + \return true if success. + */ + bool AddChunk(size_t capacity) { + if (!baseAllocator_) + ownBaseAllocator_ = baseAllocator_ = RAPIDJSON_NEW(BaseAllocator)(); + if (ChunkHeader* chunk = reinterpret_cast(baseAllocator_->Malloc(RAPIDJSON_ALIGN(sizeof(ChunkHeader)) + capacity))) { + chunk->capacity = capacity; + chunk->size = 0; + chunk->next = chunkHead_; + chunkHead_ = chunk; + return true; + } + else + return false; + } + + static const int kDefaultChunkCapacity = 64 * 1024; //!< Default chunk capacity. + + //! Chunk header for perpending to each chunk. + /*! Chunks are stored as a singly linked list. + */ + struct ChunkHeader { + size_t capacity; //!< Capacity of the chunk in bytes (excluding the header itself). + size_t size; //!< Current size of allocated memory in bytes. + ChunkHeader *next; //!< Next chunk in the linked list. + }; + + ChunkHeader *chunkHead_; //!< Head of the chunk linked-list. Only the head chunk serves allocation. + size_t chunk_capacity_; //!< The minimum capacity of chunk when they are allocated. + void *userBuffer_; //!< User supplied buffer. + BaseAllocator* baseAllocator_; //!< base allocator for allocating memory chunks. + BaseAllocator* ownBaseAllocator_; //!< base allocator created by this object. +}; + +RAPIDJSON_NAMESPACE_END + +#endif // RAPIDJSON_ENCODINGS_H_ diff --git a/umd/external/include/rapidjson/document.h b/umd/external/include/rapidjson/document.h new file mode 100644 index 00000000..57f0b3c2 --- /dev/null +++ b/umd/external/include/rapidjson/document.h @@ -0,0 +1,2604 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef RAPIDJSON_DOCUMENT_H_ +#define RAPIDJSON_DOCUMENT_H_ + +/*! \file document.h */ + +#include "reader.h" +#include "internal/meta.h" +#include "internal/strfunc.h" +#include "memorystream.h" +#include "encodedstream.h" +#include // placement new +#include + +RAPIDJSON_DIAG_PUSH +#ifdef _MSC_VER +RAPIDJSON_DIAG_OFF(4127) // conditional expression is constant +RAPIDJSON_DIAG_OFF(4244) // conversion from kXxxFlags to 'uint16_t', possible loss of data +#ifdef _MINWINDEF_ // see: http://stackoverflow.com/questions/22744262/cant-call-stdmax-because-minwindef-h-defines-max +#ifndef NOMINMAX +#pragma push_macro("min") +#pragma push_macro("max") +#undef min +#undef max +#endif +#endif +#endif + +#ifdef __clang__ +RAPIDJSON_DIAG_OFF(padded) +RAPIDJSON_DIAG_OFF(switch-enum) +RAPIDJSON_DIAG_OFF(c++98-compat) +#endif + +#ifdef __GNUC__ +RAPIDJSON_DIAG_OFF(effc++) +#if __GNUC__ >= 6 +RAPIDJSON_DIAG_OFF(terminate) // ignore throwing RAPIDJSON_ASSERT in RAPIDJSON_NOEXCEPT functions +#endif +#endif // __GNUC__ + +#ifndef RAPIDJSON_NOMEMBERITERATORCLASS +#include // std::iterator, std::random_access_iterator_tag +#endif + +#if RAPIDJSON_HAS_CXX11_RVALUE_REFS +#include // std::move +#endif + +RAPIDJSON_NAMESPACE_BEGIN + +// Forward declaration. +template +class GenericValue; + +template +class GenericDocument; + +//! Name-value pair in a JSON object value. +/*! + This class was internal to GenericValue. It used to be a inner struct. + But a compiler (IBM XL C/C++ for AIX) have reported to have problem with that so it moved as a namespace scope struct. + https://code.google.com/p/rapidjson/issues/detail?id=64 +*/ +template +struct GenericMember { + GenericValue name; //!< name of member (must be a string) + GenericValue value; //!< value of member. +}; + +/////////////////////////////////////////////////////////////////////////////// +// GenericMemberIterator + +#ifndef RAPIDJSON_NOMEMBERITERATORCLASS + +//! (Constant) member iterator for a JSON object value +/*! + \tparam Const Is this a constant iterator? + \tparam Encoding Encoding of the value. (Even non-string values need to have the same encoding in a document) + \tparam Allocator Allocator type for allocating memory of object, array and string. + + This class implements a Random Access Iterator for GenericMember elements + of a GenericValue, see ISO/IEC 14882:2003(E) C++ standard, 24.1 [lib.iterator.requirements]. + + \note This iterator implementation is mainly intended to avoid implicit + conversions from iterator values to \c NULL, + e.g. from GenericValue::FindMember. + + \note Define \c RAPIDJSON_NOMEMBERITERATORCLASS to fall back to a + pointer-based implementation, if your platform doesn't provide + the C++ header. + + \see GenericMember, GenericValue::MemberIterator, GenericValue::ConstMemberIterator + */ +template +class GenericMemberIterator + : public std::iterator >::Type> { + + friend class GenericValue; + template friend class GenericMemberIterator; + + typedef GenericMember PlainType; + typedef typename internal::MaybeAddConst::Type ValueType; + typedef std::iterator BaseType; + +public: + //! Iterator type itself + typedef GenericMemberIterator Iterator; + //! Constant iterator type + typedef GenericMemberIterator ConstIterator; + //! Non-constant iterator type + typedef GenericMemberIterator NonConstIterator; + + //! Pointer to (const) GenericMember + typedef typename BaseType::pointer Pointer; + //! Reference to (const) GenericMember + typedef typename BaseType::reference Reference; + //! Signed integer type (e.g. \c ptrdiff_t) + typedef typename BaseType::difference_type DifferenceType; + + //! Default constructor (singular value) + /*! Creates an iterator pointing to no element. + \note All operations, except for comparisons, are undefined on such values. + */ + GenericMemberIterator() : ptr_() {} + + //! Iterator conversions to more const + /*! + \param it (Non-const) iterator to copy from + + Allows the creation of an iterator from another GenericMemberIterator + that is "less const". Especially, creating a non-constant iterator + from a constant iterator are disabled: + \li const -> non-const (not ok) + \li const -> const (ok) + \li non-const -> const (ok) + \li non-const -> non-const (ok) + + \note If the \c Const template parameter is already \c false, this + constructor effectively defines a regular copy-constructor. + Otherwise, the copy constructor is implicitly defined. + */ + GenericMemberIterator(const NonConstIterator & it) : ptr_(it.ptr_) {} + Iterator& operator=(const NonConstIterator & it) { ptr_ = it.ptr_; return *this; } + + //! @name stepping + //@{ + Iterator& operator++(){ ++ptr_; return *this; } + Iterator& operator--(){ --ptr_; return *this; } + Iterator operator++(int){ Iterator old(*this); ++ptr_; return old; } + Iterator operator--(int){ Iterator old(*this); --ptr_; return old; } + //@} + + //! @name increment/decrement + //@{ + Iterator operator+(DifferenceType n) const { return Iterator(ptr_+n); } + Iterator operator-(DifferenceType n) const { return Iterator(ptr_-n); } + + Iterator& operator+=(DifferenceType n) { ptr_+=n; return *this; } + Iterator& operator-=(DifferenceType n) { ptr_-=n; return *this; } + //@} + + //! @name relations + //@{ + bool operator==(ConstIterator that) const { return ptr_ == that.ptr_; } + bool operator!=(ConstIterator that) const { return ptr_ != that.ptr_; } + bool operator<=(ConstIterator that) const { return ptr_ <= that.ptr_; } + bool operator>=(ConstIterator that) const { return ptr_ >= that.ptr_; } + bool operator< (ConstIterator that) const { return ptr_ < that.ptr_; } + bool operator> (ConstIterator that) const { return ptr_ > that.ptr_; } + //@} + + //! @name dereference + //@{ + Reference operator*() const { return *ptr_; } + Pointer operator->() const { return ptr_; } + Reference operator[](DifferenceType n) const { return ptr_[n]; } + //@} + + //! Distance + DifferenceType operator-(ConstIterator that) const { return ptr_-that.ptr_; } + +private: + //! Internal constructor from plain pointer + explicit GenericMemberIterator(Pointer p) : ptr_(p) {} + + Pointer ptr_; //!< raw pointer +}; + +#else // RAPIDJSON_NOMEMBERITERATORCLASS + +// class-based member iterator implementation disabled, use plain pointers + +template +struct GenericMemberIterator; + +//! non-const GenericMemberIterator +template +struct GenericMemberIterator { + //! use plain pointer as iterator type + typedef GenericMember* Iterator; +}; +//! const GenericMemberIterator +template +struct GenericMemberIterator { + //! use plain const pointer as iterator type + typedef const GenericMember* Iterator; +}; + +#endif // RAPIDJSON_NOMEMBERITERATORCLASS + +/////////////////////////////////////////////////////////////////////////////// +// GenericStringRef + +//! Reference to a constant string (not taking a copy) +/*! + \tparam CharType character type of the string + + This helper class is used to automatically infer constant string + references for string literals, especially from \c const \b (!) + character arrays. + + The main use is for creating JSON string values without copying the + source string via an \ref Allocator. This requires that the referenced + string pointers have a sufficient lifetime, which exceeds the lifetime + of the associated GenericValue. + + \b Example + \code + Value v("foo"); // ok, no need to copy & calculate length + const char foo[] = "foo"; + v.SetString(foo); // ok + + const char* bar = foo; + // Value x(bar); // not ok, can't rely on bar's lifetime + Value x(StringRef(bar)); // lifetime explicitly guaranteed by user + Value y(StringRef(bar, 3)); // ok, explicitly pass length + \endcode + + \see StringRef, GenericValue::SetString +*/ +template +struct GenericStringRef { + typedef CharType Ch; //!< character type of the string + + //! Create string reference from \c const character array +#ifndef __clang__ // -Wdocumentation + /*! + This constructor implicitly creates a constant string reference from + a \c const character array. It has better performance than + \ref StringRef(const CharType*) by inferring the string \ref length + from the array length, and also supports strings containing null + characters. + + \tparam N length of the string, automatically inferred + + \param str Constant character array, lifetime assumed to be longer + than the use of the string in e.g. a GenericValue + + \post \ref s == str + + \note Constant complexity. + \note There is a hidden, private overload to disallow references to + non-const character arrays to be created via this constructor. + By this, e.g. function-scope arrays used to be filled via + \c snprintf are excluded from consideration. + In such cases, the referenced string should be \b copied to the + GenericValue instead. + */ +#endif + template + GenericStringRef(const CharType (&str)[N]) RAPIDJSON_NOEXCEPT + : s(str), length(N-1) {} + + //! Explicitly create string reference from \c const character pointer +#ifndef __clang__ // -Wdocumentation + /*! + This constructor can be used to \b explicitly create a reference to + a constant string pointer. + + \see StringRef(const CharType*) + + \param str Constant character pointer, lifetime assumed to be longer + than the use of the string in e.g. a GenericValue + + \post \ref s == str + + \note There is a hidden, private overload to disallow references to + non-const character arrays to be created via this constructor. + By this, e.g. function-scope arrays used to be filled via + \c snprintf are excluded from consideration. + In such cases, the referenced string should be \b copied to the + GenericValue instead. + */ +#endif + explicit GenericStringRef(const CharType* str) + : s(str), length(internal::StrLen(str)){ RAPIDJSON_ASSERT(s != 0); } + + //! Create constant string reference from pointer and length +#ifndef __clang__ // -Wdocumentation + /*! \param str constant string, lifetime assumed to be longer than the use of the string in e.g. a GenericValue + \param len length of the string, excluding the trailing NULL terminator + + \post \ref s == str && \ref length == len + \note Constant complexity. + */ +#endif + GenericStringRef(const CharType* str, SizeType len) + : s(str), length(len) { RAPIDJSON_ASSERT(s != 0); } + + GenericStringRef(const GenericStringRef& rhs) : s(rhs.s), length(rhs.length) {} + + //! implicit conversion to plain CharType pointer + operator const Ch *() const { return s; } + + const Ch* const s; //!< plain CharType pointer + const SizeType length; //!< length of the string (excluding the trailing NULL terminator) + +private: + //! Disallow construction from non-const array + template + GenericStringRef(CharType (&str)[N]) /* = delete */; + //! Copy assignment operator not permitted - immutable type + GenericStringRef& operator=(const GenericStringRef& rhs) /* = delete */; +}; + +//! Mark a character pointer as constant string +/*! Mark a plain character pointer as a "string literal". This function + can be used to avoid copying a character string to be referenced as a + value in a JSON GenericValue object, if the string's lifetime is known + to be valid long enough. + \tparam CharType Character type of the string + \param str Constant string, lifetime assumed to be longer than the use of the string in e.g. a GenericValue + \return GenericStringRef string reference object + \relatesalso GenericStringRef + + \see GenericValue::GenericValue(StringRefType), GenericValue::operator=(StringRefType), GenericValue::SetString(StringRefType), GenericValue::PushBack(StringRefType, Allocator&), GenericValue::AddMember +*/ +template +inline GenericStringRef StringRef(const CharType* str) { + return GenericStringRef(str, internal::StrLen(str)); +} + +//! Mark a character pointer as constant string +/*! Mark a plain character pointer as a "string literal". This function + can be used to avoid copying a character string to be referenced as a + value in a JSON GenericValue object, if the string's lifetime is known + to be valid long enough. + + This version has better performance with supplied length, and also + supports string containing null characters. + + \tparam CharType character type of the string + \param str Constant string, lifetime assumed to be longer than the use of the string in e.g. a GenericValue + \param length The length of source string. + \return GenericStringRef string reference object + \relatesalso GenericStringRef +*/ +template +inline GenericStringRef StringRef(const CharType* str, size_t length) { + return GenericStringRef(str, SizeType(length)); +} + +#if RAPIDJSON_HAS_STDSTRING +//! Mark a string object as constant string +/*! Mark a string object (e.g. \c std::string) as a "string literal". + This function can be used to avoid copying a string to be referenced as a + value in a JSON GenericValue object, if the string's lifetime is known + to be valid long enough. + + \tparam CharType character type of the string + \param str Constant string, lifetime assumed to be longer than the use of the string in e.g. a GenericValue + \return GenericStringRef string reference object + \relatesalso GenericStringRef + \note Requires the definition of the preprocessor symbol \ref RAPIDJSON_HAS_STDSTRING. +*/ +template +inline GenericStringRef StringRef(const std::basic_string& str) { + return GenericStringRef(str.data(), SizeType(str.size())); +} +#endif + +/////////////////////////////////////////////////////////////////////////////// +// GenericValue type traits +namespace internal { + +template +struct IsGenericValueImpl : FalseType {}; + +// select candidates according to nested encoding and allocator types +template struct IsGenericValueImpl::Type, typename Void::Type> + : IsBaseOf, T>::Type {}; + +// helper to match arbitrary GenericValue instantiations, including derived classes +template struct IsGenericValue : IsGenericValueImpl::Type {}; + +} // namespace internal + +/////////////////////////////////////////////////////////////////////////////// +// TypeHelper + +namespace internal { + +template +struct TypeHelper {}; + +template +struct TypeHelper { + static bool Is(const ValueType& v) { return v.IsBool(); } + static bool Get(const ValueType& v) { return v.GetBool(); } + static ValueType& Set(ValueType& v, bool data) { return v.SetBool(data); } + static ValueType& Set(ValueType& v, bool data, typename ValueType::AllocatorType&) { return v.SetBool(data); } +}; + +template +struct TypeHelper { + static bool Is(const ValueType& v) { return v.IsInt(); } + static int Get(const ValueType& v) { return v.GetInt(); } + static ValueType& Set(ValueType& v, int data) { return v.SetInt(data); } + static ValueType& Set(ValueType& v, int data, typename ValueType::AllocatorType&) { return v.SetInt(data); } +}; + +template +struct TypeHelper { + static bool Is(const ValueType& v) { return v.IsUint(); } + static unsigned Get(const ValueType& v) { return v.GetUint(); } + static ValueType& Set(ValueType& v, unsigned data) { return v.SetUint(data); } + static ValueType& Set(ValueType& v, unsigned data, typename ValueType::AllocatorType&) { return v.SetUint(data); } +}; + +template +struct TypeHelper { + static bool Is(const ValueType& v) { return v.IsInt64(); } + static int64_t Get(const ValueType& v) { return v.GetInt64(); } + static ValueType& Set(ValueType& v, int64_t data) { return v.SetInt64(data); } + static ValueType& Set(ValueType& v, int64_t data, typename ValueType::AllocatorType&) { return v.SetInt64(data); } +}; + +template +struct TypeHelper { + static bool Is(const ValueType& v) { return v.IsUint64(); } + static uint64_t Get(const ValueType& v) { return v.GetUint64(); } + static ValueType& Set(ValueType& v, uint64_t data) { return v.SetUint64(data); } + static ValueType& Set(ValueType& v, uint64_t data, typename ValueType::AllocatorType&) { return v.SetUint64(data); } +}; + +template +struct TypeHelper { + static bool Is(const ValueType& v) { return v.IsDouble(); } + static double Get(const ValueType& v) { return v.GetDouble(); } + static ValueType& Set(ValueType& v, double data) { return v.SetDouble(data); } + static ValueType& Set(ValueType& v, double data, typename ValueType::AllocatorType&) { return v.SetDouble(data); } +}; + +template +struct TypeHelper { + static bool Is(const ValueType& v) { return v.IsFloat(); } + static float Get(const ValueType& v) { return v.GetFloat(); } + static ValueType& Set(ValueType& v, float data) { return v.SetFloat(data); } + static ValueType& Set(ValueType& v, float data, typename ValueType::AllocatorType&) { return v.SetFloat(data); } +}; + +template +struct TypeHelper { + typedef const typename ValueType::Ch* StringType; + static bool Is(const ValueType& v) { return v.IsString(); } + static StringType Get(const ValueType& v) { return v.GetString(); } + static ValueType& Set(ValueType& v, const StringType data) { return v.SetString(typename ValueType::StringRefType(data)); } + static ValueType& Set(ValueType& v, const StringType data, typename ValueType::AllocatorType& a) { return v.SetString(data, a); } +}; + +#if RAPIDJSON_HAS_STDSTRING +template +struct TypeHelper > { + typedef std::basic_string StringType; + static bool Is(const ValueType& v) { return v.IsString(); } + static StringType Get(const ValueType& v) { return StringType(v.GetString(), v.GetStringLength()); } + static ValueType& Set(ValueType& v, const StringType& data, typename ValueType::AllocatorType& a) { return v.SetString(data, a); } +}; +#endif + +template +struct TypeHelper { + typedef typename ValueType::Array ArrayType; + static bool Is(const ValueType& v) { return v.IsArray(); } + static ArrayType Get(ValueType& v) { return v.GetArray(); } + static ValueType& Set(ValueType& v, ArrayType data) { return v = data; } + static ValueType& Set(ValueType& v, ArrayType data, typename ValueType::AllocatorType&) { return v = data; } +}; + +template +struct TypeHelper { + typedef typename ValueType::ConstArray ArrayType; + static bool Is(const ValueType& v) { return v.IsArray(); } + static ArrayType Get(const ValueType& v) { return v.GetArray(); } +}; + +template +struct TypeHelper { + typedef typename ValueType::Object ObjectType; + static bool Is(const ValueType& v) { return v.IsObject(); } + static ObjectType Get(ValueType& v) { return v.GetObject(); } + static ValueType& Set(ValueType& v, ObjectType data) { return v = data; } + static ValueType& Set(ValueType& v, ObjectType data, typename ValueType::AllocatorType&) { return v = data; } +}; + +template +struct TypeHelper { + typedef typename ValueType::ConstObject ObjectType; + static bool Is(const ValueType& v) { return v.IsObject(); } + static ObjectType Get(const ValueType& v) { return v.GetObject(); } +}; + +} // namespace internal + +// Forward declarations +template class GenericArray; +template class GenericObject; + +/////////////////////////////////////////////////////////////////////////////// +// GenericValue + +//! Represents a JSON value. Use Value for UTF8 encoding and default allocator. +/*! + A JSON value can be one of 7 types. This class is a variant type supporting + these types. + + Use the Value if UTF8 and default allocator + + \tparam Encoding Encoding of the value. (Even non-string values need to have the same encoding in a document) + \tparam Allocator Allocator type for allocating memory of object, array and string. +*/ +template > +class GenericValue { +public: + //! Name-value pair in an object. + typedef GenericMember Member; + typedef Encoding EncodingType; //!< Encoding type from template parameter. + typedef Allocator AllocatorType; //!< Allocator type from template parameter. + typedef typename Encoding::Ch Ch; //!< Character type derived from Encoding. + typedef GenericStringRef StringRefType; //!< Reference to a constant string + typedef typename GenericMemberIterator::Iterator MemberIterator; //!< Member iterator for iterating in object. + typedef typename GenericMemberIterator::Iterator ConstMemberIterator; //!< Constant member iterator for iterating in object. + typedef GenericValue* ValueIterator; //!< Value iterator for iterating in array. + typedef const GenericValue* ConstValueIterator; //!< Constant value iterator for iterating in array. + typedef GenericValue ValueType; //!< Value type of itself. + typedef GenericArray Array; + typedef GenericArray ConstArray; + typedef GenericObject Object; + typedef GenericObject ConstObject; + + //!@name Constructors and destructor. + //@{ + + //! Default constructor creates a null value. + GenericValue() RAPIDJSON_NOEXCEPT : data_() { data_.f.flags = kNullFlag; } + +#if RAPIDJSON_HAS_CXX11_RVALUE_REFS + //! Move constructor in C++11 + GenericValue(GenericValue&& rhs) RAPIDJSON_NOEXCEPT : data_(rhs.data_) { + rhs.data_.f.flags = kNullFlag; // give up contents + } +#endif + +private: + //! Copy constructor is not permitted. + GenericValue(const GenericValue& rhs); + +#if RAPIDJSON_HAS_CXX11_RVALUE_REFS + //! Moving from a GenericDocument is not permitted. + template + GenericValue(GenericDocument&& rhs); + + //! Move assignment from a GenericDocument is not permitted. + template + GenericValue& operator=(GenericDocument&& rhs); +#endif + +public: + + //! Constructor with JSON value type. + /*! This creates a Value of specified type with default content. + \param type Type of the value. + \note Default content for number is zero. + */ + explicit GenericValue(Type type) RAPIDJSON_NOEXCEPT : data_() { + static const uint16_t defaultFlags[7] = { + kNullFlag, kFalseFlag, kTrueFlag, kObjectFlag, kArrayFlag, kShortStringFlag, + kNumberAnyFlag + }; + RAPIDJSON_ASSERT(type <= kNumberType); + data_.f.flags = defaultFlags[type]; + + // Use ShortString to store empty string. + if (type == kStringType) + data_.ss.SetLength(0); + } + + //! Explicit copy constructor (with allocator) + /*! Creates a copy of a Value by using the given Allocator + \tparam SourceAllocator allocator of \c rhs + \param rhs Value to copy from (read-only) + \param allocator Allocator for allocating copied elements and buffers. Commonly use GenericDocument::GetAllocator(). + \param copyConstStrings Force copying of constant strings (e.g. referencing an in-situ buffer) + \see CopyFrom() + */ + template + GenericValue(const GenericValue& rhs, Allocator& allocator, bool copyConstStrings = false) { + switch (rhs.GetType()) { + case kObjectType: { + SizeType count = rhs.data_.o.size; + Member* lm = reinterpret_cast(allocator.Malloc(count * sizeof(Member))); + const typename GenericValue::Member* rm = rhs.GetMembersPointer(); + for (SizeType i = 0; i < count; i++) { + new (&lm[i].name) GenericValue(rm[i].name, allocator, copyConstStrings); + new (&lm[i].value) GenericValue(rm[i].value, allocator, copyConstStrings); + } + data_.f.flags = kObjectFlag; + data_.o.size = data_.o.capacity = count; + SetMembersPointer(lm); + } + break; + case kArrayType: { + SizeType count = rhs.data_.a.size; + GenericValue* le = reinterpret_cast(allocator.Malloc(count * sizeof(GenericValue))); + const GenericValue* re = rhs.GetElementsPointer(); + for (SizeType i = 0; i < count; i++) + new (&le[i]) GenericValue(re[i], allocator, copyConstStrings); + data_.f.flags = kArrayFlag; + data_.a.size = data_.a.capacity = count; + SetElementsPointer(le); + } + break; + case kStringType: + if (rhs.data_.f.flags == kConstStringFlag && !copyConstStrings) { + data_.f.flags = rhs.data_.f.flags; + data_ = *reinterpret_cast(&rhs.data_); + } + else + SetStringRaw(StringRef(rhs.GetString(), rhs.GetStringLength()), allocator); + break; + default: + data_.f.flags = rhs.data_.f.flags; + data_ = *reinterpret_cast(&rhs.data_); + break; + } + } + + //! Constructor for boolean value. + /*! \param b Boolean value + \note This constructor is limited to \em real boolean values and rejects + implicitly converted types like arbitrary pointers. Use an explicit cast + to \c bool, if you want to construct a boolean JSON value in such cases. + */ +#ifndef RAPIDJSON_DOXYGEN_RUNNING // hide SFINAE from Doxygen + template + explicit GenericValue(T b, RAPIDJSON_ENABLEIF((internal::IsSame))) RAPIDJSON_NOEXCEPT // See #472 +#else + explicit GenericValue(bool b) RAPIDJSON_NOEXCEPT +#endif + : data_() { + // safe-guard against failing SFINAE + RAPIDJSON_STATIC_ASSERT((internal::IsSame::Value)); + data_.f.flags = b ? kTrueFlag : kFalseFlag; + } + + //! Constructor for int value. + explicit GenericValue(int i) RAPIDJSON_NOEXCEPT : data_() { + data_.n.i64 = i; + data_.f.flags = (i >= 0) ? (kNumberIntFlag | kUintFlag | kUint64Flag) : kNumberIntFlag; + } + + //! Constructor for unsigned value. + explicit GenericValue(unsigned u) RAPIDJSON_NOEXCEPT : data_() { + data_.n.u64 = u; + data_.f.flags = (u & 0x80000000) ? kNumberUintFlag : (kNumberUintFlag | kIntFlag | kInt64Flag); + } + + //! Constructor for int64_t value. + explicit GenericValue(int64_t i64) RAPIDJSON_NOEXCEPT : data_() { + data_.n.i64 = i64; + data_.f.flags = kNumberInt64Flag; + if (i64 >= 0) { + data_.f.flags |= kNumberUint64Flag; + if (!(static_cast(i64) & RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0x00000000))) + data_.f.flags |= kUintFlag; + if (!(static_cast(i64) & RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0x80000000))) + data_.f.flags |= kIntFlag; + } + else if (i64 >= static_cast(RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0x80000000))) + data_.f.flags |= kIntFlag; + } + + //! Constructor for uint64_t value. + explicit GenericValue(uint64_t u64) RAPIDJSON_NOEXCEPT : data_() { + data_.n.u64 = u64; + data_.f.flags = kNumberUint64Flag; + if (!(u64 & RAPIDJSON_UINT64_C2(0x80000000, 0x00000000))) + data_.f.flags |= kInt64Flag; + if (!(u64 & RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0x00000000))) + data_.f.flags |= kUintFlag; + if (!(u64 & RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0x80000000))) + data_.f.flags |= kIntFlag; + } + + //! Constructor for double value. + explicit GenericValue(double d) RAPIDJSON_NOEXCEPT : data_() { data_.n.d = d; data_.f.flags = kNumberDoubleFlag; } + + //! Constructor for float value. + explicit GenericValue(float f) RAPIDJSON_NOEXCEPT : data_() { data_.n.d = static_cast(f); data_.f.flags = kNumberDoubleFlag; } + + //! Constructor for constant string (i.e. do not make a copy of string) + GenericValue(const Ch* s, SizeType length) RAPIDJSON_NOEXCEPT : data_() { SetStringRaw(StringRef(s, length)); } + + //! Constructor for constant string (i.e. do not make a copy of string) + explicit GenericValue(StringRefType s) RAPIDJSON_NOEXCEPT : data_() { SetStringRaw(s); } + + //! Constructor for copy-string (i.e. do make a copy of string) + GenericValue(const Ch* s, SizeType length, Allocator& allocator) : data_() { SetStringRaw(StringRef(s, length), allocator); } + + //! Constructor for copy-string (i.e. do make a copy of string) + GenericValue(const Ch*s, Allocator& allocator) : data_() { SetStringRaw(StringRef(s), allocator); } + +#if RAPIDJSON_HAS_STDSTRING + //! Constructor for copy-string from a string object (i.e. do make a copy of string) + /*! \note Requires the definition of the preprocessor symbol \ref RAPIDJSON_HAS_STDSTRING. + */ + GenericValue(const std::basic_string& s, Allocator& allocator) : data_() { SetStringRaw(StringRef(s), allocator); } +#endif + + //! Constructor for Array. + /*! + \param a An array obtained by \c GetArray(). + \note \c Array is always pass-by-value. + \note the source array is moved into this value and the sourec array becomes empty. + */ + GenericValue(Array a) RAPIDJSON_NOEXCEPT : data_(a.value_.data_) { + a.value_.data_ = Data(); + a.value_.data_.f.flags = kArrayFlag; + } + + //! Constructor for Object. + /*! + \param o An object obtained by \c GetObject(). + \note \c Object is always pass-by-value. + \note the source object is moved into this value and the sourec object becomes empty. + */ + GenericValue(Object o) RAPIDJSON_NOEXCEPT : data_(o.value_.data_) { + o.value_.data_ = Data(); + o.value_.data_.f.flags = kObjectFlag; + } + + //! Destructor. + /*! Need to destruct elements of array, members of object, or copy-string. + */ + ~GenericValue() { + if (Allocator::kNeedFree) { // Shortcut by Allocator's trait + switch(data_.f.flags) { + case kArrayFlag: + { + GenericValue* e = GetElementsPointer(); + for (GenericValue* v = e; v != e + data_.a.size; ++v) + v->~GenericValue(); + Allocator::Free(e); + } + break; + + case kObjectFlag: + for (MemberIterator m = MemberBegin(); m != MemberEnd(); ++m) + m->~Member(); + Allocator::Free(GetMembersPointer()); + break; + + case kCopyStringFlag: + Allocator::Free(const_cast(GetStringPointer())); + break; + + default: + break; // Do nothing for other types. + } + } + } + + //@} + + //!@name Assignment operators + //@{ + + //! Assignment with move semantics. + /*! \param rhs Source of the assignment. It will become a null value after assignment. + */ + GenericValue& operator=(GenericValue& rhs) RAPIDJSON_NOEXCEPT { + RAPIDJSON_ASSERT(this != &rhs); + this->~GenericValue(); + RawAssign(rhs); + return *this; + } + +#if RAPIDJSON_HAS_CXX11_RVALUE_REFS + //! Move assignment in C++11 + GenericValue& operator=(GenericValue&& rhs) RAPIDJSON_NOEXCEPT { + return *this = rhs.Move(); + } +#endif + + //! Assignment of constant string reference (no copy) + /*! \param str Constant string reference to be assigned + \note This overload is needed to avoid clashes with the generic primitive type assignment overload below. + \see GenericStringRef, operator=(T) + */ + GenericValue& operator=(StringRefType str) RAPIDJSON_NOEXCEPT { + GenericValue s(str); + return *this = s; + } + + //! Assignment with primitive types. + /*! \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t + \param value The value to be assigned. + + \note The source type \c T explicitly disallows all pointer types, + especially (\c const) \ref Ch*. This helps avoiding implicitly + referencing character strings with insufficient lifetime, use + \ref SetString(const Ch*, Allocator&) (for copying) or + \ref StringRef() (to explicitly mark the pointer as constant) instead. + All other pointer types would implicitly convert to \c bool, + use \ref SetBool() instead. + */ + template + RAPIDJSON_DISABLEIF_RETURN((internal::IsPointer), (GenericValue&)) + operator=(T value) { + GenericValue v(value); + return *this = v; + } + + //! Deep-copy assignment from Value + /*! Assigns a \b copy of the Value to the current Value object + \tparam SourceAllocator Allocator type of \c rhs + \param rhs Value to copy from (read-only) + \param allocator Allocator to use for copying + \param copyConstStrings Force copying of constant strings (e.g. referencing an in-situ buffer) + */ + template + GenericValue& CopyFrom(const GenericValue& rhs, Allocator& allocator, bool copyConstStrings = false) { + RAPIDJSON_ASSERT(static_cast(this) != static_cast(&rhs)); + this->~GenericValue(); + new (this) GenericValue(rhs, allocator, copyConstStrings); + return *this; + } + + //! Exchange the contents of this value with those of other. + /*! + \param other Another value. + \note Constant complexity. + */ + GenericValue& Swap(GenericValue& other) RAPIDJSON_NOEXCEPT { + GenericValue temp; + temp.RawAssign(*this); + RawAssign(other); + other.RawAssign(temp); + return *this; + } + + //! free-standing swap function helper + /*! + Helper function to enable support for common swap implementation pattern based on \c std::swap: + \code + void swap(MyClass& a, MyClass& b) { + using std::swap; + swap(a.value, b.value); + // ... + } + \endcode + \see Swap() + */ + friend inline void swap(GenericValue& a, GenericValue& b) RAPIDJSON_NOEXCEPT { a.Swap(b); } + + //! Prepare Value for move semantics + /*! \return *this */ + GenericValue& Move() RAPIDJSON_NOEXCEPT { return *this; } + //@} + + //!@name Equal-to and not-equal-to operators + //@{ + //! Equal-to operator + /*! + \note If an object contains duplicated named member, comparing equality with any object is always \c false. + \note Linear time complexity (number of all values in the subtree and total lengths of all strings). + */ + template + bool operator==(const GenericValue& rhs) const { + typedef GenericValue RhsType; + if (GetType() != rhs.GetType()) + return false; + + switch (GetType()) { + case kObjectType: // Warning: O(n^2) inner-loop + if (data_.o.size != rhs.data_.o.size) + return false; + for (ConstMemberIterator lhsMemberItr = MemberBegin(); lhsMemberItr != MemberEnd(); ++lhsMemberItr) { + typename RhsType::ConstMemberIterator rhsMemberItr = rhs.FindMember(lhsMemberItr->name); + if (rhsMemberItr == rhs.MemberEnd() || lhsMemberItr->value != rhsMemberItr->value) + return false; + } + return true; + + case kArrayType: + if (data_.a.size != rhs.data_.a.size) + return false; + for (SizeType i = 0; i < data_.a.size; i++) + if ((*this)[i] != rhs[i]) + return false; + return true; + + case kStringType: + return StringEqual(rhs); + + case kNumberType: + if (IsDouble() || rhs.IsDouble()) { + double a = GetDouble(); // May convert from integer to double. + double b = rhs.GetDouble(); // Ditto + return a >= b && a <= b; // Prevent -Wfloat-equal + } + else + return data_.n.u64 == rhs.data_.n.u64; + + default: + return true; + } + } + + //! Equal-to operator with const C-string pointer + bool operator==(const Ch* rhs) const { return *this == GenericValue(StringRef(rhs)); } + +#if RAPIDJSON_HAS_STDSTRING + //! Equal-to operator with string object + /*! \note Requires the definition of the preprocessor symbol \ref RAPIDJSON_HAS_STDSTRING. + */ + bool operator==(const std::basic_string& rhs) const { return *this == GenericValue(StringRef(rhs)); } +#endif + + //! Equal-to operator with primitive types + /*! \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t, \c double, \c true, \c false + */ + template RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr,internal::IsGenericValue >), (bool)) operator==(const T& rhs) const { return *this == GenericValue(rhs); } + + //! Not-equal-to operator + /*! \return !(*this == rhs) + */ + template + bool operator!=(const GenericValue& rhs) const { return !(*this == rhs); } + + //! Not-equal-to operator with const C-string pointer + bool operator!=(const Ch* rhs) const { return !(*this == rhs); } + + //! Not-equal-to operator with arbitrary types + /*! \return !(*this == rhs) + */ + template RAPIDJSON_DISABLEIF_RETURN((internal::IsGenericValue), (bool)) operator!=(const T& rhs) const { return !(*this == rhs); } + + //! Equal-to operator with arbitrary types (symmetric version) + /*! \return (rhs == lhs) + */ + template friend RAPIDJSON_DISABLEIF_RETURN((internal::IsGenericValue), (bool)) operator==(const T& lhs, const GenericValue& rhs) { return rhs == lhs; } + + //! Not-Equal-to operator with arbitrary types (symmetric version) + /*! \return !(rhs == lhs) + */ + template friend RAPIDJSON_DISABLEIF_RETURN((internal::IsGenericValue), (bool)) operator!=(const T& lhs, const GenericValue& rhs) { return !(rhs == lhs); } + //@} + + //!@name Type + //@{ + + Type GetType() const { return static_cast(data_.f.flags & kTypeMask); } + bool IsNull() const { return data_.f.flags == kNullFlag; } + bool IsFalse() const { return data_.f.flags == kFalseFlag; } + bool IsTrue() const { return data_.f.flags == kTrueFlag; } + bool IsBool() const { return (data_.f.flags & kBoolFlag) != 0; } + bool IsObject() const { return data_.f.flags == kObjectFlag; } + bool IsArray() const { return data_.f.flags == kArrayFlag; } + bool IsNumber() const { return (data_.f.flags & kNumberFlag) != 0; } + bool IsInt() const { return (data_.f.flags & kIntFlag) != 0; } + bool IsUint() const { return (data_.f.flags & kUintFlag) != 0; } + bool IsInt64() const { return (data_.f.flags & kInt64Flag) != 0; } + bool IsUint64() const { return (data_.f.flags & kUint64Flag) != 0; } + bool IsDouble() const { return (data_.f.flags & kDoubleFlag) != 0; } + bool IsString() const { return (data_.f.flags & kStringFlag) != 0; } + + // Checks whether a number can be losslessly converted to a double. + bool IsLosslessDouble() const { + if (!IsNumber()) return false; + if (IsUint64()) { + uint64_t u = GetUint64(); + volatile double d = static_cast(u); + return (d >= 0.0) + && (d < static_cast(std::numeric_limits::max())) + && (u == static_cast(d)); + } + if (IsInt64()) { + int64_t i = GetInt64(); + volatile double d = static_cast(i); + return (d >= static_cast(std::numeric_limits::min())) + && (d < static_cast(std::numeric_limits::max())) + && (i == static_cast(d)); + } + return true; // double, int, uint are always lossless + } + + // Checks whether a number is a float (possible lossy). + bool IsFloat() const { + if ((data_.f.flags & kDoubleFlag) == 0) + return false; + double d = GetDouble(); + return d >= -3.4028234e38 && d <= 3.4028234e38; + } + // Checks whether a number can be losslessly converted to a float. + bool IsLosslessFloat() const { + if (!IsNumber()) return false; + double a = GetDouble(); + if (a < static_cast(-std::numeric_limits::max()) + || a > static_cast(std::numeric_limits::max())) + return false; + double b = static_cast(static_cast(a)); + return a >= b && a <= b; // Prevent -Wfloat-equal + } + + //@} + + //!@name Null + //@{ + + GenericValue& SetNull() { this->~GenericValue(); new (this) GenericValue(); return *this; } + + //@} + + //!@name Bool + //@{ + + bool GetBool() const { RAPIDJSON_ASSERT(IsBool()); return data_.f.flags == kTrueFlag; } + //!< Set boolean value + /*! \post IsBool() == true */ + GenericValue& SetBool(bool b) { this->~GenericValue(); new (this) GenericValue(b); return *this; } + + //@} + + //!@name Object + //@{ + + //! Set this value as an empty object. + /*! \post IsObject() == true */ + GenericValue& SetObject() { this->~GenericValue(); new (this) GenericValue(kObjectType); return *this; } + + //! Get the number of members in the object. + SizeType MemberCount() const { RAPIDJSON_ASSERT(IsObject()); return data_.o.size; } + + //! Check whether the object is empty. + bool ObjectEmpty() const { RAPIDJSON_ASSERT(IsObject()); return data_.o.size == 0; } + + //! Get a value from an object associated with the name. + /*! \pre IsObject() == true + \tparam T Either \c Ch or \c const \c Ch (template used for disambiguation with \ref operator[](SizeType)) + \note In version 0.1x, if the member is not found, this function returns a null value. This makes issue 7. + Since 0.2, if the name is not correct, it will assert. + If user is unsure whether a member exists, user should use HasMember() first. + A better approach is to use FindMember(). + \note Linear time complexity. + */ + template + RAPIDJSON_DISABLEIF_RETURN((internal::NotExpr::Type, Ch> >),(GenericValue&)) operator[](T* name) { + GenericValue n(StringRef(name)); + return (*this)[n]; + } + template + RAPIDJSON_DISABLEIF_RETURN((internal::NotExpr::Type, Ch> >),(const GenericValue&)) operator[](T* name) const { return const_cast(*this)[name]; } + + //! Get a value from an object associated with the name. + /*! \pre IsObject() == true + \tparam SourceAllocator Allocator of the \c name value + + \note Compared to \ref operator[](T*), this version is faster because it does not need a StrLen(). + And it can also handle strings with embedded null characters. + + \note Linear time complexity. + */ + template + GenericValue& operator[](const GenericValue& name) { + MemberIterator member = FindMember(name); + if (member != MemberEnd()) + return member->value; + else { + RAPIDJSON_ASSERT(false); // see above note + + // This will generate -Wexit-time-destructors in clang + // static GenericValue NullValue; + // return NullValue; + + // Use static buffer and placement-new to prevent destruction + static char buffer[sizeof(GenericValue)]; + return *new (buffer) GenericValue(); + } + } + template + const GenericValue& operator[](const GenericValue& name) const { return const_cast(*this)[name]; } + +#if RAPIDJSON_HAS_STDSTRING + //! Get a value from an object associated with name (string object). + GenericValue& operator[](const std::basic_string& name) { return (*this)[GenericValue(StringRef(name))]; } + const GenericValue& operator[](const std::basic_string& name) const { return (*this)[GenericValue(StringRef(name))]; } +#endif + + //! Const member iterator + /*! \pre IsObject() == true */ + ConstMemberIterator MemberBegin() const { RAPIDJSON_ASSERT(IsObject()); return ConstMemberIterator(GetMembersPointer()); } + //! Const \em past-the-end member iterator + /*! \pre IsObject() == true */ + ConstMemberIterator MemberEnd() const { RAPIDJSON_ASSERT(IsObject()); return ConstMemberIterator(GetMembersPointer() + data_.o.size); } + //! Member iterator + /*! \pre IsObject() == true */ + MemberIterator MemberBegin() { RAPIDJSON_ASSERT(IsObject()); return MemberIterator(GetMembersPointer()); } + //! \em Past-the-end member iterator + /*! \pre IsObject() == true */ + MemberIterator MemberEnd() { RAPIDJSON_ASSERT(IsObject()); return MemberIterator(GetMembersPointer() + data_.o.size); } + + //! Check whether a member exists in the object. + /*! + \param name Member name to be searched. + \pre IsObject() == true + \return Whether a member with that name exists. + \note It is better to use FindMember() directly if you need the obtain the value as well. + \note Linear time complexity. + */ + bool HasMember(const Ch* name) const { return FindMember(name) != MemberEnd(); } + +#if RAPIDJSON_HAS_STDSTRING + //! Check whether a member exists in the object with string object. + /*! + \param name Member name to be searched. + \pre IsObject() == true + \return Whether a member with that name exists. + \note It is better to use FindMember() directly if you need the obtain the value as well. + \note Linear time complexity. + */ + bool HasMember(const std::basic_string& name) const { return FindMember(name) != MemberEnd(); } +#endif + + //! Check whether a member exists in the object with GenericValue name. + /*! + This version is faster because it does not need a StrLen(). It can also handle string with null character. + \param name Member name to be searched. + \pre IsObject() == true + \return Whether a member with that name exists. + \note It is better to use FindMember() directly if you need the obtain the value as well. + \note Linear time complexity. + */ + template + bool HasMember(const GenericValue& name) const { return FindMember(name) != MemberEnd(); } + + //! Find member by name. + /*! + \param name Member name to be searched. + \pre IsObject() == true + \return Iterator to member, if it exists. + Otherwise returns \ref MemberEnd(). + + \note Earlier versions of Rapidjson returned a \c NULL pointer, in case + the requested member doesn't exist. For consistency with e.g. + \c std::map, this has been changed to MemberEnd() now. + \note Linear time complexity. + */ + MemberIterator FindMember(const Ch* name) { + GenericValue n(StringRef(name)); + return FindMember(n); + } + + ConstMemberIterator FindMember(const Ch* name) const { return const_cast(*this).FindMember(name); } + + //! Find member by name. + /*! + This version is faster because it does not need a StrLen(). It can also handle string with null character. + \param name Member name to be searched. + \pre IsObject() == true + \return Iterator to member, if it exists. + Otherwise returns \ref MemberEnd(). + + \note Earlier versions of Rapidjson returned a \c NULL pointer, in case + the requested member doesn't exist. For consistency with e.g. + \c std::map, this has been changed to MemberEnd() now. + \note Linear time complexity. + */ + template + MemberIterator FindMember(const GenericValue& name) { + RAPIDJSON_ASSERT(IsObject()); + RAPIDJSON_ASSERT(name.IsString()); + MemberIterator member = MemberBegin(); + for ( ; member != MemberEnd(); ++member) + if (name.StringEqual(member->name)) + break; + return member; + } + template ConstMemberIterator FindMember(const GenericValue& name) const { return const_cast(*this).FindMember(name); } + +#if RAPIDJSON_HAS_STDSTRING + //! Find member by string object name. + /*! + \param name Member name to be searched. + \pre IsObject() == true + \return Iterator to member, if it exists. + Otherwise returns \ref MemberEnd(). + */ + MemberIterator FindMember(const std::basic_string& name) { return FindMember(GenericValue(StringRef(name))); } + ConstMemberIterator FindMember(const std::basic_string& name) const { return FindMember(GenericValue(StringRef(name))); } +#endif + + //! Add a member (name-value pair) to the object. + /*! \param name A string value as name of member. + \param value Value of any type. + \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator(). + \return The value itself for fluent API. + \note The ownership of \c name and \c value will be transferred to this object on success. + \pre IsObject() && name.IsString() + \post name.IsNull() && value.IsNull() + \note Amortized Constant time complexity. + */ + GenericValue& AddMember(GenericValue& name, GenericValue& value, Allocator& allocator) { + RAPIDJSON_ASSERT(IsObject()); + RAPIDJSON_ASSERT(name.IsString()); + + ObjectData& o = data_.o; + if (o.size >= o.capacity) { + if (o.capacity == 0) { + o.capacity = kDefaultObjectCapacity; + SetMembersPointer(reinterpret_cast(allocator.Malloc(o.capacity * sizeof(Member)))); + } + else { + SizeType oldCapacity = o.capacity; + o.capacity += (oldCapacity + 1) / 2; // grow by factor 1.5 + SetMembersPointer(reinterpret_cast(allocator.Realloc(GetMembersPointer(), oldCapacity * sizeof(Member), o.capacity * sizeof(Member)))); + } + } + Member* members = GetMembersPointer(); + members[o.size].name.RawAssign(name); + members[o.size].value.RawAssign(value); + o.size++; + return *this; + } + + //! Add a constant string value as member (name-value pair) to the object. + /*! \param name A string value as name of member. + \param value constant string reference as value of member. + \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator(). + \return The value itself for fluent API. + \pre IsObject() + \note This overload is needed to avoid clashes with the generic primitive type AddMember(GenericValue&,T,Allocator&) overload below. + \note Amortized Constant time complexity. + */ + GenericValue& AddMember(GenericValue& name, StringRefType value, Allocator& allocator) { + GenericValue v(value); + return AddMember(name, v, allocator); + } + +#if RAPIDJSON_HAS_STDSTRING + //! Add a string object as member (name-value pair) to the object. + /*! \param name A string value as name of member. + \param value constant string reference as value of member. + \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator(). + \return The value itself for fluent API. + \pre IsObject() + \note This overload is needed to avoid clashes with the generic primitive type AddMember(GenericValue&,T,Allocator&) overload below. + \note Amortized Constant time complexity. + */ + GenericValue& AddMember(GenericValue& name, std::basic_string& value, Allocator& allocator) { + GenericValue v(value, allocator); + return AddMember(name, v, allocator); + } +#endif + + //! Add any primitive value as member (name-value pair) to the object. + /*! \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t + \param name A string value as name of member. + \param value Value of primitive type \c T as value of member + \param allocator Allocator for reallocating memory. Commonly use GenericDocument::GetAllocator(). + \return The value itself for fluent API. + \pre IsObject() + + \note The source type \c T explicitly disallows all pointer types, + especially (\c const) \ref Ch*. This helps avoiding implicitly + referencing character strings with insufficient lifetime, use + \ref AddMember(StringRefType, GenericValue&, Allocator&) or \ref + AddMember(StringRefType, StringRefType, Allocator&). + All other pointer types would implicitly convert to \c bool, + use an explicit cast instead, if needed. + \note Amortized Constant time complexity. + */ + template + RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (GenericValue&)) + AddMember(GenericValue& name, T value, Allocator& allocator) { + GenericValue v(value); + return AddMember(name, v, allocator); + } + +#if RAPIDJSON_HAS_CXX11_RVALUE_REFS + GenericValue& AddMember(GenericValue&& name, GenericValue&& value, Allocator& allocator) { + return AddMember(name, value, allocator); + } + GenericValue& AddMember(GenericValue&& name, GenericValue& value, Allocator& allocator) { + return AddMember(name, value, allocator); + } + GenericValue& AddMember(GenericValue& name, GenericValue&& value, Allocator& allocator) { + return AddMember(name, value, allocator); + } + GenericValue& AddMember(StringRefType name, GenericValue&& value, Allocator& allocator) { + GenericValue n(name); + return AddMember(n, value, allocator); + } +#endif // RAPIDJSON_HAS_CXX11_RVALUE_REFS + + + //! Add a member (name-value pair) to the object. + /*! \param name A constant string reference as name of member. + \param value Value of any type. + \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator(). + \return The value itself for fluent API. + \note The ownership of \c value will be transferred to this object on success. + \pre IsObject() + \post value.IsNull() + \note Amortized Constant time complexity. + */ + GenericValue& AddMember(StringRefType name, GenericValue& value, Allocator& allocator) { + GenericValue n(name); + return AddMember(n, value, allocator); + } + + //! Add a constant string value as member (name-value pair) to the object. + /*! \param name A constant string reference as name of member. + \param value constant string reference as value of member. + \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator(). + \return The value itself for fluent API. + \pre IsObject() + \note This overload is needed to avoid clashes with the generic primitive type AddMember(StringRefType,T,Allocator&) overload below. + \note Amortized Constant time complexity. + */ + GenericValue& AddMember(StringRefType name, StringRefType value, Allocator& allocator) { + GenericValue v(value); + return AddMember(name, v, allocator); + } + + //! Add any primitive value as member (name-value pair) to the object. + /*! \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t + \param name A constant string reference as name of member. + \param value Value of primitive type \c T as value of member + \param allocator Allocator for reallocating memory. Commonly use GenericDocument::GetAllocator(). + \return The value itself for fluent API. + \pre IsObject() + + \note The source type \c T explicitly disallows all pointer types, + especially (\c const) \ref Ch*. This helps avoiding implicitly + referencing character strings with insufficient lifetime, use + \ref AddMember(StringRefType, GenericValue&, Allocator&) or \ref + AddMember(StringRefType, StringRefType, Allocator&). + All other pointer types would implicitly convert to \c bool, + use an explicit cast instead, if needed. + \note Amortized Constant time complexity. + */ + template + RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (GenericValue&)) + AddMember(StringRefType name, T value, Allocator& allocator) { + GenericValue n(name); + return AddMember(n, value, allocator); + } + + //! Remove all members in the object. + /*! This function do not deallocate memory in the object, i.e. the capacity is unchanged. + \note Linear time complexity. + */ + void RemoveAllMembers() { + RAPIDJSON_ASSERT(IsObject()); + for (MemberIterator m = MemberBegin(); m != MemberEnd(); ++m) + m->~Member(); + data_.o.size = 0; + } + + //! Remove a member in object by its name. + /*! \param name Name of member to be removed. + \return Whether the member existed. + \note This function may reorder the object members. Use \ref + EraseMember(ConstMemberIterator) if you need to preserve the + relative order of the remaining members. + \note Linear time complexity. + */ + bool RemoveMember(const Ch* name) { + GenericValue n(StringRef(name)); + return RemoveMember(n); + } + +#if RAPIDJSON_HAS_STDSTRING + bool RemoveMember(const std::basic_string& name) { return RemoveMember(GenericValue(StringRef(name))); } +#endif + + template + bool RemoveMember(const GenericValue& name) { + MemberIterator m = FindMember(name); + if (m != MemberEnd()) { + RemoveMember(m); + return true; + } + else + return false; + } + + //! Remove a member in object by iterator. + /*! \param m member iterator (obtained by FindMember() or MemberBegin()). + \return the new iterator after removal. + \note This function may reorder the object members. Use \ref + EraseMember(ConstMemberIterator) if you need to preserve the + relative order of the remaining members. + \note Constant time complexity. + */ + MemberIterator RemoveMember(MemberIterator m) { + RAPIDJSON_ASSERT(IsObject()); + RAPIDJSON_ASSERT(data_.o.size > 0); + RAPIDJSON_ASSERT(GetMembersPointer() != 0); + RAPIDJSON_ASSERT(m >= MemberBegin() && m < MemberEnd()); + + MemberIterator last(GetMembersPointer() + (data_.o.size - 1)); + if (data_.o.size > 1 && m != last) + *m = *last; // Move the last one to this place + else + m->~Member(); // Only one left, just destroy + --data_.o.size; + return m; + } + + //! Remove a member from an object by iterator. + /*! \param pos iterator to the member to remove + \pre IsObject() == true && \ref MemberBegin() <= \c pos < \ref MemberEnd() + \return Iterator following the removed element. + If the iterator \c pos refers to the last element, the \ref MemberEnd() iterator is returned. + \note This function preserves the relative order of the remaining object + members. If you do not need this, use the more efficient \ref RemoveMember(MemberIterator). + \note Linear time complexity. + */ + MemberIterator EraseMember(ConstMemberIterator pos) { + return EraseMember(pos, pos +1); + } + + //! Remove members in the range [first, last) from an object. + /*! \param first iterator to the first member to remove + \param last iterator following the last member to remove + \pre IsObject() == true && \ref MemberBegin() <= \c first <= \c last <= \ref MemberEnd() + \return Iterator following the last removed element. + \note This function preserves the relative order of the remaining object + members. + \note Linear time complexity. + */ + MemberIterator EraseMember(ConstMemberIterator first, ConstMemberIterator last) { + RAPIDJSON_ASSERT(IsObject()); + RAPIDJSON_ASSERT(data_.o.size > 0); + RAPIDJSON_ASSERT(GetMembersPointer() != 0); + RAPIDJSON_ASSERT(first >= MemberBegin()); + RAPIDJSON_ASSERT(first <= last); + RAPIDJSON_ASSERT(last <= MemberEnd()); + + MemberIterator pos = MemberBegin() + (first - MemberBegin()); + for (MemberIterator itr = pos; itr != last; ++itr) + itr->~Member(); + std::memmove(&*pos, &*last, static_cast(MemberEnd() - last) * sizeof(Member)); + data_.o.size -= static_cast(last - first); + return pos; + } + + //! Erase a member in object by its name. + /*! \param name Name of member to be removed. + \return Whether the member existed. + \note Linear time complexity. + */ + bool EraseMember(const Ch* name) { + GenericValue n(StringRef(name)); + return EraseMember(n); + } + +#if RAPIDJSON_HAS_STDSTRING + bool EraseMember(const std::basic_string& name) { return EraseMember(GenericValue(StringRef(name))); } +#endif + + template + bool EraseMember(const GenericValue& name) { + MemberIterator m = FindMember(name); + if (m != MemberEnd()) { + EraseMember(m); + return true; + } + else + return false; + } + + Object GetObject() { RAPIDJSON_ASSERT(IsObject()); return Object(*this); } + ConstObject GetObject() const { RAPIDJSON_ASSERT(IsObject()); return ConstObject(*this); } + + //@} + + //!@name Array + //@{ + + //! Set this value as an empty array. + /*! \post IsArray == true */ + GenericValue& SetArray() { this->~GenericValue(); new (this) GenericValue(kArrayType); return *this; } + + //! Get the number of elements in array. + SizeType Size() const { RAPIDJSON_ASSERT(IsArray()); return data_.a.size; } + + //! Get the capacity of array. + SizeType Capacity() const { RAPIDJSON_ASSERT(IsArray()); return data_.a.capacity; } + + //! Check whether the array is empty. + bool Empty() const { RAPIDJSON_ASSERT(IsArray()); return data_.a.size == 0; } + + //! Remove all elements in the array. + /*! This function do not deallocate memory in the array, i.e. the capacity is unchanged. + \note Linear time complexity. + */ + void Clear() { + RAPIDJSON_ASSERT(IsArray()); + GenericValue* e = GetElementsPointer(); + for (GenericValue* v = e; v != e + data_.a.size; ++v) + v->~GenericValue(); + data_.a.size = 0; + } + + //! Get an element from array by index. + /*! \pre IsArray() == true + \param index Zero-based index of element. + \see operator[](T*) + */ + GenericValue& operator[](SizeType index) { + RAPIDJSON_ASSERT(IsArray()); + RAPIDJSON_ASSERT(index < data_.a.size); + return GetElementsPointer()[index]; + } + const GenericValue& operator[](SizeType index) const { return const_cast(*this)[index]; } + + //! Element iterator + /*! \pre IsArray() == true */ + ValueIterator Begin() { RAPIDJSON_ASSERT(IsArray()); return GetElementsPointer(); } + //! \em Past-the-end element iterator + /*! \pre IsArray() == true */ + ValueIterator End() { RAPIDJSON_ASSERT(IsArray()); return GetElementsPointer() + data_.a.size; } + //! Constant element iterator + /*! \pre IsArray() == true */ + ConstValueIterator Begin() const { return const_cast(*this).Begin(); } + //! Constant \em past-the-end element iterator + /*! \pre IsArray() == true */ + ConstValueIterator End() const { return const_cast(*this).End(); } + + //! Request the array to have enough capacity to store elements. + /*! \param newCapacity The capacity that the array at least need to have. + \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator(). + \return The value itself for fluent API. + \note Linear time complexity. + */ + GenericValue& Reserve(SizeType newCapacity, Allocator &allocator) { + RAPIDJSON_ASSERT(IsArray()); + if (newCapacity > data_.a.capacity) { + SetElementsPointer(reinterpret_cast(allocator.Realloc(GetElementsPointer(), data_.a.capacity * sizeof(GenericValue), newCapacity * sizeof(GenericValue)))); + data_.a.capacity = newCapacity; + } + return *this; + } + + //! Append a GenericValue at the end of the array. + /*! \param value Value to be appended. + \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator(). + \pre IsArray() == true + \post value.IsNull() == true + \return The value itself for fluent API. + \note The ownership of \c value will be transferred to this array on success. + \note If the number of elements to be appended is known, calls Reserve() once first may be more efficient. + \note Amortized constant time complexity. + */ + GenericValue& PushBack(GenericValue& value, Allocator& allocator) { + RAPIDJSON_ASSERT(IsArray()); + if (data_.a.size >= data_.a.capacity) + Reserve(data_.a.capacity == 0 ? kDefaultArrayCapacity : (data_.a.capacity + (data_.a.capacity + 1) / 2), allocator); + GetElementsPointer()[data_.a.size++].RawAssign(value); + return *this; + } + +#if RAPIDJSON_HAS_CXX11_RVALUE_REFS + GenericValue& PushBack(GenericValue&& value, Allocator& allocator) { + return PushBack(value, allocator); + } +#endif // RAPIDJSON_HAS_CXX11_RVALUE_REFS + + //! Append a constant string reference at the end of the array. + /*! \param value Constant string reference to be appended. + \param allocator Allocator for reallocating memory. It must be the same one used previously. Commonly use GenericDocument::GetAllocator(). + \pre IsArray() == true + \return The value itself for fluent API. + \note If the number of elements to be appended is known, calls Reserve() once first may be more efficient. + \note Amortized constant time complexity. + \see GenericStringRef + */ + GenericValue& PushBack(StringRefType value, Allocator& allocator) { + return (*this).template PushBack(value, allocator); + } + + //! Append a primitive value at the end of the array. + /*! \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t + \param value Value of primitive type T to be appended. + \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator(). + \pre IsArray() == true + \return The value itself for fluent API. + \note If the number of elements to be appended is known, calls Reserve() once first may be more efficient. + + \note The source type \c T explicitly disallows all pointer types, + especially (\c const) \ref Ch*. This helps avoiding implicitly + referencing character strings with insufficient lifetime, use + \ref PushBack(GenericValue&, Allocator&) or \ref + PushBack(StringRefType, Allocator&). + All other pointer types would implicitly convert to \c bool, + use an explicit cast instead, if needed. + \note Amortized constant time complexity. + */ + template + RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (GenericValue&)) + PushBack(T value, Allocator& allocator) { + GenericValue v(value); + return PushBack(v, allocator); + } + + //! Remove the last element in the array. + /*! + \note Constant time complexity. + */ + GenericValue& PopBack() { + RAPIDJSON_ASSERT(IsArray()); + RAPIDJSON_ASSERT(!Empty()); + GetElementsPointer()[--data_.a.size].~GenericValue(); + return *this; + } + + //! Remove an element of array by iterator. + /*! + \param pos iterator to the element to remove + \pre IsArray() == true && \ref Begin() <= \c pos < \ref End() + \return Iterator following the removed element. If the iterator pos refers to the last element, the End() iterator is returned. + \note Linear time complexity. + */ + ValueIterator Erase(ConstValueIterator pos) { + return Erase(pos, pos + 1); + } + + //! Remove elements in the range [first, last) of the array. + /*! + \param first iterator to the first element to remove + \param last iterator following the last element to remove + \pre IsArray() == true && \ref Begin() <= \c first <= \c last <= \ref End() + \return Iterator following the last removed element. + \note Linear time complexity. + */ + ValueIterator Erase(ConstValueIterator first, ConstValueIterator last) { + RAPIDJSON_ASSERT(IsArray()); + RAPIDJSON_ASSERT(data_.a.size > 0); + RAPIDJSON_ASSERT(GetElementsPointer() != 0); + RAPIDJSON_ASSERT(first >= Begin()); + RAPIDJSON_ASSERT(first <= last); + RAPIDJSON_ASSERT(last <= End()); + ValueIterator pos = Begin() + (first - Begin()); + for (ValueIterator itr = pos; itr != last; ++itr) + itr->~GenericValue(); + std::memmove(pos, last, static_cast(End() - last) * sizeof(GenericValue)); + data_.a.size -= static_cast(last - first); + return pos; + } + + Array GetArray() { RAPIDJSON_ASSERT(IsArray()); return Array(*this); } + ConstArray GetArray() const { RAPIDJSON_ASSERT(IsArray()); return ConstArray(*this); } + + //@} + + //!@name Number + //@{ + + int GetInt() const { RAPIDJSON_ASSERT(data_.f.flags & kIntFlag); return data_.n.i.i; } + unsigned GetUint() const { RAPIDJSON_ASSERT(data_.f.flags & kUintFlag); return data_.n.u.u; } + int64_t GetInt64() const { RAPIDJSON_ASSERT(data_.f.flags & kInt64Flag); return data_.n.i64; } + uint64_t GetUint64() const { RAPIDJSON_ASSERT(data_.f.flags & kUint64Flag); return data_.n.u64; } + + //! Get the value as double type. + /*! \note If the value is 64-bit integer type, it may lose precision. Use \c IsLosslessDouble() to check whether the converison is lossless. + */ + double GetDouble() const { + RAPIDJSON_ASSERT(IsNumber()); + if ((data_.f.flags & kDoubleFlag) != 0) return data_.n.d; // exact type, no conversion. + if ((data_.f.flags & kIntFlag) != 0) return data_.n.i.i; // int -> double + if ((data_.f.flags & kUintFlag) != 0) return data_.n.u.u; // unsigned -> double + if ((data_.f.flags & kInt64Flag) != 0) return static_cast(data_.n.i64); // int64_t -> double (may lose precision) + RAPIDJSON_ASSERT((data_.f.flags & kUint64Flag) != 0); return static_cast(data_.n.u64); // uint64_t -> double (may lose precision) + } + + //! Get the value as float type. + /*! \note If the value is 64-bit integer type, it may lose precision. Use \c IsLosslessFloat() to check whether the converison is lossless. + */ + float GetFloat() const { + return static_cast(GetDouble()); + } + + GenericValue& SetInt(int i) { this->~GenericValue(); new (this) GenericValue(i); return *this; } + GenericValue& SetUint(unsigned u) { this->~GenericValue(); new (this) GenericValue(u); return *this; } + GenericValue& SetInt64(int64_t i64) { this->~GenericValue(); new (this) GenericValue(i64); return *this; } + GenericValue& SetUint64(uint64_t u64) { this->~GenericValue(); new (this) GenericValue(u64); return *this; } + GenericValue& SetDouble(double d) { this->~GenericValue(); new (this) GenericValue(d); return *this; } + GenericValue& SetFloat(float f) { this->~GenericValue(); new (this) GenericValue(static_cast(f)); return *this; } + + //@} + + //!@name String + //@{ + + const Ch* GetString() const { RAPIDJSON_ASSERT(IsString()); return (data_.f.flags & kInlineStrFlag) ? data_.ss.str : GetStringPointer(); } + + //! Get the length of string. + /*! Since rapidjson permits "\\u0000" in the json string, strlen(v.GetString()) may not equal to v.GetStringLength(). + */ + SizeType GetStringLength() const { RAPIDJSON_ASSERT(IsString()); return ((data_.f.flags & kInlineStrFlag) ? (data_.ss.GetLength()) : data_.s.length); } + + //! Set this value as a string without copying source string. + /*! This version has better performance with supplied length, and also support string containing null character. + \param s source string pointer. + \param length The length of source string, excluding the trailing null terminator. + \return The value itself for fluent API. + \post IsString() == true && GetString() == s && GetStringLength() == length + \see SetString(StringRefType) + */ + GenericValue& SetString(const Ch* s, SizeType length) { return SetString(StringRef(s, length)); } + + //! Set this value as a string without copying source string. + /*! \param s source string reference + \return The value itself for fluent API. + \post IsString() == true && GetString() == s && GetStringLength() == s.length + */ + GenericValue& SetString(StringRefType s) { this->~GenericValue(); SetStringRaw(s); return *this; } + + //! Set this value as a string by copying from source string. + /*! This version has better performance with supplied length, and also support string containing null character. + \param s source string. + \param length The length of source string, excluding the trailing null terminator. + \param allocator Allocator for allocating copied buffer. Commonly use GenericDocument::GetAllocator(). + \return The value itself for fluent API. + \post IsString() == true && GetString() != s && strcmp(GetString(),s) == 0 && GetStringLength() == length + */ + GenericValue& SetString(const Ch* s, SizeType length, Allocator& allocator) { this->~GenericValue(); SetStringRaw(StringRef(s, length), allocator); return *this; } + + //! Set this value as a string by copying from source string. + /*! \param s source string. + \param allocator Allocator for allocating copied buffer. Commonly use GenericDocument::GetAllocator(). + \return The value itself for fluent API. + \post IsString() == true && GetString() != s && strcmp(GetString(),s) == 0 && GetStringLength() == length + */ + GenericValue& SetString(const Ch* s, Allocator& allocator) { return SetString(s, internal::StrLen(s), allocator); } + +#if RAPIDJSON_HAS_STDSTRING + //! Set this value as a string by copying from source string. + /*! \param s source string. + \param allocator Allocator for allocating copied buffer. Commonly use GenericDocument::GetAllocator(). + \return The value itself for fluent API. + \post IsString() == true && GetString() != s.data() && strcmp(GetString(),s.data() == 0 && GetStringLength() == s.size() + \note Requires the definition of the preprocessor symbol \ref RAPIDJSON_HAS_STDSTRING. + */ + GenericValue& SetString(const std::basic_string& s, Allocator& allocator) { return SetString(s.data(), SizeType(s.size()), allocator); } +#endif + + //@} + + //!@name Array + //@{ + + //! Templated version for checking whether this value is type T. + /*! + \tparam T Either \c bool, \c int, \c unsigned, \c int64_t, \c uint64_t, \c double, \c float, \c const \c char*, \c std::basic_string + */ + template + bool Is() const { return internal::TypeHelper::Is(*this); } + + template + T Get() const { return internal::TypeHelper::Get(*this); } + + template + T Get() { return internal::TypeHelper::Get(*this); } + + template + ValueType& Set(const T& data) { return internal::TypeHelper::Set(*this, data); } + + template + ValueType& Set(const T& data, AllocatorType& allocator) { return internal::TypeHelper::Set(*this, data, allocator); } + + //@} + + //! Generate events of this value to a Handler. + /*! This function adopts the GoF visitor pattern. + Typical usage is to output this JSON value as JSON text via Writer, which is a Handler. + It can also be used to deep clone this value via GenericDocument, which is also a Handler. + \tparam Handler type of handler. + \param handler An object implementing concept Handler. + */ + template + bool Accept(Handler& handler) const { + switch(GetType()) { + case kNullType: return handler.Null(); + case kFalseType: return handler.Bool(false); + case kTrueType: return handler.Bool(true); + + case kObjectType: + if (RAPIDJSON_UNLIKELY(!handler.StartObject())) + return false; + for (ConstMemberIterator m = MemberBegin(); m != MemberEnd(); ++m) { + RAPIDJSON_ASSERT(m->name.IsString()); // User may change the type of name by MemberIterator. + if (RAPIDJSON_UNLIKELY(!handler.Key(m->name.GetString(), m->name.GetStringLength(), (m->name.data_.f.flags & kCopyFlag) != 0))) + return false; + if (RAPIDJSON_UNLIKELY(!m->value.Accept(handler))) + return false; + } + return handler.EndObject(data_.o.size); + + case kArrayType: + if (RAPIDJSON_UNLIKELY(!handler.StartArray())) + return false; + for (const GenericValue* v = Begin(); v != End(); ++v) + if (RAPIDJSON_UNLIKELY(!v->Accept(handler))) + return false; + return handler.EndArray(data_.a.size); + + case kStringType: + return handler.String(GetString(), GetStringLength(), (data_.f.flags & kCopyFlag) != 0); + + default: + RAPIDJSON_ASSERT(GetType() == kNumberType); + if (IsDouble()) return handler.Double(data_.n.d); + else if (IsInt()) return handler.Int(data_.n.i.i); + else if (IsUint()) return handler.Uint(data_.n.u.u); + else if (IsInt64()) return handler.Int64(data_.n.i64); + else return handler.Uint64(data_.n.u64); + } + } + +private: + template friend class GenericValue; + template friend class GenericDocument; + + enum { + kBoolFlag = 0x0008, + kNumberFlag = 0x0010, + kIntFlag = 0x0020, + kUintFlag = 0x0040, + kInt64Flag = 0x0080, + kUint64Flag = 0x0100, + kDoubleFlag = 0x0200, + kStringFlag = 0x0400, + kCopyFlag = 0x0800, + kInlineStrFlag = 0x1000, + + // Initial flags of different types. + kNullFlag = kNullType, + kTrueFlag = kTrueType | kBoolFlag, + kFalseFlag = kFalseType | kBoolFlag, + kNumberIntFlag = kNumberType | kNumberFlag | kIntFlag | kInt64Flag, + kNumberUintFlag = kNumberType | kNumberFlag | kUintFlag | kUint64Flag | kInt64Flag, + kNumberInt64Flag = kNumberType | kNumberFlag | kInt64Flag, + kNumberUint64Flag = kNumberType | kNumberFlag | kUint64Flag, + kNumberDoubleFlag = kNumberType | kNumberFlag | kDoubleFlag, + kNumberAnyFlag = kNumberType | kNumberFlag | kIntFlag | kInt64Flag | kUintFlag | kUint64Flag | kDoubleFlag, + kConstStringFlag = kStringType | kStringFlag, + kCopyStringFlag = kStringType | kStringFlag | kCopyFlag, + kShortStringFlag = kStringType | kStringFlag | kCopyFlag | kInlineStrFlag, + kObjectFlag = kObjectType, + kArrayFlag = kArrayType, + + kTypeMask = 0x07 + }; + + static const SizeType kDefaultArrayCapacity = 16; + static const SizeType kDefaultObjectCapacity = 16; + + struct Flag { +#if RAPIDJSON_48BITPOINTER_OPTIMIZATION + char payload[sizeof(SizeType) * 2 + 6]; // 2 x SizeType + lower 48-bit pointer +#elif RAPIDJSON_64BIT + char payload[sizeof(SizeType) * 2 + sizeof(void*) + 6]; // 6 padding bytes +#else + char payload[sizeof(SizeType) * 2 + sizeof(void*) + 2]; // 2 padding bytes +#endif + uint16_t flags; + }; + + struct String { + SizeType length; + SizeType hashcode; //!< reserved + const Ch* str; + }; // 12 bytes in 32-bit mode, 16 bytes in 64-bit mode + + // implementation detail: ShortString can represent zero-terminated strings up to MaxSize chars + // (excluding the terminating zero) and store a value to determine the length of the contained + // string in the last character str[LenPos] by storing "MaxSize - length" there. If the string + // to store has the maximal length of MaxSize then str[LenPos] will be 0 and therefore act as + // the string terminator as well. For getting the string length back from that value just use + // "MaxSize - str[LenPos]". + // This allows to store 13-chars strings in 32-bit mode, 21-chars strings in 64-bit mode, + // 13-chars strings for RAPIDJSON_48BITPOINTER_OPTIMIZATION=1 inline (for `UTF8`-encoded strings). + struct ShortString { + enum { MaxChars = sizeof(static_cast(0)->payload) / sizeof(Ch), MaxSize = MaxChars - 1, LenPos = MaxSize }; + Ch str[MaxChars]; + + inline static bool Usable(SizeType len) { return (MaxSize >= len); } + inline void SetLength(SizeType len) { str[LenPos] = static_cast(MaxSize - len); } + inline SizeType GetLength() const { return static_cast(MaxSize - str[LenPos]); } + }; // at most as many bytes as "String" above => 12 bytes in 32-bit mode, 16 bytes in 64-bit mode + + // By using proper binary layout, retrieval of different integer types do not need conversions. + union Number { +#if RAPIDJSON_ENDIAN == RAPIDJSON_LITTLEENDIAN + struct I { + int i; + char padding[4]; + }i; + struct U { + unsigned u; + char padding2[4]; + }u; +#else + struct I { + char padding[4]; + int i; + }i; + struct U { + char padding2[4]; + unsigned u; + }u; +#endif + int64_t i64; + uint64_t u64; + double d; + }; // 8 bytes + + struct ObjectData { + SizeType size; + SizeType capacity; + Member* members; + }; // 12 bytes in 32-bit mode, 16 bytes in 64-bit mode + + struct ArrayData { + SizeType size; + SizeType capacity; + GenericValue* elements; + }; // 12 bytes in 32-bit mode, 16 bytes in 64-bit mode + + union Data { + String s; + ShortString ss; + Number n; + ObjectData o; + ArrayData a; + Flag f; + }; // 16 bytes in 32-bit mode, 24 bytes in 64-bit mode, 16 bytes in 64-bit with RAPIDJSON_48BITPOINTER_OPTIMIZATION + + RAPIDJSON_FORCEINLINE const Ch* GetStringPointer() const { return RAPIDJSON_GETPOINTER(Ch, data_.s.str); } + RAPIDJSON_FORCEINLINE const Ch* SetStringPointer(const Ch* str) { return RAPIDJSON_SETPOINTER(Ch, data_.s.str, str); } + RAPIDJSON_FORCEINLINE GenericValue* GetElementsPointer() const { return RAPIDJSON_GETPOINTER(GenericValue, data_.a.elements); } + RAPIDJSON_FORCEINLINE GenericValue* SetElementsPointer(GenericValue* elements) { return RAPIDJSON_SETPOINTER(GenericValue, data_.a.elements, elements); } + RAPIDJSON_FORCEINLINE Member* GetMembersPointer() const { return RAPIDJSON_GETPOINTER(Member, data_.o.members); } + RAPIDJSON_FORCEINLINE Member* SetMembersPointer(Member* members) { return RAPIDJSON_SETPOINTER(Member, data_.o.members, members); } + + // Initialize this value as array with initial data, without calling destructor. + void SetArrayRaw(GenericValue* values, SizeType count, Allocator& allocator) { + data_.f.flags = kArrayFlag; + if (count) { + GenericValue* e = static_cast(allocator.Malloc(count * sizeof(GenericValue))); + SetElementsPointer(e); + std::memcpy(e, values, count * sizeof(GenericValue)); + } + else + SetElementsPointer(0); + data_.a.size = data_.a.capacity = count; + } + + //! Initialize this value as object with initial data, without calling destructor. + void SetObjectRaw(Member* members, SizeType count, Allocator& allocator) { + data_.f.flags = kObjectFlag; + if (count) { + Member* m = static_cast(allocator.Malloc(count * sizeof(Member))); + SetMembersPointer(m); + std::memcpy(m, members, count * sizeof(Member)); + } + else + SetMembersPointer(0); + data_.o.size = data_.o.capacity = count; + } + + //! Initialize this value as constant string, without calling destructor. + void SetStringRaw(StringRefType s) RAPIDJSON_NOEXCEPT { + data_.f.flags = kConstStringFlag; + SetStringPointer(s); + data_.s.length = s.length; + } + + //! Initialize this value as copy string with initial data, without calling destructor. + void SetStringRaw(StringRefType s, Allocator& allocator) { + Ch* str = 0; + if (ShortString::Usable(s.length)) { + data_.f.flags = kShortStringFlag; + data_.ss.SetLength(s.length); + str = data_.ss.str; + } else { + data_.f.flags = kCopyStringFlag; + data_.s.length = s.length; + str = static_cast(allocator.Malloc((s.length + 1) * sizeof(Ch))); + SetStringPointer(str); + } + std::memcpy(str, s, s.length * sizeof(Ch)); + str[s.length] = '\0'; + } + + //! Assignment without calling destructor + void RawAssign(GenericValue& rhs) RAPIDJSON_NOEXCEPT { + data_ = rhs.data_; + // data_.f.flags = rhs.data_.f.flags; + rhs.data_.f.flags = kNullFlag; + } + + template + bool StringEqual(const GenericValue& rhs) const { + RAPIDJSON_ASSERT(IsString()); + RAPIDJSON_ASSERT(rhs.IsString()); + + const SizeType len1 = GetStringLength(); + const SizeType len2 = rhs.GetStringLength(); + if(len1 != len2) { return false; } + + const Ch* const str1 = GetString(); + const Ch* const str2 = rhs.GetString(); + if(str1 == str2) { return true; } // fast path for constant string + + return (std::memcmp(str1, str2, sizeof(Ch) * len1) == 0); + } + + Data data_; +}; + +//! GenericValue with UTF8 encoding +typedef GenericValue > Value; + +/////////////////////////////////////////////////////////////////////////////// +// GenericDocument + +//! A document for parsing JSON text as DOM. +/*! + \note implements Handler concept + \tparam Encoding Encoding for both parsing and string storage. + \tparam Allocator Allocator for allocating memory for the DOM + \tparam StackAllocator Allocator for allocating memory for stack during parsing. + \warning Although GenericDocument inherits from GenericValue, the API does \b not provide any virtual functions, especially no virtual destructor. To avoid memory leaks, do not \c delete a GenericDocument object via a pointer to a GenericValue. +*/ +template , typename StackAllocator = CrtAllocator> +class GenericDocument : public GenericValue { +public: + typedef typename Encoding::Ch Ch; //!< Character type derived from Encoding. + typedef GenericValue ValueType; //!< Value type of the document. + typedef Allocator AllocatorType; //!< Allocator type from template parameter. + + //! Constructor + /*! Creates an empty document of specified type. + \param type Mandatory type of object to create. + \param allocator Optional allocator for allocating memory. + \param stackCapacity Optional initial capacity of stack in bytes. + \param stackAllocator Optional allocator for allocating memory for stack. + */ + explicit GenericDocument(Type type, Allocator* allocator = 0, size_t stackCapacity = kDefaultStackCapacity, StackAllocator* stackAllocator = 0) : + GenericValue(type), allocator_(allocator), ownAllocator_(0), stack_(stackAllocator, stackCapacity), parseResult_() + { + if (!allocator_) + ownAllocator_ = allocator_ = RAPIDJSON_NEW(Allocator)(); + } + + //! Constructor + /*! Creates an empty document which type is Null. + \param allocator Optional allocator for allocating memory. + \param stackCapacity Optional initial capacity of stack in bytes. + \param stackAllocator Optional allocator for allocating memory for stack. + */ + GenericDocument(Allocator* allocator = 0, size_t stackCapacity = kDefaultStackCapacity, StackAllocator* stackAllocator = 0) : + allocator_(allocator), ownAllocator_(0), stack_(stackAllocator, stackCapacity), parseResult_() + { + if (!allocator_) + ownAllocator_ = allocator_ = RAPIDJSON_NEW(Allocator)(); + } + +#if RAPIDJSON_HAS_CXX11_RVALUE_REFS + //! Move constructor in C++11 + GenericDocument(GenericDocument&& rhs) RAPIDJSON_NOEXCEPT + : ValueType(std::forward(rhs)), // explicit cast to avoid prohibited move from Document + allocator_(rhs.allocator_), + ownAllocator_(rhs.ownAllocator_), + stack_(std::move(rhs.stack_)), + parseResult_(rhs.parseResult_) + { + rhs.allocator_ = 0; + rhs.ownAllocator_ = 0; + rhs.parseResult_ = ParseResult(); + } +#endif + + ~GenericDocument() { + Destroy(); + } + +#if RAPIDJSON_HAS_CXX11_RVALUE_REFS + //! Move assignment in C++11 + GenericDocument& operator=(GenericDocument&& rhs) RAPIDJSON_NOEXCEPT + { + // The cast to ValueType is necessary here, because otherwise it would + // attempt to call GenericValue's templated assignment operator. + ValueType::operator=(std::forward(rhs)); + + // Calling the destructor here would prematurely call stack_'s destructor + Destroy(); + + allocator_ = rhs.allocator_; + ownAllocator_ = rhs.ownAllocator_; + stack_ = std::move(rhs.stack_); + parseResult_ = rhs.parseResult_; + + rhs.allocator_ = 0; + rhs.ownAllocator_ = 0; + rhs.parseResult_ = ParseResult(); + + return *this; + } +#endif + + //! Exchange the contents of this document with those of another. + /*! + \param rhs Another document. + \note Constant complexity. + \see GenericValue::Swap + */ + GenericDocument& Swap(GenericDocument& rhs) RAPIDJSON_NOEXCEPT { + ValueType::Swap(rhs); + stack_.Swap(rhs.stack_); + internal::Swap(allocator_, rhs.allocator_); + internal::Swap(ownAllocator_, rhs.ownAllocator_); + internal::Swap(parseResult_, rhs.parseResult_); + return *this; + } + + //! free-standing swap function helper + /*! + Helper function to enable support for common swap implementation pattern based on \c std::swap: + \code + void swap(MyClass& a, MyClass& b) { + using std::swap; + swap(a.doc, b.doc); + // ... + } + \endcode + \see Swap() + */ + friend inline void swap(GenericDocument& a, GenericDocument& b) RAPIDJSON_NOEXCEPT { a.Swap(b); } + + //! Populate this document by a generator which produces SAX events. + /*! \tparam Generator A functor with bool f(Handler) prototype. + \param g Generator functor which sends SAX events to the parameter. + \return The document itself for fluent API. + */ + template + GenericDocument& Populate(Generator& g) { + ClearStackOnExit scope(*this); + if (g(*this)) { + RAPIDJSON_ASSERT(stack_.GetSize() == sizeof(ValueType)); // Got one and only one root object + ValueType::operator=(*stack_.template Pop(1));// Move value from stack to document + } + return *this; + } + + //!@name Parse from stream + //!@{ + + //! Parse JSON text from an input stream (with Encoding conversion) + /*! \tparam parseFlags Combination of \ref ParseFlag. + \tparam SourceEncoding Encoding of input stream + \tparam InputStream Type of input stream, implementing Stream concept + \param is Input stream to be parsed. + \return The document itself for fluent API. + */ + template + GenericDocument& ParseStream(InputStream& is) { + GenericReader reader( + stack_.HasAllocator() ? &stack_.GetAllocator() : 0); + ClearStackOnExit scope(*this); + parseResult_ = reader.template Parse(is, *this); + if (parseResult_) { + RAPIDJSON_ASSERT(stack_.GetSize() == sizeof(ValueType)); // Got one and only one root object + ValueType::operator=(*stack_.template Pop(1));// Move value from stack to document + } + return *this; + } + + //! Parse JSON text from an input stream + /*! \tparam parseFlags Combination of \ref ParseFlag. + \tparam InputStream Type of input stream, implementing Stream concept + \param is Input stream to be parsed. + \return The document itself for fluent API. + */ + template + GenericDocument& ParseStream(InputStream& is) { + return ParseStream(is); + } + + //! Parse JSON text from an input stream (with \ref kParseDefaultFlags) + /*! \tparam InputStream Type of input stream, implementing Stream concept + \param is Input stream to be parsed. + \return The document itself for fluent API. + */ + template + GenericDocument& ParseStream(InputStream& is) { + return ParseStream(is); + } + //!@} + + //!@name Parse in-place from mutable string + //!@{ + + //! Parse JSON text from a mutable string + /*! \tparam parseFlags Combination of \ref ParseFlag. + \param str Mutable zero-terminated string to be parsed. + \return The document itself for fluent API. + */ + template + GenericDocument& ParseInsitu(Ch* str) { + GenericInsituStringStream s(str); + return ParseStream(s); + } + + //! Parse JSON text from a mutable string (with \ref kParseDefaultFlags) + /*! \param str Mutable zero-terminated string to be parsed. + \return The document itself for fluent API. + */ + GenericDocument& ParseInsitu(Ch* str) { + return ParseInsitu(str); + } + //!@} + + //!@name Parse from read-only string + //!@{ + + //! Parse JSON text from a read-only string (with Encoding conversion) + /*! \tparam parseFlags Combination of \ref ParseFlag (must not contain \ref kParseInsituFlag). + \tparam SourceEncoding Transcoding from input Encoding + \param str Read-only zero-terminated string to be parsed. + */ + template + GenericDocument& Parse(const typename SourceEncoding::Ch* str) { + RAPIDJSON_ASSERT(!(parseFlags & kParseInsituFlag)); + GenericStringStream s(str); + return ParseStream(s); + } + + //! Parse JSON text from a read-only string + /*! \tparam parseFlags Combination of \ref ParseFlag (must not contain \ref kParseInsituFlag). + \param str Read-only zero-terminated string to be parsed. + */ + template + GenericDocument& Parse(const Ch* str) { + return Parse(str); + } + + //! Parse JSON text from a read-only string (with \ref kParseDefaultFlags) + /*! \param str Read-only zero-terminated string to be parsed. + */ + GenericDocument& Parse(const Ch* str) { + return Parse(str); + } + + template + GenericDocument& Parse(const typename SourceEncoding::Ch* str, size_t length) { + RAPIDJSON_ASSERT(!(parseFlags & kParseInsituFlag)); + MemoryStream ms(reinterpret_cast(str), length * sizeof(typename SourceEncoding::Ch)); + EncodedInputStream is(ms); + ParseStream(is); + return *this; + } + + template + GenericDocument& Parse(const Ch* str, size_t length) { + return Parse(str, length); + } + + GenericDocument& Parse(const Ch* str, size_t length) { + return Parse(str, length); + } + +#if RAPIDJSON_HAS_STDSTRING + template + GenericDocument& Parse(const std::basic_string& str) { + // c_str() is constant complexity according to standard. Should be faster than Parse(const char*, size_t) + return Parse(str.c_str()); + } + + template + GenericDocument& Parse(const std::basic_string& str) { + return Parse(str.c_str()); + } + + GenericDocument& Parse(const std::basic_string& str) { + return Parse(str); + } +#endif // RAPIDJSON_HAS_STDSTRING + + //!@} + + //!@name Handling parse errors + //!@{ + + //! Whether a parse error has occured in the last parsing. + bool HasParseError() const { return parseResult_.IsError(); } + + //! Get the \ref ParseErrorCode of last parsing. + ParseErrorCode GetParseError() const { return parseResult_.Code(); } + + //! Get the position of last parsing error in input, 0 otherwise. + size_t GetErrorOffset() const { return parseResult_.Offset(); } + + //! Implicit conversion to get the last parse result +#ifndef __clang // -Wdocumentation + /*! \return \ref ParseResult of the last parse operation + + \code + Document doc; + ParseResult ok = doc.Parse(json); + if (!ok) + printf( "JSON parse error: %s (%u)\n", GetParseError_En(ok.Code()), ok.Offset()); + \endcode + */ +#endif + operator ParseResult() const { return parseResult_; } + //!@} + + //! Get the allocator of this document. + Allocator& GetAllocator() { + RAPIDJSON_ASSERT(allocator_); + return *allocator_; + } + + //! Get the capacity of stack in bytes. + size_t GetStackCapacity() const { return stack_.GetCapacity(); } + +private: + // clear stack on any exit from ParseStream, e.g. due to exception + struct ClearStackOnExit { + explicit ClearStackOnExit(GenericDocument& d) : d_(d) {} + ~ClearStackOnExit() { d_.ClearStack(); } + private: + ClearStackOnExit(const ClearStackOnExit&); + ClearStackOnExit& operator=(const ClearStackOnExit&); + GenericDocument& d_; + }; + + // callers of the following private Handler functions + // template friend class GenericReader; // for parsing + template friend class GenericValue; // for deep copying + +public: + // Implementation of Handler + bool Null() { new (stack_.template Push()) ValueType(); return true; } + bool Bool(bool b) { new (stack_.template Push()) ValueType(b); return true; } + bool Int(int i) { new (stack_.template Push()) ValueType(i); return true; } + bool Uint(unsigned i) { new (stack_.template Push()) ValueType(i); return true; } + bool Int64(int64_t i) { new (stack_.template Push()) ValueType(i); return true; } + bool Uint64(uint64_t i) { new (stack_.template Push()) ValueType(i); return true; } + bool Double(double d) { new (stack_.template Push()) ValueType(d); return true; } + + bool RawNumber(const Ch* str, SizeType length, bool copy) { + if (copy) + new (stack_.template Push()) ValueType(str, length, GetAllocator()); + else + new (stack_.template Push()) ValueType(str, length); + return true; + } + + bool String(const Ch* str, SizeType length, bool copy) { + if (copy) + new (stack_.template Push()) ValueType(str, length, GetAllocator()); + else + new (stack_.template Push()) ValueType(str, length); + return true; + } + + bool StartObject() { new (stack_.template Push()) ValueType(kObjectType); return true; } + + bool Key(const Ch* str, SizeType length, bool copy) { return String(str, length, copy); } + + bool EndObject(SizeType memberCount) { + typename ValueType::Member* members = stack_.template Pop(memberCount); + stack_.template Top()->SetObjectRaw(members, memberCount, GetAllocator()); + return true; + } + + bool StartArray() { new (stack_.template Push()) ValueType(kArrayType); return true; } + + bool EndArray(SizeType elementCount) { + ValueType* elements = stack_.template Pop(elementCount); + stack_.template Top()->SetArrayRaw(elements, elementCount, GetAllocator()); + return true; + } + +private: + //! Prohibit copying + GenericDocument(const GenericDocument&); + //! Prohibit assignment + GenericDocument& operator=(const GenericDocument&); + + void ClearStack() { + if (Allocator::kNeedFree) + while (stack_.GetSize() > 0) // Here assumes all elements in stack array are GenericValue (Member is actually 2 GenericValue objects) + (stack_.template Pop(1))->~ValueType(); + else + stack_.Clear(); + stack_.ShrinkToFit(); + } + + void Destroy() { + RAPIDJSON_DELETE(ownAllocator_); + } + + static const size_t kDefaultStackCapacity = 1024; + Allocator* allocator_; + Allocator* ownAllocator_; + internal::Stack stack_; + ParseResult parseResult_; +}; + +//! GenericDocument with UTF8 encoding +typedef GenericDocument > Document; + +//! Helper class for accessing Value of array type. +/*! + Instance of this helper class is obtained by \c GenericValue::GetArray(). + In addition to all APIs for array type, it provides range-based for loop if \c RAPIDJSON_HAS_CXX11_RANGE_FOR=1. +*/ +template +class GenericArray { +public: + typedef GenericArray ConstArray; + typedef GenericArray Array; + typedef ValueT PlainType; + typedef typename internal::MaybeAddConst::Type ValueType; + typedef ValueType* ValueIterator; // This may be const or non-const iterator + typedef const ValueT* ConstValueIterator; + typedef typename ValueType::AllocatorType AllocatorType; + typedef typename ValueType::StringRefType StringRefType; + + template + friend class GenericValue; + + GenericArray(const GenericArray& rhs) : value_(rhs.value_) {} + GenericArray& operator=(const GenericArray& rhs) { value_ = rhs.value_; return *this; } + ~GenericArray() {} + + SizeType Size() const { return value_.Size(); } + SizeType Capacity() const { return value_.Capacity(); } + bool Empty() const { return value_.Empty(); } + void Clear() const { value_.Clear(); } + ValueType& operator[](SizeType index) const { return value_[index]; } + ValueIterator Begin() const { return value_.Begin(); } + ValueIterator End() const { return value_.End(); } + GenericArray Reserve(SizeType newCapacity, AllocatorType &allocator) const { value_.Reserve(newCapacity, allocator); return *this; } + GenericArray PushBack(ValueType& value, AllocatorType& allocator) const { value_.PushBack(value, allocator); return *this; } +#if RAPIDJSON_HAS_CXX11_RVALUE_REFS + GenericArray PushBack(ValueType&& value, AllocatorType& allocator) const { value_.PushBack(value, allocator); return *this; } +#endif // RAPIDJSON_HAS_CXX11_RVALUE_REFS + GenericArray PushBack(StringRefType value, AllocatorType& allocator) const { value_.PushBack(value, allocator); return *this; } + template RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (const GenericArray&)) PushBack(T value, AllocatorType& allocator) const { value_.PushBack(value, allocator); return *this; } + GenericArray PopBack() const { value_.PopBack(); return *this; } + ValueIterator Erase(ConstValueIterator pos) const { return value_.Erase(pos); } + ValueIterator Erase(ConstValueIterator first, ConstValueIterator last) const { return value_.Erase(first, last); } + +#if RAPIDJSON_HAS_CXX11_RANGE_FOR + ValueIterator begin() const { return value_.Begin(); } + ValueIterator end() const { return value_.End(); } +#endif + +private: + GenericArray(); + GenericArray(ValueType& value) : value_(value) {} + ValueType& value_; +}; + +//! Helper class for accessing Value of object type. +/*! + Instance of this helper class is obtained by \c GenericValue::GetObject(). + In addition to all APIs for array type, it provides range-based for loop if \c RAPIDJSON_HAS_CXX11_RANGE_FOR=1. +*/ +template +class GenericObject { +public: + typedef GenericObject ConstObject; + typedef GenericObject Object; + typedef ValueT PlainType; + typedef typename internal::MaybeAddConst::Type ValueType; + typedef GenericMemberIterator MemberIterator; // This may be const or non-const iterator + typedef GenericMemberIterator ConstMemberIterator; + typedef typename ValueType::AllocatorType AllocatorType; + typedef typename ValueType::StringRefType StringRefType; + typedef typename ValueType::EncodingType EncodingType; + typedef typename ValueType::Ch Ch; + + template + friend class GenericValue; + + GenericObject(const GenericObject& rhs) : value_(rhs.value_) {} + GenericObject& operator=(const GenericObject& rhs) { value_ = rhs.value_; return *this; } + ~GenericObject() {} + + SizeType MemberCount() const { return value_.MemberCount(); } + bool ObjectEmpty() const { return value_.ObjectEmpty(); } + template ValueType& operator[](T* name) const { return value_[name]; } + template ValueType& operator[](const GenericValue& name) const { return value_[name]; } +#if RAPIDJSON_HAS_STDSTRING + ValueType& operator[](const std::basic_string& name) const { return value_[name]; } +#endif + MemberIterator MemberBegin() const { return value_.MemberBegin(); } + MemberIterator MemberEnd() const { return value_.MemberEnd(); } + bool HasMember(const Ch* name) const { return value_.HasMember(name); } +#if RAPIDJSON_HAS_STDSTRING + bool HasMember(const std::basic_string& name) const { return value_.HasMember(name); } +#endif + template bool HasMember(const GenericValue& name) const { return value_.HasMember(name); } + MemberIterator FindMember(const Ch* name) const { return value_.FindMember(name); } + template MemberIterator FindMember(const GenericValue& name) const { return value_.FindMember(name); } +#if RAPIDJSON_HAS_STDSTRING + MemberIterator FindMember(const std::basic_string& name) const { return value_.FindMember(name); } +#endif + GenericObject AddMember(ValueType& name, ValueType& value, AllocatorType& allocator) const { value_.AddMember(name, value, allocator); return *this; } + GenericObject AddMember(ValueType& name, StringRefType value, AllocatorType& allocator) const { value_.AddMember(name, value, allocator); return *this; } +#if RAPIDJSON_HAS_STDSTRING + GenericObject AddMember(ValueType& name, std::basic_string& value, AllocatorType& allocator) const { value_.AddMember(name, value, allocator); return *this; } +#endif + template RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (ValueType&)) AddMember(ValueType& name, T value, AllocatorType& allocator) const { value_.AddMember(name, value, allocator); return *this; } +#if RAPIDJSON_HAS_CXX11_RVALUE_REFS + GenericObject AddMember(ValueType&& name, ValueType&& value, AllocatorType& allocator) const { value_.AddMember(name, value, allocator); return *this; } + GenericObject AddMember(ValueType&& name, ValueType& value, AllocatorType& allocator) const { value_.AddMember(name, value, allocator); return *this; } + GenericObject AddMember(ValueType& name, ValueType&& value, AllocatorType& allocator) const { value_.AddMember(name, value, allocator); return *this; } + GenericObject AddMember(StringRefType name, ValueType&& value, AllocatorType& allocator) const { value_.AddMember(name, value, allocator); return *this; } +#endif // RAPIDJSON_HAS_CXX11_RVALUE_REFS + GenericObject AddMember(StringRefType name, ValueType& value, AllocatorType& allocator) const { value_.AddMember(name, value, allocator); return *this; } + GenericObject AddMember(StringRefType name, StringRefType value, AllocatorType& allocator) const { value_.AddMember(name, value, allocator); return *this; } + template RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (GenericObject)) AddMember(StringRefType name, T value, AllocatorType& allocator) const { value_.AddMember(name, value, allocator); return *this; } + void RemoveAllMembers() { value_.RemoveAllMembers(); } + bool RemoveMember(const Ch* name) const { return value_.RemoveMember(name); } +#if RAPIDJSON_HAS_STDSTRING + bool RemoveMember(const std::basic_string& name) const { return value_.RemoveMember(name); } +#endif + template bool RemoveMember(const GenericValue& name) const { return value_.RemoveMember(name); } + MemberIterator RemoveMember(MemberIterator m) const { return value_.RemoveMember(m); } + MemberIterator EraseMember(ConstMemberIterator pos) const { return value_.EraseMember(pos); } + MemberIterator EraseMember(ConstMemberIterator first, ConstMemberIterator last) const { return value_.EraseMember(first, last); } + bool EraseMember(const Ch* name) const { return value_.EraseMember(name); } +#if RAPIDJSON_HAS_STDSTRING + bool EraseMember(const std::basic_string& name) const { return EraseMember(ValueType(StringRef(name))); } +#endif + template bool EraseMember(const GenericValue& name) const { return value_.EraseMember(name); } + +#if RAPIDJSON_HAS_CXX11_RANGE_FOR + MemberIterator begin() const { return value_.MemberBegin(); } + MemberIterator end() const { return value_.MemberEnd(); } +#endif + +private: + GenericObject(); + GenericObject(ValueType& value) : value_(value) {} + ValueType& value_; +}; + +RAPIDJSON_NAMESPACE_END +#ifdef _MINWINDEF_ // see: http://stackoverflow.com/questions/22744262/cant-call-stdmax-because-minwindef-h-defines-max +#ifndef NOMINMAX +#pragma pop_macro("min") +#pragma pop_macro("max") +#endif +#endif +RAPIDJSON_DIAG_POP + +#endif // RAPIDJSON_DOCUMENT_H_ diff --git a/umd/external/include/rapidjson/encodedstream.h b/umd/external/include/rapidjson/encodedstream.h new file mode 100644 index 00000000..223601c0 --- /dev/null +++ b/umd/external/include/rapidjson/encodedstream.h @@ -0,0 +1,299 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef RAPIDJSON_ENCODEDSTREAM_H_ +#define RAPIDJSON_ENCODEDSTREAM_H_ + +#include "stream.h" +#include "memorystream.h" + +#ifdef __GNUC__ +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(effc++) +#endif + +#ifdef __clang__ +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(padded) +#endif + +RAPIDJSON_NAMESPACE_BEGIN + +//! Input byte stream wrapper with a statically bound encoding. +/*! + \tparam Encoding The interpretation of encoding of the stream. Either UTF8, UTF16LE, UTF16BE, UTF32LE, UTF32BE. + \tparam InputByteStream Type of input byte stream. For example, FileReadStream. +*/ +template +class EncodedInputStream { + RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); +public: + typedef typename Encoding::Ch Ch; + + EncodedInputStream(InputByteStream& is) : is_(is) { + current_ = Encoding::TakeBOM(is_); + } + + Ch Peek() const { return current_; } + Ch Take() { Ch c = current_; current_ = Encoding::Take(is_); return c; } + size_t Tell() const { return is_.Tell(); } + + // Not implemented + void Put(Ch) { RAPIDJSON_ASSERT(false); } + void Flush() { RAPIDJSON_ASSERT(false); } + Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; } + size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; } + +private: + EncodedInputStream(const EncodedInputStream&); + EncodedInputStream& operator=(const EncodedInputStream&); + + InputByteStream& is_; + Ch current_; +}; + +//! Specialized for UTF8 MemoryStream. +template <> +class EncodedInputStream, MemoryStream> { +public: + typedef UTF8<>::Ch Ch; + + EncodedInputStream(MemoryStream& is) : is_(is) { + if (static_cast(is_.Peek()) == 0xEFu) is_.Take(); + if (static_cast(is_.Peek()) == 0xBBu) is_.Take(); + if (static_cast(is_.Peek()) == 0xBFu) is_.Take(); + } + Ch Peek() const { return is_.Peek(); } + Ch Take() { return is_.Take(); } + size_t Tell() const { return is_.Tell(); } + + // Not implemented + void Put(Ch) {} + void Flush() {} + Ch* PutBegin() { return 0; } + size_t PutEnd(Ch*) { return 0; } + + MemoryStream& is_; + +private: + EncodedInputStream(const EncodedInputStream&); + EncodedInputStream& operator=(const EncodedInputStream&); +}; + +//! Output byte stream wrapper with statically bound encoding. +/*! + \tparam Encoding The interpretation of encoding of the stream. Either UTF8, UTF16LE, UTF16BE, UTF32LE, UTF32BE. + \tparam OutputByteStream Type of input byte stream. For example, FileWriteStream. +*/ +template +class EncodedOutputStream { + RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); +public: + typedef typename Encoding::Ch Ch; + + EncodedOutputStream(OutputByteStream& os, bool putBOM = true) : os_(os) { + if (putBOM) + Encoding::PutBOM(os_); + } + + void Put(Ch c) { Encoding::Put(os_, c); } + void Flush() { os_.Flush(); } + + // Not implemented + Ch Peek() const { RAPIDJSON_ASSERT(false); return 0;} + Ch Take() { RAPIDJSON_ASSERT(false); return 0;} + size_t Tell() const { RAPIDJSON_ASSERT(false); return 0; } + Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; } + size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; } + +private: + EncodedOutputStream(const EncodedOutputStream&); + EncodedOutputStream& operator=(const EncodedOutputStream&); + + OutputByteStream& os_; +}; + +#define RAPIDJSON_ENCODINGS_FUNC(x) UTF8::x, UTF16LE::x, UTF16BE::x, UTF32LE::x, UTF32BE::x + +//! Input stream wrapper with dynamically bound encoding and automatic encoding detection. +/*! + \tparam CharType Type of character for reading. + \tparam InputByteStream type of input byte stream to be wrapped. +*/ +template +class AutoUTFInputStream { + RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); +public: + typedef CharType Ch; + + //! Constructor. + /*! + \param is input stream to be wrapped. + \param type UTF encoding type if it is not detected from the stream. + */ + AutoUTFInputStream(InputByteStream& is, UTFType type = kUTF8) : is_(&is), type_(type), hasBOM_(false) { + RAPIDJSON_ASSERT(type >= kUTF8 && type <= kUTF32BE); + DetectType(); + static const TakeFunc f[] = { RAPIDJSON_ENCODINGS_FUNC(Take) }; + takeFunc_ = f[type_]; + current_ = takeFunc_(*is_); + } + + UTFType GetType() const { return type_; } + bool HasBOM() const { return hasBOM_; } + + Ch Peek() const { return current_; } + Ch Take() { Ch c = current_; current_ = takeFunc_(*is_); return c; } + size_t Tell() const { return is_->Tell(); } + + // Not implemented + void Put(Ch) { RAPIDJSON_ASSERT(false); } + void Flush() { RAPIDJSON_ASSERT(false); } + Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; } + size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; } + +private: + AutoUTFInputStream(const AutoUTFInputStream&); + AutoUTFInputStream& operator=(const AutoUTFInputStream&); + + // Detect encoding type with BOM or RFC 4627 + void DetectType() { + // BOM (Byte Order Mark): + // 00 00 FE FF UTF-32BE + // FF FE 00 00 UTF-32LE + // FE FF UTF-16BE + // FF FE UTF-16LE + // EF BB BF UTF-8 + + const unsigned char* c = reinterpret_cast(is_->Peek4()); + if (!c) + return; + + unsigned bom = static_cast(c[0] | (c[1] << 8) | (c[2] << 16) | (c[3] << 24)); + hasBOM_ = false; + if (bom == 0xFFFE0000) { type_ = kUTF32BE; hasBOM_ = true; is_->Take(); is_->Take(); is_->Take(); is_->Take(); } + else if (bom == 0x0000FEFF) { type_ = kUTF32LE; hasBOM_ = true; is_->Take(); is_->Take(); is_->Take(); is_->Take(); } + else if ((bom & 0xFFFF) == 0xFFFE) { type_ = kUTF16BE; hasBOM_ = true; is_->Take(); is_->Take(); } + else if ((bom & 0xFFFF) == 0xFEFF) { type_ = kUTF16LE; hasBOM_ = true; is_->Take(); is_->Take(); } + else if ((bom & 0xFFFFFF) == 0xBFBBEF) { type_ = kUTF8; hasBOM_ = true; is_->Take(); is_->Take(); is_->Take(); } + + // RFC 4627: Section 3 + // "Since the first two characters of a JSON text will always be ASCII + // characters [RFC0020], it is possible to determine whether an octet + // stream is UTF-8, UTF-16 (BE or LE), or UTF-32 (BE or LE) by looking + // at the pattern of nulls in the first four octets." + // 00 00 00 xx UTF-32BE + // 00 xx 00 xx UTF-16BE + // xx 00 00 00 UTF-32LE + // xx 00 xx 00 UTF-16LE + // xx xx xx xx UTF-8 + + if (!hasBOM_) { + int pattern = (c[0] ? 1 : 0) | (c[1] ? 2 : 0) | (c[2] ? 4 : 0) | (c[3] ? 8 : 0); + switch (pattern) { + case 0x08: type_ = kUTF32BE; break; + case 0x0A: type_ = kUTF16BE; break; + case 0x01: type_ = kUTF32LE; break; + case 0x05: type_ = kUTF16LE; break; + case 0x0F: type_ = kUTF8; break; + default: break; // Use type defined by user. + } + } + + // Runtime check whether the size of character type is sufficient. It only perform checks with assertion. + if (type_ == kUTF16LE || type_ == kUTF16BE) RAPIDJSON_ASSERT(sizeof(Ch) >= 2); + if (type_ == kUTF32LE || type_ == kUTF32BE) RAPIDJSON_ASSERT(sizeof(Ch) >= 4); + } + + typedef Ch (*TakeFunc)(InputByteStream& is); + InputByteStream* is_; + UTFType type_; + Ch current_; + TakeFunc takeFunc_; + bool hasBOM_; +}; + +//! Output stream wrapper with dynamically bound encoding and automatic encoding detection. +/*! + \tparam CharType Type of character for writing. + \tparam OutputByteStream type of output byte stream to be wrapped. +*/ +template +class AutoUTFOutputStream { + RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); +public: + typedef CharType Ch; + + //! Constructor. + /*! + \param os output stream to be wrapped. + \param type UTF encoding type. + \param putBOM Whether to write BOM at the beginning of the stream. + */ + AutoUTFOutputStream(OutputByteStream& os, UTFType type, bool putBOM) : os_(&os), type_(type) { + RAPIDJSON_ASSERT(type >= kUTF8 && type <= kUTF32BE); + + // Runtime check whether the size of character type is sufficient. It only perform checks with assertion. + if (type_ == kUTF16LE || type_ == kUTF16BE) RAPIDJSON_ASSERT(sizeof(Ch) >= 2); + if (type_ == kUTF32LE || type_ == kUTF32BE) RAPIDJSON_ASSERT(sizeof(Ch) >= 4); + + static const PutFunc f[] = { RAPIDJSON_ENCODINGS_FUNC(Put) }; + putFunc_ = f[type_]; + + if (putBOM) + PutBOM(); + } + + UTFType GetType() const { return type_; } + + void Put(Ch c) { putFunc_(*os_, c); } + void Flush() { os_->Flush(); } + + // Not implemented + Ch Peek() const { RAPIDJSON_ASSERT(false); return 0;} + Ch Take() { RAPIDJSON_ASSERT(false); return 0;} + size_t Tell() const { RAPIDJSON_ASSERT(false); return 0; } + Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; } + size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; } + +private: + AutoUTFOutputStream(const AutoUTFOutputStream&); + AutoUTFOutputStream& operator=(const AutoUTFOutputStream&); + + void PutBOM() { + typedef void (*PutBOMFunc)(OutputByteStream&); + static const PutBOMFunc f[] = { RAPIDJSON_ENCODINGS_FUNC(PutBOM) }; + f[type_](*os_); + } + + typedef void (*PutFunc)(OutputByteStream&, Ch); + + OutputByteStream* os_; + UTFType type_; + PutFunc putFunc_; +}; + +#undef RAPIDJSON_ENCODINGS_FUNC + +RAPIDJSON_NAMESPACE_END + +#ifdef __clang__ +RAPIDJSON_DIAG_POP +#endif + +#ifdef __GNUC__ +RAPIDJSON_DIAG_POP +#endif + +#endif // RAPIDJSON_FILESTREAM_H_ diff --git a/umd/external/include/rapidjson/encodings.h b/umd/external/include/rapidjson/encodings.h new file mode 100644 index 00000000..0df1c343 --- /dev/null +++ b/umd/external/include/rapidjson/encodings.h @@ -0,0 +1,716 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef RAPIDJSON_ENCODINGS_H_ +#define RAPIDJSON_ENCODINGS_H_ + +#include "rapidjson.h" + +#ifdef _MSC_VER +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(4244) // conversion from 'type1' to 'type2', possible loss of data +RAPIDJSON_DIAG_OFF(4702) // unreachable code +#elif defined(__GNUC__) +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(effc++) +RAPIDJSON_DIAG_OFF(overflow) +#endif + +RAPIDJSON_NAMESPACE_BEGIN + +/////////////////////////////////////////////////////////////////////////////// +// Encoding + +/*! \class rapidjson::Encoding + \brief Concept for encoding of Unicode characters. + +\code +concept Encoding { + typename Ch; //! Type of character. A "character" is actually a code unit in unicode's definition. + + enum { supportUnicode = 1 }; // or 0 if not supporting unicode + + //! \brief Encode a Unicode codepoint to an output stream. + //! \param os Output stream. + //! \param codepoint An unicode codepoint, ranging from 0x0 to 0x10FFFF inclusively. + template + static void Encode(OutputStream& os, unsigned codepoint); + + //! \brief Decode a Unicode codepoint from an input stream. + //! \param is Input stream. + //! \param codepoint Output of the unicode codepoint. + //! \return true if a valid codepoint can be decoded from the stream. + template + static bool Decode(InputStream& is, unsigned* codepoint); + + //! \brief Validate one Unicode codepoint from an encoded stream. + //! \param is Input stream to obtain codepoint. + //! \param os Output for copying one codepoint. + //! \return true if it is valid. + //! \note This function just validating and copying the codepoint without actually decode it. + template + static bool Validate(InputStream& is, OutputStream& os); + + // The following functions are deal with byte streams. + + //! Take a character from input byte stream, skip BOM if exist. + template + static CharType TakeBOM(InputByteStream& is); + + //! Take a character from input byte stream. + template + static Ch Take(InputByteStream& is); + + //! Put BOM to output byte stream. + template + static void PutBOM(OutputByteStream& os); + + //! Put a character to output byte stream. + template + static void Put(OutputByteStream& os, Ch c); +}; +\endcode +*/ + +/////////////////////////////////////////////////////////////////////////////// +// UTF8 + +//! UTF-8 encoding. +/*! http://en.wikipedia.org/wiki/UTF-8 + http://tools.ietf.org/html/rfc3629 + \tparam CharType Code unit for storing 8-bit UTF-8 data. Default is char. + \note implements Encoding concept +*/ +template +struct UTF8 { + typedef CharType Ch; + + enum { supportUnicode = 1 }; + + template + static void Encode(OutputStream& os, unsigned codepoint) { + if (codepoint <= 0x7F) + os.Put(static_cast(codepoint & 0xFF)); + else if (codepoint <= 0x7FF) { + os.Put(static_cast(0xC0 | ((codepoint >> 6) & 0xFF))); + os.Put(static_cast(0x80 | ((codepoint & 0x3F)))); + } + else if (codepoint <= 0xFFFF) { + os.Put(static_cast(0xE0 | ((codepoint >> 12) & 0xFF))); + os.Put(static_cast(0x80 | ((codepoint >> 6) & 0x3F))); + os.Put(static_cast(0x80 | (codepoint & 0x3F))); + } + else { + RAPIDJSON_ASSERT(codepoint <= 0x10FFFF); + os.Put(static_cast(0xF0 | ((codepoint >> 18) & 0xFF))); + os.Put(static_cast(0x80 | ((codepoint >> 12) & 0x3F))); + os.Put(static_cast(0x80 | ((codepoint >> 6) & 0x3F))); + os.Put(static_cast(0x80 | (codepoint & 0x3F))); + } + } + + template + static void EncodeUnsafe(OutputStream& os, unsigned codepoint) { + if (codepoint <= 0x7F) + PutUnsafe(os, static_cast(codepoint & 0xFF)); + else if (codepoint <= 0x7FF) { + PutUnsafe(os, static_cast(0xC0 | ((codepoint >> 6) & 0xFF))); + PutUnsafe(os, static_cast(0x80 | ((codepoint & 0x3F)))); + } + else if (codepoint <= 0xFFFF) { + PutUnsafe(os, static_cast(0xE0 | ((codepoint >> 12) & 0xFF))); + PutUnsafe(os, static_cast(0x80 | ((codepoint >> 6) & 0x3F))); + PutUnsafe(os, static_cast(0x80 | (codepoint & 0x3F))); + } + else { + RAPIDJSON_ASSERT(codepoint <= 0x10FFFF); + PutUnsafe(os, static_cast(0xF0 | ((codepoint >> 18) & 0xFF))); + PutUnsafe(os, static_cast(0x80 | ((codepoint >> 12) & 0x3F))); + PutUnsafe(os, static_cast(0x80 | ((codepoint >> 6) & 0x3F))); + PutUnsafe(os, static_cast(0x80 | (codepoint & 0x3F))); + } + } + + template + static bool Decode(InputStream& is, unsigned* codepoint) { +#define COPY() c = is.Take(); *codepoint = (*codepoint << 6) | (static_cast(c) & 0x3Fu) +#define TRANS(mask) result &= ((GetRange(static_cast(c)) & mask) != 0) +#define TAIL() COPY(); TRANS(0x70) + typename InputStream::Ch c = is.Take(); + if (!(c & 0x80)) { + *codepoint = static_cast(c); + return true; + } + + unsigned char type = GetRange(static_cast(c)); + if (type >= 32) { + *codepoint = 0; + } else { + *codepoint = (0xFFu >> type) & static_cast(c); + } + bool result = true; + switch (type) { + case 2: TAIL(); return result; + case 3: TAIL(); TAIL(); return result; + case 4: COPY(); TRANS(0x50); TAIL(); return result; + case 5: COPY(); TRANS(0x10); TAIL(); TAIL(); return result; + case 6: TAIL(); TAIL(); TAIL(); return result; + case 10: COPY(); TRANS(0x20); TAIL(); return result; + case 11: COPY(); TRANS(0x60); TAIL(); TAIL(); return result; + default: return false; + } +#undef COPY +#undef TRANS +#undef TAIL + } + + template + static bool Validate(InputStream& is, OutputStream& os) { +#define COPY() os.Put(c = is.Take()) +#define TRANS(mask) result &= ((GetRange(static_cast(c)) & mask) != 0) +#define TAIL() COPY(); TRANS(0x70) + Ch c; + COPY(); + if (!(c & 0x80)) + return true; + + bool result = true; + switch (GetRange(static_cast(c))) { + case 2: TAIL(); return result; + case 3: TAIL(); TAIL(); return result; + case 4: COPY(); TRANS(0x50); TAIL(); return result; + case 5: COPY(); TRANS(0x10); TAIL(); TAIL(); return result; + case 6: TAIL(); TAIL(); TAIL(); return result; + case 10: COPY(); TRANS(0x20); TAIL(); return result; + case 11: COPY(); TRANS(0x60); TAIL(); TAIL(); return result; + default: return false; + } +#undef COPY +#undef TRANS +#undef TAIL + } + + static unsigned char GetRange(unsigned char c) { + // Referring to DFA of http://bjoern.hoehrmann.de/utf-8/decoder/dfa/ + // With new mapping 1 -> 0x10, 7 -> 0x20, 9 -> 0x40, such that AND operation can test multiple types. + static const unsigned char type[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, + 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 8,8,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, + 10,3,3,3,3,3,3,3,3,3,3,3,3,4,3,3, 11,6,6,6,5,8,8,8,8,8,8,8,8,8,8,8, + }; + return type[c]; + } + + template + static CharType TakeBOM(InputByteStream& is) { + RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); + typename InputByteStream::Ch c = Take(is); + if (static_cast(c) != 0xEFu) return c; + c = is.Take(); + if (static_cast(c) != 0xBBu) return c; + c = is.Take(); + if (static_cast(c) != 0xBFu) return c; + c = is.Take(); + return c; + } + + template + static Ch Take(InputByteStream& is) { + RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); + return static_cast(is.Take()); + } + + template + static void PutBOM(OutputByteStream& os) { + RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); + os.Put(static_cast(0xEFu)); + os.Put(static_cast(0xBBu)); + os.Put(static_cast(0xBFu)); + } + + template + static void Put(OutputByteStream& os, Ch c) { + RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); + os.Put(static_cast(c)); + } +}; + +/////////////////////////////////////////////////////////////////////////////// +// UTF16 + +//! UTF-16 encoding. +/*! http://en.wikipedia.org/wiki/UTF-16 + http://tools.ietf.org/html/rfc2781 + \tparam CharType Type for storing 16-bit UTF-16 data. Default is wchar_t. C++11 may use char16_t instead. + \note implements Encoding concept + + \note For in-memory access, no need to concern endianness. The code units and code points are represented by CPU's endianness. + For streaming, use UTF16LE and UTF16BE, which handle endianness. +*/ +template +struct UTF16 { + typedef CharType Ch; + RAPIDJSON_STATIC_ASSERT(sizeof(Ch) >= 2); + + enum { supportUnicode = 1 }; + + template + static void Encode(OutputStream& os, unsigned codepoint) { + RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputStream::Ch) >= 2); + if (codepoint <= 0xFFFF) { + RAPIDJSON_ASSERT(codepoint < 0xD800 || codepoint > 0xDFFF); // Code point itself cannot be surrogate pair + os.Put(static_cast(codepoint)); + } + else { + RAPIDJSON_ASSERT(codepoint <= 0x10FFFF); + unsigned v = codepoint - 0x10000; + os.Put(static_cast((v >> 10) | 0xD800)); + os.Put(static_cast((v & 0x3FF) | 0xDC00)); + } + } + + + template + static void EncodeUnsafe(OutputStream& os, unsigned codepoint) { + RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputStream::Ch) >= 2); + if (codepoint <= 0xFFFF) { + RAPIDJSON_ASSERT(codepoint < 0xD800 || codepoint > 0xDFFF); // Code point itself cannot be surrogate pair + PutUnsafe(os, static_cast(codepoint)); + } + else { + RAPIDJSON_ASSERT(codepoint <= 0x10FFFF); + unsigned v = codepoint - 0x10000; + PutUnsafe(os, static_cast((v >> 10) | 0xD800)); + PutUnsafe(os, static_cast((v & 0x3FF) | 0xDC00)); + } + } + + template + static bool Decode(InputStream& is, unsigned* codepoint) { + RAPIDJSON_STATIC_ASSERT(sizeof(typename InputStream::Ch) >= 2); + typename InputStream::Ch c = is.Take(); + if (c < 0xD800 || c > 0xDFFF) { + *codepoint = static_cast(c); + return true; + } + else if (c <= 0xDBFF) { + *codepoint = (static_cast(c) & 0x3FF) << 10; + c = is.Take(); + *codepoint |= (static_cast(c) & 0x3FF); + *codepoint += 0x10000; + return c >= 0xDC00 && c <= 0xDFFF; + } + return false; + } + + template + static bool Validate(InputStream& is, OutputStream& os) { + RAPIDJSON_STATIC_ASSERT(sizeof(typename InputStream::Ch) >= 2); + RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputStream::Ch) >= 2); + typename InputStream::Ch c; + os.Put(static_cast(c = is.Take())); + if (c < 0xD800 || c > 0xDFFF) + return true; + else if (c <= 0xDBFF) { + os.Put(c = is.Take()); + return c >= 0xDC00 && c <= 0xDFFF; + } + return false; + } +}; + +//! UTF-16 little endian encoding. +template +struct UTF16LE : UTF16 { + template + static CharType TakeBOM(InputByteStream& is) { + RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); + CharType c = Take(is); + return static_cast(c) == 0xFEFFu ? Take(is) : c; + } + + template + static CharType Take(InputByteStream& is) { + RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); + unsigned c = static_cast(is.Take()); + c |= static_cast(static_cast(is.Take())) << 8; + return static_cast(c); + } + + template + static void PutBOM(OutputByteStream& os) { + RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); + os.Put(static_cast(0xFFu)); + os.Put(static_cast(0xFEu)); + } + + template + static void Put(OutputByteStream& os, CharType c) { + RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); + os.Put(static_cast(static_cast(c) & 0xFFu)); + os.Put(static_cast((static_cast(c) >> 8) & 0xFFu)); + } +}; + +//! UTF-16 big endian encoding. +template +struct UTF16BE : UTF16 { + template + static CharType TakeBOM(InputByteStream& is) { + RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); + CharType c = Take(is); + return static_cast(c) == 0xFEFFu ? Take(is) : c; + } + + template + static CharType Take(InputByteStream& is) { + RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); + unsigned c = static_cast(static_cast(is.Take())) << 8; + c |= static_cast(is.Take()); + return static_cast(c); + } + + template + static void PutBOM(OutputByteStream& os) { + RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); + os.Put(static_cast(0xFEu)); + os.Put(static_cast(0xFFu)); + } + + template + static void Put(OutputByteStream& os, CharType c) { + RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); + os.Put(static_cast((static_cast(c) >> 8) & 0xFFu)); + os.Put(static_cast(static_cast(c) & 0xFFu)); + } +}; + +/////////////////////////////////////////////////////////////////////////////// +// UTF32 + +//! UTF-32 encoding. +/*! http://en.wikipedia.org/wiki/UTF-32 + \tparam CharType Type for storing 32-bit UTF-32 data. Default is unsigned. C++11 may use char32_t instead. + \note implements Encoding concept + + \note For in-memory access, no need to concern endianness. The code units and code points are represented by CPU's endianness. + For streaming, use UTF32LE and UTF32BE, which handle endianness. +*/ +template +struct UTF32 { + typedef CharType Ch; + RAPIDJSON_STATIC_ASSERT(sizeof(Ch) >= 4); + + enum { supportUnicode = 1 }; + + template + static void Encode(OutputStream& os, unsigned codepoint) { + RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputStream::Ch) >= 4); + RAPIDJSON_ASSERT(codepoint <= 0x10FFFF); + os.Put(codepoint); + } + + template + static void EncodeUnsafe(OutputStream& os, unsigned codepoint) { + RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputStream::Ch) >= 4); + RAPIDJSON_ASSERT(codepoint <= 0x10FFFF); + PutUnsafe(os, codepoint); + } + + template + static bool Decode(InputStream& is, unsigned* codepoint) { + RAPIDJSON_STATIC_ASSERT(sizeof(typename InputStream::Ch) >= 4); + Ch c = is.Take(); + *codepoint = c; + return c <= 0x10FFFF; + } + + template + static bool Validate(InputStream& is, OutputStream& os) { + RAPIDJSON_STATIC_ASSERT(sizeof(typename InputStream::Ch) >= 4); + Ch c; + os.Put(c = is.Take()); + return c <= 0x10FFFF; + } +}; + +//! UTF-32 little endian enocoding. +template +struct UTF32LE : UTF32 { + template + static CharType TakeBOM(InputByteStream& is) { + RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); + CharType c = Take(is); + return static_cast(c) == 0x0000FEFFu ? Take(is) : c; + } + + template + static CharType Take(InputByteStream& is) { + RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); + unsigned c = static_cast(is.Take()); + c |= static_cast(static_cast(is.Take())) << 8; + c |= static_cast(static_cast(is.Take())) << 16; + c |= static_cast(static_cast(is.Take())) << 24; + return static_cast(c); + } + + template + static void PutBOM(OutputByteStream& os) { + RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); + os.Put(static_cast(0xFFu)); + os.Put(static_cast(0xFEu)); + os.Put(static_cast(0x00u)); + os.Put(static_cast(0x00u)); + } + + template + static void Put(OutputByteStream& os, CharType c) { + RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); + os.Put(static_cast(c & 0xFFu)); + os.Put(static_cast((c >> 8) & 0xFFu)); + os.Put(static_cast((c >> 16) & 0xFFu)); + os.Put(static_cast((c >> 24) & 0xFFu)); + } +}; + +//! UTF-32 big endian encoding. +template +struct UTF32BE : UTF32 { + template + static CharType TakeBOM(InputByteStream& is) { + RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); + CharType c = Take(is); + return static_cast(c) == 0x0000FEFFu ? Take(is) : c; + } + + template + static CharType Take(InputByteStream& is) { + RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); + unsigned c = static_cast(static_cast(is.Take())) << 24; + c |= static_cast(static_cast(is.Take())) << 16; + c |= static_cast(static_cast(is.Take())) << 8; + c |= static_cast(static_cast(is.Take())); + return static_cast(c); + } + + template + static void PutBOM(OutputByteStream& os) { + RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); + os.Put(static_cast(0x00u)); + os.Put(static_cast(0x00u)); + os.Put(static_cast(0xFEu)); + os.Put(static_cast(0xFFu)); + } + + template + static void Put(OutputByteStream& os, CharType c) { + RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); + os.Put(static_cast((c >> 24) & 0xFFu)); + os.Put(static_cast((c >> 16) & 0xFFu)); + os.Put(static_cast((c >> 8) & 0xFFu)); + os.Put(static_cast(c & 0xFFu)); + } +}; + +/////////////////////////////////////////////////////////////////////////////// +// ASCII + +//! ASCII encoding. +/*! http://en.wikipedia.org/wiki/ASCII + \tparam CharType Code unit for storing 7-bit ASCII data. Default is char. + \note implements Encoding concept +*/ +template +struct ASCII { + typedef CharType Ch; + + enum { supportUnicode = 0 }; + + template + static void Encode(OutputStream& os, unsigned codepoint) { + RAPIDJSON_ASSERT(codepoint <= 0x7F); + os.Put(static_cast(codepoint & 0xFF)); + } + + template + static void EncodeUnsafe(OutputStream& os, unsigned codepoint) { + RAPIDJSON_ASSERT(codepoint <= 0x7F); + PutUnsafe(os, static_cast(codepoint & 0xFF)); + } + + template + static bool Decode(InputStream& is, unsigned* codepoint) { + uint8_t c = static_cast(is.Take()); + *codepoint = c; + return c <= 0X7F; + } + + template + static bool Validate(InputStream& is, OutputStream& os) { + uint8_t c = static_cast(is.Take()); + os.Put(static_cast(c)); + return c <= 0x7F; + } + + template + static CharType TakeBOM(InputByteStream& is) { + RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); + uint8_t c = static_cast(Take(is)); + return static_cast(c); + } + + template + static Ch Take(InputByteStream& is) { + RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1); + return static_cast(is.Take()); + } + + template + static void PutBOM(OutputByteStream& os) { + RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); + (void)os; + } + + template + static void Put(OutputByteStream& os, Ch c) { + RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1); + os.Put(static_cast(c)); + } +}; + +/////////////////////////////////////////////////////////////////////////////// +// AutoUTF + +//! Runtime-specified UTF encoding type of a stream. +enum UTFType { + kUTF8 = 0, //!< UTF-8. + kUTF16LE = 1, //!< UTF-16 little endian. + kUTF16BE = 2, //!< UTF-16 big endian. + kUTF32LE = 3, //!< UTF-32 little endian. + kUTF32BE = 4 //!< UTF-32 big endian. +}; + +//! Dynamically select encoding according to stream's runtime-specified UTF encoding type. +/*! \note This class can be used with AutoUTFInputtStream and AutoUTFOutputStream, which provides GetType(). +*/ +template +struct AutoUTF { + typedef CharType Ch; + + enum { supportUnicode = 1 }; + +#define RAPIDJSON_ENCODINGS_FUNC(x) UTF8::x, UTF16LE::x, UTF16BE::x, UTF32LE::x, UTF32BE::x + + template + static RAPIDJSON_FORCEINLINE void Encode(OutputStream& os, unsigned codepoint) { + typedef void (*EncodeFunc)(OutputStream&, unsigned); + static const EncodeFunc f[] = { RAPIDJSON_ENCODINGS_FUNC(Encode) }; + (*f[os.GetType()])(os, codepoint); + } + + template + static RAPIDJSON_FORCEINLINE void EncodeUnsafe(OutputStream& os, unsigned codepoint) { + typedef void (*EncodeFunc)(OutputStream&, unsigned); + static const EncodeFunc f[] = { RAPIDJSON_ENCODINGS_FUNC(EncodeUnsafe) }; + (*f[os.GetType()])(os, codepoint); + } + + template + static RAPIDJSON_FORCEINLINE bool Decode(InputStream& is, unsigned* codepoint) { + typedef bool (*DecodeFunc)(InputStream&, unsigned*); + static const DecodeFunc f[] = { RAPIDJSON_ENCODINGS_FUNC(Decode) }; + return (*f[is.GetType()])(is, codepoint); + } + + template + static RAPIDJSON_FORCEINLINE bool Validate(InputStream& is, OutputStream& os) { + typedef bool (*ValidateFunc)(InputStream&, OutputStream&); + static const ValidateFunc f[] = { RAPIDJSON_ENCODINGS_FUNC(Validate) }; + return (*f[is.GetType()])(is, os); + } + +#undef RAPIDJSON_ENCODINGS_FUNC +}; + +/////////////////////////////////////////////////////////////////////////////// +// Transcoder + +//! Encoding conversion. +template +struct Transcoder { + //! Take one Unicode codepoint from source encoding, convert it to target encoding and put it to the output stream. + template + static RAPIDJSON_FORCEINLINE bool Transcode(InputStream& is, OutputStream& os) { + unsigned codepoint; + if (!SourceEncoding::Decode(is, &codepoint)) + return false; + TargetEncoding::Encode(os, codepoint); + return true; + } + + template + static RAPIDJSON_FORCEINLINE bool TranscodeUnsafe(InputStream& is, OutputStream& os) { + unsigned codepoint; + if (!SourceEncoding::Decode(is, &codepoint)) + return false; + TargetEncoding::EncodeUnsafe(os, codepoint); + return true; + } + + //! Validate one Unicode codepoint from an encoded stream. + template + static RAPIDJSON_FORCEINLINE bool Validate(InputStream& is, OutputStream& os) { + return Transcode(is, os); // Since source/target encoding is different, must transcode. + } +}; + +// Forward declaration. +template +inline void PutUnsafe(Stream& stream, typename Stream::Ch c); + +//! Specialization of Transcoder with same source and target encoding. +template +struct Transcoder { + template + static RAPIDJSON_FORCEINLINE bool Transcode(InputStream& is, OutputStream& os) { + os.Put(is.Take()); // Just copy one code unit. This semantic is different from primary template class. + return true; + } + + template + static RAPIDJSON_FORCEINLINE bool TranscodeUnsafe(InputStream& is, OutputStream& os) { + PutUnsafe(os, is.Take()); // Just copy one code unit. This semantic is different from primary template class. + return true; + } + + template + static RAPIDJSON_FORCEINLINE bool Validate(InputStream& is, OutputStream& os) { + return Encoding::Validate(is, os); // source/target encoding are the same + } +}; + +RAPIDJSON_NAMESPACE_END + +#if defined(__GNUC__) || defined(_MSC_VER) +RAPIDJSON_DIAG_POP +#endif + +#endif // RAPIDJSON_ENCODINGS_H_ diff --git a/umd/external/include/rapidjson/error/en.h b/umd/external/include/rapidjson/error/en.h new file mode 100644 index 00000000..2db838bf --- /dev/null +++ b/umd/external/include/rapidjson/error/en.h @@ -0,0 +1,74 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef RAPIDJSON_ERROR_EN_H_ +#define RAPIDJSON_ERROR_EN_H_ + +#include "error.h" + +#ifdef __clang__ +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(switch-enum) +RAPIDJSON_DIAG_OFF(covered-switch-default) +#endif + +RAPIDJSON_NAMESPACE_BEGIN + +//! Maps error code of parsing into error message. +/*! + \ingroup RAPIDJSON_ERRORS + \param parseErrorCode Error code obtained in parsing. + \return the error message. + \note User can make a copy of this function for localization. + Using switch-case is safer for future modification of error codes. +*/ +inline const RAPIDJSON_ERROR_CHARTYPE* GetParseError_En(ParseErrorCode parseErrorCode) { + switch (parseErrorCode) { + case kParseErrorNone: return RAPIDJSON_ERROR_STRING("No error."); + + case kParseErrorDocumentEmpty: return RAPIDJSON_ERROR_STRING("The document is empty."); + case kParseErrorDocumentRootNotSingular: return RAPIDJSON_ERROR_STRING("The document root must not be followed by other values."); + + case kParseErrorValueInvalid: return RAPIDJSON_ERROR_STRING("Invalid value."); + + case kParseErrorObjectMissName: return RAPIDJSON_ERROR_STRING("Missing a name for object member."); + case kParseErrorObjectMissColon: return RAPIDJSON_ERROR_STRING("Missing a colon after a name of object member."); + case kParseErrorObjectMissCommaOrCurlyBracket: return RAPIDJSON_ERROR_STRING("Missing a comma or '}' after an object member."); + + case kParseErrorArrayMissCommaOrSquareBracket: return RAPIDJSON_ERROR_STRING("Missing a comma or ']' after an array element."); + + case kParseErrorStringUnicodeEscapeInvalidHex: return RAPIDJSON_ERROR_STRING("Incorrect hex digit after \\u escape in string."); + case kParseErrorStringUnicodeSurrogateInvalid: return RAPIDJSON_ERROR_STRING("The surrogate pair in string is invalid."); + case kParseErrorStringEscapeInvalid: return RAPIDJSON_ERROR_STRING("Invalid escape character in string."); + case kParseErrorStringMissQuotationMark: return RAPIDJSON_ERROR_STRING("Missing a closing quotation mark in string."); + case kParseErrorStringInvalidEncoding: return RAPIDJSON_ERROR_STRING("Invalid encoding in string."); + + case kParseErrorNumberTooBig: return RAPIDJSON_ERROR_STRING("Number too big to be stored in double."); + case kParseErrorNumberMissFraction: return RAPIDJSON_ERROR_STRING("Miss fraction part in number."); + case kParseErrorNumberMissExponent: return RAPIDJSON_ERROR_STRING("Miss exponent in number."); + + case kParseErrorTermination: return RAPIDJSON_ERROR_STRING("Terminate parsing due to Handler error."); + case kParseErrorUnspecificSyntaxError: return RAPIDJSON_ERROR_STRING("Unspecific syntax error."); + + default: return RAPIDJSON_ERROR_STRING("Unknown error."); + } +} + +RAPIDJSON_NAMESPACE_END + +#ifdef __clang__ +RAPIDJSON_DIAG_POP +#endif + +#endif // RAPIDJSON_ERROR_EN_H_ diff --git a/umd/external/include/rapidjson/error/error.h b/umd/external/include/rapidjson/error/error.h new file mode 100644 index 00000000..95cb31a7 --- /dev/null +++ b/umd/external/include/rapidjson/error/error.h @@ -0,0 +1,155 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef RAPIDJSON_ERROR_ERROR_H_ +#define RAPIDJSON_ERROR_ERROR_H_ + +#include "../rapidjson.h" + +#ifdef __clang__ +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(padded) +#endif + +/*! \file error.h */ + +/*! \defgroup RAPIDJSON_ERRORS RapidJSON error handling */ + +/////////////////////////////////////////////////////////////////////////////// +// RAPIDJSON_ERROR_CHARTYPE + +//! Character type of error messages. +/*! \ingroup RAPIDJSON_ERRORS + The default character type is \c char. + On Windows, user can define this macro as \c TCHAR for supporting both + unicode/non-unicode settings. +*/ +#ifndef RAPIDJSON_ERROR_CHARTYPE +#define RAPIDJSON_ERROR_CHARTYPE char +#endif + +/////////////////////////////////////////////////////////////////////////////// +// RAPIDJSON_ERROR_STRING + +//! Macro for converting string literial to \ref RAPIDJSON_ERROR_CHARTYPE[]. +/*! \ingroup RAPIDJSON_ERRORS + By default this conversion macro does nothing. + On Windows, user can define this macro as \c _T(x) for supporting both + unicode/non-unicode settings. +*/ +#ifndef RAPIDJSON_ERROR_STRING +#define RAPIDJSON_ERROR_STRING(x) x +#endif + +RAPIDJSON_NAMESPACE_BEGIN + +/////////////////////////////////////////////////////////////////////////////// +// ParseErrorCode + +//! Error code of parsing. +/*! \ingroup RAPIDJSON_ERRORS + \see GenericReader::Parse, GenericReader::GetParseErrorCode +*/ +enum ParseErrorCode { + kParseErrorNone = 0, //!< No error. + + kParseErrorDocumentEmpty, //!< The document is empty. + kParseErrorDocumentRootNotSingular, //!< The document root must not follow by other values. + + kParseErrorValueInvalid, //!< Invalid value. + + kParseErrorObjectMissName, //!< Missing a name for object member. + kParseErrorObjectMissColon, //!< Missing a colon after a name of object member. + kParseErrorObjectMissCommaOrCurlyBracket, //!< Missing a comma or '}' after an object member. + + kParseErrorArrayMissCommaOrSquareBracket, //!< Missing a comma or ']' after an array element. + + kParseErrorStringUnicodeEscapeInvalidHex, //!< Incorrect hex digit after \\u escape in string. + kParseErrorStringUnicodeSurrogateInvalid, //!< The surrogate pair in string is invalid. + kParseErrorStringEscapeInvalid, //!< Invalid escape character in string. + kParseErrorStringMissQuotationMark, //!< Missing a closing quotation mark in string. + kParseErrorStringInvalidEncoding, //!< Invalid encoding in string. + + kParseErrorNumberTooBig, //!< Number too big to be stored in double. + kParseErrorNumberMissFraction, //!< Miss fraction part in number. + kParseErrorNumberMissExponent, //!< Miss exponent in number. + + kParseErrorTermination, //!< Parsing was terminated. + kParseErrorUnspecificSyntaxError //!< Unspecific syntax error. +}; + +//! Result of parsing (wraps ParseErrorCode) +/*! + \ingroup RAPIDJSON_ERRORS + \code + Document doc; + ParseResult ok = doc.Parse("[42]"); + if (!ok) { + fprintf(stderr, "JSON parse error: %s (%u)", + GetParseError_En(ok.Code()), ok.Offset()); + exit(EXIT_FAILURE); + } + \endcode + \see GenericReader::Parse, GenericDocument::Parse +*/ +struct ParseResult { +public: + //! Default constructor, no error. + ParseResult() : code_(kParseErrorNone), offset_(0) {} + //! Constructor to set an error. + ParseResult(ParseErrorCode code, size_t offset) : code_(code), offset_(offset) {} + + //! Get the error code. + ParseErrorCode Code() const { return code_; } + //! Get the error offset, if \ref IsError(), 0 otherwise. + size_t Offset() const { return offset_; } + + //! Conversion to \c bool, returns \c true, iff !\ref IsError(). + operator bool() const { return !IsError(); } + //! Whether the result is an error. + bool IsError() const { return code_ != kParseErrorNone; } + + bool operator==(const ParseResult& that) const { return code_ == that.code_; } + bool operator==(ParseErrorCode code) const { return code_ == code; } + friend bool operator==(ParseErrorCode code, const ParseResult & err) { return code == err.code_; } + + //! Reset error code. + void Clear() { Set(kParseErrorNone); } + //! Update error code and offset. + void Set(ParseErrorCode code, size_t offset = 0) { code_ = code; offset_ = offset; } + +private: + ParseErrorCode code_; + size_t offset_; +}; + +//! Function pointer type of GetParseError(). +/*! \ingroup RAPIDJSON_ERRORS + + This is the prototype for \c GetParseError_X(), where \c X is a locale. + User can dynamically change locale in runtime, e.g.: +\code + GetParseErrorFunc GetParseError = GetParseError_En; // or whatever + const RAPIDJSON_ERROR_CHARTYPE* s = GetParseError(document.GetParseErrorCode()); +\endcode +*/ +typedef const RAPIDJSON_ERROR_CHARTYPE* (*GetParseErrorFunc)(ParseErrorCode); + +RAPIDJSON_NAMESPACE_END + +#ifdef __clang__ +RAPIDJSON_DIAG_POP +#endif + +#endif // RAPIDJSON_ERROR_ERROR_H_ diff --git a/umd/external/include/rapidjson/filereadstream.h b/umd/external/include/rapidjson/filereadstream.h new file mode 100644 index 00000000..b56ea13b --- /dev/null +++ b/umd/external/include/rapidjson/filereadstream.h @@ -0,0 +1,99 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef RAPIDJSON_FILEREADSTREAM_H_ +#define RAPIDJSON_FILEREADSTREAM_H_ + +#include "stream.h" +#include + +#ifdef __clang__ +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(padded) +RAPIDJSON_DIAG_OFF(unreachable-code) +RAPIDJSON_DIAG_OFF(missing-noreturn) +#endif + +RAPIDJSON_NAMESPACE_BEGIN + +//! File byte stream for input using fread(). +/*! + \note implements Stream concept +*/ +class FileReadStream { +public: + typedef char Ch; //!< Character type (byte). + + //! Constructor. + /*! + \param fp File pointer opened for read. + \param buffer user-supplied buffer. + \param bufferSize size of buffer in bytes. Must >=4 bytes. + */ + FileReadStream(std::FILE* fp, char* buffer, size_t bufferSize) : fp_(fp), buffer_(buffer), bufferSize_(bufferSize), bufferLast_(0), current_(buffer_), readCount_(0), count_(0), eof_(false) { + RAPIDJSON_ASSERT(fp_ != 0); + RAPIDJSON_ASSERT(bufferSize >= 4); + Read(); + } + + Ch Peek() const { return *current_; } + Ch Take() { Ch c = *current_; Read(); return c; } + size_t Tell() const { return count_ + static_cast(current_ - buffer_); } + + // Not implemented + void Put(Ch) { RAPIDJSON_ASSERT(false); } + void Flush() { RAPIDJSON_ASSERT(false); } + Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; } + size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; } + + // For encoding detection only. + const Ch* Peek4() const { + return (current_ + 4 <= bufferLast_) ? current_ : 0; + } + +private: + void Read() { + if (current_ < bufferLast_) + ++current_; + else if (!eof_) { + count_ += readCount_; + readCount_ = fread(buffer_, 1, bufferSize_, fp_); + bufferLast_ = buffer_ + readCount_ - 1; + current_ = buffer_; + + if (readCount_ < bufferSize_) { + buffer_[readCount_] = '\0'; + ++bufferLast_; + eof_ = true; + } + } + } + + std::FILE* fp_; + Ch *buffer_; + size_t bufferSize_; + Ch *bufferLast_; + Ch *current_; + size_t readCount_; + size_t count_; //!< Number of characters read + bool eof_; +}; + +RAPIDJSON_NAMESPACE_END + +#ifdef __clang__ +RAPIDJSON_DIAG_POP +#endif + +#endif // RAPIDJSON_FILESTREAM_H_ diff --git a/umd/external/include/rapidjson/filewritestream.h b/umd/external/include/rapidjson/filewritestream.h new file mode 100644 index 00000000..6378dd60 --- /dev/null +++ b/umd/external/include/rapidjson/filewritestream.h @@ -0,0 +1,104 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef RAPIDJSON_FILEWRITESTREAM_H_ +#define RAPIDJSON_FILEWRITESTREAM_H_ + +#include "stream.h" +#include + +#ifdef __clang__ +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(unreachable-code) +#endif + +RAPIDJSON_NAMESPACE_BEGIN + +//! Wrapper of C file stream for input using fread(). +/*! + \note implements Stream concept +*/ +class FileWriteStream { +public: + typedef char Ch; //!< Character type. Only support char. + + FileWriteStream(std::FILE* fp, char* buffer, size_t bufferSize) : fp_(fp), buffer_(buffer), bufferEnd_(buffer + bufferSize), current_(buffer_) { + RAPIDJSON_ASSERT(fp_ != 0); + } + + void Put(char c) { + if (current_ >= bufferEnd_) + Flush(); + + *current_++ = c; + } + + void PutN(char c, size_t n) { + size_t avail = static_cast(bufferEnd_ - current_); + while (n > avail) { + std::memset(current_, c, avail); + current_ += avail; + Flush(); + n -= avail; + avail = static_cast(bufferEnd_ - current_); + } + + if (n > 0) { + std::memset(current_, c, n); + current_ += n; + } + } + + void Flush() { + if (current_ != buffer_) { + size_t result = fwrite(buffer_, 1, static_cast(current_ - buffer_), fp_); + if (result < static_cast(current_ - buffer_)) { + // failure deliberately ignored at this time + // added to avoid warn_unused_result build errors + } + current_ = buffer_; + } + } + + // Not implemented + char Peek() const { RAPIDJSON_ASSERT(false); return 0; } + char Take() { RAPIDJSON_ASSERT(false); return 0; } + size_t Tell() const { RAPIDJSON_ASSERT(false); return 0; } + char* PutBegin() { RAPIDJSON_ASSERT(false); return 0; } + size_t PutEnd(char*) { RAPIDJSON_ASSERT(false); return 0; } + +private: + // Prohibit copy constructor & assignment operator. + FileWriteStream(const FileWriteStream&); + FileWriteStream& operator=(const FileWriteStream&); + + std::FILE* fp_; + char *buffer_; + char *bufferEnd_; + char *current_; +}; + +//! Implement specialized version of PutN() with memset() for better performance. +template<> +inline void PutN(FileWriteStream& stream, char c, size_t n) { + stream.PutN(c, n); +} + +RAPIDJSON_NAMESPACE_END + +#ifdef __clang__ +RAPIDJSON_DIAG_POP +#endif + +#endif // RAPIDJSON_FILESTREAM_H_ diff --git a/umd/external/include/rapidjson/fwd.h b/umd/external/include/rapidjson/fwd.h new file mode 100644 index 00000000..e8104e84 --- /dev/null +++ b/umd/external/include/rapidjson/fwd.h @@ -0,0 +1,151 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef RAPIDJSON_FWD_H_ +#define RAPIDJSON_FWD_H_ + +#include "rapidjson.h" + +RAPIDJSON_NAMESPACE_BEGIN + +// encodings.h + +template struct UTF8; +template struct UTF16; +template struct UTF16BE; +template struct UTF16LE; +template struct UTF32; +template struct UTF32BE; +template struct UTF32LE; +template struct ASCII; +template struct AutoUTF; + +template +struct Transcoder; + +// allocators.h + +class CrtAllocator; + +template +class MemoryPoolAllocator; + +// stream.h + +template +struct GenericStringStream; + +typedef GenericStringStream > StringStream; + +template +struct GenericInsituStringStream; + +typedef GenericInsituStringStream > InsituStringStream; + +// stringbuffer.h + +template +class GenericStringBuffer; + +typedef GenericStringBuffer, CrtAllocator> StringBuffer; + +// filereadstream.h + +class FileReadStream; + +// filewritestream.h + +class FileWriteStream; + +// memorybuffer.h + +template +struct GenericMemoryBuffer; + +typedef GenericMemoryBuffer MemoryBuffer; + +// memorystream.h + +struct MemoryStream; + +// reader.h + +template +struct BaseReaderHandler; + +template +class GenericReader; + +typedef GenericReader, UTF8, CrtAllocator> Reader; + +// writer.h + +template +class Writer; + +// prettywriter.h + +template +class PrettyWriter; + +// document.h + +template +struct GenericMember; + +template +class GenericMemberIterator; + +template +struct GenericStringRef; + +template +class GenericValue; + +typedef GenericValue, MemoryPoolAllocator > Value; + +template +class GenericDocument; + +typedef GenericDocument, MemoryPoolAllocator, CrtAllocator> Document; + +// pointer.h + +template +class GenericPointer; + +typedef GenericPointer Pointer; + +// schema.h + +template +class IGenericRemoteSchemaDocumentProvider; + +template +class GenericSchemaDocument; + +typedef GenericSchemaDocument SchemaDocument; +typedef IGenericRemoteSchemaDocumentProvider IRemoteSchemaDocumentProvider; + +template < + typename SchemaDocumentType, + typename OutputHandler, + typename StateAllocator> +class GenericSchemaValidator; + +typedef GenericSchemaValidator, void>, CrtAllocator> SchemaValidator; + +RAPIDJSON_NAMESPACE_END + +#endif // RAPIDJSON_RAPIDJSONFWD_H_ diff --git a/umd/external/include/rapidjson/internal/biginteger.h b/umd/external/include/rapidjson/internal/biginteger.h new file mode 100644 index 00000000..9d3e88c9 --- /dev/null +++ b/umd/external/include/rapidjson/internal/biginteger.h @@ -0,0 +1,290 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef RAPIDJSON_BIGINTEGER_H_ +#define RAPIDJSON_BIGINTEGER_H_ + +#include "../rapidjson.h" + +#if defined(_MSC_VER) && defined(_M_AMD64) +#include // for _umul128 +#pragma intrinsic(_umul128) +#endif + +RAPIDJSON_NAMESPACE_BEGIN +namespace internal { + +class BigInteger { +public: + typedef uint64_t Type; + + BigInteger(const BigInteger& rhs) : count_(rhs.count_) { + std::memcpy(digits_, rhs.digits_, count_ * sizeof(Type)); + } + + explicit BigInteger(uint64_t u) : count_(1) { + digits_[0] = u; + } + + BigInteger(const char* decimals, size_t length) : count_(1) { + RAPIDJSON_ASSERT(length > 0); + digits_[0] = 0; + size_t i = 0; + const size_t kMaxDigitPerIteration = 19; // 2^64 = 18446744073709551616 > 10^19 + while (length >= kMaxDigitPerIteration) { + AppendDecimal64(decimals + i, decimals + i + kMaxDigitPerIteration); + length -= kMaxDigitPerIteration; + i += kMaxDigitPerIteration; + } + + if (length > 0) + AppendDecimal64(decimals + i, decimals + i + length); + } + + BigInteger& operator=(const BigInteger &rhs) + { + if (this != &rhs) { + count_ = rhs.count_; + std::memcpy(digits_, rhs.digits_, count_ * sizeof(Type)); + } + return *this; + } + + BigInteger& operator=(uint64_t u) { + digits_[0] = u; + count_ = 1; + return *this; + } + + BigInteger& operator+=(uint64_t u) { + Type backup = digits_[0]; + digits_[0] += u; + for (size_t i = 0; i < count_ - 1; i++) { + if (digits_[i] >= backup) + return *this; // no carry + backup = digits_[i + 1]; + digits_[i + 1] += 1; + } + + // Last carry + if (digits_[count_ - 1] < backup) + PushBack(1); + + return *this; + } + + BigInteger& operator*=(uint64_t u) { + if (u == 0) return *this = 0; + if (u == 1) return *this; + if (*this == 1) return *this = u; + + uint64_t k = 0; + for (size_t i = 0; i < count_; i++) { + uint64_t hi; + digits_[i] = MulAdd64(digits_[i], u, k, &hi); + k = hi; + } + + if (k > 0) + PushBack(k); + + return *this; + } + + BigInteger& operator*=(uint32_t u) { + if (u == 0) return *this = 0; + if (u == 1) return *this; + if (*this == 1) return *this = u; + + uint64_t k = 0; + for (size_t i = 0; i < count_; i++) { + const uint64_t c = digits_[i] >> 32; + const uint64_t d = digits_[i] & 0xFFFFFFFF; + const uint64_t uc = u * c; + const uint64_t ud = u * d; + const uint64_t p0 = ud + k; + const uint64_t p1 = uc + (p0 >> 32); + digits_[i] = (p0 & 0xFFFFFFFF) | (p1 << 32); + k = p1 >> 32; + } + + if (k > 0) + PushBack(k); + + return *this; + } + + BigInteger& operator<<=(size_t shift) { + if (IsZero() || shift == 0) return *this; + + size_t offset = shift / kTypeBit; + size_t interShift = shift % kTypeBit; + RAPIDJSON_ASSERT(count_ + offset <= kCapacity); + + if (interShift == 0) { + std::memmove(&digits_[count_ - 1 + offset], &digits_[count_ - 1], count_ * sizeof(Type)); + count_ += offset; + } + else { + digits_[count_] = 0; + for (size_t i = count_; i > 0; i--) + digits_[i + offset] = (digits_[i] << interShift) | (digits_[i - 1] >> (kTypeBit - interShift)); + digits_[offset] = digits_[0] << interShift; + count_ += offset; + if (digits_[count_]) + count_++; + } + + std::memset(digits_, 0, offset * sizeof(Type)); + + return *this; + } + + bool operator==(const BigInteger& rhs) const { + return count_ == rhs.count_ && std::memcmp(digits_, rhs.digits_, count_ * sizeof(Type)) == 0; + } + + bool operator==(const Type rhs) const { + return count_ == 1 && digits_[0] == rhs; + } + + BigInteger& MultiplyPow5(unsigned exp) { + static const uint32_t kPow5[12] = { + 5, + 5 * 5, + 5 * 5 * 5, + 5 * 5 * 5 * 5, + 5 * 5 * 5 * 5 * 5, + 5 * 5 * 5 * 5 * 5 * 5, + 5 * 5 * 5 * 5 * 5 * 5 * 5, + 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5, + 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5, + 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5, + 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5, + 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 + }; + if (exp == 0) return *this; + for (; exp >= 27; exp -= 27) *this *= RAPIDJSON_UINT64_C2(0X6765C793, 0XFA10079D); // 5^27 + for (; exp >= 13; exp -= 13) *this *= static_cast(1220703125u); // 5^13 + if (exp > 0) *this *= kPow5[exp - 1]; + return *this; + } + + // Compute absolute difference of this and rhs. + // Assume this != rhs + bool Difference(const BigInteger& rhs, BigInteger* out) const { + int cmp = Compare(rhs); + RAPIDJSON_ASSERT(cmp != 0); + const BigInteger *a, *b; // Makes a > b + bool ret; + if (cmp < 0) { a = &rhs; b = this; ret = true; } + else { a = this; b = &rhs; ret = false; } + + Type borrow = 0; + for (size_t i = 0; i < a->count_; i++) { + Type d = a->digits_[i] - borrow; + if (i < b->count_) + d -= b->digits_[i]; + borrow = (d > a->digits_[i]) ? 1 : 0; + out->digits_[i] = d; + if (d != 0) + out->count_ = i + 1; + } + + return ret; + } + + int Compare(const BigInteger& rhs) const { + if (count_ != rhs.count_) + return count_ < rhs.count_ ? -1 : 1; + + for (size_t i = count_; i-- > 0;) + if (digits_[i] != rhs.digits_[i]) + return digits_[i] < rhs.digits_[i] ? -1 : 1; + + return 0; + } + + size_t GetCount() const { return count_; } + Type GetDigit(size_t index) const { RAPIDJSON_ASSERT(index < count_); return digits_[index]; } + bool IsZero() const { return count_ == 1 && digits_[0] == 0; } + +private: + void AppendDecimal64(const char* begin, const char* end) { + uint64_t u = ParseUint64(begin, end); + if (IsZero()) + *this = u; + else { + unsigned exp = static_cast(end - begin); + (MultiplyPow5(exp) <<= exp) += u; // *this = *this * 10^exp + u + } + } + + void PushBack(Type digit) { + RAPIDJSON_ASSERT(count_ < kCapacity); + digits_[count_++] = digit; + } + + static uint64_t ParseUint64(const char* begin, const char* end) { + uint64_t r = 0; + for (const char* p = begin; p != end; ++p) { + RAPIDJSON_ASSERT(*p >= '0' && *p <= '9'); + r = r * 10u + static_cast(*p - '0'); + } + return r; + } + + // Assume a * b + k < 2^128 + static uint64_t MulAdd64(uint64_t a, uint64_t b, uint64_t k, uint64_t* outHigh) { +#if defined(_MSC_VER) && defined(_M_AMD64) + uint64_t low = _umul128(a, b, outHigh) + k; + if (low < k) + (*outHigh)++; + return low; +#elif (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) && defined(__x86_64__) + __extension__ typedef unsigned __int128 uint128; + uint128 p = static_cast(a) * static_cast(b); + p += k; + *outHigh = static_cast(p >> 64); + return static_cast(p); +#else + const uint64_t a0 = a & 0xFFFFFFFF, a1 = a >> 32, b0 = b & 0xFFFFFFFF, b1 = b >> 32; + uint64_t x0 = a0 * b0, x1 = a0 * b1, x2 = a1 * b0, x3 = a1 * b1; + x1 += (x0 >> 32); // can't give carry + x1 += x2; + if (x1 < x2) + x3 += (static_cast(1) << 32); + uint64_t lo = (x1 << 32) + (x0 & 0xFFFFFFFF); + uint64_t hi = x3 + (x1 >> 32); + + lo += k; + if (lo < k) + hi++; + *outHigh = hi; + return lo; +#endif + } + + static const size_t kBitCount = 3328; // 64bit * 54 > 10^1000 + static const size_t kCapacity = kBitCount / sizeof(Type); + static const size_t kTypeBit = sizeof(Type) * 8; + + Type digits_[kCapacity]; + size_t count_; +}; + +} // namespace internal +RAPIDJSON_NAMESPACE_END + +#endif // RAPIDJSON_BIGINTEGER_H_ diff --git a/umd/external/include/rapidjson/internal/diyfp.h b/umd/external/include/rapidjson/internal/diyfp.h new file mode 100644 index 00000000..c9fefdc6 --- /dev/null +++ b/umd/external/include/rapidjson/internal/diyfp.h @@ -0,0 +1,258 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +// This is a C++ header-only implementation of Grisu2 algorithm from the publication: +// Loitsch, Florian. "Printing floating-point numbers quickly and accurately with +// integers." ACM Sigplan Notices 45.6 (2010): 233-243. + +#ifndef RAPIDJSON_DIYFP_H_ +#define RAPIDJSON_DIYFP_H_ + +#include "../rapidjson.h" + +#if defined(_MSC_VER) && defined(_M_AMD64) +#include +#pragma intrinsic(_BitScanReverse64) +#pragma intrinsic(_umul128) +#endif + +RAPIDJSON_NAMESPACE_BEGIN +namespace internal { + +#ifdef __GNUC__ +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(effc++) +#endif + +#ifdef __clang__ +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(padded) +#endif + +struct DiyFp { + DiyFp() : f(), e() {} + + DiyFp(uint64_t fp, int exp) : f(fp), e(exp) {} + + explicit DiyFp(double d) { + union { + double d; + uint64_t u64; + } u = { d }; + + int biased_e = static_cast((u.u64 & kDpExponentMask) >> kDpSignificandSize); + uint64_t significand = (u.u64 & kDpSignificandMask); + if (biased_e != 0) { + f = significand + kDpHiddenBit; + e = biased_e - kDpExponentBias; + } + else { + f = significand; + e = kDpMinExponent + 1; + } + } + + DiyFp operator-(const DiyFp& rhs) const { + return DiyFp(f - rhs.f, e); + } + + DiyFp operator*(const DiyFp& rhs) const { +#if defined(_MSC_VER) && defined(_M_AMD64) + uint64_t h; + uint64_t l = _umul128(f, rhs.f, &h); + if (l & (uint64_t(1) << 63)) // rounding + h++; + return DiyFp(h, e + rhs.e + 64); +#elif (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) && defined(__x86_64__) + __extension__ typedef unsigned __int128 uint128; + uint128 p = static_cast(f) * static_cast(rhs.f); + uint64_t h = static_cast(p >> 64); + uint64_t l = static_cast(p); + if (l & (uint64_t(1) << 63)) // rounding + h++; + return DiyFp(h, e + rhs.e + 64); +#else + const uint64_t M32 = 0xFFFFFFFF; + const uint64_t a = f >> 32; + const uint64_t b = f & M32; + const uint64_t c = rhs.f >> 32; + const uint64_t d = rhs.f & M32; + const uint64_t ac = a * c; + const uint64_t bc = b * c; + const uint64_t ad = a * d; + const uint64_t bd = b * d; + uint64_t tmp = (bd >> 32) + (ad & M32) + (bc & M32); + tmp += 1U << 31; /// mult_round + return DiyFp(ac + (ad >> 32) + (bc >> 32) + (tmp >> 32), e + rhs.e + 64); +#endif + } + + DiyFp Normalize() const { +#if defined(_MSC_VER) && defined(_M_AMD64) + unsigned long index; + _BitScanReverse64(&index, f); + return DiyFp(f << (63 - index), e - (63 - index)); +#elif defined(__GNUC__) && __GNUC__ >= 4 + int s = __builtin_clzll(f); + return DiyFp(f << s, e - s); +#else + DiyFp res = *this; + while (!(res.f & (static_cast(1) << 63))) { + res.f <<= 1; + res.e--; + } + return res; +#endif + } + + DiyFp NormalizeBoundary() const { + DiyFp res = *this; + while (!(res.f & (kDpHiddenBit << 1))) { + res.f <<= 1; + res.e--; + } + res.f <<= (kDiySignificandSize - kDpSignificandSize - 2); + res.e = res.e - (kDiySignificandSize - kDpSignificandSize - 2); + return res; + } + + void NormalizedBoundaries(DiyFp* minus, DiyFp* plus) const { + DiyFp pl = DiyFp((f << 1) + 1, e - 1).NormalizeBoundary(); + DiyFp mi = (f == kDpHiddenBit) ? DiyFp((f << 2) - 1, e - 2) : DiyFp((f << 1) - 1, e - 1); + mi.f <<= mi.e - pl.e; + mi.e = pl.e; + *plus = pl; + *minus = mi; + } + + double ToDouble() const { + union { + double d; + uint64_t u64; + }u; + const uint64_t be = (e == kDpDenormalExponent && (f & kDpHiddenBit) == 0) ? 0 : + static_cast(e + kDpExponentBias); + u.u64 = (f & kDpSignificandMask) | (be << kDpSignificandSize); + return u.d; + } + + static const int kDiySignificandSize = 64; + static const int kDpSignificandSize = 52; + static const int kDpExponentBias = 0x3FF + kDpSignificandSize; + static const int kDpMaxExponent = 0x7FF - kDpExponentBias; + static const int kDpMinExponent = -kDpExponentBias; + static const int kDpDenormalExponent = -kDpExponentBias + 1; + static const uint64_t kDpExponentMask = RAPIDJSON_UINT64_C2(0x7FF00000, 0x00000000); + static const uint64_t kDpSignificandMask = RAPIDJSON_UINT64_C2(0x000FFFFF, 0xFFFFFFFF); + static const uint64_t kDpHiddenBit = RAPIDJSON_UINT64_C2(0x00100000, 0x00000000); + + uint64_t f; + int e; +}; + +inline DiyFp GetCachedPowerByIndex(size_t index) { + // 10^-348, 10^-340, ..., 10^340 + static const uint64_t kCachedPowers_F[] = { + RAPIDJSON_UINT64_C2(0xfa8fd5a0, 0x081c0288), RAPIDJSON_UINT64_C2(0xbaaee17f, 0xa23ebf76), + RAPIDJSON_UINT64_C2(0x8b16fb20, 0x3055ac76), RAPIDJSON_UINT64_C2(0xcf42894a, 0x5dce35ea), + RAPIDJSON_UINT64_C2(0x9a6bb0aa, 0x55653b2d), RAPIDJSON_UINT64_C2(0xe61acf03, 0x3d1a45df), + RAPIDJSON_UINT64_C2(0xab70fe17, 0xc79ac6ca), RAPIDJSON_UINT64_C2(0xff77b1fc, 0xbebcdc4f), + RAPIDJSON_UINT64_C2(0xbe5691ef, 0x416bd60c), RAPIDJSON_UINT64_C2(0x8dd01fad, 0x907ffc3c), + RAPIDJSON_UINT64_C2(0xd3515c28, 0x31559a83), RAPIDJSON_UINT64_C2(0x9d71ac8f, 0xada6c9b5), + RAPIDJSON_UINT64_C2(0xea9c2277, 0x23ee8bcb), RAPIDJSON_UINT64_C2(0xaecc4991, 0x4078536d), + RAPIDJSON_UINT64_C2(0x823c1279, 0x5db6ce57), RAPIDJSON_UINT64_C2(0xc2109436, 0x4dfb5637), + RAPIDJSON_UINT64_C2(0x9096ea6f, 0x3848984f), RAPIDJSON_UINT64_C2(0xd77485cb, 0x25823ac7), + RAPIDJSON_UINT64_C2(0xa086cfcd, 0x97bf97f4), RAPIDJSON_UINT64_C2(0xef340a98, 0x172aace5), + RAPIDJSON_UINT64_C2(0xb23867fb, 0x2a35b28e), RAPIDJSON_UINT64_C2(0x84c8d4df, 0xd2c63f3b), + RAPIDJSON_UINT64_C2(0xc5dd4427, 0x1ad3cdba), RAPIDJSON_UINT64_C2(0x936b9fce, 0xbb25c996), + RAPIDJSON_UINT64_C2(0xdbac6c24, 0x7d62a584), RAPIDJSON_UINT64_C2(0xa3ab6658, 0x0d5fdaf6), + RAPIDJSON_UINT64_C2(0xf3e2f893, 0xdec3f126), RAPIDJSON_UINT64_C2(0xb5b5ada8, 0xaaff80b8), + RAPIDJSON_UINT64_C2(0x87625f05, 0x6c7c4a8b), RAPIDJSON_UINT64_C2(0xc9bcff60, 0x34c13053), + RAPIDJSON_UINT64_C2(0x964e858c, 0x91ba2655), RAPIDJSON_UINT64_C2(0xdff97724, 0x70297ebd), + RAPIDJSON_UINT64_C2(0xa6dfbd9f, 0xb8e5b88f), RAPIDJSON_UINT64_C2(0xf8a95fcf, 0x88747d94), + RAPIDJSON_UINT64_C2(0xb9447093, 0x8fa89bcf), RAPIDJSON_UINT64_C2(0x8a08f0f8, 0xbf0f156b), + RAPIDJSON_UINT64_C2(0xcdb02555, 0x653131b6), RAPIDJSON_UINT64_C2(0x993fe2c6, 0xd07b7fac), + RAPIDJSON_UINT64_C2(0xe45c10c4, 0x2a2b3b06), RAPIDJSON_UINT64_C2(0xaa242499, 0x697392d3), + RAPIDJSON_UINT64_C2(0xfd87b5f2, 0x8300ca0e), RAPIDJSON_UINT64_C2(0xbce50864, 0x92111aeb), + RAPIDJSON_UINT64_C2(0x8cbccc09, 0x6f5088cc), RAPIDJSON_UINT64_C2(0xd1b71758, 0xe219652c), + RAPIDJSON_UINT64_C2(0x9c400000, 0x00000000), RAPIDJSON_UINT64_C2(0xe8d4a510, 0x00000000), + RAPIDJSON_UINT64_C2(0xad78ebc5, 0xac620000), RAPIDJSON_UINT64_C2(0x813f3978, 0xf8940984), + RAPIDJSON_UINT64_C2(0xc097ce7b, 0xc90715b3), RAPIDJSON_UINT64_C2(0x8f7e32ce, 0x7bea5c70), + RAPIDJSON_UINT64_C2(0xd5d238a4, 0xabe98068), RAPIDJSON_UINT64_C2(0x9f4f2726, 0x179a2245), + RAPIDJSON_UINT64_C2(0xed63a231, 0xd4c4fb27), RAPIDJSON_UINT64_C2(0xb0de6538, 0x8cc8ada8), + RAPIDJSON_UINT64_C2(0x83c7088e, 0x1aab65db), RAPIDJSON_UINT64_C2(0xc45d1df9, 0x42711d9a), + RAPIDJSON_UINT64_C2(0x924d692c, 0xa61be758), RAPIDJSON_UINT64_C2(0xda01ee64, 0x1a708dea), + RAPIDJSON_UINT64_C2(0xa26da399, 0x9aef774a), RAPIDJSON_UINT64_C2(0xf209787b, 0xb47d6b85), + RAPIDJSON_UINT64_C2(0xb454e4a1, 0x79dd1877), RAPIDJSON_UINT64_C2(0x865b8692, 0x5b9bc5c2), + RAPIDJSON_UINT64_C2(0xc83553c5, 0xc8965d3d), RAPIDJSON_UINT64_C2(0x952ab45c, 0xfa97a0b3), + RAPIDJSON_UINT64_C2(0xde469fbd, 0x99a05fe3), RAPIDJSON_UINT64_C2(0xa59bc234, 0xdb398c25), + RAPIDJSON_UINT64_C2(0xf6c69a72, 0xa3989f5c), RAPIDJSON_UINT64_C2(0xb7dcbf53, 0x54e9bece), + RAPIDJSON_UINT64_C2(0x88fcf317, 0xf22241e2), RAPIDJSON_UINT64_C2(0xcc20ce9b, 0xd35c78a5), + RAPIDJSON_UINT64_C2(0x98165af3, 0x7b2153df), RAPIDJSON_UINT64_C2(0xe2a0b5dc, 0x971f303a), + RAPIDJSON_UINT64_C2(0xa8d9d153, 0x5ce3b396), RAPIDJSON_UINT64_C2(0xfb9b7cd9, 0xa4a7443c), + RAPIDJSON_UINT64_C2(0xbb764c4c, 0xa7a44410), RAPIDJSON_UINT64_C2(0x8bab8eef, 0xb6409c1a), + RAPIDJSON_UINT64_C2(0xd01fef10, 0xa657842c), RAPIDJSON_UINT64_C2(0x9b10a4e5, 0xe9913129), + RAPIDJSON_UINT64_C2(0xe7109bfb, 0xa19c0c9d), RAPIDJSON_UINT64_C2(0xac2820d9, 0x623bf429), + RAPIDJSON_UINT64_C2(0x80444b5e, 0x7aa7cf85), RAPIDJSON_UINT64_C2(0xbf21e440, 0x03acdd2d), + RAPIDJSON_UINT64_C2(0x8e679c2f, 0x5e44ff8f), RAPIDJSON_UINT64_C2(0xd433179d, 0x9c8cb841), + RAPIDJSON_UINT64_C2(0x9e19db92, 0xb4e31ba9), RAPIDJSON_UINT64_C2(0xeb96bf6e, 0xbadf77d9), + RAPIDJSON_UINT64_C2(0xaf87023b, 0x9bf0ee6b) + }; + static const int16_t kCachedPowers_E[] = { + -1220, -1193, -1166, -1140, -1113, -1087, -1060, -1034, -1007, -980, + -954, -927, -901, -874, -847, -821, -794, -768, -741, -715, + -688, -661, -635, -608, -582, -555, -529, -502, -475, -449, + -422, -396, -369, -343, -316, -289, -263, -236, -210, -183, + -157, -130, -103, -77, -50, -24, 3, 30, 56, 83, + 109, 136, 162, 189, 216, 242, 269, 295, 322, 348, + 375, 402, 428, 455, 481, 508, 534, 561, 588, 614, + 641, 667, 694, 720, 747, 774, 800, 827, 853, 880, + 907, 933, 960, 986, 1013, 1039, 1066 + }; + return DiyFp(kCachedPowers_F[index], kCachedPowers_E[index]); +} + +inline DiyFp GetCachedPower(int e, int* K) { + + //int k = static_cast(ceil((-61 - e) * 0.30102999566398114)) + 374; + double dk = (-61 - e) * 0.30102999566398114 + 347; // dk must be positive, so can do ceiling in positive + int k = static_cast(dk); + if (dk - k > 0.0) + k++; + + unsigned index = static_cast((k >> 3) + 1); + *K = -(-348 + static_cast(index << 3)); // decimal exponent no need lookup table + + return GetCachedPowerByIndex(index); +} + +inline DiyFp GetCachedPower10(int exp, int *outExp) { + unsigned index = (static_cast(exp) + 348u) / 8u; + *outExp = -348 + static_cast(index) * 8; + return GetCachedPowerByIndex(index); + } + +#ifdef __GNUC__ +RAPIDJSON_DIAG_POP +#endif + +#ifdef __clang__ +RAPIDJSON_DIAG_POP +RAPIDJSON_DIAG_OFF(padded) +#endif + +} // namespace internal +RAPIDJSON_NAMESPACE_END + +#endif // RAPIDJSON_DIYFP_H_ diff --git a/umd/external/include/rapidjson/internal/dtoa.h b/umd/external/include/rapidjson/internal/dtoa.h new file mode 100644 index 00000000..bf2e9b2e --- /dev/null +++ b/umd/external/include/rapidjson/internal/dtoa.h @@ -0,0 +1,245 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +// This is a C++ header-only implementation of Grisu2 algorithm from the publication: +// Loitsch, Florian. "Printing floating-point numbers quickly and accurately with +// integers." ACM Sigplan Notices 45.6 (2010): 233-243. + +#ifndef RAPIDJSON_DTOA_ +#define RAPIDJSON_DTOA_ + +#include "itoa.h" // GetDigitsLut() +#include "diyfp.h" +#include "ieee754.h" + +RAPIDJSON_NAMESPACE_BEGIN +namespace internal { + +#ifdef __GNUC__ +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(effc++) +RAPIDJSON_DIAG_OFF(array-bounds) // some gcc versions generate wrong warnings https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59124 +#endif + +inline void GrisuRound(char* buffer, int len, uint64_t delta, uint64_t rest, uint64_t ten_kappa, uint64_t wp_w) { + while (rest < wp_w && delta - rest >= ten_kappa && + (rest + ten_kappa < wp_w || /// closer + wp_w - rest > rest + ten_kappa - wp_w)) { + buffer[len - 1]--; + rest += ten_kappa; + } +} + +inline int CountDecimalDigit32(uint32_t n) { + // Simple pure C++ implementation was faster than __builtin_clz version in this situation. + if (n < 10) return 1; + if (n < 100) return 2; + if (n < 1000) return 3; + if (n < 10000) return 4; + if (n < 100000) return 5; + if (n < 1000000) return 6; + if (n < 10000000) return 7; + if (n < 100000000) return 8; + // Will not reach 10 digits in DigitGen() + //if (n < 1000000000) return 9; + //return 10; + return 9; +} + +inline void DigitGen(const DiyFp& W, const DiyFp& Mp, uint64_t delta, char* buffer, int* len, int* K) { + static const uint32_t kPow10[] = { 1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000 }; + const DiyFp one(uint64_t(1) << -Mp.e, Mp.e); + const DiyFp wp_w = Mp - W; + uint32_t p1 = static_cast(Mp.f >> -one.e); + uint64_t p2 = Mp.f & (one.f - 1); + int kappa = CountDecimalDigit32(p1); // kappa in [0, 9] + *len = 0; + + while (kappa > 0) { + uint32_t d = 0; + switch (kappa) { + case 9: d = p1 / 100000000; p1 %= 100000000; break; + case 8: d = p1 / 10000000; p1 %= 10000000; break; + case 7: d = p1 / 1000000; p1 %= 1000000; break; + case 6: d = p1 / 100000; p1 %= 100000; break; + case 5: d = p1 / 10000; p1 %= 10000; break; + case 4: d = p1 / 1000; p1 %= 1000; break; + case 3: d = p1 / 100; p1 %= 100; break; + case 2: d = p1 / 10; p1 %= 10; break; + case 1: d = p1; p1 = 0; break; + default:; + } + if (d || *len) + buffer[(*len)++] = static_cast('0' + static_cast(d)); + kappa--; + uint64_t tmp = (static_cast(p1) << -one.e) + p2; + if (tmp <= delta) { + *K += kappa; + GrisuRound(buffer, *len, delta, tmp, static_cast(kPow10[kappa]) << -one.e, wp_w.f); + return; + } + } + + // kappa = 0 + for (;;) { + p2 *= 10; + delta *= 10; + char d = static_cast(p2 >> -one.e); + if (d || *len) + buffer[(*len)++] = static_cast('0' + d); + p2 &= one.f - 1; + kappa--; + if (p2 < delta) { + *K += kappa; + int index = -kappa; + GrisuRound(buffer, *len, delta, p2, one.f, wp_w.f * (index < 9 ? kPow10[index] : 0)); + return; + } + } +} + +inline void Grisu2(double value, char* buffer, int* length, int* K) { + const DiyFp v(value); + DiyFp w_m, w_p; + v.NormalizedBoundaries(&w_m, &w_p); + + const DiyFp c_mk = GetCachedPower(w_p.e, K); + const DiyFp W = v.Normalize() * c_mk; + DiyFp Wp = w_p * c_mk; + DiyFp Wm = w_m * c_mk; + Wm.f++; + Wp.f--; + DigitGen(W, Wp, Wp.f - Wm.f, buffer, length, K); +} + +inline char* WriteExponent(int K, char* buffer) { + if (K < 0) { + *buffer++ = '-'; + K = -K; + } + + if (K >= 100) { + *buffer++ = static_cast('0' + static_cast(K / 100)); + K %= 100; + const char* d = GetDigitsLut() + K * 2; + *buffer++ = d[0]; + *buffer++ = d[1]; + } + else if (K >= 10) { + const char* d = GetDigitsLut() + K * 2; + *buffer++ = d[0]; + *buffer++ = d[1]; + } + else + *buffer++ = static_cast('0' + static_cast(K)); + + return buffer; +} + +inline char* Prettify(char* buffer, int length, int k, int maxDecimalPlaces) { + const int kk = length + k; // 10^(kk-1) <= v < 10^kk + + if (0 <= k && kk <= 21) { + // 1234e7 -> 12340000000 + for (int i = length; i < kk; i++) + buffer[i] = '0'; + buffer[kk] = '.'; + buffer[kk + 1] = '0'; + return &buffer[kk + 2]; + } + else if (0 < kk && kk <= 21) { + // 1234e-2 -> 12.34 + std::memmove(&buffer[kk + 1], &buffer[kk], static_cast(length - kk)); + buffer[kk] = '.'; + if (0 > k + maxDecimalPlaces) { + // When maxDecimalPlaces = 2, 1.2345 -> 1.23, 1.102 -> 1.1 + // Remove extra trailing zeros (at least one) after truncation. + for (int i = kk + maxDecimalPlaces; i > kk + 1; i--) + if (buffer[i] != '0') + return &buffer[i + 1]; + return &buffer[kk + 2]; // Reserve one zero + } + else + return &buffer[length + 1]; + } + else if (-6 < kk && kk <= 0) { + // 1234e-6 -> 0.001234 + const int offset = 2 - kk; + std::memmove(&buffer[offset], &buffer[0], static_cast(length)); + buffer[0] = '0'; + buffer[1] = '.'; + for (int i = 2; i < offset; i++) + buffer[i] = '0'; + if (length - kk > maxDecimalPlaces) { + // When maxDecimalPlaces = 2, 0.123 -> 0.12, 0.102 -> 0.1 + // Remove extra trailing zeros (at least one) after truncation. + for (int i = maxDecimalPlaces + 1; i > 2; i--) + if (buffer[i] != '0') + return &buffer[i + 1]; + return &buffer[3]; // Reserve one zero + } + else + return &buffer[length + offset]; + } + else if (kk < -maxDecimalPlaces) { + // Truncate to zero + buffer[0] = '0'; + buffer[1] = '.'; + buffer[2] = '0'; + return &buffer[3]; + } + else if (length == 1) { + // 1e30 + buffer[1] = 'e'; + return WriteExponent(kk - 1, &buffer[2]); + } + else { + // 1234e30 -> 1.234e33 + std::memmove(&buffer[2], &buffer[1], static_cast(length - 1)); + buffer[1] = '.'; + buffer[length + 1] = 'e'; + return WriteExponent(kk - 1, &buffer[0 + length + 2]); + } +} + +inline char* dtoa(double value, char* buffer, int maxDecimalPlaces = 324) { + RAPIDJSON_ASSERT(maxDecimalPlaces >= 1); + Double d(value); + if (d.IsZero()) { + if (d.Sign()) + *buffer++ = '-'; // -0.0, Issue #289 + buffer[0] = '0'; + buffer[1] = '.'; + buffer[2] = '0'; + return &buffer[3]; + } + else { + if (value < 0) { + *buffer++ = '-'; + value = -value; + } + int length, K; + Grisu2(value, buffer, &length, &K); + return Prettify(buffer, length, K, maxDecimalPlaces); + } +} + +#ifdef __GNUC__ +RAPIDJSON_DIAG_POP +#endif + +} // namespace internal +RAPIDJSON_NAMESPACE_END + +#endif // RAPIDJSON_DTOA_ diff --git a/umd/external/include/rapidjson/internal/ieee754.h b/umd/external/include/rapidjson/internal/ieee754.h new file mode 100644 index 00000000..c2684ba2 --- /dev/null +++ b/umd/external/include/rapidjson/internal/ieee754.h @@ -0,0 +1,78 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef RAPIDJSON_IEEE754_ +#define RAPIDJSON_IEEE754_ + +#include "../rapidjson.h" + +RAPIDJSON_NAMESPACE_BEGIN +namespace internal { + +class Double { +public: + Double() {} + Double(double d) : d_(d) {} + Double(uint64_t u) : u_(u) {} + + double Value() const { return d_; } + uint64_t Uint64Value() const { return u_; } + + double NextPositiveDouble() const { + RAPIDJSON_ASSERT(!Sign()); + return Double(u_ + 1).Value(); + } + + bool Sign() const { return (u_ & kSignMask) != 0; } + uint64_t Significand() const { return u_ & kSignificandMask; } + int Exponent() const { return static_cast(((u_ & kExponentMask) >> kSignificandSize) - kExponentBias); } + + bool IsNan() const { return (u_ & kExponentMask) == kExponentMask && Significand() != 0; } + bool IsInf() const { return (u_ & kExponentMask) == kExponentMask && Significand() == 0; } + bool IsNanOrInf() const { return (u_ & kExponentMask) == kExponentMask; } + bool IsNormal() const { return (u_ & kExponentMask) != 0 || Significand() == 0; } + bool IsZero() const { return (u_ & (kExponentMask | kSignificandMask)) == 0; } + + uint64_t IntegerSignificand() const { return IsNormal() ? Significand() | kHiddenBit : Significand(); } + int IntegerExponent() const { return (IsNormal() ? Exponent() : kDenormalExponent) - kSignificandSize; } + uint64_t ToBias() const { return (u_ & kSignMask) ? ~u_ + 1 : u_ | kSignMask; } + + static int EffectiveSignificandSize(int order) { + if (order >= -1021) + return 53; + else if (order <= -1074) + return 0; + else + return order + 1074; + } + +private: + static const int kSignificandSize = 52; + static const int kExponentBias = 0x3FF; + static const int kDenormalExponent = 1 - kExponentBias; + static const uint64_t kSignMask = RAPIDJSON_UINT64_C2(0x80000000, 0x00000000); + static const uint64_t kExponentMask = RAPIDJSON_UINT64_C2(0x7FF00000, 0x00000000); + static const uint64_t kSignificandMask = RAPIDJSON_UINT64_C2(0x000FFFFF, 0xFFFFFFFF); + static const uint64_t kHiddenBit = RAPIDJSON_UINT64_C2(0x00100000, 0x00000000); + + union { + double d_; + uint64_t u_; + }; +}; + +} // namespace internal +RAPIDJSON_NAMESPACE_END + +#endif // RAPIDJSON_IEEE754_ diff --git a/umd/external/include/rapidjson/internal/itoa.h b/umd/external/include/rapidjson/internal/itoa.h new file mode 100644 index 00000000..01a4e7e7 --- /dev/null +++ b/umd/external/include/rapidjson/internal/itoa.h @@ -0,0 +1,304 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef RAPIDJSON_ITOA_ +#define RAPIDJSON_ITOA_ + +#include "../rapidjson.h" + +RAPIDJSON_NAMESPACE_BEGIN +namespace internal { + +inline const char* GetDigitsLut() { + static const char cDigitsLut[200] = { + '0','0','0','1','0','2','0','3','0','4','0','5','0','6','0','7','0','8','0','9', + '1','0','1','1','1','2','1','3','1','4','1','5','1','6','1','7','1','8','1','9', + '2','0','2','1','2','2','2','3','2','4','2','5','2','6','2','7','2','8','2','9', + '3','0','3','1','3','2','3','3','3','4','3','5','3','6','3','7','3','8','3','9', + '4','0','4','1','4','2','4','3','4','4','4','5','4','6','4','7','4','8','4','9', + '5','0','5','1','5','2','5','3','5','4','5','5','5','6','5','7','5','8','5','9', + '6','0','6','1','6','2','6','3','6','4','6','5','6','6','6','7','6','8','6','9', + '7','0','7','1','7','2','7','3','7','4','7','5','7','6','7','7','7','8','7','9', + '8','0','8','1','8','2','8','3','8','4','8','5','8','6','8','7','8','8','8','9', + '9','0','9','1','9','2','9','3','9','4','9','5','9','6','9','7','9','8','9','9' + }; + return cDigitsLut; +} + +inline char* u32toa(uint32_t value, char* buffer) { + const char* cDigitsLut = GetDigitsLut(); + + if (value < 10000) { + const uint32_t d1 = (value / 100) << 1; + const uint32_t d2 = (value % 100) << 1; + + if (value >= 1000) + *buffer++ = cDigitsLut[d1]; + if (value >= 100) + *buffer++ = cDigitsLut[d1 + 1]; + if (value >= 10) + *buffer++ = cDigitsLut[d2]; + *buffer++ = cDigitsLut[d2 + 1]; + } + else if (value < 100000000) { + // value = bbbbcccc + const uint32_t b = value / 10000; + const uint32_t c = value % 10000; + + const uint32_t d1 = (b / 100) << 1; + const uint32_t d2 = (b % 100) << 1; + + const uint32_t d3 = (c / 100) << 1; + const uint32_t d4 = (c % 100) << 1; + + if (value >= 10000000) + *buffer++ = cDigitsLut[d1]; + if (value >= 1000000) + *buffer++ = cDigitsLut[d1 + 1]; + if (value >= 100000) + *buffer++ = cDigitsLut[d2]; + *buffer++ = cDigitsLut[d2 + 1]; + + *buffer++ = cDigitsLut[d3]; + *buffer++ = cDigitsLut[d3 + 1]; + *buffer++ = cDigitsLut[d4]; + *buffer++ = cDigitsLut[d4 + 1]; + } + else { + // value = aabbbbcccc in decimal + + const uint32_t a = value / 100000000; // 1 to 42 + value %= 100000000; + + if (a >= 10) { + const unsigned i = a << 1; + *buffer++ = cDigitsLut[i]; + *buffer++ = cDigitsLut[i + 1]; + } + else + *buffer++ = static_cast('0' + static_cast(a)); + + const uint32_t b = value / 10000; // 0 to 9999 + const uint32_t c = value % 10000; // 0 to 9999 + + const uint32_t d1 = (b / 100) << 1; + const uint32_t d2 = (b % 100) << 1; + + const uint32_t d3 = (c / 100) << 1; + const uint32_t d4 = (c % 100) << 1; + + *buffer++ = cDigitsLut[d1]; + *buffer++ = cDigitsLut[d1 + 1]; + *buffer++ = cDigitsLut[d2]; + *buffer++ = cDigitsLut[d2 + 1]; + *buffer++ = cDigitsLut[d3]; + *buffer++ = cDigitsLut[d3 + 1]; + *buffer++ = cDigitsLut[d4]; + *buffer++ = cDigitsLut[d4 + 1]; + } + return buffer; +} + +inline char* i32toa(int32_t value, char* buffer) { + uint32_t u = static_cast(value); + if (value < 0) { + *buffer++ = '-'; + u = ~u + 1; + } + + return u32toa(u, buffer); +} + +inline char* u64toa(uint64_t value, char* buffer) { + const char* cDigitsLut = GetDigitsLut(); + const uint64_t kTen8 = 100000000; + const uint64_t kTen9 = kTen8 * 10; + const uint64_t kTen10 = kTen8 * 100; + const uint64_t kTen11 = kTen8 * 1000; + const uint64_t kTen12 = kTen8 * 10000; + const uint64_t kTen13 = kTen8 * 100000; + const uint64_t kTen14 = kTen8 * 1000000; + const uint64_t kTen15 = kTen8 * 10000000; + const uint64_t kTen16 = kTen8 * kTen8; + + if (value < kTen8) { + uint32_t v = static_cast(value); + if (v < 10000) { + const uint32_t d1 = (v / 100) << 1; + const uint32_t d2 = (v % 100) << 1; + + if (v >= 1000) + *buffer++ = cDigitsLut[d1]; + if (v >= 100) + *buffer++ = cDigitsLut[d1 + 1]; + if (v >= 10) + *buffer++ = cDigitsLut[d2]; + *buffer++ = cDigitsLut[d2 + 1]; + } + else { + // value = bbbbcccc + const uint32_t b = v / 10000; + const uint32_t c = v % 10000; + + const uint32_t d1 = (b / 100) << 1; + const uint32_t d2 = (b % 100) << 1; + + const uint32_t d3 = (c / 100) << 1; + const uint32_t d4 = (c % 100) << 1; + + if (value >= 10000000) + *buffer++ = cDigitsLut[d1]; + if (value >= 1000000) + *buffer++ = cDigitsLut[d1 + 1]; + if (value >= 100000) + *buffer++ = cDigitsLut[d2]; + *buffer++ = cDigitsLut[d2 + 1]; + + *buffer++ = cDigitsLut[d3]; + *buffer++ = cDigitsLut[d3 + 1]; + *buffer++ = cDigitsLut[d4]; + *buffer++ = cDigitsLut[d4 + 1]; + } + } + else if (value < kTen16) { + const uint32_t v0 = static_cast(value / kTen8); + const uint32_t v1 = static_cast(value % kTen8); + + const uint32_t b0 = v0 / 10000; + const uint32_t c0 = v0 % 10000; + + const uint32_t d1 = (b0 / 100) << 1; + const uint32_t d2 = (b0 % 100) << 1; + + const uint32_t d3 = (c0 / 100) << 1; + const uint32_t d4 = (c0 % 100) << 1; + + const uint32_t b1 = v1 / 10000; + const uint32_t c1 = v1 % 10000; + + const uint32_t d5 = (b1 / 100) << 1; + const uint32_t d6 = (b1 % 100) << 1; + + const uint32_t d7 = (c1 / 100) << 1; + const uint32_t d8 = (c1 % 100) << 1; + + if (value >= kTen15) + *buffer++ = cDigitsLut[d1]; + if (value >= kTen14) + *buffer++ = cDigitsLut[d1 + 1]; + if (value >= kTen13) + *buffer++ = cDigitsLut[d2]; + if (value >= kTen12) + *buffer++ = cDigitsLut[d2 + 1]; + if (value >= kTen11) + *buffer++ = cDigitsLut[d3]; + if (value >= kTen10) + *buffer++ = cDigitsLut[d3 + 1]; + if (value >= kTen9) + *buffer++ = cDigitsLut[d4]; + if (value >= kTen8) + *buffer++ = cDigitsLut[d4 + 1]; + + *buffer++ = cDigitsLut[d5]; + *buffer++ = cDigitsLut[d5 + 1]; + *buffer++ = cDigitsLut[d6]; + *buffer++ = cDigitsLut[d6 + 1]; + *buffer++ = cDigitsLut[d7]; + *buffer++ = cDigitsLut[d7 + 1]; + *buffer++ = cDigitsLut[d8]; + *buffer++ = cDigitsLut[d8 + 1]; + } + else { + const uint32_t a = static_cast(value / kTen16); // 1 to 1844 + value %= kTen16; + + if (a < 10) + *buffer++ = static_cast('0' + static_cast(a)); + else if (a < 100) { + const uint32_t i = a << 1; + *buffer++ = cDigitsLut[i]; + *buffer++ = cDigitsLut[i + 1]; + } + else if (a < 1000) { + *buffer++ = static_cast('0' + static_cast(a / 100)); + + const uint32_t i = (a % 100) << 1; + *buffer++ = cDigitsLut[i]; + *buffer++ = cDigitsLut[i + 1]; + } + else { + const uint32_t i = (a / 100) << 1; + const uint32_t j = (a % 100) << 1; + *buffer++ = cDigitsLut[i]; + *buffer++ = cDigitsLut[i + 1]; + *buffer++ = cDigitsLut[j]; + *buffer++ = cDigitsLut[j + 1]; + } + + const uint32_t v0 = static_cast(value / kTen8); + const uint32_t v1 = static_cast(value % kTen8); + + const uint32_t b0 = v0 / 10000; + const uint32_t c0 = v0 % 10000; + + const uint32_t d1 = (b0 / 100) << 1; + const uint32_t d2 = (b0 % 100) << 1; + + const uint32_t d3 = (c0 / 100) << 1; + const uint32_t d4 = (c0 % 100) << 1; + + const uint32_t b1 = v1 / 10000; + const uint32_t c1 = v1 % 10000; + + const uint32_t d5 = (b1 / 100) << 1; + const uint32_t d6 = (b1 % 100) << 1; + + const uint32_t d7 = (c1 / 100) << 1; + const uint32_t d8 = (c1 % 100) << 1; + + *buffer++ = cDigitsLut[d1]; + *buffer++ = cDigitsLut[d1 + 1]; + *buffer++ = cDigitsLut[d2]; + *buffer++ = cDigitsLut[d2 + 1]; + *buffer++ = cDigitsLut[d3]; + *buffer++ = cDigitsLut[d3 + 1]; + *buffer++ = cDigitsLut[d4]; + *buffer++ = cDigitsLut[d4 + 1]; + *buffer++ = cDigitsLut[d5]; + *buffer++ = cDigitsLut[d5 + 1]; + *buffer++ = cDigitsLut[d6]; + *buffer++ = cDigitsLut[d6 + 1]; + *buffer++ = cDigitsLut[d7]; + *buffer++ = cDigitsLut[d7 + 1]; + *buffer++ = cDigitsLut[d8]; + *buffer++ = cDigitsLut[d8 + 1]; + } + + return buffer; +} + +inline char* i64toa(int64_t value, char* buffer) { + uint64_t u = static_cast(value); + if (value < 0) { + *buffer++ = '-'; + u = ~u + 1; + } + + return u64toa(u, buffer); +} + +} // namespace internal +RAPIDJSON_NAMESPACE_END + +#endif // RAPIDJSON_ITOA_ diff --git a/umd/external/include/rapidjson/internal/meta.h b/umd/external/include/rapidjson/internal/meta.h new file mode 100644 index 00000000..5a9aaa42 --- /dev/null +++ b/umd/external/include/rapidjson/internal/meta.h @@ -0,0 +1,181 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef RAPIDJSON_INTERNAL_META_H_ +#define RAPIDJSON_INTERNAL_META_H_ + +#include "../rapidjson.h" + +#ifdef __GNUC__ +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(effc++) +#endif +#if defined(_MSC_VER) +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(6334) +#endif + +#if RAPIDJSON_HAS_CXX11_TYPETRAITS +#include +#endif + +//@cond RAPIDJSON_INTERNAL +RAPIDJSON_NAMESPACE_BEGIN +namespace internal { + +// Helper to wrap/convert arbitrary types to void, useful for arbitrary type matching +template struct Void { typedef void Type; }; + +/////////////////////////////////////////////////////////////////////////////// +// BoolType, TrueType, FalseType +// +template struct BoolType { + static const bool Value = Cond; + typedef BoolType Type; +}; +typedef BoolType TrueType; +typedef BoolType FalseType; + + +/////////////////////////////////////////////////////////////////////////////// +// SelectIf, BoolExpr, NotExpr, AndExpr, OrExpr +// + +template struct SelectIfImpl { template struct Apply { typedef T1 Type; }; }; +template <> struct SelectIfImpl { template struct Apply { typedef T2 Type; }; }; +template struct SelectIfCond : SelectIfImpl::template Apply {}; +template struct SelectIf : SelectIfCond {}; + +template struct AndExprCond : FalseType {}; +template <> struct AndExprCond : TrueType {}; +template struct OrExprCond : TrueType {}; +template <> struct OrExprCond : FalseType {}; + +template struct BoolExpr : SelectIf::Type {}; +template struct NotExpr : SelectIf::Type {}; +template struct AndExpr : AndExprCond::Type {}; +template struct OrExpr : OrExprCond::Type {}; + + +/////////////////////////////////////////////////////////////////////////////// +// AddConst, MaybeAddConst, RemoveConst +template struct AddConst { typedef const T Type; }; +template struct MaybeAddConst : SelectIfCond {}; +template struct RemoveConst { typedef T Type; }; +template struct RemoveConst { typedef T Type; }; + + +/////////////////////////////////////////////////////////////////////////////// +// IsSame, IsConst, IsMoreConst, IsPointer +// +template struct IsSame : FalseType {}; +template struct IsSame : TrueType {}; + +template struct IsConst : FalseType {}; +template struct IsConst : TrueType {}; + +template +struct IsMoreConst + : AndExpr::Type, typename RemoveConst::Type>, + BoolType::Value >= IsConst::Value> >::Type {}; + +template struct IsPointer : FalseType {}; +template struct IsPointer : TrueType {}; + +/////////////////////////////////////////////////////////////////////////////// +// IsBaseOf +// +#if RAPIDJSON_HAS_CXX11_TYPETRAITS + +template struct IsBaseOf + : BoolType< ::std::is_base_of::value> {}; + +#else // simplified version adopted from Boost + +template struct IsBaseOfImpl { + RAPIDJSON_STATIC_ASSERT(sizeof(B) != 0); + RAPIDJSON_STATIC_ASSERT(sizeof(D) != 0); + + typedef char (&Yes)[1]; + typedef char (&No) [2]; + + template + static Yes Check(const D*, T); + static No Check(const B*, int); + + struct Host { + operator const B*() const; + operator const D*(); + }; + + enum { Value = (sizeof(Check(Host(), 0)) == sizeof(Yes)) }; +}; + +template struct IsBaseOf + : OrExpr, BoolExpr > >::Type {}; + +#endif // RAPIDJSON_HAS_CXX11_TYPETRAITS + + +////////////////////////////////////////////////////////////////////////// +// EnableIf / DisableIf +// +template struct EnableIfCond { typedef T Type; }; +template struct EnableIfCond { /* empty */ }; + +template struct DisableIfCond { typedef T Type; }; +template struct DisableIfCond { /* empty */ }; + +template +struct EnableIf : EnableIfCond {}; + +template +struct DisableIf : DisableIfCond {}; + +// SFINAE helpers +struct SfinaeTag {}; +template struct RemoveSfinaeTag; +template struct RemoveSfinaeTag { typedef T Type; }; + +#define RAPIDJSON_REMOVEFPTR_(type) \ + typename ::RAPIDJSON_NAMESPACE::internal::RemoveSfinaeTag \ + < ::RAPIDJSON_NAMESPACE::internal::SfinaeTag&(*) type>::Type + +#define RAPIDJSON_ENABLEIF(cond) \ + typename ::RAPIDJSON_NAMESPACE::internal::EnableIf \ + ::Type * = NULL + +#define RAPIDJSON_DISABLEIF(cond) \ + typename ::RAPIDJSON_NAMESPACE::internal::DisableIf \ + ::Type * = NULL + +#define RAPIDJSON_ENABLEIF_RETURN(cond,returntype) \ + typename ::RAPIDJSON_NAMESPACE::internal::EnableIf \ + ::Type + +#define RAPIDJSON_DISABLEIF_RETURN(cond,returntype) \ + typename ::RAPIDJSON_NAMESPACE::internal::DisableIf \ + ::Type + +} // namespace internal +RAPIDJSON_NAMESPACE_END +//@endcond + +#if defined(__GNUC__) || defined(_MSC_VER) +RAPIDJSON_DIAG_POP +#endif + +#endif // RAPIDJSON_INTERNAL_META_H_ diff --git a/umd/external/include/rapidjson/internal/pow10.h b/umd/external/include/rapidjson/internal/pow10.h new file mode 100644 index 00000000..02f475d7 --- /dev/null +++ b/umd/external/include/rapidjson/internal/pow10.h @@ -0,0 +1,55 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef RAPIDJSON_POW10_ +#define RAPIDJSON_POW10_ + +#include "../rapidjson.h" + +RAPIDJSON_NAMESPACE_BEGIN +namespace internal { + +//! Computes integer powers of 10 in double (10.0^n). +/*! This function uses lookup table for fast and accurate results. + \param n non-negative exponent. Must <= 308. + \return 10.0^n +*/ +inline double Pow10(int n) { + static const double e[] = { // 1e-0...1e308: 309 * 8 bytes = 2472 bytes + 1e+0, + 1e+1, 1e+2, 1e+3, 1e+4, 1e+5, 1e+6, 1e+7, 1e+8, 1e+9, 1e+10, 1e+11, 1e+12, 1e+13, 1e+14, 1e+15, 1e+16, 1e+17, 1e+18, 1e+19, 1e+20, + 1e+21, 1e+22, 1e+23, 1e+24, 1e+25, 1e+26, 1e+27, 1e+28, 1e+29, 1e+30, 1e+31, 1e+32, 1e+33, 1e+34, 1e+35, 1e+36, 1e+37, 1e+38, 1e+39, 1e+40, + 1e+41, 1e+42, 1e+43, 1e+44, 1e+45, 1e+46, 1e+47, 1e+48, 1e+49, 1e+50, 1e+51, 1e+52, 1e+53, 1e+54, 1e+55, 1e+56, 1e+57, 1e+58, 1e+59, 1e+60, + 1e+61, 1e+62, 1e+63, 1e+64, 1e+65, 1e+66, 1e+67, 1e+68, 1e+69, 1e+70, 1e+71, 1e+72, 1e+73, 1e+74, 1e+75, 1e+76, 1e+77, 1e+78, 1e+79, 1e+80, + 1e+81, 1e+82, 1e+83, 1e+84, 1e+85, 1e+86, 1e+87, 1e+88, 1e+89, 1e+90, 1e+91, 1e+92, 1e+93, 1e+94, 1e+95, 1e+96, 1e+97, 1e+98, 1e+99, 1e+100, + 1e+101,1e+102,1e+103,1e+104,1e+105,1e+106,1e+107,1e+108,1e+109,1e+110,1e+111,1e+112,1e+113,1e+114,1e+115,1e+116,1e+117,1e+118,1e+119,1e+120, + 1e+121,1e+122,1e+123,1e+124,1e+125,1e+126,1e+127,1e+128,1e+129,1e+130,1e+131,1e+132,1e+133,1e+134,1e+135,1e+136,1e+137,1e+138,1e+139,1e+140, + 1e+141,1e+142,1e+143,1e+144,1e+145,1e+146,1e+147,1e+148,1e+149,1e+150,1e+151,1e+152,1e+153,1e+154,1e+155,1e+156,1e+157,1e+158,1e+159,1e+160, + 1e+161,1e+162,1e+163,1e+164,1e+165,1e+166,1e+167,1e+168,1e+169,1e+170,1e+171,1e+172,1e+173,1e+174,1e+175,1e+176,1e+177,1e+178,1e+179,1e+180, + 1e+181,1e+182,1e+183,1e+184,1e+185,1e+186,1e+187,1e+188,1e+189,1e+190,1e+191,1e+192,1e+193,1e+194,1e+195,1e+196,1e+197,1e+198,1e+199,1e+200, + 1e+201,1e+202,1e+203,1e+204,1e+205,1e+206,1e+207,1e+208,1e+209,1e+210,1e+211,1e+212,1e+213,1e+214,1e+215,1e+216,1e+217,1e+218,1e+219,1e+220, + 1e+221,1e+222,1e+223,1e+224,1e+225,1e+226,1e+227,1e+228,1e+229,1e+230,1e+231,1e+232,1e+233,1e+234,1e+235,1e+236,1e+237,1e+238,1e+239,1e+240, + 1e+241,1e+242,1e+243,1e+244,1e+245,1e+246,1e+247,1e+248,1e+249,1e+250,1e+251,1e+252,1e+253,1e+254,1e+255,1e+256,1e+257,1e+258,1e+259,1e+260, + 1e+261,1e+262,1e+263,1e+264,1e+265,1e+266,1e+267,1e+268,1e+269,1e+270,1e+271,1e+272,1e+273,1e+274,1e+275,1e+276,1e+277,1e+278,1e+279,1e+280, + 1e+281,1e+282,1e+283,1e+284,1e+285,1e+286,1e+287,1e+288,1e+289,1e+290,1e+291,1e+292,1e+293,1e+294,1e+295,1e+296,1e+297,1e+298,1e+299,1e+300, + 1e+301,1e+302,1e+303,1e+304,1e+305,1e+306,1e+307,1e+308 + }; + RAPIDJSON_ASSERT(n >= 0 && n <= 308); + return e[n]; +} + +} // namespace internal +RAPIDJSON_NAMESPACE_END + +#endif // RAPIDJSON_POW10_ diff --git a/umd/external/include/rapidjson/internal/regex.h b/umd/external/include/rapidjson/internal/regex.h new file mode 100644 index 00000000..e1a2faae --- /dev/null +++ b/umd/external/include/rapidjson/internal/regex.h @@ -0,0 +1,734 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef RAPIDJSON_INTERNAL_REGEX_H_ +#define RAPIDJSON_INTERNAL_REGEX_H_ + +#include "../allocators.h" +#include "../stream.h" +#include "stack.h" + +#ifdef __clang__ +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(padded) +RAPIDJSON_DIAG_OFF(switch-enum) +RAPIDJSON_DIAG_OFF(implicit-fallthrough) +#endif + +#ifdef __GNUC__ +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(effc++) +#if __GNUC__ >= 7 +RAPIDJSON_DIAG_OFF(implicit-fallthrough) +#endif +#endif + +#ifdef _MSC_VER +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(4512) // assignment operator could not be generated +#endif + +#ifndef RAPIDJSON_REGEX_VERBOSE +#define RAPIDJSON_REGEX_VERBOSE 0 +#endif + +RAPIDJSON_NAMESPACE_BEGIN +namespace internal { + +/////////////////////////////////////////////////////////////////////////////// +// DecodedStream + +template +class DecodedStream { +public: + DecodedStream(SourceStream& ss) : ss_(ss), codepoint_() { Decode(); } + unsigned Peek() { return codepoint_; } + unsigned Take() { + unsigned c = codepoint_; + if (c) // No further decoding when '\0' + Decode(); + return c; + } + +private: + void Decode() { + if (!Encoding::Decode(ss_, &codepoint_)) + codepoint_ = 0; + } + + SourceStream& ss_; + unsigned codepoint_; +}; + +/////////////////////////////////////////////////////////////////////////////// +// GenericRegex + +static const SizeType kRegexInvalidState = ~SizeType(0); //!< Represents an invalid index in GenericRegex::State::out, out1 +static const SizeType kRegexInvalidRange = ~SizeType(0); + +template +class GenericRegexSearch; + +//! Regular expression engine with subset of ECMAscript grammar. +/*! + Supported regular expression syntax: + - \c ab Concatenation + - \c a|b Alternation + - \c a? Zero or one + - \c a* Zero or more + - \c a+ One or more + - \c a{3} Exactly 3 times + - \c a{3,} At least 3 times + - \c a{3,5} 3 to 5 times + - \c (ab) Grouping + - \c ^a At the beginning + - \c a$ At the end + - \c . Any character + - \c [abc] Character classes + - \c [a-c] Character class range + - \c [a-z0-9_] Character class combination + - \c [^abc] Negated character classes + - \c [^a-c] Negated character class range + - \c [\b] Backspace (U+0008) + - \c \\| \\\\ ... Escape characters + - \c \\f Form feed (U+000C) + - \c \\n Line feed (U+000A) + - \c \\r Carriage return (U+000D) + - \c \\t Tab (U+0009) + - \c \\v Vertical tab (U+000B) + + \note This is a Thompson NFA engine, implemented with reference to + Cox, Russ. "Regular Expression Matching Can Be Simple And Fast (but is slow in Java, Perl, PHP, Python, Ruby,...).", + https://swtch.com/~rsc/regexp/regexp1.html +*/ +template +class GenericRegex { +public: + typedef Encoding EncodingType; + typedef typename Encoding::Ch Ch; + template friend class GenericRegexSearch; + + GenericRegex(const Ch* source, Allocator* allocator = 0) : + states_(allocator, 256), ranges_(allocator, 256), root_(kRegexInvalidState), stateCount_(), rangeCount_(), + anchorBegin_(), anchorEnd_() + { + GenericStringStream ss(source); + DecodedStream, Encoding> ds(ss); + Parse(ds); + } + + ~GenericRegex() {} + + bool IsValid() const { + return root_ != kRegexInvalidState; + } + +private: + enum Operator { + kZeroOrOne, + kZeroOrMore, + kOneOrMore, + kConcatenation, + kAlternation, + kLeftParenthesis + }; + + static const unsigned kAnyCharacterClass = 0xFFFFFFFF; //!< For '.' + static const unsigned kRangeCharacterClass = 0xFFFFFFFE; + static const unsigned kRangeNegationFlag = 0x80000000; + + struct Range { + unsigned start; // + unsigned end; + SizeType next; + }; + + struct State { + SizeType out; //!< Equals to kInvalid for matching state + SizeType out1; //!< Equals to non-kInvalid for split + SizeType rangeStart; + unsigned codepoint; + }; + + struct Frag { + Frag(SizeType s, SizeType o, SizeType m) : start(s), out(o), minIndex(m) {} + SizeType start; + SizeType out; //!< link-list of all output states + SizeType minIndex; + }; + + State& GetState(SizeType index) { + RAPIDJSON_ASSERT(index < stateCount_); + return states_.template Bottom()[index]; + } + + const State& GetState(SizeType index) const { + RAPIDJSON_ASSERT(index < stateCount_); + return states_.template Bottom()[index]; + } + + Range& GetRange(SizeType index) { + RAPIDJSON_ASSERT(index < rangeCount_); + return ranges_.template Bottom()[index]; + } + + const Range& GetRange(SizeType index) const { + RAPIDJSON_ASSERT(index < rangeCount_); + return ranges_.template Bottom()[index]; + } + + template + void Parse(DecodedStream& ds) { + Allocator allocator; + Stack operandStack(&allocator, 256); // Frag + Stack operatorStack(&allocator, 256); // Operator + Stack atomCountStack(&allocator, 256); // unsigned (Atom per parenthesis) + + *atomCountStack.template Push() = 0; + + unsigned codepoint; + while (ds.Peek() != 0) { + switch (codepoint = ds.Take()) { + case '^': + anchorBegin_ = true; + break; + + case '$': + anchorEnd_ = true; + break; + + case '|': + while (!operatorStack.Empty() && *operatorStack.template Top() < kAlternation) + if (!Eval(operandStack, *operatorStack.template Pop(1))) + return; + *operatorStack.template Push() = kAlternation; + *atomCountStack.template Top() = 0; + break; + + case '(': + *operatorStack.template Push() = kLeftParenthesis; + *atomCountStack.template Push() = 0; + break; + + case ')': + while (!operatorStack.Empty() && *operatorStack.template Top() != kLeftParenthesis) + if (!Eval(operandStack, *operatorStack.template Pop(1))) + return; + if (operatorStack.Empty()) + return; + operatorStack.template Pop(1); + atomCountStack.template Pop(1); + ImplicitConcatenation(atomCountStack, operatorStack); + break; + + case '?': + if (!Eval(operandStack, kZeroOrOne)) + return; + break; + + case '*': + if (!Eval(operandStack, kZeroOrMore)) + return; + break; + + case '+': + if (!Eval(operandStack, kOneOrMore)) + return; + break; + + case '{': + { + unsigned n, m; + if (!ParseUnsigned(ds, &n)) + return; + + if (ds.Peek() == ',') { + ds.Take(); + if (ds.Peek() == '}') + m = kInfinityQuantifier; + else if (!ParseUnsigned(ds, &m) || m < n) + return; + } + else + m = n; + + if (!EvalQuantifier(operandStack, n, m) || ds.Peek() != '}') + return; + ds.Take(); + } + break; + + case '.': + PushOperand(operandStack, kAnyCharacterClass); + ImplicitConcatenation(atomCountStack, operatorStack); + break; + + case '[': + { + SizeType range; + if (!ParseRange(ds, &range)) + return; + SizeType s = NewState(kRegexInvalidState, kRegexInvalidState, kRangeCharacterClass); + GetState(s).rangeStart = range; + *operandStack.template Push() = Frag(s, s, s); + } + ImplicitConcatenation(atomCountStack, operatorStack); + break; + + case '\\': // Escape character + if (!CharacterEscape(ds, &codepoint)) + return; // Unsupported escape character + // fall through to default + + default: // Pattern character + PushOperand(operandStack, codepoint); + ImplicitConcatenation(atomCountStack, operatorStack); + } + } + + while (!operatorStack.Empty()) + if (!Eval(operandStack, *operatorStack.template Pop(1))) + return; + + // Link the operand to matching state. + if (operandStack.GetSize() == sizeof(Frag)) { + Frag* e = operandStack.template Pop(1); + Patch(e->out, NewState(kRegexInvalidState, kRegexInvalidState, 0)); + root_ = e->start; + +#if RAPIDJSON_REGEX_VERBOSE + printf("root: %d\n", root_); + for (SizeType i = 0; i < stateCount_ ; i++) { + State& s = GetState(i); + printf("[%2d] out: %2d out1: %2d c: '%c'\n", i, s.out, s.out1, (char)s.codepoint); + } + printf("\n"); +#endif + } + } + + SizeType NewState(SizeType out, SizeType out1, unsigned codepoint) { + State* s = states_.template Push(); + s->out = out; + s->out1 = out1; + s->codepoint = codepoint; + s->rangeStart = kRegexInvalidRange; + return stateCount_++; + } + + void PushOperand(Stack& operandStack, unsigned codepoint) { + SizeType s = NewState(kRegexInvalidState, kRegexInvalidState, codepoint); + *operandStack.template Push() = Frag(s, s, s); + } + + void ImplicitConcatenation(Stack& atomCountStack, Stack& operatorStack) { + if (*atomCountStack.template Top()) + *operatorStack.template Push() = kConcatenation; + (*atomCountStack.template Top())++; + } + + SizeType Append(SizeType l1, SizeType l2) { + SizeType old = l1; + while (GetState(l1).out != kRegexInvalidState) + l1 = GetState(l1).out; + GetState(l1).out = l2; + return old; + } + + void Patch(SizeType l, SizeType s) { + for (SizeType next; l != kRegexInvalidState; l = next) { + next = GetState(l).out; + GetState(l).out = s; + } + } + + bool Eval(Stack& operandStack, Operator op) { + switch (op) { + case kConcatenation: + RAPIDJSON_ASSERT(operandStack.GetSize() >= sizeof(Frag) * 2); + { + Frag e2 = *operandStack.template Pop(1); + Frag e1 = *operandStack.template Pop(1); + Patch(e1.out, e2.start); + *operandStack.template Push() = Frag(e1.start, e2.out, Min(e1.minIndex, e2.minIndex)); + } + return true; + + case kAlternation: + if (operandStack.GetSize() >= sizeof(Frag) * 2) { + Frag e2 = *operandStack.template Pop(1); + Frag e1 = *operandStack.template Pop(1); + SizeType s = NewState(e1.start, e2.start, 0); + *operandStack.template Push() = Frag(s, Append(e1.out, e2.out), Min(e1.minIndex, e2.minIndex)); + return true; + } + return false; + + case kZeroOrOne: + if (operandStack.GetSize() >= sizeof(Frag)) { + Frag e = *operandStack.template Pop(1); + SizeType s = NewState(kRegexInvalidState, e.start, 0); + *operandStack.template Push() = Frag(s, Append(e.out, s), e.minIndex); + return true; + } + return false; + + case kZeroOrMore: + if (operandStack.GetSize() >= sizeof(Frag)) { + Frag e = *operandStack.template Pop(1); + SizeType s = NewState(kRegexInvalidState, e.start, 0); + Patch(e.out, s); + *operandStack.template Push() = Frag(s, s, e.minIndex); + return true; + } + return false; + + default: + RAPIDJSON_ASSERT(op == kOneOrMore); + if (operandStack.GetSize() >= sizeof(Frag)) { + Frag e = *operandStack.template Pop(1); + SizeType s = NewState(kRegexInvalidState, e.start, 0); + Patch(e.out, s); + *operandStack.template Push() = Frag(e.start, s, e.minIndex); + return true; + } + return false; + } + } + + bool EvalQuantifier(Stack& operandStack, unsigned n, unsigned m) { + RAPIDJSON_ASSERT(n <= m); + RAPIDJSON_ASSERT(operandStack.GetSize() >= sizeof(Frag)); + + if (n == 0) { + if (m == 0) // a{0} not support + return false; + else if (m == kInfinityQuantifier) + Eval(operandStack, kZeroOrMore); // a{0,} -> a* + else { + Eval(operandStack, kZeroOrOne); // a{0,5} -> a? + for (unsigned i = 0; i < m - 1; i++) + CloneTopOperand(operandStack); // a{0,5} -> a? a? a? a? a? + for (unsigned i = 0; i < m - 1; i++) + Eval(operandStack, kConcatenation); // a{0,5} -> a?a?a?a?a? + } + return true; + } + + for (unsigned i = 0; i < n - 1; i++) // a{3} -> a a a + CloneTopOperand(operandStack); + + if (m == kInfinityQuantifier) + Eval(operandStack, kOneOrMore); // a{3,} -> a a a+ + else if (m > n) { + CloneTopOperand(operandStack); // a{3,5} -> a a a a + Eval(operandStack, kZeroOrOne); // a{3,5} -> a a a a? + for (unsigned i = n; i < m - 1; i++) + CloneTopOperand(operandStack); // a{3,5} -> a a a a? a? + for (unsigned i = n; i < m; i++) + Eval(operandStack, kConcatenation); // a{3,5} -> a a aa?a? + } + + for (unsigned i = 0; i < n - 1; i++) + Eval(operandStack, kConcatenation); // a{3} -> aaa, a{3,} -> aaa+, a{3.5} -> aaaa?a? + + return true; + } + + static SizeType Min(SizeType a, SizeType b) { return a < b ? a : b; } + + void CloneTopOperand(Stack& operandStack) { + const Frag src = *operandStack.template Top(); // Copy constructor to prevent invalidation + SizeType count = stateCount_ - src.minIndex; // Assumes top operand contains states in [src->minIndex, stateCount_) + State* s = states_.template Push(count); + memcpy(s, &GetState(src.minIndex), count * sizeof(State)); + for (SizeType j = 0; j < count; j++) { + if (s[j].out != kRegexInvalidState) + s[j].out += count; + if (s[j].out1 != kRegexInvalidState) + s[j].out1 += count; + } + *operandStack.template Push() = Frag(src.start + count, src.out + count, src.minIndex + count); + stateCount_ += count; + } + + template + bool ParseUnsigned(DecodedStream& ds, unsigned* u) { + unsigned r = 0; + if (ds.Peek() < '0' || ds.Peek() > '9') + return false; + while (ds.Peek() >= '0' && ds.Peek() <= '9') { + if (r >= 429496729 && ds.Peek() > '5') // 2^32 - 1 = 4294967295 + return false; // overflow + r = r * 10 + (ds.Take() - '0'); + } + *u = r; + return true; + } + + template + bool ParseRange(DecodedStream& ds, SizeType* range) { + bool isBegin = true; + bool negate = false; + int step = 0; + SizeType start = kRegexInvalidRange; + SizeType current = kRegexInvalidRange; + unsigned codepoint; + while ((codepoint = ds.Take()) != 0) { + if (isBegin) { + isBegin = false; + if (codepoint == '^') { + negate = true; + continue; + } + } + + switch (codepoint) { + case ']': + if (start == kRegexInvalidRange) + return false; // Error: nothing inside [] + if (step == 2) { // Add trailing '-' + SizeType r = NewRange('-'); + RAPIDJSON_ASSERT(current != kRegexInvalidRange); + GetRange(current).next = r; + } + if (negate) + GetRange(start).start |= kRangeNegationFlag; + *range = start; + return true; + + case '\\': + if (ds.Peek() == 'b') { + ds.Take(); + codepoint = 0x0008; // Escape backspace character + } + else if (!CharacterEscape(ds, &codepoint)) + return false; + // fall through to default + + default: + switch (step) { + case 1: + if (codepoint == '-') { + step++; + break; + } + // fall through to step 0 for other characters + + case 0: + { + SizeType r = NewRange(codepoint); + if (current != kRegexInvalidRange) + GetRange(current).next = r; + if (start == kRegexInvalidRange) + start = r; + current = r; + } + step = 1; + break; + + default: + RAPIDJSON_ASSERT(step == 2); + GetRange(current).end = codepoint; + step = 0; + } + } + } + return false; + } + + SizeType NewRange(unsigned codepoint) { + Range* r = ranges_.template Push(); + r->start = r->end = codepoint; + r->next = kRegexInvalidRange; + return rangeCount_++; + } + + template + bool CharacterEscape(DecodedStream& ds, unsigned* escapedCodepoint) { + unsigned codepoint; + switch (codepoint = ds.Take()) { + case '^': + case '$': + case '|': + case '(': + case ')': + case '?': + case '*': + case '+': + case '.': + case '[': + case ']': + case '{': + case '}': + case '\\': + *escapedCodepoint = codepoint; return true; + case 'f': *escapedCodepoint = 0x000C; return true; + case 'n': *escapedCodepoint = 0x000A; return true; + case 'r': *escapedCodepoint = 0x000D; return true; + case 't': *escapedCodepoint = 0x0009; return true; + case 'v': *escapedCodepoint = 0x000B; return true; + default: + return false; // Unsupported escape character + } + } + + Stack states_; + Stack ranges_; + SizeType root_; + SizeType stateCount_; + SizeType rangeCount_; + + static const unsigned kInfinityQuantifier = ~0u; + + // For SearchWithAnchoring() + bool anchorBegin_; + bool anchorEnd_; +}; + +template +class GenericRegexSearch { +public: + typedef typename RegexType::EncodingType Encoding; + typedef typename Encoding::Ch Ch; + + GenericRegexSearch(const RegexType& regex, Allocator* allocator = 0) : + regex_(regex), allocator_(allocator), ownAllocator_(0), + state0_(allocator, 0), state1_(allocator, 0), stateSet_() + { + RAPIDJSON_ASSERT(regex_.IsValid()); + if (!allocator_) + ownAllocator_ = allocator_ = RAPIDJSON_NEW(Allocator)(); + stateSet_ = static_cast(allocator_->Malloc(GetStateSetSize())); + state0_.template Reserve(regex_.stateCount_); + state1_.template Reserve(regex_.stateCount_); + } + + ~GenericRegexSearch() { + Allocator::Free(stateSet_); + RAPIDJSON_DELETE(ownAllocator_); + } + + template + bool Match(InputStream& is) { + return SearchWithAnchoring(is, true, true); + } + + bool Match(const Ch* s) { + GenericStringStream is(s); + return Match(is); + } + + template + bool Search(InputStream& is) { + return SearchWithAnchoring(is, regex_.anchorBegin_, regex_.anchorEnd_); + } + + bool Search(const Ch* s) { + GenericStringStream is(s); + return Search(is); + } + +private: + typedef typename RegexType::State State; + typedef typename RegexType::Range Range; + + template + bool SearchWithAnchoring(InputStream& is, bool anchorBegin, bool anchorEnd) { + DecodedStream ds(is); + + state0_.Clear(); + Stack *current = &state0_, *next = &state1_; + const size_t stateSetSize = GetStateSetSize(); + std::memset(stateSet_, 0, stateSetSize); + + bool matched = AddState(*current, regex_.root_); + unsigned codepoint; + while (!current->Empty() && (codepoint = ds.Take()) != 0) { + std::memset(stateSet_, 0, stateSetSize); + next->Clear(); + matched = false; + for (const SizeType* s = current->template Bottom(); s != current->template End(); ++s) { + const State& sr = regex_.GetState(*s); + if (sr.codepoint == codepoint || + sr.codepoint == RegexType::kAnyCharacterClass || + (sr.codepoint == RegexType::kRangeCharacterClass && MatchRange(sr.rangeStart, codepoint))) + { + matched = AddState(*next, sr.out) || matched; + if (!anchorEnd && matched) + return true; + } + if (!anchorBegin) + AddState(*next, regex_.root_); + } + internal::Swap(current, next); + } + + return matched; + } + + size_t GetStateSetSize() const { + return (regex_.stateCount_ + 31) / 32 * 4; + } + + // Return whether the added states is a match state + bool AddState(Stack& l, SizeType index) { + RAPIDJSON_ASSERT(index != kRegexInvalidState); + + const State& s = regex_.GetState(index); + if (s.out1 != kRegexInvalidState) { // Split + bool matched = AddState(l, s.out); + return AddState(l, s.out1) || matched; + } + else if (!(stateSet_[index >> 5] & (1u << (index & 31)))) { + stateSet_[index >> 5] |= (1u << (index & 31)); + *l.template PushUnsafe() = index; + } + return s.out == kRegexInvalidState; // by using PushUnsafe() above, we can ensure s is not validated due to reallocation. + } + + bool MatchRange(SizeType rangeIndex, unsigned codepoint) const { + bool yes = (regex_.GetRange(rangeIndex).start & RegexType::kRangeNegationFlag) == 0; + while (rangeIndex != kRegexInvalidRange) { + const Range& r = regex_.GetRange(rangeIndex); + if (codepoint >= (r.start & ~RegexType::kRangeNegationFlag) && codepoint <= r.end) + return yes; + rangeIndex = r.next; + } + return !yes; + } + + const RegexType& regex_; + Allocator* allocator_; + Allocator* ownAllocator_; + Stack state0_; + Stack state1_; + uint32_t* stateSet_; +}; + +typedef GenericRegex > Regex; +typedef GenericRegexSearch RegexSearch; + +} // namespace internal +RAPIDJSON_NAMESPACE_END + +#ifdef __clang__ +RAPIDJSON_DIAG_POP +#endif + +#ifdef _MSC_VER +RAPIDJSON_DIAG_POP +#endif + +#endif // RAPIDJSON_INTERNAL_REGEX_H_ diff --git a/umd/external/include/rapidjson/internal/stack.h b/umd/external/include/rapidjson/internal/stack.h new file mode 100644 index 00000000..5c5398c3 --- /dev/null +++ b/umd/external/include/rapidjson/internal/stack.h @@ -0,0 +1,231 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef RAPIDJSON_INTERNAL_STACK_H_ +#define RAPIDJSON_INTERNAL_STACK_H_ + +#include "../allocators.h" +#include "swap.h" + +#if defined(__clang__) +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(c++98-compat) +#endif + +RAPIDJSON_NAMESPACE_BEGIN +namespace internal { + +/////////////////////////////////////////////////////////////////////////////// +// Stack + +//! A type-unsafe stack for storing different types of data. +/*! \tparam Allocator Allocator for allocating stack memory. +*/ +template +class Stack { +public: + // Optimization note: Do not allocate memory for stack_ in constructor. + // Do it lazily when first Push() -> Expand() -> Resize(). + Stack(Allocator* allocator, size_t stackCapacity) : allocator_(allocator), ownAllocator_(0), stack_(0), stackTop_(0), stackEnd_(0), initialCapacity_(stackCapacity) { + } + +#if RAPIDJSON_HAS_CXX11_RVALUE_REFS + Stack(Stack&& rhs) + : allocator_(rhs.allocator_), + ownAllocator_(rhs.ownAllocator_), + stack_(rhs.stack_), + stackTop_(rhs.stackTop_), + stackEnd_(rhs.stackEnd_), + initialCapacity_(rhs.initialCapacity_) + { + rhs.allocator_ = 0; + rhs.ownAllocator_ = 0; + rhs.stack_ = 0; + rhs.stackTop_ = 0; + rhs.stackEnd_ = 0; + rhs.initialCapacity_ = 0; + } +#endif + + ~Stack() { + Destroy(); + } + +#if RAPIDJSON_HAS_CXX11_RVALUE_REFS + Stack& operator=(Stack&& rhs) { + if (&rhs != this) + { + Destroy(); + + allocator_ = rhs.allocator_; + ownAllocator_ = rhs.ownAllocator_; + stack_ = rhs.stack_; + stackTop_ = rhs.stackTop_; + stackEnd_ = rhs.stackEnd_; + initialCapacity_ = rhs.initialCapacity_; + + rhs.allocator_ = 0; + rhs.ownAllocator_ = 0; + rhs.stack_ = 0; + rhs.stackTop_ = 0; + rhs.stackEnd_ = 0; + rhs.initialCapacity_ = 0; + } + return *this; + } +#endif + + void Swap(Stack& rhs) RAPIDJSON_NOEXCEPT { + internal::Swap(allocator_, rhs.allocator_); + internal::Swap(ownAllocator_, rhs.ownAllocator_); + internal::Swap(stack_, rhs.stack_); + internal::Swap(stackTop_, rhs.stackTop_); + internal::Swap(stackEnd_, rhs.stackEnd_); + internal::Swap(initialCapacity_, rhs.initialCapacity_); + } + + void Clear() { stackTop_ = stack_; } + + void ShrinkToFit() { + if (Empty()) { + // If the stack is empty, completely deallocate the memory. + Allocator::Free(stack_); + stack_ = 0; + stackTop_ = 0; + stackEnd_ = 0; + } + else + Resize(GetSize()); + } + + // Optimization note: try to minimize the size of this function for force inline. + // Expansion is run very infrequently, so it is moved to another (probably non-inline) function. + template + RAPIDJSON_FORCEINLINE void Reserve(size_t count = 1) { + // Expand the stack if needed + if (RAPIDJSON_UNLIKELY(stackTop_ + sizeof(T) * count > stackEnd_)) + Expand(count); + } + + template + RAPIDJSON_FORCEINLINE T* Push(size_t count = 1) { + Reserve(count); + return PushUnsafe(count); + } + + template + RAPIDJSON_FORCEINLINE T* PushUnsafe(size_t count = 1) { + RAPIDJSON_ASSERT(stackTop_); + RAPIDJSON_ASSERT(stackTop_ + sizeof(T) * count <= stackEnd_); + T* ret = reinterpret_cast(stackTop_); + stackTop_ += sizeof(T) * count; + return ret; + } + + template + T* Pop(size_t count) { + RAPIDJSON_ASSERT(GetSize() >= count * sizeof(T)); + stackTop_ -= count * sizeof(T); + return reinterpret_cast(stackTop_); + } + + template + T* Top() { + RAPIDJSON_ASSERT(GetSize() >= sizeof(T)); + return reinterpret_cast(stackTop_ - sizeof(T)); + } + + template + const T* Top() const { + RAPIDJSON_ASSERT(GetSize() >= sizeof(T)); + return reinterpret_cast(stackTop_ - sizeof(T)); + } + + template + T* End() { return reinterpret_cast(stackTop_); } + + template + const T* End() const { return reinterpret_cast(stackTop_); } + + template + T* Bottom() { return reinterpret_cast(stack_); } + + template + const T* Bottom() const { return reinterpret_cast(stack_); } + + bool HasAllocator() const { + return allocator_ != 0; + } + + Allocator& GetAllocator() { + RAPIDJSON_ASSERT(allocator_); + return *allocator_; + } + + bool Empty() const { return stackTop_ == stack_; } + size_t GetSize() const { return static_cast(stackTop_ - stack_); } + size_t GetCapacity() const { return static_cast(stackEnd_ - stack_); } + +private: + template + void Expand(size_t count) { + // Only expand the capacity if the current stack exists. Otherwise just create a stack with initial capacity. + size_t newCapacity; + if (stack_ == 0) { + if (!allocator_) + ownAllocator_ = allocator_ = RAPIDJSON_NEW(Allocator)(); + newCapacity = initialCapacity_; + } else { + newCapacity = GetCapacity(); + newCapacity += (newCapacity + 1) / 2; + } + size_t newSize = GetSize() + sizeof(T) * count; + if (newCapacity < newSize) + newCapacity = newSize; + + Resize(newCapacity); + } + + void Resize(size_t newCapacity) { + const size_t size = GetSize(); // Backup the current size + stack_ = static_cast(allocator_->Realloc(stack_, GetCapacity(), newCapacity)); + stackTop_ = stack_ + size; + stackEnd_ = stack_ + newCapacity; + } + + void Destroy() { + Allocator::Free(stack_); + RAPIDJSON_DELETE(ownAllocator_); // Only delete if it is owned by the stack + } + + // Prohibit copy constructor & assignment operator. + Stack(const Stack&); + Stack& operator=(const Stack&); + + Allocator* allocator_; + Allocator* ownAllocator_; + char *stack_; + char *stackTop_; + char *stackEnd_; + size_t initialCapacity_; +}; + +} // namespace internal +RAPIDJSON_NAMESPACE_END + +#if defined(__clang__) +RAPIDJSON_DIAG_POP +#endif + +#endif // RAPIDJSON_STACK_H_ diff --git a/umd/external/include/rapidjson/internal/strfunc.h b/umd/external/include/rapidjson/internal/strfunc.h new file mode 100644 index 00000000..226439a7 --- /dev/null +++ b/umd/external/include/rapidjson/internal/strfunc.h @@ -0,0 +1,69 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef RAPIDJSON_INTERNAL_STRFUNC_H_ +#define RAPIDJSON_INTERNAL_STRFUNC_H_ + +#include "../stream.h" +#include + +RAPIDJSON_NAMESPACE_BEGIN +namespace internal { + +//! Custom strlen() which works on different character types. +/*! \tparam Ch Character type (e.g. char, wchar_t, short) + \param s Null-terminated input string. + \return Number of characters in the string. + \note This has the same semantics as strlen(), the return value is not number of Unicode codepoints. +*/ +template +inline SizeType StrLen(const Ch* s) { + RAPIDJSON_ASSERT(s != 0); + const Ch* p = s; + while (*p) ++p; + return SizeType(p - s); +} + +template <> +inline SizeType StrLen(const char* s) { + return SizeType(std::strlen(s)); +} + +template <> +inline SizeType StrLen(const wchar_t* s) { + return SizeType(std::wcslen(s)); +} + +//! Returns number of code points in a encoded string. +template +bool CountStringCodePoint(const typename Encoding::Ch* s, SizeType length, SizeType* outCount) { + RAPIDJSON_ASSERT(s != 0); + RAPIDJSON_ASSERT(outCount != 0); + GenericStringStream is(s); + const typename Encoding::Ch* end = s + length; + SizeType count = 0; + while (is.src_ < end) { + unsigned codepoint; + if (!Encoding::Decode(is, &codepoint)) + return false; + count++; + } + *outCount = count; + return true; +} + +} // namespace internal +RAPIDJSON_NAMESPACE_END + +#endif // RAPIDJSON_INTERNAL_STRFUNC_H_ diff --git a/umd/external/include/rapidjson/internal/strtod.h b/umd/external/include/rapidjson/internal/strtod.h new file mode 100644 index 00000000..adf49e34 --- /dev/null +++ b/umd/external/include/rapidjson/internal/strtod.h @@ -0,0 +1,269 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef RAPIDJSON_STRTOD_ +#define RAPIDJSON_STRTOD_ + +#include "ieee754.h" +#include "biginteger.h" +#include "diyfp.h" +#include "pow10.h" + +RAPIDJSON_NAMESPACE_BEGIN +namespace internal { + +inline double FastPath(double significand, int exp) { + if (exp < -308) + return 0.0; + else if (exp >= 0) + return significand * internal::Pow10(exp); + else + return significand / internal::Pow10(-exp); +} + +inline double StrtodNormalPrecision(double d, int p) { + if (p < -308) { + // Prevent expSum < -308, making Pow10(p) = 0 + d = FastPath(d, -308); + d = FastPath(d, p + 308); + } + else + d = FastPath(d, p); + return d; +} + +template +inline T Min3(T a, T b, T c) { + T m = a; + if (m > b) m = b; + if (m > c) m = c; + return m; +} + +inline int CheckWithinHalfULP(double b, const BigInteger& d, int dExp) { + const Double db(b); + const uint64_t bInt = db.IntegerSignificand(); + const int bExp = db.IntegerExponent(); + const int hExp = bExp - 1; + + int dS_Exp2 = 0, dS_Exp5 = 0, bS_Exp2 = 0, bS_Exp5 = 0, hS_Exp2 = 0, hS_Exp5 = 0; + + // Adjust for decimal exponent + if (dExp >= 0) { + dS_Exp2 += dExp; + dS_Exp5 += dExp; + } + else { + bS_Exp2 -= dExp; + bS_Exp5 -= dExp; + hS_Exp2 -= dExp; + hS_Exp5 -= dExp; + } + + // Adjust for binary exponent + if (bExp >= 0) + bS_Exp2 += bExp; + else { + dS_Exp2 -= bExp; + hS_Exp2 -= bExp; + } + + // Adjust for half ulp exponent + if (hExp >= 0) + hS_Exp2 += hExp; + else { + dS_Exp2 -= hExp; + bS_Exp2 -= hExp; + } + + // Remove common power of two factor from all three scaled values + int common_Exp2 = Min3(dS_Exp2, bS_Exp2, hS_Exp2); + dS_Exp2 -= common_Exp2; + bS_Exp2 -= common_Exp2; + hS_Exp2 -= common_Exp2; + + BigInteger dS = d; + dS.MultiplyPow5(static_cast(dS_Exp5)) <<= static_cast(dS_Exp2); + + BigInteger bS(bInt); + bS.MultiplyPow5(static_cast(bS_Exp5)) <<= static_cast(bS_Exp2); + + BigInteger hS(1); + hS.MultiplyPow5(static_cast(hS_Exp5)) <<= static_cast(hS_Exp2); + + BigInteger delta(0); + dS.Difference(bS, &delta); + + return delta.Compare(hS); +} + +inline bool StrtodFast(double d, int p, double* result) { + // Use fast path for string-to-double conversion if possible + // see http://www.exploringbinary.com/fast-path-decimal-to-floating-point-conversion/ + if (p > 22 && p < 22 + 16) { + // Fast Path Cases In Disguise + d *= internal::Pow10(p - 22); + p = 22; + } + + if (p >= -22 && p <= 22 && d <= 9007199254740991.0) { // 2^53 - 1 + *result = FastPath(d, p); + return true; + } + else + return false; +} + +// Compute an approximation and see if it is within 1/2 ULP +inline bool StrtodDiyFp(const char* decimals, size_t length, size_t decimalPosition, int exp, double* result) { + uint64_t significand = 0; + size_t i = 0; // 2^64 - 1 = 18446744073709551615, 1844674407370955161 = 0x1999999999999999 + for (; i < length; i++) { + if (significand > RAPIDJSON_UINT64_C2(0x19999999, 0x99999999) || + (significand == RAPIDJSON_UINT64_C2(0x19999999, 0x99999999) && decimals[i] > '5')) + break; + significand = significand * 10u + static_cast(decimals[i] - '0'); + } + + if (i < length && decimals[i] >= '5') // Rounding + significand++; + + size_t remaining = length - i; + const int kUlpShift = 3; + const int kUlp = 1 << kUlpShift; + int64_t error = (remaining == 0) ? 0 : kUlp / 2; + + DiyFp v(significand, 0); + v = v.Normalize(); + error <<= -v.e; + + const int dExp = static_cast(decimalPosition) - static_cast(i) + exp; + + int actualExp; + DiyFp cachedPower = GetCachedPower10(dExp, &actualExp); + if (actualExp != dExp) { + static const DiyFp kPow10[] = { + DiyFp(RAPIDJSON_UINT64_C2(0xa0000000, 00000000), -60), // 10^1 + DiyFp(RAPIDJSON_UINT64_C2(0xc8000000, 00000000), -57), // 10^2 + DiyFp(RAPIDJSON_UINT64_C2(0xfa000000, 00000000), -54), // 10^3 + DiyFp(RAPIDJSON_UINT64_C2(0x9c400000, 00000000), -50), // 10^4 + DiyFp(RAPIDJSON_UINT64_C2(0xc3500000, 00000000), -47), // 10^5 + DiyFp(RAPIDJSON_UINT64_C2(0xf4240000, 00000000), -44), // 10^6 + DiyFp(RAPIDJSON_UINT64_C2(0x98968000, 00000000), -40) // 10^7 + }; + int adjustment = dExp - actualExp - 1; + RAPIDJSON_ASSERT(adjustment >= 0 && adjustment < 7); + v = v * kPow10[adjustment]; + if (length + static_cast(adjustment)> 19u) // has more digits than decimal digits in 64-bit + error += kUlp / 2; + } + + v = v * cachedPower; + + error += kUlp + (error == 0 ? 0 : 1); + + const int oldExp = v.e; + v = v.Normalize(); + error <<= oldExp - v.e; + + const int effectiveSignificandSize = Double::EffectiveSignificandSize(64 + v.e); + int precisionSize = 64 - effectiveSignificandSize; + if (precisionSize + kUlpShift >= 64) { + int scaleExp = (precisionSize + kUlpShift) - 63; + v.f >>= scaleExp; + v.e += scaleExp; + error = (error >> scaleExp) + 1 + kUlp; + precisionSize -= scaleExp; + } + + DiyFp rounded(v.f >> precisionSize, v.e + precisionSize); + const uint64_t precisionBits = (v.f & ((uint64_t(1) << precisionSize) - 1)) * kUlp; + const uint64_t halfWay = (uint64_t(1) << (precisionSize - 1)) * kUlp; + if (precisionBits >= halfWay + static_cast(error)) { + rounded.f++; + if (rounded.f & (DiyFp::kDpHiddenBit << 1)) { // rounding overflows mantissa (issue #340) + rounded.f >>= 1; + rounded.e++; + } + } + + *result = rounded.ToDouble(); + + return halfWay - static_cast(error) >= precisionBits || precisionBits >= halfWay + static_cast(error); +} + +inline double StrtodBigInteger(double approx, const char* decimals, size_t length, size_t decimalPosition, int exp) { + const BigInteger dInt(decimals, length); + const int dExp = static_cast(decimalPosition) - static_cast(length) + exp; + Double a(approx); + int cmp = CheckWithinHalfULP(a.Value(), dInt, dExp); + if (cmp < 0) + return a.Value(); // within half ULP + else if (cmp == 0) { + // Round towards even + if (a.Significand() & 1) + return a.NextPositiveDouble(); + else + return a.Value(); + } + else // adjustment + return a.NextPositiveDouble(); +} + +inline double StrtodFullPrecision(double d, int p, const char* decimals, size_t length, size_t decimalPosition, int exp) { + RAPIDJSON_ASSERT(d >= 0.0); + RAPIDJSON_ASSERT(length >= 1); + + double result; + if (StrtodFast(d, p, &result)) + return result; + + // Trim leading zeros + while (*decimals == '0' && length > 1) { + length--; + decimals++; + decimalPosition--; + } + + // Trim trailing zeros + while (decimals[length - 1] == '0' && length > 1) { + length--; + decimalPosition--; + exp++; + } + + // Trim right-most digits + const int kMaxDecimalDigit = 780; + if (static_cast(length) > kMaxDecimalDigit) { + int delta = (static_cast(length) - kMaxDecimalDigit); + exp += delta; + decimalPosition -= static_cast(delta); + length = kMaxDecimalDigit; + } + + // If too small, underflow to zero + if (int(length) + exp < -324) + return 0.0; + + if (StrtodDiyFp(decimals, length, decimalPosition, exp, &result)) + return result; + + // Use approximation from StrtodDiyFp and make adjustment with BigInteger comparison + return StrtodBigInteger(result, decimals, length, decimalPosition, exp); +} + +} // namespace internal +RAPIDJSON_NAMESPACE_END + +#endif // RAPIDJSON_STRTOD_ diff --git a/umd/external/include/rapidjson/internal/swap.h b/umd/external/include/rapidjson/internal/swap.h new file mode 100644 index 00000000..666e49f9 --- /dev/null +++ b/umd/external/include/rapidjson/internal/swap.h @@ -0,0 +1,46 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef RAPIDJSON_INTERNAL_SWAP_H_ +#define RAPIDJSON_INTERNAL_SWAP_H_ + +#include "../rapidjson.h" + +#if defined(__clang__) +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(c++98-compat) +#endif + +RAPIDJSON_NAMESPACE_BEGIN +namespace internal { + +//! Custom swap() to avoid dependency on C++ header +/*! \tparam T Type of the arguments to swap, should be instantiated with primitive C++ types only. + \note This has the same semantics as std::swap(). +*/ +template +inline void Swap(T& a, T& b) RAPIDJSON_NOEXCEPT { + T tmp = a; + a = b; + b = tmp; +} + +} // namespace internal +RAPIDJSON_NAMESPACE_END + +#if defined(__clang__) +RAPIDJSON_DIAG_POP +#endif + +#endif // RAPIDJSON_INTERNAL_SWAP_H_ diff --git a/umd/external/include/rapidjson/istreamwrapper.h b/umd/external/include/rapidjson/istreamwrapper.h new file mode 100644 index 00000000..8639c8c3 --- /dev/null +++ b/umd/external/include/rapidjson/istreamwrapper.h @@ -0,0 +1,115 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef RAPIDJSON_ISTREAMWRAPPER_H_ +#define RAPIDJSON_ISTREAMWRAPPER_H_ + +#include "stream.h" +#include + +#ifdef __clang__ +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(padded) +#endif + +#ifdef _MSC_VER +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(4351) // new behavior: elements of array 'array' will be default initialized +#endif + +RAPIDJSON_NAMESPACE_BEGIN + +//! Wrapper of \c std::basic_istream into RapidJSON's Stream concept. +/*! + The classes can be wrapped including but not limited to: + + - \c std::istringstream + - \c std::stringstream + - \c std::wistringstream + - \c std::wstringstream + - \c std::ifstream + - \c std::fstream + - \c std::wifstream + - \c std::wfstream + + \tparam StreamType Class derived from \c std::basic_istream. +*/ + +template +class BasicIStreamWrapper { +public: + typedef typename StreamType::char_type Ch; + BasicIStreamWrapper(StreamType& stream) : stream_(stream), count_(), peekBuffer_() {} + + Ch Peek() const { + typename StreamType::int_type c = stream_.peek(); + return RAPIDJSON_LIKELY(c != StreamType::traits_type::eof()) ? static_cast(c) : static_cast('\0'); + } + + Ch Take() { + typename StreamType::int_type c = stream_.get(); + if (RAPIDJSON_LIKELY(c != StreamType::traits_type::eof())) { + count_++; + return static_cast(c); + } + else + return '\0'; + } + + // tellg() may return -1 when failed. So we count by ourself. + size_t Tell() const { return count_; } + + Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; } + void Put(Ch) { RAPIDJSON_ASSERT(false); } + void Flush() { RAPIDJSON_ASSERT(false); } + size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; } + + // For encoding detection only. + const Ch* Peek4() const { + RAPIDJSON_ASSERT(sizeof(Ch) == 1); // Only usable for byte stream. + int i; + bool hasError = false; + for (i = 0; i < 4; ++i) { + typename StreamType::int_type c = stream_.get(); + if (c == StreamType::traits_type::eof()) { + hasError = true; + stream_.clear(); + break; + } + peekBuffer_[i] = static_cast(c); + } + for (--i; i >= 0; --i) + stream_.putback(peekBuffer_[i]); + return !hasError ? peekBuffer_ : 0; + } + +private: + BasicIStreamWrapper(const BasicIStreamWrapper&); + BasicIStreamWrapper& operator=(const BasicIStreamWrapper&); + + StreamType& stream_; + size_t count_; //!< Number of characters read. Note: + mutable Ch peekBuffer_[4]; +}; + +typedef BasicIStreamWrapper IStreamWrapper; +typedef BasicIStreamWrapper WIStreamWrapper; + +#if defined(__clang__) || defined(_MSC_VER) +RAPIDJSON_DIAG_POP +#endif + +RAPIDJSON_NAMESPACE_END + +#endif // RAPIDJSON_ISTREAMWRAPPER_H_ diff --git a/umd/external/include/rapidjson/memorybuffer.h b/umd/external/include/rapidjson/memorybuffer.h new file mode 100644 index 00000000..39bee1de --- /dev/null +++ b/umd/external/include/rapidjson/memorybuffer.h @@ -0,0 +1,70 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef RAPIDJSON_MEMORYBUFFER_H_ +#define RAPIDJSON_MEMORYBUFFER_H_ + +#include "stream.h" +#include "internal/stack.h" + +RAPIDJSON_NAMESPACE_BEGIN + +//! Represents an in-memory output byte stream. +/*! + This class is mainly for being wrapped by EncodedOutputStream or AutoUTFOutputStream. + + It is similar to FileWriteBuffer but the destination is an in-memory buffer instead of a file. + + Differences between MemoryBuffer and StringBuffer: + 1. StringBuffer has Encoding but MemoryBuffer is only a byte buffer. + 2. StringBuffer::GetString() returns a null-terminated string. MemoryBuffer::GetBuffer() returns a buffer without terminator. + + \tparam Allocator type for allocating memory buffer. + \note implements Stream concept +*/ +template +struct GenericMemoryBuffer { + typedef char Ch; // byte + + GenericMemoryBuffer(Allocator* allocator = 0, size_t capacity = kDefaultCapacity) : stack_(allocator, capacity) {} + + void Put(Ch c) { *stack_.template Push() = c; } + void Flush() {} + + void Clear() { stack_.Clear(); } + void ShrinkToFit() { stack_.ShrinkToFit(); } + Ch* Push(size_t count) { return stack_.template Push(count); } + void Pop(size_t count) { stack_.template Pop(count); } + + const Ch* GetBuffer() const { + return stack_.template Bottom(); + } + + size_t GetSize() const { return stack_.GetSize(); } + + static const size_t kDefaultCapacity = 256; + mutable internal::Stack stack_; +}; + +typedef GenericMemoryBuffer<> MemoryBuffer; + +//! Implement specialized version of PutN() with memset() for better performance. +template<> +inline void PutN(MemoryBuffer& memoryBuffer, char c, size_t n) { + std::memset(memoryBuffer.stack_.Push(n), c, n * sizeof(c)); +} + +RAPIDJSON_NAMESPACE_END + +#endif // RAPIDJSON_MEMORYBUFFER_H_ diff --git a/umd/external/include/rapidjson/memorystream.h b/umd/external/include/rapidjson/memorystream.h new file mode 100644 index 00000000..1d71d8a4 --- /dev/null +++ b/umd/external/include/rapidjson/memorystream.h @@ -0,0 +1,71 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef RAPIDJSON_MEMORYSTREAM_H_ +#define RAPIDJSON_MEMORYSTREAM_H_ + +#include "stream.h" + +#ifdef __clang__ +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(unreachable-code) +RAPIDJSON_DIAG_OFF(missing-noreturn) +#endif + +RAPIDJSON_NAMESPACE_BEGIN + +//! Represents an in-memory input byte stream. +/*! + This class is mainly for being wrapped by EncodedInputStream or AutoUTFInputStream. + + It is similar to FileReadBuffer but the source is an in-memory buffer instead of a file. + + Differences between MemoryStream and StringStream: + 1. StringStream has encoding but MemoryStream is a byte stream. + 2. MemoryStream needs size of the source buffer and the buffer don't need to be null terminated. StringStream assume null-terminated string as source. + 3. MemoryStream supports Peek4() for encoding detection. StringStream is specified with an encoding so it should not have Peek4(). + \note implements Stream concept +*/ +struct MemoryStream { + typedef char Ch; // byte + + MemoryStream(const Ch *src, size_t size) : src_(src), begin_(src), end_(src + size), size_(size) {} + + Ch Peek() const { return RAPIDJSON_UNLIKELY(src_ == end_) ? '\0' : *src_; } + Ch Take() { return RAPIDJSON_UNLIKELY(src_ == end_) ? '\0' : *src_++; } + size_t Tell() const { return static_cast(src_ - begin_); } + + Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; } + void Put(Ch) { RAPIDJSON_ASSERT(false); } + void Flush() { RAPIDJSON_ASSERT(false); } + size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; } + + // For encoding detection only. + const Ch* Peek4() const { + return Tell() + 4 <= size_ ? src_ : 0; + } + + const Ch* src_; //!< Current read position. + const Ch* begin_; //!< Original head of the string. + const Ch* end_; //!< End of stream. + size_t size_; //!< Size of the stream. +}; + +RAPIDJSON_NAMESPACE_END + +#ifdef __clang__ +RAPIDJSON_DIAG_POP +#endif + +#endif // RAPIDJSON_MEMORYBUFFER_H_ diff --git a/umd/external/include/rapidjson/msinttypes/inttypes.h b/umd/external/include/rapidjson/msinttypes/inttypes.h new file mode 100644 index 00000000..18111286 --- /dev/null +++ b/umd/external/include/rapidjson/msinttypes/inttypes.h @@ -0,0 +1,316 @@ +// ISO C9x compliant inttypes.h for Microsoft Visual Studio +// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 +// +// Copyright (c) 2006-2013 Alexander Chemeris +// +// 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 name of the product 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 AUTHOR ``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 AUTHOR 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. +// +/////////////////////////////////////////////////////////////////////////////// + +// The above software in this distribution may have been modified by +// THL A29 Limited ("Tencent Modifications"). +// All Tencent Modifications are Copyright (C) 2015 THL A29 Limited. + +#ifndef _MSC_VER // [ +#error "Use this header only with Microsoft Visual C++ compilers!" +#endif // _MSC_VER ] + +#ifndef _MSC_INTTYPES_H_ // [ +#define _MSC_INTTYPES_H_ + +#if _MSC_VER > 1000 +#pragma once +#endif + +#include "stdint.h" + +// miloyip: VC supports inttypes.h since VC2013 +#if _MSC_VER >= 1800 +#include +#else + +// 7.8 Format conversion of integer types + +typedef struct { + intmax_t quot; + intmax_t rem; +} imaxdiv_t; + +// 7.8.1 Macros for format specifiers + +#if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) // [ See footnote 185 at page 198 + +// The fprintf macros for signed integers are: +#define PRId8 "d" +#define PRIi8 "i" +#define PRIdLEAST8 "d" +#define PRIiLEAST8 "i" +#define PRIdFAST8 "d" +#define PRIiFAST8 "i" + +#define PRId16 "hd" +#define PRIi16 "hi" +#define PRIdLEAST16 "hd" +#define PRIiLEAST16 "hi" +#define PRIdFAST16 "hd" +#define PRIiFAST16 "hi" + +#define PRId32 "I32d" +#define PRIi32 "I32i" +#define PRIdLEAST32 "I32d" +#define PRIiLEAST32 "I32i" +#define PRIdFAST32 "I32d" +#define PRIiFAST32 "I32i" + +#define PRId64 "I64d" +#define PRIi64 "I64i" +#define PRIdLEAST64 "I64d" +#define PRIiLEAST64 "I64i" +#define PRIdFAST64 "I64d" +#define PRIiFAST64 "I64i" + +#define PRIdMAX "I64d" +#define PRIiMAX "I64i" + +#define PRIdPTR "Id" +#define PRIiPTR "Ii" + +// The fprintf macros for unsigned integers are: +#define PRIo8 "o" +#define PRIu8 "u" +#define PRIx8 "x" +#define PRIX8 "X" +#define PRIoLEAST8 "o" +#define PRIuLEAST8 "u" +#define PRIxLEAST8 "x" +#define PRIXLEAST8 "X" +#define PRIoFAST8 "o" +#define PRIuFAST8 "u" +#define PRIxFAST8 "x" +#define PRIXFAST8 "X" + +#define PRIo16 "ho" +#define PRIu16 "hu" +#define PRIx16 "hx" +#define PRIX16 "hX" +#define PRIoLEAST16 "ho" +#define PRIuLEAST16 "hu" +#define PRIxLEAST16 "hx" +#define PRIXLEAST16 "hX" +#define PRIoFAST16 "ho" +#define PRIuFAST16 "hu" +#define PRIxFAST16 "hx" +#define PRIXFAST16 "hX" + +#define PRIo32 "I32o" +#define PRIu32 "I32u" +#define PRIx32 "I32x" +#define PRIX32 "I32X" +#define PRIoLEAST32 "I32o" +#define PRIuLEAST32 "I32u" +#define PRIxLEAST32 "I32x" +#define PRIXLEAST32 "I32X" +#define PRIoFAST32 "I32o" +#define PRIuFAST32 "I32u" +#define PRIxFAST32 "I32x" +#define PRIXFAST32 "I32X" + +#define PRIo64 "I64o" +#define PRIu64 "I64u" +#define PRIx64 "I64x" +#define PRIX64 "I64X" +#define PRIoLEAST64 "I64o" +#define PRIuLEAST64 "I64u" +#define PRIxLEAST64 "I64x" +#define PRIXLEAST64 "I64X" +#define PRIoFAST64 "I64o" +#define PRIuFAST64 "I64u" +#define PRIxFAST64 "I64x" +#define PRIXFAST64 "I64X" + +#define PRIoMAX "I64o" +#define PRIuMAX "I64u" +#define PRIxMAX "I64x" +#define PRIXMAX "I64X" + +#define PRIoPTR "Io" +#define PRIuPTR "Iu" +#define PRIxPTR "Ix" +#define PRIXPTR "IX" + +// The fscanf macros for signed integers are: +#define SCNd8 "d" +#define SCNi8 "i" +#define SCNdLEAST8 "d" +#define SCNiLEAST8 "i" +#define SCNdFAST8 "d" +#define SCNiFAST8 "i" + +#define SCNd16 "hd" +#define SCNi16 "hi" +#define SCNdLEAST16 "hd" +#define SCNiLEAST16 "hi" +#define SCNdFAST16 "hd" +#define SCNiFAST16 "hi" + +#define SCNd32 "ld" +#define SCNi32 "li" +#define SCNdLEAST32 "ld" +#define SCNiLEAST32 "li" +#define SCNdFAST32 "ld" +#define SCNiFAST32 "li" + +#define SCNd64 "I64d" +#define SCNi64 "I64i" +#define SCNdLEAST64 "I64d" +#define SCNiLEAST64 "I64i" +#define SCNdFAST64 "I64d" +#define SCNiFAST64 "I64i" + +#define SCNdMAX "I64d" +#define SCNiMAX "I64i" + +#ifdef _WIN64 // [ +# define SCNdPTR "I64d" +# define SCNiPTR "I64i" +#else // _WIN64 ][ +# define SCNdPTR "ld" +# define SCNiPTR "li" +#endif // _WIN64 ] + +// The fscanf macros for unsigned integers are: +#define SCNo8 "o" +#define SCNu8 "u" +#define SCNx8 "x" +#define SCNX8 "X" +#define SCNoLEAST8 "o" +#define SCNuLEAST8 "u" +#define SCNxLEAST8 "x" +#define SCNXLEAST8 "X" +#define SCNoFAST8 "o" +#define SCNuFAST8 "u" +#define SCNxFAST8 "x" +#define SCNXFAST8 "X" + +#define SCNo16 "ho" +#define SCNu16 "hu" +#define SCNx16 "hx" +#define SCNX16 "hX" +#define SCNoLEAST16 "ho" +#define SCNuLEAST16 "hu" +#define SCNxLEAST16 "hx" +#define SCNXLEAST16 "hX" +#define SCNoFAST16 "ho" +#define SCNuFAST16 "hu" +#define SCNxFAST16 "hx" +#define SCNXFAST16 "hX" + +#define SCNo32 "lo" +#define SCNu32 "lu" +#define SCNx32 "lx" +#define SCNX32 "lX" +#define SCNoLEAST32 "lo" +#define SCNuLEAST32 "lu" +#define SCNxLEAST32 "lx" +#define SCNXLEAST32 "lX" +#define SCNoFAST32 "lo" +#define SCNuFAST32 "lu" +#define SCNxFAST32 "lx" +#define SCNXFAST32 "lX" + +#define SCNo64 "I64o" +#define SCNu64 "I64u" +#define SCNx64 "I64x" +#define SCNX64 "I64X" +#define SCNoLEAST64 "I64o" +#define SCNuLEAST64 "I64u" +#define SCNxLEAST64 "I64x" +#define SCNXLEAST64 "I64X" +#define SCNoFAST64 "I64o" +#define SCNuFAST64 "I64u" +#define SCNxFAST64 "I64x" +#define SCNXFAST64 "I64X" + +#define SCNoMAX "I64o" +#define SCNuMAX "I64u" +#define SCNxMAX "I64x" +#define SCNXMAX "I64X" + +#ifdef _WIN64 // [ +# define SCNoPTR "I64o" +# define SCNuPTR "I64u" +# define SCNxPTR "I64x" +# define SCNXPTR "I64X" +#else // _WIN64 ][ +# define SCNoPTR "lo" +# define SCNuPTR "lu" +# define SCNxPTR "lx" +# define SCNXPTR "lX" +#endif // _WIN64 ] + +#endif // __STDC_FORMAT_MACROS ] + +// 7.8.2 Functions for greatest-width integer types + +// 7.8.2.1 The imaxabs function +#define imaxabs _abs64 + +// 7.8.2.2 The imaxdiv function + +// This is modified version of div() function from Microsoft's div.c found +// in %MSVC.NET%\crt\src\div.c +#ifdef STATIC_IMAXDIV // [ +static +#else // STATIC_IMAXDIV ][ +_inline +#endif // STATIC_IMAXDIV ] +imaxdiv_t __cdecl imaxdiv(intmax_t numer, intmax_t denom) +{ + imaxdiv_t result; + + result.quot = numer / denom; + result.rem = numer % denom; + + if (numer < 0 && result.rem > 0) { + // did division wrong; must fix up + ++result.quot; + result.rem -= denom; + } + + return result; +} + +// 7.8.2.3 The strtoimax and strtoumax functions +#define strtoimax _strtoi64 +#define strtoumax _strtoui64 + +// 7.8.2.4 The wcstoimax and wcstoumax functions +#define wcstoimax _wcstoi64 +#define wcstoumax _wcstoui64 + +#endif // _MSC_VER >= 1800 + +#endif // _MSC_INTTYPES_H_ ] diff --git a/umd/external/include/rapidjson/msinttypes/stdint.h b/umd/external/include/rapidjson/msinttypes/stdint.h new file mode 100644 index 00000000..3d4477b9 --- /dev/null +++ b/umd/external/include/rapidjson/msinttypes/stdint.h @@ -0,0 +1,300 @@ +// ISO C9x compliant stdint.h for Microsoft Visual Studio +// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 +// +// Copyright (c) 2006-2013 Alexander Chemeris +// +// 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 name of the product 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 AUTHOR ``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 AUTHOR 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. +// +/////////////////////////////////////////////////////////////////////////////// + +// The above software in this distribution may have been modified by +// THL A29 Limited ("Tencent Modifications"). +// All Tencent Modifications are Copyright (C) 2015 THL A29 Limited. + +#ifndef _MSC_VER // [ +#error "Use this header only with Microsoft Visual C++ compilers!" +#endif // _MSC_VER ] + +#ifndef _MSC_STDINT_H_ // [ +#define _MSC_STDINT_H_ + +#if _MSC_VER > 1000 +#pragma once +#endif + +// miloyip: Originally Visual Studio 2010 uses its own stdint.h. However it generates warning with INT64_C(), so change to use this file for vs2010. +#if _MSC_VER >= 1600 // [ +#include + +#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [ See footnote 224 at page 260 + +#undef INT8_C +#undef INT16_C +#undef INT32_C +#undef INT64_C +#undef UINT8_C +#undef UINT16_C +#undef UINT32_C +#undef UINT64_C + +// 7.18.4.1 Macros for minimum-width integer constants + +#define INT8_C(val) val##i8 +#define INT16_C(val) val##i16 +#define INT32_C(val) val##i32 +#define INT64_C(val) val##i64 + +#define UINT8_C(val) val##ui8 +#define UINT16_C(val) val##ui16 +#define UINT32_C(val) val##ui32 +#define UINT64_C(val) val##ui64 + +// 7.18.4.2 Macros for greatest-width integer constants +// These #ifndef's are needed to prevent collisions with . +// Check out Issue 9 for the details. +#ifndef INTMAX_C // [ +# define INTMAX_C INT64_C +#endif // INTMAX_C ] +#ifndef UINTMAX_C // [ +# define UINTMAX_C UINT64_C +#endif // UINTMAX_C ] + +#endif // __STDC_CONSTANT_MACROS ] + +#else // ] _MSC_VER >= 1700 [ + +#include + +// For Visual Studio 6 in C++ mode and for many Visual Studio versions when +// compiling for ARM we have to wrap include with 'extern "C++" {}' +// or compiler would give many errors like this: +// error C2733: second C linkage of overloaded function 'wmemchr' not allowed +#if defined(__cplusplus) && !defined(_M_ARM) +extern "C" { +#endif +# include +#if defined(__cplusplus) && !defined(_M_ARM) +} +#endif + +// Define _W64 macros to mark types changing their size, like intptr_t. +#ifndef _W64 +# if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300 +# define _W64 __w64 +# else +# define _W64 +# endif +#endif + + +// 7.18.1 Integer types + +// 7.18.1.1 Exact-width integer types + +// Visual Studio 6 and Embedded Visual C++ 4 doesn't +// realize that, e.g. char has the same size as __int8 +// so we give up on __intX for them. +#if (_MSC_VER < 1300) + typedef signed char int8_t; + typedef signed short int16_t; + typedef signed int int32_t; + typedef unsigned char uint8_t; + typedef unsigned short uint16_t; + typedef unsigned int uint32_t; +#else + typedef signed __int8 int8_t; + typedef signed __int16 int16_t; + typedef signed __int32 int32_t; + typedef unsigned __int8 uint8_t; + typedef unsigned __int16 uint16_t; + typedef unsigned __int32 uint32_t; +#endif +typedef signed __int64 int64_t; +typedef unsigned __int64 uint64_t; + + +// 7.18.1.2 Minimum-width integer types +typedef int8_t int_least8_t; +typedef int16_t int_least16_t; +typedef int32_t int_least32_t; +typedef int64_t int_least64_t; +typedef uint8_t uint_least8_t; +typedef uint16_t uint_least16_t; +typedef uint32_t uint_least32_t; +typedef uint64_t uint_least64_t; + +// 7.18.1.3 Fastest minimum-width integer types +typedef int8_t int_fast8_t; +typedef int16_t int_fast16_t; +typedef int32_t int_fast32_t; +typedef int64_t int_fast64_t; +typedef uint8_t uint_fast8_t; +typedef uint16_t uint_fast16_t; +typedef uint32_t uint_fast32_t; +typedef uint64_t uint_fast64_t; + +// 7.18.1.4 Integer types capable of holding object pointers +#ifdef _WIN64 // [ + typedef signed __int64 intptr_t; + typedef unsigned __int64 uintptr_t; +#else // _WIN64 ][ + typedef _W64 signed int intptr_t; + typedef _W64 unsigned int uintptr_t; +#endif // _WIN64 ] + +// 7.18.1.5 Greatest-width integer types +typedef int64_t intmax_t; +typedef uint64_t uintmax_t; + + +// 7.18.2 Limits of specified-width integer types + +#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [ See footnote 220 at page 257 and footnote 221 at page 259 + +// 7.18.2.1 Limits of exact-width integer types +#define INT8_MIN ((int8_t)_I8_MIN) +#define INT8_MAX _I8_MAX +#define INT16_MIN ((int16_t)_I16_MIN) +#define INT16_MAX _I16_MAX +#define INT32_MIN ((int32_t)_I32_MIN) +#define INT32_MAX _I32_MAX +#define INT64_MIN ((int64_t)_I64_MIN) +#define INT64_MAX _I64_MAX +#define UINT8_MAX _UI8_MAX +#define UINT16_MAX _UI16_MAX +#define UINT32_MAX _UI32_MAX +#define UINT64_MAX _UI64_MAX + +// 7.18.2.2 Limits of minimum-width integer types +#define INT_LEAST8_MIN INT8_MIN +#define INT_LEAST8_MAX INT8_MAX +#define INT_LEAST16_MIN INT16_MIN +#define INT_LEAST16_MAX INT16_MAX +#define INT_LEAST32_MIN INT32_MIN +#define INT_LEAST32_MAX INT32_MAX +#define INT_LEAST64_MIN INT64_MIN +#define INT_LEAST64_MAX INT64_MAX +#define UINT_LEAST8_MAX UINT8_MAX +#define UINT_LEAST16_MAX UINT16_MAX +#define UINT_LEAST32_MAX UINT32_MAX +#define UINT_LEAST64_MAX UINT64_MAX + +// 7.18.2.3 Limits of fastest minimum-width integer types +#define INT_FAST8_MIN INT8_MIN +#define INT_FAST8_MAX INT8_MAX +#define INT_FAST16_MIN INT16_MIN +#define INT_FAST16_MAX INT16_MAX +#define INT_FAST32_MIN INT32_MIN +#define INT_FAST32_MAX INT32_MAX +#define INT_FAST64_MIN INT64_MIN +#define INT_FAST64_MAX INT64_MAX +#define UINT_FAST8_MAX UINT8_MAX +#define UINT_FAST16_MAX UINT16_MAX +#define UINT_FAST32_MAX UINT32_MAX +#define UINT_FAST64_MAX UINT64_MAX + +// 7.18.2.4 Limits of integer types capable of holding object pointers +#ifdef _WIN64 // [ +# define INTPTR_MIN INT64_MIN +# define INTPTR_MAX INT64_MAX +# define UINTPTR_MAX UINT64_MAX +#else // _WIN64 ][ +# define INTPTR_MIN INT32_MIN +# define INTPTR_MAX INT32_MAX +# define UINTPTR_MAX UINT32_MAX +#endif // _WIN64 ] + +// 7.18.2.5 Limits of greatest-width integer types +#define INTMAX_MIN INT64_MIN +#define INTMAX_MAX INT64_MAX +#define UINTMAX_MAX UINT64_MAX + +// 7.18.3 Limits of other integer types + +#ifdef _WIN64 // [ +# define PTRDIFF_MIN _I64_MIN +# define PTRDIFF_MAX _I64_MAX +#else // _WIN64 ][ +# define PTRDIFF_MIN _I32_MIN +# define PTRDIFF_MAX _I32_MAX +#endif // _WIN64 ] + +#define SIG_ATOMIC_MIN INT_MIN +#define SIG_ATOMIC_MAX INT_MAX + +#ifndef SIZE_MAX // [ +# ifdef _WIN64 // [ +# define SIZE_MAX _UI64_MAX +# else // _WIN64 ][ +# define SIZE_MAX _UI32_MAX +# endif // _WIN64 ] +#endif // SIZE_MAX ] + +// WCHAR_MIN and WCHAR_MAX are also defined in +#ifndef WCHAR_MIN // [ +# define WCHAR_MIN 0 +#endif // WCHAR_MIN ] +#ifndef WCHAR_MAX // [ +# define WCHAR_MAX _UI16_MAX +#endif // WCHAR_MAX ] + +#define WINT_MIN 0 +#define WINT_MAX _UI16_MAX + +#endif // __STDC_LIMIT_MACROS ] + + +// 7.18.4 Limits of other integer types + +#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [ See footnote 224 at page 260 + +// 7.18.4.1 Macros for minimum-width integer constants + +#define INT8_C(val) val##i8 +#define INT16_C(val) val##i16 +#define INT32_C(val) val##i32 +#define INT64_C(val) val##i64 + +#define UINT8_C(val) val##ui8 +#define UINT16_C(val) val##ui16 +#define UINT32_C(val) val##ui32 +#define UINT64_C(val) val##ui64 + +// 7.18.4.2 Macros for greatest-width integer constants +// These #ifndef's are needed to prevent collisions with . +// Check out Issue 9 for the details. +#ifndef INTMAX_C // [ +# define INTMAX_C INT64_C +#endif // INTMAX_C ] +#ifndef UINTMAX_C // [ +# define UINTMAX_C UINT64_C +#endif // UINTMAX_C ] + +#endif // __STDC_CONSTANT_MACROS ] + +#endif // _MSC_VER >= 1600 ] + +#endif // _MSC_STDINT_H_ ] diff --git a/umd/external/include/rapidjson/ostreamwrapper.h b/umd/external/include/rapidjson/ostreamwrapper.h new file mode 100644 index 00000000..6f4667c0 --- /dev/null +++ b/umd/external/include/rapidjson/ostreamwrapper.h @@ -0,0 +1,81 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef RAPIDJSON_OSTREAMWRAPPER_H_ +#define RAPIDJSON_OSTREAMWRAPPER_H_ + +#include "stream.h" +#include + +#ifdef __clang__ +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(padded) +#endif + +RAPIDJSON_NAMESPACE_BEGIN + +//! Wrapper of \c std::basic_ostream into RapidJSON's Stream concept. +/*! + The classes can be wrapped including but not limited to: + + - \c std::ostringstream + - \c std::stringstream + - \c std::wpstringstream + - \c std::wstringstream + - \c std::ifstream + - \c std::fstream + - \c std::wofstream + - \c std::wfstream + + \tparam StreamType Class derived from \c std::basic_ostream. +*/ + +template +class BasicOStreamWrapper { +public: + typedef typename StreamType::char_type Ch; + BasicOStreamWrapper(StreamType& stream) : stream_(stream) {} + + void Put(Ch c) { + stream_.put(c); + } + + void Flush() { + stream_.flush(); + } + + // Not implemented + char Peek() const { RAPIDJSON_ASSERT(false); return 0; } + char Take() { RAPIDJSON_ASSERT(false); return 0; } + size_t Tell() const { RAPIDJSON_ASSERT(false); return 0; } + char* PutBegin() { RAPIDJSON_ASSERT(false); return 0; } + size_t PutEnd(char*) { RAPIDJSON_ASSERT(false); return 0; } + +private: + BasicOStreamWrapper(const BasicOStreamWrapper&); + BasicOStreamWrapper& operator=(const BasicOStreamWrapper&); + + StreamType& stream_; +}; + +typedef BasicOStreamWrapper OStreamWrapper; +typedef BasicOStreamWrapper WOStreamWrapper; + +#ifdef __clang__ +RAPIDJSON_DIAG_POP +#endif + +RAPIDJSON_NAMESPACE_END + +#endif // RAPIDJSON_OSTREAMWRAPPER_H_ diff --git a/umd/external/include/rapidjson/pointer.h b/umd/external/include/rapidjson/pointer.h new file mode 100644 index 00000000..0f377efe --- /dev/null +++ b/umd/external/include/rapidjson/pointer.h @@ -0,0 +1,1358 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef RAPIDJSON_POINTER_H_ +#define RAPIDJSON_POINTER_H_ + +#include "document.h" +#include "internal/itoa.h" + +#ifdef __clang__ +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(switch-enum) +#endif + +#ifdef _MSC_VER +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(4512) // assignment operator could not be generated +#endif + +RAPIDJSON_NAMESPACE_BEGIN + +static const SizeType kPointerInvalidIndex = ~SizeType(0); //!< Represents an invalid index in GenericPointer::Token + +//! Error code of parsing. +/*! \ingroup RAPIDJSON_ERRORS + \see GenericPointer::GenericPointer, GenericPointer::GetParseErrorCode +*/ +enum PointerParseErrorCode { + kPointerParseErrorNone = 0, //!< The parse is successful + + kPointerParseErrorTokenMustBeginWithSolidus, //!< A token must begin with a '/' + kPointerParseErrorInvalidEscape, //!< Invalid escape + kPointerParseErrorInvalidPercentEncoding, //!< Invalid percent encoding in URI fragment + kPointerParseErrorCharacterMustPercentEncode //!< A character must percent encoded in URI fragment +}; + +/////////////////////////////////////////////////////////////////////////////// +// GenericPointer + +//! Represents a JSON Pointer. Use Pointer for UTF8 encoding and default allocator. +/*! + This class implements RFC 6901 "JavaScript Object Notation (JSON) Pointer" + (https://tools.ietf.org/html/rfc6901). + + A JSON pointer is for identifying a specific value in a JSON document + (GenericDocument). It can simplify coding of DOM tree manipulation, because it + can access multiple-level depth of DOM tree with single API call. + + After it parses a string representation (e.g. "/foo/0" or URI fragment + representation (e.g. "#/foo/0") into its internal representation (tokens), + it can be used to resolve a specific value in multiple documents, or sub-tree + of documents. + + Contrary to GenericValue, Pointer can be copy constructed and copy assigned. + Apart from assignment, a Pointer cannot be modified after construction. + + Although Pointer is very convenient, please aware that constructing Pointer + involves parsing and dynamic memory allocation. A special constructor with user- + supplied tokens eliminates these. + + GenericPointer depends on GenericDocument and GenericValue. + + \tparam ValueType The value type of the DOM tree. E.g. GenericValue > + \tparam Allocator The allocator type for allocating memory for internal representation. + + \note GenericPointer uses same encoding of ValueType. + However, Allocator of GenericPointer is independent of Allocator of Value. +*/ +template +class GenericPointer { +public: + typedef typename ValueType::EncodingType EncodingType; //!< Encoding type from Value + typedef typename ValueType::Ch Ch; //!< Character type from Value + + //! A token is the basic units of internal representation. + /*! + A JSON pointer string representation "/foo/123" is parsed to two tokens: + "foo" and 123. 123 will be represented in both numeric form and string form. + They are resolved according to the actual value type (object or array). + + For token that are not numbers, or the numeric value is out of bound + (greater than limits of SizeType), they are only treated as string form + (i.e. the token's index will be equal to kPointerInvalidIndex). + + This struct is public so that user can create a Pointer without parsing and + allocation, using a special constructor. + */ + struct Token { + const Ch* name; //!< Name of the token. It has null character at the end but it can contain null character. + SizeType length; //!< Length of the name. + SizeType index; //!< A valid array index, if it is not equal to kPointerInvalidIndex. + }; + + //!@name Constructors and destructor. + //@{ + + //! Default constructor. + GenericPointer(Allocator* allocator = 0) : allocator_(allocator), ownAllocator_(), nameBuffer_(), tokens_(), tokenCount_(), parseErrorOffset_(), parseErrorCode_(kPointerParseErrorNone) {} + + //! Constructor that parses a string or URI fragment representation. + /*! + \param source A null-terminated, string or URI fragment representation of JSON pointer. + \param allocator User supplied allocator for this pointer. If no allocator is provided, it creates a self-owned one. + */ + explicit GenericPointer(const Ch* source, Allocator* allocator = 0) : allocator_(allocator), ownAllocator_(), nameBuffer_(), tokens_(), tokenCount_(), parseErrorOffset_(), parseErrorCode_(kPointerParseErrorNone) { + Parse(source, internal::StrLen(source)); + } + +#if RAPIDJSON_HAS_STDSTRING + //! Constructor that parses a string or URI fragment representation. + /*! + \param source A string or URI fragment representation of JSON pointer. + \param allocator User supplied allocator for this pointer. If no allocator is provided, it creates a self-owned one. + \note Requires the definition of the preprocessor symbol \ref RAPIDJSON_HAS_STDSTRING. + */ + explicit GenericPointer(const std::basic_string& source, Allocator* allocator = 0) : allocator_(allocator), ownAllocator_(), nameBuffer_(), tokens_(), tokenCount_(), parseErrorOffset_(), parseErrorCode_(kPointerParseErrorNone) { + Parse(source.c_str(), source.size()); + } +#endif + + //! Constructor that parses a string or URI fragment representation, with length of the source string. + /*! + \param source A string or URI fragment representation of JSON pointer. + \param length Length of source. + \param allocator User supplied allocator for this pointer. If no allocator is provided, it creates a self-owned one. + \note Slightly faster than the overload without length. + */ + GenericPointer(const Ch* source, size_t length, Allocator* allocator = 0) : allocator_(allocator), ownAllocator_(), nameBuffer_(), tokens_(), tokenCount_(), parseErrorOffset_(), parseErrorCode_(kPointerParseErrorNone) { + Parse(source, length); + } + + //! Constructor with user-supplied tokens. + /*! + This constructor let user supplies const array of tokens. + This prevents the parsing process and eliminates allocation. + This is preferred for memory constrained environments. + + \param tokens An constant array of tokens representing the JSON pointer. + \param tokenCount Number of tokens. + + \b Example + \code + #define NAME(s) { s, sizeof(s) / sizeof(s[0]) - 1, kPointerInvalidIndex } + #define INDEX(i) { #i, sizeof(#i) - 1, i } + + static const Pointer::Token kTokens[] = { NAME("foo"), INDEX(123) }; + static const Pointer p(kTokens, sizeof(kTokens) / sizeof(kTokens[0])); + // Equivalent to static const Pointer p("/foo/123"); + + #undef NAME + #undef INDEX + \endcode + */ + GenericPointer(const Token* tokens, size_t tokenCount) : allocator_(), ownAllocator_(), nameBuffer_(), tokens_(const_cast(tokens)), tokenCount_(tokenCount), parseErrorOffset_(), parseErrorCode_(kPointerParseErrorNone) {} + + //! Copy constructor. + GenericPointer(const GenericPointer& rhs, Allocator* allocator = 0) : allocator_(allocator), ownAllocator_(), nameBuffer_(), tokens_(), tokenCount_(), parseErrorOffset_(), parseErrorCode_(kPointerParseErrorNone) { + *this = rhs; + } + + //! Destructor. + ~GenericPointer() { + if (nameBuffer_) // If user-supplied tokens constructor is used, nameBuffer_ is nullptr and tokens_ are not deallocated. + Allocator::Free(tokens_); + RAPIDJSON_DELETE(ownAllocator_); + } + + //! Assignment operator. + GenericPointer& operator=(const GenericPointer& rhs) { + if (this != &rhs) { + // Do not delete ownAllcator + if (nameBuffer_) + Allocator::Free(tokens_); + + tokenCount_ = rhs.tokenCount_; + parseErrorOffset_ = rhs.parseErrorOffset_; + parseErrorCode_ = rhs.parseErrorCode_; + + if (rhs.nameBuffer_) + CopyFromRaw(rhs); // Normally parsed tokens. + else { + tokens_ = rhs.tokens_; // User supplied const tokens. + nameBuffer_ = 0; + } + } + return *this; + } + + //@} + + //!@name Append token + //@{ + + //! Append a token and return a new Pointer + /*! + \param token Token to be appended. + \param allocator Allocator for the newly return Pointer. + \return A new Pointer with appended token. + */ + GenericPointer Append(const Token& token, Allocator* allocator = 0) const { + GenericPointer r; + r.allocator_ = allocator; + Ch *p = r.CopyFromRaw(*this, 1, token.length + 1); + std::memcpy(p, token.name, (token.length + 1) * sizeof(Ch)); + r.tokens_[tokenCount_].name = p; + r.tokens_[tokenCount_].length = token.length; + r.tokens_[tokenCount_].index = token.index; + return r; + } + + //! Append a name token with length, and return a new Pointer + /*! + \param name Name to be appended. + \param length Length of name. + \param allocator Allocator for the newly return Pointer. + \return A new Pointer with appended token. + */ + GenericPointer Append(const Ch* name, SizeType length, Allocator* allocator = 0) const { + Token token = { name, length, kPointerInvalidIndex }; + return Append(token, allocator); + } + + //! Append a name token without length, and return a new Pointer + /*! + \param name Name (const Ch*) to be appended. + \param allocator Allocator for the newly return Pointer. + \return A new Pointer with appended token. + */ + template + RAPIDJSON_DISABLEIF_RETURN((internal::NotExpr::Type, Ch> >), (GenericPointer)) + Append(T* name, Allocator* allocator = 0) const { + return Append(name, internal::StrLen(name), allocator); + } + +#if RAPIDJSON_HAS_STDSTRING + //! Append a name token, and return a new Pointer + /*! + \param name Name to be appended. + \param allocator Allocator for the newly return Pointer. + \return A new Pointer with appended token. + */ + GenericPointer Append(const std::basic_string& name, Allocator* allocator = 0) const { + return Append(name.c_str(), static_cast(name.size()), allocator); + } +#endif + + //! Append a index token, and return a new Pointer + /*! + \param index Index to be appended. + \param allocator Allocator for the newly return Pointer. + \return A new Pointer with appended token. + */ + GenericPointer Append(SizeType index, Allocator* allocator = 0) const { + char buffer[21]; + char* end = sizeof(SizeType) == 4 ? internal::u32toa(index, buffer) : internal::u64toa(index, buffer); + SizeType length = static_cast(end - buffer); + buffer[length] = '\0'; + + if (sizeof(Ch) == 1) { + Token token = { reinterpret_cast(buffer), length, index }; + return Append(token, allocator); + } + else { + Ch name[21]; + for (size_t i = 0; i <= length; i++) + name[i] = static_cast(buffer[i]); + Token token = { name, length, index }; + return Append(token, allocator); + } + } + + //! Append a token by value, and return a new Pointer + /*! + \param token token to be appended. + \param allocator Allocator for the newly return Pointer. + \return A new Pointer with appended token. + */ + GenericPointer Append(const ValueType& token, Allocator* allocator = 0) const { + if (token.IsString()) + return Append(token.GetString(), token.GetStringLength(), allocator); + else { + RAPIDJSON_ASSERT(token.IsUint64()); + RAPIDJSON_ASSERT(token.GetUint64() <= SizeType(~0)); + return Append(static_cast(token.GetUint64()), allocator); + } + } + + //!@name Handling Parse Error + //@{ + + //! Check whether this is a valid pointer. + bool IsValid() const { return parseErrorCode_ == kPointerParseErrorNone; } + + //! Get the parsing error offset in code unit. + size_t GetParseErrorOffset() const { return parseErrorOffset_; } + + //! Get the parsing error code. + PointerParseErrorCode GetParseErrorCode() const { return parseErrorCode_; } + + //@} + + //! Get the allocator of this pointer. + Allocator& GetAllocator() { return *allocator_; } + + //!@name Tokens + //@{ + + //! Get the token array (const version only). + const Token* GetTokens() const { return tokens_; } + + //! Get the number of tokens. + size_t GetTokenCount() const { return tokenCount_; } + + //@} + + //!@name Equality/inequality operators + //@{ + + //! Equality operator. + /*! + \note When any pointers are invalid, always returns false. + */ + bool operator==(const GenericPointer& rhs) const { + if (!IsValid() || !rhs.IsValid() || tokenCount_ != rhs.tokenCount_) + return false; + + for (size_t i = 0; i < tokenCount_; i++) { + if (tokens_[i].index != rhs.tokens_[i].index || + tokens_[i].length != rhs.tokens_[i].length || + (tokens_[i].length != 0 && std::memcmp(tokens_[i].name, rhs.tokens_[i].name, sizeof(Ch)* tokens_[i].length) != 0)) + { + return false; + } + } + + return true; + } + + //! Inequality operator. + /*! + \note When any pointers are invalid, always returns true. + */ + bool operator!=(const GenericPointer& rhs) const { return !(*this == rhs); } + + //@} + + //!@name Stringify + //@{ + + //! Stringify the pointer into string representation. + /*! + \tparam OutputStream Type of output stream. + \param os The output stream. + */ + template + bool Stringify(OutputStream& os) const { + return Stringify(os); + } + + //! Stringify the pointer into URI fragment representation. + /*! + \tparam OutputStream Type of output stream. + \param os The output stream. + */ + template + bool StringifyUriFragment(OutputStream& os) const { + return Stringify(os); + } + + //@} + + //!@name Create value + //@{ + + //! Create a value in a subtree. + /*! + If the value is not exist, it creates all parent values and a JSON Null value. + So it always succeed and return the newly created or existing value. + + Remind that it may change types of parents according to tokens, so it + potentially removes previously stored values. For example, if a document + was an array, and "/foo" is used to create a value, then the document + will be changed to an object, and all existing array elements are lost. + + \param root Root value of a DOM subtree to be resolved. It can be any value other than document root. + \param allocator Allocator for creating the values if the specified value or its parents are not exist. + \param alreadyExist If non-null, it stores whether the resolved value is already exist. + \return The resolved newly created (a JSON Null value), or already exists value. + */ + ValueType& Create(ValueType& root, typename ValueType::AllocatorType& allocator, bool* alreadyExist = 0) const { + RAPIDJSON_ASSERT(IsValid()); + ValueType* v = &root; + bool exist = true; + for (const Token *t = tokens_; t != tokens_ + tokenCount_; ++t) { + if (v->IsArray() && t->name[0] == '-' && t->length == 1) { + v->PushBack(ValueType().Move(), allocator); + v = &((*v)[v->Size() - 1]); + exist = false; + } + else { + if (t->index == kPointerInvalidIndex) { // must be object name + if (!v->IsObject()) + v->SetObject(); // Change to Object + } + else { // object name or array index + if (!v->IsArray() && !v->IsObject()) + v->SetArray(); // Change to Array + } + + if (v->IsArray()) { + if (t->index >= v->Size()) { + v->Reserve(t->index + 1, allocator); + while (t->index >= v->Size()) + v->PushBack(ValueType().Move(), allocator); + exist = false; + } + v = &((*v)[t->index]); + } + else { + typename ValueType::MemberIterator m = v->FindMember(GenericStringRef(t->name, t->length)); + if (m == v->MemberEnd()) { + v->AddMember(ValueType(t->name, t->length, allocator).Move(), ValueType().Move(), allocator); + v = &(--v->MemberEnd())->value; // Assumes AddMember() appends at the end + exist = false; + } + else + v = &m->value; + } + } + } + + if (alreadyExist) + *alreadyExist = exist; + + return *v; + } + + //! Creates a value in a document. + /*! + \param document A document to be resolved. + \param alreadyExist If non-null, it stores whether the resolved value is already exist. + \return The resolved newly created, or already exists value. + */ + template + ValueType& Create(GenericDocument& document, bool* alreadyExist = 0) const { + return Create(document, document.GetAllocator(), alreadyExist); + } + + //@} + + //!@name Query value + //@{ + + //! Query a value in a subtree. + /*! + \param root Root value of a DOM sub-tree to be resolved. It can be any value other than document root. + \param unresolvedTokenIndex If the pointer cannot resolve a token in the pointer, this parameter can obtain the index of unresolved token. + \return Pointer to the value if it can be resolved. Otherwise null. + + \note + There are only 3 situations when a value cannot be resolved: + 1. A value in the path is not an array nor object. + 2. An object value does not contain the token. + 3. A token is out of range of an array value. + + Use unresolvedTokenIndex to retrieve the token index. + */ + ValueType* Get(ValueType& root, size_t* unresolvedTokenIndex = 0) const { + RAPIDJSON_ASSERT(IsValid()); + ValueType* v = &root; + for (const Token *t = tokens_; t != tokens_ + tokenCount_; ++t) { + switch (v->GetType()) { + case kObjectType: + { + typename ValueType::MemberIterator m = v->FindMember(GenericStringRef(t->name, t->length)); + if (m == v->MemberEnd()) + break; + v = &m->value; + } + continue; + case kArrayType: + if (t->index == kPointerInvalidIndex || t->index >= v->Size()) + break; + v = &((*v)[t->index]); + continue; + default: + break; + } + + // Error: unresolved token + if (unresolvedTokenIndex) + *unresolvedTokenIndex = static_cast(t - tokens_); + return 0; + } + return v; + } + + //! Query a const value in a const subtree. + /*! + \param root Root value of a DOM sub-tree to be resolved. It can be any value other than document root. + \return Pointer to the value if it can be resolved. Otherwise null. + */ + const ValueType* Get(const ValueType& root, size_t* unresolvedTokenIndex = 0) const { + return Get(const_cast(root), unresolvedTokenIndex); + } + + //@} + + //!@name Query a value with default + //@{ + + //! Query a value in a subtree with default value. + /*! + Similar to Get(), but if the specified value do not exists, it creates all parents and clone the default value. + So that this function always succeed. + + \param root Root value of a DOM sub-tree to be resolved. It can be any value other than document root. + \param defaultValue Default value to be cloned if the value was not exists. + \param allocator Allocator for creating the values if the specified value or its parents are not exist. + \see Create() + */ + ValueType& GetWithDefault(ValueType& root, const ValueType& defaultValue, typename ValueType::AllocatorType& allocator) const { + bool alreadyExist; + Value& v = Create(root, allocator, &alreadyExist); + return alreadyExist ? v : v.CopyFrom(defaultValue, allocator); + } + + //! Query a value in a subtree with default null-terminated string. + ValueType& GetWithDefault(ValueType& root, const Ch* defaultValue, typename ValueType::AllocatorType& allocator) const { + bool alreadyExist; + Value& v = Create(root, allocator, &alreadyExist); + return alreadyExist ? v : v.SetString(defaultValue, allocator); + } + +#if RAPIDJSON_HAS_STDSTRING + //! Query a value in a subtree with default std::basic_string. + ValueType& GetWithDefault(ValueType& root, const std::basic_string& defaultValue, typename ValueType::AllocatorType& allocator) const { + bool alreadyExist; + Value& v = Create(root, allocator, &alreadyExist); + return alreadyExist ? v : v.SetString(defaultValue, allocator); + } +#endif + + //! Query a value in a subtree with default primitive value. + /*! + \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t, \c bool + */ + template + RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (ValueType&)) + GetWithDefault(ValueType& root, T defaultValue, typename ValueType::AllocatorType& allocator) const { + return GetWithDefault(root, ValueType(defaultValue).Move(), allocator); + } + + //! Query a value in a document with default value. + template + ValueType& GetWithDefault(GenericDocument& document, const ValueType& defaultValue) const { + return GetWithDefault(document, defaultValue, document.GetAllocator()); + } + + //! Query a value in a document with default null-terminated string. + template + ValueType& GetWithDefault(GenericDocument& document, const Ch* defaultValue) const { + return GetWithDefault(document, defaultValue, document.GetAllocator()); + } + +#if RAPIDJSON_HAS_STDSTRING + //! Query a value in a document with default std::basic_string. + template + ValueType& GetWithDefault(GenericDocument& document, const std::basic_string& defaultValue) const { + return GetWithDefault(document, defaultValue, document.GetAllocator()); + } +#endif + + //! Query a value in a document with default primitive value. + /*! + \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t, \c bool + */ + template + RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (ValueType&)) + GetWithDefault(GenericDocument& document, T defaultValue) const { + return GetWithDefault(document, defaultValue, document.GetAllocator()); + } + + //@} + + //!@name Set a value + //@{ + + //! Set a value in a subtree, with move semantics. + /*! + It creates all parents if they are not exist or types are different to the tokens. + So this function always succeeds but potentially remove existing values. + + \param root Root value of a DOM sub-tree to be resolved. It can be any value other than document root. + \param value Value to be set. + \param allocator Allocator for creating the values if the specified value or its parents are not exist. + \see Create() + */ + ValueType& Set(ValueType& root, ValueType& value, typename ValueType::AllocatorType& allocator) const { + return Create(root, allocator) = value; + } + + //! Set a value in a subtree, with copy semantics. + ValueType& Set(ValueType& root, const ValueType& value, typename ValueType::AllocatorType& allocator) const { + return Create(root, allocator).CopyFrom(value, allocator); + } + + //! Set a null-terminated string in a subtree. + ValueType& Set(ValueType& root, const Ch* value, typename ValueType::AllocatorType& allocator) const { + return Create(root, allocator) = ValueType(value, allocator).Move(); + } + +#if RAPIDJSON_HAS_STDSTRING + //! Set a std::basic_string in a subtree. + ValueType& Set(ValueType& root, const std::basic_string& value, typename ValueType::AllocatorType& allocator) const { + return Create(root, allocator) = ValueType(value, allocator).Move(); + } +#endif + + //! Set a primitive value in a subtree. + /*! + \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t, \c bool + */ + template + RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (ValueType&)) + Set(ValueType& root, T value, typename ValueType::AllocatorType& allocator) const { + return Create(root, allocator) = ValueType(value).Move(); + } + + //! Set a value in a document, with move semantics. + template + ValueType& Set(GenericDocument& document, ValueType& value) const { + return Create(document) = value; + } + + //! Set a value in a document, with copy semantics. + template + ValueType& Set(GenericDocument& document, const ValueType& value) const { + return Create(document).CopyFrom(value, document.GetAllocator()); + } + + //! Set a null-terminated string in a document. + template + ValueType& Set(GenericDocument& document, const Ch* value) const { + return Create(document) = ValueType(value, document.GetAllocator()).Move(); + } + +#if RAPIDJSON_HAS_STDSTRING + //! Sets a std::basic_string in a document. + template + ValueType& Set(GenericDocument& document, const std::basic_string& value) const { + return Create(document) = ValueType(value, document.GetAllocator()).Move(); + } +#endif + + //! Set a primitive value in a document. + /*! + \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t, \c bool + */ + template + RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (ValueType&)) + Set(GenericDocument& document, T value) const { + return Create(document) = value; + } + + //@} + + //!@name Swap a value + //@{ + + //! Swap a value with a value in a subtree. + /*! + It creates all parents if they are not exist or types are different to the tokens. + So this function always succeeds but potentially remove existing values. + + \param root Root value of a DOM sub-tree to be resolved. It can be any value other than document root. + \param value Value to be swapped. + \param allocator Allocator for creating the values if the specified value or its parents are not exist. + \see Create() + */ + ValueType& Swap(ValueType& root, ValueType& value, typename ValueType::AllocatorType& allocator) const { + return Create(root, allocator).Swap(value); + } + + //! Swap a value with a value in a document. + template + ValueType& Swap(GenericDocument& document, ValueType& value) const { + return Create(document).Swap(value); + } + + //@} + + //! Erase a value in a subtree. + /*! + \param root Root value of a DOM sub-tree to be resolved. It can be any value other than document root. + \return Whether the resolved value is found and erased. + + \note Erasing with an empty pointer \c Pointer(""), i.e. the root, always fail and return false. + */ + bool Erase(ValueType& root) const { + RAPIDJSON_ASSERT(IsValid()); + if (tokenCount_ == 0) // Cannot erase the root + return false; + + ValueType* v = &root; + const Token* last = tokens_ + (tokenCount_ - 1); + for (const Token *t = tokens_; t != last; ++t) { + switch (v->GetType()) { + case kObjectType: + { + typename ValueType::MemberIterator m = v->FindMember(GenericStringRef(t->name, t->length)); + if (m == v->MemberEnd()) + return false; + v = &m->value; + } + break; + case kArrayType: + if (t->index == kPointerInvalidIndex || t->index >= v->Size()) + return false; + v = &((*v)[t->index]); + break; + default: + return false; + } + } + + switch (v->GetType()) { + case kObjectType: + return v->EraseMember(GenericStringRef(last->name, last->length)); + case kArrayType: + if (last->index == kPointerInvalidIndex || last->index >= v->Size()) + return false; + v->Erase(v->Begin() + last->index); + return true; + default: + return false; + } + } + +private: + //! Clone the content from rhs to this. + /*! + \param rhs Source pointer. + \param extraToken Extra tokens to be allocated. + \param extraNameBufferSize Extra name buffer size (in number of Ch) to be allocated. + \return Start of non-occupied name buffer, for storing extra names. + */ + Ch* CopyFromRaw(const GenericPointer& rhs, size_t extraToken = 0, size_t extraNameBufferSize = 0) { + if (!allocator_) // allocator is independently owned. + ownAllocator_ = allocator_ = RAPIDJSON_NEW(Allocator)(); + + size_t nameBufferSize = rhs.tokenCount_; // null terminators for tokens + for (Token *t = rhs.tokens_; t != rhs.tokens_ + rhs.tokenCount_; ++t) + nameBufferSize += t->length; + + tokenCount_ = rhs.tokenCount_ + extraToken; + tokens_ = static_cast(allocator_->Malloc(tokenCount_ * sizeof(Token) + (nameBufferSize + extraNameBufferSize) * sizeof(Ch))); + nameBuffer_ = reinterpret_cast(tokens_ + tokenCount_); + if (rhs.tokenCount_ > 0) { + std::memcpy(tokens_, rhs.tokens_, rhs.tokenCount_ * sizeof(Token)); + } + if (nameBufferSize > 0) { + std::memcpy(nameBuffer_, rhs.nameBuffer_, nameBufferSize * sizeof(Ch)); + } + + // Adjust pointers to name buffer + std::ptrdiff_t diff = nameBuffer_ - rhs.nameBuffer_; + for (Token *t = tokens_; t != tokens_ + rhs.tokenCount_; ++t) + t->name += diff; + + return nameBuffer_ + nameBufferSize; + } + + //! Check whether a character should be percent-encoded. + /*! + According to RFC 3986 2.3 Unreserved Characters. + \param c The character (code unit) to be tested. + */ + bool NeedPercentEncode(Ch c) const { + return !((c >= '0' && c <= '9') || (c >= 'A' && c <='Z') || (c >= 'a' && c <= 'z') || c == '-' || c == '.' || c == '_' || c =='~'); + } + + //! Parse a JSON String or its URI fragment representation into tokens. +#ifndef __clang__ // -Wdocumentation + /*! + \param source Either a JSON Pointer string, or its URI fragment representation. Not need to be null terminated. + \param length Length of the source string. + \note Source cannot be JSON String Representation of JSON Pointer, e.g. In "/\u0000", \u0000 will not be unescaped. + */ +#endif + void Parse(const Ch* source, size_t length) { + RAPIDJSON_ASSERT(source != NULL); + RAPIDJSON_ASSERT(nameBuffer_ == 0); + RAPIDJSON_ASSERT(tokens_ == 0); + + // Create own allocator if user did not supply. + if (!allocator_) + ownAllocator_ = allocator_ = RAPIDJSON_NEW(Allocator)(); + + // Count number of '/' as tokenCount + tokenCount_ = 0; + for (const Ch* s = source; s != source + length; s++) + if (*s == '/') + tokenCount_++; + + Token* token = tokens_ = static_cast(allocator_->Malloc(tokenCount_ * sizeof(Token) + length * sizeof(Ch))); + Ch* name = nameBuffer_ = reinterpret_cast(tokens_ + tokenCount_); + size_t i = 0; + + // Detect if it is a URI fragment + bool uriFragment = false; + if (source[i] == '#') { + uriFragment = true; + i++; + } + + if (i != length && source[i] != '/') { + parseErrorCode_ = kPointerParseErrorTokenMustBeginWithSolidus; + goto error; + } + + while (i < length) { + RAPIDJSON_ASSERT(source[i] == '/'); + i++; // consumes '/' + + token->name = name; + bool isNumber = true; + + while (i < length && source[i] != '/') { + Ch c = source[i]; + if (uriFragment) { + // Decoding percent-encoding for URI fragment + if (c == '%') { + PercentDecodeStream is(&source[i], source + length); + GenericInsituStringStream os(name); + Ch* begin = os.PutBegin(); + if (!Transcoder, EncodingType>().Validate(is, os) || !is.IsValid()) { + parseErrorCode_ = kPointerParseErrorInvalidPercentEncoding; + goto error; + } + size_t len = os.PutEnd(begin); + i += is.Tell() - 1; + if (len == 1) + c = *name; + else { + name += len; + isNumber = false; + i++; + continue; + } + } + else if (NeedPercentEncode(c)) { + parseErrorCode_ = kPointerParseErrorCharacterMustPercentEncode; + goto error; + } + } + + i++; + + // Escaping "~0" -> '~', "~1" -> '/' + if (c == '~') { + if (i < length) { + c = source[i]; + if (c == '0') c = '~'; + else if (c == '1') c = '/'; + else { + parseErrorCode_ = kPointerParseErrorInvalidEscape; + goto error; + } + i++; + } + else { + parseErrorCode_ = kPointerParseErrorInvalidEscape; + goto error; + } + } + + // First check for index: all of characters are digit + if (c < '0' || c > '9') + isNumber = false; + + *name++ = c; + } + token->length = static_cast(name - token->name); + if (token->length == 0) + isNumber = false; + *name++ = '\0'; // Null terminator + + // Second check for index: more than one digit cannot have leading zero + if (isNumber && token->length > 1 && token->name[0] == '0') + isNumber = false; + + // String to SizeType conversion + SizeType n = 0; + if (isNumber) { + for (size_t j = 0; j < token->length; j++) { + SizeType m = n * 10 + static_cast(token->name[j] - '0'); + if (m < n) { // overflow detection + isNumber = false; + break; + } + n = m; + } + } + + token->index = isNumber ? n : kPointerInvalidIndex; + token++; + } + + RAPIDJSON_ASSERT(name <= nameBuffer_ + length); // Should not overflow buffer + parseErrorCode_ = kPointerParseErrorNone; + return; + + error: + Allocator::Free(tokens_); + nameBuffer_ = 0; + tokens_ = 0; + tokenCount_ = 0; + parseErrorOffset_ = i; + return; + } + + //! Stringify to string or URI fragment representation. + /*! + \tparam uriFragment True for stringifying to URI fragment representation. False for string representation. + \tparam OutputStream type of output stream. + \param os The output stream. + */ + template + bool Stringify(OutputStream& os) const { + RAPIDJSON_ASSERT(IsValid()); + + if (uriFragment) + os.Put('#'); + + for (Token *t = tokens_; t != tokens_ + tokenCount_; ++t) { + os.Put('/'); + for (size_t j = 0; j < t->length; j++) { + Ch c = t->name[j]; + if (c == '~') { + os.Put('~'); + os.Put('0'); + } + else if (c == '/') { + os.Put('~'); + os.Put('1'); + } + else if (uriFragment && NeedPercentEncode(c)) { + // Transcode to UTF8 sequence + GenericStringStream source(&t->name[j]); + PercentEncodeStream target(os); + if (!Transcoder >().Validate(source, target)) + return false; + j += source.Tell() - 1; + } + else + os.Put(c); + } + } + return true; + } + + //! A helper stream for decoding a percent-encoded sequence into code unit. + /*! + This stream decodes %XY triplet into code unit (0-255). + If it encounters invalid characters, it sets output code unit as 0 and + mark invalid, and to be checked by IsValid(). + */ + class PercentDecodeStream { + public: + typedef typename ValueType::Ch Ch; + + //! Constructor + /*! + \param source Start of the stream + \param end Past-the-end of the stream. + */ + PercentDecodeStream(const Ch* source, const Ch* end) : src_(source), head_(source), end_(end), valid_(true) {} + + Ch Take() { + if (*src_ != '%' || src_ + 3 > end_) { // %XY triplet + valid_ = false; + return 0; + } + src_++; + Ch c = 0; + for (int j = 0; j < 2; j++) { + c = static_cast(c << 4); + Ch h = *src_; + if (h >= '0' && h <= '9') c = static_cast(c + h - '0'); + else if (h >= 'A' && h <= 'F') c = static_cast(c + h - 'A' + 10); + else if (h >= 'a' && h <= 'f') c = static_cast(c + h - 'a' + 10); + else { + valid_ = false; + return 0; + } + src_++; + } + return c; + } + + size_t Tell() const { return static_cast(src_ - head_); } + bool IsValid() const { return valid_; } + + private: + const Ch* src_; //!< Current read position. + const Ch* head_; //!< Original head of the string. + const Ch* end_; //!< Past-the-end position. + bool valid_; //!< Whether the parsing is valid. + }; + + //! A helper stream to encode character (UTF-8 code unit) into percent-encoded sequence. + template + class PercentEncodeStream { + public: + PercentEncodeStream(OutputStream& os) : os_(os) {} + void Put(char c) { // UTF-8 must be byte + unsigned char u = static_cast(c); + static const char hexDigits[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; + os_.Put('%'); + os_.Put(static_cast(hexDigits[u >> 4])); + os_.Put(static_cast(hexDigits[u & 15])); + } + private: + OutputStream& os_; + }; + + Allocator* allocator_; //!< The current allocator. It is either user-supplied or equal to ownAllocator_. + Allocator* ownAllocator_; //!< Allocator owned by this Pointer. + Ch* nameBuffer_; //!< A buffer containing all names in tokens. + Token* tokens_; //!< A list of tokens. + size_t tokenCount_; //!< Number of tokens in tokens_. + size_t parseErrorOffset_; //!< Offset in code unit when parsing fail. + PointerParseErrorCode parseErrorCode_; //!< Parsing error code. +}; + +//! GenericPointer for Value (UTF-8, default allocator). +typedef GenericPointer Pointer; + +//!@name Helper functions for GenericPointer +//@{ + +////////////////////////////////////////////////////////////////////////////// + +template +typename T::ValueType& CreateValueByPointer(T& root, const GenericPointer& pointer, typename T::AllocatorType& a) { + return pointer.Create(root, a); +} + +template +typename T::ValueType& CreateValueByPointer(T& root, const CharType(&source)[N], typename T::AllocatorType& a) { + return GenericPointer(source, N - 1).Create(root, a); +} + +// No allocator parameter + +template +typename DocumentType::ValueType& CreateValueByPointer(DocumentType& document, const GenericPointer& pointer) { + return pointer.Create(document); +} + +template +typename DocumentType::ValueType& CreateValueByPointer(DocumentType& document, const CharType(&source)[N]) { + return GenericPointer(source, N - 1).Create(document); +} + +////////////////////////////////////////////////////////////////////////////// + +template +typename T::ValueType* GetValueByPointer(T& root, const GenericPointer& pointer, size_t* unresolvedTokenIndex = 0) { + return pointer.Get(root, unresolvedTokenIndex); +} + +template +const typename T::ValueType* GetValueByPointer(const T& root, const GenericPointer& pointer, size_t* unresolvedTokenIndex = 0) { + return pointer.Get(root, unresolvedTokenIndex); +} + +template +typename T::ValueType* GetValueByPointer(T& root, const CharType (&source)[N], size_t* unresolvedTokenIndex = 0) { + return GenericPointer(source, N - 1).Get(root, unresolvedTokenIndex); +} + +template +const typename T::ValueType* GetValueByPointer(const T& root, const CharType(&source)[N], size_t* unresolvedTokenIndex = 0) { + return GenericPointer(source, N - 1).Get(root, unresolvedTokenIndex); +} + +////////////////////////////////////////////////////////////////////////////// + +template +typename T::ValueType& GetValueByPointerWithDefault(T& root, const GenericPointer& pointer, const typename T::ValueType& defaultValue, typename T::AllocatorType& a) { + return pointer.GetWithDefault(root, defaultValue, a); +} + +template +typename T::ValueType& GetValueByPointerWithDefault(T& root, const GenericPointer& pointer, const typename T::Ch* defaultValue, typename T::AllocatorType& a) { + return pointer.GetWithDefault(root, defaultValue, a); +} + +#if RAPIDJSON_HAS_STDSTRING +template +typename T::ValueType& GetValueByPointerWithDefault(T& root, const GenericPointer& pointer, const std::basic_string& defaultValue, typename T::AllocatorType& a) { + return pointer.GetWithDefault(root, defaultValue, a); +} +#endif + +template +RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (typename T::ValueType&)) +GetValueByPointerWithDefault(T& root, const GenericPointer& pointer, T2 defaultValue, typename T::AllocatorType& a) { + return pointer.GetWithDefault(root, defaultValue, a); +} + +template +typename T::ValueType& GetValueByPointerWithDefault(T& root, const CharType(&source)[N], const typename T::ValueType& defaultValue, typename T::AllocatorType& a) { + return GenericPointer(source, N - 1).GetWithDefault(root, defaultValue, a); +} + +template +typename T::ValueType& GetValueByPointerWithDefault(T& root, const CharType(&source)[N], const typename T::Ch* defaultValue, typename T::AllocatorType& a) { + return GenericPointer(source, N - 1).GetWithDefault(root, defaultValue, a); +} + +#if RAPIDJSON_HAS_STDSTRING +template +typename T::ValueType& GetValueByPointerWithDefault(T& root, const CharType(&source)[N], const std::basic_string& defaultValue, typename T::AllocatorType& a) { + return GenericPointer(source, N - 1).GetWithDefault(root, defaultValue, a); +} +#endif + +template +RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (typename T::ValueType&)) +GetValueByPointerWithDefault(T& root, const CharType(&source)[N], T2 defaultValue, typename T::AllocatorType& a) { + return GenericPointer(source, N - 1).GetWithDefault(root, defaultValue, a); +} + +// No allocator parameter + +template +typename DocumentType::ValueType& GetValueByPointerWithDefault(DocumentType& document, const GenericPointer& pointer, const typename DocumentType::ValueType& defaultValue) { + return pointer.GetWithDefault(document, defaultValue); +} + +template +typename DocumentType::ValueType& GetValueByPointerWithDefault(DocumentType& document, const GenericPointer& pointer, const typename DocumentType::Ch* defaultValue) { + return pointer.GetWithDefault(document, defaultValue); +} + +#if RAPIDJSON_HAS_STDSTRING +template +typename DocumentType::ValueType& GetValueByPointerWithDefault(DocumentType& document, const GenericPointer& pointer, const std::basic_string& defaultValue) { + return pointer.GetWithDefault(document, defaultValue); +} +#endif + +template +RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (typename DocumentType::ValueType&)) +GetValueByPointerWithDefault(DocumentType& document, const GenericPointer& pointer, T2 defaultValue) { + return pointer.GetWithDefault(document, defaultValue); +} + +template +typename DocumentType::ValueType& GetValueByPointerWithDefault(DocumentType& document, const CharType(&source)[N], const typename DocumentType::ValueType& defaultValue) { + return GenericPointer(source, N - 1).GetWithDefault(document, defaultValue); +} + +template +typename DocumentType::ValueType& GetValueByPointerWithDefault(DocumentType& document, const CharType(&source)[N], const typename DocumentType::Ch* defaultValue) { + return GenericPointer(source, N - 1).GetWithDefault(document, defaultValue); +} + +#if RAPIDJSON_HAS_STDSTRING +template +typename DocumentType::ValueType& GetValueByPointerWithDefault(DocumentType& document, const CharType(&source)[N], const std::basic_string& defaultValue) { + return GenericPointer(source, N - 1).GetWithDefault(document, defaultValue); +} +#endif + +template +RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (typename DocumentType::ValueType&)) +GetValueByPointerWithDefault(DocumentType& document, const CharType(&source)[N], T2 defaultValue) { + return GenericPointer(source, N - 1).GetWithDefault(document, defaultValue); +} + +////////////////////////////////////////////////////////////////////////////// + +template +typename T::ValueType& SetValueByPointer(T& root, const GenericPointer& pointer, typename T::ValueType& value, typename T::AllocatorType& a) { + return pointer.Set(root, value, a); +} + +template +typename T::ValueType& SetValueByPointer(T& root, const GenericPointer& pointer, const typename T::ValueType& value, typename T::AllocatorType& a) { + return pointer.Set(root, value, a); +} + +template +typename T::ValueType& SetValueByPointer(T& root, const GenericPointer& pointer, const typename T::Ch* value, typename T::AllocatorType& a) { + return pointer.Set(root, value, a); +} + +#if RAPIDJSON_HAS_STDSTRING +template +typename T::ValueType& SetValueByPointer(T& root, const GenericPointer& pointer, const std::basic_string& value, typename T::AllocatorType& a) { + return pointer.Set(root, value, a); +} +#endif + +template +RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (typename T::ValueType&)) +SetValueByPointer(T& root, const GenericPointer& pointer, T2 value, typename T::AllocatorType& a) { + return pointer.Set(root, value, a); +} + +template +typename T::ValueType& SetValueByPointer(T& root, const CharType(&source)[N], typename T::ValueType& value, typename T::AllocatorType& a) { + return GenericPointer(source, N - 1).Set(root, value, a); +} + +template +typename T::ValueType& SetValueByPointer(T& root, const CharType(&source)[N], const typename T::ValueType& value, typename T::AllocatorType& a) { + return GenericPointer(source, N - 1).Set(root, value, a); +} + +template +typename T::ValueType& SetValueByPointer(T& root, const CharType(&source)[N], const typename T::Ch* value, typename T::AllocatorType& a) { + return GenericPointer(source, N - 1).Set(root, value, a); +} + +#if RAPIDJSON_HAS_STDSTRING +template +typename T::ValueType& SetValueByPointer(T& root, const CharType(&source)[N], const std::basic_string& value, typename T::AllocatorType& a) { + return GenericPointer(source, N - 1).Set(root, value, a); +} +#endif + +template +RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (typename T::ValueType&)) +SetValueByPointer(T& root, const CharType(&source)[N], T2 value, typename T::AllocatorType& a) { + return GenericPointer(source, N - 1).Set(root, value, a); +} + +// No allocator parameter + +template +typename DocumentType::ValueType& SetValueByPointer(DocumentType& document, const GenericPointer& pointer, typename DocumentType::ValueType& value) { + return pointer.Set(document, value); +} + +template +typename DocumentType::ValueType& SetValueByPointer(DocumentType& document, const GenericPointer& pointer, const typename DocumentType::ValueType& value) { + return pointer.Set(document, value); +} + +template +typename DocumentType::ValueType& SetValueByPointer(DocumentType& document, const GenericPointer& pointer, const typename DocumentType::Ch* value) { + return pointer.Set(document, value); +} + +#if RAPIDJSON_HAS_STDSTRING +template +typename DocumentType::ValueType& SetValueByPointer(DocumentType& document, const GenericPointer& pointer, const std::basic_string& value) { + return pointer.Set(document, value); +} +#endif + +template +RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (typename DocumentType::ValueType&)) +SetValueByPointer(DocumentType& document, const GenericPointer& pointer, T2 value) { + return pointer.Set(document, value); +} + +template +typename DocumentType::ValueType& SetValueByPointer(DocumentType& document, const CharType(&source)[N], typename DocumentType::ValueType& value) { + return GenericPointer(source, N - 1).Set(document, value); +} + +template +typename DocumentType::ValueType& SetValueByPointer(DocumentType& document, const CharType(&source)[N], const typename DocumentType::ValueType& value) { + return GenericPointer(source, N - 1).Set(document, value); +} + +template +typename DocumentType::ValueType& SetValueByPointer(DocumentType& document, const CharType(&source)[N], const typename DocumentType::Ch* value) { + return GenericPointer(source, N - 1).Set(document, value); +} + +#if RAPIDJSON_HAS_STDSTRING +template +typename DocumentType::ValueType& SetValueByPointer(DocumentType& document, const CharType(&source)[N], const std::basic_string& value) { + return GenericPointer(source, N - 1).Set(document, value); +} +#endif + +template +RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr, internal::IsGenericValue >), (typename DocumentType::ValueType&)) +SetValueByPointer(DocumentType& document, const CharType(&source)[N], T2 value) { + return GenericPointer(source, N - 1).Set(document, value); +} + +////////////////////////////////////////////////////////////////////////////// + +template +typename T::ValueType& SwapValueByPointer(T& root, const GenericPointer& pointer, typename T::ValueType& value, typename T::AllocatorType& a) { + return pointer.Swap(root, value, a); +} + +template +typename T::ValueType& SwapValueByPointer(T& root, const CharType(&source)[N], typename T::ValueType& value, typename T::AllocatorType& a) { + return GenericPointer(source, N - 1).Swap(root, value, a); +} + +template +typename DocumentType::ValueType& SwapValueByPointer(DocumentType& document, const GenericPointer& pointer, typename DocumentType::ValueType& value) { + return pointer.Swap(document, value); +} + +template +typename DocumentType::ValueType& SwapValueByPointer(DocumentType& document, const CharType(&source)[N], typename DocumentType::ValueType& value) { + return GenericPointer(source, N - 1).Swap(document, value); +} + +////////////////////////////////////////////////////////////////////////////// + +template +bool EraseValueByPointer(T& root, const GenericPointer& pointer) { + return pointer.Erase(root); +} + +template +bool EraseValueByPointer(T& root, const CharType(&source)[N]) { + return GenericPointer(source, N - 1).Erase(root); +} + +//@} + +RAPIDJSON_NAMESPACE_END + +#ifdef __clang__ +RAPIDJSON_DIAG_POP +#endif + +#ifdef _MSC_VER +RAPIDJSON_DIAG_POP +#endif + +#endif // RAPIDJSON_POINTER_H_ diff --git a/umd/external/include/rapidjson/prettywriter.h b/umd/external/include/rapidjson/prettywriter.h new file mode 100644 index 00000000..98dfb306 --- /dev/null +++ b/umd/external/include/rapidjson/prettywriter.h @@ -0,0 +1,277 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef RAPIDJSON_PRETTYWRITER_H_ +#define RAPIDJSON_PRETTYWRITER_H_ + +#include "writer.h" + +#ifdef __GNUC__ +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(effc++) +#endif + +#if defined(__clang__) +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(c++98-compat) +#endif + +RAPIDJSON_NAMESPACE_BEGIN + +//! Combination of PrettyWriter format flags. +/*! \see PrettyWriter::SetFormatOptions + */ +enum PrettyFormatOptions { + kFormatDefault = 0, //!< Default pretty formatting. + kFormatSingleLineArray = 1 //!< Format arrays on a single line. +}; + +//! Writer with indentation and spacing. +/*! + \tparam OutputStream Type of ouptut os. + \tparam SourceEncoding Encoding of source string. + \tparam TargetEncoding Encoding of output stream. + \tparam StackAllocator Type of allocator for allocating memory of stack. +*/ +template, typename TargetEncoding = UTF8<>, typename StackAllocator = CrtAllocator, unsigned writeFlags = kWriteDefaultFlags> +class PrettyWriter : public Writer { +public: + typedef Writer Base; + typedef typename Base::Ch Ch; + + //! Constructor + /*! \param os Output stream. + \param allocator User supplied allocator. If it is null, it will create a private one. + \param levelDepth Initial capacity of stack. + */ + explicit PrettyWriter(OutputStream& os, StackAllocator* allocator = 0, size_t levelDepth = Base::kDefaultLevelDepth) : + Base(os, allocator, levelDepth), indentChar_(' '), indentCharCount_(4), formatOptions_(kFormatDefault) {} + + + explicit PrettyWriter(StackAllocator* allocator = 0, size_t levelDepth = Base::kDefaultLevelDepth) : + Base(allocator, levelDepth), indentChar_(' '), indentCharCount_(4) {} + +#if RAPIDJSON_HAS_CXX11_RVALUE_REFS + PrettyWriter(PrettyWriter&& rhs) : + Base(std::forward(rhs)), indentChar_(rhs.indentChar_), indentCharCount_(rhs.indentCharCount_), formatOptions_(rhs.formatOptions_) {} +#endif + + //! Set custom indentation. + /*! \param indentChar Character for indentation. Must be whitespace character (' ', '\\t', '\\n', '\\r'). + \param indentCharCount Number of indent characters for each indentation level. + \note The default indentation is 4 spaces. + */ + PrettyWriter& SetIndent(Ch indentChar, unsigned indentCharCount) { + RAPIDJSON_ASSERT(indentChar == ' ' || indentChar == '\t' || indentChar == '\n' || indentChar == '\r'); + indentChar_ = indentChar; + indentCharCount_ = indentCharCount; + return *this; + } + + //! Set pretty writer formatting options. + /*! \param options Formatting options. + */ + PrettyWriter& SetFormatOptions(PrettyFormatOptions options) { + formatOptions_ = options; + return *this; + } + + /*! @name Implementation of Handler + \see Handler + */ + //@{ + + bool Null() { PrettyPrefix(kNullType); return Base::WriteNull(); } + bool Bool(bool b) { PrettyPrefix(b ? kTrueType : kFalseType); return Base::WriteBool(b); } + bool Int(int i) { PrettyPrefix(kNumberType); return Base::WriteInt(i); } + bool Uint(unsigned u) { PrettyPrefix(kNumberType); return Base::WriteUint(u); } + bool Int64(int64_t i64) { PrettyPrefix(kNumberType); return Base::WriteInt64(i64); } + bool Uint64(uint64_t u64) { PrettyPrefix(kNumberType); return Base::WriteUint64(u64); } + bool Double(double d) { PrettyPrefix(kNumberType); return Base::WriteDouble(d); } + + bool RawNumber(const Ch* str, SizeType length, bool copy = false) { + RAPIDJSON_ASSERT(str != 0); + (void)copy; + PrettyPrefix(kNumberType); + return Base::WriteString(str, length); + } + + bool String(const Ch* str, SizeType length, bool copy = false) { + RAPIDJSON_ASSERT(str != 0); + (void)copy; + PrettyPrefix(kStringType); + return Base::WriteString(str, length); + } + +#if RAPIDJSON_HAS_STDSTRING + bool String(const std::basic_string& str) { + return String(str.data(), SizeType(str.size())); + } +#endif + + bool StartObject() { + PrettyPrefix(kObjectType); + new (Base::level_stack_.template Push()) typename Base::Level(false); + return Base::WriteStartObject(); + } + + bool Key(const Ch* str, SizeType length, bool copy = false) { return String(str, length, copy); } + +#if RAPIDJSON_HAS_STDSTRING + bool Key(const std::basic_string& str) { + return Key(str.data(), SizeType(str.size())); + } +#endif + + bool EndObject(SizeType memberCount = 0) { + (void)memberCount; + RAPIDJSON_ASSERT(Base::level_stack_.GetSize() >= sizeof(typename Base::Level)); // not inside an Object + RAPIDJSON_ASSERT(!Base::level_stack_.template Top()->inArray); // currently inside an Array, not Object + RAPIDJSON_ASSERT(0 == Base::level_stack_.template Top()->valueCount % 2); // Object has a Key without a Value + + bool empty = Base::level_stack_.template Pop(1)->valueCount == 0; + + if (!empty) { + Base::os_->Put('\n'); + WriteIndent(); + } + bool ret = Base::WriteEndObject(); + (void)ret; + RAPIDJSON_ASSERT(ret == true); + if (Base::level_stack_.Empty()) // end of json text + Base::Flush(); + return true; + } + + bool StartArray() { + PrettyPrefix(kArrayType); + new (Base::level_stack_.template Push()) typename Base::Level(true); + return Base::WriteStartArray(); + } + + bool EndArray(SizeType memberCount = 0) { + (void)memberCount; + RAPIDJSON_ASSERT(Base::level_stack_.GetSize() >= sizeof(typename Base::Level)); + RAPIDJSON_ASSERT(Base::level_stack_.template Top()->inArray); + bool empty = Base::level_stack_.template Pop(1)->valueCount == 0; + + if (!empty && !(formatOptions_ & kFormatSingleLineArray)) { + Base::os_->Put('\n'); + WriteIndent(); + } + bool ret = Base::WriteEndArray(); + (void)ret; + RAPIDJSON_ASSERT(ret == true); + if (Base::level_stack_.Empty()) // end of json text + Base::Flush(); + return true; + } + + //@} + + /*! @name Convenience extensions */ + //@{ + + //! Simpler but slower overload. + bool String(const Ch* str) { return String(str, internal::StrLen(str)); } + bool Key(const Ch* str) { return Key(str, internal::StrLen(str)); } + + //@} + + //! Write a raw JSON value. + /*! + For user to write a stringified JSON as a value. + + \param json A well-formed JSON value. It should not contain null character within [0, length - 1] range. + \param length Length of the json. + \param type Type of the root of json. + \note When using PrettyWriter::RawValue(), the result json may not be indented correctly. + */ + bool RawValue(const Ch* json, size_t length, Type type) { + RAPIDJSON_ASSERT(json != 0); + PrettyPrefix(type); + return Base::WriteRawValue(json, length); + } + +protected: + void PrettyPrefix(Type type) { + (void)type; + if (Base::level_stack_.GetSize() != 0) { // this value is not at root + typename Base::Level* level = Base::level_stack_.template Top(); + + if (level->inArray) { + if (level->valueCount > 0) { + Base::os_->Put(','); // add comma if it is not the first element in array + if (formatOptions_ & kFormatSingleLineArray) + Base::os_->Put(' '); + } + + if (!(formatOptions_ & kFormatSingleLineArray)) { + Base::os_->Put('\n'); + WriteIndent(); + } + } + else { // in object + if (level->valueCount > 0) { + if (level->valueCount % 2 == 0) { + Base::os_->Put(','); + Base::os_->Put('\n'); + } + else { + Base::os_->Put(':'); + Base::os_->Put(' '); + } + } + else + Base::os_->Put('\n'); + + if (level->valueCount % 2 == 0) + WriteIndent(); + } + if (!level->inArray && level->valueCount % 2 == 0) + RAPIDJSON_ASSERT(type == kStringType); // if it's in object, then even number should be a name + level->valueCount++; + } + else { + RAPIDJSON_ASSERT(!Base::hasRoot_); // Should only has one and only one root. + Base::hasRoot_ = true; + } + } + + void WriteIndent() { + size_t count = (Base::level_stack_.GetSize() / sizeof(typename Base::Level)) * indentCharCount_; + PutN(*Base::os_, static_cast(indentChar_), count); + } + + Ch indentChar_; + unsigned indentCharCount_; + PrettyFormatOptions formatOptions_; + +private: + // Prohibit copy constructor & assignment operator. + PrettyWriter(const PrettyWriter&); + PrettyWriter& operator=(const PrettyWriter&); +}; + +RAPIDJSON_NAMESPACE_END + +#if defined(__clang__) +RAPIDJSON_DIAG_POP +#endif + +#ifdef __GNUC__ +RAPIDJSON_DIAG_POP +#endif + +#endif // RAPIDJSON_RAPIDJSON_H_ diff --git a/umd/external/include/rapidjson/rapidjson.h b/umd/external/include/rapidjson/rapidjson.h new file mode 100644 index 00000000..57ab8514 --- /dev/null +++ b/umd/external/include/rapidjson/rapidjson.h @@ -0,0 +1,628 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef RAPIDJSON_RAPIDJSON_H_ +#define RAPIDJSON_RAPIDJSON_H_ + +/*!\file rapidjson.h + \brief common definitions and configuration + + \see RAPIDJSON_CONFIG + */ + +/*! \defgroup RAPIDJSON_CONFIG RapidJSON configuration + \brief Configuration macros for library features + + Some RapidJSON features are configurable to adapt the library to a wide + variety of platforms, environments and usage scenarios. Most of the + features can be configured in terms of overriden or predefined + preprocessor macros at compile-time. + + Some additional customization is available in the \ref RAPIDJSON_ERRORS APIs. + + \note These macros should be given on the compiler command-line + (where applicable) to avoid inconsistent values when compiling + different translation units of a single application. + */ + +#include // malloc(), realloc(), free(), size_t +#include // memset(), memcpy(), memmove(), memcmp() + +/////////////////////////////////////////////////////////////////////////////// +// RAPIDJSON_VERSION_STRING +// +// ALWAYS synchronize the following 3 macros with corresponding variables in /CMakeLists.txt. +// + +//!@cond RAPIDJSON_HIDDEN_FROM_DOXYGEN +// token stringification +#define RAPIDJSON_STRINGIFY(x) RAPIDJSON_DO_STRINGIFY(x) +#define RAPIDJSON_DO_STRINGIFY(x) #x + +// token concatenation +#define RAPIDJSON_JOIN(X, Y) RAPIDJSON_DO_JOIN(X, Y) +#define RAPIDJSON_DO_JOIN(X, Y) RAPIDJSON_DO_JOIN2(X, Y) +#define RAPIDJSON_DO_JOIN2(X, Y) X##Y +//!@endcond + +/*! \def RAPIDJSON_MAJOR_VERSION + \ingroup RAPIDJSON_CONFIG + \brief Major version of RapidJSON in integer. +*/ +/*! \def RAPIDJSON_MINOR_VERSION + \ingroup RAPIDJSON_CONFIG + \brief Minor version of RapidJSON in integer. +*/ +/*! \def RAPIDJSON_PATCH_VERSION + \ingroup RAPIDJSON_CONFIG + \brief Patch version of RapidJSON in integer. +*/ +/*! \def RAPIDJSON_VERSION_STRING + \ingroup RAPIDJSON_CONFIG + \brief Version of RapidJSON in ".." string format. +*/ +#define RAPIDJSON_MAJOR_VERSION 1 +#define RAPIDJSON_MINOR_VERSION 1 +#define RAPIDJSON_PATCH_VERSION 0 +#define RAPIDJSON_VERSION_STRING \ + RAPIDJSON_STRINGIFY(RAPIDJSON_MAJOR_VERSION.RAPIDJSON_MINOR_VERSION.RAPIDJSON_PATCH_VERSION) + +/////////////////////////////////////////////////////////////////////////////// +// RAPIDJSON_NAMESPACE_(BEGIN|END) +/*! \def RAPIDJSON_NAMESPACE + \ingroup RAPIDJSON_CONFIG + \brief provide custom rapidjson namespace + + In order to avoid symbol clashes and/or "One Definition Rule" errors + between multiple inclusions of (different versions of) RapidJSON in + a single binary, users can customize the name of the main RapidJSON + namespace. + + In case of a single nesting level, defining \c RAPIDJSON_NAMESPACE + to a custom name (e.g. \c MyRapidJSON) is sufficient. If multiple + levels are needed, both \ref RAPIDJSON_NAMESPACE_BEGIN and \ref + RAPIDJSON_NAMESPACE_END need to be defined as well: + + \code + // in some .cpp file + #define RAPIDJSON_NAMESPACE my::rapidjson + #define RAPIDJSON_NAMESPACE_BEGIN namespace my { namespace rapidjson { + #define RAPIDJSON_NAMESPACE_END } } + #include "rapidjson/..." + \endcode + + \see rapidjson + */ +/*! \def RAPIDJSON_NAMESPACE_BEGIN + \ingroup RAPIDJSON_CONFIG + \brief provide custom rapidjson namespace (opening expression) + \see RAPIDJSON_NAMESPACE +*/ +/*! \def RAPIDJSON_NAMESPACE_END + \ingroup RAPIDJSON_CONFIG + \brief provide custom rapidjson namespace (closing expression) + \see RAPIDJSON_NAMESPACE +*/ +#ifndef RAPIDJSON_NAMESPACE +#define RAPIDJSON_NAMESPACE rapidjson +#endif +#ifndef RAPIDJSON_NAMESPACE_BEGIN +#define RAPIDJSON_NAMESPACE_BEGIN namespace RAPIDJSON_NAMESPACE { +#endif +#ifndef RAPIDJSON_NAMESPACE_END +#define RAPIDJSON_NAMESPACE_END } +#endif + +/////////////////////////////////////////////////////////////////////////////// +// RAPIDJSON_HAS_STDSTRING + +#ifndef RAPIDJSON_HAS_STDSTRING +#ifdef RAPIDJSON_DOXYGEN_RUNNING +#define RAPIDJSON_HAS_STDSTRING 1 // force generation of documentation +#else +#define RAPIDJSON_HAS_STDSTRING 0 // no std::string support by default +#endif +/*! \def RAPIDJSON_HAS_STDSTRING + \ingroup RAPIDJSON_CONFIG + \brief Enable RapidJSON support for \c std::string + + By defining this preprocessor symbol to \c 1, several convenience functions for using + \ref rapidjson::GenericValue with \c std::string are enabled, especially + for construction and comparison. + + \hideinitializer +*/ +#endif // !defined(RAPIDJSON_HAS_STDSTRING) + +#if RAPIDJSON_HAS_STDSTRING +#include +#endif // RAPIDJSON_HAS_STDSTRING + +/////////////////////////////////////////////////////////////////////////////// +// RAPIDJSON_NO_INT64DEFINE + +/*! \def RAPIDJSON_NO_INT64DEFINE + \ingroup RAPIDJSON_CONFIG + \brief Use external 64-bit integer types. + + RapidJSON requires the 64-bit integer types \c int64_t and \c uint64_t types + to be available at global scope. + + If users have their own definition, define RAPIDJSON_NO_INT64DEFINE to + prevent RapidJSON from defining its own types. +*/ +#ifndef RAPIDJSON_NO_INT64DEFINE +//!@cond RAPIDJSON_HIDDEN_FROM_DOXYGEN +#if defined(_MSC_VER) && (_MSC_VER < 1800) // Visual Studio 2013 +#include "msinttypes/stdint.h" +#include "msinttypes/inttypes.h" +#else +// Other compilers should have this. +#include +#include +#endif +//!@endcond +#ifdef RAPIDJSON_DOXYGEN_RUNNING +#define RAPIDJSON_NO_INT64DEFINE +#endif +#endif // RAPIDJSON_NO_INT64TYPEDEF + +/////////////////////////////////////////////////////////////////////////////// +// RAPIDJSON_FORCEINLINE + +#ifndef RAPIDJSON_FORCEINLINE +//!@cond RAPIDJSON_HIDDEN_FROM_DOXYGEN +#if defined(_MSC_VER) && defined(NDEBUG) +#define RAPIDJSON_FORCEINLINE __forceinline +#elif defined(__GNUC__) && __GNUC__ >= 4 && defined(NDEBUG) +#define RAPIDJSON_FORCEINLINE __attribute__((always_inline)) +#else +#define RAPIDJSON_FORCEINLINE +#endif +//!@endcond +#endif // RAPIDJSON_FORCEINLINE + +/////////////////////////////////////////////////////////////////////////////// +// RAPIDJSON_ENDIAN +#define RAPIDJSON_LITTLEENDIAN 0 //!< Little endian machine +#define RAPIDJSON_BIGENDIAN 1 //!< Big endian machine + +//! Endianness of the machine. +/*! + \def RAPIDJSON_ENDIAN + \ingroup RAPIDJSON_CONFIG + + GCC 4.6 provided macro for detecting endianness of the target machine. But other + compilers may not have this. User can define RAPIDJSON_ENDIAN to either + \ref RAPIDJSON_LITTLEENDIAN or \ref RAPIDJSON_BIGENDIAN. + + Default detection implemented with reference to + \li https://gcc.gnu.org/onlinedocs/gcc-4.6.0/cpp/Common-Predefined-Macros.html + \li http://www.boost.org/doc/libs/1_42_0/boost/detail/endian.hpp +*/ +#ifndef RAPIDJSON_ENDIAN +// Detect with GCC 4.6's macro +# ifdef __BYTE_ORDER__ +# if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ +# define RAPIDJSON_ENDIAN RAPIDJSON_LITTLEENDIAN +# elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ +# define RAPIDJSON_ENDIAN RAPIDJSON_BIGENDIAN +# else +# error Unknown machine endianess detected. User needs to define RAPIDJSON_ENDIAN. +# endif // __BYTE_ORDER__ +// Detect with GLIBC's endian.h +# elif defined(__GLIBC__) +# include +# if (__BYTE_ORDER == __LITTLE_ENDIAN) +# define RAPIDJSON_ENDIAN RAPIDJSON_LITTLEENDIAN +# elif (__BYTE_ORDER == __BIG_ENDIAN) +# define RAPIDJSON_ENDIAN RAPIDJSON_BIGENDIAN +# else +# error Unknown machine endianess detected. User needs to define RAPIDJSON_ENDIAN. +# endif // __GLIBC__ +// Detect with _LITTLE_ENDIAN and _BIG_ENDIAN macro +# elif defined(_LITTLE_ENDIAN) && !defined(_BIG_ENDIAN) +# define RAPIDJSON_ENDIAN RAPIDJSON_LITTLEENDIAN +# elif defined(_BIG_ENDIAN) && !defined(_LITTLE_ENDIAN) +# define RAPIDJSON_ENDIAN RAPIDJSON_BIGENDIAN +// Detect with architecture macros +# elif defined(__sparc) || defined(__sparc__) || defined(_POWER) || defined(__powerpc__) || defined(__ppc__) || defined(__hpux) || defined(__hppa) || defined(_MIPSEB) || defined(_POWER) || defined(__s390__) +# define RAPIDJSON_ENDIAN RAPIDJSON_BIGENDIAN +# elif defined(__i386__) || defined(__alpha__) || defined(__ia64) || defined(__ia64__) || defined(_M_IX86) || defined(_M_IA64) || defined(_M_ALPHA) || defined(__amd64) || defined(__amd64__) || defined(_M_AMD64) || defined(__x86_64) || defined(__x86_64__) || defined(_M_X64) || defined(__bfin__) +# define RAPIDJSON_ENDIAN RAPIDJSON_LITTLEENDIAN +# elif defined(_MSC_VER) && defined(_M_ARM) +# define RAPIDJSON_ENDIAN RAPIDJSON_LITTLEENDIAN +# elif defined(RAPIDJSON_DOXYGEN_RUNNING) +# define RAPIDJSON_ENDIAN +# else +# error Unknown machine endianess detected. User needs to define RAPIDJSON_ENDIAN. +# endif +#endif // RAPIDJSON_ENDIAN + +/////////////////////////////////////////////////////////////////////////////// +// RAPIDJSON_64BIT + +//! Whether using 64-bit architecture +#ifndef RAPIDJSON_64BIT +#if defined(__LP64__) || (defined(__x86_64__) && defined(__ILP32__)) || defined(_WIN64) || defined(__EMSCRIPTEN__) +#define RAPIDJSON_64BIT 1 +#else +#define RAPIDJSON_64BIT 0 +#endif +#endif // RAPIDJSON_64BIT + +/////////////////////////////////////////////////////////////////////////////// +// RAPIDJSON_ALIGN + +//! Data alignment of the machine. +/*! \ingroup RAPIDJSON_CONFIG + \param x pointer to align + + Some machines require strict data alignment. Currently the default uses 4 bytes + alignment on 32-bit platforms and 8 bytes alignment for 64-bit platforms. + User can customize by defining the RAPIDJSON_ALIGN function macro. +*/ +#ifndef RAPIDJSON_ALIGN +#if RAPIDJSON_64BIT == 1 +#define RAPIDJSON_ALIGN(x) (((x) + static_cast(7u)) & ~static_cast(7u)) +#else +#define RAPIDJSON_ALIGN(x) (((x) + 3u) & ~3u) +#endif +#endif + +/////////////////////////////////////////////////////////////////////////////// +// RAPIDJSON_UINT64_C2 + +//! Construct a 64-bit literal by a pair of 32-bit integer. +/*! + 64-bit literal with or without ULL suffix is prone to compiler warnings. + UINT64_C() is C macro which cause compilation problems. + Use this macro to define 64-bit constants by a pair of 32-bit integer. +*/ +#ifndef RAPIDJSON_UINT64_C2 +#define RAPIDJSON_UINT64_C2(high32, low32) ((static_cast(high32) << 32) | static_cast(low32)) +#endif + +/////////////////////////////////////////////////////////////////////////////// +// RAPIDJSON_48BITPOINTER_OPTIMIZATION + +//! Use only lower 48-bit address for some pointers. +/*! + \ingroup RAPIDJSON_CONFIG + + This optimization uses the fact that current X86-64 architecture only implement lower 48-bit virtual address. + The higher 16-bit can be used for storing other data. + \c GenericValue uses this optimization to reduce its size form 24 bytes to 16 bytes in 64-bit architecture. +*/ +#ifndef RAPIDJSON_48BITPOINTER_OPTIMIZATION +#if defined(__amd64__) || defined(__amd64) || defined(__x86_64__) || defined(__x86_64) || defined(_M_X64) || defined(_M_AMD64) +#define RAPIDJSON_48BITPOINTER_OPTIMIZATION 1 +#else +#define RAPIDJSON_48BITPOINTER_OPTIMIZATION 0 +#endif +#endif // RAPIDJSON_48BITPOINTER_OPTIMIZATION + +#if RAPIDJSON_48BITPOINTER_OPTIMIZATION == 1 +#if RAPIDJSON_64BIT != 1 +#error RAPIDJSON_48BITPOINTER_OPTIMIZATION can only be set to 1 when RAPIDJSON_64BIT=1 +#endif +#define RAPIDJSON_SETPOINTER(type, p, x) (p = reinterpret_cast((reinterpret_cast(p) & static_cast(RAPIDJSON_UINT64_C2(0xFFFF0000, 0x00000000))) | reinterpret_cast(reinterpret_cast(x)))) +#define RAPIDJSON_GETPOINTER(type, p) (reinterpret_cast(reinterpret_cast(p) & static_cast(RAPIDJSON_UINT64_C2(0x0000FFFF, 0xFFFFFFFF)))) +#else +#define RAPIDJSON_SETPOINTER(type, p, x) (p = (x)) +#define RAPIDJSON_GETPOINTER(type, p) (p) +#endif + +/////////////////////////////////////////////////////////////////////////////// +// RAPIDJSON_SSE2/RAPIDJSON_SSE42/RAPIDJSON_NEON/RAPIDJSON_SIMD + +/*! \def RAPIDJSON_SIMD + \ingroup RAPIDJSON_CONFIG + \brief Enable SSE2/SSE4.2/Neon optimization. + + RapidJSON supports optimized implementations for some parsing operations + based on the SSE2, SSE4.2 or NEon SIMD extensions on modern Intel + or ARM compatible processors. + + To enable these optimizations, three different symbols can be defined; + \code + // Enable SSE2 optimization. + #define RAPIDJSON_SSE2 + + // Enable SSE4.2 optimization. + #define RAPIDJSON_SSE42 + \endcode + + // Enable ARM Neon optimization. + #define RAPIDJSON_NEON + \endcode + + \c RAPIDJSON_SSE42 takes precedence over SSE2, if both are defined. + + If any of these symbols is defined, RapidJSON defines the macro + \c RAPIDJSON_SIMD to indicate the availability of the optimized code. +*/ +#if defined(RAPIDJSON_SSE2) || defined(RAPIDJSON_SSE42) \ + || defined(RAPIDJSON_NEON) || defined(RAPIDJSON_DOXYGEN_RUNNING) +#define RAPIDJSON_SIMD +#endif + +/////////////////////////////////////////////////////////////////////////////// +// RAPIDJSON_NO_SIZETYPEDEFINE + +#ifndef RAPIDJSON_NO_SIZETYPEDEFINE +/*! \def RAPIDJSON_NO_SIZETYPEDEFINE + \ingroup RAPIDJSON_CONFIG + \brief User-provided \c SizeType definition. + + In order to avoid using 32-bit size types for indexing strings and arrays, + define this preprocessor symbol and provide the type rapidjson::SizeType + before including RapidJSON: + \code + #define RAPIDJSON_NO_SIZETYPEDEFINE + namespace rapidjson { typedef ::std::size_t SizeType; } + #include "rapidjson/..." + \endcode + + \see rapidjson::SizeType +*/ +#ifdef RAPIDJSON_DOXYGEN_RUNNING +#define RAPIDJSON_NO_SIZETYPEDEFINE +#endif +RAPIDJSON_NAMESPACE_BEGIN +//! Size type (for string lengths, array sizes, etc.) +/*! RapidJSON uses 32-bit array/string indices even on 64-bit platforms, + instead of using \c size_t. Users may override the SizeType by defining + \ref RAPIDJSON_NO_SIZETYPEDEFINE. +*/ +typedef unsigned SizeType; +RAPIDJSON_NAMESPACE_END +#endif + +// always import std::size_t to rapidjson namespace +RAPIDJSON_NAMESPACE_BEGIN +using std::size_t; +RAPIDJSON_NAMESPACE_END + +/////////////////////////////////////////////////////////////////////////////// +// RAPIDJSON_ASSERT + +//! Assertion. +/*! \ingroup RAPIDJSON_CONFIG + By default, rapidjson uses C \c assert() for internal assertions. + User can override it by defining RAPIDJSON_ASSERT(x) macro. + + \note Parsing errors are handled and can be customized by the + \ref RAPIDJSON_ERRORS APIs. +*/ +#ifndef RAPIDJSON_ASSERT +#include +#define RAPIDJSON_ASSERT(x) assert(x) +#endif // RAPIDJSON_ASSERT + +/////////////////////////////////////////////////////////////////////////////// +// RAPIDJSON_STATIC_ASSERT + +// Prefer C++11 static_assert, if available +#ifndef RAPIDJSON_STATIC_ASSERT +#if __cplusplus >= 201103L || ( defined(_MSC_VER) && _MSC_VER >= 1800 ) +#define RAPIDJSON_STATIC_ASSERT(x) \ + static_assert(x, RAPIDJSON_STRINGIFY(x)) +#endif // C++11 +#endif // RAPIDJSON_STATIC_ASSERT + +// Adopt C++03 implementation from boost +#ifndef RAPIDJSON_STATIC_ASSERT +#ifndef __clang__ +//!@cond RAPIDJSON_HIDDEN_FROM_DOXYGEN +#endif +RAPIDJSON_NAMESPACE_BEGIN +template struct STATIC_ASSERTION_FAILURE; +template <> struct STATIC_ASSERTION_FAILURE { enum { value = 1 }; }; +template struct StaticAssertTest {}; +RAPIDJSON_NAMESPACE_END + +#if defined(__GNUC__) +#define RAPIDJSON_STATIC_ASSERT_UNUSED_ATTRIBUTE __attribute__((unused)) +#else +#define RAPIDJSON_STATIC_ASSERT_UNUSED_ATTRIBUTE +#endif +#ifndef __clang__ +//!@endcond +#endif + +/*! \def RAPIDJSON_STATIC_ASSERT + \brief (Internal) macro to check for conditions at compile-time + \param x compile-time condition + \hideinitializer + */ +#define RAPIDJSON_STATIC_ASSERT(x) \ + typedef ::RAPIDJSON_NAMESPACE::StaticAssertTest< \ + sizeof(::RAPIDJSON_NAMESPACE::STATIC_ASSERTION_FAILURE)> \ + RAPIDJSON_JOIN(StaticAssertTypedef, __LINE__) RAPIDJSON_STATIC_ASSERT_UNUSED_ATTRIBUTE +#endif // RAPIDJSON_STATIC_ASSERT + +/////////////////////////////////////////////////////////////////////////////// +// RAPIDJSON_LIKELY, RAPIDJSON_UNLIKELY + +//! Compiler branching hint for expression with high probability to be true. +/*! + \ingroup RAPIDJSON_CONFIG + \param x Boolean expression likely to be true. +*/ +#ifndef RAPIDJSON_LIKELY +#if defined(__GNUC__) || defined(__clang__) +#define RAPIDJSON_LIKELY(x) __builtin_expect(!!(x), 1) +#else +#define RAPIDJSON_LIKELY(x) (x) +#endif +#endif + +//! Compiler branching hint for expression with low probability to be true. +/*! + \ingroup RAPIDJSON_CONFIG + \param x Boolean expression unlikely to be true. +*/ +#ifndef RAPIDJSON_UNLIKELY +#if defined(__GNUC__) || defined(__clang__) +#define RAPIDJSON_UNLIKELY(x) __builtin_expect(!!(x), 0) +#else +#define RAPIDJSON_UNLIKELY(x) (x) +#endif +#endif + +/////////////////////////////////////////////////////////////////////////////// +// Helpers + +//!@cond RAPIDJSON_HIDDEN_FROM_DOXYGEN + +#define RAPIDJSON_MULTILINEMACRO_BEGIN do { +#define RAPIDJSON_MULTILINEMACRO_END \ +} while((void)0, 0) + +// adopted from Boost +#define RAPIDJSON_VERSION_CODE(x,y,z) \ + (((x)*100000) + ((y)*100) + (z)) + +/////////////////////////////////////////////////////////////////////////////// +// RAPIDJSON_DIAG_PUSH/POP, RAPIDJSON_DIAG_OFF + +#if defined(__GNUC__) +#define RAPIDJSON_GNUC \ + RAPIDJSON_VERSION_CODE(__GNUC__,__GNUC_MINOR__,__GNUC_PATCHLEVEL__) +#endif + +#if defined(__clang__) || (defined(RAPIDJSON_GNUC) && RAPIDJSON_GNUC >= RAPIDJSON_VERSION_CODE(4,2,0)) + +#define RAPIDJSON_PRAGMA(x) _Pragma(RAPIDJSON_STRINGIFY(x)) +#define RAPIDJSON_DIAG_PRAGMA(x) RAPIDJSON_PRAGMA(GCC diagnostic x) +#define RAPIDJSON_DIAG_OFF(x) \ + RAPIDJSON_DIAG_PRAGMA(ignored RAPIDJSON_STRINGIFY(RAPIDJSON_JOIN(-W,x))) + +// push/pop support in Clang and GCC>=4.6 +#if defined(__clang__) || (defined(RAPIDJSON_GNUC) && RAPIDJSON_GNUC >= RAPIDJSON_VERSION_CODE(4,6,0)) +#define RAPIDJSON_DIAG_PUSH RAPIDJSON_DIAG_PRAGMA(push) +#define RAPIDJSON_DIAG_POP RAPIDJSON_DIAG_PRAGMA(pop) +#else // GCC >= 4.2, < 4.6 +#define RAPIDJSON_DIAG_PUSH /* ignored */ +#define RAPIDJSON_DIAG_POP /* ignored */ +#endif + +#elif defined(_MSC_VER) + +// pragma (MSVC specific) +#define RAPIDJSON_PRAGMA(x) __pragma(x) +#define RAPIDJSON_DIAG_PRAGMA(x) RAPIDJSON_PRAGMA(warning(x)) + +#define RAPIDJSON_DIAG_OFF(x) RAPIDJSON_DIAG_PRAGMA(disable: x) +#define RAPIDJSON_DIAG_PUSH RAPIDJSON_DIAG_PRAGMA(push) +#define RAPIDJSON_DIAG_POP RAPIDJSON_DIAG_PRAGMA(pop) + +#else + +#define RAPIDJSON_DIAG_OFF(x) /* ignored */ +#define RAPIDJSON_DIAG_PUSH /* ignored */ +#define RAPIDJSON_DIAG_POP /* ignored */ + +#endif // RAPIDJSON_DIAG_* + +/////////////////////////////////////////////////////////////////////////////// +// C++11 features + +#ifndef RAPIDJSON_HAS_CXX11_RVALUE_REFS +#if defined(__clang__) +#if __has_feature(cxx_rvalue_references) && \ + (defined(_LIBCPP_VERSION) || defined(__GLIBCXX__) && __GLIBCXX__ >= 20080306) +#define RAPIDJSON_HAS_CXX11_RVALUE_REFS 1 +#else +#define RAPIDJSON_HAS_CXX11_RVALUE_REFS 0 +#endif +#elif (defined(RAPIDJSON_GNUC) && (RAPIDJSON_GNUC >= RAPIDJSON_VERSION_CODE(4,3,0)) && defined(__GXX_EXPERIMENTAL_CXX0X__)) || \ + (defined(_MSC_VER) && _MSC_VER >= 1600) + +#define RAPIDJSON_HAS_CXX11_RVALUE_REFS 1 +#else +#define RAPIDJSON_HAS_CXX11_RVALUE_REFS 0 +#endif +#endif // RAPIDJSON_HAS_CXX11_RVALUE_REFS + +#ifndef RAPIDJSON_HAS_CXX11_NOEXCEPT +#if defined(__clang__) +#define RAPIDJSON_HAS_CXX11_NOEXCEPT __has_feature(cxx_noexcept) +#elif (defined(RAPIDJSON_GNUC) && (RAPIDJSON_GNUC >= RAPIDJSON_VERSION_CODE(4,6,0)) && defined(__GXX_EXPERIMENTAL_CXX0X__)) +// (defined(_MSC_VER) && _MSC_VER >= ????) // not yet supported +#define RAPIDJSON_HAS_CXX11_NOEXCEPT 1 +#else +#define RAPIDJSON_HAS_CXX11_NOEXCEPT 0 +#endif +#endif +#if RAPIDJSON_HAS_CXX11_NOEXCEPT +#define RAPIDJSON_NOEXCEPT noexcept +#else +#define RAPIDJSON_NOEXCEPT /* noexcept */ +#endif // RAPIDJSON_HAS_CXX11_NOEXCEPT + +// no automatic detection, yet +#ifndef RAPIDJSON_HAS_CXX11_TYPETRAITS +#define RAPIDJSON_HAS_CXX11_TYPETRAITS 0 +#endif + +#ifndef RAPIDJSON_HAS_CXX11_RANGE_FOR +#if defined(__clang__) +#define RAPIDJSON_HAS_CXX11_RANGE_FOR __has_feature(cxx_range_for) +#elif (defined(RAPIDJSON_GNUC) && (RAPIDJSON_GNUC >= RAPIDJSON_VERSION_CODE(4,6,0)) && defined(__GXX_EXPERIMENTAL_CXX0X__)) || \ + (defined(_MSC_VER) && _MSC_VER >= 1700) +#define RAPIDJSON_HAS_CXX11_RANGE_FOR 1 +#else +#define RAPIDJSON_HAS_CXX11_RANGE_FOR 0 +#endif +#endif // RAPIDJSON_HAS_CXX11_RANGE_FOR + +//!@endcond + +/////////////////////////////////////////////////////////////////////////////// +// new/delete + +#ifndef RAPIDJSON_NEW +///! customization point for global \c new +#define RAPIDJSON_NEW(TypeName) new TypeName +#endif +#ifndef RAPIDJSON_DELETE +///! customization point for global \c delete +#define RAPIDJSON_DELETE(x) delete x +#endif + +/////////////////////////////////////////////////////////////////////////////// +// Type + +/*! \namespace rapidjson + \brief main RapidJSON namespace + \see RAPIDJSON_NAMESPACE +*/ +RAPIDJSON_NAMESPACE_BEGIN + +//! Type of JSON value +enum Type { + kNullType = 0, //!< null + kFalseType = 1, //!< false + kTrueType = 2, //!< true + kObjectType = 3, //!< object + kArrayType = 4, //!< array + kStringType = 5, //!< string + kNumberType = 6 //!< number +}; + +RAPIDJSON_NAMESPACE_END + +#endif // RAPIDJSON_RAPIDJSON_H_ diff --git a/umd/external/include/rapidjson/reader.h b/umd/external/include/rapidjson/reader.h new file mode 100644 index 00000000..120c3111 --- /dev/null +++ b/umd/external/include/rapidjson/reader.h @@ -0,0 +1,2221 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef RAPIDJSON_READER_H_ +#define RAPIDJSON_READER_H_ + +/*! \file reader.h */ + +#include "allocators.h" +#include "stream.h" +#include "encodedstream.h" +#include "internal/meta.h" +#include "internal/stack.h" +#include "internal/strtod.h" +#include + +#if defined(RAPIDJSON_SIMD) && defined(_MSC_VER) +#include +#pragma intrinsic(_BitScanForward) +#endif +#ifdef RAPIDJSON_SSE42 +#include +#elif defined(RAPIDJSON_SSE2) +#include +#elif defined(RAPIDJSON_NEON) +#include +#endif + +#ifdef _MSC_VER +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(4127) // conditional expression is constant +RAPIDJSON_DIAG_OFF(4702) // unreachable code +#endif + +#ifdef __clang__ +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(old-style-cast) +RAPIDJSON_DIAG_OFF(padded) +RAPIDJSON_DIAG_OFF(switch-enum) +#endif + +#ifdef __GNUC__ +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(effc++) +#endif + +//!@cond RAPIDJSON_HIDDEN_FROM_DOXYGEN +#define RAPIDJSON_NOTHING /* deliberately empty */ +#ifndef RAPIDJSON_PARSE_ERROR_EARLY_RETURN +#define RAPIDJSON_PARSE_ERROR_EARLY_RETURN(value) \ + RAPIDJSON_MULTILINEMACRO_BEGIN \ + if (RAPIDJSON_UNLIKELY(HasParseError())) { return value; } \ + RAPIDJSON_MULTILINEMACRO_END +#endif +#define RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID \ + RAPIDJSON_PARSE_ERROR_EARLY_RETURN(RAPIDJSON_NOTHING) +//!@endcond + +/*! \def RAPIDJSON_PARSE_ERROR_NORETURN + \ingroup RAPIDJSON_ERRORS + \brief Macro to indicate a parse error. + \param parseErrorCode \ref rapidjson::ParseErrorCode of the error + \param offset position of the error in JSON input (\c size_t) + + This macros can be used as a customization point for the internal + error handling mechanism of RapidJSON. + + A common usage model is to throw an exception instead of requiring the + caller to explicitly check the \ref rapidjson::GenericReader::Parse's + return value: + + \code + #define RAPIDJSON_PARSE_ERROR_NORETURN(parseErrorCode,offset) \ + throw ParseException(parseErrorCode, #parseErrorCode, offset) + + #include // std::runtime_error + #include "rapidjson/error/error.h" // rapidjson::ParseResult + + struct ParseException : std::runtime_error, rapidjson::ParseResult { + ParseException(rapidjson::ParseErrorCode code, const char* msg, size_t offset) + : std::runtime_error(msg), ParseResult(code, offset) {} + }; + + #include "rapidjson/reader.h" + \endcode + + \see RAPIDJSON_PARSE_ERROR, rapidjson::GenericReader::Parse + */ +#ifndef RAPIDJSON_PARSE_ERROR_NORETURN +#define RAPIDJSON_PARSE_ERROR_NORETURN(parseErrorCode, offset) \ + RAPIDJSON_MULTILINEMACRO_BEGIN \ + RAPIDJSON_ASSERT(!HasParseError()); /* Error can only be assigned once */ \ + SetParseError(parseErrorCode, offset); \ + RAPIDJSON_MULTILINEMACRO_END +#endif + +/*! \def RAPIDJSON_PARSE_ERROR + \ingroup RAPIDJSON_ERRORS + \brief (Internal) macro to indicate and handle a parse error. + \param parseErrorCode \ref rapidjson::ParseErrorCode of the error + \param offset position of the error in JSON input (\c size_t) + + Invokes RAPIDJSON_PARSE_ERROR_NORETURN and stops the parsing. + + \see RAPIDJSON_PARSE_ERROR_NORETURN + \hideinitializer + */ +#ifndef RAPIDJSON_PARSE_ERROR +#define RAPIDJSON_PARSE_ERROR(parseErrorCode, offset) \ + RAPIDJSON_MULTILINEMACRO_BEGIN \ + RAPIDJSON_PARSE_ERROR_NORETURN(parseErrorCode, offset); \ + RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; \ + RAPIDJSON_MULTILINEMACRO_END +#endif + +#include "error/error.h" // ParseErrorCode, ParseResult + +RAPIDJSON_NAMESPACE_BEGIN + +/////////////////////////////////////////////////////////////////////////////// +// ParseFlag + +/*! \def RAPIDJSON_PARSE_DEFAULT_FLAGS + \ingroup RAPIDJSON_CONFIG + \brief User-defined kParseDefaultFlags definition. + + User can define this as any \c ParseFlag combinations. +*/ +#ifndef RAPIDJSON_PARSE_DEFAULT_FLAGS +#define RAPIDJSON_PARSE_DEFAULT_FLAGS kParseNoFlags +#endif + +//! Combination of parseFlags +/*! \see Reader::Parse, Document::Parse, Document::ParseInsitu, Document::ParseStream + */ +enum ParseFlag { + kParseNoFlags = 0, //!< No flags are set. + kParseInsituFlag = 1, //!< In-situ(destructive) parsing. + kParseValidateEncodingFlag = 2, //!< Validate encoding of JSON strings. + kParseIterativeFlag = 4, //!< Iterative(constant complexity in terms of function call stack size) parsing. + kParseStopWhenDoneFlag = 8, //!< After parsing a complete JSON root from stream, stop further processing the rest of stream. When this flag is used, parser will not generate kParseErrorDocumentRootNotSingular error. + kParseFullPrecisionFlag = 16, //!< Parse number in full precision (but slower). + kParseCommentsFlag = 32, //!< Allow one-line (//) and multi-line (/**/) comments. + kParseNumbersAsStringsFlag = 64, //!< Parse all numbers (ints/doubles) as strings. + kParseTrailingCommasFlag = 128, //!< Allow trailing commas at the end of objects and arrays. + kParseNanAndInfFlag = 256, //!< Allow parsing NaN, Inf, Infinity, -Inf and -Infinity as doubles. + kParseDefaultFlags = RAPIDJSON_PARSE_DEFAULT_FLAGS //!< Default parse flags. Can be customized by defining RAPIDJSON_PARSE_DEFAULT_FLAGS +}; + +/////////////////////////////////////////////////////////////////////////////// +// Handler + +/*! \class rapidjson::Handler + \brief Concept for receiving events from GenericReader upon parsing. + The functions return true if no error occurs. If they return false, + the event publisher should terminate the process. +\code +concept Handler { + typename Ch; + + bool Null(); + bool Bool(bool b); + bool Int(int i); + bool Uint(unsigned i); + bool Int64(int64_t i); + bool Uint64(uint64_t i); + bool Double(double d); + /// enabled via kParseNumbersAsStringsFlag, string is not null-terminated (use length) + bool RawNumber(const Ch* str, SizeType length, bool copy); + bool String(const Ch* str, SizeType length, bool copy); + bool StartObject(); + bool Key(const Ch* str, SizeType length, bool copy); + bool EndObject(SizeType memberCount); + bool StartArray(); + bool EndArray(SizeType elementCount); +}; +\endcode +*/ +/////////////////////////////////////////////////////////////////////////////// +// BaseReaderHandler + +//! Default implementation of Handler. +/*! This can be used as base class of any reader handler. + \note implements Handler concept +*/ +template, typename Derived = void> +struct BaseReaderHandler { + typedef typename Encoding::Ch Ch; + + typedef typename internal::SelectIf, BaseReaderHandler, Derived>::Type Override; + + bool Default() { return true; } + bool Null() { return static_cast(*this).Default(); } + bool Bool(bool) { return static_cast(*this).Default(); } + bool Int(int) { return static_cast(*this).Default(); } + bool Uint(unsigned) { return static_cast(*this).Default(); } + bool Int64(int64_t) { return static_cast(*this).Default(); } + bool Uint64(uint64_t) { return static_cast(*this).Default(); } + bool Double(double) { return static_cast(*this).Default(); } + /// enabled via kParseNumbersAsStringsFlag, string is not null-terminated (use length) + bool RawNumber(const Ch* str, SizeType len, bool copy) { return static_cast(*this).String(str, len, copy); } + bool String(const Ch*, SizeType, bool) { return static_cast(*this).Default(); } + bool StartObject() { return static_cast(*this).Default(); } + bool Key(const Ch* str, SizeType len, bool copy) { return static_cast(*this).String(str, len, copy); } + bool EndObject(SizeType) { return static_cast(*this).Default(); } + bool StartArray() { return static_cast(*this).Default(); } + bool EndArray(SizeType) { return static_cast(*this).Default(); } +}; + +/////////////////////////////////////////////////////////////////////////////// +// StreamLocalCopy + +namespace internal { + +template::copyOptimization> +class StreamLocalCopy; + +//! Do copy optimization. +template +class StreamLocalCopy { +public: + StreamLocalCopy(Stream& original) : s(original), original_(original) {} + ~StreamLocalCopy() { original_ = s; } + + Stream s; + +private: + StreamLocalCopy& operator=(const StreamLocalCopy&) /* = delete */; + + Stream& original_; +}; + +//! Keep reference. +template +class StreamLocalCopy { +public: + StreamLocalCopy(Stream& original) : s(original) {} + + Stream& s; + +private: + StreamLocalCopy& operator=(const StreamLocalCopy&) /* = delete */; +}; + +} // namespace internal + +/////////////////////////////////////////////////////////////////////////////// +// SkipWhitespace + +//! Skip the JSON white spaces in a stream. +/*! \param is A input stream for skipping white spaces. + \note This function has SSE2/SSE4.2 specialization. +*/ +template +void SkipWhitespace(InputStream& is) { + internal::StreamLocalCopy copy(is); + InputStream& s(copy.s); + + typename InputStream::Ch c; + while ((c = s.Peek()) == ' ' || c == '\n' || c == '\r' || c == '\t') + s.Take(); +} + +inline const char* SkipWhitespace(const char* p, const char* end) { + while (p != end && (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t')) + ++p; + return p; +} + +#ifdef RAPIDJSON_SSE42 +//! Skip whitespace with SSE 4.2 pcmpistrm instruction, testing 16 8-byte characters at once. +inline const char *SkipWhitespace_SIMD(const char* p) { + // Fast return for single non-whitespace + if (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t') + ++p; + else + return p; + + // 16-byte align to the next boundary + const char* nextAligned = reinterpret_cast((reinterpret_cast(p) + 15) & static_cast(~15)); + while (p != nextAligned) + if (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t') + ++p; + else + return p; + + // The rest of string using SIMD + static const char whitespace[16] = " \n\r\t"; + const __m128i w = _mm_loadu_si128(reinterpret_cast(&whitespace[0])); + + for (;; p += 16) { + const __m128i s = _mm_load_si128(reinterpret_cast(p)); + const int r = _mm_cmpistri(w, s, _SIDD_UBYTE_OPS | _SIDD_CMP_EQUAL_ANY | _SIDD_LEAST_SIGNIFICANT | _SIDD_NEGATIVE_POLARITY); + if (r != 16) // some of characters is non-whitespace + return p + r; + } +} + +inline const char *SkipWhitespace_SIMD(const char* p, const char* end) { + // Fast return for single non-whitespace + if (p != end && (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t')) + ++p; + else + return p; + + // The middle of string using SIMD + static const char whitespace[16] = " \n\r\t"; + const __m128i w = _mm_loadu_si128(reinterpret_cast(&whitespace[0])); + + for (; p <= end - 16; p += 16) { + const __m128i s = _mm_loadu_si128(reinterpret_cast(p)); + const int r = _mm_cmpistri(w, s, _SIDD_UBYTE_OPS | _SIDD_CMP_EQUAL_ANY | _SIDD_LEAST_SIGNIFICANT | _SIDD_NEGATIVE_POLARITY); + if (r != 16) // some of characters is non-whitespace + return p + r; + } + + return SkipWhitespace(p, end); +} + +#elif defined(RAPIDJSON_SSE2) + +//! Skip whitespace with SSE2 instructions, testing 16 8-byte characters at once. +inline const char *SkipWhitespace_SIMD(const char* p) { + // Fast return for single non-whitespace + if (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t') + ++p; + else + return p; + + // 16-byte align to the next boundary + const char* nextAligned = reinterpret_cast((reinterpret_cast(p) + 15) & static_cast(~15)); + while (p != nextAligned) + if (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t') + ++p; + else + return p; + + // The rest of string + #define C16(c) { c, c, c, c, c, c, c, c, c, c, c, c, c, c, c, c } + static const char whitespaces[4][16] = { C16(' '), C16('\n'), C16('\r'), C16('\t') }; + #undef C16 + + const __m128i w0 = _mm_loadu_si128(reinterpret_cast(&whitespaces[0][0])); + const __m128i w1 = _mm_loadu_si128(reinterpret_cast(&whitespaces[1][0])); + const __m128i w2 = _mm_loadu_si128(reinterpret_cast(&whitespaces[2][0])); + const __m128i w3 = _mm_loadu_si128(reinterpret_cast(&whitespaces[3][0])); + + for (;; p += 16) { + const __m128i s = _mm_load_si128(reinterpret_cast(p)); + __m128i x = _mm_cmpeq_epi8(s, w0); + x = _mm_or_si128(x, _mm_cmpeq_epi8(s, w1)); + x = _mm_or_si128(x, _mm_cmpeq_epi8(s, w2)); + x = _mm_or_si128(x, _mm_cmpeq_epi8(s, w3)); + unsigned short r = static_cast(~_mm_movemask_epi8(x)); + if (r != 0) { // some of characters may be non-whitespace +#ifdef _MSC_VER // Find the index of first non-whitespace + unsigned long offset; + _BitScanForward(&offset, r); + return p + offset; +#else + return p + __builtin_ffs(r) - 1; +#endif + } + } +} + +inline const char *SkipWhitespace_SIMD(const char* p, const char* end) { + // Fast return for single non-whitespace + if (p != end && (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t')) + ++p; + else + return p; + + // The rest of string + #define C16(c) { c, c, c, c, c, c, c, c, c, c, c, c, c, c, c, c } + static const char whitespaces[4][16] = { C16(' '), C16('\n'), C16('\r'), C16('\t') }; + #undef C16 + + const __m128i w0 = _mm_loadu_si128(reinterpret_cast(&whitespaces[0][0])); + const __m128i w1 = _mm_loadu_si128(reinterpret_cast(&whitespaces[1][0])); + const __m128i w2 = _mm_loadu_si128(reinterpret_cast(&whitespaces[2][0])); + const __m128i w3 = _mm_loadu_si128(reinterpret_cast(&whitespaces[3][0])); + + for (; p <= end - 16; p += 16) { + const __m128i s = _mm_loadu_si128(reinterpret_cast(p)); + __m128i x = _mm_cmpeq_epi8(s, w0); + x = _mm_or_si128(x, _mm_cmpeq_epi8(s, w1)); + x = _mm_or_si128(x, _mm_cmpeq_epi8(s, w2)); + x = _mm_or_si128(x, _mm_cmpeq_epi8(s, w3)); + unsigned short r = static_cast(~_mm_movemask_epi8(x)); + if (r != 0) { // some of characters may be non-whitespace +#ifdef _MSC_VER // Find the index of first non-whitespace + unsigned long offset; + _BitScanForward(&offset, r); + return p + offset; +#else + return p + __builtin_ffs(r) - 1; +#endif + } + } + + return SkipWhitespace(p, end); +} + +#elif defined(RAPIDJSON_NEON) + +//! Skip whitespace with ARM Neon instructions, testing 16 8-byte characters at once. +inline const char *SkipWhitespace_SIMD(const char* p) { + // Fast return for single non-whitespace + if (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t') + ++p; + else + return p; + + // 16-byte align to the next boundary + const char* nextAligned = reinterpret_cast((reinterpret_cast(p) + 15) & static_cast(~15)); + while (p != nextAligned) + if (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t') + ++p; + else + return p; + + const uint8x16_t w0 = vmovq_n_u8(' '); + const uint8x16_t w1 = vmovq_n_u8('\n'); + const uint8x16_t w2 = vmovq_n_u8('\r'); + const uint8x16_t w3 = vmovq_n_u8('\t'); + + for (;; p += 16) { + const uint8x16_t s = vld1q_u8(reinterpret_cast(p)); + uint8x16_t x = vceqq_u8(s, w0); + x = vorrq_u8(x, vceqq_u8(s, w1)); + x = vorrq_u8(x, vceqq_u8(s, w2)); + x = vorrq_u8(x, vceqq_u8(s, w3)); + + x = vmvnq_u8(x); // Negate + x = vrev64q_u8(x); // Rev in 64 + uint64_t low = vgetq_lane_u64(reinterpret_cast(x), 0); // extract + uint64_t high = vgetq_lane_u64(reinterpret_cast(x), 1); // extract + + if (low == 0) { + if (high != 0) { + int lz =__builtin_clzll(high);; + return p + 8 + (lz >> 3); + } + } else { + int lz = __builtin_clzll(low);; + return p + (lz >> 3); + } + } +} + +inline const char *SkipWhitespace_SIMD(const char* p, const char* end) { + // Fast return for single non-whitespace + if (p != end && (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t')) + ++p; + else + return p; + + const uint8x16_t w0 = vmovq_n_u8(' '); + const uint8x16_t w1 = vmovq_n_u8('\n'); + const uint8x16_t w2 = vmovq_n_u8('\r'); + const uint8x16_t w3 = vmovq_n_u8('\t'); + + for (; p <= end - 16; p += 16) { + const uint8x16_t s = vld1q_u8(reinterpret_cast(p)); + uint8x16_t x = vceqq_u8(s, w0); + x = vorrq_u8(x, vceqq_u8(s, w1)); + x = vorrq_u8(x, vceqq_u8(s, w2)); + x = vorrq_u8(x, vceqq_u8(s, w3)); + + x = vmvnq_u8(x); // Negate + x = vrev64q_u8(x); // Rev in 64 + uint64_t low = vgetq_lane_u64(reinterpret_cast(x), 0); // extract + uint64_t high = vgetq_lane_u64(reinterpret_cast(x), 1); // extract + + if (low == 0) { + if (high != 0) { + int lz = __builtin_clzll(high); + return p + 8 + (lz >> 3); + } + } else { + int lz = __builtin_clzll(low); + return p + (lz >> 3); + } + } + + return SkipWhitespace(p, end); +} + +#endif // RAPIDJSON_NEON + +#ifdef RAPIDJSON_SIMD +//! Template function specialization for InsituStringStream +template<> inline void SkipWhitespace(InsituStringStream& is) { + is.src_ = const_cast(SkipWhitespace_SIMD(is.src_)); +} + +//! Template function specialization for StringStream +template<> inline void SkipWhitespace(StringStream& is) { + is.src_ = SkipWhitespace_SIMD(is.src_); +} + +template<> inline void SkipWhitespace(EncodedInputStream, MemoryStream>& is) { + is.is_.src_ = SkipWhitespace_SIMD(is.is_.src_, is.is_.end_); +} +#endif // RAPIDJSON_SIMD + +/////////////////////////////////////////////////////////////////////////////// +// GenericReader + +//! SAX-style JSON parser. Use \ref Reader for UTF8 encoding and default allocator. +/*! GenericReader parses JSON text from a stream, and send events synchronously to an + object implementing Handler concept. + + It needs to allocate a stack for storing a single decoded string during + non-destructive parsing. + + For in-situ parsing, the decoded string is directly written to the source + text string, no temporary buffer is required. + + A GenericReader object can be reused for parsing multiple JSON text. + + \tparam SourceEncoding Encoding of the input stream. + \tparam TargetEncoding Encoding of the parse output. + \tparam StackAllocator Allocator type for stack. +*/ +template +class GenericReader { +public: + typedef typename SourceEncoding::Ch Ch; //!< SourceEncoding character type + + //! Constructor. + /*! \param stackAllocator Optional allocator for allocating stack memory. (Only use for non-destructive parsing) + \param stackCapacity stack capacity in bytes for storing a single decoded string. (Only use for non-destructive parsing) + */ + GenericReader(StackAllocator* stackAllocator = 0, size_t stackCapacity = kDefaultStackCapacity) : stack_(stackAllocator, stackCapacity), parseResult_() {} + + //! Parse JSON text. + /*! \tparam parseFlags Combination of \ref ParseFlag. + \tparam InputStream Type of input stream, implementing Stream concept. + \tparam Handler Type of handler, implementing Handler concept. + \param is Input stream to be parsed. + \param handler The handler to receive events. + \return Whether the parsing is successful. + */ + template + ParseResult Parse(InputStream& is, Handler& handler) { + if (parseFlags & kParseIterativeFlag) + return IterativeParse(is, handler); + + parseResult_.Clear(); + + ClearStackOnExit scope(*this); + + SkipWhitespaceAndComments(is); + RAPIDJSON_PARSE_ERROR_EARLY_RETURN(parseResult_); + + if (RAPIDJSON_UNLIKELY(is.Peek() == '\0')) { + RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorDocumentEmpty, is.Tell()); + RAPIDJSON_PARSE_ERROR_EARLY_RETURN(parseResult_); + } + else { + ParseValue(is, handler); + RAPIDJSON_PARSE_ERROR_EARLY_RETURN(parseResult_); + + if (!(parseFlags & kParseStopWhenDoneFlag)) { + SkipWhitespaceAndComments(is); + RAPIDJSON_PARSE_ERROR_EARLY_RETURN(parseResult_); + + if (RAPIDJSON_UNLIKELY(is.Peek() != '\0')) { + RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorDocumentRootNotSingular, is.Tell()); + RAPIDJSON_PARSE_ERROR_EARLY_RETURN(parseResult_); + } + } + } + + return parseResult_; + } + + //! Parse JSON text (with \ref kParseDefaultFlags) + /*! \tparam InputStream Type of input stream, implementing Stream concept + \tparam Handler Type of handler, implementing Handler concept. + \param is Input stream to be parsed. + \param handler The handler to receive events. + \return Whether the parsing is successful. + */ + template + ParseResult Parse(InputStream& is, Handler& handler) { + return Parse(is, handler); + } + + //! Initialize JSON text token-by-token parsing + /*! + */ + void IterativeParseInit() { + parseResult_.Clear(); + state_ = IterativeParsingStartState; + } + + //! Parse one token from JSON text + /*! \tparam InputStream Type of input stream, implementing Stream concept + \tparam Handler Type of handler, implementing Handler concept. + \param is Input stream to be parsed. + \param handler The handler to receive events. + \return Whether the parsing is successful. + */ + template + bool IterativeParseNext(InputStream& is, Handler& handler) { + while (RAPIDJSON_LIKELY(is.Peek() != '\0')) { + SkipWhitespaceAndComments(is); + + Token t = Tokenize(is.Peek()); + IterativeParsingState n = Predict(state_, t); + IterativeParsingState d = Transit(state_, t, n, is, handler); + + // If we've finished or hit an error... + if (RAPIDJSON_UNLIKELY(IsIterativeParsingCompleteState(d))) { + // Report errors. + if (d == IterativeParsingErrorState) { + HandleError(state_, is); + return false; + } + + // Transition to the finish state. + RAPIDJSON_ASSERT(d == IterativeParsingFinishState); + state_ = d; + + // If StopWhenDone is not set... + if (!(parseFlags & kParseStopWhenDoneFlag)) { + // ... and extra non-whitespace data is found... + SkipWhitespaceAndComments(is); + if (is.Peek() != '\0') { + // ... this is considered an error. + HandleError(state_, is); + return false; + } + } + + // Success! We are done! + return true; + } + + // Transition to the new state. + state_ = d; + + // If we parsed anything other than a delimiter, we invoked the handler, so we can return true now. + if (!IsIterativeParsingDelimiterState(n)) + return true; + } + + // We reached the end of file. + stack_.Clear(); + + if (state_ != IterativeParsingFinishState) { + HandleError(state_, is); + return false; + } + + return true; + } + + //! Check if token-by-token parsing JSON text is complete + /*! \return Whether the JSON has been fully decoded. + */ + RAPIDJSON_FORCEINLINE bool IterativeParseComplete() { + return IsIterativeParsingCompleteState(state_); + } + + //! Whether a parse error has occured in the last parsing. + bool HasParseError() const { return parseResult_.IsError(); } + + //! Get the \ref ParseErrorCode of last parsing. + ParseErrorCode GetParseErrorCode() const { return parseResult_.Code(); } + + //! Get the position of last parsing error in input, 0 otherwise. + size_t GetErrorOffset() const { return parseResult_.Offset(); } + +protected: + void SetParseError(ParseErrorCode code, size_t offset) { parseResult_.Set(code, offset); } + +private: + // Prohibit copy constructor & assignment operator. + GenericReader(const GenericReader&); + GenericReader& operator=(const GenericReader&); + + void ClearStack() { stack_.Clear(); } + + // clear stack on any exit from ParseStream, e.g. due to exception + struct ClearStackOnExit { + explicit ClearStackOnExit(GenericReader& r) : r_(r) {} + ~ClearStackOnExit() { r_.ClearStack(); } + private: + GenericReader& r_; + ClearStackOnExit(const ClearStackOnExit&); + ClearStackOnExit& operator=(const ClearStackOnExit&); + }; + + template + void SkipWhitespaceAndComments(InputStream& is) { + SkipWhitespace(is); + + if (parseFlags & kParseCommentsFlag) { + while (RAPIDJSON_UNLIKELY(Consume(is, '/'))) { + if (Consume(is, '*')) { + while (true) { + if (RAPIDJSON_UNLIKELY(is.Peek() == '\0')) + RAPIDJSON_PARSE_ERROR(kParseErrorUnspecificSyntaxError, is.Tell()); + else if (Consume(is, '*')) { + if (Consume(is, '/')) + break; + } + else + is.Take(); + } + } + else if (RAPIDJSON_LIKELY(Consume(is, '/'))) + while (is.Peek() != '\0' && is.Take() != '\n') {} + else + RAPIDJSON_PARSE_ERROR(kParseErrorUnspecificSyntaxError, is.Tell()); + + SkipWhitespace(is); + } + } + } + + // Parse object: { string : value, ... } + template + void ParseObject(InputStream& is, Handler& handler) { + RAPIDJSON_ASSERT(is.Peek() == '{'); + is.Take(); // Skip '{' + + if (RAPIDJSON_UNLIKELY(!handler.StartObject())) + RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell()); + + SkipWhitespaceAndComments(is); + RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; + + if (Consume(is, '}')) { + if (RAPIDJSON_UNLIKELY(!handler.EndObject(0))) // empty object + RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell()); + return; + } + + for (SizeType memberCount = 0;;) { + if (RAPIDJSON_UNLIKELY(is.Peek() != '"')) + RAPIDJSON_PARSE_ERROR(kParseErrorObjectMissName, is.Tell()); + + ParseString(is, handler, true); + RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; + + SkipWhitespaceAndComments(is); + RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; + + if (RAPIDJSON_UNLIKELY(!Consume(is, ':'))) + RAPIDJSON_PARSE_ERROR(kParseErrorObjectMissColon, is.Tell()); + + SkipWhitespaceAndComments(is); + RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; + + ParseValue(is, handler); + RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; + + SkipWhitespaceAndComments(is); + RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; + + ++memberCount; + + switch (is.Peek()) { + case ',': + is.Take(); + SkipWhitespaceAndComments(is); + RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; + break; + case '}': + is.Take(); + if (RAPIDJSON_UNLIKELY(!handler.EndObject(memberCount))) + RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell()); + return; + default: + RAPIDJSON_PARSE_ERROR(kParseErrorObjectMissCommaOrCurlyBracket, is.Tell()); break; // This useless break is only for making warning and coverage happy + } + + if (parseFlags & kParseTrailingCommasFlag) { + if (is.Peek() == '}') { + if (RAPIDJSON_UNLIKELY(!handler.EndObject(memberCount))) + RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell()); + is.Take(); + return; + } + } + } + } + + // Parse array: [ value, ... ] + template + void ParseArray(InputStream& is, Handler& handler) { + RAPIDJSON_ASSERT(is.Peek() == '['); + is.Take(); // Skip '[' + + if (RAPIDJSON_UNLIKELY(!handler.StartArray())) + RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell()); + + SkipWhitespaceAndComments(is); + RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; + + if (Consume(is, ']')) { + if (RAPIDJSON_UNLIKELY(!handler.EndArray(0))) // empty array + RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell()); + return; + } + + for (SizeType elementCount = 0;;) { + ParseValue(is, handler); + RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; + + ++elementCount; + SkipWhitespaceAndComments(is); + RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; + + if (Consume(is, ',')) { + SkipWhitespaceAndComments(is); + RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; + } + else if (Consume(is, ']')) { + if (RAPIDJSON_UNLIKELY(!handler.EndArray(elementCount))) + RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell()); + return; + } + else + RAPIDJSON_PARSE_ERROR(kParseErrorArrayMissCommaOrSquareBracket, is.Tell()); + + if (parseFlags & kParseTrailingCommasFlag) { + if (is.Peek() == ']') { + if (RAPIDJSON_UNLIKELY(!handler.EndArray(elementCount))) + RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell()); + is.Take(); + return; + } + } + } + } + + template + void ParseNull(InputStream& is, Handler& handler) { + RAPIDJSON_ASSERT(is.Peek() == 'n'); + is.Take(); + + if (RAPIDJSON_LIKELY(Consume(is, 'u') && Consume(is, 'l') && Consume(is, 'l'))) { + if (RAPIDJSON_UNLIKELY(!handler.Null())) + RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell()); + } + else + RAPIDJSON_PARSE_ERROR(kParseErrorValueInvalid, is.Tell()); + } + + template + void ParseTrue(InputStream& is, Handler& handler) { + RAPIDJSON_ASSERT(is.Peek() == 't'); + is.Take(); + + if (RAPIDJSON_LIKELY(Consume(is, 'r') && Consume(is, 'u') && Consume(is, 'e'))) { + if (RAPIDJSON_UNLIKELY(!handler.Bool(true))) + RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell()); + } + else + RAPIDJSON_PARSE_ERROR(kParseErrorValueInvalid, is.Tell()); + } + + template + void ParseFalse(InputStream& is, Handler& handler) { + RAPIDJSON_ASSERT(is.Peek() == 'f'); + is.Take(); + + if (RAPIDJSON_LIKELY(Consume(is, 'a') && Consume(is, 'l') && Consume(is, 's') && Consume(is, 'e'))) { + if (RAPIDJSON_UNLIKELY(!handler.Bool(false))) + RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell()); + } + else + RAPIDJSON_PARSE_ERROR(kParseErrorValueInvalid, is.Tell()); + } + + template + RAPIDJSON_FORCEINLINE static bool Consume(InputStream& is, typename InputStream::Ch expect) { + if (RAPIDJSON_LIKELY(is.Peek() == expect)) { + is.Take(); + return true; + } + else + return false; + } + + // Helper function to parse four hexidecimal digits in \uXXXX in ParseString(). + template + unsigned ParseHex4(InputStream& is, size_t escapeOffset) { + unsigned codepoint = 0; + for (int i = 0; i < 4; i++) { + Ch c = is.Peek(); + codepoint <<= 4; + codepoint += static_cast(c); + if (c >= '0' && c <= '9') + codepoint -= '0'; + else if (c >= 'A' && c <= 'F') + codepoint -= 'A' - 10; + else if (c >= 'a' && c <= 'f') + codepoint -= 'a' - 10; + else { + RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorStringUnicodeEscapeInvalidHex, escapeOffset); + RAPIDJSON_PARSE_ERROR_EARLY_RETURN(0); + } + is.Take(); + } + return codepoint; + } + + template + class StackStream { + public: + typedef CharType Ch; + + StackStream(internal::Stack& stack) : stack_(stack), length_(0) {} + RAPIDJSON_FORCEINLINE void Put(Ch c) { + *stack_.template Push() = c; + ++length_; + } + + RAPIDJSON_FORCEINLINE void* Push(SizeType count) { + length_ += count; + return stack_.template Push(count); + } + + size_t Length() const { return length_; } + + Ch* Pop() { + return stack_.template Pop(length_); + } + + private: + StackStream(const StackStream&); + StackStream& operator=(const StackStream&); + + internal::Stack& stack_; + SizeType length_; + }; + + // Parse string and generate String event. Different code paths for kParseInsituFlag. + template + void ParseString(InputStream& is, Handler& handler, bool isKey = false) { + internal::StreamLocalCopy copy(is); + InputStream& s(copy.s); + + RAPIDJSON_ASSERT(s.Peek() == '\"'); + s.Take(); // Skip '\"' + + bool success = false; + if (parseFlags & kParseInsituFlag) { + typename InputStream::Ch *head = s.PutBegin(); + ParseStringToStream(s, s); + RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; + size_t length = s.PutEnd(head) - 1; + RAPIDJSON_ASSERT(length <= 0xFFFFFFFF); + const typename TargetEncoding::Ch* const str = reinterpret_cast(head); + success = (isKey ? handler.Key(str, SizeType(length), false) : handler.String(str, SizeType(length), false)); + } + else { + StackStream stackStream(stack_); + ParseStringToStream(s, stackStream); + RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; + SizeType length = static_cast(stackStream.Length()) - 1; + const typename TargetEncoding::Ch* const str = stackStream.Pop(); + success = (isKey ? handler.Key(str, length, true) : handler.String(str, length, true)); + } + if (RAPIDJSON_UNLIKELY(!success)) + RAPIDJSON_PARSE_ERROR(kParseErrorTermination, s.Tell()); + } + + // Parse string to an output is + // This function handles the prefix/suffix double quotes, escaping, and optional encoding validation. + template + RAPIDJSON_FORCEINLINE void ParseStringToStream(InputStream& is, OutputStream& os) { +//!@cond RAPIDJSON_HIDDEN_FROM_DOXYGEN +#define Z16 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + static const char escape[256] = { + Z16, Z16, 0, 0,'\"', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,'/', + Z16, Z16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,'\\', 0, 0, 0, + 0, 0,'\b', 0, 0, 0,'\f', 0, 0, 0, 0, 0, 0, 0,'\n', 0, + 0, 0,'\r', 0,'\t', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + Z16, Z16, Z16, Z16, Z16, Z16, Z16, Z16 + }; +#undef Z16 +//!@endcond + + for (;;) { + // Scan and copy string before "\\\"" or < 0x20. This is an optional optimzation. + if (!(parseFlags & kParseValidateEncodingFlag)) + ScanCopyUnescapedString(is, os); + + Ch c = is.Peek(); + if (RAPIDJSON_UNLIKELY(c == '\\')) { // Escape + size_t escapeOffset = is.Tell(); // For invalid escaping, report the inital '\\' as error offset + is.Take(); + Ch e = is.Peek(); + if ((sizeof(Ch) == 1 || unsigned(e) < 256) && RAPIDJSON_LIKELY(escape[static_cast(e)])) { + is.Take(); + os.Put(static_cast(escape[static_cast(e)])); + } + else if (RAPIDJSON_LIKELY(e == 'u')) { // Unicode + is.Take(); + unsigned codepoint = ParseHex4(is, escapeOffset); + RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; + if (RAPIDJSON_UNLIKELY(codepoint >= 0xD800 && codepoint <= 0xDBFF)) { + // Handle UTF-16 surrogate pair + if (RAPIDJSON_UNLIKELY(!Consume(is, '\\') || !Consume(is, 'u'))) + RAPIDJSON_PARSE_ERROR(kParseErrorStringUnicodeSurrogateInvalid, escapeOffset); + unsigned codepoint2 = ParseHex4(is, escapeOffset); + RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; + if (RAPIDJSON_UNLIKELY(codepoint2 < 0xDC00 || codepoint2 > 0xDFFF)) + RAPIDJSON_PARSE_ERROR(kParseErrorStringUnicodeSurrogateInvalid, escapeOffset); + codepoint = (((codepoint - 0xD800) << 10) | (codepoint2 - 0xDC00)) + 0x10000; + } + TEncoding::Encode(os, codepoint); + } + else + RAPIDJSON_PARSE_ERROR(kParseErrorStringEscapeInvalid, escapeOffset); + } + else if (RAPIDJSON_UNLIKELY(c == '"')) { // Closing double quote + is.Take(); + os.Put('\0'); // null-terminate the string + return; + } + else if (RAPIDJSON_UNLIKELY(static_cast(c) < 0x20)) { // RFC 4627: unescaped = %x20-21 / %x23-5B / %x5D-10FFFF + if (c == '\0') + RAPIDJSON_PARSE_ERROR(kParseErrorStringMissQuotationMark, is.Tell()); + else + RAPIDJSON_PARSE_ERROR(kParseErrorStringInvalidEncoding, is.Tell()); + } + else { + size_t offset = is.Tell(); + if (RAPIDJSON_UNLIKELY((parseFlags & kParseValidateEncodingFlag ? + !Transcoder::Validate(is, os) : + !Transcoder::Transcode(is, os)))) + RAPIDJSON_PARSE_ERROR(kParseErrorStringInvalidEncoding, offset); + } + } + } + + template + static RAPIDJSON_FORCEINLINE void ScanCopyUnescapedString(InputStream&, OutputStream&) { + // Do nothing for generic version + } + +#if defined(RAPIDJSON_SSE2) || defined(RAPIDJSON_SSE42) + // StringStream -> StackStream + static RAPIDJSON_FORCEINLINE void ScanCopyUnescapedString(StringStream& is, StackStream& os) { + const char* p = is.src_; + + // Scan one by one until alignment (unaligned load may cross page boundary and cause crash) + const char* nextAligned = reinterpret_cast((reinterpret_cast(p) + 15) & static_cast(~15)); + while (p != nextAligned) + if (RAPIDJSON_UNLIKELY(*p == '\"') || RAPIDJSON_UNLIKELY(*p == '\\') || RAPIDJSON_UNLIKELY(static_cast(*p) < 0x20)) { + is.src_ = p; + return; + } + else + os.Put(*p++); + + // The rest of string using SIMD + static const char dquote[16] = { '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"' }; + static const char bslash[16] = { '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\' }; + static const char space[16] = { 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F }; + const __m128i dq = _mm_loadu_si128(reinterpret_cast(&dquote[0])); + const __m128i bs = _mm_loadu_si128(reinterpret_cast(&bslash[0])); + const __m128i sp = _mm_loadu_si128(reinterpret_cast(&space[0])); + + for (;; p += 16) { + const __m128i s = _mm_load_si128(reinterpret_cast(p)); + const __m128i t1 = _mm_cmpeq_epi8(s, dq); + const __m128i t2 = _mm_cmpeq_epi8(s, bs); + const __m128i t3 = _mm_cmpeq_epi8(_mm_max_epu8(s, sp), sp); // s < 0x20 <=> max(s, 0x1F) == 0x1F + const __m128i x = _mm_or_si128(_mm_or_si128(t1, t2), t3); + unsigned short r = static_cast(_mm_movemask_epi8(x)); + if (RAPIDJSON_UNLIKELY(r != 0)) { // some of characters is escaped + SizeType length; + #ifdef _MSC_VER // Find the index of first escaped + unsigned long offset; + _BitScanForward(&offset, r); + length = offset; + #else + length = static_cast(__builtin_ffs(r) - 1); + #endif + if (length != 0) { + char* q = reinterpret_cast(os.Push(length)); + for (size_t i = 0; i < length; i++) + q[i] = p[i]; + + p += length; + } + break; + } + _mm_storeu_si128(reinterpret_cast<__m128i *>(os.Push(16)), s); + } + + is.src_ = p; + } + + // InsituStringStream -> InsituStringStream + static RAPIDJSON_FORCEINLINE void ScanCopyUnescapedString(InsituStringStream& is, InsituStringStream& os) { + RAPIDJSON_ASSERT(&is == &os); + (void)os; + + if (is.src_ == is.dst_) { + SkipUnescapedString(is); + return; + } + + char* p = is.src_; + char *q = is.dst_; + + // Scan one by one until alignment (unaligned load may cross page boundary and cause crash) + const char* nextAligned = reinterpret_cast((reinterpret_cast(p) + 15) & static_cast(~15)); + while (p != nextAligned) + if (RAPIDJSON_UNLIKELY(*p == '\"') || RAPIDJSON_UNLIKELY(*p == '\\') || RAPIDJSON_UNLIKELY(static_cast(*p) < 0x20)) { + is.src_ = p; + is.dst_ = q; + return; + } + else + *q++ = *p++; + + // The rest of string using SIMD + static const char dquote[16] = { '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"' }; + static const char bslash[16] = { '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\' }; + static const char space[16] = { 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F }; + const __m128i dq = _mm_loadu_si128(reinterpret_cast(&dquote[0])); + const __m128i bs = _mm_loadu_si128(reinterpret_cast(&bslash[0])); + const __m128i sp = _mm_loadu_si128(reinterpret_cast(&space[0])); + + for (;; p += 16, q += 16) { + const __m128i s = _mm_load_si128(reinterpret_cast(p)); + const __m128i t1 = _mm_cmpeq_epi8(s, dq); + const __m128i t2 = _mm_cmpeq_epi8(s, bs); + const __m128i t3 = _mm_cmpeq_epi8(_mm_max_epu8(s, sp), sp); // s < 0x20 <=> max(s, 0x1F) == 0x1F + const __m128i x = _mm_or_si128(_mm_or_si128(t1, t2), t3); + unsigned short r = static_cast(_mm_movemask_epi8(x)); + if (RAPIDJSON_UNLIKELY(r != 0)) { // some of characters is escaped + size_t length; +#ifdef _MSC_VER // Find the index of first escaped + unsigned long offset; + _BitScanForward(&offset, r); + length = offset; +#else + length = static_cast(__builtin_ffs(r) - 1); +#endif + for (const char* pend = p + length; p != pend; ) + *q++ = *p++; + break; + } + _mm_storeu_si128(reinterpret_cast<__m128i *>(q), s); + } + + is.src_ = p; + is.dst_ = q; + } + + // When read/write pointers are the same for insitu stream, just skip unescaped characters + static RAPIDJSON_FORCEINLINE void SkipUnescapedString(InsituStringStream& is) { + RAPIDJSON_ASSERT(is.src_ == is.dst_); + char* p = is.src_; + + // Scan one by one until alignment (unaligned load may cross page boundary and cause crash) + const char* nextAligned = reinterpret_cast((reinterpret_cast(p) + 15) & static_cast(~15)); + for (; p != nextAligned; p++) + if (RAPIDJSON_UNLIKELY(*p == '\"') || RAPIDJSON_UNLIKELY(*p == '\\') || RAPIDJSON_UNLIKELY(static_cast(*p) < 0x20)) { + is.src_ = is.dst_ = p; + return; + } + + // The rest of string using SIMD + static const char dquote[16] = { '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"' }; + static const char bslash[16] = { '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\' }; + static const char space[16] = { 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F }; + const __m128i dq = _mm_loadu_si128(reinterpret_cast(&dquote[0])); + const __m128i bs = _mm_loadu_si128(reinterpret_cast(&bslash[0])); + const __m128i sp = _mm_loadu_si128(reinterpret_cast(&space[0])); + + for (;; p += 16) { + const __m128i s = _mm_load_si128(reinterpret_cast(p)); + const __m128i t1 = _mm_cmpeq_epi8(s, dq); + const __m128i t2 = _mm_cmpeq_epi8(s, bs); + const __m128i t3 = _mm_cmpeq_epi8(_mm_max_epu8(s, sp), sp); // s < 0x20 <=> max(s, 0x1F) == 0x1F + const __m128i x = _mm_or_si128(_mm_or_si128(t1, t2), t3); + unsigned short r = static_cast(_mm_movemask_epi8(x)); + if (RAPIDJSON_UNLIKELY(r != 0)) { // some of characters is escaped + size_t length; +#ifdef _MSC_VER // Find the index of first escaped + unsigned long offset; + _BitScanForward(&offset, r); + length = offset; +#else + length = static_cast(__builtin_ffs(r) - 1); +#endif + p += length; + break; + } + } + + is.src_ = is.dst_ = p; + } +#elif defined(RAPIDJSON_NEON) + // StringStream -> StackStream + static RAPIDJSON_FORCEINLINE void ScanCopyUnescapedString(StringStream& is, StackStream& os) { + const char* p = is.src_; + + // Scan one by one until alignment (unaligned load may cross page boundary and cause crash) + const char* nextAligned = reinterpret_cast((reinterpret_cast(p) + 15) & static_cast(~15)); + while (p != nextAligned) + if (RAPIDJSON_UNLIKELY(*p == '\"') || RAPIDJSON_UNLIKELY(*p == '\\') || RAPIDJSON_UNLIKELY(static_cast(*p) < 0x20)) { + is.src_ = p; + return; + } + else + os.Put(*p++); + + // The rest of string using SIMD + const uint8x16_t s0 = vmovq_n_u8('"'); + const uint8x16_t s1 = vmovq_n_u8('\\'); + const uint8x16_t s2 = vmovq_n_u8('\b'); + const uint8x16_t s3 = vmovq_n_u8(32); + + for (;; p += 16) { + const uint8x16_t s = vld1q_u8(reinterpret_cast(p)); + uint8x16_t x = vceqq_u8(s, s0); + x = vorrq_u8(x, vceqq_u8(s, s1)); + x = vorrq_u8(x, vceqq_u8(s, s2)); + x = vorrq_u8(x, vcltq_u8(s, s3)); + + x = vrev64q_u8(x); // Rev in 64 + uint64_t low = vgetq_lane_u64(reinterpret_cast(x), 0); // extract + uint64_t high = vgetq_lane_u64(reinterpret_cast(x), 1); // extract + + SizeType length = 0; + bool escaped = false; + if (low == 0) { + if (high != 0) { + unsigned lz = (unsigned)__builtin_clzll(high);; + length = 8 + (lz >> 3); + escaped = true; + } + } else { + unsigned lz = (unsigned)__builtin_clzll(low);; + length = lz >> 3; + escaped = true; + } + if (RAPIDJSON_UNLIKELY(escaped)) { // some of characters is escaped + if (length != 0) { + char* q = reinterpret_cast(os.Push(length)); + for (size_t i = 0; i < length; i++) + q[i] = p[i]; + + p += length; + } + break; + } + vst1q_u8(reinterpret_cast(os.Push(16)), s); + } + + is.src_ = p; + } + + // InsituStringStream -> InsituStringStream + static RAPIDJSON_FORCEINLINE void ScanCopyUnescapedString(InsituStringStream& is, InsituStringStream& os) { + RAPIDJSON_ASSERT(&is == &os); + (void)os; + + if (is.src_ == is.dst_) { + SkipUnescapedString(is); + return; + } + + char* p = is.src_; + char *q = is.dst_; + + // Scan one by one until alignment (unaligned load may cross page boundary and cause crash) + const char* nextAligned = reinterpret_cast((reinterpret_cast(p) + 15) & static_cast(~15)); + while (p != nextAligned) + if (RAPIDJSON_UNLIKELY(*p == '\"') || RAPIDJSON_UNLIKELY(*p == '\\') || RAPIDJSON_UNLIKELY(static_cast(*p) < 0x20)) { + is.src_ = p; + is.dst_ = q; + return; + } + else + *q++ = *p++; + + // The rest of string using SIMD + const uint8x16_t s0 = vmovq_n_u8('"'); + const uint8x16_t s1 = vmovq_n_u8('\\'); + const uint8x16_t s2 = vmovq_n_u8('\b'); + const uint8x16_t s3 = vmovq_n_u8(32); + + for (;; p += 16, q += 16) { + const uint8x16_t s = vld1q_u8(reinterpret_cast(p)); + uint8x16_t x = vceqq_u8(s, s0); + x = vorrq_u8(x, vceqq_u8(s, s1)); + x = vorrq_u8(x, vceqq_u8(s, s2)); + x = vorrq_u8(x, vcltq_u8(s, s3)); + + x = vrev64q_u8(x); // Rev in 64 + uint64_t low = vgetq_lane_u64(reinterpret_cast(x), 0); // extract + uint64_t high = vgetq_lane_u64(reinterpret_cast(x), 1); // extract + + SizeType length = 0; + bool escaped = false; + if (low == 0) { + if (high != 0) { + unsigned lz = (unsigned)__builtin_clzll(high); + length = 8 + (lz >> 3); + escaped = true; + } + } else { + unsigned lz = (unsigned)__builtin_clzll(low); + length = lz >> 3; + escaped = true; + } + if (RAPIDJSON_UNLIKELY(escaped)) { // some of characters is escaped + for (const char* pend = p + length; p != pend; ) { + *q++ = *p++; + } + break; + } + vst1q_u8(reinterpret_cast(q), s); + } + + is.src_ = p; + is.dst_ = q; + } + + // When read/write pointers are the same for insitu stream, just skip unescaped characters + static RAPIDJSON_FORCEINLINE void SkipUnescapedString(InsituStringStream& is) { + RAPIDJSON_ASSERT(is.src_ == is.dst_); + char* p = is.src_; + + // Scan one by one until alignment (unaligned load may cross page boundary and cause crash) + const char* nextAligned = reinterpret_cast((reinterpret_cast(p) + 15) & static_cast(~15)); + for (; p != nextAligned; p++) + if (RAPIDJSON_UNLIKELY(*p == '\"') || RAPIDJSON_UNLIKELY(*p == '\\') || RAPIDJSON_UNLIKELY(static_cast(*p) < 0x20)) { + is.src_ = is.dst_ = p; + return; + } + + // The rest of string using SIMD + const uint8x16_t s0 = vmovq_n_u8('"'); + const uint8x16_t s1 = vmovq_n_u8('\\'); + const uint8x16_t s2 = vmovq_n_u8('\b'); + const uint8x16_t s3 = vmovq_n_u8(32); + + for (;; p += 16) { + const uint8x16_t s = vld1q_u8(reinterpret_cast(p)); + uint8x16_t x = vceqq_u8(s, s0); + x = vorrq_u8(x, vceqq_u8(s, s1)); + x = vorrq_u8(x, vceqq_u8(s, s2)); + x = vorrq_u8(x, vcltq_u8(s, s3)); + + x = vrev64q_u8(x); // Rev in 64 + uint64_t low = vgetq_lane_u64(reinterpret_cast(x), 0); // extract + uint64_t high = vgetq_lane_u64(reinterpret_cast(x), 1); // extract + + if (low == 0) { + if (high != 0) { + int lz = __builtin_clzll(high); + p += 8 + (lz >> 3); + break; + } + } else { + int lz = __builtin_clzll(low); + p += lz >> 3; + break; + } + } + + is.src_ = is.dst_ = p; + } +#endif // RAPIDJSON_NEON + + template + class NumberStream; + + template + class NumberStream { + public: + typedef typename InputStream::Ch Ch; + + NumberStream(GenericReader& reader, InputStream& s) : is(s) { (void)reader; } + + RAPIDJSON_FORCEINLINE Ch Peek() const { return is.Peek(); } + RAPIDJSON_FORCEINLINE Ch TakePush() { return is.Take(); } + RAPIDJSON_FORCEINLINE Ch Take() { return is.Take(); } + RAPIDJSON_FORCEINLINE void Push(char) {} + + size_t Tell() { return is.Tell(); } + size_t Length() { return 0; } + const char* Pop() { return 0; } + + protected: + NumberStream& operator=(const NumberStream&); + + InputStream& is; + }; + + template + class NumberStream : public NumberStream { + typedef NumberStream Base; + public: + NumberStream(GenericReader& reader, InputStream& is) : Base(reader, is), stackStream(reader.stack_) {} + + RAPIDJSON_FORCEINLINE Ch TakePush() { + stackStream.Put(static_cast(Base::is.Peek())); + return Base::is.Take(); + } + + RAPIDJSON_FORCEINLINE void Push(char c) { + stackStream.Put(c); + } + + size_t Length() { return stackStream.Length(); } + + const char* Pop() { + stackStream.Put('\0'); + return stackStream.Pop(); + } + + private: + StackStream stackStream; + }; + + template + class NumberStream : public NumberStream { + typedef NumberStream Base; + public: + NumberStream(GenericReader& reader, InputStream& is) : Base(reader, is) {} + + RAPIDJSON_FORCEINLINE Ch Take() { return Base::TakePush(); } + }; + + template + void ParseNumber(InputStream& is, Handler& handler) { + internal::StreamLocalCopy copy(is); + NumberStream s(*this, copy.s); + + size_t startOffset = s.Tell(); + double d = 0.0; + bool useNanOrInf = false; + + // Parse minus + bool minus = Consume(s, '-'); + + // Parse int: zero / ( digit1-9 *DIGIT ) + unsigned i = 0; + uint64_t i64 = 0; + bool use64bit = false; + int significandDigit = 0; + if (RAPIDJSON_UNLIKELY(s.Peek() == '0')) { + i = 0; + s.TakePush(); + } + else if (RAPIDJSON_LIKELY(s.Peek() >= '1' && s.Peek() <= '9')) { + i = static_cast(s.TakePush() - '0'); + + if (minus) + while (RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) { + if (RAPIDJSON_UNLIKELY(i >= 214748364)) { // 2^31 = 2147483648 + if (RAPIDJSON_LIKELY(i != 214748364 || s.Peek() > '8')) { + i64 = i; + use64bit = true; + break; + } + } + i = i * 10 + static_cast(s.TakePush() - '0'); + significandDigit++; + } + else + while (RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) { + if (RAPIDJSON_UNLIKELY(i >= 429496729)) { // 2^32 - 1 = 4294967295 + if (RAPIDJSON_LIKELY(i != 429496729 || s.Peek() > '5')) { + i64 = i; + use64bit = true; + break; + } + } + i = i * 10 + static_cast(s.TakePush() - '0'); + significandDigit++; + } + } + // Parse NaN or Infinity here + else if ((parseFlags & kParseNanAndInfFlag) && RAPIDJSON_LIKELY((s.Peek() == 'I' || s.Peek() == 'N'))) { + if (Consume(s, 'N')) { + if (Consume(s, 'a') && Consume(s, 'N')) { + d = std::numeric_limits::quiet_NaN(); + useNanOrInf = true; + } + } + else if (RAPIDJSON_LIKELY(Consume(s, 'I'))) { + if (Consume(s, 'n') && Consume(s, 'f')) { + d = (minus ? -std::numeric_limits::infinity() : std::numeric_limits::infinity()); + useNanOrInf = true; + + if (RAPIDJSON_UNLIKELY(s.Peek() == 'i' && !(Consume(s, 'i') && Consume(s, 'n') + && Consume(s, 'i') && Consume(s, 't') && Consume(s, 'y')))) { + RAPIDJSON_PARSE_ERROR(kParseErrorValueInvalid, s.Tell()); + } + } + } + + if (RAPIDJSON_UNLIKELY(!useNanOrInf)) { + RAPIDJSON_PARSE_ERROR(kParseErrorValueInvalid, s.Tell()); + } + } + else + RAPIDJSON_PARSE_ERROR(kParseErrorValueInvalid, s.Tell()); + + // Parse 64bit int + bool useDouble = false; + if (use64bit) { + if (minus) + while (RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) { + if (RAPIDJSON_UNLIKELY(i64 >= RAPIDJSON_UINT64_C2(0x0CCCCCCC, 0xCCCCCCCC))) // 2^63 = 9223372036854775808 + if (RAPIDJSON_LIKELY(i64 != RAPIDJSON_UINT64_C2(0x0CCCCCCC, 0xCCCCCCCC) || s.Peek() > '8')) { + d = static_cast(i64); + useDouble = true; + break; + } + i64 = i64 * 10 + static_cast(s.TakePush() - '0'); + significandDigit++; + } + else + while (RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) { + if (RAPIDJSON_UNLIKELY(i64 >= RAPIDJSON_UINT64_C2(0x19999999, 0x99999999))) // 2^64 - 1 = 18446744073709551615 + if (RAPIDJSON_LIKELY(i64 != RAPIDJSON_UINT64_C2(0x19999999, 0x99999999) || s.Peek() > '5')) { + d = static_cast(i64); + useDouble = true; + break; + } + i64 = i64 * 10 + static_cast(s.TakePush() - '0'); + significandDigit++; + } + } + + // Force double for big integer + if (useDouble) { + while (RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) { + if (RAPIDJSON_UNLIKELY(d >= 1.7976931348623157e307)) // DBL_MAX / 10.0 + RAPIDJSON_PARSE_ERROR(kParseErrorNumberTooBig, startOffset); + d = d * 10 + (s.TakePush() - '0'); + } + } + + // Parse frac = decimal-point 1*DIGIT + int expFrac = 0; + size_t decimalPosition; + if (Consume(s, '.')) { + decimalPosition = s.Length(); + + if (RAPIDJSON_UNLIKELY(!(s.Peek() >= '0' && s.Peek() <= '9'))) + RAPIDJSON_PARSE_ERROR(kParseErrorNumberMissFraction, s.Tell()); + + if (!useDouble) { +#if RAPIDJSON_64BIT + // Use i64 to store significand in 64-bit architecture + if (!use64bit) + i64 = i; + + while (RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) { + if (i64 > RAPIDJSON_UINT64_C2(0x1FFFFF, 0xFFFFFFFF)) // 2^53 - 1 for fast path + break; + else { + i64 = i64 * 10 + static_cast(s.TakePush() - '0'); + --expFrac; + if (i64 != 0) + significandDigit++; + } + } + + d = static_cast(i64); +#else + // Use double to store significand in 32-bit architecture + d = static_cast(use64bit ? i64 : i); +#endif + useDouble = true; + } + + while (RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) { + if (significandDigit < 17) { + d = d * 10.0 + (s.TakePush() - '0'); + --expFrac; + if (RAPIDJSON_LIKELY(d > 0.0)) + significandDigit++; + } + else + s.TakePush(); + } + } + else + decimalPosition = s.Length(); // decimal position at the end of integer. + + // Parse exp = e [ minus / plus ] 1*DIGIT + int exp = 0; + if (Consume(s, 'e') || Consume(s, 'E')) { + if (!useDouble) { + d = static_cast(use64bit ? i64 : i); + useDouble = true; + } + + bool expMinus = false; + if (Consume(s, '+')) + ; + else if (Consume(s, '-')) + expMinus = true; + + if (RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) { + exp = static_cast(s.Take() - '0'); + if (expMinus) { + while (RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) { + exp = exp * 10 + static_cast(s.Take() - '0'); + if (exp >= 214748364) { // Issue #313: prevent overflow exponent + while (RAPIDJSON_UNLIKELY(s.Peek() >= '0' && s.Peek() <= '9')) // Consume the rest of exponent + s.Take(); + } + } + } + else { // positive exp + int maxExp = 308 - expFrac; + while (RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) { + exp = exp * 10 + static_cast(s.Take() - '0'); + if (RAPIDJSON_UNLIKELY(exp > maxExp)) + RAPIDJSON_PARSE_ERROR(kParseErrorNumberTooBig, startOffset); + } + } + } + else + RAPIDJSON_PARSE_ERROR(kParseErrorNumberMissExponent, s.Tell()); + + if (expMinus) + exp = -exp; + } + + // Finish parsing, call event according to the type of number. + bool cont = true; + + if (parseFlags & kParseNumbersAsStringsFlag) { + if (parseFlags & kParseInsituFlag) { + s.Pop(); // Pop stack no matter if it will be used or not. + typename InputStream::Ch* head = is.PutBegin(); + const size_t length = s.Tell() - startOffset; + RAPIDJSON_ASSERT(length <= 0xFFFFFFFF); + // unable to insert the \0 character here, it will erase the comma after this number + const typename TargetEncoding::Ch* const str = reinterpret_cast(head); + cont = handler.RawNumber(str, SizeType(length), false); + } + else { + SizeType numCharsToCopy = static_cast(s.Length()); + StringStream srcStream(s.Pop()); + StackStream dstStream(stack_); + while (numCharsToCopy--) { + Transcoder, TargetEncoding>::Transcode(srcStream, dstStream); + } + dstStream.Put('\0'); + const typename TargetEncoding::Ch* str = dstStream.Pop(); + const SizeType length = static_cast(dstStream.Length()) - 1; + cont = handler.RawNumber(str, SizeType(length), true); + } + } + else { + size_t length = s.Length(); + const char* decimal = s.Pop(); // Pop stack no matter if it will be used or not. + + if (useDouble) { + int p = exp + expFrac; + if (parseFlags & kParseFullPrecisionFlag) + d = internal::StrtodFullPrecision(d, p, decimal, length, decimalPosition, exp); + else + d = internal::StrtodNormalPrecision(d, p); + + cont = handler.Double(minus ? -d : d); + } + else if (useNanOrInf) { + cont = handler.Double(d); + } + else { + if (use64bit) { + if (minus) + cont = handler.Int64(static_cast(~i64 + 1)); + else + cont = handler.Uint64(i64); + } + else { + if (minus) + cont = handler.Int(static_cast(~i + 1)); + else + cont = handler.Uint(i); + } + } + } + if (RAPIDJSON_UNLIKELY(!cont)) + RAPIDJSON_PARSE_ERROR(kParseErrorTermination, startOffset); + } + + // Parse any JSON value + template + void ParseValue(InputStream& is, Handler& handler) { + switch (is.Peek()) { + case 'n': ParseNull (is, handler); break; + case 't': ParseTrue (is, handler); break; + case 'f': ParseFalse (is, handler); break; + case '"': ParseString(is, handler); break; + case '{': ParseObject(is, handler); break; + case '[': ParseArray (is, handler); break; + default : + ParseNumber(is, handler); + break; + + } + } + + // Iterative Parsing + + // States + enum IterativeParsingState { + IterativeParsingFinishState = 0, // sink states at top + IterativeParsingErrorState, // sink states at top + IterativeParsingStartState, + + // Object states + IterativeParsingObjectInitialState, + IterativeParsingMemberKeyState, + IterativeParsingMemberValueState, + IterativeParsingObjectFinishState, + + // Array states + IterativeParsingArrayInitialState, + IterativeParsingElementState, + IterativeParsingArrayFinishState, + + // Single value state + IterativeParsingValueState, + + // Delimiter states (at bottom) + IterativeParsingElementDelimiterState, + IterativeParsingMemberDelimiterState, + IterativeParsingKeyValueDelimiterState, + + cIterativeParsingStateCount + }; + + // Tokens + enum Token { + LeftBracketToken = 0, + RightBracketToken, + + LeftCurlyBracketToken, + RightCurlyBracketToken, + + CommaToken, + ColonToken, + + StringToken, + FalseToken, + TrueToken, + NullToken, + NumberToken, + + kTokenCount + }; + + RAPIDJSON_FORCEINLINE Token Tokenize(Ch c) { + +//!@cond RAPIDJSON_HIDDEN_FROM_DOXYGEN +#define N NumberToken +#define N16 N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N + // Maps from ASCII to Token + static const unsigned char tokenMap[256] = { + N16, // 00~0F + N16, // 10~1F + N, N, StringToken, N, N, N, N, N, N, N, N, N, CommaToken, N, N, N, // 20~2F + N, N, N, N, N, N, N, N, N, N, ColonToken, N, N, N, N, N, // 30~3F + N16, // 40~4F + N, N, N, N, N, N, N, N, N, N, N, LeftBracketToken, N, RightBracketToken, N, N, // 50~5F + N, N, N, N, N, N, FalseToken, N, N, N, N, N, N, N, NullToken, N, // 60~6F + N, N, N, N, TrueToken, N, N, N, N, N, N, LeftCurlyBracketToken, N, RightCurlyBracketToken, N, N, // 70~7F + N16, N16, N16, N16, N16, N16, N16, N16 // 80~FF + }; +#undef N +#undef N16 +//!@endcond + + if (sizeof(Ch) == 1 || static_cast(c) < 256) + return static_cast(tokenMap[static_cast(c)]); + else + return NumberToken; + } + + RAPIDJSON_FORCEINLINE IterativeParsingState Predict(IterativeParsingState state, Token token) { + // current state x one lookahead token -> new state + static const char G[cIterativeParsingStateCount][kTokenCount] = { + // Finish(sink state) + { + IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, + IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, + IterativeParsingErrorState + }, + // Error(sink state) + { + IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, + IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, + IterativeParsingErrorState + }, + // Start + { + IterativeParsingArrayInitialState, // Left bracket + IterativeParsingErrorState, // Right bracket + IterativeParsingObjectInitialState, // Left curly bracket + IterativeParsingErrorState, // Right curly bracket + IterativeParsingErrorState, // Comma + IterativeParsingErrorState, // Colon + IterativeParsingValueState, // String + IterativeParsingValueState, // False + IterativeParsingValueState, // True + IterativeParsingValueState, // Null + IterativeParsingValueState // Number + }, + // ObjectInitial + { + IterativeParsingErrorState, // Left bracket + IterativeParsingErrorState, // Right bracket + IterativeParsingErrorState, // Left curly bracket + IterativeParsingObjectFinishState, // Right curly bracket + IterativeParsingErrorState, // Comma + IterativeParsingErrorState, // Colon + IterativeParsingMemberKeyState, // String + IterativeParsingErrorState, // False + IterativeParsingErrorState, // True + IterativeParsingErrorState, // Null + IterativeParsingErrorState // Number + }, + // MemberKey + { + IterativeParsingErrorState, // Left bracket + IterativeParsingErrorState, // Right bracket + IterativeParsingErrorState, // Left curly bracket + IterativeParsingErrorState, // Right curly bracket + IterativeParsingErrorState, // Comma + IterativeParsingKeyValueDelimiterState, // Colon + IterativeParsingErrorState, // String + IterativeParsingErrorState, // False + IterativeParsingErrorState, // True + IterativeParsingErrorState, // Null + IterativeParsingErrorState // Number + }, + // MemberValue + { + IterativeParsingErrorState, // Left bracket + IterativeParsingErrorState, // Right bracket + IterativeParsingErrorState, // Left curly bracket + IterativeParsingObjectFinishState, // Right curly bracket + IterativeParsingMemberDelimiterState, // Comma + IterativeParsingErrorState, // Colon + IterativeParsingErrorState, // String + IterativeParsingErrorState, // False + IterativeParsingErrorState, // True + IterativeParsingErrorState, // Null + IterativeParsingErrorState // Number + }, + // ObjectFinish(sink state) + { + IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, + IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, + IterativeParsingErrorState + }, + // ArrayInitial + { + IterativeParsingArrayInitialState, // Left bracket(push Element state) + IterativeParsingArrayFinishState, // Right bracket + IterativeParsingObjectInitialState, // Left curly bracket(push Element state) + IterativeParsingErrorState, // Right curly bracket + IterativeParsingErrorState, // Comma + IterativeParsingErrorState, // Colon + IterativeParsingElementState, // String + IterativeParsingElementState, // False + IterativeParsingElementState, // True + IterativeParsingElementState, // Null + IterativeParsingElementState // Number + }, + // Element + { + IterativeParsingErrorState, // Left bracket + IterativeParsingArrayFinishState, // Right bracket + IterativeParsingErrorState, // Left curly bracket + IterativeParsingErrorState, // Right curly bracket + IterativeParsingElementDelimiterState, // Comma + IterativeParsingErrorState, // Colon + IterativeParsingErrorState, // String + IterativeParsingErrorState, // False + IterativeParsingErrorState, // True + IterativeParsingErrorState, // Null + IterativeParsingErrorState // Number + }, + // ArrayFinish(sink state) + { + IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, + IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, + IterativeParsingErrorState + }, + // Single Value (sink state) + { + IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, + IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, + IterativeParsingErrorState + }, + // ElementDelimiter + { + IterativeParsingArrayInitialState, // Left bracket(push Element state) + IterativeParsingArrayFinishState, // Right bracket + IterativeParsingObjectInitialState, // Left curly bracket(push Element state) + IterativeParsingErrorState, // Right curly bracket + IterativeParsingErrorState, // Comma + IterativeParsingErrorState, // Colon + IterativeParsingElementState, // String + IterativeParsingElementState, // False + IterativeParsingElementState, // True + IterativeParsingElementState, // Null + IterativeParsingElementState // Number + }, + // MemberDelimiter + { + IterativeParsingErrorState, // Left bracket + IterativeParsingErrorState, // Right bracket + IterativeParsingErrorState, // Left curly bracket + IterativeParsingObjectFinishState, // Right curly bracket + IterativeParsingErrorState, // Comma + IterativeParsingErrorState, // Colon + IterativeParsingMemberKeyState, // String + IterativeParsingErrorState, // False + IterativeParsingErrorState, // True + IterativeParsingErrorState, // Null + IterativeParsingErrorState // Number + }, + // KeyValueDelimiter + { + IterativeParsingArrayInitialState, // Left bracket(push MemberValue state) + IterativeParsingErrorState, // Right bracket + IterativeParsingObjectInitialState, // Left curly bracket(push MemberValue state) + IterativeParsingErrorState, // Right curly bracket + IterativeParsingErrorState, // Comma + IterativeParsingErrorState, // Colon + IterativeParsingMemberValueState, // String + IterativeParsingMemberValueState, // False + IterativeParsingMemberValueState, // True + IterativeParsingMemberValueState, // Null + IterativeParsingMemberValueState // Number + }, + }; // End of G + + return static_cast(G[state][token]); + } + + // Make an advance in the token stream and state based on the candidate destination state which was returned by Transit(). + // May return a new state on state pop. + template + RAPIDJSON_FORCEINLINE IterativeParsingState Transit(IterativeParsingState src, Token token, IterativeParsingState dst, InputStream& is, Handler& handler) { + (void)token; + + switch (dst) { + case IterativeParsingErrorState: + return dst; + + case IterativeParsingObjectInitialState: + case IterativeParsingArrayInitialState: + { + // Push the state(Element or MemeberValue) if we are nested in another array or value of member. + // In this way we can get the correct state on ObjectFinish or ArrayFinish by frame pop. + IterativeParsingState n = src; + if (src == IterativeParsingArrayInitialState || src == IterativeParsingElementDelimiterState) + n = IterativeParsingElementState; + else if (src == IterativeParsingKeyValueDelimiterState) + n = IterativeParsingMemberValueState; + // Push current state. + *stack_.template Push(1) = n; + // Initialize and push the member/element count. + *stack_.template Push(1) = 0; + // Call handler + bool hr = (dst == IterativeParsingObjectInitialState) ? handler.StartObject() : handler.StartArray(); + // On handler short circuits the parsing. + if (!hr) { + RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorTermination, is.Tell()); + return IterativeParsingErrorState; + } + else { + is.Take(); + return dst; + } + } + + case IterativeParsingMemberKeyState: + ParseString(is, handler, true); + if (HasParseError()) + return IterativeParsingErrorState; + else + return dst; + + case IterativeParsingKeyValueDelimiterState: + RAPIDJSON_ASSERT(token == ColonToken); + is.Take(); + return dst; + + case IterativeParsingMemberValueState: + // Must be non-compound value. Or it would be ObjectInitial or ArrayInitial state. + ParseValue(is, handler); + if (HasParseError()) { + return IterativeParsingErrorState; + } + return dst; + + case IterativeParsingElementState: + // Must be non-compound value. Or it would be ObjectInitial or ArrayInitial state. + ParseValue(is, handler); + if (HasParseError()) { + return IterativeParsingErrorState; + } + return dst; + + case IterativeParsingMemberDelimiterState: + case IterativeParsingElementDelimiterState: + is.Take(); + // Update member/element count. + *stack_.template Top() = *stack_.template Top() + 1; + return dst; + + case IterativeParsingObjectFinishState: + { + // Transit from delimiter is only allowed when trailing commas are enabled + if (!(parseFlags & kParseTrailingCommasFlag) && src == IterativeParsingMemberDelimiterState) { + RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorObjectMissName, is.Tell()); + return IterativeParsingErrorState; + } + // Get member count. + SizeType c = *stack_.template Pop(1); + // If the object is not empty, count the last member. + if (src == IterativeParsingMemberValueState) + ++c; + // Restore the state. + IterativeParsingState n = static_cast(*stack_.template Pop(1)); + // Transit to Finish state if this is the topmost scope. + if (n == IterativeParsingStartState) + n = IterativeParsingFinishState; + // Call handler + bool hr = handler.EndObject(c); + // On handler short circuits the parsing. + if (!hr) { + RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorTermination, is.Tell()); + return IterativeParsingErrorState; + } + else { + is.Take(); + return n; + } + } + + case IterativeParsingArrayFinishState: + { + // Transit from delimiter is only allowed when trailing commas are enabled + if (!(parseFlags & kParseTrailingCommasFlag) && src == IterativeParsingElementDelimiterState) { + RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorValueInvalid, is.Tell()); + return IterativeParsingErrorState; + } + // Get element count. + SizeType c = *stack_.template Pop(1); + // If the array is not empty, count the last element. + if (src == IterativeParsingElementState) + ++c; + // Restore the state. + IterativeParsingState n = static_cast(*stack_.template Pop(1)); + // Transit to Finish state if this is the topmost scope. + if (n == IterativeParsingStartState) + n = IterativeParsingFinishState; + // Call handler + bool hr = handler.EndArray(c); + // On handler short circuits the parsing. + if (!hr) { + RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorTermination, is.Tell()); + return IterativeParsingErrorState; + } + else { + is.Take(); + return n; + } + } + + default: + // This branch is for IterativeParsingValueState actually. + // Use `default:` rather than + // `case IterativeParsingValueState:` is for code coverage. + + // The IterativeParsingStartState is not enumerated in this switch-case. + // It is impossible for that case. And it can be caught by following assertion. + + // The IterativeParsingFinishState is not enumerated in this switch-case either. + // It is a "derivative" state which cannot triggered from Predict() directly. + // Therefore it cannot happen here. And it can be caught by following assertion. + RAPIDJSON_ASSERT(dst == IterativeParsingValueState); + + // Must be non-compound value. Or it would be ObjectInitial or ArrayInitial state. + ParseValue(is, handler); + if (HasParseError()) { + return IterativeParsingErrorState; + } + return IterativeParsingFinishState; + } + } + + template + void HandleError(IterativeParsingState src, InputStream& is) { + if (HasParseError()) { + // Error flag has been set. + return; + } + + switch (src) { + case IterativeParsingStartState: RAPIDJSON_PARSE_ERROR(kParseErrorDocumentEmpty, is.Tell()); return; + case IterativeParsingFinishState: RAPIDJSON_PARSE_ERROR(kParseErrorDocumentRootNotSingular, is.Tell()); return; + case IterativeParsingObjectInitialState: + case IterativeParsingMemberDelimiterState: RAPIDJSON_PARSE_ERROR(kParseErrorObjectMissName, is.Tell()); return; + case IterativeParsingMemberKeyState: RAPIDJSON_PARSE_ERROR(kParseErrorObjectMissColon, is.Tell()); return; + case IterativeParsingMemberValueState: RAPIDJSON_PARSE_ERROR(kParseErrorObjectMissCommaOrCurlyBracket, is.Tell()); return; + case IterativeParsingKeyValueDelimiterState: + case IterativeParsingArrayInitialState: + case IterativeParsingElementDelimiterState: RAPIDJSON_PARSE_ERROR(kParseErrorValueInvalid, is.Tell()); return; + default: RAPIDJSON_ASSERT(src == IterativeParsingElementState); RAPIDJSON_PARSE_ERROR(kParseErrorArrayMissCommaOrSquareBracket, is.Tell()); return; + } + } + + RAPIDJSON_FORCEINLINE bool IsIterativeParsingDelimiterState(IterativeParsingState s) { + return s >= IterativeParsingElementDelimiterState; + } + + RAPIDJSON_FORCEINLINE bool IsIterativeParsingCompleteState(IterativeParsingState s) { + return s <= IterativeParsingErrorState; + } + + template + ParseResult IterativeParse(InputStream& is, Handler& handler) { + parseResult_.Clear(); + ClearStackOnExit scope(*this); + IterativeParsingState state = IterativeParsingStartState; + + SkipWhitespaceAndComments(is); + RAPIDJSON_PARSE_ERROR_EARLY_RETURN(parseResult_); + while (is.Peek() != '\0') { + Token t = Tokenize(is.Peek()); + IterativeParsingState n = Predict(state, t); + IterativeParsingState d = Transit(state, t, n, is, handler); + + if (d == IterativeParsingErrorState) { + HandleError(state, is); + break; + } + + state = d; + + // Do not further consume streams if a root JSON has been parsed. + if ((parseFlags & kParseStopWhenDoneFlag) && state == IterativeParsingFinishState) + break; + + SkipWhitespaceAndComments(is); + RAPIDJSON_PARSE_ERROR_EARLY_RETURN(parseResult_); + } + + // Handle the end of file. + if (state != IterativeParsingFinishState) + HandleError(state, is); + + return parseResult_; + } + + static const size_t kDefaultStackCapacity = 256; //!< Default stack capacity in bytes for storing a single decoded string. + internal::Stack stack_; //!< A stack for storing decoded string temporarily during non-destructive parsing. + ParseResult parseResult_; + IterativeParsingState state_; +}; // class GenericReader + +//! Reader with UTF8 encoding and default allocator. +typedef GenericReader, UTF8<> > Reader; + +RAPIDJSON_NAMESPACE_END + +#ifdef __clang__ +RAPIDJSON_DIAG_POP +#endif + + +#ifdef __GNUC__ +RAPIDJSON_DIAG_POP +#endif + +#ifdef _MSC_VER +RAPIDJSON_DIAG_POP +#endif + +#endif // RAPIDJSON_READER_H_ diff --git a/umd/external/include/rapidjson/schema.h b/umd/external/include/rapidjson/schema.h new file mode 100644 index 00000000..348dd379 --- /dev/null +++ b/umd/external/include/rapidjson/schema.h @@ -0,0 +1,2024 @@ +// Tencent is pleased to support the open source community by making RapidJSON available-> +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip-> All rights reserved-> +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License-> You may obtain a copy of the License at +// +// http://opensource->org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied-> See the License for the +// specific language governing permissions and limitations under the License-> + +#ifndef RAPIDJSON_SCHEMA_H_ +#define RAPIDJSON_SCHEMA_H_ + +#include "document.h" +#include "pointer.h" +#include // abs, floor + +#if !defined(RAPIDJSON_SCHEMA_USE_INTERNALREGEX) +#define RAPIDJSON_SCHEMA_USE_INTERNALREGEX 1 +#else +#define RAPIDJSON_SCHEMA_USE_INTERNALREGEX 0 +#endif + +#if !RAPIDJSON_SCHEMA_USE_INTERNALREGEX && !defined(RAPIDJSON_SCHEMA_USE_STDREGEX) && (__cplusplus >=201103L || (defined(_MSC_VER) && _MSC_VER >= 1800)) +#define RAPIDJSON_SCHEMA_USE_STDREGEX 1 +#else +#define RAPIDJSON_SCHEMA_USE_STDREGEX 0 +#endif + +#if RAPIDJSON_SCHEMA_USE_INTERNALREGEX +#include "internal/regex.h" +#elif RAPIDJSON_SCHEMA_USE_STDREGEX +#include +#endif + +#if RAPIDJSON_SCHEMA_USE_INTERNALREGEX || RAPIDJSON_SCHEMA_USE_STDREGEX +#define RAPIDJSON_SCHEMA_HAS_REGEX 1 +#else +#define RAPIDJSON_SCHEMA_HAS_REGEX 0 +#endif + +#ifndef RAPIDJSON_SCHEMA_VERBOSE +#define RAPIDJSON_SCHEMA_VERBOSE 0 +#endif + +#if RAPIDJSON_SCHEMA_VERBOSE +#include "stringbuffer.h" +#endif + +RAPIDJSON_DIAG_PUSH + +#if defined(__GNUC__) +RAPIDJSON_DIAG_OFF(effc++) +#endif + +#ifdef __clang__ +RAPIDJSON_DIAG_OFF(weak-vtables) +RAPIDJSON_DIAG_OFF(exit-time-destructors) +RAPIDJSON_DIAG_OFF(c++98-compat-pedantic) +RAPIDJSON_DIAG_OFF(variadic-macros) +#endif + +#ifdef _MSC_VER +RAPIDJSON_DIAG_OFF(4512) // assignment operator could not be generated +#endif + +RAPIDJSON_NAMESPACE_BEGIN + +/////////////////////////////////////////////////////////////////////////////// +// Verbose Utilities + +#if RAPIDJSON_SCHEMA_VERBOSE + +namespace internal { + +inline void PrintInvalidKeyword(const char* keyword) { + printf("Fail keyword: %s\n", keyword); +} + +inline void PrintInvalidKeyword(const wchar_t* keyword) { + wprintf(L"Fail keyword: %ls\n", keyword); +} + +inline void PrintInvalidDocument(const char* document) { + printf("Fail document: %s\n\n", document); +} + +inline void PrintInvalidDocument(const wchar_t* document) { + wprintf(L"Fail document: %ls\n\n", document); +} + +inline void PrintValidatorPointers(unsigned depth, const char* s, const char* d) { + printf("S: %*s%s\nD: %*s%s\n\n", depth * 4, " ", s, depth * 4, " ", d); +} + +inline void PrintValidatorPointers(unsigned depth, const wchar_t* s, const wchar_t* d) { + wprintf(L"S: %*ls%ls\nD: %*ls%ls\n\n", depth * 4, L" ", s, depth * 4, L" ", d); +} + +} // namespace internal + +#endif // RAPIDJSON_SCHEMA_VERBOSE + +/////////////////////////////////////////////////////////////////////////////// +// RAPIDJSON_INVALID_KEYWORD_RETURN + +#if RAPIDJSON_SCHEMA_VERBOSE +#define RAPIDJSON_INVALID_KEYWORD_VERBOSE(keyword) internal::PrintInvalidKeyword(keyword) +#else +#define RAPIDJSON_INVALID_KEYWORD_VERBOSE(keyword) +#endif + +#define RAPIDJSON_INVALID_KEYWORD_RETURN(keyword)\ +RAPIDJSON_MULTILINEMACRO_BEGIN\ + context.invalidKeyword = keyword.GetString();\ + RAPIDJSON_INVALID_KEYWORD_VERBOSE(keyword.GetString());\ + return false;\ +RAPIDJSON_MULTILINEMACRO_END + +/////////////////////////////////////////////////////////////////////////////// +// Forward declarations + +template +class GenericSchemaDocument; + +namespace internal { + +template +class Schema; + +/////////////////////////////////////////////////////////////////////////////// +// ISchemaValidator + +class ISchemaValidator { +public: + virtual ~ISchemaValidator() {} + virtual bool IsValid() const = 0; +}; + +/////////////////////////////////////////////////////////////////////////////// +// ISchemaStateFactory + +template +class ISchemaStateFactory { +public: + virtual ~ISchemaStateFactory() {} + virtual ISchemaValidator* CreateSchemaValidator(const SchemaType&) = 0; + virtual void DestroySchemaValidator(ISchemaValidator* validator) = 0; + virtual void* CreateHasher() = 0; + virtual uint64_t GetHashCode(void* hasher) = 0; + virtual void DestroryHasher(void* hasher) = 0; + virtual void* MallocState(size_t size) = 0; + virtual void FreeState(void* p) = 0; +}; + +/////////////////////////////////////////////////////////////////////////////// +// Hasher + +// For comparison of compound value +template +class Hasher { +public: + typedef typename Encoding::Ch Ch; + + Hasher(Allocator* allocator = 0, size_t stackCapacity = kDefaultSize) : stack_(allocator, stackCapacity) {} + + bool Null() { return WriteType(kNullType); } + bool Bool(bool b) { return WriteType(b ? kTrueType : kFalseType); } + bool Int(int i) { Number n; n.u.i = i; n.d = static_cast(i); return WriteNumber(n); } + bool Uint(unsigned u) { Number n; n.u.u = u; n.d = static_cast(u); return WriteNumber(n); } + bool Int64(int64_t i) { Number n; n.u.i = i; n.d = static_cast(i); return WriteNumber(n); } + bool Uint64(uint64_t u) { Number n; n.u.u = u; n.d = static_cast(u); return WriteNumber(n); } + bool Double(double d) { + Number n; + if (d < 0) n.u.i = static_cast(d); + else n.u.u = static_cast(d); + n.d = d; + return WriteNumber(n); + } + + bool RawNumber(const Ch* str, SizeType len, bool) { + WriteBuffer(kNumberType, str, len * sizeof(Ch)); + return true; + } + + bool String(const Ch* str, SizeType len, bool) { + WriteBuffer(kStringType, str, len * sizeof(Ch)); + return true; + } + + bool StartObject() { return true; } + bool Key(const Ch* str, SizeType len, bool copy) { return String(str, len, copy); } + bool EndObject(SizeType memberCount) { + uint64_t h = Hash(0, kObjectType); + uint64_t* kv = stack_.template Pop(memberCount * 2); + for (SizeType i = 0; i < memberCount; i++) + h ^= Hash(kv[i * 2], kv[i * 2 + 1]); // Use xor to achieve member order insensitive + *stack_.template Push() = h; + return true; + } + + bool StartArray() { return true; } + bool EndArray(SizeType elementCount) { + uint64_t h = Hash(0, kArrayType); + uint64_t* e = stack_.template Pop(elementCount); + for (SizeType i = 0; i < elementCount; i++) + h = Hash(h, e[i]); // Use hash to achieve element order sensitive + *stack_.template Push() = h; + return true; + } + + bool IsValid() const { return stack_.GetSize() == sizeof(uint64_t); } + + uint64_t GetHashCode() const { + RAPIDJSON_ASSERT(IsValid()); + return *stack_.template Top(); + } + +private: + static const size_t kDefaultSize = 256; + struct Number { + union U { + uint64_t u; + int64_t i; + }u; + double d; + }; + + bool WriteType(Type type) { return WriteBuffer(type, 0, 0); } + + bool WriteNumber(const Number& n) { return WriteBuffer(kNumberType, &n, sizeof(n)); } + + bool WriteBuffer(Type type, const void* data, size_t len) { + // FNV-1a from http://isthe.com/chongo/tech/comp/fnv/ + uint64_t h = Hash(RAPIDJSON_UINT64_C2(0x84222325, 0xcbf29ce4), type); + const unsigned char* d = static_cast(data); + for (size_t i = 0; i < len; i++) + h = Hash(h, d[i]); + *stack_.template Push() = h; + return true; + } + + static uint64_t Hash(uint64_t h, uint64_t d) { + static const uint64_t kPrime = RAPIDJSON_UINT64_C2(0x00000100, 0x000001b3); + h ^= d; + h *= kPrime; + return h; + } + + Stack stack_; +}; + +/////////////////////////////////////////////////////////////////////////////// +// SchemaValidationContext + +template +struct SchemaValidationContext { + typedef Schema SchemaType; + typedef ISchemaStateFactory SchemaValidatorFactoryType; + typedef typename SchemaType::ValueType ValueType; + typedef typename ValueType::Ch Ch; + + enum PatternValidatorType { + kPatternValidatorOnly, + kPatternValidatorWithProperty, + kPatternValidatorWithAdditionalProperty + }; + + SchemaValidationContext(SchemaValidatorFactoryType& f, const SchemaType* s) : + factory(f), + schema(s), + valueSchema(), + invalidKeyword(), + hasher(), + arrayElementHashCodes(), + validators(), + validatorCount(), + patternPropertiesValidators(), + patternPropertiesValidatorCount(), + patternPropertiesSchemas(), + patternPropertiesSchemaCount(), + valuePatternValidatorType(kPatternValidatorOnly), + propertyExist(), + inArray(false), + valueUniqueness(false), + arrayUniqueness(false) + { + } + + ~SchemaValidationContext() { + if (hasher) + factory.DestroryHasher(hasher); + if (validators) { + for (SizeType i = 0; i < validatorCount; i++) + factory.DestroySchemaValidator(validators[i]); + factory.FreeState(validators); + } + if (patternPropertiesValidators) { + for (SizeType i = 0; i < patternPropertiesValidatorCount; i++) + factory.DestroySchemaValidator(patternPropertiesValidators[i]); + factory.FreeState(patternPropertiesValidators); + } + if (patternPropertiesSchemas) + factory.FreeState(patternPropertiesSchemas); + if (propertyExist) + factory.FreeState(propertyExist); + } + + SchemaValidatorFactoryType& factory; + const SchemaType* schema; + const SchemaType* valueSchema; + const Ch* invalidKeyword; + void* hasher; // Only validator access + void* arrayElementHashCodes; // Only validator access this + ISchemaValidator** validators; + SizeType validatorCount; + ISchemaValidator** patternPropertiesValidators; + SizeType patternPropertiesValidatorCount; + const SchemaType** patternPropertiesSchemas; + SizeType patternPropertiesSchemaCount; + PatternValidatorType valuePatternValidatorType; + PatternValidatorType objectPatternValidatorType; + SizeType arrayElementIndex; + bool* propertyExist; + bool inArray; + bool valueUniqueness; + bool arrayUniqueness; +}; + +/////////////////////////////////////////////////////////////////////////////// +// Schema + +template +class Schema { +public: + typedef typename SchemaDocumentType::ValueType ValueType; + typedef typename SchemaDocumentType::AllocatorType AllocatorType; + typedef typename SchemaDocumentType::PointerType PointerType; + typedef typename ValueType::EncodingType EncodingType; + typedef typename EncodingType::Ch Ch; + typedef SchemaValidationContext Context; + typedef Schema SchemaType; + typedef GenericValue SValue; + friend class GenericSchemaDocument; + + Schema(SchemaDocumentType* schemaDocument, const PointerType& p, const ValueType& value, const ValueType& document, AllocatorType* allocator) : + allocator_(allocator), + typeless_(schemaDocument->GetTypeless()), + enum_(), + enumCount_(), + not_(), + type_((1 << kTotalSchemaType) - 1), // typeless + validatorCount_(), + properties_(), + additionalPropertiesSchema_(), + patternProperties_(), + patternPropertyCount_(), + propertyCount_(), + minProperties_(), + maxProperties_(SizeType(~0)), + additionalProperties_(true), + hasDependencies_(), + hasRequired_(), + hasSchemaDependencies_(), + additionalItemsSchema_(), + itemsList_(), + itemsTuple_(), + itemsTupleCount_(), + minItems_(), + maxItems_(SizeType(~0)), + additionalItems_(true), + uniqueItems_(false), + pattern_(), + minLength_(0), + maxLength_(~SizeType(0)), + exclusiveMinimum_(false), + exclusiveMaximum_(false) + { + typedef typename SchemaDocumentType::ValueType ValueType; + typedef typename ValueType::ConstValueIterator ConstValueIterator; + typedef typename ValueType::ConstMemberIterator ConstMemberIterator; + + if (!value.IsObject()) + return; + + if (const ValueType* v = GetMember(value, GetTypeString())) { + type_ = 0; + if (v->IsString()) + AddType(*v); + else if (v->IsArray()) + for (ConstValueIterator itr = v->Begin(); itr != v->End(); ++itr) + AddType(*itr); + } + + if (const ValueType* v = GetMember(value, GetEnumString())) + if (v->IsArray() && v->Size() > 0) { + enum_ = static_cast(allocator_->Malloc(sizeof(uint64_t) * v->Size())); + for (ConstValueIterator itr = v->Begin(); itr != v->End(); ++itr) { + typedef Hasher > EnumHasherType; + char buffer[256 + 24]; + MemoryPoolAllocator<> hasherAllocator(buffer, sizeof(buffer)); + EnumHasherType h(&hasherAllocator, 256); + itr->Accept(h); + enum_[enumCount_++] = h.GetHashCode(); + } + } + + if (schemaDocument) { + AssignIfExist(allOf_, *schemaDocument, p, value, GetAllOfString(), document); + AssignIfExist(anyOf_, *schemaDocument, p, value, GetAnyOfString(), document); + AssignIfExist(oneOf_, *schemaDocument, p, value, GetOneOfString(), document); + } + + if (const ValueType* v = GetMember(value, GetNotString())) { + schemaDocument->CreateSchema(¬_, p.Append(GetNotString(), allocator_), *v, document); + notValidatorIndex_ = validatorCount_; + validatorCount_++; + } + + // Object + + const ValueType* properties = GetMember(value, GetPropertiesString()); + const ValueType* required = GetMember(value, GetRequiredString()); + const ValueType* dependencies = GetMember(value, GetDependenciesString()); + { + // Gather properties from properties/required/dependencies + SValue allProperties(kArrayType); + + if (properties && properties->IsObject()) + for (ConstMemberIterator itr = properties->MemberBegin(); itr != properties->MemberEnd(); ++itr) + AddUniqueElement(allProperties, itr->name); + + if (required && required->IsArray()) + for (ConstValueIterator itr = required->Begin(); itr != required->End(); ++itr) + if (itr->IsString()) + AddUniqueElement(allProperties, *itr); + + if (dependencies && dependencies->IsObject()) + for (ConstMemberIterator itr = dependencies->MemberBegin(); itr != dependencies->MemberEnd(); ++itr) { + AddUniqueElement(allProperties, itr->name); + if (itr->value.IsArray()) + for (ConstValueIterator i = itr->value.Begin(); i != itr->value.End(); ++i) + if (i->IsString()) + AddUniqueElement(allProperties, *i); + } + + if (allProperties.Size() > 0) { + propertyCount_ = allProperties.Size(); + properties_ = static_cast(allocator_->Malloc(sizeof(Property) * propertyCount_)); + for (SizeType i = 0; i < propertyCount_; i++) { + new (&properties_[i]) Property(); + properties_[i].name = allProperties[i]; + properties_[i].schema = typeless_; + } + } + } + + if (properties && properties->IsObject()) { + PointerType q = p.Append(GetPropertiesString(), allocator_); + for (ConstMemberIterator itr = properties->MemberBegin(); itr != properties->MemberEnd(); ++itr) { + SizeType index; + if (FindPropertyIndex(itr->name, &index)) + schemaDocument->CreateSchema(&properties_[index].schema, q.Append(itr->name, allocator_), itr->value, document); + } + } + + if (const ValueType* v = GetMember(value, GetPatternPropertiesString())) { + PointerType q = p.Append(GetPatternPropertiesString(), allocator_); + patternProperties_ = static_cast(allocator_->Malloc(sizeof(PatternProperty) * v->MemberCount())); + patternPropertyCount_ = 0; + + for (ConstMemberIterator itr = v->MemberBegin(); itr != v->MemberEnd(); ++itr) { + new (&patternProperties_[patternPropertyCount_]) PatternProperty(); + patternProperties_[patternPropertyCount_].pattern = CreatePattern(itr->name); + schemaDocument->CreateSchema(&patternProperties_[patternPropertyCount_].schema, q.Append(itr->name, allocator_), itr->value, document); + patternPropertyCount_++; + } + } + + if (required && required->IsArray()) + for (ConstValueIterator itr = required->Begin(); itr != required->End(); ++itr) + if (itr->IsString()) { + SizeType index; + if (FindPropertyIndex(*itr, &index)) { + properties_[index].required = true; + hasRequired_ = true; + } + } + + if (dependencies && dependencies->IsObject()) { + PointerType q = p.Append(GetDependenciesString(), allocator_); + hasDependencies_ = true; + for (ConstMemberIterator itr = dependencies->MemberBegin(); itr != dependencies->MemberEnd(); ++itr) { + SizeType sourceIndex; + if (FindPropertyIndex(itr->name, &sourceIndex)) { + if (itr->value.IsArray()) { + properties_[sourceIndex].dependencies = static_cast(allocator_->Malloc(sizeof(bool) * propertyCount_)); + std::memset(properties_[sourceIndex].dependencies, 0, sizeof(bool)* propertyCount_); + for (ConstValueIterator targetItr = itr->value.Begin(); targetItr != itr->value.End(); ++targetItr) { + SizeType targetIndex; + if (FindPropertyIndex(*targetItr, &targetIndex)) + properties_[sourceIndex].dependencies[targetIndex] = true; + } + } + else if (itr->value.IsObject()) { + hasSchemaDependencies_ = true; + schemaDocument->CreateSchema(&properties_[sourceIndex].dependenciesSchema, q.Append(itr->name, allocator_), itr->value, document); + properties_[sourceIndex].dependenciesValidatorIndex = validatorCount_; + validatorCount_++; + } + } + } + } + + if (const ValueType* v = GetMember(value, GetAdditionalPropertiesString())) { + if (v->IsBool()) + additionalProperties_ = v->GetBool(); + else if (v->IsObject()) + schemaDocument->CreateSchema(&additionalPropertiesSchema_, p.Append(GetAdditionalPropertiesString(), allocator_), *v, document); + } + + AssignIfExist(minProperties_, value, GetMinPropertiesString()); + AssignIfExist(maxProperties_, value, GetMaxPropertiesString()); + + // Array + if (const ValueType* v = GetMember(value, GetItemsString())) { + PointerType q = p.Append(GetItemsString(), allocator_); + if (v->IsObject()) // List validation + schemaDocument->CreateSchema(&itemsList_, q, *v, document); + else if (v->IsArray()) { // Tuple validation + itemsTuple_ = static_cast(allocator_->Malloc(sizeof(const Schema*) * v->Size())); + SizeType index = 0; + for (ConstValueIterator itr = v->Begin(); itr != v->End(); ++itr, index++) + schemaDocument->CreateSchema(&itemsTuple_[itemsTupleCount_++], q.Append(index, allocator_), *itr, document); + } + } + + AssignIfExist(minItems_, value, GetMinItemsString()); + AssignIfExist(maxItems_, value, GetMaxItemsString()); + + if (const ValueType* v = GetMember(value, GetAdditionalItemsString())) { + if (v->IsBool()) + additionalItems_ = v->GetBool(); + else if (v->IsObject()) + schemaDocument->CreateSchema(&additionalItemsSchema_, p.Append(GetAdditionalItemsString(), allocator_), *v, document); + } + + AssignIfExist(uniqueItems_, value, GetUniqueItemsString()); + + // String + AssignIfExist(minLength_, value, GetMinLengthString()); + AssignIfExist(maxLength_, value, GetMaxLengthString()); + + if (const ValueType* v = GetMember(value, GetPatternString())) + pattern_ = CreatePattern(*v); + + // Number + if (const ValueType* v = GetMember(value, GetMinimumString())) + if (v->IsNumber()) + minimum_.CopyFrom(*v, *allocator_); + + if (const ValueType* v = GetMember(value, GetMaximumString())) + if (v->IsNumber()) + maximum_.CopyFrom(*v, *allocator_); + + AssignIfExist(exclusiveMinimum_, value, GetExclusiveMinimumString()); + AssignIfExist(exclusiveMaximum_, value, GetExclusiveMaximumString()); + + if (const ValueType* v = GetMember(value, GetMultipleOfString())) + if (v->IsNumber() && v->GetDouble() > 0.0) + multipleOf_.CopyFrom(*v, *allocator_); + } + + ~Schema() { + AllocatorType::Free(enum_); + if (properties_) { + for (SizeType i = 0; i < propertyCount_; i++) + properties_[i].~Property(); + AllocatorType::Free(properties_); + } + if (patternProperties_) { + for (SizeType i = 0; i < patternPropertyCount_; i++) + patternProperties_[i].~PatternProperty(); + AllocatorType::Free(patternProperties_); + } + AllocatorType::Free(itemsTuple_); +#if RAPIDJSON_SCHEMA_HAS_REGEX + if (pattern_) { + pattern_->~RegexType(); + AllocatorType::Free(pattern_); + } +#endif + } + + bool BeginValue(Context& context) const { + if (context.inArray) { + if (uniqueItems_) + context.valueUniqueness = true; + + if (itemsList_) + context.valueSchema = itemsList_; + else if (itemsTuple_) { + if (context.arrayElementIndex < itemsTupleCount_) + context.valueSchema = itemsTuple_[context.arrayElementIndex]; + else if (additionalItemsSchema_) + context.valueSchema = additionalItemsSchema_; + else if (additionalItems_) + context.valueSchema = typeless_; + else + RAPIDJSON_INVALID_KEYWORD_RETURN(GetItemsString()); + } + else + context.valueSchema = typeless_; + + context.arrayElementIndex++; + } + return true; + } + + RAPIDJSON_FORCEINLINE bool EndValue(Context& context) const { + if (context.patternPropertiesValidatorCount > 0) { + bool otherValid = false; + SizeType count = context.patternPropertiesValidatorCount; + if (context.objectPatternValidatorType != Context::kPatternValidatorOnly) + otherValid = context.patternPropertiesValidators[--count]->IsValid(); + + bool patternValid = true; + for (SizeType i = 0; i < count; i++) + if (!context.patternPropertiesValidators[i]->IsValid()) { + patternValid = false; + break; + } + + if (context.objectPatternValidatorType == Context::kPatternValidatorOnly) { + if (!patternValid) + RAPIDJSON_INVALID_KEYWORD_RETURN(GetPatternPropertiesString()); + } + else if (context.objectPatternValidatorType == Context::kPatternValidatorWithProperty) { + if (!patternValid || !otherValid) + RAPIDJSON_INVALID_KEYWORD_RETURN(GetPatternPropertiesString()); + } + else if (!patternValid && !otherValid) // kPatternValidatorWithAdditionalProperty) + RAPIDJSON_INVALID_KEYWORD_RETURN(GetPatternPropertiesString()); + } + + if (enum_) { + const uint64_t h = context.factory.GetHashCode(context.hasher); + for (SizeType i = 0; i < enumCount_; i++) + if (enum_[i] == h) + goto foundEnum; + RAPIDJSON_INVALID_KEYWORD_RETURN(GetEnumString()); + foundEnum:; + } + + if (allOf_.schemas) + for (SizeType i = allOf_.begin; i < allOf_.begin + allOf_.count; i++) + if (!context.validators[i]->IsValid()) + RAPIDJSON_INVALID_KEYWORD_RETURN(GetAllOfString()); + + if (anyOf_.schemas) { + for (SizeType i = anyOf_.begin; i < anyOf_.begin + anyOf_.count; i++) + if (context.validators[i]->IsValid()) + goto foundAny; + RAPIDJSON_INVALID_KEYWORD_RETURN(GetAnyOfString()); + foundAny:; + } + + if (oneOf_.schemas) { + bool oneValid = false; + for (SizeType i = oneOf_.begin; i < oneOf_.begin + oneOf_.count; i++) + if (context.validators[i]->IsValid()) { + if (oneValid) + RAPIDJSON_INVALID_KEYWORD_RETURN(GetOneOfString()); + else + oneValid = true; + } + if (!oneValid) + RAPIDJSON_INVALID_KEYWORD_RETURN(GetOneOfString()); + } + + if (not_ && context.validators[notValidatorIndex_]->IsValid()) + RAPIDJSON_INVALID_KEYWORD_RETURN(GetNotString()); + + return true; + } + + bool Null(Context& context) const { + if (!(type_ & (1 << kNullSchemaType))) + RAPIDJSON_INVALID_KEYWORD_RETURN(GetTypeString()); + return CreateParallelValidator(context); + } + + bool Bool(Context& context, bool) const { + if (!(type_ & (1 << kBooleanSchemaType))) + RAPIDJSON_INVALID_KEYWORD_RETURN(GetTypeString()); + return CreateParallelValidator(context); + } + + bool Int(Context& context, int i) const { + if (!CheckInt(context, i)) + return false; + return CreateParallelValidator(context); + } + + bool Uint(Context& context, unsigned u) const { + if (!CheckUint(context, u)) + return false; + return CreateParallelValidator(context); + } + + bool Int64(Context& context, int64_t i) const { + if (!CheckInt(context, i)) + return false; + return CreateParallelValidator(context); + } + + bool Uint64(Context& context, uint64_t u) const { + if (!CheckUint(context, u)) + return false; + return CreateParallelValidator(context); + } + + bool Double(Context& context, double d) const { + if (!(type_ & (1 << kNumberSchemaType))) + RAPIDJSON_INVALID_KEYWORD_RETURN(GetTypeString()); + + if (!minimum_.IsNull() && !CheckDoubleMinimum(context, d)) + return false; + + if (!maximum_.IsNull() && !CheckDoubleMaximum(context, d)) + return false; + + if (!multipleOf_.IsNull() && !CheckDoubleMultipleOf(context, d)) + return false; + + return CreateParallelValidator(context); + } + + bool String(Context& context, const Ch* str, SizeType length, bool) const { + if (!(type_ & (1 << kStringSchemaType))) + RAPIDJSON_INVALID_KEYWORD_RETURN(GetTypeString()); + + if (minLength_ != 0 || maxLength_ != SizeType(~0)) { + SizeType count; + if (internal::CountStringCodePoint(str, length, &count)) { + if (count < minLength_) + RAPIDJSON_INVALID_KEYWORD_RETURN(GetMinLengthString()); + if (count > maxLength_) + RAPIDJSON_INVALID_KEYWORD_RETURN(GetMaxLengthString()); + } + } + + if (pattern_ && !IsPatternMatch(pattern_, str, length)) + RAPIDJSON_INVALID_KEYWORD_RETURN(GetPatternString()); + + return CreateParallelValidator(context); + } + + bool StartObject(Context& context) const { + if (!(type_ & (1 << kObjectSchemaType))) + RAPIDJSON_INVALID_KEYWORD_RETURN(GetTypeString()); + + if (hasDependencies_ || hasRequired_) { + context.propertyExist = static_cast(context.factory.MallocState(sizeof(bool) * propertyCount_)); + std::memset(context.propertyExist, 0, sizeof(bool) * propertyCount_); + } + + if (patternProperties_) { // pre-allocate schema array + SizeType count = patternPropertyCount_ + 1; // extra for valuePatternValidatorType + context.patternPropertiesSchemas = static_cast(context.factory.MallocState(sizeof(const SchemaType*) * count)); + context.patternPropertiesSchemaCount = 0; + std::memset(context.patternPropertiesSchemas, 0, sizeof(SchemaType*) * count); + } + + return CreateParallelValidator(context); + } + + bool Key(Context& context, const Ch* str, SizeType len, bool) const { + if (patternProperties_) { + context.patternPropertiesSchemaCount = 0; + for (SizeType i = 0; i < patternPropertyCount_; i++) + if (patternProperties_[i].pattern && IsPatternMatch(patternProperties_[i].pattern, str, len)) + context.patternPropertiesSchemas[context.patternPropertiesSchemaCount++] = patternProperties_[i].schema; + } + + SizeType index; + if (FindPropertyIndex(ValueType(str, len).Move(), &index)) { + if (context.patternPropertiesSchemaCount > 0) { + context.patternPropertiesSchemas[context.patternPropertiesSchemaCount++] = properties_[index].schema; + context.valueSchema = typeless_; + context.valuePatternValidatorType = Context::kPatternValidatorWithProperty; + } + else + context.valueSchema = properties_[index].schema; + + if (context.propertyExist) + context.propertyExist[index] = true; + + return true; + } + + if (additionalPropertiesSchema_) { + if (additionalPropertiesSchema_ && context.patternPropertiesSchemaCount > 0) { + context.patternPropertiesSchemas[context.patternPropertiesSchemaCount++] = additionalPropertiesSchema_; + context.valueSchema = typeless_; + context.valuePatternValidatorType = Context::kPatternValidatorWithAdditionalProperty; + } + else + context.valueSchema = additionalPropertiesSchema_; + return true; + } + else if (additionalProperties_) { + context.valueSchema = typeless_; + return true; + } + + if (context.patternPropertiesSchemaCount == 0) // patternProperties are not additional properties + RAPIDJSON_INVALID_KEYWORD_RETURN(GetAdditionalPropertiesString()); + + return true; + } + + bool EndObject(Context& context, SizeType memberCount) const { + if (hasRequired_) + for (SizeType index = 0; index < propertyCount_; index++) + if (properties_[index].required) + if (!context.propertyExist[index]) + RAPIDJSON_INVALID_KEYWORD_RETURN(GetRequiredString()); + + if (memberCount < minProperties_) + RAPIDJSON_INVALID_KEYWORD_RETURN(GetMinPropertiesString()); + + if (memberCount > maxProperties_) + RAPIDJSON_INVALID_KEYWORD_RETURN(GetMaxPropertiesString()); + + if (hasDependencies_) { + for (SizeType sourceIndex = 0; sourceIndex < propertyCount_; sourceIndex++) + if (context.propertyExist[sourceIndex]) { + if (properties_[sourceIndex].dependencies) { + for (SizeType targetIndex = 0; targetIndex < propertyCount_; targetIndex++) + if (properties_[sourceIndex].dependencies[targetIndex] && !context.propertyExist[targetIndex]) + RAPIDJSON_INVALID_KEYWORD_RETURN(GetDependenciesString()); + } + else if (properties_[sourceIndex].dependenciesSchema) + if (!context.validators[properties_[sourceIndex].dependenciesValidatorIndex]->IsValid()) + RAPIDJSON_INVALID_KEYWORD_RETURN(GetDependenciesString()); + } + } + + return true; + } + + bool StartArray(Context& context) const { + if (!(type_ & (1 << kArraySchemaType))) + RAPIDJSON_INVALID_KEYWORD_RETURN(GetTypeString()); + + context.arrayElementIndex = 0; + context.inArray = true; + + return CreateParallelValidator(context); + } + + bool EndArray(Context& context, SizeType elementCount) const { + context.inArray = false; + + if (elementCount < minItems_) + RAPIDJSON_INVALID_KEYWORD_RETURN(GetMinItemsString()); + + if (elementCount > maxItems_) + RAPIDJSON_INVALID_KEYWORD_RETURN(GetMaxItemsString()); + + return true; + } + + // Generate functions for string literal according to Ch +#define RAPIDJSON_STRING_(name, ...) \ + static const ValueType& Get##name##String() {\ + static const Ch s[] = { __VA_ARGS__, '\0' };\ + static const ValueType v(s, static_cast(sizeof(s) / sizeof(Ch) - 1));\ + return v;\ + } + + RAPIDJSON_STRING_(Null, 'n', 'u', 'l', 'l') + RAPIDJSON_STRING_(Boolean, 'b', 'o', 'o', 'l', 'e', 'a', 'n') + RAPIDJSON_STRING_(Object, 'o', 'b', 'j', 'e', 'c', 't') + RAPIDJSON_STRING_(Array, 'a', 'r', 'r', 'a', 'y') + RAPIDJSON_STRING_(String, 's', 't', 'r', 'i', 'n', 'g') + RAPIDJSON_STRING_(Number, 'n', 'u', 'm', 'b', 'e', 'r') + RAPIDJSON_STRING_(Integer, 'i', 'n', 't', 'e', 'g', 'e', 'r') + RAPIDJSON_STRING_(Type, 't', 'y', 'p', 'e') + RAPIDJSON_STRING_(Enum, 'e', 'n', 'u', 'm') + RAPIDJSON_STRING_(AllOf, 'a', 'l', 'l', 'O', 'f') + RAPIDJSON_STRING_(AnyOf, 'a', 'n', 'y', 'O', 'f') + RAPIDJSON_STRING_(OneOf, 'o', 'n', 'e', 'O', 'f') + RAPIDJSON_STRING_(Not, 'n', 'o', 't') + RAPIDJSON_STRING_(Properties, 'p', 'r', 'o', 'p', 'e', 'r', 't', 'i', 'e', 's') + RAPIDJSON_STRING_(Required, 'r', 'e', 'q', 'u', 'i', 'r', 'e', 'd') + RAPIDJSON_STRING_(Dependencies, 'd', 'e', 'p', 'e', 'n', 'd', 'e', 'n', 'c', 'i', 'e', 's') + RAPIDJSON_STRING_(PatternProperties, 'p', 'a', 't', 't', 'e', 'r', 'n', 'P', 'r', 'o', 'p', 'e', 'r', 't', 'i', 'e', 's') + RAPIDJSON_STRING_(AdditionalProperties, 'a', 'd', 'd', 'i', 't', 'i', 'o', 'n', 'a', 'l', 'P', 'r', 'o', 'p', 'e', 'r', 't', 'i', 'e', 's') + RAPIDJSON_STRING_(MinProperties, 'm', 'i', 'n', 'P', 'r', 'o', 'p', 'e', 'r', 't', 'i', 'e', 's') + RAPIDJSON_STRING_(MaxProperties, 'm', 'a', 'x', 'P', 'r', 'o', 'p', 'e', 'r', 't', 'i', 'e', 's') + RAPIDJSON_STRING_(Items, 'i', 't', 'e', 'm', 's') + RAPIDJSON_STRING_(MinItems, 'm', 'i', 'n', 'I', 't', 'e', 'm', 's') + RAPIDJSON_STRING_(MaxItems, 'm', 'a', 'x', 'I', 't', 'e', 'm', 's') + RAPIDJSON_STRING_(AdditionalItems, 'a', 'd', 'd', 'i', 't', 'i', 'o', 'n', 'a', 'l', 'I', 't', 'e', 'm', 's') + RAPIDJSON_STRING_(UniqueItems, 'u', 'n', 'i', 'q', 'u', 'e', 'I', 't', 'e', 'm', 's') + RAPIDJSON_STRING_(MinLength, 'm', 'i', 'n', 'L', 'e', 'n', 'g', 't', 'h') + RAPIDJSON_STRING_(MaxLength, 'm', 'a', 'x', 'L', 'e', 'n', 'g', 't', 'h') + RAPIDJSON_STRING_(Pattern, 'p', 'a', 't', 't', 'e', 'r', 'n') + RAPIDJSON_STRING_(Minimum, 'm', 'i', 'n', 'i', 'm', 'u', 'm') + RAPIDJSON_STRING_(Maximum, 'm', 'a', 'x', 'i', 'm', 'u', 'm') + RAPIDJSON_STRING_(ExclusiveMinimum, 'e', 'x', 'c', 'l', 'u', 's', 'i', 'v', 'e', 'M', 'i', 'n', 'i', 'm', 'u', 'm') + RAPIDJSON_STRING_(ExclusiveMaximum, 'e', 'x', 'c', 'l', 'u', 's', 'i', 'v', 'e', 'M', 'a', 'x', 'i', 'm', 'u', 'm') + RAPIDJSON_STRING_(MultipleOf, 'm', 'u', 'l', 't', 'i', 'p', 'l', 'e', 'O', 'f') + +#undef RAPIDJSON_STRING_ + +private: + enum SchemaValueType { + kNullSchemaType, + kBooleanSchemaType, + kObjectSchemaType, + kArraySchemaType, + kStringSchemaType, + kNumberSchemaType, + kIntegerSchemaType, + kTotalSchemaType + }; + +#if RAPIDJSON_SCHEMA_USE_INTERNALREGEX + typedef internal::GenericRegex RegexType; +#elif RAPIDJSON_SCHEMA_USE_STDREGEX + typedef std::basic_regex RegexType; +#else + typedef char RegexType; +#endif + + struct SchemaArray { + SchemaArray() : schemas(), count() {} + ~SchemaArray() { AllocatorType::Free(schemas); } + const SchemaType** schemas; + SizeType begin; // begin index of context.validators + SizeType count; + }; + + template + void AddUniqueElement(V1& a, const V2& v) { + for (typename V1::ConstValueIterator itr = a.Begin(); itr != a.End(); ++itr) + if (*itr == v) + return; + V1 c(v, *allocator_); + a.PushBack(c, *allocator_); + } + + static const ValueType* GetMember(const ValueType& value, const ValueType& name) { + typename ValueType::ConstMemberIterator itr = value.FindMember(name); + return itr != value.MemberEnd() ? &(itr->value) : 0; + } + + static void AssignIfExist(bool& out, const ValueType& value, const ValueType& name) { + if (const ValueType* v = GetMember(value, name)) + if (v->IsBool()) + out = v->GetBool(); + } + + static void AssignIfExist(SizeType& out, const ValueType& value, const ValueType& name) { + if (const ValueType* v = GetMember(value, name)) + if (v->IsUint64() && v->GetUint64() <= SizeType(~0)) + out = static_cast(v->GetUint64()); + } + + void AssignIfExist(SchemaArray& out, SchemaDocumentType& schemaDocument, const PointerType& p, const ValueType& value, const ValueType& name, const ValueType& document) { + if (const ValueType* v = GetMember(value, name)) { + if (v->IsArray() && v->Size() > 0) { + PointerType q = p.Append(name, allocator_); + out.count = v->Size(); + out.schemas = static_cast(allocator_->Malloc(out.count * sizeof(const Schema*))); + memset(out.schemas, 0, sizeof(Schema*)* out.count); + for (SizeType i = 0; i < out.count; i++) + schemaDocument.CreateSchema(&out.schemas[i], q.Append(i, allocator_), (*v)[i], document); + out.begin = validatorCount_; + validatorCount_ += out.count; + } + } + } + +#if RAPIDJSON_SCHEMA_USE_INTERNALREGEX + template + RegexType* CreatePattern(const ValueType& value) { + if (value.IsString()) { + RegexType* r = new (allocator_->Malloc(sizeof(RegexType))) RegexType(value.GetString()); + if (!r->IsValid()) { + r->~RegexType(); + AllocatorType::Free(r); + r = 0; + } + return r; + } + return 0; + } + + static bool IsPatternMatch(const RegexType* pattern, const Ch *str, SizeType) { + GenericRegexSearch rs(*pattern); + return rs.Search(str); + } +#elif RAPIDJSON_SCHEMA_USE_STDREGEX + template + RegexType* CreatePattern(const ValueType& value) { + if (value.IsString()) + try { + return new (allocator_->Malloc(sizeof(RegexType))) RegexType(value.GetString(), std::size_t(value.GetStringLength()), std::regex_constants::ECMAScript); + } + catch (const std::regex_error&) { + } + return 0; + } + + static bool IsPatternMatch(const RegexType* pattern, const Ch *str, SizeType length) { + std::match_results r; + return std::regex_search(str, str + length, r, *pattern); + } +#else + template + RegexType* CreatePattern(const ValueType&) { return 0; } + + static bool IsPatternMatch(const RegexType*, const Ch *, SizeType) { return true; } +#endif // RAPIDJSON_SCHEMA_USE_STDREGEX + + void AddType(const ValueType& type) { + if (type == GetNullString() ) type_ |= 1 << kNullSchemaType; + else if (type == GetBooleanString()) type_ |= 1 << kBooleanSchemaType; + else if (type == GetObjectString() ) type_ |= 1 << kObjectSchemaType; + else if (type == GetArrayString() ) type_ |= 1 << kArraySchemaType; + else if (type == GetStringString() ) type_ |= 1 << kStringSchemaType; + else if (type == GetIntegerString()) type_ |= 1 << kIntegerSchemaType; + else if (type == GetNumberString() ) type_ |= (1 << kNumberSchemaType) | (1 << kIntegerSchemaType); + } + + bool CreateParallelValidator(Context& context) const { + if (enum_ || context.arrayUniqueness) + context.hasher = context.factory.CreateHasher(); + + if (validatorCount_) { + RAPIDJSON_ASSERT(context.validators == 0); + context.validators = static_cast(context.factory.MallocState(sizeof(ISchemaValidator*) * validatorCount_)); + context.validatorCount = validatorCount_; + + if (allOf_.schemas) + CreateSchemaValidators(context, allOf_); + + if (anyOf_.schemas) + CreateSchemaValidators(context, anyOf_); + + if (oneOf_.schemas) + CreateSchemaValidators(context, oneOf_); + + if (not_) + context.validators[notValidatorIndex_] = context.factory.CreateSchemaValidator(*not_); + + if (hasSchemaDependencies_) { + for (SizeType i = 0; i < propertyCount_; i++) + if (properties_[i].dependenciesSchema) + context.validators[properties_[i].dependenciesValidatorIndex] = context.factory.CreateSchemaValidator(*properties_[i].dependenciesSchema); + } + } + + return true; + } + + void CreateSchemaValidators(Context& context, const SchemaArray& schemas) const { + for (SizeType i = 0; i < schemas.count; i++) + context.validators[schemas.begin + i] = context.factory.CreateSchemaValidator(*schemas.schemas[i]); + } + + // O(n) + bool FindPropertyIndex(const ValueType& name, SizeType* outIndex) const { + SizeType len = name.GetStringLength(); + const Ch* str = name.GetString(); + for (SizeType index = 0; index < propertyCount_; index++) + if (properties_[index].name.GetStringLength() == len && + (std::memcmp(properties_[index].name.GetString(), str, sizeof(Ch) * len) == 0)) + { + *outIndex = index; + return true; + } + return false; + } + + bool CheckInt(Context& context, int64_t i) const { + if (!(type_ & ((1 << kIntegerSchemaType) | (1 << kNumberSchemaType)))) + RAPIDJSON_INVALID_KEYWORD_RETURN(GetTypeString()); + + if (!minimum_.IsNull()) { + if (minimum_.IsInt64()) { + if (exclusiveMinimum_ ? i <= minimum_.GetInt64() : i < minimum_.GetInt64()) + RAPIDJSON_INVALID_KEYWORD_RETURN(GetMinimumString()); + } + else if (minimum_.IsUint64()) { + RAPIDJSON_INVALID_KEYWORD_RETURN(GetMinimumString()); // i <= max(int64_t) < minimum.GetUint64() + } + else if (!CheckDoubleMinimum(context, static_cast(i))) + return false; + } + + if (!maximum_.IsNull()) { + if (maximum_.IsInt64()) { + if (exclusiveMaximum_ ? i >= maximum_.GetInt64() : i > maximum_.GetInt64()) + RAPIDJSON_INVALID_KEYWORD_RETURN(GetMaximumString()); + } + else if (maximum_.IsUint64()) { } + /* do nothing */ // i <= max(int64_t) < maximum_.GetUint64() + else if (!CheckDoubleMaximum(context, static_cast(i))) + return false; + } + + if (!multipleOf_.IsNull()) { + if (multipleOf_.IsUint64()) { + if (static_cast(i >= 0 ? i : -i) % multipleOf_.GetUint64() != 0) + RAPIDJSON_INVALID_KEYWORD_RETURN(GetMultipleOfString()); + } + else if (!CheckDoubleMultipleOf(context, static_cast(i))) + return false; + } + + return true; + } + + bool CheckUint(Context& context, uint64_t i) const { + if (!(type_ & ((1 << kIntegerSchemaType) | (1 << kNumberSchemaType)))) + RAPIDJSON_INVALID_KEYWORD_RETURN(GetTypeString()); + + if (!minimum_.IsNull()) { + if (minimum_.IsUint64()) { + if (exclusiveMinimum_ ? i <= minimum_.GetUint64() : i < minimum_.GetUint64()) + RAPIDJSON_INVALID_KEYWORD_RETURN(GetMinimumString()); + } + else if (minimum_.IsInt64()) + /* do nothing */; // i >= 0 > minimum.Getint64() + else if (!CheckDoubleMinimum(context, static_cast(i))) + return false; + } + + if (!maximum_.IsNull()) { + if (maximum_.IsUint64()) { + if (exclusiveMaximum_ ? i >= maximum_.GetUint64() : i > maximum_.GetUint64()) + RAPIDJSON_INVALID_KEYWORD_RETURN(GetMaximumString()); + } + else if (maximum_.IsInt64()) + RAPIDJSON_INVALID_KEYWORD_RETURN(GetMaximumString()); // i >= 0 > maximum_ + else if (!CheckDoubleMaximum(context, static_cast(i))) + return false; + } + + if (!multipleOf_.IsNull()) { + if (multipleOf_.IsUint64()) { + if (i % multipleOf_.GetUint64() != 0) + RAPIDJSON_INVALID_KEYWORD_RETURN(GetMultipleOfString()); + } + else if (!CheckDoubleMultipleOf(context, static_cast(i))) + return false; + } + + return true; + } + + bool CheckDoubleMinimum(Context& context, double d) const { + if (exclusiveMinimum_ ? d <= minimum_.GetDouble() : d < minimum_.GetDouble()) + RAPIDJSON_INVALID_KEYWORD_RETURN(GetMinimumString()); + return true; + } + + bool CheckDoubleMaximum(Context& context, double d) const { + if (exclusiveMaximum_ ? d >= maximum_.GetDouble() : d > maximum_.GetDouble()) + RAPIDJSON_INVALID_KEYWORD_RETURN(GetMaximumString()); + return true; + } + + bool CheckDoubleMultipleOf(Context& context, double d) const { + double a = std::abs(d), b = std::abs(multipleOf_.GetDouble()); + double q = std::floor(a / b); + double r = a - q * b; + if (r > 0.0) + RAPIDJSON_INVALID_KEYWORD_RETURN(GetMultipleOfString()); + return true; + } + + struct Property { + Property() : schema(), dependenciesSchema(), dependenciesValidatorIndex(), dependencies(), required(false) {} + ~Property() { AllocatorType::Free(dependencies); } + SValue name; + const SchemaType* schema; + const SchemaType* dependenciesSchema; + SizeType dependenciesValidatorIndex; + bool* dependencies; + bool required; + }; + + struct PatternProperty { + PatternProperty() : schema(), pattern() {} + ~PatternProperty() { + if (pattern) { + pattern->~RegexType(); + AllocatorType::Free(pattern); + } + } + const SchemaType* schema; + RegexType* pattern; + }; + + AllocatorType* allocator_; + const SchemaType* typeless_; + uint64_t* enum_; + SizeType enumCount_; + SchemaArray allOf_; + SchemaArray anyOf_; + SchemaArray oneOf_; + const SchemaType* not_; + unsigned type_; // bitmask of kSchemaType + SizeType validatorCount_; + SizeType notValidatorIndex_; + + Property* properties_; + const SchemaType* additionalPropertiesSchema_; + PatternProperty* patternProperties_; + SizeType patternPropertyCount_; + SizeType propertyCount_; + SizeType minProperties_; + SizeType maxProperties_; + bool additionalProperties_; + bool hasDependencies_; + bool hasRequired_; + bool hasSchemaDependencies_; + + const SchemaType* additionalItemsSchema_; + const SchemaType* itemsList_; + const SchemaType** itemsTuple_; + SizeType itemsTupleCount_; + SizeType minItems_; + SizeType maxItems_; + bool additionalItems_; + bool uniqueItems_; + + RegexType* pattern_; + SizeType minLength_; + SizeType maxLength_; + + SValue minimum_; + SValue maximum_; + SValue multipleOf_; + bool exclusiveMinimum_; + bool exclusiveMaximum_; +}; + +template +struct TokenHelper { + RAPIDJSON_FORCEINLINE static void AppendIndexToken(Stack& documentStack, SizeType index) { + *documentStack.template Push() = '/'; + char buffer[21]; + size_t length = static_cast((sizeof(SizeType) == 4 ? u32toa(index, buffer) : u64toa(index, buffer)) - buffer); + for (size_t i = 0; i < length; i++) + *documentStack.template Push() = static_cast(buffer[i]); + } +}; + +// Partial specialized version for char to prevent buffer copying. +template +struct TokenHelper { + RAPIDJSON_FORCEINLINE static void AppendIndexToken(Stack& documentStack, SizeType index) { + if (sizeof(SizeType) == 4) { + char *buffer = documentStack.template Push(1 + 10); // '/' + uint + *buffer++ = '/'; + const char* end = internal::u32toa(index, buffer); + documentStack.template Pop(static_cast(10 - (end - buffer))); + } + else { + char *buffer = documentStack.template Push(1 + 20); // '/' + uint64 + *buffer++ = '/'; + const char* end = internal::u64toa(index, buffer); + documentStack.template Pop(static_cast(20 - (end - buffer))); + } + } +}; + +} // namespace internal + +/////////////////////////////////////////////////////////////////////////////// +// IGenericRemoteSchemaDocumentProvider + +template +class IGenericRemoteSchemaDocumentProvider { +public: + typedef typename SchemaDocumentType::Ch Ch; + + virtual ~IGenericRemoteSchemaDocumentProvider() {} + virtual const SchemaDocumentType* GetRemoteDocument(const Ch* uri, SizeType length) = 0; +}; + +/////////////////////////////////////////////////////////////////////////////// +// GenericSchemaDocument + +//! JSON schema document. +/*! + A JSON schema document is a compiled version of a JSON schema. + It is basically a tree of internal::Schema. + + \note This is an immutable class (i.e. its instance cannot be modified after construction). + \tparam ValueT Type of JSON value (e.g. \c Value ), which also determine the encoding. + \tparam Allocator Allocator type for allocating memory of this document. +*/ +template +class GenericSchemaDocument { +public: + typedef ValueT ValueType; + typedef IGenericRemoteSchemaDocumentProvider IRemoteSchemaDocumentProviderType; + typedef Allocator AllocatorType; + typedef typename ValueType::EncodingType EncodingType; + typedef typename EncodingType::Ch Ch; + typedef internal::Schema SchemaType; + typedef GenericPointer PointerType; + friend class internal::Schema; + template + friend class GenericSchemaValidator; + + //! Constructor. + /*! + Compile a JSON document into schema document. + + \param document A JSON document as source. + \param remoteProvider An optional remote schema document provider for resolving remote reference. Can be null. + \param allocator An optional allocator instance for allocating memory. Can be null. + */ + explicit GenericSchemaDocument(const ValueType& document, IRemoteSchemaDocumentProviderType* remoteProvider = 0, Allocator* allocator = 0) : + remoteProvider_(remoteProvider), + allocator_(allocator), + ownAllocator_(), + root_(), + typeless_(), + schemaMap_(allocator, kInitialSchemaMapSize), + schemaRef_(allocator, kInitialSchemaRefSize) + { + if (!allocator_) + ownAllocator_ = allocator_ = RAPIDJSON_NEW(Allocator)(); + + typeless_ = static_cast(allocator_->Malloc(sizeof(SchemaType))); + new (typeless_) SchemaType(this, PointerType(), ValueType(kObjectType).Move(), ValueType(kObjectType).Move(), 0); + + // Generate root schema, it will call CreateSchema() to create sub-schemas, + // And call AddRefSchema() if there are $ref. + CreateSchemaRecursive(&root_, PointerType(), document, document); + + // Resolve $ref + while (!schemaRef_.Empty()) { + SchemaRefEntry* refEntry = schemaRef_.template Pop(1); + if (const SchemaType* s = GetSchema(refEntry->target)) { + if (refEntry->schema) + *refEntry->schema = s; + + // Create entry in map if not exist + if (!GetSchema(refEntry->source)) { + new (schemaMap_.template Push()) SchemaEntry(refEntry->source, const_cast(s), false, allocator_); + } + } + else if (refEntry->schema) + *refEntry->schema = typeless_; + + refEntry->~SchemaRefEntry(); + } + + RAPIDJSON_ASSERT(root_ != 0); + + schemaRef_.ShrinkToFit(); // Deallocate all memory for ref + } + +#if RAPIDJSON_HAS_CXX11_RVALUE_REFS + //! Move constructor in C++11 + GenericSchemaDocument(GenericSchemaDocument&& rhs) RAPIDJSON_NOEXCEPT : + remoteProvider_(rhs.remoteProvider_), + allocator_(rhs.allocator_), + ownAllocator_(rhs.ownAllocator_), + root_(rhs.root_), + typeless_(rhs.typeless_), + schemaMap_(std::move(rhs.schemaMap_)), + schemaRef_(std::move(rhs.schemaRef_)) + { + rhs.remoteProvider_ = 0; + rhs.allocator_ = 0; + rhs.ownAllocator_ = 0; + rhs.typeless_ = 0; + } +#endif + + //! Destructor + ~GenericSchemaDocument() { + while (!schemaMap_.Empty()) + schemaMap_.template Pop(1)->~SchemaEntry(); + + if (typeless_) { + typeless_->~SchemaType(); + Allocator::Free(typeless_); + } + + RAPIDJSON_DELETE(ownAllocator_); + } + + //! Get the root schema. + const SchemaType& GetRoot() const { return *root_; } + +private: + //! Prohibit copying + GenericSchemaDocument(const GenericSchemaDocument&); + //! Prohibit assignment + GenericSchemaDocument& operator=(const GenericSchemaDocument&); + + struct SchemaRefEntry { + SchemaRefEntry(const PointerType& s, const PointerType& t, const SchemaType** outSchema, Allocator *allocator) : source(s, allocator), target(t, allocator), schema(outSchema) {} + PointerType source; + PointerType target; + const SchemaType** schema; + }; + + struct SchemaEntry { + SchemaEntry(const PointerType& p, SchemaType* s, bool o, Allocator* allocator) : pointer(p, allocator), schema(s), owned(o) {} + ~SchemaEntry() { + if (owned) { + schema->~SchemaType(); + Allocator::Free(schema); + } + } + PointerType pointer; + SchemaType* schema; + bool owned; + }; + + void CreateSchemaRecursive(const SchemaType** schema, const PointerType& pointer, const ValueType& v, const ValueType& document) { + if (schema) + *schema = typeless_; + + if (v.GetType() == kObjectType) { + const SchemaType* s = GetSchema(pointer); + if (!s) + CreateSchema(schema, pointer, v, document); + + for (typename ValueType::ConstMemberIterator itr = v.MemberBegin(); itr != v.MemberEnd(); ++itr) + CreateSchemaRecursive(0, pointer.Append(itr->name, allocator_), itr->value, document); + } + else if (v.GetType() == kArrayType) + for (SizeType i = 0; i < v.Size(); i++) + CreateSchemaRecursive(0, pointer.Append(i, allocator_), v[i], document); + } + + void CreateSchema(const SchemaType** schema, const PointerType& pointer, const ValueType& v, const ValueType& document) { + RAPIDJSON_ASSERT(pointer.IsValid()); + if (v.IsObject()) { + if (!HandleRefSchema(pointer, schema, v, document)) { + SchemaType* s = new (allocator_->Malloc(sizeof(SchemaType))) SchemaType(this, pointer, v, document, allocator_); + new (schemaMap_.template Push()) SchemaEntry(pointer, s, true, allocator_); + if (schema) + *schema = s; + } + } + } + + bool HandleRefSchema(const PointerType& source, const SchemaType** schema, const ValueType& v, const ValueType& document) { + static const Ch kRefString[] = { '$', 'r', 'e', 'f', '\0' }; + static const ValueType kRefValue(kRefString, 4); + + typename ValueType::ConstMemberIterator itr = v.FindMember(kRefValue); + if (itr == v.MemberEnd()) + return false; + + if (itr->value.IsString()) { + SizeType len = itr->value.GetStringLength(); + if (len > 0) { + const Ch* s = itr->value.GetString(); + SizeType i = 0; + while (i < len && s[i] != '#') // Find the first # + i++; + + if (i > 0) { // Remote reference, resolve immediately + if (remoteProvider_) { + if (const GenericSchemaDocument* remoteDocument = remoteProvider_->GetRemoteDocument(s, i)) { + PointerType pointer(&s[i], len - i, allocator_); + if (pointer.IsValid()) { + if (const SchemaType* sc = remoteDocument->GetSchema(pointer)) { + if (schema) + *schema = sc; + return true; + } + } + } + } + } + else if (s[i] == '#') { // Local reference, defer resolution + PointerType pointer(&s[i], len - i, allocator_); + if (pointer.IsValid()) { + if (const ValueType* nv = pointer.Get(document)) + if (HandleRefSchema(source, schema, *nv, document)) + return true; + + new (schemaRef_.template Push()) SchemaRefEntry(source, pointer, schema, allocator_); + return true; + } + } + } + } + return false; + } + + const SchemaType* GetSchema(const PointerType& pointer) const { + for (const SchemaEntry* target = schemaMap_.template Bottom(); target != schemaMap_.template End(); ++target) + if (pointer == target->pointer) + return target->schema; + return 0; + } + + PointerType GetPointer(const SchemaType* schema) const { + for (const SchemaEntry* target = schemaMap_.template Bottom(); target != schemaMap_.template End(); ++target) + if (schema == target->schema) + return target->pointer; + return PointerType(); + } + + const SchemaType* GetTypeless() const { return typeless_; } + + static const size_t kInitialSchemaMapSize = 64; + static const size_t kInitialSchemaRefSize = 64; + + IRemoteSchemaDocumentProviderType* remoteProvider_; + Allocator *allocator_; + Allocator *ownAllocator_; + const SchemaType* root_; //!< Root schema. + SchemaType* typeless_; + internal::Stack schemaMap_; // Stores created Pointer -> Schemas + internal::Stack schemaRef_; // Stores Pointer from $ref and schema which holds the $ref +}; + +//! GenericSchemaDocument using Value type. +typedef GenericSchemaDocument SchemaDocument; +//! IGenericRemoteSchemaDocumentProvider using SchemaDocument. +typedef IGenericRemoteSchemaDocumentProvider IRemoteSchemaDocumentProvider; + +/////////////////////////////////////////////////////////////////////////////// +// GenericSchemaValidator + +//! JSON Schema Validator. +/*! + A SAX style JSON schema validator. + It uses a \c GenericSchemaDocument to validate SAX events. + It delegates the incoming SAX events to an output handler. + The default output handler does nothing. + It can be reused multiple times by calling \c Reset(). + + \tparam SchemaDocumentType Type of schema document. + \tparam OutputHandler Type of output handler. Default handler does nothing. + \tparam StateAllocator Allocator for storing the internal validation states. +*/ +template < + typename SchemaDocumentType, + typename OutputHandler = BaseReaderHandler, + typename StateAllocator = CrtAllocator> +class GenericSchemaValidator : + public internal::ISchemaStateFactory, + public internal::ISchemaValidator +{ +public: + typedef typename SchemaDocumentType::SchemaType SchemaType; + typedef typename SchemaDocumentType::PointerType PointerType; + typedef typename SchemaType::EncodingType EncodingType; + typedef typename EncodingType::Ch Ch; + + //! Constructor without output handler. + /*! + \param schemaDocument The schema document to conform to. + \param allocator Optional allocator for storing internal validation states. + \param schemaStackCapacity Optional initial capacity of schema path stack. + \param documentStackCapacity Optional initial capacity of document path stack. + */ + GenericSchemaValidator( + const SchemaDocumentType& schemaDocument, + StateAllocator* allocator = 0, + size_t schemaStackCapacity = kDefaultSchemaStackCapacity, + size_t documentStackCapacity = kDefaultDocumentStackCapacity) + : + schemaDocument_(&schemaDocument), + root_(schemaDocument.GetRoot()), + stateAllocator_(allocator), + ownStateAllocator_(0), + schemaStack_(allocator, schemaStackCapacity), + documentStack_(allocator, documentStackCapacity), + outputHandler_(CreateNullHandler()), + valid_(true) +#if RAPIDJSON_SCHEMA_VERBOSE + , depth_(0) +#endif + { + } + + //! Constructor with output handler. + /*! + \param schemaDocument The schema document to conform to. + \param allocator Optional allocator for storing internal validation states. + \param schemaStackCapacity Optional initial capacity of schema path stack. + \param documentStackCapacity Optional initial capacity of document path stack. + */ + GenericSchemaValidator( + const SchemaDocumentType& schemaDocument, + OutputHandler& outputHandler, + StateAllocator* allocator = 0, + size_t schemaStackCapacity = kDefaultSchemaStackCapacity, + size_t documentStackCapacity = kDefaultDocumentStackCapacity) + : + schemaDocument_(&schemaDocument), + root_(schemaDocument.GetRoot()), + stateAllocator_(allocator), + ownStateAllocator_(0), + schemaStack_(allocator, schemaStackCapacity), + documentStack_(allocator, documentStackCapacity), + outputHandler_(outputHandler), + nullHandler_(0), + valid_(true) +#if RAPIDJSON_SCHEMA_VERBOSE + , depth_(0) +#endif + { + } + + //! Destructor. + ~GenericSchemaValidator() { + Reset(); + if (nullHandler_) { + nullHandler_->~OutputHandler(); + StateAllocator::Free(nullHandler_); + } + RAPIDJSON_DELETE(ownStateAllocator_); + } + + //! Reset the internal states. + void Reset() { + while (!schemaStack_.Empty()) + PopSchema(); + documentStack_.Clear(); + valid_ = true; + } + + //! Checks whether the current state is valid. + // Implementation of ISchemaValidator + virtual bool IsValid() const { return valid_; } + + //! Gets the JSON pointer pointed to the invalid schema. + PointerType GetInvalidSchemaPointer() const { + return schemaStack_.Empty() ? PointerType() : schemaDocument_->GetPointer(&CurrentSchema()); + } + + //! Gets the keyword of invalid schema. + const Ch* GetInvalidSchemaKeyword() const { + return schemaStack_.Empty() ? 0 : CurrentContext().invalidKeyword; + } + + //! Gets the JSON pointer pointed to the invalid value. + PointerType GetInvalidDocumentPointer() const { + return documentStack_.Empty() ? PointerType() : PointerType(documentStack_.template Bottom(), documentStack_.GetSize() / sizeof(Ch)); + } + +#if RAPIDJSON_SCHEMA_VERBOSE +#define RAPIDJSON_SCHEMA_HANDLE_BEGIN_VERBOSE_() \ +RAPIDJSON_MULTILINEMACRO_BEGIN\ + *documentStack_.template Push() = '\0';\ + documentStack_.template Pop(1);\ + internal::PrintInvalidDocument(documentStack_.template Bottom());\ +RAPIDJSON_MULTILINEMACRO_END +#else +#define RAPIDJSON_SCHEMA_HANDLE_BEGIN_VERBOSE_() +#endif + +#define RAPIDJSON_SCHEMA_HANDLE_BEGIN_(method, arg1)\ + if (!valid_) return false; \ + if (!BeginValue() || !CurrentSchema().method arg1) {\ + RAPIDJSON_SCHEMA_HANDLE_BEGIN_VERBOSE_();\ + return valid_ = false;\ + } + +#define RAPIDJSON_SCHEMA_HANDLE_PARALLEL_(method, arg2)\ + for (Context* context = schemaStack_.template Bottom(); context != schemaStack_.template End(); context++) {\ + if (context->hasher)\ + static_cast(context->hasher)->method arg2;\ + if (context->validators)\ + for (SizeType i_ = 0; i_ < context->validatorCount; i_++)\ + static_cast(context->validators[i_])->method arg2;\ + if (context->patternPropertiesValidators)\ + for (SizeType i_ = 0; i_ < context->patternPropertiesValidatorCount; i_++)\ + static_cast(context->patternPropertiesValidators[i_])->method arg2;\ + } + +#define RAPIDJSON_SCHEMA_HANDLE_END_(method, arg2)\ + return valid_ = EndValue() && outputHandler_.method arg2 + +#define RAPIDJSON_SCHEMA_HANDLE_VALUE_(method, arg1, arg2) \ + RAPIDJSON_SCHEMA_HANDLE_BEGIN_ (method, arg1);\ + RAPIDJSON_SCHEMA_HANDLE_PARALLEL_(method, arg2);\ + RAPIDJSON_SCHEMA_HANDLE_END_ (method, arg2) + + bool Null() { RAPIDJSON_SCHEMA_HANDLE_VALUE_(Null, (CurrentContext() ), ( )); } + bool Bool(bool b) { RAPIDJSON_SCHEMA_HANDLE_VALUE_(Bool, (CurrentContext(), b), (b)); } + bool Int(int i) { RAPIDJSON_SCHEMA_HANDLE_VALUE_(Int, (CurrentContext(), i), (i)); } + bool Uint(unsigned u) { RAPIDJSON_SCHEMA_HANDLE_VALUE_(Uint, (CurrentContext(), u), (u)); } + bool Int64(int64_t i) { RAPIDJSON_SCHEMA_HANDLE_VALUE_(Int64, (CurrentContext(), i), (i)); } + bool Uint64(uint64_t u) { RAPIDJSON_SCHEMA_HANDLE_VALUE_(Uint64, (CurrentContext(), u), (u)); } + bool Double(double d) { RAPIDJSON_SCHEMA_HANDLE_VALUE_(Double, (CurrentContext(), d), (d)); } + bool RawNumber(const Ch* str, SizeType length, bool copy) + { RAPIDJSON_SCHEMA_HANDLE_VALUE_(String, (CurrentContext(), str, length, copy), (str, length, copy)); } + bool String(const Ch* str, SizeType length, bool copy) + { RAPIDJSON_SCHEMA_HANDLE_VALUE_(String, (CurrentContext(), str, length, copy), (str, length, copy)); } + + bool StartObject() { + RAPIDJSON_SCHEMA_HANDLE_BEGIN_(StartObject, (CurrentContext())); + RAPIDJSON_SCHEMA_HANDLE_PARALLEL_(StartObject, ()); + return valid_ = outputHandler_.StartObject(); + } + + bool Key(const Ch* str, SizeType len, bool copy) { + if (!valid_) return false; + AppendToken(str, len); + if (!CurrentSchema().Key(CurrentContext(), str, len, copy)) return valid_ = false; + RAPIDJSON_SCHEMA_HANDLE_PARALLEL_(Key, (str, len, copy)); + return valid_ = outputHandler_.Key(str, len, copy); + } + + bool EndObject(SizeType memberCount) { + if (!valid_) return false; + RAPIDJSON_SCHEMA_HANDLE_PARALLEL_(EndObject, (memberCount)); + if (!CurrentSchema().EndObject(CurrentContext(), memberCount)) return valid_ = false; + RAPIDJSON_SCHEMA_HANDLE_END_(EndObject, (memberCount)); + } + + bool StartArray() { + RAPIDJSON_SCHEMA_HANDLE_BEGIN_(StartArray, (CurrentContext())); + RAPIDJSON_SCHEMA_HANDLE_PARALLEL_(StartArray, ()); + return valid_ = outputHandler_.StartArray(); + } + + bool EndArray(SizeType elementCount) { + if (!valid_) return false; + RAPIDJSON_SCHEMA_HANDLE_PARALLEL_(EndArray, (elementCount)); + if (!CurrentSchema().EndArray(CurrentContext(), elementCount)) return valid_ = false; + RAPIDJSON_SCHEMA_HANDLE_END_(EndArray, (elementCount)); + } + +#undef RAPIDJSON_SCHEMA_HANDLE_BEGIN_VERBOSE_ +#undef RAPIDJSON_SCHEMA_HANDLE_BEGIN_ +#undef RAPIDJSON_SCHEMA_HANDLE_PARALLEL_ +#undef RAPIDJSON_SCHEMA_HANDLE_VALUE_ + + // Implementation of ISchemaStateFactory + virtual ISchemaValidator* CreateSchemaValidator(const SchemaType& root) { + return new (GetStateAllocator().Malloc(sizeof(GenericSchemaValidator))) GenericSchemaValidator(*schemaDocument_, root, +#if RAPIDJSON_SCHEMA_VERBOSE + depth_ + 1, +#endif + &GetStateAllocator()); + } + + virtual void DestroySchemaValidator(ISchemaValidator* validator) { + GenericSchemaValidator* v = static_cast(validator); + v->~GenericSchemaValidator(); + StateAllocator::Free(v); + } + + virtual void* CreateHasher() { + return new (GetStateAllocator().Malloc(sizeof(HasherType))) HasherType(&GetStateAllocator()); + } + + virtual uint64_t GetHashCode(void* hasher) { + return static_cast(hasher)->GetHashCode(); + } + + virtual void DestroryHasher(void* hasher) { + HasherType* h = static_cast(hasher); + h->~HasherType(); + StateAllocator::Free(h); + } + + virtual void* MallocState(size_t size) { + return GetStateAllocator().Malloc(size); + } + + virtual void FreeState(void* p) { + StateAllocator::Free(p); + } + +private: + typedef typename SchemaType::Context Context; + typedef GenericValue, StateAllocator> HashCodeArray; + typedef internal::Hasher HasherType; + + GenericSchemaValidator( + const SchemaDocumentType& schemaDocument, + const SchemaType& root, +#if RAPIDJSON_SCHEMA_VERBOSE + unsigned depth, +#endif + StateAllocator* allocator = 0, + size_t schemaStackCapacity = kDefaultSchemaStackCapacity, + size_t documentStackCapacity = kDefaultDocumentStackCapacity) + : + schemaDocument_(&schemaDocument), + root_(root), + stateAllocator_(allocator), + ownStateAllocator_(0), + schemaStack_(allocator, schemaStackCapacity), + documentStack_(allocator, documentStackCapacity), + outputHandler_(CreateNullHandler()), + valid_(true) +#if RAPIDJSON_SCHEMA_VERBOSE + , depth_(depth) +#endif + { + } + + StateAllocator& GetStateAllocator() { + if (!stateAllocator_) + stateAllocator_ = ownStateAllocator_ = RAPIDJSON_NEW(StateAllocator)(); + return *stateAllocator_; + } + + bool BeginValue() { + if (schemaStack_.Empty()) + PushSchema(root_); + else { + if (CurrentContext().inArray) + internal::TokenHelper, Ch>::AppendIndexToken(documentStack_, CurrentContext().arrayElementIndex); + + if (!CurrentSchema().BeginValue(CurrentContext())) + return false; + + SizeType count = CurrentContext().patternPropertiesSchemaCount; + const SchemaType** sa = CurrentContext().patternPropertiesSchemas; + typename Context::PatternValidatorType patternValidatorType = CurrentContext().valuePatternValidatorType; + bool valueUniqueness = CurrentContext().valueUniqueness; + RAPIDJSON_ASSERT(CurrentContext().valueSchema); + PushSchema(*CurrentContext().valueSchema); + + if (count > 0) { + CurrentContext().objectPatternValidatorType = patternValidatorType; + ISchemaValidator**& va = CurrentContext().patternPropertiesValidators; + SizeType& validatorCount = CurrentContext().patternPropertiesValidatorCount; + va = static_cast(MallocState(sizeof(ISchemaValidator*) * count)); + for (SizeType i = 0; i < count; i++) + va[validatorCount++] = CreateSchemaValidator(*sa[i]); + } + + CurrentContext().arrayUniqueness = valueUniqueness; + } + return true; + } + + bool EndValue() { + if (!CurrentSchema().EndValue(CurrentContext())) + return false; + +#if RAPIDJSON_SCHEMA_VERBOSE + GenericStringBuffer sb; + schemaDocument_->GetPointer(&CurrentSchema()).Stringify(sb); + + *documentStack_.template Push() = '\0'; + documentStack_.template Pop(1); + internal::PrintValidatorPointers(depth_, sb.GetString(), documentStack_.template Bottom()); +#endif + + uint64_t h = CurrentContext().arrayUniqueness ? static_cast(CurrentContext().hasher)->GetHashCode() : 0; + + PopSchema(); + + if (!schemaStack_.Empty()) { + Context& context = CurrentContext(); + if (context.valueUniqueness) { + HashCodeArray* a = static_cast(context.arrayElementHashCodes); + if (!a) + CurrentContext().arrayElementHashCodes = a = new (GetStateAllocator().Malloc(sizeof(HashCodeArray))) HashCodeArray(kArrayType); + for (typename HashCodeArray::ConstValueIterator itr = a->Begin(); itr != a->End(); ++itr) + if (itr->GetUint64() == h) + RAPIDJSON_INVALID_KEYWORD_RETURN(SchemaType::GetUniqueItemsString()); + a->PushBack(h, GetStateAllocator()); + } + } + + // Remove the last token of document pointer + while (!documentStack_.Empty() && *documentStack_.template Pop(1) != '/') + ; + + return true; + } + + void AppendToken(const Ch* str, SizeType len) { + documentStack_.template Reserve(1 + len * 2); // worst case all characters are escaped as two characters + *documentStack_.template PushUnsafe() = '/'; + for (SizeType i = 0; i < len; i++) { + if (str[i] == '~') { + *documentStack_.template PushUnsafe() = '~'; + *documentStack_.template PushUnsafe() = '0'; + } + else if (str[i] == '/') { + *documentStack_.template PushUnsafe() = '~'; + *documentStack_.template PushUnsafe() = '1'; + } + else + *documentStack_.template PushUnsafe() = str[i]; + } + } + + RAPIDJSON_FORCEINLINE void PushSchema(const SchemaType& schema) { new (schemaStack_.template Push()) Context(*this, &schema); } + + RAPIDJSON_FORCEINLINE void PopSchema() { + Context* c = schemaStack_.template Pop(1); + if (HashCodeArray* a = static_cast(c->arrayElementHashCodes)) { + a->~HashCodeArray(); + StateAllocator::Free(a); + } + c->~Context(); + } + + const SchemaType& CurrentSchema() const { return *schemaStack_.template Top()->schema; } + Context& CurrentContext() { return *schemaStack_.template Top(); } + const Context& CurrentContext() const { return *schemaStack_.template Top(); } + + OutputHandler& CreateNullHandler() { + return *(nullHandler_ = new (GetStateAllocator().Malloc(sizeof(OutputHandler))) OutputHandler); + } + + static const size_t kDefaultSchemaStackCapacity = 1024; + static const size_t kDefaultDocumentStackCapacity = 256; + const SchemaDocumentType* schemaDocument_; + const SchemaType& root_; + StateAllocator* stateAllocator_; + StateAllocator* ownStateAllocator_; + internal::Stack schemaStack_; //!< stack to store the current path of schema (BaseSchemaType *) + internal::Stack documentStack_; //!< stack to store the current path of validating document (Ch) + OutputHandler& outputHandler_; + OutputHandler* nullHandler_; + bool valid_; +#if RAPIDJSON_SCHEMA_VERBOSE + unsigned depth_; +#endif +}; + +typedef GenericSchemaValidator SchemaValidator; + +/////////////////////////////////////////////////////////////////////////////// +// SchemaValidatingReader + +//! A helper class for parsing with validation. +/*! + This helper class is a functor, designed as a parameter of \ref GenericDocument::Populate(). + + \tparam parseFlags Combination of \ref ParseFlag. + \tparam InputStream Type of input stream, implementing Stream concept. + \tparam SourceEncoding Encoding of the input stream. + \tparam SchemaDocumentType Type of schema document. + \tparam StackAllocator Allocator type for stack. +*/ +template < + unsigned parseFlags, + typename InputStream, + typename SourceEncoding, + typename SchemaDocumentType = SchemaDocument, + typename StackAllocator = CrtAllocator> +class SchemaValidatingReader { +public: + typedef typename SchemaDocumentType::PointerType PointerType; + typedef typename InputStream::Ch Ch; + + //! Constructor + /*! + \param is Input stream. + \param sd Schema document. + */ + SchemaValidatingReader(InputStream& is, const SchemaDocumentType& sd) : is_(is), sd_(sd), invalidSchemaKeyword_(), isValid_(true) {} + + template + bool operator()(Handler& handler) { + GenericReader reader; + GenericSchemaValidator validator(sd_, handler); + parseResult_ = reader.template Parse(is_, validator); + + isValid_ = validator.IsValid(); + if (isValid_) { + invalidSchemaPointer_ = PointerType(); + invalidSchemaKeyword_ = 0; + invalidDocumentPointer_ = PointerType(); + } + else { + invalidSchemaPointer_ = validator.GetInvalidSchemaPointer(); + invalidSchemaKeyword_ = validator.GetInvalidSchemaKeyword(); + invalidDocumentPointer_ = validator.GetInvalidDocumentPointer(); + } + + return parseResult_; + } + + const ParseResult& GetParseResult() const { return parseResult_; } + bool IsValid() const { return isValid_; } + const PointerType& GetInvalidSchemaPointer() const { return invalidSchemaPointer_; } + const Ch* GetInvalidSchemaKeyword() const { return invalidSchemaKeyword_; } + const PointerType& GetInvalidDocumentPointer() const { return invalidDocumentPointer_; } + +private: + InputStream& is_; + const SchemaDocumentType& sd_; + + ParseResult parseResult_; + PointerType invalidSchemaPointer_; + const Ch* invalidSchemaKeyword_; + PointerType invalidDocumentPointer_; + bool isValid_; +}; + +RAPIDJSON_NAMESPACE_END +RAPIDJSON_DIAG_POP + +#endif // RAPIDJSON_SCHEMA_H_ diff --git a/umd/external/include/rapidjson/stream.h b/umd/external/include/rapidjson/stream.h new file mode 100644 index 00000000..fef82c25 --- /dev/null +++ b/umd/external/include/rapidjson/stream.h @@ -0,0 +1,179 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#include "rapidjson.h" + +#ifndef RAPIDJSON_STREAM_H_ +#define RAPIDJSON_STREAM_H_ + +#include "encodings.h" + +RAPIDJSON_NAMESPACE_BEGIN + +/////////////////////////////////////////////////////////////////////////////// +// Stream + +/*! \class rapidjson::Stream + \brief Concept for reading and writing characters. + + For read-only stream, no need to implement PutBegin(), Put(), Flush() and PutEnd(). + + For write-only stream, only need to implement Put() and Flush(). + +\code +concept Stream { + typename Ch; //!< Character type of the stream. + + //! Read the current character from stream without moving the read cursor. + Ch Peek() const; + + //! Read the current character from stream and moving the read cursor to next character. + Ch Take(); + + //! Get the current read cursor. + //! \return Number of characters read from start. + size_t Tell(); + + //! Begin writing operation at the current read pointer. + //! \return The begin writer pointer. + Ch* PutBegin(); + + //! Write a character. + void Put(Ch c); + + //! Flush the buffer. + void Flush(); + + //! End the writing operation. + //! \param begin The begin write pointer returned by PutBegin(). + //! \return Number of characters written. + size_t PutEnd(Ch* begin); +} +\endcode +*/ + +//! Provides additional information for stream. +/*! + By using traits pattern, this type provides a default configuration for stream. + For custom stream, this type can be specialized for other configuration. + See TEST(Reader, CustomStringStream) in readertest.cpp for example. +*/ +template +struct StreamTraits { + //! Whether to make local copy of stream for optimization during parsing. + /*! + By default, for safety, streams do not use local copy optimization. + Stream that can be copied fast should specialize this, like StreamTraits. + */ + enum { copyOptimization = 0 }; +}; + +//! Reserve n characters for writing to a stream. +template +inline void PutReserve(Stream& stream, size_t count) { + (void)stream; + (void)count; +} + +//! Write character to a stream, presuming buffer is reserved. +template +inline void PutUnsafe(Stream& stream, typename Stream::Ch c) { + stream.Put(c); +} + +//! Put N copies of a character to a stream. +template +inline void PutN(Stream& stream, Ch c, size_t n) { + PutReserve(stream, n); + for (size_t i = 0; i < n; i++) + PutUnsafe(stream, c); +} + +/////////////////////////////////////////////////////////////////////////////// +// StringStream + +//! Read-only string stream. +/*! \note implements Stream concept +*/ +template +struct GenericStringStream { + typedef typename Encoding::Ch Ch; + + GenericStringStream(const Ch *src) : src_(src), head_(src) {} + + Ch Peek() const { return *src_; } + Ch Take() { return *src_++; } + size_t Tell() const { return static_cast(src_ - head_); } + + Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; } + void Put(Ch) { RAPIDJSON_ASSERT(false); } + void Flush() { RAPIDJSON_ASSERT(false); } + size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; } + + const Ch* src_; //!< Current read position. + const Ch* head_; //!< Original head of the string. +}; + +template +struct StreamTraits > { + enum { copyOptimization = 1 }; +}; + +//! String stream with UTF8 encoding. +typedef GenericStringStream > StringStream; + +/////////////////////////////////////////////////////////////////////////////// +// InsituStringStream + +//! A read-write string stream. +/*! This string stream is particularly designed for in-situ parsing. + \note implements Stream concept +*/ +template +struct GenericInsituStringStream { + typedef typename Encoding::Ch Ch; + + GenericInsituStringStream(Ch *src) : src_(src), dst_(0), head_(src) {} + + // Read + Ch Peek() { return *src_; } + Ch Take() { return *src_++; } + size_t Tell() { return static_cast(src_ - head_); } + + // Write + void Put(Ch c) { RAPIDJSON_ASSERT(dst_ != 0); *dst_++ = c; } + + Ch* PutBegin() { return dst_ = src_; } + size_t PutEnd(Ch* begin) { return static_cast(dst_ - begin); } + void Flush() {} + + Ch* Push(size_t count) { Ch* begin = dst_; dst_ += count; return begin; } + void Pop(size_t count) { dst_ -= count; } + + Ch* src_; + Ch* dst_; + Ch* head_; +}; + +template +struct StreamTraits > { + enum { copyOptimization = 1 }; +}; + +//! Insitu string stream with UTF8 encoding. +typedef GenericInsituStringStream > InsituStringStream; + +RAPIDJSON_NAMESPACE_END + +#endif // RAPIDJSON_STREAM_H_ diff --git a/umd/external/include/rapidjson/stringbuffer.h b/umd/external/include/rapidjson/stringbuffer.h new file mode 100644 index 00000000..4e38b82c --- /dev/null +++ b/umd/external/include/rapidjson/stringbuffer.h @@ -0,0 +1,121 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef RAPIDJSON_STRINGBUFFER_H_ +#define RAPIDJSON_STRINGBUFFER_H_ + +#include "stream.h" +#include "internal/stack.h" + +#if RAPIDJSON_HAS_CXX11_RVALUE_REFS +#include // std::move +#endif + +#include "internal/stack.h" + +#if defined(__clang__) +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(c++98-compat) +#endif + +RAPIDJSON_NAMESPACE_BEGIN + +//! Represents an in-memory output stream. +/*! + \tparam Encoding Encoding of the stream. + \tparam Allocator type for allocating memory buffer. + \note implements Stream concept +*/ +template +class GenericStringBuffer { +public: + typedef typename Encoding::Ch Ch; + + GenericStringBuffer(Allocator* allocator = 0, size_t capacity = kDefaultCapacity) : stack_(allocator, capacity) {} + +#if RAPIDJSON_HAS_CXX11_RVALUE_REFS + GenericStringBuffer(GenericStringBuffer&& rhs) : stack_(std::move(rhs.stack_)) {} + GenericStringBuffer& operator=(GenericStringBuffer&& rhs) { + if (&rhs != this) + stack_ = std::move(rhs.stack_); + return *this; + } +#endif + + void Put(Ch c) { *stack_.template Push() = c; } + void PutUnsafe(Ch c) { *stack_.template PushUnsafe() = c; } + void Flush() {} + + void Clear() { stack_.Clear(); } + void ShrinkToFit() { + // Push and pop a null terminator. This is safe. + *stack_.template Push() = '\0'; + stack_.ShrinkToFit(); + stack_.template Pop(1); + } + + void Reserve(size_t count) { stack_.template Reserve(count); } + Ch* Push(size_t count) { return stack_.template Push(count); } + Ch* PushUnsafe(size_t count) { return stack_.template PushUnsafe(count); } + void Pop(size_t count) { stack_.template Pop(count); } + + const Ch* GetString() const { + // Push and pop a null terminator. This is safe. + *stack_.template Push() = '\0'; + stack_.template Pop(1); + + return stack_.template Bottom(); + } + + //! Get the size of string in bytes in the string buffer. + size_t GetSize() const { return stack_.GetSize(); } + + //! Get the length of string in Ch in the string buffer. + size_t GetLength() const { return stack_.GetSize() / sizeof(Ch); } + + static const size_t kDefaultCapacity = 256; + mutable internal::Stack stack_; + +private: + // Prohibit copy constructor & assignment operator. + GenericStringBuffer(const GenericStringBuffer&); + GenericStringBuffer& operator=(const GenericStringBuffer&); +}; + +//! String buffer with UTF8 encoding +typedef GenericStringBuffer > StringBuffer; + +template +inline void PutReserve(GenericStringBuffer& stream, size_t count) { + stream.Reserve(count); +} + +template +inline void PutUnsafe(GenericStringBuffer& stream, typename Encoding::Ch c) { + stream.PutUnsafe(c); +} + +//! Implement specialized version of PutN() with memset() for better performance. +template<> +inline void PutN(GenericStringBuffer >& stream, char c, size_t n) { + std::memset(stream.stack_.Push(n), c, n * sizeof(c)); +} + +RAPIDJSON_NAMESPACE_END + +#if defined(__clang__) +RAPIDJSON_DIAG_POP +#endif + +#endif // RAPIDJSON_STRINGBUFFER_H_ diff --git a/umd/external/include/rapidjson/writer.h b/umd/external/include/rapidjson/writer.h new file mode 100644 index 00000000..e610ebb6 --- /dev/null +++ b/umd/external/include/rapidjson/writer.h @@ -0,0 +1,711 @@ +// Tencent is pleased to support the open source community by making RapidJSON available. +// +// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. +// +// Licensed under the MIT License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// http://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef RAPIDJSON_WRITER_H_ +#define RAPIDJSON_WRITER_H_ + +#include "stream.h" +#include "internal/meta.h" +#include "internal/stack.h" +#include "internal/strfunc.h" +#include "internal/dtoa.h" +#include "internal/itoa.h" +#include "stringbuffer.h" +#include // placement new + +#if defined(RAPIDJSON_SIMD) && defined(_MSC_VER) +#include +#pragma intrinsic(_BitScanForward) +#endif +#ifdef RAPIDJSON_SSE42 +#include +#elif defined(RAPIDJSON_SSE2) +#include +#elif defined(RAPIDJSON_NEON) +#include +#endif + +#ifdef _MSC_VER +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(4127) // conditional expression is constant +#endif + +#ifdef __clang__ +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(padded) +RAPIDJSON_DIAG_OFF(unreachable-code) +RAPIDJSON_DIAG_OFF(c++98-compat) +#endif + +RAPIDJSON_NAMESPACE_BEGIN + +/////////////////////////////////////////////////////////////////////////////// +// WriteFlag + +/*! \def RAPIDJSON_WRITE_DEFAULT_FLAGS + \ingroup RAPIDJSON_CONFIG + \brief User-defined kWriteDefaultFlags definition. + + User can define this as any \c WriteFlag combinations. +*/ +#ifndef RAPIDJSON_WRITE_DEFAULT_FLAGS +#define RAPIDJSON_WRITE_DEFAULT_FLAGS kWriteNoFlags +#endif + +//! Combination of writeFlags +enum WriteFlag { + kWriteNoFlags = 0, //!< No flags are set. + kWriteValidateEncodingFlag = 1, //!< Validate encoding of JSON strings. + kWriteNanAndInfFlag = 2, //!< Allow writing of Infinity, -Infinity and NaN. + kWriteDefaultFlags = RAPIDJSON_WRITE_DEFAULT_FLAGS //!< Default write flags. Can be customized by defining RAPIDJSON_WRITE_DEFAULT_FLAGS +}; + +//! JSON writer +/*! Writer implements the concept Handler. + It generates JSON text by events to an output os. + + User may programmatically calls the functions of a writer to generate JSON text. + + On the other side, a writer can also be passed to objects that generates events, + + for example Reader::Parse() and Document::Accept(). + + \tparam OutputStream Type of output stream. + \tparam SourceEncoding Encoding of source string. + \tparam TargetEncoding Encoding of output stream. + \tparam StackAllocator Type of allocator for allocating memory of stack. + \note implements Handler concept +*/ +template, typename TargetEncoding = UTF8<>, typename StackAllocator = CrtAllocator, unsigned writeFlags = kWriteDefaultFlags> +class Writer { +public: + typedef typename SourceEncoding::Ch Ch; + + static const int kDefaultMaxDecimalPlaces = 324; + + //! Constructor + /*! \param os Output stream. + \param stackAllocator User supplied allocator. If it is null, it will create a private one. + \param levelDepth Initial capacity of stack. + */ + explicit + Writer(OutputStream& os, StackAllocator* stackAllocator = 0, size_t levelDepth = kDefaultLevelDepth) : + os_(&os), level_stack_(stackAllocator, levelDepth * sizeof(Level)), maxDecimalPlaces_(kDefaultMaxDecimalPlaces), hasRoot_(false) {} + + explicit + Writer(StackAllocator* allocator = 0, size_t levelDepth = kDefaultLevelDepth) : + os_(0), level_stack_(allocator, levelDepth * sizeof(Level)), maxDecimalPlaces_(kDefaultMaxDecimalPlaces), hasRoot_(false) {} + +#if RAPIDJSON_HAS_CXX11_RVALUE_REFS + Writer(Writer&& rhs) : + os_(rhs.os_), level_stack_(std::move(rhs.level_stack_)), maxDecimalPlaces_(rhs.maxDecimalPlaces_), hasRoot_(rhs.hasRoot_) { + rhs.os_ = 0; + } +#endif + + //! Reset the writer with a new stream. + /*! + This function reset the writer with a new stream and default settings, + in order to make a Writer object reusable for output multiple JSONs. + + \param os New output stream. + \code + Writer writer(os1); + writer.StartObject(); + // ... + writer.EndObject(); + + writer.Reset(os2); + writer.StartObject(); + // ... + writer.EndObject(); + \endcode + */ + void Reset(OutputStream& os) { + os_ = &os; + hasRoot_ = false; + level_stack_.Clear(); + } + + //! Checks whether the output is a complete JSON. + /*! + A complete JSON has a complete root object or array. + */ + bool IsComplete() const { + return hasRoot_ && level_stack_.Empty(); + } + + int GetMaxDecimalPlaces() const { + return maxDecimalPlaces_; + } + + //! Sets the maximum number of decimal places for double output. + /*! + This setting truncates the output with specified number of decimal places. + + For example, + + \code + writer.SetMaxDecimalPlaces(3); + writer.StartArray(); + writer.Double(0.12345); // "0.123" + writer.Double(0.0001); // "0.0" + writer.Double(1.234567890123456e30); // "1.234567890123456e30" (do not truncate significand for positive exponent) + writer.Double(1.23e-4); // "0.0" (do truncate significand for negative exponent) + writer.EndArray(); + \endcode + + The default setting does not truncate any decimal places. You can restore to this setting by calling + \code + writer.SetMaxDecimalPlaces(Writer::kDefaultMaxDecimalPlaces); + \endcode + */ + void SetMaxDecimalPlaces(int maxDecimalPlaces) { + maxDecimalPlaces_ = maxDecimalPlaces; + } + + /*!@name Implementation of Handler + \see Handler + */ + //@{ + + bool Null() { Prefix(kNullType); return EndValue(WriteNull()); } + bool Bool(bool b) { Prefix(b ? kTrueType : kFalseType); return EndValue(WriteBool(b)); } + bool Int(int i) { Prefix(kNumberType); return EndValue(WriteInt(i)); } + bool Uint(unsigned u) { Prefix(kNumberType); return EndValue(WriteUint(u)); } + bool Int64(int64_t i64) { Prefix(kNumberType); return EndValue(WriteInt64(i64)); } + bool Uint64(uint64_t u64) { Prefix(kNumberType); return EndValue(WriteUint64(u64)); } + + //! Writes the given \c double value to the stream + /*! + \param d The value to be written. + \return Whether it is succeed. + */ + bool Double(double d) { Prefix(kNumberType); return EndValue(WriteDouble(d)); } + + bool RawNumber(const Ch* str, SizeType length, bool copy = false) { + RAPIDJSON_ASSERT(str != 0); + (void)copy; + Prefix(kNumberType); + return EndValue(WriteString(str, length)); + } + + bool String(const Ch* str, SizeType length, bool copy = false) { + RAPIDJSON_ASSERT(str != 0); + (void)copy; + Prefix(kStringType); + return EndValue(WriteString(str, length)); + } + +#if RAPIDJSON_HAS_STDSTRING + bool String(const std::basic_string& str) { + return String(str.data(), SizeType(str.size())); + } +#endif + + bool StartObject() { + Prefix(kObjectType); + new (level_stack_.template Push()) Level(false); + return WriteStartObject(); + } + + bool Key(const Ch* str, SizeType length, bool copy = false) { return String(str, length, copy); } + +#if RAPIDJSON_HAS_STDSTRING + bool Key(const std::basic_string& str) + { + return Key(str.data(), SizeType(str.size())); + } +#endif + + bool EndObject(SizeType memberCount = 0) { + (void)memberCount; + RAPIDJSON_ASSERT(level_stack_.GetSize() >= sizeof(Level)); // not inside an Object + RAPIDJSON_ASSERT(!level_stack_.template Top()->inArray); // currently inside an Array, not Object + RAPIDJSON_ASSERT(0 == level_stack_.template Top()->valueCount % 2); // Object has a Key without a Value + level_stack_.template Pop(1); + return EndValue(WriteEndObject()); + } + + bool StartArray() { + Prefix(kArrayType); + new (level_stack_.template Push()) Level(true); + return WriteStartArray(); + } + + bool EndArray(SizeType elementCount = 0) { + (void)elementCount; + RAPIDJSON_ASSERT(level_stack_.GetSize() >= sizeof(Level)); + RAPIDJSON_ASSERT(level_stack_.template Top()->inArray); + level_stack_.template Pop(1); + return EndValue(WriteEndArray()); + } + //@} + + /*! @name Convenience extensions */ + //@{ + + //! Simpler but slower overload. + bool String(const Ch* const& str) { return String(str, internal::StrLen(str)); } + bool Key(const Ch* const& str) { return Key(str, internal::StrLen(str)); } + + //@} + + //! Write a raw JSON value. + /*! + For user to write a stringified JSON as a value. + + \param json A well-formed JSON value. It should not contain null character within [0, length - 1] range. + \param length Length of the json. + \param type Type of the root of json. + */ + bool RawValue(const Ch* json, size_t length, Type type) { + RAPIDJSON_ASSERT(json != 0); + Prefix(type); + return EndValue(WriteRawValue(json, length)); + } + + //! Flush the output stream. + /*! + Allows the user to flush the output stream immediately. + */ + void Flush() { + os_->Flush(); + } + +protected: + //! Information for each nested level + struct Level { + Level(bool inArray_) : valueCount(0), inArray(inArray_) {} + size_t valueCount; //!< number of values in this level + bool inArray; //!< true if in array, otherwise in object + }; + + static const size_t kDefaultLevelDepth = 32; + + bool WriteNull() { + PutReserve(*os_, 4); + PutUnsafe(*os_, 'n'); PutUnsafe(*os_, 'u'); PutUnsafe(*os_, 'l'); PutUnsafe(*os_, 'l'); return true; + } + + bool WriteBool(bool b) { + if (b) { + PutReserve(*os_, 4); + PutUnsafe(*os_, 't'); PutUnsafe(*os_, 'r'); PutUnsafe(*os_, 'u'); PutUnsafe(*os_, 'e'); + } + else { + PutReserve(*os_, 5); + PutUnsafe(*os_, 'f'); PutUnsafe(*os_, 'a'); PutUnsafe(*os_, 'l'); PutUnsafe(*os_, 's'); PutUnsafe(*os_, 'e'); + } + return true; + } + + bool WriteInt(int i) { + char buffer[11]; + const char* end = internal::i32toa(i, buffer); + PutReserve(*os_, static_cast(end - buffer)); + for (const char* p = buffer; p != end; ++p) + PutUnsafe(*os_, static_cast(*p)); + return true; + } + + bool WriteUint(unsigned u) { + char buffer[10]; + const char* end = internal::u32toa(u, buffer); + PutReserve(*os_, static_cast(end - buffer)); + for (const char* p = buffer; p != end; ++p) + PutUnsafe(*os_, static_cast(*p)); + return true; + } + + bool WriteInt64(int64_t i64) { + char buffer[21]; + const char* end = internal::i64toa(i64, buffer); + PutReserve(*os_, static_cast(end - buffer)); + for (const char* p = buffer; p != end; ++p) + PutUnsafe(*os_, static_cast(*p)); + return true; + } + + bool WriteUint64(uint64_t u64) { + char buffer[20]; + char* end = internal::u64toa(u64, buffer); + PutReserve(*os_, static_cast(end - buffer)); + for (char* p = buffer; p != end; ++p) + PutUnsafe(*os_, static_cast(*p)); + return true; + } + + bool WriteDouble(double d) { + if (internal::Double(d).IsNanOrInf()) { + if (!(writeFlags & kWriteNanAndInfFlag)) + return false; + if (internal::Double(d).IsNan()) { + PutReserve(*os_, 3); + PutUnsafe(*os_, 'N'); PutUnsafe(*os_, 'a'); PutUnsafe(*os_, 'N'); + return true; + } + if (internal::Double(d).Sign()) { + PutReserve(*os_, 9); + PutUnsafe(*os_, '-'); + } + else + PutReserve(*os_, 8); + PutUnsafe(*os_, 'I'); PutUnsafe(*os_, 'n'); PutUnsafe(*os_, 'f'); + PutUnsafe(*os_, 'i'); PutUnsafe(*os_, 'n'); PutUnsafe(*os_, 'i'); PutUnsafe(*os_, 't'); PutUnsafe(*os_, 'y'); + return true; + } + + char buffer[25]; + char* end = internal::dtoa(d, buffer, maxDecimalPlaces_); + PutReserve(*os_, static_cast(end - buffer)); + for (char* p = buffer; p != end; ++p) + PutUnsafe(*os_, static_cast(*p)); + return true; + } + + bool WriteString(const Ch* str, SizeType length) { + static const typename OutputStream::Ch hexDigits[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; + static const char escape[256] = { +#define Z16 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + //0 1 2 3 4 5 6 7 8 9 A B C D E F + 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'b', 't', 'n', 'u', 'f', 'r', 'u', 'u', // 00 + 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', // 10 + 0, 0, '"', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 20 + Z16, Z16, // 30~4F + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,'\\', 0, 0, 0, // 50 + Z16, Z16, Z16, Z16, Z16, Z16, Z16, Z16, Z16, Z16 // 60~FF +#undef Z16 + }; + + if (TargetEncoding::supportUnicode) + PutReserve(*os_, 2 + length * 6); // "\uxxxx..." + else + PutReserve(*os_, 2 + length * 12); // "\uxxxx\uyyyy..." + + PutUnsafe(*os_, '\"'); + GenericStringStream is(str); + while (ScanWriteUnescapedString(is, length)) { + const Ch c = is.Peek(); + if (!TargetEncoding::supportUnicode && static_cast(c) >= 0x80) { + // Unicode escaping + unsigned codepoint; + if (RAPIDJSON_UNLIKELY(!SourceEncoding::Decode(is, &codepoint))) + return false; + PutUnsafe(*os_, '\\'); + PutUnsafe(*os_, 'u'); + if (codepoint <= 0xD7FF || (codepoint >= 0xE000 && codepoint <= 0xFFFF)) { + PutUnsafe(*os_, hexDigits[(codepoint >> 12) & 15]); + PutUnsafe(*os_, hexDigits[(codepoint >> 8) & 15]); + PutUnsafe(*os_, hexDigits[(codepoint >> 4) & 15]); + PutUnsafe(*os_, hexDigits[(codepoint ) & 15]); + } + else { + RAPIDJSON_ASSERT(codepoint >= 0x010000 && codepoint <= 0x10FFFF); + // Surrogate pair + unsigned s = codepoint - 0x010000; + unsigned lead = (s >> 10) + 0xD800; + unsigned trail = (s & 0x3FF) + 0xDC00; + PutUnsafe(*os_, hexDigits[(lead >> 12) & 15]); + PutUnsafe(*os_, hexDigits[(lead >> 8) & 15]); + PutUnsafe(*os_, hexDigits[(lead >> 4) & 15]); + PutUnsafe(*os_, hexDigits[(lead ) & 15]); + PutUnsafe(*os_, '\\'); + PutUnsafe(*os_, 'u'); + PutUnsafe(*os_, hexDigits[(trail >> 12) & 15]); + PutUnsafe(*os_, hexDigits[(trail >> 8) & 15]); + PutUnsafe(*os_, hexDigits[(trail >> 4) & 15]); + PutUnsafe(*os_, hexDigits[(trail ) & 15]); + } + } + else if ((sizeof(Ch) == 1 || static_cast(c) < 256) && RAPIDJSON_UNLIKELY(escape[static_cast(c)])) { + is.Take(); + PutUnsafe(*os_, '\\'); + PutUnsafe(*os_, static_cast(escape[static_cast(c)])); + if (escape[static_cast(c)] == 'u') { + PutUnsafe(*os_, '0'); + PutUnsafe(*os_, '0'); + PutUnsafe(*os_, hexDigits[static_cast(c) >> 4]); + PutUnsafe(*os_, hexDigits[static_cast(c) & 0xF]); + } + } + else if (RAPIDJSON_UNLIKELY(!(writeFlags & kWriteValidateEncodingFlag ? + Transcoder::Validate(is, *os_) : + Transcoder::TranscodeUnsafe(is, *os_)))) + return false; + } + PutUnsafe(*os_, '\"'); + return true; + } + + bool ScanWriteUnescapedString(GenericStringStream& is, size_t length) { + return RAPIDJSON_LIKELY(is.Tell() < length); + } + + bool WriteStartObject() { os_->Put('{'); return true; } + bool WriteEndObject() { os_->Put('}'); return true; } + bool WriteStartArray() { os_->Put('['); return true; } + bool WriteEndArray() { os_->Put(']'); return true; } + + bool WriteRawValue(const Ch* json, size_t length) { + PutReserve(*os_, length); + for (size_t i = 0; i < length; i++) { + RAPIDJSON_ASSERT(json[i] != '\0'); + PutUnsafe(*os_, json[i]); + } + return true; + } + + void Prefix(Type type) { + (void)type; + if (RAPIDJSON_LIKELY(level_stack_.GetSize() != 0)) { // this value is not at root + Level* level = level_stack_.template Top(); + if (level->valueCount > 0) { + if (level->inArray) + os_->Put(','); // add comma if it is not the first element in array + else // in object + os_->Put((level->valueCount % 2 == 0) ? ',' : ':'); + } + if (!level->inArray && level->valueCount % 2 == 0) + RAPIDJSON_ASSERT(type == kStringType); // if it's in object, then even number should be a name + level->valueCount++; + } + else { + RAPIDJSON_ASSERT(!hasRoot_); // Should only has one and only one root. + hasRoot_ = true; + } + } + + // Flush the value if it is the top level one. + bool EndValue(bool ret) { + if (RAPIDJSON_UNLIKELY(level_stack_.Empty())) // end of json text + Flush(); + return ret; + } + + OutputStream* os_; + internal::Stack level_stack_; + int maxDecimalPlaces_; + bool hasRoot_; + +private: + // Prohibit copy constructor & assignment operator. + Writer(const Writer&); + Writer& operator=(const Writer&); +}; + +// Full specialization for StringStream to prevent memory copying + +template<> +inline bool Writer::WriteInt(int i) { + char *buffer = os_->Push(11); + const char* end = internal::i32toa(i, buffer); + os_->Pop(static_cast(11 - (end - buffer))); + return true; +} + +template<> +inline bool Writer::WriteUint(unsigned u) { + char *buffer = os_->Push(10); + const char* end = internal::u32toa(u, buffer); + os_->Pop(static_cast(10 - (end - buffer))); + return true; +} + +template<> +inline bool Writer::WriteInt64(int64_t i64) { + char *buffer = os_->Push(21); + const char* end = internal::i64toa(i64, buffer); + os_->Pop(static_cast(21 - (end - buffer))); + return true; +} + +template<> +inline bool Writer::WriteUint64(uint64_t u) { + char *buffer = os_->Push(20); + const char* end = internal::u64toa(u, buffer); + os_->Pop(static_cast(20 - (end - buffer))); + return true; +} + +template<> +inline bool Writer::WriteDouble(double d) { + if (internal::Double(d).IsNanOrInf()) { + // Note: This code path can only be reached if (RAPIDJSON_WRITE_DEFAULT_FLAGS & kWriteNanAndInfFlag). + if (!(kWriteDefaultFlags & kWriteNanAndInfFlag)) + return false; + if (internal::Double(d).IsNan()) { + PutReserve(*os_, 3); + PutUnsafe(*os_, 'N'); PutUnsafe(*os_, 'a'); PutUnsafe(*os_, 'N'); + return true; + } + if (internal::Double(d).Sign()) { + PutReserve(*os_, 9); + PutUnsafe(*os_, '-'); + } + else + PutReserve(*os_, 8); + PutUnsafe(*os_, 'I'); PutUnsafe(*os_, 'n'); PutUnsafe(*os_, 'f'); + PutUnsafe(*os_, 'i'); PutUnsafe(*os_, 'n'); PutUnsafe(*os_, 'i'); PutUnsafe(*os_, 't'); PutUnsafe(*os_, 'y'); + return true; + } + + char *buffer = os_->Push(25); + char* end = internal::dtoa(d, buffer, maxDecimalPlaces_); + os_->Pop(static_cast(25 - (end - buffer))); + return true; +} + +#if defined(RAPIDJSON_SSE2) || defined(RAPIDJSON_SSE42) +template<> +inline bool Writer::ScanWriteUnescapedString(StringStream& is, size_t length) { + if (length < 16) + return RAPIDJSON_LIKELY(is.Tell() < length); + + if (!RAPIDJSON_LIKELY(is.Tell() < length)) + return false; + + const char* p = is.src_; + const char* end = is.head_ + length; + const char* nextAligned = reinterpret_cast((reinterpret_cast(p) + 15) & static_cast(~15)); + const char* endAligned = reinterpret_cast(reinterpret_cast(end) & static_cast(~15)); + if (nextAligned > end) + return true; + + while (p != nextAligned) + if (*p < 0x20 || *p == '\"' || *p == '\\') { + is.src_ = p; + return RAPIDJSON_LIKELY(is.Tell() < length); + } + else + os_->PutUnsafe(*p++); + + // The rest of string using SIMD + static const char dquote[16] = { '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"' }; + static const char bslash[16] = { '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\' }; + static const char space[16] = { 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F }; + const __m128i dq = _mm_loadu_si128(reinterpret_cast(&dquote[0])); + const __m128i bs = _mm_loadu_si128(reinterpret_cast(&bslash[0])); + const __m128i sp = _mm_loadu_si128(reinterpret_cast(&space[0])); + + for (; p != endAligned; p += 16) { + const __m128i s = _mm_load_si128(reinterpret_cast(p)); + const __m128i t1 = _mm_cmpeq_epi8(s, dq); + const __m128i t2 = _mm_cmpeq_epi8(s, bs); + const __m128i t3 = _mm_cmpeq_epi8(_mm_max_epu8(s, sp), sp); // s < 0x20 <=> max(s, 0x1F) == 0x1F + const __m128i x = _mm_or_si128(_mm_or_si128(t1, t2), t3); + unsigned short r = static_cast(_mm_movemask_epi8(x)); + if (RAPIDJSON_UNLIKELY(r != 0)) { // some of characters is escaped + SizeType len; +#ifdef _MSC_VER // Find the index of first escaped + unsigned long offset; + _BitScanForward(&offset, r); + len = offset; +#else + len = static_cast(__builtin_ffs(r) - 1); +#endif + char* q = reinterpret_cast(os_->PushUnsafe(len)); + for (size_t i = 0; i < len; i++) + q[i] = p[i]; + + p += len; + break; + } + _mm_storeu_si128(reinterpret_cast<__m128i *>(os_->PushUnsafe(16)), s); + } + + is.src_ = p; + return RAPIDJSON_LIKELY(is.Tell() < length); +} +#elif defined(RAPIDJSON_NEON) +template<> +inline bool Writer::ScanWriteUnescapedString(StringStream& is, size_t length) { + if (length < 16) + return RAPIDJSON_LIKELY(is.Tell() < length); + + if (!RAPIDJSON_LIKELY(is.Tell() < length)) + return false; + + const char* p = is.src_; + const char* end = is.head_ + length; + const char* nextAligned = reinterpret_cast((reinterpret_cast(p) + 15) & static_cast(~15)); + const char* endAligned = reinterpret_cast(reinterpret_cast(end) & static_cast(~15)); + if (nextAligned > end) + return true; + + while (p != nextAligned) + if (*p < 0x20 || *p == '\"' || *p == '\\') { + is.src_ = p; + return RAPIDJSON_LIKELY(is.Tell() < length); + } + else + os_->PutUnsafe(*p++); + + // The rest of string using SIMD + const uint8x16_t s0 = vmovq_n_u8('"'); + const uint8x16_t s1 = vmovq_n_u8('\\'); + const uint8x16_t s2 = vmovq_n_u8('\b'); + const uint8x16_t s3 = vmovq_n_u8(32); + + for (; p != endAligned; p += 16) { + const uint8x16_t s = vld1q_u8(reinterpret_cast(p)); + uint8x16_t x = vceqq_u8(s, s0); + x = vorrq_u8(x, vceqq_u8(s, s1)); + x = vorrq_u8(x, vceqq_u8(s, s2)); + x = vorrq_u8(x, vcltq_u8(s, s3)); + + x = vrev64q_u8(x); // Rev in 64 + uint64_t low = vgetq_lane_u64(reinterpret_cast(x), 0); // extract + uint64_t high = vgetq_lane_u64(reinterpret_cast(x), 1); // extract + + SizeType len = 0; + bool escaped = false; + if (low == 0) { + if (high != 0) { + unsigned lz = (unsigned)__builtin_clzll(high); + len = 8 + (lz >> 3); + escaped = true; + } + } else { + unsigned lz = (unsigned)__builtin_clzll(low); + len = lz >> 3; + escaped = true; + } + if (RAPIDJSON_UNLIKELY(escaped)) { // some of characters is escaped + char* q = reinterpret_cast(os_->PushUnsafe(len)); + for (size_t i = 0; i < len; i++) + q[i] = p[i]; + + p += len; + break; + } + vst1q_u8(reinterpret_cast(os_->PushUnsafe(16)), s); + } + + is.src_ = p; + return RAPIDJSON_LIKELY(is.Tell() < length); +} +#endif // RAPIDJSON_NEON + +RAPIDJSON_NAMESPACE_END + +#ifdef _MSC_VER +RAPIDJSON_DIAG_POP +#endif + +#ifdef __clang__ +RAPIDJSON_DIAG_POP +#endif + +#endif // RAPIDJSON_RAPIDJSON_H_ diff --git a/umd/make/module.mk b/umd/make/module.mk index 9502035d..9f7598b2 100644 --- a/umd/make/module.mk +++ b/umd/make/module.mk @@ -27,12 +27,12 @@ MODULE_SRCDIR := $(MODULE) # build with default toolchain/arch, unless module has overridden it -ifeq ($(MODULE_CC),) -MODULE_CC := $(TOOLCHAIN_PREFIX)gcc -endif -ifeq ($(MODULE_LD),) -MODULE_LD := $(TOOLCHAIN_PREFIX)ld -endif +#ifeq ($(MODULE_CC),) +#MODULE_CC := $(TOOLCHAIN_PREFIX)gcc +#endif +#ifeq ($(MODULE_LD),) +#MODULE_LD := $(TOOLCHAIN_PREFIX)ld +#endif $(info MODULE_CC $(MODULE_CC)) diff --git a/umd/utils/BitBinaryTree.c b/umd/utils/BitBinaryTree.c new file mode 100644 index 00000000..03851d90 --- /dev/null +++ b/umd/utils/BitBinaryTree.c @@ -0,0 +1,214 @@ +/* + * Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +// Common includes +#include +//#include +#include "dlaerror.h" +#include "dlatypes.h" + + +// File includes +#include // malloc +#include // memset + +#include "nvdla_os_inf.h" +#include "BitBinaryTree.h" +#include "ErrorMacros.h" + +static inline NvU32 pow2i(const NvU32 x) +{ + return (1 << x); +} + +static inline NvU32 roundUp(NvU32 numToRound, NvU32 multiple) +{ + if (multiple == 0) + { + return 0; + } + + NvU32 result = numToRound; + NvU32 remainder = numToRound % multiple; + if (remainder != 0) + { + result += multiple - remainder; + } + + return result; +} + +static NvDlaError construct(NvDlaBitBinaryTreeInst* self, NvU8 numLevels) +{ + //NvDlaDebugPrintf("NvDlaBitBinaryTree::construct called %u levels\n", numLevels); + if (!self || numLevels == 0 || numLevels > 31) + { + ORIGINATE_ERROR(NvDlaError_BadParameter); + } + + self->numLevels = numLevels; + NvU32 numElements = 0; + + for (NvU8 ii = 0; ii < numLevels; ii++) + { + numElements += pow2i(ii); + } + + //NvDlaDebugPrintf("BinaryBitTree(%u levels, %u elements) ", numLevels, numElements); + + // Calculate number of bytes required + NvU32 numBytes = roundUp(numElements, 8) / 8; + + //NvDlaDebugPrintf("=> %uB\n", numBytes); + + self->treeStorage = (NvU8*)malloc(numBytes); + if (!self->treeStorage) + { + ORIGINATE_ERROR(NvDlaError_InsufficientMemory); + } + + memset(self->treeStorage, 0, numBytes); + + return NvDlaSuccess; +} + +static NvDlaError destruct(NvDlaBitBinaryTreeInst* self) +{ + //NvDlaDebugPrintf("NvDlaBitBinaryTree::destruct called\n"); + if (!self) + { + ORIGINATE_ERROR(NvDlaError_BadParameter); + } + + free(self->treeStorage); + + return NvDlaSuccess; +} + +static bool get(const NvDlaBitBinaryTreeInst* self, NvU8 level, NvU32 index) +{ + //NvDlaDebugPrintf("get called %u level %u index\n", level, index); + NvU32 bitAddr = (pow2i(level) - 1) + index; + + NvU32 byteAddr = bitAddr / 8; + NvU8 byteMask = 1 << (bitAddr % 8); + + NvU8 value = self->treeStorage[byteAddr] & byteMask; + + return value > 0 ? true : false; +} + +static void set(NvDlaBitBinaryTreeInst* self, NvU8 level, NvU32 index, bool value) +{ + //NvDlaDebugPrintf("set called %u level %u index %u value\n", level, index, value); + NvU32 bitAddr = (pow2i(level) - 1) + index; + + NvU32 byteAddr = bitAddr / 8; + NvU8 byteMask = 1 << (bitAddr % 8); + + if (value) + { + self->treeStorage[byteAddr] |= byteMask; + } + else + { + self->treeStorage[byteAddr] &= ~byteMask; + } +} + +static bool flip(NvDlaBitBinaryTreeInst* self, NvU8 level, NvU32 index) +{ + //NvDlaDebugPrintf("flip called %u level %u index\n", level, index); + NvU32 bitAddr = (pow2i(level) - 1) + index; + + NvU32 byteAddr = bitAddr / 8; + NvU8 byteMask = 1 << (bitAddr % 8); + + NvU8 value = self->treeStorage[byteAddr] & byteMask; + + if (value > 0) + { + self->treeStorage[byteAddr] &= ~byteMask; + } + else + { + self->treeStorage[byteAddr] |= byteMask; + } + + return value > 0 ? false : true; +} + +static NvDlaError print(const NvDlaBitBinaryTreeInst* self) +{ + if (!self) + { + ORIGINATE_ERROR(NvDlaError_BadParameter); + } + + for (NvU8 level = 0; level < self->numLevels; level++) + { + NvU32 numElements = pow2i(level); + + NvDlaDebugPrintf("Level %d ", level); + NvDlaDebugPrintf("["); + for (NvU32 ii = 0; ii < numElements; ii++) + { + bool value = get(self, level, ii); + if (value) + { + NvDlaDebugPrintf("1"); + } + else + { + NvDlaDebugPrintf("0"); + } + + NvU8 numLevels = self->numLevels; + + NvU32 numSpaces = pow2i(numLevels - level) - 1; + for (NvU32 jj = 0; jj < numSpaces; jj++) + { + NvDlaDebugPrintf(" "); + } + } + NvDlaDebugPrintf("]\n"); + } + + return NvDlaSuccess; +} + +const NvDlaBitBinaryTreeClass NvDlaBitBinaryTree = +{ + .construct = construct, + .destruct = destruct, + + .get = get, + .set = set, + .flip = flip, + .print = print, +}; diff --git a/umd/utils/BuddyAlloc.c b/umd/utils/BuddyAlloc.c new file mode 100644 index 00000000..784f88aa --- /dev/null +++ b/umd/utils/BuddyAlloc.c @@ -0,0 +1,637 @@ +/* + * Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +// Common includes +#include +#include + +// File includes +#include // malloc + +#include "dlaerror.h" +#include "dlatypes.h" +#include "nvdla_os_inf.h" // NvDlaDebugPrintf +#include "BuddyAlloc.h" +#include "ErrorMacros.h" + +#define GENERIC_MAX(x, y) ((x) > (y) ? (x) : (y)) + +#if 0 +#define LOGD(...) \ + NvDlaDebugPrintf(__VA_ARGS__) +#else +#define LOGD(...) +#endif + +#if 0 +#define LOGV(...) \ + NvDlaDebugPrintf(__VA_ARGS__) +#else +#define LOGV(...) +#endif + + +static inline NvU32 log2i(const NvU32 x) +{ +#if defined(__i386__) || defined(__x86_64__) + NvU32 y; + __asm__ ( "\tbsr %1, %0\n" + : "=r"(y) + : "r" (x) + ); + return y; +#else + NvU32 v = x; // 32-bit value to find the log2 of + const NvU32 b[] = {0x2, 0xC, 0xF0, 0xFF00, 0xFFFF0000}; + const NvU32 S[] = {1, 2, 4, 8, 16}; + NvS32 i; + + register NvU32 r = 0; // result of log2(v) will go here + for (i = 4; i >= 0; i--) // unroll for speed... + { + if (v & b[i]) + { + v >>= S[i]; + r |= S[i]; + } + } + + return r; +#endif +} + +static inline bool isPowerOfTwo(const NvU64 x) +{ + return (x && !(x & (x - 1))); +} + +static inline NvU8 getNumLevels(const NvDlaBuddyAllocInst* self) +{ + return self->maxElementSizeLog2 - self->minElementSizeLog2 + 1; +} + +static inline NvU32 getBlockBytesFromLevel(const NvDlaBuddyAllocInst* self, NvU8 level) +{ + return 1 << (self->maxElementSizeLog2 - level); +} + +static inline NvU32 getIndexFromAddrLevel(const NvDlaBuddyAllocInst* self, NvU32 addr, NvU8 level) +{ + return addr >> (self->maxElementSizeLog2 - level); +} + +static inline NvU32 getAddrFromLevelIndex(const NvDlaBuddyAllocInst* self, NvU8 level, NvU32 index) +{ + NvU32 blockBytes = getBlockBytesFromLevel(self, level); + + return blockBytes * index; +} + +static inline NvU8 getBlockLevelFromNumBytesLog2(const NvDlaBuddyAllocInst* self, NvU8 numBytesLog2) +{ + return self->maxElementSizeLog2 - numBytesLog2; +} + +static NvU8 getBlockLevelFromAddr(const NvDlaBuddyAllocInst* self, NvUPtr addr) +{ + // Transform address to binary tree representation + NvU8 level = getNumLevels(self) - 1; + + while (level > 0) + { + NvU32 index = getIndexFromAddrLevel(self, addr, level - 1); + + if (NvDlaBitBinaryTree.get(self->splitData, level - 1, index)) + { + return level; + } + + level = level - 1; + } + + return 0; +} + +static void printFreeList(const NvDlaBuddyAllocInst* self) +{ + for (NvU32 ii=0; iifreeHead[ii]; + LOGV("freeHead[%u] = ", ii); + + if (tmp) + { + if (tmp->prev) + { + LOGV("[0x%x] ", (NvUPtr)tmp->prev); + + } else { + LOGV("[NULL] "); + } + } + + while (tmp) + { + LOGV("0x%x ", (NvUPtr)tmp); + tmp = tmp->next; + } + + LOGV("NULL\n"); + } +} + +static NvDlaError construct(NvDlaBuddyAllocInst* self, + const void* poolData, NvU32 poolSize, + NvU8 minElementSizeLog2) +{ + LOGD("NvDlaBuddyAlloc::construct called\n"); + NVDLA_UNUSED(&printFreeList); + + if (!self || !poolData || + !isPowerOfTwo(poolSize) || + poolSize < ((NvU64)(1LLU<poolData = poolData; + self->poolSize = poolSize; + self->maxElementSizeLog2 = poolSizeLog2; + self->minElementSizeLog2 = minElementSizeLog2; + + // Initialize buddy list + self->freeHead[0] = (NvDlaFreeBlock*)poolData; + self->freeHead[0]->prev = NULL; + self->freeHead[0]->next = NULL; + + for (NvU8 ii = 1; ii < NVDLA_UTILS_BUDDY_ALLOC_MAX_NUM_BLOCKTYPE; ii++) + { + self->freeHead[ii] = NULL; + } + + self->splitData = NULL; + self->fxfData = NULL; + + NvU8 numLevels = getNumLevels(self); + + if (numLevels > 1) + { + self->splitData = (NvDlaBitBinaryTreeInst*)malloc(sizeof(*self->splitData)); + NvDlaBitBinaryTree.construct(self->splitData, numLevels - 1); + + self->fxfData = (NvDlaBitBinaryTreeInst*)malloc(sizeof(*self->fxfData)); + NvDlaBitBinaryTree.construct(self->fxfData, numLevels - 1); + + //self->allocData = (NvDlaBitBinaryTree*)malloc(sizeof(NvDlaBitBinaryTree)); + //*self->allocData = NvDlaBitBinaryTreeStatic; + //self->allocData->construct(self->allocData, numLevels); + } + + return NvDlaSuccess; +} + +static NvDlaError destruct(NvDlaBuddyAllocInst* self) +{ + LOGD("NvDlaBuddyAlloc::destruct called\n"); + + if (!self) + { + ORIGINATE_ERROR(NvDlaError_BadParameter); + } + + if (self->fxfData) + { + NvDlaBitBinaryTree.destruct(self->fxfData); + free(self->fxfData); + } + + if (self->splitData) + { + NvDlaBitBinaryTree.destruct(self->splitData); + free(self->splitData); + } + + return NvDlaSuccess; +} + + +static void borrowFromBuddy(NvDlaBuddyAllocInst* self, NvU8 level) +{ + NvU32 blockBytesLevel = getBlockBytesFromLevel(self, level); + NVDLA_UNUSED(blockBytesLevel); + LOGV("%uB block trying to borrow from buddy\n", blockBytesLevel); + + if (level == 0) + { + LOGV("Already at root buddy\n"); + return; + } + + NvU32 buddyLevel = level - 1; + if (self->freeHead[buddyLevel] == NULL) + { + // No available buddy, ask buddy to also borrow + borrowFromBuddy(self, buddyLevel); + } + + // Check for buddy availability again + if (self->freeHead[buddyLevel] == NULL) + { + // Still no available buddy, give up + LOGV("No available buddy, giving up\n"); + return; + } + + NvU32 blockBytesBuddyLevel = getBlockBytesFromLevel(self, buddyLevel); + NVDLA_UNUSED(blockBytesBuddyLevel); + LOGV("%uB block borrowing from buddy %uB block\n", blockBytesLevel, blockBytesBuddyLevel); + + // Reference the free blocks + NvDlaFreeBlock* freeBlock0 = self->freeHead[buddyLevel]; + NvDlaFreeBlock* freeBlock1 = (NvDlaFreeBlock*)(((NvUPtr)freeBlock0) + getBlockBytesFromLevel(self, level)); + + // Transform buddy address to binary tree representation + NvU32 buddyAddr = (NvU32)((NvUPtr)self->freeHead[buddyLevel] - (NvUPtr)self->poolData); + LOGV("buddyAddr = 0x%x\n", buddyAddr); + + NvU32 buddyIndex = getIndexFromAddrLevel(self, buddyAddr, buddyLevel); + + // Mark buddy block as split + NvDlaBitBinaryTree.set(self->splitData, buddyLevel, buddyIndex, true); + //splitData->print(); + + // Remove free block from buddy + if (self->freeHead[buddyLevel]->next) + { + self->freeHead[buddyLevel]->next->prev = self->freeHead[buddyLevel]->prev; + } + self->freeHead[buddyLevel] = self->freeHead[buddyLevel]->next; + + // Split the block and save both blocks here (the free list should already be empty) + freeBlock1->prev = freeBlock0; + freeBlock1->next = NULL; + freeBlock0->prev = NULL; + freeBlock0->next = freeBlock1; + self->freeHead[level] = freeBlock0; + + // Mark buddy as allocated + if (buddyLevel > 0) + { + NvU32 buddyParentLevel = buddyLevel - 1; + NvU32 buddyParentIndex = getIndexFromAddrLevel(self, buddyAddr, buddyParentLevel); + + NvDlaBitBinaryTree.flip(self->fxfData, buddyParentLevel, buddyParentIndex); + } + + //printFreeList(self); + + // Update alloc debug info + //self->allocData->set(self->allocData, buddyLevel, buddyIndex, true); +} + +static void* allocate(NvDlaBuddyAllocInst* self, NvU32 size) +{ + LOGV("NvDlaBuddyAlloc::allocate(%uB)\n", size); + + // Round numBytes up to the nearest power-of-two + NvU8 allocNumBytesLog2 = log2i(size); + if (!isPowerOfTwo(size)) + { + allocNumBytesLog2 = allocNumBytesLog2 + 1; + } + + // Clamp to legal min element value + allocNumBytesLog2 = GENERIC_MAX(allocNumBytesLog2, self->minElementSizeLog2); + + void* myPointer = NULL; + + // convert allocNumBytesLog2 into FreeHead level + NvU8 level = getBlockLevelFromNumBytesLog2(self, allocNumBytesLog2); + + // Requested allocation greater than max element value + if (allocNumBytesLog2 > self->maxElementSizeLog2) + { + LOGD("Request size too large\n"); + goto fail; + } + + if (self->freeHead[level] == NULL) + { + borrowFromBuddy(self, level); + } + else + { + LOGV("Easy Allocation!\n"); + //easyAllocations = easyAllocations + 1; + } + + // Vanilla allocate attempt + if (self->freeHead[level] != NULL) + { + // We have an available free block + myPointer = self->freeHead[level]; + + if (self->freeHead[level]->next != NULL) + { + self->freeHead[level]->next->prev = self->freeHead[level]->prev; + } + + self->freeHead[level] = self->freeHead[level]->next; + + LOGV("Free block is available\n"); + } + else + { + NvU32 blockBytes = getBlockBytesFromLevel(self, level); + NVDLA_UNUSED(blockBytes); + LOGV("No free %uB block available\n", blockBytes); + goto fail; + } + + NvUPtr allocAddr = 0; + if (myPointer != NULL) + { + allocAddr = (NvUPtr)myPointer - (NvUPtr)self->poolData; + + // Update fxfData binary tree + if (level == 0) + { + // Root has no buddies to a^b + } + else + { + NvU32 buddyLevel = level - 1; + + // Transform address to binary tree representation + NvU32 buddyIndex = getIndexFromAddrLevel(self, allocAddr, buddyLevel); + + // Mark block as allocated, flip freeA ^ freeB bit + NvDlaBitBinaryTree.flip(self->fxfData, buddyLevel, buddyIndex); + //printf( "fxfData\n" ); + //self->fxfData->print(self->fxfData); + } + + // Update alloc debug info + //self->allocData->set(self->allocData, level, getIndexFromAddrLevel(self, allocAddr, level), true); + //printf( "allocData\n" ); + //self->allocData->print(self->allocData); + } + else + { + goto fail; + } + + LOGD("NvDlaBuddyAlloc::allocate(%uB) => SUCCESS [0x%x:0x%x] (%uB)\n", size, (NvUPtr)myPointer, allocAddr, 1 << allocNumBytesLog2); + //printFreeList(self); + return myPointer; + + +fail: + LOGD("NvDlaBuddyAlloc::allocate(%uB) => FAILED\n", size); + return NULL; +} + +static NvDlaError reclaimFromPartners(NvDlaBuddyAllocInst* self, NvU32 addr, NvU8 level) +{ + LOGV("reclaimFromPartners 0x%x %u\n", addr, level); + + NvU32 index = getIndexFromAddrLevel(self, addr, level); + NvU8 partnerLevel = level + 1; + NvU32 partner0Index = getIndexFromAddrLevel(self, addr, partnerLevel); + NvU32 partner1Index = 0; + + // Sort partner 0 and 1 + if (partner0Index % 2) + { + partner0Index = partner0Index - 1; + } + partner1Index = partner0Index + 1; + + LOGV("partnerIndex0 %d\n", partner0Index); + LOGV("partnerIndex1 %d\n", partner1Index); + + // Clear split status bit + NvDlaBitBinaryTree.set(self->splitData, level, index, false); + + LOGV("Reclaiming 0x%x for level %d\n", addr, level); + NvU32 partner0Addr = getAddrFromLevelIndex(self, partnerLevel, partner0Index); + NvU32 partner1Addr = getAddrFromLevelIndex(self, partnerLevel, partner1Index); + + // Remove partners from their free lists + NvUPtr partner0Pointer = (NvUPtr)self->poolData + partner0Addr; + NvUPtr partner1Pointer = (NvUPtr)self->poolData + partner1Addr; + LOGV("Request to remove partner0 0x%x:0x%x\n", partner0Pointer, partner0Addr); + LOGV("Request to remove partner1 0x%x:0x%x\n", partner1Pointer, partner1Addr); + + LOGV("Removing partner0..."); + + NvDlaFreeBlock* temp = (NvDlaFreeBlock*)partner0Pointer; + + if (self->freeHead[partnerLevel] == temp) + { + self->freeHead[partnerLevel] = self->freeHead[partnerLevel]->next; + } + + // Remove partner0 from the free list + if (temp->prev != NULL) + { + temp->prev->next = temp->next; + } + if (temp->next != NULL) + { + temp->next->prev = temp->prev; + } + + LOGV("Done\n"); + + LOGV("Removing partner1..."); + + temp = (NvDlaFreeBlock*)partner1Pointer; + + if (self->freeHead[partnerLevel] == temp) + { + self->freeHead[partnerLevel] = self->freeHead[partnerLevel]->next; + } + + // Remove partner1 from the free list + if (temp->prev != NULL) + { + temp->prev->next = temp->next; + } + if (temp->next != NULL) + { + temp->next->prev = temp->prev; + } + + LOGV("Done\n"); + + // Reclaim the block + NvUPtr myPointer = (NvUPtr)self->poolData + partner0Addr; + + NvDlaFreeBlock* freeBlockPtr = (NvDlaFreeBlock*)myPointer; + freeBlockPtr->prev = NULL; + freeBlockPtr->next = self->freeHead[level]; + if (self->freeHead[level] != NULL) + { + self->freeHead[level]->prev = freeBlockPtr; + } + self->freeHead[level] = freeBlockPtr; + + // Mark self as free + if (level > 0) + { + NvU32 buddyLevel = level - 1; + NvU32 buddyIndex = getIndexFromAddrLevel(self, addr, buddyLevel); + + NvDlaBitBinaryTree.flip(self->fxfData, buddyLevel, buddyIndex); + } + + // Update alloc debug info + //self->allocData->set(self->allocData, level, getIndexFromAddrLevel(self, addr, level), false); + + return NvDlaSuccess; +} + +static NvDlaError deallocate(NvDlaBuddyAllocInst* self, void* ptr) +{ + NvDlaError e; + + LOGV("NvDlaBuddyAlloc::deallocate([0x%x", (NvUPtr)ptr); + if (!self || !ptr) + { + LOGV("])\n"); + ORIGINATE_ERROR_FAIL(NvDlaError_BadParameter); + } + + NvUPtr deallocAddr = (NvUPtr)ptr - (NvUPtr)self->poolData; + + // Determine the size of the block + NvU8 level = getBlockLevelFromAddr(self, deallocAddr); + + NvU32 blockBytes = getBlockBytesFromLevel(self, level); + NVDLA_UNUSED(blockBytes); + LOGV(":0x%x]) (%uB)\n", deallocAddr, blockBytes); + + // Vanilla deallocate attempt + NvDlaFreeBlock* freeBlockPtr = (NvDlaFreeBlock*)ptr; + if (self->freeHead[level] != NULL) + { + freeBlockPtr->prev = NULL; + freeBlockPtr->next = self->freeHead[level]; + self->freeHead[level]->prev = freeBlockPtr; + } else { + freeBlockPtr->prev = NULL; + freeBlockPtr->next = NULL; + } + + self->freeHead[level] = freeBlockPtr; + + // Update fxfData binary tree + if (level == 0) + { + // Root has no buddies to a^b + } + else + { + NvU8 buddyLevel = level - 1; + + // Transform address to binary tree representation + NvU32 buddyIndex = getIndexFromAddrLevel(self, deallocAddr, buddyLevel); + + // Mark block as allocated, flip freeA ^ freeB bit + NvDlaBitBinaryTree.flip(self->fxfData, buddyLevel, buddyIndex); + //printf( "fxfData\n" ); + //fxfData->print(); + } + + // Update alloc debug info + //self->allocData->set(self->allocData, level, getIndexFromAddrLevel(self, deallocAddr, level), false); + //printf("allocData\n"); + //self->allocData->print(self->allocData); + + NvU8 myLevel = level; + + while (myLevel > 0) + { + LOGV("myLevel is %u\n", myLevel); + // Is our partner block free? + if (myLevel == 0) + { + // We have no partner blocks + break; + } + else + { + NvU8 buddyLevel = myLevel - 1; + NvU32 buddyIndex = getIndexFromAddrLevel(self, deallocAddr, buddyLevel); + + if (NvDlaBitBinaryTree.get(self->fxfData, buddyLevel, buddyIndex)) + { + // Partner block is not free + break; + } + else + { + // Partner block is also free, attempt to merge blocks + PROPAGATE_ERROR_FAIL(reclaimFromPartners(self, deallocAddr, buddyLevel)); + + // Continue to check if our buddy wants to reclaim as well + myLevel = buddyLevel; + + // Print alloc debug info + //printf( "allocData\n" ); + //self->allocData->print(self->allocData); + } + } + } + + //printf("allocData\n"); + //self->allocData->print(self->allocData); + LOGD("NvDlaBuddyAlloc::deallocate([0x%x:0x%x]) => SUCCESS\n", (NvUPtr)ptr, deallocAddr); + //printFreeList(self); + return NvDlaSuccess; + +fail: + LOGD("NvDlaBuddyAlloc::deallocate([0x%x:0x%x]) (%uB) => FAILED\n", (NvUPtr)ptr, deallocAddr, blockBytes); + return e; +} + +const NvDlaBuddyAllocClass NvDlaBuddyAlloc = +{ + .construct = construct, + .destruct = destruct, + + .allocate = allocate, + .deallocate = deallocate, +}; diff --git a/umd/utils/ErrorLogging.c b/umd/utils/ErrorLogging.c new file mode 100644 index 00000000..397f31f2 --- /dev/null +++ b/umd/utils/ErrorLogging.c @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2015-2019, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of NVIDIA CORPORATION 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 ``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. + */ + +#include "ErrorMacros.h" + +#include +#include +#include + +#include "nvdla_os_inf.h" + +const char* NvDlaUtilsGetNvErrorString(NvDlaError e) +{ + return NULL; +} + +/** + * The default error logging function to use when NVDLA_UTILS_ERROR_TAG is defined. + */ +#if defined (NVDLA_UTILS_ERROR_TAG) +void NvDlaUtilsLogError(const char* tag, const char* path, NvDlaError e, const char* file, const char* func, + uint32_t line, bool propagating, const char* format, ...) +{ + static const uint32_t MAX_LENGTH = 1024; + + char msg[MAX_LENGTH]; + char *cur = msg; + + // Remove the leading file path. + if (strstr(file, path)) + file = strstr(file, path) + strlen(path); + + // Use the error string if found, otherwise just use the raw error code. + const char* errorString = NvDlaUtilsGetNvErrorString(e); + if (errorString) + cur += snprintf(cur, msg + sizeof(msg) - cur, "(%s) Error %s:", tag, errorString); + else + cur += snprintf(cur, msg + sizeof(msg) - cur, "(%s) Error 0x%08x:", tag, e); + + // Append the error message. + if (format) + { + cur += snprintf(cur, msg + sizeof(msg) - cur, " "); + + va_list args; + va_start(args, format); + cur += vsnprintf(cur, msg + sizeof(msg) - cur, format, args); + va_end(args); + } + + // Append the error location. + if (propagating) + cur += snprintf(cur, msg + sizeof(msg) - cur, " (propagating from "); + else + cur += snprintf(cur, msg + sizeof(msg) - cur, " (in "); + snprintf(cur, msg + sizeof(msg) - cur, "%s, function %s(), line %d)", file, func, line); + + // Output the error. + NvDlaDebugPrintf("%s\n", msg); +} +#endif // defined(NVDLA_UTILS_ERROR_TAG) diff --git a/umd/utils/calibdata/calib_txt_to_json.py b/umd/utils/calibdata/calib_txt_to_json.py new file mode 100644 index 00000000..7daeba38 --- /dev/null +++ b/umd/utils/calibdata/calib_txt_to_json.py @@ -0,0 +1,72 @@ +#!/usr/bin/env python3 + +## + # Copyright (c) 2019 NVIDIA Corporation. All rights reserved. + # + # NVIDIA Corporation and its licensors retain all intellectual property + # and proprietary rights in and to this software, related documentation + # and any modifications thereto. Any use, reproduction, disclosure or + # distribution of this software and related documentation without an express + # license agreement from NVIDIA Corporation is strictly prohibited. +## + +import struct +import json +import sys +from collections import OrderedDict +import logging + +namemaps = [] + +def read_calibtable_txt2json(calib_file): + logging.info("calibration input txt: %s" % (calib_file,)) + root = OrderedDict() + index_name = 0 + index_val = 1 + with open(calib_file) as calibtxt: + for line in calibtxt: + + line = line.strip() + logging.debug("") + logging.debug(">> %s" % line) + + # colon delimited + fields = line.split(':') + logging.debug(fields) + if len(fields) != 2: + logging.debug("...skipping") + continue + + layername = fields[index_name].strip() + float_hex = fields[index_val].strip() + float_val = struct.unpack('>f', float_hex.decode("hex"))[0] + logging.debug("%s: %s", layername, float_val) + + vald = OrderedDict() + vald['scale'] = float_val + vald['min'] = 0 + vald['max'] = 0 + vald['offset'] = 0 + root[layername] = vald + return root + +def dump_json(json_root, json_file): + logging.info("calibration output json: %s" % (json_file,)) + json_str = json.dumps(json_root, indent=4) + with open(json_file, 'w') as fp: + fp.write(json_str); + logging.debug(json_str) + +if __name__ == "__main__": + logging.basicConfig( + format='%(levelname)s: %(message)s', + level=logging.INFO) + #level=logging.DEBUG) + if len(sys.argv) != 3: + print "usage: calib_txt_to_json.py input_calib_txt output_calib_json" + exit(1); + calib_file = sys.argv[1] + json_file = sys.argv[2] + json_data = read_calibtable_txt2json(calib_file) + dump_json(json_data, json_file) + diff --git a/umd/utils/calibdata/resnet50.json b/umd/utils/calibdata/resnet50.json new file mode 100644 index 00000000..b3e0dbfd --- /dev/null +++ b/umd/utils/calibdata/resnet50.json @@ -0,0 +1,1376 @@ +{ + "data": { + "scale": 1.1892666816711426, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 0) [Convolution]_output": { + "scale": 6.530066967010498, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 1) [Scale]_output": { + "scale": 0.10154115408658981, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 2) [Scale]_output": { + "scale": 0.08912137895822525, + "min": 0, + "max": 0, + "offset": 0 + }, + "conv1": { + "scale": 0.08912137895822525, + "min": 0, + "max": 0, + "offset": 0 + }, + "pool1": { + "scale": 0.08912137895822525, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 5) [Convolution]_output": { + "scale": 0.1622725874185562, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 6) [Scale]_output": { + "scale": 0.06544797867536545, + "min": 0, + "max": 0, + "offset": 0 + }, + "res2a_branch1": { + "scale": 0.11954623460769653, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 8) [Convolution]_output": { + "scale": 0.14947058260440826, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 9) [Scale]_output": { + "scale": 0.08705271780490875, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 10) [Scale]_output": { + "scale": 0.12335167825222015, + "min": 0, + "max": 0, + "offset": 0 + }, + "res2a_branch2a": { + "scale": 0.06775594502687454, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 12) [Convolution]_output": { + "scale": 0.09759176522493362, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 13) [Scale]_output": { + "scale": 0.07662761956453323, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 14) [Scale]_output": { + "scale": 0.09621984511613846, + "min": 0, + "max": 0, + "offset": 0 + }, + "res2a_branch2b": { + "scale": 0.09678556025028229, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 16) [Convolution]_output": { + "scale": 0.04290047660470009, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 17) [Scale]_output": { + "scale": 0.06223507225513458, + "min": 0, + "max": 0, + "offset": 0 + }, + "res2a_branch2c": { + "scale": 0.07257778942584991, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 19) [ElementWise]_output": { + "scale": 0.12937262654304504, + "min": 0, + "max": 0, + "offset": 0 + }, + "res2a": { + "scale": 0.09847443550825119, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 21) [Convolution]_output": { + "scale": 0.07893124967813492, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 22) [Scale]_output": { + "scale": 0.06537651270627975, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 23) [Scale]_output": { + "scale": 0.09749626368284225, + "min": 0, + "max": 0, + "offset": 0 + }, + "res2b_branch2a": { + "scale": 0.07389650493860245, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 25) [Convolution]_output": { + "scale": 0.05371924862265587, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 26) [Scale]_output": { + "scale": 0.06582987308502197, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 27) [Scale]_output": { + "scale": 0.07440046966075897, + "min": 0, + "max": 0, + "offset": 0 + }, + "res2b_branch2b": { + "scale": 0.07082346081733704, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 29) [Convolution]_output": { + "scale": 0.020119747146964073, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 30) [Scale]_output": { + "scale": 0.0830288901925087, + "min": 0, + "max": 0, + "offset": 0 + }, + "res2b_branch2c": { + "scale": 0.056553132832050323, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 32) [ElementWise]_output": { + "scale": 0.08835902810096741, + "min": 0, + "max": 0, + "offset": 0 + }, + "res2b": { + "scale": 0.0980917364358902, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 34) [Convolution]_output": { + "scale": 0.07630462199449539, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 35) [Scale]_output": { + "scale": 0.057323750108480453, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 36) [Scale]_output": { + "scale": 0.08291234076023102, + "min": 0, + "max": 0, + "offset": 0 + }, + "res2c_branch2a": { + "scale": 0.06333382427692413, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 38) [Convolution]_output": { + "scale": 0.047480762004852295, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 39) [Scale]_output": { + "scale": 0.06038884446024895, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 40) [Scale]_output": { + "scale": 0.08928743004798889, + "min": 0, + "max": 0, + "offset": 0 + }, + "res2c_branch2b": { + "scale": 0.08928743004798889, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 42) [Convolution]_output": { + "scale": 0.02570602484047413, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 43) [Scale]_output": { + "scale": 0.06423699855804443, + "min": 0, + "max": 0, + "offset": 0 + }, + "res2c_branch2c": { + "scale": 0.04844983294606209, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 45) [ElementWise]_output": { + "scale": 0.0964774638414383, + "min": 0, + "max": 0, + "offset": 0 + }, + "res2c": { + "scale": 0.09678252786397934, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 47) [Convolution]_output": { + "scale": 0.06110835447907448, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 48) [Scale]_output": { + "scale": 0.056991349905729294, + "min": 0, + "max": 0, + "offset": 0 + }, + "res3a_branch1": { + "scale": 0.0918654128909111, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 50) [Convolution]_output": { + "scale": 0.06927043199539185, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 51) [Scale]_output": { + "scale": 0.06256631761789322, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 52) [Scale]_output": { + "scale": 0.07401362806558609, + "min": 0, + "max": 0, + "offset": 0 + }, + "res3a_branch2a": { + "scale": 0.0688948705792427, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 54) [Convolution]_output": { + "scale": 0.07337787002325058, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 55) [Scale]_output": { + "scale": 0.05772147700190544, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 56) [Scale]_output": { + "scale": 0.08060514181852341, + "min": 0, + "max": 0, + "offset": 0 + }, + "res3a_branch2b": { + "scale": 0.0591665655374527, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 58) [Convolution]_output": { + "scale": 0.02343173883855343, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 59) [Scale]_output": { + "scale": 0.05596625432372093, + "min": 0, + "max": 0, + "offset": 0 + }, + "res3a_branch2c": { + "scale": 0.09847981482744217, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 61) [ElementWise]_output": { + "scale": 0.12294833362102509, + "min": 0, + "max": 0, + "offset": 0 + }, + "res3a": { + "scale": 0.11204986274242401, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 63) [Convolution]_output": { + "scale": 0.0640440508723259, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 64) [Scale]_output": { + "scale": 0.05753196403384209, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 65) [Scale]_output": { + "scale": 0.05988924205303192, + "min": 0, + "max": 0, + "offset": 0 + }, + "res3b_branch2a": { + "scale": 0.055613983422517776, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 67) [Convolution]_output": { + "scale": 0.0372556708753109, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 68) [Scale]_output": { + "scale": 0.054906364530324936, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 69) [Scale]_output": { + "scale": 0.07962044328451157, + "min": 0, + "max": 0, + "offset": 0 + }, + "res3b_branch2b": { + "scale": 0.0683821588754654, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 71) [Convolution]_output": { + "scale": 0.013726117089390755, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 72) [Scale]_output": { + "scale": 0.0511939637362957, + "min": 0, + "max": 0, + "offset": 0 + }, + "res3b_branch2c": { + "scale": 0.050069987773895264, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 74) [ElementWise]_output": { + "scale": 0.08551886677742004, + "min": 0, + "max": 0, + "offset": 0 + }, + "res3b": { + "scale": 0.08551886677742004, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 76) [Convolution]_output": { + "scale": 0.08718874305486679, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 77) [Scale]_output": { + "scale": 0.06293842941522598, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 78) [Scale]_output": { + "scale": 0.07379148155450821, + "min": 0, + "max": 0, + "offset": 0 + }, + "res3c_branch2a": { + "scale": 0.08555953949689865, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 80) [Convolution]_output": { + "scale": 0.06377585232257843, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 81) [Scale]_output": { + "scale": 0.06883139908313751, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 82) [Scale]_output": { + "scale": 0.08970290422439575, + "min": 0, + "max": 0, + "offset": 0 + }, + "res3c_branch2b": { + "scale": 0.0631943941116333, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 84) [Convolution]_output": { + "scale": 0.021908413618803024, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 85) [Scale]_output": { + "scale": 0.17666171491146088, + "min": 0, + "max": 0, + "offset": 0 + }, + "res3c_branch2c": { + "scale": 0.11109849810600281, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 87) [ElementWise]_output": { + "scale": 0.12127365916967392, + "min": 0, + "max": 0, + "offset": 0 + }, + "res3c": { + "scale": 0.08516602963209152, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 89) [Convolution]_output": { + "scale": 0.07705821096897125, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 90) [Scale]_output": { + "scale": 0.06800369918346405, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 91) [Scale]_output": { + "scale": 0.1048537939786911, + "min": 0, + "max": 0, + "offset": 0 + }, + "res3d_branch2a": { + "scale": 0.09229502826929092, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 93) [Convolution]_output": { + "scale": 0.05846773087978363, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 94) [Scale]_output": { + "scale": 0.06820867210626602, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 95) [Scale]_output": { + "scale": 0.08610943704843521, + "min": 0, + "max": 0, + "offset": 0 + }, + "res3d_branch2b": { + "scale": 0.08969893306493759, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 97) [Convolution]_output": { + "scale": 0.021504491567611694, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 98) [Scale]_output": { + "scale": 0.07901439070701599, + "min": 0, + "max": 0, + "offset": 0 + }, + "res3d_branch2c": { + "scale": 0.0527477003633976, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 100) [ElementWise]_output": { + "scale": 0.11845599114894867, + "min": 0, + "max": 0, + "offset": 0 + }, + "res3d": { + "scale": 0.12229187786579132, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 102) [Convolution]_output": { + "scale": 0.062378447502851486, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 103) [Scale]_output": { + "scale": 0.05794394761323929, + "min": 0, + "max": 0, + "offset": 0 + }, + "res4a_branch1": { + "scale": 0.10385233908891678, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 105) [Convolution]_output": { + "scale": 0.06241574138402939, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 106) [Scale]_output": { + "scale": 0.0653228759765625, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 107) [Scale]_output": { + "scale": 0.07446765899658203, + "min": 0, + "max": 0, + "offset": 0 + }, + "res4a_branch2a": { + "scale": 0.07446765899658203, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 109) [Convolution]_output": { + "scale": 0.10114644467830658, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 110) [Scale]_output": { + "scale": 0.047561053186655045, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 111) [Scale]_output": { + "scale": 0.07352551072835922, + "min": 0, + "max": 0, + "offset": 0 + }, + "res4a_branch2b": { + "scale": 0.057342469692230225, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 113) [Convolution]_output": { + "scale": 0.019311996176838875, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 114) [Scale]_output": { + "scale": 0.06292856484651566, + "min": 0, + "max": 0, + "offset": 0 + }, + "res4a_branch2c": { + "scale": 0.07851208746433258, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 116) [ElementWise]_output": { + "scale": 0.1201726570725441, + "min": 0, + "max": 0, + "offset": 0 + }, + "res4a": { + "scale": 0.11615817993879318, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 118) [Convolution]_output": { + "scale": 0.1020636111497879, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 119) [Scale]_output": { + "scale": 0.05944163724780083, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 120) [Scale]_output": { + "scale": 0.06631634384393692, + "min": 0, + "max": 0, + "offset": 0 + }, + "res4b_branch2a": { + "scale": 0.06690791994333267, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 122) [Convolution]_output": { + "scale": 0.042588017880916595, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 123) [Scale]_output": { + "scale": 0.05697552114725113, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 124) [Scale]_output": { + "scale": 0.07259157299995422, + "min": 0, + "max": 0, + "offset": 0 + }, + "res4b_branch2b": { + "scale": 0.049211423844099045, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 126) [Convolution]_output": { + "scale": 0.015369857661426067, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 127) [Scale]_output": { + "scale": 0.10203637927770615, + "min": 0, + "max": 0, + "offset": 0 + }, + "res4b_branch2c": { + "scale": 0.07522841542959213, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 129) [ElementWise]_output": { + "scale": 0.09624315798282623, + "min": 0, + "max": 0, + "offset": 0 + }, + "res4b": { + "scale": 0.09700760245323181, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 131) [Convolution]_output": { + "scale": 0.0687045156955719, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 132) [Scale]_output": { + "scale": 0.05884663760662079, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 133) [Scale]_output": { + "scale": 0.0640127956867218, + "min": 0, + "max": 0, + "offset": 0 + }, + "res4c_branch2a": { + "scale": 0.0687754899263382, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 135) [Convolution]_output": { + "scale": 0.03364177420735359, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 136) [Scale]_output": { + "scale": 0.05849551409482956, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 137) [Scale]_output": { + "scale": 0.06163341552019119, + "min": 0, + "max": 0, + "offset": 0 + }, + "res4c_branch2b": { + "scale": 0.05358177050948143, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 139) [Convolution]_output": { + "scale": 0.01356083806604147, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 140) [Scale]_output": { + "scale": 0.07975142449140549, + "min": 0, + "max": 0, + "offset": 0 + }, + "res4c_branch2c": { + "scale": 0.06052481755614281, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 142) [ElementWise]_output": { + "scale": 0.09771627932786942, + "min": 0, + "max": 0, + "offset": 0 + }, + "res4c": { + "scale": 0.10090021044015884, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 144) [Convolution]_output": { + "scale": 0.06564440578222275, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 145) [Scale]_output": { + "scale": 0.058878473937511444, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 146) [Scale]_output": { + "scale": 0.07000578939914703, + "min": 0, + "max": 0, + "offset": 0 + }, + "res4d_branch2a": { + "scale": 0.06515974551439285, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 148) [Convolution]_output": { + "scale": 0.03959187492728233, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 149) [Scale]_output": { + "scale": 0.059980008751153946, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 150) [Scale]_output": { + "scale": 0.07127563655376434, + "min": 0, + "max": 0, + "offset": 0 + }, + "res4d_branch2b": { + "scale": 0.07101693004369736, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 152) [Convolution]_output": { + "scale": 0.030017612501978874, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 153) [Scale]_output": { + "scale": 0.18068255484104156, + "min": 0, + "max": 0, + "offset": 0 + }, + "res4d_branch2c": { + "scale": 0.12508144974708557, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 155) [ElementWise]_output": { + "scale": 0.13627120852470398, + "min": 0, + "max": 0, + "offset": 0 + }, + "res4d": { + "scale": 0.09087702631950378, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 157) [Convolution]_output": { + "scale": 0.06978315114974976, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 158) [Scale]_output": { + "scale": 0.06799472868442535, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 159) [Scale]_output": { + "scale": 0.07320103794336319, + "min": 0, + "max": 0, + "offset": 0 + }, + "res4e_branch2a": { + "scale": 0.07559733092784882, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 161) [Convolution]_output": { + "scale": 0.02990233153104782, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 162) [Scale]_output": { + "scale": 0.07083655893802643, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 163) [Scale]_output": { + "scale": 0.08231381326913834, + "min": 0, + "max": 0, + "offset": 0 + }, + "res4e_branch2b": { + "scale": 0.07780347019433975, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 165) [Convolution]_output": { + "scale": 0.03841407224535942, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 166) [Scale]_output": { + "scale": 0.16732531785964966, + "min": 0, + "max": 0, + "offset": 0 + }, + "res4e_branch2c": { + "scale": 0.1250983029603958, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 168) [ElementWise]_output": { + "scale": 0.12518416345119476, + "min": 0, + "max": 0, + "offset": 0 + }, + "res4e": { + "scale": 0.09578414261341095, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 170) [Convolution]_output": { + "scale": 0.0674305334687233, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 171) [Scale]_output": { + "scale": 0.06694090366363525, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 172) [Scale]_output": { + "scale": 0.07630855590105057, + "min": 0, + "max": 0, + "offset": 0 + }, + "res4f_branch2a": { + "scale": 0.07661076635122299, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 174) [Convolution]_output": { + "scale": 0.043497733771800995, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 175) [Scale]_output": { + "scale": 0.08277729153633118, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 176) [Scale]_output": { + "scale": 0.1027178093791008, + "min": 0, + "max": 0, + "offset": 0 + }, + "res4f_branch2b": { + "scale": 0.11880411952733994, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 178) [Convolution]_output": { + "scale": 0.03204292058944702, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 179) [Scale]_output": { + "scale": 0.10214398801326752, + "min": 0, + "max": 0, + "offset": 0 + }, + "res4f_branch2c": { + "scale": 0.07387398183345795, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 181) [ElementWise]_output": { + "scale": 0.11928170919418335, + "min": 0, + "max": 0, + "offset": 0 + }, + "res4f": { + "scale": 0.11974269896745682, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 183) [Convolution]_output": { + "scale": 0.03932074084877968, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 184) [Scale]_output": { + "scale": 0.06550708413124084, + "min": 0, + "max": 0, + "offset": 0 + }, + "res5a_branch1": { + "scale": 0.16776393353939056, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 186) [Convolution]_output": { + "scale": 0.0552973747253418, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 187) [Scale]_output": { + "scale": 0.05912976339459419, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 188) [Scale]_output": { + "scale": 0.06385094672441483, + "min": 0, + "max": 0, + "offset": 0 + }, + "res5a_branch2a": { + "scale": 0.0599994920194149, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 190) [Convolution]_output": { + "scale": 0.042413003742694855, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 191) [Scale]_output": { + "scale": 0.05152537301182747, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 192) [Scale]_output": { + "scale": 0.07050610333681107, + "min": 0, + "max": 0, + "offset": 0 + }, + "res5a_branch2b": { + "scale": 0.04970370605587959, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 194) [Convolution]_output": { + "scale": 0.011437957175076008, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 195) [Scale]_output": { + "scale": 0.05711860954761505, + "min": 0, + "max": 0, + "offset": 0 + }, + "res5a_branch2c": { + "scale": 0.11040966957807541, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 197) [ElementWise]_output": { + "scale": 0.2233041226863861, + "min": 0, + "max": 0, + "offset": 0 + }, + "res5a": { + "scale": 0.23766332864761353, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 199) [Convolution]_output": { + "scale": 0.13342782855033875, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 200) [Scale]_output": { + "scale": 0.05710480362176895, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 201) [Scale]_output": { + "scale": 0.06758549064397812, + "min": 0, + "max": 0, + "offset": 0 + }, + "res5b_branch2a": { + "scale": 0.04794960841536522, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 203) [Convolution]_output": { + "scale": 0.030513694509863853, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 204) [Scale]_output": { + "scale": 0.05892922729253769, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 205) [Scale]_output": { + "scale": 0.07211833447217941, + "min": 0, + "max": 0, + "offset": 0 + }, + "res5b_branch2b": { + "scale": 0.04774565249681473, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 207) [Convolution]_output": { + "scale": 0.00963673647493124, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 208) [Scale]_output": { + "scale": 0.06931557506322861, + "min": 0, + "max": 0, + "offset": 0 + }, + "res5b_branch2c": { + "scale": 0.10190387815237045, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 210) [ElementWise]_output": { + "scale": 0.20928776264190674, + "min": 0, + "max": 0, + "offset": 0 + }, + "res5b": { + "scale": 0.23991525173187256, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 212) [Convolution]_output": { + "scale": 0.14844802021980286, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 213) [Scale]_output": { + "scale": 0.061311136931180954, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 214) [Scale]_output": { + "scale": 0.06339897215366364, + "min": 0, + "max": 0, + "offset": 0 + }, + "res5c_branch2a": { + "scale": 0.053142234683036804, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 216) [Convolution]_output": { + "scale": 0.024154923856258392, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 217) [Scale]_output": { + "scale": 0.06658461689949036, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 218) [Scale]_output": { + "scale": 0.07290826737880707, + "min": 0, + "max": 0, + "offset": 0 + }, + "res5c_branch2b": { + "scale": 0.0626562088727951, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 220) [Convolution]_output": { + "scale": 0.010541917756199837, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 221) [Scale]_output": { + "scale": 0.0991540253162384, + "min": 0, + "max": 0, + "offset": 0 + }, + "res5c_branch2c": { + "scale": 0.14704902470111847, + "min": 0, + "max": 0, + "offset": 0 + }, + "(Unnamed Layer* 223) [ElementWise]_output": { + "scale": 0.2492985725402832, + "min": 0, + "max": 0, + "offset": 0 + }, + "res5c": { + "scale": 0.34255242347717285, + "min": 0, + "max": 0, + "offset": 0 + }, + "pool5": { + "scale": 0.34255242347717285, + "min": 0, + "max": 0, + "offset": 0 + }, + "fc1000": { + "scale": 0.23768144845962524, + "min": 0, + "max": 0, + "offset": 0 + }, + "prob": { + "scale": 0.0009285033447667956, + "min": 0, + "max": 0, + "offset": 0 + } +} diff --git a/umd/utils/calibdata/resnet50.txt b/umd/utils/calibdata/resnet50.txt new file mode 100644 index 00000000..d28b3059 --- /dev/null +++ b/umd/utils/calibdata/resnet50.txt @@ -0,0 +1,230 @@ +TRT-5101-EntropyCalibration2 +data: 3f9839e4 +(Unnamed Layer* 0) [Convolution]_output: 40d0f64f +(Unnamed Layer* 1) [Scale]_output: 3dcff4cf +(Unnamed Layer* 2) [Scale]_output: 3db68545 +conv1: 3db68545 +pool1: 3db68545 +(Unnamed Layer* 5) [Convolution]_output: 3e262ac9 +(Unnamed Layer* 6) [Scale]_output: 3d860997 +res2a_branch1: 3df4d4a8 +(Unnamed Layer* 8) [Convolution]_output: 3e190ed1 +(Unnamed Layer* 9) [Scale]_output: 3db248b2 +(Unnamed Layer* 10) [Scale]_output: 3dfc9fce +res2a_branch2a: 3d8ac3a1 +(Unnamed Layer* 12) [Convolution]_output: 3dc7de31 +(Unnamed Layer* 13) [Scale]_output: 3d9ceef1 +(Unnamed Layer* 14) [Scale]_output: 3dc50ee9 +res2a_branch2b: 3dc63782 +(Unnamed Layer* 16) [Convolution]_output: 3d2fb869 +(Unnamed Layer* 17) [Scale]_output: 3d7eea34 +res2a_branch2c: 3d94a3aa +(Unnamed Layer* 19) [ElementWise]_output: 3e047a42 +res2a: 3dc9acf7 +(Unnamed Layer* 21) [Convolution]_output: 3da1a6b5 +(Unnamed Layer* 22) [Scale]_output: 3d85e41f +(Unnamed Layer* 23) [Scale]_output: 3dc7ac1f +res2b_branch2a: 3d97570d +(Unnamed Layer* 25) [Convolution]_output: 3d5c08b7 +(Unnamed Layer* 26) [Scale]_output: 3d86d1d0 +(Unnamed Layer* 27) [Scale]_output: 3d985f46 +res2b_branch2b: 3d910be4 +(Unnamed Layer* 29) [Convolution]_output: 3ca4d22b +(Unnamed Layer* 30) [Scale]_output: 3daa0b0d +res2b_branch2c: 3d67a442 +(Unnamed Layer* 32) [ElementWise]_output: 3db4f594 +res2b: 3dc8e452 +(Unnamed Layer* 34) [Convolution]_output: 3d9c4599 +(Unnamed Layer* 35) [Scale]_output: 3d6acc4f +(Unnamed Layer* 36) [Scale]_output: 3da9cdf2 +res2c_branch2a: 3d81b52a +(Unnamed Layer* 38) [Convolution]_output: 3d427b30 +(Unnamed Layer* 39) [Scale]_output: 3d775a4b +(Unnamed Layer* 40) [Scale]_output: 3db6dc54 +res2c_branch2b: 3db6dc54 +(Unnamed Layer* 42) [Convolution]_output: 3cd29571 +(Unnamed Layer* 43) [Scale]_output: 3d838eb0 +res2c_branch2c: 3d467355 +(Unnamed Layer* 45) [ElementWise]_output: 3dc595fa +res2c: 3dc635eb +(Unnamed Layer* 47) [Convolution]_output: 3d7a4cc1 +(Unnamed Layer* 48) [Scale]_output: 3d696fc3 +res3a_branch1: 3dbc23ef +(Unnamed Layer* 50) [Convolution]_output: 3d8ddda8 +(Unnamed Layer* 51) [Scale]_output: 3d8022c5 +(Unnamed Layer* 52) [Scale]_output: 3d979475 +res3a_branch2a: 3d8d18c1 +(Unnamed Layer* 54) [Convolution]_output: 3d964723 +(Unnamed Layer* 55) [Scale]_output: 3d6c6d5b +(Unnamed Layer* 56) [Scale]_output: 3da5144f +res3a_branch2b: 3d7258a4 +(Unnamed Layer* 58) [Convolution]_output: 3cbff3eb +(Unnamed Layer* 59) [Scale]_output: 3d653cdf +res3a_branch2c: 3dc9afc9 +(Unnamed Layer* 61) [ElementWise]_output: 3dfbcc56 +res3a: 3de57a66 +(Unnamed Layer* 63) [Convolution]_output: 3d832987 +(Unnamed Layer* 64) [Scale]_output: 3d6ba6a3 +(Unnamed Layer* 65) [Scale]_output: 3d754e6c +res3b_branch2a: 3d63cb7d +(Unnamed Layer* 67) [Convolution]_output: 3d189967 +(Unnamed Layer* 68) [Scale]_output: 3d60e57f +(Unnamed Layer* 69) [Scale]_output: 3da3100b +res3b_branch2b: 3d8c0bf2 +(Unnamed Layer* 71) [Convolution]_output: 3c60e382 +(Unnamed Layer* 72) [Scale]_output: 3d51b0c3 +res3b_branch2c: 3d4d1630 +(Unnamed Layer* 74) [ElementWise]_output: 3daf2484 +res3b: 3daf2484 +(Unnamed Layer* 76) [Convolution]_output: 3db29003 +(Unnamed Layer* 77) [Scale]_output: 3d80e5dd +(Unnamed Layer* 78) [Scale]_output: 3d971ffd +res3c_branch2a: 3daf39d7 +(Unnamed Layer* 80) [Convolution]_output: 3d829cea +(Unnamed Layer* 81) [Scale]_output: 3d8cf77a +(Unnamed Layer* 82) [Scale]_output: 3db7b628 +res3c_branch2b: 3d816c10 +(Unnamed Layer* 84) [Convolution]_output: 3cb37946 +(Unnamed Layer* 85) [Scale]_output: 3e34e6cf +res3c_branch2c: 3de3879c +(Unnamed Layer* 87) [ElementWise]_output: 3df85e53 +res3c: 3dae6b87 +(Unnamed Layer* 89) [Convolution]_output: 3d9dd0b2 +(Unnamed Layer* 90) [Scale]_output: 3d8b4586 +(Unnamed Layer* 91) [Scale]_output: 3dd6bd96 +res3d_branch2a: 3dbd052d +(Unnamed Layer* 93) [Convolution]_output: 3d6f7bdc +(Unnamed Layer* 94) [Scale]_output: 3d8bb0fd +(Unnamed Layer* 95) [Scale]_output: 3db05a25 +res3d_branch2b: 3db7b413 +(Unnamed Layer* 97) [Convolution]_output: 3cb02a30 +(Unnamed Layer* 98) [Scale]_output: 3da1d24c +res3d_branch2c: 3d580df9 +(Unnamed Layer* 100) [ElementWise]_output: 3df2990e +res3d: 3dfa742a +(Unnamed Layer* 102) [Convolution]_output: 3d7f808b +(Unnamed Layer* 103) [Scale]_output: 3d6d56a2 +res4a_branch1: 3dd4b089 +(Unnamed Layer* 105) [Convolution]_output: 3d7fa7a6 +(Unnamed Layer* 106) [Scale]_output: 3d85c800 +(Unnamed Layer* 107) [Scale]_output: 3d988280 +res4a_branch2a: 3d988280 +(Unnamed Layer* 109) [Convolution]_output: 3dcf25de +(Unnamed Layer* 110) [Scale]_output: 3d42cf61 +(Unnamed Layer* 111) [Scale]_output: 3d96948b +res4a_branch2b: 3d6adff0 +(Unnamed Layer* 113) [Convolution]_output: 3c9e3431 +(Unnamed Layer* 114) [Scale]_output: 3d80e0b1 +res4a_branch2c: 3da0caf2 +(Unnamed Layer* 116) [ElementWise]_output: 3df61d15 +res4a: 3dede457 +(Unnamed Layer* 118) [Convolution]_output: 3dd106ba +(Unnamed Layer* 119) [Scale]_output: 3d737913 +(Unnamed Layer* 120) [Scale]_output: 3d87d0dd +res4b_branch2a: 3d890705 +(Unnamed Layer* 122) [Convolution]_output: 3d2e70c6 +(Unnamed Layer* 123) [Scale]_output: 3d695f2a +(Unnamed Layer* 124) [Scale]_output: 3d94aae4 +res4b_branch2b: 3d4991eb +(Unnamed Layer* 126) [Convolution]_output: 3c7bd1db +(Unnamed Layer* 127) [Scale]_output: 3dd0f873 +res4b_branch2c: 3d9a115b +(Unnamed Layer* 129) [ElementWise]_output: 3dc51b22 +res4b: 3dc6abec +(Unnamed Layer* 131) [Convolution]_output: 3d8cb4f4 +(Unnamed Layer* 132) [Scale]_output: 3d71092c +(Unnamed Layer* 133) [Scale]_output: 3d831924 +res4c_branch2a: 3d8cda2a +(Unnamed Layer* 135) [Convolution]_output: 3d09cbf5 +(Unnamed Layer* 136) [Scale]_output: 3d6f98fe +(Unnamed Layer* 137) [Scale]_output: 3d7c7352 +res4c_branch2b: 3d5b788f +(Unnamed Layer* 139) [Convolution]_output: 3c5e2e47 +(Unnamed Layer* 140) [Scale]_output: 3da354b7 +res4c_branch2c: 3d77e8df +(Unnamed Layer* 142) [ElementWise]_output: 3dc81f79 +res4c: 3dcea4c5 +(Unnamed Layer* 144) [Convolution]_output: 3d867093 +(Unnamed Layer* 145) [Scale]_output: 3d712a8e +(Unnamed Layer* 146) [Scale]_output: 3d8f5f32 +res4d_branch2a: 3d857279 +(Unnamed Layer* 148) [Convolution]_output: 3d222b17 +(Unnamed Layer* 149) [Scale]_output: 3d75ad99 +(Unnamed Layer* 150) [Scale]_output: 3d91f8f6 +res4d_branch2b: 3d917153 +(Unnamed Layer* 152) [Convolution]_output: 3cf5e77f +(Unnamed Layer* 153) [Scale]_output: 3e3904d9 +res4d_branch2c: 3e00155a +(Unnamed Layer* 155) [ElementWise]_output: 3e0b8aae +res4d: 3dba1dbc +(Unnamed Layer* 157) [Convolution]_output: 3d8eea78 +(Unnamed Layer* 158) [Scale]_output: 3d8b40d2 +(Unnamed Layer* 159) [Scale]_output: 3d95ea6d +res4e_branch2a: 3d9ad2c6 +(Unnamed Layer* 161) [Convolution]_output: 3cf4f5bc +(Unnamed Layer* 162) [Scale]_output: 3d9112c2 +(Unnamed Layer* 163) [Scale]_output: 3da89425 +res4e_branch2b: 3d9f576d +(Unnamed Layer* 165) [Convolution]_output: 3d1d5813 +(Unnamed Layer* 166) [Scale]_output: 3e2b5754 +res4e_branch2c: 3e0019c5 +(Unnamed Layer* 168) [ElementWise]_output: 3e003047 +res4e: 3dc42a7a +(Unnamed Layer* 170) [Convolution]_output: 3d8a1905 +(Unnamed Layer* 171) [Scale]_output: 3d891850 +(Unnamed Layer* 172) [Scale]_output: 3d9c47a9 +res4f_branch2a: 3d9ce61b +(Unnamed Layer* 174) [Convolution]_output: 3d322aae +(Unnamed Layer* 175) [Scale]_output: 3da98724 +(Unnamed Layer* 176) [Scale]_output: 3dd25db7 +res4f_branch2b: 3df34f93 +(Unnamed Layer* 178) [Convolution]_output: 3d033f70 +(Unnamed Layer* 179) [Scale]_output: 3dd130de +res4f_branch2c: 3d974b3e +(Unnamed Layer* 181) [ElementWise]_output: 3df449f8 +res4f: 3df53ba9 +(Unnamed Layer* 183) [Convolution]_output: 3d210ec9 +(Unnamed Layer* 184) [Scale]_output: 3d862894 +res5a_branch1: 3e2bca4f +(Unnamed Layer* 186) [Convolution]_output: 3d627f80 +(Unnamed Layer* 187) [Scale]_output: 3d72320d +(Unnamed Layer* 188) [Scale]_output: 3d82c449 +res5a_branch2a: 3d75c207 +(Unnamed Layer* 190) [Convolution]_output: 3d2db942 +(Unnamed Layer* 191) [Scale]_output: 3d530c45 +(Unnamed Layer* 192) [Scale]_output: 3d906581 +res5a_branch2b: 3d4b961d +(Unnamed Layer* 194) [Convolution]_output: 3c3b6645 +(Unnamed Layer* 195) [Scale]_output: 3d69f534 +res5a_branch2c: 3de21e77 +(Unnamed Layer* 197) [ElementWise]_output: 3e64a9d6 +res5a: 3e735e04 +(Unnamed Layer* 199) [Convolution]_output: 3e08a14e +(Unnamed Layer* 200) [Scale]_output: 3d69e6ba +(Unnamed Layer* 201) [Scale]_output: 3d8a6a43 +res5b_branch2a: 3d4466cf +(Unnamed Layer* 203) [Convolution]_output: 3cf9f7db +(Unnamed Layer* 204) [Scale]_output: 3d715fc6 +(Unnamed Layer* 205) [Scale]_output: 3d93b2c7 +res5b_branch2b: 3d4390f2 +(Unnamed Layer* 207) [Convolution]_output: 3c1de367 +(Unnamed Layer* 208) [Scale]_output: 3d8df553 +res5b_branch2c: 3dd0b2fb +(Unnamed Layer* 210) [ElementWise]_output: 3e564f88 +res5b: 3e75ac58 +(Unnamed Layer* 212) [Convolution]_output: 3e1802c2 +(Unnamed Layer* 213) [Scale]_output: 3d7b2163 +(Unnamed Layer* 214) [Scale]_output: 3d81d752 +res5c_branch2a: 3d59abac +(Unnamed Layer* 216) [Convolution]_output: 3cc5e08c +(Unnamed Layer* 217) [Scale]_output: 3d885d84 +(Unnamed Layer* 218) [Scale]_output: 3d9550ee +res5c_branch2b: 3d8051e6 +(Unnamed Layer* 220) [Convolution]_output: 3c2cb802 +(Unnamed Layer* 221) [Scale]_output: 3dcb1144 +res5c_branch2c: 3e169405 +(Unnamed Layer* 223) [ElementWise]_output: 3e7f4820 +res5c: 3eaf6308 +pool5: 3eaf6308 +fc1000: 3e7362c4 +prob: 3a7366ce